From 3d85e099e2f6d8f3e831855185c84e3ba03925d1 Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 21 Feb 2012 09:28:07 -0500 Subject: [PATCH 0001/1149] fix a few issues with the spell scripts i made. --- src/server/scripts/Spells/spell_generic.cpp | 14 ++++++-------- src/server/scripts/Spells/spell_item.cpp | 10 ++++------ src/server/scripts/Spells/spell_quest.cpp | 20 +++++++------------- 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 638a17bc4f9..ec82dbc0e57 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1585,19 +1585,17 @@ class spell_gen_spirit_healer_res : public SpellScriptLoader bool Load() { - return GetOriginalCaster()->GetTypeId() == TYPEID_PLAYER; + return GetOriginalCaster() && GetOriginalCaster()->GetTypeId() == TYPEID_PLAYER; } void HandleDummy(SpellEffIndex /* effIndex */) { - if (Player* originalCaster = GetOriginalCaster()->ToPlayer()) + Player* originalCaster = GetOriginalCaster()->ToPlayer(); + if (Unit* target = GetHitUnit()) { - if (Unit* target = GetHitUnit()) - { - WorldPacket data(SMSG_SPIRIT_HEALER_CONFIRM, 8); - data << uint64(target->GetGUID()); - originalCaster->GetSession()->SendPacket(&data); - } + WorldPacket data(SMSG_SPIRIT_HEALER_CONFIRM, 8); + data << uint64(target->GetGUID()); + originalCaster->GetSession()->SendPacket(&data); } } diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 7829587b0ea..4e7b195621a 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1509,7 +1509,7 @@ class spell_item_complete_raptor_capture : public SpellScriptLoader enum ImpaleLeviroth { NPC_LEVIROTH = 26452, - SPELL_LEVIROTH_SELF_IMPALE = 49882 + SPELL_LEVIROTH_SELF_IMPALE = 49882, }; class spell_item_impale_leviroth : public SpellScriptLoader @@ -1530,11 +1530,9 @@ class spell_item_impale_leviroth : public SpellScriptLoader void HandleDummy(SpellEffIndex /* effIndex */) { - Unit* target = GetHitCreature(); - if (!target || target->GetEntry() != NPC_LEVIROTH || !target->HealthBelowPct(95)) - return; - - target->CastSpell(target, SPELL_LEVIROTH_SELF_IMPALE, true); + if (Unit* target = GetHitCreature()) + if (target->GetEntry() == NPC_LEVIROTH && target->HealthBelowPct(95)) + target->CastSpell(target, SPELL_LEVIROTH_SELF_IMPALE, true); } void Register() diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 6de1ffa8376..a581980bf8e 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1025,9 +1025,9 @@ class spell_q14112_14145_chum_the_water: public SpellScriptLoader // http://old01.wowhead.com/quest=9452 - Red Snapper - Very Tasty! enum RedSnapperVeryTasty { - SPELL_CAST_NET = 29866, - ITEM_RED_SNAPPER = 23614, - NPC_ANGRY_MURLOC = 17102, + SPELL_CAST_NET = 29866, + ITEM_RED_SNAPPER = 23614, + SPELL_NEW_SUMMON_TEST = 49214, }; class spell_q9452_cast_net: public SpellScriptLoader @@ -1047,16 +1047,10 @@ class spell_q9452_cast_net: public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { Player* caster = GetCaster()->ToPlayer(); - switch (urand(0, 2)) - { - case 0: case 1: - caster->AddItem(ITEM_RED_SNAPPER, 1); - break; - case 2: - if (Creature* murloc = caster->SummonCreature(NPC_ANGRY_MURLOC, caster->GetPositionX()+5, caster->GetPositionY(), caster->GetPositionZ(), 0.0f, TEMPSUMMON_MANUAL_DESPAWN, 120000)) - murloc->AI()->AttackStart(caster); - break; - } + if (roll_chance_i(66)) + caster->AddItem(ITEM_RED_SNAPPER, 1); + else + caster->CastSpell(caster, SPELL_NEW_SUMMON_TEST, true); } void Register() From 1cac01b3df83b24e90ef101630316836a79ee792 Mon Sep 17 00:00:00 2001 From: Venugh Date: Thu, 23 Feb 2012 11:50:58 +0100 Subject: [PATCH 0002/1149] Core/Movement: Use SetWalk(true/false) instead of AddUnit/RemoveUnit. --- .../game/AI/ScriptedAI/ScriptedEscortAI.cpp | 14 ++--- src/server/game/AI/SmartScripts/SmartAI.cpp | 6 +- .../game/Entities/Creature/CreatureGroups.cpp | 2 +- src/server/game/Entities/Unit/Unit.cpp | 10 ++- src/server/game/Entities/Unit/Unit.h | 1 + .../Deadmines/instance_deadmines.cpp | 2 +- .../Karazhan/boss_nightbane.cpp | 2 +- .../MagistersTerrace/boss_selin_fireheart.cpp | 2 +- .../ScarletEnclave/chapter1.cpp | 4 +- .../ScarletEnclave/chapter2.cpp | 2 +- .../ScarletEnclave/chapter5.cpp | 62 +++++++++---------- .../ScarletEnclave/the_scarlet_enclave.cpp | 2 +- .../EasternKingdoms/ZulAman/boss_janalai.cpp | 2 +- .../EasternKingdoms/ZulAman/boss_nalorakk.cpp | 2 +- .../scripts/EasternKingdoms/ghostlands.cpp | 6 +- .../scripts/EasternKingdoms/hinterlands.cpp | 2 +- .../EasternKingdoms/redridge_mountains.cpp | 4 +- .../EasternKingdoms/stormwind_city.cpp | 2 +- .../BattleForMountHyjal/hyjalAI.cpp | 4 +- .../culling_of_stratholme.cpp | 12 ++-- .../EscapeFromDurnholdeKeep/old_hillsbrad.cpp | 2 +- .../Kalimdor/ZulFarrak/instance_zulfarrak.cpp | 2 +- .../scripts/Kalimdor/ZulFarrak/zulfarrak.cpp | 2 +- .../scripts/Kalimdor/dustwallow_marsh.cpp | 2 +- .../ObsidianSanctum/boss_sartharion.cpp | 2 +- .../RubySanctum/ruby_sanctum.cpp | 2 +- .../trial_of_the_crusader.cpp | 6 +- .../boss_deathbringer_saurfang.cpp | 10 +-- .../boss_professor_putricide.cpp | 4 +- .../IcecrownCitadel/boss_the_lich_king.cpp | 10 +-- .../Naxxramas/boss_four_horsemen.cpp | 2 +- .../Northrend/Nexus/Oculus/boss_varos.cpp | 5 +- .../Ulduar/Ulduar/boss_razorscale.cpp | 4 +- .../UtgardePinnacle/boss_skadi.cpp | 2 +- .../UtgardePinnacle/boss_svala.cpp | 2 +- .../Northrend/VioletHold/violet_hold.cpp | 2 +- .../scripts/Northrend/borean_tundra.cpp | 12 ++-- .../scripts/Northrend/grizzly_hills.cpp | 2 +- .../scripts/Northrend/howling_fjord.cpp | 2 +- src/server/scripts/Northrend/zuldrak.cpp | 2 +- .../Outland/BlackTemple/boss_illidan.cpp | 6 +- .../BlackTemple/boss_shade_of_akama.cpp | 8 +-- .../SerpentShrine/boss_lady_vashj.cpp | 2 +- .../boss_vazruden_the_herald.cpp | 2 +- .../boss_warchief_kargath_bladefist.cpp | 2 +- src/server/scripts/Outland/nagrand.cpp | 4 +- .../scripts/Outland/shadowmoon_valley.cpp | 2 +- .../scripts/Outland/terokkar_forest.cpp | 3 +- .../scripts/World/boss_emerald_dragons.cpp | 2 +- src/server/scripts/World/npcs_special.cpp | 2 +- 50 files changed, 131 insertions(+), 122 deletions(-) diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 048cc8b3d68..01e13b29f19 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -307,11 +307,7 @@ void npc_escortAI::MovementInform(uint32 moveType, uint32 pointId) { sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has returned to original position before combat"); - if (m_bIsRunning && me->HasUnitMovementFlag(MOVEMENTFLAG_WALKING)) - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - else if (!m_bIsRunning && !me->HasUnitMovementFlag(MOVEMENTFLAG_WALKING)) - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); - + me->SetWalk(!m_bIsRunning); RemoveEscortState(STATE_ESCORT_RETURNING); if (!m_uiWPWaitTimer) @@ -400,14 +396,14 @@ void npc_escortAI::SetRun(bool on) if (on) { if (!m_bIsRunning) - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); else sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set run mode, but is already running."); } else { if (m_bIsRunning) - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); else sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set walk mode, but is already walking."); } @@ -473,9 +469,9 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false //Set initial speed if (m_bIsRunning) - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); else - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); AddEscortState(STATE_ESCORT_ESCORTING); } diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 7838e6891fe..e5797595146 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -45,7 +45,7 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c) mCanRepeatPath = false; // spawn in run mode - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); mRun = false; me->GetPosition(&mLastOOCPos); @@ -720,9 +720,9 @@ uint64 SmartAI::GetGUID(int32 /*id*/) void SmartAI::SetRun(bool run) { if (run) - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); else - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); mRun = run; } diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp index f440fd497fc..c95d77db358 100755 --- a/src/server/game/Entities/Creature/CreatureGroups.cpp +++ b/src/server/game/Entities/Creature/CreatureGroups.cpp @@ -240,7 +240,7 @@ void CreatureGroup::LeaderMoveTo(float x, float y, float z) if (member->IsWithinDist(m_leader, dist + MAX_DESYNC)) member->SetUnitMovementFlags(m_leader->GetUnitMovementFlags()); else - member->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + member->SetWalk(false); member->GetMotionMaster()->MovePoint(0, dx, dy, dz); member->SetHomePosition(dx, dy, dz, pathangle); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 7faa6ef52bb..69fb9906efb 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -9906,7 +9906,7 @@ void Unit::SetCharm(Unit* charm, bool apply) if (charm->HasUnitMovementFlag(MOVEMENTFLAG_WALKING)) { - charm->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + charm->SetWalk(false); charm->SendMovementFlagUpdate(); } @@ -17455,3 +17455,11 @@ void Unit::SetFacingToObject(WorldObject* pObject) // TODO: figure out under what conditions creature will move towards object instead of facing it where it currently is. SetFacingTo(GetAngle(pObject)); } + +void Unit::SetWalk(bool enable) +{ + if (enable) + AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + else + RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); +} \ No newline at end of file diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index e55141a3bae..00f96f15a2c 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1627,6 +1627,7 @@ class Unit : public WorldObject void SendMovementFlagUpdate(); bool IsLevitating() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_LEVITATING);} bool IsWalking() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING);} + virtual void SetWalk(bool enable); void SetInFront(Unit const* target); void SetFacingTo(float ori); diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp index 76bdfe753c6..a75eda93d1d 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp @@ -156,7 +156,7 @@ class instance_deadmines : public InstanceMapScript void MoveCreatureInside(Creature* creature) { - creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + creature->SetWalk(false); creature->GetMotionMaster()->MovePoint(0, -102.7f, -655.9f, creature->GetPositionZ()); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index 728446aa833..9dc142c4dc2 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -122,7 +122,7 @@ public: me->SetSpeed(MOVE_RUN, 2.0f); me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); me->setActive(true); if (instance) diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp index fa97e4eefc0..62acd96d0a9 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp @@ -171,7 +171,7 @@ public: float x, y, z; // coords that we move to, close to the crystal. CrystalChosen->GetClosePoint(x, y, z, me->GetObjectSize(), CONTACT_DISTANCE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); me->GetMotionMaster()->MovePoint(1, x, y, z); DrainingCrystal = true; } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index a2c8a890feb..342c0d18dc9 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -587,7 +587,7 @@ public: return; TargetGUID = who->GetGUID(); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->SetSpeed(MOVE_RUN, 0.4f); me->GetMotionMaster()->MoveChase(who); me->SetTarget(TargetGUID); @@ -892,7 +892,7 @@ public: { if (Creature* miner = Unit::GetCreature(*me, minerGUID)) { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); //Not 100% correct, but movement is smooth. Sometimes miner walks faster //than normal, this speed is fast enough to keep up at those times. diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 4583a33a196..d8cbf0e8595 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -400,7 +400,7 @@ public: switch (uiStage) { case 1: - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); if (GameObject* tree = me->FindNearestGameObject(GO_INCONSPICUOUS_TREE, 40.0f)) { DoScriptText(SAY_TREE1, me); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 81c4b1261ef..2df31971275 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -502,7 +502,7 @@ public: switch (wpId) { case 0: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); SetHoldState(true); break; case 1: @@ -537,7 +537,7 @@ public: bIsBattle = true; break; case 2: - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); DoCast(me, SPELL_THE_LIGHT_OF_DAWN); break; case 3: @@ -551,30 +551,30 @@ public: { if (temp->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0)) temp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); - temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(true); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[19].x, LightofDawnLoc[19].y, LightofDawnLoc[19].z); } if (Creature* temp = Unit::GetCreature(*me, uiThassarianGUID)) { if (temp->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0)) temp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); - temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(true); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[21].x, LightofDawnLoc[21].y, LightofDawnLoc[21].z); } if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) { - temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(true); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[10].x, LightofDawnLoc[10].y, LightofDawnLoc[10].z); } if (Creature* temp = Unit::GetCreature(*me, uiMaxwellGUID)) { - temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(true); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[13].x, LightofDawnLoc[13].y, LightofDawnLoc[13].z); } if (Creature* temp = Unit::GetCreature(*me, uiEligorGUID)) { - temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(true); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[16].x, LightofDawnLoc[16].y, LightofDawnLoc[16].z); } JumpToNextStep(10000); @@ -664,7 +664,7 @@ public: if (uiSummon_counter < ENCOUNTER_GHOUL_NUMBER) { Unit* temp = me->SummonCreature(NPC_ACHERUS_GHOUL, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->setFaction(2084); uiGhoulGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; @@ -682,7 +682,7 @@ public: if (uiSummon_counter < ENCOUNTER_ABOMINATION_NUMBER) { Unit* temp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->setFaction(2084); uiAbominationGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; @@ -700,7 +700,7 @@ public: if (uiSummon_counter < ENCOUNTER_WARRIOR_NUMBER) { Unit* temp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->setFaction(2084); uiWarriorGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; @@ -718,7 +718,7 @@ public: if (uiSummon_counter < ENCOUNTER_BEHEMOTH_NUMBER) { Unit* temp = me->SummonCreature(NPC_FLESH_BEHEMOTH, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->setFaction(2084); uiBehemothGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; @@ -739,17 +739,17 @@ public: SetHoldState(false); if (Creature* temp = Unit::GetCreature(*me, uiKoltiraGUID)) { - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); } if (Creature* temp = Unit::GetCreature(*me, uiOrbazGUID)) { - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); } if (Creature* temp = Unit::GetCreature(*me, uiThassarianGUID)) { - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); } for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) @@ -824,7 +824,7 @@ public: if (Unit* temp = me->SummonCreature(NPC_DARION_MOGRAINE, LightofDawnLoc[24].x, LightofDawnLoc[24].y, LightofDawnLoc[24].z, LightofDawnLoc[24].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) { DoScriptText(SAY_LIGHT_OF_DAWN35, temp); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); uiDarionGUID = temp->GetGUID(); } JumpToNextStep(4000); @@ -940,7 +940,7 @@ public: DoCast(me, SPELL_MOGRAINE_CHARGE); // jumping charge // doesn't make it looks well, so workarounds, Darion charges, looks better me->SetSpeed(MOVE_RUN, 3.0f); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); SetHoldState(false); JumpToNextStep(0); break; @@ -1013,7 +1013,7 @@ public: Unit* temp; temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->SetSpeed(MOVE_RUN, 2.0f); temp->setFaction(me->getFaction()); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); @@ -1021,7 +1021,7 @@ public: temp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->SetSpeed(MOVE_RUN, 2.0f); temp->setFaction(me->getFaction()); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); @@ -1030,7 +1030,7 @@ public: if (Creature* temp = Unit::GetCreature(*me, uiMaxwellGUID)) { temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->SetSpeed(MOVE_RUN, 2.0f); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); DoScriptText(SAY_LIGHT_OF_DAWN50, temp); @@ -1038,7 +1038,7 @@ public: if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) { temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->SetSpeed(MOVE_RUN, 2.0f); temp->HandleEmoteCommand(EMOTE_STATE_ATTACK_UNARMED); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); @@ -1046,7 +1046,7 @@ public: if (Creature* temp = Unit::GetCreature(*me, uiEligorGUID)) { temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->SetSpeed(MOVE_RUN, 2.0f); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); } @@ -1111,7 +1111,7 @@ public: case 46: // Darion stand up, "not today" me->SetSpeed(MOVE_RUN, 1.0f); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->SetStandState(UNIT_STAND_STATE_STAND); DoScriptText(SAY_LIGHT_OF_DAWN53, me); SetHoldState(false); // Darion throws sword @@ -1171,7 +1171,7 @@ public: temp->CastSpell(temp, SPELL_TIRION_CHARGE, false); // jumping charge temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); temp->SetSpeed(MOVE_RUN, 3.0f); // workarounds, make Tirion still running - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[2].x, LightofDawnLoc[2].y, LightofDawnLoc[2].z); if (Creature* lktemp = Unit::GetCreature(*me, uiLichKingGUID)) lktemp->Relocate(LightofDawnLoc[28].x, LightofDawnLoc[28].y, LightofDawnLoc[28].z); // workarounds, he should kick back by Tirion, but here we relocate him @@ -1189,7 +1189,7 @@ public: if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) { temp->SetSpeed(MOVE_RUN, 1.0f); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[29].x, LightofDawnLoc[29].y, LightofDawnLoc[29].z); // 26 } JumpToNextStep(4000); @@ -1249,7 +1249,7 @@ public: case 62: if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) { - temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(true); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[7].x, LightofDawnLoc[7].y, LightofDawnLoc[7].z); } JumpToNextStep(5500); @@ -1438,7 +1438,7 @@ public: me->DeleteThreatList(); me->CombatStop(true); me->InterruptNonMeleeSpells(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i) DespawnNPC(uiDefenderGUID[i]); @@ -1460,7 +1460,7 @@ public: temp->CombatStop(true); temp->AttackStop(); temp->setFaction(me->getFaction()); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[9].x, LightofDawnLoc[9].y, LightofDawnLoc[9].z); } @@ -1471,7 +1471,7 @@ public: temp->CombatStop(true); temp->AttackStop(); temp->setFaction(me->getFaction()); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[12].x, LightofDawnLoc[12].y, LightofDawnLoc[12].z); } @@ -1482,7 +1482,7 @@ public: temp->CombatStop(true); temp->AttackStop(); temp->setFaction(me->getFaction()); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[15].x, LightofDawnLoc[15].y, LightofDawnLoc[15].z); } DespawnNPC(uiRayneGUID); @@ -1494,7 +1494,7 @@ public: temp->CombatStop(true); temp->AttackStop(); temp->setFaction(me->getFaction()); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[18].x, LightofDawnLoc[18].y, LightofDawnLoc[18].z); temp->CastSpell(temp, SPELL_THE_LIGHT_OF_DAWN, false); } @@ -1509,7 +1509,7 @@ public: temp->CombatStop(true); temp->AttackStop(); temp->setFaction(me->getFaction()); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[20].x, LightofDawnLoc[20].y, LightofDawnLoc[20].z); temp->CastSpell(temp, SPELL_THE_LIGHT_OF_DAWN, false); } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp index 9512d66b6eb..4f4622b6d4a 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp @@ -74,7 +74,7 @@ public: switch (phase) { case 0: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); me->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED); FlyBackTimer = 500; break; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index 21245209e45..dd2bef556c4 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -501,7 +501,7 @@ class mob_janalai_hatcher : public CreatureScript void Reset() { - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); side =(me->GetPositionY() < 1150); waypoint = 0; isHatching = false; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp index 954f232f786..a6b74ddf06e 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp @@ -136,7 +136,7 @@ class boss_nalorakk : public CreatureScript inMove = false; waitTimer = 0; me->SetSpeed(MOVE_RUN, 2); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); }else { (*me).GetMotionMaster()->MovePoint(0, NalorakkWay[7][0], NalorakkWay[7][1], NalorakkWay[7][2]); diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/ghostlands.cpp index 412613572f1..effc333d6f8 100644 --- a/src/server/scripts/EasternKingdoms/ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/ghostlands.cpp @@ -168,8 +168,10 @@ public: me->AI()->AttackStart(Summ1); break; } - case 19: me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); break; - case 25: me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); break; + case 19: me->SetWalk(false); + break; + case 25: me->SetWalk(true); + break; case 30: if (player && player->GetTypeId() == TYPEID_PLAYER) CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me); diff --git a/src/server/scripts/EasternKingdoms/hinterlands.cpp b/src/server/scripts/EasternKingdoms/hinterlands.cpp index 7021deeae75..a66a01e00e5 100644 --- a/src/server/scripts/EasternKingdoms/hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/hinterlands.cpp @@ -273,7 +273,7 @@ public: void JustSummoned(Creature* summoned) { - summoned->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + summoned->SetWalk(false); summoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ); } diff --git a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp index d7b00af33e8..310ecbf7b66 100644 --- a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp @@ -84,7 +84,7 @@ public: return; if (uiI >= 65 && me->GetUnitMovementFlags() == MOVEMENTFLAG_WALKING) - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); switch (uiI) { @@ -94,7 +94,7 @@ public: uiPhase = 1; break; case 65: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); break; case 115: player->AreaExploredOrEventHappens(QUEST_MISSING_IN_ACTION); diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/stormwind_city.cpp index a4eca1950f8..26267497aa1 100644 --- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/stormwind_city.cpp @@ -391,7 +391,7 @@ public: { npc_marzon_silent_bladeAI(Creature* creature) : ScriptedAI(creature) { - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); } void Reset() diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index 107c9e8f2f9..8a0ea30ca6a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -492,7 +492,7 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) // Increment Enemy Count to be used in World States and instance script ++EnemyCount; - creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + creature->SetWalk(false); creature->setActive(true); switch (entry) { @@ -1014,7 +1014,7 @@ void hyjalAI::WaypointReached(uint32 i) if ((*itr) && (*itr)->isAlive() && (*itr) != me && (*itr)->GetEntry() != JAINA) { if (!(*itr)->IsWithinDist(me, 60)) - (*itr)->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + (*itr)->SetWalk(false); float x, y, z; (*itr)->SetDefaultMovementType(IDLE_MOTION_TYPE); (*itr)->GetMotionMaster()->Initialize(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp index 9518abd1635..e891f00ea36 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp @@ -591,11 +591,11 @@ public: } //After waypoint 0 case 1: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); if (Unit* pUther = me->SummonCreature(NPC_UTHER, 1794.357f, 1272.183f, 140.558f, 1.37f, TEMPSUMMON_DEAD_DESPAWN, 180000)) { uiUtherGUID = pUther->GetGUID(); - pUther->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + pUther->SetWalk(false); pUther->GetMotionMaster()->MovePoint(0, 1897.018f, 1287.487f, 143.481f); pUther->SetTarget(me->GetGUID()); me->SetTarget(uiUtherGUID); @@ -680,7 +680,7 @@ public: case 17: if (Creature* pUther = Unit::GetCreature(*me, uiUtherGUID)) { - pUther->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + pUther->SetWalk(true); pUther->GetMotionMaster()->MovePoint(0, 1794.357f, 1272.183f, 140.558f); } JumpToNextStep(1000); @@ -689,7 +689,7 @@ public: if (Creature* pJaina = Unit::GetCreature(*me, uiJainaGUID)) { me->SetTarget(uiJainaGUID); - pJaina->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + pJaina->SetWalk(true); pJaina->GetMotionMaster()->MovePoint(0, 1794.357f, 1272.183f, 140.558f); } JumpToNextStep(1000); @@ -755,7 +755,7 @@ public: if (Creature* pCityman = Unit::GetCreature(*me, uiCitymenGUID[0])) { pCityman->SetTarget(me->GetGUID()); - pCityman->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + pCityman->SetWalk(true); pCityman->GetMotionMaster()->MovePoint(0, 2088.625f, 1279.191f, 140.743f); } JumpToNextStep(2000); @@ -929,7 +929,7 @@ public: if (Unit* pBoss = me->SummonCreature(uiBossID, 2232.19f, 1331.933f, 126.662f, 3.15f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000)) { uiBossGUID = pBoss->GetGUID(); - pBoss->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + pBoss->SetWalk(true); pBoss->GetMotionMaster()->MovePoint(0, 2194.110f, 1332.00f, 130.00f); } } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp index aa57b3d9499..f5745f0f894 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp @@ -401,7 +401,7 @@ public: SetRun(); break; case 91: - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); SetRun(false); break; case 93: diff --git a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp index 33a2ce73e21..da29c911c9f 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp @@ -301,7 +301,7 @@ public: { if (npc->isAlive()) { - npc->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + npc->SetWalk(true); npc->GetMotionMaster()->MovePoint(1, x, y, z); npc->SetHomePosition(x, y, z, o); } diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp index 61fe526407c..98de619c127 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp @@ -204,7 +204,7 @@ void initBlyCrewMember(InstanceScript* instance, uint32 entry, float x, float y, if (Creature* crew = instance->instance->GetCreature(instance->GetData64(entry))) { crew->SetReactState(REACT_AGGRESSIVE); - crew->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + crew->SetWalk(true); crew->SetHomePosition(x, y, z, 0); crew->GetMotionMaster()->MovePoint(1, x, y, z); crew->setFaction(FACTION_FREED); diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp index eede1aa069a..1a6ba36bbb1 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp @@ -640,7 +640,7 @@ public: case 37: DoScriptText(SAY_QUEST_COMPLETE, me, player); me->SetSpeed(MOVE_RUN, 1.2f, true); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); if (player && player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H)) player->GroupEventHappens(QUEST_STINKYS_ESCAPE_H, me); if (player && player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A)) diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp index 3e9d8144c19..547544fb754 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp @@ -480,7 +480,7 @@ public: if (temp->isAlive() && !temp->getVictim()) { if (temp->HasUnitMovementFlag(MOVEMENTFLAG_WALKING)) - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); if (temp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp index cfbbb79c5f6..19ae66b6a60 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp @@ -71,7 +71,7 @@ class npc_xerestrasza : public CreatureScript _isIntro = false; Talk(SAY_XERESTRASZA_EVENT); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->GetMotionMaster()->MovePoint(0, xerestraszaMovePos); _events.ScheduleEvent(EVENT_XERESTRASZA_EVENT_1, 16000); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp index 3831e4824ad..28110d883c6 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -255,7 +255,7 @@ class boss_lich_king_toc : public CreatureScript summoned->SetDisplayId(11686); } if (m_instance) m_instance->SetData(TYPE_LICH_KING, IN_PROGRESS); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); } void MovementInform(uint32 uiType, uint32 uiId) @@ -378,7 +378,7 @@ class npc_fizzlebang_toc : public CreatureScript void Reset() { - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); m_uiPortalGUID = 0; me->GetMotionMaster()->MovePoint(1, ToCCommonLoc[10].GetPositionX(), ToCCommonLoc[10].GetPositionY()-60, ToCCommonLoc[10].GetPositionZ()); } @@ -390,7 +390,7 @@ class npc_fizzlebang_toc : public CreatureScript switch (uiId) { case 1: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); if (m_instance) { m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 3c795187f43..d171f069cad 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -641,7 +641,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript switch (id) { case POINT_FIRST_STEP: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); Talk(SAY_INTRO_HORDE_3); _events.ScheduleEvent(EVENT_INTRO_HORDE_5, 15500, 0, PHASE_INTRO_H); _events.ScheduleEvent(EVENT_INTRO_HORDE_6, 29500, 0, PHASE_INTRO_H); @@ -687,7 +687,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript switch (eventId) { case EVENT_INTRO_HORDE_3: - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->GetMotionMaster()->MovePoint(POINT_FIRST_STEP, firstStepPos.GetPositionX(), firstStepPos.GetPositionY(), firstStepPos.GetPositionZ()); break; case EVENT_INTRO_HORDE_5: @@ -718,7 +718,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript { float x, y, z; deathbringer->GetClosePoint(x, y, z, deathbringer->GetObjectSize()); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->GetMotionMaster()->MovePoint(POINT_CORPSE, x, y, z); } break; @@ -841,7 +841,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript { if (type == POINT_MOTION_TYPE && id == POINT_FIRST_STEP) { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); Talk(SAY_INTRO_ALLIANCE_4); _events.ScheduleEvent(EVENT_INTRO_ALLIANCE_5, 5000, 0, PHASE_INTRO_A); if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_DEATHBRINGER_SAURFANG))) @@ -865,7 +865,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript switch (eventId) { case EVENT_INTRO_ALLIANCE_4: - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->GetMotionMaster()->MovePoint(POINT_FIRST_STEP, firstStepPos.GetPositionX(), firstStepPos.GetPositionY(), firstStepPos.GetPositionZ()); break; case EVENT_INTRO_ALLIANCE_5: diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index 8623fcfde81..44bc40d08bd 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -191,7 +191,7 @@ class boss_professor_putricide : public CreatureScript SetPhase(PHASE_COMBAT_1); _experimentState = EXPERIMENT_STATE_OOZE; me->SetReactState(REACT_DEFENSIVE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); @@ -230,7 +230,7 @@ class boss_professor_putricide : public CreatureScript void JustReachedHome() { _JustReachedHome(); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); if (events.GetPhaseMask() & PHASE_MASK_COMBAT) instance->SetBossState(DATA_PROFESSOR_PUTRICIDE, FAIL); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index fbed870eb19..908ce37c604 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -660,7 +660,7 @@ class boss_the_lich_king : public CreatureScript summons.DespawnAll(); SendMusicToPlayers(MUSIC_FURY_OF_FROSTMOURNE); DoCastAOE(SPELL_FURY_OF_FROSTMOURNE); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); events.ScheduleEvent(EVENT_OUTRO_TALK_1, 2600, 0, PHASE_OUTRO); events.ScheduleEvent(EVENT_OUTRO_EMOTE_TALK, 6600, 0, PHASE_OUTRO); events.ScheduleEvent(EVENT_OUTRO_EMOTE_TALK, 17600, 0, PHASE_OUTRO); @@ -864,7 +864,7 @@ class boss_the_lich_king : public CreatureScript case EVENT_INTRO_MOVE_1: me->SetSheath(SHEATH_STATE_MELEE); me->RemoveAurasDueToSpell(SPELL_EMOTE_SIT_NO_SHEATH); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->GetMotionMaster()->MovePoint(POINT_LK_INTRO_1, LichKingIntro[0]); break; case EVENT_INTRO_MOVE_2: @@ -894,7 +894,7 @@ class boss_the_lich_king : public CreatureScript events.ScheduleEvent(EVENT_FINISH_INTRO, 1000, 0, PHASE_INTRO); break; case EVENT_FINISH_INTRO: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetReactState(REACT_AGGRESSIVE); events.SetPhase(PHASE_ONE); @@ -1226,7 +1226,7 @@ class npc_tirion_fordring_tft : public CreatureScript { _events.SetPhase(PHASE_INTRO); me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->GetMotionMaster()->MovePoint(POINT_TIRION_INTRO, TirionIntro); } } @@ -1264,7 +1264,7 @@ class npc_tirion_fordring_tft : public CreatureScript me->HandleEmoteCommand(EMOTE_ONESHOT_POINT_NO_SHEATHE); break; case EVENT_INTRO_CHARGE: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); me->GetMotionMaster()->MovePoint(POINT_TIRION_CHARGE, TirionCharge); break; case EVENT_OUTRO_TALK_1: diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp index 47151ef6d80..05206102762 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp @@ -194,7 +194,7 @@ public: { movementStarted = true; me->SetReactState(REACT_PASSIVE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); me->SetSpeed(MOVE_RUN, me->GetSpeedRate(MOVE_RUN), true); switch (id) diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp index 8852338c362..187dbed6901 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp @@ -169,7 +169,8 @@ class npc_azure_ring_captain : public CreatureScript { targetGUID = 0; - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING | MOVEMENTFLAG_FLYING); + me->SetWalk(true); + me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING); me->SetReactState(REACT_AGGRESSIVE); } @@ -214,7 +215,7 @@ class npc_azure_ring_captain : public CreatureScript if (Unit* victim = varos->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0)) { me->SetReactState(REACT_PASSIVE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); me->GetMotionMaster()->MovePoint(ACTION_CALL_DRAGON_EVENT, victim->GetPositionX(), victim->GetPositionY(), victim->GetPositionZ() + 20.0f); targetGUID = victim->GetGUID(); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index 45f9a1fa012..7ad859e3e8d 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp @@ -647,7 +647,7 @@ class npc_expedition_commander : public CreatureScript for (uint8 n = 0; n < RAID_MODE(2, 4); n++) { Engineer[n] = me->SummonCreature(NPC_ENGINEER, PosEngSpawn, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); - Engineer[n]->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + Engineer[n]->SetWalk(false); Engineer[n]->SetSpeed(MOVE_RUN, 0.5f); Engineer[n]->SetHomePosition(PosEngRepair[n]); Engineer[n]->GetMotionMaster()->MoveTargetedHome(); @@ -660,7 +660,7 @@ class npc_expedition_commander : public CreatureScript for (uint8 n = 0; n < 4; n++) { Defender[n] = me->SummonCreature(NPC_DEFENDER, PosDefSpawn[n], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); - Defender[n]->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + Defender[n]->SetWalk(false); Defender[n]->SetHomePosition(PosDefCombat[n]); Defender[n]->GetMotionMaster()->MoveTargetedHome(); } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index d5cd79b25f1..dd3557071cd 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -240,7 +240,7 @@ public: m_instance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, IN_PROGRESS); m_instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); me->GetMotionMaster()->MoveJump(Location[0].GetPositionX(), Location[0].GetPositionY(), Location[0].GetPositionZ(), 5.0f, 10.0f); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); m_uiMountTimer = 1000; Summons.DespawnEntry(CREATURE_GRAUF); } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index 915ead98bb7..ad87c435bba 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -340,7 +340,7 @@ public: if ((*itr)->isAlive()) { (*itr)->SetStandState(UNIT_STAND_STATE_STAND); - (*itr)->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + (*itr)->SetWalk(false); (*itr)->GetMotionMaster()->MovePoint(1, spectatorWP[0][0], spectatorWP[0][1], spectatorWP[0][2]); } } diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp index 8b77cb250da..d9e8798b179 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp @@ -363,7 +363,7 @@ public: { if (Creature* pGuard = *itr) { - pGuard->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + pGuard->SetWalk(false); pGuard->GetMotionMaster()->MovePoint(0, MovePosition); } } diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index 11fb0933b9b..a8fcd6139da 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -1030,16 +1030,16 @@ public: uiArthas = pArthas->GetGUID(); pArthas->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); pArthas->SetReactState(REACT_PASSIVE); - pArthas->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + pArthas->SetWalk(true); pArthas->GetMotionMaster()->MovePoint(0, 3737.374756f, 3564.841309f, 477.433014f); } if (Creature* pTalbot = me->SummonCreature(NPC_COUNSELOR_TALBOT, 3747.23f, 3614.936f, 473.321f, 4.462012f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 120000)) { uiTalbot = pTalbot->GetGUID(); - pTalbot->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + pTalbot->SetWalk(true); pTalbot->GetMotionMaster()->MovePoint(0, 3738.000977f, 3568.882080f, 477.433014f); } - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); break; case 4: @@ -1118,13 +1118,13 @@ public: if (Creature* pArlos = me->SummonCreature(NPC_GENERAL_ARLOS, 3745.527100f, 3615.655029f, 473.321533f, 4.447805f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 120000)) { uiArlos = pArlos->GetGUID(); - pArlos->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + pArlos->SetWalk(true); pArlos->GetMotionMaster()->MovePoint(0, 3735.570068f, 3572.419922f, 477.441010f); } if (Creature* pLeryssa = me->SummonCreature(NPC_LERYSSA, 3749.654541f, 3614.959717f, 473.323486f, 4.524959f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 120000)) { uiLeryssa = pLeryssa->GetGUID(); - pLeryssa->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + pLeryssa->SetWalk(false); pLeryssa->SetReactState(REACT_PASSIVE); pLeryssa->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); pLeryssa->GetMotionMaster()->MovePoint(0, 3741.969971f, 3571.439941f, 477.441010f); @@ -1446,7 +1446,7 @@ public: pArlos->Kill(pArlos, false); pLeryssa->RemoveAura(SPELL_STUN); pLeryssa->ClearUnitState(UNIT_STATE_STUNNED); - pLeryssa->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + pLeryssa->SetWalk(false); pLeryssa->GetMotionMaster()->MovePoint(0, 3722.114502f, 3564.201660f, 477.441437f); if (killer->GetTypeId() == TYPEID_PLAYER) diff --git a/src/server/scripts/Northrend/grizzly_hills.cpp b/src/server/scripts/Northrend/grizzly_hills.cpp index ccb31c869a4..fdebe3b7ab1 100644 --- a/src/server/scripts/Northrend/grizzly_hills.cpp +++ b/src/server/scripts/Northrend/grizzly_hills.cpp @@ -162,7 +162,7 @@ public: player->GroupEventHappens(QUEST_PERILOUS_ADVENTURE, me); DoScriptText(SAY_QUEST_COMPLETE, me, player); } - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); break; case 25: DoScriptText(SAY_VICTORY4, me); diff --git a/src/server/scripts/Northrend/howling_fjord.cpp b/src/server/scripts/Northrend/howling_fjord.cpp index 3c44fa0eb44..5e4b7dafdb4 100644 --- a/src/server/scripts/Northrend/howling_fjord.cpp +++ b/src/server/scripts/Northrend/howling_fjord.cpp @@ -389,7 +389,7 @@ public: { if (player->isAlive()) { - summon->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + summon->SetWalk(false); summon->GetMotionMaster()->MovePoint(0, afCenter[0], afCenter[1], afCenter[2]); summon->AI()->AttackStart(player); return; diff --git a/src/server/scripts/Northrend/zuldrak.cpp b/src/server/scripts/Northrend/zuldrak.cpp index 0af82345dce..1bf04bc624c 100644 --- a/src/server/scripts/Northrend/zuldrak.cpp +++ b/src/server/scripts/Northrend/zuldrak.cpp @@ -1328,7 +1328,7 @@ public: break; case 2: // walk forward - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->GetMotionMaster()->MovePoint(0, me->GetPositionX() + (cos(m_heading) * 10), me->GetPositionY() + (sin(m_heading) * 10), me->GetPositionZ()); m_uiTimer = 5000; m_uiPhase = 3; diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 58f0e10c950..c0c18b082bf 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -750,7 +750,7 @@ public: if (!Trigger) return; Trigger->SetSpeed(MOVE_WALK, 3); - Trigger->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + Trigger->SetWalk(true); Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z); // Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -1537,7 +1537,7 @@ public: void BeginWalk() { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); me->SetSpeed(MOVE_RUN, 1.0f); me->GetMotionMaster()->MovePoint(0, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z); } @@ -1932,7 +1932,7 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::HandleTalkSequence() // Equip our warglaives! SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); break; case 9: if (GETCRE(Akama, AkamaGUID)) diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp index 5ca3189ebca..08b188f7301 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -354,7 +354,7 @@ public: if (Sorcerer) { CAST_AI(mob_ashtongue_sorcerer::mob_ashtongue_sorcererAI, Sorcerer->AI())->ShadeGUID = me->GetGUID(); - Sorcerer->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + Sorcerer->SetWalk(false); Sorcerer->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); Sorcerer->SetTarget(me->GetGUID()); Sorcerers.push_back(Sorcerer->GetGUID()); @@ -369,7 +369,7 @@ public: Creature* Spawn = me->SummonCreature(spawnEntries[i], X, Y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); if (Spawn) { - Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + Spawn->SetWalk(false); Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z); Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1); Spawn->AI()->AttackStart(target); @@ -430,7 +430,7 @@ public: Creature* Defender = me->SummonCreature(CREATURE_DEFENDER, SpawnLocations[ran].x, SpawnLocations[ran].y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); if (Defender) { - Defender->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + Defender->SetWalk(false); bool move = true; if (AkamaGUID) { @@ -760,7 +760,7 @@ public: { ShadeHasDied = true; WayPointId = 0; - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z); } if (Shade && Shade->isAlive()) diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index 33ce04e45e3..0ec8addd9f1 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -644,7 +644,7 @@ public: if (move <= diff) { - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); if (phase == 1) me->GetMotionMaster()->MovePoint(0, x, y, z); if (phase == 1 && me->IsWithinDist3d(x, y, z, 0.1f)) diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp index ecea5e6abb4..2e2ea1b7936 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp @@ -146,7 +146,7 @@ class boss_nazan : public CreatureScript BellowingRoar_Timer = 6000; ConeOfFire_Timer = 12000; me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->GetMotionMaster()->Clear(); if (Unit* victim = SelectTarget(SELECT_TARGET_NEAREST, 0)) me->AI()->AttackStart(victim); diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp index 3f07552441b..12e28d42a67 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp @@ -95,7 +95,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript removeAdds(); me->SetSpeed(MOVE_RUN, 2); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); summoned = 2; InBlade = false; diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp index 668db2efcbb..f1aaf82cb67 100644 --- a/src/server/scripts/Outland/nagrand.cpp +++ b/src/server/scripts/Outland/nagrand.cpp @@ -258,7 +258,7 @@ public: if (summoned->isTotem()) return; - summoned->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + summoned->SetWalk(false); summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); summoned->AI()->AttackStart(me); @@ -603,7 +603,7 @@ public: if (summoned->isTotem()) return; - summoned->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + summoned->SetWalk(false); summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); summoned->AI()->AttackStart(me); } diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index 19c4754c4fd..7a50fb8cda2 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -366,7 +366,7 @@ public: float x, y, z; caster->GetClosePoint(x, y, z, me->GetObjectSize()); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); me->GetMotionMaster()->MovePoint(1, x, y, z); } } diff --git a/src/server/scripts/Outland/terokkar_forest.cpp b/src/server/scripts/Outland/terokkar_forest.cpp index 043b74b6924..5eb88e6bfb6 100644 --- a/src/server/scripts/Outland/terokkar_forest.cpp +++ b/src/server/scripts/Outland/terokkar_forest.cpp @@ -497,7 +497,8 @@ public: me->SetInFront(player); break; case 30: me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break; case 31: DoCast(me, SPELL_CAT); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); break; + me->SetWalk(false); + break; } } diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp index 9f652e7a859..a844e500ce5 100644 --- a/src/server/scripts/World/boss_emerald_dragons.cpp +++ b/src/server/scripts/World/boss_emerald_dragons.cpp @@ -198,7 +198,7 @@ class npc_dream_fog : public CreatureScript me->GetMotionMaster()->MoveRandom(25.0f); } // Seeping fog movement is slow enough for a player to be able to walk backwards and still outpace it - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->SetSpeed(MOVE_WALK, 0.75f); } else diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 1e1e34431a2..4915e5f15f2 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -764,7 +764,7 @@ public: DoScriptText(RAND(SAY_DOC1, SAY_DOC2, SAY_DOC3), me); uint32 mobId = me->GetEntry(); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); switch (mobId) { From 5416b734e4c044cfea4e78f9f34ecf237c693265 Mon Sep 17 00:00:00 2001 From: Venugh Date: Thu, 23 Feb 2012 12:32:21 +0100 Subject: [PATCH 0003/1149] Core/Movement: Use SetLevitate(true/false) instead of AddUnit/RemoveUnit. --- src/server/game/AI/SmartScripts/SmartAI.cpp | 4 ++-- .../Karazhan/boss_nightbane.cpp | 8 ++++---- .../EasternKingdoms/Karazhan/karazhan.cpp | 2 +- .../boss_felblood_kaelthas.cpp | 4 ++-- .../SunwellPlateau/boss_brutallus.cpp | 2 +- .../SunwellPlateau/boss_felmyst.cpp | 4 ++-- .../SunwellPlateau/boss_kalecgos.cpp | 8 ++++---- .../SunwellPlateau/boss_kiljaeden.cpp | 2 +- .../scripts/EasternKingdoms/undercity.cpp | 4 ++-- .../EasternKingdoms/western_plaguelands.cpp | 2 +- .../BattleForMountHyjal/hyjal_trash.cpp | 6 +++--- src/server/scripts/Kalimdor/silithus.cpp | 8 ++++---- .../RubySanctum/boss_saviana_ragefire.cpp | 6 +++--- .../TrialOfTheCrusader/boss_twin_valkyr.cpp | 4 ++-- .../boss_blood_prince_council.cpp | 2 +- .../boss_blood_queen_lana_thel.cpp | 10 +++++----- .../boss_deathbringer_saurfang.cpp | 10 +++++----- .../IcecrownCitadel/boss_sindragosa.cpp | 18 +++++++++--------- .../IcecrownCitadel/boss_the_lich_king.cpp | 4 ++-- .../Northrend/Naxxramas/boss_sapphiron.cpp | 4 ++-- .../Nexus/EyeOfEternity/boss_malygos.cpp | 10 +++++----- .../Ulduar/Ulduar/boss_assembly_of_iron.cpp | 6 +++--- .../UtgardeKeep/UtgardePinnacle/boss_svala.cpp | 12 ++++++------ .../UtgardePinnacle/boss_ymiron.cpp | 2 +- .../Outland/BlackTemple/boss_illidan.cpp | 4 ++-- .../SerpentShrine/boss_lady_vashj.cpp | 2 +- .../boss_vazruden_the_herald.cpp | 4 ++-- .../scripts/Outland/shadowmoon_valley.cpp | 8 ++++---- src/server/scripts/World/npcs_special.cpp | 2 +- 29 files changed, 81 insertions(+), 81 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index e5797595146..8776090c86f 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -731,12 +731,12 @@ void SmartAI::SetFly(bool fly) { if (fly) { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); } else { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); } me->SetFlying(fly); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index 9dc142c4dc2..2a8676d7915 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -121,7 +121,7 @@ public: MovePhase = 0; me->SetSpeed(MOVE_RUN, 2.0f); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->SetWalk(false); me->setActive(true); @@ -240,7 +240,7 @@ public: me->InterruptSpell(CURRENT_GENERIC_SPELL); me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); (*me).GetMotionMaster()->Clear(false); (*me).GetMotionMaster()->MovePoint(0, IntroWay[2][0], IntroWay[2][1], IntroWay[2][2]); @@ -263,7 +263,7 @@ public: { if (MovePhase >= 7) { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); me->GetMotionMaster()->MovePoint(8, IntroWay[7][0], IntroWay[7][1], IntroWay[7][2]); } @@ -277,7 +277,7 @@ public: { if (MovePhase >= 7) { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); me->GetMotionMaster()->MovePoint(8, IntroWay[7][0], IntroWay[7][1], IntroWay[7][2]); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index 056a2e95448..30fc8a2f9c4 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -527,7 +527,7 @@ public: if (!Arcanagos) return; ArcanagosGUID = Arcanagos->GetGUID(); - Arcanagos->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + Arcanagos->SetLevitate(true); (*Arcanagos).GetMotionMaster()->MovePoint(0, ArcanagosPos[0], ArcanagosPos[1], ArcanagosPos[2]); Arcanagos->SetOrientation(ArcanagosPos[3]); me->SetOrientation(MedivPos[3]); diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index 94c894f7e47..a46037f2662 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -497,7 +497,7 @@ public: void Reset() { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); DoCast(me, SPELL_PHOENIX_BURN, true); BurnTimer = 2000; Death_Timer = 3000; @@ -651,7 +651,7 @@ public: ChangeTargetTimer = urand(6000, 12000); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->setFaction(14); DoCast(me, SPELL_ARCANE_SPHERE_PASSIVE, true); } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp index 1404fd14e91..78d00e19cdf 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp @@ -216,7 +216,7 @@ public: break; case 3: DoCast(me, SPELL_INTRO_FROST_BLAST); - Madrigosa->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + Madrigosa->SetLevitate(true); me->AttackStop(); Madrigosa->AttackStop(); IntroFrostBoltTimer = 3000; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp index c65ce2c8f98..0d98efd703b 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp @@ -137,7 +137,7 @@ public: uiFlightCount = 0; - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); @@ -391,7 +391,7 @@ public: } break; case 10: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); EnterPhase(PHASE_GROUND); AttackStart(SelectTarget(SELECT_TARGET_TOPAGGRO)); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index d7c90732a80..1735c0c4f07 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -159,7 +159,7 @@ public: if (!bJustReset) //first reset at create { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->SetVisible(true); me->SetStandState(UNIT_STAND_STATE_SLEEP); } @@ -231,7 +231,7 @@ public: if (ResetTimer <= diff) { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->SetVisible(true); me->SetStandState(UNIT_STAND_STATE_SLEEP); ResetTimer = 10000; @@ -400,7 +400,7 @@ public: TalkTimer = 10000; break; case 3: - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->GetMotionMaster()->MovePoint(0, FLY_X, FLY_Y, FLY_Z); TalkTimer = 600000; break; @@ -418,7 +418,7 @@ public: TalkTimer = 3000; break; case 2: - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->GetMotionMaster()->MovePoint(0, FLY_X, FLY_Y, FLY_Z); TalkTimer = 15000; break; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index 337eea13438..41806dcb308 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -1196,7 +1196,7 @@ public: void Reset() { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); bPointReached = true; uiTimer = urand(500, 1000); uiCheckTimer = 1000; diff --git a/src/server/scripts/EasternKingdoms/undercity.cpp b/src/server/scripts/EasternKingdoms/undercity.cpp index fe9c40e6dbd..1724572f796 100644 --- a/src/server/scripts/EasternKingdoms/undercity.cpp +++ b/src/server/scripts/EasternKingdoms/undercity.cpp @@ -114,7 +114,7 @@ public: summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false); } - summoned->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + summoned->SetLevitate(true); targetGUID = summoned->GetGUID(); } } @@ -185,7 +185,7 @@ public: { if (EventMove_Timer <= diff) { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetDistance(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW) / (5000 * 0.001f)); me->SetPosition(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetOrientation()); EventMove = false; diff --git a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp index a04a94f73b1..4ec8dbb647b 100644 --- a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp @@ -359,7 +359,7 @@ public: break; case 23: Ughost = me->SummonCreature(NPC_GHOST_UTHER, 971.86f, -1825.42f, 81.99f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - Ughost->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + Ughost->SetLevitate(true); DoScriptText(SAY_WP_4, Ughost, me); m_uiChatTimer = 4000; break; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index c94cb874bfa..ecc6b865b3d 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -459,7 +459,7 @@ public: { trigger->SetVisible(false); trigger->setFaction(me->getFaction()); - trigger->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + trigger->SetLevitate(true); trigger->CastSpell(me, SPELL_METEOR, true); } me->GetMotionMaster()->Clear(); @@ -1176,7 +1176,7 @@ public: { FrostBreathTimer = 5000; MoveTimer = 0; - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); } void WaypointReached(uint32 i) @@ -1298,7 +1298,7 @@ public: Zpos = 10.0f; StrikeTimer = 2000+rand()%5000; MoveTimer = 0; - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); } void WaypointReached(uint32 i) diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp index fac56021c3a..71cc92da438 100644 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ b/src/server/scripts/Kalimdor/silithus.cpp @@ -576,7 +576,7 @@ public: break; case 10: Merithra->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - Merithra->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + Merithra->SetLevitate(true); Merithra->GetMotionMaster()->MoveCharge(-8065, 1530, 6.61f, 3); break; case 11: @@ -603,7 +603,7 @@ public: break; case 18: Arygos->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - Arygos->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + Arygos->SetLevitate(true); Arygos->GetMotionMaster()->MoveCharge(-8065, 1530, 6.61f, 42); break; case 19: @@ -630,7 +630,7 @@ public: break; case 26: Caelestrasz->HandleEmoteCommand(254); - Caelestrasz->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + Caelestrasz->SetLevitate(true); Caelestrasz->GetMotionMaster()->MoveCharge(-8065, 1530, 7.61f, 4); break; case 27: @@ -769,7 +769,7 @@ public: break; case 63: me->HandleEmoteCommand(254); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); break; case 64: me->GetMotionMaster()->MoveCharge(-8000, 1400, 150, 9); diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp index 78810e27b05..03a04648793 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp @@ -106,7 +106,7 @@ class boss_saviana_ragefire : public CreatureScript break; case POINT_LAND: me->SetFlying(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->SetReactState(REACT_AGGRESSIVE); if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); @@ -121,7 +121,7 @@ class boss_saviana_ragefire : public CreatureScript { _JustReachedHome(); me->SetFlying(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); } void KilledUnit(Unit* victim) @@ -147,7 +147,7 @@ class boss_saviana_ragefire : public CreatureScript case EVENT_FLIGHT: { me->SetFlying(true); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->SetReactState(REACT_PASSIVE); me->GetMotionMaster()->MovePoint(POINT_FLIGHT, SavianaRagefireFlyPos); events.ScheduleEvent(EVENT_FLIGHT, 50000); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index 242b2f2f0ea..0e604566276 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -176,7 +176,7 @@ struct boss_twin_baseAI : public ScriptedAI me->SetReactState(REACT_PASSIVE); me->ModifyAuraState(m_uiAuraState, true); /* Uncomment this once that they are flying above the ground - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->SetFlying(true); */ m_bIsBerserk = false; @@ -576,7 +576,7 @@ struct mob_unleashed_ballAI : public ScriptedAI { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_PASSIVE); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->SetFlying(true); SetCombatMovement(false); MoveToNextPoint(); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index 70b07c61e79..8ee0ef02cbd 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -1058,7 +1058,7 @@ class npc_blood_queen_lana_thel : public CreatureScript void Reset() { _events.Reset(); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); if (_instance->GetBossState(DATA_BLOOD_PRINCE_COUNCIL) == DONE) { me->SetVisible(false); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index 79a577f6591..5eeb941d9aa 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -216,7 +216,7 @@ class boss_blood_queen_lana_thel : public CreatureScript _killMinchar = true; else { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); me->SetFlying(true); me->SendMovementFlagUpdate(); @@ -230,7 +230,7 @@ class boss_blood_queen_lana_thel : public CreatureScript if (_killMinchar) { _killMinchar = false; - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); me->SetFlying(true); me->GetMotionMaster()->MovePoint(POINT_MINCHAR, mincharPos); @@ -244,7 +244,7 @@ class boss_blood_queen_lana_thel : public CreatureScript void JustReachedHome() { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); me->SetFlying(false); me->SetReactState(REACT_AGGRESSIVE); @@ -295,7 +295,7 @@ class boss_blood_queen_lana_thel : public CreatureScript events.ScheduleEvent(EVENT_AIR_FLY_DOWN, 10000); break; case POINT_GROUND: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); me->SetFlying(false); me->SendMovementFlagUpdate(); @@ -424,7 +424,7 @@ class boss_blood_queen_lana_thel : public CreatureScript me->GetMotionMaster()->MovePoint(POINT_CENTER, centerPos); break; case EVENT_AIR_START_FLYING: - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); me->SetFlying(true); me->SendMovementFlagUpdate(); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index d171f069cad..5177f65f670 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -605,7 +605,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript _events.ScheduleEvent(EVENT_OUTRO_HORDE_3, 18000); // say _events.ScheduleEvent(EVENT_OUTRO_HORDE_4, 24000); // cast _events.ScheduleEvent(EVENT_OUTRO_HORDE_5, 30000); // move - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->SendMovementFlagUpdate(); me->Relocate(me->GetPositionX(), me->GetPositionY(), 539.2917f); me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 0.0f); @@ -629,7 +629,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript { if (spell->Id == SPELL_GRIP_OF_AGONY) { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->GetMotionMaster()->MovePoint(POINT_CHOKE, chokePos[0]); } } @@ -812,7 +812,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript { me->RemoveAurasDueToSpell(SPELL_GRIP_OF_AGONY); Talk(SAY_OUTRO_ALLIANCE_1); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->SendMovementFlagUpdate(); me->Relocate(me->GetPositionX(), me->GetPositionY(), 539.2917f); me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 0.0f); @@ -832,7 +832,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript { if (spell->Id == SPELL_GRIP_OF_AGONY) { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->GetMotionMaster()->MovePoint(POINT_CHOKE, chokePos[0]); } } @@ -934,7 +934,7 @@ class npc_saurfang_event : public CreatureScript { if (spell->Id == SPELL_GRIP_OF_AGONY) { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->GetMotionMaster()->MovePoint(POINT_CHOKE, chokePos[_index]); } } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 1d9c3c14897..a544f2f4710 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -199,7 +199,7 @@ class boss_sindragosa : public CreatureScript if (instance->GetData(DATA_SINDRAGOSA_FROSTWYRMS) != 255) { me->SetFlying(true); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); } } @@ -229,7 +229,7 @@ class boss_sindragosa : public CreatureScript BossAI::JustReachedHome(); instance->SetBossState(DATA_SINDRAGOSA, FAIL); me->SetFlying(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); } void KilledUnit(Unit* victim) @@ -276,7 +276,7 @@ class boss_sindragosa : public CreatureScript case POINT_FROSTWYRM_LAND: me->setActive(false); me->SetFlying(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->SetHomePosition(SindragosaLandPos); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetSpeed(MOVE_FLIGHT, 2.0f); @@ -293,7 +293,7 @@ class boss_sindragosa : public CreatureScript break; case POINT_LAND: me->SetFlying(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->SetReactState(REACT_DEFENSIVE); if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); @@ -426,7 +426,7 @@ class boss_sindragosa : public CreatureScript _isInAirPhase = true; Talk(SAY_AIR_PHASE); me->SetFlying(true); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->SetReactState(REACT_PASSIVE); Position pos; pos.Relocate(me); @@ -618,7 +618,7 @@ class npc_spinestalker : public CreatureScript if (_instance->GetData(DATA_SPINESTALKER) != 255) { me->SetFlying(true); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); } } @@ -661,7 +661,7 @@ class npc_spinestalker : public CreatureScript me->setActive(false); me->SetFlying(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->SetHomePosition(SpinestalkerLandPos); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -743,7 +743,7 @@ class npc_rimefang : public CreatureScript if (_instance->GetData(DATA_RIMEFANG) != 255) { me->SetFlying(true); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); } } @@ -786,7 +786,7 @@ class npc_rimefang : public CreatureScript me->setActive(false); me->SetFlying(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->SetHomePosition(RimefangLandPos); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 908ce37c604..7ca371d1c82 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -499,7 +499,7 @@ class boss_the_lich_king : public CreatureScript { _JustDied(); DoCastAOE(SPELL_PLAY_MOVIE, false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x03); me->GetMotionMaster()->MoveFall(); } @@ -1072,7 +1072,7 @@ class boss_the_lich_king : public CreatureScript DoCastAOE(SPELL_SOUL_BARRAGE); sCreatureTextMgr->SendSound(me, SOUND_PAIN, CHAT_MSG_MONSTER_YELL, 0, TEXT_RANGE_NORMAL, TEAM_OTHER, false); // set flight - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x03); me->GetMotionMaster()->MovePoint(POINT_LK_OUTRO_2, OutroFlying); break; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp index 16b1e7ac996..63f7c653c5a 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp @@ -296,7 +296,7 @@ public: { case EVENT_LIFTOFF: me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->SendMovementFlagUpdate(); events.ScheduleEvent(EVENT_ICEBOLT, 1500); iceboltCount = RAID_MODE(2, 3); @@ -340,7 +340,7 @@ public: return; case EVENT_LAND: me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->SendMovementFlagUpdate(); events.ScheduleEvent(EVENT_GROUND, 1500); return; diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 437d9980af3..64060464d7c 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -271,7 +271,7 @@ public: { me->SetHomePosition(_homePosition); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); BossAI::EnterEvadeMode(); @@ -354,7 +354,7 @@ public: { _EnterCombat(); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->SetFlying(false); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -412,7 +412,7 @@ public: void PrepareForVortex() { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->SetFlying(true); me->GetMotionMaster()->MovementExpired(); @@ -461,7 +461,7 @@ public: { SetPhase(PHASE_TWO, true); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->SetFlying(true); me->GetMotionMaster()->MoveIdle(); @@ -704,7 +704,7 @@ class spell_malygos_vortex_visual : public SpellScriptLoader // Anyway even with this issue, the boss does not enter in evade mode - this prevents iterate an empty list in the next vortex execution. malygos->SetInCombatWithZone(); - malygos->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + malygos->SetLevitate(false); malygos->SetFlying(false); malygos->GetMotionMaster()->MoveChase(caster->getVictim()); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp index eadc524348b..1671953aba1 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp @@ -575,7 +575,7 @@ class boss_stormcaller_brundir : public CreatureScript _Reset(); phase = 0; me->RemoveAllAuras(); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, false); // Should be interruptable unless overridden by spell (Overload) me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_STUN, false); // Reset immumity, Brundir should be stunnable by default RespawnEncounter(instance, me); @@ -681,7 +681,7 @@ class boss_stormcaller_brundir : public CreatureScript DoCast(RAID_MODE(SPELL_LIGHTNING_TENDRILS_10M, SPELL_LIGHTNING_TENDRILS_25M)); DoCast(SPELL_LIGHTNING_TENDRILS_VISUAL); me->AttackStop(); - //me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + //me->SetLevitate(true); me->GetMotionMaster()->Initialize(); me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), FINAL_FLIGHT_Z); events.DelayEvents(35000); @@ -708,7 +708,7 @@ class boss_stormcaller_brundir : public CreatureScript events.ScheduleEvent(EVENT_GROUND, 2500); break; case EVENT_GROUND: - //me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + //me->SetLevitate(false); me->RemoveAurasDueToSpell(RAID_MODE(SPELL_LIGHTNING_TENDRILS_10M, SPELL_LIGHTNING_TENDRILS_25M)); me->RemoveAurasDueToSpell(SPELL_LIGHTNING_TENDRILS_VISUAL); DoStartMovement(me->getVictim()); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index ad87c435bba..a4289b2eb06 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -161,7 +161,7 @@ public: if (Phase > INTRO) { me->SetFlying(true); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); } if (Phase > NORMAL) @@ -183,7 +183,7 @@ public: if (Phase > INTRO) { me->SetFlying(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->SetOrientation(1.58f); me->SendMovementFlagUpdate(); } @@ -326,7 +326,7 @@ public: case 2: arthas->CastSpell(me, SPELL_TRANSFORMING_CHANNEL, false); me->SetFlying(true); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); pos.Relocate(me); pos.m_positionZ += 8.0f; me->GetMotionMaster()->MoveTakeoff(0, pos, 3.30078125f); @@ -383,7 +383,7 @@ public: break; case 8: me->SetFlying(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->SendMovementFlagUpdate(); pos.Relocate(me); pos.m_positionX = me->GetHomePosition().GetPositionX(); @@ -417,7 +417,7 @@ public: if (me->IsWithinMeleeRange(me->getVictim()) && me->HasUnitMovementFlag(MOVEMENTFLAG_LEVITATING)) { me->SetFlying(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->SendMovementFlagUpdate(); } @@ -451,7 +451,7 @@ public: SetCombatMovement(false); me->SetFlying(true); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); Phase = SACRIFICING; sacrePhase = 0; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp index 29d6278124f..35bbb98fd77 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp @@ -218,7 +218,7 @@ public: m_uiActivedCreatureGUID = temp->GetGUID(); temp->CastSpell(me, SPELL_CHANNEL_SPIRIT_TO_YMIRON, true); temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); - temp->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + temp->SetLevitate(true); switch (m_uiActiveOrder[m_uiActivedNumber]) { case 0: m_bIsActiveWithBJORN = true; break; diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index c0c18b082bf..b0a42614ee3 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -867,7 +867,7 @@ public: Timer[EVENT_FLIGHT_SEQUENCE] = 2000; break; case 9: // land - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->StopMoving(); me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); for (uint8 i = 0; i < 2; ++i) @@ -1869,7 +1869,7 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::Reset() me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->setActive(false); Summons.DespawnAll(); } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index 0ec8addd9f1..2db259744df 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -779,7 +779,7 @@ public: void Reset() { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->setFaction(14); movement_timer = 0; ToxicSpore_Timer = 5000; diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp index 2e2ea1b7936..4f422da35ad 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp @@ -145,7 +145,7 @@ class boss_nazan : public CreatureScript flight = false; BellowingRoar_Timer = 6000; ConeOfFire_Timer = 12000; - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->SetWalk(true); me->GetMotionMaster()->Clear(); if (Unit* victim = SelectTarget(SELECT_TARGET_NEAREST, 0)) @@ -374,7 +374,7 @@ class boss_vazruden_the_herald : public CreatureScript if (summoned->GetEntry() == ENTRY_NAZAN) { CAST_AI(boss_nazan::boss_nazanAI, summoned->AI())->VazrudenGUID = VazrudenGUID; - summoned->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + summoned->SetLevitate(true); summoned->SetSpeed(MOVE_FLIGHT, 2.5f); if (victim) AttackStartNoMove(victim); diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index 7a50fb8cda2..6acd9bf6c99 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -224,7 +224,7 @@ public: me->setFaction(FACTION_DEFAULT); FlyTimer = 10000; - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->SetVisible(true); } @@ -271,7 +271,7 @@ public: PlayerGUID = 0; } me->SetVisible(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); me->RemoveCorpse(); } @@ -309,7 +309,7 @@ public: pos.m_positionZ += 25; } - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->GetMotionMaster()->MovePoint(1, pos); } } @@ -815,7 +815,7 @@ public: case 19: DoScriptText(LORD_ILLIDAN_SAY_7, Illi); return 5000; break; case 20: Illi->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - Illi->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + Illi->SetLevitate(true); return 500; break; case 21: DoScriptText(OVERLORD_SAY_5, me); return 500; break; case 22: diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 4915e5f15f2..4674d4584e1 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -421,7 +421,7 @@ public: float x, y, z; me->GetPosition(x, y, z); me->Relocate(x, y, z + 0.94f); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->HandleEmoteCommand(EMOTE_ONESHOT_DANCE); WorldPacket data; //send update position to client me->BuildHeartBeatMsg(&data); From dc28b924151374776aefa04935379ad095eb4c06 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 23 Feb 2012 13:01:16 +0100 Subject: [PATCH 0004/1149] Core: Random cleanup + compile fix --- .../game/AI/SmartScripts/SmartScriptMgr.cpp | 14 ++---- src/server/game/Battlegrounds/ArenaTeam.cpp | 4 +- .../Battlegrounds/Zones/BattlegroundAV.cpp | 15 ++++--- .../game/Entities/Creature/Creature.cpp | 20 ++++----- src/server/game/Entities/Creature/Creature.h | 4 +- src/server/game/Entities/Player/Player.cpp | 44 ++++++++----------- src/server/game/Entities/Unit/Unit.cpp | 30 ++++++++++--- src/server/game/Entities/Unit/Unit.h | 3 +- .../game/Handlers/AuctionHouseHandler.cpp | 22 +++++----- src/server/game/Handlers/CharacterHandler.cpp | 4 +- .../WaypointMovementGenerator.cpp | 2 +- src/server/game/Scripting/MapScripts.cpp | 12 ++--- .../game/Spells/Auras/SpellAuraEffects.cpp | 10 ++--- src/server/game/Spells/Spell.cpp | 14 +++--- src/server/game/Warden/WardenCheckMgr.cpp | 6 +-- src/server/scripts/Commands/cs_account.cpp | 3 +- .../SunwellPlateau/boss_kiljaeden.cpp | 12 +---- .../Ahnkahet/boss_prince_taldaram.cpp | 4 +- .../boss_grand_champions.cpp | 2 +- src/server/scripts/World/npcs_special.cpp | 2 +- 20 files changed, 114 insertions(+), 113 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index f99e317454c..4105012ac86 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -62,27 +62,19 @@ void SmartWaypointMgr::LoadFromDB() y = fields[3].GetFloat(); z = fields[4].GetFloat(); - WayPoint* wp = new WayPoint(id, x, y, z); - if (last_entry != entry) { - path = new WPPath; + waypoint_map[entry] = new WPPath(); last_id = 1; + count++; } if (last_id != id) - { sLog->outErrorDb("SmartWaypointMgr::LoadFromDB: Path entry %u, unexpected point id %u, expected %u.", entry, id, last_id); - } last_id++; - (*path)[id] = wp; + (*waypoint_map[entry])[id] = new WayPoint(id, x, y, z); - if (last_entry != entry) - { - count++; - waypoint_map[entry] = path; - } last_entry = entry; total++; } diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index 02707261d13..a5c34e4b7ee 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -295,8 +295,10 @@ void ArenaTeam::SetCaptain(uint64 guid) if (newCaptain) { newCaptain->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 0); + char const* oldCaptainName = oldCaptain ? oldCaptain->GetName() : ""; + uint32 oldCaptainLowGuid = oldCaptain ? oldCaptain->GetGUIDLow() : 0; sLog->outArena("Player: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team [Id: %u] [Type: %u].", - oldCaptain->GetName(), oldCaptain->GetGUIDLow(), newCaptain->GetName(), newCaptain->GetGUIDLow(), GetId(), GetType()); + oldCaptainName, oldCaptainLowGuid, newCaptain->GetName(), newCaptain->GetGUIDLow(), GetId(), GetType()); } } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index 801b522feab..5ea9fc67fed 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -1032,17 +1032,18 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object) std::vector ghost_list = m_ReviveQueue[BgCreatures[node]]; if (!ghost_list.empty()) { - Player* player; - WorldSafeLocsEntry const* ClosestGrave = NULL; + Player* waitingPlayer; // player waiting at graveyard for resurrection + WorldSafeLocsEntry const* closestGrave = NULL; for (std::vector::iterator itr = ghost_list.begin(); itr != ghost_list.end(); ++itr) { - player = ObjectAccessor::FindPlayer(*ghost_list.begin()); - if (!player) + waitingPlayer = ObjectAccessor::FindPlayer(*ghost_list.begin()); + if (!waitingPlayer) continue; - if (!ClosestGrave) - ClosestGrave = GetClosestGraveYard(player); + + if (!closestGrave) + closestGrave = GetClosestGraveYard(waitingPlayer); else - player->TeleportTo(GetMapId(), ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, player->GetOrientation()); + waitingPlayer->TeleportTo(GetMapId(), closestGrave->x, closestGrave->y, closestGrave->z, player->GetOrientation()); } m_ReviveQueue[BgCreatures[node]].clear(); } diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 3dfa1cece61..20bcfc8f41c 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2408,24 +2408,24 @@ bool Creature::IsDungeonBoss() const return cinfo && (cinfo->flags_extra & CREATURE_FLAG_EXTRA_DUNGEON_BOSS); } -void Creature::SetWalk(bool enable) +bool Creature::SetWalk(bool enable) { - if (enable) - AddUnitMovementFlag(MOVEMENTFLAG_WALKING); - else - RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + if (!Unit::SetWalk(enable)) + return false; + WorldPacket data(enable ? SMSG_SPLINE_MOVE_SET_WALK_MODE : SMSG_SPLINE_MOVE_SET_RUN_MODE, 9); data.append(GetPackGUID()); SendMessageToSet(&data, true); + return true; } -void Creature::SetLevitate(bool enable) +bool Creature::SetLevitate(bool enable) { - if (enable) - AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - else - RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + if (!Unit::SetLevitate(enable)) + return false; + WorldPacket data(enable ? SMSG_SPLINE_MOVE_GRAVITY_DISABLE : SMSG_SPLINE_MOVE_GRAVITY_ENABLE, 9); data.append(GetPackGUID()); SendMessageToSet(&data, true); + return true; } diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index bfe186329e1..40477de7c75 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -520,8 +520,8 @@ class Creature : public Unit, public GridObject, public MapCreature void AI_SendMoveToPacket(float x, float y, float z, uint32 time, uint32 MovementFlags, uint8 type); CreatureAI* AI() const { return (CreatureAI*)i_AI; } - void SetWalk(bool enable); - void SetLevitate(bool enable); + bool SetWalk(bool enable); + bool SetLevitate(bool enable); uint32 GetShieldBlockValue() const //dunno mob block value { diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index fde4f4c6959..632453a230f 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7944,14 +7944,12 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply _ApplyWeaponDamage(slot, proto, ssv, apply); // Apply feral bonus from ScalingStatValue if set - if (ssv) - if (int32 feral_bonus = ssv->getFeralBonus(proto->ScalingStatValue)) - ApplyFeralAPBonus(feral_bonus, apply); - - // Druids get feral AP bonus from weapon dps (lso use DPS from ScalingStatValue) - if (getClass() == CLASS_DRUID) - if (int32 feral_bonus = proto->getFeralBonus(ssv->getDPSMod(proto->ScalingStatValue))) + if (ssv && getClass() == CLASS_DRUID) + { + int32 feral_bonus = ssv->getFeralBonus(proto->ScalingStatValue) + proto->getFeralBonus(ssv->getDPSMod(proto->ScalingStatValue)); + if (feral_bonus) ApplyFeralAPBonus(feral_bonus, apply); + } } void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingStatValuesEntry const* ssv, bool apply) @@ -14071,12 +14069,10 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool menuItemBounds = sObjectMgr->GetGossipMenuItemsMapBounds(0); uint32 npcflags = 0; - Creature* creature = NULL; if (source->GetTypeId() == TYPEID_UNIT) { - creature = source->ToCreature(); - npcflags = creature->GetUInt32Value(UNIT_NPC_FLAGS); + npcflags = source->GetUInt32Value(UNIT_NPC_FLAGS); if (npcflags & UNIT_NPC_FLAG_QUESTGIVER && showQuests) PrepareQuestMenu(source->GetGUID()); } @@ -14091,7 +14087,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool if (!sConditionMgr->IsObjectMeetToConditions(this, source, itr->second.Conditions)) continue; - if (source->GetTypeId() == TYPEID_UNIT) + if (Creature* creature = source->ToCreature()) { if (!(itr->second.OptionNpcflag & npcflags)) continue; @@ -14164,10 +14160,8 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool break; } } - else if (source->GetTypeId() == TYPEID_GAMEOBJECT) + else if (GameObject* go = source->ToGameObject()) { - GameObject* go = source->ToGameObject(); - switch (itr->second.OptionType) { case GOSSIP_OPTION_GOSSIP: @@ -16002,9 +15996,9 @@ void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id) if (reqTarget != entry) // if entry doesn't match, check for killcredits referenced in template { CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(entry); - for (uint8 j = 0; j < MAX_KILL_CREDIT; ++j) - if (cinfo->KillCredit[j] == reqTarget) - entry = cinfo->KillCredit[j]; + for (uint8 k = 0; k < MAX_KILL_CREDIT; ++k) + if (cinfo->KillCredit[k] == reqTarget) + entry = cinfo->KillCredit[k]; } } } @@ -17649,7 +17643,7 @@ void Player::_LoadMailedItems(Mail* mail) { sLog->outError("Player %u has unknown item_template (ProtoType) in mailed items(GUID: %u template: %u) in mail (%u), deleted.", GetGUIDLow(), itemGuid, itemTemplate, mail->messageID); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_MAIL_ITEM); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_MAIL_ITEM); stmt->setUInt32(0, itemGuid); CharacterDatabase.Execute(stmt); @@ -17665,10 +17659,8 @@ void Player::_LoadMailedItems(Mail* mail) { sLog->outError("Player::_LoadMailedItems - Item in mail (%u) doesn't exist !!!! - item guid: %u, deleted from mail", mail->messageID, itemGuid); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEM); - + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEM); stmt->setUInt32(0, itemGuid); - CharacterDatabase.Execute(stmt); item->FSetState(ITEM_REMOVED); @@ -19044,20 +19036,22 @@ void Player::_SaveDailyQuestStatus(SQLTransaction& trans) stmt->setUInt32(0, GetGUIDLow()); trans->Append(stmt); for (uint32 quest_daily_idx = 0; quest_daily_idx < PLAYER_MAX_DAILY_QUESTS; ++quest_daily_idx) + { if (GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx)) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_DAILYQUESTSTATUS); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_DAILYQUESTSTATUS); stmt->setUInt32(0, GetGUIDLow()); stmt->setUInt32(1, GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx)); stmt->setUInt64(2, uint64(m_lastDailyQuestTime)); trans->Append(stmt); } + } if (!m_DFQuests.empty()) { for (DFQuestsDoneList::iterator itr = m_DFQuests.begin(); itr != m_DFQuests.end(); ++itr) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_DAILYQUESTSTATUS); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_DAILYQUESTSTATUS); stmt->setUInt32(0, GetGUIDLow()); stmt->setUInt32(1, (*itr)); stmt->setUInt64(2, uint64(m_lastDailyQuestTime)); @@ -19080,7 +19074,7 @@ void Player::_SaveWeeklyQuestStatus(SQLTransaction& trans) { uint32 quest_id = *iter; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_WEEKLYQUESTSTATUS); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_WEEKLYQUESTSTATUS); stmt->setUInt32(0, GetGUIDLow()); stmt->setUInt32(1, quest_id); trans->Append(stmt); @@ -19106,7 +19100,7 @@ void Player::_SaveSeasonalQuestStatus(SQLTransaction& trans) { uint32 quest_id = (*itr); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_SEASONALQUESTSTATUS); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_SEASONALQUESTSTATUS); stmt->setUInt32(0, GetGUIDLow()); stmt->setUInt32(1, quest_id); stmt->setUInt32(2, event_id); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 69fb9906efb..41d13f38cc8 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1469,8 +1469,8 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo if (GetTypeId() == TYPEID_PLAYER) { float bonusPct = 0; - AuraEffectList const& ResIgnoreAuras = GetAuraEffectsByType(SPELL_AURA_MOD_ARMOR_PENETRATION_PCT); - for (AuraEffectList::const_iterator itr = ResIgnoreAuras.begin(); itr != ResIgnoreAuras.end(); ++itr) + AuraEffectList const& armorPenAuras = GetAuraEffectsByType(SPELL_AURA_MOD_ARMOR_PENETRATION_PCT); + for (AuraEffectList::const_iterator itr = armorPenAuras.begin(); itr != armorPenAuras.end(); ++itr) { if ((*itr)->GetSpellInfo()->EquippedItemClass == -1) { @@ -15459,7 +15459,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) // Inform pets (if any) when player kills target) // MUST come after victim->setDeathState(JUST_DIED); or pet next target // selection will get stuck on same target and break pet react state - if (Player* player = ToPlayer()) + if (player) { Pet* pet = player->GetPet(); if (pet && pet->isAlive() && pet->isControlled()) @@ -17003,7 +17003,7 @@ void Unit::ExitVehicle(Position const* exitPosition) return; GetVehicleBase()->RemoveAurasByType(SPELL_AURA_CONTROL_VEHICLE, GetGUID()); - //! The following call would not even be executed successfully as the + //! The following call would not even be executed successfully as the //! SPELL_AURA_CONTROL_VEHICLE unapply handler already calls _ExitVehicle without //! specifying an exitposition. The subsequent call below would return on if (!m_vehicle). /*_ExitVehicle(exitPosition);*/ @@ -17456,10 +17456,28 @@ void Unit::SetFacingToObject(WorldObject* pObject) SetFacingTo(GetAngle(pObject)); } -void Unit::SetWalk(bool enable) +bool Unit::SetWalk(bool enable) { + if (enable == IsWalking()) + return false; + if (enable) AddUnitMovementFlag(MOVEMENTFLAG_WALKING); else RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); -} \ No newline at end of file + + return true; +} + +bool Unit::SetLevitate(bool enable) +{ + if (enable == IsLevitating()) + return false; + + if (enable) + AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + else + RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + + return true; +} diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 00f96f15a2c..0fe5f3d8ca3 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1627,7 +1627,8 @@ class Unit : public WorldObject void SendMovementFlagUpdate(); bool IsLevitating() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_LEVITATING);} bool IsWalking() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING);} - virtual void SetWalk(bool enable); + virtual bool SetWalk(bool enable); + virtual bool SetLevitate(bool enable); void SetInFront(Unit const* target); void SetFacingTo(float ori); diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index f99bfe52df3..45c0f7bed42 100755 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -309,28 +309,28 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) sAuctionMgr->AddAItem(newItem); auctionHouse->AddAuction(AH); - for (uint32 i = 0; i < itemsCount; ++i) + for (uint32 j = 0; j < itemsCount; ++j) { - Item* item = items[i]; + Item* item2 = items[j]; - if (item->GetCount() == count[i]) + if (item2->GetCount() == count[j]) { - _player->MoveItemFromInventory(item->GetBagSlot(), item->GetSlot(), true); + _player->MoveItemFromInventory(item2->GetBagSlot(), item2->GetSlot(), true); SQLTransaction trans = CharacterDatabase.BeginTransaction(); - item->DeleteFromInventoryDB(trans); - item->SaveToDB(trans); + item2->DeleteFromInventoryDB(trans); + item2->SaveToDB(trans); CharacterDatabase.CommitTransaction(trans); } else { - item->SetCount(item->GetCount() - count[i]); - item->SetState(ITEM_CHANGED, _player); - _player->ItemRemovedQuestCheck(item->GetEntry(), count[i]); - item->SendUpdateToPlayer(_player); + item2->SetCount(item2->GetCount() - count[j]); + item2->SetState(ITEM_CHANGED, _player); + _player->ItemRemovedQuestCheck(item2->GetEntry(), count[j]); + item2->SendUpdateToPlayer(_player); SQLTransaction trans = CharacterDatabase.BeginTransaction(); - item->SaveToDB(trans); + item2->SaveToDB(trans); CharacterDatabase.CommitTransaction(trans); } } diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index a48cf70bd54..30119c79d96 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1811,8 +1811,8 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD)) { // Reset guild - if (QueryResult result = CharacterDatabase.PQuery("SELECT guildid FROM `guild_member` WHERE guid ='%u'", lowGuid)) - if (Guild* guild = sGuildMgr->GetGuildById((result->Fetch()[0]).GetUInt32())) + if (QueryResult result2 = CharacterDatabase.PQuery("SELECT guildid FROM `guild_member` WHERE guid ='%u'", lowGuid)) + if (Guild* guild = sGuildMgr->GetGuildById((result2->Fetch()[0]).GetUInt32())) guild->DeleteMember(MAKE_NEW_GUID(lowGuid, 0, HIGHGUID_PLAYER)); } diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index fb2249c508e..a8602153de3 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -79,7 +79,7 @@ void WaypointMovementGenerator::OnArrived(Creature& creature) if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance) { sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Creature movement start script %u at point %u for "UI64FMTD".", i_path->at(i_currentNode)->event_id, i_currentNode, creature.GetGUID()); - creature.GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, &creature, NULL/*, false*/); + creature.GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, &creature, NULL); } // Inform script diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index 7757e1a1a35..fb2590ebbfe 100755 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -39,9 +39,9 @@ void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, O return; // prepare static data - uint64 sourceGUID = source ? source->GetGUID() : (uint64)0; //some script commands doesn't have source - uint64 targetGUID = target ? target->GetGUID() : (uint64)0; - uint64 ownerGUID = (source->GetTypeId() == TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : (uint64)0; + uint64 sourceGUID = source ? source->GetGUID() : uint64(0); //some script commands doesn't have source + uint64 targetGUID = target ? target->GetGUID() : uint64(0); + uint64 ownerGUID = (source && source->GetTypeId() == TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : uint64(0); ///- Schedule script execution for all scripts in the script map ScriptMap const* s2 = &(s->second); @@ -74,9 +74,9 @@ void Map::ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* sou // NOTE: script record _must_ exist until command executed // prepare static data - uint64 sourceGUID = source ? source->GetGUID() : (uint64)0; - uint64 targetGUID = target ? target->GetGUID() : (uint64)0; - uint64 ownerGUID = (source->GetTypeId() == TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : (uint64)0; + uint64 sourceGUID = source ? source->GetGUID() : uint64(0); + uint64 targetGUID = target ? target->GetGUID() : uint64(0); + uint64 ownerGUID = (source && source->GetTypeId() == TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : uint64(0); ScriptAction sa; sa.sourceGUID = sourceGUID; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 99497870a15..cb79bd00776 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4686,11 +4686,11 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool if (owner_aura) { owner_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount); - } - if (pet_aura) - { - pet_aura->SetCharges(0); - pet_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount); + if (pet_aura) + { + pet_aura->SetCharges(0); + pet_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount); + } } break; } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index b4ee4febbef..db36eb30191 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1126,7 +1126,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge case TYPEID_PLAYER: { Unit* unitTarget = (*itr)->ToUnit(); - if (unitTarget->isAlive() || !playerCaster->isHonorOrXPTarget(unitTarget) + if (unitTarget->isAlive() || !playerCaster->isHonorOrXPTarget(unitTarget) || ((unitTarget->GetCreatureTypeMask() & (1 << (CREATURE_TYPE_HUMANOID-1))) == 0) || (unitTarget->GetDisplayId() != unitTarget->GetNativeDisplayId())) break; @@ -1151,7 +1151,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge case 51328: // check if our target is not valid (spell can target ghoul or dead unit) if (!(m_targets.GetUnitTarget() && m_targets.GetUnitTarget()->GetDisplayId() == m_targets.GetUnitTarget()->GetNativeDisplayId() && - ((m_targets.GetUnitTarget()->GetEntry() == 26125 && m_targets.GetUnitTarget()->GetOwnerGUID() == m_caster->GetGUID()) + ((m_targets.GetUnitTarget()->GetEntry() == 26125 && m_targets.GetUnitTarget()->GetOwnerGUID() == m_caster->GetGUID()) || m_targets.GetUnitTarget()->isDead()))) { // remove existing targets @@ -1893,7 +1893,7 @@ void Spell::SearchChainTargets(std::list& targets, uint32 chainTar } // chain lightning/heal spells and similar - allow to jump at larger distance and go out of los - bool isBouncingFar = (m_spellInfo->AttributesEx4 & SPELL_ATTR4_AREA_TARGET_CHAIN + bool isBouncingFar = (m_spellInfo->AttributesEx4 & SPELL_ATTR4_AREA_TARGET_CHAIN || m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_NONE || m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC); @@ -4505,9 +4505,7 @@ void Spell::TakeReagents() if (m_caster->GetTypeId() != TYPEID_PLAYER) return; - ItemTemplate const* castItemTemplate = m_CastItem - ? m_CastItem->GetTemplate() - : NULL; + ItemTemplate const* castItemTemplate = m_CastItem ? m_CastItem->GetTemplate() : NULL; // do not take reagents for these item casts if (castItemTemplate && castItemTemplate->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST) @@ -7230,7 +7228,7 @@ namespace Trinity { WorldObjectSpellTargetCheck::WorldObjectSpellTargetCheck(Unit* caster, Unit* referer, SpellInfo const* spellInfo, - SpellTargetCheckTypes selectionType, ConditionList* condList) : _caster(caster), _referer(referer), _spellInfo(spellInfo), + SpellTargetCheckTypes selectionType, ConditionList* condList) : _caster(caster), _referer(referer), _spellInfo(spellInfo), _targetSelectionType(selectionType), _condList(condList) { if (condList) @@ -7304,7 +7302,7 @@ bool WorldObjectSpellTargetCheck::operator()(WorldObject* target) return sConditionMgr->IsObjectMeetToConditions(*_condSrcInfo, *_condList); } -WorldObjectSpellNearbyTargetCheck::WorldObjectSpellNearbyTargetCheck(float range, Unit* caster, SpellInfo const* spellInfo, +WorldObjectSpellNearbyTargetCheck::WorldObjectSpellNearbyTargetCheck(float range, Unit* caster, SpellInfo const* spellInfo, SpellTargetCheckTypes selectionType, ConditionList* condList) : WorldObjectSpellTargetCheck(caster, caster, spellInfo, selectionType, condList), _range(range), _position(caster) { diff --git a/src/server/game/Warden/WardenCheckMgr.cpp b/src/server/game/Warden/WardenCheckMgr.cpp index 77332bd30a8..589b666c035 100644 --- a/src/server/game/Warden/WardenCheckMgr.cpp +++ b/src/server/game/Warden/WardenCheckMgr.cpp @@ -82,7 +82,7 @@ void WardenCheckMgr::LoadWardenChecks() uint32 count = 0; do { - Field* fields = result->Fetch(); + fields = result->Fetch(); uint16 id = fields[0].GetUInt16(); uint8 checkType = fields[1].GetUInt8(); @@ -156,11 +156,11 @@ void WardenCheckMgr::LoadWardenChecks() uint32 overrideCount = 0; - if(overrideResult) + if (overrideResult) { do { - Field * fields = overrideResult->Fetch(); + fields = overrideResult->Fetch(); uint16 checkId = fields[0].GetUInt16(); diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 7372c92c4dd..df83fe8118f 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -502,11 +502,12 @@ public: stmt->setUInt32(0, targetAccountId); stmt->setUInt32(1, realmID); } + LoginDatabase.Execute(stmt); if (gm != 0) { - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_ACCESS); + stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_ACCESS); stmt->setUInt32(0, targetAccountId); stmt->setUInt8(1, uint8(gm)); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index 41806dcb308..02a8de14fdf 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -660,17 +660,9 @@ public: DoScriptText(RAND(SAY_KJ_REFLECTION1, SAY_KJ_REFLECTION2), me); for (uint8 i = 0; i < 4; ++i) { - float x, y, z; - Unit* target = NULL; - for (uint8 i = 0; i < 6; ++i) - { - target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - if (!target || !target->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, 0)) - break; - } - - if (target) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true, -SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT)) { + float x, y, z; target->GetPosition(x, y, z); if (Creature* pSinisterReflection = me->SummonCreature(CREATURE_SINISTER_REFLECTION, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0)) { diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp index 0f4b046f7d5..636be5e29be 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp @@ -389,8 +389,10 @@ public: bool OnGossipHello(Player* /*player*/, GameObject* pGO) { InstanceScript* instance = pGO->GetInstanceScript(); + if (!instance) + return true; - Creature* pPrinceTaldaram = Unit::GetCreature(*pGO, instance ? instance->GetData64(DATA_PRINCE_TALDARAM) : 0); + Creature* pPrinceTaldaram = Unit::GetCreature(*pGO, instance->GetData64(DATA_PRINCE_TALDARAM)); if (pPrinceTaldaram && pPrinceTaldaram->isAlive()) { // maybe these are hacks :( diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp index 9fcfcfa47e5..7c82454ba87 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -208,7 +208,7 @@ public: switch (i) { case 2: - if ((instance && uiWaypointPath == 3) || uiWaypointPath == 2) + if (instance && (uiWaypointPath == 3 || uiWaypointPath == 2)) instance->SetData(DATA_MOVEMENT_DONE, instance->GetData(DATA_MOVEMENT_DONE)+1); break; case 3: diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 4674d4584e1..8513eae5876 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -137,8 +137,8 @@ public: if (!spawnedTemplate) { - SpawnAssoc = NULL; sLog->outErrorDb("TCSR: Creature template entry %u does not exist in DB, which is required by npc_air_force_bots", SpawnAssoc->spawnedCreatureEntry); + SpawnAssoc = NULL; return; } } From 40cda6b095a294a94bcd9b3484a57c26feedb13d Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 23 Feb 2012 13:07:51 +0100 Subject: [PATCH 0005/1149] Copypaste fix --- src/server/game/Entities/Unit/Unit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 41d13f38cc8..f9d287d271a 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17475,9 +17475,9 @@ bool Unit::SetLevitate(bool enable) return false; if (enable) - AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); else - RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); return true; } From adc115dc41a7af07ab27f35db674568fd88d05db Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 23 Feb 2012 15:56:53 +0100 Subject: [PATCH 0006/1149] Core/Vmaps: Fixed errors during loading gameobject models and improved error output (will now write to logs) --- .../collision/Models/GameObjectModel.cpp | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp index 1abbc59a5b0..c0bcdd1e782 100644 --- a/src/server/collision/Models/GameObjectModel.cpp +++ b/src/server/collision/Models/GameObjectModel.cpp @@ -33,6 +33,8 @@ using G3D::Vector3; using G3D::Ray; using G3D::AABox; +#ifndef NO_CORE_FUNCS + struct GameobjectModelData { GameobjectModelData(const std::string& name_, const AABox& box) : @@ -47,23 +49,30 @@ ModelList model_list; void LoadGameObjectModelList() { + uint32 oldMSTime = getMSTime(); FILE* model_list_file = fopen((sWorld->GetDataPath() + "vmaps/" + VMAP::GAMEOBJECT_MODELS).c_str(), "rb"); if (!model_list_file) + { + sLog->outError("Unable to open '%s' file.", VMAP::GAMEOBJECT_MODELS); return; + } uint32 name_length, displayId; char buff[500]; - while (!feof(model_list_file)) + while (true) { Vector3 v1, v2; - if (fread(&displayId, sizeof(uint32), 1, model_list_file) != 1 - || fread(&name_length, sizeof(uint32), 1, model_list_file) != 1 + if (fread(&displayId, sizeof(uint32), 1, model_list_file) != 1) + if (feof(model_list_file)) // EOF flag is only set after failed reading attempt + break; + + if (fread(&name_length, sizeof(uint32), 1, model_list_file) != 1 || name_length >= sizeof(buff) || fread(&buff, sizeof(char), name_length, model_list_file) != name_length || fread(&v1, sizeof(Vector3), 1, model_list_file) != 1 || fread(&v2, sizeof(Vector3), 1, model_list_file) != 1) { - printf("\nFile '%s' seems to be corrupted", VMAP::GAMEOBJECT_MODELS); + sLog->outError("File '%s' seems to be corrupted!", VMAP::GAMEOBJECT_MODELS); break; } @@ -72,7 +81,10 @@ void LoadGameObjectModelList() ModelList::value_type( displayId, GameobjectModelData(std::string(buff,name_length),AABox(v1,v2)) ) ); } + fclose(model_list_file); + sLog->outString(">> Loaded %d GameObject models in %u ms", model_list.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } GameObjectModel::~GameObjectModel() @@ -91,7 +103,7 @@ bool GameObjectModel::initialize(const GameObject& go, const GameObjectDisplayIn // ignore models with no bounds if (mdl_box == G3D::AABox::zero()) { - std::cout << "Model " << it->second.name << " has zero bounds, loading skipped" << std::endl; + sLog->outError("GameObject model %s has zero bounds, loading skipped", it->second.name); return false; } @@ -171,3 +183,5 @@ bool GameObjectModel::intersectRay(const G3D::Ray& ray, float& MaxDist, bool Sto } return hit; } + +#endif From 8ae3037307c9ca2ebc17fae286f59b51bc4b1c79 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 23 Feb 2012 16:14:50 +0100 Subject: [PATCH 0007/1149] Compile fix for gcc 4.5 and higher --- src/server/collision/Models/GameObjectModel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp index c0bcdd1e782..1c3a0aa639e 100644 --- a/src/server/collision/Models/GameObjectModel.cpp +++ b/src/server/collision/Models/GameObjectModel.cpp @@ -83,7 +83,7 @@ void LoadGameObjectModelList() } fclose(model_list_file); - sLog->outString(">> Loaded %d GameObject models in %u ms", model_list.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> Loaded %u GameObject models in %u ms", model_list.size(), GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } @@ -103,7 +103,7 @@ bool GameObjectModel::initialize(const GameObject& go, const GameObjectDisplayIn // ignore models with no bounds if (mdl_box == G3D::AABox::zero()) { - sLog->outError("GameObject model %s has zero bounds, loading skipped", it->second.name); + sLog->outError("GameObject model %s has zero bounds, loading skipped", it->second.name.c_str()); return false; } From c27a0333ceaeeb9c499f54670cbc40d4ce8cd9c5 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 23 Feb 2012 12:06:43 -0500 Subject: [PATCH 0008/1149] Core/Scripts: script despawn for dummy effect of muisek vessels --- ...2012_02_23_00_world_spell_script_names.sql | 7 +++++ src/server/scripts/Spells/spell_item.cpp | 29 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 sql/updates/world/2012_02_23_00_world_spell_script_names.sql diff --git a/sql/updates/world/2012_02_23_00_world_spell_script_names.sql b/sql/updates/world/2012_02_23_00_world_spell_script_names.sql new file mode 100644 index 00000000000..6ea96033091 --- /dev/null +++ b/sql/updates/world/2012_02_23_00_world_spell_script_names.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` in (11885,11886,11887,11888,11889); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(11885,'spell_item_muisek_vessel'), +(11886,'spell_item_muisek_vessel'), +(11887,'spell_item_muisek_vessel'), +(11888,'spell_item_muisek_vessel'), +(11889,'spell_item_muisek_vessel'); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 416869d98ce..388ee8fd3cd 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1994,6 +1994,34 @@ class spell_item_refocus : public SpellScriptLoader } }; +class spell_item_muisek_vessel : public SpellScriptLoader +{ + public: + spell_item_muisek_vessel() : SpellScriptLoader("spell_item_muisek_vessel") { } + + class spell_item_muisek_vessel_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_muisek_vessel_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Creature* target = GetHitCreature()) + if (target->isDead()) + target->ForcedDespawn(); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_muisek_vessel_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_muisek_vessel_SpellScript(); + } +}; + void AddSC_item_spell_scripts() { // 23074 Arcanite Dragonling @@ -2045,4 +2073,5 @@ void AddSC_item_spell_scripts() new spell_item_unusual_compass(); new spell_item_uded(); new spell_item_chicken_cover(); + new spell_item_muisek_vessel(); } From 348ed1782f8d67cccf03aab3adca08d87c8ffdb6 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 23 Feb 2012 12:45:04 -0500 Subject: [PATCH 0009/1149] Core/Scripts: fix rotface ooze flood (thx to vincent-michael) --- src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index 9649b6c8ef8..09707b2d9ab 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -441,6 +441,10 @@ class spell_rotface_ooze_flood : public SpellScriptLoader std::list triggers; GetHitUnit()->GetCreatureListWithEntryInGrid(triggers, GetHitUnit()->GetEntry(), 12.5f); + + if (triggers.empty()) + return; + triggers.sort(Trinity::ObjectDistanceOrderPred(GetHitUnit())); GetHitUnit()->CastSpell(triggers.back(), uint32(GetEffectValue()), false, NULL, NULL, GetOriginalCaster() ? GetOriginalCaster()->GetGUID() : 0); } From a3755f8355e64c9efc3033977e39af3b157368f6 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Fri, 24 Feb 2012 11:22:13 +0100 Subject: [PATCH 0010/1149] DB/Loot: Add Primordial Saronite to Deathbringer and Dreamwalker Closes #5381 --- .../2012_02_24_00_world_gameobject_loot_template.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 sql/updates/world/2012_02_24_00_world_gameobject_loot_template.sql diff --git a/sql/updates/world/2012_02_24_00_world_gameobject_loot_template.sql b/sql/updates/world/2012_02_24_00_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..daecfc02dfc --- /dev/null +++ b/sql/updates/world/2012_02_24_00_world_gameobject_loot_template.sql @@ -0,0 +1,10 @@ +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (28058,28074,28088,28064,28082,28096) AND `item`=49908; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Deathbringer's Cache +(28058,49908,20,1,0,1,1), -- Primordial Saronite 10H +(28074,49908,20,1,0,1,1), -- Primordial Saronite 25N +(28088,49908,20,1,0,1,1), -- Primordial Saronite 25H +-- Cache of the Dreamwalker +(28064,49908,20,1,0,1,1), -- Primordial Saronite 10H +(28082,49908,20,1,0,1,1), -- Primordial Saronite 25N +(28096,49908,20,1,0,1,1); -- Primordial Saronite 25H From c4b6dc3a15ccf5eb3b28d453d65a1e0556188015 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 24 Feb 2012 16:45:57 +0000 Subject: [PATCH 0011/1149] Core/Calendar: Initial work for calendar Original author: Silinoron (from calendar branch) --- src/server/game/Calendar/Calendar.cpp | 2 + src/server/game/Calendar/Calendar.h | 57 +++- src/server/game/Calendar/CalendarMgr.cpp | 80 ++++++ src/server/game/Calendar/CalendarMgr.h | 71 +++++ src/server/game/Handlers/CalendarHandler.cpp | 286 +++++++++++++------ src/server/game/Server/WorldSession.h | 3 + 6 files changed, 404 insertions(+), 95 deletions(-) create mode 100644 src/server/game/Calendar/CalendarMgr.cpp create mode 100644 src/server/game/Calendar/CalendarMgr.h diff --git a/src/server/game/Calendar/Calendar.cpp b/src/server/game/Calendar/Calendar.cpp index 2c4ad943dd6..2dadd66f64c 100755 --- a/src/server/game/Calendar/Calendar.cpp +++ b/src/server/game/Calendar/Calendar.cpp @@ -15,3 +15,5 @@ * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ + +#include "Calendar.h" diff --git a/src/server/game/Calendar/Calendar.h b/src/server/game/Calendar/Calendar.h index dfc88e477f9..c53ba8bf113 100755 --- a/src/server/game/Calendar/Calendar.h +++ b/src/server/game/Calendar/Calendar.h @@ -19,8 +19,61 @@ #ifndef TRINITY_CALENDAR_H #define TRINITY_CALENDAR_H -class Calendar -{ +#include "Common.h" +// TODO - Get correct values +enum CalendarEventType +{ + CALENDARTYPE_RAID = 0, + CALENDARTYPE_DUNGEON, + CALENDARTYPE_PVP, + CALENDARTYPE_MEETING, + CALENDARTYPE_OTHER, }; + +// TODO - Get correct values +enum CalendarInviteStatus +{ + CALENDARSTATUS_INVITED = 0, + CALENDARSTATUS_ACCEPTED, + CALENDARSTATUS_DECLINED, + CALENDARSTATUS_TENTATIVE, + CALENDARSTATUS_OUT, + CALENDARSTATUS_STANDBY, + CALENDARSTATUS_CONFIRMED, +}; + +struct CalendarEvent +{ + uint64 Id; + uint64 CreatorGuid; + std::string Name; + std::string Description; + uint8 Type; + uint8 Unk; + uint32 DungeonId; + uint32 UnkTime; + uint32 Time; + uint32 Flags; + uint32 GuildId; +}; + +struct CalendarInvite +{ + uint64 Id; + uint64 Event; + uint8 Status; + uint8 Rank; + uint8 Unk1; + uint8 Unk2; + uint8 Unk3; + std::string Text; + uint64 CreatorGuid; + uint32 Time; + uint64 TargetGuid; +}; + +typedef UNORDERED_MAP CalendarInviteMap; +typedef UNORDERED_MAP CalendarEventMap; + #endif diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp new file mode 100644 index 00000000000..d947faed42f --- /dev/null +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2008-2012 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "CalendarMgr.h" +#include "QueryResult.h" + +CalendarMgr::CalendarMgr() : _currentEventId(0), _currentInviteId(0) +{ +} + +CalendarMgr::~CalendarMgr() +{ +} + +void CalendarMgr::AppendInvitesToCalendarPacketForPlayer(WorldPacket& data, Player* player) +{ + size_t pCounter = data.wpos(); + data << uint32(0); + uint32 counter = 0; + for (CalendarInviteMap::iterator itr = _inviteMap.begin(); itr != _inviteMap.end(); ++itr) + { + CalendarInvite invite = itr->second; + if (invite.TargetGuid == player->GetGUID()) + { + data << uint64(invite.Id); // Invite ID + data << uint64(invite.Event); // Event ID + data << uint8(invite.Rank); // rank + data << uint8(0); // unk - TODO: Figure out what this is + data << uint8(0); // unk + data.appendPackGUID(invite.CreatorGuid); // creator's guid + counter++; + } + } + data.put(pCounter, counter); // update number of invites +} + +void CalendarMgr::AppendEventsToCalendarPacketForPlayer(WorldPacket& data, Player* player) +{ + // TODO: There's gotta be a better way to do this + size_t pCounter = data.wpos(); + data << uint32(0); + uint32 counter = 0; + std::set alreadyAdded; + for (CalendarInviteMap::iterator itr = _inviteMap.begin(); itr != _inviteMap.end(); ++itr) + { + CalendarInvite invite = itr->second; + if (invite.TargetGuid == player->GetGUID()) + { + if (alreadyAdded.find(invite.Event) == alreadyAdded.end()) + { + CalendarEvent const* event = GetEvent(invite.Event); + data << uint64(event->Id); // event ID + data << event->Name; // event title + data << uint32(event->Type); // event type + data << uint32(event->Time); // event time as time bit field + data << uint32(event->Flags); // event flags + data << uint32(event->DungeonId); // dungeon ID + data.appendPackGUID(event->CreatorGuid); // creator guid + alreadyAdded.insert(invite.Event); + counter++; + } + } + } + data.put(pCounter, counter); // update number of invites +} diff --git a/src/server/game/Calendar/CalendarMgr.h b/src/server/game/Calendar/CalendarMgr.h new file mode 100644 index 00000000000..50acde647cc --- /dev/null +++ b/src/server/game/Calendar/CalendarMgr.h @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2008-2012 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef TRINITY_CALENDARMGR_H +#define TRINITY_CALENDARMGR_H + +#include +#include "Calendar.h" +#include "Player.h" + +class CalendarMgr +{ + friend class ACE_Singleton; + +public: + CalendarMgr(); + ~CalendarMgr(); + + CalendarInvite const* GetInvite(uint64 inviteId) + { + CalendarInviteMap::const_iterator itr = _inviteMap.find(inviteId); + if(itr != _inviteMap.end()) + return &itr->second; + return NULL; + } + + void AddInvite(CalendarInvite invite) { _inviteMap[invite.Id] = invite; } + void RemoveInvite(uint64 inviteId) { _inviteMap.erase(inviteId); } + + CalendarEvent const* GetEvent(uint64 eventId) + { + CalendarEventMap::const_iterator itr = _eventMap.find(eventId); + if(itr != _eventMap.end()) + return &itr->second; + return NULL; + } + + void AddEvent(CalendarEvent event) { _eventMap[event.Id] = event; } + void RemoveEvent(uint64 eventId) { _eventMap.erase(eventId); } + + void AppendInvitesToCalendarPacketForPlayer(WorldPacket& data, Player* player); + void AppendEventsToCalendarPacketForPlayer(WorldPacket& data, Player* player); + + uint64 GetNextEventId() { return ++_currentEventId; } + uint64 GetNextInviteId() { return ++_currentInviteId; } + +private: + CalendarInviteMap _inviteMap; + CalendarEventMap _eventMap; + uint64 _currentEventId; + uint64 _currentInviteId; +}; + +#define sCalendarMgr ACE_Singleton::instance() + +#endif diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 820079a90e1..33ecbf8cac5 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -20,6 +20,7 @@ #include "WorldPacket.h" #include "WorldSession.h" +#include "CalendarMgr.h" #include "InstanceSaveMgr.h" #include "Log.h" #include "Opcodes.h" @@ -33,45 +34,25 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) time_t cur_time = time_t(time(NULL)); sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_SEND_CALENDAR [" UI64FMTD "]", guid); + // we can't really get the real size of this packet... WorldPacket data(SMSG_CALENDAR_SEND_CALENDAR, 4+4*0+4+4*0+4+4); - data << uint32(0); // invite count - /* - for (;;) - { - uint64 inviteId; - uint64 unkGuid0; - uint8 unk1, unk2, unk3; - uint64 creatorGuid; - } - */ - - data << uint32(0); // event count - /* - for (;;) - { - uint64 eventId; - std::string title; // 128 chars - uint32 type; - uint32 occurrenceTime; - uint32 flags; - uint32 unk4; -- possibly mapid for dungeon/raid - uint64 creatorGuid; - } - */ - - data << uint32(cur_time); // server time - data << uint32(secsToTimeBitFields(cur_time)); // server time + sCalendarMgr->AppendInvitesToCalendarPacketForPlayer(data, GetPlayer()); + sCalendarMgr->AppendEventsToCalendarPacketForPlayer(data, GetPlayer()); + data << uint32(cur_time); // current time + data << uint32(secsToTimeBitFields(cur_time)); // unknown packed time + + InstanceSave *save = NULL; uint32 counter = 0; size_t p_counter = data.wpos(); - data << uint32(counter); // instance save count + data << uint32(counter); // instance reset count for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) for (Player::BoundInstancesMap::const_iterator itr = _player->m_boundInstances[i].begin(); itr != _player->m_boundInstances[i].end(); ++itr) if (itr->second.perm) { - InstanceSave const* save = itr->second.save; + save = itr->second.save; data << uint32(save->GetMapId()); data << uint32(save->GetDifficulty()); data << uint32(save->GetResetTime() - cur_time); @@ -111,83 +92,127 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) data.put(p_counter, counter); - data << uint32(0); // holiday count? - /* - for (;;) + + // TODO: Fix this -- read from DBC? + std::string holidayName = ""; + uint32 holidayCount = 0; + data << uint32(holidayCount); // holiday count + for (uint32 i = 0; i < holidayCount; ++i) { - uint32 unk5, unk6, unk7, unk8, unk9; - for (uint32 j = 0; j < 26; ++j) - { - uint32 unk10; - } - for (uint32 j = 0; j < 10; ++j) - { - uint32 unk11; - } - for (uint32 j = 0; j < 10; ++j) - { - uint32 unk12; - } - std::string holidayName; // 64 chars + data << uint32(0); // Unk + data << uint32(0); // Unk + data << uint32(0); // Unk + data << uint32(0); // Unk + data << uint32(0); // Unk + for (uint8 j = 0; j < 26; ++j) + data << uint32(0); // Unk + for (uint8 j = 0; j < 10; ++j) + data << uint32(0); // Unk + for (uint8 j = 0; j < 10; ++j) + data << uint32(0); // Unk + data << holidayName.c_str(); // holiday name } - */ SendPacket(&data); } void WorldSession::HandleCalendarGetEvent(WorldPacket& recv_data) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_GET_EVENT"); - recv_data.read_skip(); // unk + uint64 eventId; + recv_data >> eventId; + if (!eventId) + return; + //SendCalendarEvent(eventId); } void WorldSession::HandleCalendarGuildFilter(WorldPacket& recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_GUILD_FILTER"); - recv_data.read_skip(); // unk1 - recv_data.read_skip(); // unk2 - recv_data.read_skip(); // unk3 + + uint32 unk1; + uint32 unk2; + uint32 unk3; + recv_data >> unk1; + recv_data >> unk2; + recv_data >> unk3; } void WorldSession::HandleCalendarArenaTeam(WorldPacket& recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_ARENA_TEAM"); - recv_data.read_skip(); // unk + + uint32 unk1; + recv_data >> unk1; } void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_ADD_EVENT"); - recv_data.rfinish(); // set to end to avoid warnings spam + + std::string title; + std::string description; + uint8 type; + uint8 unkbyte; + uint32 maxInvites; + uint32 dungeonId; + uint32 eventPackedTime; + uint32 unkPackedTime; + uint32 flags; - //std::string unk1, unk2; - //recv_data >> (std::string)unk1; - //recv_data >> (std::string)unk2; + recv_data >> title; + recv_data >> description; + recv_data >> type; + recv_data >> unkbyte; + recv_data >> maxInvites; + recv_data >> dungeonId; + recv_data >> eventPackedTime; + recv_data >> unkPackedTime; + recv_data >> flags; - //uint8 unk3, unk4; - //uint32 unk5, unk6, unk7, unk8, unk9, count = 0; - //recv_data >> (uint8)unk3; - //recv_data >> (uint8)unk4; - //recv_data >> (uint32)unk5; - //recv_data >> (uint32)unk6; - //recv_data >> (uint32)unk7; - //recv_data >> (uint32)unk8; - //recv_data >> (uint32)unk9; - //if (!((unk9 >> 6) & 1)) - //{ - // recv_data >> (uint32)count; - // if (count) - // { - // uint8 unk12, unk13; - // uint64 guid; - // for (int i=0; i> (uint8)unk12; - // recv_data >> (uint8)unk13; - // } - // } - //} + CalendarEvent event; + event.Id = sCalendarMgr->GetNextEventId(); + event.Name = title; + event.Description = description; + event.Type = type; + event.Unk = unkbyte; + event.DungeonId = dungeonId; + event.Flags = flags; + event.Time = eventPackedTime; + event.UnkTime = unkPackedTime; + event.CreatorGuid = GetPlayer()->GetGUID(); + + sCalendarMgr->AddEvent(event); + + if (((flags >> 6) & 1)) + return; + + uint32 inviteCount; + recv_data >> inviteCount; + + if (!inviteCount) + return; + + uint64 guid; + uint8 status; + uint8 rank; + for (int32 i = 0; i < inviteCount; ++i) + { + CalendarInvite invite; + invite.Id = sCalendarMgr->GetNextInviteId(); + recv_data.readPackGUID(guid); + recv_data >> status; + recv_data >> rank; + invite.Event = event.Id; + invite.CreatorGuid = GetPlayer()->GetGUID(); + invite.TargetGuid = guid; + invite.Status = status; + invite.Rank = rank; + invite.Time = event.Time; + invite.Text = ""; // hmm... + invite.Unk1 = invite.Unk2 = invite.Unk3 = 0; + sCalendarMgr->AddInvite(invite); + } + //SendCalendarEvent(eventId, true); } void WorldSession::HandleCalendarUpdateEvent(WorldPacket& recv_data) @@ -211,12 +236,14 @@ void WorldSession::HandleCalendarUpdateEvent(WorldPacket& recv_data) void WorldSession::HandleCalendarRemoveEvent(WorldPacket& recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_REMOVE_EVENT"); - recv_data.rfinish(); // set to end to avoid warnings spam - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint32 + uint64 eventId; + uint64 creatorGuid; + uint32 unk1; + recv_data >> eventId; + recv_data >> creatorGuid; + recv_data >> unk1; } void WorldSession::HandleCalendarCopyEvent(WorldPacket& recv_data) @@ -233,14 +260,22 @@ void WorldSession::HandleCalendarCopyEvent(WorldPacket& recv_data) void WorldSession::HandleCalendarEventInvite(WorldPacket& recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_EVENT_INVITE"); + + uint64 eventId; + uint64 inviteId; + std::string name; + uint8 status; + uint8 rank; + + recv_data >> eventId; + recv_data >> inviteId; + recv_data >> name; + recv_data >> status; + recv_data >> rank; + + //FIXME - Finish it + recv_data.rfinish(); // set to end to avoid warnings spam - - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> std::string - //recv_data >> uint8 - //recv_data >> uint8 - } void WorldSession::HandleCalendarEventRsvp(WorldPacket& recv_data) @@ -304,6 +339,71 @@ void WorldSession::HandleCalendarGetNumPending(WorldPacket& /*recv_data*/) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_GET_NUM_PENDING"); // empty WorldPacket data(SMSG_CALENDAR_SEND_NUM_PENDING, 4); - data << uint32(0); // 0 - no pending invites, 1 - some pending invites + data << uint32(0); // number of pending invites + SendPacket(&data); +} + +void WorldSession::SendCalendarEvent(uint64 eventId, bool added) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_SEND_EVENT"); + WorldPacket data(SMSG_CALENDAR_SEND_EVENT); + data << uint8(added); // from add_event + data.appendPackGUID(0); // creator GUID + data << uint64(0); // event ID + data << uint8(0); // event name + data << uint8(0); // event description + data << uint8(0); // event type + data << uint8(0); // unk + data << uint32(100); // Max invites + data << int32(0); // dungeon ID + data << uint32(0); // unk time + data << uint32(0); // event time + data << uint32(0); // event flags + data << uint32(0); // event guild id + + if (false) // invites exist + { + data << uint32(0); // invite count + for (uint8 i = 0; i < 0; ++i) + { + data << uint64(0); // invite played guid + data << uint8(0); // unk + data << uint8(0); // status + data << uint8(0); // rank + data << uint8(0); // unk + data << uint64(0); // invite ID + data << uint32(0); // unk + data << uint8(0); // text + } + } + SendPacket(&data); +} + +void WorldSession::SendCalendarEventInviteAlert(uint64 eventId, uint64 inviteId) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_INVITE_ALERT"); + WorldPacket data(SMSG_CALENDAR_EVENT_INVITE_ALERT); + data << uint64(0); // event ID + data << uint8(0); // event title + data << uint32(0); // event time + uint32 unknum = 1; + data << uint32(unknum); + data << uint8(0); // event type + data << uint32(0); // dungeon id + data << uint64(0); // invite id + data << uint8(0); // invite status + data << uint8(0); // invite rank + data.appendPackGUID(0); // event creator + data.appendPackGUID(0); // invite sender + SendPacket(&data); +} + +void WorldSession::SendCalendarEventRemovedAlert(uint64 eventId) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_REMOVED_ALERT"); + WorldPacket data(SMSG_CALENDAR_EVENT_REMOVED_ALERT); + data << uint8(0); // unk + data << uint64(0); // invite id + data << uint32(0); // invite time SendPacket(&data); } diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 90772bfeab9..47c48e96de0 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -878,6 +878,9 @@ class WorldSession void HandleCalendarEventModeratorStatus(WorldPacket& recv_data); void HandleCalendarComplain(WorldPacket& recv_data); void HandleCalendarGetNumPending(WorldPacket& recv_data); + void SendCalendarEvent(uint64 eventId, bool added = false); + void SendCalendarEventInviteAlert(uint64 eventId, uint64 inviteId); + void SendCalendarEventRemovedAlert(uint64 eventId); void HandleSpellClick(WorldPacket& recv_data); void HandleMirrorImageDataRequest(WorldPacket& recv_data); From 9c3357c1def39f7fcc21a2d7d41a3d8952900372 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 24 Feb 2012 19:06:53 +0100 Subject: [PATCH 0012/1149] Core/Calendar * Fixed raid resets display in calendar * Active instance locks will now be added to calendar as soon as they are created (not after login) --- src/server/game/Entities/Player/Player.cpp | 9 +++++++++ src/server/game/Handlers/CalendarHandler.cpp | 14 +++++++++----- src/server/game/Maps/Map.cpp | 9 +++++++++ 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 632453a230f..c8141d27b80 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -18185,6 +18185,15 @@ void Player::BindToInstance() data << uint32(0); GetSession()->SendPacket(&data); BindToInstance(mapSave, true); + + time_t currTime = time(NULL); + data.Initialize(SMSG_CALENDAR_RAID_LOCKOUT_ADDED, 4 + 4 + 4 + 4 + 8); + data << uint32(secsToTimeBitFields(currTime)); + data << uint32(mapSave->GetMapId()); + data << uint32(mapSave->GetDifficulty()); + data << uint32(mapSave->GetResetTime() - currTime); + data << uint64(mapSave->GetInstanceId()); + GetSession()->SendPacket(&data); } void Player::SendRaidInfo() diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 33ecbf8cac5..5cd67b0ffbc 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -42,7 +42,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) data << uint32(cur_time); // current time data << uint32(secsToTimeBitFields(cur_time)); // unknown packed time - + InstanceSave *save = NULL; uint32 counter = 0; size_t p_counter = data.wpos(); @@ -74,7 +74,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) for (ResetTimeByMapDifficultyMap::const_iterator itr = resets.begin(); itr != resets.end(); ++itr) { uint32 mapId = PAIR32_LOPART(itr->first); - + Difficulty difficulty = Difficulty(PAIR32_HIPART(itr->first)); if (sentMaps.find(mapId) != sentMaps.end()) continue; @@ -82,10 +82,14 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) if (!mapEntry || !mapEntry->IsRaid()) continue; + MapDifficulty const* diff = GetMapDifficultyData(mapId, difficulty); + if (!diff) + continue; + sentMaps.insert(mapId); data << uint32(mapId); - data << uint32(itr->second - cur_time); + data << uint32(diff->resetTime); data << uint32(mapEntry->unk_time); ++counter; } @@ -148,7 +152,7 @@ void WorldSession::HandleCalendarArenaTeam(WorldPacket& recv_data) void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_ADD_EVENT"); - + std::string title; std::string description; uint8 type; @@ -365,7 +369,7 @@ void WorldSession::SendCalendarEvent(uint64 eventId, bool added) { data << uint32(0); // invite count for (uint8 i = 0; i < 0; ++i) - { + { data << uint64(0); // invite played guid data << uint8(0); // unk data << uint8(0); // status diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index cf517ccfbb4..8ce01d8cd0e 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2518,6 +2518,15 @@ void InstanceMap::PermBindAllPlayers(Player* source) WorldPacket data(SMSG_INSTANCE_SAVE_CREATED, 4); data << uint32(0); player->GetSession()->SendPacket(&data); + + time_t currTime = time(NULL); + data.Initialize(SMSG_CALENDAR_RAID_LOCKOUT_ADDED, 4 + 4 + 4 + 4 + 8); + data << uint32(secsToTimeBitFields(currTime)); + data << uint32(save->GetMapId()); + data << uint32(save->GetDifficulty()); + data << uint32(save->GetResetTime() - currTime); + data << uint64(save->GetInstanceId()); + player->GetSession()->SendPacket(&data); } // if the leader is not in the instance the group will not get a perm bind From a09310244fea05c5406c370dd3df461855fb3522 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 24 Feb 2012 18:22:31 +0000 Subject: [PATCH 0013/1149] Core/Calendar: Use enums Source: WPP --- src/server/game/Calendar/Calendar.h | 40 ++++++++++++++++---- src/server/game/Handlers/CalendarHandler.cpp | 23 ++++++----- 2 files changed, 46 insertions(+), 17 deletions(-) diff --git a/src/server/game/Calendar/Calendar.h b/src/server/game/Calendar/Calendar.h index c53ba8bf113..d8da4ce7ffe 100755 --- a/src/server/game/Calendar/Calendar.h +++ b/src/server/game/Calendar/Calendar.h @@ -21,7 +21,6 @@ #include "Common.h" -// TODO - Get correct values enum CalendarEventType { CALENDARTYPE_RAID = 0, @@ -31,8 +30,21 @@ enum CalendarEventType CALENDARTYPE_OTHER, }; -// TODO - Get correct values -enum CalendarInviteStatus +enum CalendarSendEventType +{ + CALENDARSENDEVENTTYPE_GET = 0, + CALENDARSENDEVENTTYPE_ADD, + CALENDARSENDEVENTTYPE_COPY +}; + +enum CalendarModerationRank +{ + CALENDARMODERATIONRANK_PLAYER = 0, + CALENDARMODERATIONRANK_MODERATOR, + CALENDARMODERATIONRANK_OWNER +}; + +enum CalendarEventStatus { CALENDARSTATUS_INVITED = 0, CALENDARSTATUS_ACCEPTED, @@ -41,6 +53,20 @@ enum CalendarInviteStatus CALENDARSTATUS_OUT, CALENDARSTATUS_STANDBY, CALENDARSTATUS_CONFIRMED, + // CALENDARSTATUS_UNK7 + // CALENDARSTATUS_UNK8 + // CALENDARSTATUS_UNK9 +}; + +enum CalendarFlags +{ + CALENDARFLAG_NONE = 0x000000, + CALENDARFLAG_NORMAL = 0x000001, + CALENDARFLAG_INVITES_LOCKED = 0x000010, + CALENDARFLAG_WITHOUT_INVITES = 0x000040, + CALENDARFLAG_GUILD_EVENT = 0x000400 + // CALENDARFLAG_Unk10000 = 0x010000, + // CALENDARFLAG_Unk400000 = 0x400000 }; struct CalendarEvent @@ -49,12 +75,12 @@ struct CalendarEvent uint64 CreatorGuid; std::string Name; std::string Description; - uint8 Type; + CalendarEventType Type; uint8 Unk; uint32 DungeonId; uint32 UnkTime; uint32 Time; - uint32 Flags; + CalendarFlags Flags; uint32 GuildId; }; @@ -62,8 +88,8 @@ struct CalendarInvite { uint64 Id; uint64 Event; - uint8 Status; - uint8 Rank; + CalendarEventStatus Status; + CalendarModerationRank Rank; uint8 Unk1; uint8 Unk2; uint8 Unk3; diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 5cd67b0ffbc..ec7bac82547 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -155,13 +155,13 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data) std::string title; std::string description; - uint8 type; + uint8 type; // CalendarEventType uint8 unkbyte; uint32 maxInvites; uint32 dungeonId; uint32 eventPackedTime; uint32 unkPackedTime; - uint32 flags; + uint32 flags; // CalendarFlags recv_data >> title; recv_data >> description; @@ -177,17 +177,17 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data) event.Id = sCalendarMgr->GetNextEventId(); event.Name = title; event.Description = description; - event.Type = type; + event.Type = (CalendarEventType) type; event.Unk = unkbyte; event.DungeonId = dungeonId; - event.Flags = flags; + event.Flags = (CalendarFlags) flags; event.Time = eventPackedTime; event.UnkTime = unkPackedTime; event.CreatorGuid = GetPlayer()->GetGUID(); sCalendarMgr->AddEvent(event); - if (((flags >> 6) & 1)) + if (flags & CALENDARFLAG_WITHOUT_INVITES) return; uint32 inviteCount; @@ -197,23 +197,26 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data) return; uint64 guid; - uint8 status; - uint8 rank; - for (int32 i = 0; i < inviteCount; ++i) + uint8 status; // CalendarEventStatus + uint8 rank; // CalendarModerationRank + for (uint32 i = 0; i < inviteCount; ++i) { CalendarInvite invite; invite.Id = sCalendarMgr->GetNextInviteId(); + recv_data.readPackGUID(guid); recv_data >> status; recv_data >> rank; + invite.Event = event.Id; invite.CreatorGuid = GetPlayer()->GetGUID(); invite.TargetGuid = guid; - invite.Status = status; - invite.Rank = rank; + invite.Status = (CalendarEventStatus) status; + invite.Rank = (CalendarModerationRank) rank; invite.Time = event.Time; invite.Text = ""; // hmm... invite.Unk1 = invite.Unk2 = invite.Unk3 = 0; + sCalendarMgr->AddInvite(invite); } //SendCalendarEvent(eventId, true); From a934abbbb7b6454983ec8e6ac5c34cc8382c87c0 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 24 Feb 2012 19:31:40 +0100 Subject: [PATCH 0014/1149] Core/Calendar * Added sending SMSG_CALENDAR_RAID_LOCKOUT_REMOVED when instance save is removed * Refactored sending SMSG_CALENDAR_RAID_LOCKOUT_ADDED/REMOVED into separate method --- src/server/game/Entities/Player/Player.cpp | 12 ++++-------- src/server/game/Handlers/CalendarHandler.cpp | 19 +++++++++++++++++++ src/server/game/Maps/Map.cpp | 9 +-------- src/server/game/Server/WorldSession.h | 1 + 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index c8141d27b80..e6afd44e489 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -18117,6 +18117,9 @@ void Player::UnbindInstance(BoundInstancesMap::iterator &itr, Difficulty difficu } itr->second.save->RemovePlayer(this); // save can become invalid + if (itr->second.perm) + GetSession()->SendCalendarRaidLockout(itr->second.save, false); + m_boundInstances[difficulty].erase(itr++); } } @@ -18186,14 +18189,7 @@ void Player::BindToInstance() GetSession()->SendPacket(&data); BindToInstance(mapSave, true); - time_t currTime = time(NULL); - data.Initialize(SMSG_CALENDAR_RAID_LOCKOUT_ADDED, 4 + 4 + 4 + 4 + 8); - data << uint32(secsToTimeBitFields(currTime)); - data << uint32(mapSave->GetMapId()); - data << uint32(mapSave->GetDifficulty()); - data << uint32(mapSave->GetResetTime() - currTime); - data << uint64(mapSave->GetInstanceId()); - GetSession()->SendPacket(&data); + GetSession()->SendCalendarRaidLockout(mapSave, true); } void Player::SendRaidInfo() diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index ec7bac82547..26465691c64 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -414,3 +414,22 @@ void WorldSession::SendCalendarEventRemovedAlert(uint64 eventId) data << uint32(0); // invite time SendPacket(&data); } + +void WorldSession::SendCalendarRaidLockout(InstanceSave* save, bool add) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", add ? "SMSG_CALENDAR_RAID_LOCKOUT_ADDED" : "SMSG_CALENDAR_RAID_LOCKOUT_REMOVED"); + time_t currTime = time(NULL); + + WorldPacket data(SMSG_CALENDAR_RAID_LOCKOUT_REMOVED, (add ? 4 : 0) + 4 + 4 + 4 + 8); + if (add) + { + data.SetOpcode(SMSG_CALENDAR_RAID_LOCKOUT_ADDED); + data << uint32(secsToTimeBitFields(currTime)); + } + + data << uint32(save->GetMapId()); + data << uint32(save->GetDifficulty()); + data << uint32(save->GetResetTime() - currTime); + data << uint64(save->GetInstanceId()); + SendPacket(&data); +} diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 8ce01d8cd0e..31dc622a724 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2519,14 +2519,7 @@ void InstanceMap::PermBindAllPlayers(Player* source) data << uint32(0); player->GetSession()->SendPacket(&data); - time_t currTime = time(NULL); - data.Initialize(SMSG_CALENDAR_RAID_LOCKOUT_ADDED, 4 + 4 + 4 + 4 + 8); - data << uint32(secsToTimeBitFields(currTime)); - data << uint32(save->GetMapId()); - data << uint32(save->GetDifficulty()); - data << uint32(save->GetResetTime() - currTime); - data << uint64(save->GetInstanceId()); - player->GetSession()->SendPacket(&data); + player->GetSession()->SendCalendarRaidLockout(save, true); } // if the leader is not in the instance the group will not get a perm bind diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 47c48e96de0..a12470b842b 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -881,6 +881,7 @@ class WorldSession void SendCalendarEvent(uint64 eventId, bool added = false); void SendCalendarEventInviteAlert(uint64 eventId, uint64 inviteId); void SendCalendarEventRemovedAlert(uint64 eventId); + void SendCalendarRaidLockout(InstanceSave* save, bool add); void HandleSpellClick(WorldPacket& recv_data); void HandleMirrorImageDataRequest(WorldPacket& recv_data); From 32eab3dca794cf0da17153349b9e76f3a49c7a0f Mon Sep 17 00:00:00 2001 From: Spp Date: Fri, 24 Feb 2012 20:11:29 +0100 Subject: [PATCH 0015/1149] Core/Calendar: WIP Calendar. --- src/server/game/Calendar/Calendar.cpp | 303 +++++++ src/server/game/Calendar/Calendar.h | 219 +++-- src/server/game/Calendar/CalendarMgr.cpp | 605 +++++++++++-- src/server/game/Calendar/CalendarMgr.h | 93 +- src/server/game/Handlers/CalendarHandler.cpp | 902 ++++++++++++++----- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/WorldSession.h | 21 +- src/server/game/World/World.cpp | 4 + 8 files changed, 1758 insertions(+), 391 deletions(-) diff --git a/src/server/game/Calendar/Calendar.cpp b/src/server/game/Calendar/Calendar.cpp index 2dadd66f64c..82ba3c1b062 100755 --- a/src/server/game/Calendar/Calendar.cpp +++ b/src/server/game/Calendar/Calendar.cpp @@ -17,3 +17,306 @@ */ #include "Calendar.h" + +CalendarInvite::CalendarInvite(uint64 _inviteId /* = 0 */): inviteId(_inviteId), +eventId(0), invitee(0), senderGUID(0), statusTime(0), status(0), rank(0) +{ +} + +CalendarInvite::~CalendarInvite() +{ +} + +void CalendarInvite::SetInviteId(uint64 _inviteId) +{ + inviteId = _inviteId; +} + +uint64 CalendarInvite::GetInviteId() const +{ + return inviteId; +} + +void CalendarInvite::SetEventId(uint64 _eventId) +{ + eventId = _eventId; +} + +uint64 CalendarInvite::GetEventId() const +{ + return eventId; +} + +void CalendarInvite::SetSenderGUID(uint64 _guid) +{ + senderGUID = _guid; +} + +uint64 CalendarInvite::GetSenderGUID() const +{ + return senderGUID; +} + +void CalendarInvite::SetInvitee(uint64 _guid) +{ + invitee = _guid; +} + +uint64 CalendarInvite::GetInvitee() const +{ + return invitee; +} + +void CalendarInvite::SetStatusTime(uint32 _statusTime) +{ + statusTime = _statusTime; +} + +uint32 CalendarInvite::GetStatusTime() const +{ + return statusTime; +} + +void CalendarInvite::SetText(std::string _text) +{ + text = _text; +} + +std::string CalendarInvite::GetText() const +{ + return text; +} + +void CalendarInvite::SetStatus(uint8 _status) +{ + status = _status; +} + +uint8 CalendarInvite::GetStatus() const +{ + return status; +} + +void CalendarInvite::SetRank(uint8 _rank) +{ + rank = _rank; +} + +uint8 CalendarInvite::GetRank() const +{ + return rank; +} + +CalendarEvent::CalendarEvent(uint64 _eventId /* = 0 */) : eventId(_eventId), +creatorGUID(0), guildId(0), type(CALENDAR_TYPE_OTHER), dungeonId(-1), +maxInvites(0), eventTime(0), flags(0), repeatable(false), timezoneTime(0), +title(""), description("") +{ +} + +CalendarEvent::~CalendarEvent() +{ +} + +void CalendarEvent::SetEventId(uint64 _eventId) +{ + eventId = _eventId; +} + +uint64 CalendarEvent::GetEventId() const +{ + return eventId; +} + +void CalendarEvent::SetCreatorGUID(uint64 _guid) +{ + creatorGUID = _guid; +} + +uint64 CalendarEvent::GetCreatorGUID() const +{ + return creatorGUID; +} + +void CalendarEvent::SetGuildId(uint32 _guildId) +{ + guildId = _guildId; +} + +uint32 CalendarEvent::GetGuildId() const +{ + return guildId; +} + +void CalendarEvent::SetTitle(std::string _title) +{ + title = _title; +} + +std::string CalendarEvent::GetTitle() const +{ + return title; +} + +void CalendarEvent::SetDescription(std::string _description) +{ + description = _description; +} + +std::string CalendarEvent::GetDescription() const +{ + return description; +} + +void CalendarEvent::SetType(uint8 _type) +{ + type = _type; +} + +uint8 CalendarEvent::GetType() const +{ + return type; +} + +void CalendarEvent::SetMaxInvites(uint32 max) +{ + maxInvites = max; +} + +uint32 CalendarEvent::GetMaxInvites() const +{ + return maxInvites; +} + +void CalendarEvent::SetDungeonId(int32 _dungeonId) +{ + dungeonId = _dungeonId; +} + +int32 CalendarEvent::GetDungeonId() const +{ + return dungeonId; +} + +void CalendarEvent::SetTime(uint32 _eventTime) +{ + eventTime = _eventTime; +} + +uint32 CalendarEvent::GetTime() const +{ + return eventTime; +} + +void CalendarEvent::SetFlags(uint32 _flags) +{ + flags = _flags; +} + +uint32 CalendarEvent::GetFlags() const +{ + return flags; +} + +void CalendarEvent::SetRepeatable(bool _repeatable) +{ + repeatable = _repeatable; +} + +uint8 CalendarEvent::GetRepeatable() const +{ + return repeatable; +} + +void CalendarEvent::SetTimeZoneTime(uint32 _timezoneTime) +{ + timezoneTime = _timezoneTime; +} + +uint32 CalendarEvent::GetTimeZoneTime() const +{ + return timezoneTime; +} + +void CalendarEvent::AddInvite(uint64 inviteId) +{ + if (inviteId) + _invites.insert(inviteId); +} + +void CalendarEvent::RemoveInvite(uint64 inviteId) +{ + _invites.erase(inviteId); +} + +bool CalendarEvent::HasInvite(uint64 inviteId) const +{ + return _invites.find(inviteId) != _invites.end(); +} + +CalendarinviteIdList const& CalendarEvent::GetInviteIdList() const +{ + return _invites; +} + +void CalendarEvent::SetInviteIdList(CalendarinviteIdList const& list) +{ + _invites = list; +} + +void CalendarEvent::ClearInviteIdList() +{ + _invites.clear(); +} + +std::string CalendarInvite::GetDebugString() const +{ + std::ostringstream data; + + data << "CalendarInvite::" + << " inviteId: " << inviteId + << " EventId: " << eventId + << " Status: " << uint32(status) + << " Invitee: " << invitee + << " Sender: " << senderGUID + << " Rank: " << uint32(rank) + << " Text: " << text; + + return data.str(); +} + +std::string CalendarEvent::GetDebugString() const +{ + std::ostringstream data; + + data << "CalendarEvent::" + << " EventId: " << eventId + << " Title: " << title + << " Description" << description + << " Type: " << uint32(type) + << " Max Invites: " << maxInvites + << " Creator: " << creatorGUID + << " Flags: " << flags + << " Guild: " << guildId + << " Time: " << eventTime + << " Time2: " << timezoneTime + << " Repeatable: " << uint32(repeatable) + << " DungeonId: " << dungeonId; + + return data.str(); +} + +std::string CalendarAction::GetDebugString() const +{ + std::ostringstream data; + + data << "CalendarAction::" + << " Action: " << GetAction() + << " Guid: " << GetGUID() + << " Invite Id: " << GetInviteId() + << " Extra data: " << GetExtraData() + << " Event: " << Event.GetDebugString() + << " Invite: " << Invite.GetDebugString(); + + return data.str(); +} diff --git a/src/server/game/Calendar/Calendar.h b/src/server/game/Calendar/Calendar.h index d8da4ce7ffe..ffe2f97269c 100755 --- a/src/server/game/Calendar/Calendar.h +++ b/src/server/game/Calendar/Calendar.h @@ -20,86 +20,187 @@ #define TRINITY_CALENDAR_H #include "Common.h" +#include -enum CalendarEventType +enum CalendarFlags { - CALENDARTYPE_RAID = 0, - CALENDARTYPE_DUNGEON, - CALENDARTYPE_PVP, - CALENDARTYPE_MEETING, - CALENDARTYPE_OTHER, + CALENDAR_FLAG_ALL_ALLOWED = 0x001, + CALENDAR_FLAG_INVITES_LOCKED = 0x010, + CALENDAR_FLAG_WITHOUT_INVITES = 0x040, + CALENDAR_FLAG_GUILD_ONLY = 0x400, +}; + +enum CalendarActionData +{ + CALENDAR_ACTION_NONE, + CALENDAR_ACTION_ADD_EVENT, + CALENDAR_ACTION_MODIFY_EVENT, + CALENDAR_ACTION_REMOVE_EVENT, + CALENDAR_ACTION_COPY_EVENT, + CALENDAR_ACTION_ADD_EVENT_INVITE, + CALENDAR_ACTION_MODIFY_EVENT_INVITE, + CALENDAR_ACTION_MODIFY_MODERATOR_EVENT_INVITE, + CALENDAR_ACTION_REMOVE_EVENT_INVITE, + CALENDAR_ACTION_SIGNUP_TO_EVENT, +}; + +enum CalendarRanks +{ + CALENDAR_RANK_PLAYER, + CALENDAR_RANK_MODERATOR, + CALENDAR_RANK_OWNER, }; enum CalendarSendEventType { - CALENDARSENDEVENTTYPE_GET = 0, - CALENDARSENDEVENTTYPE_ADD, - CALENDARSENDEVENTTYPE_COPY + CALENDAR_SENDTYPE_GET, + CALENDAR_SENDTYPE_ADD, + CALENDAR_SENDTYPE_COPY, }; -enum CalendarModerationRank +enum CalendarEventType { - CALENDARMODERATIONRANK_PLAYER = 0, - CALENDARMODERATIONRANK_MODERATOR, - CALENDARMODERATIONRANK_OWNER + CALENDAR_TYPE_RAID, + CALENDAR_TYPE_DUNGEON, + CALENDAR_TYPE_PVP, + CALENDAR_TYPE_MEETING, + CALENDAR_TYPE_OTHER, }; -enum CalendarEventStatus +enum CalendarInviteStatus { - CALENDARSTATUS_INVITED = 0, - CALENDARSTATUS_ACCEPTED, - CALENDARSTATUS_DECLINED, - CALENDARSTATUS_TENTATIVE, - CALENDARSTATUS_OUT, - CALENDARSTATUS_STANDBY, - CALENDARSTATUS_CONFIRMED, - // CALENDARSTATUS_UNK7 - // CALENDARSTATUS_UNK8 - // CALENDARSTATUS_UNK9 + CALENDAR_STATUS_INVITED, + CALENDAR_STATUS_ACCEPTED, + CALENDAR_STATUS_DECLINED, + CALENDAR_STATUS_TENTATIVE, + CALENDAR_STATUS_OUT, + CALENDAR_STATUS_STANDBY, + CALENDAR_STATUS_CONFIRMED, + CALENDAR_STATUS_NO_OWNER, + CALENDAR_STATUS_8, + CALENDAR_STATUS_9, }; -enum CalendarFlags +class CalendarInvite { - CALENDARFLAG_NONE = 0x000000, - CALENDARFLAG_NORMAL = 0x000001, - CALENDARFLAG_INVITES_LOCKED = 0x000010, - CALENDARFLAG_WITHOUT_INVITES = 0x000040, - CALENDARFLAG_GUILD_EVENT = 0x000400 - // CALENDARFLAG_Unk10000 = 0x010000, - // CALENDARFLAG_Unk400000 = 0x400000 + public: + CalendarInvite(uint64 _inviteId = 0); + ~CalendarInvite(); + + void SetInviteId(uint64 inviteId); + uint64 GetInviteId() const; + void SetEventId(uint64 eventId); + uint64 GetEventId() const; + void SetSenderGUID(uint64 guid); + uint64 GetSenderGUID() const; + void SetInvitee(uint64 guid); + uint64 GetInvitee() const; + void SetStatusTime(uint32 statusTime); + uint32 GetStatusTime() const; + void SetText(std::string text); + std::string GetText() const; + void SetStatus(uint8 _status); + uint8 GetStatus() const; + void SetRank(uint8 _rank); + uint8 GetRank() const; + + std::string GetDebugString() const; + private: + uint64 inviteId; + uint64 eventId; + uint64 invitee; + uint64 senderGUID; + uint32 statusTime; + uint8 status; + uint8 rank; + std::string text; }; -struct CalendarEvent +typedef std::set CalendarinviteIdList; + +class CalendarEvent { - uint64 Id; - uint64 CreatorGuid; - std::string Name; - std::string Description; - CalendarEventType Type; - uint8 Unk; - uint32 DungeonId; - uint32 UnkTime; - uint32 Time; - CalendarFlags Flags; - uint32 GuildId; + public: + CalendarEvent(uint64 _eventId = 0); + ~CalendarEvent(); + + void SetEventId(uint64 eventId); + uint64 GetEventId() const; + void SetCreatorGUID(uint64 guid); + uint64 GetCreatorGUID() const; + void SetGuildId(uint32 guild); + uint32 GetGuildId() const; + void SetTitle(std::string title); + std::string GetTitle() const; + void SetDescription(std::string description); + std::string GetDescription() const; + void SetType(uint8 type); + uint8 GetType() const; + void SetMaxInvites(uint32 max); + uint32 GetMaxInvites() const; + void SetDungeonId(int32 dungeonId); + int32 GetDungeonId() const; + void SetTime(uint32 eventTime); + uint32 GetTime() const; + void SetFlags(uint32 flags); + uint32 GetFlags() const; + void SetRepeatable(bool repeatable); + uint8 GetRepeatable() const; + void SetTimeZoneTime(uint32 time); + uint32 GetTimeZoneTime() const; + + void AddInvite(uint64 inviteId); + void RemoveInvite(uint64 inviteId); + bool HasInvite(uint64 inviteId) const; + CalendarinviteIdList const& GetInviteIdList() const; + void SetInviteIdList(CalendarinviteIdList const& list); + void ClearInviteIdList(); + + std::string GetDebugString() const; + private: + uint64 eventId; + uint64 creatorGUID; + uint32 guildId; + uint8 type; + int32 dungeonId; + uint32 maxInvites; + uint32 eventTime; + uint32 flags; + uint8 repeatable; + uint32 timezoneTime; + std::string title; + std::string description; + CalendarinviteIdList _invites; }; -struct CalendarInvite +typedef std::set CalendarEventIdList; +typedef std::map CalendarPlayerinviteIdMap; +typedef std::map CalendarPlayerEventIdMap; +typedef std::map CalendarInviteMap; +typedef std::map CalendarEventMap; + +struct CalendarAction { - uint64 Id; - uint64 Event; - CalendarEventStatus Status; - CalendarModerationRank Rank; - uint8 Unk1; - uint8 Unk2; - uint8 Unk3; - std::string Text; - uint64 CreatorGuid; - uint32 Time; - uint64 TargetGuid; -}; + CalendarAction(): _action(CALENDAR_ACTION_NONE), _guid(0), _inviteId(0), _data(0) {}; + std::string GetDebugString() const; -typedef UNORDERED_MAP CalendarInviteMap; -typedef UNORDERED_MAP CalendarEventMap; + void SetAction(CalendarActionData data) { _action = data; } + void SetGUID(uint64 guid) { _guid = guid; } + void SetInviteId(uint64 id) { _inviteId = id; } + void SetExtraData(uint32 data) { _data = data; } + + uint64 GetGUID() const { return _guid; } + CalendarActionData GetAction() const { return _action; } + uint64 GetInviteId() const { return _inviteId; } + uint32 GetExtraData() const { return _data; } + + CalendarEvent Event; + CalendarInvite Invite; + private: + CalendarActionData _action; + uint64 _guid; + uint64 _inviteId; + uint32 _data; +}; #endif diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index d947faed42f..0a4d9e36f49 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -1,25 +1,61 @@ /* - * Copyright (C) 2008-2012 Trinity + * Copyright (C) 2008-2012 TrinityCore * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ + +/* + +DROP TABLE IF EXISTS `calendar_events`; +CREATE TABLE IF NOT EXISTS `calendar_events` ( + `id` int(11) unsigned NOT NULL DEFAULT '0', + `creator` int(11) unsigned NOT NULL DEFAULT '0', + `title` varchar(255) NOT NULL DEFAULT '', + `description` varchar(255) NOT NULL DEFAULT '', + `type` tinyint(1) unsigned NOT NULL DEFAULT '4', + `dungeon` tinyint(3) NOT NULL DEFAULT '-1', + `eventtime` int(10) unsigned NOT NULL DEFAULT '0', + `flags` int(10) unsigned NOT NULL DEFAULT '0', + `repeatable` tinyint(1) unsigned NOT NULL DEFAULT '0', + `time2` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +); + +DROP TABLE IF EXISTS `calendar_invites`; +CREATE TABLE IF NOT EXISTS `calendar_invites` ( + `id` int(11) unsigned NOT NULL DEFAULT '0', + `event` int(11) unsigned NOT NULL DEFAULT '0', + `invitee` int(11) unsigned NOT NULL DEFAULT '0', + `sender` int(11) unsigned NOT NULL DEFAULT '0', + `status` tinyint(1) unsigned NOT NULL DEFAULT '0', + `statustime` int(10) unsigned NOT NULL DEFAULT '0', + `rank` tinyint(1) unsigned NOT NULL DEFAULT '0', + `text` varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (`id`) +); +*/ #include "CalendarMgr.h" #include "QueryResult.h" +#include "DatabaseEnv.h" +#include "Log.h" +#include "Player.h" +#include "ObjectAccessor.h" -CalendarMgr::CalendarMgr() : _currentEventId(0), _currentInviteId(0) +CalendarMgr::CalendarMgr() + : eventNum(0) + , InviteNum(0) { } @@ -27,54 +63,505 @@ CalendarMgr::~CalendarMgr() { } -void CalendarMgr::AppendInvitesToCalendarPacketForPlayer(WorldPacket& data, Player* player) +uint32 CalendarMgr::GetPlayerNumPending(uint64 guid) { - size_t pCounter = data.wpos(); - data << uint32(0); - uint32 counter = 0; - for (CalendarInviteMap::iterator itr = _inviteMap.begin(); itr != _inviteMap.end(); ++itr) - { - CalendarInvite invite = itr->second; - if (invite.TargetGuid == player->GetGUID()) - { - data << uint64(invite.Id); // Invite ID - data << uint64(invite.Event); // Event ID - data << uint8(invite.Rank); // rank - data << uint8(0); // unk - TODO: Figure out what this is - data << uint8(0); // unk - data.appendPackGUID(invite.CreatorGuid); // creator's guid - counter++; - } - } - data.put(pCounter, counter); // update number of invites + if (!guid) + return 0; + + CalendarPlayerinviteIdMap::const_iterator itr = _playerInvites.find(guid); + if (itr == _playerInvites.end()) + return 0; + + uint32 pendingNum = 0; + for (CalendarinviteIdList::const_iterator it = itr->second.begin(); it != itr->second.end(); ++it) + if (CalendarInvite* invite = GetInvite(*it)) + if (invite->GetRank() != CALENDAR_RANK_OWNER + && invite->GetStatus() != CALENDAR_STATUS_CONFIRMED + && invite->GetStatus() != CALENDAR_STATUS_8 + && invite->GetStatus() != CALENDAR_STATUS_9) // FIXME Check the proper value + ++pendingNum; + + return pendingNum; } -void CalendarMgr::AppendEventsToCalendarPacketForPlayer(WorldPacket& data, Player* player) +CalendarinviteIdList const& CalendarMgr::GetPlayerInvites(uint64 guid) { - // TODO: There's gotta be a better way to do this - size_t pCounter = data.wpos(); - data << uint32(0); - uint32 counter = 0; - std::set alreadyAdded; - for (CalendarInviteMap::iterator itr = _inviteMap.begin(); itr != _inviteMap.end(); ++itr) - { - CalendarInvite invite = itr->second; - if (invite.TargetGuid == player->GetGUID()) - { - if (alreadyAdded.find(invite.Event) == alreadyAdded.end()) - { - CalendarEvent const* event = GetEvent(invite.Event); - data << uint64(event->Id); // event ID - data << event->Name; // event title - data << uint32(event->Type); // event type - data << uint32(event->Time); // event time as time bit field - data << uint32(event->Flags); // event flags - data << uint32(event->DungeonId); // dungeon ID - data.appendPackGUID(event->CreatorGuid); // creator guid - alreadyAdded.insert(invite.Event); - counter++; - } - } - } - data.put(pCounter, counter); // update number of invites + return _playerInvites[guid]; +} + +CalendarEventIdList const& CalendarMgr::GetPlayerEvents(uint64 guid) +{ + return _playerEvents[guid]; +} + +CalendarInvite* CalendarMgr::GetInvite(uint64 inviteId) +{ + CalendarInviteMap::iterator it = _invites.find(inviteId); + if (it != _invites.end()) + return &(it->second); + + sLog->outError("SPP: CalendarMgr::GetInvite: [" UI64FMTD "] not found!", inviteId); + return NULL; +} + +CalendarEvent* CalendarMgr::GetEvent(uint64 eventId) +{ + CalendarEventMap::iterator it = _events.find(eventId); + if (it != _events.end()) + return &(it->second); + + sLog->outError("SPP: CalendarMgr::GetEvent: [" UI64FMTD "] not found!", eventId); + return NULL; +} + +uint64 CalendarMgr::GetFreeEventId() +{ + return ++eventNum; +} +uint64 CalendarMgr::GetFreeInviteId() +{ + return ++InviteNum; +} + +void CalendarMgr::LoadFromDB() +{ + /* + uint32 count = 0; + // 0 1 2 3 4 5 6 7 8 9 + if (QueryResult result = CharacterDatabase.Query("SELECT id, creator, title, description, type, dungeon, eventtime, flags, repeatable, time2 FROM calendar_events")) + do + { + Field * fields = result->Fetch(); + + uint64 eventId = fields[0].GetUInt64(); + CalendarEvent& calendarEvent = _events[eventId]; + + calendarEvent.SetEventId(eventId); + calendarEvent.SetCreatorGUID(fields[1].GetUInt64()); + calendarEvent.SetTitle(fields[2].GetString()); + calendarEvent.SetDescription(fields[3].GetString()); + calendarEvent.SetType(fields[4].GetUInt8()); + calendarEvent.SetDungeonId(fields[5].GetInt32()); + calendarEvent.SetTime(fields[6].GetUInt32()); + calendarEvent.SetFlags(fields[7].GetUInt32()); + calendarEvent.SetRepeatable(fields[8].GetBool()); + calendarEvent.SetTimeZoneTime(fields[9].GetUInt32()); + ++count; + } + while (result->NextRow()); + + sLog->outString(">> Loaded %u calendar events", count); + count = 0; + + // 0 1 2 3 4 5 6 7 + if (QueryResult result = CharacterDatabase.Query("SELECT id, event, invitee, sender, status, statustime, rank, text FROM calendar_invites")) + do + { + Field * fields = result->Fetch(); + + uint64 inviteId = fields[0].GetUInt64(); + uint64 eventId = fields[1].GetUInt64(); + + CalendarInvite& invite = _invites[inviteId]; + + invite.SetEventId(eventId); + invite.SetInvitee(fields[2].GetUInt64()); + invite.SetSenderGUID(fields[3].GetUInt64()); + invite.SetStatus(fields[4].GetUInt8()); + invite.SetStatusTime(fields[5].GetUInt32()); + invite.SetRank(fields[6].GetUInt8()); + invite.SetText(fields[7].GetString()); + + CalendarEvent& calendarEvent = _events[eventId]; + calendarEvent.AddInvite(inviteId); + } + while (result->NextRow()); + + sLog->outString(">> Loaded %u calendar Invites", count); + */ +} + +CalendarEvent* CalendarMgr::CheckPermisions(uint64 eventId, uint64 guid, uint64 inviteId, CalendarRanks minRank) +{ + if (CalendarEvent* calendarEvent = GetEvent(eventId)) + if (CalendarInvite* invite = GetInvite(inviteId)) + if (calendarEvent->HasInvite(inviteId) + && invite->GetEventId() == calendarEvent->GetEventId() + && invite->GetInvitee() == guid + && invite->GetRank() >= minRank) + return calendarEvent; + + return NULL; +} + +void CalendarMgr::AddAction(CalendarAction const& action) +{ + switch (action.GetAction()) + { + case CALENDAR_ACTION_ADD_EVENT: + { + if (addEvent(action.Event) && addInvite(action.Invite)) + { + SendCalendarEventInviteAlert(action.Event, action.Invite); + SendCalendarEvent(action.Event, CALENDAR_SENDTYPE_ADD); + } + break; + } + case CALENDAR_ACTION_MODIFY_EVENT: + { + uint64 eventId = action.Event.GetEventId(); + CalendarEvent* calendarEvent = CheckPermisions(eventId, + action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); + + if (!calendarEvent) + return; + + calendarEvent->SetEventId(action.Event.GetEventId()); + calendarEvent->SetType(action.Event.GetType()); + calendarEvent->SetFlags(action.Event.GetFlags()); + calendarEvent->SetTime(action.Event.GetTime()); + calendarEvent->SetTimeZoneTime(action.Event.GetTimeZoneTime()); + calendarEvent->SetRepeatable(action.Event.GetRepeatable()); + calendarEvent->SetDungeonId(action.Event.GetDungeonId()); + calendarEvent->SetTitle(action.Event.GetTitle()); + calendarEvent->SetDescription(action.Event.GetDescription()); + calendarEvent->SetMaxInvites(action.Event.GetMaxInvites()); + + CalendarinviteIdList const& invites = calendarEvent->GetInviteIdList(); + for (CalendarinviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) + if (CalendarInvite* invite = GetInvite(*itr)) + SendCalendarEventUpdateAlert(invite->GetInvitee(), *calendarEvent, CALENDAR_SENDTYPE_ADD); + + break; + } + case CALENDAR_ACTION_COPY_EVENT: + { + CalendarEvent* calendarEvent = CheckPermisions(action.Event.GetEventId(), + action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_OWNER); + + if (!calendarEvent) + return; + + uint64 eventId = GetFreeEventId(); + CalendarEvent newEvent(eventId); + newEvent.SetType(calendarEvent->GetType()); + newEvent.SetFlags(calendarEvent->GetFlags()); + newEvent.SetTime(action.Event.GetTime()); + newEvent.SetTimeZoneTime(calendarEvent->GetTimeZoneTime()); + newEvent.SetRepeatable(calendarEvent->GetRepeatable()); + newEvent.SetDungeonId(calendarEvent->GetDungeonId()); + newEvent.SetTitle(calendarEvent->GetTitle()); + newEvent.SetDescription(calendarEvent->GetDescription()); + newEvent.SetMaxInvites(calendarEvent->GetMaxInvites()); + newEvent.SetCreatorGUID(calendarEvent->GetCreatorGUID()); + newEvent.SetGuildId(calendarEvent->GetGuildId()); + + CalendarinviteIdList const invites = calendarEvent->GetInviteIdList(); + for (CalendarinviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) + if (CalendarInvite* invite = GetInvite(*itr)) + { + uint64 inviteId = GetFreeInviteId(); + CalendarInvite newInvite(inviteId); + newInvite.SetEventId(eventId); + newInvite.SetSenderGUID(action.GetGUID()); + newInvite.SetInvitee(invite->GetInvitee()); + newInvite.SetStatus(invite->GetStatus()); + newInvite.SetStatusTime(invite->GetStatusTime()); + newInvite.SetText(invite->GetText()); + newInvite.SetRank(invite->GetRank()); + if (addInvite(newInvite)) + { + SendCalendarEventInviteAlert(newEvent, newInvite); + newEvent.AddInvite(inviteId); + } + } + + if (addEvent(newEvent)) + SendCalendarEvent(newEvent, CALENDAR_SENDTYPE_COPY); + + break; + } + case CALENDAR_ACTION_REMOVE_EVENT: + { + uint64 eventId = action.Event.GetEventId(); + uint32 flags = action.Event.GetFlags(); + sLog->outError("CalendarMgr::AddAction:: Flags %u", flags); + // FIXME - Use of Flags here! + + CalendarEvent* calendarEvent = CheckPermisions(eventId, + action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_OWNER); + + if (!calendarEvent) + return; + + CalendarinviteIdList const& inviteIds = calendarEvent->GetInviteIdList(); + for (CalendarinviteIdList::const_iterator it = inviteIds.begin(); it != inviteIds.end(); ++it) + if (uint64 invitee = removeInvite(*it)) + SendCalendarEventRemovedAlert(invitee, *calendarEvent); + + removeEvent(eventId); + break; + } + case CALENDAR_ACTION_ADD_EVENT_INVITE: + { + uint64 eventId = action.Invite.GetEventId(); + CalendarEvent* calendarEvent = CheckPermisions(eventId, + action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); + + if (!calendarEvent) + return; + + if (addInvite(action.Invite)) + { + calendarEvent->AddInvite(action.Invite.GetInviteId()); + SendCalendarEventInvite(action.Invite, (!(calendarEvent->GetFlags() & CALENDAR_FLAG_INVITES_LOCKED) && + !action.Invite.GetStatusTime())); + SendCalendarEventInviteAlert(*calendarEvent, action.Invite); + } + + break; + } + case CALENDAR_ACTION_SIGNUP_TO_EVENT: + { + uint64 eventId = action.Event.GetEventId(); + CalendarEvent* calendarEvent = GetEvent(eventId); + CheckPermisions(eventId, + action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); + + if (!calendarEvent || !(calendarEvent->GetFlags() & CALENDAR_FLAG_GUILD_ONLY) + || !calendarEvent->GetGuildId() || calendarEvent->GetGuildId() != action.GetExtraData()) + return; + + uint8 status = action.Invite.GetStatus(); + + if (status == CALENDAR_STATUS_INVITED) + status = CALENDAR_STATUS_CONFIRMED; + else if (status == CALENDAR_STATUS_ACCEPTED) + status = CALENDAR_STATUS_8; + CalendarInvite newInvite(GetFreeInviteId()); + newInvite.SetStatus(status); + newInvite.SetStatusTime(uint32(time(NULL))); + newInvite.SetEventId(eventId); + newInvite.SetInvitee(action.GetGUID()); + newInvite.SetSenderGUID(action.GetGUID()); + + if (addInvite(newInvite)) + SendCalendarEventInvite(newInvite, false); + + break; + } + case CALENDAR_ACTION_MODIFY_EVENT_INVITE: + { + uint64 eventId = action.Invite.GetEventId(); + uint64 inviteId = action.Invite.GetInviteId(); + + CalendarEvent* calendarEvent; + if (action.GetInviteId() != action.Invite.GetInviteId()) + calendarEvent = CheckPermisions(eventId, action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); + else + calendarEvent = GetEvent(eventId); + + CalendarInvite* invite = GetInvite(inviteId); + + if (!calendarEvent || !invite || !calendarEvent->HasInvite(inviteId)) + return; + + invite->SetStatus(action.Invite.GetStatus()); + SendCalendarEventStatus(invite->GetSenderGUID(), *calendarEvent, *invite); + break; + } + case CALENDAR_ACTION_MODIFY_MODERATOR_EVENT_INVITE: + { + uint64 eventId = action.Invite.GetEventId(); + uint64 inviteId = action.Invite.GetInviteId(); + + CalendarEvent* calendarEvent; + if (action.GetInviteId() != action.Invite.GetInviteId()) + calendarEvent = CheckPermisions(eventId, action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_OWNER); + else + calendarEvent = GetEvent(eventId); + + CalendarInvite* invite = GetInvite(inviteId); + + if (!calendarEvent || !invite || !calendarEvent->HasInvite(inviteId)) + return; + + sLog->outError("SPP: CALENDAR_ACTION_MODIFY_MODERATOR_EVENT_INVITE: All OK"); + invite->SetStatus(action.Invite.GetStatus()); + SendCalendarEventModeratorStatusAlert(*invite); + break; + } + case CALENDAR_ACTION_REMOVE_EVENT_INVITE: + { + uint64 eventId = action.Invite.GetEventId(); + uint64 inviteId = action.Invite.GetInviteId(); + CalendarEvent* calendarEvent = CheckPermisions(eventId, + action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); + + if (!calendarEvent) + return; + + if (uint64 invitee = removeInvite(inviteId)) + { + SendCalendarEventInviteRemoveAlert(invitee, *calendarEvent, CALENDAR_STATUS_9); + SendCalendarEventInviteRemove(action.GetGUID(), action.Invite, calendarEvent->GetFlags()); + } + break; + } + default: + break; + } + +} + +bool CalendarMgr::addEvent(CalendarEvent const& newEvent) +{ + uint64 eventId = newEvent.GetEventId(); + if (_events.find(eventId) != _events.end()) + { + sLog->outError("CalendarMgr::addEvent: Event [" UI64FMTD "] exists", eventId); + return false; + } + + _events[eventId] = newEvent; + return true; +} + +bool CalendarMgr::removeEvent(uint64 eventId) +{ + CalendarEventMap::iterator itr = _events.find(eventId); + if (itr == _events.end()) + { + sLog->outError("CalendarMgr::removeEvent: Event [" UI64FMTD "] does not exist", eventId); + return false; + } + + _events.erase(itr); + + bool val = true; + + CalendarinviteIdList const& invites = itr->second.GetInviteIdList(); + for (CalendarinviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) + { + CalendarInvite* invite = GetInvite(*itr); + if (!invite || !removePlayerEvent(invite->GetInvitee(), eventId)) + val = false; + } + + return val; +} + +bool CalendarMgr::addPlayerEvent(uint64 guid, uint64 eventId) +{ + _playerEvents[guid].insert(eventId); + return true; +} + +bool CalendarMgr::removePlayerEvent(uint64 guid, uint64 eventId) +{ + _playerEvents[guid].erase(eventId); + return true; +} + +bool CalendarMgr::addInvite(CalendarInvite const& newInvite) +{ + uint64 inviteId = newInvite.GetInviteId(); + if (!inviteId) + { + sLog->outError("CalendarMgr::addInvite: Cant add Invite 0"); + return false; + } + + if (_invites.find(inviteId) != _invites.end()) + { + sLog->outError("CalendarMgr::addInvite: Invite [" UI64FMTD "] exists", inviteId); + return false; + } + + _invites[inviteId] = newInvite; + uint64 guid = newInvite.GetInvitee(); + bool inviteAdded = addPlayerInvite(guid, inviteId); + bool eventAdded = addPlayerEvent(guid, newInvite.GetEventId()); + return eventAdded && inviteAdded; +} + +uint64 CalendarMgr::removeInvite(uint64 inviteId) +{ + CalendarInviteMap::iterator itr = _invites.find(inviteId); + if (itr == _invites.end()) + { + sLog->outError("CalendarMgr::removeInvite: Invite [" UI64FMTD "] does not exist", inviteId); + return 0; + } + + uint64 invitee = itr->second.GetInvitee(); + _invites.erase(itr); + + return removePlayerInvite(invitee, inviteId) ? invitee : 0; +} + +bool CalendarMgr::addPlayerInvite(uint64 guid, uint64 inviteId) +{ + _playerInvites[guid].insert(inviteId); + return true; +} + +bool CalendarMgr::removePlayerInvite(uint64 guid, uint64 inviteId) +{ + _playerInvites[guid].erase(inviteId); + return true; +} + +void CalendarMgr::SendCalendarEvent(CalendarEvent const& calendarEvent, CalendarSendEventType type) +{ + if (Player* player = ObjectAccessor::FindPlayer(calendarEvent.GetCreatorGUID())) + player->GetSession()->SendCalendarEvent(calendarEvent, type); +} + +void CalendarMgr::SendCalendarEventInvite(CalendarInvite const& invite, bool pending) +{ + if (Player* player = ObjectAccessor::FindPlayer(invite.GetSenderGUID())) + player->GetSession()->SendCalendarEventInvite(invite, pending); +} + +void CalendarMgr::SendCalendarEventInviteAlert(CalendarEvent const& calendarEvent, CalendarInvite const& invite) +{ + if (Player* player = ObjectAccessor::FindPlayer(invite.GetInvitee())) + player->GetSession()->SendCalendarEventInviteAlert(calendarEvent, invite); +} + +void CalendarMgr::SendCalendarEventUpdateAlert(uint64 guid, CalendarEvent const& calendarEvent, CalendarSendEventType type) +{ + if (Player* player = ObjectAccessor::FindPlayer(guid)) + player->GetSession()->SendCalendarEventUpdateAlert(calendarEvent, type); +} + +void CalendarMgr::SendCalendarEventStatus(uint64 guid, CalendarEvent const& calendarEvent, CalendarInvite const& invite) +{ + if (Player* player = ObjectAccessor::FindPlayer(guid)) + player->GetSession()->SendCalendarEventStatus(calendarEvent, invite); +} + +void CalendarMgr::SendCalendarEventRemovedAlert(uint64 guid, CalendarEvent const& calendarEvent) +{ + if (Player* player = ObjectAccessor::FindPlayer(guid)) + player->GetSession()->SendCalendarEventRemovedAlert(calendarEvent); +} + +void CalendarMgr::SendCalendarEventInviteRemoveAlert(uint64 guid, CalendarEvent const& calendarEvent, uint8 status) +{ + if (Player* player = ObjectAccessor::FindPlayer(guid)) + player->GetSession()->SendCalendarEventInviteRemoveAlert(calendarEvent, status); +} + +void CalendarMgr::SendCalendarEventInviteRemove(uint64 guid, CalendarInvite const& invite, uint32 flags) +{ + if (Player* player = ObjectAccessor::FindPlayer(guid)) + player->GetSession()->SendCalendarEventInviteRemove(invite, flags); +} + +void CalendarMgr::SendCalendarEventModeratorStatusAlert(CalendarInvite const& invite) +{ + if (Player* player = ObjectAccessor::FindPlayer(invite.GetInvitee())) + player->GetSession()->SendCalendarEventModeratorStatusAlert(invite); } diff --git a/src/server/game/Calendar/CalendarMgr.h b/src/server/game/Calendar/CalendarMgr.h index 50acde647cc..f80a21d6960 100644 --- a/src/server/game/Calendar/CalendarMgr.h +++ b/src/server/game/Calendar/CalendarMgr.h @@ -1,19 +1,18 @@ /* - * Copyright (C) 2008-2012 Trinity + * Copyright (C) 2008-2012 TrinityCore * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #ifndef TRINITY_CALENDARMGR_H @@ -21,49 +20,57 @@ #include #include "Calendar.h" -#include "Player.h" class CalendarMgr { friend class ACE_Singleton; + public: + void LoadFromDB(); -public: - CalendarMgr(); - ~CalendarMgr(); + CalendarInvite* GetInvite(uint64 inviteId); + CalendarEvent* GetEvent(uint64 eventId); - CalendarInvite const* GetInvite(uint64 inviteId) - { - CalendarInviteMap::const_iterator itr = _inviteMap.find(inviteId); - if(itr != _inviteMap.end()) - return &itr->second; - return NULL; - } + CalendarinviteIdList const& GetPlayerInvites(uint64 guid); + CalendarEventIdList const& GetPlayerEvents(uint64 guid); - void AddInvite(CalendarInvite invite) { _inviteMap[invite.Id] = invite; } - void RemoveInvite(uint64 inviteId) { _inviteMap.erase(inviteId); } + uint32 GetPlayerNumPending(uint64 guid); + uint64 GetFreeEventId(); + uint64 GetFreeInviteId(); - CalendarEvent const* GetEvent(uint64 eventId) - { - CalendarEventMap::const_iterator itr = _eventMap.find(eventId); - if(itr != _eventMap.end()) - return &itr->second; - return NULL; - } + void AddAction(CalendarAction const& action); - void AddEvent(CalendarEvent event) { _eventMap[event.Id] = event; } - void RemoveEvent(uint64 eventId) { _eventMap.erase(eventId); } + void SendCalendarEvent(CalendarEvent const& calendarEvent, CalendarSendEventType type); + void SendCalendarEventInvite(CalendarInvite const& invite, bool pending); + void SendCalendarEventInviteAlert(CalendarEvent const& calendarEvent, CalendarInvite const& invite); + void SendCalendarEventInviteRemove(uint64 guid, CalendarInvite const& invite, uint32 flags); + void SendCalendarEventInviteRemoveAlert(uint64 guid, CalendarEvent const& calendarEvent, uint8 status); + void SendCalendarEventUpdateAlert(uint64 guid, CalendarEvent const& calendarEvent, CalendarSendEventType type); + void SendCalendarEventStatus(uint64 guid, CalendarEvent const& calendarEvent, CalendarInvite const& invite); + void SendCalendarEventRemovedAlert(uint64 guid, CalendarEvent const& calendarEvent); + void SendCalendarEventModeratorStatusAlert(CalendarInvite const& invite); - void AppendInvitesToCalendarPacketForPlayer(WorldPacket& data, Player* player); - void AppendEventsToCalendarPacketForPlayer(WorldPacket& data, Player* player); + private: + CalendarMgr(); + ~CalendarMgr(); + CalendarEvent* CheckPermisions(uint64 eventId, uint64 guid, uint64 invitateId, CalendarRanks minRank); - uint64 GetNextEventId() { return ++_currentEventId; } - uint64 GetNextInviteId() { return ++_currentInviteId; } + bool addEvent(CalendarEvent const& calendarEvent); + bool removeEvent(uint64 eventId); + bool addPlayerEvent(uint64 guid, uint64 eventId); + bool removePlayerEvent(uint64 guid, uint64 eventId); -private: - CalendarInviteMap _inviteMap; - CalendarEventMap _eventMap; - uint64 _currentEventId; - uint64 _currentInviteId; + bool addInvite(CalendarInvite const& invite); + uint64 removeInvite(uint64 inviteId); + bool addPlayerInvite(uint64 guid, uint64 inviteId); + bool removePlayerInvite(uint64 guid, uint64 inviteId); + + CalendarEventMap _events; + CalendarInviteMap _invites; + CalendarPlayerinviteIdMap _playerInvites; + CalendarPlayerEventIdMap _playerEvents; + + uint64 eventNum; + uint64 InviteNum; }; #define sCalendarMgr ACE_Singleton::instance() diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 26465691c64..8c1de583d06 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -16,15 +16,34 @@ * with this program. If not, see . */ +/* +----- Opcodes Not Used yet ----- + +SMSG_CALENDAR_CLEAR_PENDING_ACTION SendCalendarClearPendingAction() +SMSG_CALENDAR_RAID_LOCKOUT_UPDATED SendCalendarRaildLockoutUpdated(InstanceSave const* save) <--- Structure unknown, using LOCKOUT_ADDED +SMSG_CALENDAR_COMMAND_RESULT SendCalendarCommandResult(uint32 value) <--- Structure meanings not known using in a Hack way + +----- Opcodes without Sniffs ----- +SMSG_CALENDAR_FILTER_GUILD [ for (... uint32(count) { packguid(???), uint8(???) } ] +SMSG_CALENDAR_ARENA_TEAM [ for (... uint32(count) { packguid(???), uint8(???) } ] +CMSG_CALENDAR_EVENT_INVITE_NOTES [ packguid(Invitee), uint64(inviteId), string(Text), Boolean(Unk) ] +SMSG_CALENDAR_EVENT_INVITE_NOTES [ uint32(unk1), uint32(unk2), uint32(unk3), uint32(unk4), uint32(unk5) ] +SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT [ uint64(inviteId), string(Text) ] +SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT [ Structure unkown ] + +*/ + #include "Common.h" #include "WorldPacket.h" #include "WorldSession.h" -#include "CalendarMgr.h" #include "InstanceSaveMgr.h" #include "Log.h" #include "Opcodes.h" #include "Player.h" +#include "CalendarMgr.h" +#include "ObjectMgr.h" +#include "ObjectAccessor.h" void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) { @@ -34,25 +53,67 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) time_t cur_time = time_t(time(NULL)); sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_SEND_CALENDAR [" UI64FMTD "]", guid); - // we can't really get the real size of this packet... - WorldPacket data(SMSG_CALENDAR_SEND_CALENDAR, 4+4*0+4+4*0+4+4); + WorldPacket data(SMSG_CALENDAR_SEND_CALENDAR, 1000); // Impossible to get the correct size without doing a double iteration of some elements - sCalendarMgr->AppendInvitesToCalendarPacketForPlayer(data, GetPlayer()); - sCalendarMgr->AppendEventsToCalendarPacketForPlayer(data, GetPlayer()); + CalendarinviteIdList const& invites = sCalendarMgr->GetPlayerInvites(guid); + data << uint32(invites.size()); + for (CalendarinviteIdList::const_iterator it = invites.begin(); it != invites.end(); ++it) + { + CalendarInvite* invite = sCalendarMgr->GetInvite(*it); + CalendarEvent* calendarEvent = invite ? sCalendarMgr->GetEvent(invite->GetEventId()) : NULL; - data << uint32(cur_time); // current time - data << uint32(secsToTimeBitFields(cur_time)); // unknown packed time + if (calendarEvent) + { + data << uint64(invite->GetEventId()); + data << uint64(invite->GetInviteId()); + data << uint8(invite->GetStatus()); + data << uint8(invite->GetRank()); + data << uint8(calendarEvent->GetGuildId() != 0); + data.appendPackGUID(calendarEvent->GetCreatorGUID()); + } + else + { + sLog->outError("SMSG_CALENDAR_SEND_CALENDAR: No Invite found with id [" UI64FMTD "]", *it); + data << uint64(0) << uint64(0) << uint8(0) << uint8(0); + data.appendPackGUID(0); + } + } + + CalendarEventIdList const& events = sCalendarMgr->GetPlayerEvents(guid); + data << uint32(events.size()); + for (CalendarEventIdList::const_iterator it = events.begin(); it != events.end(); ++it) + { + if (CalendarEvent* calendarEvent = sCalendarMgr->GetEvent(*it)) + { + data << uint64(*it); + data << calendarEvent->GetTitle().c_str(); + data << uint32(calendarEvent->GetType()); + data << uint32(calendarEvent->GetTime()); + data << uint32(calendarEvent->GetFlags()); + data << uint32(calendarEvent->GetDungeonId()); + data.appendPackGUID(calendarEvent->GetCreatorGUID()); + } + else + { + sLog->outError("SMSG_CALENDAR_SEND_CALENDAR: No Event found with id [" UI64FMTD "]", *it); + data << uint64(0) << uint8(0) << uint32(0) + << uint32(0) << uint32(0) << uint32(0); + data.appendPackGUID(0); + } + } + + data << uint32(cur_time); // server time + data << uint32(secsToTimeBitFields(cur_time)); // server time - InstanceSave *save = NULL; uint32 counter = 0; size_t p_counter = data.wpos(); - data << uint32(counter); // instance reset count + data << uint32(counter); // instance save count for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) for (Player::BoundInstancesMap::const_iterator itr = _player->m_boundInstances[i].begin(); itr != _player->m_boundInstances[i].end(); ++itr) if (itr->second.perm) { - save = itr->second.save; + InstanceSave const* save = itr->second.save; data << uint32(save->GetMapId()); data << uint32(save->GetDifficulty()); data << uint32(save->GetResetTime() - cur_time); @@ -69,12 +130,12 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) data << uint32(counter); // raid reset count std::set sentMaps; - + ResetTimeByMapDifficultyMap const& resets = sInstanceSaveMgr->GetResetTimeMap(); for (ResetTimeByMapDifficultyMap::const_iterator itr = resets.begin(); itr != resets.end(); ++itr) { uint32 mapId = PAIR32_LOPART(itr->first); - Difficulty difficulty = Difficulty(PAIR32_HIPART(itr->first)); + if (sentMaps.find(mapId) != sentMaps.end()) continue; @@ -82,40 +143,36 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) if (!mapEntry || !mapEntry->IsRaid()) continue; - MapDifficulty const* diff = GetMapDifficultyData(mapId, difficulty); - if (!diff) - continue; - sentMaps.insert(mapId); - + data << uint32(mapId); - data << uint32(diff->resetTime); + data << uint32(itr->second - cur_time); data << uint32(mapEntry->unk_time); ++counter; } data.put(p_counter, counter); - - // TODO: Fix this -- read from DBC? - std::string holidayName = ""; - uint32 holidayCount = 0; - data << uint32(holidayCount); // holiday count - for (uint32 i = 0; i < holidayCount; ++i) + data << uint32(0); // holiday count? + /* + for (;;) { - data << uint32(0); // Unk - data << uint32(0); // Unk - data << uint32(0); // Unk - data << uint32(0); // Unk - data << uint32(0); // Unk - for (uint8 j = 0; j < 26; ++j) - data << uint32(0); // Unk - for (uint8 j = 0; j < 10; ++j) - data << uint32(0); // Unk - for (uint8 j = 0; j < 10; ++j) - data << uint32(0); // Unk - data << holidayName.c_str(); // holiday name + uint32 unk5, unk6, unk7, unk8, unk9; + for (uint32 j = 0; j < 26; ++j) + { + uint32 unk10; + } + for (uint32 j = 0; j < 10; ++j) + { + uint32 unk11; + } + for (uint32 j = 0; j < 10; ++j) + { + uint32 unk12; + } + std::string holidayName; // 64 chars } + */ SendPacket(&data); } @@ -124,294 +181,687 @@ void WorldSession::HandleCalendarGetEvent(WorldPacket& recv_data) { uint64 eventId; recv_data >> eventId; - if (!eventId) - return; - //SendCalendarEvent(eventId); + + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_GET_EVENT. Event: [" + UI64FMTD "] Event [" UI64FMTD "]", _player->GetGUID(), eventId); + + if (CalendarEvent* calendarEvent = sCalendarMgr->GetEvent(eventId)) + SendCalendarEvent(*calendarEvent, CALENDAR_SENDTYPE_GET); } void WorldSession::HandleCalendarGuildFilter(WorldPacket& recv_data) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_GUILD_FILTER"); - - uint32 unk1; - uint32 unk2; - uint32 unk3; - recv_data >> unk1; - recv_data >> unk2; - recv_data >> unk3; + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_GUILD_FILTER [" UI64FMTD "]", _player->GetGUID()); + recv_data.read_skip(); // unk1 + recv_data.read_skip(); // unk2 + recv_data.read_skip(); // level } void WorldSession::HandleCalendarArenaTeam(WorldPacket& recv_data) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_ARENA_TEAM"); - - uint32 unk1; - recv_data >> unk1; + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_ARENA_TEAM [" UI64FMTD "]", _player->GetGUID()); + recv_data.read_skip(); // unk } void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_ADD_EVENT"); - + uint64 guid = _player->GetGUID(); std::string title; std::string description; - uint8 type; // CalendarEventType - uint8 unkbyte; + uint8 type; + bool repeatable; uint32 maxInvites; - uint32 dungeonId; + int32 dungeonId; uint32 eventPackedTime; uint32 unkPackedTime; - uint32 flags; // CalendarFlags + uint32 flags; + uint64 inviteId = 0; + uint64 invitee; + uint8 status; + uint8 rank; - recv_data >> title; - recv_data >> description; - recv_data >> type; - recv_data >> unkbyte; - recv_data >> maxInvites; - recv_data >> dungeonId; - recv_data >> eventPackedTime; - recv_data >> unkPackedTime; - recv_data >> flags; + recv_data >> title >> description >> type >> repeatable >> maxInvites; + recv_data >> dungeonId >> eventPackedTime >> unkPackedTime >> flags; - CalendarEvent event; - event.Id = sCalendarMgr->GetNextEventId(); - event.Name = title; - event.Description = description; - event.Type = (CalendarEventType) type; - event.Unk = unkbyte; - event.DungeonId = dungeonId; - event.Flags = (CalendarFlags) flags; - event.Time = eventPackedTime; - event.UnkTime = unkPackedTime; - event.CreatorGuid = GetPlayer()->GetGUID(); - - sCalendarMgr->AddEvent(event); - - if (flags & CALENDARFLAG_WITHOUT_INVITES) - return; - - uint32 inviteCount; - recv_data >> inviteCount; - - if (!inviteCount) - return; - - uint64 guid; - uint8 status; // CalendarEventStatus - uint8 rank; // CalendarModerationRank - for (uint32 i = 0; i < inviteCount; ++i) + if (!(flags & CALENDAR_FLAG_WITHOUT_INVITES)) { - CalendarInvite invite; - invite.Id = sCalendarMgr->GetNextInviteId(); + uint32 inviteCount; + recv_data >> inviteCount; + recv_data.readPackGUID(invitee); + recv_data >> status >> rank; - recv_data.readPackGUID(guid); - recv_data >> status; - recv_data >> rank; - - invite.Event = event.Id; - invite.CreatorGuid = GetPlayer()->GetGUID(); - invite.TargetGuid = guid; - invite.Status = (CalendarEventStatus) status; - invite.Rank = (CalendarModerationRank) rank; - invite.Time = event.Time; - invite.Text = ""; // hmm... - invite.Unk1 = invite.Unk2 = invite.Unk3 = 0; - - sCalendarMgr->AddInvite(invite); + if (inviteCount != 1 || invitee != guid) + { + sLog->outError("HandleCalendarAddEvent: [" UI64FMTD + "]: More than one invite (%d) or Invitee [" UI64FMTD + "] differs", guid, inviteCount, invitee); + return; + } + inviteId = sCalendarMgr->GetFreeInviteId(); } - //SendCalendarEvent(eventId, true); + else + { + inviteId = 0; + status = CALENDAR_STATUS_NO_OWNER; + rank = CALENDAR_RANK_PLAYER; + } + + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_ADD_EVENT: [" UI64FMTD "] " + "Title %s, Description %s, type %u, Repeatable %u, MaxInvites %u, " + "Dungeon ID %d, Time %u, Time2 %u, Flags %u, Invitee [" UI64FMTD "] " + "Status %d, Rank %d", guid, title.c_str(), description.c_str(), + type, repeatable, maxInvites, dungeonId, eventPackedTime, + unkPackedTime, flags, invitee, status, rank); + + CalendarAction action; + + action.SetAction(CALENDAR_ACTION_ADD_EVENT); + action.SetGUID(guid); + action.Event.SetEventId(sCalendarMgr->GetFreeEventId()); + action.Event.SetCreatorGUID(guid); + action.Event.SetType(type); + action.Event.SetFlags(flags); + action.Event.SetTime(eventPackedTime); + action.Event.SetTimeZoneTime(unkPackedTime); + action.Event.SetRepeatable(repeatable); + action.Event.SetMaxInvites(maxInvites); + action.Event.SetDungeonId(dungeonId); + action.Event.SetGuildId((flags & CALENDAR_FLAG_GUILD_ONLY) ? GetPlayer()->GetGuildId() : 0); + action.Event.SetTitle(title); + action.Event.SetDescription(description); + action.Event.AddInvite(inviteId); + action.Invite.SetEventId(action.Event.GetEventId()); + action.Invite.SetInviteId(inviteId); + action.Invite.SetInvitee(invitee); + action.Invite.SetStatus(status); + action.Invite.SetRank(rank); + action.Invite.SetSenderGUID(guid); + + sCalendarMgr->AddAction(action); } void WorldSession::HandleCalendarUpdateEvent(WorldPacket& recv_data) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_UPDATE_EVENT"); - recv_data.rfinish(); // set to end to avoid warnings spam + uint64 guid = _player->GetGUID(); + uint64 eventId; + uint64 inviteId; + std::string title; + std::string description; + uint8 type; + bool repeatable; + uint32 maxInvites; + int32 dungeonId; + uint32 eventPackedTime; + uint32 timeZoneTime; + uint32 flags; - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> std::string - //recv_data >> std::string - //recv_data >> uint8 - //recv_data >> uint8 - //recv_data >> uint32 - //recv_data >> uint32 - //recv_data >> uint32 - //recv_data >> uint32 - //recv_data >> uint32 + recv_data >> eventId >> inviteId >> title >> description >> type; + recv_data >> repeatable >> maxInvites >> dungeonId; + recv_data >> eventPackedTime >> timeZoneTime >> flags; + + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_UPDATE_EVENT [" UI64FMTD "] EventId [" UI64FMTD + "], InviteId [" UI64FMTD "] Title %s, Description %s, type %u " + "Repeatable %u, MaxInvites %u, Dungeon ID %d, Time %u " + "Time2 %u, Flags %u", guid, eventId, inviteId, title.c_str(), + description.c_str(), type, repeatable, maxInvites, dungeonId, + eventPackedTime, timeZoneTime, flags); + + CalendarAction action; + action.SetAction(CALENDAR_ACTION_MODIFY_EVENT); + action.SetGUID(guid); + action.SetInviteId(inviteId); + action.Event.SetEventId(eventId); + action.Event.SetType(type); + action.Event.SetFlags(flags); + action.Event.SetTime(eventPackedTime); + action.Event.SetTimeZoneTime(timeZoneTime); + action.Event.SetRepeatable(repeatable); + action.Event.SetDungeonId(dungeonId); + action.Event.SetTitle(title); + action.Event.SetDescription(description); + action.Event.SetMaxInvites(maxInvites); + + sCalendarMgr->AddAction(action); } void WorldSession::HandleCalendarRemoveEvent(WorldPacket& recv_data) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_REMOVE_EVENT"); - + uint64 guid = _player->GetGUID(); uint64 eventId; - uint64 creatorGuid; - uint32 unk1; + uint64 inviteId; + uint32 flags; - recv_data >> eventId; - recv_data >> creatorGuid; - recv_data >> unk1; + recv_data >> eventId >> inviteId >> flags; + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_REMOVE_EVENT [" UI64FMTD "], EventId [" UI64FMTD + "] inviteId [" UI64FMTD "] Flags?: %u", guid, eventId, inviteId, flags); + + CalendarAction action; + action.SetAction(CALENDAR_ACTION_REMOVE_EVENT); + action.SetGUID(guid); + action.SetInviteId(inviteId); + action.Event.SetEventId(eventId); + action.Event.SetFlags(flags); + + sCalendarMgr->AddAction(action); } void WorldSession::HandleCalendarCopyEvent(WorldPacket& recv_data) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_COPY_EVENT"); - recv_data.rfinish(); // set to end to avoid warnings spam + uint64 guid = _player->GetGUID(); + uint64 eventId; + uint64 inviteId; + uint32 time; - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint32 + recv_data >> eventId >> inviteId >> time; + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_COPY_EVENT [" UI64FMTD "], EventId [" UI64FMTD + "] inviteId [" UI64FMTD "] Time: %u", guid, eventId, inviteId, time); + CalendarAction action; + action.SetAction(CALENDAR_ACTION_COPY_EVENT); + action.SetGUID(guid); + action.SetInviteId(inviteId); + action.Event.SetEventId(eventId); + action.Event.SetTime(time); + + sCalendarMgr->AddAction(action); } void WorldSession::HandleCalendarEventInvite(WorldPacket& recv_data) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_EVENT_INVITE"); - + uint64 guid = _player->GetGUID(); uint64 eventId; uint64 inviteId; std::string name; uint8 status; uint8 rank; - recv_data >> eventId; - recv_data >> inviteId; - recv_data >> name; - recv_data >> status; - recv_data >> rank; + recv_data >> eventId >> inviteId >> name >> status >> rank; + uint64 invitee = 0; + if (Player* player = sObjectAccessor->FindPlayerByName(name.c_str())) + invitee = player->GetGUID(); + else + invitee = sObjectMgr->GetPlayerGUIDByName(name.c_str()); - //FIXME - Finish it + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_EVENT_INVITE [" UI64FMTD "], EventId [" + UI64FMTD "] InviteId [" UI64FMTD "] Name %s ([" UI64FMTD "]), status %u, " + "Rank %u", guid, eventId, inviteId, name.c_str(), invitee, status, rank); - recv_data.rfinish(); // set to end to avoid warnings spam + CalendarAction action; + action.SetAction(CALENDAR_ACTION_ADD_EVENT_INVITE); + action.SetGUID(guid); + action.SetInviteId(inviteId); + action.Invite.SetEventId(eventId); + action.Invite.SetInviteId(sCalendarMgr->GetFreeInviteId()); + action.Invite.SetSenderGUID(_player->GetGUID()); + action.Invite.SetInvitee(invitee); + action.Invite.SetRank(rank); + action.Invite.SetStatus(status); + + sCalendarMgr->AddAction(action); +} + +void WorldSession::HandleCalendarEventSignup(WorldPacket& recv_data) +{ + uint64 guid = _player->GetGUID(); + uint64 eventId; + uint8 status; + + recv_data >> eventId >> status; + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_EVENT_SIGNUP [" UI64FMTD "] EventId [" + UI64FMTD "] Status %u", guid, eventId, status); + + CalendarAction action; + action.SetAction(CALENDAR_ACTION_SIGNUP_TO_EVENT); + action.SetGUID(guid); + action.SetExtraData(GetPlayer()->GetGuildId()); + action.Event.SetEventId(eventId); + action.Invite.SetStatus(status); + sCalendarMgr->AddAction(action); } void WorldSession::HandleCalendarEventRsvp(WorldPacket& recv_data) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_EVENT_RSVP"); - recv_data.rfinish(); // set to end to avoid warnings spam + uint64 guid = _player->GetGUID(); + uint64 eventId; + uint64 inviteId; + uint8 status; - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint32 + recv_data >> eventId >> inviteId >> status; + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_EVENT_RSVP [" UI64FMTD"] EventId [" + UI64FMTD "], InviteId [" UI64FMTD "], status %u", guid, eventId, + inviteId, status); + CalendarAction action; + action.SetAction(CALENDAR_ACTION_MODIFY_EVENT_INVITE); + action.SetGUID(guid); + action.SetInviteId(inviteId); + action.Invite.SetInviteId(inviteId); + action.Invite.SetEventId(eventId); + action.Invite.SetStatus(status); + + sCalendarMgr->AddAction(action); } void WorldSession::HandleCalendarEventRemoveInvite(WorldPacket& recv_data) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_EVENT_REMOVE_INVITE"); - recv_data.rfinish(); // set to end to avoid warnings spam + uint64 guid = _player->GetGUID(); + uint64 invitee; + uint64 eventId; + uint64 owninviteId; + uint64 inviteId; - //recv_data.readPackGUID(guid) - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint64 + recv_data.readPackGUID(invitee); + recv_data >> inviteId >> owninviteId >> eventId; + + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_EVENT_REMOVE_INVITE [" + UI64FMTD "] EventId [" UI64FMTD "], OwnInviteId [" + UI64FMTD "], Invitee ([" UI64FMTD "] id: [" UI64FMTD "])", + guid, eventId, owninviteId, invitee, inviteId); + + CalendarAction action; + action.SetAction(CALENDAR_ACTION_REMOVE_EVENT_INVITE); + action.SetGUID(guid); + action.SetInviteId(owninviteId); + action.Invite.SetInviteId(inviteId); + action.Invite.SetEventId(eventId); + action.Invite.SetInvitee(invitee); + + sCalendarMgr->AddAction(action); } void WorldSession::HandleCalendarEventStatus(WorldPacket& recv_data) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_EVENT_STATUS"); - recv_data.rfinish(); // set to end to avoid warnings spam + uint64 guid = _player->GetGUID(); + uint64 invitee; + uint64 eventId; + uint64 inviteId; + uint64 owninviteId; + uint8 status; - //recv_data.readPackGUID(guid) - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint32 + recv_data.readPackGUID(invitee); + recv_data >> eventId >> inviteId >> owninviteId >> status; + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_EVENT_STATUS [" UI64FMTD"] EventId [" + UI64FMTD "] OwnInviteId [" UI64FMTD "], Invitee ([" UI64FMTD "] id: [" + UI64FMTD "], status %u", guid, eventId, owninviteId, invitee, inviteId, status); + + CalendarAction action; + action.SetAction(CALENDAR_ACTION_MODIFY_EVENT_INVITE); + action.SetGUID(guid); + action.SetInviteId(owninviteId); + action.Invite.SetInviteId(inviteId); + action.Invite.SetEventId(eventId); + action.Invite.SetInvitee(invitee); + action.Invite.SetStatus(status); + + sCalendarMgr->AddAction(action); } void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket& recv_data) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_EVENT_MODERATOR_STATUS"); - recv_data.rfinish(); // set to end to avoid warnings spam + uint64 guid = _player->GetGUID(); + uint64 invitee; + uint64 eventId; + uint64 inviteId; + uint64 owninviteId; + uint8 status; - //recv_data.readPackGUID(guid) - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint32 + recv_data.readPackGUID(invitee); + recv_data >> eventId >> inviteId >> owninviteId >> status; + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_EVENT_MODERATOR_STATUS [" UI64FMTD "] EventId [" + UI64FMTD "] OwnInviteId [" UI64FMTD "], Invitee ([" UI64FMTD "] id: [" + UI64FMTD "], status %u", guid, eventId, owninviteId, invitee, inviteId, status); + + CalendarAction action; + action.SetAction(CALENDAR_ACTION_MODIFY_MODERATOR_EVENT_INVITE); + action.SetGUID(guid); + action.SetInviteId(owninviteId); + action.Invite.SetInviteId(inviteId); + action.Invite.SetEventId(eventId); + action.Invite.SetInvitee(invitee); + action.Invite.SetStatus(status); + + sCalendarMgr->AddAction(action); } void WorldSession::HandleCalendarComplain(WorldPacket& recv_data) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_COMPLAIN"); - recv_data.rfinish(); // set to end to avoid warnings spam + uint64 guid = _player->GetGUID(); + uint64 eventId; + uint64 complainGUID; - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint64 + recv_data >> eventId >> complainGUID; + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_COMPLAIN [" UI64FMTD "] EventId [" + UI64FMTD "] guid [" UI64FMTD "]", guid, eventId, complainGUID); } void WorldSession::HandleCalendarGetNumPending(WorldPacket& /*recv_data*/) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_GET_NUM_PENDING"); // empty + uint64 guid = _player->GetGUID(); + uint32 pending = sCalendarMgr->GetPlayerNumPending(guid); + + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_GET_NUM_PENDING: [" UI64FMTD + "] Pending: %u", guid, pending); WorldPacket data(SMSG_CALENDAR_SEND_NUM_PENDING, 4); - data << uint32(0); // number of pending invites + data << uint32(pending); SendPacket(&data); } -void WorldSession::SendCalendarEvent(uint64 eventId, bool added) -{ - sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_SEND_EVENT"); - WorldPacket data(SMSG_CALENDAR_SEND_EVENT); - data << uint8(added); // from add_event - data.appendPackGUID(0); // creator GUID - data << uint64(0); // event ID - data << uint8(0); // event name - data << uint8(0); // event description - data << uint8(0); // event type - data << uint8(0); // unk - data << uint32(100); // Max invites - data << int32(0); // dungeon ID - data << uint32(0); // unk time - data << uint32(0); // event time - data << uint32(0); // event flags - data << uint32(0); // event guild id +// ----------------------------------- SEND ------------------------------------ - if (false) // invites exist +void WorldSession::SendCalendarEvent(CalendarEvent const& calendarEvent, uint8 sendEventType) +{ + uint64 guid = _player->GetGUID(); + uint64 eventId = calendarEvent.GetEventId(); + + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_SEND_EVENT [" UI64FMTD "] EventId [" + UI64FMTD "] SendType %u", guid, eventId, sendEventType); + + WorldPacket data(SMSG_CALENDAR_SEND_EVENT); + data << uint8(sendEventType); + data.appendPackGUID(calendarEvent.GetCreatorGUID()); + data << uint64(eventId); + data << calendarEvent.GetTitle().c_str(); + data << calendarEvent.GetDescription().c_str(); + data << uint8(calendarEvent.GetType()); + data << uint8(calendarEvent.GetRepeatable()); + data << uint32(calendarEvent.GetMaxInvites()); + data << int32(calendarEvent.GetDungeonId()); + data << uint32(calendarEvent.GetFlags()); + data << uint32(calendarEvent.GetTime()); + data << uint32(calendarEvent.GetTimeZoneTime()); + data << uint32(calendarEvent.GetGuildId()); + + CalendarinviteIdList const& invites = calendarEvent.GetInviteIdList(); + data << uint32(invites.size()); + for (CalendarinviteIdList::const_iterator it = invites.begin(); it != invites.end(); ++it) { - data << uint32(0); // invite count - for (uint8 i = 0; i < 0; ++i) + if (CalendarInvite* invite = sCalendarMgr->GetInvite(*it)) { - data << uint64(0); // invite played guid - data << uint8(0); // unk - data << uint8(0); // status - data << uint8(0); // rank - data << uint8(0); // unk - data << uint64(0); // invite ID - data << uint32(0); // unk - data << uint8(0); // text + uint64 guid = invite->GetInvitee(); + Player* player = ObjectAccessor::FindPlayer(guid); + uint8 level = player ? player->getLevel() : Player::GetLevelFromDB(guid); + + data.appendPackGUID(guid); + data << uint8(level); + data << uint8(invite->GetStatus()); + data << uint8(invite->GetRank()); + data << uint8(calendarEvent.GetGuildId() != 0); + data << uint64(invite->GetInviteId()); + data << uint32(invite->GetStatusTime()); + data << invite->GetText().c_str(); + } + else + { + data.appendPackGUID(guid); + data << uint8(0) << uint8(0) << uint8(0) << uint8(0) + << uint64(0) << uint32(0) << uint8(0); + + sLog->outError("SendCalendarEvent: No Invite found with id [" UI64FMTD "]", *it); } } SendPacket(&data); } -void WorldSession::SendCalendarEventInviteAlert(uint64 eventId, uint64 inviteId) +void WorldSession::SendCalendarEventInvite(CalendarInvite const& invite, bool pending) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_INVITE_ALERT"); - WorldPacket data(SMSG_CALENDAR_EVENT_INVITE_ALERT); - data << uint64(0); // event ID - data << uint8(0); // event title - data << uint32(0); // event time - uint32 unknum = 1; - data << uint32(unknum); - data << uint8(0); // event type - data << uint32(0); // dungeon id - data << uint64(0); // invite id - data << uint8(0); // invite status - data << uint8(0); // invite rank - data.appendPackGUID(0); // event creator - data.appendPackGUID(0); // invite sender + uint64 guid = _player->GetGUID(); + uint64 eventId = invite.GetEventId(); + uint64 inviteId = invite.GetInviteId(); + uint64 invitee = invite.GetInvitee(); + uint8 status = invite.GetStatus(); + uint32 statusTime = invite.GetStatusTime(); + Player* player = ObjectAccessor::FindPlayer(invitee); + uint8 level = player ? player->getLevel() : Player::GetLevelFromDB(invitee); + + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_INVITE [" UI64FMTD "] EventId [" + UI64FMTD "] InviteId [" UI64FMTD "] Invitee [" UI64FMTD "] " + " Level %u, Status %u, StatusTime %u" , guid, eventId, inviteId, + invitee, level, status, statusTime); + + WorldPacket data(SMSG_CALENDAR_EVENT_INVITE, 8 + 8 + 8 + 1 + 1 + 1 + (statusTime ? 4 : 0) + 1); + data.appendPackGUID(invitee); + data << uint64(eventId); + data << uint64(inviteId); + data << uint8(level); + data << uint8(status); + if (statusTime) + data << uint8(1) << uint32(statusTime); + else + data << uint8(0); + data << uint8(pending); + SendPacket(&data); } -void WorldSession::SendCalendarEventRemovedAlert(uint64 eventId) +void WorldSession::SendCalendarEventInviteAlert(CalendarEvent const& calendarEvent, CalendarInvite const& invite) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_REMOVED_ALERT"); - WorldPacket data(SMSG_CALENDAR_EVENT_REMOVED_ALERT); - data << uint8(0); // unk - data << uint64(0); // invite id - data << uint32(0); // invite time + uint64 guid = _player->GetGUID(); + uint64 eventId = calendarEvent.GetEventId(); + uint64 inviteId = invite.GetInviteId(); + + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_INVITE_ALERT [" UI64FMTD "] EventId [" + UI64FMTD "] InviteId [" UI64FMTD "]", guid, eventId, inviteId); + + WorldPacket data(SMSG_CALENDAR_EVENT_INVITE_ALERT); + data << uint64(eventId); + data << calendarEvent.GetTitle().c_str(); + data << uint32(calendarEvent.GetTime()); + data << uint32(calendarEvent.GetFlags()); + data << uint32(calendarEvent.GetType()); + data << uint32(calendarEvent.GetDungeonId()); + data << uint64(inviteId); + data << uint8(invite.GetStatus()); + data << uint8(invite.GetRank()); + data.appendPackGUID(calendarEvent.GetCreatorGUID()); + data.appendPackGUID(invite.GetSenderGUID()); + SendPacket(&data); +} + +void WorldSession::SendCalendarEventUpdateAlert(CalendarEvent const& calendarEvent, uint8 sendEventType) +{ + uint64 guid = _player->GetGUID(); + uint64 eventId = calendarEvent.GetEventId(); + + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_UPDATED_ALERT [" + UI64FMTD "] EventId [" UI64FMTD "]", guid, eventId); + + + WorldPacket data(SMSG_CALENDAR_EVENT_UPDATED_ALERT, 1 + 8 + 4 + 4 + 4 + 1 + 4 + + calendarEvent.GetTitle().size() + calendarEvent.GetDescription().size() + 1 + 4 + 4); + data << uint8(sendEventType); + data << uint64(eventId); + data << uint32(calendarEvent.GetTime()); + data << uint32(calendarEvent.GetFlags()); + data << uint32(calendarEvent.GetTime()); + data << uint8(calendarEvent.GetType()); + data << uint32(calendarEvent.GetDungeonId()); + data << calendarEvent.GetTitle().c_str(); + data << calendarEvent.GetDescription().c_str(); + data << uint8(calendarEvent.GetRepeatable()); + data << uint32(calendarEvent.GetMaxInvites()); + data << uint32(0); // FIXME + SendPacket(&data); +} + +void WorldSession::SendCalendarEventRemovedAlert(CalendarEvent const& calendarEvent) +{ + uint64 guid = _player->GetGUID(); + uint64 eventId = calendarEvent.GetEventId(); + uint32 eventTime = (calendarEvent.GetTime()); + + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_REMOVED_ALERT [" UI64FMTD "] EventId [" + UI64FMTD "] Time %u", guid, eventId, eventTime); + + WorldPacket data(SMSG_CALENDAR_EVENT_REMOVED_ALERT, 1 + 8 + 1); + data << uint8(0); // FIXME + data << uint64(eventId); + data << uint32(eventTime); + SendPacket(&data); +} + +void WorldSession::SendCalendarEventStatus(CalendarEvent const& calendarEvent, CalendarInvite const& invite) +{ + uint64 guid = _player->GetGUID(); + uint64 eventId = calendarEvent.GetEventId(); + uint64 inviteId = invite.GetInviteId(); + uint64 invitee = invite.GetInvitee(); + uint32 eventTime = (calendarEvent.GetTime()); + uint32 flags = calendarEvent.GetFlags(); + uint8 status = invite.GetStatus(); + uint8 rank = invite.GetRank(); + uint32 statusTime = secsToTimeBitFields(invite.GetStatusTime()); + + + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_STATUS [" UI64FMTD "] EventId [" + UI64FMTD "] InviteId [" UI64FMTD "] Invitee [" UI64FMTD "] Time %u " + "Flags %u, Status %u, Rank %u, StatusTime %u", + guid, eventId, inviteId, invitee, eventTime, flags, status, rank, + statusTime); + + WorldPacket data(SMSG_CALENDAR_EVENT_STATUS, 8 + 8 + 4 + 4 + 1 + 1 + 4); + data.appendPackGUID(invitee); + data << uint64(eventId); + data << uint32(eventTime); + data << uint32(flags); + data << uint8(status); + data << uint8(rank); + data << uint32(statusTime); + SendPacket(&data); +} + +void WorldSession::SendCalendarEventModeratorStatusAlert(CalendarInvite const& invite) +{ + uint64 guid = _player->GetGUID(); + uint64 eventId = invite.GetEventId(); + uint64 invitee = invite.GetInvitee(); + uint8 status = invite.GetStatus(); + + + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT [" UI64FMTD + "] Invitee [" UI64FMTD "] EventId [" UI64FMTD "] Status %u ", guid, + invitee, eventId, status); + + + WorldPacket data(SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT, 8 + 8 + 1 + 1); + data.appendPackGUID(invitee); + data << uint64(eventId); + data << uint8(status); + data << uint8(1); // FIXME + SendPacket(&data); +} + +void WorldSession::SendCalendarEventInviteRemoveAlert(CalendarEvent const& calendarEvent, uint8 status) +{ + uint64 guid = _player->GetGUID(); + uint64 eventId = calendarEvent.GetEventId(); + uint32 eventTime = (calendarEvent.GetTime()); + uint32 flags = calendarEvent.GetFlags(); + + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT [" + UI64FMTD "] EventId [" UI64FMTD "] Time %u, Flags %u, Status %u", + guid, eventId, eventTime, flags, status); + + WorldPacket data(SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT, 8 + 4 + 4 + 1); + data << uint64(eventId); + data << uint32(eventTime); + data << uint32(flags); + data << uint8(status); + SendPacket(&data); +} + +void WorldSession::SendCalendarEventInviteRemove(CalendarInvite const& invite, uint32 flags) +{ + uint64 guid = _player->GetGUID(); + uint64 eventId = invite.GetEventId(); + uint64 invitee = invite.GetInvitee(); + + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_INVITE_REMOVED [" + UI64FMTD "] Invitee [" UI64FMTD "] EventId [" UI64FMTD + "] Flags %u", guid, invitee, eventId, flags); + + WorldPacket data(SMSG_CALENDAR_EVENT_INVITE_REMOVED, 8 + 4 + 4 + 1); + data.appendPackGUID(invitee); + data << uint32(eventId); + data << uint32(flags); + data << uint8(1); // FIXME + SendPacket(&data); +} + +void WorldSession::SendCalendarClearPendingAction() +{ + uint64 guid = _player->GetGUID(); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_CLEAR_PENDING_ACTION [" UI64FMTD "]", guid); + + WorldPacket data(SMSG_CALENDAR_CLEAR_PENDING_ACTION, 0); + SendPacket(&data); +} + +void WorldSession::SendCalendarRaildLockoutUpdated(InstanceSave const* save) +{ + if (!save) + return; + + uint64 guid = _player->GetGUID(); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_RAID_LOCKOUT_UPDATED [" UI64FMTD + "] Map: %u, Difficulty %u", guid, save->GetMapId(), save->GetDifficulty()); + + time_t cur_time = time_t(time(NULL)); + + WorldPacket data(SMSG_CALENDAR_RAID_LOCKOUT_UPDATED, 4 + 4 + 4 + 4 + 8); + data << secsToTimeBitFields(cur_time); + data << uint32(save->GetMapId()); + data << uint32(save->GetDifficulty()); + data << uint32(save->GetResetTime() - cur_time); + data << uint64(save->GetInstanceId()); + SendPacket(&data); +} + +void WorldSession::SendCalendarCommandResult(uint32 value) +{ + uint64 guid = _player->GetGUID(); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_COMMAND_RESULT [" UI64FMTD "] Value: %u", guid, value); + + WorldPacket data(SMSG_CALENDAR_COMMAND_RESULT, 0); + data << uint16(0) << uint32(0) << uint32(value); + + SendPacket(&data); +} + +void WorldSession::SendCalendarRaildLockoutAdded(InstanceSave const* save) +{ + if (!save) + return; + + uint64 guid = _player->GetGUID(); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_RAID_LOCKOUT_ADDED [" UI64FMTD + "] Map: %u, Difficulty %u", guid, save->GetMapId(), save->GetDifficulty()); + + time_t cur_time = time_t(time(NULL)); + + WorldPacket data(SMSG_CALENDAR_RAID_LOCKOUT_ADDED, 4 + 4 + 4 + 4 + 8); + data << secsToTimeBitFields(cur_time); + data << uint32(save->GetMapId()); + data << uint32(save->GetDifficulty()); + data << uint32(save->GetResetTime() - cur_time); + data << uint64(save->GetInstanceId()); + SendPacket(&data); +} + +void WorldSession::SendCalendarRaildLockoutRemoved(InstanceSave const* save) +{ + if (!save) + return; + + uint64 guid = _player->GetGUID(); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_RAID_LOCKOUT_REMOVED [" UI64FMTD + "] Map: %u, Difficulty %u", guid, save->GetMapId(), save->GetDifficulty()); + + WorldPacket data(SMSG_CALENDAR_RAID_LOCKOUT_REMOVED, 4 + 4 + 4 + 8); + data << uint32(save->GetMapId()); + data << uint32(save->GetDifficulty()); + data << uint32(0); + data << uint64(save->GetInstanceId()); SendPacket(&data); } @@ -432,4 +882,4 @@ void WorldSession::SendCalendarRaidLockout(InstanceSave* save, bool add) data << uint32(save->GetResetTime() - currTime); data << uint64(save->GetInstanceId()); SendPacket(&data); -} +} \ No newline at end of file diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 4335452635b..e2e6772f230 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1236,7 +1236,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x4B7*/ { "SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x4B8*/ { "CMSG_UNUSED5", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL }, /*0x4B9*/ { "CMSG_UNUSED6", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4BA*/ { "CMSG_CALENDAR_EVENT_SIGNUP", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, + /*0x4BA*/ { "CMSG_CALENDAR_EVENT_SIGNUP", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventSignup }, /*0x4BB*/ { "SMSG_CALENDAR_CLEAR_PENDING_ACTION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x4BC*/ { "SMSG_EQUIPMENT_SET_LIST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x4BD*/ { "CMSG_EQUIPMENT_SET_SAVE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetSave }, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index a12470b842b..4f9880d3257 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -56,6 +56,8 @@ struct LfgProposal; struct LfgReward; struct LfgRoleCheck; struct LfgUpdateData; +class CalendarEvent; +class CalendarInvite; enum AccountDataType { @@ -878,9 +880,22 @@ class WorldSession void HandleCalendarEventModeratorStatus(WorldPacket& recv_data); void HandleCalendarComplain(WorldPacket& recv_data); void HandleCalendarGetNumPending(WorldPacket& recv_data); - void SendCalendarEvent(uint64 eventId, bool added = false); - void SendCalendarEventInviteAlert(uint64 eventId, uint64 inviteId); - void SendCalendarEventRemovedAlert(uint64 eventId); + void HandleCalendarEventSignup(WorldPacket& recv_data); + + void SendCalendarEvent(CalendarEvent const& calendarEvent, uint8 sendEventType); + void SendCalendarEventInvite(CalendarInvite const& invite, bool pending); + void SendCalendarEventInviteAlert(CalendarEvent const& calendarEvent, CalendarInvite const& calendarInvite); + void SendCalendarEventInviteRemove(CalendarInvite const& invite, uint32 flags); + void SendCalendarEventInviteRemoveAlert(CalendarEvent const& calendarEvent, uint8 status); + void SendCalendarEventRemovedAlert(CalendarEvent const& calendarEvent); + void SendCalendarEventUpdateAlert(CalendarEvent const& calendarEvent, uint8 sendEventType); + void SendCalendarEventStatus(CalendarEvent const& calendarEvent, CalendarInvite const& invite); + void SendCalendarEventModeratorStatusAlert(CalendarInvite const& invite); + void SendCalendarClearPendingAction(); + void SendCalendarRaildLockoutAdded(InstanceSave const* save); + void SendCalendarRaildLockoutRemoved(InstanceSave const* save); + void SendCalendarRaildLockoutUpdated(InstanceSave const* save); + void SendCalendarCommandResult(uint32 value); void SendCalendarRaidLockout(InstanceSave* save, bool add); void HandleSpellClick(WorldPacket& recv_data); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 59f5508149d..61757b4fab2 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -76,6 +76,7 @@ #include "Channel.h" #include "WardenCheckMgr.h" #include "Warden.h" +#include "CalendarMgr.h" volatile bool World::m_stopEvent = false; uint8 World::m_ExitCode = SHUTDOWN_EXIT_CODE; @@ -1659,6 +1660,9 @@ void World::SetInitialWorldSettings() sLog->outString("Loading SmartAI scripts..."); sSmartScriptMgr->LoadSmartAIFromDB(); + sLog->outString("Loading Calendar data..."); + sCalendarMgr->LoadFromDB(); + ///- Initialize game time and timers sLog->outString("Initialize game time and timers"); m_gameTime = time(NULL); From ae5ecb6ac00c859059835525c7e72deee33e7ff6 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 24 Feb 2012 22:04:29 +0100 Subject: [PATCH 0016/1149] Core/Calendar: Code refactoring/removed obsolete functions --- src/server/game/Calendar/Calendar.cpp | 316 +++---------------- src/server/game/Calendar/Calendar.h | 195 +++++++----- src/server/game/Calendar/CalendarMgr.cpp | 65 ++-- src/server/game/Calendar/CalendarMgr.h | 28 +- src/server/game/Handlers/CalendarHandler.cpp | 55 +--- 5 files changed, 219 insertions(+), 440 deletions(-) diff --git a/src/server/game/Calendar/Calendar.cpp b/src/server/game/Calendar/Calendar.cpp index 82ba3c1b062..320f49e0ed4 100755 --- a/src/server/game/Calendar/Calendar.cpp +++ b/src/server/game/Calendar/Calendar.cpp @@ -18,294 +18,70 @@ #include "Calendar.h" -CalendarInvite::CalendarInvite(uint64 _inviteId /* = 0 */): inviteId(_inviteId), -eventId(0), invitee(0), senderGUID(0), statusTime(0), status(0), rank(0) -{ -} - -CalendarInvite::~CalendarInvite() -{ -} - -void CalendarInvite::SetInviteId(uint64 _inviteId) -{ - inviteId = _inviteId; -} - -uint64 CalendarInvite::GetInviteId() const -{ - return inviteId; -} - -void CalendarInvite::SetEventId(uint64 _eventId) -{ - eventId = _eventId; -} - -uint64 CalendarInvite::GetEventId() const -{ - return eventId; -} - -void CalendarInvite::SetSenderGUID(uint64 _guid) -{ - senderGUID = _guid; -} - -uint64 CalendarInvite::GetSenderGUID() const -{ - return senderGUID; -} - -void CalendarInvite::SetInvitee(uint64 _guid) -{ - invitee = _guid; -} - -uint64 CalendarInvite::GetInvitee() const -{ - return invitee; -} - -void CalendarInvite::SetStatusTime(uint32 _statusTime) -{ - statusTime = _statusTime; -} - -uint32 CalendarInvite::GetStatusTime() const -{ - return statusTime; -} - -void CalendarInvite::SetText(std::string _text) -{ - text = _text; -} - -std::string CalendarInvite::GetText() const -{ - return text; -} - -void CalendarInvite::SetStatus(uint8 _status) -{ - status = _status; -} - -uint8 CalendarInvite::GetStatus() const -{ - return status; -} - -void CalendarInvite::SetRank(uint8 _rank) -{ - rank = _rank; -} - -uint8 CalendarInvite::GetRank() const -{ - return rank; -} - -CalendarEvent::CalendarEvent(uint64 _eventId /* = 0 */) : eventId(_eventId), -creatorGUID(0), guildId(0), type(CALENDAR_TYPE_OTHER), dungeonId(-1), -maxInvites(0), eventTime(0), flags(0), repeatable(false), timezoneTime(0), -title(""), description("") -{ -} - -CalendarEvent::~CalendarEvent() -{ -} - -void CalendarEvent::SetEventId(uint64 _eventId) -{ - eventId = _eventId; -} - -uint64 CalendarEvent::GetEventId() const -{ - return eventId; -} - -void CalendarEvent::SetCreatorGUID(uint64 _guid) -{ - creatorGUID = _guid; -} - -uint64 CalendarEvent::GetCreatorGUID() const -{ - return creatorGUID; -} - -void CalendarEvent::SetGuildId(uint32 _guildId) -{ - guildId = _guildId; -} - -uint32 CalendarEvent::GetGuildId() const -{ - return guildId; -} - -void CalendarEvent::SetTitle(std::string _title) -{ - title = _title; -} - -std::string CalendarEvent::GetTitle() const -{ - return title; -} - -void CalendarEvent::SetDescription(std::string _description) -{ - description = _description; -} - -std::string CalendarEvent::GetDescription() const -{ - return description; -} - -void CalendarEvent::SetType(uint8 _type) -{ - type = _type; -} - -uint8 CalendarEvent::GetType() const -{ - return type; -} - -void CalendarEvent::SetMaxInvites(uint32 max) -{ - maxInvites = max; -} - -uint32 CalendarEvent::GetMaxInvites() const -{ - return maxInvites; -} - -void CalendarEvent::SetDungeonId(int32 _dungeonId) -{ - dungeonId = _dungeonId; -} - -int32 CalendarEvent::GetDungeonId() const -{ - return dungeonId; -} - -void CalendarEvent::SetTime(uint32 _eventTime) -{ - eventTime = _eventTime; -} - -uint32 CalendarEvent::GetTime() const -{ - return eventTime; -} - -void CalendarEvent::SetFlags(uint32 _flags) -{ - flags = _flags; -} - -uint32 CalendarEvent::GetFlags() const -{ - return flags; -} - -void CalendarEvent::SetRepeatable(bool _repeatable) -{ - repeatable = _repeatable; -} - -uint8 CalendarEvent::GetRepeatable() const -{ - return repeatable; -} - -void CalendarEvent::SetTimeZoneTime(uint32 _timezoneTime) -{ - timezoneTime = _timezoneTime; -} - -uint32 CalendarEvent::GetTimeZoneTime() const -{ - return timezoneTime; -} - -void CalendarEvent::AddInvite(uint64 inviteId) -{ - if (inviteId) - _invites.insert(inviteId); -} - -void CalendarEvent::RemoveInvite(uint64 inviteId) -{ - _invites.erase(inviteId); -} - -bool CalendarEvent::HasInvite(uint64 inviteId) const -{ - return _invites.find(inviteId) != _invites.end(); -} - -CalendarinviteIdList const& CalendarEvent::GetInviteIdList() const -{ - return _invites; -} - -void CalendarEvent::SetInviteIdList(CalendarinviteIdList const& list) -{ - _invites = list; -} - -void CalendarEvent::ClearInviteIdList() -{ - _invites.clear(); -} - std::string CalendarInvite::GetDebugString() const { std::ostringstream data; data << "CalendarInvite::" - << " inviteId: " << inviteId - << " EventId: " << eventId - << " Status: " << uint32(status) - << " Invitee: " << invitee - << " Sender: " << senderGUID - << " Rank: " << uint32(rank) - << " Text: " << text; + << " inviteId: " << _inviteId + << " EventId: " << _eventId + << " Status: " << uint32(_status) + << " Invitee: " << _invitee + << " Sender: " << _senderGUID + << " Rank: " << uint32(_rank) + << " Text: " << _text; return data.str(); } +void CalendarInvite::Init() +{ + _eventId = 0; + _invitee = 0; + _senderGUID = 0; + _statusTime = 0; + _status = 0; + _rank = 0; + _text = ""; +} + std::string CalendarEvent::GetDebugString() const { std::ostringstream data; data << "CalendarEvent::" - << " EventId: " << eventId - << " Title: " << title - << " Description" << description - << " Type: " << uint32(type) - << " Max Invites: " << maxInvites - << " Creator: " << creatorGUID - << " Flags: " << flags - << " Guild: " << guildId - << " Time: " << eventTime - << " Time2: " << timezoneTime - << " Repeatable: " << uint32(repeatable) - << " DungeonId: " << dungeonId; + << " EventId: " << _eventId + << " Title: " << _title + << " Description" << _description + << " Type: " << uint32(_type) + << " Max Invites: " << _maxInvites + << " Creator: " << _creatorGUID + << " Flags: " << _flags + << " Guild: " << _guildId + << " Time: " << _eventTime + << " Time2: " << _timezoneTime + << " Repeatable: " << uint32(_repeatable) + << " DungeonId: " << _dungeonId; return data.str(); } +void CalendarEvent::Init() +{ + _creatorGUID = 0; + _guildId = 0; + _type = CALENDAR_TYPE_OTHER; + _dungeonId = -1; + _maxInvites = 0; + _eventTime = 0; + _flags = 0; + _repeatable = false; + _timezoneTime = 0; + _title = ""; + _description = ""; + +} + std::string CalendarAction::GetDebugString() const { std::ostringstream data; diff --git a/src/server/game/Calendar/Calendar.h b/src/server/game/Calendar/Calendar.h index ffe2f97269c..ad073ffbebf 100755 --- a/src/server/game/Calendar/Calendar.h +++ b/src/server/game/Calendar/Calendar.h @@ -84,36 +84,48 @@ enum CalendarInviteStatus class CalendarInvite { public: - CalendarInvite(uint64 _inviteId = 0); - ~CalendarInvite(); + CalendarInvite() : _inviteId(0) { Init(); } + explicit CalendarInvite(uint64 inviteId) : _inviteId(inviteId) { Init(); } - void SetInviteId(uint64 inviteId); - uint64 GetInviteId() const; - void SetEventId(uint64 eventId); - uint64 GetEventId() const; - void SetSenderGUID(uint64 guid); - uint64 GetSenderGUID() const; - void SetInvitee(uint64 guid); - uint64 GetInvitee() const; - void SetStatusTime(uint32 statusTime); - uint32 GetStatusTime() const; - void SetText(std::string text); - std::string GetText() const; - void SetStatus(uint8 _status); - uint8 GetStatus() const; - void SetRank(uint8 _rank); - uint8 GetRank() const; + ~CalendarInvite() { } + + void SetInviteId(uint64 inviteId) { _inviteId = inviteId; } + uint64 GetInviteId() const { return _inviteId; } + + void SetEventId(uint64 eventId) { _eventId = eventId; } + uint64 GetEventId() const { return _eventId; } + + void SetSenderGUID(uint64 guid) { _senderGUID = guid; } + uint64 GetSenderGUID() const { return _senderGUID; } + + void SetInvitee(uint64 guid) { _invitee = guid; } + uint64 GetInvitee() const { return _invitee; } + + void SetStatusTime(uint32 statusTime) { _statusTime = statusTime; } + uint32 GetStatusTime() const { return _statusTime; } + + void SetText(std::string text) { _text = text; } + std::string GetText() const { return _text; } + + void SetStatus(uint8 status) { _status = status; } + uint8 GetStatus() const { return _status; } + + void SetRank(uint8 rank) { _rank = rank; } + uint8 GetRank() const { return _rank; } std::string GetDebugString() const; + private: - uint64 inviteId; - uint64 eventId; - uint64 invitee; - uint64 senderGUID; - uint32 statusTime; - uint8 status; - uint8 rank; - std::string text; + void Init(); + + uint64 _inviteId; + uint64 _eventId; + uint64 _invitee; + uint64 _senderGUID; + uint32 _statusTime; + uint8 _status; + uint8 _rank; + std::string _text; }; typedef std::set CalendarinviteIdList; @@ -121,55 +133,76 @@ typedef std::set CalendarinviteIdList; class CalendarEvent { public: - CalendarEvent(uint64 _eventId = 0); - ~CalendarEvent(); + CalendarEvent() : _eventId(0) { Init(); } + explicit CalendarEvent(uint64 eventId) : _eventId(eventId) { Init(); } - void SetEventId(uint64 eventId); - uint64 GetEventId() const; - void SetCreatorGUID(uint64 guid); - uint64 GetCreatorGUID() const; - void SetGuildId(uint32 guild); - uint32 GetGuildId() const; - void SetTitle(std::string title); - std::string GetTitle() const; - void SetDescription(std::string description); - std::string GetDescription() const; - void SetType(uint8 type); - uint8 GetType() const; - void SetMaxInvites(uint32 max); - uint32 GetMaxInvites() const; - void SetDungeonId(int32 dungeonId); - int32 GetDungeonId() const; - void SetTime(uint32 eventTime); - uint32 GetTime() const; - void SetFlags(uint32 flags); - uint32 GetFlags() const; - void SetRepeatable(bool repeatable); - uint8 GetRepeatable() const; - void SetTimeZoneTime(uint32 time); - uint32 GetTimeZoneTime() const; + ~CalendarEvent() { } - void AddInvite(uint64 inviteId); - void RemoveInvite(uint64 inviteId); - bool HasInvite(uint64 inviteId) const; - CalendarinviteIdList const& GetInviteIdList() const; - void SetInviteIdList(CalendarinviteIdList const& list); - void ClearInviteIdList(); + void SetEventId(uint64 eventId) { _eventId = eventId; } + uint64 GetEventId() const { return _eventId; } + + void SetCreatorGUID(uint64 guid) { _creatorGUID = guid; } + uint64 GetCreatorGUID() const { return _creatorGUID; } + + void SetGuildId(uint32 guildId) { _guildId = guildId; } + uint32 GetGuildId() const { return _guildId; } + + void SetTitle(std::string title) { _title = title; } + std::string GetTitle() const { return _title; } + + void SetDescription(std::string description) { _description = description; } + std::string GetDescription() const { return _description; } + + void SetType(uint8 type) { _type = type; } + uint8 GetType() const { return _type; } + + void SetMaxInvites(uint32 limit) { _maxInvites = limit; } + uint32 GetMaxInvites() const { return _maxInvites; } + + void SetDungeonId(int32 dungeonId) { _dungeonId = dungeonId; } + int32 GetDungeonId() const { return _dungeonId; } + + void SetTime(uint32 eventTime) { _eventTime = eventTime; } + uint32 GetTime() const { return _eventTime; } + + void SetFlags(uint32 flags) { _flags = flags; } + uint32 GetFlags() const { return _flags; } + + void SetRepeatable(bool repeatable) { _repeatable = repeatable; } + uint8 GetRepeatable() const { return _repeatable; } + + void SetTimeZoneTime(uint32 timezoneTime) { _timezoneTime = timezoneTime; } + uint32 GetTimeZoneTime() const { return _timezoneTime; } + + void AddInvite(uint64 inviteId) + { + if (inviteId) + _invites.insert(inviteId); + } + + void RemoveInvite(uint64 inviteId) { _invites.erase(inviteId); } + bool HasInvite(uint64 inviteId) const { return _invites.find(inviteId) != _invites.end(); } + CalendarinviteIdList const& GetInviteIdList() const { return _invites; } + void SetInviteIdList(CalendarinviteIdList const& list) { _invites = list; } + void ClearInviteIdList() { _invites.clear(); } std::string GetDebugString() const; + private: - uint64 eventId; - uint64 creatorGUID; - uint32 guildId; - uint8 type; - int32 dungeonId; - uint32 maxInvites; - uint32 eventTime; - uint32 flags; - uint8 repeatable; - uint32 timezoneTime; - std::string title; - std::string description; + void Init(); + + uint64 _eventId; + uint64 _creatorGUID; + uint32 _guildId; + uint8 _type; + int32 _dungeonId; + uint32 _maxInvites; + uint32 _eventTime; + uint32 _flags; + uint8 _repeatable; + uint32 _timezoneTime; + std::string _title; + std::string _description; CalendarinviteIdList _invites; }; @@ -181,22 +214,28 @@ typedef std::map CalendarEventMap; struct CalendarAction { - CalendarAction(): _action(CALENDAR_ACTION_NONE), _guid(0), _inviteId(0), _data(0) {}; - std::string GetDebugString() const; + CalendarAction(): _action(CALENDAR_ACTION_NONE), _guid(0), _inviteId(0), _data(0) + { + } void SetAction(CalendarActionData data) { _action = data; } - void SetGUID(uint64 guid) { _guid = guid; } - void SetInviteId(uint64 id) { _inviteId = id; } - void SetExtraData(uint32 data) { _data = data; } - - uint64 GetGUID() const { return _guid; } CalendarActionData GetAction() const { return _action; } + + void SetGUID(uint64 guid) { _guid = guid; } + uint64 GetGUID() const { return _guid; } + + void SetInviteId(uint64 id) { _inviteId = id; } uint64 GetInviteId() const { return _inviteId; } + + void SetExtraData(uint32 data) { _data = data; } uint32 GetExtraData() const { return _data; } CalendarEvent Event; CalendarInvite Invite; - private: + + std::string GetDebugString() const; + + private: CalendarActionData _action; uint64 _guid; uint64 _inviteId; diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index 0a4d9e36f49..5ad612f0c5f 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ - + /* DROP TABLE IF EXISTS `calendar_events`; @@ -53,9 +53,8 @@ CREATE TABLE IF NOT EXISTS `calendar_invites` ( #include "Player.h" #include "ObjectAccessor.h" -CalendarMgr::CalendarMgr() - : eventNum(0) - , InviteNum(0) +CalendarMgr::CalendarMgr() : + _eventNum(0), _inviteNum(0) { } @@ -116,11 +115,11 @@ CalendarEvent* CalendarMgr::GetEvent(uint64 eventId) uint64 CalendarMgr::GetFreeEventId() { - return ++eventNum; + return ++_eventNum; } uint64 CalendarMgr::GetFreeInviteId() { - return ++InviteNum; + return ++_inviteNum; } void CalendarMgr::LoadFromDB() @@ -200,7 +199,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) { case CALENDAR_ACTION_ADD_EVENT: { - if (addEvent(action.Event) && addInvite(action.Invite)) + if (AddEvent(action.Event) && AddInvite(action.Invite)) { SendCalendarEventInviteAlert(action.Event, action.Invite); SendCalendarEvent(action.Event, CALENDAR_SENDTYPE_ADD); @@ -210,9 +209,9 @@ void CalendarMgr::AddAction(CalendarAction const& action) case CALENDAR_ACTION_MODIFY_EVENT: { uint64 eventId = action.Event.GetEventId(); - CalendarEvent* calendarEvent = CheckPermisions(eventId, + CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); - + if (!calendarEvent) return; @@ -226,7 +225,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) calendarEvent->SetTitle(action.Event.GetTitle()); calendarEvent->SetDescription(action.Event.GetDescription()); calendarEvent->SetMaxInvites(action.Event.GetMaxInvites()); - + CalendarinviteIdList const& invites = calendarEvent->GetInviteIdList(); for (CalendarinviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) if (CalendarInvite* invite = GetInvite(*itr)) @@ -241,7 +240,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) if (!calendarEvent) return; - + uint64 eventId = GetFreeEventId(); CalendarEvent newEvent(eventId); newEvent.SetType(calendarEvent->GetType()); @@ -269,14 +268,14 @@ void CalendarMgr::AddAction(CalendarAction const& action) newInvite.SetStatusTime(invite->GetStatusTime()); newInvite.SetText(invite->GetText()); newInvite.SetRank(invite->GetRank()); - if (addInvite(newInvite)) + if (AddInvite(newInvite)) { SendCalendarEventInviteAlert(newEvent, newInvite); newEvent.AddInvite(inviteId); } } - if (addEvent(newEvent)) + if (AddEvent(newEvent)) SendCalendarEvent(newEvent, CALENDAR_SENDTYPE_COPY); break; @@ -296,10 +295,10 @@ void CalendarMgr::AddAction(CalendarAction const& action) CalendarinviteIdList const& inviteIds = calendarEvent->GetInviteIdList(); for (CalendarinviteIdList::const_iterator it = inviteIds.begin(); it != inviteIds.end(); ++it) - if (uint64 invitee = removeInvite(*it)) + if (uint64 invitee = RemoveInvite(*it)) SendCalendarEventRemovedAlert(invitee, *calendarEvent); - - removeEvent(eventId); + + RemoveEvent(eventId); break; } case CALENDAR_ACTION_ADD_EVENT_INVITE: @@ -311,14 +310,14 @@ void CalendarMgr::AddAction(CalendarAction const& action) if (!calendarEvent) return; - if (addInvite(action.Invite)) + if (AddInvite(action.Invite)) { calendarEvent->AddInvite(action.Invite.GetInviteId()); SendCalendarEventInvite(action.Invite, (!(calendarEvent->GetFlags() & CALENDAR_FLAG_INVITES_LOCKED) && !action.Invite.GetStatusTime())); SendCalendarEventInviteAlert(*calendarEvent, action.Invite); } - + break; } case CALENDAR_ACTION_SIGNUP_TO_EVENT: @@ -345,7 +344,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) newInvite.SetInvitee(action.GetGUID()); newInvite.SetSenderGUID(action.GetGUID()); - if (addInvite(newInvite)) + if (AddInvite(newInvite)) SendCalendarEventInvite(newInvite, false); break; @@ -401,7 +400,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) if (!calendarEvent) return; - if (uint64 invitee = removeInvite(inviteId)) + if (uint64 invitee = RemoveInvite(inviteId)) { SendCalendarEventInviteRemoveAlert(invitee, *calendarEvent, CALENDAR_STATUS_9); SendCalendarEventInviteRemove(action.GetGUID(), action.Invite, calendarEvent->GetFlags()); @@ -414,7 +413,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) } -bool CalendarMgr::addEvent(CalendarEvent const& newEvent) +bool CalendarMgr::AddEvent(CalendarEvent const& newEvent) { uint64 eventId = newEvent.GetEventId(); if (_events.find(eventId) != _events.end()) @@ -427,7 +426,7 @@ bool CalendarMgr::addEvent(CalendarEvent const& newEvent) return true; } -bool CalendarMgr::removeEvent(uint64 eventId) +bool CalendarMgr::RemoveEvent(uint64 eventId) { CalendarEventMap::iterator itr = _events.find(eventId); if (itr == _events.end()) @@ -444,26 +443,26 @@ bool CalendarMgr::removeEvent(uint64 eventId) for (CalendarinviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) { CalendarInvite* invite = GetInvite(*itr); - if (!invite || !removePlayerEvent(invite->GetInvitee(), eventId)) + if (!invite || !RemovePlayerEvent(invite->GetInvitee(), eventId)) val = false; } return val; } -bool CalendarMgr::addPlayerEvent(uint64 guid, uint64 eventId) +bool CalendarMgr::AddPlayerEvent(uint64 guid, uint64 eventId) { _playerEvents[guid].insert(eventId); return true; } -bool CalendarMgr::removePlayerEvent(uint64 guid, uint64 eventId) +bool CalendarMgr::RemovePlayerEvent(uint64 guid, uint64 eventId) { _playerEvents[guid].erase(eventId); return true; } -bool CalendarMgr::addInvite(CalendarInvite const& newInvite) +bool CalendarMgr::AddInvite(CalendarInvite const& newInvite) { uint64 inviteId = newInvite.GetInviteId(); if (!inviteId) @@ -480,12 +479,12 @@ bool CalendarMgr::addInvite(CalendarInvite const& newInvite) _invites[inviteId] = newInvite; uint64 guid = newInvite.GetInvitee(); - bool inviteAdded = addPlayerInvite(guid, inviteId); - bool eventAdded = addPlayerEvent(guid, newInvite.GetEventId()); + bool inviteAdded = AddPlayerInvite(guid, inviteId); + bool eventAdded = AddPlayerEvent(guid, newInvite.GetEventId()); return eventAdded && inviteAdded; } -uint64 CalendarMgr::removeInvite(uint64 inviteId) +uint64 CalendarMgr::RemoveInvite(uint64 inviteId) { CalendarInviteMap::iterator itr = _invites.find(inviteId); if (itr == _invites.end()) @@ -493,20 +492,20 @@ uint64 CalendarMgr::removeInvite(uint64 inviteId) sLog->outError("CalendarMgr::removeInvite: Invite [" UI64FMTD "] does not exist", inviteId); return 0; } - + uint64 invitee = itr->second.GetInvitee(); _invites.erase(itr); - return removePlayerInvite(invitee, inviteId) ? invitee : 0; + return RemovePlayerInvite(invitee, inviteId) ? invitee : 0; } -bool CalendarMgr::addPlayerInvite(uint64 guid, uint64 inviteId) +bool CalendarMgr::AddPlayerInvite(uint64 guid, uint64 inviteId) { _playerInvites[guid].insert(inviteId); return true; } -bool CalendarMgr::removePlayerInvite(uint64 guid, uint64 inviteId) +bool CalendarMgr::RemovePlayerInvite(uint64 guid, uint64 inviteId) { _playerInvites[guid].erase(inviteId); return true; diff --git a/src/server/game/Calendar/CalendarMgr.h b/src/server/game/Calendar/CalendarMgr.h index f80a21d6960..490e39ab300 100644 --- a/src/server/game/Calendar/CalendarMgr.h +++ b/src/server/game/Calendar/CalendarMgr.h @@ -23,7 +23,11 @@ class CalendarMgr { - friend class ACE_Singleton; + friend class ACE_Singleton; + + CalendarMgr(); + ~CalendarMgr(); + public: void LoadFromDB(); @@ -50,27 +54,25 @@ class CalendarMgr void SendCalendarEventModeratorStatusAlert(CalendarInvite const& invite); private: - CalendarMgr(); - ~CalendarMgr(); CalendarEvent* CheckPermisions(uint64 eventId, uint64 guid, uint64 invitateId, CalendarRanks minRank); - bool addEvent(CalendarEvent const& calendarEvent); - bool removeEvent(uint64 eventId); - bool addPlayerEvent(uint64 guid, uint64 eventId); - bool removePlayerEvent(uint64 guid, uint64 eventId); + bool AddEvent(CalendarEvent const& calendarEvent); + bool RemoveEvent(uint64 eventId); + bool AddPlayerEvent(uint64 guid, uint64 eventId); + bool RemovePlayerEvent(uint64 guid, uint64 eventId); - bool addInvite(CalendarInvite const& invite); - uint64 removeInvite(uint64 inviteId); - bool addPlayerInvite(uint64 guid, uint64 inviteId); - bool removePlayerInvite(uint64 guid, uint64 inviteId); + bool AddInvite(CalendarInvite const& invite); + uint64 RemoveInvite(uint64 inviteId); + bool AddPlayerInvite(uint64 guid, uint64 inviteId); + bool RemovePlayerInvite(uint64 guid, uint64 inviteId); CalendarEventMap _events; CalendarInviteMap _invites; CalendarPlayerinviteIdMap _playerInvites; CalendarPlayerEventIdMap _playerEvents; - uint64 eventNum; - uint64 InviteNum; + uint64 _eventNum; + uint64 _inviteNum; }; #define sCalendarMgr ACE_Singleton::instance() diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 8c1de583d06..92cae23e5b2 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -17,7 +17,7 @@ */ /* ------ Opcodes Not Used yet ----- +----- Opcodes Not Used yet ----- SMSG_CALENDAR_CLEAR_PENDING_ACTION SendCalendarClearPendingAction() SMSG_CALENDAR_RAID_LOCKOUT_UPDATED SendCalendarRaildLockoutUpdated(InstanceSave const* save) <--- Structure unknown, using LOCKOUT_ADDED @@ -130,7 +130,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) data << uint32(counter); // raid reset count std::set sentMaps; - + ResetTimeByMapDifficultyMap const& resets = sInstanceSaveMgr->GetResetTimeMap(); for (ResetTimeByMapDifficultyMap::const_iterator itr = resets.begin(); itr != resets.end(); ++itr) { @@ -144,7 +144,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) continue; sentMaps.insert(mapId); - + data << uint32(mapId); data << uint32(itr->second - cur_time); data << uint32(mapEntry->unk_time); @@ -689,7 +689,7 @@ void WorldSession::SendCalendarEventRemovedAlert(CalendarEvent const& calendarEv uint64 guid = _player->GetGUID(); uint64 eventId = calendarEvent.GetEventId(); uint32 eventTime = (calendarEvent.GetTime()); - + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_REMOVED_ALERT [" UI64FMTD "] EventId [" UI64FMTD "] Time %u", guid, eventId, eventTime); @@ -711,7 +711,7 @@ void WorldSession::SendCalendarEventStatus(CalendarEvent const& calendarEvent, C uint8 status = invite.GetStatus(); uint8 rank = invite.GetRank(); uint32 statusTime = secsToTimeBitFields(invite.GetStatusTime()); - + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_STATUS [" UI64FMTD "] EventId [" UI64FMTD "] InviteId [" UI64FMTD "] Invitee [" UI64FMTD "] Time %u " @@ -736,7 +736,7 @@ void WorldSession::SendCalendarEventModeratorStatusAlert(CalendarInvite const& i uint64 eventId = invite.GetEventId(); uint64 invitee = invite.GetInvitee(); uint8 status = invite.GetStatus(); - + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT [" UI64FMTD "] Invitee [" UI64FMTD "] EventId [" UI64FMTD "] Status %u ", guid, @@ -797,7 +797,7 @@ void WorldSession::SendCalendarClearPendingAction() SendPacket(&data); } -void WorldSession::SendCalendarRaildLockoutUpdated(InstanceSave const* save) +void WorldSession::SendCalendarRaidLockoutUpdated(InstanceSave const* save) { if (!save) return; @@ -807,13 +807,13 @@ void WorldSession::SendCalendarRaildLockoutUpdated(InstanceSave const* save) "] Map: %u, Difficulty %u", guid, save->GetMapId(), save->GetDifficulty()); time_t cur_time = time_t(time(NULL)); - + WorldPacket data(SMSG_CALENDAR_RAID_LOCKOUT_UPDATED, 4 + 4 + 4 + 4 + 8); data << secsToTimeBitFields(cur_time); data << uint32(save->GetMapId()); data << uint32(save->GetDifficulty()); data << uint32(save->GetResetTime() - cur_time); - data << uint64(save->GetInstanceId()); + data << uint64(save->GetInstanceId()); SendPacket(&data); } @@ -828,43 +828,6 @@ void WorldSession::SendCalendarCommandResult(uint32 value) SendPacket(&data); } -void WorldSession::SendCalendarRaildLockoutAdded(InstanceSave const* save) -{ - if (!save) - return; - - uint64 guid = _player->GetGUID(); - sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_RAID_LOCKOUT_ADDED [" UI64FMTD - "] Map: %u, Difficulty %u", guid, save->GetMapId(), save->GetDifficulty()); - - time_t cur_time = time_t(time(NULL)); - - WorldPacket data(SMSG_CALENDAR_RAID_LOCKOUT_ADDED, 4 + 4 + 4 + 4 + 8); - data << secsToTimeBitFields(cur_time); - data << uint32(save->GetMapId()); - data << uint32(save->GetDifficulty()); - data << uint32(save->GetResetTime() - cur_time); - data << uint64(save->GetInstanceId()); - SendPacket(&data); -} - -void WorldSession::SendCalendarRaildLockoutRemoved(InstanceSave const* save) -{ - if (!save) - return; - - uint64 guid = _player->GetGUID(); - sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_RAID_LOCKOUT_REMOVED [" UI64FMTD - "] Map: %u, Difficulty %u", guid, save->GetMapId(), save->GetDifficulty()); - - WorldPacket data(SMSG_CALENDAR_RAID_LOCKOUT_REMOVED, 4 + 4 + 4 + 8); - data << uint32(save->GetMapId()); - data << uint32(save->GetDifficulty()); - data << uint32(0); - data << uint64(save->GetInstanceId()); - SendPacket(&data); -} - void WorldSession::SendCalendarRaidLockout(InstanceSave* save, bool add) { sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", add ? "SMSG_CALENDAR_RAID_LOCKOUT_ADDED" : "SMSG_CALENDAR_RAID_LOCKOUT_REMOVED"); From f1f469481dba49fa4db5870e1cf19f63839c2740 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 24 Feb 2012 22:43:12 +0100 Subject: [PATCH 0017/1149] Core/MovementGenerators: Removed pointless check --- .../game/Movement/MovementGenerators/HomeMovementGenerator.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp index 5725aec54f6..311b69c06b7 100755 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp @@ -35,9 +35,6 @@ void HomeMovementGenerator::Reset(Creature &) void HomeMovementGenerator::_setTargetLocation(Creature & owner) { - if (!&owner) - return; - if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED)) return; From c7ddb428b30fe23fb0a7e208e45c559e9f1c730f Mon Sep 17 00:00:00 2001 From: kaelima Date: Fri, 24 Feb 2012 22:56:41 +0100 Subject: [PATCH 0018/1149] Scripts/Zalazane's Fall: Some cleanup and general code improvement --- src/server/scripts/Kalimdor/durotar.cpp | 101 +++++++++++++----------- 1 file changed, 56 insertions(+), 45 deletions(-) diff --git a/src/server/scripts/Kalimdor/durotar.cpp b/src/server/scripts/Kalimdor/durotar.cpp index 6c91c64f981..726904e745f 100644 --- a/src/server/scripts/Kalimdor/durotar.cpp +++ b/src/server/scripts/Kalimdor/durotar.cpp @@ -170,7 +170,7 @@ enum Points class npc_tiger_matriarch_credit : public CreatureScript { public: - npc_tiger_matriarch_credit() : CreatureScript("npc_tiger_matriarch_credit"){} + npc_tiger_matriarch_credit() : CreatureScript("npc_tiger_matriarch_credit") { } struct npc_tiger_matriarch_creditAI : public Scripted_NoMovementAI { @@ -179,7 +179,7 @@ class npc_tiger_matriarch_credit : public CreatureScript events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 2000); } - void UpdateAI(const uint32 diff) + void UpdateAI(uint32 const diff) { events.Update(diff); @@ -223,27 +223,32 @@ class npc_tiger_matriarch_credit : public CreatureScript class npc_tiger_matriarch : public CreatureScript { public: - npc_tiger_matriarch() : CreatureScript("npc_tiger_matriarch"){} + npc_tiger_matriarch() : CreatureScript("npc_tiger_matriarch") {} struct npc_tiger_matriarchAI : public ScriptedAI { npc_tiger_matriarchAI(Creature* creature) : ScriptedAI(creature), - _tiger(NULL) + _tigerGuid(0) { } + void EnterCombat(Unit* /*target*/) + { + _events.Reset(); + _events.ScheduleEvent(EVENT_POUNCE, 100); + _events.ScheduleEvent(EVENT_NOSUMMON, 50000); + } + void IsSummonedBy(Unit* summoner) { - if (summoner->GetTypeId() != TYPEID_PLAYER) + if (summoner->GetTypeId() != TYPEID_PLAYER && summoner->GetVehicle()) return; - _tiger = summoner->GetVehicle()->GetBase(); - if (_tiger) + _tigerGuid = summoner->GetVehicle()->GetBase()->GetGUID(); + if (Unit* tiger = ObjectAccessor::GetUnit(*me, _tigerGuid)) { - me->AddThreat(_tiger, 500000.0f); + me->AddThreat(tiger, 500000.0f); DoCast(me, SPELL_FURIOUS_BITE); - events.ScheduleEvent(EVENT_POUNCE, 100); - events.ScheduleEvent(EVENT_NOSUMMON, 50000); } } @@ -291,24 +296,27 @@ class npc_tiger_matriarch : public CreatureScript if (!UpdateVictim()) return; - if (!_tiger) + if (!_tigerGuid) return; - events.Update(diff); + _events.Update(diff); - while (uint32 eventId = events.ExecuteEvent()) + while (uint32 eventId = _events.ExecuteEvent()) { switch (eventId) { case EVENT_POUNCE: DoCastVictim(SPELL_POUNCE); - events.ScheduleEvent(EVENT_POUNCE, 30000); + _events.ScheduleEvent(EVENT_POUNCE, 30000); break; case EVENT_NOSUMMON: // Reapply SPELL_NO_SUMMON_AURA - if (_tiger && _tiger->isSummon()) - if (Unit* vehSummoner = _tiger->ToTempSummon()->GetSummoner()) - me->AddAura(SPELL_NO_SUMMON_AURA, vehSummoner); - events.ScheduleEvent(EVENT_NOSUMMON, 50000); + if (Unit* tiger = ObjectAccessor::GetUnit(*me, _tigerGuid)) + { + if (tiger->isSummon()) + if (Unit* vehSummoner = tiger->ToTempSummon()->GetSummoner()) + me->AddAura(SPELL_NO_SUMMON_AURA, vehSummoner); + } + _events.ScheduleEvent(EVENT_NOSUMMON, 50000); break; default: break; @@ -319,8 +327,8 @@ class npc_tiger_matriarch : public CreatureScript } private: - EventMap events; - Unit* _tiger; + EventMap _events; + uint64 _tigerGuid; }; CreatureAI* GetAI(Creature* creature) const @@ -345,26 +353,32 @@ class npc_troll_volunteer : public CreatureScript { npc_troll_volunteerAI(Creature* creature) : ScriptedAI(creature) { - Reset(); - Player* player = me->GetOwner()->ToPlayer(); + } - switch (urand(1, 4)) + void InitializeAI() + { + if (me->isDead() || !me->GetOwner()) + return; + + Reset(); + + switch (urand(0, 3)) { - case 1: + case 0: _mountModel = 6471; break; - case 2: + case 1: _mountModel = 6473; break; - case 3: + case 2: _mountModel = 6469; break; - case 4: + default: _mountModel = 6472; break; } me->SetDisplayId(trollmodel[urand(0, 39)]); - if (player) + if (Player* player = me->GetOwner()->ToPlayer()) me->GetMotionMaster()->MoveFollow(player, 5.0f, float(rand_norm() + 1.0f) * M_PI / 3.0f * 4.0f); } @@ -417,6 +431,8 @@ class npc_troll_volunteer : public CreatureScript } }; +typedef npc_troll_volunteer::npc_troll_volunteerAI VolunteerAI; + class spell_mount_check : public SpellScriptLoader { public: @@ -442,9 +458,8 @@ class spell_mount_check : public SpellScriptLoader if (owner->IsMounted() && !target->IsMounted()) { - if (Creature* volunteer = target->ToCreature()) - if (uint32 mountid = CAST_AI(npc_troll_volunteer::npc_troll_volunteerAI, volunteer->AI())->GetMountId()) - target->Mount(mountid); + if (VolunteerAI* volunteerAI = CAST_AI(VolunteerAI, target->GetAI())) + target->Mount(volunteerAI->GetMountId()); } else if (!owner->IsMounted() && target->IsMounted()) target->Dismount(); @@ -493,7 +508,7 @@ class spell_voljin_war_drums : public SpellScriptLoader else if (target->GetEntry() == NPC_CITIZEN_2) motivate = SPELL_MOTIVATE_2; if (motivate) - caster->CastSpell(target, motivate, true, NULL, NULL, caster->GetGUID()); + caster->CastSpell(target, motivate, false); } } @@ -511,13 +526,13 @@ class spell_voljin_war_drums : public SpellScriptLoader enum VoodooSpells { - SPELL_BREW = 16712, // Special Brew - SPELL_GHOSTLY = 16713, // Ghostly - SPELL_HEX1 = 16707, // Hex - SPELL_HEX2 = 16708, // Hex - SPELL_HEX3 = 16709, // Hex - SPELL_GROW = 16711, // Grow - SPELL_LAUNCH = 16716, // Launch (Whee!) + SPELL_BREW = 16712, // Special Brew + SPELL_GHOSTLY = 16713, // Ghostly + SPELL_HEX1 = 16707, // Hex + SPELL_HEX2 = 16708, // Hex + SPELL_HEX3 = 16709, // Hex + SPELL_GROW = 16711, // Grow + SPELL_LAUNCH = 16716, // Launch (Whee!) }; // 17009 @@ -542,13 +557,9 @@ class spell_voodoo : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { - Unit* caster = GetCaster(); + uint32 spellid = RAND(SPELL_BREW, SPELL_GHOSTLY, RAND(SPELL_HEX1, SPELL_HEX2, SPELL_HEX3), SPELL_GROW, SPELL_LAUNCH); if (Unit* target = GetHitUnit()) - { - caster->CastSpell(target, RAND(SPELL_BREW, SPELL_GHOSTLY, - RAND(SPELL_HEX1, SPELL_HEX2, SPELL_HEX3), - SPELL_GROW, SPELL_LAUNCH), false); - } + GetCaster()->CastSpell(target, spellid, false); } void Register() From bc151a0453a7d80a30a5480c2a758f28ca7aaa8b Mon Sep 17 00:00:00 2001 From: kaelima Date: Fri, 24 Feb 2012 23:10:12 +0100 Subject: [PATCH 0019/1149] Scripts/Zalazane's Fall: Fixed a logical mistake from last commit --- src/server/scripts/Kalimdor/durotar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Kalimdor/durotar.cpp b/src/server/scripts/Kalimdor/durotar.cpp index 726904e745f..ea3a093990e 100644 --- a/src/server/scripts/Kalimdor/durotar.cpp +++ b/src/server/scripts/Kalimdor/durotar.cpp @@ -241,7 +241,7 @@ class npc_tiger_matriarch : public CreatureScript void IsSummonedBy(Unit* summoner) { - if (summoner->GetTypeId() != TYPEID_PLAYER && summoner->GetVehicle()) + if (summoner->GetTypeId() != TYPEID_PLAYER || !summoner->GetVehicle()) return; _tigerGuid = summoner->GetVehicle()->GetBase()->GetGUID(); From e5621dfd99f682db8118bba447966bda06bf1bc1 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 24 Feb 2012 23:30:09 +0100 Subject: [PATCH 0020/1149] Compile fix --- src/server/game/Server/WorldSession.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 4f9880d3257..71ef13a159f 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -892,11 +892,9 @@ class WorldSession void SendCalendarEventStatus(CalendarEvent const& calendarEvent, CalendarInvite const& invite); void SendCalendarEventModeratorStatusAlert(CalendarInvite const& invite); void SendCalendarClearPendingAction(); - void SendCalendarRaildLockoutAdded(InstanceSave const* save); - void SendCalendarRaildLockoutRemoved(InstanceSave const* save); - void SendCalendarRaildLockoutUpdated(InstanceSave const* save); void SendCalendarCommandResult(uint32 value); void SendCalendarRaidLockout(InstanceSave* save, bool add); + void SendCalendarRaidLockoutUpdated(InstanceSave const* save); void HandleSpellClick(WorldPacket& recv_data); void HandleMirrorImageDataRequest(WorldPacket& recv_data); From 0e86b3a5785c7e5eb0660d1e5c30aab25ae40645 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 24 Feb 2012 23:40:06 +0100 Subject: [PATCH 0021/1149] Core/Calendar: Corrected structure of SMSG_CALENDAR_COMMAND_RESULT --- src/server/game/Calendar/CalendarMgr.cpp | 37 ++++++++---------- src/server/game/Handlers/CalendarHandler.cpp | 27 +++++++++++-- src/server/game/Server/WorldSession.h | 40 +++++++++++++++++++- 3 files changed, 78 insertions(+), 26 deletions(-) diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index 5ad612f0c5f..e49976a48a1 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -99,7 +99,7 @@ CalendarInvite* CalendarMgr::GetInvite(uint64 inviteId) if (it != _invites.end()) return &(it->second); - sLog->outError("SPP: CalendarMgr::GetInvite: [" UI64FMTD "] not found!", inviteId); + sLog->outError("CalendarMgr::GetInvite: [" UI64FMTD "] not found!", inviteId); return NULL; } @@ -109,7 +109,7 @@ CalendarEvent* CalendarMgr::GetEvent(uint64 eventId) if (it != _events.end()) return &(it->second); - sLog->outError("SPP: CalendarMgr::GetEvent: [" UI64FMTD "] not found!", eventId); + sLog->outError("CalendarMgr::GetEvent: [" UI64FMTD "] not found!", eventId); return NULL; } @@ -209,8 +209,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) case CALENDAR_ACTION_MODIFY_EVENT: { uint64 eventId = action.Event.GetEventId(); - CalendarEvent* calendarEvent = CheckPermisions(eventId, - action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); + CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); if (!calendarEvent) return; @@ -235,8 +234,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) } case CALENDAR_ACTION_COPY_EVENT: { - CalendarEvent* calendarEvent = CheckPermisions(action.Event.GetEventId(), - action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_OWNER); + CalendarEvent* calendarEvent = CheckPermisions(action.Event.GetEventId(), action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_OWNER); if (!calendarEvent) return; @@ -257,6 +255,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) CalendarinviteIdList const invites = calendarEvent->GetInviteIdList(); for (CalendarinviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) + { if (CalendarInvite* invite = GetInvite(*itr)) { uint64 inviteId = GetFreeInviteId(); @@ -274,6 +273,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) newEvent.AddInvite(inviteId); } } + } if (AddEvent(newEvent)) SendCalendarEvent(newEvent, CALENDAR_SENDTYPE_COPY); @@ -284,11 +284,9 @@ void CalendarMgr::AddAction(CalendarAction const& action) { uint64 eventId = action.Event.GetEventId(); uint32 flags = action.Event.GetFlags(); - sLog->outError("CalendarMgr::AddAction:: Flags %u", flags); // FIXME - Use of Flags here! - CalendarEvent* calendarEvent = CheckPermisions(eventId, - action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_OWNER); + CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_OWNER); if (!calendarEvent) return; @@ -304,9 +302,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) case CALENDAR_ACTION_ADD_EVENT_INVITE: { uint64 eventId = action.Invite.GetEventId(); - CalendarEvent* calendarEvent = CheckPermisions(eventId, - action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); - + CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); if (!calendarEvent) return; @@ -324,8 +320,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) { uint64 eventId = action.Event.GetEventId(); CalendarEvent* calendarEvent = GetEvent(eventId); - CheckPermisions(eventId, - action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); + CheckPermisions(eventId, action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); if (!calendarEvent || !(calendarEvent->GetFlags() & CALENDAR_FLAG_GUILD_ONLY) || !calendarEvent->GetGuildId() || calendarEvent->GetGuildId() != action.GetExtraData()) @@ -385,7 +380,6 @@ void CalendarMgr::AddAction(CalendarAction const& action) if (!calendarEvent || !invite || !calendarEvent->HasInvite(inviteId)) return; - sLog->outError("SPP: CALENDAR_ACTION_MODIFY_MODERATOR_EVENT_INVITE: All OK"); invite->SetStatus(action.Invite.GetStatus()); SendCalendarEventModeratorStatusAlert(*invite); break; @@ -394,8 +388,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) { uint64 eventId = action.Invite.GetEventId(); uint64 inviteId = action.Invite.GetInviteId(); - CalendarEvent* calendarEvent = CheckPermisions(eventId, - action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); + CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); if (!calendarEvent) return; @@ -418,7 +411,7 @@ bool CalendarMgr::AddEvent(CalendarEvent const& newEvent) uint64 eventId = newEvent.GetEventId(); if (_events.find(eventId) != _events.end()) { - sLog->outError("CalendarMgr::addEvent: Event [" UI64FMTD "] exists", eventId); + sLog->outError("CalendarMgr::AddEvent: Event [" UI64FMTD "] exists", eventId); return false; } @@ -431,7 +424,7 @@ bool CalendarMgr::RemoveEvent(uint64 eventId) CalendarEventMap::iterator itr = _events.find(eventId); if (itr == _events.end()) { - sLog->outError("CalendarMgr::removeEvent: Event [" UI64FMTD "] does not exist", eventId); + sLog->outError("CalendarMgr::RemoveEvent: Event [" UI64FMTD "] does not exist", eventId); return false; } @@ -467,13 +460,13 @@ bool CalendarMgr::AddInvite(CalendarInvite const& newInvite) uint64 inviteId = newInvite.GetInviteId(); if (!inviteId) { - sLog->outError("CalendarMgr::addInvite: Cant add Invite 0"); + sLog->outError("CalendarMgr::AddInvite: Cant add Invite 0"); return false; } if (_invites.find(inviteId) != _invites.end()) { - sLog->outError("CalendarMgr::addInvite: Invite [" UI64FMTD "] exists", inviteId); + sLog->outError("CalendarMgr::AddInvite: Invite [" UI64FMTD "] exists", inviteId); return false; } @@ -489,7 +482,7 @@ uint64 CalendarMgr::RemoveInvite(uint64 inviteId) CalendarInviteMap::iterator itr = _invites.find(inviteId); if (itr == _invites.end()) { - sLog->outError("CalendarMgr::removeInvite: Invite [" UI64FMTD "] does not exist", inviteId); + sLog->outError("CalendarMgr::RemoveInvite: Invite [" UI64FMTD "] does not exist", inviteId); return 0; } diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 92cae23e5b2..b5a77dd52e0 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -237,6 +237,7 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data) "] differs", guid, inviteCount, invitee); return; } + inviteId = sCalendarMgr->GetFreeInviteId(); } else @@ -386,6 +387,12 @@ void WorldSession::HandleCalendarEventInvite(WorldPacket& recv_data) UI64FMTD "] InviteId [" UI64FMTD "] Name %s ([" UI64FMTD "]), status %u, " "Rank %u", guid, eventId, inviteId, name.c_str(), invitee, status, rank); + if (!invitee) + { + SendCalendarCommandResult(CALENDAR_ERROR_PLAYER_NOT_FOUND); + return; + } + CalendarAction action; action.SetAction(CALENDAR_ACTION_ADD_EVENT_INVITE); action.SetGUID(guid); @@ -817,13 +824,27 @@ void WorldSession::SendCalendarRaidLockoutUpdated(InstanceSave const* save) SendPacket(&data); } -void WorldSession::SendCalendarCommandResult(uint32 value) +void WorldSession::SendCalendarCommandResult(CalendarError err, char const* param /*= NULL*/) { uint64 guid = _player->GetGUID(); - sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_COMMAND_RESULT [" UI64FMTD "] Value: %u", guid, value); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_COMMAND_RESULT [" UI64FMTD "] Value: %u", guid, err); WorldPacket data(SMSG_CALENDAR_COMMAND_RESULT, 0); - data << uint16(0) << uint32(0) << uint32(value); + data << uint32(0); + data << uint8(0); + switch (err) + { + case CALENDAR_ERROR_OTHER_INVITES_EXCEEDED: + case CALENDAR_ERROR_ALREADY_INVITED_TO_EVENT_S: + case CALENDAR_ERROR_IGNORING_YOU_S: + data << param; + break; + default: + data << uint8(0); + break; + } + + data << uint32(err); SendPacket(&data); } diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 71ef13a159f..35a85753c20 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -141,6 +141,44 @@ enum CharterTypes ARENA_TEAM_CHARTER_5v5_TYPE = 5 }; +enum CalendarError +{ + CALENDAR_OK = 0, + CALENDAR_ERROR_GUILD_EVENTS_EXCEEDED = 1, + CALENDAR_ERROR_EVENTS_EXCEEDED = 2, + CALENDAR_ERROR_SELF_INVITES_EXCEEDED = 3, + CALENDAR_ERROR_OTHER_INVITES_EXCEEDED = 4, + CALENDAR_ERROR_PERMISSIONS = 5, + CALENDAR_ERROR_EVENT_INVALID = 6, + CALENDAR_ERROR_NOT_INVITED = 7, + CALENDAR_ERROR_INTERNAL = 8, + CALENDAR_ERROR_GUILD_PLAYER_NOT_IN_GUILD = 9, + CALENDAR_ERROR_ALREADY_INVITED_TO_EVENT_S = 10, + CALENDAR_ERROR_PLAYER_NOT_FOUND = 11, + CALENDAR_ERROR_NOT_ALLIED = 12, + CALENDAR_ERROR_IGNORING_YOU_S = 13, + CALENDAR_ERROR_INVITES_EXCEEDED = 14, + CALENDAR_ERROR_INVALID_DATE = 16, + CALENDAR_ERROR_INVALID_TIME = 17, + + CALENDAR_ERROR_NEEDS_TITLE = 19, + CALENDAR_ERROR_EVENT_PASSED = 20, + CALENDAR_ERROR_EVENT_LOCKED = 21, + CALENDAR_ERROR_DELETE_CREATOR_FAILED = 22, + CALENDAR_ERROR_SYSTEM_DISABLED = 24, + CALENDAR_ERROR_RESTRICTED_ACCOUNT = 25, + CALENDAR_ERROR_ARENA_EVENTS_EXCEEDED = 26, + CALENDAR_ERROR_RESTRICTED_LEVEL = 27, + CALENDAR_ERROR_USER_SQUELCHED = 28, + CALENDAR_ERROR_NO_INVITE = 29, + + CALENDAR_ERROR_EVENT_WRONG_SERVER = 36, + CALENDAR_ERROR_INVITE_WRONG_SERVER = 37, + CALENDAR_ERROR_NO_GUILD_INVITES = 38, + CALENDAR_ERROR_INVALID_SIGNUP = 39, + CALENDAR_ERROR_NO_MODERATOR = 40 +}; + //class to deal with packet processing //allows to determine if next packet is safe to be processed class PacketFilter @@ -892,9 +930,9 @@ class WorldSession void SendCalendarEventStatus(CalendarEvent const& calendarEvent, CalendarInvite const& invite); void SendCalendarEventModeratorStatusAlert(CalendarInvite const& invite); void SendCalendarClearPendingAction(); - void SendCalendarCommandResult(uint32 value); void SendCalendarRaidLockout(InstanceSave* save, bool add); void SendCalendarRaidLockoutUpdated(InstanceSave const* save); + void SendCalendarCommandResult(CalendarError err, char const* param = NULL); void HandleSpellClick(WorldPacket& recv_data); void HandleMirrorImageDataRequest(WorldPacket& recv_data); From 7a4d388e0467c8303137de543861b29d231e8a4f Mon Sep 17 00:00:00 2001 From: Malcrom Date: Fri, 24 Feb 2012 19:28:14 -0330 Subject: [PATCH 0022/1149] DB/SAI: Fix for quest "You've Really Done It This Time, Kul" 14096 Alliance / 14142 Horde --- sql/updates/world/2012_02_24_01_world_sai.sql | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 sql/updates/world/2012_02_24_01_world_sai.sql diff --git a/sql/updates/world/2012_02_24_01_world_sai.sql b/sql/updates/world/2012_02_24_01_world_sai.sql new file mode 100644 index 00000000000..e7488fd8220 --- /dev/null +++ b/sql/updates/world/2012_02_24_01_world_sai.sql @@ -0,0 +1,44 @@ +-- Fix for quest "You've Really Done It This Time, Kul" 14096 Alliance / 14142 Horde +-- SAI for Black Cage +SET @ENTRY=195310; +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY AND `source_type`=1); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY*100 AND `source_type`=9); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,1,0,0,70,0,100,0,2,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Black Cage - On activate - Run Script'), +(@ENTRY*100,9,0,0,0,0,100,0,6000,6000,6000,6000,32,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Black Cage - Script - set go state'); +-- SAI for Captive Aspirant +SET @ENTRY=34716; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY AND `source_type`=0); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY*100 AND `source_type`=9); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,8,0,100,0,66531,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Captive Aspirant - On spellhit - Run Script'), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Captive Aspirant - Script - Say random text'), +(@ENTRY*100,9,1,0,0,0,100,0,2000,2000,2000,2000,33,@ENTRY,0,0,0,0,0,7,0,0,0,0,0,0,0,'Captive Aspirant - Script - Kill credit'), +(@ENTRY*100,9,2,0,0,0,100,0,2000,2000,2000,2000,46,10,0,0,0,0,0,1,0,0,0,0,0,0,0,'Captive Aspirant - Script - move 10 yards'), +(@ENTRY*100,9,3,0,0,0,100,0,4000,4000,4000,4000,72,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Captive Aspirant - Script - despawn'); +-- SAI for Kul the Reckless +SET @ENTRY=34956; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY AND `source_type`=0); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY*100 AND `source_type`=9); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,8,0,100,0,66531,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kul the Reckless - On spellhit - Run Script'), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kul the Reckless - Script - Say random text'), +(@ENTRY*100,9,1,0,0,0,100,0,2000,2000,2000,2000,33,@ENTRY,0,0,0,0,0,7,0,0,0,0,0,0,0,'Kul the Reckless - Script - Kill credit'), +(@ENTRY*100,9,2,0,0,0,100,0,2000,2000,2000,2000,46,10,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kul the Reckless - Script - move 10 yards'), +(@ENTRY*100,9,3,0,0,0,100,0,4000,4000,4000,4000,72,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kul the Reckless - Script - despawn'); +-- Captive Aspirant & Kul the Reckless text from sniff +DELETE FROM `creature_text` WHERE `entry` IN (34716,34956); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(34716,0,0, 'Thank you, $c.',12,0,100,5,0,0, 'Captive Aspirant'), +(34716,0,1, 'They''re killing the prisoners! Hurry, help the others.',12,0,100,5,0,0, 'Captive Aspirant'), +(34716,0,2, 'I knew I shouldn''t have come to the tournament!',12,0,100,5,0,0, 'Captive Aspirant'), +(34716,0,3, 'I thought I was going to die in there!',12,0,100,5,0,0, 'Captive Aspirant'), +(34956,0,0, 'They were seconds from strapping me to one of those altars and sucking my soul out. Let''s get out of here!',12,0,100,5,0,0, 'Kul the Reckless'); +-- Target conditions for spell 66531 +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=66531; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,2,66531,0,0,31,3,34716,0,0,0,'','Spell 66531 targets npc 34716 or npc 34956'), +(13,2,66531,0,1,31,3,34956,0,0,0,'','Spell 66531 targets npc 34716 or npc 34956'); From 8945d115b2bf68f440f3b0ca68bff16a38d7541c Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 25 Feb 2012 00:14:39 +0100 Subject: [PATCH 0023/1149] Core/Calendar: Added some checks & error responses for calendar actions, many more to do still --- src/server/game/Calendar/Calendar.cpp | 2 +- src/server/game/Calendar/Calendar.h | 12 +-- src/server/game/Calendar/CalendarMgr.cpp | 81 ++++++++++++++------ src/server/game/Calendar/CalendarMgr.h | 2 +- src/server/game/Handlers/CalendarHandler.cpp | 46 ++++++++--- 5 files changed, 100 insertions(+), 43 deletions(-) diff --git a/src/server/game/Calendar/Calendar.cpp b/src/server/game/Calendar/Calendar.cpp index 320f49e0ed4..22578ef2dcc 100755 --- a/src/server/game/Calendar/Calendar.cpp +++ b/src/server/game/Calendar/Calendar.cpp @@ -88,7 +88,7 @@ std::string CalendarAction::GetDebugString() const data << "CalendarAction::" << " Action: " << GetAction() - << " Guid: " << GetGUID() + << " Guid: " << GetPlayer()->GetGUID() << " Invite Id: " << GetInviteId() << " Extra data: " << GetExtraData() << " Event: " << Event.GetDebugString() diff --git a/src/server/game/Calendar/Calendar.h b/src/server/game/Calendar/Calendar.h index ad073ffbebf..0caf4fca0dc 100755 --- a/src/server/game/Calendar/Calendar.h +++ b/src/server/game/Calendar/Calendar.h @@ -19,7 +19,7 @@ #ifndef TRINITY_CALENDAR_H #define TRINITY_CALENDAR_H -#include "Common.h" +#include "Errors.h" #include enum CalendarFlags @@ -212,17 +212,19 @@ typedef std::map CalendarPlayerEventIdMap; typedef std::map CalendarInviteMap; typedef std::map CalendarEventMap; +class Player; + struct CalendarAction { - CalendarAction(): _action(CALENDAR_ACTION_NONE), _guid(0), _inviteId(0), _data(0) + CalendarAction(): _action(CALENDAR_ACTION_NONE), _player(NULL), _guid(0), _inviteId(0), _data(0) { } void SetAction(CalendarActionData data) { _action = data; } CalendarActionData GetAction() const { return _action; } - void SetGUID(uint64 guid) { _guid = guid; } - uint64 GetGUID() const { return _guid; } + void SetPlayer(Player* player) { ASSERT(player); _player = player; } + Player* GetPlayer() const { return _player; } void SetInviteId(uint64 id) { _inviteId = id; } uint64 GetInviteId() const { return _inviteId; } @@ -237,7 +239,7 @@ struct CalendarAction private: CalendarActionData _action; - uint64 _guid; + Player* _player; uint64 _inviteId; uint32 _data; }; diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index e49976a48a1..aac26578c3e 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -180,17 +180,44 @@ void CalendarMgr::LoadFromDB() */ } -CalendarEvent* CalendarMgr::CheckPermisions(uint64 eventId, uint64 guid, uint64 inviteId, CalendarRanks minRank) +CalendarEvent* CalendarMgr::CheckPermisions(uint64 eventId, Player* player, uint64 inviteId, CalendarRanks minRank) { - if (CalendarEvent* calendarEvent = GetEvent(eventId)) - if (CalendarInvite* invite = GetInvite(inviteId)) - if (calendarEvent->HasInvite(inviteId) - && invite->GetEventId() == calendarEvent->GetEventId() - && invite->GetInvitee() == guid - && invite->GetRank() >= minRank) - return calendarEvent; + if (!player) + return NULL; // CALENDAR_ERROR_INTERNAL - return NULL; + CalendarEvent* calendarEvent = GetEvent(eventId); + if (!calendarEvent) + { + player->GetSession()->SendCalendarCommandResult(CALENDAR_ERROR_EVENT_INVALID); + return NULL; + } + + CalendarInvite* invite = GetInvite(inviteId); + if (!invite) + { + player->GetSession()->SendCalendarCommandResult(CALENDAR_ERROR_NO_INVITE); + return NULL; + } + + if (!calendarEvent->HasInvite(inviteId)) + { + player->GetSession()->SendCalendarCommandResult(CALENDAR_ERROR_NOT_INVITED); + return NULL; + } + + if (invite->GetEventId() != calendarEvent->GetEventId() || invite->GetInvitee() != player->GetGUID()) + { + player->GetSession()->SendCalendarCommandResult(CALENDAR_ERROR_INTERNAL); + return NULL; + } + + if (invite->GetRank() < minRank) + { + player->GetSession()->SendCalendarCommandResult(CALENDAR_ERROR_PERMISSIONS); + return NULL; + } + + return calendarEvent; } void CalendarMgr::AddAction(CalendarAction const& action) @@ -209,8 +236,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) case CALENDAR_ACTION_MODIFY_EVENT: { uint64 eventId = action.Event.GetEventId(); - CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); - + CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); if (!calendarEvent) return; @@ -234,7 +260,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) } case CALENDAR_ACTION_COPY_EVENT: { - CalendarEvent* calendarEvent = CheckPermisions(action.Event.GetEventId(), action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_OWNER); + CalendarEvent* calendarEvent = CheckPermisions(action.Event.GetEventId(), action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_OWNER); if (!calendarEvent) return; @@ -261,7 +287,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) uint64 inviteId = GetFreeInviteId(); CalendarInvite newInvite(inviteId); newInvite.SetEventId(eventId); - newInvite.SetSenderGUID(action.GetGUID()); + newInvite.SetSenderGUID(action.GetPlayer()->GetGUID()); newInvite.SetInvitee(invite->GetInvitee()); newInvite.SetStatus(invite->GetStatus()); newInvite.SetStatusTime(invite->GetStatusTime()); @@ -286,8 +312,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) uint32 flags = action.Event.GetFlags(); // FIXME - Use of Flags here! - CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_OWNER); - + CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_OWNER); if (!calendarEvent) return; @@ -302,7 +327,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) case CALENDAR_ACTION_ADD_EVENT_INVITE: { uint64 eventId = action.Invite.GetEventId(); - CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); + CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); if (!calendarEvent) return; @@ -320,7 +345,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) { uint64 eventId = action.Event.GetEventId(); CalendarEvent* calendarEvent = GetEvent(eventId); - CheckPermisions(eventId, action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); + CheckPermisions(eventId, action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); if (!calendarEvent || !(calendarEvent->GetFlags() & CALENDAR_FLAG_GUILD_ONLY) || !calendarEvent->GetGuildId() || calendarEvent->GetGuildId() != action.GetExtraData()) @@ -332,12 +357,13 @@ void CalendarMgr::AddAction(CalendarAction const& action) status = CALENDAR_STATUS_CONFIRMED; else if (status == CALENDAR_STATUS_ACCEPTED) status = CALENDAR_STATUS_8; + CalendarInvite newInvite(GetFreeInviteId()); newInvite.SetStatus(status); newInvite.SetStatusTime(uint32(time(NULL))); newInvite.SetEventId(eventId); - newInvite.SetInvitee(action.GetGUID()); - newInvite.SetSenderGUID(action.GetGUID()); + newInvite.SetInvitee(action.GetPlayer()->GetGUID()); + newInvite.SetSenderGUID(action.GetPlayer()->GetGUID()); if (AddInvite(newInvite)) SendCalendarEventInvite(newInvite, false); @@ -351,7 +377,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) CalendarEvent* calendarEvent; if (action.GetInviteId() != action.Invite.GetInviteId()) - calendarEvent = CheckPermisions(eventId, action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); + calendarEvent = CheckPermisions(eventId, action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); else calendarEvent = GetEvent(eventId); @@ -371,7 +397,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) CalendarEvent* calendarEvent; if (action.GetInviteId() != action.Invite.GetInviteId()) - calendarEvent = CheckPermisions(eventId, action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_OWNER); + calendarEvent = CheckPermisions(eventId, action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_OWNER); else calendarEvent = GetEvent(eventId); @@ -388,15 +414,22 @@ void CalendarMgr::AddAction(CalendarAction const& action) { uint64 eventId = action.Invite.GetEventId(); uint64 inviteId = action.Invite.GetInviteId(); - CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetGUID(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); - + CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); if (!calendarEvent) return; + // already checked in CheckPermisions + CalendarInvite* invite = GetInvite(inviteId); + if (calendarEvent->GetCreatorGUID() == invite->GetInvitee()) + { + action.GetPlayer()->GetSession()->SendCalendarCommandResult(CALENDAR_ERROR_DELETE_CREATOR_FAILED); + return; + } + if (uint64 invitee = RemoveInvite(inviteId)) { SendCalendarEventInviteRemoveAlert(invitee, *calendarEvent, CALENDAR_STATUS_9); - SendCalendarEventInviteRemove(action.GetGUID(), action.Invite, calendarEvent->GetFlags()); + SendCalendarEventInviteRemove(action.GetPlayer()->GetGUID(), action.Invite, calendarEvent->GetFlags()); } break; } diff --git a/src/server/game/Calendar/CalendarMgr.h b/src/server/game/Calendar/CalendarMgr.h index 490e39ab300..0fb4362bc95 100644 --- a/src/server/game/Calendar/CalendarMgr.h +++ b/src/server/game/Calendar/CalendarMgr.h @@ -54,7 +54,7 @@ class CalendarMgr void SendCalendarEventModeratorStatusAlert(CalendarInvite const& invite); private: - CalendarEvent* CheckPermisions(uint64 eventId, uint64 guid, uint64 invitateId, CalendarRanks minRank); + CalendarEvent* CheckPermisions(uint64 eventId, Player* player, uint64 inviteId, CalendarRanks minRank); bool AddEvent(CalendarEvent const& calendarEvent); bool RemoveEvent(uint64 eventId); diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index b5a77dd52e0..01838f815fb 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -44,6 +44,7 @@ SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT [ Structure unkown ] #include "CalendarMgr.h" #include "ObjectMgr.h" #include "ObjectAccessor.h" +#include "DatabaseEnv.h" void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) { @@ -257,7 +258,7 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data) CalendarAction action; action.SetAction(CALENDAR_ACTION_ADD_EVENT); - action.SetGUID(guid); + action.SetPlayer(_player); action.Event.SetEventId(sCalendarMgr->GetFreeEventId()); action.Event.SetCreatorGUID(guid); action.Event.SetType(type); @@ -309,7 +310,7 @@ void WorldSession::HandleCalendarUpdateEvent(WorldPacket& recv_data) CalendarAction action; action.SetAction(CALENDAR_ACTION_MODIFY_EVENT); - action.SetGUID(guid); + action.SetPlayer(_player); action.SetInviteId(inviteId); action.Event.SetEventId(eventId); action.Event.SetType(type); @@ -338,7 +339,7 @@ void WorldSession::HandleCalendarRemoveEvent(WorldPacket& recv_data) CalendarAction action; action.SetAction(CALENDAR_ACTION_REMOVE_EVENT); - action.SetGUID(guid); + action.SetPlayer(_player); action.SetInviteId(inviteId); action.Event.SetEventId(eventId); action.Event.SetFlags(flags); @@ -359,7 +360,7 @@ void WorldSession::HandleCalendarCopyEvent(WorldPacket& recv_data) CalendarAction action; action.SetAction(CALENDAR_ACTION_COPY_EVENT); - action.SetGUID(guid); + action.SetPlayer(_player); action.SetInviteId(inviteId); action.Event.SetEventId(eventId); action.Event.SetTime(time); @@ -375,13 +376,26 @@ void WorldSession::HandleCalendarEventInvite(WorldPacket& recv_data) std::string name; uint8 status; uint8 rank; + uint64 invitee = 0; + uint32 team = 0; recv_data >> eventId >> inviteId >> name >> status >> rank; - uint64 invitee = 0; if (Player* player = sObjectAccessor->FindPlayerByName(name.c_str())) + { invitee = player->GetGUID(); + team = player->GetTeam(); + } else - invitee = sObjectMgr->GetPlayerGUIDByName(name.c_str()); + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_RACE_ACC_BY_NAME); + stmt->setString(0, name); + if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) + { + Field* fields = result->Fetch(); + invitee = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER); + team = Player::TeamForRace(fields[1].GetUInt8()); + } + } sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_EVENT_INVITE [" UI64FMTD "], EventId [" UI64FMTD "] InviteId [" UI64FMTD "] Name %s ([" UI64FMTD "]), status %u, " @@ -393,9 +407,17 @@ void WorldSession::HandleCalendarEventInvite(WorldPacket& recv_data) return; } + if (_player->GetTeam() != team) + { + SendCalendarCommandResult(CALENDAR_ERROR_NOT_ALLIED); + return; + } + + // TODO: Check ignore, even if offline (db query) + CalendarAction action; action.SetAction(CALENDAR_ACTION_ADD_EVENT_INVITE); - action.SetGUID(guid); + action.SetPlayer(_player); action.SetInviteId(inviteId); action.Invite.SetEventId(eventId); action.Invite.SetInviteId(sCalendarMgr->GetFreeInviteId()); @@ -419,7 +441,7 @@ void WorldSession::HandleCalendarEventSignup(WorldPacket& recv_data) CalendarAction action; action.SetAction(CALENDAR_ACTION_SIGNUP_TO_EVENT); - action.SetGUID(guid); + action.SetPlayer(_player); action.SetExtraData(GetPlayer()->GetGuildId()); action.Event.SetEventId(eventId); action.Invite.SetStatus(status); @@ -440,7 +462,7 @@ void WorldSession::HandleCalendarEventRsvp(WorldPacket& recv_data) CalendarAction action; action.SetAction(CALENDAR_ACTION_MODIFY_EVENT_INVITE); - action.SetGUID(guid); + action.SetPlayer(_player); action.SetInviteId(inviteId); action.Invite.SetInviteId(inviteId); action.Invite.SetEventId(eventId); @@ -467,7 +489,7 @@ void WorldSession::HandleCalendarEventRemoveInvite(WorldPacket& recv_data) CalendarAction action; action.SetAction(CALENDAR_ACTION_REMOVE_EVENT_INVITE); - action.SetGUID(guid); + action.SetPlayer(_player); action.SetInviteId(owninviteId); action.Invite.SetInviteId(inviteId); action.Invite.SetEventId(eventId); @@ -493,7 +515,7 @@ void WorldSession::HandleCalendarEventStatus(WorldPacket& recv_data) CalendarAction action; action.SetAction(CALENDAR_ACTION_MODIFY_EVENT_INVITE); - action.SetGUID(guid); + action.SetPlayer(_player); action.SetInviteId(owninviteId); action.Invite.SetInviteId(inviteId); action.Invite.SetEventId(eventId); @@ -520,7 +542,7 @@ void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket& recv_data) CalendarAction action; action.SetAction(CALENDAR_ACTION_MODIFY_MODERATOR_EVENT_INVITE); - action.SetGUID(guid); + action.SetPlayer(_player); action.SetInviteId(owninviteId); action.Invite.SetInviteId(inviteId); action.Invite.SetEventId(eventId); From ac70e09bc8b715250738aa9e627cea6dca6037f2 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Fri, 24 Feb 2012 21:15:05 -0330 Subject: [PATCH 0024/1149] DB/Updates: Fix some update sql's to proper naming. --- ...5_world_say_text.sql => 2012_02_19_05_world_creature_text.sql} | 0 ...6_world_say_text.sql => 2012_02_19_06_world_creature_text.sql} | 0 ..._02_20_01_world_misc_db.sql => 2012_02_20_01_world_gossip.sql} | 0 ..._21_05_world_Gossip_SAI.sql => 2012_02_21_05_world_gossip.sql} | 0 ...1_world_say_text.sql => 2012_02_22_01_world_creature_text.sql} | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename sql/updates/world/{2012_02_19_05_world_say_text.sql => 2012_02_19_05_world_creature_text.sql} (100%) rename sql/updates/world/{2012_02_19_06_world_say_text.sql => 2012_02_19_06_world_creature_text.sql} (100%) rename sql/updates/world/{2012_02_20_01_world_misc_db.sql => 2012_02_20_01_world_gossip.sql} (100%) rename sql/updates/world/{2012_02_21_05_world_Gossip_SAI.sql => 2012_02_21_05_world_gossip.sql} (100%) rename sql/updates/world/{2012_02_22_01_world_say_text.sql => 2012_02_22_01_world_creature_text.sql} (100%) diff --git a/sql/updates/world/2012_02_19_05_world_say_text.sql b/sql/updates/world/2012_02_19_05_world_creature_text.sql similarity index 100% rename from sql/updates/world/2012_02_19_05_world_say_text.sql rename to sql/updates/world/2012_02_19_05_world_creature_text.sql diff --git a/sql/updates/world/2012_02_19_06_world_say_text.sql b/sql/updates/world/2012_02_19_06_world_creature_text.sql similarity index 100% rename from sql/updates/world/2012_02_19_06_world_say_text.sql rename to sql/updates/world/2012_02_19_06_world_creature_text.sql diff --git a/sql/updates/world/2012_02_20_01_world_misc_db.sql b/sql/updates/world/2012_02_20_01_world_gossip.sql similarity index 100% rename from sql/updates/world/2012_02_20_01_world_misc_db.sql rename to sql/updates/world/2012_02_20_01_world_gossip.sql diff --git a/sql/updates/world/2012_02_21_05_world_Gossip_SAI.sql b/sql/updates/world/2012_02_21_05_world_gossip.sql similarity index 100% rename from sql/updates/world/2012_02_21_05_world_Gossip_SAI.sql rename to sql/updates/world/2012_02_21_05_world_gossip.sql diff --git a/sql/updates/world/2012_02_22_01_world_say_text.sql b/sql/updates/world/2012_02_22_01_world_creature_text.sql similarity index 100% rename from sql/updates/world/2012_02_22_01_world_say_text.sql rename to sql/updates/world/2012_02_22_01_world_creature_text.sql From d505e8ccc9190d4a9c4c7f13c2a45f484bd31234 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Fri, 24 Feb 2012 21:18:35 -0330 Subject: [PATCH 0025/1149] DB/SAI: Fix error in SAI. --- sql/updates/world/2012_02_24_01_world_sai.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/updates/world/2012_02_24_01_world_sai.sql b/sql/updates/world/2012_02_24_01_world_sai.sql index e7488fd8220..19e4e8fb772 100644 --- a/sql/updates/world/2012_02_24_01_world_sai.sql +++ b/sql/updates/world/2012_02_24_01_world_sai.sql @@ -17,7 +17,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type (@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Captive Aspirant - Script - Say random text'), (@ENTRY*100,9,1,0,0,0,100,0,2000,2000,2000,2000,33,@ENTRY,0,0,0,0,0,7,0,0,0,0,0,0,0,'Captive Aspirant - Script - Kill credit'), (@ENTRY*100,9,2,0,0,0,100,0,2000,2000,2000,2000,46,10,0,0,0,0,0,1,0,0,0,0,0,0,0,'Captive Aspirant - Script - move 10 yards'), -(@ENTRY*100,9,3,0,0,0,100,0,4000,4000,4000,4000,72,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Captive Aspirant - Script - despawn'); +(@ENTRY*100,9,3,0,0,0,100,0,4000,4000,4000,4000,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Captive Aspirant - Script - despawn'); -- SAI for Kul the Reckless SET @ENTRY=34956; UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; @@ -28,7 +28,7 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type (@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kul the Reckless - Script - Say random text'), (@ENTRY*100,9,1,0,0,0,100,0,2000,2000,2000,2000,33,@ENTRY,0,0,0,0,0,7,0,0,0,0,0,0,0,'Kul the Reckless - Script - Kill credit'), (@ENTRY*100,9,2,0,0,0,100,0,2000,2000,2000,2000,46,10,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kul the Reckless - Script - move 10 yards'), -(@ENTRY*100,9,3,0,0,0,100,0,4000,4000,4000,4000,72,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kul the Reckless - Script - despawn'); +(@ENTRY*100,9,3,0,0,0,100,0,4000,4000,4000,4000,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kul the Reckless - Script - despawn'); -- Captive Aspirant & Kul the Reckless text from sniff DELETE FROM `creature_text` WHERE `entry` IN (34716,34956); INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES From 28310f0938a8776d0cb42ba8a64f125cc42bff6b Mon Sep 17 00:00:00 2001 From: Elron103 Date: Sat, 25 Feb 2012 02:16:08 +0100 Subject: [PATCH 0026/1149] Core: Fix the SFMT randgen-initbug Signed-off-by: click --- src/server/shared/Utilities/Util.cpp | 5 +++++ src/server/shared/Utilities/Util.h | 5 +++++ src/server/worldserver/Master.cpp | 4 +++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/server/shared/Utilities/Util.cpp b/src/server/shared/Utilities/Util.cpp index 52ce74be8f8..d3ae82e4ff3 100755 --- a/src/server/shared/Utilities/Util.cpp +++ b/src/server/shared/Utilities/Util.cpp @@ -31,6 +31,11 @@ typedef ACE_TSS SFMTRandTSS; static SFMTRandTSS sfmtRand; +void init_sfmt() +{ + sfmtRand->RandomInit((int)(time(0))); +} + int32 irand(int32 min, int32 max) { return int32(sfmtRand->IRandom(min, max)); diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h index 4c2c1936993..1a542ff15e1 100755 --- a/src/server/shared/Utilities/Util.h +++ b/src/server/shared/Utilities/Util.h @@ -24,6 +24,11 @@ #include #include +#ifdef USE_SFMT_FOR_RNG + // Initialize SFMT before first use, if enabled. + void init_sfmt(); +#endif + // Searcher for map of structs template struct Finder { diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index d84cfc1a4a4..892328dcc81 100755 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -139,7 +139,9 @@ int Master::Run() #ifdef USE_SFMT_FOR_RNG sLog->outString("\n"); sLog->outString("SFMT has been enabled as the random number generator, if worldserver"); - sLog->outString("freezes or crashes randomly, first, try disabling SFMT in CMAKE configuration"); + sLog->outString("freezes or crashes randomly, first, try disabling SFMT in CMAKE configuration."); + sLog->outString("Initializing SFMT before first use."); + init_sfmt(); sLog->outString("\n"); #endif //USE_SFMT_FOR_RNG From d6c0a67a7c9d2cb1792ae7026a5e45f80f4082d0 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 25 Feb 2012 04:00:32 +0000 Subject: [PATCH 0027/1149] Core/Calendar: - Fix build - Use enums where possible - Renaming --- src/server/game/Calendar/Calendar.cpp | 6 +- src/server/game/Calendar/Calendar.h | 100 ++++------------- src/server/game/Calendar/CalendarMgr.cpp | 30 +++--- src/server/game/Calendar/CalendarMgr.h | 10 +- src/server/game/Handlers/CalendarHandler.cpp | 43 ++++---- src/server/game/Miscellaneous/SharedDefines.h | 101 ++++++++++++++++++ src/server/game/Server/WorldSession.h | 46 +------- 7 files changed, 170 insertions(+), 166 deletions(-) diff --git a/src/server/game/Calendar/Calendar.cpp b/src/server/game/Calendar/Calendar.cpp index 22578ef2dcc..ad0d4b4ac2e 100755 --- a/src/server/game/Calendar/Calendar.cpp +++ b/src/server/game/Calendar/Calendar.cpp @@ -40,8 +40,8 @@ void CalendarInvite::Init() _invitee = 0; _senderGUID = 0; _statusTime = 0; - _status = 0; - _rank = 0; + _status = CALENDAR_STATUS_INVITED; // default (0)? + _rank = CALENDAR_RANK_PLAYER; _text = ""; } @@ -74,7 +74,7 @@ void CalendarEvent::Init() _dungeonId = -1; _maxInvites = 0; _eventTime = 0; - _flags = 0; + _flags = (CalendarFlags) 0; _repeatable = false; _timezoneTime = 0; _title = ""; diff --git a/src/server/game/Calendar/Calendar.h b/src/server/game/Calendar/Calendar.h index 0caf4fca0dc..440a241652d 100755 --- a/src/server/game/Calendar/Calendar.h +++ b/src/server/game/Calendar/Calendar.h @@ -20,67 +20,9 @@ #define TRINITY_CALENDAR_H #include "Errors.h" +#include "SharedDefines.h" #include -enum CalendarFlags -{ - CALENDAR_FLAG_ALL_ALLOWED = 0x001, - CALENDAR_FLAG_INVITES_LOCKED = 0x010, - CALENDAR_FLAG_WITHOUT_INVITES = 0x040, - CALENDAR_FLAG_GUILD_ONLY = 0x400, -}; - -enum CalendarActionData -{ - CALENDAR_ACTION_NONE, - CALENDAR_ACTION_ADD_EVENT, - CALENDAR_ACTION_MODIFY_EVENT, - CALENDAR_ACTION_REMOVE_EVENT, - CALENDAR_ACTION_COPY_EVENT, - CALENDAR_ACTION_ADD_EVENT_INVITE, - CALENDAR_ACTION_MODIFY_EVENT_INVITE, - CALENDAR_ACTION_MODIFY_MODERATOR_EVENT_INVITE, - CALENDAR_ACTION_REMOVE_EVENT_INVITE, - CALENDAR_ACTION_SIGNUP_TO_EVENT, -}; - -enum CalendarRanks -{ - CALENDAR_RANK_PLAYER, - CALENDAR_RANK_MODERATOR, - CALENDAR_RANK_OWNER, -}; - -enum CalendarSendEventType -{ - CALENDAR_SENDTYPE_GET, - CALENDAR_SENDTYPE_ADD, - CALENDAR_SENDTYPE_COPY, -}; - -enum CalendarEventType -{ - CALENDAR_TYPE_RAID, - CALENDAR_TYPE_DUNGEON, - CALENDAR_TYPE_PVP, - CALENDAR_TYPE_MEETING, - CALENDAR_TYPE_OTHER, -}; - -enum CalendarInviteStatus -{ - CALENDAR_STATUS_INVITED, - CALENDAR_STATUS_ACCEPTED, - CALENDAR_STATUS_DECLINED, - CALENDAR_STATUS_TENTATIVE, - CALENDAR_STATUS_OUT, - CALENDAR_STATUS_STANDBY, - CALENDAR_STATUS_CONFIRMED, - CALENDAR_STATUS_NO_OWNER, - CALENDAR_STATUS_8, - CALENDAR_STATUS_9, -}; - class CalendarInvite { public: @@ -107,11 +49,11 @@ class CalendarInvite void SetText(std::string text) { _text = text; } std::string GetText() const { return _text; } - void SetStatus(uint8 status) { _status = status; } - uint8 GetStatus() const { return _status; } + void SetStatus(CalendarInviteStatus status) { _status = status; } + CalendarInviteStatus GetStatus() const { return _status; } - void SetRank(uint8 rank) { _rank = rank; } - uint8 GetRank() const { return _rank; } + void SetRank(CalendarModerationRank rank) { _rank = rank; } + CalendarModerationRank GetRank() const { return _rank; } std::string GetDebugString() const; @@ -123,12 +65,12 @@ class CalendarInvite uint64 _invitee; uint64 _senderGUID; uint32 _statusTime; - uint8 _status; - uint8 _rank; + CalendarInviteStatus _status; + CalendarModerationRank _rank; std::string _text; }; -typedef std::set CalendarinviteIdList; +typedef std::set CalendarInviteIdList; class CalendarEvent { @@ -153,8 +95,8 @@ class CalendarEvent void SetDescription(std::string description) { _description = description; } std::string GetDescription() const { return _description; } - void SetType(uint8 type) { _type = type; } - uint8 GetType() const { return _type; } + void SetType(CalendarEventType type) { _type = type; } + CalendarEventType GetType() const { return _type; } void SetMaxInvites(uint32 limit) { _maxInvites = limit; } uint32 GetMaxInvites() const { return _maxInvites; } @@ -165,11 +107,11 @@ class CalendarEvent void SetTime(uint32 eventTime) { _eventTime = eventTime; } uint32 GetTime() const { return _eventTime; } - void SetFlags(uint32 flags) { _flags = flags; } - uint32 GetFlags() const { return _flags; } + void SetFlags(CalendarFlags flags) { _flags = flags; } + CalendarFlags GetFlags() const { return _flags; } void SetRepeatable(bool repeatable) { _repeatable = repeatable; } - uint8 GetRepeatable() const { return _repeatable; } + bool GetRepeatable() const { return _repeatable; } void SetTimeZoneTime(uint32 timezoneTime) { _timezoneTime = timezoneTime; } uint32 GetTimeZoneTime() const { return _timezoneTime; } @@ -182,8 +124,8 @@ class CalendarEvent void RemoveInvite(uint64 inviteId) { _invites.erase(inviteId); } bool HasInvite(uint64 inviteId) const { return _invites.find(inviteId) != _invites.end(); } - CalendarinviteIdList const& GetInviteIdList() const { return _invites; } - void SetInviteIdList(CalendarinviteIdList const& list) { _invites = list; } + CalendarInviteIdList const& GetInviteIdList() const { return _invites; } + void SetInviteIdList(CalendarInviteIdList const& list) { _invites = list; } void ClearInviteIdList() { _invites.clear(); } std::string GetDebugString() const; @@ -194,20 +136,20 @@ class CalendarEvent uint64 _eventId; uint64 _creatorGUID; uint32 _guildId; - uint8 _type; + CalendarEventType _type; int32 _dungeonId; uint32 _maxInvites; uint32 _eventTime; - uint32 _flags; - uint8 _repeatable; + CalendarFlags _flags; + bool _repeatable; uint32 _timezoneTime; std::string _title; std::string _description; - CalendarinviteIdList _invites; + CalendarInviteIdList _invites; }; typedef std::set CalendarEventIdList; -typedef std::map CalendarPlayerinviteIdMap; +typedef std::map CalendarPlayerInviteIdMap; typedef std::map CalendarPlayerEventIdMap; typedef std::map CalendarInviteMap; typedef std::map CalendarEventMap; @@ -216,7 +158,7 @@ class Player; struct CalendarAction { - CalendarAction(): _action(CALENDAR_ACTION_NONE), _player(NULL), _guid(0), _inviteId(0), _data(0) + CalendarAction(): _action(CALENDAR_ACTION_NONE), _player(NULL), _inviteId(0), _data(0) { } diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index aac26578c3e..9b8ef5614f0 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -67,12 +67,12 @@ uint32 CalendarMgr::GetPlayerNumPending(uint64 guid) if (!guid) return 0; - CalendarPlayerinviteIdMap::const_iterator itr = _playerInvites.find(guid); + CalendarPlayerInviteIdMap::const_iterator itr = _playerInvites.find(guid); if (itr == _playerInvites.end()) return 0; uint32 pendingNum = 0; - for (CalendarinviteIdList::const_iterator it = itr->second.begin(); it != itr->second.end(); ++it) + for (CalendarInviteIdList::const_iterator it = itr->second.begin(); it != itr->second.end(); ++it) if (CalendarInvite* invite = GetInvite(*it)) if (invite->GetRank() != CALENDAR_RANK_OWNER && invite->GetStatus() != CALENDAR_STATUS_CONFIRMED @@ -83,7 +83,7 @@ uint32 CalendarMgr::GetPlayerNumPending(uint64 guid) return pendingNum; } -CalendarinviteIdList const& CalendarMgr::GetPlayerInvites(uint64 guid) +CalendarInviteIdList const& CalendarMgr::GetPlayerInvites(uint64 guid) { return _playerInvites[guid]; } @@ -180,7 +180,7 @@ void CalendarMgr::LoadFromDB() */ } -CalendarEvent* CalendarMgr::CheckPermisions(uint64 eventId, Player* player, uint64 inviteId, CalendarRanks minRank) +CalendarEvent* CalendarMgr::CheckPermisions(uint64 eventId, Player* player, uint64 inviteId, CalendarModerationRank minRank) { if (!player) return NULL; // CALENDAR_ERROR_INTERNAL @@ -251,8 +251,8 @@ void CalendarMgr::AddAction(CalendarAction const& action) calendarEvent->SetDescription(action.Event.GetDescription()); calendarEvent->SetMaxInvites(action.Event.GetMaxInvites()); - CalendarinviteIdList const& invites = calendarEvent->GetInviteIdList(); - for (CalendarinviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) + CalendarInviteIdList const& invites = calendarEvent->GetInviteIdList(); + for (CalendarInviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) if (CalendarInvite* invite = GetInvite(*itr)) SendCalendarEventUpdateAlert(invite->GetInvitee(), *calendarEvent, CALENDAR_SENDTYPE_ADD); @@ -279,8 +279,8 @@ void CalendarMgr::AddAction(CalendarAction const& action) newEvent.SetCreatorGUID(calendarEvent->GetCreatorGUID()); newEvent.SetGuildId(calendarEvent->GetGuildId()); - CalendarinviteIdList const invites = calendarEvent->GetInviteIdList(); - for (CalendarinviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) + CalendarInviteIdList const invites = calendarEvent->GetInviteIdList(); + for (CalendarInviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) { if (CalendarInvite* invite = GetInvite(*itr)) { @@ -316,8 +316,8 @@ void CalendarMgr::AddAction(CalendarAction const& action) if (!calendarEvent) return; - CalendarinviteIdList const& inviteIds = calendarEvent->GetInviteIdList(); - for (CalendarinviteIdList::const_iterator it = inviteIds.begin(); it != inviteIds.end(); ++it) + CalendarInviteIdList const& inviteIds = calendarEvent->GetInviteIdList(); + for (CalendarInviteIdList::const_iterator it = inviteIds.begin(); it != inviteIds.end(); ++it) if (uint64 invitee = RemoveInvite(*it)) SendCalendarEventRemovedAlert(invitee, *calendarEvent); @@ -351,7 +351,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) || !calendarEvent->GetGuildId() || calendarEvent->GetGuildId() != action.GetExtraData()) return; - uint8 status = action.Invite.GetStatus(); + CalendarInviteStatus status = action.Invite.GetStatus(); if (status == CALENDAR_STATUS_INVITED) status = CALENDAR_STATUS_CONFIRMED; @@ -465,8 +465,8 @@ bool CalendarMgr::RemoveEvent(uint64 eventId) bool val = true; - CalendarinviteIdList const& invites = itr->second.GetInviteIdList(); - for (CalendarinviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) + CalendarInviteIdList const& invites = itr->second.GetInviteIdList(); + for (CalendarInviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) { CalendarInvite* invite = GetInvite(*itr); if (!invite || !RemovePlayerEvent(invite->GetInvitee(), eventId)) @@ -573,13 +573,13 @@ void CalendarMgr::SendCalendarEventRemovedAlert(uint64 guid, CalendarEvent const player->GetSession()->SendCalendarEventRemovedAlert(calendarEvent); } -void CalendarMgr::SendCalendarEventInviteRemoveAlert(uint64 guid, CalendarEvent const& calendarEvent, uint8 status) +void CalendarMgr::SendCalendarEventInviteRemoveAlert(uint64 guid, CalendarEvent const& calendarEvent, CalendarInviteStatus status) { if (Player* player = ObjectAccessor::FindPlayer(guid)) player->GetSession()->SendCalendarEventInviteRemoveAlert(calendarEvent, status); } -void CalendarMgr::SendCalendarEventInviteRemove(uint64 guid, CalendarInvite const& invite, uint32 flags) +void CalendarMgr::SendCalendarEventInviteRemove(uint64 guid, CalendarInvite const& invite, CalendarFlags flags) { if (Player* player = ObjectAccessor::FindPlayer(guid)) player->GetSession()->SendCalendarEventInviteRemove(invite, flags); diff --git a/src/server/game/Calendar/CalendarMgr.h b/src/server/game/Calendar/CalendarMgr.h index 0fb4362bc95..bfc0fd9d1cf 100644 --- a/src/server/game/Calendar/CalendarMgr.h +++ b/src/server/game/Calendar/CalendarMgr.h @@ -34,7 +34,7 @@ class CalendarMgr CalendarInvite* GetInvite(uint64 inviteId); CalendarEvent* GetEvent(uint64 eventId); - CalendarinviteIdList const& GetPlayerInvites(uint64 guid); + CalendarInviteIdList const& GetPlayerInvites(uint64 guid); CalendarEventIdList const& GetPlayerEvents(uint64 guid); uint32 GetPlayerNumPending(uint64 guid); @@ -46,15 +46,15 @@ class CalendarMgr void SendCalendarEvent(CalendarEvent const& calendarEvent, CalendarSendEventType type); void SendCalendarEventInvite(CalendarInvite const& invite, bool pending); void SendCalendarEventInviteAlert(CalendarEvent const& calendarEvent, CalendarInvite const& invite); - void SendCalendarEventInviteRemove(uint64 guid, CalendarInvite const& invite, uint32 flags); - void SendCalendarEventInviteRemoveAlert(uint64 guid, CalendarEvent const& calendarEvent, uint8 status); + void SendCalendarEventInviteRemove(uint64 guid, CalendarInvite const& invite, CalendarFlags flags); + void SendCalendarEventInviteRemoveAlert(uint64 guid, CalendarEvent const& calendarEvent, CalendarInviteStatus status); void SendCalendarEventUpdateAlert(uint64 guid, CalendarEvent const& calendarEvent, CalendarSendEventType type); void SendCalendarEventStatus(uint64 guid, CalendarEvent const& calendarEvent, CalendarInvite const& invite); void SendCalendarEventRemovedAlert(uint64 guid, CalendarEvent const& calendarEvent); void SendCalendarEventModeratorStatusAlert(CalendarInvite const& invite); private: - CalendarEvent* CheckPermisions(uint64 eventId, Player* player, uint64 inviteId, CalendarRanks minRank); + CalendarEvent* CheckPermisions(uint64 eventId, Player* player, uint64 inviteId, CalendarModerationRank minRank); bool AddEvent(CalendarEvent const& calendarEvent); bool RemoveEvent(uint64 eventId); @@ -68,7 +68,7 @@ class CalendarMgr CalendarEventMap _events; CalendarInviteMap _invites; - CalendarPlayerinviteIdMap _playerInvites; + CalendarPlayerInviteIdMap _playerInvites; CalendarPlayerEventIdMap _playerEvents; uint64 _eventNum; diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 01838f815fb..f9e74b60c58 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -21,7 +21,6 @@ SMSG_CALENDAR_CLEAR_PENDING_ACTION SendCalendarClearPendingAction() SMSG_CALENDAR_RAID_LOCKOUT_UPDATED SendCalendarRaildLockoutUpdated(InstanceSave const* save) <--- Structure unknown, using LOCKOUT_ADDED -SMSG_CALENDAR_COMMAND_RESULT SendCalendarCommandResult(uint32 value) <--- Structure meanings not known using in a Hack way ----- Opcodes without Sniffs ----- SMSG_CALENDAR_FILTER_GUILD [ for (... uint32(count) { packguid(???), uint8(???) } ] @@ -56,9 +55,9 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_SEND_CALENDAR [" UI64FMTD "]", guid); WorldPacket data(SMSG_CALENDAR_SEND_CALENDAR, 1000); // Impossible to get the correct size without doing a double iteration of some elements - CalendarinviteIdList const& invites = sCalendarMgr->GetPlayerInvites(guid); + CalendarInviteIdList const& invites = sCalendarMgr->GetPlayerInvites(guid); data << uint32(invites.size()); - for (CalendarinviteIdList::const_iterator it = invites.begin(); it != invites.end(); ++it) + for (CalendarInviteIdList::const_iterator it = invites.begin(); it != invites.end(); ++it) { CalendarInvite* invite = sCalendarMgr->GetInvite(*it); CalendarEvent* calendarEvent = invite ? sCalendarMgr->GetEvent(invite->GetEventId()) : NULL; @@ -261,8 +260,8 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data) action.SetPlayer(_player); action.Event.SetEventId(sCalendarMgr->GetFreeEventId()); action.Event.SetCreatorGUID(guid); - action.Event.SetType(type); - action.Event.SetFlags(flags); + action.Event.SetType((CalendarEventType) type); + action.Event.SetFlags((CalendarFlags) flags); action.Event.SetTime(eventPackedTime); action.Event.SetTimeZoneTime(unkPackedTime); action.Event.SetRepeatable(repeatable); @@ -275,8 +274,8 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data) action.Invite.SetEventId(action.Event.GetEventId()); action.Invite.SetInviteId(inviteId); action.Invite.SetInvitee(invitee); - action.Invite.SetStatus(status); - action.Invite.SetRank(rank); + action.Invite.SetStatus((CalendarInviteStatus) status); + action.Invite.SetRank((CalendarModerationRank) rank); action.Invite.SetSenderGUID(guid); sCalendarMgr->AddAction(action); @@ -313,8 +312,8 @@ void WorldSession::HandleCalendarUpdateEvent(WorldPacket& recv_data) action.SetPlayer(_player); action.SetInviteId(inviteId); action.Event.SetEventId(eventId); - action.Event.SetType(type); - action.Event.SetFlags(flags); + action.Event.SetType((CalendarEventType) type); + action.Event.SetFlags((CalendarFlags) flags); action.Event.SetTime(eventPackedTime); action.Event.SetTimeZoneTime(timeZoneTime); action.Event.SetRepeatable(repeatable); @@ -342,7 +341,7 @@ void WorldSession::HandleCalendarRemoveEvent(WorldPacket& recv_data) action.SetPlayer(_player); action.SetInviteId(inviteId); action.Event.SetEventId(eventId); - action.Event.SetFlags(flags); + action.Event.SetFlags((CalendarFlags) flags); sCalendarMgr->AddAction(action); } @@ -423,8 +422,8 @@ void WorldSession::HandleCalendarEventInvite(WorldPacket& recv_data) action.Invite.SetInviteId(sCalendarMgr->GetFreeInviteId()); action.Invite.SetSenderGUID(_player->GetGUID()); action.Invite.SetInvitee(invitee); - action.Invite.SetRank(rank); - action.Invite.SetStatus(status); + action.Invite.SetRank((CalendarModerationRank) rank); + action.Invite.SetStatus((CalendarInviteStatus) status); sCalendarMgr->AddAction(action); } @@ -444,7 +443,7 @@ void WorldSession::HandleCalendarEventSignup(WorldPacket& recv_data) action.SetPlayer(_player); action.SetExtraData(GetPlayer()->GetGuildId()); action.Event.SetEventId(eventId); - action.Invite.SetStatus(status); + action.Invite.SetStatus((CalendarInviteStatus) status); sCalendarMgr->AddAction(action); } @@ -466,7 +465,7 @@ void WorldSession::HandleCalendarEventRsvp(WorldPacket& recv_data) action.SetInviteId(inviteId); action.Invite.SetInviteId(inviteId); action.Invite.SetEventId(eventId); - action.Invite.SetStatus(status); + action.Invite.SetStatus((CalendarInviteStatus) status); sCalendarMgr->AddAction(action); } @@ -520,7 +519,7 @@ void WorldSession::HandleCalendarEventStatus(WorldPacket& recv_data) action.Invite.SetInviteId(inviteId); action.Invite.SetEventId(eventId); action.Invite.SetInvitee(invitee); - action.Invite.SetStatus(status); + action.Invite.SetStatus((CalendarInviteStatus) status); sCalendarMgr->AddAction(action); } @@ -547,7 +546,7 @@ void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket& recv_data) action.Invite.SetInviteId(inviteId); action.Invite.SetEventId(eventId); action.Invite.SetInvitee(invitee); - action.Invite.SetStatus(status); + action.Invite.SetStatus((CalendarInviteStatus) status); sCalendarMgr->AddAction(action); } @@ -578,7 +577,7 @@ void WorldSession::HandleCalendarGetNumPending(WorldPacket& /*recv_data*/) // ----------------------------------- SEND ------------------------------------ -void WorldSession::SendCalendarEvent(CalendarEvent const& calendarEvent, uint8 sendEventType) +void WorldSession::SendCalendarEvent(CalendarEvent const& calendarEvent, CalendarSendEventType sendEventType) { uint64 guid = _player->GetGUID(); uint64 eventId = calendarEvent.GetEventId(); @@ -601,9 +600,9 @@ void WorldSession::SendCalendarEvent(CalendarEvent const& calendarEvent, uint8 s data << uint32(calendarEvent.GetTimeZoneTime()); data << uint32(calendarEvent.GetGuildId()); - CalendarinviteIdList const& invites = calendarEvent.GetInviteIdList(); + CalendarInviteIdList const& invites = calendarEvent.GetInviteIdList(); data << uint32(invites.size()); - for (CalendarinviteIdList::const_iterator it = invites.begin(); it != invites.end(); ++it) + for (CalendarInviteIdList::const_iterator it = invites.begin(); it != invites.end(); ++it) { if (CalendarInvite* invite = sCalendarMgr->GetInvite(*it)) { @@ -687,7 +686,7 @@ void WorldSession::SendCalendarEventInviteAlert(CalendarEvent const& calendarEve SendPacket(&data); } -void WorldSession::SendCalendarEventUpdateAlert(CalendarEvent const& calendarEvent, uint8 sendEventType) +void WorldSession::SendCalendarEventUpdateAlert(CalendarEvent const& calendarEvent, CalendarSendEventType sendEventType) { uint64 guid = _player->GetGUID(); uint64 eventId = calendarEvent.GetEventId(); @@ -780,7 +779,7 @@ void WorldSession::SendCalendarEventModeratorStatusAlert(CalendarInvite const& i SendPacket(&data); } -void WorldSession::SendCalendarEventInviteRemoveAlert(CalendarEvent const& calendarEvent, uint8 status) +void WorldSession::SendCalendarEventInviteRemoveAlert(CalendarEvent const& calendarEvent, CalendarInviteStatus status) { uint64 guid = _player->GetGUID(); uint64 eventId = calendarEvent.GetEventId(); @@ -799,7 +798,7 @@ void WorldSession::SendCalendarEventInviteRemoveAlert(CalendarEvent const& calen SendPacket(&data); } -void WorldSession::SendCalendarEventInviteRemove(CalendarInvite const& invite, uint32 flags) +void WorldSession::SendCalendarEventInviteRemove(CalendarInvite const& invite, CalendarFlags flags) { uint64 guid = _player->GetGUID(); uint64 eventId = invite.GetEventId(); diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index fbc84b85a80..c404277f61f 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -3422,4 +3422,105 @@ enum ActivateTaxiReply ERR_TAXINOTSTANDING = 12 }; +// Calendar - start + +enum CalendarFlags +{ + CALENDAR_FLAG_ALL_ALLOWED = 0x001, + CALENDAR_FLAG_INVITES_LOCKED = 0x010, + CALENDAR_FLAG_WITHOUT_INVITES = 0x040, + CALENDAR_FLAG_GUILD_ONLY = 0x400, +}; + +enum CalendarActionData +{ + CALENDAR_ACTION_NONE, + CALENDAR_ACTION_ADD_EVENT, + CALENDAR_ACTION_MODIFY_EVENT, + CALENDAR_ACTION_REMOVE_EVENT, + CALENDAR_ACTION_COPY_EVENT, + CALENDAR_ACTION_ADD_EVENT_INVITE, + CALENDAR_ACTION_MODIFY_EVENT_INVITE, + CALENDAR_ACTION_MODIFY_MODERATOR_EVENT_INVITE, + CALENDAR_ACTION_REMOVE_EVENT_INVITE, + CALENDAR_ACTION_SIGNUP_TO_EVENT, +}; + +enum CalendarModerationRank +{ + CALENDAR_RANK_PLAYER, + CALENDAR_RANK_MODERATOR, + CALENDAR_RANK_OWNER, +}; + +enum CalendarSendEventType +{ + CALENDAR_SENDTYPE_GET, + CALENDAR_SENDTYPE_ADD, + CALENDAR_SENDTYPE_COPY, +}; + +enum CalendarEventType +{ + CALENDAR_TYPE_RAID, + CALENDAR_TYPE_DUNGEON, + CALENDAR_TYPE_PVP, + CALENDAR_TYPE_MEETING, + CALENDAR_TYPE_OTHER, +}; + +enum CalendarInviteStatus +{ + CALENDAR_STATUS_INVITED, + CALENDAR_STATUS_ACCEPTED, + CALENDAR_STATUS_DECLINED, + CALENDAR_STATUS_TENTATIVE, + CALENDAR_STATUS_OUT, + CALENDAR_STATUS_STANDBY, + CALENDAR_STATUS_CONFIRMED, + CALENDAR_STATUS_NO_OWNER, + CALENDAR_STATUS_8, + CALENDAR_STATUS_9, +}; + +enum CalendarError +{ + CALENDAR_OK = 0, + CALENDAR_ERROR_GUILD_EVENTS_EXCEEDED = 1, + CALENDAR_ERROR_EVENTS_EXCEEDED = 2, + CALENDAR_ERROR_SELF_INVITES_EXCEEDED = 3, + CALENDAR_ERROR_OTHER_INVITES_EXCEEDED = 4, + CALENDAR_ERROR_PERMISSIONS = 5, + CALENDAR_ERROR_EVENT_INVALID = 6, + CALENDAR_ERROR_NOT_INVITED = 7, + CALENDAR_ERROR_INTERNAL = 8, + CALENDAR_ERROR_GUILD_PLAYER_NOT_IN_GUILD = 9, + CALENDAR_ERROR_ALREADY_INVITED_TO_EVENT_S = 10, + CALENDAR_ERROR_PLAYER_NOT_FOUND = 11, + CALENDAR_ERROR_NOT_ALLIED = 12, + CALENDAR_ERROR_IGNORING_YOU_S = 13, + CALENDAR_ERROR_INVITES_EXCEEDED = 14, + CALENDAR_ERROR_INVALID_DATE = 16, + CALENDAR_ERROR_INVALID_TIME = 17, + + CALENDAR_ERROR_NEEDS_TITLE = 19, + CALENDAR_ERROR_EVENT_PASSED = 20, + CALENDAR_ERROR_EVENT_LOCKED = 21, + CALENDAR_ERROR_DELETE_CREATOR_FAILED = 22, + CALENDAR_ERROR_SYSTEM_DISABLED = 24, + CALENDAR_ERROR_RESTRICTED_ACCOUNT = 25, + CALENDAR_ERROR_ARENA_EVENTS_EXCEEDED = 26, + CALENDAR_ERROR_RESTRICTED_LEVEL = 27, + CALENDAR_ERROR_USER_SQUELCHED = 28, + CALENDAR_ERROR_NO_INVITE = 29, + + CALENDAR_ERROR_EVENT_WRONG_SERVER = 36, + CALENDAR_ERROR_INVITE_WRONG_SERVER = 37, + CALENDAR_ERROR_NO_GUILD_INVITES = 38, + CALENDAR_ERROR_INVALID_SIGNUP = 39, + CALENDAR_ERROR_NO_MODERATOR = 40 +}; + +// Calendar - end + #endif diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 35a85753c20..3158c02a320 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -141,44 +141,6 @@ enum CharterTypes ARENA_TEAM_CHARTER_5v5_TYPE = 5 }; -enum CalendarError -{ - CALENDAR_OK = 0, - CALENDAR_ERROR_GUILD_EVENTS_EXCEEDED = 1, - CALENDAR_ERROR_EVENTS_EXCEEDED = 2, - CALENDAR_ERROR_SELF_INVITES_EXCEEDED = 3, - CALENDAR_ERROR_OTHER_INVITES_EXCEEDED = 4, - CALENDAR_ERROR_PERMISSIONS = 5, - CALENDAR_ERROR_EVENT_INVALID = 6, - CALENDAR_ERROR_NOT_INVITED = 7, - CALENDAR_ERROR_INTERNAL = 8, - CALENDAR_ERROR_GUILD_PLAYER_NOT_IN_GUILD = 9, - CALENDAR_ERROR_ALREADY_INVITED_TO_EVENT_S = 10, - CALENDAR_ERROR_PLAYER_NOT_FOUND = 11, - CALENDAR_ERROR_NOT_ALLIED = 12, - CALENDAR_ERROR_IGNORING_YOU_S = 13, - CALENDAR_ERROR_INVITES_EXCEEDED = 14, - CALENDAR_ERROR_INVALID_DATE = 16, - CALENDAR_ERROR_INVALID_TIME = 17, - - CALENDAR_ERROR_NEEDS_TITLE = 19, - CALENDAR_ERROR_EVENT_PASSED = 20, - CALENDAR_ERROR_EVENT_LOCKED = 21, - CALENDAR_ERROR_DELETE_CREATOR_FAILED = 22, - CALENDAR_ERROR_SYSTEM_DISABLED = 24, - CALENDAR_ERROR_RESTRICTED_ACCOUNT = 25, - CALENDAR_ERROR_ARENA_EVENTS_EXCEEDED = 26, - CALENDAR_ERROR_RESTRICTED_LEVEL = 27, - CALENDAR_ERROR_USER_SQUELCHED = 28, - CALENDAR_ERROR_NO_INVITE = 29, - - CALENDAR_ERROR_EVENT_WRONG_SERVER = 36, - CALENDAR_ERROR_INVITE_WRONG_SERVER = 37, - CALENDAR_ERROR_NO_GUILD_INVITES = 38, - CALENDAR_ERROR_INVALID_SIGNUP = 39, - CALENDAR_ERROR_NO_MODERATOR = 40 -}; - //class to deal with packet processing //allows to determine if next packet is safe to be processed class PacketFilter @@ -920,13 +882,13 @@ class WorldSession void HandleCalendarGetNumPending(WorldPacket& recv_data); void HandleCalendarEventSignup(WorldPacket& recv_data); - void SendCalendarEvent(CalendarEvent const& calendarEvent, uint8 sendEventType); + void SendCalendarEvent(CalendarEvent const& calendarEvent, CalendarSendEventType sendEventType); void SendCalendarEventInvite(CalendarInvite const& invite, bool pending); void SendCalendarEventInviteAlert(CalendarEvent const& calendarEvent, CalendarInvite const& calendarInvite); - void SendCalendarEventInviteRemove(CalendarInvite const& invite, uint32 flags); - void SendCalendarEventInviteRemoveAlert(CalendarEvent const& calendarEvent, uint8 status); + void SendCalendarEventInviteRemove(CalendarInvite const& invite, CalendarFlags flags); + void SendCalendarEventInviteRemoveAlert(CalendarEvent const& calendarEvent, CalendarInviteStatus status); void SendCalendarEventRemovedAlert(CalendarEvent const& calendarEvent); - void SendCalendarEventUpdateAlert(CalendarEvent const& calendarEvent, uint8 sendEventType); + void SendCalendarEventUpdateAlert(CalendarEvent const& calendarEvent, CalendarSendEventType sendEventType); void SendCalendarEventStatus(CalendarEvent const& calendarEvent, CalendarInvite const& invite); void SendCalendarEventModeratorStatusAlert(CalendarInvite const& invite); void SendCalendarClearPendingAction(); From ad78d44da84499438f347bde5a48e382bb1316fd Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 25 Feb 2012 04:16:17 +0000 Subject: [PATCH 0028/1149] Core/Calendar: Change (revert) CalendarFlags vars to ints P.S I'd like to have type safe enums (C#-like, also [Flags] attr) --- src/server/game/Calendar/Calendar.cpp | 2 +- src/server/game/Calendar/Calendar.h | 6 +- src/server/game/Calendar/CalendarMgr.cpp | 2 +- src/server/game/Calendar/CalendarMgr.h | 2 +- src/server/game/Handlers/CalendarHandler.cpp | 86 ++++++++++---------- src/server/game/Server/WorldSession.h | 34 ++++---- 6 files changed, 66 insertions(+), 66 deletions(-) diff --git a/src/server/game/Calendar/Calendar.cpp b/src/server/game/Calendar/Calendar.cpp index ad0d4b4ac2e..3d6eef2cbab 100755 --- a/src/server/game/Calendar/Calendar.cpp +++ b/src/server/game/Calendar/Calendar.cpp @@ -74,7 +74,7 @@ void CalendarEvent::Init() _dungeonId = -1; _maxInvites = 0; _eventTime = 0; - _flags = (CalendarFlags) 0; + _flags = 0; _repeatable = false; _timezoneTime = 0; _title = ""; diff --git a/src/server/game/Calendar/Calendar.h b/src/server/game/Calendar/Calendar.h index 440a241652d..a2d2dc2ffb7 100755 --- a/src/server/game/Calendar/Calendar.h +++ b/src/server/game/Calendar/Calendar.h @@ -107,8 +107,8 @@ class CalendarEvent void SetTime(uint32 eventTime) { _eventTime = eventTime; } uint32 GetTime() const { return _eventTime; } - void SetFlags(CalendarFlags flags) { _flags = flags; } - CalendarFlags GetFlags() const { return _flags; } + void SetFlags(uint32 flags) { _flags = flags; } + uint32 GetFlags() const { return _flags; } void SetRepeatable(bool repeatable) { _repeatable = repeatable; } bool GetRepeatable() const { return _repeatable; } @@ -140,7 +140,7 @@ class CalendarEvent int32 _dungeonId; uint32 _maxInvites; uint32 _eventTime; - CalendarFlags _flags; + uint32 _flags; bool _repeatable; uint32 _timezoneTime; std::string _title; diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index 9b8ef5614f0..ea420d88516 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -579,7 +579,7 @@ void CalendarMgr::SendCalendarEventInviteRemoveAlert(uint64 guid, CalendarEvent player->GetSession()->SendCalendarEventInviteRemoveAlert(calendarEvent, status); } -void CalendarMgr::SendCalendarEventInviteRemove(uint64 guid, CalendarInvite const& invite, CalendarFlags flags) +void CalendarMgr::SendCalendarEventInviteRemove(uint64 guid, CalendarInvite const& invite, uint32 flags) { if (Player* player = ObjectAccessor::FindPlayer(guid)) player->GetSession()->SendCalendarEventInviteRemove(invite, flags); diff --git a/src/server/game/Calendar/CalendarMgr.h b/src/server/game/Calendar/CalendarMgr.h index bfc0fd9d1cf..a8749778cb3 100644 --- a/src/server/game/Calendar/CalendarMgr.h +++ b/src/server/game/Calendar/CalendarMgr.h @@ -46,7 +46,7 @@ class CalendarMgr void SendCalendarEvent(CalendarEvent const& calendarEvent, CalendarSendEventType type); void SendCalendarEventInvite(CalendarInvite const& invite, bool pending); void SendCalendarEventInviteAlert(CalendarEvent const& calendarEvent, CalendarInvite const& invite); - void SendCalendarEventInviteRemove(uint64 guid, CalendarInvite const& invite, CalendarFlags flags); + void SendCalendarEventInviteRemove(uint64 guid, CalendarInvite const& invite, uint32 flags); void SendCalendarEventInviteRemoveAlert(uint64 guid, CalendarEvent const& calendarEvent, CalendarInviteStatus status); void SendCalendarEventUpdateAlert(uint64 guid, CalendarEvent const& calendarEvent, CalendarSendEventType type); void SendCalendarEventStatus(uint64 guid, CalendarEvent const& calendarEvent, CalendarInvite const& invite); diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index f9e74b60c58..b5bff0e710a 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -45,7 +45,7 @@ SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT [ Structure unkown ] #include "ObjectAccessor.h" #include "DatabaseEnv.h" -void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) +void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/) { uint64 guid = _player->GetGUID(); sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_GET_CALENDAR [" UI64FMTD "]", guid); @@ -177,10 +177,10 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) SendPacket(&data); } -void WorldSession::HandleCalendarGetEvent(WorldPacket& recv_data) +void WorldSession::HandleCalendarGetEvent(WorldPacket& recvData) { uint64 eventId; - recv_data >> eventId; + recvData >> eventId; sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_GET_EVENT. Event: [" UI64FMTD "] Event [" UI64FMTD "]", _player->GetGUID(), eventId); @@ -189,21 +189,21 @@ void WorldSession::HandleCalendarGetEvent(WorldPacket& recv_data) SendCalendarEvent(*calendarEvent, CALENDAR_SENDTYPE_GET); } -void WorldSession::HandleCalendarGuildFilter(WorldPacket& recv_data) +void WorldSession::HandleCalendarGuildFilter(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_GUILD_FILTER [" UI64FMTD "]", _player->GetGUID()); - recv_data.read_skip(); // unk1 - recv_data.read_skip(); // unk2 - recv_data.read_skip(); // level + recvData.read_skip(); // unk1 + recvData.read_skip(); // unk2 + recvData.read_skip(); // level } -void WorldSession::HandleCalendarArenaTeam(WorldPacket& recv_data) +void WorldSession::HandleCalendarArenaTeam(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_ARENA_TEAM [" UI64FMTD "]", _player->GetGUID()); - recv_data.read_skip(); // unk + recvData.read_skip(); // unk } -void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data) +void WorldSession::HandleCalendarAddEvent(WorldPacket& recvData) { uint64 guid = _player->GetGUID(); std::string title; @@ -220,15 +220,15 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data) uint8 status; uint8 rank; - recv_data >> title >> description >> type >> repeatable >> maxInvites; - recv_data >> dungeonId >> eventPackedTime >> unkPackedTime >> flags; + recvData >> title >> description >> type >> repeatable >> maxInvites; + recvData >> dungeonId >> eventPackedTime >> unkPackedTime >> flags; if (!(flags & CALENDAR_FLAG_WITHOUT_INVITES)) { uint32 inviteCount; - recv_data >> inviteCount; - recv_data.readPackGUID(invitee); - recv_data >> status >> rank; + recvData >> inviteCount; + recvData.readPackGUID(invitee); + recvData >> status >> rank; if (inviteCount != 1 || invitee != guid) { @@ -261,7 +261,7 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data) action.Event.SetEventId(sCalendarMgr->GetFreeEventId()); action.Event.SetCreatorGUID(guid); action.Event.SetType((CalendarEventType) type); - action.Event.SetFlags((CalendarFlags) flags); + action.Event.SetFlags(flags); action.Event.SetTime(eventPackedTime); action.Event.SetTimeZoneTime(unkPackedTime); action.Event.SetRepeatable(repeatable); @@ -281,7 +281,7 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data) sCalendarMgr->AddAction(action); } -void WorldSession::HandleCalendarUpdateEvent(WorldPacket& recv_data) +void WorldSession::HandleCalendarUpdateEvent(WorldPacket& recvData) { uint64 guid = _player->GetGUID(); uint64 eventId; @@ -296,9 +296,9 @@ void WorldSession::HandleCalendarUpdateEvent(WorldPacket& recv_data) uint32 timeZoneTime; uint32 flags; - recv_data >> eventId >> inviteId >> title >> description >> type; - recv_data >> repeatable >> maxInvites >> dungeonId; - recv_data >> eventPackedTime >> timeZoneTime >> flags; + recvData >> eventId >> inviteId >> title >> description >> type; + recvData >> repeatable >> maxInvites >> dungeonId; + recvData >> eventPackedTime >> timeZoneTime >> flags; sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_UPDATE_EVENT [" UI64FMTD "] EventId [" UI64FMTD "], InviteId [" UI64FMTD "] Title %s, Description %s, type %u " @@ -325,14 +325,14 @@ void WorldSession::HandleCalendarUpdateEvent(WorldPacket& recv_data) sCalendarMgr->AddAction(action); } -void WorldSession::HandleCalendarRemoveEvent(WorldPacket& recv_data) +void WorldSession::HandleCalendarRemoveEvent(WorldPacket& recvData) { uint64 guid = _player->GetGUID(); uint64 eventId; uint64 inviteId; uint32 flags; - recv_data >> eventId >> inviteId >> flags; + recvData >> eventId >> inviteId >> flags; sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_REMOVE_EVENT [" UI64FMTD "], EventId [" UI64FMTD "] inviteId [" UI64FMTD "] Flags?: %u", guid, eventId, inviteId, flags); @@ -346,14 +346,14 @@ void WorldSession::HandleCalendarRemoveEvent(WorldPacket& recv_data) sCalendarMgr->AddAction(action); } -void WorldSession::HandleCalendarCopyEvent(WorldPacket& recv_data) +void WorldSession::HandleCalendarCopyEvent(WorldPacket& recvData) { uint64 guid = _player->GetGUID(); uint64 eventId; uint64 inviteId; uint32 time; - recv_data >> eventId >> inviteId >> time; + recvData >> eventId >> inviteId >> time; sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_COPY_EVENT [" UI64FMTD "], EventId [" UI64FMTD "] inviteId [" UI64FMTD "] Time: %u", guid, eventId, inviteId, time); @@ -367,7 +367,7 @@ void WorldSession::HandleCalendarCopyEvent(WorldPacket& recv_data) sCalendarMgr->AddAction(action); } -void WorldSession::HandleCalendarEventInvite(WorldPacket& recv_data) +void WorldSession::HandleCalendarEventInvite(WorldPacket& recvData) { uint64 guid = _player->GetGUID(); uint64 eventId; @@ -378,7 +378,7 @@ void WorldSession::HandleCalendarEventInvite(WorldPacket& recv_data) uint64 invitee = 0; uint32 team = 0; - recv_data >> eventId >> inviteId >> name >> status >> rank; + recvData >> eventId >> inviteId >> name >> status >> rank; if (Player* player = sObjectAccessor->FindPlayerByName(name.c_str())) { invitee = player->GetGUID(); @@ -428,13 +428,13 @@ void WorldSession::HandleCalendarEventInvite(WorldPacket& recv_data) sCalendarMgr->AddAction(action); } -void WorldSession::HandleCalendarEventSignup(WorldPacket& recv_data) +void WorldSession::HandleCalendarEventSignup(WorldPacket& recvData) { uint64 guid = _player->GetGUID(); uint64 eventId; uint8 status; - recv_data >> eventId >> status; + recvData >> eventId >> status; sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_EVENT_SIGNUP [" UI64FMTD "] EventId [" UI64FMTD "] Status %u", guid, eventId, status); @@ -447,14 +447,14 @@ void WorldSession::HandleCalendarEventSignup(WorldPacket& recv_data) sCalendarMgr->AddAction(action); } -void WorldSession::HandleCalendarEventRsvp(WorldPacket& recv_data) +void WorldSession::HandleCalendarEventRsvp(WorldPacket& recvData) { uint64 guid = _player->GetGUID(); uint64 eventId; uint64 inviteId; uint8 status; - recv_data >> eventId >> inviteId >> status; + recvData >> eventId >> inviteId >> status; sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_EVENT_RSVP [" UI64FMTD"] EventId [" UI64FMTD "], InviteId [" UI64FMTD "], status %u", guid, eventId, inviteId, status); @@ -470,7 +470,7 @@ void WorldSession::HandleCalendarEventRsvp(WorldPacket& recv_data) sCalendarMgr->AddAction(action); } -void WorldSession::HandleCalendarEventRemoveInvite(WorldPacket& recv_data) +void WorldSession::HandleCalendarEventRemoveInvite(WorldPacket& recvData) { uint64 guid = _player->GetGUID(); uint64 invitee; @@ -478,8 +478,8 @@ void WorldSession::HandleCalendarEventRemoveInvite(WorldPacket& recv_data) uint64 owninviteId; uint64 inviteId; - recv_data.readPackGUID(invitee); - recv_data >> inviteId >> owninviteId >> eventId; + recvData.readPackGUID(invitee); + recvData >> inviteId >> owninviteId >> eventId; sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_EVENT_REMOVE_INVITE [" UI64FMTD "] EventId [" UI64FMTD "], OwnInviteId [" @@ -497,7 +497,7 @@ void WorldSession::HandleCalendarEventRemoveInvite(WorldPacket& recv_data) sCalendarMgr->AddAction(action); } -void WorldSession::HandleCalendarEventStatus(WorldPacket& recv_data) +void WorldSession::HandleCalendarEventStatus(WorldPacket& recvData) { uint64 guid = _player->GetGUID(); uint64 invitee; @@ -506,8 +506,8 @@ void WorldSession::HandleCalendarEventStatus(WorldPacket& recv_data) uint64 owninviteId; uint8 status; - recv_data.readPackGUID(invitee); - recv_data >> eventId >> inviteId >> owninviteId >> status; + recvData.readPackGUID(invitee); + recvData >> eventId >> inviteId >> owninviteId >> status; sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_EVENT_STATUS [" UI64FMTD"] EventId [" UI64FMTD "] OwnInviteId [" UI64FMTD "], Invitee ([" UI64FMTD "] id: [" UI64FMTD "], status %u", guid, eventId, owninviteId, invitee, inviteId, status); @@ -524,7 +524,7 @@ void WorldSession::HandleCalendarEventStatus(WorldPacket& recv_data) sCalendarMgr->AddAction(action); } -void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket& recv_data) +void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket& recvData) { uint64 guid = _player->GetGUID(); uint64 invitee; @@ -533,8 +533,8 @@ void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket& recv_data) uint64 owninviteId; uint8 status; - recv_data.readPackGUID(invitee); - recv_data >> eventId >> inviteId >> owninviteId >> status; + recvData.readPackGUID(invitee); + recvData >> eventId >> inviteId >> owninviteId >> status; sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_EVENT_MODERATOR_STATUS [" UI64FMTD "] EventId [" UI64FMTD "] OwnInviteId [" UI64FMTD "], Invitee ([" UI64FMTD "] id: [" UI64FMTD "], status %u", guid, eventId, owninviteId, invitee, inviteId, status); @@ -551,18 +551,18 @@ void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket& recv_data) sCalendarMgr->AddAction(action); } -void WorldSession::HandleCalendarComplain(WorldPacket& recv_data) +void WorldSession::HandleCalendarComplain(WorldPacket& recvData) { uint64 guid = _player->GetGUID(); uint64 eventId; uint64 complainGUID; - recv_data >> eventId >> complainGUID; + recvData >> eventId >> complainGUID; sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_COMPLAIN [" UI64FMTD "] EventId [" UI64FMTD "] guid [" UI64FMTD "]", guid, eventId, complainGUID); } -void WorldSession::HandleCalendarGetNumPending(WorldPacket& /*recv_data*/) +void WorldSession::HandleCalendarGetNumPending(WorldPacket& /*recvData*/) { uint64 guid = _player->GetGUID(); uint32 pending = sCalendarMgr->GetPlayerNumPending(guid); @@ -798,7 +798,7 @@ void WorldSession::SendCalendarEventInviteRemoveAlert(CalendarEvent const& calen SendPacket(&data); } -void WorldSession::SendCalendarEventInviteRemove(CalendarInvite const& invite, CalendarFlags flags) +void WorldSession::SendCalendarEventInviteRemove(CalendarInvite const& invite, uint32 flags) { uint64 guid = _player->GetGUID(); uint64 eventId = invite.GetEventId(); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 3158c02a320..703c37c35a8 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -865,27 +865,27 @@ class WorldSession void HandleAcceptGrantLevel(WorldPacket& recv_data); // Calendar - void HandleCalendarGetCalendar(WorldPacket& recv_data); - void HandleCalendarGetEvent(WorldPacket& recv_data); - void HandleCalendarGuildFilter(WorldPacket& recv_data); - void HandleCalendarArenaTeam(WorldPacket& recv_data); - void HandleCalendarAddEvent(WorldPacket& recv_data); - void HandleCalendarUpdateEvent(WorldPacket& recv_data); - void HandleCalendarRemoveEvent(WorldPacket& recv_data); - void HandleCalendarCopyEvent(WorldPacket& recv_data); - void HandleCalendarEventInvite(WorldPacket& recv_data); - void HandleCalendarEventRsvp(WorldPacket& recv_data); - void HandleCalendarEventRemoveInvite(WorldPacket& recv_data); - void HandleCalendarEventStatus(WorldPacket& recv_data); - void HandleCalendarEventModeratorStatus(WorldPacket& recv_data); - void HandleCalendarComplain(WorldPacket& recv_data); - void HandleCalendarGetNumPending(WorldPacket& recv_data); - void HandleCalendarEventSignup(WorldPacket& recv_data); + void HandleCalendarGetCalendar(WorldPacket& recvData); + void HandleCalendarGetEvent(WorldPacket& recvData); + void HandleCalendarGuildFilter(WorldPacket& recvData); + void HandleCalendarArenaTeam(WorldPacket& recvData); + void HandleCalendarAddEvent(WorldPacket& recvData); + void HandleCalendarUpdateEvent(WorldPacket& recvData); + void HandleCalendarRemoveEvent(WorldPacket& recvData); + void HandleCalendarCopyEvent(WorldPacket& recvData); + void HandleCalendarEventInvite(WorldPacket& recvData); + void HandleCalendarEventRsvp(WorldPacket& recvData); + void HandleCalendarEventRemoveInvite(WorldPacket& recvData); + void HandleCalendarEventStatus(WorldPacket& recvData); + void HandleCalendarEventModeratorStatus(WorldPacket& recvData); + void HandleCalendarComplain(WorldPacket& recvData); + void HandleCalendarGetNumPending(WorldPacket& recvData); + void HandleCalendarEventSignup(WorldPacket& recvData); void SendCalendarEvent(CalendarEvent const& calendarEvent, CalendarSendEventType sendEventType); void SendCalendarEventInvite(CalendarInvite const& invite, bool pending); void SendCalendarEventInviteAlert(CalendarEvent const& calendarEvent, CalendarInvite const& calendarInvite); - void SendCalendarEventInviteRemove(CalendarInvite const& invite, CalendarFlags flags); + void SendCalendarEventInviteRemove(CalendarInvite const& invite, uint32 flags); void SendCalendarEventInviteRemoveAlert(CalendarEvent const& calendarEvent, CalendarInviteStatus status); void SendCalendarEventRemovedAlert(CalendarEvent const& calendarEvent); void SendCalendarEventUpdateAlert(CalendarEvent const& calendarEvent, CalendarSendEventType sendEventType); From 0f1bd50ae02cd79b6430a15fe5fb9390b13eb43d Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 25 Feb 2012 05:28:22 +0000 Subject: [PATCH 0029/1149] Core/Calendar: Holiday.dbc -> SMSG_CALENDAR_SEND_CALENDAR --- src/server/game/DataStores/DBCStructure.h | 18 ++++----- src/server/game/DataStores/DBCfmt.h | 2 +- src/server/game/Handlers/CalendarHandler.cpp | 41 +++++++++++--------- 3 files changed, 33 insertions(+), 28 deletions(-) diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index adb7f0ac380..128ae553700 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1068,17 +1068,17 @@ struct HolidayNamesEntry struct HolidaysEntry { - uint32 ID; // 0 m_ID - //uint32 duration[10]; // 1-10 m_duration - //uint32 date[26]; // 11-36 m_date (dates in unix time starting at January, 1, 2000) - //uint32 region; // 37 m_region (wow region) - //uint32 looping; // 38 m_looping - //uint32 calendarFlags[10]; // 39-48 m_calendarFlags + uint32 Id; // 0 m_ID + uint32 Duration[10]; // 1-10 m_duration + uint32 Date[26]; // 11-36 m_date (dates in unix time starting at January, 1, 2000) + uint32 Region; // 37 m_region (wow region) + uint32 Looping; // 38 m_looping + uint32 CalendarFlags[10]; // 39-48 m_calendarFlags //uint32 holidayNameId; // 49 m_holidayNameID (HolidayNames.dbc) //uint32 holidayDescriptionId; // 50 m_holidayDescriptionID (HolidayDescriptions.dbc) - //char *textureFilename; // 51 m_textureFilename - //uint32 priority; // 52 m_priority - //uint32 calendarFilterType; // 53 m_calendarFilterType (-1 = Fishing Contest, 0 = Unk, 1 = Darkmoon Festival, 2 = Yearly holiday) + char* TextureFilename; // 51 m_textureFilename + uint32 Priority; // 52 m_priority + uint32 CalendarFilterType; // 53 m_calendarFilterType (-1 = Fishing Contest, 0 = Unk, 1 = Darkmoon Festival, 2 = Yearly holiday) //uint32 flags; // 54 m_flags (0 = Darkmoon Faire, Fishing Contest and Wotlk Launch, rest is 1) }; diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 150159feb11..54be02a619e 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -67,7 +67,7 @@ const char GtOCTRegenHPfmt[]="f"; //const char GtOCTRegenMPfmt[]="f"; const char GtRegenHPPerSptfmt[]="f"; const char GtRegenMPPerSptfmt[]="f"; -const char Holidaysfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +const char Holidaysfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiixxsiix"; const char Itemfmt[]="niiiiiii"; const char ItemBagFamilyfmt[]="nxxxxxxxxxxxxxxxxx"; //const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx"; diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index b5bff0e710a..294e669fd18 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -153,26 +153,31 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/) data.put(p_counter, counter); - data << uint32(0); // holiday count? - /* - for (;;) + + // TODO: Fix this, how we do know how many and what holidays to send? + uint32 holidayCount = 0; + data << uint32(holidayCount); + for (uint32 i = 0; i < holidayCount; ++i) { - uint32 unk5, unk6, unk7, unk8, unk9; - for (uint32 j = 0; j < 26; ++j) - { - uint32 unk10; - } - for (uint32 j = 0; j < 10; ++j) - { - uint32 unk11; - } - for (uint32 j = 0; j < 10; ++j) - { - uint32 unk12; - } - std::string holidayName; // 64 chars + HolidaysEntry const* holiday = sHolidaysStore.LookupEntry(666); + + data << uint32(holiday->Id); // m_ID + data << uint32(holiday->Region); // m_region, might be looping + data << uint32(holiday->Looping); // m_looping, might be region + data << uint32(holiday->Priority); // m_priority + data << uint32(holiday->CalendarFilterType); // m_calendarFilterType + + for (uint8 j = 0; j < sizeof(holiday->Date)/sizeof(holiday->Date[0]; ++j) + data << uint32(holiday->Date[j]); // 26 * m_date + + for (uint8 j = 0; j < sizeof(holiday->Duration)/sizeof(holiday->Duration[0]; ++j) + data << uint32(holiday->Duration[j]); // 10 * m_duration + + for (uint8 j = 0; j < sizeof(holiday->CalendarFlags)/sizeof(holiday->CalendarFlags[0]; ++j) + data << uint32(holiday->CalendarFlags[j]); // 10 * m_calendarFlags + + data << holiday->TextureFilename.c_str(); // m_textureFilename (holiday name) } - */ SendPacket(&data); } From 7885e2066af75095b21f9186c537ec8f69ab4226 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 25 Feb 2012 05:33:27 +0000 Subject: [PATCH 0030/1149] Copy-paste typos in previous commit (0f1bd50) :( --- src/server/game/Handlers/CalendarHandler.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 294e669fd18..bbf8433ad22 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -167,16 +167,16 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/) data << uint32(holiday->Priority); // m_priority data << uint32(holiday->CalendarFilterType); // m_calendarFilterType - for (uint8 j = 0; j < sizeof(holiday->Date)/sizeof(holiday->Date[0]; ++j) + for (uint8 j = 0; j < sizeof(holiday->Date)/sizeof(holiday->Date[0]); ++j) data << uint32(holiday->Date[j]); // 26 * m_date - for (uint8 j = 0; j < sizeof(holiday->Duration)/sizeof(holiday->Duration[0]; ++j) + for (uint8 j = 0; j < sizeof(holiday->Duration)/sizeof(holiday->Duration[0]); ++j) data << uint32(holiday->Duration[j]); // 10 * m_duration - for (uint8 j = 0; j < sizeof(holiday->CalendarFlags)/sizeof(holiday->CalendarFlags[0]; ++j) + for (uint8 j = 0; j < sizeof(holiday->CalendarFlags)/sizeof(holiday->CalendarFlags[0]); ++j) data << uint32(holiday->CalendarFlags[j]); // 10 * m_calendarFlags - data << holiday->TextureFilename.c_str(); // m_textureFilename (holiday name) + data << holiday->TextureFilename; // m_textureFilename (holiday name) } SendPacket(&data); From 6ce46624d29b28ad8e22f5b7893c28b8536451cb Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 25 Feb 2012 11:14:19 +0100 Subject: [PATCH 0031/1149] Core/Calendar: Fixed crash happening when inviting an offline player to an event --- src/server/shared/Database/Implementation/CharacterDatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index fe276b26738..125c4509b18 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -43,7 +43,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_PET_ENTRY, "SELECT entry FROM character_pet WHERE owner = ? AND id = ? AND slot >= ? AND slot <= ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_PET_SLOT_BY_ID, "SELECT slot, entry FROM character_pet WHERE owner = ? AND id = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_FREE_NAME, "SELECT guid, name FROM characters WHERE guid = ? AND account = ? AND (at_login & ?) = ? AND NOT EXISTS (SELECT NULL FROM characters WHERE name = ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_SEL_GUID_RACE_ACC_BY_NAME, "SELECT guid, race, account FROM characters WHERE name = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_SEL_GUID_RACE_ACC_BY_NAME, "SELECT guid, race, account FROM characters WHERE name = ?", CONNECTION_BOTH); PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_DAILY, "DELETE FROM character_queststatus_daily", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_WEEKLY, "DELETE FROM character_queststatus_weekly", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_SEASONAL, "DELETE FROM character_queststatus_seasonal WHERE event = ?", CONNECTION_ASYNC); From 1f373c0f3749e2c62ccdc3d19f2a753773e147c3 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 25 Feb 2012 11:42:00 +0100 Subject: [PATCH 0032/1149] Scripts/Icecrown Citadel: Removed obsolete workaround for Ice Tomb LoS --- ...2012_02_25_00_world_spell_script_names.sql | 1 + src/server/game/Handlers/CalendarHandler.cpp | 2 +- .../IcecrownCitadel/boss_sindragosa.cpp | 58 ------------------- 3 files changed, 2 insertions(+), 59 deletions(-) create mode 100644 sql/updates/world/2012_02_25_00_world_spell_script_names.sql diff --git a/sql/updates/world/2012_02_25_00_world_spell_script_names.sql b/sql/updates/world/2012_02_25_00_world_spell_script_names.sql new file mode 100644 index 00000000000..9619121e982 --- /dev/null +++ b/sql/updates/world/2012_02_25_00_world_spell_script_names.sql @@ -0,0 +1 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_sindragosa_collision_filter'; diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index bbf8433ad22..12c0b571b38 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -892,4 +892,4 @@ void WorldSession::SendCalendarRaidLockout(InstanceSave* save, bool add) data << uint32(save->GetResetTime() - currTime); data << uint64(save->GetInstanceId()); SendPacket(&data); -} \ No newline at end of file +} diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index a544f2f4710..01879240e3a 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -1198,63 +1198,6 @@ class spell_sindragosa_ice_tomb : public SpellScriptLoader } }; -class FrostBombTargetSelector -{ - public: - FrostBombTargetSelector(Unit* caster, std::list const& collisionList) : _caster(caster), _collisionList(collisionList) { } - - bool operator()(Unit* unit) - { - if (unit->HasAura(SPELL_ICE_TOMB_DAMAGE)) - return true; - - for (std::list::const_iterator itr = _collisionList.begin(); itr != _collisionList.end(); ++itr) - if ((*itr)->IsInBetween(_caster, unit)) - return true; - - return false; - } - - private: - Unit* _caster; - std::list const& _collisionList; -}; - -class spell_sindragosa_collision_filter : public SpellScriptLoader -{ - public: - spell_sindragosa_collision_filter() : SpellScriptLoader("spell_sindragosa_collision_filter") { } - - class spell_sindragosa_collision_filter_SpellScript : public SpellScript - { - PrepareSpellScript(spell_sindragosa_collision_filter_SpellScript); - - bool Validate(SpellInfo const* /*spell*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_ICE_TOMB_DAMAGE)) - return false; - return true; - } - - void FilterTargets(std::list& unitList) - { - std::list tombs; - GetCreatureListWithEntryInGrid(tombs, GetCaster(), NPC_ICE_TOMB, 200.0f); - unitList.remove_if (FrostBombTargetSelector(GetCaster(), tombs)); - } - - void Register() - { - OnUnitTargetSelect += SpellUnitTargetFn(spell_sindragosa_collision_filter_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_sindragosa_collision_filter_SpellScript(); - } -}; - class spell_sindragosa_icy_grip : public SpellScriptLoader { public: @@ -1513,7 +1456,6 @@ void AddSC_boss_sindragosa() new spell_sindragosa_instability(); new spell_sindragosa_frost_beacon(); new spell_sindragosa_ice_tomb(); - new spell_sindragosa_collision_filter(); new spell_sindragosa_icy_grip(); new spell_rimefang_icy_blast(); new spell_frostwarden_handler_order_whelp(); From b7b37dca298682a44cd1d0c635e0bf40476eefb6 Mon Sep 17 00:00:00 2001 From: QAston Date: Sat, 25 Feb 2012 11:52:28 +0100 Subject: [PATCH 0033/1149] Core/Spells: send spell error messages on spell cast condition checks. --- src/server/game/Spells/Spell.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index db36eb30191..b8d3c5318aa 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4785,11 +4785,16 @@ SpellCastResult Spell::CheckCast(bool strict) // TODO: using WorldSession::SendNotification is not blizzlike if (Player* playerCaster = m_caster->ToPlayer()) { - if (playerCaster->GetSession() && condInfo.mLastFailedCondition + if (playerCaster->GetSession() && condInfo.mLastFailedCondition->ErrorTextId) + { playerCaster->GetSession()->SendNotification(condInfo.mLastFailedCondition->ErrorTextId); + return SPELL_FAILED_DONT_REPORT; + } } - return SPELL_FAILED_DONT_REPORT; + if (!condInfo.mLastFailedCondition->ConditionTarget) + return SPELL_FAILED_CASTER_AURASTATE; + return SPELL_FAILED_BAD_TARGETS; } } From c952c7f98f847f3820c97a7c75fcc77d6263965d Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 25 Feb 2012 07:26:01 -0330 Subject: [PATCH 0034/1149] Scripts/go_black_cage: Remove script replaced by SAI. --- src/server/scripts/World/go_scripts.cpp | 39 ------------------------- 1 file changed, 39 deletions(-) diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 3dfc85d7eb4..541c3e2e7ec 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -44,7 +44,6 @@ go_ethereal_teleport_pad go_soulwell go_dragonflayer_cage go_tadpole_cage -go_black_cage go_amberpine_outhouse go_hive_pod go_gjalerbron_cage @@ -1078,43 +1077,6 @@ public: } }; -/*###### -## Quest 14096 & 14142: You've Really Done It This Time, Kul -## go_black_cage -######*/ - -enum eReallyDoneItThisTime -{ - QUEST_ALLIANCE_YOU_VE_REALLY_DONE_IT_THIS_TIME_KUL = 14096, - QUEST_HORDE_YOU_VE_REALLY_DONE_IT_THIS_TIME_KUL = 14142, - NPC_CAPTIVE_ASPIRANT = 34716, - NPC_KUL = 34956 -}; - -class go_black_cage : public GameObjectScript -{ -public: - go_black_cage() : GameObjectScript("go_black_cage") { } - - bool OnGossipHello(Player* player, GameObject* pGO) - { - if ((player->GetTeamId() == TEAM_ALLIANCE && player->GetQuestStatus(QUEST_ALLIANCE_YOU_VE_REALLY_DONE_IT_THIS_TIME_KUL) == QUEST_STATUS_INCOMPLETE) || - (player->GetTeamId() == TEAM_HORDE && player->GetQuestStatus(QUEST_HORDE_YOU_VE_REALLY_DONE_IT_THIS_TIME_KUL) == QUEST_STATUS_INCOMPLETE)) - { - Creature* pPrisoner = pGO->FindNearestCreature(NPC_CAPTIVE_ASPIRANT, 1.0f); - if (!pPrisoner) - pPrisoner = pGO->FindNearestCreature(NPC_KUL, 1.0f); - if (pPrisoner) - { - pGO->UseDoorOrButton(); - pPrisoner->DisappearAndDie(); - player->KilledMonsterCredit(pPrisoner->GetEntry(), 0); - } - } - return true; - } -}; - /*###### ## go_amberpine_outhouse ######*/ @@ -1352,7 +1314,6 @@ void AddSC_go_scripts() new go_soulwell; new go_tadpole_cage; new go_dragonflayer_cage; - new go_black_cage; new go_amberpine_outhouse; new go_hive_pod; new go_massive_seaforium_charge; From a0de042efe0cf7f5d32f6a329e5eeccc75fe57ae Mon Sep 17 00:00:00 2001 From: QAston Date: Sat, 25 Feb 2012 14:05:47 +0100 Subject: [PATCH 0035/1149] Core/Spells: Remove SpellSelectTargetTypes enum - it's not needed anymore. --- src/server/game/Entities/Unit/Unit.cpp | 7 +- src/server/game/Spells/Spell.cpp | 13 +-- src/server/game/Spells/SpellEffects.cpp | 2 +- src/server/game/Spells/SpellInfo.cpp | 143 ------------------------ src/server/game/Spells/SpellInfo.h | 24 ---- 5 files changed, 6 insertions(+), 183 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f9d287d271a..f006b4c07c0 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13903,12 +13903,7 @@ void CharmInfo::InitCharmCreateSpells() newstate = ACT_PASSIVE; else { - bool autocast = false; - for (uint32 i = 0; i < MAX_SPELL_EFFECTS && !autocast; ++i) - if (spellInfo->Effects[i].TargetA.GetType() == TARGET_TYPE_UNIT_TARGET) - autocast = true; - - if (autocast) + if (spellInfo->NeedsExplicitUnitTarget()) { newstate = ACT_ENABLED; ToggleCreatureAutocast(spellInfo, true); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index b8d3c5318aa..e2cd360b844 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5548,16 +5548,11 @@ SpellCastResult Spell::CheckPetCast(Unit* target) if (!target && m_targets.GetUnitTarget()) target = m_targets.GetUnitTarget(); - for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if (m_spellInfo->NeedsExplicitUnitTarget()) { - if (m_spellInfo->Effects[i].TargetA.GetType() == TARGET_TYPE_UNIT_TARGET - || m_spellInfo->Effects[i].TargetA.GetType() == TARGET_TYPE_DEST_TARGET) - { - if (!target) - return SPELL_FAILED_BAD_IMPLICIT_TARGETS; - m_targets.SetUnitTarget(target); - break; - } + if (!target) + return SPELL_FAILED_BAD_IMPLICIT_TARGETS; + m_targets.SetUnitTarget(target); } // cooldown diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 407ddbf6b21..2f04099f86b 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1031,7 +1031,7 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex) SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id); if (!spellInfo) { - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTriggerSpell spell %u tried to trigger unknown spell %u", m_spellInfo->Id, triggered_spell_id); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTriggerMissileSpell spell %u tried to trigger unknown spell %u", m_spellInfo->Id, triggered_spell_id); return; } diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 3365aad1cd9..626e0a3653e 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -61,11 +61,6 @@ bool SpellImplicitTargetInfo::IsArea() const return GetSelectionCategory() == TARGET_SELECT_CATEGORY_AREA || GetSelectionCategory() == TARGET_SELECT_CATEGORY_CONE; } -SpellSelectTargetTypes SpellImplicitTargetInfo::GetType() const -{ - return Type[_target]; -} - SpellTargetSelectionCategories SpellImplicitTargetInfo::GetSelectionCategory() const { return _data[_target].SelectionCategory; @@ -207,144 +202,6 @@ uint32 SpellImplicitTargetInfo::GetExplicitTargetMask(bool& srcSet, bool& dstSet return targetMask; } -bool SpellImplicitTargetInfo::InitStaticData() -{ - InitTypeData(); - return true; -} - -void SpellImplicitTargetInfo::InitTypeData() -{ - for (uint8 i = 0; i < TOTAL_SPELL_TARGETS; ++i) - { - switch (i) - { - case TARGET_UNIT_CASTER: - case TARGET_DEST_CASTER_FISHING: - case TARGET_UNIT_MASTER: - case TARGET_UNIT_PET: - case TARGET_UNIT_CASTER_AREA_PARTY: - case TARGET_UNIT_CASTER_AREA_RAID: - case TARGET_UNIT_VEHICLE: - case TARGET_UNIT_PASSENGER_0: - case TARGET_UNIT_PASSENGER_1: - case TARGET_UNIT_PASSENGER_2: - case TARGET_UNIT_PASSENGER_3: - case TARGET_UNIT_PASSENGER_4: - case TARGET_UNIT_PASSENGER_5: - case TARGET_UNIT_PASSENGER_6: - case TARGET_UNIT_PASSENGER_7: - case TARGET_UNIT_SUMMONER: - Type[i] = TARGET_TYPE_UNIT_CASTER; - break; - case TARGET_UNIT_TARGET_MINIPET: - case TARGET_UNIT_TARGET_ALLY: - case TARGET_UNIT_TARGET_RAID: - case TARGET_UNIT_TARGET_ANY: - case TARGET_UNIT_TARGET_ENEMY: - case TARGET_UNIT_TARGET_PARTY: - case TARGET_UNIT_TARGET_PASSENGER: - case TARGET_UNIT_LASTTARGET_AREA_PARTY: - case TARGET_UNIT_TARGET_AREA_RAID_CLASS: - case TARGET_UNIT_TARGET_CHAINHEAL_ALLY: - Type[i] = TARGET_TYPE_UNIT_TARGET; - break; - case TARGET_UNIT_NEARBY_ENEMY: - case TARGET_UNIT_NEARBY_ALLY: - case TARGET_UNIT_NEARBY_ENTRY: - case TARGET_UNIT_NEARBY_PARTY: - case TARGET_UNIT_NEARBY_RAID: - case TARGET_GAMEOBJECT_NEARBY_ENTRY: - Type[i] = TARGET_TYPE_UNIT_NEARBY; - break; - case TARGET_UNIT_SRC_AREA_ENEMY: - case TARGET_UNIT_SRC_AREA_ALLY: - case TARGET_UNIT_SRC_AREA_ENTRY: - case TARGET_UNIT_SRC_AREA_PARTY: - case TARGET_GAMEOBJECT_SRC_AREA: - Type[i] = TARGET_TYPE_AREA_SRC; - break; - case TARGET_UNIT_DEST_AREA_ENEMY: - case TARGET_UNIT_DEST_AREA_ALLY: - case TARGET_UNIT_DEST_AREA_ENTRY: - case TARGET_UNIT_DEST_AREA_PARTY: - case TARGET_GAMEOBJECT_DEST_AREA: - Type[i] = TARGET_TYPE_AREA_DST; - break; - case TARGET_UNIT_CONE_ENEMY_24: - case TARGET_UNIT_CONE_ALLY: - case TARGET_UNIT_CONE_ENTRY: - case TARGET_UNIT_CONE_ENEMY_54: - case TARGET_UNIT_CONE_ENEMY_104: - case TARGET_GAMEOBJECT_CONE: - Type[i] = TARGET_TYPE_AREA_CONE; - break; - case TARGET_DEST_CASTER: - case TARGET_SRC_CASTER: - case TARGET_DEST_CASTER_SUMMON: - case TARGET_DEST_CASTER_FRONT_LEAP: - case TARGET_DEST_CASTER_FRONT: - case TARGET_DEST_CASTER_BACK: - case TARGET_DEST_CASTER_RIGHT: - case TARGET_DEST_CASTER_LEFT: - case TARGET_DEST_CASTER_FRONT_LEFT: - case TARGET_DEST_CASTER_BACK_LEFT: - case TARGET_DEST_CASTER_BACK_RIGHT: - case TARGET_DEST_CASTER_FRONT_RIGHT: - case TARGET_DEST_CASTER_RANDOM: - case TARGET_DEST_CASTER_RADIUS: - Type[i] = TARGET_TYPE_DEST_CASTER; - break; - case TARGET_DEST_TARGET_ENEMY: - case TARGET_DEST_TARGET_ANY: - case TARGET_DEST_TARGET_FRONT: - case TARGET_DEST_TARGET_BACK: - case TARGET_DEST_TARGET_RIGHT: - case TARGET_DEST_TARGET_LEFT: - case TARGET_DEST_TARGET_FRONT_LEFT: - case TARGET_DEST_TARGET_BACK_LEFT: - case TARGET_DEST_TARGET_BACK_RIGHT: - case TARGET_DEST_TARGET_FRONT_RIGHT: - case TARGET_DEST_TARGET_RANDOM: - case TARGET_DEST_TARGET_RADIUS: - Type[i] = TARGET_TYPE_DEST_TARGET; - break; - case TARGET_DEST_DYNOBJ_ENEMY: - case TARGET_DEST_DYNOBJ_ALLY: - case TARGET_DEST_DYNOBJ_NONE: - case TARGET_DEST_DEST: - case TARGET_DEST_TRAJ: - case TARGET_DEST_DEST_FRONT_LEFT: - case TARGET_DEST_DEST_BACK_LEFT: - case TARGET_DEST_DEST_BACK_RIGHT: - case TARGET_DEST_DEST_FRONT_RIGHT: - case TARGET_DEST_DEST_FRONT: - case TARGET_DEST_DEST_BACK: - case TARGET_DEST_DEST_RIGHT: - case TARGET_DEST_DEST_LEFT: - case TARGET_DEST_DEST_RANDOM: - case TARGET_DEST_DEST_RADIUS: - Type[i] = TARGET_TYPE_DEST_DEST; - break; - case TARGET_DEST_DB: - case TARGET_DEST_HOME: - case TARGET_DEST_NEARBY_ENTRY: - Type[i] = TARGET_TYPE_DEST_SPECIAL; - break; - case TARGET_UNIT_CHANNEL_TARGET: - case TARGET_DEST_CHANNEL_TARGET: - case TARGET_DEST_CHANNEL_CASTER: - Type[i] = TARGET_TYPE_CHANNEL; - break; - default: - Type[i] = TARGET_TYPE_DEFAULT; - } - } -} - -bool SpellImplicitTargetInfo::Init = SpellImplicitTargetInfo::InitStaticData(); -SpellSelectTargetTypes SpellImplicitTargetInfo::Type[TOTAL_SPELL_TARGETS]; - SpellImplicitTargetInfo::StaticData SpellImplicitTargetInfo::_data[TOTAL_SPELL_TARGETS] = { {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 69ea07f7563..9c33db7f708 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -133,22 +133,6 @@ enum SpellTargetDirectionTypes TARGET_DIR_ENTRY, }; -enum SpellSelectTargetTypes -{ - TARGET_TYPE_DEFAULT, - TARGET_TYPE_UNIT_CASTER, - TARGET_TYPE_UNIT_TARGET, - TARGET_TYPE_UNIT_NEARBY, - TARGET_TYPE_AREA_SRC, - TARGET_TYPE_AREA_DST, - TARGET_TYPE_AREA_CONE, - TARGET_TYPE_DEST_CASTER, - TARGET_TYPE_DEST_TARGET, - TARGET_TYPE_DEST_DEST, - TARGET_TYPE_DEST_SPECIAL, - TARGET_TYPE_CHANNEL, -}; - enum SpellEffectImplicitTargetTypes { EFFECT_IMPLICIT_TARGET_NONE = 0, @@ -218,7 +202,6 @@ public: SpellImplicitTargetInfo(uint32 target); bool IsArea() const; - SpellSelectTargetTypes GetType() const; SpellTargetSelectionCategories GetSelectionCategory() const; SpellTargetReferenceTypes GetReferenceType() const; SpellTargetObjectTypes GetObjectType() const; @@ -229,14 +212,7 @@ public: Targets GetTarget() const; uint32 GetExplicitTargetMask(bool& srcSet, bool& dstSet) const; - // temporarily avalible to public - static SpellSelectTargetTypes Type[TOTAL_SPELL_TARGETS]; private: - static bool InitStaticData(); - static void InitTypeData(); - - static bool Init; - struct StaticData { SpellTargetObjectTypes ObjectType; // type of object returned by target type From 7b2672b17b1961817ba2420ce158f034def18666 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 25 Feb 2012 15:32:55 +0100 Subject: [PATCH 0036/1149] Core/Calendar: Fix compile without PCH --- src/server/game/Calendar/Calendar.cpp | 1 + src/server/game/Handlers/CalendarHandler.cpp | 2 +- src/server/game/Server/WorldSession.h | 26 ++++++++++---------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/server/game/Calendar/Calendar.cpp b/src/server/game/Calendar/Calendar.cpp index 3d6eef2cbab..139e63614cc 100755 --- a/src/server/game/Calendar/Calendar.cpp +++ b/src/server/game/Calendar/Calendar.cpp @@ -16,6 +16,7 @@ * with this program. If not, see . */ +#include "Player.h" #include "Calendar.h" std::string CalendarInvite::GetDebugString() const diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 12c0b571b38..f995ea3e9cf 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -875,7 +875,7 @@ void WorldSession::SendCalendarCommandResult(CalendarError err, char const* para SendPacket(&data); } -void WorldSession::SendCalendarRaidLockout(InstanceSave* save, bool add) +void WorldSession::SendCalendarRaidLockout(InstanceSave const* save, bool add) { sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", add ? "SMSG_CALENDAR_RAID_LOCKOUT_ADDED" : "SMSG_CALENDAR_RAID_LOCKOUT_REMOVED"); time_t currTime = time(NULL); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 703c37c35a8..a18067ff612 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -31,24 +31,25 @@ #include "WorldPacket.h" #include "Cryptography/BigNumber.h" -struct ItemTemplate; -struct AuctionEntry; -struct DeclinedName; -struct MovementInfo; - +class CalendarEvent; +class CalendarInvite; class Creature; +class GameObject; +class InstanceSave; class Item; +class LoginQueryHolder; class Object; class Player; -class Unit; -class GameObject; class Quest; +class SpellCastTargets; +class Unit; +class Warden; class WorldPacket; class WorldSocket; -class LoginQueryHolder; -class SpellCastTargets; -class Warden; struct AreaTableEntry; +struct AuctionEntry; +struct DeclinedName; +struct ItemTemplate; struct LfgJoinResultData; struct LfgLockStatus; struct LfgPlayerBoot; @@ -56,8 +57,7 @@ struct LfgProposal; struct LfgReward; struct LfgRoleCheck; struct LfgUpdateData; -class CalendarEvent; -class CalendarInvite; +struct MovementInfo; enum AccountDataType { @@ -892,7 +892,7 @@ class WorldSession void SendCalendarEventStatus(CalendarEvent const& calendarEvent, CalendarInvite const& invite); void SendCalendarEventModeratorStatusAlert(CalendarInvite const& invite); void SendCalendarClearPendingAction(); - void SendCalendarRaidLockout(InstanceSave* save, bool add); + void SendCalendarRaidLockout(InstanceSave const* save, bool add); void SendCalendarRaidLockoutUpdated(InstanceSave const* save); void SendCalendarCommandResult(CalendarError err, char const* param = NULL); From 5c00e93602e7afc0ad54713d16f2eb012751cc8d Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 25 Feb 2012 16:56:25 +0100 Subject: [PATCH 0037/1149] Core/Commands: Added lost group commands --- sql/updates/world/2012_02_25_01_world_command.sql | 6 ++++++ src/server/game/Chat/Chat.cpp | 11 ++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 sql/updates/world/2012_02_25_01_world_command.sql diff --git a/sql/updates/world/2012_02_25_01_world_command.sql b/sql/updates/world/2012_02_25_01_world_command.sql new file mode 100644 index 00000000000..de708b7a9cc --- /dev/null +++ b/sql/updates/world/2012_02_25_01_world_command.sql @@ -0,0 +1,6 @@ +DELETE FROM `command` WHERE `name` IN ('group','group leader','group disband','group remove'); +INSERT INTO `command` (`name`,`security`,`help`) VALUES +('group', 3, 'Syntax: .group $subcommand\nType .group to see the list of possible subcommands or .help group $subcommand to see info on subcommands'), +('group leader', 3, 'Syntax: .group leader [$characterName]\n\nSets the given character as his group''s leader.'), +('group disband', 3, 'Syntax: .group disband [$characterName]\n\nDisbands the given character''s group.'), +('group remove', 3, 'Syntax: .group remove [$characterName]\n\nRemoves the given character from his group.'); diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 035fbaf5b78..a6596de25d6 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -140,10 +140,10 @@ ChatCommand* ChatHandler::getCommandTable() static ChatCommand groupCommandTable[] = { - { "leader", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGroupLeaderCommand>, "", NULL }, - { "disband", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGroupDisbandCommand>, "", NULL }, - { "remove", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGroupRemoveCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "leader", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGroupLeaderCommand>, "", NULL }, + { "disband", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGroupDisbandCommand>, "", NULL }, + { "remove", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGroupRemoveCommand>, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand guildCommandTable[] = @@ -281,7 +281,7 @@ ChatCommand* ChatHandler::getCommandTable() { "corpses", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleServerCorpsesCommand>, "", NULL }, { "exit", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerExitCommand>, "", NULL }, { "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable }, - { "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable }, + { "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverIdleShutdownCommandTable }, { "info", SEC_PLAYER, true, OldHandler<&ChatHandler::HandleServerInfoCommand>, "", NULL }, { "motd", SEC_PLAYER, true, OldHandler<&ChatHandler::HandleServerMotdCommand>, "", NULL }, { "plimit", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerPLimitCommand>, "", NULL }, @@ -336,6 +336,7 @@ ChatCommand* ChatHandler::getCommandTable() { "lookup", SEC_ADMINISTRATOR, true, NULL, "", lookupCommandTable }, { "pdump", SEC_ADMINISTRATOR, true, NULL, "", pdumpCommandTable }, { "guild", SEC_ADMINISTRATOR, true, NULL, "", guildCommandTable }, + { "group", SEC_ADMINISTRATOR, false, NULL, "", groupCommandTable }, { "cast", SEC_ADMINISTRATOR, false, NULL, "", castCommandTable }, { "reset", SEC_ADMINISTRATOR, true, NULL, "", resetCommandTable }, { "instance", SEC_ADMINISTRATOR, true, NULL, "", instanceCommandTable }, From a813e6f579a33910cd691d02f9bb86d7a3b789ab Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 25 Feb 2012 16:17:08 +0000 Subject: [PATCH 0038/1149] Core/Calendar: Use defines when sending holiday data Update some comments --- src/server/game/DataStores/DBCStructure.h | 6 ++-- src/server/game/Handlers/CalendarHandler.cpp | 28 +++++++++++-------- src/server/game/Miscellaneous/SharedDefines.h | 4 +++ 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 128ae553700..75a6b71d943 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1069,11 +1069,11 @@ struct HolidayNamesEntry struct HolidaysEntry { uint32 Id; // 0 m_ID - uint32 Duration[10]; // 1-10 m_duration - uint32 Date[26]; // 11-36 m_date (dates in unix time starting at January, 1, 2000) + uint32 Duration[10]; // 1-10 m_duration (MAX_HOLIDAY_DURATIONS) + uint32 Date[26]; // 11-36 m_date (dates in unix time starting at January, 1, 2000) (MAX_HOLIDAY_DATES) uint32 Region; // 37 m_region (wow region) uint32 Looping; // 38 m_looping - uint32 CalendarFlags[10]; // 39-48 m_calendarFlags + uint32 CalendarFlags[10]; // 39-48 m_calendarFlags (MAX_HOLIDAY_FLAGS) //uint32 holidayNameId; // 49 m_holidayNameID (HolidayNames.dbc) //uint32 holidayDescriptionId; // 50 m_holidayDescriptionID (HolidayDescriptions.dbc) char* TextureFilename; // 51 m_textureFilename diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index f995ea3e9cf..467a84be186 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -20,7 +20,7 @@ ----- Opcodes Not Used yet ----- SMSG_CALENDAR_CLEAR_PENDING_ACTION SendCalendarClearPendingAction() -SMSG_CALENDAR_RAID_LOCKOUT_UPDATED SendCalendarRaildLockoutUpdated(InstanceSave const* save) <--- Structure unknown, using LOCKOUT_ADDED +SMSG_CALENDAR_RAID_LOCKOUT_UPDATED SendCalendarRaidLockoutUpdated(InstanceSave const* save) <--- Structure unknown, using LOCKOUT_ADDED ----- Opcodes without Sniffs ----- SMSG_CALENDAR_FILTER_GUILD [ for (... uint32(count) { packguid(???), uint8(???) } ] @@ -150,10 +150,8 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/) data << uint32(mapEntry->unk_time); ++counter; } - data.put(p_counter, counter); - // TODO: Fix this, how we do know how many and what holidays to send? uint32 holidayCount = 0; data << uint32(holidayCount); @@ -167,13 +165,13 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/) data << uint32(holiday->Priority); // m_priority data << uint32(holiday->CalendarFilterType); // m_calendarFilterType - for (uint8 j = 0; j < sizeof(holiday->Date)/sizeof(holiday->Date[0]); ++j) + for (uint8 j = 0; j < MAX_HOLIDAY_DATES; ++j) data << uint32(holiday->Date[j]); // 26 * m_date - for (uint8 j = 0; j < sizeof(holiday->Duration)/sizeof(holiday->Duration[0]); ++j) + for (uint8 j = 0; j < MAX_HOLIDAY_DURATIONS; ++j) data << uint32(holiday->Duration[j]); // 10 * m_duration - for (uint8 j = 0; j < sizeof(holiday->CalendarFlags)/sizeof(holiday->CalendarFlags[0]); ++j) + for (uint8 j = 0; j < MAX_HOLIDAY_FLAGS; ++j) data << uint32(holiday->CalendarFlags[j]); // 10 * m_calendarFlags data << holiday->TextureFilename; // m_textureFilename (holiday name) @@ -197,15 +195,23 @@ void WorldSession::HandleCalendarGetEvent(WorldPacket& recvData) void WorldSession::HandleCalendarGuildFilter(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_GUILD_FILTER [" UI64FMTD "]", _player->GetGUID()); - recvData.read_skip(); // unk1 - recvData.read_skip(); // unk2 - recvData.read_skip(); // level + + int32 unk1, unk2, unk3; + recvData >> unk1; + recvData >> unk2; + recvData >> unk3; + + sLog->outDebug(LOG_FILTER_NETWORKIO, "Calendar: CMSG_CALENDAR_GUILD_FILTER - unk1: %d unk2: %d unk3: %d", unk1, unk2, unk3); } void WorldSession::HandleCalendarArenaTeam(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_ARENA_TEAM [" UI64FMTD "]", _player->GetGUID()); - recvData.read_skip(); // unk + + int32 unk1; + recvData >> unk1; + + sLog->outDebug(LOG_FILTER_NETWORKIO, "Calendar: CMSG_CALENDAR_ARENA_TEAM - unk1: %d", unk1); } void WorldSession::HandleCalendarAddEvent(WorldPacket& recvData) @@ -727,7 +733,7 @@ void WorldSession::SendCalendarEventRemovedAlert(CalendarEvent const& calendarEv UI64FMTD "] Time %u", guid, eventId, eventTime); WorldPacket data(SMSG_CALENDAR_EVENT_REMOVED_ALERT, 1 + 8 + 1); - data << uint8(0); // FIXME + data << uint8(1); // FIXME: If true does not SignalEvent(EVENT_CALENDAR_ACTION_PENDING) data << uint64(eventId); data << uint32(eventTime); SendPacket(&data); diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index c404277f61f..369b20252ab 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -3424,6 +3424,10 @@ enum ActivateTaxiReply // Calendar - start +#define MAX_HOLIDAY_DATES 26 +#define MAX_HOLIDAY_FLAGS 10 +#define MAX_HOLIDAY_DURATIONS 10 + enum CalendarFlags { CALENDAR_FLAG_ALL_ALLOWED = 0x001, From 4e1c8e0fa1c117f5400b86df8267f56a0f266239 Mon Sep 17 00:00:00 2001 From: click Date: Sat, 25 Feb 2012 19:41:51 +0100 Subject: [PATCH 0039/1149] Core/Scripts: Fix non-PCH building and linking under GCC --- .../scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index c4f973726bc..aae1995e204 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -26,6 +26,10 @@ #include "ScriptedCreature.h" #include "ScriptedGossip.h" #include "ScriptedEscortAI.h" +#include "Cell.h" +#include "CellImpl.h" +#include "GridNotifiers.h" +#include "GridNotifiersImpl.h" #include "CombatAI.h" #include "PassiveAI.h" #include "ObjectMgr.h" From 63ebdcda5b2a7dbec9b04b50010ea83835d983c0 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 25 Feb 2012 20:23:14 +0100 Subject: [PATCH 0040/1149] Core/Player: Fixed feral AP applying for non-scaling items --- src/server/game/Entities/Player/Player.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index e6afd44e489..4b3c7f9a83a 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7943,10 +7943,19 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply if (CanUseAttackType(attType)) _ApplyWeaponDamage(slot, proto, ssv, apply); - // Apply feral bonus from ScalingStatValue if set - if (ssv && getClass() == CLASS_DRUID) + + // Druids get feral AP bonus from weapon dps (also use DPS from ScalingStatValue) + if (getClass() == CLASS_DRUID) { - int32 feral_bonus = ssv->getFeralBonus(proto->ScalingStatValue) + proto->getFeralBonus(ssv->getDPSMod(proto->ScalingStatValue)); + int32 dpsMod = 0; + int32 feral_bonus = 0; + if (ssv) + { + dpsMod = ssv->getDPSMod(proto->ScalingStatValue); + feral_bonus += ssv->getFeralBonus(proto->ScalingStatValue); + } + + feral_bonus += proto->getFeralBonus(dpsMod); if (feral_bonus) ApplyFeralAPBonus(feral_bonus, apply); } From ca4c5ed5446fd93dac62fe48575d2b6970d03329 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 25 Feb 2012 20:29:27 +0100 Subject: [PATCH 0041/1149] Core/Utils: Fixed random crashes with SFMT caused by wrong memory alignment when operating on SSE instructions (they require 16 byte alignment, while classes and its members are only aligned to 8 byte boundaries) --- dep/SFMT/SFMT.h | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/dep/SFMT/SFMT.h b/dep/SFMT/SFMT.h index 03a7e853316..6c65cd12433 100644 --- a/dep/SFMT/SFMT.h +++ b/dep/SFMT/SFMT.h @@ -39,6 +39,7 @@ #include // Define SSE2 intrinsics #include "randomc.h" // Define integer types etc #include +#include // Choose one of the possible Mersenne exponents. // Higher values give longer cycle length and use more memory: @@ -149,8 +150,14 @@ __m128i const &c, __m128i const &d, __m128i const &mask) { // Class for SFMT generator class SFMTRand { // Encapsulate random number generator + friend class ACE_TSS; + public: - SFMTRand() { LastInterval = 0; RandomInit((int)(time(0))); } + SFMTRand() + { + LastInterval = 0; + RandomInit((int)(time(0))); + } void RandomInit(int seed) // Re-seed { @@ -298,6 +305,46 @@ private: ix = 0; } + void* operator new(size_t size, std::nothrow_t const&) + { + return _mm_malloc(size, 16); + } + + void operator delete(void* ptr, std::nothrow_t const&) + { + _mm_free(ptr); + } + + void* operator new(size_t size) + { + return _mm_malloc(size, 16); + } + + void operator delete(void* ptr) + { + _mm_free(ptr); + } + + void* operator new[](size_t size, std::nothrow_t const&) + { + return _mm_malloc(size, 16); + } + + void operator delete[](void* ptr, std::nothrow_t const&) + { + _mm_free(ptr); + } + + void* operator new[](size_t size) + { + return _mm_malloc(size, 16); + } + + void operator delete[](void* ptr) + { + _mm_free(ptr); + } + uint32_t ix; // Index into state array uint32_t LastInterval; // Last interval length for IRandom uint32_t RLimit; // Rejection limit used by IRandom From bed3fb6d98e6c43c8588318e6baa8c4433da80ac Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 25 Feb 2012 15:59:40 -0330 Subject: [PATCH 0042/1149] DB/SAI: SAI for Quest: 12843 "They Took Our Men!". Remove cpp script. --- sql/updates/world/2012_02_25_02_world_sai.sql | 28 ++++++++++++++++++ src/server/scripts/World/go_scripts.cpp | 29 ------------------- 2 files changed, 28 insertions(+), 29 deletions(-) create mode 100644 sql/updates/world/2012_02_25_02_world_sai.sql diff --git a/sql/updates/world/2012_02_25_02_world_sai.sql b/sql/updates/world/2012_02_25_02_world_sai.sql new file mode 100644 index 00000000000..e2ff99534b4 --- /dev/null +++ b/sql/updates/world/2012_02_25_02_world_sai.sql @@ -0,0 +1,28 @@ +-- Fix for Quest: 12843 "They Took Our Men!" +-- SAI for Rusty Cage +SET @ENTRY=191544; +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY AND `source_type`=1); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY*100 AND `source_type`=9); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,1,0,1,70,0,100,0,2,0,0,0,45,0,1,0,0,0,0,11,29466,5,0,0,0,0,0,'Rusty Cage - On activate - set data on Goblin Prisoner'), +(@ENTRY,1,1,0,61,0,100,0,0,0,0,0,33,29466,0,0,0,0,0,7,0,0,0,0,0,0,0,'Rusty Cage - On activate - quest credit'); +-- SAI for Goblin Prisoner +SET @ENTRY=29466; +UPDATE `creature` SET `modelid`=0,`spawntimesecs`=120,`curhealth`=1 WHERE `id`=29466; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY AND `source_type`=0); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY*100 AND `source_type`=9); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,11,0,100,1,0,0,0,0,32,0,0,0,0,0,0,15,191544,5,0,0,0,0,0,'Goblin Prisoner - On respawn - reset cage'), +(@ENTRY,0,1,0,38,0,100,0,0,1,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Goblin Prisoner - On dataset - Run Script'), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Goblin Prisoner - Script - set data 0'), +(@ENTRY*100,9,1,0,0,0,100,0,1000,1000,1000,1000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Goblin Prisoner - Script - Say random text'), +(@ENTRY*100,9,2,0,0,0,100,0,2000,2000,2000,2000,46,10,0,0,0,0,0,1,0,0,0,0,0,0,0,'Goblin Prisoner - Script - move 10 yards'), +(@ENTRY*100,9,3,0,0,0,100,0,4000,4000,4000,4000,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Goblin Prisoner - Script - despawn'); +-- Goblin Prisoner +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0, 'I can''t believe it! I''m free to go!',12,0,100,5,0,0, 'Goblin Prisoner'), +(@ENTRY,0,1, 'I''m free? I''m free!',12,0,100,5,0,0, 'Goblin Prisoner'), +(@ENTRY,0,2, 'Time to hightail it! Thanks, friend!',12,0,100,5,0,0, 'Goblin Prisoner'); diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 541c3e2e7ec..59ed06788cb 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -34,7 +34,6 @@ go_tablet_of_madness go_tablet_of_the_seven go_tele_to_dalaran_crystal go_tele_to_violet_stand -go_rusty_cage go_scourge_cage go_jotunheim_cage go_table_theka @@ -714,33 +713,6 @@ public: } }; -/*###### -## go_rusty_cage -######*/ - -enum eRustyCage -{ - NPC_GOBLIN_PRISIONER = 29466 -}; - -class go_rusty_cage : public GameObjectScript -{ -public: - go_rusty_cage() : GameObjectScript("go_rusty_cage") { } - - bool OnGossipHello(Player* player, GameObject* pGO) - { - if (Creature* pGoblinPrisoner = pGO->FindNearestCreature(NPC_GOBLIN_PRISIONER, 5.0f, true)) - { - pGO->SetGoState(GO_STATE_ACTIVE); - player->KilledMonsterCredit(NPC_GOBLIN_PRISIONER, pGoblinPrisoner->GetGUID()); - pGoblinPrisoner->DisappearAndDie(); - } - - return true; - } -}; - /*###### ## go_scourge_cage ######*/ @@ -1303,7 +1275,6 @@ void AddSC_go_scripts() new go_fel_crystalforge; new go_bashir_crystalforge; new go_matrix_punchograph; - new go_rusty_cage; new go_scourge_cage; new go_arcane_prison; new go_blood_filled_orb; From e615fba7f8d970eb13265ff0ae181ecab1fff737 Mon Sep 17 00:00:00 2001 From: click Date: Sat, 25 Feb 2012 20:39:28 +0100 Subject: [PATCH 0043/1149] Revert "Core: Fix the SFMT randgen-initbug" - alignment-fix is now properly handled within the respective code This reverts commit 28310f0938a8776d0cb42ba8a64f125cc42bff6b. --- src/server/shared/Utilities/Util.cpp | 5 ----- src/server/shared/Utilities/Util.h | 5 ----- src/server/worldserver/Master.cpp | 4 +--- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/server/shared/Utilities/Util.cpp b/src/server/shared/Utilities/Util.cpp index d3ae82e4ff3..52ce74be8f8 100755 --- a/src/server/shared/Utilities/Util.cpp +++ b/src/server/shared/Utilities/Util.cpp @@ -31,11 +31,6 @@ typedef ACE_TSS SFMTRandTSS; static SFMTRandTSS sfmtRand; -void init_sfmt() -{ - sfmtRand->RandomInit((int)(time(0))); -} - int32 irand(int32 min, int32 max) { return int32(sfmtRand->IRandom(min, max)); diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h index 1a542ff15e1..4c2c1936993 100755 --- a/src/server/shared/Utilities/Util.h +++ b/src/server/shared/Utilities/Util.h @@ -24,11 +24,6 @@ #include #include -#ifdef USE_SFMT_FOR_RNG - // Initialize SFMT before first use, if enabled. - void init_sfmt(); -#endif - // Searcher for map of structs template struct Finder { diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index 892328dcc81..d84cfc1a4a4 100755 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -139,9 +139,7 @@ int Master::Run() #ifdef USE_SFMT_FOR_RNG sLog->outString("\n"); sLog->outString("SFMT has been enabled as the random number generator, if worldserver"); - sLog->outString("freezes or crashes randomly, first, try disabling SFMT in CMAKE configuration."); - sLog->outString("Initializing SFMT before first use."); - init_sfmt(); + sLog->outString("freezes or crashes randomly, first, try disabling SFMT in CMAKE configuration"); sLog->outString("\n"); #endif //USE_SFMT_FOR_RNG From 6f152a1ff896c8e502260ce2fa36f7ccc3bfd0d9 Mon Sep 17 00:00:00 2001 From: click Date: Sat, 25 Feb 2012 21:18:29 +0100 Subject: [PATCH 0044/1149] Core/Scripts: Remove some leftover debugging-output from the warlock spellscripts --- src/server/scripts/Spells/spell_warlock.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index b1aff706db0..1e2e9459ccb 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -327,11 +327,7 @@ class spell_warl_soulshatter : public SpellScriptLoader if (Unit* target = GetHitUnit()) { if (target->CanHaveThreatList() && target->getThreatManager().getThreat(caster) > 0.0f) - { - sLog->outString("THREATREDUCTION"); caster->CastSpell(target, SPELL_SOULSHATTER, true); - } else - sLog->outString("can have threat? %u . threat number? %f ",target->CanHaveThreatList(),target->getThreatManager().getThreat(caster)); } } From e37d9d73a92c5bc48e9b7d98f3d33f3b3c0d70ef Mon Sep 17 00:00:00 2001 From: click Date: Sat, 25 Feb 2012 21:19:05 +0100 Subject: [PATCH 0045/1149] Core/Scripts: Remove script for npc_goblin_prisoner (handled by SAI already) --- src/server/scripts/Northrend/storm_peaks.cpp | 38 -------------------- 1 file changed, 38 deletions(-) diff --git a/src/server/scripts/Northrend/storm_peaks.cpp b/src/server/scripts/Northrend/storm_peaks.cpp index 7bd59b92b7f..4e0864e01e4 100644 --- a/src/server/scripts/Northrend/storm_peaks.cpp +++ b/src/server/scripts/Northrend/storm_peaks.cpp @@ -192,43 +192,6 @@ public: } }; -/*###### -## npc_goblin_prisoner -######*/ - -enum eGoblinPrisoner -{ - GO_RUSTY_CAGE = 191544 -}; - -class npc_goblin_prisoner : public CreatureScript -{ -public: - npc_goblin_prisoner() : CreatureScript("npc_goblin_prisoner") { } - - struct npc_goblin_prisonerAI : public ScriptedAI - { - npc_goblin_prisonerAI(Creature* creature) : ScriptedAI (creature){} - - void Reset() - { - me->SetReactState(REACT_PASSIVE); - - if (GameObject* pGO = me->FindNearestGameObject(GO_RUSTY_CAGE, 5.0f)) - { - if (pGO->GetGoState() == GO_STATE_ACTIVE) - pGO->SetGoState(GO_STATE_READY); - } - } - - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_goblin_prisonerAI(creature); - } -}; - /*###### ## npc_victorious_challenger ######*/ @@ -786,7 +749,6 @@ void AddSC_storm_peaks() new npc_agnetta_tyrsdottar; new npc_frostborn_scout; new npc_thorim; - new npc_goblin_prisoner; new npc_victorious_challenger; new npc_loklira_crone; new npc_injured_goblin; From c10e6708ed6bcef4602841ae5178e912842b0867 Mon Sep 17 00:00:00 2001 From: Discovered Date: Sat, 25 Feb 2012 21:40:05 +0100 Subject: [PATCH 0046/1149] Core: Add some more output in HandleSetActionButtonOpcode (show playername/guid as well) Signed-off-by: click --- src/server/game/Handlers/MiscHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 3b56a0712e1..f220be7d2b5 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1058,7 +1058,7 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) sLog->outDetail("MISC: Added Item %u into button %u", action, button); break; default: - sLog->outError("MISC: Unknown action button type %u for action %u into button %u", type, action, button); + sLog->outError("MISC: Unknown action button type %u for action %u into button %u for player %s (GUID: %u)", type, action, button, _player->GetName(), _player->GetGUIDLow()); return; } GetPlayer()->addActionButton(button, action, type); From f0d0d95cf9350bfc77113a58e8541f6866658e9d Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 25 Feb 2012 22:51:06 +0200 Subject: [PATCH 0047/1149] Core/Spells: Fix spellmod restore on failed cast for auras that have multiple mods for different spells (by lost-illusion) --- src/server/game/Entities/Player/Player.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 4b3c7f9a83a..f5b7d487219 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -20065,9 +20065,13 @@ void Player::RestoreSpellMods(Spell* spell, uint32 ownerAuraId, Aura* aura) continue; // check if mod affected this spell + // first, check if the mod aura applied at least one spellmod to this spell Spell::UsedSpellMods::iterator iterMod = spell->m_appliedMods.find(mod->ownerAura); if (iterMod == spell->m_appliedMods.end()) continue; + // secondly, check if the current mod is one of the spellmods applied by the mod aura + if (!(mod->mask & spell->m_spellInfo->SpellFamilyFlags)) + continue; // remove from list spell->m_appliedMods.erase(iterMod); From 1ebdc5c19cc871ab2e00e75c3e477972151c8e7f Mon Sep 17 00:00:00 2001 From: leak Date: Sat, 25 Feb 2012 22:05:47 +0100 Subject: [PATCH 0048/1149] Core/Warden: Add reload ability for character.warden_action table / Centralize the crypto keys in one header file --- .../game/Warden/Modules/WardenModuleWin.h | 2389 +++++++++-------- src/server/game/Warden/WardenCheckMgr.cpp | 58 +- src/server/game/Warden/WardenCheckMgr.h | 2 +- src/server/game/Warden/WardenWin.cpp | 36 +- src/server/game/World/World.cpp | 3 + src/server/scripts/Commands/cs_reload.cpp | 17 + 6 files changed, 1279 insertions(+), 1226 deletions(-) diff --git a/src/server/game/Warden/Modules/WardenModuleWin.h b/src/server/game/Warden/Modules/WardenModuleWin.h index ca61a270a81..bf40cde546b 100644 --- a/src/server/game/Warden/Modules/WardenModuleWin.h +++ b/src/server/game/Warden/Modules/WardenModuleWin.h @@ -19,1186 +19,1219 @@ #ifndef _WARDEN_MODULE_WIN_H #define _WARDEN_MODULE_WIN_H -uint8 Module_79C0768D657977D697E10BAD956CCED1_Data[18756] = -{ - 0x21, 0x6C, 0xBB, 0x6A, 0xB9, 0xAF, 0xE8, 0xA1, 0x9A, 0x79, 0x18, 0xF1, 0x27, 0x9A, 0x14, 0xF5, - 0x42, 0x5D, 0x00, 0xBA, 0x74, 0x57, 0x0E, 0xAF, 0xD2, 0xAE, 0x8E, 0x51, 0xA5, 0xC1, 0x17, 0x4E, - 0xEC, 0x7F, 0xAC, 0xBC, 0xDD, 0x42, 0x87, 0xA6, 0xF9, 0xC1, 0x4A, 0xCE, 0xB5, 0xDD, 0xB3, 0xF8, - 0x06, 0x52, 0x9D, 0xF2, 0xAE, 0x2A, 0x49, 0x2B, 0x7B, 0x72, 0x5F, 0x40, 0x01, 0x16, 0xDB, 0x98, - 0x77, 0x1F, 0xE3, 0x61, 0x5A, 0x99, 0x39, 0x66, 0x2F, 0x2F, 0x35, 0xBF, 0x00, 0x20, 0xE4, 0xE0, - 0x8F, 0x98, 0xAD, 0xFC, 0xDB, 0x7D, 0xDD, 0xE8, 0x7A, 0xE9, 0x21, 0x6C, 0x86, 0x80, 0x3A, 0xE7, - 0x75, 0x66, 0x0E, 0xD9, 0xC6, 0xC5, 0xD8, 0xD8, 0xA9, 0x9B, 0x84, 0x09, 0xF0, 0xB3, 0x7C, 0x72, - 0x53, 0xE2, 0x29, 0xF9, 0x64, 0x8C, 0x17, 0xFD, 0x90, 0xAE, 0x48, 0x5A, 0x30, 0xFA, 0x30, 0xB7, - 0x54, 0x58, 0x59, 0x61, 0xA0, 0x24, 0x57, 0xE4, 0xF0, 0x05, 0xA2, 0x3F, 0x7A, 0xA6, 0x51, 0x7E, - 0x4F, 0x35, 0xF4, 0xE5, 0xFF, 0x98, 0xE9, 0x3E, 0x1F, 0xF1, 0x66, 0x48, 0x5B, 0xF8, 0xCF, 0x3B, - 0x37, 0x3B, 0x60, 0x47, 0x1C, 0xF7, 0xBE, 0x59, 0x70, 0x3A, 0x03, 0x4C, 0xE6, 0xBD, 0xB6, 0xED, - 0x46, 0xAF, 0x04, 0x5A, 0xAA, 0xC4, 0x30, 0xCF, 0x0B, 0x05, 0x86, 0xA9, 0x56, 0x5B, 0x09, 0xF0, - 0x92, 0x59, 0xC8, 0x48, 0x58, 0x33, 0xBF, 0x81, 0x70, 0x51, 0x92, 0x98, 0xE9, 0x4F, 0x2B, 0xDD, - 0x5B, 0x0A, 0x42, 0x51, 0x73, 0x97, 0xF6, 0x66, 0x00, 0xF2, 0x04, 0x50, 0x4A, 0x54, 0x62, 0x7A, - 0x00, 0x10, 0x5B, 0xAD, 0x0E, 0xFC, 0xE1, 0x44, 0x55, 0x4E, 0x21, 0x76, 0xC6, 0x4B, 0xD5, 0x2E, - 0xF5, 0xF4, 0x0E, 0xFC, 0x55, 0xE1, 0xDE, 0x32, 0x20, 0x22, 0x03, 0x98, 0xF0, 0xD3, 0x4A, 0xE5, - 0x45, 0x49, 0x0C, 0xE8, 0x76, 0xE1, 0xBF, 0x4A, 0x53, 0xD3, 0xCE, 0x64, 0xCF, 0x82, 0xCF, 0x67, - 0xA9, 0x3F, 0xF1, 0x06, 0x24, 0x33, 0x0A, 0x98, 0x6A, 0x5C, 0xAB, 0xEE, 0x7F, 0x64, 0xE3, 0x65, - 0x1F, 0xF6, 0xBE, 0xAF, 0x9C, 0x63, 0x53, 0x54, 0x06, 0x84, 0x4F, 0xF2, 0x7D, 0xC5, 0xBD, 0x70, - 0xC7, 0x6F, 0x59, 0x93, 0x7C, 0xEE, 0xC0, 0xCA, 0xF5, 0x56, 0x21, 0x58, 0x5B, 0xD8, 0x1D, 0xB4, - 0xB7, 0x60, 0x72, 0x46, 0xA2, 0x60, 0x3F, 0xC3, 0x30, 0xAB, 0xE0, 0x3B, 0xAC, 0x9E, 0xB9, 0x64, - 0xA8, 0xEF, 0xD0, 0xE1, 0xE5, 0xE1, 0x83, 0x48, 0xB8, 0x35, 0xA7, 0x12, 0x11, 0x00, 0xC9, 0x29, - 0x1A, 0x41, 0x1D, 0x3B, 0xFB, 0x33, 0x0B, 0x66, 0x45, 0x86, 0x61, 0x70, 0x35, 0x4C, 0x5F, 0x64, - 0x8E, 0xF5, 0x57, 0xBE, 0xA6, 0xFA, 0x49, 0xC9, 0x89, 0xA4, 0x74, 0x02, 0x9E, 0xE7, 0x67, 0x14, - 0x8B, 0xB9, 0xE7, 0xA8, 0xB0, 0x75, 0x65, 0x22, 0xB7, 0xCD, 0xFA, 0x55, 0x18, 0x00, 0x55, 0xB5, - 0x09, 0x70, 0x7E, 0x05, 0x0B, 0x11, 0x42, 0xF0, 0x80, 0x58, 0x2F, 0xFE, 0x3B, 0x2C, 0x4A, 0xCA, - 0x50, 0x34, 0xD0, 0x6F, 0xF1, 0xCC, 0x7F, 0x35, 0xD7, 0x9B, 0xF2, 0x97, 0x16, 0xFE, 0x5F, 0x6C, - 0x94, 0xDC, 0xAC, 0x63, 0xC8, 0x85, 0x2E, 0x60, 0x41, 0x34, 0x89, 0xD3, 0xDD, 0xBF, 0x2D, 0x69, - 0xC2, 0xF7, 0x74, 0xB2, 0x56, 0xD9, 0x76, 0xA2, 0x35, 0x30, 0x60, 0x35, 0xAB, 0x50, 0x21, 0xAE, - 0xFC, 0xFA, 0x19, 0x06, 0xDE, 0x89, 0x46, 0xFF, 0x34, 0x2F, 0x19, 0x84, 0x85, 0xF5, 0x1E, 0x60, - 0x91, 0x0D, 0x8C, 0x94, 0xDB, 0x2E, 0xEE, 0x4D, 0x0A, 0x29, 0x64, 0x81, 0xAD, 0x4C, 0xBF, 0x41, - 0x51, 0x04, 0xCD, 0x1C, 0x5C, 0x89, 0xD3, 0x3A, 0x91, 0xD9, 0x5C, 0x7E, 0xF3, 0xE9, 0x5B, 0x9E, - 0xC2, 0xD2, 0xE4, 0xD5, 0xEF, 0x47, 0x63, 0xD2, 0xD4, 0x19, 0x3E, 0xDF, 0xCF, 0xA4, 0x10, 0x47, - 0x16, 0x93, 0xC2, 0xF2, 0x22, 0xED, 0x1D, 0x9E, 0x21, 0x63, 0xC4, 0xCB, 0x89, 0xBB, 0x3E, 0xF7, - 0x89, 0x68, 0x6D, 0x2C, 0xDF, 0x2C, 0x6F, 0xB2, 0x8D, 0x75, 0xF8, 0xC6, 0x57, 0x98, 0x47, 0x86, - 0x40, 0x72, 0xBB, 0xD7, 0x32, 0xCD, 0x7A, 0x15, 0x64, 0x83, 0xD9, 0x50, 0x2E, 0xDE, 0x0C, 0x8C, - 0x30, 0xCD, 0xB0, 0x64, 0xD6, 0x7F, 0xE7, 0xAD, 0x6E, 0x01, 0x3E, 0x14, 0x8A, 0x24, 0x86, 0x1F, - 0x92, 0xAB, 0x1A, 0xE5, 0xD6, 0xBF, 0x64, 0xE5, 0xF6, 0x34, 0x62, 0xD5, 0x92, 0x5B, 0x64, 0xC4, - 0xFC, 0x1B, 0x7F, 0xA0, 0x13, 0xC1, 0xD4, 0xEB, 0x92, 0x90, 0xEF, 0x8C, 0x5E, 0x75, 0x4B, 0x78, - 0x56, 0x5F, 0xA2, 0x55, 0x4B, 0x1B, 0xE3, 0xDD, 0x80, 0x7E, 0xCF, 0x69, 0x97, 0x5A, 0x76, 0xD5, - 0xAA, 0x7D, 0x85, 0x73, 0x10, 0x4E, 0x79, 0x9A, 0x10, 0x10, 0x01, 0xD8, 0xD7, 0x85, 0x41, 0x8D, - 0x3D, 0xEA, 0xE3, 0x59, 0xD9, 0x31, 0x4B, 0x23, 0xC6, 0x53, 0x11, 0xA6, 0x35, 0x29, 0x64, 0x7E, - 0x28, 0xD7, 0x8D, 0x03, 0x70, 0x5C, 0x53, 0xA7, 0x6D, 0x81, 0x30, 0x7B, 0xDF, 0x2B, 0xAE, 0xAB, - 0x6F, 0x52, 0x93, 0xCF, 0xDD, 0x00, 0x35, 0xE9, 0x65, 0x4A, 0x04, 0x79, 0x11, 0x30, 0xCA, 0xC7, - 0xD2, 0xF3, 0x34, 0xAC, 0x32, 0x1F, 0xE4, 0xE5, 0x83, 0x12, 0x66, 0xD6, 0xA6, 0xE4, 0xEB, 0x67, - 0x7E, 0xDD, 0x64, 0x3E, 0xF1, 0x0C, 0xE6, 0x1C, 0xB6, 0xE1, 0xB0, 0x2B, 0xE7, 0x83, 0xB4, 0x4A, - 0x82, 0xDD, 0xC1, 0x22, 0x3F, 0x03, 0x38, 0x90, 0xB2, 0xA9, 0x7B, 0x60, 0x57, 0xF9, 0xDD, 0x04, - 0x60, 0x5D, 0x7C, 0x2C, 0xD3, 0xE6, 0xFE, 0x02, 0x5A, 0x7D, 0x2A, 0x48, 0x81, 0x42, 0x20, 0x84, - 0xFF, 0x1D, 0xCC, 0x64, 0x11, 0x70, 0xE5, 0x4F, 0x9F, 0xE0, 0x11, 0xFB, 0xF0, 0xE2, 0xC4, 0x9B, - 0x11, 0x30, 0x7F, 0x2F, 0x7F, 0xA1, 0xB1, 0xBC, 0x5F, 0x29, 0x21, 0xDF, 0xB4, 0xEB, 0xB2, 0x4F, - 0xAA, 0x2D, 0x95, 0x60, 0x47, 0x78, 0x37, 0x67, 0xCD, 0xFA, 0x36, 0x17, 0x8F, 0x64, 0x15, 0xAF, - 0x04, 0xAA, 0x5C, 0x76, 0x23, 0x07, 0x64, 0x96, 0xB2, 0x5A, 0xCF, 0x03, 0xDC, 0xC3, 0x2D, 0xFB, - 0x0D, 0x2D, 0xA8, 0xBD, 0xCE, 0x58, 0xF8, 0x44, 0x75, 0xA1, 0x07, 0xAA, 0xDF, 0x25, 0xDC, 0x25, - 0x32, 0xCF, 0xA8, 0x92, 0xC5, 0xC0, 0xD5, 0x70, 0x21, 0x19, 0x6F, 0x32, 0xCA, 0x16, 0xFA, 0x8C, - 0xB2, 0x86, 0xF6, 0xD5, 0x2E, 0xD9, 0x0A, 0x9C, 0x96, 0xDB, 0x4D, 0xA4, 0x11, 0x02, 0x4C, 0x33, - 0x99, 0xB3, 0x5E, 0x45, 0x5C, 0xF1, 0x99, 0x61, 0x04, 0x20, 0xC9, 0xC8, 0xB3, 0xB4, 0xD3, 0x8B, - 0x24, 0x78, 0x55, 0x2E, 0xB7, 0x48, 0x43, 0x17, 0xBF, 0xB9, 0x2A, 0xCC, 0xD5, 0x4A, 0x49, 0xB2, - 0x4E, 0x1E, 0xC7, 0x45, 0x4E, 0x55, 0xC4, 0xBC, 0xB1, 0xD2, 0xA6, 0x62, 0xE9, 0x95, 0xBB, 0xCD, - 0x87, 0xD2, 0x7C, 0xE5, 0xC6, 0x77, 0x5B, 0xFF, 0xAF, 0xDD, 0x44, 0x9D, 0x3D, 0x10, 0x05, 0x3C, - 0x77, 0x7A, 0xF8, 0x84, 0x0D, 0x04, 0x55, 0xB5, 0x20, 0xEA, 0xD2, 0x3F, 0x04, 0x33, 0xFF, 0xE2, - 0x01, 0x3B, 0x51, 0x46, 0x3E, 0x34, 0xAA, 0x40, 0xCA, 0x7C, 0x85, 0x46, 0x57, 0xD9, 0xB7, 0xE1, - 0xDC, 0x65, 0xEF, 0x11, 0x66, 0x0B, 0xBA, 0xD8, 0x37, 0x66, 0x96, 0x64, 0x54, 0x8B, 0x05, 0x81, - 0x47, 0x87, 0x70, 0xA8, 0x54, 0xC6, 0x02, 0x08, 0xB4, 0xAD, 0x69, 0x3C, 0xC0, 0x03, 0x69, 0x19, - 0xE6, 0xAC, 0x13, 0xD5, 0x3F, 0x2C, 0x9D, 0x61, 0xCC, 0xA8, 0x60, 0xB5, 0x60, 0x85, 0x19, 0x5B, - 0x3E, 0x82, 0xCA, 0x34, 0x70, 0x06, 0xCD, 0x37, 0x3E, 0x91, 0x2F, 0x49, 0x82, 0x0A, 0x87, 0xE8, - 0x09, 0x18, 0xB3, 0xF4, 0x16, 0xA4, 0xA5, 0x46, 0xC5, 0x76, 0x6D, 0x73, 0xB1, 0x93, 0xDC, 0x69, - 0xF4, 0x49, 0xF8, 0x2F, 0x97, 0xB4, 0xAA, 0x19, 0x4A, 0x60, 0xD2, 0xF9, 0x7B, 0x5A, 0xF0, 0x57, - 0x45, 0xC6, 0xA2, 0x64, 0x37, 0x56, 0xED, 0x6B, 0x5E, 0x1D, 0x9E, 0x35, 0x5E, 0xFE, 0xDE, 0x04, - 0x08, 0x3B, 0x62, 0x40, 0x82, 0xD4, 0xF9, 0xF3, 0x54, 0x95, 0x3E, 0x57, 0x49, 0x3A, 0x41, 0x41, - 0xDA, 0xD4, 0x78, 0x80, 0xC7, 0xF1, 0xDE, 0xA7, 0xFF, 0xDC, 0x53, 0xC9, 0x3A, 0x37, 0xA5, 0x83, - 0xDE, 0xE8, 0x51, 0x33, 0x7B, 0xE6, 0xAC, 0xA5, 0xC4, 0x7D, 0x34, 0xB0, 0x99, 0x0D, 0x03, 0x34, - 0x0F, 0x8D, 0xB8, 0x10, 0x4E, 0x30, 0x38, 0x10, 0xFC, 0x62, 0xC3, 0xC0, 0xF5, 0x67, 0x69, 0xF5, - 0x23, 0xB4, 0xF2, 0x6B, 0x79, 0xA8, 0xEE, 0xF0, 0xDD, 0x06, 0xA1, 0x50, 0x41, 0x3E, 0x1D, 0x04, - 0xB0, 0xB7, 0xC8, 0x58, 0x20, 0x72, 0xF6, 0x41, 0x53, 0x58, 0xAA, 0xAB, 0xA1, 0x19, 0xB0, 0x99, - 0xE4, 0x35, 0x44, 0x32, 0xF0, 0x34, 0x52, 0x4E, 0xD0, 0xBC, 0x1D, 0xD2, 0x14, 0x6A, 0x22, 0x46, - 0x93, 0x52, 0xFF, 0xD5, 0xD9, 0xEF, 0x19, 0xAF, 0xFB, 0x9A, 0x0D, 0x4A, 0x14, 0x49, 0xAE, 0xC0, - 0x09, 0x5E, 0x40, 0x36, 0x63, 0xE7, 0xC3, 0xFA, 0x84, 0x1C, 0xBF, 0x65, 0x17, 0xED, 0xED, 0x49, - 0x93, 0xB9, 0xCD, 0x85, 0x3F, 0x95, 0x57, 0xF9, 0xE7, 0x59, 0x55, 0x59, 0xED, 0x3A, 0xA1, 0x90, - 0x24, 0x36, 0xB8, 0x38, 0x91, 0x57, 0x59, 0xDB, 0xDE, 0x8E, 0x8B, 0x3A, 0xBB, 0x31, 0x76, 0x39, - 0x0D, 0x20, 0x84, 0x8A, 0x05, 0x5A, 0xC1, 0x93, 0x04, 0x5E, 0x9E, 0x2E, 0x41, 0x13, 0xC9, 0x7F, - 0xAB, 0x45, 0x86, 0x99, 0xB2, 0x5C, 0x7E, 0x1A, 0x1C, 0x9C, 0x7C, 0xCF, 0x60, 0x38, 0xF7, 0x02, - 0x8A, 0xE6, 0x74, 0x4F, 0x31, 0x67, 0x99, 0x96, 0xC3, 0x79, 0xEB, 0x19, 0x07, 0xAD, 0xBB, 0xD2, - 0xD7, 0x51, 0x75, 0xDD, 0xD5, 0x44, 0xC2, 0x9A, 0xDE, 0x01, 0x68, 0x8C, 0xBF, 0x11, 0xFE, 0x5F, - 0xB9, 0xCF, 0x25, 0x35, 0xD2, 0xF7, 0x29, 0xE0, 0x63, 0x0F, 0x0A, 0xCA, 0xB9, 0x38, 0xB6, 0xDA, - 0xDD, 0x66, 0xD9, 0x5F, 0x67, 0x42, 0x15, 0xD8, 0x1C, 0xD1, 0x1C, 0xCC, 0xD6, 0xB9, 0x29, 0x85, - 0x99, 0xD6, 0xDD, 0xCE, 0x8E, 0x3D, 0x63, 0x1C, 0x31, 0x32, 0x37, 0xCD, 0xE1, 0xF8, 0xEA, 0x4E, - 0x31, 0x25, 0xF7, 0x2D, 0xE1, 0xCA, 0x36, 0x5B, 0xEC, 0xAC, 0x2B, 0xB0, 0xA5, 0x69, 0x3B, 0x4C, - 0xAE, 0xD7, 0x15, 0xF7, 0x7F, 0x5C, 0x5F, 0x82, 0xF0, 0x1D, 0x44, 0x62, 0xA0, 0x72, 0x57, 0xAD, - 0xB3, 0xD7, 0x1B, 0xA9, 0xE2, 0x76, 0xFF, 0x18, 0xA6, 0x3E, 0xF9, 0xF5, 0x6F, 0xB5, 0x13, 0x26, - 0x72, 0x0F, 0xF4, 0xE1, 0x7D, 0x43, 0x86, 0x48, 0x42, 0x0B, 0x94, 0x96, 0xBF, 0x0E, 0x32, 0x1C, - 0xE0, 0x18, 0x69, 0xA9, 0xAE, 0x83, 0x6F, 0x36, 0xE7, 0x04, 0x20, 0xEE, 0x34, 0xFF, 0x21, 0xE9, - 0xBA, 0x3B, 0x38, 0x48, 0x2D, 0x81, 0x38, 0x48, 0x25, 0xE5, 0x4A, 0xAD, 0x81, 0xA9, 0xE8, 0x33, - 0x0A, 0x4C, 0x60, 0xAE, 0xBB, 0xCC, 0x24, 0x96, 0x44, 0xF3, 0x1A, 0x2A, 0x89, 0xCB, 0xD9, 0x5E, - 0x89, 0x4C, 0xFD, 0x62, 0xA8, 0x38, 0x1E, 0x73, 0x63, 0xB3, 0xF1, 0x3E, 0xAC, 0xB1, 0x0B, 0x5D, - 0x10, 0xE5, 0xCC, 0x88, 0x2F, 0x9D, 0x57, 0xF1, 0x33, 0xA6, 0x50, 0x13, 0x2C, 0x54, 0x81, 0x1B, - 0x90, 0xD8, 0x6F, 0x7C, 0x02, 0x86, 0xA8, 0x02, 0x5F, 0xCE, 0x24, 0x22, 0x76, 0x73, 0xE8, 0x66, - 0xDC, 0x7F, 0x8F, 0x69, 0x4E, 0xBB, 0x63, 0xEB, 0xCD, 0x38, 0xE6, 0xEE, 0x84, 0x70, 0x97, 0x2F, - 0xD1, 0x77, 0xEE, 0x63, 0xE4, 0x2D, 0x42, 0xDE, 0x17, 0x95, 0x18, 0xB5, 0xA9, 0x4D, 0xFD, 0x2A, - 0xA8, 0x07, 0x1F, 0xCC, 0x3F, 0x22, 0x3B, 0x03, 0x49, 0xCF, 0x83, 0x83, 0x85, 0xAA, 0x87, 0xA0, - 0xC6, 0x30, 0x8C, 0x8F, 0x91, 0x88, 0x67, 0xA7, 0x1F, 0xE0, 0xE2, 0x40, 0x1E, 0xE9, 0x12, 0x2E, - 0x5C, 0x33, 0x44, 0x29, 0x0D, 0xEA, 0x34, 0x8B, 0x1A, 0x48, 0x80, 0x67, 0x45, 0x2A, 0xF2, 0x82, - 0xD8, 0x78, 0x7E, 0x36, 0x59, 0x6C, 0x32, 0x58, 0x3B, 0x0F, 0x2C, 0x0B, 0xD1, 0xFA, 0x67, 0x2B, - 0x0C, 0xFF, 0x16, 0x57, 0x04, 0x38, 0x51, 0x4F, 0x34, 0xEE, 0x94, 0x8B, 0xBB, 0x7B, 0xBE, 0xEA, - 0x37, 0xB5, 0x9F, 0xBA, 0xDE, 0xC1, 0xC6, 0x34, 0x2D, 0x36, 0xE6, 0xC8, 0x67, 0x6A, 0x74, 0x56, - 0xB5, 0x05, 0x53, 0xAE, 0x5C, 0x94, 0x83, 0xF9, 0xE0, 0xD7, 0x21, 0xC2, 0x71, 0x4B, 0x0F, 0x9C, - 0x64, 0x1C, 0xF4, 0x6A, 0xF8, 0xE3, 0x3C, 0x8F, 0xD2, 0x20, 0xCF, 0x14, 0xAC, 0x21, 0xF5, 0x2A, - 0xE7, 0xEC, 0x5C, 0x49, 0xAB, 0x21, 0xF2, 0x41, 0x2C, 0x3B, 0xA0, 0x49, 0x43, 0xF3, 0x14, 0xFE, - 0x68, 0x7C, 0x83, 0x05, 0xF3, 0x71, 0x77, 0x02, 0x2B, 0xD4, 0x94, 0x2B, 0x28, 0x5E, 0x4A, 0x5E, - 0x6E, 0x81, 0x1A, 0xD3, 0xDA, 0x58, 0x9F, 0xD6, 0x7B, 0x6D, 0xAD, 0x14, 0xBC, 0x60, 0xFC, 0xC4, - 0x83, 0x0A, 0x8E, 0x9B, 0x8D, 0x5B, 0x24, 0x77, 0x10, 0x34, 0x78, 0xC9, 0x8F, 0xA5, 0x2D, 0x0F, - 0x6A, 0x88, 0x7F, 0x24, 0x40, 0x46, 0x25, 0x3A, 0xDE, 0xB9, 0x9E, 0xA2, 0xE7, 0x8D, 0x52, 0xA2, - 0xFF, 0xDE, 0xB4, 0x95, 0xDB, 0x05, 0x2E, 0xDF, 0x29, 0x28, 0xB5, 0x76, 0xD6, 0x1D, 0x09, 0x45, - 0x69, 0x29, 0xF9, 0x95, 0xAA, 0x36, 0x71, 0xD9, 0x3F, 0xFF, 0x6B, 0x04, 0xFE, 0xED, 0x63, 0xC8, - 0x3C, 0x4B, 0x6B, 0x0B, 0xF3, 0xD8, 0x71, 0x15, 0xDA, 0xC0, 0xC9, 0xE2, 0x0D, 0x87, 0x94, 0x61, - 0xBE, 0xEF, 0x79, 0x92, 0x4C, 0x14, 0x92, 0xBF, 0x0C, 0x4E, 0xA0, 0x1B, 0x58, 0x00, 0x30, 0xF6, - 0xD0, 0x09, 0xD6, 0x1E, 0x81, 0xA0, 0xE7, 0xFD, 0xFD, 0xFF, 0x21, 0x47, 0xAB, 0xDE, 0x67, 0xC6, - 0xF4, 0x19, 0x60, 0x0C, 0x49, 0xE5, 0xC4, 0xBD, 0x64, 0x05, 0xED, 0x89, 0xD7, 0xBD, 0x74, 0xF7, - 0xD4, 0xCC, 0x4B, 0x9E, 0xEB, 0x6E, 0xB7, 0x87, 0xB6, 0x31, 0x07, 0xCB, 0x6E, 0x0D, 0xDF, 0x3A, - 0xD8, 0x64, 0x1F, 0xF9, 0x2C, 0xEE, 0xC0, 0x61, 0x22, 0x0E, 0x5A, 0x20, 0x0C, 0xD4, 0x4F, 0xC5, - 0x2D, 0x82, 0x63, 0x39, 0x36, 0x34, 0x07, 0xC6, 0x23, 0xBC, 0xF1, 0x56, 0xC6, 0x8C, 0x39, 0x23, - 0x43, 0xFF, 0xEC, 0xBE, 0x95, 0x7B, 0xC7, 0xFD, 0xA9, 0x99, 0x3D, 0xDF, 0x50, 0x28, 0x39, 0xCA, - 0x80, 0xCF, 0x1C, 0xE7, 0x81, 0x06, 0xB4, 0x43, 0x55, 0xFB, 0xB0, 0xA4, 0x5D, 0x78, 0x39, 0x71, - 0x88, 0xEC, 0xBB, 0x01, 0x69, 0x5E, 0x85, 0x97, 0x1F, 0xEB, 0x6C, 0x82, 0x07, 0xF4, 0x00, 0x1B, - 0x90, 0x03, 0x1B, 0x92, 0x9A, 0x4A, 0x95, 0x9D, 0x45, 0x45, 0x65, 0x6F, 0x8B, 0x70, 0x4C, 0xFE, - 0x48, 0x94, 0x5B, 0x71, 0x86, 0x70, 0x45, 0xB7, 0x85, 0xD9, 0x59, 0x29, 0x94, 0x47, 0x5A, 0x17, - 0x96, 0xA1, 0x0E, 0xFD, 0x72, 0x71, 0xE1, 0x3F, 0x7B, 0xE6, 0x59, 0x2A, 0x91, 0x5A, 0x6B, 0x82, - 0xB1, 0xA1, 0x31, 0xC2, 0xE4, 0xE3, 0xB9, 0x8E, 0x5A, 0x68, 0xC1, 0x18, 0xD4, 0x4B, 0x02, 0x2E, - 0x50, 0x3D, 0x73, 0x53, 0x2B, 0x13, 0x77, 0x19, 0xC7, 0x03, 0x0B, 0xB5, 0xAD, 0x5C, 0x0B, 0x6B, - 0x66, 0x12, 0xF0, 0xE8, 0x67, 0xB7, 0xF7, 0x88, 0x64, 0xA8, 0x2C, 0x51, 0xA7, 0xF8, 0x5E, 0xB3, - 0x39, 0xEC, 0x1B, 0xDF, 0x6C, 0x89, 0x16, 0xFD, 0x51, 0x26, 0x29, 0x8D, 0x0E, 0xBE, 0x1B, 0xCE, - 0x61, 0xE5, 0x22, 0x09, 0xC1, 0x0F, 0xAD, 0x0C, 0xA1, 0x61, 0xF8, 0x49, 0x29, 0x11, 0x7C, 0x93, - 0x0C, 0xBE, 0xD0, 0x11, 0x6F, 0x24, 0x4E, 0x4B, 0xF5, 0xEF, 0x41, 0x3D, 0x0C, 0x69, 0xC6, 0xA6, - 0xBF, 0x87, 0x68, 0xFF, 0x2F, 0x76, 0xD9, 0xFD, 0x1D, 0x8E, 0x9F, 0x80, 0x19, 0x3B, 0x35, 0x8B, - 0x2D, 0xDB, 0x5C, 0x3E, 0x86, 0xE8, 0xBF, 0xF1, 0x30, 0x88, 0xE4, 0x80, 0xD0, 0x49, 0xC3, 0x50, - 0xF8, 0x1E, 0xCE, 0xDA, 0xAC, 0x2E, 0x3F, 0x97, 0x51, 0x12, 0x89, 0x47, 0x5D, 0xF4, 0xD4, 0x77, - 0x93, 0x66, 0x74, 0xE3, 0x4C, 0xCD, 0xB4, 0xC8, 0x00, 0x85, 0x64, 0x8C, 0x04, 0x72, 0x1C, 0x14, - 0xDA, 0x77, 0xD7, 0x1D, 0x39, 0xC3, 0x65, 0xD0, 0x28, 0x51, 0xCA, 0x91, 0xAE, 0x2D, 0xCD, 0x50, - 0x0D, 0x1B, 0xA4, 0xF1, 0x5D, 0x4C, 0x28, 0x1C, 0x57, 0xE5, 0x00, 0xEC, 0xA4, 0x02, 0x3B, 0xCA, - 0x70, 0xF3, 0x8B, 0x3C, 0x4F, 0xEE, 0x9D, 0x08, 0xFF, 0x66, 0x31, 0xCE, 0x37, 0x93, 0x90, 0x3D, - 0x6E, 0xDE, 0xB9, 0xCF, 0x35, 0xAA, 0xF0, 0x43, 0x3E, 0x6B, 0x19, 0xEC, 0x69, 0x7A, 0xF0, 0xC6, - 0xC3, 0x7D, 0x49, 0x89, 0x43, 0xCC, 0x2C, 0x20, 0x2E, 0xB8, 0x5D, 0xCC, 0xDB, 0x39, 0xCB, 0x0B, - 0x76, 0xD8, 0xAC, 0xD6, 0x2A, 0x76, 0x59, 0x7F, 0x6A, 0x1B, 0xCD, 0x4A, 0x93, 0xCA, 0x42, 0x5F, - 0xC7, 0x98, 0xFA, 0xC9, 0x30, 0x2E, 0x9F, 0x8F, 0xE5, 0xB5, 0x37, 0x41, 0x19, 0xF4, 0xA0, 0xE5, - 0xDA, 0x7D, 0x3C, 0xF5, 0x61, 0xCC, 0x98, 0x27, 0xED, 0xE4, 0x5C, 0x0E, 0x7C, 0x1B, 0x33, 0x38, - 0x77, 0x20, 0x92, 0xC9, 0xD3, 0x38, 0xC3, 0x03, 0x2C, 0xAF, 0xE2, 0x77, 0x34, 0x4B, 0xE2, 0x1C, - 0x9F, 0xE4, 0x4D, 0xAB, 0x12, 0xFE, 0xCD, 0xB3, 0x2C, 0xD3, 0xE2, 0x42, 0xB8, 0xE7, 0xE0, 0x14, - 0x88, 0x31, 0xB1, 0xDC, 0x35, 0xDE, 0xCD, 0x3D, 0x3B, 0xDF, 0x6C, 0x00, 0xA3, 0x48, 0xA6, 0x71, - 0x7E, 0xC6, 0x3A, 0xE8, 0x07, 0xCE, 0xC8, 0xE7, 0xDC, 0xB1, 0x98, 0x17, 0xDB, 0x75, 0x20, 0xFE, - 0x38, 0xC7, 0x1F, 0x02, 0x8E, 0xE4, 0x91, 0x79, 0x3D, 0xC0, 0x50, 0x2D, 0xC7, 0x49, 0x33, 0x6C, - 0xDF, 0x3C, 0xE9, 0x42, 0xE9, 0x27, 0xBC, 0x39, 0x38, 0xAA, 0x98, 0x16, 0x6E, 0x1F, 0x71, 0xDF, - 0x3B, 0xBA, 0x15, 0x2F, 0x69, 0xEB, 0x06, 0x5C, 0xFB, 0xF8, 0x4C, 0x83, 0x2C, 0x28, 0xC2, 0x19, - 0xAD, 0x04, 0xA1, 0xB0, 0x7F, 0xF1, 0x9C, 0x84, 0x38, 0x42, 0x45, 0x3E, 0x1E, 0xC7, 0x95, 0xD5, - 0xAF, 0x35, 0x7E, 0x2A, 0xCC, 0x06, 0x9D, 0x9A, 0xCF, 0xC2, 0x56, 0xE6, 0x73, 0x7F, 0x7E, 0x9D, - 0x9B, 0x01, 0x27, 0x76, 0x14, 0x8C, 0x3E, 0x3A, 0xBD, 0x2E, 0x6C, 0x7C, 0xB7, 0xF2, 0x9A, 0x92, - 0x41, 0xBC, 0xD0, 0x48, 0xF6, 0xE6, 0x16, 0x62, 0x01, 0x4D, 0x3D, 0x8E, 0xD2, 0x98, 0x8F, 0x61, - 0x70, 0x7C, 0x41, 0xCC, 0xCA, 0x3D, 0x3E, 0x0B, 0x70, 0xC3, 0x9F, 0x9D, 0x3E, 0x33, 0x50, 0x2B, - 0xB0, 0x47, 0xC8, 0xA3, 0xAA, 0x55, 0xBA, 0x16, 0x3B, 0xF4, 0x07, 0x98, 0x1B, 0x6C, 0x49, 0x6A, - 0xA5, 0xB4, 0x7A, 0xBE, 0x28, 0x37, 0xF2, 0x55, 0x69, 0x09, 0x7A, 0xEC, 0x94, 0x1C, 0x60, 0xE3, - 0xB5, 0x89, 0x07, 0x58, 0x43, 0xA3, 0x3F, 0x1D, 0x94, 0x20, 0x49, 0x5E, 0xC1, 0xB7, 0x4E, 0x2C, - 0x75, 0x95, 0x54, 0x91, 0x4A, 0x01, 0x90, 0xF8, 0xF1, 0x81, 0xC6, 0x4C, 0x9A, 0x63, 0x20, 0x55, - 0x65, 0x8D, 0x30, 0xA2, 0xD4, 0xC7, 0xAF, 0x18, 0xA5, 0x83, 0xB6, 0x68, 0x1B, 0x35, 0x13, 0x6D, - 0xC6, 0x77, 0x5A, 0x04, 0xFB, 0xD5, 0xBD, 0x2B, 0x0D, 0x55, 0x5E, 0xEC, 0x7A, 0x80, 0x17, 0x01, - 0x9C, 0x4F, 0x55, 0x39, 0x57, 0x9F, 0x31, 0x9E, 0xB9, 0xB1, 0x35, 0xD5, 0x2F, 0xB9, 0xF3, 0x6A, - 0x9C, 0x30, 0xEA, 0x1B, 0xE9, 0x34, 0x4A, 0x2F, 0xB1, 0x36, 0x9C, 0xF0, 0x8A, 0xE9, 0x62, 0xDB, - 0x06, 0x32, 0x64, 0x39, 0x58, 0x29, 0xBD, 0xB1, 0x2C, 0x06, 0x56, 0x54, 0xAF, 0x6B, 0x97, 0x5A, - 0x7D, 0x49, 0xB6, 0xDF, 0x06, 0xFC, 0x9F, 0x06, 0x64, 0x89, 0xF5, 0xF4, 0xC4, 0x55, 0x02, 0x19, - 0xAA, 0xC9, 0x1D, 0x8A, 0x5E, 0x3D, 0xA7, 0x13, 0xEC, 0x52, 0x29, 0x8B, 0x6E, 0xC5, 0xA0, 0x62, - 0x9E, 0x89, 0x96, 0xDF, 0x5E, 0x74, 0x69, 0x53, 0x75, 0xCA, 0xF0, 0x95, 0x0E, 0xF8, 0x42, 0xB6, - 0x06, 0x62, 0xDA, 0x92, 0x48, 0xC3, 0x37, 0x50, 0x59, 0xDF, 0x59, 0xAF, 0xAF, 0x0E, 0x2E, 0x84, - 0xE5, 0x2F, 0x3C, 0xC9, 0x7E, 0x2A, 0xE5, 0xA9, 0x41, 0xB1, 0x51, 0x82, 0xC6, 0x42, 0xEC, 0x65, - 0xFD, 0xCB, 0x54, 0x29, 0x33, 0xC2, 0xE5, 0x5E, 0x10, 0xFB, 0x9E, 0x19, 0xE2, 0x75, 0x53, 0x43, - 0x50, 0xD5, 0x10, 0x8E, 0xBC, 0xC6, 0x2A, 0x0A, 0x8D, 0x7F, 0x4A, 0xF6, 0x07, 0x28, 0xA1, 0xEB, - 0x14, 0x1C, 0xD3, 0xE9, 0x63, 0x55, 0xC7, 0xD2, 0xE8, 0xB2, 0x3D, 0x17, 0x84, 0x63, 0xF9, 0x11, - 0xA4, 0x11, 0xE0, 0xA1, 0x83, 0x11, 0x11, 0xD2, 0xA0, 0x8C, 0x61, 0x74, 0x36, 0x63, 0xE9, 0xE8, - 0x98, 0x4C, 0x20, 0x38, 0x1F, 0xA5, 0x15, 0x60, 0x3E, 0x5C, 0x1B, 0xE6, 0xDE, 0xC1, 0x70, 0x7F, - 0xCB, 0x92, 0x76, 0x05, 0xD8, 0x63, 0xDF, 0x01, 0x7E, 0xF2, 0xF1, 0x01, 0xBD, 0xCE, 0x9A, 0x1E, - 0x50, 0x7F, 0xB4, 0xF4, 0x49, 0x5D, 0x7F, 0xCA, 0x86, 0x83, 0x2F, 0x63, 0x33, 0xEF, 0x4F, 0x35, - 0xA1, 0xBF, 0xB6, 0xCD, 0x25, 0xBA, 0x0E, 0xB9, 0xA3, 0x96, 0x41, 0xD4, 0x90, 0xFF, 0xEB, 0xF7, - 0x4F, 0x93, 0xC8, 0xD7, 0x04, 0x62, 0x6E, 0x88, 0xD7, 0x71, 0x0E, 0x0E, 0x37, 0x50, 0xCE, 0xFA, - 0x9B, 0xBD, 0x5B, 0xB0, 0xB7, 0x0F, 0x70, 0x75, 0x0A, 0x5D, 0xFC, 0x69, 0xB3, 0x07, 0x11, 0x9B, - 0xE8, 0x13, 0x0D, 0xBF, 0x08, 0x33, 0x59, 0x20, 0x4A, 0xBD, 0x27, 0x76, 0xED, 0xF2, 0x36, 0x0B, - 0xEA, 0xBC, 0x78, 0x17, 0xBD, 0x6E, 0x4F, 0x37, 0xD3, 0x26, 0x86, 0x85, 0xB1, 0x71, 0xEA, 0x55, - 0x73, 0xAA, 0x7C, 0xA2, 0x36, 0x75, 0xD2, 0xCD, 0xE4, 0xFC, 0xE7, 0xCE, 0x5E, 0xB1, 0xE5, 0xF4, - 0x65, 0xD7, 0x8F, 0x34, 0x07, 0x66, 0xA7, 0x4B, 0xCE, 0x55, 0xB0, 0x71, 0xFD, 0x20, 0x03, 0x5C, - 0xBA, 0x28, 0x0B, 0x71, 0x4D, 0x93, 0xB9, 0x77, 0x5E, 0x46, 0x6A, 0xCB, 0xD7, 0x0A, 0x59, 0x2E, - 0x26, 0x49, 0x0A, 0x36, 0x0F, 0x03, 0x6F, 0x32, 0xD7, 0xF0, 0xEC, 0x53, 0xF6, 0x0B, 0x1E, 0x08, - 0x27, 0x37, 0x69, 0xC5, 0x9F, 0x6C, 0x76, 0x27, 0x4C, 0x7A, 0x7C, 0xB7, 0xC8, 0x1B, 0xC4, 0x79, - 0xA1, 0xE3, 0xE0, 0xF3, 0x3B, 0x20, 0x07, 0x0C, 0xE4, 0xAB, 0x10, 0x6F, 0xA4, 0xFA, 0x7F, 0x08, - 0x6F, 0x5C, 0xAE, 0x06, 0xC5, 0x6D, 0x09, 0x1E, 0x2D, 0xDD, 0x80, 0xA7, 0x7B, 0x9E, 0xE6, 0x44, - 0x79, 0x3D, 0x55, 0x12, 0x51, 0x87, 0x4D, 0x4A, 0x66, 0x32, 0x2D, 0x4E, 0x17, 0x30, 0xAF, 0x77, - 0x7A, 0x8B, 0x44, 0x8D, 0xA4, 0xF8, 0x70, 0xC1, 0x99, 0x55, 0x3D, 0x4B, 0x08, 0x40, 0x2F, 0xA2, - 0xEA, 0xAA, 0x94, 0x24, 0xC3, 0xBD, 0x5C, 0x68, 0x35, 0x8D, 0x71, 0xA8, 0x3E, 0xBA, 0x00, 0x70, - 0x28, 0xB8, 0x10, 0x20, 0x8F, 0x5C, 0xE4, 0xC4, 0xBB, 0x22, 0x59, 0xA2, 0x35, 0x5F, 0x7A, 0x3D, - 0xF1, 0x24, 0x70, 0x1C, 0xE3, 0x3E, 0xED, 0x26, 0x07, 0xD7, 0x82, 0x4B, 0x80, 0x3B, 0x0C, 0xE4, - 0xAB, 0xCF, 0x71, 0x97, 0x87, 0x22, 0x2B, 0x53, 0x27, 0x99, 0x29, 0x10, 0x41, 0x30, 0xE8, 0x28, - 0xD2, 0x48, 0xAC, 0x25, 0x40, 0xBF, 0xDB, 0xED, 0x3A, 0xF4, 0x5D, 0x6E, 0x66, 0x1A, 0x08, 0xFF, - 0xEE, 0x49, 0x36, 0xD7, 0x68, 0x1E, 0xD7, 0xAB, 0xEC, 0xD6, 0x84, 0x1C, 0x8D, 0x35, 0x2D, 0x10, - 0x3C, 0x9C, 0x77, 0x12, 0xB3, 0x09, 0x5F, 0x0B, 0x2A, 0xB3, 0xCF, 0x8E, 0xE0, 0xF1, 0xAA, 0x71, - 0xB1, 0xE3, 0x58, 0x5C, 0xFF, 0xD1, 0x34, 0xE0, 0xBF, 0x20, 0x6D, 0x42, 0x86, 0xCA, 0x97, 0x1B, - 0x76, 0x2F, 0x08, 0x29, 0xEC, 0xD5, 0xDD, 0x04, 0x36, 0xFC, 0xCA, 0x39, 0xBE, 0x28, 0x8C, 0x1F, - 0x0D, 0x56, 0x77, 0xB7, 0xE0, 0x23, 0x41, 0x1E, 0xB4, 0x29, 0x17, 0x7A, 0xAF, 0xF9, 0x30, 0xCF, - 0xF1, 0xFE, 0xF4, 0x62, 0x32, 0xD9, 0xDB, 0x56, 0x9A, 0x2B, 0x31, 0xBF, 0xA5, 0x15, 0x19, 0x1E, - 0xEA, 0xCB, 0x5D, 0x6B, 0x65, 0x9A, 0x06, 0x1F, 0x9C, 0x0E, 0xC0, 0x5D, 0x8C, 0xFB, 0xD5, 0xCF, - 0xA4, 0x18, 0xA1, 0x0C, 0xAD, 0xD3, 0x98, 0x09, 0x3A, 0x86, 0x7F, 0x1C, 0x60, 0xC9, 0xFB, 0x42, - 0xF2, 0x37, 0x4E, 0xF0, 0x91, 0x02, 0x33, 0x41, 0xDE, 0xDB, 0xF8, 0x8E, 0x44, 0x00, 0xC5, 0x94, - 0x21, 0x39, 0x91, 0x0A, 0xB5, 0xC4, 0x44, 0xAC, 0x04, 0xF8, 0xB7, 0xA1, 0x13, 0x70, 0xA7, 0xEF, - 0x23, 0xBD, 0xF6, 0x12, 0x34, 0x30, 0x3A, 0x70, 0x81, 0x21, 0xE7, 0x66, 0xB8, 0x55, 0x00, 0xAF, - 0xC1, 0xC3, 0x56, 0x3D, 0xAB, 0x3D, 0xCA, 0x16, 0x4F, 0x6B, 0x3E, 0x69, 0xEF, 0xF8, 0xCA, 0x7B, - 0x65, 0x1C, 0xF3, 0xD9, 0xE8, 0xB0, 0xF6, 0xF3, 0x18, 0x9E, 0xDF, 0x45, 0xC7, 0xAF, 0xCE, 0xC8, - 0x5E, 0x51, 0x94, 0x76, 0x23, 0x80, 0xF8, 0x49, 0x9B, 0xB9, 0x7C, 0x2F, 0x3C, 0xE6, 0xB5, 0x2F, - 0xAD, 0xCC, 0xE7, 0xE7, 0x1E, 0x08, 0xBF, 0xFA, 0x70, 0x2C, 0xB3, 0xED, 0x0C, 0x29, 0x7D, 0xB0, - 0xBE, 0xE7, 0x91, 0x39, 0x73, 0xC2, 0x80, 0x77, 0x2F, 0x91, 0x1D, 0x2F, 0x45, 0x1E, 0x41, 0xE4, - 0x45, 0x2A, 0x7E, 0x93, 0xCE, 0x6D, 0x65, 0x18, 0x76, 0x61, 0x15, 0x05, 0x24, 0x0E, 0x65, 0xD6, - 0x19, 0x7A, 0xFF, 0x02, 0x94, 0xFB, 0x2D, 0x14, 0xE4, 0xA3, 0x9C, 0xFC, 0x48, 0x29, 0x3A, 0x7F, - 0x36, 0x4F, 0x18, 0xD5, 0x5B, 0x99, 0x4C, 0x97, 0x20, 0x36, 0x77, 0xA6, 0x75, 0xE3, 0x44, 0x92, - 0x47, 0x72, 0xEA, 0x1D, 0x00, 0x5A, 0x1D, 0xAF, 0x12, 0xAC, 0x26, 0xE9, 0x1E, 0x4C, 0x89, 0xCC, - 0x56, 0x01, 0x22, 0x4D, 0x45, 0x44, 0xAC, 0xB6, 0x75, 0xEF, 0x3F, 0x2B, 0x35, 0xC6, 0x06, 0x12, - 0xF6, 0xDB, 0xF1, 0x55, 0xF7, 0x05, 0xB0, 0xC0, 0x16, 0x13, 0x60, 0xAA, 0x01, 0x68, 0x1A, 0xCF, - 0xA3, 0xDE, 0xC2, 0xED, 0x60, 0xB9, 0x38, 0x0A, 0x78, 0x7C, 0x5A, 0x96, 0x70, 0x3E, 0x1E, 0xDC, - 0xCD, 0x80, 0xDE, 0x5B, 0x63, 0x94, 0x01, 0x9D, 0x68, 0x02, 0xB9, 0x64, 0xBC, 0x89, 0xCA, 0xB4, - 0x12, 0xD7, 0x5E, 0x20, 0xC7, 0xBD, 0x39, 0x21, 0xAD, 0x74, 0x3A, 0x04, 0x8F, 0x5F, 0xE2, 0x55, - 0xE2, 0xA4, 0x8F, 0xE0, 0xFB, 0x9D, 0xBD, 0x67, 0xCF, 0xD8, 0x93, 0x6C, 0x84, 0xE7, 0xB6, 0xCE, - 0xBD, 0x7B, 0xDA, 0x93, 0x18, 0x70, 0x6B, 0x48, 0xBA, 0x0E, 0x66, 0x09, 0x2E, 0x91, 0x55, 0x38, - 0x84, 0x02, 0x18, 0x1D, 0x49, 0xDE, 0x25, 0xB3, 0x7E, 0xE8, 0xD0, 0x6E, 0xDD, 0x13, 0x8F, 0xA4, - 0x95, 0x17, 0x01, 0x0D, 0x93, 0xB0, 0xD8, 0xBD, 0x0C, 0xCA, 0x48, 0x62, 0xFA, 0xF5, 0xEA, 0xC5, - 0x71, 0x21, 0x00, 0xEC, 0x3A, 0x88, 0x26, 0xA1, 0x52, 0xBA, 0xBF, 0x2A, 0x70, 0xEB, 0xF7, 0x2B, - 0x43, 0xF4, 0xF6, 0xE3, 0xD0, 0x63, 0x1A, 0xA1, 0x0C, 0x00, 0xFE, 0xF9, 0x12, 0xE1, 0xED, 0x2A, - 0xFD, 0x19, 0x4E, 0x51, 0x22, 0xA0, 0x4C, 0x09, 0x2F, 0x0B, 0x8A, 0x57, 0xFA, 0x3E, 0xF3, 0x02, - 0xE3, 0xF0, 0x8F, 0x17, 0x6E, 0xC1, 0x45, 0x34, 0x95, 0x61, 0x22, 0x9E, 0x72, 0xA9, 0x50, 0x77, - 0x07, 0x64, 0xEE, 0x52, 0x03, 0x10, 0xBA, 0x09, 0xF9, 0x45, 0x29, 0x58, 0x46, 0x24, 0xE7, 0x0F, - 0x21, 0xE0, 0xC8, 0xC8, 0x69, 0xCB, 0x4C, 0xD8, 0x39, 0x0E, 0x0C, 0x24, 0x68, 0x46, 0x1E, 0xD9, - 0x7A, 0x8C, 0xB2, 0x91, 0xF4, 0x1B, 0x96, 0xDE, 0x63, 0xFF, 0xE7, 0xCB, 0x86, 0x9F, 0xCD, 0xFB, - 0xBF, 0x67, 0xBE, 0x46, 0xF7, 0x0E, 0x1F, 0x1D, 0x77, 0x4F, 0x66, 0x4F, 0x4F, 0x09, 0x4E, 0x79, - 0x33, 0x80, 0x66, 0xA5, 0xD0, 0x47, 0xAD, 0x50, 0x3D, 0x45, 0xE5, 0x15, 0xCB, 0x05, 0xA9, 0xC8, - 0xFB, 0x0F, 0x00, 0xB6, 0x9F, 0xF7, 0xC2, 0x1B, 0x15, 0x2B, 0xD1, 0x01, 0xA2, 0x5A, 0xFB, 0x26, - 0x3D, 0x9E, 0xAC, 0x37, 0x2C, 0x0B, 0x3A, 0xD3, 0xE8, 0x99, 0xAF, 0xB0, 0x12, 0x17, 0x06, 0x0C, - 0x7B, 0xF1, 0x6D, 0xB5, 0x8D, 0x18, 0xE4, 0x32, 0x3F, 0x51, 0xC2, 0x20, 0x20, 0xC6, 0x47, 0x22, - 0x08, 0x94, 0x32, 0x99, 0x17, 0x4A, 0x50, 0x36, 0x1E, 0xA2, 0x88, 0xCE, 0x01, 0xAF, 0x78, 0xF5, - 0x6B, 0xF2, 0xA2, 0x0C, 0x8E, 0xC5, 0xE4, 0x31, 0x9C, 0x28, 0xA4, 0x7F, 0x4E, 0x64, 0x1D, 0xF5, - 0xC1, 0x1A, 0x68, 0xE2, 0xF4, 0x3A, 0x99, 0xBC, 0xD3, 0x31, 0xF9, 0xD8, 0x58, 0x7B, 0xB1, 0xB7, - 0x7D, 0x57, 0x2B, 0x7D, 0xAC, 0x4A, 0x43, 0x9E, 0xB2, 0x50, 0x96, 0x06, 0x99, 0x17, 0x89, 0x6A, - 0xA7, 0x2E, 0xC2, 0xB9, 0xA2, 0xBB, 0x96, 0xD4, 0x03, 0xD5, 0xF2, 0xB4, 0xA7, 0x78, 0xE6, 0x65, - 0x31, 0xD2, 0x43, 0x75, 0x4A, 0xD1, 0xB5, 0xE6, 0x07, 0x98, 0x27, 0xAA, 0xBD, 0xCD, 0x32, 0xF1, - 0x80, 0xCE, 0x9E, 0xCD, 0xF2, 0xA1, 0x50, 0xD0, 0x88, 0x02, 0xF0, 0x1C, 0x10, 0x70, 0xAA, 0xA5, - 0xDF, 0x70, 0x32, 0x7E, 0x89, 0xAE, 0x51, 0x37, 0x84, 0x13, 0x18, 0xCE, 0x7D, 0x4C, 0x8A, 0x16, - 0x99, 0xA2, 0x42, 0x9D, 0x5D, 0x9C, 0x81, 0x86, 0x4D, 0x15, 0x96, 0xF0, 0xE6, 0xE1, 0x38, 0x11, - 0xA6, 0x8A, 0x15, 0x14, 0xF7, 0x13, 0xAD, 0x33, 0x81, 0xB5, 0xF4, 0x65, 0x87, 0x87, 0x6F, 0x97, - 0x2F, 0x5D, 0xED, 0xEC, 0xA7, 0xB6, 0x91, 0xE2, 0xF3, 0x7B, 0xE5, 0xC8, 0x7E, 0x3A, 0x26, 0x54, - 0x9C, 0xC3, 0xD3, 0x6C, 0x4B, 0x6A, 0x78, 0x48, 0xF3, 0x0E, 0xCF, 0xBF, 0x9A, 0xC8, 0x60, 0x46, - 0x0B, 0x6C, 0x92, 0x6B, 0x88, 0x6F, 0x42, 0x39, 0xB0, 0xC2, 0x43, 0x8D, 0xA6, 0x4A, 0xF8, 0xF5, - 0x1E, 0x23, 0x74, 0xF7, 0x15, 0xB2, 0x15, 0xEB, 0x5A, 0x2A, 0xCA, 0xA5, 0x2C, 0xCC, 0x3C, 0x7D, - 0x63, 0x65, 0x7F, 0x3A, 0xA8, 0x35, 0xB0, 0x77, 0x54, 0x1A, 0xCB, 0xA5, 0x07, 0x1E, 0x2C, 0x60, - 0x3C, 0x66, 0x32, 0x55, 0x75, 0xEB, 0x57, 0x35, 0xE2, 0xD3, 0xC2, 0x73, 0x5D, 0xF7, 0xC2, 0xB6, - 0xEE, 0x45, 0x1C, 0x19, 0xE6, 0xF9, 0x23, 0x24, 0x23, 0xBA, 0x77, 0x6B, 0x93, 0x73, 0xA0, 0x9C, - 0xF9, 0xF0, 0x59, 0xE7, 0xB4, 0x60, 0xC3, 0xA6, 0x01, 0xEA, 0xC7, 0x52, 0x2B, 0xDC, 0xDC, 0x96, - 0x0F, 0x3C, 0xB0, 0x19, 0x19, 0xE1, 0x52, 0xB6, 0x17, 0x91, 0x2A, 0x4D, 0xC3, 0xFC, 0x44, 0x33, - 0x5F, 0x9D, 0x36, 0x51, 0x3C, 0x02, 0x6D, 0x68, 0x23, 0x64, 0x1B, 0xA0, 0xA3, 0xD7, 0xEA, 0x64, - 0x60, 0xB9, 0xEB, 0xC5, 0x3F, 0xB5, 0x52, 0xC8, 0xC4, 0xC8, 0x73, 0x36, 0x73, 0x28, 0x67, 0xF1, - 0x2A, 0x3C, 0xA6, 0x8A, 0xDB, 0x99, 0x81, 0x90, 0xDF, 0xD7, 0x4C, 0x1F, 0xD1, 0xD9, 0x0D, 0xCE, - 0x6C, 0xD8, 0x8A, 0x03, 0xB4, 0x70, 0x3A, 0x07, 0x2E, 0x2E, 0x5E, 0xA5, 0x5C, 0xBF, 0x51, 0x36, - 0x97, 0x42, 0xA5, 0x76, 0x2A, 0xCA, 0x0A, 0x51, 0x5D, 0x06, 0x78, 0x0E, 0xCF, 0x9E, 0x93, 0x59, - 0x5C, 0x17, 0x05, 0xB6, 0xF2, 0x0D, 0x02, 0xD6, 0x2D, 0x2E, 0x20, 0x62, 0x8D, 0xF7, 0x38, 0xE0, - 0xC1, 0x5E, 0x17, 0x72, 0x4D, 0xA4, 0x2F, 0x5B, 0xDC, 0xC6, 0x40, 0x82, 0x34, 0x04, 0x39, 0x69, - 0xF8, 0xBC, 0xB1, 0x79, 0x54, 0xD5, 0x1E, 0x2D, 0xD8, 0x8C, 0x90, 0x8D, 0xB4, 0xE3, 0x61, 0xB7, - 0x1D, 0xA2, 0x3C, 0xFB, 0x6A, 0x38, 0x98, 0x06, 0xDA, 0x56, 0x2C, 0xBF, 0x9B, 0x14, 0x76, 0xE6, - 0x3C, 0x01, 0x57, 0xCC, 0xC2, 0x08, 0x0C, 0xBC, 0x10, 0x09, 0x67, 0xAB, 0x01, 0x2A, 0x32, 0x6C, - 0x81, 0x2C, 0xAB, 0xD3, 0xEC, 0x7D, 0x87, 0x48, 0x16, 0x28, 0xAC, 0x1D, 0x61, 0x11, 0x31, 0x87, - 0xD6, 0x2B, 0xB0, 0x36, 0xB1, 0x18, 0xDD, 0xE7, 0xD0, 0x46, 0x57, 0x93, 0xFC, 0xDF, 0xD2, 0x3A, - 0x37, 0x49, 0x42, 0xDB, 0xE6, 0x45, 0x46, 0x22, 0xB0, 0xF2, 0x92, 0xEE, 0x52, 0x94, 0x9F, 0xFE, - 0xB1, 0xD2, 0x33, 0x45, 0xAD, 0xC9, 0x6D, 0x11, 0x79, 0x57, 0xF1, 0x80, 0xF4, 0x07, 0xAE, 0xDF, - 0x11, 0x6C, 0x85, 0x58, 0x49, 0x2F, 0x13, 0x81, 0xB9, 0x66, 0x73, 0xAB, 0x84, 0x94, 0x36, 0xC4, - 0xC6, 0x23, 0x5F, 0xC5, 0x36, 0xC6, 0xBE, 0x8E, 0x6B, 0xE9, 0x97, 0xF0, 0xAC, 0xB4, 0xF1, 0x11, - 0x43, 0xB4, 0xD2, 0xC0, 0x79, 0x5E, 0x88, 0x72, 0xC7, 0x46, 0x6B, 0x22, 0xC7, 0xF2, 0x7B, 0x61, - 0xC8, 0xFA, 0x39, 0x65, 0x45, 0x97, 0xF0, 0xC7, 0xCE, 0x74, 0x09, 0x9F, 0x5D, 0xB7, 0x68, 0xF2, - 0x2E, 0x6E, 0x2D, 0x42, 0x56, 0x9C, 0xED, 0xC5, 0x5A, 0x57, 0xD9, 0x53, 0x5A, 0xB4, 0xE8, 0x15, - 0x07, 0x1B, 0xFB, 0x31, 0x40, 0x14, 0x95, 0x77, 0x33, 0x74, 0x71, 0x73, 0x7B, 0xFA, 0xA7, 0xBF, - 0x51, 0xF8, 0x3D, 0xE6, 0xB1, 0xD0, 0x42, 0x25, 0x52, 0xFC, 0x4F, 0x1A, 0xA6, 0x4D, 0xAF, 0xCD, - 0x13, 0x62, 0x7A, 0xBF, 0x22, 0x98, 0xD6, 0x07, 0x9C, 0xAE, 0x5E, 0xFC, 0x96, 0xEC, 0x0E, 0x79, - 0x84, 0x1F, 0x73, 0x60, 0x6C, 0x02, 0x6C, 0xE5, 0xB7, 0xFD, 0x7A, 0x4B, 0x8D, 0x0D, 0xC0, 0xD7, - 0x0A, 0x70, 0x6E, 0xE1, 0x51, 0x0E, 0x8C, 0xAA, 0x02, 0x6A, 0xCF, 0x61, 0x04, 0xBD, 0x53, 0x9D, - 0xE0, 0xB5, 0x28, 0x1E, 0x24, 0xBA, 0x97, 0x13, 0x0C, 0x6E, 0x93, 0x71, 0xE2, 0x68, 0xEC, 0x73, - 0x2C, 0xEC, 0x80, 0xB2, 0x16, 0xD5, 0x38, 0xC6, 0x3B, 0xCE, 0xEB, 0xB9, 0x42, 0xBE, 0x37, 0xB5, - 0x39, 0x31, 0x00, 0x5F, 0xB6, 0xD1, 0xB6, 0xD9, 0x57, 0x34, 0x82, 0x12, 0x07, 0x05, 0x04, 0x4B, - 0x5E, 0xB8, 0xC7, 0x6F, 0xA3, 0x01, 0xB9, 0x1D, 0xFF, 0x5F, 0x52, 0xBF, 0x6E, 0x7B, 0xA8, 0xC3, - 0x6E, 0xAC, 0x00, 0xCD, 0x0A, 0xAB, 0x7D, 0x4E, 0x63, 0x43, 0xCE, 0x10, 0x21, 0x38, 0x42, 0x88, - 0x8D, 0xA7, 0x46, 0x7F, 0x74, 0x1F, 0x1D, 0x5F, 0x25, 0xD2, 0xC0, 0x18, 0x7D, 0x40, 0x61, 0x36, - 0x06, 0xB5, 0x09, 0xCA, 0xC6, 0xAD, 0xD6, 0x9E, 0xED, 0x45, 0xF6, 0x95, 0x32, 0x07, 0x84, 0x71, - 0xC8, 0x35, 0xB0, 0x81, 0x97, 0xC9, 0x60, 0xDE, 0xFD, 0x8E, 0x90, 0x67, 0xD7, 0x23, 0x51, 0x28, - 0x90, 0xA5, 0x6E, 0xB6, 0x59, 0x88, 0xD1, 0x8D, 0xCD, 0x17, 0xA3, 0x48, 0xE3, 0x3F, 0x00, 0x4E, - 0x9B, 0x21, 0xD5, 0xA4, 0x5A, 0xF0, 0xA0, 0xBA, 0x40, 0xB7, 0xBB, 0xE1, 0x3D, 0x16, 0x9E, 0xEE, - 0xBB, 0x9E, 0xB2, 0x91, 0xBD, 0x39, 0x77, 0xD6, 0xB5, 0x9C, 0xB5, 0xE8, 0xCF, 0x7D, 0x8C, 0x83, - 0x82, 0x1A, 0xBA, 0x11, 0xDA, 0xF3, 0x96, 0xDD, 0x09, 0x20, 0x9F, 0xEB, 0xAE, 0x39, 0xAC, 0x7C, - 0xF2, 0x41, 0x98, 0x21, 0x6B, 0x8D, 0x19, 0xFF, 0x36, 0x5E, 0x82, 0xAC, 0xEE, 0x1E, 0x0E, 0x77, - 0x63, 0x14, 0x4E, 0x87, 0xE8, 0x22, 0x01, 0xD4, 0xC4, 0xF3, 0xE6, 0x49, 0xE6, 0x25, 0x64, 0x5C, - 0x54, 0x4B, 0x10, 0xE7, 0xCD, 0x17, 0x8F, 0xFA, 0xA3, 0x4D, 0xCA, 0x49, 0xCA, 0x4D, 0x33, 0xBC, - 0x29, 0x71, 0x4D, 0xF9, 0x0D, 0x74, 0x01, 0xAC, 0x79, 0xA7, 0xD7, 0x75, 0xD3, 0x9B, 0x04, 0xEE, - 0xCB, 0xCD, 0x51, 0xCC, 0xAA, 0x68, 0xFB, 0x41, 0xD3, 0x2D, 0xC1, 0xC8, 0x72, 0xDC, 0x69, 0xBE, - 0x0A, 0x74, 0xFF, 0xA8, 0x0C, 0xB4, 0xE1, 0x1A, 0xD3, 0x30, 0x21, 0xA9, 0x34, 0xCC, 0xB5, 0xE9, - 0xCF, 0x38, 0x48, 0x3B, 0xFC, 0xD6, 0x88, 0xD8, 0xB7, 0x3D, 0x71, 0xE4, 0x36, 0xA2, 0xE6, 0x03, - 0x02, 0xE3, 0xFB, 0x68, 0x0F, 0x07, 0x3B, 0x80, 0x30, 0x1C, 0xF4, 0x88, 0x0D, 0x86, 0x1F, 0x83, - 0x4D, 0x93, 0xD4, 0x10, 0xB1, 0xFF, 0x2C, 0xCB, 0xBE, 0x8E, 0xA8, 0xDB, 0x09, 0xE5, 0xF7, 0x9C, - 0x82, 0x48, 0xE0, 0xC8, 0x2C, 0x7B, 0xA1, 0x46, 0x89, 0xE9, 0x0D, 0x82, 0x6F, 0xC1, 0xEA, 0xA5, - 0x84, 0x82, 0x33, 0x26, 0x4A, 0xB6, 0x84, 0x60, 0x21, 0x00, 0x89, 0x20, 0x84, 0x14, 0x7A, 0xDF, - 0x7B, 0xEB, 0x45, 0x6B, 0x76, 0xE6, 0xDB, 0x53, 0xBE, 0x6A, 0x95, 0xE1, 0xFE, 0x6A, 0x79, 0x07, - 0xBC, 0x9D, 0xB3, 0x37, 0x67, 0xAF, 0xC2, 0x1E, 0x2B, 0xFF, 0x9F, 0xC5, 0xF5, 0x54, 0xE0, 0x29, - 0x44, 0xA4, 0x2A, 0x6F, 0xB7, 0x52, 0x17, 0x2C, 0xB1, 0x72, 0x6E, 0x9F, 0x30, 0x9D, 0x42, 0x41, - 0xF6, 0xD5, 0x14, 0x3E, 0x32, 0x59, 0x42, 0xAD, 0x7A, 0x68, 0x53, 0xF9, 0x99, 0xFD, 0x30, 0xC0, - 0x68, 0xB6, 0x97, 0xD9, 0x1B, 0x9A, 0xF6, 0xB9, 0x06, 0xE2, 0x2E, 0x27, 0x60, 0xE9, 0x1A, 0xBD, - 0x88, 0xCD, 0xAD, 0xE0, 0xCB, 0xED, 0x76, 0x2B, 0x46, 0x24, 0xB0, 0x48, 0xBA, 0x55, 0x9B, 0xBD, - 0x6D, 0xF2, 0xF7, 0x8C, 0x59, 0x4E, 0xB6, 0xE4, 0x89, 0xE1, 0xD4, 0x97, 0x85, 0x15, 0x27, 0xAE, - 0xD0, 0x9A, 0x72, 0x98, 0xB0, 0x6F, 0x06, 0xB9, 0xFC, 0xFD, 0x0D, 0x51, 0x11, 0x7E, 0x02, 0x66, - 0xD2, 0xE7, 0x25, 0xD4, 0x4D, 0xAE, 0x78, 0x9F, 0x8E, 0x69, 0xDD, 0x43, 0x80, 0x2F, 0xE6, 0x6E, - 0x46, 0xD7, 0x1A, 0x05, 0x8F, 0x4B, 0x5E, 0xF7, 0x4E, 0x09, 0x9B, 0xAF, 0x4E, 0x2B, 0x14, 0x91, - 0x59, 0x67, 0xFF, 0xFF, 0xAA, 0x08, 0xE7, 0x25, 0x42, 0x4E, 0x17, 0xD6, 0xDF, 0xD8, 0x23, 0x45, - 0xB4, 0xE2, 0x15, 0xE8, 0xDB, 0xA8, 0x55, 0x81, 0x9B, 0xE3, 0x3F, 0x09, 0x0C, 0x16, 0x19, 0xE6, - 0xE3, 0x7F, 0x1D, 0xB6, 0xBB, 0x14, 0x3C, 0x58, 0xBB, 0x69, 0x5F, 0x7A, 0x1A, 0x51, 0x45, 0xEE, - 0xDB, 0xA5, 0x7F, 0x53, 0x27, 0x04, 0xA0, 0x60, 0x76, 0x7A, 0xAD, 0x29, 0x7A, 0x8B, 0x49, 0x4C, - 0x6D, 0x26, 0x01, 0x45, 0x9B, 0x2F, 0xC8, 0x6B, 0xE0, 0x11, 0x1E, 0xCE, 0x35, 0x18, 0xDA, 0x6A, - 0x7E, 0x14, 0x56, 0xFB, 0x19, 0xE2, 0xBC, 0xAF, 0xE9, 0x62, 0xF9, 0xD4, 0xB7, 0x21, 0x1D, 0x45, - 0x10, 0xB7, 0xF3, 0x10, 0x80, 0xD0, 0xA9, 0x20, 0x12, 0xFB, 0xFA, 0xB9, 0xF6, 0x9B, 0x32, 0xA9, - 0x68, 0x58, 0xD9, 0x97, 0xDD, 0x4D, 0xDB, 0x67, 0x95, 0x35, 0xFE, 0xFA, 0x9A, 0xB2, 0x8D, 0x39, - 0x32, 0xD0, 0x5F, 0x6E, 0x74, 0x62, 0x3F, 0xC0, 0xC9, 0x24, 0x49, 0xC9, 0x65, 0x27, 0x88, 0x52, - 0x60, 0xBB, 0x6B, 0x52, 0xAC, 0x35, 0x90, 0x47, 0xF8, 0x34, 0xF4, 0x8E, 0x9E, 0x43, 0xE6, 0x28, - 0xA5, 0x04, 0xA9, 0x10, 0x09, 0x4F, 0xE0, 0x2E, 0x3E, 0x12, 0xD9, 0xC3, 0xC3, 0xF0, 0xAB, 0x30, - 0x18, 0x13, 0x6C, 0x17, 0x06, 0x2C, 0x03, 0x60, 0x04, 0x5D, 0x0E, 0xC8, 0x7F, 0x80, 0x4B, 0xAD, - 0xAF, 0x34, 0x2B, 0xDC, 0x94, 0x1F, 0x68, 0x0A, 0xAB, 0xA3, 0xD7, 0x19, 0x23, 0x02, 0x8F, 0xBD, - 0xB9, 0x33, 0xD3, 0x93, 0x66, 0xC9, 0x19, 0x18, 0xEF, 0x08, 0x0C, 0xEE, 0xDB, 0xB3, 0x5E, 0x55, - 0xB2, 0xDC, 0xBB, 0x90, 0x02, 0x2B, 0x90, 0x67, 0x41, 0x3E, 0x65, 0xA0, 0x9B, 0xC4, 0x5D, 0x81, - 0xDC, 0x64, 0x82, 0xA9, 0x86, 0xA7, 0xB1, 0x1C, 0x6C, 0x7B, 0xA2, 0x07, 0xF1, 0xE0, 0x8E, 0x4F, - 0xBF, 0x07, 0x20, 0x48, 0x05, 0xE5, 0x1D, 0xB6, 0xD8, 0x83, 0x45, 0x7C, 0xAD, 0x84, 0x32, 0x94, - 0xCA, 0x88, 0x96, 0xAA, 0x07, 0xE8, 0x7B, 0x0A, 0x89, 0x46, 0x98, 0x2F, 0x93, 0x65, 0xEB, 0x7B, - 0x79, 0x50, 0x8C, 0x8D, 0x01, 0x6D, 0xCE, 0xB4, 0x5E, 0x1E, 0x74, 0x6D, 0xC3, 0x29, 0x0B, 0x34, - 0xB6, 0xB8, 0xE7, 0x9C, 0x2D, 0x71, 0x49, 0x65, 0x07, 0x1A, 0x7D, 0x04, 0x74, 0x42, 0xD7, 0x0D, - 0x96, 0x80, 0x85, 0xFC, 0x5D, 0x29, 0x79, 0x54, 0x8F, 0x08, 0x2A, 0x7F, 0xF2, 0xB8, 0x87, 0x13, - 0x29, 0x6E, 0xC4, 0xB7, 0x99, 0xBB, 0xC5, 0x6C, 0x4D, 0x01, 0x38, 0xB5, 0xFF, 0x93, 0xEC, 0x0F, - 0x96, 0xA5, 0x47, 0x78, 0xD1, 0xC0, 0x63, 0x61, 0xE0, 0x2D, 0xE4, 0x56, 0x7C, 0xAC, 0x77, 0x30, - 0x21, 0x55, 0x32, 0xFD, 0x4E, 0xC0, 0x31, 0x9B, 0x7C, 0x37, 0x04, 0x8B, 0xAB, 0x95, 0x03, 0xAC, - 0x22, 0x9E, 0x1F, 0x86, 0x2A, 0xB5, 0xD9, 0x32, 0x56, 0xCC, 0x4E, 0xE5, 0x1A, 0x70, 0x65, 0x5B, - 0x32, 0xC7, 0x1D, 0x96, 0x73, 0x62, 0x49, 0xB3, 0xC5, 0xA1, 0x83, 0xEB, 0x32, 0x6B, 0x6E, 0x17, - 0xC2, 0xD2, 0xBA, 0x90, 0x3B, 0xB5, 0x99, 0x18, 0x34, 0x4D, 0x15, 0x57, 0x19, 0xCD, 0x3C, 0xE1, - 0xCF, 0x55, 0x4A, 0x44, 0xD0, 0xFD, 0xD1, 0x29, 0xB5, 0x86, 0xA1, 0xAA, 0xB0, 0x6C, 0x30, 0xEE, - 0x14, 0xC2, 0x9E, 0x02, 0x31, 0xDF, 0x13, 0x0D, 0xC6, 0xFA, 0x9F, 0xC1, 0x17, 0xF1, 0x52, 0x08, - 0x8B, 0xBB, 0x81, 0xB8, 0x92, 0x7B, 0x19, 0x0F, 0x5E, 0x7A, 0xDF, 0xEB, 0x86, 0x8C, 0x5F, 0x6C, - 0x7A, 0xE9, 0xF1, 0x26, 0x55, 0x80, 0xFF, 0xBC, 0x6A, 0x0A, 0xBC, 0x23, 0xAB, 0xE8, 0x8E, 0xC3, - 0xA5, 0xD7, 0xFD, 0x52, 0x73, 0x68, 0x4B, 0x56, 0x7F, 0x60, 0x4A, 0x68, 0x84, 0x30, 0xE1, 0x1F, - 0x0C, 0x10, 0x41, 0x71, 0xFC, 0x10, 0xDF, 0x62, 0xCC, 0x4D, 0xD6, 0x2A, 0x7F, 0xB9, 0xAF, 0x46, - 0x94, 0x3A, 0xD7, 0x0F, 0x12, 0x2C, 0xB8, 0x17, 0x1F, 0x56, 0xF3, 0xCD, 0xA0, 0xE7, 0xBF, 0xA4, - 0xFB, 0xC5, 0xE8, 0x17, 0x4B, 0x8A, 0xE5, 0x3E, 0x96, 0x22, 0x17, 0x07, 0xA3, 0x17, 0x0A, 0x77, - 0x98, 0xF8, 0x9B, 0x59, 0x5C, 0x2F, 0xC9, 0x73, 0xA4, 0x5A, 0x17, 0x1F, 0xBD, 0x56, 0x3E, 0xA2, - 0xE6, 0x8F, 0x34, 0xF2, 0xE0, 0x20, 0x37, 0xE4, 0x98, 0xE1, 0xEC, 0xC4, 0x1E, 0x81, 0x13, 0x17, - 0x21, 0x95, 0x88, 0x60, 0x04, 0xDA, 0x91, 0xB9, 0x22, 0xF8, 0x64, 0x87, 0x8D, 0x32, 0x60, 0x37, - 0x33, 0x2E, 0x2B, 0x95, 0x43, 0x0C, 0x10, 0xDF, 0xFC, 0x64, 0x56, 0x89, 0x32, 0x47, 0xA3, 0x8F, - 0xF1, 0x3E, 0x34, 0x63, 0x35, 0xD9, 0x41, 0xD8, 0x1A, 0x23, 0x88, 0x39, 0x6D, 0x23, 0x2A, 0x20, - 0xCE, 0xFB, 0x80, 0x0F, 0x59, 0xB7, 0xFB, 0x1E, 0x24, 0xF5, 0x8A, 0x78, 0x2B, 0xE8, 0x13, 0x52, - 0x34, 0x5B, 0x65, 0x64, 0xAB, 0x78, 0x4D, 0x5C, 0x79, 0x3B, 0xF2, 0x7D, 0x1F, 0x5B, 0xA9, 0x37, - 0xAE, 0x4C, 0x9E, 0x30, 0x6B, 0x39, 0x3D, 0x75, 0x06, 0xCE, 0xFE, 0x87, 0xB7, 0x1B, 0x9C, 0x9F, - 0x44, 0x7E, 0x98, 0xFF, 0x3B, 0xA6, 0x71, 0x48, 0xE3, 0x07, 0x8C, 0x5E, 0x95, 0x96, 0x04, 0xC1, - 0xBF, 0x7A, 0x18, 0x06, 0xC2, 0xD2, 0x24, 0xD6, 0xC9, 0x4D, 0x65, 0xCE, 0x18, 0x8F, 0x8B, 0x0D, - 0xFC, 0x66, 0x40, 0xB1, 0xE6, 0xE5, 0xC5, 0xDE, 0xAE, 0x2E, 0x84, 0x3F, 0xBA, 0x16, 0x5A, 0x63, - 0x72, 0x0F, 0x3C, 0x82, 0x4A, 0xD7, 0x54, 0x54, 0x60, 0x1B, 0x6A, 0x16, 0x2D, 0xDA, 0x0F, 0xF9, - 0x61, 0xD2, 0x53, 0x2B, 0xE4, 0x22, 0x0E, 0x1D, 0x08, 0x69, 0x5D, 0x4D, 0x4D, 0x3E, 0x99, 0xBE, - 0x8A, 0x83, 0xA2, 0x5A, 0x68, 0x8B, 0xBB, 0x6A, 0xA5, 0x31, 0xB9, 0x65, 0xA6, 0x55, 0xD1, 0x09, - 0x8D, 0x6B, 0xAB, 0xD8, 0xF1, 0x06, 0x62, 0xA8, 0x1A, 0xDA, 0xA4, 0x4B, 0x68, 0xA9, 0xB8, 0xA5, - 0x9D, 0xD1, 0xAA, 0x42, 0x8E, 0x67, 0xA8, 0xC6, 0x29, 0x94, 0x69, 0x38, 0xA0, 0x66, 0x84, 0xBB, - 0x73, 0x3B, 0xFC, 0x7D, 0x6B, 0xCD, 0x39, 0x8F, 0x1C, 0x6C, 0xE0, 0x58, 0x97, 0x75, 0xB7, 0x09, - 0x40, 0x68, 0x45, 0xCD, 0x97, 0x78, 0x1A, 0x81, 0xA9, 0x6D, 0x6C, 0x59, 0xB8, 0x0C, 0x7D, 0x94, - 0x46, 0x23, 0xCC, 0xD4, 0x2D, 0x71, 0x95, 0x7F, 0x9F, 0x08, 0xE0, 0xE5, 0xF9, 0xC0, 0x2C, 0xC4, - 0x09, 0x27, 0x7C, 0x62, 0x5E, 0xF4, 0xB6, 0xAA, 0x9D, 0x18, 0x10, 0xCE, 0xCB, 0xCA, 0xFC, 0xC2, - 0x12, 0x5A, 0xC2, 0xC7, 0xFA, 0x47, 0x3B, 0x4A, 0x5C, 0xC7, 0x52, 0xCA, 0x97, 0xD4, 0xC3, 0x90, - 0x1D, 0x04, 0x50, 0x92, 0xFF, 0xCC, 0xA9, 0x85, 0x4D, 0x1F, 0x73, 0xE3, 0x5B, 0x4D, 0x20, 0xCA, - 0x46, 0x89, 0xD5, 0x26, 0x2B, 0xF5, 0x6B, 0x2A, 0x0B, 0x9C, 0x36, 0x15, 0x9A, 0xB2, 0x15, 0xC1, - 0xAF, 0x38, 0x3D, 0xA5, 0x4B, 0x47, 0x56, 0x32, 0x90, 0x60, 0x93, 0x5D, 0x8C, 0xE4, 0x3D, 0x3A, - 0x00, 0xB2, 0x84, 0x92, 0xE7, 0x9C, 0x09, 0xD4, 0x55, 0x01, 0xFC, 0xFC, 0x3C, 0x0B, 0x6B, 0x0B, - 0xD4, 0x39, 0x7B, 0x88, 0x40, 0x08, 0xDE, 0x2D, 0xFC, 0x9E, 0xEF, 0xFE, 0xCA, 0x45, 0xB6, 0x8F, - 0xDD, 0x59, 0x49, 0x16, 0x9B, 0x26, 0x88, 0x7F, 0x83, 0xA0, 0x29, 0x14, 0xA6, 0x96, 0x51, 0x1D, - 0x36, 0xCF, 0x7D, 0x01, 0x2E, 0xC3, 0xC5, 0xC2, 0x49, 0xAB, 0x70, 0xAC, 0x66, 0x08, 0xA4, 0xB7, - 0xB5, 0x37, 0x34, 0xEB, 0xD1, 0xA1, 0x52, 0xB1, 0xF8, 0x1C, 0x88, 0x36, 0x32, 0x00, 0xA4, 0x5B, - 0x3B, 0x93, 0x34, 0x20, 0x5F, 0xA9, 0x9B, 0x1E, 0xA6, 0xF9, 0xFC, 0xC5, 0x34, 0x2E, 0x64, 0xCE, - 0x97, 0x44, 0x71, 0x0D, 0x09, 0x89, 0xF2, 0x68, 0x41, 0xF9, 0x64, 0xA0, 0xFC, 0xE2, 0x43, 0x14, - 0x77, 0xB1, 0x68, 0x2C, 0xE6, 0xCB, 0xD4, 0x82, 0xE0, 0xF1, 0x93, 0x00, 0x50, 0x9F, 0x14, 0x6F, - 0x78, 0xDC, 0x7B, 0xC2, 0xD6, 0x31, 0x29, 0x85, 0xA6, 0xEB, 0x50, 0xEC, 0xA6, 0xDD, 0xAA, 0x50, - 0x65, 0x94, 0xEE, 0x68, 0xC3, 0x11, 0xAA, 0xB7, 0xA7, 0xEE, 0xBB, 0x39, 0x08, 0xA6, 0xE8, 0xC5, - 0x4E, 0x52, 0x84, 0xDD, 0xE6, 0x16, 0xF5, 0xC3, 0xAC, 0xB0, 0xBE, 0x3F, 0xA0, 0xC9, 0x1F, 0x17, - 0xC0, 0x8D, 0x7C, 0x80, 0x27, 0xAE, 0xBB, 0x47, 0x32, 0x94, 0x01, 0xCB, 0x72, 0x12, 0xCB, 0x74, - 0x56, 0x58, 0x17, 0x30, 0x57, 0x6C, 0x94, 0x08, 0xD4, 0x60, 0x50, 0x41, 0x35, 0xAB, 0xBD, 0x0B, - 0xA7, 0x43, 0x1B, 0x53, 0x19, 0xBA, 0x05, 0x67, 0xAF, 0x4C, 0xAD, 0x76, 0xBA, 0x7D, 0x75, 0x8E, - 0x64, 0x0C, 0xDD, 0xFB, 0xD9, 0x84, 0x3F, 0xB0, 0x57, 0x4D, 0x8C, 0xA0, 0x0F, 0xD9, 0xE0, 0x53, - 0xB9, 0x1D, 0xAE, 0xE1, 0xCC, 0x9E, 0xD5, 0x79, 0xDA, 0xB4, 0x0C, 0x0B, 0xDD, 0x95, 0x28, 0xDD, - 0x7F, 0x73, 0x43, 0x83, 0xC5, 0x45, 0x14, 0x00, 0xBA, 0x00, 0x9C, 0xC0, 0xC8, 0x62, 0x34, 0x66, - 0xF9, 0x78, 0x57, 0x0B, 0x9F, 0x85, 0xEE, 0x49, 0xF6, 0xA9, 0x86, 0x05, 0x6B, 0x0E, 0x1F, 0x26, - 0xD0, 0xD9, 0xEB, 0xA8, 0x5B, 0x9B, 0xCD, 0x4E, 0x25, 0x07, 0xE1, 0xE0, 0x60, 0xA0, 0xFB, 0x17, - 0x7C, 0x41, 0xAA, 0x20, 0xFE, 0x83, 0x25, 0x3A, 0x9A, 0x02, 0x87, 0x0A, 0x71, 0x87, 0xE5, 0xD3, - 0xC1, 0xDC, 0x85, 0xC8, 0xFA, 0x71, 0x2A, 0xCF, 0xA1, 0xF7, 0x44, 0x13, 0x9C, 0x03, 0x56, 0xC3, - 0x7A, 0xEE, 0x51, 0x35, 0x3C, 0x27, 0x30, 0xF3, 0x3E, 0x31, 0x5F, 0x00, 0x51, 0xA7, 0x1C, 0x92, - 0xA4, 0xE1, 0xC3, 0x43, 0x12, 0x03, 0x3C, 0xEE, 0xD3, 0xFA, 0x1C, 0x6A, 0x0F, 0xE0, 0x45, 0xBB, - 0x3B, 0x81, 0xF1, 0x37, 0x46, 0x9C, 0x6E, 0x21, 0x74, 0xFA, 0x93, 0x52, 0xF4, 0x57, 0x95, 0x81, - 0xD3, 0x57, 0x44, 0x5E, 0xF0, 0x54, 0x18, 0x3C, 0xFB, 0x3A, 0xE7, 0x10, 0x67, 0xF2, 0x20, 0x24, - 0x09, 0xD2, 0x6D, 0xAB, 0xC2, 0xBA, 0x3C, 0x30, 0xE9, 0x65, 0xF1, 0x50, 0xFB, 0x11, 0xB6, 0xCF, - 0x85, 0x7B, 0x6A, 0x4A, 0x56, 0x59, 0x59, 0xB7, 0xDE, 0xFB, 0xC8, 0x39, 0x6A, 0x52, 0x6D, 0xE6, - 0xB7, 0xC7, 0x7A, 0x62, 0x01, 0x25, 0x3D, 0x54, 0x54, 0xB4, 0xF2, 0xBA, 0xF9, 0xEE, 0xE3, 0x59, - 0xD0, 0x74, 0xB5, 0xBF, 0xDF, 0x3E, 0x3F, 0x87, 0x64, 0x82, 0xD9, 0xD5, 0xF9, 0xE8, 0xBB, 0xC5, - 0xA5, 0x61, 0x91, 0x9C, 0x2C, 0x99, 0xC0, 0x39, 0xB3, 0xEF, 0x33, 0x5E, 0x3E, 0x1E, 0x00, 0xC6, - 0x5A, 0x90, 0x1C, 0x50, 0x43, 0x3D, 0x4B, 0xA1, 0x3F, 0x46, 0xEB, 0xBA, 0x86, 0xA4, 0xEA, 0xE1, - 0xA9, 0x40, 0x97, 0x5A, 0x80, 0x97, 0x36, 0x1C, 0xA8, 0x19, 0x4E, 0x0D, 0xF8, 0xCB, 0x1C, 0xC7, - 0xD4, 0x1C, 0xB1, 0x4C, 0x2E, 0xDB, 0x2D, 0x96, 0x1E, 0xBA, 0xEB, 0x3D, 0xDE, 0x7D, 0xC7, 0x2E, - 0xF8, 0x36, 0x54, 0x5C, 0x94, 0xD0, 0x5A, 0x0E, 0x5D, 0xF6, 0x4D, 0x35, 0xD2, 0xC1, 0x52, 0xC7, - 0x3B, 0x58, 0x43, 0xEB, 0xB6, 0x54, 0xBA, 0xA5, 0xF1, 0x86, 0xDB, 0x23, 0xAB, 0x6A, 0x42, 0x00, - 0x90, 0xD2, 0x0C, 0x76, 0x32, 0xA0, 0xC2, 0xE3, 0x10, 0x0E, 0x0C, 0x8A, 0x7C, 0xA5, 0x5F, 0xC9, - 0x4E, 0x79, 0x6E, 0x38, 0x0D, 0xA1, 0xD8, 0x7E, 0x90, 0xDD, 0xA4, 0x35, 0x33, 0xBF, 0xCE, 0x69, - 0x8F, 0x93, 0xBC, 0xB4, 0xC8, 0xD2, 0xD1, 0xD8, 0x2F, 0x31, 0xF8, 0x0B, 0x12, 0x8B, 0xA2, 0xAA, - 0x7B, 0x36, 0x5F, 0x66, 0x0D, 0xF6, 0x34, 0x0F, 0xA7, 0x6A, 0xF3, 0x52, 0x4A, 0xB3, 0xCE, 0x83, - 0xB5, 0x57, 0x11, 0x74, 0xBF, 0x1D, 0x5E, 0xA4, 0x18, 0x84, 0xC6, 0xE4, 0xAC, 0x42, 0x93, 0x82, - 0x99, 0xF1, 0x4B, 0xE2, 0x07, 0x0E, 0x0C, 0xAD, 0xC4, 0x7E, 0x24, 0xC7, 0xF9, 0x22, 0x34, 0x31, - 0x0B, 0xC9, 0xBF, 0xA8, 0x74, 0xE9, 0xDE, 0xE8, 0x61, 0xDC, 0xC2, 0x49, 0x95, 0x78, 0x6F, 0x2D, - 0x46, 0x76, 0xD8, 0x2F, 0xA9, 0x56, 0x00, 0x38, 0x74, 0x54, 0xBB, 0x66, 0xE5, 0x9B, 0xA1, 0xAB, - 0xE4, 0x1E, 0x46, 0x71, 0x90, 0xC1, 0xF8, 0x16, 0x8A, 0x8F, 0x76, 0xE6, 0x4F, 0x06, 0xE8, 0xE8, - 0xAA, 0x25, 0xF2, 0x75, 0x3A, 0x0D, 0xBD, 0xF6, 0x40, 0xEE, 0x64, 0xE0, 0xF4, 0xD5, 0xBB, 0x76, - 0x7A, 0x8B, 0x43, 0xD8, 0x75, 0xD3, 0xAF, 0x1A, 0xE7, 0x59, 0x5E, 0x8E, 0xC8, 0xE4, 0xD9, 0x7C, - 0x3E, 0x02, 0x4D, 0xBE, 0x00, 0xD9, 0x6F, 0x46, 0xF1, 0x4A, 0x5B, 0x33, 0x97, 0x6E, 0x54, 0x5A, - 0x3A, 0x41, 0x6F, 0xC0, 0xB7, 0x3E, 0x78, 0xE5, 0xCF, 0x75, 0x1C, 0xEE, 0xD8, 0xA1, 0xEE, 0xD0, - 0x37, 0x94, 0xFE, 0x63, 0x1B, 0x2F, 0x63, 0x7A, 0xFE, 0x22, 0xCD, 0x32, 0xE1, 0xB6, 0xF8, 0x21, - 0x33, 0xDA, 0xCE, 0xB4, 0x91, 0x25, 0x21, 0x67, 0xA2, 0x6D, 0x5D, 0x49, 0xBD, 0x77, 0x92, 0x60, - 0xA3, 0x56, 0xBF, 0x1E, 0x1B, 0xF8, 0xE9, 0x40, 0xC5, 0xBF, 0x06, 0xFC, 0x14, 0xBC, 0xBC, 0x62, - 0xC0, 0xCB, 0x8D, 0x67, 0x7E, 0xDD, 0xB9, 0xCE, 0x66, 0xE2, 0x52, 0xC1, 0x21, 0x68, 0x93, 0xB4, - 0x6F, 0xFC, 0x81, 0x1F, 0x41, 0xD7, 0x7F, 0x10, 0xCF, 0x35, 0x9B, 0x72, 0xC6, 0xBC, 0x05, 0x5D, - 0x7D, 0x63, 0x09, 0xB4, 0xA8, 0x62, 0xAA, 0x42, 0x51, 0xC1, 0xC0, 0xF0, 0x2D, 0xE2, 0xBE, 0x6D, - 0x54, 0x53, 0x55, 0x7B, 0x39, 0x0A, 0xB0, 0x2A, 0xE0, 0x45, 0x0A, 0xEF, 0xD7, 0x7E, 0xB9, 0xAF, - 0xB9, 0xDA, 0x22, 0x5D, 0x65, 0xD5, 0x39, 0x0F, 0xE4, 0x2B, 0x8E, 0xAA, 0x79, 0xC9, 0xFB, 0xF0, - 0x00, 0x51, 0xE6, 0x59, 0x3F, 0x12, 0x54, 0x4A, 0x29, 0x23, 0xD3, 0x6A, 0x9F, 0xB9, 0x0D, 0x99, - 0x1E, 0x8A, 0xF6, 0x55, 0xD3, 0xDC, 0x8A, 0x48, 0xC3, 0xE5, 0x16, 0xDA, 0xFF, 0xB0, 0x3B, 0x92, - 0x49, 0xD6, 0x00, 0xB1, 0x13, 0x8E, 0xC2, 0x3F, 0x7C, 0xF9, 0x48, 0x55, 0xD5, 0xAC, 0xEA, 0x8A, - 0xC1, 0x5C, 0xA9, 0x48, 0xEA, 0x71, 0xDA, 0x99, 0xE9, 0x49, 0xBA, 0xD8, 0x1F, 0xF2, 0xB2, 0x51, - 0x5D, 0x13, 0xC7, 0x6A, 0x82, 0x8E, 0x64, 0x3A, 0x11, 0x56, 0x66, 0x24, 0x2D, 0xC1, 0x7D, 0x3A, - 0xB2, 0x45, 0xB6, 0xAE, 0x10, 0x8F, 0xBD, 0xD6, 0x9F, 0xAB, 0x44, 0xA7, 0x4A, 0x5D, 0x92, 0x7D, - 0x8F, 0xE5, 0x59, 0x4A, 0x10, 0x85, 0xFD, 0x3C, 0x40, 0x3B, 0xBF, 0xDF, 0xA7, 0x3A, 0x1D, 0xB5, - 0x67, 0x23, 0xF9, 0xAC, 0x59, 0x31, 0x2F, 0xD9, 0xD6, 0xF5, 0xEA, 0xD1, 0xDE, 0xAE, 0xFA, 0x44, - 0xFD, 0xE0, 0xBE, 0xE3, 0xF7, 0xEA, 0xD5, 0xF0, 0x26, 0x41, 0xE5, 0x3D, 0xBE, 0xAA, 0xFC, 0x57, - 0x49, 0xAE, 0x3E, 0x70, 0x8F, 0x9D, 0xF1, 0xB6, 0x32, 0x7D, 0xE7, 0x21, 0x4A, 0x7E, 0x99, 0xD7, - 0x90, 0xFE, 0xC5, 0xB2, 0xE8, 0xAC, 0x6D, 0xF7, 0x3C, 0xD3, 0x1E, 0x61, 0xF4, 0xFF, 0x8C, 0x13, - 0x5A, 0x7F, 0x87, 0x66, 0x47, 0x84, 0xF8, 0x3B, 0x0B, 0x70, 0xCF, 0xBA, 0x0C, 0x87, 0x93, 0x62, - 0x65, 0x1E, 0x47, 0xFC, 0x96, 0x25, 0x46, 0x01, 0xE0, 0xCE, 0xE2, 0x41, 0xC6, 0x38, 0x90, 0x0D, - 0xE3, 0xC7, 0x60, 0x4E, 0x08, 0x0F, 0x02, 0xF5, 0xB8, 0x70, 0x27, 0x89, 0x29, 0x6E, 0x79, 0x85, - 0x12, 0xA4, 0xCA, 0x6C, 0x69, 0xBE, 0x52, 0xFF, 0xBD, 0xCF, 0x3E, 0x07, 0xA8, 0x7B, 0x00, 0x44, - 0xE0, 0x3B, 0xA6, 0x50, 0xFF, 0xF9, 0xDA, 0x0D, 0xEB, 0xCC, 0x70, 0x21, 0x20, 0x5F, 0xF4, 0xAF, - 0x1B, 0x2C, 0xF8, 0x63, 0x9C, 0xB9, 0x8F, 0x0B, 0xBF, 0x1C, 0xA5, 0x85, 0xA6, 0x9A, 0x0A, 0x93, - 0x1E, 0x8B, 0xA3, 0x80, 0x63, 0x30, 0x24, 0xE1, 0xF0, 0xB6, 0x7B, 0x93, 0xC5, 0x72, 0xE9, 0x49, - 0x91, 0x1D, 0xB0, 0x77, 0xC0, 0xA2, 0x1D, 0xC9, 0x66, 0x90, 0xF7, 0x58, 0x92, 0x87, 0x4F, 0xB0, - 0x0D, 0x0A, 0x48, 0x16, 0x5F, 0x7D, 0xF4, 0xA6, 0xC9, 0x80, 0xD2, 0x38, 0xD6, 0xC7, 0xEE, 0x73, - 0xA6, 0xA8, 0x57, 0xC9, 0xAA, 0x32, 0x6A, 0x3C, 0xA7, 0x9F, 0x89, 0x79, 0x8B, 0xD9, 0x6B, 0x8C, - 0xB1, 0x26, 0x5D, 0x4B, 0xE9, 0xF0, 0x9D, 0xFA, 0xC0, 0xD3, 0xEA, 0x82, 0xDA, 0x7C, 0xCB, 0x43, - 0x90, 0x74, 0x24, 0xC6, 0xBD, 0x5B, 0x87, 0x29, 0xCA, 0xEC, 0x6E, 0xBA, 0x7C, 0x41, 0xF9, 0x99, - 0x0A, 0x92, 0xFA, 0x43, 0xAE, 0xE7, 0xF9, 0xFB, 0x55, 0x5B, 0x3A, 0xCC, 0x1C, 0xC5, 0x20, 0x37, - 0x53, 0x4A, 0x83, 0xC6, 0x79, 0x5A, 0x42, 0xF9, 0x23, 0x62, 0xA1, 0x3A, 0x42, 0xCE, 0x51, 0xC5, - 0x5D, 0xC9, 0x99, 0x1F, 0x82, 0xE7, 0x43, 0x72, 0x46, 0x70, 0x80, 0x25, 0x65, 0x98, 0x78, 0xC2, - 0xF9, 0xD4, 0x07, 0x2D, 0xAB, 0x79, 0x7D, 0x45, 0xC3, 0x0B, 0xEE, 0x18, 0xBB, 0x3C, 0x33, 0xE5, - 0x8B, 0xE5, 0x2A, 0x04, 0x53, 0x7C, 0x92, 0x92, 0x3E, 0x77, 0xE6, 0xB5, 0x8A, 0x7C, 0xAC, 0x3F, - 0xEA, 0xFC, 0x19, 0x64, 0xFD, 0xB4, 0xA3, 0x33, 0xCC, 0xBB, 0xE3, 0x5F, 0xBA, 0xAB, 0x9F, 0x2A, - 0x4E, 0x71, 0x96, 0x4D, 0x8D, 0x33, 0x39, 0x02, 0x0F, 0x6B, 0xFB, 0xC7, 0x76, 0x0D, 0xC4, 0x9D, - 0xB0, 0x6C, 0xA3, 0x91, 0x32, 0x23, 0x60, 0xF9, 0x53, 0x3C, 0x48, 0xCF, 0x54, 0x4A, 0x34, 0x6A, - 0x90, 0xB8, 0xDB, 0xB6, 0xFD, 0xD8, 0xB9, 0x79, 0xF1, 0x5D, 0x64, 0xFC, 0x2C, 0x6E, 0xA2, 0xD2, - 0x4D, 0x37, 0x56, 0xCB, 0x8D, 0xE9, 0xC9, 0x02, 0x3A, 0x7F, 0x53, 0x75, 0x98, 0x46, 0xF9, 0x8E, - 0xE2, 0x00, 0x05, 0x20, 0x8E, 0xAD, 0xAA, 0x38, 0x5F, 0x6A, 0x34, 0x16, 0x2E, 0x25, 0xFF, 0x7F, - 0xE2, 0x10, 0x2D, 0x49, 0x2C, 0xEF, 0xB5, 0xE5, 0x8A, 0x2A, 0x1F, 0x6F, 0x6C, 0x49, 0xF7, 0x78, - 0x80, 0xCA, 0xFA, 0x14, 0x5D, 0xAE, 0xA9, 0xCD, 0xC5, 0xB8, 0xA8, 0xDC, 0xFF, 0x84, 0xC5, 0x80, - 0x8E, 0x98, 0x5F, 0x7E, 0xF6, 0x26, 0xBB, 0x35, 0xF7, 0xA7, 0x40, 0x46, 0x83, 0x26, 0xDF, 0x3B, - 0x64, 0xE0, 0x67, 0x7A, 0xBE, 0x08, 0xF4, 0xE6, 0x1A, 0xF8, 0xFD, 0xBA, 0x0E, 0xBE, 0xB2, 0x28, - 0x6C, 0x45, 0xEA, 0xB1, 0x6C, 0xA8, 0x8E, 0x4F, 0xB8, 0xBC, 0x82, 0x0A, 0xD1, 0x84, 0xAB, 0x03, - 0x6C, 0x30, 0x85, 0xA1, 0x2C, 0x72, 0xA3, 0x08, 0x25, 0x4C, 0x97, 0x32, 0xEB, 0xAD, 0x0E, 0x3E, - 0xE8, 0x8E, 0x2B, 0xF0, 0xCF, 0x13, 0xCA, 0xD1, 0x53, 0xC6, 0xCD, 0x58, 0x98, 0xDE, 0xB0, 0x7E, - 0x0D, 0xBF, 0x94, 0x3E, 0xA7, 0x1C, 0x84, 0xBC, 0xB3, 0x9B, 0x6D, 0x54, 0x32, 0x39, 0x89, 0xF8, - 0x02, 0xAF, 0xBC, 0xB2, 0x53, 0x3B, 0x43, 0xF2, 0xCC, 0xC9, 0x05, 0xF2, 0xC4, 0x88, 0x37, 0x6E, - 0xE1, 0xA1, 0x55, 0x82, 0x7E, 0xBE, 0x83, 0xE0, 0x0B, 0xF8, 0x96, 0x45, 0x61, 0xC1, 0x96, 0x28, - 0x6D, 0x64, 0xCF, 0xF9, 0xC1, 0xC7, 0x3A, 0x18, 0xF3, 0x9A, 0x69, 0x2B, 0x07, 0x57, 0x55, 0xE8, - 0x09, 0xCB, 0x33, 0xC5, 0x4F, 0xBF, 0x0F, 0x9A, 0x22, 0xB1, 0xB3, 0x50, 0x15, 0xA3, 0xCB, 0x8D, - 0x6E, 0x29, 0x56, 0x89, 0x64, 0xAF, 0x5B, 0x0D, 0xD4, 0xE2, 0x6F, 0x6A, 0x38, 0xBD, 0xD8, 0xA1, - 0x7D, 0x0A, 0x6F, 0x7B, 0x07, 0x89, 0x5B, 0xD2, 0xFB, 0x34, 0x5F, 0xA9, 0x0F, 0x41, 0x18, 0xD3, - 0x99, 0xFD, 0xA8, 0x88, 0xFD, 0x4B, 0x9B, 0xCA, 0xAE, 0x5A, 0xB0, 0xEE, 0x23, 0x0F, 0x4B, 0x5C, - 0x99, 0xEA, 0x29, 0xF3, 0xF6, 0x97, 0x5F, 0xF9, 0xAF, 0x28, 0x4F, 0xEC, 0xD6, 0x01, 0x69, 0x8B, - 0x65, 0x08, 0x55, 0xCA, 0x05, 0xC0, 0xB4, 0xB2, 0x64, 0x2A, 0xF5, 0x3E, 0xDA, 0xA2, 0xD2, 0xBB, - 0xDF, 0x17, 0xFF, 0xCF, 0x9E, 0xDE, 0x8A, 0x1E, 0x5F, 0xFD, 0xEA, 0x12, 0x0F, 0xFF, 0x96, 0x20, - 0x0A, 0x15, 0xE6, 0x9B, 0x4F, 0x12, 0x0B, 0xCC, 0x39, 0x4D, 0xFD, 0xD4, 0x7A, 0xDA, 0x24, 0x11, - 0x2D, 0x93, 0x92, 0x9F, 0x3E, 0x3F, 0xA2, 0x9B, 0xAD, 0x98, 0x13, 0xE2, 0x5F, 0xF2, 0x7E, 0x84, - 0xA1, 0x43, 0xAB, 0x76, 0xB8, 0xFC, 0xA0, 0x01, 0x17, 0x38, 0xB3, 0x33, 0x13, 0x4A, 0xF5, 0x15, - 0xA5, 0x56, 0x66, 0xC5, 0x44, 0x0C, 0x88, 0x75, 0x76, 0xA5, 0x7E, 0x57, 0xD4, 0x22, 0xE5, 0x32, - 0x99, 0x60, 0x99, 0x7C, 0x65, 0x29, 0xBA, 0xB0, 0x5B, 0x1F, 0x84, 0x98, 0x0C, 0x06, 0x8A, 0xAE, - 0x96, 0x63, 0x91, 0xB1, 0x75, 0xE6, 0xE6, 0x7A, 0xBF, 0x1E, 0xB5, 0xB6, 0x76, 0x1B, 0xE2, 0xBF, - 0xB4, 0x1F, 0x4D, 0x33, 0xF9, 0x9D, 0x9C, 0x79, 0xE6, 0xF5, 0xA3, 0x8C, 0x72, 0xFE, 0xAE, 0xB1, - 0x13, 0x09, 0x20, 0x91, 0x7C, 0x11, 0x99, 0x68, 0x1A, 0xA7, 0x6B, 0x3F, 0x88, 0xC7, 0xF5, 0x94, - 0x0D, 0xBC, 0x3B, 0xA5, 0x14, 0xD7, 0x8B, 0xA0, 0xA0, 0x70, 0xB4, 0xC2, 0x4E, 0x2F, 0xA8, 0xB1, - 0x0D, 0x7B, 0x8C, 0xD4, 0x96, 0xC1, 0xD1, 0xC5, 0x13, 0x67, 0x24, 0x16, 0x3C, 0xC0, 0xFD, 0x79, - 0x3C, 0x11, 0x69, 0x03, 0xF6, 0x55, 0xF7, 0xF2, 0x09, 0x8B, 0x49, 0x5B, 0xDA, 0x05, 0x3C, 0xDB, - 0x1C, 0x01, 0x1F, 0xDC, 0x4D, 0xE2, 0x09, 0xB6, 0x1F, 0x5F, 0xE2, 0xB0, 0xDF, 0x77, 0xF8, 0x83, - 0x59, 0xCF, 0xEE, 0x8B, 0x14, 0x12, 0xEB, 0xBC, 0x9B, 0xB4, 0x38, 0xFD, 0x38, 0x53, 0xC9, 0xA1, - 0x4E, 0xF6, 0x80, 0xA8, 0xE5, 0x25, 0x89, 0x97, 0xCF, 0x94, 0x06, 0xE4, 0x25, 0xDF, 0x86, 0x46, - 0xA2, 0x54, 0xA7, 0x04, 0xB5, 0xCA, 0x67, 0xF1, 0x95, 0x65, 0x57, 0xE1, 0x38, 0x61, 0xCB, 0x20, - 0xE5, 0x98, 0xF4, 0x07, 0x95, 0x25, 0xBD, 0xBE, 0x9F, 0x87, 0x76, 0x4D, 0x52, 0x96, 0xAE, 0x82, - 0xAE, 0x2C, 0x3C, 0xB6, 0x7C, 0x1A, 0x36, 0xE5, 0x34, 0x13, 0x1B, 0x72, 0x52, 0x8F, 0xFF, 0xE7, - 0x6B, 0x83, 0xDB, 0x88, 0x4A, 0xDB, 0x95, 0x37, 0xFA, 0x9D, 0xA2, 0x49, 0xDB, 0x5A, 0xE3, 0x5C, - 0x95, 0xC7, 0xF8, 0xE0, 0x14, 0x38, 0xB2, 0xCD, 0x09, 0xF4, 0x2A, 0x2A, 0xF7, 0x1A, 0xA1, 0x8E, - 0xB8, 0xBC, 0x3B, 0x51, 0x9A, 0xE4, 0xD1, 0xCF, 0xA7, 0xD1, 0xF9, 0x63, 0x0F, 0x98, 0x3D, 0x61, - 0x51, 0xEC, 0x1B, 0x67, 0x68, 0x88, 0x25, 0x65, 0x0B, 0xA6, 0x32, 0xA2, 0xCD, 0x93, 0xE1, 0x16, - 0x01, 0x12, 0xB2, 0xDA, 0x35, 0xBA, 0x52, 0x66, 0x46, 0x44, 0x8D, 0xB3, 0x19, 0x33, 0xC1, 0x1F, - 0x47, 0x6C, 0x48, 0x7B, 0x5C, 0x8C, 0xA8, 0x68, 0x74, 0xDE, 0x7C, 0xB4, 0xDF, 0x05, 0x54, 0x35, - 0x8A, 0xFE, 0x78, 0xB5, 0x05, 0x78, 0xC3, 0xB4, 0x85, 0x12, 0x88, 0xBB, 0x49, 0x17, 0x46, 0x5D, - 0x7D, 0x1F, 0xF4, 0xB5, 0xD9, 0xEF, 0x62, 0xBA, 0xC4, 0x86, 0x61, 0x0B, 0xE0, 0xC5, 0xEE, 0x69, - 0xEC, 0xF9, 0x52, 0x93, 0x3F, 0xC7, 0x69, 0xE4, 0xD2, 0x9C, 0xE0, 0xEB, 0xB5, 0x5A, 0x55, 0xCE, - 0x87, 0xA3, 0x1C, 0x52, 0x2E, 0xC5, 0x99, 0x92, 0x7F, 0x10, 0x06, 0xC4, 0xA2, 0x5B, 0x77, 0x3D, - 0x53, 0xE8, 0xCA, 0xB5, 0x3B, 0x18, 0x58, 0x54, 0xC6, 0x63, 0xDB, 0x1D, 0xB6, 0x75, 0xD2, 0x69, - 0x64, 0x8A, 0x69, 0x0E, 0xF9, 0x57, 0x41, 0x4C, 0xC2, 0xF3, 0x59, 0x0A, 0x60, 0x76, 0x67, 0x4A, - 0xE6, 0xE8, 0x63, 0xB5, 0x0A, 0x39, 0xDE, 0x95, 0xD6, 0xFB, 0xD4, 0xEC, 0xA3, 0xBD, 0x1A, 0xB1, - 0x8F, 0x54, 0x1C, 0xD7, 0x39, 0x50, 0x8F, 0x92, 0x0D, 0x33, 0x9F, 0x49, 0x10, 0xB2, 0x73, 0x87, - 0x83, 0xF0, 0x72, 0x9D, 0xE7, 0xEA, 0x14, 0xC7, 0x5A, 0x23, 0x6F, 0x54, 0x3E, 0xB5, 0x86, 0x6D, - 0xD6, 0xE2, 0x3E, 0x97, 0x96, 0x5F, 0xF4, 0x1A, 0xFD, 0x8B, 0x96, 0x9B, 0x14, 0xD7, 0x25, 0x3A, - 0x96, 0x25, 0x7B, 0xBE, 0x32, 0x46, 0xC3, 0x20, 0x4E, 0x01, 0x98, 0x0A, 0x27, 0x53, 0x58, 0xFA, - 0xAF, 0x14, 0xE6, 0x6B, 0x99, 0x32, 0x85, 0x87, 0x8F, 0xDA, 0x09, 0x7C, 0x92, 0x9D, 0x4C, 0x87, - 0xF6, 0xB3, 0x67, 0x61, 0xA2, 0x7C, 0x25, 0x5D, 0x4E, 0xA7, 0x6F, 0xF0, 0xCB, 0x6C, 0x6A, 0xC3, - 0xE2, 0x19, 0x33, 0xBE, 0x73, 0x95, 0xE1, 0xBA, 0x39, 0x09, 0x7F, 0xAE, 0x72, 0x8A, 0x4E, 0x74, - 0xA1, 0xBF, 0x5B, 0x1D, 0x34, 0x89, 0xF0, 0x94, 0xE6, 0x84, 0x3C, 0x64, 0x29, 0x04, 0x07, 0x34, - 0xC3, 0x32, 0xEF, 0xF6, 0xE5, 0x24, 0x54, 0x09, 0xFA, 0x81, 0xDB, 0xF1, 0xCF, 0xE5, 0xDB, 0x98, - 0x27, 0xC0, 0xEB, 0xDA, 0x10, 0x73, 0x74, 0x76, 0xCA, 0xD7, 0xFE, 0xDF, 0x82, 0x63, 0x0F, 0x31, - 0x03, 0xBE, 0x10, 0xF4, 0xF6, 0x76, 0xDD, 0x27, 0xAD, 0xE4, 0xC1, 0xFA, 0xC5, 0x5A, 0x71, 0x8D, - 0x59, 0x39, 0x41, 0x6C, 0xDD, 0xFB, 0x4C, 0x5C, 0xB0, 0xB8, 0xF9, 0x67, 0x9C, 0xD7, 0x90, 0x44, - 0xE2, 0xF3, 0x39, 0x4C, 0x84, 0x1A, 0x13, 0x3F, 0xF2, 0xDF, 0x77, 0xA5, 0xF6, 0xAB, 0x69, 0x37, - 0x18, 0x56, 0x03, 0x86, 0xE9, 0xB7, 0xC8, 0xD8, 0x5A, 0xA1, 0x87, 0x00, 0xBC, 0x14, 0x44, 0xFF, - 0x21, 0xDD, 0xAC, 0x99, 0xD2, 0x78, 0xDF, 0x0C, 0xF3, 0xAC, 0x5F, 0xF4, 0x56, 0xE4, 0xAB, 0xCF, - 0x5F, 0x1C, 0x60, 0x7E, 0xFA, 0xDA, 0x36, 0x8A, 0xF2, 0xD4, 0x80, 0x64, 0xC5, 0x54, 0x53, 0xCA, - 0xF3, 0x80, 0x9A, 0x3C, 0x7C, 0x7B, 0x32, 0x30, 0x14, 0xB7, 0x17, 0x9B, 0x42, 0x7C, 0x94, 0x0D, - 0xC4, 0x43, 0x5B, 0xB0, 0x86, 0xE9, 0x1F, 0x80, 0xCD, 0x45, 0x97, 0x3D, 0x8A, 0xD0, 0x22, 0x91, - 0xA0, 0x14, 0xA5, 0xD7, 0x71, 0x07, 0x8D, 0xAB, 0x69, 0xE8, 0x38, 0x98, 0xEE, 0x70, 0x3D, 0x7B, - 0x86, 0x13, 0xDE, 0xAF, 0xE5, 0x89, 0x5A, 0x5F, 0x1F, 0xF9, 0xA5, 0x3F, 0xED, 0x62, 0xE6, 0x65, - 0x3B, 0x86, 0xF9, 0x76, 0xD6, 0x5A, 0x57, 0x54, 0x8B, 0x0D, 0x39, 0xEC, 0x9F, 0x00, 0xBF, 0x4E, - 0xF8, 0x62, 0x51, 0x83, 0x74, 0x16, 0x00, 0x3A, 0x4F, 0x71, 0x18, 0x73, 0xF0, 0x41, 0x71, 0xB4, - 0xDC, 0x79, 0xFC, 0x32, 0xDB, 0x38, 0x0C, 0x3F, 0x1B, 0x66, 0xA4, 0x27, 0xED, 0xA7, 0xE2, 0xE6, - 0xB0, 0x51, 0xF6, 0xBD, 0xEF, 0x2E, 0x0E, 0x10, 0x8F, 0x1D, 0x40, 0xDF, 0x85, 0x67, 0xC7, 0x25, - 0x11, 0x7F, 0x50, 0x99, 0xC8, 0xAE, 0xDF, 0x6A, 0xAF, 0x70, 0x8C, 0xD4, 0xB5, 0x6A, 0xA5, 0x21, - 0x1C, 0xBF, 0x0C, 0x75, 0xA2, 0x40, 0x03, 0x17, 0x58, 0x8C, 0x84, 0x4D, 0x82, 0x29, 0xE5, 0x7C, - 0x05, 0xA1, 0xAF, 0x48, 0x07, 0xD1, 0xF7, 0x53, 0xBC, 0x02, 0xF7, 0xCD, 0x60, 0x35, 0xEE, 0x04, - 0x03, 0xE1, 0x3A, 0xAA, 0x71, 0x54, 0x5B, 0xDD, 0x86, 0x68, 0xFB, 0xC6, 0xBC, 0xCF, 0xCD, 0x55, - 0xBC, 0x0E, 0x0D, 0x8D, 0x7B, 0x70, 0x1F, 0xE4, 0xEC, 0x2C, 0x91, 0x22, 0xF6, 0x55, 0xC9, 0x07, - 0x0F, 0x26, 0x60, 0x4F, 0xB0, 0x27, 0xFA, 0xAB, 0xBF, 0x3B, 0xF1, 0x3F, 0x52, 0xB8, 0xC7, 0x7B, - 0x52, 0xBF, 0x6E, 0xA4, 0x87, 0xCD, 0x40, 0x62, 0x4D, 0xDA, 0xD1, 0x37, 0x77, 0x44, 0xB3, 0x1D, - 0xD6, 0x2F, 0x9A, 0xA8, 0x61, 0x54, 0x6A, 0x1E, 0x2E, 0xE2, 0xC0, 0xBF, 0x7D, 0xAD, 0xB9, 0xDB, - 0x52, 0x5C, 0x0F, 0x15, 0x7F, 0x40, 0x8B, 0xC3, 0x4E, 0xC5, 0xC3, 0x59, 0x5A, 0x19, 0x3F, 0xA1, - 0xB3, 0x58, 0x3A, 0xC2, 0x06, 0x5B, 0x16, 0xF8, 0xEA, 0xFA, 0xB6, 0x8D, 0x93, 0xFF, 0xC4, 0x96, - 0x2C, 0x9F, 0xD0, 0xAB, 0x5A, 0x2B, 0x81, 0x17, 0xA9, 0x71, 0x38, 0x0F, 0x01, 0xEF, 0x5A, 0xC0, - 0xE9, 0x9F, 0x8B, 0x63, 0x47, 0x89, 0x50, 0xC2, 0xFB, 0x8A, 0x8B, 0x9F, 0xEE, 0xC4, 0xC4, 0x7A, - 0xDC, 0xAD, 0xC3, 0x6A, 0x70, 0xA4, 0x71, 0x53, 0xFD, 0xA9, 0x0D, 0xC0, 0x62, 0x23, 0xB8, 0x9D, - 0xAE, 0xA2, 0x12, 0x0B, 0x18, 0x42, 0xB6, 0x93, 0x2A, 0x85, 0x60, 0x09, 0x59, 0x69, 0x52, 0x1F, - 0x1E, 0xBA, 0xBF, 0x0F, 0xA6, 0x8E, 0xB0, 0x8A, 0x03, 0xCA, 0xC5, 0x1C, 0x8E, 0x89, 0xF2, 0x50, - 0xD7, 0x1A, 0xA9, 0x63, 0x83, 0x0F, 0x6D, 0x06, 0x27, 0x1F, 0x40, 0xDA, 0x0B, 0x9E, 0xEB, 0x1F, - 0x7E, 0x4F, 0x8A, 0xF0, 0x38, 0x86, 0x08, 0xC6, 0x3A, 0xFF, 0x29, 0xCC, 0xA7, 0x10, 0x27, 0xF3, - 0x99, 0x3E, 0x52, 0xF3, 0x0F, 0x83, 0x93, 0x9F, 0x63, 0xE8, 0x23, 0x41, 0x71, 0x98, 0x25, 0x1B, - 0xC9, 0x89, 0x15, 0x8F, 0xC8, 0x72, 0x35, 0x72, 0x7D, 0xF2, 0x36, 0x31, 0x64, 0xF5, 0x3A, 0x4C, - 0x15, 0x9B, 0x30, 0x77, 0x36, 0x03, 0xB9, 0xEE, 0xCA, 0x61, 0x22, 0x7C, 0xCF, 0xEE, 0x6C, 0xE4, - 0xEC, 0x83, 0x67, 0x10, 0x07, 0x7A, 0x21, 0x97, 0xDF, 0xC3, 0x2A, 0x27, 0x47, 0xDB, 0x1A, 0x76, - 0x2D, 0xA5, 0x9D, 0xD7, 0x39, 0x54, 0x4F, 0x62, 0x9C, 0xFD, 0x77, 0x0E, 0xB0, 0x4A, 0x0A, 0xD9, - 0x46, 0xC2, 0x28, 0x49, 0xB0, 0x53, 0x99, 0x2A, 0xC2, 0x81, 0xF9, 0x8A, 0xE1, 0x01, 0xDA, 0xCC, - 0x31, 0x60, 0x9B, 0x32, 0x4B, 0x69, 0x2B, 0x89, 0x00, 0xDA, 0xCD, 0x41, 0x0B, 0x13, 0xC0, 0x3C, - 0x4A, 0xD0, 0x32, 0x0A, 0x45, 0x31, 0x54, 0x38, 0x9E, 0x74, 0x56, 0x60, 0x8A, 0xFA, 0x0C, 0x0C, - 0xC8, 0xDC, 0x4E, 0x12, 0x9A, 0xD0, 0x2B, 0xAC, 0xF3, 0x16, 0xD3, 0xE4, 0x5C, 0xA8, 0x3B, 0x8A, - 0x8E, 0x04, 0x4B, 0x09, 0xDE, 0x91, 0x1C, 0xF2, 0x3D, 0xB5, 0x27, 0x23, 0x9A, 0x5F, 0xCA, 0xCE, - 0x1D, 0x81, 0x25, 0xD3, 0x0B, 0x07, 0x3B, 0xA2, 0xED, 0xC1, 0x68, 0xA3, 0x10, 0x1E, 0x49, 0xED, - 0x2B, 0x02, 0xD4, 0x65, 0x6B, 0xDE, 0xF7, 0xE8, 0x3D, 0xC3, 0x41, 0x1E, 0x75, 0xDB, 0xD0, 0xE4, - 0xA7, 0xFF, 0xFC, 0xB3, 0x0D, 0xAE, 0x72, 0x6D, 0xF2, 0x16, 0xF9, 0x4C, 0x9B, 0x2C, 0x83, 0x55, - 0x53, 0x32, 0xB1, 0x4E, 0xE7, 0x7E, 0x7F, 0xF6, 0xBE, 0xE4, 0x7A, 0xF3, 0xDB, 0x73, 0xA5, 0xDC, - 0xB3, 0x1F, 0x1B, 0x9E, 0x93, 0x58, 0x58, 0x4C, 0xDB, 0xED, 0x8C, 0x02, 0xB7, 0x43, 0x10, 0x7F, - 0x32, 0xF0, 0xFC, 0xD2, 0xDA, 0x18, 0xA6, 0x74, 0x80, 0x12, 0x9C, 0xBB, 0xB9, 0xA9, 0x03, 0x76, - 0xC9, 0x4E, 0xE0, 0xE3, 0x63, 0x96, 0xC8, 0x32, 0x04, 0x06, 0x15, 0x52, 0xD1, 0xB6, 0x03, 0x1B, - 0x5D, 0xF2, 0x40, 0x43, 0x37, 0xCF, 0x7C, 0xF5, 0xC4, 0xAB, 0x8B, 0x83, 0x63, 0x5D, 0xE3, 0x3B, - 0x3B, 0x66, 0xE6, 0x19, 0xEF, 0x51, 0x6B, 0x60, 0x6F, 0x3E, 0x71, 0x3D, 0x8E, 0x5A, 0x77, 0xD2, - 0x57, 0x9A, 0x06, 0xE9, 0xBB, 0x8A, 0x50, 0x58, 0x90, 0xF1, 0x17, 0xD7, 0x18, 0x9C, 0x24, 0x65, - 0x3D, 0x40, 0xA5, 0xA1, 0xD8, 0x24, 0x4B, 0xAA, 0x8A, 0x47, 0x3F, 0x0D, 0xB6, 0x60, 0xE6, 0x75, - 0xCD, 0x45, 0x6D, 0x54, 0xD9, 0x67, 0x65, 0xE0, 0x04, 0xCC, 0xBE, 0xCC, 0xAA, 0x8E, 0x3D, 0xB9, - 0x1E, 0x03, 0x25, 0x25, 0x31, 0x88, 0x36, 0xF6, 0x52, 0xD7, 0x4E, 0x75, 0xB5, 0xEA, 0x05, 0x83, - 0x59, 0xAD, 0xAF, 0xF4, 0x13, 0xCE, 0x5D, 0xF4, 0x52, 0x98, 0xBC, 0x63, 0xFE, 0xB0, 0xC5, 0x55, - 0xBD, 0x5A, 0x65, 0x3E, 0xAF, 0x24, 0x4C, 0x5E, 0xEA, 0x9A, 0x44, 0x32, 0x0E, 0x39, 0xCA, 0x60, - 0xB2, 0xBF, 0x62, 0x40, 0x19, 0x57, 0xDE, 0x7C, 0x70, 0xD7, 0xC3, 0x0E, 0x9A, 0x98, 0x6F, 0x26, - 0x22, 0x45, 0xC4, 0xD1, 0x8E, 0x6B, 0xC9, 0x3F, 0x1E, 0x71, 0x4F, 0x2E, 0x86, 0x42, 0x73, 0x00, - 0xEB, 0x98, 0x22, 0x03, 0x1F, 0x6F, 0xC3, 0xAF, 0xD0, 0x55, 0x8F, 0x95, 0x6F, 0x8E, 0x4B, 0xF0, - 0x21, 0x1D, 0xA7, 0xB1, 0xE8, 0x6B, 0xC7, 0x8A, 0xAD, 0x69, 0xD7, 0x6A, 0x7F, 0x09, 0x3A, 0x9F, - 0xBF, 0x30, 0x27, 0x18, 0x00, 0x11, 0xF2, 0x96, 0xAB, 0x57, 0xD3, 0x67, 0x5D, 0x2A, 0x36, 0xCF, - 0xE2, 0x05, 0xBB, 0x01, 0x83, 0x0B, 0xC7, 0x6D, 0xE9, 0xFD, 0x5A, 0xC8, 0x0D, 0x9C, 0xC0, 0xA2, - 0x41, 0x8D, 0x0E, 0x53, 0xB2, 0xD2, 0x2B, 0xD8, 0xE5, 0x4C, 0xEE, 0x81, 0x52, 0xED, 0xE8, 0xEA, - 0xF1, 0xF3, 0x2A, 0x5D, 0xEC, 0x2D, 0x0E, 0xFD, 0x76, 0x26, 0x4C, 0x25, 0x78, 0x26, 0x6F, 0x2F, - 0xF7, 0x31, 0xAB, 0xC0, 0x6C, 0x80, 0x1F, 0x2B, 0x8B, 0x1E, 0xC1, 0x09, 0x46, 0x5E, 0x94, 0x19, - 0xED, 0x07, 0x94, 0xEC, 0xCF, 0x3B, 0xC6, 0x51, 0x29, 0xC2, 0x87, 0xD4, 0x55, 0xD0, 0xAD, 0x82, - 0x66, 0x27, 0x61, 0x18, 0xDD, 0xB8, 0xBD, 0xF9, 0xE1, 0xCA, 0xAA, 0xBA, 0x49, 0x39, 0xD6, 0x43, - 0xA9, 0x10, 0x12, 0x7C, 0xA6, 0x82, 0xD8, 0xDB, 0x11, 0x76, 0x9D, 0xF0, 0x92, 0xFB, 0x31, 0xC1, - 0x9C, 0x31, 0x78, 0x1C, 0x11, 0xD6, 0xF3, 0x1F, 0x14, 0x39, 0xC6, 0x33, 0x46, 0x58, 0x8C, 0xE9, - 0x2B, 0x87, 0x94, 0xA6, 0xFA, 0x55, 0x5A, 0x3C, 0x39, 0x60, 0xD0, 0x26, 0x0F, 0xB3, 0x56, 0x18, - 0x77, 0x9C, 0x1B, 0x01, 0xBA, 0xE6, 0xB2, 0x1E, 0x8B, 0xA0, 0x63, 0x2D, 0x7E, 0xA2, 0x30, 0xFC, - 0xDF, 0x31, 0x99, 0xB2, 0xD6, 0x1E, 0xD3, 0xAB, 0xB7, 0xFA, 0x72, 0xB0, 0x6F, 0xE5, 0x6B, 0x9F, - 0xAF, 0xB4, 0xF0, 0x53, 0x06, 0x9C, 0xB0, 0x98, 0x6B, 0xF4, 0x5A, 0x52, 0xDB, 0xD0, 0x13, 0xED, - 0x73, 0x70, 0x11, 0xBB, 0xD0, 0x98, 0x58, 0xCA, 0x29, 0x44, 0xCB, 0x7C, 0x2D, 0x43, 0xDE, 0x4F, - 0xBF, 0x13, 0x06, 0xDD, 0x3C, 0x69, 0x49, 0xD2, 0xD7, 0xA7, 0x24, 0x9E, 0x0D, 0x3C, 0x8C, 0x73, - 0x0F, 0xB2, 0x4F, 0x16, 0x83, 0x7E, 0x7B, 0x3A, 0xD4, 0x49, 0x42, 0x26, 0x9C, 0x6F, 0xAF, 0xD6, - 0x73, 0xEF, 0x29, 0x3D, 0x1A, 0x21, 0x58, 0x48, 0xF7, 0xEE, 0xD2, 0xC8, 0x06, 0x4D, 0xB2, 0x3D, - 0x1E, 0xD6, 0xF6, 0xF3, 0x25, 0xC8, 0xD5, 0xF4, 0xB6, 0x07, 0x2C, 0xB0, 0x03, 0xDE, 0x83, 0xE0, - 0x1C, 0x68, 0x2E, 0x78, 0xB6, 0xDA, 0x99, 0xA6, 0xBD, 0xE8, 0x1D, 0x47, 0x6E, 0x7A, 0x4C, 0xC5, - 0xE4, 0x54, 0xEA, 0xDB, 0xB1, 0x6F, 0x9F, 0x53, 0xA6, 0x41, 0xE2, 0x24, 0x6C, 0x9C, 0x88, 0xF7, - 0x88, 0xA8, 0x90, 0x0D, 0x34, 0x61, 0xAA, 0x7D, 0x52, 0x5F, 0x8D, 0x81, 0xBE, 0xC9, 0x3E, 0x36, - 0x8D, 0x69, 0x81, 0x0D, 0x24, 0x7D, 0xCE, 0x03, 0xB8, 0x4E, 0x9C, 0xFD, 0x5A, 0x4A, 0x45, 0xAF, - 0x45, 0xB5, 0xFF, 0x49, 0xEA, 0x6C, 0xF7, 0xB9, 0xE5, 0xC1, 0xA6, 0x57, 0xF3, 0xCA, 0xCC, 0x46, - 0xD2, 0x20, 0xB3, 0xB1, 0xC0, 0x18, 0xEE, 0x82, 0xE4, 0x00, 0x3C, 0xA7, 0x8B, 0xA6, 0x3A, 0xDA, - 0x82, 0x53, 0x3C, 0x42, 0x4C, 0x3B, 0x16, 0xD0, 0x3E, 0x0E, 0xBA, 0x36, 0xA6, 0xEA, 0x36, 0x16, - 0x80, 0xA3, 0x51, 0xFD, 0xF8, 0xFA, 0xE5, 0x75, 0x64, 0x17, 0x0C, 0xE5, 0xAE, 0xB2, 0xE5, 0x14, - 0xC1, 0xA9, 0xAE, 0x3A, 0x7E, 0x4D, 0x0E, 0x5C, 0x67, 0x31, 0x02, 0xD2, 0x4D, 0xB3, 0xD6, 0xC6, - 0xE6, 0x86, 0xC2, 0x62, 0xE6, 0xB6, 0x53, 0x2C, 0x29, 0x72, 0x90, 0x55, 0xAC, 0x1C, 0xE7, 0x7F, - 0x7F, 0xA3, 0xE8, 0x21, 0xF0, 0x2D, 0x3E, 0x8A, 0xA3, 0xA2, 0xA2, 0x29, 0xEC, 0x36, 0x4B, 0x89, - 0x1C, 0xB6, 0xC1, 0xB9, 0x4A, 0x8F, 0x65, 0xDF, 0x97, 0x29, 0x0F, 0x0B, 0xB1, 0x61, 0x24, 0xA2, - 0xD2, 0x57, 0x7A, 0x99, 0xF7, 0x1D, 0xC8, 0xB4, 0xDD, 0xEE, 0x7A, 0xBE, 0x2E, 0x46, 0x9A, 0xF6, - 0x92, 0x13, 0xAC, 0x98, 0x64, 0x4C, 0xDD, 0x6B, 0x03, 0xD3, 0xF4, 0x14, 0xC9, 0x7D, 0xCE, 0x9B, - 0xF7, 0xD4, 0x80, 0xB1, 0x2A, 0x66, 0x33, 0xA4, 0xE2, 0x45, 0x99, 0x95, 0x77, 0xE1, 0x3E, 0x8A, - 0x43, 0x85, 0xD9, 0x79, 0x69, 0x0D, 0x55, 0xCF, 0x09, 0xF4, 0xFC, 0x07, 0x39, 0x20, 0x26, 0xB4, - 0x8B, 0xD0, 0x60, 0xFB, 0x42, 0x41, 0xEF, 0x02, 0x5F, 0x0D, 0xC7, 0x7F, 0x09, 0xFA, 0x26, 0x94, - 0x7A, 0xCD, 0xDE, 0x43, 0x86, 0x44, 0xD6, 0xC6, 0xB1, 0x77, 0x13, 0xB1, 0x08, 0xC9, 0xDD, 0x99, - 0xF0, 0xED, 0x7B, 0xB0, 0xAB, 0x31, 0x6D, 0x5B, 0x66, 0xA3, 0x53, 0xE2, 0x3B, 0x0F, 0x31, 0xA2, - 0x63, 0x6E, 0x05, 0xAD, 0xC6, 0x74, 0xC5, 0x2D, 0xB3, 0x79, 0xEB, 0x66, 0xF3, 0x6B, 0x79, 0x02, - 0x7A, 0x7D, 0x49, 0x59, 0x30, 0x04, 0x29, 0xD8, 0x5E, 0xF7, 0xF3, 0x6C, 0x5E, 0xC2, 0xA6, 0xFF, - 0x1B, 0x5A, 0xFE, 0x01, 0x54, 0x40, 0xEF, 0xA0, 0xD5, 0xDB, 0x47, 0xED, 0x2A, 0x9B, 0x85, 0x12, - 0x9F, 0x74, 0x5D, 0xB7, 0xA6, 0x80, 0x22, 0x34, 0x87, 0x81, 0x7E, 0x15, 0x87, 0x62, 0x03, 0x87, - 0x62, 0x6B, 0x85, 0xF1, 0x37, 0x55, 0x55, 0x31, 0x18, 0xBD, 0xEF, 0x57, 0x1D, 0x21, 0x5E, 0x87, - 0x37, 0x53, 0x61, 0x7B, 0xA5, 0x80, 0x71, 0x2C, 0x72, 0x83, 0x64, 0x73, 0xF2, 0x4C, 0xA0, 0x3F, - 0x4C, 0x3E, 0x21, 0xF3, 0x96, 0xBB, 0x9C, 0x05, 0xE1, 0x12, 0x47, 0xA2, 0x6E, 0xF6, 0x67, 0xFE, - 0x1B, 0x3F, 0x74, 0xA5, 0x6B, 0x2E, 0xB3, 0x77, 0x02, 0x64, 0x30, 0xAF, 0x6C, 0x64, 0x2E, 0x69, - 0x92, 0xA5, 0xD3, 0xA8, 0xEE, 0xEF, 0xB7, 0x89, 0xD9, 0x31, 0x1B, 0x61, 0xC8, 0x91, 0xF1, 0xC5, - 0x59, 0x7D, 0xCE, 0xDF, 0xFB, 0xF2, 0x10, 0xF7, 0x42, 0x02, 0xEC, 0x70, 0x2F, 0xE4, 0x02, 0xB4, - 0xFB, 0xA0, 0xFC, 0x83, 0x58, 0x68, 0xA2, 0x8E, 0x01, 0x8B, 0x10, 0xF6, 0x30, 0x86, 0xAA, 0x5A, - 0xC4, 0x95, 0x61, 0x02, 0x8E, 0xF2, 0xB7, 0x6B, 0x6C, 0x80, 0x5C, 0xCB, 0x11, 0x66, 0x97, 0x60, - 0x70, 0xD4, 0x06, 0xA9, 0xC7, 0x80, 0xE3, 0x2C, 0xA4, 0xE1, 0xAA, 0x34, 0x92, 0x13, 0x57, 0x05, - 0xF9, 0x70, 0xF3, 0xF4, 0x80, 0x73, 0xF2, 0x16, 0xDA, 0xBD, 0x39, 0x51, 0xD1, 0x40, 0xC1, 0x59, - 0x04, 0xCD, 0xE4, 0x79, 0x63, 0x24, 0x69, 0xC6, 0x99, 0x2F, 0x4D, 0x0D, 0x1C, 0x9C, 0x15, 0xED, - 0x41, 0x47, 0x12, 0x78, 0x6F, 0x8E, 0xFF, 0xA7, 0x34, 0xB8, 0x8B, 0x0C, 0x70, 0x96, 0x07, 0x0B, - 0x49, 0x42, 0x59, 0xFE, 0x5A, 0x08, 0x76, 0x36, 0x3D, 0x7D, 0xBA, 0x10, 0x1B, 0x11, 0xB4, 0x6B, - 0x1C, 0x59, 0x60, 0x02, 0x36, 0x30, 0xD9, 0xEC, 0xBA, 0xEE, 0x22, 0xFD, 0x0F, 0x2E, 0xA2, 0xE2, - 0x70, 0x9C, 0x0D, 0x18, 0x58, 0x88, 0x4A, 0x0D, 0xE7, 0x0E, 0xEF, 0xD8, 0x6F, 0xA7, 0x70, 0x12, - 0x9D, 0x06, 0x4C, 0x8C, 0xAD, 0x1A, 0x28, 0x01, 0xB6, 0x23, 0x53, 0x76, 0xDD, 0x3F, 0x17, 0x87, - 0x0B, 0xC1, 0xEB, 0x9C, 0x44, 0x67, 0x1B, 0x79, 0xE0, 0x67, 0xB2, 0x2A, 0x99, 0x72, 0xEB, 0x4C, - 0xB4, 0x17, 0x2E, 0xB5, 0xE8, 0x52, 0x1E, 0xCB, 0x3A, 0x3D, 0xF7, 0xF2, 0x21, 0xC7, 0xF1, 0x29, - 0x97, 0x22, 0x31, 0x2C, 0x39, 0x8A, 0xAF, 0x47, 0xF9, 0x3B, 0xA9, 0x8B, 0x2B, 0xEF, 0xE2, 0xF0, - 0x11, 0x59, 0xFC, 0xE4, 0x56, 0xFF, 0x4E, 0xA7, 0x92, 0xE5, 0xE5, 0x26, 0x16, 0xC8, 0x2C, 0x35, - 0xD2, 0x70, 0x9F, 0xAE, 0xA7, 0x08, 0x16, 0x2B, 0x64, 0xA1, 0xF6, 0xF3, 0xC1, 0x43, 0x27, 0x92, - 0x46, 0x4E, 0xA2, 0x01, 0x72, 0x18, 0x08, 0xAB, 0x22, 0x42, 0x1B, 0x9E, 0x35, 0xAE, 0xB3, 0xE6, - 0x42, 0x1B, 0x49, 0x31, 0xBB, 0xA4, 0xD0, 0xD6, 0x7A, 0xEB, 0xFE, 0x32, 0x37, 0x7F, 0xE6, 0x2F, - 0x75, 0x54, 0x1D, 0x88, 0x9F, 0x81, 0xEE, 0xF0, 0x97, 0xC9, 0x12, 0x80, 0x47, 0x5C, 0xCA, 0x3B, - 0x45, 0xF4, 0x63, 0xC3, 0x16, 0x2D, 0x7E, 0xCD, 0x80, 0xC2, 0xBA, 0x50, 0x1D, 0xC2, 0x31, 0x72, - 0xF0, 0x27, 0x97, 0xB0, 0xF4, 0x69, 0x43, 0x2B, 0x26, 0x89, 0x28, 0xFC, 0xBD, 0x03, 0x6A, 0x4A, - 0x22, 0x5D, 0xD3, 0x7D, 0xEC, 0xC8, 0xEC, 0x7B, 0x15, 0xFA, 0x05, 0x5D, 0x73, 0x6B, 0x5B, 0x1B, - 0xC9, 0x83, 0xD0, 0xFA, 0x24, 0xBA, 0x97, 0x11, 0x30, 0x04, 0xD3, 0x11, 0xCE, 0x24, 0xBD, 0x71, - 0xB7, 0xAA, 0xB2, 0xC2, 0x43, 0xC2, 0x67, 0x3B, 0x9C, 0x28, 0x62, 0x52, 0xF0, 0xFA, 0xCB, 0xFA, - 0xDF, 0x4F, 0xC9, 0x23, 0xD1, 0x94, 0xE1, 0x5F, 0x2A, 0xF2, 0xC7, 0x5F, 0x76, 0x6B, 0x86, 0x28, - 0x29, 0xF1, 0x54, 0x4F, 0x7A, 0x4D, 0xFD, 0xD0, 0x51, 0xFA, 0xBC, 0x6F, 0x7B, 0x44, 0xE5, 0xB0, - 0xF3, 0xC0, 0x34, 0x80, 0x6D, 0xE6, 0xDD, 0xCD, 0x7F, 0x67, 0x7B, 0x15, 0xC5, 0xE5, 0x14, 0x64, - 0x80, 0x81, 0xD9, 0x47, 0xCE, 0x71, 0x62, 0x94, 0xCE, 0x41, 0x61, 0xFA, 0xDD, 0x5A, 0x6D, 0xC1, - 0x28, 0x87, 0x39, 0xC4, 0xBC, 0x89, 0x3A, 0x99, 0x18, 0x80, 0xDC, 0x50, 0x72, 0xCF, 0x67, 0x4D, - 0x77, 0x6D, 0x6A, 0xB4, 0x17, 0x85, 0xD6, 0x2B, 0xC3, 0x4A, 0x7C, 0xD1, 0xF3, 0x0E, 0xA4, 0x8F, - 0x3B, 0xDA, 0x8A, 0x7B, 0x0A, 0x37, 0x7D, 0x36, 0xEC, 0x89, 0x87, 0xD9, 0x88, 0xB7, 0xC9, 0x1F, - 0xEB, 0xEE, 0x25, 0x46, 0xA9, 0x3B, 0x19, 0x16, 0x17, 0x2D, 0x0F, 0x8C, 0xEB, 0x19, 0xF3, 0x47, - 0xC7, 0x21, 0xA8, 0x1E, 0x7F, 0xC4, 0xE3, 0x6B, 0x96, 0x1D, 0x63, 0xDD, 0xC2, 0xEF, 0xB2, 0x65, - 0x60, 0x07, 0xE5, 0xD3, 0x48, 0x49, 0x9A, 0xF2, 0xB0, 0x76, 0x2D, 0xFB, 0x68, 0xF8, 0xAD, 0xE9, - 0x3C, 0x52, 0x37, 0x9A, 0xD1, 0xAE, 0x16, 0x37, 0x2E, 0xB3, 0x63, 0xE0, 0x66, 0xB1, 0x4D, 0x49, - 0x83, 0xD2, 0xEA, 0x20, 0xFD, 0x43, 0x84, 0x5B, 0x22, 0xBC, 0x0C, 0xA1, 0x85, 0x28, 0xF7, 0x45, - 0xF1, 0x2A, 0xC2, 0xFE, 0x87, 0x4C, 0xFC, 0x0A, 0x5B, 0xD9, 0x84, 0x7A, 0xAC, 0x8C, 0xBD, 0xDF, - 0xDC, 0xA5, 0xFC, 0xD0, 0x85, 0x65, 0xA2, 0x73, 0x1C, 0x7C, 0xFD, 0xF9, 0xBA, 0x1E, 0xBD, 0x5F, - 0x06, 0xE8, 0xFC, 0x62, 0xD1, 0xF7, 0x13, 0x52, 0xE3, 0xC2, 0xEB, 0xEE, 0x0E, 0x7E, 0x9D, 0x8A, - 0x19, 0x3E, 0xA2, 0x62, 0x06, 0xC5, 0xA1, 0xDC, 0x6B, 0x4A, 0x59, 0xA6, 0x57, 0x73, 0xCB, 0x57, - 0x16, 0x99, 0xFB, 0x93, 0x36, 0xDF, 0x0E, 0x1A, 0x38, 0xD4, 0x89, 0x02, 0x79, 0xB6, 0xA8, 0x52, - 0xCB, 0x2E, 0x96, 0xD4, 0xD8, 0x52, 0xA9, 0x7C, 0xE3, 0x97, 0x47, 0x6F, 0x6E, 0x82, 0x6D, 0x3A, - 0x01, 0x8F, 0x2F, 0x59, 0xDF, 0x93, 0xBA, 0x52, 0xC4, 0x46, 0xDA, 0xC5, 0x0C, 0x2E, 0x40, 0xB8, - 0x37, 0x55, 0x40, 0xB8, 0x13, 0xCD, 0x51, 0x96, 0xCE, 0x4A, 0x6C, 0x0D, 0xF9, 0x5A, 0xE6, 0x34, - 0x95, 0xF0, 0xFF, 0x54, 0x93, 0x05, 0x9D, 0x56, 0x94, 0xF7, 0x23, 0x90, 0x00, 0x44, 0xA7, 0xD9, - 0x86, 0x71, 0xB2, 0xFD, 0x58, 0x19, 0xBB, 0xEC, 0x6B, 0x90, 0x07, 0x2B, 0x7A, 0x20, 0x4B, 0xFD, - 0x0E, 0xB8, 0xF8, 0x00, 0x13, 0xC2, 0xF2, 0x32, 0x39, 0xED, 0x71, 0x59, 0x71, 0xC4, 0xDC, 0xE5, - 0xC2, 0xA9, 0x2B, 0x7B, 0x52, 0x00, 0xCB, 0x49, 0xB4, 0x00, 0xE6, 0x98, 0x13, 0xC1, 0x2F, 0x3A, - 0x19, 0x86, 0xD5, 0x74, 0xCD, 0xBC, 0xBA, 0x4C, 0x48, 0x00, 0x8E, 0x22, 0xD5, 0xAC, 0x11, 0xEF, - 0xC8, 0xCD, 0x99, 0xBA, 0xBC, 0x0F, 0xD4, 0xC0, 0xAE, 0x15, 0x2F, 0x82, 0x6D, 0x4D, 0x44, 0x10, - 0xF1, 0xF5, 0x55, 0xF0, 0x00, 0xAF, 0xEA, 0x96, 0x1F, 0xE6, 0xA6, 0x9A, 0x78, 0xDD, 0x6D, 0xD5, - 0xDF, 0xA4, 0x4D, 0xAE, 0x05, 0xEE, 0x12, 0x9F, 0x9B, 0x99, 0xAC, 0xE4, 0xBE, 0x9E, 0x56, 0xCC, - 0x4B, 0x6D, 0x26, 0xB9, 0x56, 0x9B, 0x9B, 0x52, 0x6D, 0x14, 0x28, 0x7D, 0xE8, 0x75, 0xCB, 0x59, - 0xC0, 0x50, 0x69, 0x6B, 0xD7, 0x68, 0x06, 0xA8, 0x38, 0xD1, 0xBB, 0xD9, 0xA3, 0x3D, 0xA1, 0xBD, - 0x7D, 0x9E, 0xD2, 0xB9, 0x5D, 0x35, 0x02, 0xE0, 0xD4, 0xAF, 0x66, 0x56, 0x7D, 0xF4, 0x88, 0x74, - 0x3C, 0x28, 0x2C, 0xBA, 0x20, 0xC1, 0x2A, 0x93, 0xA9, 0xBA, 0x90, 0xE8, 0xC2, 0xE9, 0x15, 0xC8, - 0x8F, 0xBD, 0x27, 0xDE, 0x21, 0xBF, 0x56, 0x69, 0x93, 0x72, 0x7E, 0xE4, 0xE7, 0x7D, 0xE8, 0x4D, - 0xBF, 0x24, 0xA2, 0x77, 0xC0, 0xE0, 0x30, 0xD9, 0xEE, 0x82, 0xCD, 0x21, 0x60, 0xFC, 0xD1, 0x6F, - 0xB4, 0x40, 0x01, 0xFE, 0xF4, 0x73, 0xAF, 0xBB, 0xF6, 0x2B, 0x41, 0xFC, 0xDE, 0x74, 0x78, 0xE5, - 0x7E, 0xAB, 0xC9, 0xED, 0x63, 0x4B, 0x3E, 0x1A, 0x27, 0xCD, 0xBF, 0x85, 0xA4, 0x70, 0x92, 0x36, - 0x56, 0x70, 0x4A, 0xEE, 0x45, 0xAB, 0x33, 0x0A, 0x76, 0xB8, 0x0B, 0xEA, 0x55, 0xC7, 0x4E, 0xD7, - 0xD9, 0xC7, 0x10, 0x8D, 0x09, 0xFA, 0x10, 0x30, 0x62, 0x20, 0xE5, 0xBC, 0xFB, 0x74, 0x72, 0xA6, - 0x77, 0xB5, 0xBB, 0xD7, 0xD6, 0x60, 0x3A, 0x6B, 0x5D, 0xF5, 0x35, 0xF4, 0x84, 0xA0, 0x19, 0x49, - 0x36, 0x00, 0xC9, 0x35, 0xCC, 0xF7, 0xFE, 0x92, 0xF9, 0x4B, 0x8B, 0xB3, 0xBE, 0x98, 0xBF, 0xF4, - 0x25, 0xB1, 0x62, 0x4D, 0x41, 0xA0, 0xF7, 0x36, 0x6C, 0x86, 0x3C, 0x4F, 0xC4, 0xF8, 0xF2, 0xFC, - 0xE6, 0x34, 0x30, 0x95, 0x32, 0x9D, 0xE5, 0x85, 0x70, 0xD8, 0xB8, 0xD6, 0xD9, 0x42, 0xB9, 0x05, - 0x6E, 0x4B, 0x6F, 0x29, 0x33, 0x8E, 0xE4, 0x31, 0x3C, 0x21, 0x7B, 0x19, 0x31, 0x97, 0xD5, 0x62, - 0x6B, 0xF6, 0x98, 0x3C, 0xA5, 0x54, 0x18, 0x16, 0x03, 0x49, 0x51, 0x1F, 0x13, 0x37, 0xFB, 0x18, - 0x9D, 0xCF, 0x16, 0x43, 0x34, 0x7D, 0xB6, 0x5C, 0x9E, 0x74, 0x4D, 0x66, 0x23, 0x99, 0xDE, 0x6E, - 0x57, 0xFE, 0x47, 0x0D, 0x3B, 0x59, 0x3F, 0x01, 0x79, 0x75, 0x0D, 0x78, 0x62, 0x4A, 0xA5, 0xF2, - 0xF8, 0xD6, 0xAE, 0x11, 0x85, 0x88, 0x13, 0x98, 0x07, 0x0B, 0x92, 0x99, 0xC6, 0x9F, 0x85, 0x24, - 0xB1, 0x48, 0xEF, 0x59, 0x11, 0xCB, 0xAB, 0x92, 0xE4, 0x58, 0x50, 0xAA, 0xE8, 0x97, 0xD5, 0xCD, - 0x63, 0x57, 0x61, 0x62, 0x06, 0xBD, 0x26, 0x08, 0x0E, 0xC6, 0x42, 0x98, 0x8E, 0x82, 0x13, 0xD7, - 0xB8, 0x18, 0x7B, 0xAA, 0xFD, 0x42, 0x51, 0x07, 0xDE, 0x6F, 0xCF, 0xE7, 0x87, 0xF6, 0xBF, 0x15, - 0x8D, 0x8E, 0xFD, 0xA9, 0x4A, 0x45, 0x81, 0x57, 0x8F, 0x22, 0x4D, 0x63, 0x21, 0x4E, 0x41, 0x3C, - 0xCD, 0x77, 0xF5, 0xEC, 0xB8, 0x15, 0x8A, 0xBC, 0x69, 0x22, 0x98, 0xE5, 0xA4, 0x66, 0x47, 0xC5, - 0x9F, 0xE9, 0x9D, 0x06, 0xD8, 0xD2, 0x37, 0xA0, 0x4C, 0xDC, 0x33, 0xD4, 0xE7, 0xED, 0x77, 0x7D, - 0xA2, 0x20, 0x81, 0xB2, 0x46, 0xC5, 0xF6, 0xF5, 0x2A, 0x76, 0x50, 0xAF, 0xC2, 0x5A, 0xC7, 0x8F, - 0xD8, 0x3C, 0x4F, 0x2F, 0xE3, 0x56, 0x04, 0xB2, 0x6C, 0x8C, 0x0D, 0x84, 0xD7, 0xE0, 0xB5, 0x45, - 0xB2, 0x93, 0x34, 0xA0, 0xC2, 0xF4, 0x3A, 0x28, 0xDC, 0x50, 0xE8, 0xF3, 0xF0, 0x7C, 0x67, 0x1A, - 0x11, 0xD7, 0x8D, 0xB2, 0x71, 0x3D, 0xB3, 0x68, 0x49, 0x19, 0x29, 0x54, 0xDF, 0x44, 0xB9, 0x48, - 0xDD, 0x9E, 0xCE, 0xCD, 0x2D, 0x69, 0xB6, 0x18, 0xAD, 0xBC, 0xDC, 0xDF, 0x1F, 0x48, 0x04, 0x16, - 0xD6, 0x3A, 0x39, 0x7E, 0x30, 0xDB, 0x9D, 0xE1, 0x14, 0xF2, 0x5F, 0xDB, 0x1D, 0xBB, 0x7F, 0x4F, - 0x49, 0xBF, 0x4D, 0x2B, 0x9B, 0x5C, 0x7E, 0xA8, 0x1B, 0x79, 0x4F, 0x29, 0xA2, 0xF8, 0xBA, 0x36, - 0x86, 0x10, 0xFA, 0x7C, 0x45, 0x99, 0xE9, 0xD1, 0xDB, 0x93, 0xDB, 0x2A, 0xD5, 0xA8, 0x61, 0x48, - 0xBA, 0xD9, 0x40, 0xD7, 0xAE, 0xE5, 0x35, 0xAA, 0xF0, 0xA5, 0xFD, 0xC5, 0x64, 0x0B, 0x31, 0xA5, - 0x9D, 0x83, 0x31, 0xF6, 0xB8, 0xB5, 0x18, 0x3E, 0xB4, 0x2A, 0x8E, 0x70, 0x7A, 0xB8, 0xAC, 0xB5, - 0x92, 0xDD, 0x12, 0xA7, 0x9D, 0x41, 0xB1, 0x16, 0xE8, 0x45, 0x63, 0x1B, 0xB9, 0x73, 0xF1, 0x19, - 0xF6, 0xAE, 0x0F, 0xF3, 0xF7, 0x60, 0xED, 0x27, 0x70, 0x12, 0x8C, 0x12, 0x3A, 0xCF, 0xA6, 0xDC, - 0xBD, 0x17, 0x82, 0x05, 0x6E, 0x10, 0x04, 0xD4, 0xE7, 0x10, 0x9B, 0x83, 0x55, 0xB0, 0xED, 0x1B, - 0xF9, 0x7D, 0x75, 0x8E, 0xB2, 0x26, 0xA7, 0xBD, 0xE2, 0x0F, 0x29, 0x25, 0x6C, 0xFD, 0xC9, 0xC4, - 0x72, 0xE1, 0x1C, 0xDC, 0x9E, 0xBE, 0x69, 0xB5, 0xE8, 0x31, 0x83, 0x03, 0x5A, 0xEA, 0xA3, 0x52, - 0xD7, 0x51, 0x8A, 0x76, 0xB8, 0x83, 0xF0, 0x5E, 0xDC, 0xFC, 0xED, 0x80, 0x36, 0x7A, 0x39, 0xC6, - 0xFC, 0xF3, 0xC3, 0xE1, 0x5D, 0x15, 0x05, 0x30, 0xF6, 0x74, 0x93, 0x45, 0xB5, 0x2B, 0x0B, 0x63, - 0x2E, 0xF1, 0x24, 0x4B, 0x16, 0xD9, 0x61, 0xDB, 0x97, 0x9A, 0xC8, 0xFF, 0xCE, 0x74, 0xE9, 0x39, - 0x93, 0x00, 0xF8, 0xE0, 0x50, 0x62, 0x07, 0x0A, 0x6B, 0xB4, 0xBA, 0x2B, 0x61, 0x09, 0x25, 0x58, - 0x18, 0x0A, 0xB8, 0xDA, 0x8D, 0xFA, 0x8C, 0x4A, 0x41, 0xBE, 0xA4, 0x51, 0x9B, 0x83, 0x14, 0xC4, - 0xB5, 0x81, 0xB0, 0xA1, 0x35, 0x48, 0x34, 0xEB, 0xAF, 0x74, 0xF4, 0x61, 0xC5, 0x00, 0x39, 0x7D, - 0xAD, 0xF1, 0x07, 0x9C, 0x43, 0x20, 0x8F, 0x4B, 0x3D, 0xD3, 0x7C, 0x91, 0x1D, 0xC3, 0x3B, 0x06, - 0x50, 0x59, 0xA9, 0xC9, 0xA3, 0x23, 0xC9, 0xA6, 0x8A, 0x29, 0x84, 0x0D, 0x7D, 0xEE, 0x56, 0x5D, - 0xA1, 0xB6, 0xA3, 0xE7, 0x1F, 0x2A, 0xFB, 0x95, 0x7B, 0xFC, 0x9F, 0x9A, 0x18, 0xEA, 0xFF, 0xFD, - 0x61, 0x75, 0x3A, 0xF2, 0x22, 0xFF, 0xEB, 0xA2, 0x7C, 0x5A, 0x16, 0xB1, 0xE9, 0x93, 0xB0, 0x4D, - 0xA7, 0xA4, 0xB0, 0xAF, 0x70, 0x8C, 0x7E, 0x7D, 0xE8, 0x4F, 0xAA, 0x9D, 0x81, 0xD6, 0xF8, 0xB5, - 0xB6, 0x32, 0xA5, 0x31, 0xA1, 0x55, 0x11, 0x3A, 0x01, 0x13, 0x38, 0x3A, 0x41, 0x7A, 0x79, 0x31, - 0x3C, 0x13, 0xF5, 0x2C, 0x97, 0x28, 0xBD, 0x1F, 0x2E, 0x68, 0xAB, 0xA1, 0x52, 0x5F, 0xBB, 0x2A, - 0xCB, 0x11, 0xFE, 0x4A, 0x34, 0x30, 0xCD, 0xDD, 0x38, 0xAC, 0xED, 0xD0, 0x53, 0xC6, 0xC4, 0x33, - 0xE5, 0x17, 0x41, 0xC8, 0x7D, 0x14, 0x9C, 0x8C, 0x2D, 0x59, 0x61, 0xB1, 0xEC, 0x6A, 0x48, 0xAD, - 0xC7, 0x42, 0x79, 0x9B, 0x63, 0xDB, 0xB0, 0xAD, 0xAF, 0x44, 0x85, 0x2E, 0x24, 0x11, 0xE6, 0x1E, - 0x56, 0xB2, 0x1B, 0x2E, 0x98, 0x7E, 0x64, 0x3D, 0x98, 0x69, 0x51, 0x05, 0x3D, 0x5C, 0x0A, 0x85, - 0xCA, 0x58, 0x0E, 0x11, 0x86, 0xA7, 0xD6, 0xAC, 0xFF, 0x21, 0x12, 0x9F, 0xA1, 0x52, 0xE4, 0xD9, - 0xD5, 0xAC, 0x9B, 0xE2, 0x4B, 0xF0, 0x57, 0xFA, 0xFC, 0x05, 0x84, 0xB6, 0xD9, 0xB0, 0xCE, 0x5E, - 0xA0, 0x73, 0x32, 0xCE, 0x15, 0x29, 0xE8, 0x8F, 0xC4, 0xD9, 0x22, 0x3A, 0x9D, 0x71, 0xC5, 0x37, - 0x2B, 0x33, 0x76, 0x63, 0x49, 0x52, 0x8A, 0x2E, 0x89, 0x6D, 0x5A, 0x04, 0x83, 0xC1, 0xD9, 0x46, - 0xC3, 0x5C, 0x93, 0x6C, 0x3B, 0xDB, 0xFC, 0x1C, 0xC1, 0x65, 0x3B, 0x2C, 0xAD, 0xD5, 0x78, 0x9A, - 0x3A, 0xE4, 0xC3, 0x04, 0x11, 0xD8, 0xBD, 0x63, 0xA9, 0x93, 0x01, 0xF1, 0x42, 0x89, 0x5E, 0x66, - 0x95, 0xF2, 0x75, 0x38, 0x30, 0x4B, 0x39, 0x41, 0x49, 0x54, 0x8E, 0x12, 0x36, 0xFB, 0x9A, 0xA0, - 0x61, 0x13, 0x1C, 0xC2, 0xB2, 0x30, 0x7E, 0xD5, 0x22, 0xEB, 0xA3, 0xB6, 0x69, 0x2E, 0x0F, 0x0B, - 0xB0, 0x29, 0xF3, 0x24, 0x5A, 0x29, 0xA6, 0x3F, 0xC9, 0xC1, 0x56, 0xC5, 0x8E, 0xAA, 0x0B, 0x17, - 0x44, 0xBC, 0xFF, 0xE3, 0x12, 0xB8, 0x3E, 0xA9, 0x16, 0xF9, 0x7F, 0x57, 0x92, 0x7C, 0x0C, 0xFD, - 0x87, 0x9D, 0x70, 0xED, 0x81, 0xD0, 0x77, 0x01, 0x77, 0x71, 0xF5, 0x6C, 0x7F, 0xCC, 0xE4, 0xF0, - 0xAD, 0x27, 0x66, 0x2D, 0x16, 0x7B, 0x4E, 0x95, 0xF9, 0x59, 0xAA, 0x8A, 0x83, 0xE3, 0x1E, 0xD9, - 0x6E, 0x9C, 0x84, 0xEB, 0xBD, 0x5B, 0x33, 0x68, 0xA9, 0x3F, 0xDA, 0x69, 0xCB, 0xF1, 0xC7, 0x64, - 0x99, 0x27, 0xEF, 0xFF, 0xE2, 0x37, 0x34, 0x2D, 0x3C, 0x92, 0xAF, 0x7B, 0xE6, 0x6D, 0x7E, 0xF9, - 0xD2, 0x95, 0x14, 0xF1, 0x01, 0x93, 0xF2, 0xBD, 0xDF, 0x59, 0x67, 0xF6, 0x2D, 0x36, 0xBB, 0x8E, - 0x16, 0xCA, 0x07, 0xEC, 0x34, 0xA0, 0xE2, 0x16, 0x6C, 0xEC, 0x23, 0x41, 0x87, 0x7A, 0x66, 0x82, - 0x09, 0x6A, 0xFE, 0x21, 0xB3, 0x9A, 0xC7, 0x12, 0x0D, 0x07, 0xEB, 0xCF, 0xCB, 0x44, 0x9B, 0xA3, - 0xA1, 0xD9, 0x07, 0x76, 0x1D, 0x93, 0x96, 0x1B, 0x6D, 0xA1, 0x65, 0x6D, 0xB2, 0x62, 0x81, 0x55, - 0xFD, 0xE1, 0x76, 0xF2, 0x6F, 0x9A, 0x71, 0x9F, 0xFC, 0x48, 0x8D, 0x58, 0x1D, 0x3E, 0xFE, 0xBC, - 0x02, 0xB5, 0x36, 0xEE, 0x58, 0x35, 0x82, 0xF3, 0x51, 0x93, 0x35, 0x7E, 0xFA, 0xAF, 0x7E, 0x56, - 0x7E, 0xE8, 0x59, 0x7E, 0x90, 0x73, 0x9B, 0x0E, 0x4D, 0x0D, 0x84, 0x75, 0x30, 0x29, 0xCA, 0xE7, - 0x2C, 0xB3, 0xAC, 0x53, 0x3C, 0xC3, 0x7D, 0x55, 0xCD, 0xE0, 0xB9, 0xF8, 0x44, 0x02, 0xF2, 0x2B, - 0xB7, 0xD1, 0x83, 0x75, 0xDC, 0x96, 0xE7, 0x62, 0x5A, 0x58, 0x63, 0x2D, 0xC1, 0x33, 0xD2, 0x74, - 0x27, 0x05, 0xFD, 0xB7, 0x69, 0x63, 0x34, 0x81, 0xDB, 0xC1, 0x24, 0x10, 0x3A, 0xC2, 0xE2, 0xE9, - 0x75, 0xF8, 0x90, 0x50, 0x3A, 0x3C, 0xAF, 0xCD, 0x4E, 0x78, 0xB0, 0xFA, 0x5F, 0x2C, 0x09, 0x90, - 0xFE, 0xDA, 0xE4, 0x99, 0x8E, 0x3E, 0x63, 0x74, 0x3C, 0x6C, 0xD6, 0xC5, 0x2A, 0x1A, 0xBD, 0x95, - 0xA3, 0xAB, 0xF3, 0xEF, 0x1E, 0x95, 0x02, 0x8E, 0xCB, 0x23, 0xED, 0x11, 0xDB, 0x42, 0x45, 0xD5, - 0x5D, 0xDF, 0xF6, 0xE5, 0x98, 0xB4, 0x46, 0x49, 0x1A, 0xC6, 0x87, 0xFC, 0xA1, 0x79, 0x15, 0xD8, - 0x84, 0x99, 0xFE, 0x0B, 0x33, 0x30, 0x21, 0xA7, 0x59, 0x0A, 0x35, 0xE6, 0x68, 0x62, 0x55, 0x58, - 0xB4, 0x74, 0xDC, 0x80, 0xA4, 0xAD, 0x97, 0x57, 0x08, 0x9D, 0xC9, 0x9C, 0x1C, 0x0E, 0xD6, 0xE5, - 0xE3, 0xC8, 0x13, 0x02, 0xA8, 0xB9, 0x06, 0x27, 0x55, 0x89, 0xE7, 0xA3, 0xBF, 0xB0, 0xA6, 0xD0, - 0x92, 0xAD, 0xDA, 0xFE, 0x9E, 0x38, 0x2B, 0x88, 0x18, 0x7E, 0x3E, 0x90, 0xC3, 0xC0, 0x90, 0xAB, - 0x10, 0x21, 0x49, 0x47, 0xD1, 0x9D, 0x0A, 0xE9, 0x9F, 0xF9, 0xBB, 0x44, 0x83, 0x43, 0xBE, 0xBB, - 0x72, 0xD3, 0x06, 0xB4, 0x1B, 0x11, 0x03, 0xB8, 0xF5, 0xE5, 0x85, 0x1C, 0x4D, 0x7B, 0x0E, 0x65, - 0x33, 0xB0, 0x06, 0xD4, 0x58, 0x1F, 0xC9, 0x52, 0x27, 0xAD, 0xC9, 0xDE, 0x33, 0x4D, 0xC5, 0x45, - 0x6F, 0x11, 0xE1, 0x1D, 0xB9, 0x26, 0xED, 0x5B, 0x9B, 0xF6, 0xFC, 0x87, 0xF7, 0x96, 0x58, 0x5D, - 0xD7, 0x10, 0x15, 0x59, 0x1E, 0x3C, 0xFC, 0xF2, 0x8C, 0x7B, 0xB8, 0x70, 0x35, 0xD2, 0xB3, 0xA2, - 0xF1, 0xE7, 0x9D, 0xC6, 0xAE, 0x37, 0x71, 0xDA, 0x04, 0x32, 0x09, 0x33, 0xF7, 0x7D, 0x45, 0x33, - 0x9F, 0x5C, 0xD6, 0x66, 0xEC, 0x68, 0xCA, 0xEC, 0xBF, 0x4C, 0xF8, 0xA1, 0x4D, 0x5C, 0x41, 0x0E, - 0x69, 0x1F, 0x96, 0xE8, 0xD9, 0x76, 0xB9, 0xEA, 0x04, 0xEF, 0x91, 0xD4, 0xD7, 0x36, 0xEF, 0xE9, - 0xE6, 0x7B, 0x81, 0x31, 0xFD, 0x4E, 0x15, 0x17, 0xF1, 0x25, 0x86, 0x4C, 0x94, 0x2A, 0xAA, 0x50, - 0xB0, 0x98, 0x19, 0xB4, 0x34, 0x81, 0xE2, 0x61, 0xE6, 0xEE, 0x9C, 0x70, 0x72, 0x38, 0xB8, 0xE8, - 0xA6, 0xE1, 0x9F, 0x24, 0xDC, 0xD2, 0x9D, 0xC3, 0x94, 0x43, 0x65, 0x5B, 0x22, 0x45, 0xF2, 0x75, - 0x33, 0x6D, 0xB9, 0x60, 0xC6, 0x9F, 0x0A, 0xC1, 0x1F, 0xFC, 0x8B, 0x7B, 0xAB, 0x71, 0x61, 0xAE, - 0xD2, 0x1B, 0xF6, 0x79, 0x3D, 0x63, 0x1F, 0x4F, 0x1C, 0xDD, 0x4B, 0x50, 0x02, 0x97, 0xCD, 0xF4, - 0xC7, 0x0B, 0xFC, 0xB3, 0xD1, 0x21, 0xD3, 0x73, 0x1B, 0x4B, 0xE8, 0x9F, 0x3D, 0x16, 0x88, 0x0E, - 0x7F, 0xCC, 0x26, 0xA6, 0xF5, 0x8F, 0x69, 0x7F, 0xAC, 0xE8, 0x3F, 0x7B, 0x29, 0x81, 0xDA, 0x14, - 0x8F, 0x98, 0x78, 0x11, 0x34, 0x46, 0x60, 0xAD, 0x9E, 0xB3, 0x69, 0xFD, 0x74, 0x95, 0x3A, 0x14, - 0x30, 0xBE, 0x34, 0xE2, 0xAC, 0x54, 0x81, 0x70, 0x1F, 0x47, 0xD7, 0x5A, 0xDE, 0x81, 0x29, 0x17, - 0x9B, 0x3F, 0xC7, 0x57, 0x56, 0x26, 0xCD, 0xF8, 0x3B, 0x4E, 0x94, 0x4E, 0xA4, 0x09, 0x46, 0x1A, - 0x6D, 0xA3, 0x44, 0x51, 0xA9, 0x9F, 0x97, 0x88, 0x5E, 0x5E, 0x70, 0xCA, 0xDE, 0xA4, 0xAF, 0x6D, - 0xBC, 0xCE, 0xF6, 0x67, 0x81, 0x10, 0xD3, 0xF5, 0xB8, 0xC9, 0x49, 0xF3, 0x98, 0x71, 0x2D, 0x29, - 0xBD, 0x34, 0x08, 0x25, 0x1B, 0x9A, 0x6F, 0xC3, 0x4D, 0xC3, 0x9F, 0x5E, 0xE2, 0xA2, 0xF3, 0x82, - 0x52, 0xA9, 0xF6, 0x79, 0x14, 0x6F, 0xD0, 0x12, 0xB6, 0x0D, 0x4C, 0xAC, 0x3E, 0x2A, 0x8C, 0x86, - 0xE1, 0xFF, 0x1C, 0x49, 0x43, 0xF2, 0x1D, 0x34, 0xA3, 0x0F, 0xA3, 0x9B, 0x2C, 0xF3, 0x9C, 0xFC, - 0x23, 0x4B, 0xE0, 0xCB, 0xE6, 0xBE, 0x7E, 0x8B, 0x51, 0x2D, 0x32, 0x92, 0xCC, 0xC6, 0xDB, 0x36, - 0x1B, 0x83, 0x80, 0x64, 0xD2, 0x23, 0x1C, 0x60, 0x90, 0x1C, 0x71, 0x06, 0x0F, 0x30, 0xC0, 0xDF, - 0xFE, 0xF7, 0x50, 0x5A, 0xF8, 0x9C, 0x97, 0x29, 0xFB, 0x7B, 0xEB, 0x91, 0x6A, 0x42, 0xE4, 0xAB, - 0x62, 0xB4, 0x1F, 0x14, 0xEC, 0x1A, 0x9F, 0xC4, 0x98, 0x77, 0x85, 0x8B, 0xF1, 0x15, 0x2B, 0x2C, - 0x3F, 0xAB, 0x3A, 0x5E, 0xD3, 0x50, 0x32, 0xDD, 0x23, 0x81, 0x89, 0x3B, 0xB8, 0xFD, 0x49, 0x78, - 0xA9, 0x35, 0x20, 0x2D, 0xBC, 0xFC, 0x10, 0x8A, 0x08, 0xA0, 0x57, 0x24, 0xFA, 0x29, 0xD3, 0x9C, - 0xC0, 0xC5, 0x06, 0xF2, 0x7D, 0xC4, 0x45, 0x38, 0x1F, 0xC6, 0xE4, 0xC8, 0x23, 0x65, 0xD2, 0x5A, - 0xE5, 0xCD, 0x63, 0x14, 0x56, 0x03, 0xAA, 0x29, 0x82, 0xAB, 0x67, 0x92, 0x2C, 0x71, 0x67, 0x6A, - 0x36, 0xF9, 0xE1, 0x89, 0xD2, 0x98, 0x88, 0x97, 0x65, 0x72, 0xE4, 0x3C, 0x5A, 0x1D, 0xB7, 0x34, - 0x4D, 0x01, 0x91, 0x5D, 0xC4, 0xAF, 0x88, 0x2F, 0xD1, 0x27, 0x26, 0x36, 0x16, 0x98, 0x39, 0x9A, - 0xEA, 0xFA, 0xDF, 0x3B, 0x7F, 0xD8, 0x76, 0x95, 0xDB, 0x03, 0x82, 0x86, 0xD0, 0x6D, 0x15, 0xD0, - 0xF0, 0xB9, 0xCC, 0xB9, 0xD6, 0xE1, 0x9C, 0xC7, 0xAE, 0x3C, 0xA8, 0xB9, 0x49, 0xA3, 0xC4, 0xB3, - 0x24, 0x3A, 0xA3, 0x50, 0x7E, 0xDF, 0xBE, 0x5F, 0xAF, 0xC3, 0x7C, 0x3C, 0xC7, 0x39, 0xD9, 0x29, - 0x06, 0xD5, 0x0B, 0xE8, 0xFA, 0x80, 0xC2, 0xCE, 0xA8, 0xD9, 0x20, 0xCE, 0x28, 0x0A, 0xDE, 0x15, - 0xB5, 0x0D, 0x9A, 0xB8, 0xB0, 0x7B, 0x33, 0xB8, 0x35, 0xEB, 0x4E, 0xDE, 0xF5, 0x9F, 0x66, 0x79, - 0x52, 0x44, 0xD2, 0x49, 0x3A, 0x94, 0xE2, 0xCB, 0x83, 0x22, 0x7D, 0xC6, 0x1C, 0xEB, 0x44, 0x28, - 0xE9, 0x38, 0x8F, 0xB7, 0xF6, 0x3D, 0x39, 0x8F, 0x64, 0x9F, 0x86, 0x85, 0x27, 0x7E, 0xBF, 0xD8, - 0xC3, 0x8B, 0x70, 0xF9, 0x7A, 0xE6, 0x19, 0xAF, 0xA8, 0x8F, 0x6C, 0x38, 0xE2, 0xB4, 0x1E, 0xF3, - 0xDD, 0xFD, 0x6C, 0xB4, 0x04, 0xB4, 0xD1, 0x37, 0xF4, 0x59, 0xFF, 0x5A, 0x8B, 0x73, 0x6B, 0x62, - 0x6C, 0x91, 0x23, 0x96, 0x61, 0xEC, 0x9F, 0xF6, 0x83, 0x18, 0xD9, 0xEE, 0xEF, 0x00, 0xB0, 0xEB, - 0x8D, 0xC6, 0x35, 0xCE, 0xB4, 0xE0, 0xBB, 0x84, 0xD3, 0xD7, 0xDB, 0x77, 0x4A, 0x07, 0xE7, 0x3B, - 0xF7, 0x12, 0xF8, 0x9D, 0xF5, 0x0A, 0xDF, 0xF4, 0x1B, 0x00, 0x1A, 0x77, 0xD9, 0x03, 0x21, 0xC2, - 0x46, 0xF7, 0x7E, 0x4B, 0xE2, 0xC1, 0xF1, 0x8D, 0xFE, 0x61, 0xB9, 0xD4, 0x0B, 0xC9, 0x65, 0x82, - 0xCF, 0x7F, 0x3D, 0x24, 0x9E, 0xC9, 0x97, 0x30, 0xE9, 0x81, 0xB4, 0x6B, 0xA5, 0x6A, 0xA7, 0xED, - 0xE3, 0x8F, 0x88, 0x09, 0x78, 0x36, 0x6A, 0x14, 0xB9, 0xBB, 0x93, 0xE6, 0xA2, 0x07, 0x72, 0x81, - 0xD2, 0x41, 0x75, 0x28, 0x50, 0x57, 0xDE, 0x68, 0x04, 0xB1, 0x0F, 0x1F, 0xCF, 0x0F, 0x3E, 0xCB, - 0x44, 0x3D, 0x2A, 0x01, 0xC1, 0x38, 0x61, 0x8E, 0xA1, 0x13, 0xB8, 0x82, 0x3F, 0xAC, 0xA7, 0x31, - 0x7B, 0xF7, 0xA7, 0xCD, 0xBF, 0x15, 0xD3, 0xC2, 0xCC, 0xDC, 0xD0, 0xB2, 0xC1, 0x44, 0xBA, 0x82, - 0x85, 0x2D, 0x59, 0x53, 0xE4, 0xBE, 0x6B, 0x69, 0x8F, 0x5C, 0x20, 0x38, 0x76, 0xE0, 0x49, 0x59, - 0x32, 0x0A, 0x90, 0x42, 0x13, 0x35, 0x24, 0x71, 0xD9, 0x98, 0x9A, 0x0F, 0x0A, 0x83, 0x90, 0x47, - 0xD0, 0x57, 0x29, 0xC8, 0xF5, 0x5B, 0xA8, 0x5D, 0x41, 0xCD, 0x61, 0x98, 0x5C, 0x28, 0x1B, 0xF2, - 0x9B, 0x31, 0x3F, 0x14, 0x79, 0x37, 0xEA, 0xDD, 0x42, 0xD3, 0x59, 0x20, 0x0D, 0x5A, 0x3D, 0x59, - 0x84, 0x1A, 0x48, 0x28, 0x6D, 0x48, 0x3B, 0x0C, 0x87, 0xB0, 0xBB, 0xEF, 0x72, 0x91, 0x85, 0xE0, - 0x9A, 0x2C, 0x78, 0xAF, 0xFE, 0x0D, 0x6D, 0x9A, 0x99, 0x10, 0x16, 0x7D, 0x42, 0x76, 0xA0, 0xAA, - 0xC7, 0xF9, 0x11, 0x5C, 0x04, 0x83, 0x0A, 0xA9, 0x48, 0x65, 0x28, 0x81, 0x65, 0x2E, 0xA7, 0x5A, - 0xFE, 0xDB, 0x10, 0x56, 0xEA, 0x19, 0x67, 0xC2, 0x61, 0xBB, 0x9B, 0x6B, 0x48, 0x4F, 0x22, 0x4C, - 0xB7, 0xEC, 0x15, 0x84, 0x08, 0x1A, 0xFE, 0x08, 0x46, 0xCA, 0x72, 0x10, 0x30, 0x81, 0xAE, 0xE7, - 0x1B, 0xAA, 0x2F, 0x1B, 0x22, 0x6A, 0x89, 0x95, 0x34, 0x9F, 0x53, 0xE4, 0xDA, 0x0B, 0x1B, 0x56, - 0xB4, 0xB7, 0x71, 0x99, 0xB8, 0x77, 0x91, 0xEB, 0x59, 0x61, 0x71, 0x84, 0xAF, 0x55, 0xBD, 0x33, - 0x1C, 0xD9, 0x7A, 0x40, 0xD3, 0x7B, 0x6C, 0xB0, 0xA4, 0x96, 0x07, 0x57, 0x49, 0x9C, 0xC1, 0x0B, - 0x23, 0xF3, 0xE5, 0x36, 0xA4, 0xE8, 0xE1, 0xEC, 0x51, 0xF1, 0xBB, 0x7B, 0x40, 0x4B, 0x05, 0xD1, - 0x3D, 0xD6, 0x6D, 0x22, 0x7C, 0x9D, 0x51, 0x28, 0x70, 0xF6, 0xB3, 0x0C, 0x6F, 0xB2, 0xE1, 0xBC, - 0xFF, 0xB8, 0xA3, 0x92, 0x7C, 0x0A, 0xA3, 0x36, 0x6D, 0xF8, 0xFC, 0x27, 0x45, 0x58, 0x94, 0xE0, - 0x0A, 0x90, 0xF8, 0x2A, 0xF3, 0x02, 0xA4, 0x98, 0xD8, 0xEF, 0x1C, 0x53, 0xE2, 0x47, 0xC7, 0x20, - 0xB2, 0x6F, 0xB7, 0x39, 0x5A, 0xA9, 0x49, 0xC2, 0x65, 0x18, 0x50, 0xBD, 0x7F, 0xB0, 0xDE, 0xBB, - 0x2F, 0x56, 0xDD, 0x62, 0x85, 0xAC, 0x3B, 0x7E, 0xCD, 0x00, 0x88, 0x7A, 0x22, 0xC5, 0x03, 0x03, - 0x26, 0xC4, 0x27, 0x09, 0xE8, 0x16, 0x36, 0xB7, 0x0B, 0xDF, 0xDA, 0x21, 0xEB, 0x59, 0xE8, 0x6D, - 0x96, 0x2D, 0x18, 0x89, 0xD4, 0x4E, 0x5A, 0x66, 0x63, 0x31, 0x15, 0xF0, 0x48, 0x50, 0x7A, 0xF3, - 0xA7, 0x82, 0xE0, 0x91, 0x04, 0xB2, 0x16, 0xAC, 0xA1, 0xD4, 0xC1, 0xE4, 0xBD, 0xC9, 0x43, 0x83, - 0xD9, 0x18, 0x11, 0x50, 0xC0, 0x93, 0x9D, 0x6B, 0x17, 0x63, 0xC8, 0xA3, 0xAF, 0xAC, 0xBF, 0x29, - 0x65, 0xA6, 0x4A, 0xE4, 0xCD, 0xE2, 0x89, 0x59, 0xF8, 0x96, 0xF8, 0x3B, 0x80, 0xCA, 0x68, 0xF2, - 0xBF, 0xBE, 0xFD, 0xD0, 0x84, 0x88, 0xE3, 0x3D, 0x08, 0x8A, 0x08, 0x39, 0xDC, 0x88, 0x71, 0x61, - 0x76, 0xAD, 0xB6, 0xBE, 0xC0, 0xA4, 0x28, 0xEE, 0x38, 0x8F, 0x2E, 0x8D, 0x3A, 0x28, 0xAE, 0xEB, - 0x93, 0x7E, 0xF4, 0x2E, 0x5F, 0x3B, 0xEA, 0x37, 0x9A, 0x53, 0x6C, 0xC5, 0x3A, 0x2F, 0x7F, 0xA9, - 0x80, 0x85, 0x18, 0xFE, 0x14, 0x0C, 0x37, 0xA7, 0xE2, 0x78, 0x90, 0x20, 0x1F, 0x41, 0x1C, 0x03, - 0xD1, 0xD0, 0x8C, 0xB2, 0x2D, 0x4C, 0x32, 0x81, 0x63, 0xF6, 0x6F, 0xD3, 0x7F, 0xB4, 0x6D, 0xA8, - 0xD6, 0xE0, 0x56, 0x84, 0xAD, 0x37, 0x96, 0x44, 0xB4, 0xAE, 0x6F, 0x49, 0x3E, 0x30, 0x0C, 0x79, - 0xE3, 0x93, 0xBA, 0xD2, 0x10, 0x71, 0xAC, 0x7C, 0x06, 0x89, 0x26, 0xCB, 0x72, 0x9E, 0xC4, 0xCC, - 0xBB, 0xA1, 0xDE, 0x9B, 0x66, 0x75, 0x6F, 0xAC, 0x51, 0x93, 0xE8, 0xF4, 0x43, 0xE4, 0x79, 0xF2, - 0x50, 0x67, 0x3D, 0x1B, 0x33, 0xB5, 0xEC, 0x93, 0x10, 0xCE, 0x78, 0x3C, 0x0C, 0x25, 0x44, 0x30, - 0x3C, 0xAB, 0x40, 0x6F, 0x4B, 0x54, 0x0C, 0x38, 0xD4, 0xEF, 0x18, 0xED, 0xA5, 0x75, 0x1E, 0x9C, - 0x06, 0x42, 0x11, 0x9D, 0xEC, 0xE8, 0x81, 0x38, 0xBE, 0xEF, 0x21, 0xB5, 0x0A, 0xC3, 0x38, 0x94, - 0x0C, 0x5A, 0xE2, 0x47, 0xDC, 0x2E, 0x82, 0xC3, 0xA6, 0x9D, 0xA6, 0x54, 0x5E, 0xE6, 0x7C, 0xFE, - 0x7E, 0x7B, 0x86, 0x9A, 0x54, 0xEC, 0xCD, 0xE5, 0x9F, 0xF7, 0x23, 0xDE, 0x06, 0x90, 0x93, 0xB6, - 0xCC, 0xC8, 0x3D, 0x75, 0xA6, 0x43, 0xEA, 0x1F, 0x44, 0xAB, 0xBB, 0x15, 0xC4, 0xAB, 0xB1, 0xDF, - 0xE9, 0x30, 0xB4, 0xB2, 0x3B, 0x5B, 0xA6, 0x57, 0xEE, 0x25, 0x4B, 0x83, 0x26, 0xE4, 0x6B, 0xE3, - 0x35, 0x62, 0xA5, 0xD2, 0xB6, 0xDE, 0xFD, 0x5F, 0x8C, 0x21, 0xF8, 0x15, 0x41, 0x1C, 0x61, 0xCD, - 0x78, 0x0F, 0x61, 0x9E, 0x0C, 0x7E, 0x88, 0xE3, 0x34, 0x7F, 0x0B, 0x00, 0x5D, 0x8A, 0x37, 0x5F, - 0xFB, 0x65, 0xB8, 0xEC, 0x6C, 0x6A, 0x7E, 0x8F, 0x70, 0x6A, 0x17, 0xFB, 0x6B, 0x9D, 0xD8, 0xC3, - 0xD5, 0x13, 0x49, 0xEC, 0xD0, 0xEC, 0x1B, 0xC7, 0x79, 0xBB, 0xD2, 0x89, 0x96, 0x39, 0x1C, 0xF3, - 0x70, 0xEA, 0xF0, 0xEA, 0x6B, 0x45, 0x51, 0xDB, 0x1A, 0x61, 0x60, 0x98, 0x1C, 0x7A, 0xA6, 0x48, - 0x65, 0xDA, 0x85, 0xBE, 0x6B, 0xC4, 0x27, 0x2F, 0x76, 0x6D, 0x5F, 0x4C, 0xDE, 0x92, 0xA1, 0xB3, - 0xD4, 0x11, 0xB4, 0x0B, 0x3A, 0x4C, 0x73, 0xC3, 0xAA, 0x9C, 0x0F, 0x95, 0x9B, 0x2C, 0x67, 0x02, - 0x47, 0xCD, 0xE3, 0x75, 0x84, 0x60, 0x5E, 0x17, 0xAB, 0xF0, 0xBC, 0xBE, 0xB4, 0xAA, 0x4C, 0xEA, - 0x11, 0x52, 0x87, 0xAC, 0x16, 0x56, 0x06, 0x1F, 0xC1, 0x97, 0xF9, 0xAB, 0x26, 0xD9, 0xCC, 0x58, - 0x01, 0xFF, 0x44, 0x21, 0xFE, 0x5D, 0x53, 0x0B, 0xA2, 0xAF, 0xBC, 0x9D, 0x63, 0x25, 0x87, 0x66, - 0xB3, 0x79, 0xB4, 0x9F, 0x49, 0xE6, 0x6E, 0xCB, 0x8B, 0x39, 0x8C, 0x46, 0x60, 0x3D, 0x5B, 0xEC, - 0x08, 0x1B, 0xB2, 0xEC, 0xA2, 0xAA, 0x9A, 0xDA, 0xAA, 0xAD, 0x25, 0xAB, 0x45, 0x99, 0x63, 0x23, - 0x6C, 0x53, 0x87, 0xA0, 0x5A, 0x6C, 0xD6, 0xE3, 0x6C, 0x34, 0x42, 0x0F, 0xF3, 0xA0, 0x23, 0xD3, - 0x16, 0x05, 0xAB, 0x05, 0x14, 0xA8, 0xA9, 0x02, 0x23, 0xFC, 0xC0, 0xED, 0x75, 0xC5, 0x43, 0x7C, - 0x1E, 0xB1, 0x69, 0xB6, 0x01, 0x96, 0x7B, 0x9E, 0x12, 0x1C, 0x72, 0x42, 0x0D, 0xAB, 0x0B, 0x79, - 0x22, 0xF3, 0xF0, 0xEB, 0x71, 0x83, 0x42, 0x3C, 0x11, 0xC7, 0x4F, 0x87, 0xFF, 0x5D, 0x19, 0x0B, - 0xE4, 0x1E, 0xC3, 0xA2, 0xD7, 0x0E, 0x9C, 0x3C, 0x7D, 0xFB, 0x4F, 0xDA, 0x99, 0x9F, 0xF8, 0x3E, - 0xD4, 0xA0, 0xA2, 0xF8, 0x83, 0x33, 0x1E, 0xE2, 0x1C, 0x52, 0x9D, 0xB8, 0x63, 0x8F, 0xA1, 0x4D, - 0x68, 0xAE, 0xCE, 0xD4, 0x12, 0x8E, 0x96, 0xA1, 0x78, 0x27, 0x6A, 0x29, 0x11, 0x19, 0x4C, 0x94, - 0x89, 0x0F, 0xFB, 0x7C, 0xA8, 0xAC, 0x7E, 0x84, 0x44, 0xC8, 0x7A, 0x18, 0xAE, 0x34, 0x0F, 0x6E, - 0x90, 0xDB, 0x1E, 0x79, 0xFA, 0xE8, 0xAF, 0x71, 0xE4, 0x80, 0x24, 0x53, 0x2F, 0xB6, 0xC2, 0x12, - 0x1F, 0xA0, 0x44, 0x98, 0x40, 0xAE, 0x01, 0xD6, 0xFB, 0x86, 0xBB, 0xC6, 0xF7, 0x2F, 0x38, 0x41, - 0xE3, 0x2E, 0x1F, 0x2E, 0x7C, 0x90, 0x1F, 0xD9, 0xD3, 0x34, 0x86, 0xC8, 0xA3, 0x8E, 0xAB, 0x5E, - 0x05, 0x55, 0x71, 0x5B, 0x21, 0xB7, 0x2F, 0x9E, 0x56, 0x32, 0x56, 0xD1, 0xDC, 0xC9, 0xDA, 0xDE, - 0xAC, 0x1D, 0x91, 0x0E, 0x4D, 0x1F, 0x4F, 0xE7, 0x31, 0xFE, 0x9A, 0x3F, 0x18, 0xAD, 0x85, 0x4E, - 0x66, 0x95, 0x76, 0x67, 0x6A, 0xC8, 0x90, 0x6A, 0xB5, 0xB0, 0x7D, 0xB2, 0xB3, 0xD7, 0xD6, 0x42, - 0xF1, 0x63, 0x52, 0xBD, 0x72, 0xE1, 0xD2, 0x63, 0x9A, 0x00, 0x45, 0x8E, 0x77, 0xCF, 0x93, 0xCF, - 0x1A, 0x31, 0xAA, 0x16, 0xA9, 0xCF, 0x45, 0xE3, 0x99, 0x3E, 0x6C, 0x70, 0xE9, 0x93, 0x83, 0x78, - 0x11, 0xB8, 0x80, 0xEA, 0x75, 0x5A, 0x87, 0xCE, 0x1D, 0xCD, 0x12, 0x5F, 0x1F, 0x6F, 0x86, 0x25, - 0x5E, 0x95, 0x22, 0x07, 0xFE, 0x29, 0xDA, 0x93, 0x52, 0x41, 0x62, 0x79, 0x06, 0x06, 0x83, 0xAE, - 0x42, 0x35, 0x5C, 0x9E, 0x01, 0xF8, 0xFA, 0x3F, 0x07, 0x15, 0xCA, 0x02, 0x69, 0x8E, 0xEA, 0x9E, - 0xEF, 0xF4, 0x99, 0x26, 0x73, 0x42, 0xC2, 0xEC, 0x0F, 0xEC, 0x03, 0x8F, 0x66, 0xC1, 0x88, 0x76, - 0xC5, 0xC2, 0x55, 0x46, 0x59, 0xC4, 0x28, 0x55, 0x93, 0xBF, 0x7C, 0x1C, 0x5C, 0xA0, 0xBA, 0x8A, - 0xCA, 0x8A, 0x81, 0x6C, 0xA3, 0xDE, 0x2D, 0x63, 0xC5, 0xCA, 0x0B, 0x8E, 0x99, 0xC9, 0xE4, 0x7E, - 0x32, 0x36, 0xD8, 0xFA, 0x80, 0xA5, 0x93, 0x4F, 0x5C, 0x97, 0x33, 0x74, 0xD2, 0x03, 0xFF, 0xFD, - 0x57, 0x84, 0x26, 0x62, 0x6A, 0x4C, 0x15, 0x45, 0xB9, 0x7C, 0xCD, 0xD8, 0x7B, 0xC5, 0x70, 0xA1, - 0xCB, 0xB4, 0xDE, 0xA6, 0xBD, 0xE0, 0xE9, 0x49, 0xB7, 0xEA, 0x21, 0x17, 0xCD, 0x0C, 0xA7, 0xF2, - 0x9B, 0xB6, 0x26, 0x06, 0xB1, 0x63, 0x3D, 0x0D, 0x1A, 0xAE, 0x57, 0xF1, 0x53, 0xDA, 0x61, 0x47, - 0x7E, 0x66, 0xC0, 0x2A, 0xAC, 0x7E, 0xE8, 0xE9, 0x4F, 0xC2, 0x21, 0x01, 0x0B, 0x9C, 0xA7, 0x98, - 0x05, 0x3A, 0x34, 0x68, 0x19, 0x26, 0x35, 0x57, 0xF7, 0xF8, 0xE0, 0x77, 0x7B, 0x42, 0x8D, 0xE0, - 0xD3, 0x08, 0x49, 0x62, 0x1D, 0x86, 0xBE, 0xC8, 0xDC, 0x2F, 0xE0, 0xFF, 0xC4, 0x6E, 0xBD, 0xEC, - 0x8B, 0x33, 0xF1, 0x61, 0x6E, 0x96, 0xEB, 0xEA, 0x87, 0x4C, 0xA3, 0x5F, 0x97, 0x92, 0x22, 0x0C, - 0x36, 0x05, 0xA5, 0xC1, 0xF6, 0xB8, 0xF5, 0xE0, 0xE4, 0x91, 0x73, 0x73, 0xD0, 0x38, 0x81, 0x24, - 0x13, 0xB4, 0x4B, 0xAB, 0x4C, 0xBB, 0x15, 0x56, 0xC2, 0x66, 0xF9, 0x27, 0xEF, 0xE0, 0x3D, 0x4E, - 0xDB, 0x12, 0xCB, 0xC1, 0xDE, 0x57, 0x1B, 0x7F, 0x69, 0x10, 0xE4, 0x6E, 0xF7, 0xCC, 0x0F, 0x64, - 0x31, 0x6A, 0xBF, 0x49, 0x6C, 0xF8, 0x9E, 0xC9, 0x37, 0xF9, 0x26, 0x32, 0x4A, 0x26, 0x97, 0x99, - 0x30, 0xA6, 0x86, 0x82, 0xCE, 0x04, 0x8B, 0xFB, 0x39, 0x3B, 0xEF, 0x05, 0xAE, 0x3F, 0xFD, 0xEA, - 0x21, 0xA7, 0xF9, 0xD8, 0x2D, 0x34, 0x42, 0xE4, 0xDC, 0x40, 0x1C, 0x82, 0x94, 0x89, 0xC4, 0x74, - 0x0C, 0xF6, 0x76, 0x65, 0x13, 0x29, 0x85, 0xE7, 0xF6, 0x8C, 0x19, 0x3D, 0xC2, 0x69, 0x79, 0x07, - 0x8C, 0x47, 0x24, 0x24, 0x4C, 0xD6, 0x41, 0x93, 0x70, 0x40, 0x08, 0x6D, 0x49, 0x4D, 0x92, 0xAA, - 0x9D, 0x02, 0xAB, 0x53, 0x8D, 0x8C, 0x96, 0x75, 0x54, 0xD0, 0xA2, 0x45, 0xBA, 0x19, 0x81, 0xFE, - 0x20, 0xCC, 0x93, 0x78, 0x4D, 0xBB, 0xA2, 0x21, 0xAB, 0xB5, 0x1B, 0x47, 0x0C, 0xA2, 0x34, 0x24, - 0x1E, 0xF3, 0x40, 0xF3, 0xC8, 0x79, 0xAE, 0x00, 0x40, 0xC3, 0xC4, 0x1B, 0x41, 0x5E, 0xF4, 0x08, - 0x7D, 0x15, 0xF1, 0xDF, 0xE2, 0x34, 0x78, 0xC3, 0x2A, 0x91, 0x8D, 0xC1, 0xA7, 0xF4, 0xD0, 0xF9, - 0xE7, 0x4E, 0x9F, 0xDC, 0x56, 0x16, 0x6C, 0x5B, 0x48, 0x10, 0x7E, 0xE9, 0xA6, 0x3F, 0x3B, 0xD0, - 0xFD, 0x12, 0x46, 0x1B, 0xFF, 0x61, 0x76, 0x61, 0xCC, 0x24, 0x1C, 0x94, 0xDF, 0x77, 0x6F, 0xAE, - 0x8E, 0xEE, 0x96, 0xF6, 0x9B, 0xB4, 0xE9, 0xA5, 0x1E, 0x6D, 0x7C, 0x2C, 0x43, 0xFB, 0x74, 0xF3, - 0x23, 0x86, 0xE6, 0x07, 0xC7, 0x36, 0xE3, 0xED, 0xAF, 0xDD, 0x75, 0x61, 0xCD, 0xFE, 0xEE, 0x4B, - 0x82, 0xF7, 0xC7, 0x66, 0x2B, 0x4C, 0xFF, 0x97, 0x77, 0x1A, 0xF5, 0xA5, 0x55, 0xF2, 0xBD, 0xC0, - 0xD4, 0xD8, 0x07, 0x2A, 0x92, 0xB0, 0x04, 0x56, 0x55, 0x3F, 0x1B, 0xCA, 0x21, 0x25, 0x3F, 0xB9, - 0x81, 0x01, 0x94, 0x43, 0xEE, 0x83, 0xD5, 0x10, 0xB4, 0x13, 0x19, 0xC0, 0x06, 0xBA, 0xEF, 0xA3, - 0xE4, 0xEC, 0xD8, 0x66, 0x30, 0x58, 0xA2, 0xE7, 0x81, 0x65, 0xDA, 0xA1, 0x35, 0x28, 0x4B, 0x47, - 0x17, 0x95, 0xA3, 0x8C, 0x67, 0x44, 0xC8, 0x8B, 0x1B, 0x5F, 0xE9, 0x0E, 0x99, 0xA3, 0x39, 0xAF, - 0x5C, 0xCA, 0x0D, 0x68, 0xAD, 0xE0, 0x91, 0xF3, 0x95, 0x54, 0x02, 0xFF, 0xC4, 0x23, 0xA1, 0x2E, - 0xCE, 0xD2, 0xFC, 0x34, 0x5A, 0xF0, 0x83, 0x82, 0x54, 0x07, 0xDE, 0x21, 0x0D, 0xE3, 0xDF, 0x86, - 0xC1, 0x6E, 0xAB, 0x95, 0x28, 0x90, 0xED, 0x3B, 0x93, 0x95, 0x9E, 0xDE, 0xBA, 0x3E, 0x32, 0x85, - 0x0F, 0xB9, 0x62, 0x68, 0x00, 0x93, 0x38, 0xF9, 0x6B, 0x36, 0x5E, 0xAB, 0x9F, 0xDD, 0x84, 0x97, - 0xB8, 0xAB, 0xDA, 0x29, 0x88, 0xEC, 0x9D, 0xFA, 0xAA, 0x34, 0x2B, 0x1E, 0xC0, 0x6C, 0x53, 0xD4, - 0x55, 0x40, 0x45, 0x9F, 0xEC, 0x0A, 0x90, 0x51, 0xC5, 0x7A, 0x8A, 0xF6, 0xEE, 0x62, 0xC2, 0xE9, - 0x57, 0x2A, 0x1D, 0x8F, 0xB6, 0x83, 0xF9, 0x44, 0x42, 0x33, 0x2A, 0x3D, 0xC7, 0x46, 0xDA, 0xCA, - 0xBC, 0x6B, 0x49, 0x7F, 0x94, 0xB0, 0x6C, 0x80, 0xEC, 0x76, 0x96, 0x12, 0xB9, 0x05, 0x47, 0x96, - 0x84, 0x98, 0xCF, 0x8F, 0x21, 0xF5, 0x6B, 0x86, 0xB8, 0xD4, 0x80, 0xBA, 0xEA, 0x3C, 0xF6, 0x7A, - 0x98, 0xE9, 0x1A, 0x5E, 0x2C, 0x69, 0x1A, 0x2A, 0x31, 0xB9, 0xE6, 0x28, 0xA3, 0xCA, 0xC2, 0x70, - 0xDB, 0xF0, 0x30, 0x28, 0xD3, 0xD6, 0x17, 0xAD, 0x73, 0x8D, 0xB3, 0xF5, 0xFD, 0xA3, 0x6D, 0x8A, - 0xAE, 0x7A, 0x69, 0xD7, 0x6E, 0x4C, 0x29, 0x44, 0xBD, 0x57, 0xBA, 0xC9, 0xFD, 0xA1, 0xEF, 0xA9, - 0xA0, 0x98, 0x39, 0x7A, 0x05, 0x61, 0x46, 0x55, 0x77, 0x5C, 0x1A, 0x39, 0x38, 0x98, 0xFA, 0x79, - 0x9A, 0xBC, 0x68, 0xDB, 0x29, 0x51, 0xDD, 0x2C, 0xEC, 0xFA, 0x61, 0x93, 0x93, 0x44, 0xF2, 0x7E, - 0xD7, 0xA2, 0x79, 0xF1, 0xBD, 0x19, 0x81, 0x36, 0x04, 0x3A, 0x26, 0x20, 0x07, 0x3E, 0x01, 0x8E, - 0x16, 0xE0, 0x6F, 0xF6, 0x29, 0xB8, 0x0B, 0xAC, 0x37, 0x19, 0x39, 0x91, 0x09, 0x23, 0xA6, 0x9C, - 0xAD, 0x08, 0x70, 0xA8, 0x66, 0x0A, 0x22, 0xA2, 0x2E, 0xC5, 0xB9, 0x7F, 0x58, 0xC0, 0x2F, 0x07, - 0x61, 0xB9, 0x2D, 0x3F, 0xA9, 0xB1, 0x67, 0x52, 0xC1, 0x1C, 0x2C, 0xB4, 0xFC, 0x02, 0xA8, 0x4F, - 0x71, 0x87, 0x7F, 0x42, 0x35, 0x93, 0x25, 0xF5, 0x81, 0x07, 0xF9, 0x75, 0x01, 0xBE, 0x08, 0x15, - 0xC5, 0xD1, 0xED, 0x91, 0xB6, 0x0B, 0xC8, 0x8B, 0x4D, 0x62, 0x54, 0xD7, 0x14, 0x9C, 0x3E, 0xEA, - 0x15, 0x3E, 0x91, 0x4F, 0x2F, 0xB5, 0x5C, 0x5A, 0x13, 0x6D, 0x24, 0xE5, 0xB1, 0xA2, 0xFC, 0xAF, - 0x5F, 0x85, 0x13, 0x52, 0x9F, 0x80, 0x19, 0xBB, 0xB7, 0x9A, 0xC6, 0x92, 0x49, 0x2D, 0x28, 0xA7, - 0xA2, 0x28, 0xFA, 0x4A, 0x7B, 0xBA, 0x99, 0x15, 0xA9, 0xF3, 0x51, 0xED, 0xA5, 0xD7, 0x9A, 0xC1, - 0x7A, 0x1E, 0x77, 0x57, 0xBB, 0xA7, 0x25, 0x10, 0xE9, 0x69, 0xAC, 0x50, 0xEF, 0xEC, 0x85, 0x02, - 0x52, 0xC9, 0x29, 0xE9, 0xCB, 0xC8, 0xD0, 0x2D, 0x43, 0xAD, 0x26, 0x93, 0xA8, 0x12, 0xE3, 0xEB, - 0xB1, 0x1E, 0xA2, 0x8D, 0xE4, 0xF7, 0x8F, 0x4B, 0x55, 0xE7, 0xD7, 0x98, 0x3B, 0x7B, 0x85, 0x16, - 0xEE, 0x5A, 0xD8, 0x61, 0x65, 0x57, 0xBC, 0x74, 0x62, 0xD3, 0xDC, 0x7C, 0x6D, 0xCC, 0x56, 0xB0, - 0x3B, 0xA7, 0xE9, 0x10, 0xDE, 0x6A, 0xF4, 0x3A, 0xEC, 0x7E, 0x2E, 0xD0, 0x1E, 0x81, 0x48, 0xD3, - 0xEC, 0xD7, 0xC5, 0xDB, 0x16, 0xBD, 0xD5, 0x5B, 0xAD, 0x8E, 0x13, 0x5A, 0x2A, 0x9E, 0x1A, 0x96, - 0xC3, 0x7E, 0x23, 0xAD, 0xA7, 0x45, 0xE0, 0xCE, 0xA4, 0x52, 0x0C, 0x2A, 0x2E, 0x84, 0x9D, 0xB3, - 0xB4, 0x21, 0x18, 0xA7, 0xCF, 0x57, 0xA3, 0xFE, 0xA1, 0x27, 0x99, 0xCE, 0x48, 0x1E, 0xA7, 0xDB, - 0x62, 0x13, 0x9B, 0x19, 0xE3, 0xBF, 0xAA, 0xA2, 0x9D, 0x29, 0xC9, 0x92, 0xD1, 0x5A, 0x43, 0x4E, - 0xC4, 0xF8, 0xB4, 0xD9, 0xFC, 0xBD, 0x1A, 0xBB, 0x4D, 0x23, 0x99, 0xF3, 0x86, 0xE6, 0xBC, 0xB7, - 0x03, 0xE1, 0xA9, 0xD7, 0xDF, 0x5C, 0x15, 0x56, 0xB4, 0x63, 0xC2, 0x71, 0x6D, 0x15, 0xF1, 0x85, - 0xB6, 0xFF, 0x85, 0x4B, 0x6C, 0x36, 0xDB, 0xA8, 0x07, 0x22, 0x92, 0x4F, 0xD5, 0xA3, 0x2B, 0x40, - 0x8F, 0x6D, 0x89, 0xE3, 0x3E, 0xA2, 0x40, 0xAE, 0x80, 0xA5, 0x3A, 0xD2, 0x5D, 0x7E, 0x74, 0x6A, - 0x94, 0xED, 0xA3, 0xF2, 0x4C, 0x2E, 0x57, 0xF2, 0xBE, 0x8B, 0x25, 0xEF, 0x87, 0x0C, 0x05, 0x99, - 0x27, 0x5E, 0xA5, 0xDE, 0xAE, 0x94, 0x49, 0xFD, 0x7A, 0x62, 0xA7, 0x74, 0x58, 0x8A, 0x1A, 0xED, - 0x15, 0x23, 0x1D, 0x83, 0xD7, 0xA4, 0x6B, 0x4F, 0x3F, 0x9C, 0xBB, 0x5B, 0x27, 0xAD, 0x5C, 0x7E, - 0xA2, 0xE0, 0xBF, 0x39, 0x0C, 0x73, 0xB1, 0x48, 0x07, 0xC1, 0x3B, 0xD5, 0xA6, 0x2D, 0x94, 0x20, - 0x6D, 0xE6, 0x91, 0xAD, 0xCC, 0xDE, 0x4A, 0x3C, 0x4C, 0x02, 0x92, 0xCD, 0x41, 0x46, 0x3C, 0x88, - 0x5A, 0xB6, 0xF6, 0x8F, 0x85, 0x05, 0x7E, 0x75, 0xAC, 0x92, 0x92, 0x99, 0xF4, 0x36, 0x21, 0xE9, - 0x0D, 0x19, 0x02, 0xA1, 0xF0, 0xF1, 0xDB, 0xD8, 0x8F, 0x48, 0x11, 0x5D, 0x84, 0x80, 0x24, 0xD8, - 0xEE, 0x57, 0xB2, 0x3A, 0xE6, 0x0E, 0xC5, 0xA1, 0x26, 0xF9, 0x0C, 0x2E, 0x6C, 0x3A, 0x7A, 0x8B, - 0x0B, 0x9B, 0x3D, 0x2E, 0xAF, 0x26, 0x7D, 0x02, 0x63, 0xC8, 0x0D, 0x24, 0x7D, 0x36, 0x19, 0xAB, - 0xAC, 0xA9, 0x10, 0xA0, 0x53, 0x25, 0x4C, 0xC7, 0x4C, 0x28, 0x4A, 0xC3, 0x38, 0x92, 0xE2, 0x3D, - 0xF3, 0xE1, 0x93, 0xDE, 0x3E, 0x77, 0xAC, 0xEF, 0x6A, 0x08, 0x44, 0xE8, 0x20, 0x18, 0xA3, 0xA0, - 0x90, 0x56, 0xDD, 0xAB, 0x77, 0x7D, 0x36, 0xC2, 0x91, 0xB5, 0x44, 0x8C, 0xD4, 0x57, 0x2C, 0x81, - 0xA1, 0xB9, 0xD9, 0x59, 0x50, 0x8A, 0x76, 0x88, 0x5A, 0x5E, 0x45, 0x99, 0xAC, 0x8C, 0x40, 0x14, - 0x46, 0x28, 0x77, 0xED, 0x1C, 0x7C, 0x59, 0x36, 0x83, 0x4A, 0xA7, 0x0A, 0x71, 0x9C, 0x3B, 0x02, - 0x43, 0x50, 0x74, 0x85, 0xE3, 0xD4, 0x0A, 0x3B, 0x1B, 0xE2, 0xD7, 0x1F, 0x79, 0x78, 0x4B, 0x00, - 0x8E, 0x0A, 0x99, 0xDF, 0x14, 0x17, 0xCD, 0xB8, 0xCF, 0x21, 0xB3, 0x85, 0x38, 0xDE, 0x01, 0xBA, - 0x1B, 0x95, 0x4B, 0x97, 0x2B, 0xB0, 0xC9, 0xED, 0x45, 0xCE, 0x22, 0x5B, 0x8E, 0x04, 0x91, 0x07, - 0x58, 0xC8, 0xB5, 0xA7, 0x06, 0x62, 0x9D, 0xC4, 0xAC, 0x1E, 0x08, 0xFD, 0xEA, 0xB7, 0x4D, 0x0B, - 0xD2, 0x79, 0xA8, 0xEF, 0x4F, 0xBE, 0x80, 0xE6, 0x55, 0x44, 0x7B, 0x59, 0x5E, 0x9C, 0x92, 0x6A, - 0x92, 0xF7, 0xE7, 0x78, 0xFB, 0x46, 0xA1, 0xF4, 0x1E, 0x36, 0x8B, 0xE2, 0x86, 0xA2, 0xE1, 0x19, - 0xB5, 0x29, 0xEA, 0xD2, 0x1D, 0x0B, 0x68, 0xC5, 0x2F, 0x4F, 0x48, 0x6A, 0xC8, 0x92, 0xCE, 0x64, - 0x9D, 0xA5, 0x86, 0xA5, 0x05, 0x40, 0xCE, 0xD7, 0x6C, 0x69, 0x9F, 0x6C, 0xB2, 0xA3, 0x11, 0x08, - 0xEF, 0x9B, 0xCD, 0x10, 0x07, 0x7B, 0x9E, 0x25, 0xF4, 0x1A, 0x2B, 0x21, 0x7E, 0xA5, 0xB9, 0xE1, - 0x33, 0x52, 0xFA, 0x04, 0x09, 0xD4, 0x78, 0xCB, 0x56, 0xE6, 0x55, 0x2C, 0xB4, 0x5D, 0xBB, 0x40, - 0x34, 0xE5, 0x23, 0x30, 0xB8, 0x65, 0x19, 0xF1, 0x5A, 0x08, 0xF2, 0xF4, 0x86, 0x45, 0xB7, 0x87, - 0x17, 0xFA, 0x68, 0x6A, 0x1F, 0x7E, 0x69, 0xDA, 0x89, 0x8E, 0xCA, 0xB6, 0xFF, 0x9F, 0x4E, 0x6F, - 0x25, 0x46, 0x46, 0xF6, 0x7B, 0x1E, 0xB3, 0x3D, 0x2C, 0x8C, 0x01, 0xA9, 0x7B, 0xDA, 0xE9, 0x4D, - 0x6E, 0x89, 0x9D, 0x0F, 0x3F, 0x9F, 0x15, 0x3C, 0xFE, 0x35, 0x61, 0x2A, 0x45, 0xC2, 0xA9, 0xC5, - 0x5C, 0x51, 0xCC, 0x6B, 0xCC, 0x2F, 0xA7, 0x60, 0x03, 0x71, 0xF0, 0xB3, 0xBF, 0x7B, 0x76, 0xCC, - 0x89, 0x2C, 0x31, 0x79, 0xE6, 0xDC, 0x7C, 0x39, 0x24, 0xD8, 0x1A, 0x98, 0x1F, 0x98, 0xCD, 0xD4, - 0x7E, 0x04, 0xF2, 0x92, 0x8D, 0x23, 0x03, 0x5F, 0xF3, 0x05, 0x3B, 0xB0, 0x0A, 0xF0, 0x7A, 0xCA, - 0x76, 0xCB, 0xD0, 0xBA, 0xA0, 0x7F, 0xBA, 0x0D, 0x68, 0x60, 0xC3, 0xEF, 0xDC, 0x44, 0x2E, 0x40, - 0x24, 0x9D, 0xCB, 0x1D, 0x5A, 0x0C, 0x51, 0x66, 0x1A, 0x2A, 0x68, 0xA6, 0x83, 0x20, 0x79, 0x9B, - 0x24, 0xEA, 0x10, 0x5A, 0xB4, 0x39, 0x58, 0xAC, 0xA0, 0x45, 0x3B, 0x16, 0xBE, 0x24, 0x59, 0x1D, - 0x18, 0x5C, 0xD8, 0xCD, 0xFE, 0x16, 0x5C, 0x84, 0x5C, 0x2D, 0x7D, 0x28, 0xC9, 0xCE, 0x9D, 0x38, - 0xF6, 0x2F, 0x9A, 0x8A, 0x93, 0x95, 0xDC, 0x73, 0x48, 0xFD, 0xF5, 0xAB, 0xF4, 0x06, 0xB4, 0x11, - 0x79, 0x7B, 0xF7, 0x75, 0x73, 0xC2, 0x2D, 0x9C, 0x91, 0x7E, 0x51, 0x12, 0x54, 0xAC, 0x55, 0x29, - 0x48, 0x7F, 0x50, 0x15, 0xC2, 0x79, 0x05, 0x3C, 0x8F, 0xB4, 0xAE, 0xDD, 0x28, 0x09, 0xCC, 0x1D, - 0xDE, 0xEF, 0x82, 0xFD, 0x64, 0xD1, 0x5A, 0xFE, 0x06, 0x18, 0x7C, 0xF6, 0x32, 0x67, 0xDB, 0xF1, - 0x55, 0xF4, 0x09, 0x33, 0xB4, 0x91, 0xA7, 0x68, 0xE7, 0xA3, 0x60, 0x93, 0xE6, 0x36, 0xDE, 0x28, - 0xB3, 0xBD, 0x90, 0x46, 0x7F, 0xE5, 0xAF, 0x3C, 0xB6, 0x5E, 0xF2, 0x98, 0xE6, 0x28, 0x07, 0xA9, - 0x21, 0x4C, 0xAA, 0xF7, 0x95, 0xD9, 0x25, 0x51, 0x7F, 0x26, 0x8F, 0xC9, 0xD6, 0x65, 0xCA, 0x07, - 0x82, 0x1F, 0x8E, 0xBF, 0xBA, 0x65, 0xF7, 0xB1, 0x51, 0x85, 0x99, 0x23, 0x4E, 0x48, 0x2E, 0x7B, - 0xC8, 0x09, 0xC4, 0x93, 0xB9, 0xDB, 0x6B, 0xAF, 0xCA, 0xC7, 0x0A, 0xC5, 0x6D, 0xD0, 0xC2, 0xD4, - 0xF5, 0xA1, 0x5E, 0x45, 0x28, 0x54, 0x1D, 0x87, 0xC8, 0x83, 0xAF, 0x9E, 0xB7, 0xC7, 0x4D, 0x48, - 0x3B, 0x49, 0x23, 0x8B, 0x23, 0x6A, 0x2D, 0xD6, 0x30, 0xAD, 0xD3, 0xFA, 0x35, 0x67, 0xF0, 0x0D, - 0x3A, 0xDC, 0x42, 0x57, 0xBE, 0xE6, 0x5B, 0x26, 0x0B, 0x30, 0x45, 0x7E, 0x71, 0x5D, 0x82, 0xE7, - 0x40, 0x45, 0x58, 0xBB, 0xF5, 0x07, 0xEC, 0x36, 0x47, 0xF7, 0x98, 0x05, 0x70, 0x83, 0x17, 0x9D, - 0xDD, 0x4A, 0x4A, 0xB7, 0xB5, 0xBC, 0x8B, 0xF5, 0x08, 0x47, 0x74, 0xF3, 0x0F, 0x3C, 0xB0, 0xC7, - 0x30, 0x88, 0xCF, 0xA2, 0xE1, 0xC3, 0x13, 0x52, 0x20, 0x2D, 0xAD, 0xB3, 0x99, 0x37, 0x71, 0x91, - 0xBB, 0x3F, 0x31, 0xAC, 0xEC, 0xB8, 0x2A, 0x84, 0x12, 0x34, 0x84, 0xE5, 0xBF, 0x47, 0x94, 0xD6, - 0x9A, 0x1F, 0xEB, 0x34, 0xAF, 0xDA, 0x93, 0x5D, 0x22, 0x88, 0x27, 0x1A, 0x04, 0x13, 0xAA, 0x06, - 0x52, 0x8C, 0x44, 0xCB, 0xCC, 0x70, 0x7A, 0xBF, 0xC3, 0x3D, 0x21, 0x71, 0x99, 0x4F, 0x06, 0x42, - 0x8B, 0x7F, 0xDA, 0xBC, 0xAF, 0x7C, 0x24, 0x94, 0x3F, 0xC9, 0xB9, 0xF0, 0xFB, 0x9C, 0xFB, 0x94, - 0xFC, 0x7F, 0xA0, 0x2F, 0x20, 0x4D, 0x57, 0x06, 0xDB, 0xA8, 0xC4, 0xBD, 0x02, 0x6C, 0xDD, 0x00, - 0x8C, 0x84, 0xEF, 0x63, 0xDB, 0x45, 0x34, 0x21, 0x69, 0x73, 0x53, 0x22, 0xD3, 0x61, 0xA6, 0x7A, - 0xDE, 0xC1, 0x66, 0xFD, 0x3B, 0x95, 0x13, 0x76, 0x06, 0xE4, 0x76, 0x0E, 0x63, 0xF2, 0x66, 0x56, - 0xE3, 0x80, 0x55, 0x57, 0xF3, 0x88, 0xA2, 0x5E, 0x84, 0x29, 0xFD, 0x44, 0x78, 0xA9, 0xF0, 0x3A, - 0xF9, 0xE7, 0xDD, 0x66, 0xE1, 0x48, 0xA4, 0xD7, 0x15, 0x06, 0x47, 0xBA, 0x1E, 0x70, 0xA0, 0xA2, - 0xBC, 0x79, 0xCF, 0x9B, 0xA6, 0x61, 0x95, 0x4F, 0xF8, 0x46, 0xA7, 0xD5, 0xB5, 0x5F, 0x66, 0xDD, - 0xE2, 0x5A, 0x8B, 0x29, 0xBA, 0x02, 0xC8, 0x1A, 0x17, 0xFD, 0x72, 0x45, 0xED, 0x63, 0x46, 0x64, - 0x5E, 0xC9, 0x24, 0x8D, 0x91, 0x38, 0xD1, 0xEF, 0xDF, 0x82, 0x09, 0xB0, 0x5B, 0x8C, 0x43, 0x5F, - 0xF9, 0x05, 0x34, 0x1E, 0x2B, 0x4D, 0xA8, 0xC3, 0xE5, 0x9A, 0xD5, 0x95, 0x1B, 0xC0, 0xB9, 0x30, - 0x55, 0xB1, 0xEF, 0x53, 0xD2, 0x86, 0x65, 0x96, 0xD1, 0x3C, 0x75, 0x9E, 0x43, 0xED, 0x72, 0x92, - 0x5F, 0xC3, 0xF8, 0x4C, 0x14, 0xA7, 0x77, 0x22, 0x48, 0x5E, 0xD0, 0x02, 0x32, 0xB4, 0x5F, 0xA9, - 0xCD, 0x9C, 0xF6, 0x46, 0x60, 0xEF, 0x4D, 0x14, 0x84, 0x6E, 0xC5, 0x2C, 0xA6, 0xB2, 0xFB, 0x38, - 0xD1, 0x0C, 0xB2, 0x87, 0xE8, 0x64, 0x1E, 0xFD, 0xC4, 0x28, 0x08, 0x37, 0x61, 0x85, 0x11, 0x44, - 0x76, 0xC9, 0x9F, 0xAD, 0x6D, 0xBC, 0xC0, 0xC8, 0x02, 0xC8, 0xDA, 0x22, 0x1D, 0xB3, 0x54, 0x5F, - 0x38, 0x0D, 0x1D, 0xC0, 0x78, 0x46, 0x7C, 0x46, 0x05, 0xC1, 0x51, 0x9A, 0xF7, 0x7E, 0x51, 0x75, - 0x32, 0xD6, 0xB1, 0x7E, 0x8B, 0x3A, 0xB9, 0xA8, 0x12, 0xAF, 0xF8, 0x20, 0x69, 0xED, 0x37, 0xB4, - 0xD2, 0x7D, 0x7C, 0x08, 0xE4, 0x74, 0xD8, 0x18, 0x2B, 0x6E, 0x65, 0x21, 0xC4, 0x8C, 0xF0, 0xB2, - 0x1A, 0x7D, 0xDD, 0xA5, 0xE9, 0xC3, 0x88, 0xEE, 0x7E, 0x80, 0xE3, 0x4B, 0x3A, 0x56, 0x3D, 0x4B, - 0x75, 0x62, 0xE1, 0xCE, 0xB6, 0xD5, 0xF1, 0xFC, 0x0C, 0x0A, 0x66, 0x10, 0xD2, 0xC0, 0xF3, 0xD3, - 0xCA, 0xFE, 0xD6, 0x73, 0xE4, 0x21, 0xDA, 0xED, 0xE4, 0xE4, 0x5A, 0xAC, 0x31, 0x6D, 0x84, 0x8E, - 0x24, 0x56, 0x6B, 0x09, 0x14, 0x09, 0x81, 0xD6, 0xC6, 0x92, 0x2B, 0xE5, 0x2F, 0x61, 0xCE, 0xD3, - 0xBD, 0x31, 0x10, 0x56, 0x4C, 0x68, 0x18, 0xA2, 0x4E, 0xBF, 0x22, 0x71, 0x77, 0x4A, 0xEC, 0x3F, - 0x8A, 0x10, 0xF9, 0x62, 0x7B, 0x4F, 0x7E, 0xE3, 0x16, 0x23, 0x3C, 0x4A, 0x7B, 0xD9, 0xCC, 0xA1, - 0x13, 0x09, 0x31, 0xD8, 0xD1, 0x23, 0xC4, 0xAD, 0x48, 0xD6, 0xC7, 0xCF, 0xB6, 0xE2, 0x5E, 0x53, - 0xAF, 0x45, 0xF4, 0xE4, 0x82, 0xDC, 0xB3, 0x5D, 0x19, 0x4A, 0x71, 0xBE, 0x75, 0x1D, 0x82, 0x9C, - 0xCD, 0x1F, 0x1E, 0xCE, 0xE1, 0xB6, 0x94, 0xED, 0x9A, 0x3A, 0x1A, 0x66, 0xFF, 0x5C, 0x43, 0x7D, - 0x51, 0x46, 0x09, 0xBB, 0xD0, 0x5D, 0x1A, 0x81, 0x98, 0x9A, 0xAC, 0x74, 0x94, 0xD3, 0x05, 0x55, - 0xE1, 0xE4, 0x2A, 0x43, 0xCC, 0xC8, 0x2C, 0x10, 0xA7, 0xE8, 0xAD, 0x5F, 0x02, 0xDF, 0x3B, 0x10, - 0x33, 0x43, 0x8A, 0x92, 0xF9, 0xCF, 0x12, 0x04, 0x60, 0xCD, 0xA0, 0x30, 0xA9, 0xE8, 0x32, 0x30, - 0x80, 0x8B, 0xF2, 0x09, 0xA4, 0x91, 0xFA, 0x3B, 0xBD, 0x1D, 0x54, 0xFD, 0xF8, 0xCF, 0x74, 0x70, - 0x50, 0x9B, 0x8D, 0x40, 0xBD, 0xC7, 0x3D, 0x4F, 0x03, 0x7B, 0x63, 0x32, 0xCE, 0x8B, 0x5B, 0x7C, - 0x9A, 0xE0, 0x3A, 0x37, 0x38, 0xCA, 0x31, 0x21, 0xDB, 0x4F, 0xF6, 0xF0, 0xDB, 0x4E, 0xE5, 0xDC, - 0x69, 0x4B, 0xAE, 0x28, 0x01, 0xF2, 0x46, 0x38, 0x6A, 0x9A, 0x50, 0x2D, 0xF4, 0x36, 0x5D, 0xEF, - 0x25, 0xB1, 0x31, 0xCA, 0x58, 0x5E, 0x4B, 0xE6, 0xAC, 0xCF, 0x0C, 0x20, 0x84, 0x7F, 0xF5, 0xC1, - 0x1A, 0xE5, 0x94, 0xC3, 0x3D, 0x77, 0x8E, 0xA3, 0x9B, 0xAF, 0x96, 0xBF, 0xD1, 0xEC, 0x35, 0x17, - 0x15, 0xDF, 0x2B, 0x00, 0xCD, 0x2C, 0xDB, 0xD3, 0x31, 0x8A, 0x6D, 0xE0, 0xB3, 0x1F, 0x71, 0xB4, - 0xA4, 0xCA, 0xFA, 0x40, 0xEB, 0x99, 0x4C, 0xFB, 0xFE, 0x9D, 0xBA, 0x26, 0x0F, 0x1B, 0x6D, 0xE6, - 0xB6, 0x2C, 0xAD, 0xF4, 0xD8, 0x12, 0xC0, 0xA3, 0xA4, 0x65, 0x10, 0x1B, 0xCD, 0xFD, 0x0A, 0xB0, - 0x52, 0x71, 0x56, 0xD4, 0x01, 0x49, 0xC9, 0x68, 0x06, 0xA1, 0xD3, 0x61, 0x8A, 0xC1, 0x07, 0x1B, - 0x06, 0x48, 0x78, 0x1B, 0x96, 0xCB, 0x7B, 0xC5, 0xF4, 0x8B, 0x27, 0x93, 0xF1, 0x10, 0x40, 0xB3, - 0x36, 0xA3, 0xA8, 0x19, 0xF3, 0x1B, 0x1B, 0xA4, 0xCD, 0x19, 0x18, 0x25, 0x7C, 0x24, 0xAC, 0x05, - 0xD1, 0xB2, 0xA1, 0x1E, 0x0B, 0xB3, 0xDA, 0x82, 0x3E, 0x78, 0x87, 0x12, 0x8F, 0xE6, 0xB9, 0x59, - 0x02, 0xDC, 0x15, 0x31, 0xA3, 0xAE, 0x22, 0x2F, 0xB7, 0x60, 0x08, 0x42, 0xA0, 0x4B, 0x94, 0xA1, - 0x1A, 0xD9, 0x32, 0x40, 0x2C, 0x33, 0x5A, 0x62, 0xB3, 0xDB, 0x9C, 0x04, 0x3B, 0xCE, 0x40, 0xCD, - 0x3C, 0x29, 0xDB, 0x1C, 0x98, 0xC7, 0x7B, 0x09, 0x65, 0x91, 0xCD, 0xB9, 0x71, 0x80, 0xF2, 0x14, - 0x90, 0x27, 0xA5, 0xC7, 0x16, 0xBB, 0xC8, 0x6D, 0x79, 0x0F, 0xC7, 0x06, 0x4F, 0xFD, 0xEF, 0x3D, - 0x7E, 0xA9, 0x1A, 0x20, 0x4A, 0x94, 0x3F, 0x84, 0xA1, 0x97, 0xE1, 0x99, 0xF5, 0x9E, 0xB2, 0x46, - 0x23, 0xC3, 0x48, 0x46, 0xC0, 0x2C, 0x7D, 0x64, 0x45, 0x7B, 0xA0, 0xBF, 0x5F, 0x14, 0xBC, 0xB2, - 0x17, 0x87, 0x68, 0x5C, 0x17, 0xCE, 0xCA, 0xEA, 0x73, 0x3C, 0xAE, 0x6C, 0x8C, 0x4A, 0x2C, 0xFB, - 0x77, 0x52, 0xE7, 0xA1, 0xFF, 0x6C, 0x23, 0x05, 0x1E, 0x69, 0x22, 0xF1, 0xDA, 0x6B, 0xB6, 0x01, - 0x44, 0xDE, 0xEB, 0x80, 0xB7, 0x84, 0x5B, 0xC7, 0xEA, 0x59, 0x5B, 0x3F, 0x23, 0x7E, 0x10, 0x00, - 0x27, 0x5C, 0x6A, 0x7B, 0xEB, 0xFF, 0xDF, 0x82, 0xEE, 0x85, 0x6C, 0xA5, 0x1A, 0xBF, 0xEB, 0x64, - 0xBB, 0x10, 0x46, 0x40, 0x51, 0x29, 0x2C, 0x6A, 0xD2, 0xF5, 0x58, 0x61, 0x5F, 0x77, 0x31, 0xBD, - 0x59, 0x0A, 0x1B, 0xF5, 0xC2, 0xFA, 0x9A, 0xB4, 0x59, 0xF4, 0x0A, 0xD1, 0x68, 0xCC, 0x21, 0x44, - 0xDC, 0x70, 0x80, 0xD1, 0x67, 0xCC, 0x24, 0x22, 0xC0, 0x77, 0x04, 0xED, 0xA3, 0xB4, 0x23, 0xC8, - 0xAD, 0x5E, 0x18, 0x64, 0x57, 0x89, 0x52, 0xDD, 0x25, 0x6C, 0x38, 0xCE, 0x5D, 0x45, 0x42, 0x18, - 0xA3, 0xE2, 0xD8, 0x6E, 0x21, 0x5F, 0xBB, 0x9D, 0xCA, 0x90, 0x57, 0x85, 0x0C, 0xD5, 0x56, 0xC8, - 0x12, 0x39, 0x27, 0x44, 0x77, 0xE6, 0x59, 0xE7, 0x08, 0xB0, 0x4E, 0x80, 0xBD, 0xE3, 0xE6, 0x8B, - 0xE1, 0x4B, 0x6E, 0xCE, 0xA9, 0x5C, 0x8E, 0xF2, 0xE2, 0xFE, 0x18, 0xFB, 0x74, 0xD6, 0x3C, 0x76, - 0xB8, 0xB0, 0x90, 0x00, 0x3A, 0xF4, 0xE4, 0xB7, 0xFD, 0x05, 0xA3, 0x7A, 0xD9, 0xF7, 0x0E, 0x18, - 0x66, 0xBC, 0x9A, 0x47, 0x18, 0x80, 0x4F, 0x4A, 0x6B, 0x9C, 0xF8, 0x48, 0x16, 0x49, 0x3F, 0x21, - 0xB4, 0x20, 0x59, 0x51, 0xDA, 0xD1, 0x4B, 0xE8, 0x5E, 0x48, 0x95, 0x77, 0x0A, 0x82, 0xA1, 0x8F, - 0xD2, 0x77, 0xC9, 0xC5, 0xE2, 0x79, 0x24, 0x87, 0x34, 0x0C, 0x9E, 0x17, 0x6F, 0x7B, 0xEA, 0x14, - 0x79, 0xF6, 0x0C, 0x95, 0x5F, 0x1C, 0x61, 0x01, 0x61, 0x6D, 0xD1, 0xF2, 0x6A, 0xA8, 0x09, 0xAA, - 0x0A, 0x6E, 0xF9, 0x28, 0x69, 0x49, 0x14, 0x60, 0x6D, 0xA3, 0xCF, 0x5E, 0x4C, 0x34, 0x8E, 0xFC, - 0x7E, 0x3E, 0x72, 0x3E, 0x02, 0x78, 0x3D, 0x1B, 0xA4, 0x93, 0x46, 0x39, 0x46, 0x0E, 0xF0, 0xE3, - 0x46, 0xF0, 0x4C, 0x2F, 0xE2, 0x14, 0x93, 0xF0, 0x2A, 0x5B, 0xE8, 0x05, 0xF7, 0x10, 0x3A, 0x6D, - 0x03, 0xA0, 0x5D, 0xF8, 0x5D, 0xD1, 0x4C, 0x58, 0x7B, 0xBF, 0xAB, 0x52, 0xC1, 0x6E, 0x72, 0x1E, - 0x60, 0x8C, 0x33, 0x4E, 0x22, 0xE7, 0x12, 0x51, 0x0B, 0xFE, 0x22, 0xDA, 0x8A, 0x53, 0xA7, 0xC6, - 0x9A, 0x66, 0x92, 0x76, 0x46, 0x3C, 0xC5, 0x72, 0x55, 0x6C, 0xD2, 0x8D, 0xF1, 0xD5, 0x6C, 0x09, - 0xEA, 0x2D, 0x1A, 0xF9, 0x99, 0x5E, 0x65, 0xCC, 0x6D, 0x55, 0x5F, 0x46, 0x66, 0xC3, 0xBB, 0xBE, - 0x1C, 0x53, 0x40, 0x3B, 0xE9, 0x15, 0x6C, 0xD6, 0x94, 0x8C, 0x5D, 0xB4, 0x4A, 0xDC, 0x2F, 0x2F, - 0xC1, 0xA8, 0xE1, 0xDF, 0x7A, 0xB5, 0x6D, 0xE2, 0xF8, 0xDB, 0xAA, 0x5D, 0x3D, 0x80, 0x5D, 0x33, - 0x6F, 0xCD, 0x5A, 0x84, 0xBC, 0x2D, 0x6E, 0x28, 0x97, 0x07, 0xA6, 0xF1, 0x0B, 0x22, 0x23, 0x58, - 0xDF, 0x50, 0x15, 0x73, 0xD6, 0x75, 0x63, 0xB6, 0x0F, 0xD8, 0x75, 0x9B, 0xF9, 0x9D, 0xBF, 0xE6, - 0xAF, 0xF8, 0xBF, 0xB4, 0x3A, 0xD4, 0x02, 0x3B, 0x8A, 0x4D, 0xF6, 0x44, 0x0E, 0x7F, 0x2B, 0xDB, - 0x9C, 0xAC, 0xD6, 0xB8, 0xC5, 0xB5, 0xEF, 0x1B, 0x67, 0xB0, 0x10, 0xCC, 0x1E, 0x24, 0xD4, 0x05, - 0x06, 0x6D, 0x3A, 0xFE, 0x95, 0x4C, 0x00, 0x8A, 0xD2, 0x53, 0x1B, 0x7A, 0xDE, 0xA0, 0x9F, 0x2D, - 0x10, 0x43, 0x2D, 0xA3, 0x8E, 0x66, 0x36, 0x27, 0x77, 0x05, 0x26, 0x78, 0x21, 0x09, 0x18, 0xD0, - 0x2E, 0x86, 0x1E, 0x56, 0x3B, 0x71, 0x3A, 0x46, 0x24, 0x7C, 0x90, 0x1E, 0x42, 0x36, 0x11, 0xA1, - 0x7C, 0x04, 0x80, 0x42, 0x0F, 0xA8, 0x4E, 0x07, 0xA1, 0x7B, 0x55, 0x5F, 0xA8, 0x8A, 0x1D, 0x36, - 0x9C, 0x16, 0xBD, 0xE0, 0x63, 0x0A, 0xE3, 0xC5, 0xF9, 0x55, 0xA4, 0xE9, 0x75, 0x7D, 0xD5, 0x82, - 0x32, 0x1E, 0x6B, 0x05, 0xE4, 0xF9, 0x8A, 0x8C, 0x18, 0x0E, 0xA0, 0xDF, 0x23, 0x4D, 0xA8, 0x4E, - 0xF0, 0x85, 0xFF, 0x04, 0xC5, 0xFE, 0x1E, 0x8A, 0x3F, 0xBF, 0x54, 0x05, 0x82, 0x8A, 0x0C, 0xDF, - 0xCA, 0x0A, 0xD0, 0x43, 0x76, 0xE5, 0x49, 0x55, 0x36, 0x24, 0x6F, 0x2F, 0x20, 0x58, 0x3A, 0xFE, - 0x62, 0x3A, 0x11, 0xAA, 0x2F, 0xB2, 0x25, 0x6F, 0x0B, 0x9D, 0xD8, 0xCC, 0xC5, 0x26, 0x16, 0x2E, - 0x74, 0x56, 0xBE, 0x99, 0xF4, 0xE7, 0x90, 0x88, 0x65, 0x1E, 0x6C, 0xAA, 0xB4, 0x2C, 0xCF, 0x12, - 0x63, 0x86, 0x8E, 0x9C, 0xF5, 0x75, 0x5A, 0x71, 0xBF, 0xFB, 0x54, 0xF3, 0x86, 0x61, 0xC5, 0x59, - 0xB4, 0xD5, 0x8E, 0x5D, 0x91, 0xA0, 0xB0, 0x9B, 0xB1, 0x95, 0xCE, 0x45, 0x0C, 0x4A, 0xFC, 0xE0, - 0x56, 0x73, 0x96, 0xC1, 0xAA, 0x0A, 0x65, 0x42, 0x42, 0xC1, 0xC7, 0x2D, 0x6E, 0xC8, 0x4A, 0x7F, - 0x40, 0x53, 0x0C, 0x7A, 0x99, 0x96, 0x59, 0xFA, 0xEC, 0xAD, 0xA1, 0xF0, 0xAB, 0xFE, 0xB6, 0x58, - 0x49, 0x65, 0xF4, 0x29, 0x2A, 0x21, 0x42, 0x93, 0x0A, 0xED, 0x38, 0xC0, 0x33, 0xFD, 0xCF, 0x8E, - 0xC1, 0xEC, 0x3A, 0xF9, 0x1F, 0xEA, 0x8F, 0xA2, 0xEA, 0xAE, 0xC4, 0xE7, 0x43, 0xCB, 0x53, 0xF1, - 0x77, 0xC9, 0x6C, 0x61, 0x35, 0xE2, 0xED, 0x25, 0x68, 0xF6, 0x8E, 0x06, 0xD6, 0x41, 0x87, 0x58, - 0x8A, 0xE4, 0x5F, 0x80, 0x59, 0xC7, 0x21, 0xAC, 0xC1, 0x95, 0xC8, 0xBA, 0xF9, 0x84, 0x1F, 0x70, - 0x15, 0x1C, 0xB1, 0xF1, 0x2B, 0xB4, 0xB7, 0xA0, 0x4B, 0xE3, 0xB3, 0xD4, 0x3C, 0x9C, 0x01, 0xB2, - 0x4A, 0xE5, 0x47, 0x39, 0x10, 0x32, 0xE0, 0x0E, 0x1C, 0xE9, 0x3E, 0x2E, 0xDD, 0x12, 0x2C, 0xDF, - 0xB7, 0x47, 0xE8, 0x88, 0x53, 0x28, 0xF2, 0xC6, 0x11, 0x12, 0x15, 0x4A, 0x60, 0x14, 0xA4, 0x78, - 0x54, 0x8E, 0x6A, 0x77, 0xD6, 0x74, 0xC2, 0xCD, 0x4B, 0xF9, 0xC2, 0x84, 0xE8, 0xD6, 0xED, 0x4D, - 0xB3, 0x0C, 0x32, 0x39, 0xCF, 0xB9, 0xF9, 0x0B, 0xC3, 0x52, 0xF5, 0x6E, 0x9A, 0x38, 0x84, 0xED, - 0x0D, 0x83, 0xFA, 0x83, 0x2D, 0xF4, 0xB3, 0xEE, 0x71, 0xE0, 0x47, 0x48, 0xE6, 0x1A, 0x0B, 0xD9, - 0x54, 0x74, 0xB8, 0x39, 0xA1, 0x4C, 0xC7, 0x3C, 0x52, 0x02, 0x07, 0x61, 0x12, 0x1B, 0x49, 0x0B, - 0x7D, 0x08, 0xAA, 0xEA, 0xB0, 0x3A, 0x05, 0x65, 0x9A, 0xEA, 0x68, 0x0C, 0x5B, 0xA6, 0x37, 0xC6, - 0x5F, 0x10, 0x7D, 0xC8, 0xAE, 0xCA, 0x65, 0x1F, 0x16, 0x80, 0x38, 0xF1, 0xB7, 0xB5, 0xDB, 0x1D, - 0x37, 0x5A, 0x1D, 0xEB, 0x7B, 0x2C, 0xA1, 0x7B, 0x72, 0xCE, 0x0D, 0x34, 0xB4, 0x17, 0x23, 0x52, - 0x8B, 0x3A, 0xD6, 0xEC, 0xE5, 0x8D, 0x23, 0x6A, 0xCF, 0x34, 0xDE, 0x02, 0x5A, 0xA4, 0x54, 0xFF, - 0x85, 0x85, 0x3E, 0x33, 0x87, 0xF9, 0x27, 0x59, 0xE2, 0x32, 0xAB, 0x8D, 0xBA, 0x8A, 0x92, 0xEB, - 0x5D, 0xA7, 0xF6, 0x6A, 0xDF, 0x32, 0xAD, 0xAC, 0x70, 0xCF, 0x91, 0xA9, 0x8E, 0x4C, 0x39, 0x71, - 0x4C, 0x1B, 0xBF, 0xD1, 0xD0, 0x68, 0x19, 0x9C, 0x8A, 0x7B, 0x57, 0x52, 0x40, 0xCE, 0xCC, 0x86, - 0xB7, 0x0E, 0x3D, 0x5E, 0xAD, 0xD0, 0x2B, 0xD4, 0x58, 0x5C, 0x5B, 0xD8, 0x00, 0x7F, 0x42, 0x99, - 0x84, 0x5D, 0x2D, 0x86, 0x40, 0x10, 0x35, 0x15, 0x05, 0x67, 0xDE, 0x22, 0x6C, 0xB4, 0x5C, 0x7B, - 0xCA, 0xDF, 0xF4, 0x1D, 0xD2, 0xCB, 0x34, 0x02, 0x6C, 0x22, 0x10, 0x4F, 0x7F, 0xDF, 0x18, 0xFF, - 0x5A, 0x81, 0x4C, 0xAC, 0xF7, 0xF3, 0xF1, 0x5D, 0xBA, 0x72, 0x36, 0x26, 0x88, 0xAE, 0xCA, 0xE0, - 0x79, 0x84, 0x68, 0x86, 0xCE, 0x35, 0xAF, 0x27, 0xB4, 0x21, 0xFD, 0x05, 0xB1, 0x38, 0x17, 0x7D, - 0x9B, 0x5A, 0x12, 0x29, 0x76, 0xE5, 0xA0, 0x39, 0x0B, 0xAD, 0x4C, 0x33, 0xCB, 0x45, 0x59, 0x82, - 0xB7, 0x03, 0xD2, 0x1A, 0xF7, 0x2F, 0x54, 0x43, 0x92, 0xC9, 0x8B, 0x6F, 0x6C, 0x6C, 0x1B, 0x10, - 0xEE, 0x97, 0x38, 0xA5, 0x8B, 0x16, 0xDE, 0xFC, 0xDA, 0x83, 0x4B, 0x39, 0x79, 0x17, 0xB7, 0x5A, - 0x59, 0x01, 0x11, 0xC0, 0xC6, 0x36, 0xD5, 0xBA, 0xB1, 0x46, 0x9E, 0x6B, 0xA1, 0xCB, 0x96, 0x7E, - 0x56, 0x91, 0x87, 0x68, 0x59, 0x8E, 0xCF, 0xB5, 0x58, 0x24, 0x2C, 0xD9, 0x0A, 0x06, 0x25, 0xCB, - 0x8C, 0xE6, 0x02, 0xE3, 0x5A, 0x19, 0x4D, 0x8F, 0x43, 0x5B, 0x40, 0x3F, 0x7D, 0x50, 0x24, 0x90, - 0x71, 0x3E, 0x88, 0x96, 0x3C, 0xCE, 0x2C, 0x80, 0x35, 0x68, 0x3E, 0x21, 0x67, 0x8A, 0x03, 0x68, - 0x49, 0x6B, 0xFA, 0xE2, 0x5A, 0xC7, 0xFF, 0x9C, 0xDF, 0x0D, 0xD9, 0xB5, 0x12, 0x07, 0x35, 0x7B, - 0x35, 0xDC, 0xF7, 0x12, 0x55, 0x71, 0x8A, 0x9F, 0x68, 0x66, 0x2A, 0x72, 0x55, 0x14, 0x82, 0xE2, - 0xBC, 0x3A, 0x39, 0xA7, 0x91, 0xA9, 0x91, 0xC8, 0x2B, 0x5F, 0x0A, 0x09, 0xFD, 0xE0, 0x6B, 0x58, - 0x85, 0x58, 0x1D, 0xCD, 0xEA, 0xAE, 0xBA, 0xA5, 0x49, 0xFF, 0x69, 0x4A, 0x10, 0xDD, 0x5A, 0xE0, - 0x0E, 0xD3, 0x9C, 0x0B, 0xD8, 0x28, 0x2E, 0xCA, 0x8E, 0x9F, 0x29, 0x84, 0xC8, 0xCA, 0x47, 0x79, - 0xB9, 0xCC, 0x71, 0xC6, 0xE1, 0xC1, 0x4D, 0x15, 0xB6, 0x1F, 0x92, 0x13, 0x2C, 0x83, 0xBE, 0x0D, - 0x03, 0x0A, 0x7C, 0x02, 0x7C, 0x2C, 0xFA, 0x8E, 0xC8, 0x23, 0xE1, 0xFD, 0x83, 0xDC, 0x61, 0xDB, - 0x1C, 0xE4, 0x3F, 0xE8, 0xA9, 0x1C, 0x55, 0x1E, 0xB2, 0xF1, 0x47, 0x6C, 0x5A, 0xD8, 0xD9, 0xD4, - 0xA8, 0xBF, 0x4B, 0xF9, 0x0A, 0xD5, 0xBF, 0x1D, 0x88, 0x30, 0x12, 0x80, 0x72, 0x49, 0x6C, 0x91, - 0x70, 0x6A, 0xB7, 0x4D, 0x86, 0x34, 0x8F, 0x57, 0x1A, 0x6A, 0x16, 0x7B, 0xA5, 0x5D, 0x3C, 0x74, - 0x8E, 0x03, 0x1D, 0x53, 0xD6, 0x1C, 0x75, 0x83, 0x2C, 0xF7, 0x5E, 0xF6, 0xE0, 0xC9, 0x25, 0x11, - 0x9F, 0x98, 0x73, 0xD2, 0xBE, 0x50, 0x56, 0xD6, 0x73, 0x38, 0xC8, 0x30, 0x5A, 0xB5, 0xF6, 0x67, - 0x37, 0x75, 0x7E, 0x99, 0x71, 0xC7, 0x30, 0x26, 0x0D, 0x43, 0xA2, 0x0B, 0xF0, 0xC2, 0xCC, 0x38, - 0xDF, 0x0F, 0x37, 0x25, 0xA0, 0x4F, 0x18, 0x5A, 0x40, 0x75, 0x2D, 0xFC, 0x52, 0xFF, 0x37, 0xD5, - 0x38, 0x06, 0xC6, 0x62, 0x13, 0xA0, 0x8E, 0x7A, 0xFA, 0xDD, 0xB9, 0x25, 0xBE, 0xBC, 0x1F, 0x02, - 0x4C, 0x56, 0xA1, 0xBA, 0x08, 0xBB, 0x65, 0xAE, 0xAC, 0x14, 0x4E, 0x65, 0xD7, 0xD1, 0x99, 0xFF, - 0x14, 0x33, 0x9F, 0x18, 0x1D, 0x54, 0x70, 0x6F, 0xBC, 0x85, 0xB4, 0x49, 0x82, 0x4C, 0x0A, 0xA6, - 0xE8, 0x10, 0x61, 0x8F, 0xED, 0xFD, 0x7F, 0x10, 0xAA, 0xAC, 0x13, 0xB5, 0xE2, 0x5D, 0xF3, 0x69, - 0x2B, 0xC3, 0xE1, 0xC2, 0x89, 0x9A, 0x46, 0xF0, 0x97, 0x34, 0xFC, 0x93, 0x31, 0x45, 0xE9, 0x7A, - 0xD4, 0x46, 0x1A, 0x31, 0xFF, 0x65, 0x39, 0xAE, 0xCE, 0xC5, 0x40, 0x2F, 0xD0, 0xCB, 0x1E, 0xC6, - 0x86, 0xDC, 0x2F, 0x72, 0x34, 0x35, 0x28, 0xAD, 0x96, 0xC3, 0xBE, 0xE4, 0xC8, 0xA5, 0xB6, 0x6B, - 0xBD, 0xFB, 0x9B, 0xE5, 0x16, 0x01, 0x4A, 0x55, 0xA2, 0xB0, 0xE8, 0x66, 0x4A, 0xC1, 0xE3, 0xC0, - 0xB9, 0x87, 0xF4, 0xD6, 0x8C, 0xF4, 0x61, 0x42, 0xA4, 0xBF, 0x73, 0x03, 0x67, 0xBD, 0x2F, 0x30, - 0x6E, 0x97, 0x45, 0x0F, 0xC6, 0xBD, 0xCA, 0x2E, 0x69, 0x72, 0x41, 0x07, 0x38, 0x74, 0x18, 0xB1, - 0xCB, 0x5C, 0xD3, 0xC2, 0x1D, 0xB7, 0xF2, 0xAF, 0xEC, 0x00, 0xCD, 0x4F, 0x6F, 0xDE, 0xB2, 0xAC, - 0x44, 0x4C, 0x1A, 0x56, 0xC3, 0x93, 0x21, 0x57, 0x8C, 0x6B, 0x1C, 0xD7, 0xF9, 0xC7, 0xC0, 0xA9, - 0xF7, 0xE4, 0xA3, 0xD8, 0x58, 0x9B, 0x35, 0xE6, 0x00, 0x7C, 0xE2, 0x12, 0xD0, 0x53, 0x61, 0x1F, - 0xC6, 0xA5, 0x81, 0x7A, 0x52, 0xEF, 0x09, 0x36, 0x1A, 0x62, 0x3C, 0x92, 0xD2, 0x65, 0x43, 0xF6, - 0xDF, 0x0B, 0x89, 0x7E, 0xC6, 0xB9, 0x47, 0xF4, 0x52, 0x14, 0x0C, 0x44, 0x4D, 0x23, 0x55, 0x6F, - 0x80, 0xC2, 0xBE, 0xC5, 0x59, 0xF8, 0xB5, 0x27, 0xE6, 0xE8, 0xF0, 0x32, 0x91, 0x3A, 0x59, 0x2B, - 0x1D, 0xF9, 0xAC, 0xF9, 0x2E, 0xF3, 0xB9, 0x36, 0x8C, 0x1A, 0x5D, 0x92, 0x33, 0xEA, 0xA6, 0xAF, - 0x71, 0x24, 0xE2, 0x7F, 0x18, 0xB1, 0x23, 0x3C, 0x53, 0xF3, 0xCC, 0x5D, 0xD4, 0x2D, 0x2B, 0x7A, - 0xF8, 0x94, 0x04, 0xC0, 0x8C, 0x65, 0x4D, 0x3A, 0xFA, 0xCF, 0xF9, 0x07, 0xC2, 0xD7, 0x75, 0x87, - 0x47, 0x9E, 0x6E, 0xA0, 0x79, 0x81, 0x6E, 0x03, 0xC7, 0xD2, 0x75, 0xF6, 0xC3, 0x85, 0x22, 0x28, - 0x1B, 0x39, 0x63, 0xCC, 0x12, 0x7E, 0x4A, 0xC3, 0x2A, 0x45, 0x85, 0xA9, 0x54, 0xDF, 0xB2, 0x33, - 0xEF, 0x76, 0x25, 0x31, 0xC9, 0xCD, 0xDA, 0x14, 0xE7, 0xD8, 0x4D, 0x18, 0xCE, 0xAB, 0xE7, 0x85, - 0xDD, 0x95, 0x8D, 0x36, 0xA1, 0x18, 0x87, 0x5E, 0xB6, 0x75, 0x2F, 0x3B, 0x97, 0x09, 0x18, 0x47, - 0xC8, 0x90, 0x37, 0xA3, 0xB2, 0xD2, 0x09, 0x3C, 0x5E, 0x6C, 0x2E, 0x72, 0x38, 0x08, 0x24, 0x99, - 0x90, 0xD0, 0x86, 0xC7, 0xD3, 0xFB, 0x4E, 0xA2, 0xDF, 0xC7, 0x26, 0x4D, 0x8E, 0x81, 0x98, 0x19, - 0x15, 0xD0, 0x4C, 0xB8, 0x44, 0xF7, 0x53, 0x1C, 0x0F, 0xAF, 0x78, 0x4C, 0x20, 0xB8, 0xCC, 0xBB, - 0x20, 0x60, 0xEC, 0x55, 0x70, 0xBD, 0xE9, 0x02, 0x63, 0x9F, 0x1F, 0xA7, 0xD5, 0x27, 0x18, 0x33, - 0x29, 0xA8, 0x33, 0x6E, 0xCB, 0x80, 0x40, 0x2D, 0x52, 0xDF, 0x6C, 0x78, 0x8F, 0xA6, 0x1D, 0xCF, - 0xE8, 0xB9, 0x54, 0x6B -}; +/* +Seed: 4D808D2C77D905C41A6380EC08586AFE (0x05 packet) +Hash: 568C054C781A972A6037A2290C22B52571A06F4E (0x04 packet) +Module MD5: 79C0768D657977D697E10BAD956CCED1 +New Client Key: 7F 96 EE FD A5 B6 3D 20 A4 DF 8E 00 CB F4 83 04 +New Cerver Key: C2 B7 AD ED FC CC A9 C2 BF B3 F8 56 02 BA 80 9B +*/ -uint8 Module_79C0768D657977D697E10BAD956CCED1_Key[16] = +struct Module_79C0768D657977D697E10BAD956CCED1 { - 0xAE, 0x25, 0xBC, 0x51, 0x06, 0x3B, 0x77, 0xBD, 0x36, 0x3C, 0x3E, 0xFE, 0x0F, 0xC1, 0x73, 0xF9 + uint8 Module[18756]; + uint8 ModuleKey[16]; + uint8 Seed[16]; + uint8 ServerKeySeed[16]; + uint8 ClientKeySeed[16]; + uint8 ClientKeySeedHash[20]; +} Module = +{ + { + 0x21, 0x6C, 0xBB, 0x6A, 0xB9, 0xAF, 0xE8, 0xA1, 0x9A, 0x79, 0x18, 0xF1, 0x27, 0x9A, 0x14, 0xF5, + 0x42, 0x5D, 0x00, 0xBA, 0x74, 0x57, 0x0E, 0xAF, 0xD2, 0xAE, 0x8E, 0x51, 0xA5, 0xC1, 0x17, 0x4E, + 0xEC, 0x7F, 0xAC, 0xBC, 0xDD, 0x42, 0x87, 0xA6, 0xF9, 0xC1, 0x4A, 0xCE, 0xB5, 0xDD, 0xB3, 0xF8, + 0x06, 0x52, 0x9D, 0xF2, 0xAE, 0x2A, 0x49, 0x2B, 0x7B, 0x72, 0x5F, 0x40, 0x01, 0x16, 0xDB, 0x98, + 0x77, 0x1F, 0xE3, 0x61, 0x5A, 0x99, 0x39, 0x66, 0x2F, 0x2F, 0x35, 0xBF, 0x00, 0x20, 0xE4, 0xE0, + 0x8F, 0x98, 0xAD, 0xFC, 0xDB, 0x7D, 0xDD, 0xE8, 0x7A, 0xE9, 0x21, 0x6C, 0x86, 0x80, 0x3A, 0xE7, + 0x75, 0x66, 0x0E, 0xD9, 0xC6, 0xC5, 0xD8, 0xD8, 0xA9, 0x9B, 0x84, 0x09, 0xF0, 0xB3, 0x7C, 0x72, + 0x53, 0xE2, 0x29, 0xF9, 0x64, 0x8C, 0x17, 0xFD, 0x90, 0xAE, 0x48, 0x5A, 0x30, 0xFA, 0x30, 0xB7, + 0x54, 0x58, 0x59, 0x61, 0xA0, 0x24, 0x57, 0xE4, 0xF0, 0x05, 0xA2, 0x3F, 0x7A, 0xA6, 0x51, 0x7E, + 0x4F, 0x35, 0xF4, 0xE5, 0xFF, 0x98, 0xE9, 0x3E, 0x1F, 0xF1, 0x66, 0x48, 0x5B, 0xF8, 0xCF, 0x3B, + 0x37, 0x3B, 0x60, 0x47, 0x1C, 0xF7, 0xBE, 0x59, 0x70, 0x3A, 0x03, 0x4C, 0xE6, 0xBD, 0xB6, 0xED, + 0x46, 0xAF, 0x04, 0x5A, 0xAA, 0xC4, 0x30, 0xCF, 0x0B, 0x05, 0x86, 0xA9, 0x56, 0x5B, 0x09, 0xF0, + 0x92, 0x59, 0xC8, 0x48, 0x58, 0x33, 0xBF, 0x81, 0x70, 0x51, 0x92, 0x98, 0xE9, 0x4F, 0x2B, 0xDD, + 0x5B, 0x0A, 0x42, 0x51, 0x73, 0x97, 0xF6, 0x66, 0x00, 0xF2, 0x04, 0x50, 0x4A, 0x54, 0x62, 0x7A, + 0x00, 0x10, 0x5B, 0xAD, 0x0E, 0xFC, 0xE1, 0x44, 0x55, 0x4E, 0x21, 0x76, 0xC6, 0x4B, 0xD5, 0x2E, + 0xF5, 0xF4, 0x0E, 0xFC, 0x55, 0xE1, 0xDE, 0x32, 0x20, 0x22, 0x03, 0x98, 0xF0, 0xD3, 0x4A, 0xE5, + 0x45, 0x49, 0x0C, 0xE8, 0x76, 0xE1, 0xBF, 0x4A, 0x53, 0xD3, 0xCE, 0x64, 0xCF, 0x82, 0xCF, 0x67, + 0xA9, 0x3F, 0xF1, 0x06, 0x24, 0x33, 0x0A, 0x98, 0x6A, 0x5C, 0xAB, 0xEE, 0x7F, 0x64, 0xE3, 0x65, + 0x1F, 0xF6, 0xBE, 0xAF, 0x9C, 0x63, 0x53, 0x54, 0x06, 0x84, 0x4F, 0xF2, 0x7D, 0xC5, 0xBD, 0x70, + 0xC7, 0x6F, 0x59, 0x93, 0x7C, 0xEE, 0xC0, 0xCA, 0xF5, 0x56, 0x21, 0x58, 0x5B, 0xD8, 0x1D, 0xB4, + 0xB7, 0x60, 0x72, 0x46, 0xA2, 0x60, 0x3F, 0xC3, 0x30, 0xAB, 0xE0, 0x3B, 0xAC, 0x9E, 0xB9, 0x64, + 0xA8, 0xEF, 0xD0, 0xE1, 0xE5, 0xE1, 0x83, 0x48, 0xB8, 0x35, 0xA7, 0x12, 0x11, 0x00, 0xC9, 0x29, + 0x1A, 0x41, 0x1D, 0x3B, 0xFB, 0x33, 0x0B, 0x66, 0x45, 0x86, 0x61, 0x70, 0x35, 0x4C, 0x5F, 0x64, + 0x8E, 0xF5, 0x57, 0xBE, 0xA6, 0xFA, 0x49, 0xC9, 0x89, 0xA4, 0x74, 0x02, 0x9E, 0xE7, 0x67, 0x14, + 0x8B, 0xB9, 0xE7, 0xA8, 0xB0, 0x75, 0x65, 0x22, 0xB7, 0xCD, 0xFA, 0x55, 0x18, 0x00, 0x55, 0xB5, + 0x09, 0x70, 0x7E, 0x05, 0x0B, 0x11, 0x42, 0xF0, 0x80, 0x58, 0x2F, 0xFE, 0x3B, 0x2C, 0x4A, 0xCA, + 0x50, 0x34, 0xD0, 0x6F, 0xF1, 0xCC, 0x7F, 0x35, 0xD7, 0x9B, 0xF2, 0x97, 0x16, 0xFE, 0x5F, 0x6C, + 0x94, 0xDC, 0xAC, 0x63, 0xC8, 0x85, 0x2E, 0x60, 0x41, 0x34, 0x89, 0xD3, 0xDD, 0xBF, 0x2D, 0x69, + 0xC2, 0xF7, 0x74, 0xB2, 0x56, 0xD9, 0x76, 0xA2, 0x35, 0x30, 0x60, 0x35, 0xAB, 0x50, 0x21, 0xAE, + 0xFC, 0xFA, 0x19, 0x06, 0xDE, 0x89, 0x46, 0xFF, 0x34, 0x2F, 0x19, 0x84, 0x85, 0xF5, 0x1E, 0x60, + 0x91, 0x0D, 0x8C, 0x94, 0xDB, 0x2E, 0xEE, 0x4D, 0x0A, 0x29, 0x64, 0x81, 0xAD, 0x4C, 0xBF, 0x41, + 0x51, 0x04, 0xCD, 0x1C, 0x5C, 0x89, 0xD3, 0x3A, 0x91, 0xD9, 0x5C, 0x7E, 0xF3, 0xE9, 0x5B, 0x9E, + 0xC2, 0xD2, 0xE4, 0xD5, 0xEF, 0x47, 0x63, 0xD2, 0xD4, 0x19, 0x3E, 0xDF, 0xCF, 0xA4, 0x10, 0x47, + 0x16, 0x93, 0xC2, 0xF2, 0x22, 0xED, 0x1D, 0x9E, 0x21, 0x63, 0xC4, 0xCB, 0x89, 0xBB, 0x3E, 0xF7, + 0x89, 0x68, 0x6D, 0x2C, 0xDF, 0x2C, 0x6F, 0xB2, 0x8D, 0x75, 0xF8, 0xC6, 0x57, 0x98, 0x47, 0x86, + 0x40, 0x72, 0xBB, 0xD7, 0x32, 0xCD, 0x7A, 0x15, 0x64, 0x83, 0xD9, 0x50, 0x2E, 0xDE, 0x0C, 0x8C, + 0x30, 0xCD, 0xB0, 0x64, 0xD6, 0x7F, 0xE7, 0xAD, 0x6E, 0x01, 0x3E, 0x14, 0x8A, 0x24, 0x86, 0x1F, + 0x92, 0xAB, 0x1A, 0xE5, 0xD6, 0xBF, 0x64, 0xE5, 0xF6, 0x34, 0x62, 0xD5, 0x92, 0x5B, 0x64, 0xC4, + 0xFC, 0x1B, 0x7F, 0xA0, 0x13, 0xC1, 0xD4, 0xEB, 0x92, 0x90, 0xEF, 0x8C, 0x5E, 0x75, 0x4B, 0x78, + 0x56, 0x5F, 0xA2, 0x55, 0x4B, 0x1B, 0xE3, 0xDD, 0x80, 0x7E, 0xCF, 0x69, 0x97, 0x5A, 0x76, 0xD5, + 0xAA, 0x7D, 0x85, 0x73, 0x10, 0x4E, 0x79, 0x9A, 0x10, 0x10, 0x01, 0xD8, 0xD7, 0x85, 0x41, 0x8D, + 0x3D, 0xEA, 0xE3, 0x59, 0xD9, 0x31, 0x4B, 0x23, 0xC6, 0x53, 0x11, 0xA6, 0x35, 0x29, 0x64, 0x7E, + 0x28, 0xD7, 0x8D, 0x03, 0x70, 0x5C, 0x53, 0xA7, 0x6D, 0x81, 0x30, 0x7B, 0xDF, 0x2B, 0xAE, 0xAB, + 0x6F, 0x52, 0x93, 0xCF, 0xDD, 0x00, 0x35, 0xE9, 0x65, 0x4A, 0x04, 0x79, 0x11, 0x30, 0xCA, 0xC7, + 0xD2, 0xF3, 0x34, 0xAC, 0x32, 0x1F, 0xE4, 0xE5, 0x83, 0x12, 0x66, 0xD6, 0xA6, 0xE4, 0xEB, 0x67, + 0x7E, 0xDD, 0x64, 0x3E, 0xF1, 0x0C, 0xE6, 0x1C, 0xB6, 0xE1, 0xB0, 0x2B, 0xE7, 0x83, 0xB4, 0x4A, + 0x82, 0xDD, 0xC1, 0x22, 0x3F, 0x03, 0x38, 0x90, 0xB2, 0xA9, 0x7B, 0x60, 0x57, 0xF9, 0xDD, 0x04, + 0x60, 0x5D, 0x7C, 0x2C, 0xD3, 0xE6, 0xFE, 0x02, 0x5A, 0x7D, 0x2A, 0x48, 0x81, 0x42, 0x20, 0x84, + 0xFF, 0x1D, 0xCC, 0x64, 0x11, 0x70, 0xE5, 0x4F, 0x9F, 0xE0, 0x11, 0xFB, 0xF0, 0xE2, 0xC4, 0x9B, + 0x11, 0x30, 0x7F, 0x2F, 0x7F, 0xA1, 0xB1, 0xBC, 0x5F, 0x29, 0x21, 0xDF, 0xB4, 0xEB, 0xB2, 0x4F, + 0xAA, 0x2D, 0x95, 0x60, 0x47, 0x78, 0x37, 0x67, 0xCD, 0xFA, 0x36, 0x17, 0x8F, 0x64, 0x15, 0xAF, + 0x04, 0xAA, 0x5C, 0x76, 0x23, 0x07, 0x64, 0x96, 0xB2, 0x5A, 0xCF, 0x03, 0xDC, 0xC3, 0x2D, 0xFB, + 0x0D, 0x2D, 0xA8, 0xBD, 0xCE, 0x58, 0xF8, 0x44, 0x75, 0xA1, 0x07, 0xAA, 0xDF, 0x25, 0xDC, 0x25, + 0x32, 0xCF, 0xA8, 0x92, 0xC5, 0xC0, 0xD5, 0x70, 0x21, 0x19, 0x6F, 0x32, 0xCA, 0x16, 0xFA, 0x8C, + 0xB2, 0x86, 0xF6, 0xD5, 0x2E, 0xD9, 0x0A, 0x9C, 0x96, 0xDB, 0x4D, 0xA4, 0x11, 0x02, 0x4C, 0x33, + 0x99, 0xB3, 0x5E, 0x45, 0x5C, 0xF1, 0x99, 0x61, 0x04, 0x20, 0xC9, 0xC8, 0xB3, 0xB4, 0xD3, 0x8B, + 0x24, 0x78, 0x55, 0x2E, 0xB7, 0x48, 0x43, 0x17, 0xBF, 0xB9, 0x2A, 0xCC, 0xD5, 0x4A, 0x49, 0xB2, + 0x4E, 0x1E, 0xC7, 0x45, 0x4E, 0x55, 0xC4, 0xBC, 0xB1, 0xD2, 0xA6, 0x62, 0xE9, 0x95, 0xBB, 0xCD, + 0x87, 0xD2, 0x7C, 0xE5, 0xC6, 0x77, 0x5B, 0xFF, 0xAF, 0xDD, 0x44, 0x9D, 0x3D, 0x10, 0x05, 0x3C, + 0x77, 0x7A, 0xF8, 0x84, 0x0D, 0x04, 0x55, 0xB5, 0x20, 0xEA, 0xD2, 0x3F, 0x04, 0x33, 0xFF, 0xE2, + 0x01, 0x3B, 0x51, 0x46, 0x3E, 0x34, 0xAA, 0x40, 0xCA, 0x7C, 0x85, 0x46, 0x57, 0xD9, 0xB7, 0xE1, + 0xDC, 0x65, 0xEF, 0x11, 0x66, 0x0B, 0xBA, 0xD8, 0x37, 0x66, 0x96, 0x64, 0x54, 0x8B, 0x05, 0x81, + 0x47, 0x87, 0x70, 0xA8, 0x54, 0xC6, 0x02, 0x08, 0xB4, 0xAD, 0x69, 0x3C, 0xC0, 0x03, 0x69, 0x19, + 0xE6, 0xAC, 0x13, 0xD5, 0x3F, 0x2C, 0x9D, 0x61, 0xCC, 0xA8, 0x60, 0xB5, 0x60, 0x85, 0x19, 0x5B, + 0x3E, 0x82, 0xCA, 0x34, 0x70, 0x06, 0xCD, 0x37, 0x3E, 0x91, 0x2F, 0x49, 0x82, 0x0A, 0x87, 0xE8, + 0x09, 0x18, 0xB3, 0xF4, 0x16, 0xA4, 0xA5, 0x46, 0xC5, 0x76, 0x6D, 0x73, 0xB1, 0x93, 0xDC, 0x69, + 0xF4, 0x49, 0xF8, 0x2F, 0x97, 0xB4, 0xAA, 0x19, 0x4A, 0x60, 0xD2, 0xF9, 0x7B, 0x5A, 0xF0, 0x57, + 0x45, 0xC6, 0xA2, 0x64, 0x37, 0x56, 0xED, 0x6B, 0x5E, 0x1D, 0x9E, 0x35, 0x5E, 0xFE, 0xDE, 0x04, + 0x08, 0x3B, 0x62, 0x40, 0x82, 0xD4, 0xF9, 0xF3, 0x54, 0x95, 0x3E, 0x57, 0x49, 0x3A, 0x41, 0x41, + 0xDA, 0xD4, 0x78, 0x80, 0xC7, 0xF1, 0xDE, 0xA7, 0xFF, 0xDC, 0x53, 0xC9, 0x3A, 0x37, 0xA5, 0x83, + 0xDE, 0xE8, 0x51, 0x33, 0x7B, 0xE6, 0xAC, 0xA5, 0xC4, 0x7D, 0x34, 0xB0, 0x99, 0x0D, 0x03, 0x34, + 0x0F, 0x8D, 0xB8, 0x10, 0x4E, 0x30, 0x38, 0x10, 0xFC, 0x62, 0xC3, 0xC0, 0xF5, 0x67, 0x69, 0xF5, + 0x23, 0xB4, 0xF2, 0x6B, 0x79, 0xA8, 0xEE, 0xF0, 0xDD, 0x06, 0xA1, 0x50, 0x41, 0x3E, 0x1D, 0x04, + 0xB0, 0xB7, 0xC8, 0x58, 0x20, 0x72, 0xF6, 0x41, 0x53, 0x58, 0xAA, 0xAB, 0xA1, 0x19, 0xB0, 0x99, + 0xE4, 0x35, 0x44, 0x32, 0xF0, 0x34, 0x52, 0x4E, 0xD0, 0xBC, 0x1D, 0xD2, 0x14, 0x6A, 0x22, 0x46, + 0x93, 0x52, 0xFF, 0xD5, 0xD9, 0xEF, 0x19, 0xAF, 0xFB, 0x9A, 0x0D, 0x4A, 0x14, 0x49, 0xAE, 0xC0, + 0x09, 0x5E, 0x40, 0x36, 0x63, 0xE7, 0xC3, 0xFA, 0x84, 0x1C, 0xBF, 0x65, 0x17, 0xED, 0xED, 0x49, + 0x93, 0xB9, 0xCD, 0x85, 0x3F, 0x95, 0x57, 0xF9, 0xE7, 0x59, 0x55, 0x59, 0xED, 0x3A, 0xA1, 0x90, + 0x24, 0x36, 0xB8, 0x38, 0x91, 0x57, 0x59, 0xDB, 0xDE, 0x8E, 0x8B, 0x3A, 0xBB, 0x31, 0x76, 0x39, + 0x0D, 0x20, 0x84, 0x8A, 0x05, 0x5A, 0xC1, 0x93, 0x04, 0x5E, 0x9E, 0x2E, 0x41, 0x13, 0xC9, 0x7F, + 0xAB, 0x45, 0x86, 0x99, 0xB2, 0x5C, 0x7E, 0x1A, 0x1C, 0x9C, 0x7C, 0xCF, 0x60, 0x38, 0xF7, 0x02, + 0x8A, 0xE6, 0x74, 0x4F, 0x31, 0x67, 0x99, 0x96, 0xC3, 0x79, 0xEB, 0x19, 0x07, 0xAD, 0xBB, 0xD2, + 0xD7, 0x51, 0x75, 0xDD, 0xD5, 0x44, 0xC2, 0x9A, 0xDE, 0x01, 0x68, 0x8C, 0xBF, 0x11, 0xFE, 0x5F, + 0xB9, 0xCF, 0x25, 0x35, 0xD2, 0xF7, 0x29, 0xE0, 0x63, 0x0F, 0x0A, 0xCA, 0xB9, 0x38, 0xB6, 0xDA, + 0xDD, 0x66, 0xD9, 0x5F, 0x67, 0x42, 0x15, 0xD8, 0x1C, 0xD1, 0x1C, 0xCC, 0xD6, 0xB9, 0x29, 0x85, + 0x99, 0xD6, 0xDD, 0xCE, 0x8E, 0x3D, 0x63, 0x1C, 0x31, 0x32, 0x37, 0xCD, 0xE1, 0xF8, 0xEA, 0x4E, + 0x31, 0x25, 0xF7, 0x2D, 0xE1, 0xCA, 0x36, 0x5B, 0xEC, 0xAC, 0x2B, 0xB0, 0xA5, 0x69, 0x3B, 0x4C, + 0xAE, 0xD7, 0x15, 0xF7, 0x7F, 0x5C, 0x5F, 0x82, 0xF0, 0x1D, 0x44, 0x62, 0xA0, 0x72, 0x57, 0xAD, + 0xB3, 0xD7, 0x1B, 0xA9, 0xE2, 0x76, 0xFF, 0x18, 0xA6, 0x3E, 0xF9, 0xF5, 0x6F, 0xB5, 0x13, 0x26, + 0x72, 0x0F, 0xF4, 0xE1, 0x7D, 0x43, 0x86, 0x48, 0x42, 0x0B, 0x94, 0x96, 0xBF, 0x0E, 0x32, 0x1C, + 0xE0, 0x18, 0x69, 0xA9, 0xAE, 0x83, 0x6F, 0x36, 0xE7, 0x04, 0x20, 0xEE, 0x34, 0xFF, 0x21, 0xE9, + 0xBA, 0x3B, 0x38, 0x48, 0x2D, 0x81, 0x38, 0x48, 0x25, 0xE5, 0x4A, 0xAD, 0x81, 0xA9, 0xE8, 0x33, + 0x0A, 0x4C, 0x60, 0xAE, 0xBB, 0xCC, 0x24, 0x96, 0x44, 0xF3, 0x1A, 0x2A, 0x89, 0xCB, 0xD9, 0x5E, + 0x89, 0x4C, 0xFD, 0x62, 0xA8, 0x38, 0x1E, 0x73, 0x63, 0xB3, 0xF1, 0x3E, 0xAC, 0xB1, 0x0B, 0x5D, + 0x10, 0xE5, 0xCC, 0x88, 0x2F, 0x9D, 0x57, 0xF1, 0x33, 0xA6, 0x50, 0x13, 0x2C, 0x54, 0x81, 0x1B, + 0x90, 0xD8, 0x6F, 0x7C, 0x02, 0x86, 0xA8, 0x02, 0x5F, 0xCE, 0x24, 0x22, 0x76, 0x73, 0xE8, 0x66, + 0xDC, 0x7F, 0x8F, 0x69, 0x4E, 0xBB, 0x63, 0xEB, 0xCD, 0x38, 0xE6, 0xEE, 0x84, 0x70, 0x97, 0x2F, + 0xD1, 0x77, 0xEE, 0x63, 0xE4, 0x2D, 0x42, 0xDE, 0x17, 0x95, 0x18, 0xB5, 0xA9, 0x4D, 0xFD, 0x2A, + 0xA8, 0x07, 0x1F, 0xCC, 0x3F, 0x22, 0x3B, 0x03, 0x49, 0xCF, 0x83, 0x83, 0x85, 0xAA, 0x87, 0xA0, + 0xC6, 0x30, 0x8C, 0x8F, 0x91, 0x88, 0x67, 0xA7, 0x1F, 0xE0, 0xE2, 0x40, 0x1E, 0xE9, 0x12, 0x2E, + 0x5C, 0x33, 0x44, 0x29, 0x0D, 0xEA, 0x34, 0x8B, 0x1A, 0x48, 0x80, 0x67, 0x45, 0x2A, 0xF2, 0x82, + 0xD8, 0x78, 0x7E, 0x36, 0x59, 0x6C, 0x32, 0x58, 0x3B, 0x0F, 0x2C, 0x0B, 0xD1, 0xFA, 0x67, 0x2B, + 0x0C, 0xFF, 0x16, 0x57, 0x04, 0x38, 0x51, 0x4F, 0x34, 0xEE, 0x94, 0x8B, 0xBB, 0x7B, 0xBE, 0xEA, + 0x37, 0xB5, 0x9F, 0xBA, 0xDE, 0xC1, 0xC6, 0x34, 0x2D, 0x36, 0xE6, 0xC8, 0x67, 0x6A, 0x74, 0x56, + 0xB5, 0x05, 0x53, 0xAE, 0x5C, 0x94, 0x83, 0xF9, 0xE0, 0xD7, 0x21, 0xC2, 0x71, 0x4B, 0x0F, 0x9C, + 0x64, 0x1C, 0xF4, 0x6A, 0xF8, 0xE3, 0x3C, 0x8F, 0xD2, 0x20, 0xCF, 0x14, 0xAC, 0x21, 0xF5, 0x2A, + 0xE7, 0xEC, 0x5C, 0x49, 0xAB, 0x21, 0xF2, 0x41, 0x2C, 0x3B, 0xA0, 0x49, 0x43, 0xF3, 0x14, 0xFE, + 0x68, 0x7C, 0x83, 0x05, 0xF3, 0x71, 0x77, 0x02, 0x2B, 0xD4, 0x94, 0x2B, 0x28, 0x5E, 0x4A, 0x5E, + 0x6E, 0x81, 0x1A, 0xD3, 0xDA, 0x58, 0x9F, 0xD6, 0x7B, 0x6D, 0xAD, 0x14, 0xBC, 0x60, 0xFC, 0xC4, + 0x83, 0x0A, 0x8E, 0x9B, 0x8D, 0x5B, 0x24, 0x77, 0x10, 0x34, 0x78, 0xC9, 0x8F, 0xA5, 0x2D, 0x0F, + 0x6A, 0x88, 0x7F, 0x24, 0x40, 0x46, 0x25, 0x3A, 0xDE, 0xB9, 0x9E, 0xA2, 0xE7, 0x8D, 0x52, 0xA2, + 0xFF, 0xDE, 0xB4, 0x95, 0xDB, 0x05, 0x2E, 0xDF, 0x29, 0x28, 0xB5, 0x76, 0xD6, 0x1D, 0x09, 0x45, + 0x69, 0x29, 0xF9, 0x95, 0xAA, 0x36, 0x71, 0xD9, 0x3F, 0xFF, 0x6B, 0x04, 0xFE, 0xED, 0x63, 0xC8, + 0x3C, 0x4B, 0x6B, 0x0B, 0xF3, 0xD8, 0x71, 0x15, 0xDA, 0xC0, 0xC9, 0xE2, 0x0D, 0x87, 0x94, 0x61, + 0xBE, 0xEF, 0x79, 0x92, 0x4C, 0x14, 0x92, 0xBF, 0x0C, 0x4E, 0xA0, 0x1B, 0x58, 0x00, 0x30, 0xF6, + 0xD0, 0x09, 0xD6, 0x1E, 0x81, 0xA0, 0xE7, 0xFD, 0xFD, 0xFF, 0x21, 0x47, 0xAB, 0xDE, 0x67, 0xC6, + 0xF4, 0x19, 0x60, 0x0C, 0x49, 0xE5, 0xC4, 0xBD, 0x64, 0x05, 0xED, 0x89, 0xD7, 0xBD, 0x74, 0xF7, + 0xD4, 0xCC, 0x4B, 0x9E, 0xEB, 0x6E, 0xB7, 0x87, 0xB6, 0x31, 0x07, 0xCB, 0x6E, 0x0D, 0xDF, 0x3A, + 0xD8, 0x64, 0x1F, 0xF9, 0x2C, 0xEE, 0xC0, 0x61, 0x22, 0x0E, 0x5A, 0x20, 0x0C, 0xD4, 0x4F, 0xC5, + 0x2D, 0x82, 0x63, 0x39, 0x36, 0x34, 0x07, 0xC6, 0x23, 0xBC, 0xF1, 0x56, 0xC6, 0x8C, 0x39, 0x23, + 0x43, 0xFF, 0xEC, 0xBE, 0x95, 0x7B, 0xC7, 0xFD, 0xA9, 0x99, 0x3D, 0xDF, 0x50, 0x28, 0x39, 0xCA, + 0x80, 0xCF, 0x1C, 0xE7, 0x81, 0x06, 0xB4, 0x43, 0x55, 0xFB, 0xB0, 0xA4, 0x5D, 0x78, 0x39, 0x71, + 0x88, 0xEC, 0xBB, 0x01, 0x69, 0x5E, 0x85, 0x97, 0x1F, 0xEB, 0x6C, 0x82, 0x07, 0xF4, 0x00, 0x1B, + 0x90, 0x03, 0x1B, 0x92, 0x9A, 0x4A, 0x95, 0x9D, 0x45, 0x45, 0x65, 0x6F, 0x8B, 0x70, 0x4C, 0xFE, + 0x48, 0x94, 0x5B, 0x71, 0x86, 0x70, 0x45, 0xB7, 0x85, 0xD9, 0x59, 0x29, 0x94, 0x47, 0x5A, 0x17, + 0x96, 0xA1, 0x0E, 0xFD, 0x72, 0x71, 0xE1, 0x3F, 0x7B, 0xE6, 0x59, 0x2A, 0x91, 0x5A, 0x6B, 0x82, + 0xB1, 0xA1, 0x31, 0xC2, 0xE4, 0xE3, 0xB9, 0x8E, 0x5A, 0x68, 0xC1, 0x18, 0xD4, 0x4B, 0x02, 0x2E, + 0x50, 0x3D, 0x73, 0x53, 0x2B, 0x13, 0x77, 0x19, 0xC7, 0x03, 0x0B, 0xB5, 0xAD, 0x5C, 0x0B, 0x6B, + 0x66, 0x12, 0xF0, 0xE8, 0x67, 0xB7, 0xF7, 0x88, 0x64, 0xA8, 0x2C, 0x51, 0xA7, 0xF8, 0x5E, 0xB3, + 0x39, 0xEC, 0x1B, 0xDF, 0x6C, 0x89, 0x16, 0xFD, 0x51, 0x26, 0x29, 0x8D, 0x0E, 0xBE, 0x1B, 0xCE, + 0x61, 0xE5, 0x22, 0x09, 0xC1, 0x0F, 0xAD, 0x0C, 0xA1, 0x61, 0xF8, 0x49, 0x29, 0x11, 0x7C, 0x93, + 0x0C, 0xBE, 0xD0, 0x11, 0x6F, 0x24, 0x4E, 0x4B, 0xF5, 0xEF, 0x41, 0x3D, 0x0C, 0x69, 0xC6, 0xA6, + 0xBF, 0x87, 0x68, 0xFF, 0x2F, 0x76, 0xD9, 0xFD, 0x1D, 0x8E, 0x9F, 0x80, 0x19, 0x3B, 0x35, 0x8B, + 0x2D, 0xDB, 0x5C, 0x3E, 0x86, 0xE8, 0xBF, 0xF1, 0x30, 0x88, 0xE4, 0x80, 0xD0, 0x49, 0xC3, 0x50, + 0xF8, 0x1E, 0xCE, 0xDA, 0xAC, 0x2E, 0x3F, 0x97, 0x51, 0x12, 0x89, 0x47, 0x5D, 0xF4, 0xD4, 0x77, + 0x93, 0x66, 0x74, 0xE3, 0x4C, 0xCD, 0xB4, 0xC8, 0x00, 0x85, 0x64, 0x8C, 0x04, 0x72, 0x1C, 0x14, + 0xDA, 0x77, 0xD7, 0x1D, 0x39, 0xC3, 0x65, 0xD0, 0x28, 0x51, 0xCA, 0x91, 0xAE, 0x2D, 0xCD, 0x50, + 0x0D, 0x1B, 0xA4, 0xF1, 0x5D, 0x4C, 0x28, 0x1C, 0x57, 0xE5, 0x00, 0xEC, 0xA4, 0x02, 0x3B, 0xCA, + 0x70, 0xF3, 0x8B, 0x3C, 0x4F, 0xEE, 0x9D, 0x08, 0xFF, 0x66, 0x31, 0xCE, 0x37, 0x93, 0x90, 0x3D, + 0x6E, 0xDE, 0xB9, 0xCF, 0x35, 0xAA, 0xF0, 0x43, 0x3E, 0x6B, 0x19, 0xEC, 0x69, 0x7A, 0xF0, 0xC6, + 0xC3, 0x7D, 0x49, 0x89, 0x43, 0xCC, 0x2C, 0x20, 0x2E, 0xB8, 0x5D, 0xCC, 0xDB, 0x39, 0xCB, 0x0B, + 0x76, 0xD8, 0xAC, 0xD6, 0x2A, 0x76, 0x59, 0x7F, 0x6A, 0x1B, 0xCD, 0x4A, 0x93, 0xCA, 0x42, 0x5F, + 0xC7, 0x98, 0xFA, 0xC9, 0x30, 0x2E, 0x9F, 0x8F, 0xE5, 0xB5, 0x37, 0x41, 0x19, 0xF4, 0xA0, 0xE5, + 0xDA, 0x7D, 0x3C, 0xF5, 0x61, 0xCC, 0x98, 0x27, 0xED, 0xE4, 0x5C, 0x0E, 0x7C, 0x1B, 0x33, 0x38, + 0x77, 0x20, 0x92, 0xC9, 0xD3, 0x38, 0xC3, 0x03, 0x2C, 0xAF, 0xE2, 0x77, 0x34, 0x4B, 0xE2, 0x1C, + 0x9F, 0xE4, 0x4D, 0xAB, 0x12, 0xFE, 0xCD, 0xB3, 0x2C, 0xD3, 0xE2, 0x42, 0xB8, 0xE7, 0xE0, 0x14, + 0x88, 0x31, 0xB1, 0xDC, 0x35, 0xDE, 0xCD, 0x3D, 0x3B, 0xDF, 0x6C, 0x00, 0xA3, 0x48, 0xA6, 0x71, + 0x7E, 0xC6, 0x3A, 0xE8, 0x07, 0xCE, 0xC8, 0xE7, 0xDC, 0xB1, 0x98, 0x17, 0xDB, 0x75, 0x20, 0xFE, + 0x38, 0xC7, 0x1F, 0x02, 0x8E, 0xE4, 0x91, 0x79, 0x3D, 0xC0, 0x50, 0x2D, 0xC7, 0x49, 0x33, 0x6C, + 0xDF, 0x3C, 0xE9, 0x42, 0xE9, 0x27, 0xBC, 0x39, 0x38, 0xAA, 0x98, 0x16, 0x6E, 0x1F, 0x71, 0xDF, + 0x3B, 0xBA, 0x15, 0x2F, 0x69, 0xEB, 0x06, 0x5C, 0xFB, 0xF8, 0x4C, 0x83, 0x2C, 0x28, 0xC2, 0x19, + 0xAD, 0x04, 0xA1, 0xB0, 0x7F, 0xF1, 0x9C, 0x84, 0x38, 0x42, 0x45, 0x3E, 0x1E, 0xC7, 0x95, 0xD5, + 0xAF, 0x35, 0x7E, 0x2A, 0xCC, 0x06, 0x9D, 0x9A, 0xCF, 0xC2, 0x56, 0xE6, 0x73, 0x7F, 0x7E, 0x9D, + 0x9B, 0x01, 0x27, 0x76, 0x14, 0x8C, 0x3E, 0x3A, 0xBD, 0x2E, 0x6C, 0x7C, 0xB7, 0xF2, 0x9A, 0x92, + 0x41, 0xBC, 0xD0, 0x48, 0xF6, 0xE6, 0x16, 0x62, 0x01, 0x4D, 0x3D, 0x8E, 0xD2, 0x98, 0x8F, 0x61, + 0x70, 0x7C, 0x41, 0xCC, 0xCA, 0x3D, 0x3E, 0x0B, 0x70, 0xC3, 0x9F, 0x9D, 0x3E, 0x33, 0x50, 0x2B, + 0xB0, 0x47, 0xC8, 0xA3, 0xAA, 0x55, 0xBA, 0x16, 0x3B, 0xF4, 0x07, 0x98, 0x1B, 0x6C, 0x49, 0x6A, + 0xA5, 0xB4, 0x7A, 0xBE, 0x28, 0x37, 0xF2, 0x55, 0x69, 0x09, 0x7A, 0xEC, 0x94, 0x1C, 0x60, 0xE3, + 0xB5, 0x89, 0x07, 0x58, 0x43, 0xA3, 0x3F, 0x1D, 0x94, 0x20, 0x49, 0x5E, 0xC1, 0xB7, 0x4E, 0x2C, + 0x75, 0x95, 0x54, 0x91, 0x4A, 0x01, 0x90, 0xF8, 0xF1, 0x81, 0xC6, 0x4C, 0x9A, 0x63, 0x20, 0x55, + 0x65, 0x8D, 0x30, 0xA2, 0xD4, 0xC7, 0xAF, 0x18, 0xA5, 0x83, 0xB6, 0x68, 0x1B, 0x35, 0x13, 0x6D, + 0xC6, 0x77, 0x5A, 0x04, 0xFB, 0xD5, 0xBD, 0x2B, 0x0D, 0x55, 0x5E, 0xEC, 0x7A, 0x80, 0x17, 0x01, + 0x9C, 0x4F, 0x55, 0x39, 0x57, 0x9F, 0x31, 0x9E, 0xB9, 0xB1, 0x35, 0xD5, 0x2F, 0xB9, 0xF3, 0x6A, + 0x9C, 0x30, 0xEA, 0x1B, 0xE9, 0x34, 0x4A, 0x2F, 0xB1, 0x36, 0x9C, 0xF0, 0x8A, 0xE9, 0x62, 0xDB, + 0x06, 0x32, 0x64, 0x39, 0x58, 0x29, 0xBD, 0xB1, 0x2C, 0x06, 0x56, 0x54, 0xAF, 0x6B, 0x97, 0x5A, + 0x7D, 0x49, 0xB6, 0xDF, 0x06, 0xFC, 0x9F, 0x06, 0x64, 0x89, 0xF5, 0xF4, 0xC4, 0x55, 0x02, 0x19, + 0xAA, 0xC9, 0x1D, 0x8A, 0x5E, 0x3D, 0xA7, 0x13, 0xEC, 0x52, 0x29, 0x8B, 0x6E, 0xC5, 0xA0, 0x62, + 0x9E, 0x89, 0x96, 0xDF, 0x5E, 0x74, 0x69, 0x53, 0x75, 0xCA, 0xF0, 0x95, 0x0E, 0xF8, 0x42, 0xB6, + 0x06, 0x62, 0xDA, 0x92, 0x48, 0xC3, 0x37, 0x50, 0x59, 0xDF, 0x59, 0xAF, 0xAF, 0x0E, 0x2E, 0x84, + 0xE5, 0x2F, 0x3C, 0xC9, 0x7E, 0x2A, 0xE5, 0xA9, 0x41, 0xB1, 0x51, 0x82, 0xC6, 0x42, 0xEC, 0x65, + 0xFD, 0xCB, 0x54, 0x29, 0x33, 0xC2, 0xE5, 0x5E, 0x10, 0xFB, 0x9E, 0x19, 0xE2, 0x75, 0x53, 0x43, + 0x50, 0xD5, 0x10, 0x8E, 0xBC, 0xC6, 0x2A, 0x0A, 0x8D, 0x7F, 0x4A, 0xF6, 0x07, 0x28, 0xA1, 0xEB, + 0x14, 0x1C, 0xD3, 0xE9, 0x63, 0x55, 0xC7, 0xD2, 0xE8, 0xB2, 0x3D, 0x17, 0x84, 0x63, 0xF9, 0x11, + 0xA4, 0x11, 0xE0, 0xA1, 0x83, 0x11, 0x11, 0xD2, 0xA0, 0x8C, 0x61, 0x74, 0x36, 0x63, 0xE9, 0xE8, + 0x98, 0x4C, 0x20, 0x38, 0x1F, 0xA5, 0x15, 0x60, 0x3E, 0x5C, 0x1B, 0xE6, 0xDE, 0xC1, 0x70, 0x7F, + 0xCB, 0x92, 0x76, 0x05, 0xD8, 0x63, 0xDF, 0x01, 0x7E, 0xF2, 0xF1, 0x01, 0xBD, 0xCE, 0x9A, 0x1E, + 0x50, 0x7F, 0xB4, 0xF4, 0x49, 0x5D, 0x7F, 0xCA, 0x86, 0x83, 0x2F, 0x63, 0x33, 0xEF, 0x4F, 0x35, + 0xA1, 0xBF, 0xB6, 0xCD, 0x25, 0xBA, 0x0E, 0xB9, 0xA3, 0x96, 0x41, 0xD4, 0x90, 0xFF, 0xEB, 0xF7, + 0x4F, 0x93, 0xC8, 0xD7, 0x04, 0x62, 0x6E, 0x88, 0xD7, 0x71, 0x0E, 0x0E, 0x37, 0x50, 0xCE, 0xFA, + 0x9B, 0xBD, 0x5B, 0xB0, 0xB7, 0x0F, 0x70, 0x75, 0x0A, 0x5D, 0xFC, 0x69, 0xB3, 0x07, 0x11, 0x9B, + 0xE8, 0x13, 0x0D, 0xBF, 0x08, 0x33, 0x59, 0x20, 0x4A, 0xBD, 0x27, 0x76, 0xED, 0xF2, 0x36, 0x0B, + 0xEA, 0xBC, 0x78, 0x17, 0xBD, 0x6E, 0x4F, 0x37, 0xD3, 0x26, 0x86, 0x85, 0xB1, 0x71, 0xEA, 0x55, + 0x73, 0xAA, 0x7C, 0xA2, 0x36, 0x75, 0xD2, 0xCD, 0xE4, 0xFC, 0xE7, 0xCE, 0x5E, 0xB1, 0xE5, 0xF4, + 0x65, 0xD7, 0x8F, 0x34, 0x07, 0x66, 0xA7, 0x4B, 0xCE, 0x55, 0xB0, 0x71, 0xFD, 0x20, 0x03, 0x5C, + 0xBA, 0x28, 0x0B, 0x71, 0x4D, 0x93, 0xB9, 0x77, 0x5E, 0x46, 0x6A, 0xCB, 0xD7, 0x0A, 0x59, 0x2E, + 0x26, 0x49, 0x0A, 0x36, 0x0F, 0x03, 0x6F, 0x32, 0xD7, 0xF0, 0xEC, 0x53, 0xF6, 0x0B, 0x1E, 0x08, + 0x27, 0x37, 0x69, 0xC5, 0x9F, 0x6C, 0x76, 0x27, 0x4C, 0x7A, 0x7C, 0xB7, 0xC8, 0x1B, 0xC4, 0x79, + 0xA1, 0xE3, 0xE0, 0xF3, 0x3B, 0x20, 0x07, 0x0C, 0xE4, 0xAB, 0x10, 0x6F, 0xA4, 0xFA, 0x7F, 0x08, + 0x6F, 0x5C, 0xAE, 0x06, 0xC5, 0x6D, 0x09, 0x1E, 0x2D, 0xDD, 0x80, 0xA7, 0x7B, 0x9E, 0xE6, 0x44, + 0x79, 0x3D, 0x55, 0x12, 0x51, 0x87, 0x4D, 0x4A, 0x66, 0x32, 0x2D, 0x4E, 0x17, 0x30, 0xAF, 0x77, + 0x7A, 0x8B, 0x44, 0x8D, 0xA4, 0xF8, 0x70, 0xC1, 0x99, 0x55, 0x3D, 0x4B, 0x08, 0x40, 0x2F, 0xA2, + 0xEA, 0xAA, 0x94, 0x24, 0xC3, 0xBD, 0x5C, 0x68, 0x35, 0x8D, 0x71, 0xA8, 0x3E, 0xBA, 0x00, 0x70, + 0x28, 0xB8, 0x10, 0x20, 0x8F, 0x5C, 0xE4, 0xC4, 0xBB, 0x22, 0x59, 0xA2, 0x35, 0x5F, 0x7A, 0x3D, + 0xF1, 0x24, 0x70, 0x1C, 0xE3, 0x3E, 0xED, 0x26, 0x07, 0xD7, 0x82, 0x4B, 0x80, 0x3B, 0x0C, 0xE4, + 0xAB, 0xCF, 0x71, 0x97, 0x87, 0x22, 0x2B, 0x53, 0x27, 0x99, 0x29, 0x10, 0x41, 0x30, 0xE8, 0x28, + 0xD2, 0x48, 0xAC, 0x25, 0x40, 0xBF, 0xDB, 0xED, 0x3A, 0xF4, 0x5D, 0x6E, 0x66, 0x1A, 0x08, 0xFF, + 0xEE, 0x49, 0x36, 0xD7, 0x68, 0x1E, 0xD7, 0xAB, 0xEC, 0xD6, 0x84, 0x1C, 0x8D, 0x35, 0x2D, 0x10, + 0x3C, 0x9C, 0x77, 0x12, 0xB3, 0x09, 0x5F, 0x0B, 0x2A, 0xB3, 0xCF, 0x8E, 0xE0, 0xF1, 0xAA, 0x71, + 0xB1, 0xE3, 0x58, 0x5C, 0xFF, 0xD1, 0x34, 0xE0, 0xBF, 0x20, 0x6D, 0x42, 0x86, 0xCA, 0x97, 0x1B, + 0x76, 0x2F, 0x08, 0x29, 0xEC, 0xD5, 0xDD, 0x04, 0x36, 0xFC, 0xCA, 0x39, 0xBE, 0x28, 0x8C, 0x1F, + 0x0D, 0x56, 0x77, 0xB7, 0xE0, 0x23, 0x41, 0x1E, 0xB4, 0x29, 0x17, 0x7A, 0xAF, 0xF9, 0x30, 0xCF, + 0xF1, 0xFE, 0xF4, 0x62, 0x32, 0xD9, 0xDB, 0x56, 0x9A, 0x2B, 0x31, 0xBF, 0xA5, 0x15, 0x19, 0x1E, + 0xEA, 0xCB, 0x5D, 0x6B, 0x65, 0x9A, 0x06, 0x1F, 0x9C, 0x0E, 0xC0, 0x5D, 0x8C, 0xFB, 0xD5, 0xCF, + 0xA4, 0x18, 0xA1, 0x0C, 0xAD, 0xD3, 0x98, 0x09, 0x3A, 0x86, 0x7F, 0x1C, 0x60, 0xC9, 0xFB, 0x42, + 0xF2, 0x37, 0x4E, 0xF0, 0x91, 0x02, 0x33, 0x41, 0xDE, 0xDB, 0xF8, 0x8E, 0x44, 0x00, 0xC5, 0x94, + 0x21, 0x39, 0x91, 0x0A, 0xB5, 0xC4, 0x44, 0xAC, 0x04, 0xF8, 0xB7, 0xA1, 0x13, 0x70, 0xA7, 0xEF, + 0x23, 0xBD, 0xF6, 0x12, 0x34, 0x30, 0x3A, 0x70, 0x81, 0x21, 0xE7, 0x66, 0xB8, 0x55, 0x00, 0xAF, + 0xC1, 0xC3, 0x56, 0x3D, 0xAB, 0x3D, 0xCA, 0x16, 0x4F, 0x6B, 0x3E, 0x69, 0xEF, 0xF8, 0xCA, 0x7B, + 0x65, 0x1C, 0xF3, 0xD9, 0xE8, 0xB0, 0xF6, 0xF3, 0x18, 0x9E, 0xDF, 0x45, 0xC7, 0xAF, 0xCE, 0xC8, + 0x5E, 0x51, 0x94, 0x76, 0x23, 0x80, 0xF8, 0x49, 0x9B, 0xB9, 0x7C, 0x2F, 0x3C, 0xE6, 0xB5, 0x2F, + 0xAD, 0xCC, 0xE7, 0xE7, 0x1E, 0x08, 0xBF, 0xFA, 0x70, 0x2C, 0xB3, 0xED, 0x0C, 0x29, 0x7D, 0xB0, + 0xBE, 0xE7, 0x91, 0x39, 0x73, 0xC2, 0x80, 0x77, 0x2F, 0x91, 0x1D, 0x2F, 0x45, 0x1E, 0x41, 0xE4, + 0x45, 0x2A, 0x7E, 0x93, 0xCE, 0x6D, 0x65, 0x18, 0x76, 0x61, 0x15, 0x05, 0x24, 0x0E, 0x65, 0xD6, + 0x19, 0x7A, 0xFF, 0x02, 0x94, 0xFB, 0x2D, 0x14, 0xE4, 0xA3, 0x9C, 0xFC, 0x48, 0x29, 0x3A, 0x7F, + 0x36, 0x4F, 0x18, 0xD5, 0x5B, 0x99, 0x4C, 0x97, 0x20, 0x36, 0x77, 0xA6, 0x75, 0xE3, 0x44, 0x92, + 0x47, 0x72, 0xEA, 0x1D, 0x00, 0x5A, 0x1D, 0xAF, 0x12, 0xAC, 0x26, 0xE9, 0x1E, 0x4C, 0x89, 0xCC, + 0x56, 0x01, 0x22, 0x4D, 0x45, 0x44, 0xAC, 0xB6, 0x75, 0xEF, 0x3F, 0x2B, 0x35, 0xC6, 0x06, 0x12, + 0xF6, 0xDB, 0xF1, 0x55, 0xF7, 0x05, 0xB0, 0xC0, 0x16, 0x13, 0x60, 0xAA, 0x01, 0x68, 0x1A, 0xCF, + 0xA3, 0xDE, 0xC2, 0xED, 0x60, 0xB9, 0x38, 0x0A, 0x78, 0x7C, 0x5A, 0x96, 0x70, 0x3E, 0x1E, 0xDC, + 0xCD, 0x80, 0xDE, 0x5B, 0x63, 0x94, 0x01, 0x9D, 0x68, 0x02, 0xB9, 0x64, 0xBC, 0x89, 0xCA, 0xB4, + 0x12, 0xD7, 0x5E, 0x20, 0xC7, 0xBD, 0x39, 0x21, 0xAD, 0x74, 0x3A, 0x04, 0x8F, 0x5F, 0xE2, 0x55, + 0xE2, 0xA4, 0x8F, 0xE0, 0xFB, 0x9D, 0xBD, 0x67, 0xCF, 0xD8, 0x93, 0x6C, 0x84, 0xE7, 0xB6, 0xCE, + 0xBD, 0x7B, 0xDA, 0x93, 0x18, 0x70, 0x6B, 0x48, 0xBA, 0x0E, 0x66, 0x09, 0x2E, 0x91, 0x55, 0x38, + 0x84, 0x02, 0x18, 0x1D, 0x49, 0xDE, 0x25, 0xB3, 0x7E, 0xE8, 0xD0, 0x6E, 0xDD, 0x13, 0x8F, 0xA4, + 0x95, 0x17, 0x01, 0x0D, 0x93, 0xB0, 0xD8, 0xBD, 0x0C, 0xCA, 0x48, 0x62, 0xFA, 0xF5, 0xEA, 0xC5, + 0x71, 0x21, 0x00, 0xEC, 0x3A, 0x88, 0x26, 0xA1, 0x52, 0xBA, 0xBF, 0x2A, 0x70, 0xEB, 0xF7, 0x2B, + 0x43, 0xF4, 0xF6, 0xE3, 0xD0, 0x63, 0x1A, 0xA1, 0x0C, 0x00, 0xFE, 0xF9, 0x12, 0xE1, 0xED, 0x2A, + 0xFD, 0x19, 0x4E, 0x51, 0x22, 0xA0, 0x4C, 0x09, 0x2F, 0x0B, 0x8A, 0x57, 0xFA, 0x3E, 0xF3, 0x02, + 0xE3, 0xF0, 0x8F, 0x17, 0x6E, 0xC1, 0x45, 0x34, 0x95, 0x61, 0x22, 0x9E, 0x72, 0xA9, 0x50, 0x77, + 0x07, 0x64, 0xEE, 0x52, 0x03, 0x10, 0xBA, 0x09, 0xF9, 0x45, 0x29, 0x58, 0x46, 0x24, 0xE7, 0x0F, + 0x21, 0xE0, 0xC8, 0xC8, 0x69, 0xCB, 0x4C, 0xD8, 0x39, 0x0E, 0x0C, 0x24, 0x68, 0x46, 0x1E, 0xD9, + 0x7A, 0x8C, 0xB2, 0x91, 0xF4, 0x1B, 0x96, 0xDE, 0x63, 0xFF, 0xE7, 0xCB, 0x86, 0x9F, 0xCD, 0xFB, + 0xBF, 0x67, 0xBE, 0x46, 0xF7, 0x0E, 0x1F, 0x1D, 0x77, 0x4F, 0x66, 0x4F, 0x4F, 0x09, 0x4E, 0x79, + 0x33, 0x80, 0x66, 0xA5, 0xD0, 0x47, 0xAD, 0x50, 0x3D, 0x45, 0xE5, 0x15, 0xCB, 0x05, 0xA9, 0xC8, + 0xFB, 0x0F, 0x00, 0xB6, 0x9F, 0xF7, 0xC2, 0x1B, 0x15, 0x2B, 0xD1, 0x01, 0xA2, 0x5A, 0xFB, 0x26, + 0x3D, 0x9E, 0xAC, 0x37, 0x2C, 0x0B, 0x3A, 0xD3, 0xE8, 0x99, 0xAF, 0xB0, 0x12, 0x17, 0x06, 0x0C, + 0x7B, 0xF1, 0x6D, 0xB5, 0x8D, 0x18, 0xE4, 0x32, 0x3F, 0x51, 0xC2, 0x20, 0x20, 0xC6, 0x47, 0x22, + 0x08, 0x94, 0x32, 0x99, 0x17, 0x4A, 0x50, 0x36, 0x1E, 0xA2, 0x88, 0xCE, 0x01, 0xAF, 0x78, 0xF5, + 0x6B, 0xF2, 0xA2, 0x0C, 0x8E, 0xC5, 0xE4, 0x31, 0x9C, 0x28, 0xA4, 0x7F, 0x4E, 0x64, 0x1D, 0xF5, + 0xC1, 0x1A, 0x68, 0xE2, 0xF4, 0x3A, 0x99, 0xBC, 0xD3, 0x31, 0xF9, 0xD8, 0x58, 0x7B, 0xB1, 0xB7, + 0x7D, 0x57, 0x2B, 0x7D, 0xAC, 0x4A, 0x43, 0x9E, 0xB2, 0x50, 0x96, 0x06, 0x99, 0x17, 0x89, 0x6A, + 0xA7, 0x2E, 0xC2, 0xB9, 0xA2, 0xBB, 0x96, 0xD4, 0x03, 0xD5, 0xF2, 0xB4, 0xA7, 0x78, 0xE6, 0x65, + 0x31, 0xD2, 0x43, 0x75, 0x4A, 0xD1, 0xB5, 0xE6, 0x07, 0x98, 0x27, 0xAA, 0xBD, 0xCD, 0x32, 0xF1, + 0x80, 0xCE, 0x9E, 0xCD, 0xF2, 0xA1, 0x50, 0xD0, 0x88, 0x02, 0xF0, 0x1C, 0x10, 0x70, 0xAA, 0xA5, + 0xDF, 0x70, 0x32, 0x7E, 0x89, 0xAE, 0x51, 0x37, 0x84, 0x13, 0x18, 0xCE, 0x7D, 0x4C, 0x8A, 0x16, + 0x99, 0xA2, 0x42, 0x9D, 0x5D, 0x9C, 0x81, 0x86, 0x4D, 0x15, 0x96, 0xF0, 0xE6, 0xE1, 0x38, 0x11, + 0xA6, 0x8A, 0x15, 0x14, 0xF7, 0x13, 0xAD, 0x33, 0x81, 0xB5, 0xF4, 0x65, 0x87, 0x87, 0x6F, 0x97, + 0x2F, 0x5D, 0xED, 0xEC, 0xA7, 0xB6, 0x91, 0xE2, 0xF3, 0x7B, 0xE5, 0xC8, 0x7E, 0x3A, 0x26, 0x54, + 0x9C, 0xC3, 0xD3, 0x6C, 0x4B, 0x6A, 0x78, 0x48, 0xF3, 0x0E, 0xCF, 0xBF, 0x9A, 0xC8, 0x60, 0x46, + 0x0B, 0x6C, 0x92, 0x6B, 0x88, 0x6F, 0x42, 0x39, 0xB0, 0xC2, 0x43, 0x8D, 0xA6, 0x4A, 0xF8, 0xF5, + 0x1E, 0x23, 0x74, 0xF7, 0x15, 0xB2, 0x15, 0xEB, 0x5A, 0x2A, 0xCA, 0xA5, 0x2C, 0xCC, 0x3C, 0x7D, + 0x63, 0x65, 0x7F, 0x3A, 0xA8, 0x35, 0xB0, 0x77, 0x54, 0x1A, 0xCB, 0xA5, 0x07, 0x1E, 0x2C, 0x60, + 0x3C, 0x66, 0x32, 0x55, 0x75, 0xEB, 0x57, 0x35, 0xE2, 0xD3, 0xC2, 0x73, 0x5D, 0xF7, 0xC2, 0xB6, + 0xEE, 0x45, 0x1C, 0x19, 0xE6, 0xF9, 0x23, 0x24, 0x23, 0xBA, 0x77, 0x6B, 0x93, 0x73, 0xA0, 0x9C, + 0xF9, 0xF0, 0x59, 0xE7, 0xB4, 0x60, 0xC3, 0xA6, 0x01, 0xEA, 0xC7, 0x52, 0x2B, 0xDC, 0xDC, 0x96, + 0x0F, 0x3C, 0xB0, 0x19, 0x19, 0xE1, 0x52, 0xB6, 0x17, 0x91, 0x2A, 0x4D, 0xC3, 0xFC, 0x44, 0x33, + 0x5F, 0x9D, 0x36, 0x51, 0x3C, 0x02, 0x6D, 0x68, 0x23, 0x64, 0x1B, 0xA0, 0xA3, 0xD7, 0xEA, 0x64, + 0x60, 0xB9, 0xEB, 0xC5, 0x3F, 0xB5, 0x52, 0xC8, 0xC4, 0xC8, 0x73, 0x36, 0x73, 0x28, 0x67, 0xF1, + 0x2A, 0x3C, 0xA6, 0x8A, 0xDB, 0x99, 0x81, 0x90, 0xDF, 0xD7, 0x4C, 0x1F, 0xD1, 0xD9, 0x0D, 0xCE, + 0x6C, 0xD8, 0x8A, 0x03, 0xB4, 0x70, 0x3A, 0x07, 0x2E, 0x2E, 0x5E, 0xA5, 0x5C, 0xBF, 0x51, 0x36, + 0x97, 0x42, 0xA5, 0x76, 0x2A, 0xCA, 0x0A, 0x51, 0x5D, 0x06, 0x78, 0x0E, 0xCF, 0x9E, 0x93, 0x59, + 0x5C, 0x17, 0x05, 0xB6, 0xF2, 0x0D, 0x02, 0xD6, 0x2D, 0x2E, 0x20, 0x62, 0x8D, 0xF7, 0x38, 0xE0, + 0xC1, 0x5E, 0x17, 0x72, 0x4D, 0xA4, 0x2F, 0x5B, 0xDC, 0xC6, 0x40, 0x82, 0x34, 0x04, 0x39, 0x69, + 0xF8, 0xBC, 0xB1, 0x79, 0x54, 0xD5, 0x1E, 0x2D, 0xD8, 0x8C, 0x90, 0x8D, 0xB4, 0xE3, 0x61, 0xB7, + 0x1D, 0xA2, 0x3C, 0xFB, 0x6A, 0x38, 0x98, 0x06, 0xDA, 0x56, 0x2C, 0xBF, 0x9B, 0x14, 0x76, 0xE6, + 0x3C, 0x01, 0x57, 0xCC, 0xC2, 0x08, 0x0C, 0xBC, 0x10, 0x09, 0x67, 0xAB, 0x01, 0x2A, 0x32, 0x6C, + 0x81, 0x2C, 0xAB, 0xD3, 0xEC, 0x7D, 0x87, 0x48, 0x16, 0x28, 0xAC, 0x1D, 0x61, 0x11, 0x31, 0x87, + 0xD6, 0x2B, 0xB0, 0x36, 0xB1, 0x18, 0xDD, 0xE7, 0xD0, 0x46, 0x57, 0x93, 0xFC, 0xDF, 0xD2, 0x3A, + 0x37, 0x49, 0x42, 0xDB, 0xE6, 0x45, 0x46, 0x22, 0xB0, 0xF2, 0x92, 0xEE, 0x52, 0x94, 0x9F, 0xFE, + 0xB1, 0xD2, 0x33, 0x45, 0xAD, 0xC9, 0x6D, 0x11, 0x79, 0x57, 0xF1, 0x80, 0xF4, 0x07, 0xAE, 0xDF, + 0x11, 0x6C, 0x85, 0x58, 0x49, 0x2F, 0x13, 0x81, 0xB9, 0x66, 0x73, 0xAB, 0x84, 0x94, 0x36, 0xC4, + 0xC6, 0x23, 0x5F, 0xC5, 0x36, 0xC6, 0xBE, 0x8E, 0x6B, 0xE9, 0x97, 0xF0, 0xAC, 0xB4, 0xF1, 0x11, + 0x43, 0xB4, 0xD2, 0xC0, 0x79, 0x5E, 0x88, 0x72, 0xC7, 0x46, 0x6B, 0x22, 0xC7, 0xF2, 0x7B, 0x61, + 0xC8, 0xFA, 0x39, 0x65, 0x45, 0x97, 0xF0, 0xC7, 0xCE, 0x74, 0x09, 0x9F, 0x5D, 0xB7, 0x68, 0xF2, + 0x2E, 0x6E, 0x2D, 0x42, 0x56, 0x9C, 0xED, 0xC5, 0x5A, 0x57, 0xD9, 0x53, 0x5A, 0xB4, 0xE8, 0x15, + 0x07, 0x1B, 0xFB, 0x31, 0x40, 0x14, 0x95, 0x77, 0x33, 0x74, 0x71, 0x73, 0x7B, 0xFA, 0xA7, 0xBF, + 0x51, 0xF8, 0x3D, 0xE6, 0xB1, 0xD0, 0x42, 0x25, 0x52, 0xFC, 0x4F, 0x1A, 0xA6, 0x4D, 0xAF, 0xCD, + 0x13, 0x62, 0x7A, 0xBF, 0x22, 0x98, 0xD6, 0x07, 0x9C, 0xAE, 0x5E, 0xFC, 0x96, 0xEC, 0x0E, 0x79, + 0x84, 0x1F, 0x73, 0x60, 0x6C, 0x02, 0x6C, 0xE5, 0xB7, 0xFD, 0x7A, 0x4B, 0x8D, 0x0D, 0xC0, 0xD7, + 0x0A, 0x70, 0x6E, 0xE1, 0x51, 0x0E, 0x8C, 0xAA, 0x02, 0x6A, 0xCF, 0x61, 0x04, 0xBD, 0x53, 0x9D, + 0xE0, 0xB5, 0x28, 0x1E, 0x24, 0xBA, 0x97, 0x13, 0x0C, 0x6E, 0x93, 0x71, 0xE2, 0x68, 0xEC, 0x73, + 0x2C, 0xEC, 0x80, 0xB2, 0x16, 0xD5, 0x38, 0xC6, 0x3B, 0xCE, 0xEB, 0xB9, 0x42, 0xBE, 0x37, 0xB5, + 0x39, 0x31, 0x00, 0x5F, 0xB6, 0xD1, 0xB6, 0xD9, 0x57, 0x34, 0x82, 0x12, 0x07, 0x05, 0x04, 0x4B, + 0x5E, 0xB8, 0xC7, 0x6F, 0xA3, 0x01, 0xB9, 0x1D, 0xFF, 0x5F, 0x52, 0xBF, 0x6E, 0x7B, 0xA8, 0xC3, + 0x6E, 0xAC, 0x00, 0xCD, 0x0A, 0xAB, 0x7D, 0x4E, 0x63, 0x43, 0xCE, 0x10, 0x21, 0x38, 0x42, 0x88, + 0x8D, 0xA7, 0x46, 0x7F, 0x74, 0x1F, 0x1D, 0x5F, 0x25, 0xD2, 0xC0, 0x18, 0x7D, 0x40, 0x61, 0x36, + 0x06, 0xB5, 0x09, 0xCA, 0xC6, 0xAD, 0xD6, 0x9E, 0xED, 0x45, 0xF6, 0x95, 0x32, 0x07, 0x84, 0x71, + 0xC8, 0x35, 0xB0, 0x81, 0x97, 0xC9, 0x60, 0xDE, 0xFD, 0x8E, 0x90, 0x67, 0xD7, 0x23, 0x51, 0x28, + 0x90, 0xA5, 0x6E, 0xB6, 0x59, 0x88, 0xD1, 0x8D, 0xCD, 0x17, 0xA3, 0x48, 0xE3, 0x3F, 0x00, 0x4E, + 0x9B, 0x21, 0xD5, 0xA4, 0x5A, 0xF0, 0xA0, 0xBA, 0x40, 0xB7, 0xBB, 0xE1, 0x3D, 0x16, 0x9E, 0xEE, + 0xBB, 0x9E, 0xB2, 0x91, 0xBD, 0x39, 0x77, 0xD6, 0xB5, 0x9C, 0xB5, 0xE8, 0xCF, 0x7D, 0x8C, 0x83, + 0x82, 0x1A, 0xBA, 0x11, 0xDA, 0xF3, 0x96, 0xDD, 0x09, 0x20, 0x9F, 0xEB, 0xAE, 0x39, 0xAC, 0x7C, + 0xF2, 0x41, 0x98, 0x21, 0x6B, 0x8D, 0x19, 0xFF, 0x36, 0x5E, 0x82, 0xAC, 0xEE, 0x1E, 0x0E, 0x77, + 0x63, 0x14, 0x4E, 0x87, 0xE8, 0x22, 0x01, 0xD4, 0xC4, 0xF3, 0xE6, 0x49, 0xE6, 0x25, 0x64, 0x5C, + 0x54, 0x4B, 0x10, 0xE7, 0xCD, 0x17, 0x8F, 0xFA, 0xA3, 0x4D, 0xCA, 0x49, 0xCA, 0x4D, 0x33, 0xBC, + 0x29, 0x71, 0x4D, 0xF9, 0x0D, 0x74, 0x01, 0xAC, 0x79, 0xA7, 0xD7, 0x75, 0xD3, 0x9B, 0x04, 0xEE, + 0xCB, 0xCD, 0x51, 0xCC, 0xAA, 0x68, 0xFB, 0x41, 0xD3, 0x2D, 0xC1, 0xC8, 0x72, 0xDC, 0x69, 0xBE, + 0x0A, 0x74, 0xFF, 0xA8, 0x0C, 0xB4, 0xE1, 0x1A, 0xD3, 0x30, 0x21, 0xA9, 0x34, 0xCC, 0xB5, 0xE9, + 0xCF, 0x38, 0x48, 0x3B, 0xFC, 0xD6, 0x88, 0xD8, 0xB7, 0x3D, 0x71, 0xE4, 0x36, 0xA2, 0xE6, 0x03, + 0x02, 0xE3, 0xFB, 0x68, 0x0F, 0x07, 0x3B, 0x80, 0x30, 0x1C, 0xF4, 0x88, 0x0D, 0x86, 0x1F, 0x83, + 0x4D, 0x93, 0xD4, 0x10, 0xB1, 0xFF, 0x2C, 0xCB, 0xBE, 0x8E, 0xA8, 0xDB, 0x09, 0xE5, 0xF7, 0x9C, + 0x82, 0x48, 0xE0, 0xC8, 0x2C, 0x7B, 0xA1, 0x46, 0x89, 0xE9, 0x0D, 0x82, 0x6F, 0xC1, 0xEA, 0xA5, + 0x84, 0x82, 0x33, 0x26, 0x4A, 0xB6, 0x84, 0x60, 0x21, 0x00, 0x89, 0x20, 0x84, 0x14, 0x7A, 0xDF, + 0x7B, 0xEB, 0x45, 0x6B, 0x76, 0xE6, 0xDB, 0x53, 0xBE, 0x6A, 0x95, 0xE1, 0xFE, 0x6A, 0x79, 0x07, + 0xBC, 0x9D, 0xB3, 0x37, 0x67, 0xAF, 0xC2, 0x1E, 0x2B, 0xFF, 0x9F, 0xC5, 0xF5, 0x54, 0xE0, 0x29, + 0x44, 0xA4, 0x2A, 0x6F, 0xB7, 0x52, 0x17, 0x2C, 0xB1, 0x72, 0x6E, 0x9F, 0x30, 0x9D, 0x42, 0x41, + 0xF6, 0xD5, 0x14, 0x3E, 0x32, 0x59, 0x42, 0xAD, 0x7A, 0x68, 0x53, 0xF9, 0x99, 0xFD, 0x30, 0xC0, + 0x68, 0xB6, 0x97, 0xD9, 0x1B, 0x9A, 0xF6, 0xB9, 0x06, 0xE2, 0x2E, 0x27, 0x60, 0xE9, 0x1A, 0xBD, + 0x88, 0xCD, 0xAD, 0xE0, 0xCB, 0xED, 0x76, 0x2B, 0x46, 0x24, 0xB0, 0x48, 0xBA, 0x55, 0x9B, 0xBD, + 0x6D, 0xF2, 0xF7, 0x8C, 0x59, 0x4E, 0xB6, 0xE4, 0x89, 0xE1, 0xD4, 0x97, 0x85, 0x15, 0x27, 0xAE, + 0xD0, 0x9A, 0x72, 0x98, 0xB0, 0x6F, 0x06, 0xB9, 0xFC, 0xFD, 0x0D, 0x51, 0x11, 0x7E, 0x02, 0x66, + 0xD2, 0xE7, 0x25, 0xD4, 0x4D, 0xAE, 0x78, 0x9F, 0x8E, 0x69, 0xDD, 0x43, 0x80, 0x2F, 0xE6, 0x6E, + 0x46, 0xD7, 0x1A, 0x05, 0x8F, 0x4B, 0x5E, 0xF7, 0x4E, 0x09, 0x9B, 0xAF, 0x4E, 0x2B, 0x14, 0x91, + 0x59, 0x67, 0xFF, 0xFF, 0xAA, 0x08, 0xE7, 0x25, 0x42, 0x4E, 0x17, 0xD6, 0xDF, 0xD8, 0x23, 0x45, + 0xB4, 0xE2, 0x15, 0xE8, 0xDB, 0xA8, 0x55, 0x81, 0x9B, 0xE3, 0x3F, 0x09, 0x0C, 0x16, 0x19, 0xE6, + 0xE3, 0x7F, 0x1D, 0xB6, 0xBB, 0x14, 0x3C, 0x58, 0xBB, 0x69, 0x5F, 0x7A, 0x1A, 0x51, 0x45, 0xEE, + 0xDB, 0xA5, 0x7F, 0x53, 0x27, 0x04, 0xA0, 0x60, 0x76, 0x7A, 0xAD, 0x29, 0x7A, 0x8B, 0x49, 0x4C, + 0x6D, 0x26, 0x01, 0x45, 0x9B, 0x2F, 0xC8, 0x6B, 0xE0, 0x11, 0x1E, 0xCE, 0x35, 0x18, 0xDA, 0x6A, + 0x7E, 0x14, 0x56, 0xFB, 0x19, 0xE2, 0xBC, 0xAF, 0xE9, 0x62, 0xF9, 0xD4, 0xB7, 0x21, 0x1D, 0x45, + 0x10, 0xB7, 0xF3, 0x10, 0x80, 0xD0, 0xA9, 0x20, 0x12, 0xFB, 0xFA, 0xB9, 0xF6, 0x9B, 0x32, 0xA9, + 0x68, 0x58, 0xD9, 0x97, 0xDD, 0x4D, 0xDB, 0x67, 0x95, 0x35, 0xFE, 0xFA, 0x9A, 0xB2, 0x8D, 0x39, + 0x32, 0xD0, 0x5F, 0x6E, 0x74, 0x62, 0x3F, 0xC0, 0xC9, 0x24, 0x49, 0xC9, 0x65, 0x27, 0x88, 0x52, + 0x60, 0xBB, 0x6B, 0x52, 0xAC, 0x35, 0x90, 0x47, 0xF8, 0x34, 0xF4, 0x8E, 0x9E, 0x43, 0xE6, 0x28, + 0xA5, 0x04, 0xA9, 0x10, 0x09, 0x4F, 0xE0, 0x2E, 0x3E, 0x12, 0xD9, 0xC3, 0xC3, 0xF0, 0xAB, 0x30, + 0x18, 0x13, 0x6C, 0x17, 0x06, 0x2C, 0x03, 0x60, 0x04, 0x5D, 0x0E, 0xC8, 0x7F, 0x80, 0x4B, 0xAD, + 0xAF, 0x34, 0x2B, 0xDC, 0x94, 0x1F, 0x68, 0x0A, 0xAB, 0xA3, 0xD7, 0x19, 0x23, 0x02, 0x8F, 0xBD, + 0xB9, 0x33, 0xD3, 0x93, 0x66, 0xC9, 0x19, 0x18, 0xEF, 0x08, 0x0C, 0xEE, 0xDB, 0xB3, 0x5E, 0x55, + 0xB2, 0xDC, 0xBB, 0x90, 0x02, 0x2B, 0x90, 0x67, 0x41, 0x3E, 0x65, 0xA0, 0x9B, 0xC4, 0x5D, 0x81, + 0xDC, 0x64, 0x82, 0xA9, 0x86, 0xA7, 0xB1, 0x1C, 0x6C, 0x7B, 0xA2, 0x07, 0xF1, 0xE0, 0x8E, 0x4F, + 0xBF, 0x07, 0x20, 0x48, 0x05, 0xE5, 0x1D, 0xB6, 0xD8, 0x83, 0x45, 0x7C, 0xAD, 0x84, 0x32, 0x94, + 0xCA, 0x88, 0x96, 0xAA, 0x07, 0xE8, 0x7B, 0x0A, 0x89, 0x46, 0x98, 0x2F, 0x93, 0x65, 0xEB, 0x7B, + 0x79, 0x50, 0x8C, 0x8D, 0x01, 0x6D, 0xCE, 0xB4, 0x5E, 0x1E, 0x74, 0x6D, 0xC3, 0x29, 0x0B, 0x34, + 0xB6, 0xB8, 0xE7, 0x9C, 0x2D, 0x71, 0x49, 0x65, 0x07, 0x1A, 0x7D, 0x04, 0x74, 0x42, 0xD7, 0x0D, + 0x96, 0x80, 0x85, 0xFC, 0x5D, 0x29, 0x79, 0x54, 0x8F, 0x08, 0x2A, 0x7F, 0xF2, 0xB8, 0x87, 0x13, + 0x29, 0x6E, 0xC4, 0xB7, 0x99, 0xBB, 0xC5, 0x6C, 0x4D, 0x01, 0x38, 0xB5, 0xFF, 0x93, 0xEC, 0x0F, + 0x96, 0xA5, 0x47, 0x78, 0xD1, 0xC0, 0x63, 0x61, 0xE0, 0x2D, 0xE4, 0x56, 0x7C, 0xAC, 0x77, 0x30, + 0x21, 0x55, 0x32, 0xFD, 0x4E, 0xC0, 0x31, 0x9B, 0x7C, 0x37, 0x04, 0x8B, 0xAB, 0x95, 0x03, 0xAC, + 0x22, 0x9E, 0x1F, 0x86, 0x2A, 0xB5, 0xD9, 0x32, 0x56, 0xCC, 0x4E, 0xE5, 0x1A, 0x70, 0x65, 0x5B, + 0x32, 0xC7, 0x1D, 0x96, 0x73, 0x62, 0x49, 0xB3, 0xC5, 0xA1, 0x83, 0xEB, 0x32, 0x6B, 0x6E, 0x17, + 0xC2, 0xD2, 0xBA, 0x90, 0x3B, 0xB5, 0x99, 0x18, 0x34, 0x4D, 0x15, 0x57, 0x19, 0xCD, 0x3C, 0xE1, + 0xCF, 0x55, 0x4A, 0x44, 0xD0, 0xFD, 0xD1, 0x29, 0xB5, 0x86, 0xA1, 0xAA, 0xB0, 0x6C, 0x30, 0xEE, + 0x14, 0xC2, 0x9E, 0x02, 0x31, 0xDF, 0x13, 0x0D, 0xC6, 0xFA, 0x9F, 0xC1, 0x17, 0xF1, 0x52, 0x08, + 0x8B, 0xBB, 0x81, 0xB8, 0x92, 0x7B, 0x19, 0x0F, 0x5E, 0x7A, 0xDF, 0xEB, 0x86, 0x8C, 0x5F, 0x6C, + 0x7A, 0xE9, 0xF1, 0x26, 0x55, 0x80, 0xFF, 0xBC, 0x6A, 0x0A, 0xBC, 0x23, 0xAB, 0xE8, 0x8E, 0xC3, + 0xA5, 0xD7, 0xFD, 0x52, 0x73, 0x68, 0x4B, 0x56, 0x7F, 0x60, 0x4A, 0x68, 0x84, 0x30, 0xE1, 0x1F, + 0x0C, 0x10, 0x41, 0x71, 0xFC, 0x10, 0xDF, 0x62, 0xCC, 0x4D, 0xD6, 0x2A, 0x7F, 0xB9, 0xAF, 0x46, + 0x94, 0x3A, 0xD7, 0x0F, 0x12, 0x2C, 0xB8, 0x17, 0x1F, 0x56, 0xF3, 0xCD, 0xA0, 0xE7, 0xBF, 0xA4, + 0xFB, 0xC5, 0xE8, 0x17, 0x4B, 0x8A, 0xE5, 0x3E, 0x96, 0x22, 0x17, 0x07, 0xA3, 0x17, 0x0A, 0x77, + 0x98, 0xF8, 0x9B, 0x59, 0x5C, 0x2F, 0xC9, 0x73, 0xA4, 0x5A, 0x17, 0x1F, 0xBD, 0x56, 0x3E, 0xA2, + 0xE6, 0x8F, 0x34, 0xF2, 0xE0, 0x20, 0x37, 0xE4, 0x98, 0xE1, 0xEC, 0xC4, 0x1E, 0x81, 0x13, 0x17, + 0x21, 0x95, 0x88, 0x60, 0x04, 0xDA, 0x91, 0xB9, 0x22, 0xF8, 0x64, 0x87, 0x8D, 0x32, 0x60, 0x37, + 0x33, 0x2E, 0x2B, 0x95, 0x43, 0x0C, 0x10, 0xDF, 0xFC, 0x64, 0x56, 0x89, 0x32, 0x47, 0xA3, 0x8F, + 0xF1, 0x3E, 0x34, 0x63, 0x35, 0xD9, 0x41, 0xD8, 0x1A, 0x23, 0x88, 0x39, 0x6D, 0x23, 0x2A, 0x20, + 0xCE, 0xFB, 0x80, 0x0F, 0x59, 0xB7, 0xFB, 0x1E, 0x24, 0xF5, 0x8A, 0x78, 0x2B, 0xE8, 0x13, 0x52, + 0x34, 0x5B, 0x65, 0x64, 0xAB, 0x78, 0x4D, 0x5C, 0x79, 0x3B, 0xF2, 0x7D, 0x1F, 0x5B, 0xA9, 0x37, + 0xAE, 0x4C, 0x9E, 0x30, 0x6B, 0x39, 0x3D, 0x75, 0x06, 0xCE, 0xFE, 0x87, 0xB7, 0x1B, 0x9C, 0x9F, + 0x44, 0x7E, 0x98, 0xFF, 0x3B, 0xA6, 0x71, 0x48, 0xE3, 0x07, 0x8C, 0x5E, 0x95, 0x96, 0x04, 0xC1, + 0xBF, 0x7A, 0x18, 0x06, 0xC2, 0xD2, 0x24, 0xD6, 0xC9, 0x4D, 0x65, 0xCE, 0x18, 0x8F, 0x8B, 0x0D, + 0xFC, 0x66, 0x40, 0xB1, 0xE6, 0xE5, 0xC5, 0xDE, 0xAE, 0x2E, 0x84, 0x3F, 0xBA, 0x16, 0x5A, 0x63, + 0x72, 0x0F, 0x3C, 0x82, 0x4A, 0xD7, 0x54, 0x54, 0x60, 0x1B, 0x6A, 0x16, 0x2D, 0xDA, 0x0F, 0xF9, + 0x61, 0xD2, 0x53, 0x2B, 0xE4, 0x22, 0x0E, 0x1D, 0x08, 0x69, 0x5D, 0x4D, 0x4D, 0x3E, 0x99, 0xBE, + 0x8A, 0x83, 0xA2, 0x5A, 0x68, 0x8B, 0xBB, 0x6A, 0xA5, 0x31, 0xB9, 0x65, 0xA6, 0x55, 0xD1, 0x09, + 0x8D, 0x6B, 0xAB, 0xD8, 0xF1, 0x06, 0x62, 0xA8, 0x1A, 0xDA, 0xA4, 0x4B, 0x68, 0xA9, 0xB8, 0xA5, + 0x9D, 0xD1, 0xAA, 0x42, 0x8E, 0x67, 0xA8, 0xC6, 0x29, 0x94, 0x69, 0x38, 0xA0, 0x66, 0x84, 0xBB, + 0x73, 0x3B, 0xFC, 0x7D, 0x6B, 0xCD, 0x39, 0x8F, 0x1C, 0x6C, 0xE0, 0x58, 0x97, 0x75, 0xB7, 0x09, + 0x40, 0x68, 0x45, 0xCD, 0x97, 0x78, 0x1A, 0x81, 0xA9, 0x6D, 0x6C, 0x59, 0xB8, 0x0C, 0x7D, 0x94, + 0x46, 0x23, 0xCC, 0xD4, 0x2D, 0x71, 0x95, 0x7F, 0x9F, 0x08, 0xE0, 0xE5, 0xF9, 0xC0, 0x2C, 0xC4, + 0x09, 0x27, 0x7C, 0x62, 0x5E, 0xF4, 0xB6, 0xAA, 0x9D, 0x18, 0x10, 0xCE, 0xCB, 0xCA, 0xFC, 0xC2, + 0x12, 0x5A, 0xC2, 0xC7, 0xFA, 0x47, 0x3B, 0x4A, 0x5C, 0xC7, 0x52, 0xCA, 0x97, 0xD4, 0xC3, 0x90, + 0x1D, 0x04, 0x50, 0x92, 0xFF, 0xCC, 0xA9, 0x85, 0x4D, 0x1F, 0x73, 0xE3, 0x5B, 0x4D, 0x20, 0xCA, + 0x46, 0x89, 0xD5, 0x26, 0x2B, 0xF5, 0x6B, 0x2A, 0x0B, 0x9C, 0x36, 0x15, 0x9A, 0xB2, 0x15, 0xC1, + 0xAF, 0x38, 0x3D, 0xA5, 0x4B, 0x47, 0x56, 0x32, 0x90, 0x60, 0x93, 0x5D, 0x8C, 0xE4, 0x3D, 0x3A, + 0x00, 0xB2, 0x84, 0x92, 0xE7, 0x9C, 0x09, 0xD4, 0x55, 0x01, 0xFC, 0xFC, 0x3C, 0x0B, 0x6B, 0x0B, + 0xD4, 0x39, 0x7B, 0x88, 0x40, 0x08, 0xDE, 0x2D, 0xFC, 0x9E, 0xEF, 0xFE, 0xCA, 0x45, 0xB6, 0x8F, + 0xDD, 0x59, 0x49, 0x16, 0x9B, 0x26, 0x88, 0x7F, 0x83, 0xA0, 0x29, 0x14, 0xA6, 0x96, 0x51, 0x1D, + 0x36, 0xCF, 0x7D, 0x01, 0x2E, 0xC3, 0xC5, 0xC2, 0x49, 0xAB, 0x70, 0xAC, 0x66, 0x08, 0xA4, 0xB7, + 0xB5, 0x37, 0x34, 0xEB, 0xD1, 0xA1, 0x52, 0xB1, 0xF8, 0x1C, 0x88, 0x36, 0x32, 0x00, 0xA4, 0x5B, + 0x3B, 0x93, 0x34, 0x20, 0x5F, 0xA9, 0x9B, 0x1E, 0xA6, 0xF9, 0xFC, 0xC5, 0x34, 0x2E, 0x64, 0xCE, + 0x97, 0x44, 0x71, 0x0D, 0x09, 0x89, 0xF2, 0x68, 0x41, 0xF9, 0x64, 0xA0, 0xFC, 0xE2, 0x43, 0x14, + 0x77, 0xB1, 0x68, 0x2C, 0xE6, 0xCB, 0xD4, 0x82, 0xE0, 0xF1, 0x93, 0x00, 0x50, 0x9F, 0x14, 0x6F, + 0x78, 0xDC, 0x7B, 0xC2, 0xD6, 0x31, 0x29, 0x85, 0xA6, 0xEB, 0x50, 0xEC, 0xA6, 0xDD, 0xAA, 0x50, + 0x65, 0x94, 0xEE, 0x68, 0xC3, 0x11, 0xAA, 0xB7, 0xA7, 0xEE, 0xBB, 0x39, 0x08, 0xA6, 0xE8, 0xC5, + 0x4E, 0x52, 0x84, 0xDD, 0xE6, 0x16, 0xF5, 0xC3, 0xAC, 0xB0, 0xBE, 0x3F, 0xA0, 0xC9, 0x1F, 0x17, + 0xC0, 0x8D, 0x7C, 0x80, 0x27, 0xAE, 0xBB, 0x47, 0x32, 0x94, 0x01, 0xCB, 0x72, 0x12, 0xCB, 0x74, + 0x56, 0x58, 0x17, 0x30, 0x57, 0x6C, 0x94, 0x08, 0xD4, 0x60, 0x50, 0x41, 0x35, 0xAB, 0xBD, 0x0B, + 0xA7, 0x43, 0x1B, 0x53, 0x19, 0xBA, 0x05, 0x67, 0xAF, 0x4C, 0xAD, 0x76, 0xBA, 0x7D, 0x75, 0x8E, + 0x64, 0x0C, 0xDD, 0xFB, 0xD9, 0x84, 0x3F, 0xB0, 0x57, 0x4D, 0x8C, 0xA0, 0x0F, 0xD9, 0xE0, 0x53, + 0xB9, 0x1D, 0xAE, 0xE1, 0xCC, 0x9E, 0xD5, 0x79, 0xDA, 0xB4, 0x0C, 0x0B, 0xDD, 0x95, 0x28, 0xDD, + 0x7F, 0x73, 0x43, 0x83, 0xC5, 0x45, 0x14, 0x00, 0xBA, 0x00, 0x9C, 0xC0, 0xC8, 0x62, 0x34, 0x66, + 0xF9, 0x78, 0x57, 0x0B, 0x9F, 0x85, 0xEE, 0x49, 0xF6, 0xA9, 0x86, 0x05, 0x6B, 0x0E, 0x1F, 0x26, + 0xD0, 0xD9, 0xEB, 0xA8, 0x5B, 0x9B, 0xCD, 0x4E, 0x25, 0x07, 0xE1, 0xE0, 0x60, 0xA0, 0xFB, 0x17, + 0x7C, 0x41, 0xAA, 0x20, 0xFE, 0x83, 0x25, 0x3A, 0x9A, 0x02, 0x87, 0x0A, 0x71, 0x87, 0xE5, 0xD3, + 0xC1, 0xDC, 0x85, 0xC8, 0xFA, 0x71, 0x2A, 0xCF, 0xA1, 0xF7, 0x44, 0x13, 0x9C, 0x03, 0x56, 0xC3, + 0x7A, 0xEE, 0x51, 0x35, 0x3C, 0x27, 0x30, 0xF3, 0x3E, 0x31, 0x5F, 0x00, 0x51, 0xA7, 0x1C, 0x92, + 0xA4, 0xE1, 0xC3, 0x43, 0x12, 0x03, 0x3C, 0xEE, 0xD3, 0xFA, 0x1C, 0x6A, 0x0F, 0xE0, 0x45, 0xBB, + 0x3B, 0x81, 0xF1, 0x37, 0x46, 0x9C, 0x6E, 0x21, 0x74, 0xFA, 0x93, 0x52, 0xF4, 0x57, 0x95, 0x81, + 0xD3, 0x57, 0x44, 0x5E, 0xF0, 0x54, 0x18, 0x3C, 0xFB, 0x3A, 0xE7, 0x10, 0x67, 0xF2, 0x20, 0x24, + 0x09, 0xD2, 0x6D, 0xAB, 0xC2, 0xBA, 0x3C, 0x30, 0xE9, 0x65, 0xF1, 0x50, 0xFB, 0x11, 0xB6, 0xCF, + 0x85, 0x7B, 0x6A, 0x4A, 0x56, 0x59, 0x59, 0xB7, 0xDE, 0xFB, 0xC8, 0x39, 0x6A, 0x52, 0x6D, 0xE6, + 0xB7, 0xC7, 0x7A, 0x62, 0x01, 0x25, 0x3D, 0x54, 0x54, 0xB4, 0xF2, 0xBA, 0xF9, 0xEE, 0xE3, 0x59, + 0xD0, 0x74, 0xB5, 0xBF, 0xDF, 0x3E, 0x3F, 0x87, 0x64, 0x82, 0xD9, 0xD5, 0xF9, 0xE8, 0xBB, 0xC5, + 0xA5, 0x61, 0x91, 0x9C, 0x2C, 0x99, 0xC0, 0x39, 0xB3, 0xEF, 0x33, 0x5E, 0x3E, 0x1E, 0x00, 0xC6, + 0x5A, 0x90, 0x1C, 0x50, 0x43, 0x3D, 0x4B, 0xA1, 0x3F, 0x46, 0xEB, 0xBA, 0x86, 0xA4, 0xEA, 0xE1, + 0xA9, 0x40, 0x97, 0x5A, 0x80, 0x97, 0x36, 0x1C, 0xA8, 0x19, 0x4E, 0x0D, 0xF8, 0xCB, 0x1C, 0xC7, + 0xD4, 0x1C, 0xB1, 0x4C, 0x2E, 0xDB, 0x2D, 0x96, 0x1E, 0xBA, 0xEB, 0x3D, 0xDE, 0x7D, 0xC7, 0x2E, + 0xF8, 0x36, 0x54, 0x5C, 0x94, 0xD0, 0x5A, 0x0E, 0x5D, 0xF6, 0x4D, 0x35, 0xD2, 0xC1, 0x52, 0xC7, + 0x3B, 0x58, 0x43, 0xEB, 0xB6, 0x54, 0xBA, 0xA5, 0xF1, 0x86, 0xDB, 0x23, 0xAB, 0x6A, 0x42, 0x00, + 0x90, 0xD2, 0x0C, 0x76, 0x32, 0xA0, 0xC2, 0xE3, 0x10, 0x0E, 0x0C, 0x8A, 0x7C, 0xA5, 0x5F, 0xC9, + 0x4E, 0x79, 0x6E, 0x38, 0x0D, 0xA1, 0xD8, 0x7E, 0x90, 0xDD, 0xA4, 0x35, 0x33, 0xBF, 0xCE, 0x69, + 0x8F, 0x93, 0xBC, 0xB4, 0xC8, 0xD2, 0xD1, 0xD8, 0x2F, 0x31, 0xF8, 0x0B, 0x12, 0x8B, 0xA2, 0xAA, + 0x7B, 0x36, 0x5F, 0x66, 0x0D, 0xF6, 0x34, 0x0F, 0xA7, 0x6A, 0xF3, 0x52, 0x4A, 0xB3, 0xCE, 0x83, + 0xB5, 0x57, 0x11, 0x74, 0xBF, 0x1D, 0x5E, 0xA4, 0x18, 0x84, 0xC6, 0xE4, 0xAC, 0x42, 0x93, 0x82, + 0x99, 0xF1, 0x4B, 0xE2, 0x07, 0x0E, 0x0C, 0xAD, 0xC4, 0x7E, 0x24, 0xC7, 0xF9, 0x22, 0x34, 0x31, + 0x0B, 0xC9, 0xBF, 0xA8, 0x74, 0xE9, 0xDE, 0xE8, 0x61, 0xDC, 0xC2, 0x49, 0x95, 0x78, 0x6F, 0x2D, + 0x46, 0x76, 0xD8, 0x2F, 0xA9, 0x56, 0x00, 0x38, 0x74, 0x54, 0xBB, 0x66, 0xE5, 0x9B, 0xA1, 0xAB, + 0xE4, 0x1E, 0x46, 0x71, 0x90, 0xC1, 0xF8, 0x16, 0x8A, 0x8F, 0x76, 0xE6, 0x4F, 0x06, 0xE8, 0xE8, + 0xAA, 0x25, 0xF2, 0x75, 0x3A, 0x0D, 0xBD, 0xF6, 0x40, 0xEE, 0x64, 0xE0, 0xF4, 0xD5, 0xBB, 0x76, + 0x7A, 0x8B, 0x43, 0xD8, 0x75, 0xD3, 0xAF, 0x1A, 0xE7, 0x59, 0x5E, 0x8E, 0xC8, 0xE4, 0xD9, 0x7C, + 0x3E, 0x02, 0x4D, 0xBE, 0x00, 0xD9, 0x6F, 0x46, 0xF1, 0x4A, 0x5B, 0x33, 0x97, 0x6E, 0x54, 0x5A, + 0x3A, 0x41, 0x6F, 0xC0, 0xB7, 0x3E, 0x78, 0xE5, 0xCF, 0x75, 0x1C, 0xEE, 0xD8, 0xA1, 0xEE, 0xD0, + 0x37, 0x94, 0xFE, 0x63, 0x1B, 0x2F, 0x63, 0x7A, 0xFE, 0x22, 0xCD, 0x32, 0xE1, 0xB6, 0xF8, 0x21, + 0x33, 0xDA, 0xCE, 0xB4, 0x91, 0x25, 0x21, 0x67, 0xA2, 0x6D, 0x5D, 0x49, 0xBD, 0x77, 0x92, 0x60, + 0xA3, 0x56, 0xBF, 0x1E, 0x1B, 0xF8, 0xE9, 0x40, 0xC5, 0xBF, 0x06, 0xFC, 0x14, 0xBC, 0xBC, 0x62, + 0xC0, 0xCB, 0x8D, 0x67, 0x7E, 0xDD, 0xB9, 0xCE, 0x66, 0xE2, 0x52, 0xC1, 0x21, 0x68, 0x93, 0xB4, + 0x6F, 0xFC, 0x81, 0x1F, 0x41, 0xD7, 0x7F, 0x10, 0xCF, 0x35, 0x9B, 0x72, 0xC6, 0xBC, 0x05, 0x5D, + 0x7D, 0x63, 0x09, 0xB4, 0xA8, 0x62, 0xAA, 0x42, 0x51, 0xC1, 0xC0, 0xF0, 0x2D, 0xE2, 0xBE, 0x6D, + 0x54, 0x53, 0x55, 0x7B, 0x39, 0x0A, 0xB0, 0x2A, 0xE0, 0x45, 0x0A, 0xEF, 0xD7, 0x7E, 0xB9, 0xAF, + 0xB9, 0xDA, 0x22, 0x5D, 0x65, 0xD5, 0x39, 0x0F, 0xE4, 0x2B, 0x8E, 0xAA, 0x79, 0xC9, 0xFB, 0xF0, + 0x00, 0x51, 0xE6, 0x59, 0x3F, 0x12, 0x54, 0x4A, 0x29, 0x23, 0xD3, 0x6A, 0x9F, 0xB9, 0x0D, 0x99, + 0x1E, 0x8A, 0xF6, 0x55, 0xD3, 0xDC, 0x8A, 0x48, 0xC3, 0xE5, 0x16, 0xDA, 0xFF, 0xB0, 0x3B, 0x92, + 0x49, 0xD6, 0x00, 0xB1, 0x13, 0x8E, 0xC2, 0x3F, 0x7C, 0xF9, 0x48, 0x55, 0xD5, 0xAC, 0xEA, 0x8A, + 0xC1, 0x5C, 0xA9, 0x48, 0xEA, 0x71, 0xDA, 0x99, 0xE9, 0x49, 0xBA, 0xD8, 0x1F, 0xF2, 0xB2, 0x51, + 0x5D, 0x13, 0xC7, 0x6A, 0x82, 0x8E, 0x64, 0x3A, 0x11, 0x56, 0x66, 0x24, 0x2D, 0xC1, 0x7D, 0x3A, + 0xB2, 0x45, 0xB6, 0xAE, 0x10, 0x8F, 0xBD, 0xD6, 0x9F, 0xAB, 0x44, 0xA7, 0x4A, 0x5D, 0x92, 0x7D, + 0x8F, 0xE5, 0x59, 0x4A, 0x10, 0x85, 0xFD, 0x3C, 0x40, 0x3B, 0xBF, 0xDF, 0xA7, 0x3A, 0x1D, 0xB5, + 0x67, 0x23, 0xF9, 0xAC, 0x59, 0x31, 0x2F, 0xD9, 0xD6, 0xF5, 0xEA, 0xD1, 0xDE, 0xAE, 0xFA, 0x44, + 0xFD, 0xE0, 0xBE, 0xE3, 0xF7, 0xEA, 0xD5, 0xF0, 0x26, 0x41, 0xE5, 0x3D, 0xBE, 0xAA, 0xFC, 0x57, + 0x49, 0xAE, 0x3E, 0x70, 0x8F, 0x9D, 0xF1, 0xB6, 0x32, 0x7D, 0xE7, 0x21, 0x4A, 0x7E, 0x99, 0xD7, + 0x90, 0xFE, 0xC5, 0xB2, 0xE8, 0xAC, 0x6D, 0xF7, 0x3C, 0xD3, 0x1E, 0x61, 0xF4, 0xFF, 0x8C, 0x13, + 0x5A, 0x7F, 0x87, 0x66, 0x47, 0x84, 0xF8, 0x3B, 0x0B, 0x70, 0xCF, 0xBA, 0x0C, 0x87, 0x93, 0x62, + 0x65, 0x1E, 0x47, 0xFC, 0x96, 0x25, 0x46, 0x01, 0xE0, 0xCE, 0xE2, 0x41, 0xC6, 0x38, 0x90, 0x0D, + 0xE3, 0xC7, 0x60, 0x4E, 0x08, 0x0F, 0x02, 0xF5, 0xB8, 0x70, 0x27, 0x89, 0x29, 0x6E, 0x79, 0x85, + 0x12, 0xA4, 0xCA, 0x6C, 0x69, 0xBE, 0x52, 0xFF, 0xBD, 0xCF, 0x3E, 0x07, 0xA8, 0x7B, 0x00, 0x44, + 0xE0, 0x3B, 0xA6, 0x50, 0xFF, 0xF9, 0xDA, 0x0D, 0xEB, 0xCC, 0x70, 0x21, 0x20, 0x5F, 0xF4, 0xAF, + 0x1B, 0x2C, 0xF8, 0x63, 0x9C, 0xB9, 0x8F, 0x0B, 0xBF, 0x1C, 0xA5, 0x85, 0xA6, 0x9A, 0x0A, 0x93, + 0x1E, 0x8B, 0xA3, 0x80, 0x63, 0x30, 0x24, 0xE1, 0xF0, 0xB6, 0x7B, 0x93, 0xC5, 0x72, 0xE9, 0x49, + 0x91, 0x1D, 0xB0, 0x77, 0xC0, 0xA2, 0x1D, 0xC9, 0x66, 0x90, 0xF7, 0x58, 0x92, 0x87, 0x4F, 0xB0, + 0x0D, 0x0A, 0x48, 0x16, 0x5F, 0x7D, 0xF4, 0xA6, 0xC9, 0x80, 0xD2, 0x38, 0xD6, 0xC7, 0xEE, 0x73, + 0xA6, 0xA8, 0x57, 0xC9, 0xAA, 0x32, 0x6A, 0x3C, 0xA7, 0x9F, 0x89, 0x79, 0x8B, 0xD9, 0x6B, 0x8C, + 0xB1, 0x26, 0x5D, 0x4B, 0xE9, 0xF0, 0x9D, 0xFA, 0xC0, 0xD3, 0xEA, 0x82, 0xDA, 0x7C, 0xCB, 0x43, + 0x90, 0x74, 0x24, 0xC6, 0xBD, 0x5B, 0x87, 0x29, 0xCA, 0xEC, 0x6E, 0xBA, 0x7C, 0x41, 0xF9, 0x99, + 0x0A, 0x92, 0xFA, 0x43, 0xAE, 0xE7, 0xF9, 0xFB, 0x55, 0x5B, 0x3A, 0xCC, 0x1C, 0xC5, 0x20, 0x37, + 0x53, 0x4A, 0x83, 0xC6, 0x79, 0x5A, 0x42, 0xF9, 0x23, 0x62, 0xA1, 0x3A, 0x42, 0xCE, 0x51, 0xC5, + 0x5D, 0xC9, 0x99, 0x1F, 0x82, 0xE7, 0x43, 0x72, 0x46, 0x70, 0x80, 0x25, 0x65, 0x98, 0x78, 0xC2, + 0xF9, 0xD4, 0x07, 0x2D, 0xAB, 0x79, 0x7D, 0x45, 0xC3, 0x0B, 0xEE, 0x18, 0xBB, 0x3C, 0x33, 0xE5, + 0x8B, 0xE5, 0x2A, 0x04, 0x53, 0x7C, 0x92, 0x92, 0x3E, 0x77, 0xE6, 0xB5, 0x8A, 0x7C, 0xAC, 0x3F, + 0xEA, 0xFC, 0x19, 0x64, 0xFD, 0xB4, 0xA3, 0x33, 0xCC, 0xBB, 0xE3, 0x5F, 0xBA, 0xAB, 0x9F, 0x2A, + 0x4E, 0x71, 0x96, 0x4D, 0x8D, 0x33, 0x39, 0x02, 0x0F, 0x6B, 0xFB, 0xC7, 0x76, 0x0D, 0xC4, 0x9D, + 0xB0, 0x6C, 0xA3, 0x91, 0x32, 0x23, 0x60, 0xF9, 0x53, 0x3C, 0x48, 0xCF, 0x54, 0x4A, 0x34, 0x6A, + 0x90, 0xB8, 0xDB, 0xB6, 0xFD, 0xD8, 0xB9, 0x79, 0xF1, 0x5D, 0x64, 0xFC, 0x2C, 0x6E, 0xA2, 0xD2, + 0x4D, 0x37, 0x56, 0xCB, 0x8D, 0xE9, 0xC9, 0x02, 0x3A, 0x7F, 0x53, 0x75, 0x98, 0x46, 0xF9, 0x8E, + 0xE2, 0x00, 0x05, 0x20, 0x8E, 0xAD, 0xAA, 0x38, 0x5F, 0x6A, 0x34, 0x16, 0x2E, 0x25, 0xFF, 0x7F, + 0xE2, 0x10, 0x2D, 0x49, 0x2C, 0xEF, 0xB5, 0xE5, 0x8A, 0x2A, 0x1F, 0x6F, 0x6C, 0x49, 0xF7, 0x78, + 0x80, 0xCA, 0xFA, 0x14, 0x5D, 0xAE, 0xA9, 0xCD, 0xC5, 0xB8, 0xA8, 0xDC, 0xFF, 0x84, 0xC5, 0x80, + 0x8E, 0x98, 0x5F, 0x7E, 0xF6, 0x26, 0xBB, 0x35, 0xF7, 0xA7, 0x40, 0x46, 0x83, 0x26, 0xDF, 0x3B, + 0x64, 0xE0, 0x67, 0x7A, 0xBE, 0x08, 0xF4, 0xE6, 0x1A, 0xF8, 0xFD, 0xBA, 0x0E, 0xBE, 0xB2, 0x28, + 0x6C, 0x45, 0xEA, 0xB1, 0x6C, 0xA8, 0x8E, 0x4F, 0xB8, 0xBC, 0x82, 0x0A, 0xD1, 0x84, 0xAB, 0x03, + 0x6C, 0x30, 0x85, 0xA1, 0x2C, 0x72, 0xA3, 0x08, 0x25, 0x4C, 0x97, 0x32, 0xEB, 0xAD, 0x0E, 0x3E, + 0xE8, 0x8E, 0x2B, 0xF0, 0xCF, 0x13, 0xCA, 0xD1, 0x53, 0xC6, 0xCD, 0x58, 0x98, 0xDE, 0xB0, 0x7E, + 0x0D, 0xBF, 0x94, 0x3E, 0xA7, 0x1C, 0x84, 0xBC, 0xB3, 0x9B, 0x6D, 0x54, 0x32, 0x39, 0x89, 0xF8, + 0x02, 0xAF, 0xBC, 0xB2, 0x53, 0x3B, 0x43, 0xF2, 0xCC, 0xC9, 0x05, 0xF2, 0xC4, 0x88, 0x37, 0x6E, + 0xE1, 0xA1, 0x55, 0x82, 0x7E, 0xBE, 0x83, 0xE0, 0x0B, 0xF8, 0x96, 0x45, 0x61, 0xC1, 0x96, 0x28, + 0x6D, 0x64, 0xCF, 0xF9, 0xC1, 0xC7, 0x3A, 0x18, 0xF3, 0x9A, 0x69, 0x2B, 0x07, 0x57, 0x55, 0xE8, + 0x09, 0xCB, 0x33, 0xC5, 0x4F, 0xBF, 0x0F, 0x9A, 0x22, 0xB1, 0xB3, 0x50, 0x15, 0xA3, 0xCB, 0x8D, + 0x6E, 0x29, 0x56, 0x89, 0x64, 0xAF, 0x5B, 0x0D, 0xD4, 0xE2, 0x6F, 0x6A, 0x38, 0xBD, 0xD8, 0xA1, + 0x7D, 0x0A, 0x6F, 0x7B, 0x07, 0x89, 0x5B, 0xD2, 0xFB, 0x34, 0x5F, 0xA9, 0x0F, 0x41, 0x18, 0xD3, + 0x99, 0xFD, 0xA8, 0x88, 0xFD, 0x4B, 0x9B, 0xCA, 0xAE, 0x5A, 0xB0, 0xEE, 0x23, 0x0F, 0x4B, 0x5C, + 0x99, 0xEA, 0x29, 0xF3, 0xF6, 0x97, 0x5F, 0xF9, 0xAF, 0x28, 0x4F, 0xEC, 0xD6, 0x01, 0x69, 0x8B, + 0x65, 0x08, 0x55, 0xCA, 0x05, 0xC0, 0xB4, 0xB2, 0x64, 0x2A, 0xF5, 0x3E, 0xDA, 0xA2, 0xD2, 0xBB, + 0xDF, 0x17, 0xFF, 0xCF, 0x9E, 0xDE, 0x8A, 0x1E, 0x5F, 0xFD, 0xEA, 0x12, 0x0F, 0xFF, 0x96, 0x20, + 0x0A, 0x15, 0xE6, 0x9B, 0x4F, 0x12, 0x0B, 0xCC, 0x39, 0x4D, 0xFD, 0xD4, 0x7A, 0xDA, 0x24, 0x11, + 0x2D, 0x93, 0x92, 0x9F, 0x3E, 0x3F, 0xA2, 0x9B, 0xAD, 0x98, 0x13, 0xE2, 0x5F, 0xF2, 0x7E, 0x84, + 0xA1, 0x43, 0xAB, 0x76, 0xB8, 0xFC, 0xA0, 0x01, 0x17, 0x38, 0xB3, 0x33, 0x13, 0x4A, 0xF5, 0x15, + 0xA5, 0x56, 0x66, 0xC5, 0x44, 0x0C, 0x88, 0x75, 0x76, 0xA5, 0x7E, 0x57, 0xD4, 0x22, 0xE5, 0x32, + 0x99, 0x60, 0x99, 0x7C, 0x65, 0x29, 0xBA, 0xB0, 0x5B, 0x1F, 0x84, 0x98, 0x0C, 0x06, 0x8A, 0xAE, + 0x96, 0x63, 0x91, 0xB1, 0x75, 0xE6, 0xE6, 0x7A, 0xBF, 0x1E, 0xB5, 0xB6, 0x76, 0x1B, 0xE2, 0xBF, + 0xB4, 0x1F, 0x4D, 0x33, 0xF9, 0x9D, 0x9C, 0x79, 0xE6, 0xF5, 0xA3, 0x8C, 0x72, 0xFE, 0xAE, 0xB1, + 0x13, 0x09, 0x20, 0x91, 0x7C, 0x11, 0x99, 0x68, 0x1A, 0xA7, 0x6B, 0x3F, 0x88, 0xC7, 0xF5, 0x94, + 0x0D, 0xBC, 0x3B, 0xA5, 0x14, 0xD7, 0x8B, 0xA0, 0xA0, 0x70, 0xB4, 0xC2, 0x4E, 0x2F, 0xA8, 0xB1, + 0x0D, 0x7B, 0x8C, 0xD4, 0x96, 0xC1, 0xD1, 0xC5, 0x13, 0x67, 0x24, 0x16, 0x3C, 0xC0, 0xFD, 0x79, + 0x3C, 0x11, 0x69, 0x03, 0xF6, 0x55, 0xF7, 0xF2, 0x09, 0x8B, 0x49, 0x5B, 0xDA, 0x05, 0x3C, 0xDB, + 0x1C, 0x01, 0x1F, 0xDC, 0x4D, 0xE2, 0x09, 0xB6, 0x1F, 0x5F, 0xE2, 0xB0, 0xDF, 0x77, 0xF8, 0x83, + 0x59, 0xCF, 0xEE, 0x8B, 0x14, 0x12, 0xEB, 0xBC, 0x9B, 0xB4, 0x38, 0xFD, 0x38, 0x53, 0xC9, 0xA1, + 0x4E, 0xF6, 0x80, 0xA8, 0xE5, 0x25, 0x89, 0x97, 0xCF, 0x94, 0x06, 0xE4, 0x25, 0xDF, 0x86, 0x46, + 0xA2, 0x54, 0xA7, 0x04, 0xB5, 0xCA, 0x67, 0xF1, 0x95, 0x65, 0x57, 0xE1, 0x38, 0x61, 0xCB, 0x20, + 0xE5, 0x98, 0xF4, 0x07, 0x95, 0x25, 0xBD, 0xBE, 0x9F, 0x87, 0x76, 0x4D, 0x52, 0x96, 0xAE, 0x82, + 0xAE, 0x2C, 0x3C, 0xB6, 0x7C, 0x1A, 0x36, 0xE5, 0x34, 0x13, 0x1B, 0x72, 0x52, 0x8F, 0xFF, 0xE7, + 0x6B, 0x83, 0xDB, 0x88, 0x4A, 0xDB, 0x95, 0x37, 0xFA, 0x9D, 0xA2, 0x49, 0xDB, 0x5A, 0xE3, 0x5C, + 0x95, 0xC7, 0xF8, 0xE0, 0x14, 0x38, 0xB2, 0xCD, 0x09, 0xF4, 0x2A, 0x2A, 0xF7, 0x1A, 0xA1, 0x8E, + 0xB8, 0xBC, 0x3B, 0x51, 0x9A, 0xE4, 0xD1, 0xCF, 0xA7, 0xD1, 0xF9, 0x63, 0x0F, 0x98, 0x3D, 0x61, + 0x51, 0xEC, 0x1B, 0x67, 0x68, 0x88, 0x25, 0x65, 0x0B, 0xA6, 0x32, 0xA2, 0xCD, 0x93, 0xE1, 0x16, + 0x01, 0x12, 0xB2, 0xDA, 0x35, 0xBA, 0x52, 0x66, 0x46, 0x44, 0x8D, 0xB3, 0x19, 0x33, 0xC1, 0x1F, + 0x47, 0x6C, 0x48, 0x7B, 0x5C, 0x8C, 0xA8, 0x68, 0x74, 0xDE, 0x7C, 0xB4, 0xDF, 0x05, 0x54, 0x35, + 0x8A, 0xFE, 0x78, 0xB5, 0x05, 0x78, 0xC3, 0xB4, 0x85, 0x12, 0x88, 0xBB, 0x49, 0x17, 0x46, 0x5D, + 0x7D, 0x1F, 0xF4, 0xB5, 0xD9, 0xEF, 0x62, 0xBA, 0xC4, 0x86, 0x61, 0x0B, 0xE0, 0xC5, 0xEE, 0x69, + 0xEC, 0xF9, 0x52, 0x93, 0x3F, 0xC7, 0x69, 0xE4, 0xD2, 0x9C, 0xE0, 0xEB, 0xB5, 0x5A, 0x55, 0xCE, + 0x87, 0xA3, 0x1C, 0x52, 0x2E, 0xC5, 0x99, 0x92, 0x7F, 0x10, 0x06, 0xC4, 0xA2, 0x5B, 0x77, 0x3D, + 0x53, 0xE8, 0xCA, 0xB5, 0x3B, 0x18, 0x58, 0x54, 0xC6, 0x63, 0xDB, 0x1D, 0xB6, 0x75, 0xD2, 0x69, + 0x64, 0x8A, 0x69, 0x0E, 0xF9, 0x57, 0x41, 0x4C, 0xC2, 0xF3, 0x59, 0x0A, 0x60, 0x76, 0x67, 0x4A, + 0xE6, 0xE8, 0x63, 0xB5, 0x0A, 0x39, 0xDE, 0x95, 0xD6, 0xFB, 0xD4, 0xEC, 0xA3, 0xBD, 0x1A, 0xB1, + 0x8F, 0x54, 0x1C, 0xD7, 0x39, 0x50, 0x8F, 0x92, 0x0D, 0x33, 0x9F, 0x49, 0x10, 0xB2, 0x73, 0x87, + 0x83, 0xF0, 0x72, 0x9D, 0xE7, 0xEA, 0x14, 0xC7, 0x5A, 0x23, 0x6F, 0x54, 0x3E, 0xB5, 0x86, 0x6D, + 0xD6, 0xE2, 0x3E, 0x97, 0x96, 0x5F, 0xF4, 0x1A, 0xFD, 0x8B, 0x96, 0x9B, 0x14, 0xD7, 0x25, 0x3A, + 0x96, 0x25, 0x7B, 0xBE, 0x32, 0x46, 0xC3, 0x20, 0x4E, 0x01, 0x98, 0x0A, 0x27, 0x53, 0x58, 0xFA, + 0xAF, 0x14, 0xE6, 0x6B, 0x99, 0x32, 0x85, 0x87, 0x8F, 0xDA, 0x09, 0x7C, 0x92, 0x9D, 0x4C, 0x87, + 0xF6, 0xB3, 0x67, 0x61, 0xA2, 0x7C, 0x25, 0x5D, 0x4E, 0xA7, 0x6F, 0xF0, 0xCB, 0x6C, 0x6A, 0xC3, + 0xE2, 0x19, 0x33, 0xBE, 0x73, 0x95, 0xE1, 0xBA, 0x39, 0x09, 0x7F, 0xAE, 0x72, 0x8A, 0x4E, 0x74, + 0xA1, 0xBF, 0x5B, 0x1D, 0x34, 0x89, 0xF0, 0x94, 0xE6, 0x84, 0x3C, 0x64, 0x29, 0x04, 0x07, 0x34, + 0xC3, 0x32, 0xEF, 0xF6, 0xE5, 0x24, 0x54, 0x09, 0xFA, 0x81, 0xDB, 0xF1, 0xCF, 0xE5, 0xDB, 0x98, + 0x27, 0xC0, 0xEB, 0xDA, 0x10, 0x73, 0x74, 0x76, 0xCA, 0xD7, 0xFE, 0xDF, 0x82, 0x63, 0x0F, 0x31, + 0x03, 0xBE, 0x10, 0xF4, 0xF6, 0x76, 0xDD, 0x27, 0xAD, 0xE4, 0xC1, 0xFA, 0xC5, 0x5A, 0x71, 0x8D, + 0x59, 0x39, 0x41, 0x6C, 0xDD, 0xFB, 0x4C, 0x5C, 0xB0, 0xB8, 0xF9, 0x67, 0x9C, 0xD7, 0x90, 0x44, + 0xE2, 0xF3, 0x39, 0x4C, 0x84, 0x1A, 0x13, 0x3F, 0xF2, 0xDF, 0x77, 0xA5, 0xF6, 0xAB, 0x69, 0x37, + 0x18, 0x56, 0x03, 0x86, 0xE9, 0xB7, 0xC8, 0xD8, 0x5A, 0xA1, 0x87, 0x00, 0xBC, 0x14, 0x44, 0xFF, + 0x21, 0xDD, 0xAC, 0x99, 0xD2, 0x78, 0xDF, 0x0C, 0xF3, 0xAC, 0x5F, 0xF4, 0x56, 0xE4, 0xAB, 0xCF, + 0x5F, 0x1C, 0x60, 0x7E, 0xFA, 0xDA, 0x36, 0x8A, 0xF2, 0xD4, 0x80, 0x64, 0xC5, 0x54, 0x53, 0xCA, + 0xF3, 0x80, 0x9A, 0x3C, 0x7C, 0x7B, 0x32, 0x30, 0x14, 0xB7, 0x17, 0x9B, 0x42, 0x7C, 0x94, 0x0D, + 0xC4, 0x43, 0x5B, 0xB0, 0x86, 0xE9, 0x1F, 0x80, 0xCD, 0x45, 0x97, 0x3D, 0x8A, 0xD0, 0x22, 0x91, + 0xA0, 0x14, 0xA5, 0xD7, 0x71, 0x07, 0x8D, 0xAB, 0x69, 0xE8, 0x38, 0x98, 0xEE, 0x70, 0x3D, 0x7B, + 0x86, 0x13, 0xDE, 0xAF, 0xE5, 0x89, 0x5A, 0x5F, 0x1F, 0xF9, 0xA5, 0x3F, 0xED, 0x62, 0xE6, 0x65, + 0x3B, 0x86, 0xF9, 0x76, 0xD6, 0x5A, 0x57, 0x54, 0x8B, 0x0D, 0x39, 0xEC, 0x9F, 0x00, 0xBF, 0x4E, + 0xF8, 0x62, 0x51, 0x83, 0x74, 0x16, 0x00, 0x3A, 0x4F, 0x71, 0x18, 0x73, 0xF0, 0x41, 0x71, 0xB4, + 0xDC, 0x79, 0xFC, 0x32, 0xDB, 0x38, 0x0C, 0x3F, 0x1B, 0x66, 0xA4, 0x27, 0xED, 0xA7, 0xE2, 0xE6, + 0xB0, 0x51, 0xF6, 0xBD, 0xEF, 0x2E, 0x0E, 0x10, 0x8F, 0x1D, 0x40, 0xDF, 0x85, 0x67, 0xC7, 0x25, + 0x11, 0x7F, 0x50, 0x99, 0xC8, 0xAE, 0xDF, 0x6A, 0xAF, 0x70, 0x8C, 0xD4, 0xB5, 0x6A, 0xA5, 0x21, + 0x1C, 0xBF, 0x0C, 0x75, 0xA2, 0x40, 0x03, 0x17, 0x58, 0x8C, 0x84, 0x4D, 0x82, 0x29, 0xE5, 0x7C, + 0x05, 0xA1, 0xAF, 0x48, 0x07, 0xD1, 0xF7, 0x53, 0xBC, 0x02, 0xF7, 0xCD, 0x60, 0x35, 0xEE, 0x04, + 0x03, 0xE1, 0x3A, 0xAA, 0x71, 0x54, 0x5B, 0xDD, 0x86, 0x68, 0xFB, 0xC6, 0xBC, 0xCF, 0xCD, 0x55, + 0xBC, 0x0E, 0x0D, 0x8D, 0x7B, 0x70, 0x1F, 0xE4, 0xEC, 0x2C, 0x91, 0x22, 0xF6, 0x55, 0xC9, 0x07, + 0x0F, 0x26, 0x60, 0x4F, 0xB0, 0x27, 0xFA, 0xAB, 0xBF, 0x3B, 0xF1, 0x3F, 0x52, 0xB8, 0xC7, 0x7B, + 0x52, 0xBF, 0x6E, 0xA4, 0x87, 0xCD, 0x40, 0x62, 0x4D, 0xDA, 0xD1, 0x37, 0x77, 0x44, 0xB3, 0x1D, + 0xD6, 0x2F, 0x9A, 0xA8, 0x61, 0x54, 0x6A, 0x1E, 0x2E, 0xE2, 0xC0, 0xBF, 0x7D, 0xAD, 0xB9, 0xDB, + 0x52, 0x5C, 0x0F, 0x15, 0x7F, 0x40, 0x8B, 0xC3, 0x4E, 0xC5, 0xC3, 0x59, 0x5A, 0x19, 0x3F, 0xA1, + 0xB3, 0x58, 0x3A, 0xC2, 0x06, 0x5B, 0x16, 0xF8, 0xEA, 0xFA, 0xB6, 0x8D, 0x93, 0xFF, 0xC4, 0x96, + 0x2C, 0x9F, 0xD0, 0xAB, 0x5A, 0x2B, 0x81, 0x17, 0xA9, 0x71, 0x38, 0x0F, 0x01, 0xEF, 0x5A, 0xC0, + 0xE9, 0x9F, 0x8B, 0x63, 0x47, 0x89, 0x50, 0xC2, 0xFB, 0x8A, 0x8B, 0x9F, 0xEE, 0xC4, 0xC4, 0x7A, + 0xDC, 0xAD, 0xC3, 0x6A, 0x70, 0xA4, 0x71, 0x53, 0xFD, 0xA9, 0x0D, 0xC0, 0x62, 0x23, 0xB8, 0x9D, + 0xAE, 0xA2, 0x12, 0x0B, 0x18, 0x42, 0xB6, 0x93, 0x2A, 0x85, 0x60, 0x09, 0x59, 0x69, 0x52, 0x1F, + 0x1E, 0xBA, 0xBF, 0x0F, 0xA6, 0x8E, 0xB0, 0x8A, 0x03, 0xCA, 0xC5, 0x1C, 0x8E, 0x89, 0xF2, 0x50, + 0xD7, 0x1A, 0xA9, 0x63, 0x83, 0x0F, 0x6D, 0x06, 0x27, 0x1F, 0x40, 0xDA, 0x0B, 0x9E, 0xEB, 0x1F, + 0x7E, 0x4F, 0x8A, 0xF0, 0x38, 0x86, 0x08, 0xC6, 0x3A, 0xFF, 0x29, 0xCC, 0xA7, 0x10, 0x27, 0xF3, + 0x99, 0x3E, 0x52, 0xF3, 0x0F, 0x83, 0x93, 0x9F, 0x63, 0xE8, 0x23, 0x41, 0x71, 0x98, 0x25, 0x1B, + 0xC9, 0x89, 0x15, 0x8F, 0xC8, 0x72, 0x35, 0x72, 0x7D, 0xF2, 0x36, 0x31, 0x64, 0xF5, 0x3A, 0x4C, + 0x15, 0x9B, 0x30, 0x77, 0x36, 0x03, 0xB9, 0xEE, 0xCA, 0x61, 0x22, 0x7C, 0xCF, 0xEE, 0x6C, 0xE4, + 0xEC, 0x83, 0x67, 0x10, 0x07, 0x7A, 0x21, 0x97, 0xDF, 0xC3, 0x2A, 0x27, 0x47, 0xDB, 0x1A, 0x76, + 0x2D, 0xA5, 0x9D, 0xD7, 0x39, 0x54, 0x4F, 0x62, 0x9C, 0xFD, 0x77, 0x0E, 0xB0, 0x4A, 0x0A, 0xD9, + 0x46, 0xC2, 0x28, 0x49, 0xB0, 0x53, 0x99, 0x2A, 0xC2, 0x81, 0xF9, 0x8A, 0xE1, 0x01, 0xDA, 0xCC, + 0x31, 0x60, 0x9B, 0x32, 0x4B, 0x69, 0x2B, 0x89, 0x00, 0xDA, 0xCD, 0x41, 0x0B, 0x13, 0xC0, 0x3C, + 0x4A, 0xD0, 0x32, 0x0A, 0x45, 0x31, 0x54, 0x38, 0x9E, 0x74, 0x56, 0x60, 0x8A, 0xFA, 0x0C, 0x0C, + 0xC8, 0xDC, 0x4E, 0x12, 0x9A, 0xD0, 0x2B, 0xAC, 0xF3, 0x16, 0xD3, 0xE4, 0x5C, 0xA8, 0x3B, 0x8A, + 0x8E, 0x04, 0x4B, 0x09, 0xDE, 0x91, 0x1C, 0xF2, 0x3D, 0xB5, 0x27, 0x23, 0x9A, 0x5F, 0xCA, 0xCE, + 0x1D, 0x81, 0x25, 0xD3, 0x0B, 0x07, 0x3B, 0xA2, 0xED, 0xC1, 0x68, 0xA3, 0x10, 0x1E, 0x49, 0xED, + 0x2B, 0x02, 0xD4, 0x65, 0x6B, 0xDE, 0xF7, 0xE8, 0x3D, 0xC3, 0x41, 0x1E, 0x75, 0xDB, 0xD0, 0xE4, + 0xA7, 0xFF, 0xFC, 0xB3, 0x0D, 0xAE, 0x72, 0x6D, 0xF2, 0x16, 0xF9, 0x4C, 0x9B, 0x2C, 0x83, 0x55, + 0x53, 0x32, 0xB1, 0x4E, 0xE7, 0x7E, 0x7F, 0xF6, 0xBE, 0xE4, 0x7A, 0xF3, 0xDB, 0x73, 0xA5, 0xDC, + 0xB3, 0x1F, 0x1B, 0x9E, 0x93, 0x58, 0x58, 0x4C, 0xDB, 0xED, 0x8C, 0x02, 0xB7, 0x43, 0x10, 0x7F, + 0x32, 0xF0, 0xFC, 0xD2, 0xDA, 0x18, 0xA6, 0x74, 0x80, 0x12, 0x9C, 0xBB, 0xB9, 0xA9, 0x03, 0x76, + 0xC9, 0x4E, 0xE0, 0xE3, 0x63, 0x96, 0xC8, 0x32, 0x04, 0x06, 0x15, 0x52, 0xD1, 0xB6, 0x03, 0x1B, + 0x5D, 0xF2, 0x40, 0x43, 0x37, 0xCF, 0x7C, 0xF5, 0xC4, 0xAB, 0x8B, 0x83, 0x63, 0x5D, 0xE3, 0x3B, + 0x3B, 0x66, 0xE6, 0x19, 0xEF, 0x51, 0x6B, 0x60, 0x6F, 0x3E, 0x71, 0x3D, 0x8E, 0x5A, 0x77, 0xD2, + 0x57, 0x9A, 0x06, 0xE9, 0xBB, 0x8A, 0x50, 0x58, 0x90, 0xF1, 0x17, 0xD7, 0x18, 0x9C, 0x24, 0x65, + 0x3D, 0x40, 0xA5, 0xA1, 0xD8, 0x24, 0x4B, 0xAA, 0x8A, 0x47, 0x3F, 0x0D, 0xB6, 0x60, 0xE6, 0x75, + 0xCD, 0x45, 0x6D, 0x54, 0xD9, 0x67, 0x65, 0xE0, 0x04, 0xCC, 0xBE, 0xCC, 0xAA, 0x8E, 0x3D, 0xB9, + 0x1E, 0x03, 0x25, 0x25, 0x31, 0x88, 0x36, 0xF6, 0x52, 0xD7, 0x4E, 0x75, 0xB5, 0xEA, 0x05, 0x83, + 0x59, 0xAD, 0xAF, 0xF4, 0x13, 0xCE, 0x5D, 0xF4, 0x52, 0x98, 0xBC, 0x63, 0xFE, 0xB0, 0xC5, 0x55, + 0xBD, 0x5A, 0x65, 0x3E, 0xAF, 0x24, 0x4C, 0x5E, 0xEA, 0x9A, 0x44, 0x32, 0x0E, 0x39, 0xCA, 0x60, + 0xB2, 0xBF, 0x62, 0x40, 0x19, 0x57, 0xDE, 0x7C, 0x70, 0xD7, 0xC3, 0x0E, 0x9A, 0x98, 0x6F, 0x26, + 0x22, 0x45, 0xC4, 0xD1, 0x8E, 0x6B, 0xC9, 0x3F, 0x1E, 0x71, 0x4F, 0x2E, 0x86, 0x42, 0x73, 0x00, + 0xEB, 0x98, 0x22, 0x03, 0x1F, 0x6F, 0xC3, 0xAF, 0xD0, 0x55, 0x8F, 0x95, 0x6F, 0x8E, 0x4B, 0xF0, + 0x21, 0x1D, 0xA7, 0xB1, 0xE8, 0x6B, 0xC7, 0x8A, 0xAD, 0x69, 0xD7, 0x6A, 0x7F, 0x09, 0x3A, 0x9F, + 0xBF, 0x30, 0x27, 0x18, 0x00, 0x11, 0xF2, 0x96, 0xAB, 0x57, 0xD3, 0x67, 0x5D, 0x2A, 0x36, 0xCF, + 0xE2, 0x05, 0xBB, 0x01, 0x83, 0x0B, 0xC7, 0x6D, 0xE9, 0xFD, 0x5A, 0xC8, 0x0D, 0x9C, 0xC0, 0xA2, + 0x41, 0x8D, 0x0E, 0x53, 0xB2, 0xD2, 0x2B, 0xD8, 0xE5, 0x4C, 0xEE, 0x81, 0x52, 0xED, 0xE8, 0xEA, + 0xF1, 0xF3, 0x2A, 0x5D, 0xEC, 0x2D, 0x0E, 0xFD, 0x76, 0x26, 0x4C, 0x25, 0x78, 0x26, 0x6F, 0x2F, + 0xF7, 0x31, 0xAB, 0xC0, 0x6C, 0x80, 0x1F, 0x2B, 0x8B, 0x1E, 0xC1, 0x09, 0x46, 0x5E, 0x94, 0x19, + 0xED, 0x07, 0x94, 0xEC, 0xCF, 0x3B, 0xC6, 0x51, 0x29, 0xC2, 0x87, 0xD4, 0x55, 0xD0, 0xAD, 0x82, + 0x66, 0x27, 0x61, 0x18, 0xDD, 0xB8, 0xBD, 0xF9, 0xE1, 0xCA, 0xAA, 0xBA, 0x49, 0x39, 0xD6, 0x43, + 0xA9, 0x10, 0x12, 0x7C, 0xA6, 0x82, 0xD8, 0xDB, 0x11, 0x76, 0x9D, 0xF0, 0x92, 0xFB, 0x31, 0xC1, + 0x9C, 0x31, 0x78, 0x1C, 0x11, 0xD6, 0xF3, 0x1F, 0x14, 0x39, 0xC6, 0x33, 0x46, 0x58, 0x8C, 0xE9, + 0x2B, 0x87, 0x94, 0xA6, 0xFA, 0x55, 0x5A, 0x3C, 0x39, 0x60, 0xD0, 0x26, 0x0F, 0xB3, 0x56, 0x18, + 0x77, 0x9C, 0x1B, 0x01, 0xBA, 0xE6, 0xB2, 0x1E, 0x8B, 0xA0, 0x63, 0x2D, 0x7E, 0xA2, 0x30, 0xFC, + 0xDF, 0x31, 0x99, 0xB2, 0xD6, 0x1E, 0xD3, 0xAB, 0xB7, 0xFA, 0x72, 0xB0, 0x6F, 0xE5, 0x6B, 0x9F, + 0xAF, 0xB4, 0xF0, 0x53, 0x06, 0x9C, 0xB0, 0x98, 0x6B, 0xF4, 0x5A, 0x52, 0xDB, 0xD0, 0x13, 0xED, + 0x73, 0x70, 0x11, 0xBB, 0xD0, 0x98, 0x58, 0xCA, 0x29, 0x44, 0xCB, 0x7C, 0x2D, 0x43, 0xDE, 0x4F, + 0xBF, 0x13, 0x06, 0xDD, 0x3C, 0x69, 0x49, 0xD2, 0xD7, 0xA7, 0x24, 0x9E, 0x0D, 0x3C, 0x8C, 0x73, + 0x0F, 0xB2, 0x4F, 0x16, 0x83, 0x7E, 0x7B, 0x3A, 0xD4, 0x49, 0x42, 0x26, 0x9C, 0x6F, 0xAF, 0xD6, + 0x73, 0xEF, 0x29, 0x3D, 0x1A, 0x21, 0x58, 0x48, 0xF7, 0xEE, 0xD2, 0xC8, 0x06, 0x4D, 0xB2, 0x3D, + 0x1E, 0xD6, 0xF6, 0xF3, 0x25, 0xC8, 0xD5, 0xF4, 0xB6, 0x07, 0x2C, 0xB0, 0x03, 0xDE, 0x83, 0xE0, + 0x1C, 0x68, 0x2E, 0x78, 0xB6, 0xDA, 0x99, 0xA6, 0xBD, 0xE8, 0x1D, 0x47, 0x6E, 0x7A, 0x4C, 0xC5, + 0xE4, 0x54, 0xEA, 0xDB, 0xB1, 0x6F, 0x9F, 0x53, 0xA6, 0x41, 0xE2, 0x24, 0x6C, 0x9C, 0x88, 0xF7, + 0x88, 0xA8, 0x90, 0x0D, 0x34, 0x61, 0xAA, 0x7D, 0x52, 0x5F, 0x8D, 0x81, 0xBE, 0xC9, 0x3E, 0x36, + 0x8D, 0x69, 0x81, 0x0D, 0x24, 0x7D, 0xCE, 0x03, 0xB8, 0x4E, 0x9C, 0xFD, 0x5A, 0x4A, 0x45, 0xAF, + 0x45, 0xB5, 0xFF, 0x49, 0xEA, 0x6C, 0xF7, 0xB9, 0xE5, 0xC1, 0xA6, 0x57, 0xF3, 0xCA, 0xCC, 0x46, + 0xD2, 0x20, 0xB3, 0xB1, 0xC0, 0x18, 0xEE, 0x82, 0xE4, 0x00, 0x3C, 0xA7, 0x8B, 0xA6, 0x3A, 0xDA, + 0x82, 0x53, 0x3C, 0x42, 0x4C, 0x3B, 0x16, 0xD0, 0x3E, 0x0E, 0xBA, 0x36, 0xA6, 0xEA, 0x36, 0x16, + 0x80, 0xA3, 0x51, 0xFD, 0xF8, 0xFA, 0xE5, 0x75, 0x64, 0x17, 0x0C, 0xE5, 0xAE, 0xB2, 0xE5, 0x14, + 0xC1, 0xA9, 0xAE, 0x3A, 0x7E, 0x4D, 0x0E, 0x5C, 0x67, 0x31, 0x02, 0xD2, 0x4D, 0xB3, 0xD6, 0xC6, + 0xE6, 0x86, 0xC2, 0x62, 0xE6, 0xB6, 0x53, 0x2C, 0x29, 0x72, 0x90, 0x55, 0xAC, 0x1C, 0xE7, 0x7F, + 0x7F, 0xA3, 0xE8, 0x21, 0xF0, 0x2D, 0x3E, 0x8A, 0xA3, 0xA2, 0xA2, 0x29, 0xEC, 0x36, 0x4B, 0x89, + 0x1C, 0xB6, 0xC1, 0xB9, 0x4A, 0x8F, 0x65, 0xDF, 0x97, 0x29, 0x0F, 0x0B, 0xB1, 0x61, 0x24, 0xA2, + 0xD2, 0x57, 0x7A, 0x99, 0xF7, 0x1D, 0xC8, 0xB4, 0xDD, 0xEE, 0x7A, 0xBE, 0x2E, 0x46, 0x9A, 0xF6, + 0x92, 0x13, 0xAC, 0x98, 0x64, 0x4C, 0xDD, 0x6B, 0x03, 0xD3, 0xF4, 0x14, 0xC9, 0x7D, 0xCE, 0x9B, + 0xF7, 0xD4, 0x80, 0xB1, 0x2A, 0x66, 0x33, 0xA4, 0xE2, 0x45, 0x99, 0x95, 0x77, 0xE1, 0x3E, 0x8A, + 0x43, 0x85, 0xD9, 0x79, 0x69, 0x0D, 0x55, 0xCF, 0x09, 0xF4, 0xFC, 0x07, 0x39, 0x20, 0x26, 0xB4, + 0x8B, 0xD0, 0x60, 0xFB, 0x42, 0x41, 0xEF, 0x02, 0x5F, 0x0D, 0xC7, 0x7F, 0x09, 0xFA, 0x26, 0x94, + 0x7A, 0xCD, 0xDE, 0x43, 0x86, 0x44, 0xD6, 0xC6, 0xB1, 0x77, 0x13, 0xB1, 0x08, 0xC9, 0xDD, 0x99, + 0xF0, 0xED, 0x7B, 0xB0, 0xAB, 0x31, 0x6D, 0x5B, 0x66, 0xA3, 0x53, 0xE2, 0x3B, 0x0F, 0x31, 0xA2, + 0x63, 0x6E, 0x05, 0xAD, 0xC6, 0x74, 0xC5, 0x2D, 0xB3, 0x79, 0xEB, 0x66, 0xF3, 0x6B, 0x79, 0x02, + 0x7A, 0x7D, 0x49, 0x59, 0x30, 0x04, 0x29, 0xD8, 0x5E, 0xF7, 0xF3, 0x6C, 0x5E, 0xC2, 0xA6, 0xFF, + 0x1B, 0x5A, 0xFE, 0x01, 0x54, 0x40, 0xEF, 0xA0, 0xD5, 0xDB, 0x47, 0xED, 0x2A, 0x9B, 0x85, 0x12, + 0x9F, 0x74, 0x5D, 0xB7, 0xA6, 0x80, 0x22, 0x34, 0x87, 0x81, 0x7E, 0x15, 0x87, 0x62, 0x03, 0x87, + 0x62, 0x6B, 0x85, 0xF1, 0x37, 0x55, 0x55, 0x31, 0x18, 0xBD, 0xEF, 0x57, 0x1D, 0x21, 0x5E, 0x87, + 0x37, 0x53, 0x61, 0x7B, 0xA5, 0x80, 0x71, 0x2C, 0x72, 0x83, 0x64, 0x73, 0xF2, 0x4C, 0xA0, 0x3F, + 0x4C, 0x3E, 0x21, 0xF3, 0x96, 0xBB, 0x9C, 0x05, 0xE1, 0x12, 0x47, 0xA2, 0x6E, 0xF6, 0x67, 0xFE, + 0x1B, 0x3F, 0x74, 0xA5, 0x6B, 0x2E, 0xB3, 0x77, 0x02, 0x64, 0x30, 0xAF, 0x6C, 0x64, 0x2E, 0x69, + 0x92, 0xA5, 0xD3, 0xA8, 0xEE, 0xEF, 0xB7, 0x89, 0xD9, 0x31, 0x1B, 0x61, 0xC8, 0x91, 0xF1, 0xC5, + 0x59, 0x7D, 0xCE, 0xDF, 0xFB, 0xF2, 0x10, 0xF7, 0x42, 0x02, 0xEC, 0x70, 0x2F, 0xE4, 0x02, 0xB4, + 0xFB, 0xA0, 0xFC, 0x83, 0x58, 0x68, 0xA2, 0x8E, 0x01, 0x8B, 0x10, 0xF6, 0x30, 0x86, 0xAA, 0x5A, + 0xC4, 0x95, 0x61, 0x02, 0x8E, 0xF2, 0xB7, 0x6B, 0x6C, 0x80, 0x5C, 0xCB, 0x11, 0x66, 0x97, 0x60, + 0x70, 0xD4, 0x06, 0xA9, 0xC7, 0x80, 0xE3, 0x2C, 0xA4, 0xE1, 0xAA, 0x34, 0x92, 0x13, 0x57, 0x05, + 0xF9, 0x70, 0xF3, 0xF4, 0x80, 0x73, 0xF2, 0x16, 0xDA, 0xBD, 0x39, 0x51, 0xD1, 0x40, 0xC1, 0x59, + 0x04, 0xCD, 0xE4, 0x79, 0x63, 0x24, 0x69, 0xC6, 0x99, 0x2F, 0x4D, 0x0D, 0x1C, 0x9C, 0x15, 0xED, + 0x41, 0x47, 0x12, 0x78, 0x6F, 0x8E, 0xFF, 0xA7, 0x34, 0xB8, 0x8B, 0x0C, 0x70, 0x96, 0x07, 0x0B, + 0x49, 0x42, 0x59, 0xFE, 0x5A, 0x08, 0x76, 0x36, 0x3D, 0x7D, 0xBA, 0x10, 0x1B, 0x11, 0xB4, 0x6B, + 0x1C, 0x59, 0x60, 0x02, 0x36, 0x30, 0xD9, 0xEC, 0xBA, 0xEE, 0x22, 0xFD, 0x0F, 0x2E, 0xA2, 0xE2, + 0x70, 0x9C, 0x0D, 0x18, 0x58, 0x88, 0x4A, 0x0D, 0xE7, 0x0E, 0xEF, 0xD8, 0x6F, 0xA7, 0x70, 0x12, + 0x9D, 0x06, 0x4C, 0x8C, 0xAD, 0x1A, 0x28, 0x01, 0xB6, 0x23, 0x53, 0x76, 0xDD, 0x3F, 0x17, 0x87, + 0x0B, 0xC1, 0xEB, 0x9C, 0x44, 0x67, 0x1B, 0x79, 0xE0, 0x67, 0xB2, 0x2A, 0x99, 0x72, 0xEB, 0x4C, + 0xB4, 0x17, 0x2E, 0xB5, 0xE8, 0x52, 0x1E, 0xCB, 0x3A, 0x3D, 0xF7, 0xF2, 0x21, 0xC7, 0xF1, 0x29, + 0x97, 0x22, 0x31, 0x2C, 0x39, 0x8A, 0xAF, 0x47, 0xF9, 0x3B, 0xA9, 0x8B, 0x2B, 0xEF, 0xE2, 0xF0, + 0x11, 0x59, 0xFC, 0xE4, 0x56, 0xFF, 0x4E, 0xA7, 0x92, 0xE5, 0xE5, 0x26, 0x16, 0xC8, 0x2C, 0x35, + 0xD2, 0x70, 0x9F, 0xAE, 0xA7, 0x08, 0x16, 0x2B, 0x64, 0xA1, 0xF6, 0xF3, 0xC1, 0x43, 0x27, 0x92, + 0x46, 0x4E, 0xA2, 0x01, 0x72, 0x18, 0x08, 0xAB, 0x22, 0x42, 0x1B, 0x9E, 0x35, 0xAE, 0xB3, 0xE6, + 0x42, 0x1B, 0x49, 0x31, 0xBB, 0xA4, 0xD0, 0xD6, 0x7A, 0xEB, 0xFE, 0x32, 0x37, 0x7F, 0xE6, 0x2F, + 0x75, 0x54, 0x1D, 0x88, 0x9F, 0x81, 0xEE, 0xF0, 0x97, 0xC9, 0x12, 0x80, 0x47, 0x5C, 0xCA, 0x3B, + 0x45, 0xF4, 0x63, 0xC3, 0x16, 0x2D, 0x7E, 0xCD, 0x80, 0xC2, 0xBA, 0x50, 0x1D, 0xC2, 0x31, 0x72, + 0xF0, 0x27, 0x97, 0xB0, 0xF4, 0x69, 0x43, 0x2B, 0x26, 0x89, 0x28, 0xFC, 0xBD, 0x03, 0x6A, 0x4A, + 0x22, 0x5D, 0xD3, 0x7D, 0xEC, 0xC8, 0xEC, 0x7B, 0x15, 0xFA, 0x05, 0x5D, 0x73, 0x6B, 0x5B, 0x1B, + 0xC9, 0x83, 0xD0, 0xFA, 0x24, 0xBA, 0x97, 0x11, 0x30, 0x04, 0xD3, 0x11, 0xCE, 0x24, 0xBD, 0x71, + 0xB7, 0xAA, 0xB2, 0xC2, 0x43, 0xC2, 0x67, 0x3B, 0x9C, 0x28, 0x62, 0x52, 0xF0, 0xFA, 0xCB, 0xFA, + 0xDF, 0x4F, 0xC9, 0x23, 0xD1, 0x94, 0xE1, 0x5F, 0x2A, 0xF2, 0xC7, 0x5F, 0x76, 0x6B, 0x86, 0x28, + 0x29, 0xF1, 0x54, 0x4F, 0x7A, 0x4D, 0xFD, 0xD0, 0x51, 0xFA, 0xBC, 0x6F, 0x7B, 0x44, 0xE5, 0xB0, + 0xF3, 0xC0, 0x34, 0x80, 0x6D, 0xE6, 0xDD, 0xCD, 0x7F, 0x67, 0x7B, 0x15, 0xC5, 0xE5, 0x14, 0x64, + 0x80, 0x81, 0xD9, 0x47, 0xCE, 0x71, 0x62, 0x94, 0xCE, 0x41, 0x61, 0xFA, 0xDD, 0x5A, 0x6D, 0xC1, + 0x28, 0x87, 0x39, 0xC4, 0xBC, 0x89, 0x3A, 0x99, 0x18, 0x80, 0xDC, 0x50, 0x72, 0xCF, 0x67, 0x4D, + 0x77, 0x6D, 0x6A, 0xB4, 0x17, 0x85, 0xD6, 0x2B, 0xC3, 0x4A, 0x7C, 0xD1, 0xF3, 0x0E, 0xA4, 0x8F, + 0x3B, 0xDA, 0x8A, 0x7B, 0x0A, 0x37, 0x7D, 0x36, 0xEC, 0x89, 0x87, 0xD9, 0x88, 0xB7, 0xC9, 0x1F, + 0xEB, 0xEE, 0x25, 0x46, 0xA9, 0x3B, 0x19, 0x16, 0x17, 0x2D, 0x0F, 0x8C, 0xEB, 0x19, 0xF3, 0x47, + 0xC7, 0x21, 0xA8, 0x1E, 0x7F, 0xC4, 0xE3, 0x6B, 0x96, 0x1D, 0x63, 0xDD, 0xC2, 0xEF, 0xB2, 0x65, + 0x60, 0x07, 0xE5, 0xD3, 0x48, 0x49, 0x9A, 0xF2, 0xB0, 0x76, 0x2D, 0xFB, 0x68, 0xF8, 0xAD, 0xE9, + 0x3C, 0x52, 0x37, 0x9A, 0xD1, 0xAE, 0x16, 0x37, 0x2E, 0xB3, 0x63, 0xE0, 0x66, 0xB1, 0x4D, 0x49, + 0x83, 0xD2, 0xEA, 0x20, 0xFD, 0x43, 0x84, 0x5B, 0x22, 0xBC, 0x0C, 0xA1, 0x85, 0x28, 0xF7, 0x45, + 0xF1, 0x2A, 0xC2, 0xFE, 0x87, 0x4C, 0xFC, 0x0A, 0x5B, 0xD9, 0x84, 0x7A, 0xAC, 0x8C, 0xBD, 0xDF, + 0xDC, 0xA5, 0xFC, 0xD0, 0x85, 0x65, 0xA2, 0x73, 0x1C, 0x7C, 0xFD, 0xF9, 0xBA, 0x1E, 0xBD, 0x5F, + 0x06, 0xE8, 0xFC, 0x62, 0xD1, 0xF7, 0x13, 0x52, 0xE3, 0xC2, 0xEB, 0xEE, 0x0E, 0x7E, 0x9D, 0x8A, + 0x19, 0x3E, 0xA2, 0x62, 0x06, 0xC5, 0xA1, 0xDC, 0x6B, 0x4A, 0x59, 0xA6, 0x57, 0x73, 0xCB, 0x57, + 0x16, 0x99, 0xFB, 0x93, 0x36, 0xDF, 0x0E, 0x1A, 0x38, 0xD4, 0x89, 0x02, 0x79, 0xB6, 0xA8, 0x52, + 0xCB, 0x2E, 0x96, 0xD4, 0xD8, 0x52, 0xA9, 0x7C, 0xE3, 0x97, 0x47, 0x6F, 0x6E, 0x82, 0x6D, 0x3A, + 0x01, 0x8F, 0x2F, 0x59, 0xDF, 0x93, 0xBA, 0x52, 0xC4, 0x46, 0xDA, 0xC5, 0x0C, 0x2E, 0x40, 0xB8, + 0x37, 0x55, 0x40, 0xB8, 0x13, 0xCD, 0x51, 0x96, 0xCE, 0x4A, 0x6C, 0x0D, 0xF9, 0x5A, 0xE6, 0x34, + 0x95, 0xF0, 0xFF, 0x54, 0x93, 0x05, 0x9D, 0x56, 0x94, 0xF7, 0x23, 0x90, 0x00, 0x44, 0xA7, 0xD9, + 0x86, 0x71, 0xB2, 0xFD, 0x58, 0x19, 0xBB, 0xEC, 0x6B, 0x90, 0x07, 0x2B, 0x7A, 0x20, 0x4B, 0xFD, + 0x0E, 0xB8, 0xF8, 0x00, 0x13, 0xC2, 0xF2, 0x32, 0x39, 0xED, 0x71, 0x59, 0x71, 0xC4, 0xDC, 0xE5, + 0xC2, 0xA9, 0x2B, 0x7B, 0x52, 0x00, 0xCB, 0x49, 0xB4, 0x00, 0xE6, 0x98, 0x13, 0xC1, 0x2F, 0x3A, + 0x19, 0x86, 0xD5, 0x74, 0xCD, 0xBC, 0xBA, 0x4C, 0x48, 0x00, 0x8E, 0x22, 0xD5, 0xAC, 0x11, 0xEF, + 0xC8, 0xCD, 0x99, 0xBA, 0xBC, 0x0F, 0xD4, 0xC0, 0xAE, 0x15, 0x2F, 0x82, 0x6D, 0x4D, 0x44, 0x10, + 0xF1, 0xF5, 0x55, 0xF0, 0x00, 0xAF, 0xEA, 0x96, 0x1F, 0xE6, 0xA6, 0x9A, 0x78, 0xDD, 0x6D, 0xD5, + 0xDF, 0xA4, 0x4D, 0xAE, 0x05, 0xEE, 0x12, 0x9F, 0x9B, 0x99, 0xAC, 0xE4, 0xBE, 0x9E, 0x56, 0xCC, + 0x4B, 0x6D, 0x26, 0xB9, 0x56, 0x9B, 0x9B, 0x52, 0x6D, 0x14, 0x28, 0x7D, 0xE8, 0x75, 0xCB, 0x59, + 0xC0, 0x50, 0x69, 0x6B, 0xD7, 0x68, 0x06, 0xA8, 0x38, 0xD1, 0xBB, 0xD9, 0xA3, 0x3D, 0xA1, 0xBD, + 0x7D, 0x9E, 0xD2, 0xB9, 0x5D, 0x35, 0x02, 0xE0, 0xD4, 0xAF, 0x66, 0x56, 0x7D, 0xF4, 0x88, 0x74, + 0x3C, 0x28, 0x2C, 0xBA, 0x20, 0xC1, 0x2A, 0x93, 0xA9, 0xBA, 0x90, 0xE8, 0xC2, 0xE9, 0x15, 0xC8, + 0x8F, 0xBD, 0x27, 0xDE, 0x21, 0xBF, 0x56, 0x69, 0x93, 0x72, 0x7E, 0xE4, 0xE7, 0x7D, 0xE8, 0x4D, + 0xBF, 0x24, 0xA2, 0x77, 0xC0, 0xE0, 0x30, 0xD9, 0xEE, 0x82, 0xCD, 0x21, 0x60, 0xFC, 0xD1, 0x6F, + 0xB4, 0x40, 0x01, 0xFE, 0xF4, 0x73, 0xAF, 0xBB, 0xF6, 0x2B, 0x41, 0xFC, 0xDE, 0x74, 0x78, 0xE5, + 0x7E, 0xAB, 0xC9, 0xED, 0x63, 0x4B, 0x3E, 0x1A, 0x27, 0xCD, 0xBF, 0x85, 0xA4, 0x70, 0x92, 0x36, + 0x56, 0x70, 0x4A, 0xEE, 0x45, 0xAB, 0x33, 0x0A, 0x76, 0xB8, 0x0B, 0xEA, 0x55, 0xC7, 0x4E, 0xD7, + 0xD9, 0xC7, 0x10, 0x8D, 0x09, 0xFA, 0x10, 0x30, 0x62, 0x20, 0xE5, 0xBC, 0xFB, 0x74, 0x72, 0xA6, + 0x77, 0xB5, 0xBB, 0xD7, 0xD6, 0x60, 0x3A, 0x6B, 0x5D, 0xF5, 0x35, 0xF4, 0x84, 0xA0, 0x19, 0x49, + 0x36, 0x00, 0xC9, 0x35, 0xCC, 0xF7, 0xFE, 0x92, 0xF9, 0x4B, 0x8B, 0xB3, 0xBE, 0x98, 0xBF, 0xF4, + 0x25, 0xB1, 0x62, 0x4D, 0x41, 0xA0, 0xF7, 0x36, 0x6C, 0x86, 0x3C, 0x4F, 0xC4, 0xF8, 0xF2, 0xFC, + 0xE6, 0x34, 0x30, 0x95, 0x32, 0x9D, 0xE5, 0x85, 0x70, 0xD8, 0xB8, 0xD6, 0xD9, 0x42, 0xB9, 0x05, + 0x6E, 0x4B, 0x6F, 0x29, 0x33, 0x8E, 0xE4, 0x31, 0x3C, 0x21, 0x7B, 0x19, 0x31, 0x97, 0xD5, 0x62, + 0x6B, 0xF6, 0x98, 0x3C, 0xA5, 0x54, 0x18, 0x16, 0x03, 0x49, 0x51, 0x1F, 0x13, 0x37, 0xFB, 0x18, + 0x9D, 0xCF, 0x16, 0x43, 0x34, 0x7D, 0xB6, 0x5C, 0x9E, 0x74, 0x4D, 0x66, 0x23, 0x99, 0xDE, 0x6E, + 0x57, 0xFE, 0x47, 0x0D, 0x3B, 0x59, 0x3F, 0x01, 0x79, 0x75, 0x0D, 0x78, 0x62, 0x4A, 0xA5, 0xF2, + 0xF8, 0xD6, 0xAE, 0x11, 0x85, 0x88, 0x13, 0x98, 0x07, 0x0B, 0x92, 0x99, 0xC6, 0x9F, 0x85, 0x24, + 0xB1, 0x48, 0xEF, 0x59, 0x11, 0xCB, 0xAB, 0x92, 0xE4, 0x58, 0x50, 0xAA, 0xE8, 0x97, 0xD5, 0xCD, + 0x63, 0x57, 0x61, 0x62, 0x06, 0xBD, 0x26, 0x08, 0x0E, 0xC6, 0x42, 0x98, 0x8E, 0x82, 0x13, 0xD7, + 0xB8, 0x18, 0x7B, 0xAA, 0xFD, 0x42, 0x51, 0x07, 0xDE, 0x6F, 0xCF, 0xE7, 0x87, 0xF6, 0xBF, 0x15, + 0x8D, 0x8E, 0xFD, 0xA9, 0x4A, 0x45, 0x81, 0x57, 0x8F, 0x22, 0x4D, 0x63, 0x21, 0x4E, 0x41, 0x3C, + 0xCD, 0x77, 0xF5, 0xEC, 0xB8, 0x15, 0x8A, 0xBC, 0x69, 0x22, 0x98, 0xE5, 0xA4, 0x66, 0x47, 0xC5, + 0x9F, 0xE9, 0x9D, 0x06, 0xD8, 0xD2, 0x37, 0xA0, 0x4C, 0xDC, 0x33, 0xD4, 0xE7, 0xED, 0x77, 0x7D, + 0xA2, 0x20, 0x81, 0xB2, 0x46, 0xC5, 0xF6, 0xF5, 0x2A, 0x76, 0x50, 0xAF, 0xC2, 0x5A, 0xC7, 0x8F, + 0xD8, 0x3C, 0x4F, 0x2F, 0xE3, 0x56, 0x04, 0xB2, 0x6C, 0x8C, 0x0D, 0x84, 0xD7, 0xE0, 0xB5, 0x45, + 0xB2, 0x93, 0x34, 0xA0, 0xC2, 0xF4, 0x3A, 0x28, 0xDC, 0x50, 0xE8, 0xF3, 0xF0, 0x7C, 0x67, 0x1A, + 0x11, 0xD7, 0x8D, 0xB2, 0x71, 0x3D, 0xB3, 0x68, 0x49, 0x19, 0x29, 0x54, 0xDF, 0x44, 0xB9, 0x48, + 0xDD, 0x9E, 0xCE, 0xCD, 0x2D, 0x69, 0xB6, 0x18, 0xAD, 0xBC, 0xDC, 0xDF, 0x1F, 0x48, 0x04, 0x16, + 0xD6, 0x3A, 0x39, 0x7E, 0x30, 0xDB, 0x9D, 0xE1, 0x14, 0xF2, 0x5F, 0xDB, 0x1D, 0xBB, 0x7F, 0x4F, + 0x49, 0xBF, 0x4D, 0x2B, 0x9B, 0x5C, 0x7E, 0xA8, 0x1B, 0x79, 0x4F, 0x29, 0xA2, 0xF8, 0xBA, 0x36, + 0x86, 0x10, 0xFA, 0x7C, 0x45, 0x99, 0xE9, 0xD1, 0xDB, 0x93, 0xDB, 0x2A, 0xD5, 0xA8, 0x61, 0x48, + 0xBA, 0xD9, 0x40, 0xD7, 0xAE, 0xE5, 0x35, 0xAA, 0xF0, 0xA5, 0xFD, 0xC5, 0x64, 0x0B, 0x31, 0xA5, + 0x9D, 0x83, 0x31, 0xF6, 0xB8, 0xB5, 0x18, 0x3E, 0xB4, 0x2A, 0x8E, 0x70, 0x7A, 0xB8, 0xAC, 0xB5, + 0x92, 0xDD, 0x12, 0xA7, 0x9D, 0x41, 0xB1, 0x16, 0xE8, 0x45, 0x63, 0x1B, 0xB9, 0x73, 0xF1, 0x19, + 0xF6, 0xAE, 0x0F, 0xF3, 0xF7, 0x60, 0xED, 0x27, 0x70, 0x12, 0x8C, 0x12, 0x3A, 0xCF, 0xA6, 0xDC, + 0xBD, 0x17, 0x82, 0x05, 0x6E, 0x10, 0x04, 0xD4, 0xE7, 0x10, 0x9B, 0x83, 0x55, 0xB0, 0xED, 0x1B, + 0xF9, 0x7D, 0x75, 0x8E, 0xB2, 0x26, 0xA7, 0xBD, 0xE2, 0x0F, 0x29, 0x25, 0x6C, 0xFD, 0xC9, 0xC4, + 0x72, 0xE1, 0x1C, 0xDC, 0x9E, 0xBE, 0x69, 0xB5, 0xE8, 0x31, 0x83, 0x03, 0x5A, 0xEA, 0xA3, 0x52, + 0xD7, 0x51, 0x8A, 0x76, 0xB8, 0x83, 0xF0, 0x5E, 0xDC, 0xFC, 0xED, 0x80, 0x36, 0x7A, 0x39, 0xC6, + 0xFC, 0xF3, 0xC3, 0xE1, 0x5D, 0x15, 0x05, 0x30, 0xF6, 0x74, 0x93, 0x45, 0xB5, 0x2B, 0x0B, 0x63, + 0x2E, 0xF1, 0x24, 0x4B, 0x16, 0xD9, 0x61, 0xDB, 0x97, 0x9A, 0xC8, 0xFF, 0xCE, 0x74, 0xE9, 0x39, + 0x93, 0x00, 0xF8, 0xE0, 0x50, 0x62, 0x07, 0x0A, 0x6B, 0xB4, 0xBA, 0x2B, 0x61, 0x09, 0x25, 0x58, + 0x18, 0x0A, 0xB8, 0xDA, 0x8D, 0xFA, 0x8C, 0x4A, 0x41, 0xBE, 0xA4, 0x51, 0x9B, 0x83, 0x14, 0xC4, + 0xB5, 0x81, 0xB0, 0xA1, 0x35, 0x48, 0x34, 0xEB, 0xAF, 0x74, 0xF4, 0x61, 0xC5, 0x00, 0x39, 0x7D, + 0xAD, 0xF1, 0x07, 0x9C, 0x43, 0x20, 0x8F, 0x4B, 0x3D, 0xD3, 0x7C, 0x91, 0x1D, 0xC3, 0x3B, 0x06, + 0x50, 0x59, 0xA9, 0xC9, 0xA3, 0x23, 0xC9, 0xA6, 0x8A, 0x29, 0x84, 0x0D, 0x7D, 0xEE, 0x56, 0x5D, + 0xA1, 0xB6, 0xA3, 0xE7, 0x1F, 0x2A, 0xFB, 0x95, 0x7B, 0xFC, 0x9F, 0x9A, 0x18, 0xEA, 0xFF, 0xFD, + 0x61, 0x75, 0x3A, 0xF2, 0x22, 0xFF, 0xEB, 0xA2, 0x7C, 0x5A, 0x16, 0xB1, 0xE9, 0x93, 0xB0, 0x4D, + 0xA7, 0xA4, 0xB0, 0xAF, 0x70, 0x8C, 0x7E, 0x7D, 0xE8, 0x4F, 0xAA, 0x9D, 0x81, 0xD6, 0xF8, 0xB5, + 0xB6, 0x32, 0xA5, 0x31, 0xA1, 0x55, 0x11, 0x3A, 0x01, 0x13, 0x38, 0x3A, 0x41, 0x7A, 0x79, 0x31, + 0x3C, 0x13, 0xF5, 0x2C, 0x97, 0x28, 0xBD, 0x1F, 0x2E, 0x68, 0xAB, 0xA1, 0x52, 0x5F, 0xBB, 0x2A, + 0xCB, 0x11, 0xFE, 0x4A, 0x34, 0x30, 0xCD, 0xDD, 0x38, 0xAC, 0xED, 0xD0, 0x53, 0xC6, 0xC4, 0x33, + 0xE5, 0x17, 0x41, 0xC8, 0x7D, 0x14, 0x9C, 0x8C, 0x2D, 0x59, 0x61, 0xB1, 0xEC, 0x6A, 0x48, 0xAD, + 0xC7, 0x42, 0x79, 0x9B, 0x63, 0xDB, 0xB0, 0xAD, 0xAF, 0x44, 0x85, 0x2E, 0x24, 0x11, 0xE6, 0x1E, + 0x56, 0xB2, 0x1B, 0x2E, 0x98, 0x7E, 0x64, 0x3D, 0x98, 0x69, 0x51, 0x05, 0x3D, 0x5C, 0x0A, 0x85, + 0xCA, 0x58, 0x0E, 0x11, 0x86, 0xA7, 0xD6, 0xAC, 0xFF, 0x21, 0x12, 0x9F, 0xA1, 0x52, 0xE4, 0xD9, + 0xD5, 0xAC, 0x9B, 0xE2, 0x4B, 0xF0, 0x57, 0xFA, 0xFC, 0x05, 0x84, 0xB6, 0xD9, 0xB0, 0xCE, 0x5E, + 0xA0, 0x73, 0x32, 0xCE, 0x15, 0x29, 0xE8, 0x8F, 0xC4, 0xD9, 0x22, 0x3A, 0x9D, 0x71, 0xC5, 0x37, + 0x2B, 0x33, 0x76, 0x63, 0x49, 0x52, 0x8A, 0x2E, 0x89, 0x6D, 0x5A, 0x04, 0x83, 0xC1, 0xD9, 0x46, + 0xC3, 0x5C, 0x93, 0x6C, 0x3B, 0xDB, 0xFC, 0x1C, 0xC1, 0x65, 0x3B, 0x2C, 0xAD, 0xD5, 0x78, 0x9A, + 0x3A, 0xE4, 0xC3, 0x04, 0x11, 0xD8, 0xBD, 0x63, 0xA9, 0x93, 0x01, 0xF1, 0x42, 0x89, 0x5E, 0x66, + 0x95, 0xF2, 0x75, 0x38, 0x30, 0x4B, 0x39, 0x41, 0x49, 0x54, 0x8E, 0x12, 0x36, 0xFB, 0x9A, 0xA0, + 0x61, 0x13, 0x1C, 0xC2, 0xB2, 0x30, 0x7E, 0xD5, 0x22, 0xEB, 0xA3, 0xB6, 0x69, 0x2E, 0x0F, 0x0B, + 0xB0, 0x29, 0xF3, 0x24, 0x5A, 0x29, 0xA6, 0x3F, 0xC9, 0xC1, 0x56, 0xC5, 0x8E, 0xAA, 0x0B, 0x17, + 0x44, 0xBC, 0xFF, 0xE3, 0x12, 0xB8, 0x3E, 0xA9, 0x16, 0xF9, 0x7F, 0x57, 0x92, 0x7C, 0x0C, 0xFD, + 0x87, 0x9D, 0x70, 0xED, 0x81, 0xD0, 0x77, 0x01, 0x77, 0x71, 0xF5, 0x6C, 0x7F, 0xCC, 0xE4, 0xF0, + 0xAD, 0x27, 0x66, 0x2D, 0x16, 0x7B, 0x4E, 0x95, 0xF9, 0x59, 0xAA, 0x8A, 0x83, 0xE3, 0x1E, 0xD9, + 0x6E, 0x9C, 0x84, 0xEB, 0xBD, 0x5B, 0x33, 0x68, 0xA9, 0x3F, 0xDA, 0x69, 0xCB, 0xF1, 0xC7, 0x64, + 0x99, 0x27, 0xEF, 0xFF, 0xE2, 0x37, 0x34, 0x2D, 0x3C, 0x92, 0xAF, 0x7B, 0xE6, 0x6D, 0x7E, 0xF9, + 0xD2, 0x95, 0x14, 0xF1, 0x01, 0x93, 0xF2, 0xBD, 0xDF, 0x59, 0x67, 0xF6, 0x2D, 0x36, 0xBB, 0x8E, + 0x16, 0xCA, 0x07, 0xEC, 0x34, 0xA0, 0xE2, 0x16, 0x6C, 0xEC, 0x23, 0x41, 0x87, 0x7A, 0x66, 0x82, + 0x09, 0x6A, 0xFE, 0x21, 0xB3, 0x9A, 0xC7, 0x12, 0x0D, 0x07, 0xEB, 0xCF, 0xCB, 0x44, 0x9B, 0xA3, + 0xA1, 0xD9, 0x07, 0x76, 0x1D, 0x93, 0x96, 0x1B, 0x6D, 0xA1, 0x65, 0x6D, 0xB2, 0x62, 0x81, 0x55, + 0xFD, 0xE1, 0x76, 0xF2, 0x6F, 0x9A, 0x71, 0x9F, 0xFC, 0x48, 0x8D, 0x58, 0x1D, 0x3E, 0xFE, 0xBC, + 0x02, 0xB5, 0x36, 0xEE, 0x58, 0x35, 0x82, 0xF3, 0x51, 0x93, 0x35, 0x7E, 0xFA, 0xAF, 0x7E, 0x56, + 0x7E, 0xE8, 0x59, 0x7E, 0x90, 0x73, 0x9B, 0x0E, 0x4D, 0x0D, 0x84, 0x75, 0x30, 0x29, 0xCA, 0xE7, + 0x2C, 0xB3, 0xAC, 0x53, 0x3C, 0xC3, 0x7D, 0x55, 0xCD, 0xE0, 0xB9, 0xF8, 0x44, 0x02, 0xF2, 0x2B, + 0xB7, 0xD1, 0x83, 0x75, 0xDC, 0x96, 0xE7, 0x62, 0x5A, 0x58, 0x63, 0x2D, 0xC1, 0x33, 0xD2, 0x74, + 0x27, 0x05, 0xFD, 0xB7, 0x69, 0x63, 0x34, 0x81, 0xDB, 0xC1, 0x24, 0x10, 0x3A, 0xC2, 0xE2, 0xE9, + 0x75, 0xF8, 0x90, 0x50, 0x3A, 0x3C, 0xAF, 0xCD, 0x4E, 0x78, 0xB0, 0xFA, 0x5F, 0x2C, 0x09, 0x90, + 0xFE, 0xDA, 0xE4, 0x99, 0x8E, 0x3E, 0x63, 0x74, 0x3C, 0x6C, 0xD6, 0xC5, 0x2A, 0x1A, 0xBD, 0x95, + 0xA3, 0xAB, 0xF3, 0xEF, 0x1E, 0x95, 0x02, 0x8E, 0xCB, 0x23, 0xED, 0x11, 0xDB, 0x42, 0x45, 0xD5, + 0x5D, 0xDF, 0xF6, 0xE5, 0x98, 0xB4, 0x46, 0x49, 0x1A, 0xC6, 0x87, 0xFC, 0xA1, 0x79, 0x15, 0xD8, + 0x84, 0x99, 0xFE, 0x0B, 0x33, 0x30, 0x21, 0xA7, 0x59, 0x0A, 0x35, 0xE6, 0x68, 0x62, 0x55, 0x58, + 0xB4, 0x74, 0xDC, 0x80, 0xA4, 0xAD, 0x97, 0x57, 0x08, 0x9D, 0xC9, 0x9C, 0x1C, 0x0E, 0xD6, 0xE5, + 0xE3, 0xC8, 0x13, 0x02, 0xA8, 0xB9, 0x06, 0x27, 0x55, 0x89, 0xE7, 0xA3, 0xBF, 0xB0, 0xA6, 0xD0, + 0x92, 0xAD, 0xDA, 0xFE, 0x9E, 0x38, 0x2B, 0x88, 0x18, 0x7E, 0x3E, 0x90, 0xC3, 0xC0, 0x90, 0xAB, + 0x10, 0x21, 0x49, 0x47, 0xD1, 0x9D, 0x0A, 0xE9, 0x9F, 0xF9, 0xBB, 0x44, 0x83, 0x43, 0xBE, 0xBB, + 0x72, 0xD3, 0x06, 0xB4, 0x1B, 0x11, 0x03, 0xB8, 0xF5, 0xE5, 0x85, 0x1C, 0x4D, 0x7B, 0x0E, 0x65, + 0x33, 0xB0, 0x06, 0xD4, 0x58, 0x1F, 0xC9, 0x52, 0x27, 0xAD, 0xC9, 0xDE, 0x33, 0x4D, 0xC5, 0x45, + 0x6F, 0x11, 0xE1, 0x1D, 0xB9, 0x26, 0xED, 0x5B, 0x9B, 0xF6, 0xFC, 0x87, 0xF7, 0x96, 0x58, 0x5D, + 0xD7, 0x10, 0x15, 0x59, 0x1E, 0x3C, 0xFC, 0xF2, 0x8C, 0x7B, 0xB8, 0x70, 0x35, 0xD2, 0xB3, 0xA2, + 0xF1, 0xE7, 0x9D, 0xC6, 0xAE, 0x37, 0x71, 0xDA, 0x04, 0x32, 0x09, 0x33, 0xF7, 0x7D, 0x45, 0x33, + 0x9F, 0x5C, 0xD6, 0x66, 0xEC, 0x68, 0xCA, 0xEC, 0xBF, 0x4C, 0xF8, 0xA1, 0x4D, 0x5C, 0x41, 0x0E, + 0x69, 0x1F, 0x96, 0xE8, 0xD9, 0x76, 0xB9, 0xEA, 0x04, 0xEF, 0x91, 0xD4, 0xD7, 0x36, 0xEF, 0xE9, + 0xE6, 0x7B, 0x81, 0x31, 0xFD, 0x4E, 0x15, 0x17, 0xF1, 0x25, 0x86, 0x4C, 0x94, 0x2A, 0xAA, 0x50, + 0xB0, 0x98, 0x19, 0xB4, 0x34, 0x81, 0xE2, 0x61, 0xE6, 0xEE, 0x9C, 0x70, 0x72, 0x38, 0xB8, 0xE8, + 0xA6, 0xE1, 0x9F, 0x24, 0xDC, 0xD2, 0x9D, 0xC3, 0x94, 0x43, 0x65, 0x5B, 0x22, 0x45, 0xF2, 0x75, + 0x33, 0x6D, 0xB9, 0x60, 0xC6, 0x9F, 0x0A, 0xC1, 0x1F, 0xFC, 0x8B, 0x7B, 0xAB, 0x71, 0x61, 0xAE, + 0xD2, 0x1B, 0xF6, 0x79, 0x3D, 0x63, 0x1F, 0x4F, 0x1C, 0xDD, 0x4B, 0x50, 0x02, 0x97, 0xCD, 0xF4, + 0xC7, 0x0B, 0xFC, 0xB3, 0xD1, 0x21, 0xD3, 0x73, 0x1B, 0x4B, 0xE8, 0x9F, 0x3D, 0x16, 0x88, 0x0E, + 0x7F, 0xCC, 0x26, 0xA6, 0xF5, 0x8F, 0x69, 0x7F, 0xAC, 0xE8, 0x3F, 0x7B, 0x29, 0x81, 0xDA, 0x14, + 0x8F, 0x98, 0x78, 0x11, 0x34, 0x46, 0x60, 0xAD, 0x9E, 0xB3, 0x69, 0xFD, 0x74, 0x95, 0x3A, 0x14, + 0x30, 0xBE, 0x34, 0xE2, 0xAC, 0x54, 0x81, 0x70, 0x1F, 0x47, 0xD7, 0x5A, 0xDE, 0x81, 0x29, 0x17, + 0x9B, 0x3F, 0xC7, 0x57, 0x56, 0x26, 0xCD, 0xF8, 0x3B, 0x4E, 0x94, 0x4E, 0xA4, 0x09, 0x46, 0x1A, + 0x6D, 0xA3, 0x44, 0x51, 0xA9, 0x9F, 0x97, 0x88, 0x5E, 0x5E, 0x70, 0xCA, 0xDE, 0xA4, 0xAF, 0x6D, + 0xBC, 0xCE, 0xF6, 0x67, 0x81, 0x10, 0xD3, 0xF5, 0xB8, 0xC9, 0x49, 0xF3, 0x98, 0x71, 0x2D, 0x29, + 0xBD, 0x34, 0x08, 0x25, 0x1B, 0x9A, 0x6F, 0xC3, 0x4D, 0xC3, 0x9F, 0x5E, 0xE2, 0xA2, 0xF3, 0x82, + 0x52, 0xA9, 0xF6, 0x79, 0x14, 0x6F, 0xD0, 0x12, 0xB6, 0x0D, 0x4C, 0xAC, 0x3E, 0x2A, 0x8C, 0x86, + 0xE1, 0xFF, 0x1C, 0x49, 0x43, 0xF2, 0x1D, 0x34, 0xA3, 0x0F, 0xA3, 0x9B, 0x2C, 0xF3, 0x9C, 0xFC, + 0x23, 0x4B, 0xE0, 0xCB, 0xE6, 0xBE, 0x7E, 0x8B, 0x51, 0x2D, 0x32, 0x92, 0xCC, 0xC6, 0xDB, 0x36, + 0x1B, 0x83, 0x80, 0x64, 0xD2, 0x23, 0x1C, 0x60, 0x90, 0x1C, 0x71, 0x06, 0x0F, 0x30, 0xC0, 0xDF, + 0xFE, 0xF7, 0x50, 0x5A, 0xF8, 0x9C, 0x97, 0x29, 0xFB, 0x7B, 0xEB, 0x91, 0x6A, 0x42, 0xE4, 0xAB, + 0x62, 0xB4, 0x1F, 0x14, 0xEC, 0x1A, 0x9F, 0xC4, 0x98, 0x77, 0x85, 0x8B, 0xF1, 0x15, 0x2B, 0x2C, + 0x3F, 0xAB, 0x3A, 0x5E, 0xD3, 0x50, 0x32, 0xDD, 0x23, 0x81, 0x89, 0x3B, 0xB8, 0xFD, 0x49, 0x78, + 0xA9, 0x35, 0x20, 0x2D, 0xBC, 0xFC, 0x10, 0x8A, 0x08, 0xA0, 0x57, 0x24, 0xFA, 0x29, 0xD3, 0x9C, + 0xC0, 0xC5, 0x06, 0xF2, 0x7D, 0xC4, 0x45, 0x38, 0x1F, 0xC6, 0xE4, 0xC8, 0x23, 0x65, 0xD2, 0x5A, + 0xE5, 0xCD, 0x63, 0x14, 0x56, 0x03, 0xAA, 0x29, 0x82, 0xAB, 0x67, 0x92, 0x2C, 0x71, 0x67, 0x6A, + 0x36, 0xF9, 0xE1, 0x89, 0xD2, 0x98, 0x88, 0x97, 0x65, 0x72, 0xE4, 0x3C, 0x5A, 0x1D, 0xB7, 0x34, + 0x4D, 0x01, 0x91, 0x5D, 0xC4, 0xAF, 0x88, 0x2F, 0xD1, 0x27, 0x26, 0x36, 0x16, 0x98, 0x39, 0x9A, + 0xEA, 0xFA, 0xDF, 0x3B, 0x7F, 0xD8, 0x76, 0x95, 0xDB, 0x03, 0x82, 0x86, 0xD0, 0x6D, 0x15, 0xD0, + 0xF0, 0xB9, 0xCC, 0xB9, 0xD6, 0xE1, 0x9C, 0xC7, 0xAE, 0x3C, 0xA8, 0xB9, 0x49, 0xA3, 0xC4, 0xB3, + 0x24, 0x3A, 0xA3, 0x50, 0x7E, 0xDF, 0xBE, 0x5F, 0xAF, 0xC3, 0x7C, 0x3C, 0xC7, 0x39, 0xD9, 0x29, + 0x06, 0xD5, 0x0B, 0xE8, 0xFA, 0x80, 0xC2, 0xCE, 0xA8, 0xD9, 0x20, 0xCE, 0x28, 0x0A, 0xDE, 0x15, + 0xB5, 0x0D, 0x9A, 0xB8, 0xB0, 0x7B, 0x33, 0xB8, 0x35, 0xEB, 0x4E, 0xDE, 0xF5, 0x9F, 0x66, 0x79, + 0x52, 0x44, 0xD2, 0x49, 0x3A, 0x94, 0xE2, 0xCB, 0x83, 0x22, 0x7D, 0xC6, 0x1C, 0xEB, 0x44, 0x28, + 0xE9, 0x38, 0x8F, 0xB7, 0xF6, 0x3D, 0x39, 0x8F, 0x64, 0x9F, 0x86, 0x85, 0x27, 0x7E, 0xBF, 0xD8, + 0xC3, 0x8B, 0x70, 0xF9, 0x7A, 0xE6, 0x19, 0xAF, 0xA8, 0x8F, 0x6C, 0x38, 0xE2, 0xB4, 0x1E, 0xF3, + 0xDD, 0xFD, 0x6C, 0xB4, 0x04, 0xB4, 0xD1, 0x37, 0xF4, 0x59, 0xFF, 0x5A, 0x8B, 0x73, 0x6B, 0x62, + 0x6C, 0x91, 0x23, 0x96, 0x61, 0xEC, 0x9F, 0xF6, 0x83, 0x18, 0xD9, 0xEE, 0xEF, 0x00, 0xB0, 0xEB, + 0x8D, 0xC6, 0x35, 0xCE, 0xB4, 0xE0, 0xBB, 0x84, 0xD3, 0xD7, 0xDB, 0x77, 0x4A, 0x07, 0xE7, 0x3B, + 0xF7, 0x12, 0xF8, 0x9D, 0xF5, 0x0A, 0xDF, 0xF4, 0x1B, 0x00, 0x1A, 0x77, 0xD9, 0x03, 0x21, 0xC2, + 0x46, 0xF7, 0x7E, 0x4B, 0xE2, 0xC1, 0xF1, 0x8D, 0xFE, 0x61, 0xB9, 0xD4, 0x0B, 0xC9, 0x65, 0x82, + 0xCF, 0x7F, 0x3D, 0x24, 0x9E, 0xC9, 0x97, 0x30, 0xE9, 0x81, 0xB4, 0x6B, 0xA5, 0x6A, 0xA7, 0xED, + 0xE3, 0x8F, 0x88, 0x09, 0x78, 0x36, 0x6A, 0x14, 0xB9, 0xBB, 0x93, 0xE6, 0xA2, 0x07, 0x72, 0x81, + 0xD2, 0x41, 0x75, 0x28, 0x50, 0x57, 0xDE, 0x68, 0x04, 0xB1, 0x0F, 0x1F, 0xCF, 0x0F, 0x3E, 0xCB, + 0x44, 0x3D, 0x2A, 0x01, 0xC1, 0x38, 0x61, 0x8E, 0xA1, 0x13, 0xB8, 0x82, 0x3F, 0xAC, 0xA7, 0x31, + 0x7B, 0xF7, 0xA7, 0xCD, 0xBF, 0x15, 0xD3, 0xC2, 0xCC, 0xDC, 0xD0, 0xB2, 0xC1, 0x44, 0xBA, 0x82, + 0x85, 0x2D, 0x59, 0x53, 0xE4, 0xBE, 0x6B, 0x69, 0x8F, 0x5C, 0x20, 0x38, 0x76, 0xE0, 0x49, 0x59, + 0x32, 0x0A, 0x90, 0x42, 0x13, 0x35, 0x24, 0x71, 0xD9, 0x98, 0x9A, 0x0F, 0x0A, 0x83, 0x90, 0x47, + 0xD0, 0x57, 0x29, 0xC8, 0xF5, 0x5B, 0xA8, 0x5D, 0x41, 0xCD, 0x61, 0x98, 0x5C, 0x28, 0x1B, 0xF2, + 0x9B, 0x31, 0x3F, 0x14, 0x79, 0x37, 0xEA, 0xDD, 0x42, 0xD3, 0x59, 0x20, 0x0D, 0x5A, 0x3D, 0x59, + 0x84, 0x1A, 0x48, 0x28, 0x6D, 0x48, 0x3B, 0x0C, 0x87, 0xB0, 0xBB, 0xEF, 0x72, 0x91, 0x85, 0xE0, + 0x9A, 0x2C, 0x78, 0xAF, 0xFE, 0x0D, 0x6D, 0x9A, 0x99, 0x10, 0x16, 0x7D, 0x42, 0x76, 0xA0, 0xAA, + 0xC7, 0xF9, 0x11, 0x5C, 0x04, 0x83, 0x0A, 0xA9, 0x48, 0x65, 0x28, 0x81, 0x65, 0x2E, 0xA7, 0x5A, + 0xFE, 0xDB, 0x10, 0x56, 0xEA, 0x19, 0x67, 0xC2, 0x61, 0xBB, 0x9B, 0x6B, 0x48, 0x4F, 0x22, 0x4C, + 0xB7, 0xEC, 0x15, 0x84, 0x08, 0x1A, 0xFE, 0x08, 0x46, 0xCA, 0x72, 0x10, 0x30, 0x81, 0xAE, 0xE7, + 0x1B, 0xAA, 0x2F, 0x1B, 0x22, 0x6A, 0x89, 0x95, 0x34, 0x9F, 0x53, 0xE4, 0xDA, 0x0B, 0x1B, 0x56, + 0xB4, 0xB7, 0x71, 0x99, 0xB8, 0x77, 0x91, 0xEB, 0x59, 0x61, 0x71, 0x84, 0xAF, 0x55, 0xBD, 0x33, + 0x1C, 0xD9, 0x7A, 0x40, 0xD3, 0x7B, 0x6C, 0xB0, 0xA4, 0x96, 0x07, 0x57, 0x49, 0x9C, 0xC1, 0x0B, + 0x23, 0xF3, 0xE5, 0x36, 0xA4, 0xE8, 0xE1, 0xEC, 0x51, 0xF1, 0xBB, 0x7B, 0x40, 0x4B, 0x05, 0xD1, + 0x3D, 0xD6, 0x6D, 0x22, 0x7C, 0x9D, 0x51, 0x28, 0x70, 0xF6, 0xB3, 0x0C, 0x6F, 0xB2, 0xE1, 0xBC, + 0xFF, 0xB8, 0xA3, 0x92, 0x7C, 0x0A, 0xA3, 0x36, 0x6D, 0xF8, 0xFC, 0x27, 0x45, 0x58, 0x94, 0xE0, + 0x0A, 0x90, 0xF8, 0x2A, 0xF3, 0x02, 0xA4, 0x98, 0xD8, 0xEF, 0x1C, 0x53, 0xE2, 0x47, 0xC7, 0x20, + 0xB2, 0x6F, 0xB7, 0x39, 0x5A, 0xA9, 0x49, 0xC2, 0x65, 0x18, 0x50, 0xBD, 0x7F, 0xB0, 0xDE, 0xBB, + 0x2F, 0x56, 0xDD, 0x62, 0x85, 0xAC, 0x3B, 0x7E, 0xCD, 0x00, 0x88, 0x7A, 0x22, 0xC5, 0x03, 0x03, + 0x26, 0xC4, 0x27, 0x09, 0xE8, 0x16, 0x36, 0xB7, 0x0B, 0xDF, 0xDA, 0x21, 0xEB, 0x59, 0xE8, 0x6D, + 0x96, 0x2D, 0x18, 0x89, 0xD4, 0x4E, 0x5A, 0x66, 0x63, 0x31, 0x15, 0xF0, 0x48, 0x50, 0x7A, 0xF3, + 0xA7, 0x82, 0xE0, 0x91, 0x04, 0xB2, 0x16, 0xAC, 0xA1, 0xD4, 0xC1, 0xE4, 0xBD, 0xC9, 0x43, 0x83, + 0xD9, 0x18, 0x11, 0x50, 0xC0, 0x93, 0x9D, 0x6B, 0x17, 0x63, 0xC8, 0xA3, 0xAF, 0xAC, 0xBF, 0x29, + 0x65, 0xA6, 0x4A, 0xE4, 0xCD, 0xE2, 0x89, 0x59, 0xF8, 0x96, 0xF8, 0x3B, 0x80, 0xCA, 0x68, 0xF2, + 0xBF, 0xBE, 0xFD, 0xD0, 0x84, 0x88, 0xE3, 0x3D, 0x08, 0x8A, 0x08, 0x39, 0xDC, 0x88, 0x71, 0x61, + 0x76, 0xAD, 0xB6, 0xBE, 0xC0, 0xA4, 0x28, 0xEE, 0x38, 0x8F, 0x2E, 0x8D, 0x3A, 0x28, 0xAE, 0xEB, + 0x93, 0x7E, 0xF4, 0x2E, 0x5F, 0x3B, 0xEA, 0x37, 0x9A, 0x53, 0x6C, 0xC5, 0x3A, 0x2F, 0x7F, 0xA9, + 0x80, 0x85, 0x18, 0xFE, 0x14, 0x0C, 0x37, 0xA7, 0xE2, 0x78, 0x90, 0x20, 0x1F, 0x41, 0x1C, 0x03, + 0xD1, 0xD0, 0x8C, 0xB2, 0x2D, 0x4C, 0x32, 0x81, 0x63, 0xF6, 0x6F, 0xD3, 0x7F, 0xB4, 0x6D, 0xA8, + 0xD6, 0xE0, 0x56, 0x84, 0xAD, 0x37, 0x96, 0x44, 0xB4, 0xAE, 0x6F, 0x49, 0x3E, 0x30, 0x0C, 0x79, + 0xE3, 0x93, 0xBA, 0xD2, 0x10, 0x71, 0xAC, 0x7C, 0x06, 0x89, 0x26, 0xCB, 0x72, 0x9E, 0xC4, 0xCC, + 0xBB, 0xA1, 0xDE, 0x9B, 0x66, 0x75, 0x6F, 0xAC, 0x51, 0x93, 0xE8, 0xF4, 0x43, 0xE4, 0x79, 0xF2, + 0x50, 0x67, 0x3D, 0x1B, 0x33, 0xB5, 0xEC, 0x93, 0x10, 0xCE, 0x78, 0x3C, 0x0C, 0x25, 0x44, 0x30, + 0x3C, 0xAB, 0x40, 0x6F, 0x4B, 0x54, 0x0C, 0x38, 0xD4, 0xEF, 0x18, 0xED, 0xA5, 0x75, 0x1E, 0x9C, + 0x06, 0x42, 0x11, 0x9D, 0xEC, 0xE8, 0x81, 0x38, 0xBE, 0xEF, 0x21, 0xB5, 0x0A, 0xC3, 0x38, 0x94, + 0x0C, 0x5A, 0xE2, 0x47, 0xDC, 0x2E, 0x82, 0xC3, 0xA6, 0x9D, 0xA6, 0x54, 0x5E, 0xE6, 0x7C, 0xFE, + 0x7E, 0x7B, 0x86, 0x9A, 0x54, 0xEC, 0xCD, 0xE5, 0x9F, 0xF7, 0x23, 0xDE, 0x06, 0x90, 0x93, 0xB6, + 0xCC, 0xC8, 0x3D, 0x75, 0xA6, 0x43, 0xEA, 0x1F, 0x44, 0xAB, 0xBB, 0x15, 0xC4, 0xAB, 0xB1, 0xDF, + 0xE9, 0x30, 0xB4, 0xB2, 0x3B, 0x5B, 0xA6, 0x57, 0xEE, 0x25, 0x4B, 0x83, 0x26, 0xE4, 0x6B, 0xE3, + 0x35, 0x62, 0xA5, 0xD2, 0xB6, 0xDE, 0xFD, 0x5F, 0x8C, 0x21, 0xF8, 0x15, 0x41, 0x1C, 0x61, 0xCD, + 0x78, 0x0F, 0x61, 0x9E, 0x0C, 0x7E, 0x88, 0xE3, 0x34, 0x7F, 0x0B, 0x00, 0x5D, 0x8A, 0x37, 0x5F, + 0xFB, 0x65, 0xB8, 0xEC, 0x6C, 0x6A, 0x7E, 0x8F, 0x70, 0x6A, 0x17, 0xFB, 0x6B, 0x9D, 0xD8, 0xC3, + 0xD5, 0x13, 0x49, 0xEC, 0xD0, 0xEC, 0x1B, 0xC7, 0x79, 0xBB, 0xD2, 0x89, 0x96, 0x39, 0x1C, 0xF3, + 0x70, 0xEA, 0xF0, 0xEA, 0x6B, 0x45, 0x51, 0xDB, 0x1A, 0x61, 0x60, 0x98, 0x1C, 0x7A, 0xA6, 0x48, + 0x65, 0xDA, 0x85, 0xBE, 0x6B, 0xC4, 0x27, 0x2F, 0x76, 0x6D, 0x5F, 0x4C, 0xDE, 0x92, 0xA1, 0xB3, + 0xD4, 0x11, 0xB4, 0x0B, 0x3A, 0x4C, 0x73, 0xC3, 0xAA, 0x9C, 0x0F, 0x95, 0x9B, 0x2C, 0x67, 0x02, + 0x47, 0xCD, 0xE3, 0x75, 0x84, 0x60, 0x5E, 0x17, 0xAB, 0xF0, 0xBC, 0xBE, 0xB4, 0xAA, 0x4C, 0xEA, + 0x11, 0x52, 0x87, 0xAC, 0x16, 0x56, 0x06, 0x1F, 0xC1, 0x97, 0xF9, 0xAB, 0x26, 0xD9, 0xCC, 0x58, + 0x01, 0xFF, 0x44, 0x21, 0xFE, 0x5D, 0x53, 0x0B, 0xA2, 0xAF, 0xBC, 0x9D, 0x63, 0x25, 0x87, 0x66, + 0xB3, 0x79, 0xB4, 0x9F, 0x49, 0xE6, 0x6E, 0xCB, 0x8B, 0x39, 0x8C, 0x46, 0x60, 0x3D, 0x5B, 0xEC, + 0x08, 0x1B, 0xB2, 0xEC, 0xA2, 0xAA, 0x9A, 0xDA, 0xAA, 0xAD, 0x25, 0xAB, 0x45, 0x99, 0x63, 0x23, + 0x6C, 0x53, 0x87, 0xA0, 0x5A, 0x6C, 0xD6, 0xE3, 0x6C, 0x34, 0x42, 0x0F, 0xF3, 0xA0, 0x23, 0xD3, + 0x16, 0x05, 0xAB, 0x05, 0x14, 0xA8, 0xA9, 0x02, 0x23, 0xFC, 0xC0, 0xED, 0x75, 0xC5, 0x43, 0x7C, + 0x1E, 0xB1, 0x69, 0xB6, 0x01, 0x96, 0x7B, 0x9E, 0x12, 0x1C, 0x72, 0x42, 0x0D, 0xAB, 0x0B, 0x79, + 0x22, 0xF3, 0xF0, 0xEB, 0x71, 0x83, 0x42, 0x3C, 0x11, 0xC7, 0x4F, 0x87, 0xFF, 0x5D, 0x19, 0x0B, + 0xE4, 0x1E, 0xC3, 0xA2, 0xD7, 0x0E, 0x9C, 0x3C, 0x7D, 0xFB, 0x4F, 0xDA, 0x99, 0x9F, 0xF8, 0x3E, + 0xD4, 0xA0, 0xA2, 0xF8, 0x83, 0x33, 0x1E, 0xE2, 0x1C, 0x52, 0x9D, 0xB8, 0x63, 0x8F, 0xA1, 0x4D, + 0x68, 0xAE, 0xCE, 0xD4, 0x12, 0x8E, 0x96, 0xA1, 0x78, 0x27, 0x6A, 0x29, 0x11, 0x19, 0x4C, 0x94, + 0x89, 0x0F, 0xFB, 0x7C, 0xA8, 0xAC, 0x7E, 0x84, 0x44, 0xC8, 0x7A, 0x18, 0xAE, 0x34, 0x0F, 0x6E, + 0x90, 0xDB, 0x1E, 0x79, 0xFA, 0xE8, 0xAF, 0x71, 0xE4, 0x80, 0x24, 0x53, 0x2F, 0xB6, 0xC2, 0x12, + 0x1F, 0xA0, 0x44, 0x98, 0x40, 0xAE, 0x01, 0xD6, 0xFB, 0x86, 0xBB, 0xC6, 0xF7, 0x2F, 0x38, 0x41, + 0xE3, 0x2E, 0x1F, 0x2E, 0x7C, 0x90, 0x1F, 0xD9, 0xD3, 0x34, 0x86, 0xC8, 0xA3, 0x8E, 0xAB, 0x5E, + 0x05, 0x55, 0x71, 0x5B, 0x21, 0xB7, 0x2F, 0x9E, 0x56, 0x32, 0x56, 0xD1, 0xDC, 0xC9, 0xDA, 0xDE, + 0xAC, 0x1D, 0x91, 0x0E, 0x4D, 0x1F, 0x4F, 0xE7, 0x31, 0xFE, 0x9A, 0x3F, 0x18, 0xAD, 0x85, 0x4E, + 0x66, 0x95, 0x76, 0x67, 0x6A, 0xC8, 0x90, 0x6A, 0xB5, 0xB0, 0x7D, 0xB2, 0xB3, 0xD7, 0xD6, 0x42, + 0xF1, 0x63, 0x52, 0xBD, 0x72, 0xE1, 0xD2, 0x63, 0x9A, 0x00, 0x45, 0x8E, 0x77, 0xCF, 0x93, 0xCF, + 0x1A, 0x31, 0xAA, 0x16, 0xA9, 0xCF, 0x45, 0xE3, 0x99, 0x3E, 0x6C, 0x70, 0xE9, 0x93, 0x83, 0x78, + 0x11, 0xB8, 0x80, 0xEA, 0x75, 0x5A, 0x87, 0xCE, 0x1D, 0xCD, 0x12, 0x5F, 0x1F, 0x6F, 0x86, 0x25, + 0x5E, 0x95, 0x22, 0x07, 0xFE, 0x29, 0xDA, 0x93, 0x52, 0x41, 0x62, 0x79, 0x06, 0x06, 0x83, 0xAE, + 0x42, 0x35, 0x5C, 0x9E, 0x01, 0xF8, 0xFA, 0x3F, 0x07, 0x15, 0xCA, 0x02, 0x69, 0x8E, 0xEA, 0x9E, + 0xEF, 0xF4, 0x99, 0x26, 0x73, 0x42, 0xC2, 0xEC, 0x0F, 0xEC, 0x03, 0x8F, 0x66, 0xC1, 0x88, 0x76, + 0xC5, 0xC2, 0x55, 0x46, 0x59, 0xC4, 0x28, 0x55, 0x93, 0xBF, 0x7C, 0x1C, 0x5C, 0xA0, 0xBA, 0x8A, + 0xCA, 0x8A, 0x81, 0x6C, 0xA3, 0xDE, 0x2D, 0x63, 0xC5, 0xCA, 0x0B, 0x8E, 0x99, 0xC9, 0xE4, 0x7E, + 0x32, 0x36, 0xD8, 0xFA, 0x80, 0xA5, 0x93, 0x4F, 0x5C, 0x97, 0x33, 0x74, 0xD2, 0x03, 0xFF, 0xFD, + 0x57, 0x84, 0x26, 0x62, 0x6A, 0x4C, 0x15, 0x45, 0xB9, 0x7C, 0xCD, 0xD8, 0x7B, 0xC5, 0x70, 0xA1, + 0xCB, 0xB4, 0xDE, 0xA6, 0xBD, 0xE0, 0xE9, 0x49, 0xB7, 0xEA, 0x21, 0x17, 0xCD, 0x0C, 0xA7, 0xF2, + 0x9B, 0xB6, 0x26, 0x06, 0xB1, 0x63, 0x3D, 0x0D, 0x1A, 0xAE, 0x57, 0xF1, 0x53, 0xDA, 0x61, 0x47, + 0x7E, 0x66, 0xC0, 0x2A, 0xAC, 0x7E, 0xE8, 0xE9, 0x4F, 0xC2, 0x21, 0x01, 0x0B, 0x9C, 0xA7, 0x98, + 0x05, 0x3A, 0x34, 0x68, 0x19, 0x26, 0x35, 0x57, 0xF7, 0xF8, 0xE0, 0x77, 0x7B, 0x42, 0x8D, 0xE0, + 0xD3, 0x08, 0x49, 0x62, 0x1D, 0x86, 0xBE, 0xC8, 0xDC, 0x2F, 0xE0, 0xFF, 0xC4, 0x6E, 0xBD, 0xEC, + 0x8B, 0x33, 0xF1, 0x61, 0x6E, 0x96, 0xEB, 0xEA, 0x87, 0x4C, 0xA3, 0x5F, 0x97, 0x92, 0x22, 0x0C, + 0x36, 0x05, 0xA5, 0xC1, 0xF6, 0xB8, 0xF5, 0xE0, 0xE4, 0x91, 0x73, 0x73, 0xD0, 0x38, 0x81, 0x24, + 0x13, 0xB4, 0x4B, 0xAB, 0x4C, 0xBB, 0x15, 0x56, 0xC2, 0x66, 0xF9, 0x27, 0xEF, 0xE0, 0x3D, 0x4E, + 0xDB, 0x12, 0xCB, 0xC1, 0xDE, 0x57, 0x1B, 0x7F, 0x69, 0x10, 0xE4, 0x6E, 0xF7, 0xCC, 0x0F, 0x64, + 0x31, 0x6A, 0xBF, 0x49, 0x6C, 0xF8, 0x9E, 0xC9, 0x37, 0xF9, 0x26, 0x32, 0x4A, 0x26, 0x97, 0x99, + 0x30, 0xA6, 0x86, 0x82, 0xCE, 0x04, 0x8B, 0xFB, 0x39, 0x3B, 0xEF, 0x05, 0xAE, 0x3F, 0xFD, 0xEA, + 0x21, 0xA7, 0xF9, 0xD8, 0x2D, 0x34, 0x42, 0xE4, 0xDC, 0x40, 0x1C, 0x82, 0x94, 0x89, 0xC4, 0x74, + 0x0C, 0xF6, 0x76, 0x65, 0x13, 0x29, 0x85, 0xE7, 0xF6, 0x8C, 0x19, 0x3D, 0xC2, 0x69, 0x79, 0x07, + 0x8C, 0x47, 0x24, 0x24, 0x4C, 0xD6, 0x41, 0x93, 0x70, 0x40, 0x08, 0x6D, 0x49, 0x4D, 0x92, 0xAA, + 0x9D, 0x02, 0xAB, 0x53, 0x8D, 0x8C, 0x96, 0x75, 0x54, 0xD0, 0xA2, 0x45, 0xBA, 0x19, 0x81, 0xFE, + 0x20, 0xCC, 0x93, 0x78, 0x4D, 0xBB, 0xA2, 0x21, 0xAB, 0xB5, 0x1B, 0x47, 0x0C, 0xA2, 0x34, 0x24, + 0x1E, 0xF3, 0x40, 0xF3, 0xC8, 0x79, 0xAE, 0x00, 0x40, 0xC3, 0xC4, 0x1B, 0x41, 0x5E, 0xF4, 0x08, + 0x7D, 0x15, 0xF1, 0xDF, 0xE2, 0x34, 0x78, 0xC3, 0x2A, 0x91, 0x8D, 0xC1, 0xA7, 0xF4, 0xD0, 0xF9, + 0xE7, 0x4E, 0x9F, 0xDC, 0x56, 0x16, 0x6C, 0x5B, 0x48, 0x10, 0x7E, 0xE9, 0xA6, 0x3F, 0x3B, 0xD0, + 0xFD, 0x12, 0x46, 0x1B, 0xFF, 0x61, 0x76, 0x61, 0xCC, 0x24, 0x1C, 0x94, 0xDF, 0x77, 0x6F, 0xAE, + 0x8E, 0xEE, 0x96, 0xF6, 0x9B, 0xB4, 0xE9, 0xA5, 0x1E, 0x6D, 0x7C, 0x2C, 0x43, 0xFB, 0x74, 0xF3, + 0x23, 0x86, 0xE6, 0x07, 0xC7, 0x36, 0xE3, 0xED, 0xAF, 0xDD, 0x75, 0x61, 0xCD, 0xFE, 0xEE, 0x4B, + 0x82, 0xF7, 0xC7, 0x66, 0x2B, 0x4C, 0xFF, 0x97, 0x77, 0x1A, 0xF5, 0xA5, 0x55, 0xF2, 0xBD, 0xC0, + 0xD4, 0xD8, 0x07, 0x2A, 0x92, 0xB0, 0x04, 0x56, 0x55, 0x3F, 0x1B, 0xCA, 0x21, 0x25, 0x3F, 0xB9, + 0x81, 0x01, 0x94, 0x43, 0xEE, 0x83, 0xD5, 0x10, 0xB4, 0x13, 0x19, 0xC0, 0x06, 0xBA, 0xEF, 0xA3, + 0xE4, 0xEC, 0xD8, 0x66, 0x30, 0x58, 0xA2, 0xE7, 0x81, 0x65, 0xDA, 0xA1, 0x35, 0x28, 0x4B, 0x47, + 0x17, 0x95, 0xA3, 0x8C, 0x67, 0x44, 0xC8, 0x8B, 0x1B, 0x5F, 0xE9, 0x0E, 0x99, 0xA3, 0x39, 0xAF, + 0x5C, 0xCA, 0x0D, 0x68, 0xAD, 0xE0, 0x91, 0xF3, 0x95, 0x54, 0x02, 0xFF, 0xC4, 0x23, 0xA1, 0x2E, + 0xCE, 0xD2, 0xFC, 0x34, 0x5A, 0xF0, 0x83, 0x82, 0x54, 0x07, 0xDE, 0x21, 0x0D, 0xE3, 0xDF, 0x86, + 0xC1, 0x6E, 0xAB, 0x95, 0x28, 0x90, 0xED, 0x3B, 0x93, 0x95, 0x9E, 0xDE, 0xBA, 0x3E, 0x32, 0x85, + 0x0F, 0xB9, 0x62, 0x68, 0x00, 0x93, 0x38, 0xF9, 0x6B, 0x36, 0x5E, 0xAB, 0x9F, 0xDD, 0x84, 0x97, + 0xB8, 0xAB, 0xDA, 0x29, 0x88, 0xEC, 0x9D, 0xFA, 0xAA, 0x34, 0x2B, 0x1E, 0xC0, 0x6C, 0x53, 0xD4, + 0x55, 0x40, 0x45, 0x9F, 0xEC, 0x0A, 0x90, 0x51, 0xC5, 0x7A, 0x8A, 0xF6, 0xEE, 0x62, 0xC2, 0xE9, + 0x57, 0x2A, 0x1D, 0x8F, 0xB6, 0x83, 0xF9, 0x44, 0x42, 0x33, 0x2A, 0x3D, 0xC7, 0x46, 0xDA, 0xCA, + 0xBC, 0x6B, 0x49, 0x7F, 0x94, 0xB0, 0x6C, 0x80, 0xEC, 0x76, 0x96, 0x12, 0xB9, 0x05, 0x47, 0x96, + 0x84, 0x98, 0xCF, 0x8F, 0x21, 0xF5, 0x6B, 0x86, 0xB8, 0xD4, 0x80, 0xBA, 0xEA, 0x3C, 0xF6, 0x7A, + 0x98, 0xE9, 0x1A, 0x5E, 0x2C, 0x69, 0x1A, 0x2A, 0x31, 0xB9, 0xE6, 0x28, 0xA3, 0xCA, 0xC2, 0x70, + 0xDB, 0xF0, 0x30, 0x28, 0xD3, 0xD6, 0x17, 0xAD, 0x73, 0x8D, 0xB3, 0xF5, 0xFD, 0xA3, 0x6D, 0x8A, + 0xAE, 0x7A, 0x69, 0xD7, 0x6E, 0x4C, 0x29, 0x44, 0xBD, 0x57, 0xBA, 0xC9, 0xFD, 0xA1, 0xEF, 0xA9, + 0xA0, 0x98, 0x39, 0x7A, 0x05, 0x61, 0x46, 0x55, 0x77, 0x5C, 0x1A, 0x39, 0x38, 0x98, 0xFA, 0x79, + 0x9A, 0xBC, 0x68, 0xDB, 0x29, 0x51, 0xDD, 0x2C, 0xEC, 0xFA, 0x61, 0x93, 0x93, 0x44, 0xF2, 0x7E, + 0xD7, 0xA2, 0x79, 0xF1, 0xBD, 0x19, 0x81, 0x36, 0x04, 0x3A, 0x26, 0x20, 0x07, 0x3E, 0x01, 0x8E, + 0x16, 0xE0, 0x6F, 0xF6, 0x29, 0xB8, 0x0B, 0xAC, 0x37, 0x19, 0x39, 0x91, 0x09, 0x23, 0xA6, 0x9C, + 0xAD, 0x08, 0x70, 0xA8, 0x66, 0x0A, 0x22, 0xA2, 0x2E, 0xC5, 0xB9, 0x7F, 0x58, 0xC0, 0x2F, 0x07, + 0x61, 0xB9, 0x2D, 0x3F, 0xA9, 0xB1, 0x67, 0x52, 0xC1, 0x1C, 0x2C, 0xB4, 0xFC, 0x02, 0xA8, 0x4F, + 0x71, 0x87, 0x7F, 0x42, 0x35, 0x93, 0x25, 0xF5, 0x81, 0x07, 0xF9, 0x75, 0x01, 0xBE, 0x08, 0x15, + 0xC5, 0xD1, 0xED, 0x91, 0xB6, 0x0B, 0xC8, 0x8B, 0x4D, 0x62, 0x54, 0xD7, 0x14, 0x9C, 0x3E, 0xEA, + 0x15, 0x3E, 0x91, 0x4F, 0x2F, 0xB5, 0x5C, 0x5A, 0x13, 0x6D, 0x24, 0xE5, 0xB1, 0xA2, 0xFC, 0xAF, + 0x5F, 0x85, 0x13, 0x52, 0x9F, 0x80, 0x19, 0xBB, 0xB7, 0x9A, 0xC6, 0x92, 0x49, 0x2D, 0x28, 0xA7, + 0xA2, 0x28, 0xFA, 0x4A, 0x7B, 0xBA, 0x99, 0x15, 0xA9, 0xF3, 0x51, 0xED, 0xA5, 0xD7, 0x9A, 0xC1, + 0x7A, 0x1E, 0x77, 0x57, 0xBB, 0xA7, 0x25, 0x10, 0xE9, 0x69, 0xAC, 0x50, 0xEF, 0xEC, 0x85, 0x02, + 0x52, 0xC9, 0x29, 0xE9, 0xCB, 0xC8, 0xD0, 0x2D, 0x43, 0xAD, 0x26, 0x93, 0xA8, 0x12, 0xE3, 0xEB, + 0xB1, 0x1E, 0xA2, 0x8D, 0xE4, 0xF7, 0x8F, 0x4B, 0x55, 0xE7, 0xD7, 0x98, 0x3B, 0x7B, 0x85, 0x16, + 0xEE, 0x5A, 0xD8, 0x61, 0x65, 0x57, 0xBC, 0x74, 0x62, 0xD3, 0xDC, 0x7C, 0x6D, 0xCC, 0x56, 0xB0, + 0x3B, 0xA7, 0xE9, 0x10, 0xDE, 0x6A, 0xF4, 0x3A, 0xEC, 0x7E, 0x2E, 0xD0, 0x1E, 0x81, 0x48, 0xD3, + 0xEC, 0xD7, 0xC5, 0xDB, 0x16, 0xBD, 0xD5, 0x5B, 0xAD, 0x8E, 0x13, 0x5A, 0x2A, 0x9E, 0x1A, 0x96, + 0xC3, 0x7E, 0x23, 0xAD, 0xA7, 0x45, 0xE0, 0xCE, 0xA4, 0x52, 0x0C, 0x2A, 0x2E, 0x84, 0x9D, 0xB3, + 0xB4, 0x21, 0x18, 0xA7, 0xCF, 0x57, 0xA3, 0xFE, 0xA1, 0x27, 0x99, 0xCE, 0x48, 0x1E, 0xA7, 0xDB, + 0x62, 0x13, 0x9B, 0x19, 0xE3, 0xBF, 0xAA, 0xA2, 0x9D, 0x29, 0xC9, 0x92, 0xD1, 0x5A, 0x43, 0x4E, + 0xC4, 0xF8, 0xB4, 0xD9, 0xFC, 0xBD, 0x1A, 0xBB, 0x4D, 0x23, 0x99, 0xF3, 0x86, 0xE6, 0xBC, 0xB7, + 0x03, 0xE1, 0xA9, 0xD7, 0xDF, 0x5C, 0x15, 0x56, 0xB4, 0x63, 0xC2, 0x71, 0x6D, 0x15, 0xF1, 0x85, + 0xB6, 0xFF, 0x85, 0x4B, 0x6C, 0x36, 0xDB, 0xA8, 0x07, 0x22, 0x92, 0x4F, 0xD5, 0xA3, 0x2B, 0x40, + 0x8F, 0x6D, 0x89, 0xE3, 0x3E, 0xA2, 0x40, 0xAE, 0x80, 0xA5, 0x3A, 0xD2, 0x5D, 0x7E, 0x74, 0x6A, + 0x94, 0xED, 0xA3, 0xF2, 0x4C, 0x2E, 0x57, 0xF2, 0xBE, 0x8B, 0x25, 0xEF, 0x87, 0x0C, 0x05, 0x99, + 0x27, 0x5E, 0xA5, 0xDE, 0xAE, 0x94, 0x49, 0xFD, 0x7A, 0x62, 0xA7, 0x74, 0x58, 0x8A, 0x1A, 0xED, + 0x15, 0x23, 0x1D, 0x83, 0xD7, 0xA4, 0x6B, 0x4F, 0x3F, 0x9C, 0xBB, 0x5B, 0x27, 0xAD, 0x5C, 0x7E, + 0xA2, 0xE0, 0xBF, 0x39, 0x0C, 0x73, 0xB1, 0x48, 0x07, 0xC1, 0x3B, 0xD5, 0xA6, 0x2D, 0x94, 0x20, + 0x6D, 0xE6, 0x91, 0xAD, 0xCC, 0xDE, 0x4A, 0x3C, 0x4C, 0x02, 0x92, 0xCD, 0x41, 0x46, 0x3C, 0x88, + 0x5A, 0xB6, 0xF6, 0x8F, 0x85, 0x05, 0x7E, 0x75, 0xAC, 0x92, 0x92, 0x99, 0xF4, 0x36, 0x21, 0xE9, + 0x0D, 0x19, 0x02, 0xA1, 0xF0, 0xF1, 0xDB, 0xD8, 0x8F, 0x48, 0x11, 0x5D, 0x84, 0x80, 0x24, 0xD8, + 0xEE, 0x57, 0xB2, 0x3A, 0xE6, 0x0E, 0xC5, 0xA1, 0x26, 0xF9, 0x0C, 0x2E, 0x6C, 0x3A, 0x7A, 0x8B, + 0x0B, 0x9B, 0x3D, 0x2E, 0xAF, 0x26, 0x7D, 0x02, 0x63, 0xC8, 0x0D, 0x24, 0x7D, 0x36, 0x19, 0xAB, + 0xAC, 0xA9, 0x10, 0xA0, 0x53, 0x25, 0x4C, 0xC7, 0x4C, 0x28, 0x4A, 0xC3, 0x38, 0x92, 0xE2, 0x3D, + 0xF3, 0xE1, 0x93, 0xDE, 0x3E, 0x77, 0xAC, 0xEF, 0x6A, 0x08, 0x44, 0xE8, 0x20, 0x18, 0xA3, 0xA0, + 0x90, 0x56, 0xDD, 0xAB, 0x77, 0x7D, 0x36, 0xC2, 0x91, 0xB5, 0x44, 0x8C, 0xD4, 0x57, 0x2C, 0x81, + 0xA1, 0xB9, 0xD9, 0x59, 0x50, 0x8A, 0x76, 0x88, 0x5A, 0x5E, 0x45, 0x99, 0xAC, 0x8C, 0x40, 0x14, + 0x46, 0x28, 0x77, 0xED, 0x1C, 0x7C, 0x59, 0x36, 0x83, 0x4A, 0xA7, 0x0A, 0x71, 0x9C, 0x3B, 0x02, + 0x43, 0x50, 0x74, 0x85, 0xE3, 0xD4, 0x0A, 0x3B, 0x1B, 0xE2, 0xD7, 0x1F, 0x79, 0x78, 0x4B, 0x00, + 0x8E, 0x0A, 0x99, 0xDF, 0x14, 0x17, 0xCD, 0xB8, 0xCF, 0x21, 0xB3, 0x85, 0x38, 0xDE, 0x01, 0xBA, + 0x1B, 0x95, 0x4B, 0x97, 0x2B, 0xB0, 0xC9, 0xED, 0x45, 0xCE, 0x22, 0x5B, 0x8E, 0x04, 0x91, 0x07, + 0x58, 0xC8, 0xB5, 0xA7, 0x06, 0x62, 0x9D, 0xC4, 0xAC, 0x1E, 0x08, 0xFD, 0xEA, 0xB7, 0x4D, 0x0B, + 0xD2, 0x79, 0xA8, 0xEF, 0x4F, 0xBE, 0x80, 0xE6, 0x55, 0x44, 0x7B, 0x59, 0x5E, 0x9C, 0x92, 0x6A, + 0x92, 0xF7, 0xE7, 0x78, 0xFB, 0x46, 0xA1, 0xF4, 0x1E, 0x36, 0x8B, 0xE2, 0x86, 0xA2, 0xE1, 0x19, + 0xB5, 0x29, 0xEA, 0xD2, 0x1D, 0x0B, 0x68, 0xC5, 0x2F, 0x4F, 0x48, 0x6A, 0xC8, 0x92, 0xCE, 0x64, + 0x9D, 0xA5, 0x86, 0xA5, 0x05, 0x40, 0xCE, 0xD7, 0x6C, 0x69, 0x9F, 0x6C, 0xB2, 0xA3, 0x11, 0x08, + 0xEF, 0x9B, 0xCD, 0x10, 0x07, 0x7B, 0x9E, 0x25, 0xF4, 0x1A, 0x2B, 0x21, 0x7E, 0xA5, 0xB9, 0xE1, + 0x33, 0x52, 0xFA, 0x04, 0x09, 0xD4, 0x78, 0xCB, 0x56, 0xE6, 0x55, 0x2C, 0xB4, 0x5D, 0xBB, 0x40, + 0x34, 0xE5, 0x23, 0x30, 0xB8, 0x65, 0x19, 0xF1, 0x5A, 0x08, 0xF2, 0xF4, 0x86, 0x45, 0xB7, 0x87, + 0x17, 0xFA, 0x68, 0x6A, 0x1F, 0x7E, 0x69, 0xDA, 0x89, 0x8E, 0xCA, 0xB6, 0xFF, 0x9F, 0x4E, 0x6F, + 0x25, 0x46, 0x46, 0xF6, 0x7B, 0x1E, 0xB3, 0x3D, 0x2C, 0x8C, 0x01, 0xA9, 0x7B, 0xDA, 0xE9, 0x4D, + 0x6E, 0x89, 0x9D, 0x0F, 0x3F, 0x9F, 0x15, 0x3C, 0xFE, 0x35, 0x61, 0x2A, 0x45, 0xC2, 0xA9, 0xC5, + 0x5C, 0x51, 0xCC, 0x6B, 0xCC, 0x2F, 0xA7, 0x60, 0x03, 0x71, 0xF0, 0xB3, 0xBF, 0x7B, 0x76, 0xCC, + 0x89, 0x2C, 0x31, 0x79, 0xE6, 0xDC, 0x7C, 0x39, 0x24, 0xD8, 0x1A, 0x98, 0x1F, 0x98, 0xCD, 0xD4, + 0x7E, 0x04, 0xF2, 0x92, 0x8D, 0x23, 0x03, 0x5F, 0xF3, 0x05, 0x3B, 0xB0, 0x0A, 0xF0, 0x7A, 0xCA, + 0x76, 0xCB, 0xD0, 0xBA, 0xA0, 0x7F, 0xBA, 0x0D, 0x68, 0x60, 0xC3, 0xEF, 0xDC, 0x44, 0x2E, 0x40, + 0x24, 0x9D, 0xCB, 0x1D, 0x5A, 0x0C, 0x51, 0x66, 0x1A, 0x2A, 0x68, 0xA6, 0x83, 0x20, 0x79, 0x9B, + 0x24, 0xEA, 0x10, 0x5A, 0xB4, 0x39, 0x58, 0xAC, 0xA0, 0x45, 0x3B, 0x16, 0xBE, 0x24, 0x59, 0x1D, + 0x18, 0x5C, 0xD8, 0xCD, 0xFE, 0x16, 0x5C, 0x84, 0x5C, 0x2D, 0x7D, 0x28, 0xC9, 0xCE, 0x9D, 0x38, + 0xF6, 0x2F, 0x9A, 0x8A, 0x93, 0x95, 0xDC, 0x73, 0x48, 0xFD, 0xF5, 0xAB, 0xF4, 0x06, 0xB4, 0x11, + 0x79, 0x7B, 0xF7, 0x75, 0x73, 0xC2, 0x2D, 0x9C, 0x91, 0x7E, 0x51, 0x12, 0x54, 0xAC, 0x55, 0x29, + 0x48, 0x7F, 0x50, 0x15, 0xC2, 0x79, 0x05, 0x3C, 0x8F, 0xB4, 0xAE, 0xDD, 0x28, 0x09, 0xCC, 0x1D, + 0xDE, 0xEF, 0x82, 0xFD, 0x64, 0xD1, 0x5A, 0xFE, 0x06, 0x18, 0x7C, 0xF6, 0x32, 0x67, 0xDB, 0xF1, + 0x55, 0xF4, 0x09, 0x33, 0xB4, 0x91, 0xA7, 0x68, 0xE7, 0xA3, 0x60, 0x93, 0xE6, 0x36, 0xDE, 0x28, + 0xB3, 0xBD, 0x90, 0x46, 0x7F, 0xE5, 0xAF, 0x3C, 0xB6, 0x5E, 0xF2, 0x98, 0xE6, 0x28, 0x07, 0xA9, + 0x21, 0x4C, 0xAA, 0xF7, 0x95, 0xD9, 0x25, 0x51, 0x7F, 0x26, 0x8F, 0xC9, 0xD6, 0x65, 0xCA, 0x07, + 0x82, 0x1F, 0x8E, 0xBF, 0xBA, 0x65, 0xF7, 0xB1, 0x51, 0x85, 0x99, 0x23, 0x4E, 0x48, 0x2E, 0x7B, + 0xC8, 0x09, 0xC4, 0x93, 0xB9, 0xDB, 0x6B, 0xAF, 0xCA, 0xC7, 0x0A, 0xC5, 0x6D, 0xD0, 0xC2, 0xD4, + 0xF5, 0xA1, 0x5E, 0x45, 0x28, 0x54, 0x1D, 0x87, 0xC8, 0x83, 0xAF, 0x9E, 0xB7, 0xC7, 0x4D, 0x48, + 0x3B, 0x49, 0x23, 0x8B, 0x23, 0x6A, 0x2D, 0xD6, 0x30, 0xAD, 0xD3, 0xFA, 0x35, 0x67, 0xF0, 0x0D, + 0x3A, 0xDC, 0x42, 0x57, 0xBE, 0xE6, 0x5B, 0x26, 0x0B, 0x30, 0x45, 0x7E, 0x71, 0x5D, 0x82, 0xE7, + 0x40, 0x45, 0x58, 0xBB, 0xF5, 0x07, 0xEC, 0x36, 0x47, 0xF7, 0x98, 0x05, 0x70, 0x83, 0x17, 0x9D, + 0xDD, 0x4A, 0x4A, 0xB7, 0xB5, 0xBC, 0x8B, 0xF5, 0x08, 0x47, 0x74, 0xF3, 0x0F, 0x3C, 0xB0, 0xC7, + 0x30, 0x88, 0xCF, 0xA2, 0xE1, 0xC3, 0x13, 0x52, 0x20, 0x2D, 0xAD, 0xB3, 0x99, 0x37, 0x71, 0x91, + 0xBB, 0x3F, 0x31, 0xAC, 0xEC, 0xB8, 0x2A, 0x84, 0x12, 0x34, 0x84, 0xE5, 0xBF, 0x47, 0x94, 0xD6, + 0x9A, 0x1F, 0xEB, 0x34, 0xAF, 0xDA, 0x93, 0x5D, 0x22, 0x88, 0x27, 0x1A, 0x04, 0x13, 0xAA, 0x06, + 0x52, 0x8C, 0x44, 0xCB, 0xCC, 0x70, 0x7A, 0xBF, 0xC3, 0x3D, 0x21, 0x71, 0x99, 0x4F, 0x06, 0x42, + 0x8B, 0x7F, 0xDA, 0xBC, 0xAF, 0x7C, 0x24, 0x94, 0x3F, 0xC9, 0xB9, 0xF0, 0xFB, 0x9C, 0xFB, 0x94, + 0xFC, 0x7F, 0xA0, 0x2F, 0x20, 0x4D, 0x57, 0x06, 0xDB, 0xA8, 0xC4, 0xBD, 0x02, 0x6C, 0xDD, 0x00, + 0x8C, 0x84, 0xEF, 0x63, 0xDB, 0x45, 0x34, 0x21, 0x69, 0x73, 0x53, 0x22, 0xD3, 0x61, 0xA6, 0x7A, + 0xDE, 0xC1, 0x66, 0xFD, 0x3B, 0x95, 0x13, 0x76, 0x06, 0xE4, 0x76, 0x0E, 0x63, 0xF2, 0x66, 0x56, + 0xE3, 0x80, 0x55, 0x57, 0xF3, 0x88, 0xA2, 0x5E, 0x84, 0x29, 0xFD, 0x44, 0x78, 0xA9, 0xF0, 0x3A, + 0xF9, 0xE7, 0xDD, 0x66, 0xE1, 0x48, 0xA4, 0xD7, 0x15, 0x06, 0x47, 0xBA, 0x1E, 0x70, 0xA0, 0xA2, + 0xBC, 0x79, 0xCF, 0x9B, 0xA6, 0x61, 0x95, 0x4F, 0xF8, 0x46, 0xA7, 0xD5, 0xB5, 0x5F, 0x66, 0xDD, + 0xE2, 0x5A, 0x8B, 0x29, 0xBA, 0x02, 0xC8, 0x1A, 0x17, 0xFD, 0x72, 0x45, 0xED, 0x63, 0x46, 0x64, + 0x5E, 0xC9, 0x24, 0x8D, 0x91, 0x38, 0xD1, 0xEF, 0xDF, 0x82, 0x09, 0xB0, 0x5B, 0x8C, 0x43, 0x5F, + 0xF9, 0x05, 0x34, 0x1E, 0x2B, 0x4D, 0xA8, 0xC3, 0xE5, 0x9A, 0xD5, 0x95, 0x1B, 0xC0, 0xB9, 0x30, + 0x55, 0xB1, 0xEF, 0x53, 0xD2, 0x86, 0x65, 0x96, 0xD1, 0x3C, 0x75, 0x9E, 0x43, 0xED, 0x72, 0x92, + 0x5F, 0xC3, 0xF8, 0x4C, 0x14, 0xA7, 0x77, 0x22, 0x48, 0x5E, 0xD0, 0x02, 0x32, 0xB4, 0x5F, 0xA9, + 0xCD, 0x9C, 0xF6, 0x46, 0x60, 0xEF, 0x4D, 0x14, 0x84, 0x6E, 0xC5, 0x2C, 0xA6, 0xB2, 0xFB, 0x38, + 0xD1, 0x0C, 0xB2, 0x87, 0xE8, 0x64, 0x1E, 0xFD, 0xC4, 0x28, 0x08, 0x37, 0x61, 0x85, 0x11, 0x44, + 0x76, 0xC9, 0x9F, 0xAD, 0x6D, 0xBC, 0xC0, 0xC8, 0x02, 0xC8, 0xDA, 0x22, 0x1D, 0xB3, 0x54, 0x5F, + 0x38, 0x0D, 0x1D, 0xC0, 0x78, 0x46, 0x7C, 0x46, 0x05, 0xC1, 0x51, 0x9A, 0xF7, 0x7E, 0x51, 0x75, + 0x32, 0xD6, 0xB1, 0x7E, 0x8B, 0x3A, 0xB9, 0xA8, 0x12, 0xAF, 0xF8, 0x20, 0x69, 0xED, 0x37, 0xB4, + 0xD2, 0x7D, 0x7C, 0x08, 0xE4, 0x74, 0xD8, 0x18, 0x2B, 0x6E, 0x65, 0x21, 0xC4, 0x8C, 0xF0, 0xB2, + 0x1A, 0x7D, 0xDD, 0xA5, 0xE9, 0xC3, 0x88, 0xEE, 0x7E, 0x80, 0xE3, 0x4B, 0x3A, 0x56, 0x3D, 0x4B, + 0x75, 0x62, 0xE1, 0xCE, 0xB6, 0xD5, 0xF1, 0xFC, 0x0C, 0x0A, 0x66, 0x10, 0xD2, 0xC0, 0xF3, 0xD3, + 0xCA, 0xFE, 0xD6, 0x73, 0xE4, 0x21, 0xDA, 0xED, 0xE4, 0xE4, 0x5A, 0xAC, 0x31, 0x6D, 0x84, 0x8E, + 0x24, 0x56, 0x6B, 0x09, 0x14, 0x09, 0x81, 0xD6, 0xC6, 0x92, 0x2B, 0xE5, 0x2F, 0x61, 0xCE, 0xD3, + 0xBD, 0x31, 0x10, 0x56, 0x4C, 0x68, 0x18, 0xA2, 0x4E, 0xBF, 0x22, 0x71, 0x77, 0x4A, 0xEC, 0x3F, + 0x8A, 0x10, 0xF9, 0x62, 0x7B, 0x4F, 0x7E, 0xE3, 0x16, 0x23, 0x3C, 0x4A, 0x7B, 0xD9, 0xCC, 0xA1, + 0x13, 0x09, 0x31, 0xD8, 0xD1, 0x23, 0xC4, 0xAD, 0x48, 0xD6, 0xC7, 0xCF, 0xB6, 0xE2, 0x5E, 0x53, + 0xAF, 0x45, 0xF4, 0xE4, 0x82, 0xDC, 0xB3, 0x5D, 0x19, 0x4A, 0x71, 0xBE, 0x75, 0x1D, 0x82, 0x9C, + 0xCD, 0x1F, 0x1E, 0xCE, 0xE1, 0xB6, 0x94, 0xED, 0x9A, 0x3A, 0x1A, 0x66, 0xFF, 0x5C, 0x43, 0x7D, + 0x51, 0x46, 0x09, 0xBB, 0xD0, 0x5D, 0x1A, 0x81, 0x98, 0x9A, 0xAC, 0x74, 0x94, 0xD3, 0x05, 0x55, + 0xE1, 0xE4, 0x2A, 0x43, 0xCC, 0xC8, 0x2C, 0x10, 0xA7, 0xE8, 0xAD, 0x5F, 0x02, 0xDF, 0x3B, 0x10, + 0x33, 0x43, 0x8A, 0x92, 0xF9, 0xCF, 0x12, 0x04, 0x60, 0xCD, 0xA0, 0x30, 0xA9, 0xE8, 0x32, 0x30, + 0x80, 0x8B, 0xF2, 0x09, 0xA4, 0x91, 0xFA, 0x3B, 0xBD, 0x1D, 0x54, 0xFD, 0xF8, 0xCF, 0x74, 0x70, + 0x50, 0x9B, 0x8D, 0x40, 0xBD, 0xC7, 0x3D, 0x4F, 0x03, 0x7B, 0x63, 0x32, 0xCE, 0x8B, 0x5B, 0x7C, + 0x9A, 0xE0, 0x3A, 0x37, 0x38, 0xCA, 0x31, 0x21, 0xDB, 0x4F, 0xF6, 0xF0, 0xDB, 0x4E, 0xE5, 0xDC, + 0x69, 0x4B, 0xAE, 0x28, 0x01, 0xF2, 0x46, 0x38, 0x6A, 0x9A, 0x50, 0x2D, 0xF4, 0x36, 0x5D, 0xEF, + 0x25, 0xB1, 0x31, 0xCA, 0x58, 0x5E, 0x4B, 0xE6, 0xAC, 0xCF, 0x0C, 0x20, 0x84, 0x7F, 0xF5, 0xC1, + 0x1A, 0xE5, 0x94, 0xC3, 0x3D, 0x77, 0x8E, 0xA3, 0x9B, 0xAF, 0x96, 0xBF, 0xD1, 0xEC, 0x35, 0x17, + 0x15, 0xDF, 0x2B, 0x00, 0xCD, 0x2C, 0xDB, 0xD3, 0x31, 0x8A, 0x6D, 0xE0, 0xB3, 0x1F, 0x71, 0xB4, + 0xA4, 0xCA, 0xFA, 0x40, 0xEB, 0x99, 0x4C, 0xFB, 0xFE, 0x9D, 0xBA, 0x26, 0x0F, 0x1B, 0x6D, 0xE6, + 0xB6, 0x2C, 0xAD, 0xF4, 0xD8, 0x12, 0xC0, 0xA3, 0xA4, 0x65, 0x10, 0x1B, 0xCD, 0xFD, 0x0A, 0xB0, + 0x52, 0x71, 0x56, 0xD4, 0x01, 0x49, 0xC9, 0x68, 0x06, 0xA1, 0xD3, 0x61, 0x8A, 0xC1, 0x07, 0x1B, + 0x06, 0x48, 0x78, 0x1B, 0x96, 0xCB, 0x7B, 0xC5, 0xF4, 0x8B, 0x27, 0x93, 0xF1, 0x10, 0x40, 0xB3, + 0x36, 0xA3, 0xA8, 0x19, 0xF3, 0x1B, 0x1B, 0xA4, 0xCD, 0x19, 0x18, 0x25, 0x7C, 0x24, 0xAC, 0x05, + 0xD1, 0xB2, 0xA1, 0x1E, 0x0B, 0xB3, 0xDA, 0x82, 0x3E, 0x78, 0x87, 0x12, 0x8F, 0xE6, 0xB9, 0x59, + 0x02, 0xDC, 0x15, 0x31, 0xA3, 0xAE, 0x22, 0x2F, 0xB7, 0x60, 0x08, 0x42, 0xA0, 0x4B, 0x94, 0xA1, + 0x1A, 0xD9, 0x32, 0x40, 0x2C, 0x33, 0x5A, 0x62, 0xB3, 0xDB, 0x9C, 0x04, 0x3B, 0xCE, 0x40, 0xCD, + 0x3C, 0x29, 0xDB, 0x1C, 0x98, 0xC7, 0x7B, 0x09, 0x65, 0x91, 0xCD, 0xB9, 0x71, 0x80, 0xF2, 0x14, + 0x90, 0x27, 0xA5, 0xC7, 0x16, 0xBB, 0xC8, 0x6D, 0x79, 0x0F, 0xC7, 0x06, 0x4F, 0xFD, 0xEF, 0x3D, + 0x7E, 0xA9, 0x1A, 0x20, 0x4A, 0x94, 0x3F, 0x84, 0xA1, 0x97, 0xE1, 0x99, 0xF5, 0x9E, 0xB2, 0x46, + 0x23, 0xC3, 0x48, 0x46, 0xC0, 0x2C, 0x7D, 0x64, 0x45, 0x7B, 0xA0, 0xBF, 0x5F, 0x14, 0xBC, 0xB2, + 0x17, 0x87, 0x68, 0x5C, 0x17, 0xCE, 0xCA, 0xEA, 0x73, 0x3C, 0xAE, 0x6C, 0x8C, 0x4A, 0x2C, 0xFB, + 0x77, 0x52, 0xE7, 0xA1, 0xFF, 0x6C, 0x23, 0x05, 0x1E, 0x69, 0x22, 0xF1, 0xDA, 0x6B, 0xB6, 0x01, + 0x44, 0xDE, 0xEB, 0x80, 0xB7, 0x84, 0x5B, 0xC7, 0xEA, 0x59, 0x5B, 0x3F, 0x23, 0x7E, 0x10, 0x00, + 0x27, 0x5C, 0x6A, 0x7B, 0xEB, 0xFF, 0xDF, 0x82, 0xEE, 0x85, 0x6C, 0xA5, 0x1A, 0xBF, 0xEB, 0x64, + 0xBB, 0x10, 0x46, 0x40, 0x51, 0x29, 0x2C, 0x6A, 0xD2, 0xF5, 0x58, 0x61, 0x5F, 0x77, 0x31, 0xBD, + 0x59, 0x0A, 0x1B, 0xF5, 0xC2, 0xFA, 0x9A, 0xB4, 0x59, 0xF4, 0x0A, 0xD1, 0x68, 0xCC, 0x21, 0x44, + 0xDC, 0x70, 0x80, 0xD1, 0x67, 0xCC, 0x24, 0x22, 0xC0, 0x77, 0x04, 0xED, 0xA3, 0xB4, 0x23, 0xC8, + 0xAD, 0x5E, 0x18, 0x64, 0x57, 0x89, 0x52, 0xDD, 0x25, 0x6C, 0x38, 0xCE, 0x5D, 0x45, 0x42, 0x18, + 0xA3, 0xE2, 0xD8, 0x6E, 0x21, 0x5F, 0xBB, 0x9D, 0xCA, 0x90, 0x57, 0x85, 0x0C, 0xD5, 0x56, 0xC8, + 0x12, 0x39, 0x27, 0x44, 0x77, 0xE6, 0x59, 0xE7, 0x08, 0xB0, 0x4E, 0x80, 0xBD, 0xE3, 0xE6, 0x8B, + 0xE1, 0x4B, 0x6E, 0xCE, 0xA9, 0x5C, 0x8E, 0xF2, 0xE2, 0xFE, 0x18, 0xFB, 0x74, 0xD6, 0x3C, 0x76, + 0xB8, 0xB0, 0x90, 0x00, 0x3A, 0xF4, 0xE4, 0xB7, 0xFD, 0x05, 0xA3, 0x7A, 0xD9, 0xF7, 0x0E, 0x18, + 0x66, 0xBC, 0x9A, 0x47, 0x18, 0x80, 0x4F, 0x4A, 0x6B, 0x9C, 0xF8, 0x48, 0x16, 0x49, 0x3F, 0x21, + 0xB4, 0x20, 0x59, 0x51, 0xDA, 0xD1, 0x4B, 0xE8, 0x5E, 0x48, 0x95, 0x77, 0x0A, 0x82, 0xA1, 0x8F, + 0xD2, 0x77, 0xC9, 0xC5, 0xE2, 0x79, 0x24, 0x87, 0x34, 0x0C, 0x9E, 0x17, 0x6F, 0x7B, 0xEA, 0x14, + 0x79, 0xF6, 0x0C, 0x95, 0x5F, 0x1C, 0x61, 0x01, 0x61, 0x6D, 0xD1, 0xF2, 0x6A, 0xA8, 0x09, 0xAA, + 0x0A, 0x6E, 0xF9, 0x28, 0x69, 0x49, 0x14, 0x60, 0x6D, 0xA3, 0xCF, 0x5E, 0x4C, 0x34, 0x8E, 0xFC, + 0x7E, 0x3E, 0x72, 0x3E, 0x02, 0x78, 0x3D, 0x1B, 0xA4, 0x93, 0x46, 0x39, 0x46, 0x0E, 0xF0, 0xE3, + 0x46, 0xF0, 0x4C, 0x2F, 0xE2, 0x14, 0x93, 0xF0, 0x2A, 0x5B, 0xE8, 0x05, 0xF7, 0x10, 0x3A, 0x6D, + 0x03, 0xA0, 0x5D, 0xF8, 0x5D, 0xD1, 0x4C, 0x58, 0x7B, 0xBF, 0xAB, 0x52, 0xC1, 0x6E, 0x72, 0x1E, + 0x60, 0x8C, 0x33, 0x4E, 0x22, 0xE7, 0x12, 0x51, 0x0B, 0xFE, 0x22, 0xDA, 0x8A, 0x53, 0xA7, 0xC6, + 0x9A, 0x66, 0x92, 0x76, 0x46, 0x3C, 0xC5, 0x72, 0x55, 0x6C, 0xD2, 0x8D, 0xF1, 0xD5, 0x6C, 0x09, + 0xEA, 0x2D, 0x1A, 0xF9, 0x99, 0x5E, 0x65, 0xCC, 0x6D, 0x55, 0x5F, 0x46, 0x66, 0xC3, 0xBB, 0xBE, + 0x1C, 0x53, 0x40, 0x3B, 0xE9, 0x15, 0x6C, 0xD6, 0x94, 0x8C, 0x5D, 0xB4, 0x4A, 0xDC, 0x2F, 0x2F, + 0xC1, 0xA8, 0xE1, 0xDF, 0x7A, 0xB5, 0x6D, 0xE2, 0xF8, 0xDB, 0xAA, 0x5D, 0x3D, 0x80, 0x5D, 0x33, + 0x6F, 0xCD, 0x5A, 0x84, 0xBC, 0x2D, 0x6E, 0x28, 0x97, 0x07, 0xA6, 0xF1, 0x0B, 0x22, 0x23, 0x58, + 0xDF, 0x50, 0x15, 0x73, 0xD6, 0x75, 0x63, 0xB6, 0x0F, 0xD8, 0x75, 0x9B, 0xF9, 0x9D, 0xBF, 0xE6, + 0xAF, 0xF8, 0xBF, 0xB4, 0x3A, 0xD4, 0x02, 0x3B, 0x8A, 0x4D, 0xF6, 0x44, 0x0E, 0x7F, 0x2B, 0xDB, + 0x9C, 0xAC, 0xD6, 0xB8, 0xC5, 0xB5, 0xEF, 0x1B, 0x67, 0xB0, 0x10, 0xCC, 0x1E, 0x24, 0xD4, 0x05, + 0x06, 0x6D, 0x3A, 0xFE, 0x95, 0x4C, 0x00, 0x8A, 0xD2, 0x53, 0x1B, 0x7A, 0xDE, 0xA0, 0x9F, 0x2D, + 0x10, 0x43, 0x2D, 0xA3, 0x8E, 0x66, 0x36, 0x27, 0x77, 0x05, 0x26, 0x78, 0x21, 0x09, 0x18, 0xD0, + 0x2E, 0x86, 0x1E, 0x56, 0x3B, 0x71, 0x3A, 0x46, 0x24, 0x7C, 0x90, 0x1E, 0x42, 0x36, 0x11, 0xA1, + 0x7C, 0x04, 0x80, 0x42, 0x0F, 0xA8, 0x4E, 0x07, 0xA1, 0x7B, 0x55, 0x5F, 0xA8, 0x8A, 0x1D, 0x36, + 0x9C, 0x16, 0xBD, 0xE0, 0x63, 0x0A, 0xE3, 0xC5, 0xF9, 0x55, 0xA4, 0xE9, 0x75, 0x7D, 0xD5, 0x82, + 0x32, 0x1E, 0x6B, 0x05, 0xE4, 0xF9, 0x8A, 0x8C, 0x18, 0x0E, 0xA0, 0xDF, 0x23, 0x4D, 0xA8, 0x4E, + 0xF0, 0x85, 0xFF, 0x04, 0xC5, 0xFE, 0x1E, 0x8A, 0x3F, 0xBF, 0x54, 0x05, 0x82, 0x8A, 0x0C, 0xDF, + 0xCA, 0x0A, 0xD0, 0x43, 0x76, 0xE5, 0x49, 0x55, 0x36, 0x24, 0x6F, 0x2F, 0x20, 0x58, 0x3A, 0xFE, + 0x62, 0x3A, 0x11, 0xAA, 0x2F, 0xB2, 0x25, 0x6F, 0x0B, 0x9D, 0xD8, 0xCC, 0xC5, 0x26, 0x16, 0x2E, + 0x74, 0x56, 0xBE, 0x99, 0xF4, 0xE7, 0x90, 0x88, 0x65, 0x1E, 0x6C, 0xAA, 0xB4, 0x2C, 0xCF, 0x12, + 0x63, 0x86, 0x8E, 0x9C, 0xF5, 0x75, 0x5A, 0x71, 0xBF, 0xFB, 0x54, 0xF3, 0x86, 0x61, 0xC5, 0x59, + 0xB4, 0xD5, 0x8E, 0x5D, 0x91, 0xA0, 0xB0, 0x9B, 0xB1, 0x95, 0xCE, 0x45, 0x0C, 0x4A, 0xFC, 0xE0, + 0x56, 0x73, 0x96, 0xC1, 0xAA, 0x0A, 0x65, 0x42, 0x42, 0xC1, 0xC7, 0x2D, 0x6E, 0xC8, 0x4A, 0x7F, + 0x40, 0x53, 0x0C, 0x7A, 0x99, 0x96, 0x59, 0xFA, 0xEC, 0xAD, 0xA1, 0xF0, 0xAB, 0xFE, 0xB6, 0x58, + 0x49, 0x65, 0xF4, 0x29, 0x2A, 0x21, 0x42, 0x93, 0x0A, 0xED, 0x38, 0xC0, 0x33, 0xFD, 0xCF, 0x8E, + 0xC1, 0xEC, 0x3A, 0xF9, 0x1F, 0xEA, 0x8F, 0xA2, 0xEA, 0xAE, 0xC4, 0xE7, 0x43, 0xCB, 0x53, 0xF1, + 0x77, 0xC9, 0x6C, 0x61, 0x35, 0xE2, 0xED, 0x25, 0x68, 0xF6, 0x8E, 0x06, 0xD6, 0x41, 0x87, 0x58, + 0x8A, 0xE4, 0x5F, 0x80, 0x59, 0xC7, 0x21, 0xAC, 0xC1, 0x95, 0xC8, 0xBA, 0xF9, 0x84, 0x1F, 0x70, + 0x15, 0x1C, 0xB1, 0xF1, 0x2B, 0xB4, 0xB7, 0xA0, 0x4B, 0xE3, 0xB3, 0xD4, 0x3C, 0x9C, 0x01, 0xB2, + 0x4A, 0xE5, 0x47, 0x39, 0x10, 0x32, 0xE0, 0x0E, 0x1C, 0xE9, 0x3E, 0x2E, 0xDD, 0x12, 0x2C, 0xDF, + 0xB7, 0x47, 0xE8, 0x88, 0x53, 0x28, 0xF2, 0xC6, 0x11, 0x12, 0x15, 0x4A, 0x60, 0x14, 0xA4, 0x78, + 0x54, 0x8E, 0x6A, 0x77, 0xD6, 0x74, 0xC2, 0xCD, 0x4B, 0xF9, 0xC2, 0x84, 0xE8, 0xD6, 0xED, 0x4D, + 0xB3, 0x0C, 0x32, 0x39, 0xCF, 0xB9, 0xF9, 0x0B, 0xC3, 0x52, 0xF5, 0x6E, 0x9A, 0x38, 0x84, 0xED, + 0x0D, 0x83, 0xFA, 0x83, 0x2D, 0xF4, 0xB3, 0xEE, 0x71, 0xE0, 0x47, 0x48, 0xE6, 0x1A, 0x0B, 0xD9, + 0x54, 0x74, 0xB8, 0x39, 0xA1, 0x4C, 0xC7, 0x3C, 0x52, 0x02, 0x07, 0x61, 0x12, 0x1B, 0x49, 0x0B, + 0x7D, 0x08, 0xAA, 0xEA, 0xB0, 0x3A, 0x05, 0x65, 0x9A, 0xEA, 0x68, 0x0C, 0x5B, 0xA6, 0x37, 0xC6, + 0x5F, 0x10, 0x7D, 0xC8, 0xAE, 0xCA, 0x65, 0x1F, 0x16, 0x80, 0x38, 0xF1, 0xB7, 0xB5, 0xDB, 0x1D, + 0x37, 0x5A, 0x1D, 0xEB, 0x7B, 0x2C, 0xA1, 0x7B, 0x72, 0xCE, 0x0D, 0x34, 0xB4, 0x17, 0x23, 0x52, + 0x8B, 0x3A, 0xD6, 0xEC, 0xE5, 0x8D, 0x23, 0x6A, 0xCF, 0x34, 0xDE, 0x02, 0x5A, 0xA4, 0x54, 0xFF, + 0x85, 0x85, 0x3E, 0x33, 0x87, 0xF9, 0x27, 0x59, 0xE2, 0x32, 0xAB, 0x8D, 0xBA, 0x8A, 0x92, 0xEB, + 0x5D, 0xA7, 0xF6, 0x6A, 0xDF, 0x32, 0xAD, 0xAC, 0x70, 0xCF, 0x91, 0xA9, 0x8E, 0x4C, 0x39, 0x71, + 0x4C, 0x1B, 0xBF, 0xD1, 0xD0, 0x68, 0x19, 0x9C, 0x8A, 0x7B, 0x57, 0x52, 0x40, 0xCE, 0xCC, 0x86, + 0xB7, 0x0E, 0x3D, 0x5E, 0xAD, 0xD0, 0x2B, 0xD4, 0x58, 0x5C, 0x5B, 0xD8, 0x00, 0x7F, 0x42, 0x99, + 0x84, 0x5D, 0x2D, 0x86, 0x40, 0x10, 0x35, 0x15, 0x05, 0x67, 0xDE, 0x22, 0x6C, 0xB4, 0x5C, 0x7B, + 0xCA, 0xDF, 0xF4, 0x1D, 0xD2, 0xCB, 0x34, 0x02, 0x6C, 0x22, 0x10, 0x4F, 0x7F, 0xDF, 0x18, 0xFF, + 0x5A, 0x81, 0x4C, 0xAC, 0xF7, 0xF3, 0xF1, 0x5D, 0xBA, 0x72, 0x36, 0x26, 0x88, 0xAE, 0xCA, 0xE0, + 0x79, 0x84, 0x68, 0x86, 0xCE, 0x35, 0xAF, 0x27, 0xB4, 0x21, 0xFD, 0x05, 0xB1, 0x38, 0x17, 0x7D, + 0x9B, 0x5A, 0x12, 0x29, 0x76, 0xE5, 0xA0, 0x39, 0x0B, 0xAD, 0x4C, 0x33, 0xCB, 0x45, 0x59, 0x82, + 0xB7, 0x03, 0xD2, 0x1A, 0xF7, 0x2F, 0x54, 0x43, 0x92, 0xC9, 0x8B, 0x6F, 0x6C, 0x6C, 0x1B, 0x10, + 0xEE, 0x97, 0x38, 0xA5, 0x8B, 0x16, 0xDE, 0xFC, 0xDA, 0x83, 0x4B, 0x39, 0x79, 0x17, 0xB7, 0x5A, + 0x59, 0x01, 0x11, 0xC0, 0xC6, 0x36, 0xD5, 0xBA, 0xB1, 0x46, 0x9E, 0x6B, 0xA1, 0xCB, 0x96, 0x7E, + 0x56, 0x91, 0x87, 0x68, 0x59, 0x8E, 0xCF, 0xB5, 0x58, 0x24, 0x2C, 0xD9, 0x0A, 0x06, 0x25, 0xCB, + 0x8C, 0xE6, 0x02, 0xE3, 0x5A, 0x19, 0x4D, 0x8F, 0x43, 0x5B, 0x40, 0x3F, 0x7D, 0x50, 0x24, 0x90, + 0x71, 0x3E, 0x88, 0x96, 0x3C, 0xCE, 0x2C, 0x80, 0x35, 0x68, 0x3E, 0x21, 0x67, 0x8A, 0x03, 0x68, + 0x49, 0x6B, 0xFA, 0xE2, 0x5A, 0xC7, 0xFF, 0x9C, 0xDF, 0x0D, 0xD9, 0xB5, 0x12, 0x07, 0x35, 0x7B, + 0x35, 0xDC, 0xF7, 0x12, 0x55, 0x71, 0x8A, 0x9F, 0x68, 0x66, 0x2A, 0x72, 0x55, 0x14, 0x82, 0xE2, + 0xBC, 0x3A, 0x39, 0xA7, 0x91, 0xA9, 0x91, 0xC8, 0x2B, 0x5F, 0x0A, 0x09, 0xFD, 0xE0, 0x6B, 0x58, + 0x85, 0x58, 0x1D, 0xCD, 0xEA, 0xAE, 0xBA, 0xA5, 0x49, 0xFF, 0x69, 0x4A, 0x10, 0xDD, 0x5A, 0xE0, + 0x0E, 0xD3, 0x9C, 0x0B, 0xD8, 0x28, 0x2E, 0xCA, 0x8E, 0x9F, 0x29, 0x84, 0xC8, 0xCA, 0x47, 0x79, + 0xB9, 0xCC, 0x71, 0xC6, 0xE1, 0xC1, 0x4D, 0x15, 0xB6, 0x1F, 0x92, 0x13, 0x2C, 0x83, 0xBE, 0x0D, + 0x03, 0x0A, 0x7C, 0x02, 0x7C, 0x2C, 0xFA, 0x8E, 0xC8, 0x23, 0xE1, 0xFD, 0x83, 0xDC, 0x61, 0xDB, + 0x1C, 0xE4, 0x3F, 0xE8, 0xA9, 0x1C, 0x55, 0x1E, 0xB2, 0xF1, 0x47, 0x6C, 0x5A, 0xD8, 0xD9, 0xD4, + 0xA8, 0xBF, 0x4B, 0xF9, 0x0A, 0xD5, 0xBF, 0x1D, 0x88, 0x30, 0x12, 0x80, 0x72, 0x49, 0x6C, 0x91, + 0x70, 0x6A, 0xB7, 0x4D, 0x86, 0x34, 0x8F, 0x57, 0x1A, 0x6A, 0x16, 0x7B, 0xA5, 0x5D, 0x3C, 0x74, + 0x8E, 0x03, 0x1D, 0x53, 0xD6, 0x1C, 0x75, 0x83, 0x2C, 0xF7, 0x5E, 0xF6, 0xE0, 0xC9, 0x25, 0x11, + 0x9F, 0x98, 0x73, 0xD2, 0xBE, 0x50, 0x56, 0xD6, 0x73, 0x38, 0xC8, 0x30, 0x5A, 0xB5, 0xF6, 0x67, + 0x37, 0x75, 0x7E, 0x99, 0x71, 0xC7, 0x30, 0x26, 0x0D, 0x43, 0xA2, 0x0B, 0xF0, 0xC2, 0xCC, 0x38, + 0xDF, 0x0F, 0x37, 0x25, 0xA0, 0x4F, 0x18, 0x5A, 0x40, 0x75, 0x2D, 0xFC, 0x52, 0xFF, 0x37, 0xD5, + 0x38, 0x06, 0xC6, 0x62, 0x13, 0xA0, 0x8E, 0x7A, 0xFA, 0xDD, 0xB9, 0x25, 0xBE, 0xBC, 0x1F, 0x02, + 0x4C, 0x56, 0xA1, 0xBA, 0x08, 0xBB, 0x65, 0xAE, 0xAC, 0x14, 0x4E, 0x65, 0xD7, 0xD1, 0x99, 0xFF, + 0x14, 0x33, 0x9F, 0x18, 0x1D, 0x54, 0x70, 0x6F, 0xBC, 0x85, 0xB4, 0x49, 0x82, 0x4C, 0x0A, 0xA6, + 0xE8, 0x10, 0x61, 0x8F, 0xED, 0xFD, 0x7F, 0x10, 0xAA, 0xAC, 0x13, 0xB5, 0xE2, 0x5D, 0xF3, 0x69, + 0x2B, 0xC3, 0xE1, 0xC2, 0x89, 0x9A, 0x46, 0xF0, 0x97, 0x34, 0xFC, 0x93, 0x31, 0x45, 0xE9, 0x7A, + 0xD4, 0x46, 0x1A, 0x31, 0xFF, 0x65, 0x39, 0xAE, 0xCE, 0xC5, 0x40, 0x2F, 0xD0, 0xCB, 0x1E, 0xC6, + 0x86, 0xDC, 0x2F, 0x72, 0x34, 0x35, 0x28, 0xAD, 0x96, 0xC3, 0xBE, 0xE4, 0xC8, 0xA5, 0xB6, 0x6B, + 0xBD, 0xFB, 0x9B, 0xE5, 0x16, 0x01, 0x4A, 0x55, 0xA2, 0xB0, 0xE8, 0x66, 0x4A, 0xC1, 0xE3, 0xC0, + 0xB9, 0x87, 0xF4, 0xD6, 0x8C, 0xF4, 0x61, 0x42, 0xA4, 0xBF, 0x73, 0x03, 0x67, 0xBD, 0x2F, 0x30, + 0x6E, 0x97, 0x45, 0x0F, 0xC6, 0xBD, 0xCA, 0x2E, 0x69, 0x72, 0x41, 0x07, 0x38, 0x74, 0x18, 0xB1, + 0xCB, 0x5C, 0xD3, 0xC2, 0x1D, 0xB7, 0xF2, 0xAF, 0xEC, 0x00, 0xCD, 0x4F, 0x6F, 0xDE, 0xB2, 0xAC, + 0x44, 0x4C, 0x1A, 0x56, 0xC3, 0x93, 0x21, 0x57, 0x8C, 0x6B, 0x1C, 0xD7, 0xF9, 0xC7, 0xC0, 0xA9, + 0xF7, 0xE4, 0xA3, 0xD8, 0x58, 0x9B, 0x35, 0xE6, 0x00, 0x7C, 0xE2, 0x12, 0xD0, 0x53, 0x61, 0x1F, + 0xC6, 0xA5, 0x81, 0x7A, 0x52, 0xEF, 0x09, 0x36, 0x1A, 0x62, 0x3C, 0x92, 0xD2, 0x65, 0x43, 0xF6, + 0xDF, 0x0B, 0x89, 0x7E, 0xC6, 0xB9, 0x47, 0xF4, 0x52, 0x14, 0x0C, 0x44, 0x4D, 0x23, 0x55, 0x6F, + 0x80, 0xC2, 0xBE, 0xC5, 0x59, 0xF8, 0xB5, 0x27, 0xE6, 0xE8, 0xF0, 0x32, 0x91, 0x3A, 0x59, 0x2B, + 0x1D, 0xF9, 0xAC, 0xF9, 0x2E, 0xF3, 0xB9, 0x36, 0x8C, 0x1A, 0x5D, 0x92, 0x33, 0xEA, 0xA6, 0xAF, + 0x71, 0x24, 0xE2, 0x7F, 0x18, 0xB1, 0x23, 0x3C, 0x53, 0xF3, 0xCC, 0x5D, 0xD4, 0x2D, 0x2B, 0x7A, + 0xF8, 0x94, 0x04, 0xC0, 0x8C, 0x65, 0x4D, 0x3A, 0xFA, 0xCF, 0xF9, 0x07, 0xC2, 0xD7, 0x75, 0x87, + 0x47, 0x9E, 0x6E, 0xA0, 0x79, 0x81, 0x6E, 0x03, 0xC7, 0xD2, 0x75, 0xF6, 0xC3, 0x85, 0x22, 0x28, + 0x1B, 0x39, 0x63, 0xCC, 0x12, 0x7E, 0x4A, 0xC3, 0x2A, 0x45, 0x85, 0xA9, 0x54, 0xDF, 0xB2, 0x33, + 0xEF, 0x76, 0x25, 0x31, 0xC9, 0xCD, 0xDA, 0x14, 0xE7, 0xD8, 0x4D, 0x18, 0xCE, 0xAB, 0xE7, 0x85, + 0xDD, 0x95, 0x8D, 0x36, 0xA1, 0x18, 0x87, 0x5E, 0xB6, 0x75, 0x2F, 0x3B, 0x97, 0x09, 0x18, 0x47, + 0xC8, 0x90, 0x37, 0xA3, 0xB2, 0xD2, 0x09, 0x3C, 0x5E, 0x6C, 0x2E, 0x72, 0x38, 0x08, 0x24, 0x99, + 0x90, 0xD0, 0x86, 0xC7, 0xD3, 0xFB, 0x4E, 0xA2, 0xDF, 0xC7, 0x26, 0x4D, 0x8E, 0x81, 0x98, 0x19, + 0x15, 0xD0, 0x4C, 0xB8, 0x44, 0xF7, 0x53, 0x1C, 0x0F, 0xAF, 0x78, 0x4C, 0x20, 0xB8, 0xCC, 0xBB, + 0x20, 0x60, 0xEC, 0x55, 0x70, 0xBD, 0xE9, 0x02, 0x63, 0x9F, 0x1F, 0xA7, 0xD5, 0x27, 0x18, 0x33, + 0x29, 0xA8, 0x33, 0x6E, 0xCB, 0x80, 0x40, 0x2D, 0x52, 0xDF, 0x6C, 0x78, 0x8F, 0xA6, 0x1D, 0xCF, + 0xE8, 0xB9, 0x54, 0x6B + }, + // ModuleKey + { + 0xAE, 0x25, 0xBC, 0x51, 0x06, 0x3B, 0x77, 0xBD, 0x36, 0x3C, 0x3E, 0xFE, 0x0F, 0xC1, 0x73, 0xF9 + }, + // Seed + { + 0x4D, 0x80, 0x8D, 0x2C, 0x77, 0xD9, 0x05, 0xC4, 0x1A, 0x63, 0x80, 0xEC, 0x08, 0x58, 0x6A, 0xFE + }, + // ServerKeySeed + { + 0xC2, 0xB7, 0xAD, 0xED, 0xFC, 0xCC, 0xA9, 0xC2, 0xBF, 0xB3, 0xF8, 0x56, 0x02, 0xBA, 0x80, 0x9B + }, + // ClientKeySeed + { + 0x7F, 0x96, 0xEE, 0xFD, 0xA5, 0xB6, 0x3D, 0x20, 0xA4, 0xDF, 0x8E, 0x00, 0xCB, 0xF4, 0x83, 0x04 + }, + // ClientKeySeedHash (SHA1(ClientKeySeed)) + { + 0x56, 0x8C, 0x05, 0x4C, 0x78, 0x1A, 0x97, 0x2A, 0x60, 0x37, 0xA2, 0x29, 0x0C, 0x22, 0xB5, 0x25, 0x71, 0xA0, 0x6F, 0x4E + } }; #endif diff --git a/src/server/game/Warden/WardenCheckMgr.cpp b/src/server/game/Warden/WardenCheckMgr.cpp index 589b666c035..29f29fe5b88 100644 --- a/src/server/game/Warden/WardenCheckMgr.cpp +++ b/src/server/game/Warden/WardenCheckMgr.cpp @@ -28,7 +28,6 @@ WardenCheckMgr::WardenCheckMgr() { - InternalDataID = 1; } WardenCheckMgr::~WardenCheckMgr() @@ -151,31 +150,48 @@ void WardenCheckMgr::LoadWardenChecks() } while (result->NextRow()); - // Fetch overrides from char db and overwrite default action in CheckStore - QueryResult overrideResult = CharacterDatabase.Query("SELECT wardenId, action FROM warden_action"); + sLog->outString(">> Loaded %u warden checks.", count); + sLog->outString(); +} - uint32 overrideCount = 0; +void WardenCheckMgr::LoadWardenOverrides() +{ + // 0 1 + QueryResult result = CharacterDatabase.Query("SELECT wardenId, action FROM warden_action"); - if (overrideResult) + if (!result) { - do - { - fields = overrideResult->Fetch(); - - uint16 checkId = fields[0].GetUInt16(); - - // Check if override check ID actually exists in current Warden checks - if (checkId > maxCheckId) - sLog->outError("Warden check action override for invalid check (ID: %u, action: %u), skipped", checkId, fields[1].GetUInt8()); - else - CheckStore[fields[0].GetUInt16()]->Action = WardenActions(fields[1].GetUInt8()); - - ++overrideCount; - } - while (overrideResult->NextRow()); + sLog->outString(">> Loaded 0 Warden action overrides. DB table `warden_action` is empty!"); + sLog->outString(); + return; } - sLog->outString(">> Loaded %u warden checks and %u action overrides.", count, overrideCount); + Field* fields = result->Fetch(); + + uint32 count = 0; + + do + { + fields = result->Fetch(); + + uint16 checkId = fields[0].GetUInt16(); + uint8 action = fields[1].GetUInt8(); + + // Check if action value is in range (0-2, see WardenActions enum) + if (action > WARDEN_ACTION_BAN) + sLog->outError("Warden check override action out of range (ID: %u, action: %u)", checkId, action); + // Check if check actually exists before accessing the CheckStore vector + else if (checkId > CheckStore.size()) + sLog->outError("Warden check action override for non-existing check (ID: %u, action: %u), skipped", checkId, action); + else + { + CheckStore[checkId]->Action = WardenActions(action); + ++count; + } + } + while (result->NextRow()); + + sLog->outString(">> Loaded %u warden action overrides.", count); sLog->outString(); } diff --git a/src/server/game/Warden/WardenCheckMgr.h b/src/server/game/Warden/WardenCheckMgr.h index cbe8460db3b..1b790d16716 100644 --- a/src/server/game/Warden/WardenCheckMgr.h +++ b/src/server/game/Warden/WardenCheckMgr.h @@ -58,11 +58,11 @@ class WardenCheckMgr WardenCheck* GetWardenDataById(uint16 Id); WardenCheckResult* GetWardenResultById(uint16 Id); - uint32 InternalDataID; std::vector MemChecksIdPool; std::vector OtherChecksIdPool; void LoadWardenChecks(); + void LoadWardenOverrides(); private: CheckContainer CheckStore; diff --git a/src/server/game/Warden/WardenWin.cpp b/src/server/game/Warden/WardenWin.cpp index a77c77a3261..53d167082d6 100644 --- a/src/server/game/Warden/WardenWin.cpp +++ b/src/server/game/Warden/WardenWin.cpp @@ -49,16 +49,8 @@ void WardenWin::Init(WorldSession* session, BigNumber *k) SHA1Randx WK(k->AsByteArray(), k->GetNumBytes()); WK.generate(_inputKey, 16); WK.generate(_outputKey, 16); - /* - Seed: 4D808D2C77D905C41A6380EC08586AFE (0x05 packet) - Hash: 568C054C781A972A6037A2290C22B52571A06F4E (0x04 packet) - Module MD5: 79C0768D657977D697E10BAD956CCED1 - New Client Key: 7F 96 EE FD A5 B6 3D 20 A4 DF 8E 00 CB F4 83 04 - New Cerver Key: C2 B7 AD ED FC CC A9 C2 BF B3 F8 56 02 BA 80 9B - */ - uint8 mod_seed[16] = { 0x4D, 0x80, 0x8D, 0x2C, 0x77, 0xD9, 0x05, 0xC4, 0x1A, 0x63, 0x80, 0xEC, 0x08, 0x58, 0x6A, 0xFE }; - memcpy(_seed, mod_seed, 16); + memcpy(_seed, Module.Seed, 16); _inputCrypto.Init(_inputKey); _outputCrypto.Init(_outputKey); @@ -79,13 +71,13 @@ ClientWardenModule* WardenWin::GetModuleForClient() { ClientWardenModule *mod = new ClientWardenModule; - uint32 length = sizeof(Module_79C0768D657977D697E10BAD956CCED1_Data); + uint32 length = sizeof(Module.Module); // data assign mod->CompressedSize = length; mod->CompressedData = new uint8[length]; - memcpy(mod->CompressedData, Module_79C0768D657977D697E10BAD956CCED1_Data, length); - memcpy(mod->Key, Module_79C0768D657977D697E10BAD956CCED1_Key, 16); + memcpy(mod->CompressedData, Module.Module, length); + memcpy(mod->Key, Module.ModuleKey, 16); // md5 hash MD5_CTX ctx; @@ -104,7 +96,6 @@ void WardenWin::InitializeModule() WardenInitModuleRequest Request; Request.Command1 = WARDEN_SMSG_MODULE_INITIALIZE; Request.Size1 = 20; - Request.CheckSumm1 = BuildChecksum(&Request.Unk1, 20); Request.Unk1 = 1; Request.Unk2 = 0; Request.Type = 1; @@ -113,24 +104,25 @@ void WardenWin::InitializeModule() Request.Function1[1] = 0x000218C0; // 0x00400000 + 0x000218C0 SFileGetFileSize Request.Function1[2] = 0x00022530; // 0x00400000 + 0x00022530 SFileReadFile Request.Function1[3] = 0x00022910; // 0x00400000 + 0x00022910 SFileCloseFile + Request.CheckSumm1 = BuildChecksum(&Request.Unk1, 20); Request.Command2 = WARDEN_SMSG_MODULE_INITIALIZE; Request.Size2 = 8; - Request.CheckSumm2 = BuildChecksum(&Request.Unk2, 8); Request.Unk3 = 4; Request.Unk4 = 0; Request.String_library2 = 0; Request.Function2 = 0x00419D40; // 0x00400000 + 0x00419D40 FrameScript::GetText Request.Function2_set = 1; + Request.CheckSumm2 = BuildChecksum(&Request.Unk2, 8); Request.Command3 = WARDEN_SMSG_MODULE_INITIALIZE; Request.Size3 = 8; - Request.CheckSumm3 = BuildChecksum(&Request.Unk5, 8); Request.Unk5 = 1; Request.Unk6 = 1; Request.String_library3 = 0; Request.Function3 = 0x0046AE20; // 0x00400000 + 0x0046AE20 PerformanceCounter Request.Function3_set = 1; + Request.CheckSumm3 = BuildChecksum(&Request.Unk5, 8); // Encrypt with warden RC4 key. EncryptData((uint8*)&Request, sizeof(WardenInitModuleRequest)); @@ -161,10 +153,8 @@ void WardenWin::HandleHashResult(ByteBuffer &buff) { buff.rpos(buff.wpos()); - const uint8 validHash[20] = { 0x56, 0x8C, 0x05, 0x4C, 0x78, 0x1A, 0x97, 0x2A, 0x60, 0x37, 0xA2, 0x29, 0x0C, 0x22, 0xB5, 0x25, 0x71, 0xA0, 0x6F, 0x4E }; - // Verify key - if (memcmp(buff.contents() + 1, validHash, sizeof(validHash)) != 0) + if (memcmp(buff.contents() + 1, Module.ClientKeySeedHash, 20) != 0) { sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: failed"); sLog->outWarden("WARDEN: Player %s (guid: %u, account: %u) failed hash reply. Action: %s", @@ -174,15 +164,9 @@ void WardenWin::HandleHashResult(ByteBuffer &buff) sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: succeed"); - // Client 7F96EEFDA5B63D20A4DF8E00CBF48304 - const uint8 client_key[16] = { 0x7F, 0x96, 0xEE, 0xFD, 0xA5, 0xB6, 0x3D, 0x20, 0xA4, 0xDF, 0x8E, 0x00, 0xCB, 0xF4, 0x83, 0x04 }; - - // Server C2B7ADEDFCCCA9C2BFB3F85602BA809B - const uint8 server_key[16] = { 0xC2, 0xB7, 0xAD, 0xED, 0xFC, 0xCC, 0xA9, 0xC2, 0xBF, 0xB3, 0xF8, 0x56, 0x02, 0xBA, 0x80, 0x9B }; - // Change keys here - memcpy(_inputKey, client_key, 16); - memcpy(_outputKey, server_key, 16); + memcpy(_inputKey, Module.ClientKeySeed, 16); + memcpy(_outputKey, Module.ServerKeySeed, 16); _inputCrypto.Init(_inputKey); _outputCrypto.Init(_outputKey); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 61757b4fab2..fcdb6b7fcd6 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1743,6 +1743,9 @@ void World::SetInitialWorldSettings() sLog->outString("Loading Warden Checks..." ); sWardenCheckMgr->LoadWardenChecks(); + sLog->outString("Loading Warden Action Overrides..." ); + sWardenCheckMgr->LoadWardenOverrides(); + sLog->outString("Deleting expired bans..."); LoginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate"); diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 17c819f2f22..361d329ac6b 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -37,6 +37,7 @@ EndScriptData */ #include "SkillExtraItems.h" #include "Chat.h" #include "WaypointManager.h" +#include "WardenCheckMgr.h" class reload_commandscript : public CommandScript { @@ -151,6 +152,7 @@ public: { "spell_threats", SEC_ADMINISTRATOR, true, &HandleReloadSpellThreatsCommand, "", NULL }, { "spell_group_stack_rules", SEC_ADMINISTRATOR, true, &HandleReloadSpellGroupStackRulesCommand, "", NULL }, { "trinity_string", SEC_ADMINISTRATOR, true, &HandleReloadTrinityStringCommand, "", NULL }, + { "warden_action", SEC_ADMINISTRATOR, true, &HandleReloadWardenActionCommand, "", NULL }, { "waypoint_scripts", SEC_ADMINISTRATOR, true, &HandleReloadWpScriptsCommand, "", NULL }, { "waypoint_data", SEC_ADMINISTRATOR, true, &HandleReloadWpCommand, "", NULL }, { "vehicle_accessory", SEC_ADMINISTRATOR, true, &HandleReloadVehicleAccessoryCommand, "", NULL }, @@ -724,6 +726,21 @@ public: return true; } + static bool HandleReloadWardenActionCommand(ChatHandler* handler, const char* /*args*/) + { + if (!sWorld->getBoolConfig(CONFIG_WARDEN_ENABLED)) + { + handler->SendSysMessage("Warden system disabled by config - reloading warden_action skipped."); + handler->SetSentErrorMessage(true); + return false; + } + + sLog->outString("Re-Loading warden_action Table!"); + sWardenCheckMgr->LoadWardenOverrides(); + handler->SendGlobalGMSysMessage("DB table `warden_action` reloaded."); + return true; + } + static bool HandleReloadNpcTrainerCommand(ChatHandler* handler, const char* /*args*/) { sLog->outString("Re-Loading `npc_trainer` Table!"); From 7e4fa9174d7196a0c467e83e7a8c3fa1df0e8c4d Mon Sep 17 00:00:00 2001 From: Shocker Date: Sun, 26 Feb 2012 02:16:45 +0200 Subject: [PATCH 0049/1149] Core/Auction House: Fix item loss issue when inserting multiple stacks (by Elron103) Closes #5428 --- src/server/game/Handlers/AuctionHouseHandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 45c0f7bed42..223bb7dd5c7 100755 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -336,6 +336,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) } SQLTransaction trans = CharacterDatabase.BeginTransaction(); + newItem->SaveToDB(trans); AH->SaveToDB(trans); _player->SaveInventoryAndGoldToDB(trans); CharacterDatabase.CommitTransaction(trans); From ca17e1c7e49200e1df6b9c29f7f12b408fce9f48 Mon Sep 17 00:00:00 2001 From: Anubisss Date: Sun, 26 Feb 2012 05:15:20 +0100 Subject: [PATCH 0050/1149] Add a missing semicolon (;) to a SQL. Signed-off-by: Anubisss --- .../characters/2012_02_19_00_characters_warden_action.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/updates/characters/2012_02_19_00_characters_warden_action.sql b/sql/updates/characters/2012_02_19_00_characters_warden_action.sql index 6e317f5100d..587f65fedc5 100644 --- a/sql/updates/characters/2012_02_19_00_characters_warden_action.sql +++ b/sql/updates/characters/2012_02_19_00_characters_warden_action.sql @@ -4,4 +4,4 @@ CREATE TABLE `warden_action` ( `wardenId` smallint(5) unsigned NOT NULL, `action` tinyint(3) unsigned DEFAULT NULL, PRIMARY KEY (`wardenId`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 +) ENGINE=InnoDB DEFAULT CHARSET=utf8; From b2e4f8f9585cd06af648929bb044b2cb5333f770 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 26 Feb 2012 15:16:22 +0100 Subject: [PATCH 0051/1149] Core/Misc: Add some documentation to TRINITY_WRITE_GUARD and TRINITY_READ_GUARD because ACE's documentation on underlying objects is not clear. --- src/server/shared/Common.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/shared/Common.h b/src/server/shared/Common.h index 57809cca255..259c60ade20 100755 --- a/src/server/shared/Common.h +++ b/src/server/shared/Common.h @@ -208,10 +208,14 @@ typedef std::vector StringVector; ACE_Guard< MUTEX > TRINITY_GUARD_OBJECT (LOCK); \ if (TRINITY_GUARD_OBJECT.locked() == 0) ASSERT(false); +//! For proper implementation of multiple-read, single-write pattern, use +//! ACE_RW_Mutex as underlying @MUTEX # define TRINITY_WRITE_GUARD(MUTEX, LOCK) \ ACE_Write_Guard< MUTEX > TRINITY_GUARD_OBJECT (LOCK); \ if (TRINITY_GUARD_OBJECT.locked() == 0) ASSERT(false); +//! For proper implementation of multiple-read, single-write pattern, use +//! ACE_RW_Mutex as underlying @MUTEX # define TRINITY_READ_GUARD(MUTEX, LOCK) \ ACE_Read_Guard< MUTEX > TRINITY_GUARD_OBJECT (LOCK); \ if (TRINITY_GUARD_OBJECT.locked() == 0) ASSERT(false); From 9dbd9c02f47480d19bed4b79a3bb982a35bf8902 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 26 Feb 2012 14:37:03 +0000 Subject: [PATCH 0052/1149] Misc: - Fix errors in recent SQLs (1fc122e5c6a5e0099,a3755f8355e64c9efc) - Proper defines in DBCStructure.h (Holiday Entry) --- sql/updates/world/2012_02_26_00_world_misc.sql | 13 +++++++++++++ src/server/game/DataStores/DBCStructure.h | 12 ++++++++---- src/server/game/Miscellaneous/SharedDefines.h | 4 ---- 3 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 sql/updates/world/2012_02_26_00_world_misc.sql diff --git a/sql/updates/world/2012_02_26_00_world_misc.sql b/sql/updates/world/2012_02_26_00_world_misc.sql new file mode 100644 index 00000000000..3df42934aa9 --- /dev/null +++ b/sql/updates/world/2012_02_26_00_world_misc.sql @@ -0,0 +1,13 @@ +UPDATE `spell_area` SET `quest_start`=12987,`quest_end`=12987 WHERE `spell`=56305; + +DELETE FROM `reference_loot_template` WHERE `entry` IN (28058,28074,28088,28064,28082,28096) AND `item`=49908; -- bad data +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (28058,28074,28088,28064,28082,28096) AND `item`=49908; +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Deathbringer's Cache +(28058,49908,20,1,0,1,1), -- Primordial Saronite 10H +(28074,49908,20,1,0,1,1), -- Primordial Saronite 25N +(28088,49908,20,1,0,1,1), -- Primordial Saronite 25H +-- Cache of the Dreamwalker +(28064,49908,20,1,0,1,1), -- Primordial Saronite 10H +(28082,49908,20,1,0,1,1), -- Primordial Saronite 25N +(28096,49908,20,1,0,1,1); -- Primordial Saronite 25H diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 75a6b71d943..1978dbc71f9 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1066,14 +1066,18 @@ struct HolidayNamesEntry }; */ +#define MAX_HOLIDAY_DURATIONS 10 +#define MAX_HOLIDAY_DATES 26 +#define MAX_HOLIDAY_FLAGS 10 + struct HolidaysEntry { uint32 Id; // 0 m_ID - uint32 Duration[10]; // 1-10 m_duration (MAX_HOLIDAY_DURATIONS) - uint32 Date[26]; // 11-36 m_date (dates in unix time starting at January, 1, 2000) (MAX_HOLIDAY_DATES) + uint32 Duration[MAX_HOLIDAY_DURATIONS]; // 1-10 m_duration + uint32 Date[MAX_HOLIDAY_DATES]; // 11-36 m_date (dates in unix time starting at January, 1, 2000) uint32 Region; // 37 m_region (wow region) uint32 Looping; // 38 m_looping - uint32 CalendarFlags[10]; // 39-48 m_calendarFlags (MAX_HOLIDAY_FLAGS) + uint32 CalendarFlags[MAX_HOLIDAY_FLAGS]; // 39-48 m_calendarFlags //uint32 holidayNameId; // 49 m_holidayNameID (HolidayNames.dbc) //uint32 holidayDescriptionId; // 50 m_holidayDescriptionID (HolidayDescriptions.dbc) char* TextureFilename; // 51 m_textureFilename @@ -1086,7 +1090,7 @@ struct ItemEntry { uint32 ID; // 0 uint32 Class; // 1 - uint32 SubClass; // 2 some items have strnage subclasses + uint32 SubClass; // 2 some items have strange subclasses int32 Unk0; // 3 int32 Material; // 4 uint32 DisplayId; // 5 diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 369b20252ab..c404277f61f 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -3424,10 +3424,6 @@ enum ActivateTaxiReply // Calendar - start -#define MAX_HOLIDAY_DATES 26 -#define MAX_HOLIDAY_FLAGS 10 -#define MAX_HOLIDAY_DURATIONS 10 - enum CalendarFlags { CALENDAR_FLAG_ALL_ALLOWED = 0x001, From 05097c7fc55420db48c4f1e79ef362b9995ba38b Mon Sep 17 00:00:00 2001 From: Souler Date: Sun, 26 Feb 2012 17:06:58 +0100 Subject: [PATCH 0053/1149] Scripts/Spells: Move Demonic Circle mechanics to spell_warlock.cpp --- ...2012_02_26_01_world_spell_script_names.sql | 4 + .../game/Spells/Auras/SpellAuraEffects.cpp | 21 ----- src/server/game/Spells/Auras/SpellAuras.cpp | 24 ----- src/server/scripts/Spells/spell_warlock.cpp | 89 +++++++++++++++++++ 4 files changed, 93 insertions(+), 45 deletions(-) create mode 100644 sql/updates/world/2012_02_26_01_world_spell_script_names.sql diff --git a/sql/updates/world/2012_02_26_01_world_spell_script_names.sql b/sql/updates/world/2012_02_26_01_world_spell_script_names.sql new file mode 100644 index 00000000000..d066218db8f --- /dev/null +++ b/sql/updates/world/2012_02_26_01_world_spell_script_names.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (48018, 48020); +INSERT INTO `spell_script_names` VALUES (`spell_id`,`ScriptName`) +(48018,'spell_warl_demonic_circle_summon'), +(48020,'spell_warl_demonic_circle_teleport'); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index cb79bd00776..2cf6938f67a 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5668,27 +5668,6 @@ void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const target->CastSpell((Unit*)NULL, m_spellInfo->Effects[m_effIndex].TriggerSpell, true); break; } - case SPELLFAMILY_WARLOCK: - { - switch (GetSpellInfo()->Id) - { - // Demonic Circle - case 48018: - if (GameObject* obj = target->GetGameObject(GetSpellInfo()->Id)) - { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(48020); - if (target->IsWithinDist(obj, spellInfo->GetMaxRange(true))) - { - if (!target->HasAura(62388)) - target->CastSpell(target, 62388, true); - } - else - target->RemoveAura(62388); - } - break; - } - break; - } case SPELLFAMILY_DRUID: { switch (GetSpellInfo()->Id) diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 5329c1a0914..32473a93a26 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1202,19 +1202,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b break; } break; - case SPELLFAMILY_WARLOCK: - switch (GetId()) - { - case 48020: // Demonic Circle - if (target->GetTypeId() == TYPEID_PLAYER) - if (GameObject* obj = target->GetGameObject(48018)) - { - target->NearTeleportTo(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), obj->GetOrientation()); - target->RemoveMovementImpairingAuras(); - } - break; - } - break; case SPELLFAMILY_PRIEST: if (!caster) break; @@ -1418,17 +1405,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b caster->CastSpell(target, spellId, true); } } - switch (GetId()) - { - case 48018: // Demonic Circle - // Do not remove GO when aura is removed by stack - // to prevent remove GO added by new spell - // old one is already removed - if (!onReapply) - target->RemoveGameObject(GetId(), true); - target->RemoveAura(62388); - break; - } break; case SPELLFAMILY_PRIEST: if (!caster) diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index b1aff706db0..ceebba8cd96 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -34,6 +34,9 @@ enum WarlockSpells WARLOCK_DEMONIC_EMPOWERMENT_IMP = 54444, WARLOCK_IMPROVED_HEALTHSTONE_R1 = 18692, WARLOCK_IMPROVED_HEALTHSTONE_R2 = 18693, + WARLOCK_DEMONIC_CIRCLE_SUMMON = 48018, + WARLOCK_DEMONIC_CIRCLE_TELEPORT = 48020, + WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388, }; class spell_warl_banish : public SpellScriptLoader @@ -443,6 +446,90 @@ class spell_warl_life_tap : public SpellScriptLoader } }; +class spell_warl_demonic_circle_summon : public SpellScriptLoader +{ + public: + spell_warl_demonic_circle_summon() : SpellScriptLoader("spell_warl_demonic_circle_summon") { } + + class spell_warl_demonic_circle_summon_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_demonic_circle_summon_AuraScript); + + void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes mode) + { + // If effect is removed by expire remove the summoned demonic circle too. + if (!(mode & AURA_EFFECT_HANDLE_REAPPLY)) + GetTarget()->RemoveGameObject(GetId(), true); + + GetTarget()->RemoveAura(WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST); + } + + void HandleDummyTick(AuraEffect const* /*aurEff*/) + { + if (GameObject* circle = GetTarget()->GetGameObject(GetId())) + { + // Here we check if player is in demonic circle teleport range, if so add + // WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST; allowing him to cast the WARLOCK_DEMONIC_CIRCLE_TELEPORT. + // If not in range remove the WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST. + + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_CIRCLE_TELEPORT); + + if (GetTarget()->IsWithinDist(circle, spellInfo->GetMaxRange(true))) + { + if (!GetTarget()->HasAura(WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST)) + GetTarget()->CastSpell(GetTarget(), WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST, true); + } + else + GetTarget()->RemoveAura(WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST); + } + } + + void Register() + { + OnEffectRemove += AuraEffectApplyFn(spell_warl_demonic_circle_summon_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_warl_demonic_circle_summon_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_warl_demonic_circle_summon_AuraScript(); + } +}; + +class spell_warl_demonic_circle_teleport : public SpellScriptLoader +{ + public: + spell_warl_demonic_circle_teleport() : SpellScriptLoader("spell_warl_demonic_circle_teleport") { } + + class spell_warl_demonic_circle_teleport_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_demonic_circle_teleport_AuraScript); + + void HandleTeleport(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Player* player = GetTarget()->ToPlayer()) + { + if (GameObject* circle = player->GetGameObject(WARLOCK_DEMONIC_CIRCLE_SUMMON)) + { + player->NearTeleportTo(circle->GetPositionX(), circle->GetPositionY(), circle->GetPositionZ(), circle->GetOrientation()); + player->RemoveMovementImpairingAuras(); + } + } + } + + void Register() + { + OnEffectApply += AuraEffectApplyFn(spell_warl_demonic_circle_teleport_AuraScript::HandleTeleport, EFFECT_0, SPELL_AURA_MECHANIC_IMMUNITY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_warl_demonic_circle_teleport_AuraScript(); + } +}; + void AddSC_warlock_spell_scripts() { new spell_warl_banish(); @@ -453,4 +540,6 @@ void AddSC_warlock_spell_scripts() new spell_warl_seed_of_corruption(); new spell_warl_soulshatter(); new spell_warl_life_tap(); + new spell_warl_demonic_circle_summon(); + new spell_warl_demonic_circle_teleport(); } From fd9f185f1f22042e45574d7ca05aac419f141d5d Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 26 Feb 2012 14:53:34 -0500 Subject: [PATCH 0054/1149] Core/Battlegrounds: Initialize _flagDebuffState before using it in Warsong Gulch --- src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index 9650cf11a8c..43a29e93c55 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -51,6 +51,7 @@ BattlegroundWS::BattlegroundWS() StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE; StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE; StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_WS_HAS_BEGUN; + _flagDebuffState = 0; } BattlegroundWS::~BattlegroundWS() From 95d3ea55122921dc7df31e0427de3b1d63f346f2 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 26 Feb 2012 14:55:22 -0500 Subject: [PATCH 0055/1149] Core/Misc: Reserve space for the data in the stores before inserting it --- src/server/game/Globals/ObjectMgr.cpp | 11 ++++++++--- src/server/game/Globals/ObjectMgr.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index f50d4144b62..f31ce74d896 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -389,6 +389,7 @@ void ObjectMgr::LoadCreatureTemplates() return; } + _creatureTemplateStore.rehash(result->GetRowCount()); uint32 count = 0; do { @@ -1104,6 +1105,7 @@ void ObjectMgr::LoadCreatureModelInfo() return; } + _creatureModelStore.rehash(result->GetRowCount()); uint32 count = 0; do @@ -1137,9 +1139,7 @@ void ObjectMgr::LoadCreatureModelInfo() } if (modelInfo.combat_reach < 0.1f) - { modelInfo.combat_reach = DEFAULT_COMBAT_REACH; - } ++count; } @@ -1404,6 +1404,7 @@ void ObjectMgr::LoadCreatures() if (GetMapDifficultyData(i, Difficulty(k))) spawnMasks[i] |= (1 << k); + _creatureDataStore.rehash(result->GetRowCount()); uint32 count = 0; do { @@ -1420,7 +1421,6 @@ void ObjectMgr::LoadCreatures() } CreatureData& data = _creatureDataStore[guid]; - data.id = entry; data.mapid = fields[ 2].GetUInt32(); data.displayid = fields[ 3].GetUInt32(); @@ -1714,6 +1714,7 @@ void ObjectMgr::LoadGameobjects() if (GetMapDifficultyData(i, Difficulty(k))) spawnMasks[i] |= (1 << k); + _gameObjectDataStore.rehash(result->GetRowCount()); do { Field* fields = result->Fetch(); @@ -2085,6 +2086,7 @@ void ObjectMgr::LoadItemTemplates() return; } + _itemTemplateStore.rehash(result->GetRowCount()); uint32 count = 0; bool enforceDBCAttributes = sWorld->getBoolConfig(CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES); @@ -2703,6 +2705,7 @@ void ObjectMgr::LoadItemSetNames() return; } + _itemSetNameStore.rehash(result->GetRowCount()); uint32 count = 0; do @@ -5166,6 +5169,7 @@ void ObjectMgr::LoadGossipText() sLog->outString(); return; } + _gossipTextStore.rehash(result->GetRowCount()); int cic; @@ -6390,6 +6394,7 @@ void ObjectMgr::LoadGameObjectTemplate() return; } + _gameObjectTemplateStore.rehash(result->GetRowCount()); uint32 count = 0; do { diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 4224f1e2bfd..1172f04241d 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -385,6 +385,7 @@ struct TrinityStringLocale StringVector Content; }; + typedef std::map LinkedRespawnContainer; typedef UNORDERED_MAP CreatureDataContainer; typedef UNORDERED_MAP GameObjectDataContainer; From 9610b9e53c5f7e0112f67e0c8b4bccc62c663efa Mon Sep 17 00:00:00 2001 From: "E. van Harten" Date: Mon, 27 Feb 2012 10:54:09 +0100 Subject: [PATCH 0056/1149] Fixed compile issue for -DTOOLS, someone broke it again! --- src/tools/map_extractor/CMakeLists.txt | 2 +- src/tools/vmap4_extractor/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/map_extractor/CMakeLists.txt b/src/tools/map_extractor/CMakeLists.txt index afeb8af99ba..bde62c24c70 100644 --- a/src/tools/map_extractor/CMakeLists.txt +++ b/src/tools/map_extractor/CMakeLists.txt @@ -33,9 +33,9 @@ add_executable(mapextractor ) target_link_libraries(mapextractor + mpq ${BZIP2_LIBRARIES} ${ZLIB_LIBRARIES} - mpq ) add_dependencies(mapextractor mpq) diff --git a/src/tools/vmap4_extractor/CMakeLists.txt b/src/tools/vmap4_extractor/CMakeLists.txt index 1c44b01bbec..5c98d84eb17 100644 --- a/src/tools/vmap4_extractor/CMakeLists.txt +++ b/src/tools/vmap4_extractor/CMakeLists.txt @@ -34,9 +34,9 @@ endif() add_executable(vmap4extractor ${sources}) target_link_libraries(vmap4extractor + mpq ${BZIP2_LIBRARIES} ${ZLIB_LIBRARIES} - mpq ) add_dependencies(vmap4extractor mpq) From 3e622ee7ac36de3a1e137c12b03417c3880ba342 Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 27 Feb 2012 11:08:34 +0100 Subject: [PATCH 0057/1149] Core: Minor cleanup in ObjectMgr and warning fixes --- .../collision/Models/GameObjectModel.cpp | 2 +- .../game/AI/SmartScripts/SmartScriptMgr.cpp | 1 - src/server/game/Calendar/CalendarMgr.cpp | 2 +- src/server/game/Globals/ObjectMgr.cpp | 160 ++++++++---------- src/server/game/Globals/ObjectMgr.h | 5 +- src/server/game/Handlers/CalendarHandler.cpp | 2 +- src/server/game/Warden/Warden.cpp | 4 +- 7 files changed, 73 insertions(+), 103 deletions(-) diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp index 1c3a0aa639e..84c736c22e8 100644 --- a/src/server/collision/Models/GameObjectModel.cpp +++ b/src/server/collision/Models/GameObjectModel.cpp @@ -83,7 +83,7 @@ void LoadGameObjectModelList() } fclose(model_list_file); - sLog->outString(">> Loaded %u GameObject models in %u ms", model_list.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> Loaded %u GameObject models in %u ms", uint32(model_list.size()), GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 4105012ac86..3fc3f233b4b 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -48,7 +48,6 @@ void SmartWaypointMgr::LoadFromDB() uint32 count = 0; uint32 total = 0; - WPPath* path = NULL; uint32 last_entry = 0; uint32 last_id = 1; diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index ea420d88516..b286abba81e 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -309,7 +309,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) case CALENDAR_ACTION_REMOVE_EVENT: { uint64 eventId = action.Event.GetEventId(); - uint32 flags = action.Event.GetFlags(); + //uint32 flags = action.Event.GetFlags(); // FIXME - Use of Flags here! CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_OWNER); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index f31ce74d896..7834a1cc4a3 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -701,7 +701,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) else if (!displayScaleEntry) displayScaleEntry = displayEntry; - CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid2);; + CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid2); if (!modelInfo) sLog->outErrorDb("No model data exist for `Modelid2` = %u listed by creature (Entry: %u).", cInfo->Modelid2, cInfo->Entry); } @@ -733,7 +733,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) else if (!displayScaleEntry) displayScaleEntry = displayEntry; - CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid4);; + CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid4); if (!modelInfo) sLog->outErrorDb("No model data exist for `Modelid4` = %u listed by creature (Entry: %u).", cInfo->Modelid4, cInfo->Entry); } @@ -992,7 +992,7 @@ void ObjectMgr::LoadEquipmentTemplates() if (!equipmentInfo.ItemEntry[i]) continue; - ItemEntry const* dbcItem = sItemStore.LookupEntry(equipmentInfo.ItemEntry[i]); + ItemEntry const* dbcItem = sItemStore.LookupEntry(equipmentInfo.ItemEntry[i]); if (!dbcItem) { @@ -1071,25 +1071,25 @@ void ObjectMgr::ChooseCreatureFlags(const CreatureTemplate* cinfo, uint32& npcfl CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32* displayID) { - CreatureModelInfo const* minfo = GetCreatureModelInfo(*displayID); - if (!minfo) + CreatureModelInfo const* modelInfo = GetCreatureModelInfo(*displayID); + if (!modelInfo) return NULL; // If a model for another gender exists, 50% chance to use it - if (minfo->modelid_other_gender != 0 && urand(0, 1) == 0) + if (modelInfo->modelid_other_gender != 0 && urand(0, 1) == 0) { - CreatureModelInfo const* minfo_tmp = GetCreatureModelInfo(minfo->modelid_other_gender); + CreatureModelInfo const* minfo_tmp = GetCreatureModelInfo(modelInfo->modelid_other_gender); if (!minfo_tmp) - sLog->outErrorDb("Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", *displayID, minfo->modelid_other_gender); + sLog->outErrorDb("Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", *displayID, modelInfo->modelid_other_gender); else { // Model ID changed - *displayID = minfo->modelid_other_gender; + *displayID = modelInfo->modelid_other_gender; return minfo_tmp; } } - return minfo; + return modelInfo; } void ObjectMgr::LoadCreatureModelInfo() @@ -1327,7 +1327,6 @@ void ObjectMgr::LoadLinkedRespawn() if (!error) _linkedRespawnStore[guid] = linkedGuid; - } while (result->NextRow()); @@ -1381,9 +1380,9 @@ void ObjectMgr::LoadCreatures() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 6 7 8 9 10 + // 0 1 2 3 4 5 6 7 8 9 10 QueryResult result = WorldDatabase.Query("SELECT creature.guid, id, map, modelid, equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, spawndist, " - // 11 12 13 14 15 16 17 18 19 20 21 + // 11 12 13 14 15 16 17 18 19 20 21 "currentwaypoint, curhealth, curmana, MovementType, spawnMask, phaseMask, eventEntry, pool_entry, creature.npcflag, creature.unit_flags, creature.dynamicflags " "FROM creature " "LEFT OUTER JOIN game_event_creature ON creature.guid = game_event_creature.guid " @@ -1694,7 +1693,7 @@ void ObjectMgr::LoadGameobjects() // 0 1 2 3 4 5 6 QueryResult result = WorldDatabase.Query("SELECT gameobject.guid, id, map, position_x, position_y, position_z, orientation, " - // 7 8 9 10 11 12 13 14 15 16 17 + // 7 8 9 10 11 12 13 14 15 16 17 "rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state, spawnMask, phaseMask, eventEntry, pool_entry " "FROM gameobject LEFT OUTER JOIN game_event_gameobject ON gameobject.guid = game_event_gameobject.guid " "LEFT OUTER JOIN pool_gameobject ON gameobject.guid = pool_gameobject.guid"); @@ -1821,7 +1820,6 @@ void ObjectMgr::LoadGameobjects() if (gameEvent == 0 && PoolId == 0) // if not this is to be managed by GameEvent System or Pool system AddGameobjectToGrid(guid, &data); ++count; - } while (result->NextRow()); sLog->outString(">> Loaded %lu gameobjects in %u ms", (unsigned long)_gameObjectDataStore.size(), GetMSTimeDiffToNow(oldMSTime)); @@ -2628,7 +2626,7 @@ void ObjectMgr::LoadItemTemplates() uint32 item_id = entry->ItemId[j]; - if (!sObjectMgr->GetItemTemplate(item_id)) + if (!GetItemTemplate(item_id)) notFoundOutfit.insert(item_id); } } @@ -3131,7 +3129,7 @@ void ObjectMgr::LoadPlayerInfo() uint32 item_id = fields[2].GetUInt32(); - if (!sObjectMgr->GetItemTemplate(item_id)) + if (!GetItemTemplate(item_id)) { sLog->outErrorDb("Item id %u (race %u class %u) in `playercreateinfo_item` table but not listed in `item_template`, ignoring.", item_id, current_race, current_class); continue; @@ -3694,7 +3692,7 @@ void ObjectMgr::LoadQuests() { Field* fields = result->Fetch(); - Quest * newQuest = new Quest(fields); + Quest* newQuest = new Quest(fields); _questTemplates[newQuest->GetQuestId()] = newQuest; } while (result->NextRow()); @@ -3712,9 +3710,7 @@ void ObjectMgr::LoadQuests() // additional quest integrity checks (GO, creature_template and item_template must be loaded already) if (qinfo->GetQuestMethod() >= 3) - { sLog->outErrorDb("Quest %u has `Method` = %u, expected values are 0, 1 or 2.", qinfo->GetQuestId(), qinfo->GetQuestMethod()); - } if (qinfo->Flags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED) { @@ -4401,7 +4397,6 @@ void ObjectMgr::LoadScripts(ScriptsType type) do { - Field* fields = result->Fetch(); ScriptInfo tmp; tmp.type = type; @@ -4810,8 +4805,8 @@ void ObjectMgr::LoadWaypointScripts() uint32 action = fields[0].GetUInt32(); actionSet.erase(action); - - } while (result->NextRow()); + } + while (result->NextRow()); } for (std::set::iterator itr = actionSet.begin(); itr != actionSet.end(); ++itr) @@ -5164,7 +5159,6 @@ void ObjectMgr::LoadGossipText() int count = 0; if (!result) { - sLog->outString(">> Loaded %u npc texts", count); sLog->outString(); return; @@ -5299,7 +5293,6 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) uint32 returnedCount = 0; do { - Field* fields = result->Fetch(); Mail* m = new Mail; m->messageID = fields[0].GetUInt32(); @@ -5618,7 +5611,7 @@ uint32 ObjectMgr::GetTaxiMountDisplayId(uint32 id, uint32 team, bool allowed_alt } // minfo is not actually used but the mount_id was updated - sObjectMgr->GetCreatureModelRandomGender(&mount_id); + GetCreatureModelRandomGender(&mount_id); return mount_id; } @@ -5766,10 +5759,10 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float if (MapId != entry->map_id) { // if find graveyard at different map from where entrance placed (or no entrance data), use any first - if (!mapEntry || - mapEntry->entrance_map < 0 || - uint32(mapEntry->entrance_map) != entry->map_id || - (mapEntry->entrance_x == 0 && mapEntry->entrance_y == 0)) + if (!mapEntry + || mapEntry->entrance_map < 0 + || uint32(mapEntry->entrance_map) != entry->map_id + || (mapEntry->entrance_x == 0 && mapEntry->entrance_y == 0)) { // not have any corrdinates for check distance anyway entryFar = entry; @@ -5914,8 +5907,6 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool WorldDatabase.Execute(stmt); } - - return; } void ObjectMgr::LoadAreaTriggerTeleports() @@ -5985,7 +5976,7 @@ void ObjectMgr::LoadAccessRequirements() _accessRequirementStore.clear(); // need for reload case - // 0 1 2 3 4 5 6 7 8 9 + // 0 1 2 3 4 5 6 7 8 9 QueryResult result = WorldDatabase.Query("SELECT mapid, difficulty, level_min, level_max, item, item2, quest_done_A, quest_done_H, completed_achievement, quest_failed_text FROM access_requirement"); if (!result) { @@ -6019,7 +6010,7 @@ void ObjectMgr::LoadAccessRequirements() if (ar.item) { - ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(ar.item); + ItemTemplate const* pProto = GetItemTemplate(ar.item); if (!pProto) { sLog->outError("Key item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item, mapid, difficulty); @@ -6029,7 +6020,7 @@ void ObjectMgr::LoadAccessRequirements() if (ar.item2) { - ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(ar.item2); + ItemTemplate const* pProto = GetItemTemplate(ar.item2); if (!pProto) { sLog->outError("Second item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item2, mapid, difficulty); @@ -6136,10 +6127,10 @@ void ObjectMgr::SetHighestGuids() _hiItemGuid = (*result)[0].GetUInt32()+1; // Cleanup other tables from not existed guids ( >= _hiItemGuid) - CharacterDatabase.PExecute("DELETE FROM character_inventory WHERE item >= '%u'", _hiItemGuid); // One-time query - CharacterDatabase.PExecute("DELETE FROM mail_items WHERE item_guid >= '%u'", _hiItemGuid); // One-time query - CharacterDatabase.PExecute("DELETE FROM auctionhouse WHERE itemguid >= '%u'", _hiItemGuid); // One-time query - CharacterDatabase.PExecute("DELETE FROM guild_bank_item WHERE item_guid >= '%u'", _hiItemGuid); // One-time query + CharacterDatabase.PExecute("DELETE FROM character_inventory WHERE item >= '%u'", _hiItemGuid); + CharacterDatabase.PExecute("DELETE FROM mail_items WHERE item_guid >= '%u'", _hiItemGuid); + CharacterDatabase.PExecute("DELETE FROM auctionhouse WHERE itemguid >= '%u'", _hiItemGuid); + CharacterDatabase.PExecute("DELETE FROM guild_bank_item WHERE item_guid >= '%u'", _hiItemGuid); result = WorldDatabase.Query("SELECT MAX(guid) FROM gameobject"); if (result) @@ -6416,14 +6407,10 @@ void ObjectMgr::LoadGameObjectTemplate() got.size = fields[9].GetFloat(); for (uint8 i = 0; i < MAX_GAMEOBJECT_QUEST_ITEMS; ++i) - { got.questItems[i] = fields[10 + i].GetUInt32(); - } for (uint8 i = 0; i < MAX_GAMEOBJECT_DATA; ++i) - { got.raw.data[i] = fields[16 + i].GetUInt32(); - } got.AIName = fields[40].GetString(); got.ScriptId = GetScriptId(fields[41].GetCString()); @@ -6432,28 +6419,28 @@ void ObjectMgr::LoadGameObjectTemplate() switch (got.type) { - case GAMEOBJECT_TYPE_DOOR: //0 + case GAMEOBJECT_TYPE_DOOR: //0 { if (got.door.lockId) CheckGOLockId(&got, got.door.lockId, 1); - CheckGONoDamageImmuneId(&got, got.door.noDamageImmune, 3); + CheckGONoDamageImmuneId(&got, got.door.noDamageImmune, 3); break; } - case GAMEOBJECT_TYPE_BUTTON: //1 + case GAMEOBJECT_TYPE_BUTTON: //1 { if (got.button.lockId) - CheckGOLockId(&got, got.button.lockId, 1); + CheckGOLockId(&got, got.button.lockId, 1); CheckGONoDamageImmuneId(&got, got.button.noDamageImmune, 4); break; } - case GAMEOBJECT_TYPE_QUESTGIVER: //2 + case GAMEOBJECT_TYPE_QUESTGIVER: //2 { if (got.questgiver.lockId) CheckGOLockId(&got, got.questgiver.lockId, 0); CheckGONoDamageImmuneId(&got, got.questgiver.noDamageImmune, 5); break; } - case GAMEOBJECT_TYPE_CHEST: //3 + case GAMEOBJECT_TYPE_CHEST: //3 { if (got.chest.lockId) CheckGOLockId(&got, got.chest.lockId, 0); @@ -6464,16 +6451,16 @@ void ObjectMgr::LoadGameObjectTemplate() CheckGOLinkedTrapId(&got, got.chest.linkedTrapId, 7); break; } - case GAMEOBJECT_TYPE_TRAP: //6 + case GAMEOBJECT_TYPE_TRAP: //6 { if (got.trap.lockId) CheckGOLockId(&got, got.trap.lockId, 0); break; } - case GAMEOBJECT_TYPE_CHAIR: //7 - CheckAndFixGOChairHeightId(&got, got.chair.height, 1); - break; - case GAMEOBJECT_TYPE_SPELL_FOCUS: //8 + case GAMEOBJECT_TYPE_CHAIR: //7 + CheckAndFixGOChairHeightId(&got, got.chair.height, 1); + break; + case GAMEOBJECT_TYPE_SPELL_FOCUS: //8 { if (got.spellFocus.focusId) { @@ -6486,7 +6473,7 @@ void ObjectMgr::LoadGameObjectTemplate() CheckGOLinkedTrapId(&got, got.spellFocus.linkedTrapId, 2); break; } - case GAMEOBJECT_TYPE_GOOBER: //10 + case GAMEOBJECT_TYPE_GOOBER: //10 { if (got.goober.lockId) CheckGOLockId(&got, got.goober.lockId, 0); @@ -6504,19 +6491,19 @@ void ObjectMgr::LoadGameObjectTemplate() CheckGOLinkedTrapId(&got, got.goober.linkedTrapId, 12); break; } - case GAMEOBJECT_TYPE_AREADAMAGE: //12 + case GAMEOBJECT_TYPE_AREADAMAGE: //12 { if (got.areadamage.lockId) CheckGOLockId(&got, got.areadamage.lockId, 0); break; } - case GAMEOBJECT_TYPE_CAMERA: //13 + case GAMEOBJECT_TYPE_CAMERA: //13 { if (got.camera.lockId) CheckGOLockId(&got, got.camera.lockId, 0); break; } - case GAMEOBJECT_TYPE_MO_TRANSPORT: //15 + case GAMEOBJECT_TYPE_MO_TRANSPORT: //15 { if (got.moTransport.taxiPathId) { @@ -6526,37 +6513,37 @@ void ObjectMgr::LoadGameObjectTemplate() } break; } - case GAMEOBJECT_TYPE_SUMMONING_RITUAL: //18 - break; - case GAMEOBJECT_TYPE_SPELLCASTER: //22 + case GAMEOBJECT_TYPE_SUMMONING_RITUAL: //18 + break; + case GAMEOBJECT_TYPE_SPELLCASTER: //22 { // always must have spell CheckGOSpellId(&got, got.spellcaster.spellId, 0); break; } - case GAMEOBJECT_TYPE_FLAGSTAND: //24 + case GAMEOBJECT_TYPE_FLAGSTAND: //24 { if (got.flagstand.lockId) CheckGOLockId(&got, got.flagstand.lockId, 0); CheckGONoDamageImmuneId(&got, got.flagstand.noDamageImmune, 5); break; } - case GAMEOBJECT_TYPE_FISHINGHOLE: //25 + case GAMEOBJECT_TYPE_FISHINGHOLE: //25 { if (got.fishinghole.lockId) CheckGOLockId(&got, got.fishinghole.lockId, 4); break; } - case GAMEOBJECT_TYPE_FLAGDROP: //26 + case GAMEOBJECT_TYPE_FLAGDROP: //26 { if (got.flagdrop.lockId) CheckGOLockId(&got, got.flagdrop.lockId, 0); CheckGONoDamageImmuneId(&got, got.flagdrop.noDamageImmune, 3); break; } - case GAMEOBJECT_TYPE_BARBER_CHAIR: //32 - CheckAndFixGOChairHeightId(&got, got.barberChair.chairheight, 0); - break; + case GAMEOBJECT_TYPE_BARBER_CHAIR: //32 + CheckAndFixGOChairHeightId(&got, got.barberChair.chairheight, 0); + break; } ++count; @@ -6584,7 +6571,6 @@ void ObjectMgr::LoadExplorationBaseXP() do { - Field* fields = result->Fetch(); uint8 level = fields[0].GetUInt8(); uint32 basexp = fields[1].GetUInt32(); @@ -6626,7 +6612,6 @@ void ObjectMgr::LoadPetNames() do { - Field* fields = result->Fetch(); std::string word = fields[0].GetString(); uint32 entry = fields[1].GetUInt32(); @@ -6739,7 +6724,6 @@ void ObjectMgr::LoadReputationRewardRate() do { - Field* fields = result->Fetch(); uint32 factionId = fields[0].GetUInt32(); @@ -6877,7 +6861,6 @@ void ObjectMgr::LoadReputationSpilloverTemplate() do { - Field* fields = result->Fetch(); uint32 factionId = fields[0].GetUInt32(); @@ -6997,12 +6980,12 @@ void ObjectMgr::LoadPointsOfInterest() uint32 point_id = fields[0].GetUInt32(); PointOfInterest POI; - POI.x = fields[1].GetFloat(); - POI.y = fields[2].GetFloat(); - POI.icon = fields[3].GetUInt32(); - POI.flags = fields[4].GetUInt32(); - POI.data = fields[5].GetUInt32(); - POI.icon_name = fields[6].GetString(); + POI.x = fields[1].GetFloat(); + POI.y = fields[2].GetFloat(); + POI.icon = fields[3].GetUInt32(); + POI.flags = fields[4].GetUInt32(); + POI.data = fields[5].GetUInt32(); + POI.icon_name = fields[6].GetString(); if (!Trinity::IsValidMapCoord(POI.x, POI.y)) { @@ -7051,7 +7034,6 @@ void ObjectMgr::LoadQuestPOI() do { - fields = points->Fetch(); uint32 questId = fields[0].GetUInt32(); @@ -7176,7 +7158,7 @@ void ObjectMgr::SaveCreatureRespawnTime(uint32 loguid, uint32 instance, time_t t _creatureRespawnTimesMutex.release(); } - PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN); stmt->setUInt32(0, loguid); stmt->setUInt64(1, uint64(t)); stmt->setUInt32(2, instance); @@ -7330,7 +7312,6 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table, do { - uint32 id = result->Fetch()[0].GetUInt32(); uint32 quest = result->Fetch()[1].GetUInt32(); uint32 poolId = result->Fetch()[2].GetUInt32(); @@ -7653,7 +7634,7 @@ void ObjectMgr::LoadGameObjectForQuests() sLog->outString(); } -bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max_value) +bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max_value) { uint32 oldMSTime = getMSTime(); @@ -7695,7 +7676,6 @@ bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max if (!result) { - if (min_value == MIN_TRINITY_STRING_ID) // error only in case internal strings sLog->outErrorDb(">> Loaded 0 trinity strings. DB table `%s` is empty. Cannot continue.", table); else @@ -7783,7 +7763,6 @@ void ObjectMgr::LoadFishingBaseSkillLevel() do { - Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); int32 skill = fields[1].GetInt32(); @@ -7813,7 +7792,7 @@ bool ObjectMgr::CheckDeclinedNames(std::wstring w_ownname, DeclinedName const& n bool y = true; // check declined names - for (uint8 i =0; i < MAX_DECLINED_NAME_CASES; ++i) + for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i) { std::wstring wname; if (!Utf8toWStr(names.name[i], wname)) @@ -7892,7 +7871,6 @@ void ObjectMgr::LoadGameTele() do { - Field* fields = result->Fetch(); uint32 id = fields[0].GetUInt32(); @@ -7935,7 +7913,7 @@ GameTele const* ObjectMgr::GetGameTele(const std::string& name) const // explicit name case std::wstring wname; if (!Utf8toWStr(name, wname)) - return false; + return NULL; // converting string that we try to find to lower case wstrToLower(wname); @@ -8033,7 +8011,6 @@ void ObjectMgr::LoadMailLevelRewards() do { - Field* fields = result->Fetch(); uint8 level = fields[0].GetUInt8(); @@ -8177,7 +8154,6 @@ void ObjectMgr::LoadTrainerSpell() do { - Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); @@ -8189,8 +8165,7 @@ void ObjectMgr::LoadTrainerSpell() AddSpellToTrainer(entry, spell, spellCost, reqSkill, reqSkillValue, reqLevel); - count++; - + ++count; } while (result->NextRow()); @@ -8229,7 +8204,6 @@ int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set *s vList.AddItem(item_id, maxcount, incrtime, ExtendedCost); ++count; } - } while (result->NextRow()); return count; @@ -8280,7 +8254,6 @@ void ObjectMgr::LoadVendors() vList.AddItem(item_id, maxcount, incrtime, ExtendedCost); ++count; } - } while (result->NextRow()); @@ -8307,7 +8280,6 @@ void ObjectMgr::LoadGossipMenu() do { - Field* fields = result->Fetch(); GossipMenus gMenu; @@ -8626,7 +8598,7 @@ void ObjectMgr::LoadDbScriptStrings() sLog->outErrorDb("Table `db_script_string` has unused string id %u", *itr); } -bool LoadTrinityStrings(char const* table, int32 start_value, int32 end_value) +bool LoadTrinityStrings(const char* table, int32 start_value, int32 end_value) { // MAX_DB_SCRIPT_STRING_ID is max allowed negative value for scripts (scrpts can use only more deep negative values // start/end reversed for negative values diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 1172f04241d..0f2b2382007 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -385,7 +385,6 @@ struct TrinityStringLocale StringVector Content; }; - typedef std::map LinkedRespawnContainer; typedef UNORDERED_MAP CreatureDataContainer; typedef UNORDERED_MAP GameObjectDataContainer; @@ -527,6 +526,7 @@ struct GraveYardData uint32 safeLocId; uint32 team; }; + typedef std::multimap GraveYardContainer; typedef UNORDERED_MAP CacheVendorItemContainer; @@ -641,7 +641,7 @@ class ObjectMgr return NULL; } - InstanceTemplate const* GetInstanceTemplate(uint32 mapID); + InstanceTemplate const* GetInstanceTemplate(uint32 mapId); PetLevelInfo const* GetPetLevelInfo(uint32 creature_id, uint8 level) const; @@ -1334,7 +1334,6 @@ class ObjectMgr GO_TO_GO, GO_TO_CREATURE, // GO is dependant on creature }; - }; #define sObjectMgr ACE_Singleton::instance() diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 467a84be186..c9e99af6fed 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -227,7 +227,7 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recvData) uint32 unkPackedTime; uint32 flags; uint64 inviteId = 0; - uint64 invitee; + uint64 invitee = 0; uint8 status; uint8 rank; diff --git a/src/server/game/Warden/Warden.cpp b/src/server/game/Warden/Warden.cpp index 3d625df63d0..f2fe3c4ad67 100644 --- a/src/server/game/Warden/Warden.cpp +++ b/src/server/game/Warden/Warden.cpp @@ -203,7 +203,7 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& recvData) _warden->DecryptData(const_cast(recvData.contents()), recvData.size()); uint8 opcode; recvData >> opcode; - sLog->outDebug(LOG_FILTER_WARDEN, "Got packet, opcode %02X, size %u", opcode, recvData.size()); + sLog->outDebug(LOG_FILTER_WARDEN, "Got packet, opcode %02X, size %u", opcode, uint32(recvData.size())); recvData.hexlike(); switch(opcode) @@ -228,7 +228,7 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& recvData) sLog->outDebug(LOG_FILTER_WARDEN, "NYI WARDEN_CMSG_MODULE_FAILED received!"); break; default: - sLog->outDebug(LOG_FILTER_WARDEN, "Got unknown warden opcode %02X of size %u.", opcode, recvData.size() - 1); + sLog->outDebug(LOG_FILTER_WARDEN, "Got unknown warden opcode %02X of size %u.", opcode, uint32(recvData.size() - 1)); break; } } From d38bc3a17857c36a3ab871deac57b314987194bb Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 27 Feb 2012 14:58:47 +0100 Subject: [PATCH 0058/1149] Core: Rename GetCreatureInfo to GetCreatureTemplate and minor cleanup here and there --- src/server/game/AI/CreatureAISelector.cpp | 2 +- .../game/AI/ScriptedAI/ScriptedEscortAI.cpp | 4 +- .../game/AI/ScriptedAI/ScriptedFollowerAI.cpp | 6 +- src/server/game/AI/SmartScripts/SmartAI.cpp | 4 +- src/server/game/Battlegrounds/ArenaTeam.cpp | 22 +-- .../game/Entities/Creature/Creature.cpp | 64 +++---- src/server/game/Entities/Creature/Creature.h | 22 +-- src/server/game/Entities/Item/Item.cpp | 26 ++- src/server/game/Entities/Object/Object.cpp | 2 +- src/server/game/Entities/Pet/Pet.cpp | 22 +-- src/server/game/Entities/Player/Player.cpp | 73 ++++---- src/server/game/Entities/Player/Player.h | 14 +- src/server/game/Entities/Unit/StatSystem.cpp | 4 +- src/server/game/Entities/Unit/Unit.cpp | 52 +++--- src/server/game/Entities/Vehicle/Vehicle.cpp | 2 +- src/server/game/Events/GameEventMgr.cpp | 2 +- src/server/game/Groups/Group.cpp | 3 +- src/server/game/Handlers/ItemHandler.cpp | 1 - src/server/game/Handlers/LootHandler.cpp | 25 ++- src/server/game/Handlers/MiscHandler.cpp | 34 ++-- src/server/game/Handlers/NPCHandler.cpp | 4 +- src/server/game/Handlers/QuestHandler.cpp | 2 +- src/server/game/Loot/LootMgr.cpp | 162 +++++++++--------- src/server/game/Miscellaneous/Formulas.h | 4 +- .../game/Spells/Auras/SpellAuraEffects.cpp | 6 +- src/server/game/Spells/Spell.cpp | 4 +- src/server/game/Spells/SpellEffects.cpp | 6 +- src/server/scripts/Commands/cs_learn.cpp | 2 +- src/server/scripts/Commands/cs_npc.cpp | 6 +- .../BlackrockSpire/boss_gyth.cpp | 2 +- .../Karazhan/boss_prince_malchezaar.cpp | 4 +- .../ScarletEnclave/chapter1.cpp | 4 +- .../EasternKingdoms/ZulGurub/boss_arlokk.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_marli.cpp | 4 +- .../EasternKingdoms/ZulGurub/boss_thekal.cpp | 2 +- .../boss_anubarak_trial.cpp | 4 +- .../IcecrownCitadel/boss_the_lich_king.cpp | 2 +- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 2 +- .../Northrend/Ulduar/Ulduar/boss_hodir.cpp | 10 +- .../Ulduar/Ulduar/boss_razorscale.cpp | 2 +- .../scripts/Northrend/borean_tundra.cpp | 2 +- src/server/scripts/Northrend/zuldrak.cpp | 4 +- .../Outland/BlackTemple/boss_illidan.cpp | 2 +- .../scripts/Outland/blades_edge_mountains.cpp | 2 +- src/server/scripts/Spells/spell_dk.cpp | 2 +- .../scripts/World/mob_generic_creature.cpp | 2 +- src/server/scripts/World/npcs_special.cpp | 2 +- 47 files changed, 317 insertions(+), 317 deletions(-) diff --git a/src/server/game/AI/CreatureAISelector.cpp b/src/server/game/AI/CreatureAISelector.cpp index ab616d78a8c..f64bb320542 100755 --- a/src/server/game/AI/CreatureAISelector.cpp +++ b/src/server/game/AI/CreatureAISelector.cpp @@ -102,7 +102,7 @@ namespace FactorySelector MovementGenerator* selectMovementGenerator(Creature* creature) { MovementGeneratorRegistry& mv_registry(*MovementGeneratorRepository::instance()); - ASSERT(creature->GetCreatureInfo() != NULL); + ASSERT(creature->GetCreatureTemplate() != NULL); const MovementGeneratorCreator* mv_factory = mv_registry.GetRegistryItem(creature->GetDefaultMovementType()); /* if (mv_factory == NULL) diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 01e13b29f19..1e0c3f5c1fc 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -57,7 +57,7 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* who) return false; //experimental (unknown) flag not present - if (!(me->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS)) + if (!(me->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS)) return false; //not a player @@ -150,7 +150,7 @@ void npc_escortAI::JustRespawned() //add a small delay before going to first waypoint, normal in near all cases m_uiWPWaitTimer = 2500; - if (me->getFaction() != me->GetCreatureInfo()->faction_A) + if (me->getFaction() != me->GetCreatureTemplate()->faction_A) me->RestoreFaction(); Reset(); diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index d83ad9b756c..e0fe12082f1 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -55,7 +55,7 @@ bool FollowerAI::AssistPlayerInCombat(Unit* who) return false; //experimental (unknown) flag not present - if (!(me->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS)) + if (!(me->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS)) return false; //not a player @@ -150,8 +150,8 @@ void FollowerAI::JustRespawned() if (!IsCombatMovementAllowed()) SetCombatMovement(true); - if (me->getFaction() != me->GetCreatureInfo()->faction_A) - me->setFaction(me->GetCreatureInfo()->faction_A); + if (me->getFaction() != me->GetCreatureTemplate()->faction_A) + me->setFaction(me->GetCreatureTemplate()->faction_A); Reset(); } diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 8776090c86f..50c7aba0360 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -524,7 +524,7 @@ bool SmartAI::AssistPlayerInCombat(Unit* who) return false; //experimental (unknown) flag not present - if (!(me->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS)) + if (!(me->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS)) return false; //not a player @@ -561,7 +561,7 @@ void SmartAI::JustRespawned() mDespawnState = 0; mEscortState = SMART_ESCORT_NONE; me->SetVisible(true); - if (me->getFaction() != me->GetCreatureInfo()->faction_A) + if (me->getFaction() != me->GetCreatureTemplate()->faction_A) me->RestoreFaction(); GetScript()->ProcessEventsFor(SMART_EVENT_RESPAWN); Reset(); diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index a5c34e4b7ee..05fef44f676 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -154,18 +154,18 @@ bool ArenaTeam::AddMember(uint64 playerGuid) Player::RemovePetitionsAndSigns(playerGuid, GetType()); // Feed data to the struct - ArenaTeamMember newmember; - newmember.Name = playerName; - newmember.Guid = playerGuid; - newmember.Class = playerClass; - newmember.SeasonGames = 0; - newmember.WeekGames = 0; - newmember.SeasonWins = 0; - newmember.WeekWins = 0; - newmember.PersonalRating = personalRating; - newmember.MatchMakerRating = matchMakerRating; + ArenaTeamMember newMember; + newMember.Name = playerName; + newMember.Guid = playerGuid; + newMember.Class = playerClass; + newMember.SeasonGames = 0; + newMember.WeekGames = 0; + newMember.SeasonWins = 0; + newMember.WeekWins = 0; + newMember.PersonalRating = personalRating; + newMember.MatchMakerRating = matchMakerRating; - Members.push_back(newmember); + Members.push_back(newMember); // Save player's arena team membership to db stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ARENA_TEAM_MEMBER); diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 20bcfc8f41c..0fe2016950b 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -303,7 +303,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data return false; } - uint32 displayID = sObjectMgr->ChooseDisplayId(0, GetCreatureInfo(), data); + uint32 displayID = sObjectMgr->ChooseDisplayId(0, GetCreatureTemplate(), data); CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID); if (!minfo) // Cancel load if no model defined { @@ -342,7 +342,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data m_defaultMovementType = IDLE_MOTION_TYPE; for (uint8 i=0; i < CREATURE_MAX_SPELLS; ++i) - m_spells[i] = GetCreatureInfo()->spells[i]; + m_spells[i] = GetCreatureTemplate()->spells[i]; return true; } @@ -352,14 +352,14 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data) if (!InitEntry(Entry, team, data)) return false; - CreatureTemplate const* cInfo = GetCreatureInfo(); + CreatureTemplate const* cInfo = GetCreatureTemplate(); m_regenHealth = cInfo->RegenHealth; // creatures always have melee weapon ready if any SetSheath(SHEATH_STATE_MELEE); - SelectLevel(GetCreatureInfo()); + SelectLevel(GetCreatureTemplate()); if (team == HORDE) setFaction(cInfo->faction_H); else @@ -754,7 +754,7 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, if (!CreateFromProto(guidlow, Entry, vehId, team, data)) return false; - switch (GetCreatureInfo()->rank) + switch (GetCreatureTemplate()->rank) { case CREATURE_ELITE_RARE: m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_RARE); @@ -783,7 +783,7 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, SetByteValue(UNIT_FIELD_BYTES_0, 2, minfo->gender); } - if (GetCreatureInfo()->InhabitType & INHABIT_AIR) + if (GetCreatureTemplate()->InhabitType & INHABIT_AIR) { if (GetDefaultMovementType() == IDLE_MOTION_TYPE) AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); @@ -791,10 +791,10 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, SetFlying(true); } - if (GetCreatureInfo()->InhabitType & INHABIT_WATER) + if (GetCreatureTemplate()->InhabitType & INHABIT_WATER) AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); - LastUsedScriptID = GetCreatureInfo()->ScriptID; + LastUsedScriptID = GetCreatureTemplate()->ScriptID; // TODO: Replace with spell, handle from DB if (isSpiritHealer() || isSpiritGuide()) @@ -816,22 +816,22 @@ bool Creature::isCanTrainingOf(Player* player, bool msg) const TrainerSpellData const* trainer_spells = GetTrainerSpells(); - if ((!trainer_spells || trainer_spells->spellList.empty()) && GetCreatureInfo()->trainer_type != TRAINER_TYPE_PETS) + if ((!trainer_spells || trainer_spells->spellList.empty()) && GetCreatureTemplate()->trainer_type != TRAINER_TYPE_PETS) { sLog->outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_TRAINER but have empty trainer spell list.", GetGUIDLow(), GetEntry()); return false; } - switch (GetCreatureInfo()->trainer_type) + switch (GetCreatureTemplate()->trainer_type) { case TRAINER_TYPE_CLASS: - if (player->getClass() != GetCreatureInfo()->trainer_class) + if (player->getClass() != GetCreatureTemplate()->trainer_class) { if (msg) { player->PlayerTalkClass->ClearMenus(); - switch (GetCreatureInfo()->trainer_class) + switch (GetCreatureTemplate()->trainer_class) { case CLASS_DRUID: player->PlayerTalkClass->SendGossipMenu(4913, GetGUID()); break; case CLASS_HUNTER: player->PlayerTalkClass->SendGossipMenu(10090, GetGUID()); break; @@ -856,12 +856,12 @@ bool Creature::isCanTrainingOf(Player* player, bool msg) const } break; case TRAINER_TYPE_MOUNTS: - if (GetCreatureInfo()->trainer_race && player->getRace() != GetCreatureInfo()->trainer_race) + if (GetCreatureTemplate()->trainer_race && player->getRace() != GetCreatureTemplate()->trainer_race) { if (msg) { player->PlayerTalkClass->ClearMenus(); - switch (GetCreatureInfo()->trainer_class) + switch (GetCreatureTemplate()->trainer_class) { case RACE_DWARF: player->PlayerTalkClass->SendGossipMenu(5865, GetGUID()); break; case RACE_GNOME: player->PlayerTalkClass->SendGossipMenu(4881, GetGUID()); break; @@ -879,7 +879,7 @@ bool Creature::isCanTrainingOf(Player* player, bool msg) const } break; case TRAINER_TYPE_TRADESKILLS: - if (GetCreatureInfo()->trainer_spell && !player->HasSpell(GetCreatureInfo()->trainer_spell)) + if (GetCreatureTemplate()->trainer_spell && !player->HasSpell(GetCreatureTemplate()->trainer_spell)) { if (msg) { @@ -930,8 +930,8 @@ bool Creature::isCanInteractWithBattleMaster(Player* player, bool msg) const bool Creature::isCanTrainingAndResetTalentsOf(Player* player) const { return player->getLevel() >= 10 - && GetCreatureInfo()->trainer_type == TRAINER_TYPE_CLASS - && player->getClass() == GetCreatureInfo()->trainer_class; + && GetCreatureTemplate()->trainer_type == TRAINER_TYPE_CLASS + && player->getClass() == GetCreatureTemplate()->trainer_class; } void Creature::AI_SendMoveToPacket(float x, float y, float z, uint32 time, uint32 /*MovementFlags*/, uint8 /*type*/) @@ -1040,7 +1040,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) uint32 dynamicflags = GetUInt32Value(UNIT_DYNAMIC_FLAGS); // check if it's a custom model and if not, use 0 for displayId - CreatureTemplate const* cinfo = GetCreatureInfo(); + CreatureTemplate const* cinfo = GetCreatureTemplate(); if (cinfo) { if (displayId == cinfo->Modelid1 || displayId == cinfo->Modelid2 || @@ -1302,7 +1302,7 @@ bool Creature::LoadCreatureFromDB(uint32 guid, Map* map, bool addToMap) curhealth = data->curhealth; if (curhealth) { - curhealth = uint32(curhealth*_GetHealthMod(GetCreatureInfo()->rank)); + curhealth = uint32(curhealth*_GetHealthMod(GetCreatureTemplate()->rank)); if (curhealth < 1) curhealth = 1; } @@ -1502,8 +1502,8 @@ void Creature::setDeathState(DeathState s) setActive(false); - if (!isPet() && GetCreatureInfo()->SkinLootId) - if (LootTemplates_Skinning.HaveLootFor(GetCreatureInfo()->SkinLootId)) + if (!isPet() && GetCreatureTemplate()->SkinLootId) + if (LootTemplates_Skinning.HaveLootFor(GetCreatureTemplate()->SkinLootId)) if (hasLootRecipient()) SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); @@ -1529,11 +1529,11 @@ void Creature::setDeathState(DeathState s) SetFullHealth(); SetLootRecipient(NULL); ResetPlayerDamageReq(); - CreatureTemplate const* cinfo = GetCreatureInfo(); + CreatureTemplate const* cinfo = GetCreatureTemplate(); SetWalk(true); - if (GetCreatureInfo()->InhabitType & INHABIT_AIR) + if (GetCreatureTemplate()->InhabitType & INHABIT_AIR) AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING); - if (GetCreatureInfo()->InhabitType & INHABIT_WATER) + if (GetCreatureTemplate()->InhabitType & INHABIT_WATER) AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); ClearUnitState(uint32(UNIT_STATE_ALL_STATE)); @@ -1573,7 +1573,7 @@ void Creature::Respawn(bool force) if (m_originalEntry != GetEntry()) UpdateEntry(m_originalEntry); - CreatureTemplate const* cinfo = GetCreatureInfo(); + CreatureTemplate const* cinfo = GetCreatureTemplate(); SelectLevel(cinfo); setDeathState(JUST_ALIVED); @@ -1634,11 +1634,11 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo) return false; // Spells that don't have effectMechanics. - if (!spellInfo->HasAnyEffectMechanic() && GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1))) + if (!spellInfo->HasAnyEffectMechanic() && GetCreatureTemplate()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1))) return true; - // This check must be done instead of 'if (GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))' for not break - // the check of mechanic immunity on DB (tested) because GetCreatureInfo()->MechanicImmuneMask and m_spellImmune[IMMUNITY_MECHANIC] don't have same data. + // This check must be done instead of 'if (GetCreatureTemplate()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))' for not break + // the check of mechanic immunity on DB (tested) because GetCreatureTemplate()->MechanicImmuneMask and m_spellImmune[IMMUNITY_MECHANIC] don't have same data. bool immunedToAllEffects = true; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (!IsImmunedToSpellEffect(spellInfo, i)) @@ -1654,10 +1654,10 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo) bool Creature::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const { - if (GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->Effects[index].Mechanic - 1))) + if (GetCreatureTemplate()->MechanicImmuneMask & (1 << (spellInfo->Effects[index].Mechanic - 1))) return true; - if (GetCreatureInfo()->type == CREATURE_TYPE_MECHANICAL && spellInfo->Effects[index].Effect == SPELL_EFFECT_HEAL) + if (GetCreatureTemplate()->type == CREATURE_TYPE_MECHANICAL && spellInfo->Effects[index].Effect == SPELL_EFFECT_HEAL) return true; return Unit::IsImmunedToSpellEffect(spellInfo, index); @@ -2015,7 +2015,7 @@ CreatureAddon const* Creature::GetCreatureAddon() const } // dependent from difficulty mode entry - return sObjectMgr->GetCreatureTemplateAddon(GetCreatureInfo()->Entry); + return sObjectMgr->GetCreatureTemplateAddon(GetCreatureTemplate()->Entry); } //creature_addon table @@ -2236,7 +2236,7 @@ void Creature::AllLootRemovedFromCorpse() return; float decayRate; - CreatureTemplate const* cinfo = GetCreatureInfo(); + CreatureTemplate const* cinfo = GetCreatureTemplate(); decayRate = sWorld->getRate(RATE_CORPSE_DECAY_LOOTED); uint32 diff = uint32((m_corpseRemoveTime - now) * decayRate); diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 40477de7c75..f986e09e7cb 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -457,17 +457,17 @@ class Creature : public Unit, public GridObject, public MapCreature void Update(uint32 time); // overwrited Unit::Update void GetRespawnPosition(float &x, float &y, float &z, float* ori = NULL, float* dist =NULL) const; - uint32 GetEquipmentId() const { return GetCreatureInfo()->equipmentId; } + uint32 GetEquipmentId() const { return GetCreatureTemplate()->equipmentId; } void SetCorpseDelay(uint32 delay) { m_corpseDelay = delay; } uint32 GetCorpseDelay() const { return m_corpseDelay; } - bool isRacialLeader() const { return GetCreatureInfo()->RacialLeader; } - bool isCivilian() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_CIVILIAN; } - bool isTrigger() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER; } - bool isGuard() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_GUARD; } - bool canWalk() const { return GetCreatureInfo()->InhabitType & INHABIT_GROUND; } - bool canSwim() const { return GetCreatureInfo()->InhabitType & INHABIT_WATER; } - //bool canFly() const { return GetCreatureInfo()->InhabitType & INHABIT_AIR; } + bool isRacialLeader() const { return GetCreatureTemplate()->RacialLeader; } + bool isCivilian() const { return GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_CIVILIAN; } + bool isTrigger() const { return GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER; } + bool isGuard() const { return GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_GUARD; } + bool canWalk() const { return GetCreatureTemplate()->InhabitType & INHABIT_GROUND; } + bool canSwim() const { return GetCreatureTemplate()->InhabitType & INHABIT_WATER; } + //bool canFly() const { return GetCreatureTemplate()->InhabitType & INHABIT_AIR; } void SetReactState(ReactStates st) { m_reactState = st; } ReactStates GetReactState() { return m_reactState; } @@ -496,7 +496,7 @@ class Creature : public Unit, public GridObject, public MapCreature if (isPet()) return false; - uint32 rank = GetCreatureInfo()->rank; + uint32 rank = GetCreatureTemplate()->rank; return rank != CREATURE_ELITE_NORMAL && rank != CREATURE_ELITE_RARE; } @@ -505,7 +505,7 @@ class Creature : public Unit, public GridObject, public MapCreature if (isPet()) return false; - return GetCreatureInfo()->rank == CREATURE_ELITE_WORLDBOSS; + return GetCreatureTemplate()->rank == CREATURE_ELITE_WORLDBOSS; } bool IsDungeonBoss() const; @@ -558,7 +558,7 @@ class Creature : public Unit, public GridObject, public MapCreature TrainerSpellData const* GetTrainerSpells() const; - CreatureTemplate const* GetCreatureInfo() const { return m_creatureInfo; } + CreatureTemplate const* GetCreatureTemplate() const { return m_creatureInfo; } CreatureData const* GetCreatureData() const { return m_creatureData; } CreatureAddon const* GetCreatureAddon() const; diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 70b81593b56..0fc53a65258 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -56,8 +56,7 @@ void AddItemsSetItem(Player* player, Item* item) if (!eff) { - eff = new ItemSetEffect; - memset(eff, 0, sizeof(ItemSetEffect)); + eff = new ItemSetEffect(); eff->setid = setid; size_t x = 0; @@ -780,20 +779,18 @@ bool Item::CanBeTraded(bool mail, bool trade) const bool Item::HasEnchantRequiredSkill(const Player* player) const { - - // Check all enchants for required skill - for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot) - if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot))) - if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id)) - if (enchantEntry->requiredSkill && player->GetSkillValue(enchantEntry->requiredSkill) < enchantEntry->requiredSkillValue) - return false; + // Check all enchants for required skill + for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot) + if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot))) + if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id)) + if (enchantEntry->requiredSkill && player->GetSkillValue(enchantEntry->requiredSkill) < enchantEntry->requiredSkillValue) + return false; return true; } uint32 Item::GetEnchantRequiredLevel() const { - uint32 level = 0; // Check all enchants for required level @@ -861,7 +858,7 @@ bool Item::IsFitToSpellRequirements(SpellInfo const* spellInfo) const // Special case - accept weapon type for main and offhand requirements if (proto->InventoryType == INVTYPE_WEAPON && (spellInfo->EquippedItemInventoryTypeMask & (1 << INVTYPE_WEAPONMAINHAND) || - spellInfo->EquippedItemInventoryTypeMask & (1 << INVTYPE_WEAPONOFFHAND))) + spellInfo->EquippedItemInventoryTypeMask & (1 << INVTYPE_WEAPONOFFHAND))) return true; else if ((spellInfo->EquippedItemInventoryTypeMask & (1 << proto->InventoryType)) == 0) return false; // inventory type not present in mask @@ -1001,12 +998,13 @@ bool Item::IsLimitedToAnotherMapOrZone(uint32 cur_mapId, uint32 cur_zoneId) cons // time. void Item::SendTimeUpdate(Player* owner) { - if (!GetUInt32Value(ITEM_FIELD_DURATION)) + uint32 duration = GetUInt32Value(ITEM_FIELD_DURATION); + if (!duration) return; WorldPacket data(SMSG_ITEM_TIME_UPDATE, (8+4)); - data << (uint64)GetGUID(); - data << (uint32)GetUInt32Value(ITEM_FIELD_DURATION); + data << uint64(GetGUID()); + data << uint32(duration); owner->GetSession()->SendPacket(&data); } diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index c98364ecb2d..c1ecc3b74e7 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -541,7 +541,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* { if (GetTypeId() == TYPEID_UNIT) { - CreatureTemplate const* cinfo = ToCreature()->GetCreatureInfo(); + CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate(); // this also applies for transform auras if (SpellInfo const* transform = sSpellMgr->GetSpellInfo(ToUnit()->getTransForm())) diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 566ee06218e..e7103e2cb70 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -180,7 +180,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c setFaction(owner->getFaction()); SetUInt32Value(UNIT_CREATED_BY_SPELL, summon_spell_id); - CreatureTemplate const* cinfo = GetCreatureInfo(); + CreatureTemplate const* cinfo = GetCreatureTemplate(); if (cinfo->type == CREATURE_TYPE_CRITTER) { map->AddToMap(this->ToCreature()); @@ -692,7 +692,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature) { ASSERT(creature); - if (!CreateBaseAtTamed(creature->GetCreatureInfo(), creature->GetMap(), creature->GetPhaseMask())) + if (!CreateBaseAtTamed(creature->GetCreatureTemplate(), creature->GetMap(), creature->GetPhaseMask())) return false; Relocate(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), creature->GetOrientation()); @@ -704,7 +704,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature) return false; } - CreatureTemplate const* cinfo = GetCreatureInfo(); + CreatureTemplate const* cinfo = GetCreatureTemplate(); if (!cinfo) { sLog->outError("CreateBaseAtCreature() failed, creatureInfo is missing!"); @@ -763,7 +763,7 @@ bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phas // TODO: Move stat mods code to pet passive auras bool Guardian::InitStatsForLevel(uint8 petlevel) { - CreatureTemplate const* cinfo = GetCreatureInfo(); + CreatureTemplate const* cinfo = GetCreatureTemplate(); ASSERT(cinfo); SetLevel(petlevel); @@ -997,7 +997,7 @@ bool Pet::HaveInDiet(ItemTemplate const* item) const if (!item->FoodType) return false; - CreatureTemplate const* cInfo = GetCreatureInfo(); + CreatureTemplate const* cInfo = GetCreatureTemplate(); if (!cInfo) return false; @@ -1405,7 +1405,7 @@ void Pet::InitLevelupSpellsForLevel() { uint8 level = getLevel(); - if (PetLevelupSpellSet const* levelupSpells = GetCreatureInfo()->family ? sSpellMgr->GetPetLevelupSpellList(GetCreatureInfo()->family) : NULL) + if (PetLevelupSpellSet const* levelupSpells = GetCreatureTemplate()->family ? sSpellMgr->GetPetLevelupSpellList(GetCreatureTemplate()->family) : NULL) { // PetLevelupSpellSet ordered by levels, process in reversed order for (PetLevelupSpellSet::const_reverse_iterator itr = levelupSpells->rbegin(); itr != levelupSpells->rend(); ++itr) @@ -1419,7 +1419,7 @@ void Pet::InitLevelupSpellsForLevel() } } - int32 petSpellsId = GetCreatureInfo()->PetSpellDataId ? -(int32)GetCreatureInfo()->PetSpellDataId : GetEntry(); + int32 petSpellsId = GetCreatureTemplate()->PetSpellDataId ? -(int32)GetCreatureTemplate()->PetSpellDataId : GetEntry(); // default spells (can be not learned if pet level (as owner level decrease result for example) less first possible in normal game) if (PetDefaultSpellsEntry const* defSpells = sSpellMgr->GetPetDefaultSpellsEntry(petSpellsId)) @@ -1543,7 +1543,7 @@ bool Pet::resetTalents() if (owner->ToPlayer()->HasAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS)) owner->ToPlayer()->RemoveAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS, true); - CreatureTemplate const* ci = GetCreatureInfo(); + CreatureTemplate const* ci = GetCreatureTemplate(); if (!ci) return false; // Check pet talent type @@ -1771,9 +1771,9 @@ bool Pet::IsPermanentPetFor(Player* owner) switch (owner->getClass()) { case CLASS_WARLOCK: - return GetCreatureInfo()->type == CREATURE_TYPE_DEMON; + return GetCreatureTemplate()->type == CREATURE_TYPE_DEMON; case CLASS_DEATH_KNIGHT: - return GetCreatureInfo()->type == CREATURE_TYPE_UNDEAD; + return GetCreatureTemplate()->type == CREATURE_TYPE_UNDEAD; default: return false; } @@ -1812,7 +1812,7 @@ bool Pet::HasSpell(uint32 spell) const // Get all passive spells in our skill line void Pet::LearnPetPassives() { - CreatureTemplate const* cInfo = GetCreatureInfo(); + CreatureTemplate const* cInfo = GetCreatureTemplate(); if (!cInfo) return; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f5b7d487219..857ae4d845b 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -143,10 +143,8 @@ static uint32 copseReclaimDelay[MAX_DEATH_COUNT] = { 30, 60, 120 }; // == PlayerTaxi ================================================ PlayerTaxi::PlayerTaxi() -{ - // Taxi nodes - memset(m_taximask, 0, sizeof(m_taximask)); -} + : m_taximask() +{ } void PlayerTaxi::InitTaxiNodesForLevel(uint32 race, uint32 chrClass, uint8 level) { @@ -540,7 +538,7 @@ inline void KillRewarder::_RewardKillCredit(Player* player) // 4.4. Give kill credit (player must not be in group, or he must be alive or without corpse). if (!_group || player->isAlive() || !player->GetCorpse()) if (_victim->GetTypeId() == TYPEID_UNIT) - player->KilledMonster(_victim->ToCreature()->GetCreatureInfo(), _victim->GetGUID()); + player->KilledMonster(_victim->ToCreature()->GetCreatureTemplate(), _victim->GetGUID()); } void KillRewarder::_RewardPlayer(Player* player, bool isDungeon) @@ -1123,10 +1121,10 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) if (oEntry->ItemId[j] <= 0) continue; - uint32 item_id = oEntry->ItemId[j]; + uint32 itemId = oEntry->ItemId[j]; // just skip, reported in ObjectMgr::LoadItemTemplates - ItemTemplate const* iProto = sObjectMgr->GetItemTemplate(item_id); + ItemTemplate const* iProto = sObjectMgr->GetItemTemplate(itemId); if (!iProto) continue; @@ -1148,7 +1146,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) if (iProto->GetMaxStackSize() < count) count = iProto->GetMaxStackSize(); } - StoreNewItemInBestSlots(item_id, count); + StoreNewItemInBestSlots(itemId, count); } } @@ -1589,14 +1587,14 @@ void Player::Update(uint32 p_time) if (HasUnitState(UNIT_STATE_MELEE_ATTACKING) && !HasUnitState(UNIT_STATE_CASTING)) { - if (Unit* pVictim = getVictim()) + if (Unit* victim = getVictim()) { // default combat reach 10 // TODO add weapon, skill check if (isAttackReady(BASE_ATTACK)) { - if (!IsWithinMeleeRange(pVictim)) + if (!IsWithinMeleeRange(victim)) { setAttackTimer(BASE_ATTACK, 100); if (m_swingErrorMsg != 1) // send single time (client auto repeat) @@ -1606,7 +1604,7 @@ void Player::Update(uint32 p_time) } } //120 degrees of radiant range - else if (!HasInArc(2*M_PI/3, pVictim)) + else if (!HasInArc(2*M_PI/3, victim)) { setAttackTimer(BASE_ATTACK, 100); if (m_swingErrorMsg != 2) // send single time (client auto repeat) @@ -1625,16 +1623,16 @@ void Player::Update(uint32 p_time) setAttackTimer(OFF_ATTACK, ATTACK_DISPLAY_DELAY); // do attack - AttackerStateUpdate(pVictim, BASE_ATTACK); + AttackerStateUpdate(victim, BASE_ATTACK); resetAttackTimer(BASE_ATTACK); } } if (haveOffhandWeapon() && isAttackReady(OFF_ATTACK)) { - if (!IsWithinMeleeRange(pVictim)) + if (!IsWithinMeleeRange(victim)) setAttackTimer(OFF_ATTACK, 100); - else if (!HasInArc(2*M_PI/3, pVictim)) + else if (!HasInArc(2*M_PI/3, victim)) setAttackTimer(OFF_ATTACK, 100); else { @@ -1643,13 +1641,13 @@ void Player::Update(uint32 p_time) setAttackTimer(BASE_ATTACK, ATTACK_DISPLAY_DELAY); // do attack - AttackerStateUpdate(pVictim, OFF_ATTACK); + AttackerStateUpdate(victim, OFF_ATTACK); resetAttackTimer(OFF_ATTACK); } } - /*Unit* owner = pVictim->GetOwner(); - Unit* u = owner ? owner : pVictim; + /*Unit* owner = victim->GetOwner(); + Unit* u = owner ? owner : victim; if (u->IsPvP() && (!duel || duel->opponent != u)) { UpdatePvP(true); @@ -2687,11 +2685,11 @@ Creature* Player::GetNPCIfCanInteractWith(uint64 guid, uint32 npcflagmask) return NULL; // Deathstate checks - if (!isAlive() && !(creature->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_GHOST)) + if (!isAlive() && !(creature->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_GHOST)) return NULL; // alive or spirit healer - if (!creature->isAlive() && !(creature->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_DEAD_INTERACT)) + if (!creature->isAlive() && !(creature->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_DEAD_INTERACT)) return NULL; // appropriate npc type @@ -4458,7 +4456,7 @@ bool Player::resetTalents(bool no_cost) /* when prev line will dropped use next line if (Pet* pet = GetPet()) { - if (pet->getPetType() == HUNTER_PET && !pet->GetCreatureInfo()->isTameable(CanTameExoticPets())) + if (pet->getPetType() == HUNTER_PET && !pet->GetCreatureTemplate()->isTameable(CanTameExoticPets())) RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true); } */ @@ -6222,7 +6220,7 @@ void Player::UpdateWeaponSkill(WeaponAttackType attType) if (GetShapeshiftForm() == FORM_TREE) return; // use weapon but not skill up - if (victim && victim->GetTypeId() == TYPEID_UNIT && (victim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_SKILLGAIN)) + if (victim && victim->GetTypeId() == TYPEID_UNIT && (victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_SKILLGAIN)) return; uint32 weapon_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_WEAPON); @@ -6922,7 +6920,7 @@ void Player::RewardReputation(Unit* pVictim, float rate) if (pVictim->ToCreature()->IsReputationGainDisabled()) return; - ReputationOnKillEntry const* Rep = sObjectMgr->GetReputationOnKilEntry(pVictim->ToCreature()->GetCreatureInfo()->Entry); + ReputationOnKillEntry const* Rep = sObjectMgr->GetReputationOnKilEntry(pVictim->ToCreature()->GetCreatureTemplate()->Entry); if (!Rep) return; @@ -8845,7 +8843,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type) creature->lootForPickPocketed = true; loot->clear(); - if (uint32 lootid = creature->GetCreatureInfo()->pickpocketLootId) + if (uint32 lootid = creature->GetCreatureTemplate()->pickpocketLootId) loot->FillLoot(lootid, LootTemplates_Pickpocketing, this, true); // Generate extra money for pick pocket loot @@ -8892,7 +8890,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type) if (loot_type == LOOT_SKINNING) { loot->clear(); - loot->FillLoot(creature->GetCreatureInfo()->SkinLootId, LootTemplates_Skinning, this, true); + loot->FillLoot(creature->GetCreatureTemplate()->SkinLootId, LootTemplates_Skinning, this, true); permission = OWNER_PERMISSION; } // set group rights only for loot_type != LOOT_SKINNING @@ -12007,7 +12005,7 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update { pItem->SetSoulboundTradeable(allowedLooters); pItem->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, GetTotalPlayedTime()); - m_itemSoulboundTradeable.push_back(pItem); + AddTradeableItem(pItem); // save data std::ostringstream ss; @@ -12450,7 +12448,7 @@ void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool } if (pLastItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE)) - m_itemSoulboundTradeable.push_back(pLastItem); + AddTradeableItem(pLastItem); } void Player::DestroyItem(uint8 bag, uint8 slot, bool update) @@ -13449,6 +13447,11 @@ void Player::UpdateSoulboundTradeItems() } } +void Player::AddTradeableItem(Item* item) +{ + m_itemSoulboundTradeable.push_back(item); +} + //TODO: should never allow an item to be added to m_itemSoulboundTradeable twice void Player::RemoveTradeableItem(Item* item) { @@ -14133,7 +14136,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool canTalk = false; break; case GOSSIP_OPTION_UNLEARNPETTALENTS: - if (!GetPet() || GetPet()->getPetType() != HUNTER_PET || GetPet()->m_spells.size() <= 1 || creature->GetCreatureInfo()->trainer_type != TRAINER_TYPE_PETS || creature->GetCreatureInfo()->trainer_class != CLASS_HUNTER) + if (!GetPet() || GetPet()->getPetType() != HUNTER_PET || GetPet()->m_spells.size() <= 1 || creature->GetCreatureTemplate()->trainer_type != TRAINER_TYPE_PETS || creature->GetCreatureTemplate()->trainer_class != CLASS_HUNTER) canTalk = false; break; case GOSSIP_OPTION_TAXIVENDOR: @@ -14406,7 +14409,7 @@ uint32 Player::GetDefaultGossipMenuForSource(WorldObject* source) switch (source->GetTypeId()) { case TYPEID_UNIT: - return source->ToCreature()->GetCreatureInfo()->GossipMenuId; + return source->ToCreature()->GetCreatureTemplate()->GossipMenuId; case TYPEID_GAMEOBJECT: return source->ToGameObject()->GetGOInfo()->GetGossipMenuId(); default: @@ -17578,7 +17581,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F for (Tokens::iterator itr = GUIDlist.begin(); itr != GUIDlist.end(); ++itr) looters.insert(atol(*itr)); item->SetSoulboundTradeable(looters); - m_itemSoulboundTradeable.push_back(item); + AddTradeableItem(item); } else { @@ -19759,7 +19762,7 @@ void Player::PetSpellInitialize() WorldPacket data(SMSG_PET_SPELLS, 8+2+4+4+4*MAX_UNIT_ACTION_BAR_INDEX+1+1); data << uint64(pet->GetGUID()); - data << uint16(pet->GetCreatureInfo()->family); // creature family (required for pet talents) + data << uint16(pet->GetCreatureTemplate()->family); // creature family (required for pet talents) data << uint32(0); data << uint8(pet->GetReactState()) << uint8(charmInfo->GetCommandState()) << uint16(0); @@ -19853,7 +19856,7 @@ void Player::VehicleSpellInitialize() WorldPacket data(SMSG_PET_SPELLS, 8 + 2 + 4 + 4 + 4 * 10 + 1 + 1 + cooldownCount * (4 + 2 + 4 + 4)); data << uint64(veh->GetGUID()); - data << uint16(veh->GetCreatureInfo()->family); + data << uint16(veh->GetCreatureTemplate()->family); data << uint32(0); // The following three segments are read as one uint32 data << uint8(veh->GetReactState()); @@ -19939,7 +19942,7 @@ void Player::CharmSpellInitialize() uint8 addlist = 0; if (charm->GetTypeId() != TYPEID_PLAYER) { - //CreatureInfo const* cinfo = charm->ToCreature()->GetCreatureInfo(); + //CreatureInfo const* cinfo = charm->ToCreature()->GetCreatureTemplate(); //if (cinfo && cinfo->type == CREATURE_TYPE_DEMON && getClass() == CLASS_WARLOCK) { for (uint32 i = 0; i < MAX_SPELL_CHARM; ++i) @@ -22641,7 +22644,7 @@ bool Player::isHonorOrXPTarget(Unit* pVictim) { if (pVictim->ToCreature()->isTotem() || pVictim->ToCreature()->isPet() || - pVictim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) + pVictim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) return false; } return true; @@ -24001,7 +24004,7 @@ void Player::LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank) if (!talentTabInfo) return; - CreatureTemplate const* ci = pet->GetCreatureInfo(); + CreatureTemplate const* ci = pet->GetCreatureTemplate(); if (!ci) return; @@ -24262,7 +24265,7 @@ void Player::BuildPetTalentsInfoData(WorldPacket* data) data->put(pointsPos, unspentTalentPoints); // put real points - CreatureTemplate const* ci = pet->GetCreatureInfo(); + CreatureTemplate const* ci = pet->GetCreatureTemplate(); if (!ci) return; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 82bbd1b38d5..db055088808 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1337,6 +1337,7 @@ class Player : public Unit, public GridObject void UpdateEnchantTime(uint32 time); void UpdateSoulboundTradeItems(); + void AddTradeableItem(Item* item); void RemoveTradeableItem(Item* item); void UpdateItemDuration(uint32 time, bool realtimeonly = false); void AddEnchantmentDurations(Item* item); @@ -1982,7 +1983,7 @@ class Player : public Unit, public GridObject void UpdateDefense(); void UpdateWeaponSkill (WeaponAttackType attType); - void UpdateCombatSkills(Unit* pVictim, WeaponAttackType attType, bool defence); + void UpdateCombatSkills(Unit* victim, WeaponAttackType attType, bool defence); void SetSkill(uint16 id, uint16 step, uint16 currVal, uint16 maxVal); uint16 GetMaxSkillValue(uint32 skill) const; // max + perm. bonus + temp bonus @@ -2015,9 +2016,9 @@ class Player : public Unit, public GridObject bool IsAtGroupRewardDistance(WorldObject const* pRewardSource) const; bool IsAtRecruitAFriendDistance(WorldObject const* pOther) const; - void RewardPlayerAndGroupAtKill(Unit* pVictim, bool isBattleGround); + void RewardPlayerAndGroupAtKill(Unit* victim, bool isBattleGround); void RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewardSource); - bool isHonorOrXPTarget(Unit* pVictim); + bool isHonorOrXPTarget(Unit* victim); bool GetsRecruitAFriendBonus(bool forXP); uint8 GetGrantableLevels() { return m_grantableLevels; } @@ -2026,7 +2027,7 @@ class Player : public Unit, public GridObject ReputationMgr& GetReputationMgr() { return m_reputationMgr; } ReputationMgr const& GetReputationMgr() const { return m_reputationMgr; } ReputationRank GetReputationRank(uint32 faction_id) const; - void RewardReputation(Unit* pVictim, float rate); + void RewardReputation(Unit* victim, float rate); void RewardReputation(Quest const* quest); void UpdateSkillsForLevel(); @@ -2037,7 +2038,7 @@ class Player : public Unit, public GridObject /*** PVP SYSTEM ***/ /*********************************************************/ void UpdateHonorFields(); - bool RewardHonor(Unit* pVictim, uint32 groupsize, int32 honor = -1, bool pvptoken = false); + bool RewardHonor(Unit* victim, uint32 groupsize, int32 honor = -1, bool pvptoken = false); uint32 GetHonorPoints() const { return GetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY); } uint32 GetArenaPoints() const { return GetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY); } void ModifyHonorPoints(int32 value, SQLTransaction* trans = NULL); //! If trans is specified, honor save query will be added to trans @@ -2331,7 +2332,7 @@ class Player : public Unit, public GridObject void UpdateTriggerVisibility(); template - void UpdateVisibilityOf(T* target, UpdateData& data, std::set& visibleNow); + void UpdateVisibilityOf(T* target, UpdateData& data, std::set& visibleNow); uint8 m_forced_speed_changes[MAX_MOVE_TYPE]; @@ -2414,6 +2415,7 @@ class Player : public Unit, public GridObject void SetAuraUpdateMaskForRaid(uint8 slot) { m_auraRaidUpdateMask |= (uint64(1) << slot); } Player* GetNextRandomRaidMember(float radius); PartyResult CanUninviteFromGroup() const; + // Battleground Group System void SetBattlegroundRaid(Group* group, int8 subgroup = -1); void RemoveFromBattlegroundRaid(); diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index c0bd5cb95a6..283ab2c9cf6 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -1019,12 +1019,12 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType) float weapon_maxdamage = GetWeaponDamageRange(attType, MAXDAMAGE); /* difference in AP between current attack power and base value from DB */ - float att_pwr_change = GetTotalAttackPowerValue(attType) - GetCreatureInfo()->attackpower; + float att_pwr_change = GetTotalAttackPowerValue(attType) - GetCreatureTemplate()->attackpower; float base_value = GetModifierValue(unitMod, BASE_VALUE) + (att_pwr_change * GetAPMultiplier(attType, false) / 14.0f); float base_pct = GetModifierValue(unitMod, BASE_PCT); float total_value = GetModifierValue(unitMod, TOTAL_VALUE); float total_pct = GetModifierValue(unitMod, TOTAL_PCT); - float dmg_multiplier = GetCreatureInfo()->dmg_multiplier; + float dmg_multiplier = GetCreatureTemplate()->dmg_multiplier; if (!CanUseAttackType(attType)) { diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f006b4c07c0..3af6d388ba9 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2014,7 +2014,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT else parry_chance -= GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE) * 25; - if (victim->GetTypeId() == TYPEID_PLAYER || !(victim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_PARRY)) + if (victim->GetTypeId() == TYPEID_PLAYER || !(victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_PARRY)) { int32 tmp2 = int32(parry_chance); if (tmp2 > 0 // check if unit _can_ parry @@ -2026,7 +2026,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT } } - if (victim->GetTypeId() == TYPEID_PLAYER || !(victim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK)) + if (victim->GetTypeId() == TYPEID_PLAYER || !(victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK)) { tmp = block_chance; if (tmp > 0 // check if unit _can_ block @@ -2045,7 +2045,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT if (tmp > 0 && roll < (sum += tmp)) { sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum); - if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT)) + if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT)) sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT DISABLED)"); else return MELEE_HIT_CRIT; @@ -2075,7 +2075,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT if (getLevelForTarget(victim) >= victim->getLevelForTarget(this) + 4 && // can be from by creature (if can) or from controlled player that considered as creature !IsControlledByPlayer() && - !(GetTypeId() == TYPEID_UNIT && ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH)) + !(GetTypeId() == TYPEID_UNIT && ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH)) { // when their weapon skill is 15 or more above victim's defense skill tmp = victimDefenseSkill; @@ -2189,7 +2189,7 @@ bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttac { // Check creatures flags_extra for disable block if (victim->GetTypeId() == TYPEID_UNIT && - victim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK) + victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK) return false; float blockChance = victim->GetUnitBlockChance(); @@ -2327,7 +2327,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spell) // Check creatures flags_extra for disable parry if (victim->GetTypeId() == TYPEID_UNIT) { - uint32 flagEx = victim->ToCreature()->GetCreatureInfo()->flags_extra; + uint32 flagEx = victim->ToCreature()->GetCreatureTemplate()->flags_extra; if (flagEx & CREATURE_FLAG_EXTRA_NO_PARRY) canParry = false; // Check creatures flags_extra for disable block @@ -9178,7 +9178,7 @@ FactionTemplateEntry const* Unit::getFactionTemplateEntry() const if (Player const* player = ToPlayer()) sLog->outError("Player %s has invalid faction (faction template id) #%u", player->GetName(), getFaction()); else if (Creature const* creature = ToCreature()) - sLog->outError("Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureInfo()->Entry, getFaction()); + sLog->outError("Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry, getFaction()); else sLog->outError("Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName(), uint32(GetTypeId()), getFaction()); @@ -10235,7 +10235,7 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 // ..done // Pet damage? if (GetTypeId() == TYPEID_UNIT && !ToCreature()->isPet()) - DoneTotalMod *= ToCreature()->GetSpellDamageMod(ToCreature()->GetCreatureInfo()->rank); + DoneTotalMod *= ToCreature()->GetSpellDamageMod(ToCreature()->GetCreatureTemplate()->rank); AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i) @@ -12032,7 +12032,7 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy) UpdateSpeed(MOVE_FLIGHT, true); } - if (!(creature->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_MOUNTED_COMBAT)) + if (!(creature->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_MOUNTED_COMBAT)) Dismount(); } @@ -12051,12 +12051,12 @@ void Unit::ClearInCombat() // Player's state will be cleared in Player::UpdateContestedPvP if (Creature* creature = ToCreature()) { - if (creature->GetCreatureInfo() && creature->GetCreatureInfo()->unit_flags & UNIT_FLAG_IMMUNE_TO_PC) + if (creature->GetCreatureTemplate() && creature->GetCreatureTemplate()->unit_flags & UNIT_FLAG_IMMUNE_TO_PC) SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); // set immunity state to the one from db on evade ClearUnitState(UNIT_STATE_ATTACK_PLAYER); if (HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED)) - SetUInt32Value(UNIT_DYNAMIC_FLAGS, creature->GetCreatureInfo()->dynamicflags); + SetUInt32Value(UNIT_DYNAMIC_FLAGS, creature->GetCreatureTemplate()->dynamicflags); if (creature->isPet()) { @@ -12171,7 +12171,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) co } Creature const* creatureAttacker = ToCreature(); - if (creatureAttacker && creatureAttacker->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_UNK26) + if (creatureAttacker && creatureAttacker->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_UNK26) return false; Player const* playerAffectingAttacker = HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) ? GetAffectingPlayer() : NULL; @@ -12258,7 +12258,7 @@ bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) co // can't assist non-friendly targets if (GetReactionTo(target) <= REP_NEUTRAL && target->GetReactionTo(this) <= REP_NEUTRAL - && (!ToCreature() || !(ToCreature()->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_UNK26))) + && (!ToCreature() || !(ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_UNK26))) return false; // PvP case @@ -12292,7 +12292,7 @@ bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) co && !((target->GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_PVP))) { if (Creature const* creatureTarget = target->ToCreature()) - return creatureTarget->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_UNK26 || creatureTarget->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS; + return creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_UNK26 || creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS; } return true; } @@ -12514,7 +12514,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced) { // Set creature speed rate from CreatureInfo if (GetTypeId() == TYPEID_UNIT) - speed *= ToCreature()->GetCreatureInfo()->speed_walk; + speed *= ToCreature()->GetCreatureTemplate()->speed_walk; // Normalize speed by 191 aura SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED if need // TODO: possible affect only on MOVE_RUN @@ -13200,7 +13200,7 @@ float Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, Unit const* source = casterOwner ? casterOwner : caster; if ((target->GetTypeId() == TYPEID_PLAYER - || ((Creature*)target)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH) + || ((Creature*)target)->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH) && source->GetTypeId() == TYPEID_PLAYER) duration = limitduration; } @@ -13209,7 +13209,7 @@ float Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, if (group == DIMINISHING_TAUNT) { - if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TAUNT_DIMINISH)) + if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_TAUNT_DIMINISH)) { DiminishingLevels diminish = Level; switch (diminish) @@ -13226,7 +13226,7 @@ float Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, // Some diminishings applies to mobs too (for example, Stun) else if ((GetDiminishingReturnsGroupType(group) == DRTYPE_PLAYER && ((targetOwner ? (targetOwner->GetTypeId() == TYPEID_PLAYER) : (GetTypeId() == TYPEID_PLAYER)) - || (GetTypeId() == TYPEID_UNIT && ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH))) + || (GetTypeId() == TYPEID_UNIT && ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH))) || GetDiminishingReturnsGroupType(group) == DRTYPE_ALL) { DiminishingLevels diminish = Level; @@ -13310,7 +13310,7 @@ uint32 Unit::GetCreatureType() const return CREATURE_TYPE_HUMANOID; } else - return ToCreature()->GetCreatureInfo()->type; + return ToCreature()->GetCreatureTemplate()->type; } /*####################################### @@ -15393,10 +15393,10 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) creature->lootForPickPocketed = false; loot->clear(); - if (uint32 lootid = creature->GetCreatureInfo()->lootid) + if (uint32 lootid = creature->GetCreatureTemplate()->lootid) loot->FillLoot(lootid, LootTemplates_Creature, looter, false, false, creature->GetLootMode()); - loot->generateMoneyLoot(creature->GetCreatureInfo()->mingold, creature->GetCreatureInfo()->maxgold); + loot->generateMoneyLoot(creature->GetCreatureTemplate()->mingold, creature->GetCreatureTemplate()->maxgold); } player->RewardPlayerAndGroupAtKill(victim, false); @@ -15497,7 +15497,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) if (!creature->isPet()) { creature->DeleteThreatList(); - CreatureTemplate const* cInfo = creature->GetCreatureInfo(); + CreatureTemplate const* cInfo = creature->GetCreatureTemplate(); if (cInfo && (cInfo->lootid || cInfo->maxgold > 0)) creature->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); } @@ -15526,7 +15526,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) { if (instanceMap->IsRaidOrHeroicDungeon()) { - if (creature->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND) + if (creature->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND) ((InstanceMap*)instanceMap)->PermBindAllPlayers(creditedPlayer); } else @@ -15935,7 +15935,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au case CHARM_TYPE_CHARM: if (GetTypeId() == TYPEID_UNIT && charmer->getClass() == CLASS_WARLOCK) { - CreatureTemplate const* cinfo = ToCreature()->GetCreatureInfo(); + CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate(); if (cinfo && cinfo->type == CREATURE_TYPE_DEMON) { // to prevent client crash @@ -16039,7 +16039,7 @@ void Unit::RemoveCharmedBy(Unit* charmer) case CHARM_TYPE_CHARM: if (GetTypeId() == TYPEID_UNIT && charmer->getClass() == CLASS_WARLOCK) { - CreatureTemplate const* cinfo = ToCreature()->GetCreatureInfo(); + CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate(); if (cinfo && cinfo->type == CREATURE_TYPE_DEMON) { SetByteValue(UNIT_FIELD_BYTES_0, 1, uint8(cinfo->unit_class)); @@ -16078,7 +16078,7 @@ void Unit::RestoreFaction() } } - if (CreatureTemplate const* cinfo = ToCreature()->GetCreatureInfo()) // normal creature + if (CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate()) // normal creature { FactionTemplateEntry const* faction = getFactionTemplateEntry(); setFaction((faction && faction->friendlyMask & 0x004) ? cinfo->faction_H : cinfo->faction_A); diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index 348ce132da8..6693af5c91f 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -146,7 +146,7 @@ void Vehicle::ApplyAllImmunities() _me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, true); // Mechanical units & vehicles ( which are not Bosses, they have own immunities in DB ) should be also immune on healing ( exceptions in switch below ) - if (_me->ToCreature() && _me->ToCreature()->GetCreatureInfo()->type == CREATURE_TYPE_MECHANICAL && !_me->ToCreature()->isWorldBoss()) + if (_me->ToCreature() && _me->ToCreature()->GetCreatureTemplate()->type == CREATURE_TYPE_MECHANICAL && !_me->ToCreature()->isWorldBoss()) { // Heal & dispel ... _me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_HEAL, true); diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 6f5dc0e511e..808da1ac791 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -1174,7 +1174,7 @@ void GameEventMgr::UpdateEventNPCFlags(uint16 event_id) if (cr) { uint32 npcflag = GetNPCFlag(cr); - if (const CreatureTemplate* ci = cr->GetCreatureInfo()) + if (const CreatureTemplate* ci = cr->GetCreatureTemplate()) npcflag |= ci->npcflag; cr->SetUInt32Value(UNIT_NPC_FLAGS, npcflag); // reset gossip options, since the flag change might have added / removed some diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index b24b5be014a..9879ef7ff3b 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -41,6 +41,7 @@ totalPlayersRolling(0), totalNeed(0), totalGreed(0), totalPass(0), itemSlot(0), rollVoteMask(ROLL_ALL_TYPE_NO_DISENCHANT) { } + Roll::~Roll() { } @@ -1727,7 +1728,7 @@ bool Group::InCombatToInstance(uint32 instanceId) Player* player = itr->getSource(); if (player && !player->getAttackers().empty() && player->GetInstanceId() == instanceId && (player->GetMap()->IsRaidOrHeroicDungeon())) for (std::set::const_iterator i = player->getAttackers().begin(); i != player->getAttackers().end(); ++i) - if ((*i) && (*i)->GetTypeId() == TYPEID_UNIT && (*i)->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND) + if ((*i) && (*i)->GetTypeId() == TYPEID_UNIT && (*i)->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND) return true; } return false; diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 802597e14eb..2434ba6eaa7 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1262,7 +1262,6 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) } } } - } } diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 6508f08dc22..496eae34133 100755 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -386,8 +386,8 @@ void WorldSession::DoLootRelease(uint64 lguid) { Creature* creature = GetPlayer()->GetMap()->GetCreature(lguid); - bool ok_loot = creature && creature->isAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed); - if (!ok_loot || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE)) + bool lootAllowed = creature && creature->isAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed); + if (!lootAllowed || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE)) return; loot = &creature->loot; @@ -448,7 +448,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data) if (_player->GetLootGUID() != lootguid) return; - Loot* pLoot = NULL; + Loot* loot = NULL; if (IS_CRE_OR_VEH_GUID(GetPlayer()->GetLootGUID())) { @@ -456,7 +456,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data) if (!creature) return; - pLoot = &creature->loot; + loot = &creature->loot; } else if (IS_GAMEOBJECT_GUID(GetPlayer()->GetLootGUID())) { @@ -464,19 +464,19 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data) if (!pGO) return; - pLoot = &pGO->loot; + loot = &pGO->loot; } - if (!pLoot) + if (!loot) return; - if (slotid > pLoot->items.size()) + if (slotid > loot->items.size()) { - sLog->outDebug(LOG_FILTER_LOOT, "MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)", GetPlayer()->GetName(), slotid, (unsigned long)pLoot->items.size()); + sLog->outDebug(LOG_FILTER_LOOT, "MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)", GetPlayer()->GetName(), slotid, (unsigned long)loot->items.size()); return; } - LootItem& item = pLoot->items[slotid]; + LootItem& item = loot->items[slotid]; ItemPosCountVec dest; InventoryResult msg = target->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, item.itemid, item.count); @@ -495,14 +495,13 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data) Item* newitem = target->StoreNewItem(dest, item.itemid, true, item.randomPropertyId, looters); target->SendNewItem(newitem, uint32(item.count), false, false, true); target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, item.itemid, item.count); - target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, pLoot->loot_type, item.count); + target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, loot->loot_type, item.count); target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, item.itemid, item.count); // mark as looted item.count=0; item.is_looted=true; - pLoot->NotifyItemRemoved(slotid); - --pLoot->unlootedCount; + loot->NotifyItemRemoved(slotid); + --loot->unlootedCount; } - diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index f220be7d2b5..aaa41ec3519 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -125,11 +125,11 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - if ((unit && unit->GetCreatureInfo()->ScriptID != unit->LastUsedScriptID) || (go && go->GetGOInfo()->ScriptId != go->LastUsedScriptID)) + if ((unit && unit->GetCreatureTemplate()->ScriptID != unit->LastUsedScriptID) || (go && go->GetGOInfo()->ScriptId != go->LastUsedScriptID)) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - Script reloaded while in use, ignoring and set new scipt id"); if (unit) - unit->LastUsedScriptID = unit->GetCreatureInfo()->ScriptID; + unit->LastUsedScriptID = unit->GetCreatureTemplate()->ScriptID; if (go) go->LastUsedScriptID = go->GetGOInfo()->ScriptId; _player->PlayerTalkClass->SendCloseGossip(); @@ -811,7 +811,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) Player* player = GetPlayer(); if (player->isInFlight()) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) in flight, ignore Area Trigger ID:%u", + sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) in flight, ignore Area Trigger ID:%u", player->GetName(), player->GetGUIDLow(), triggerId); return; } @@ -819,14 +819,14 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(triggerId); if (!atEntry) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) send unknown (by DBC) Area Trigger ID:%u", + sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) send unknown (by DBC) Area Trigger ID:%u", player->GetName(), player->GetGUIDLow(), triggerId); return; } if (player->GetMapId() != atEntry->mapid) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u", + sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u", player->GetName(), atEntry->mapid, player->GetMapId(), player->GetGUIDLow(), triggerId); return; } @@ -840,7 +840,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) float dist = player->GetDistance(atEntry->x, atEntry->y, atEntry->z); if (dist > atEntry->radius + delta) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) too far (radius: %f distance: %f), ignore Area Trigger ID: %u", + sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) too far (radius: %f distance: %f), ignore Area Trigger ID: %u", player->GetName(), player->GetGUIDLow(), atEntry->radius, dist, triggerId); return; } @@ -871,7 +871,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) (fabs(dy) > atEntry->box_y / 2 + delta) || (fabs(dz) > atEntry->box_z / 2 + delta)) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) too far (1/2 box X: %f 1/2 box Y: %f 1/2 box Z: %f rotatedPlayerX: %f rotatedPlayerY: %f dZ:%f), ignore Area Trigger ID: %u", + sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) too far (1/2 box X: %f 1/2 box Y: %f 1/2 box Z: %f rotatedPlayerX: %f rotatedPlayerY: %f dZ:%f), ignore Area Trigger ID: %u", player->GetName(), player->GetGUIDLow(), atEntry->box_x/2, atEntry->box_y/2, atEntry->box_z/2, rotPlayerX, rotPlayerY, dz, triggerId); return; } @@ -1325,7 +1325,7 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data) WorldPacket data(SMSG_WHOIS, msg.size()+1); data << msg; - _player->GetSession()->SendPacket(&data); + SendPacket(&data); sLog->outDebug(LOG_FILTER_NETWORKIO, "Received whois command from player %s for character %s", GetPlayer()->GetName(), charname.c_str()); } @@ -1501,16 +1501,16 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data) { for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { - Player* pGroupGuy = itr->getSource(); - if (!pGroupGuy) + Player* groupGuy = itr->getSource(); + if (!groupGuy) continue; - if (!pGroupGuy->IsInMap(pGroupGuy)) + if (!groupGuy->IsInMap(groupGuy)) return; - if (pGroupGuy->GetMap()->IsNonRaidDungeon()) + if (groupGuy->GetMap()->IsNonRaidDungeon()) { - sLog->outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while group member (Name: %s, GUID: %u) is inside!", _player->GetGUIDLow(), pGroupGuy->GetName(), pGroupGuy->GetGUIDLow()); + sLog->outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while group member (Name: %s, GUID: %u) is inside!", _player->GetGUIDLow(), groupGuy->GetName(), groupGuy->GetGUIDLow()); return; } } @@ -1558,14 +1558,14 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data) { for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { - Player* pGroupGuy = itr->getSource(); - if (!pGroupGuy) + Player* groupGuy = itr->getSource(); + if (!groupGuy) continue; - if (!pGroupGuy->IsInMap(pGroupGuy)) + if (!groupGuy->IsInMap(groupGuy)) return; - if (pGroupGuy->GetMap()->IsRaid()) + if (groupGuy->GetMap()->IsRaid()) { sLog->outError("WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow()); return; diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index 6a44c7ae5e2..5479791d341 100755 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -135,7 +135,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) if (!unit->isCanTrainingOf(_player, true)) return; - CreatureTemplate const* ci = unit->GetCreatureInfo(); + CreatureTemplate const* ci = unit->GetCreatureTemplate(); if (!ci) { @@ -337,7 +337,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) if (!sScriptMgr->OnGossipHello(_player, unit)) { // _player->TalkedToCreature(unit->GetEntry(), unit->GetGUID()); - _player->PrepareGossipMenu(unit, unit->GetCreatureInfo()->GossipMenuId, true); + _player->PrepareGossipMenu(unit, unit->GetCreatureTemplate()->GossipMenuId, true); _player->SendPreparedGossip(unit); } unit->AI()->sGossipHello(_player); diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index 05d945d3a93..6725992b48a 100755 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -103,7 +103,7 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data) if (sScriptMgr->OnGossipHello(_player, creature)) return; - _player->PrepareGossipMenu(creature, creature->GetCreatureInfo()->GossipMenuId, true); + _player->PrepareGossipMenu(creature, creature->GetCreatureTemplate()->GossipMenuId, true); _player->SendPreparedGossip(creature); creature->AI()->sGossipHello(_player); diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 64e9b9a27e4..3522571775c 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -147,7 +147,6 @@ uint32 LootStore::LoadLootTable() // Adds current row to the template tab->second->AddEntry(storeitem); ++count; - } while (result->NextRow()); @@ -205,12 +204,12 @@ LootTemplate* LootStore::GetLootForConditionFill(uint32 loot_id) return tab->second; } -uint32 LootStore::LoadAndCollectLootIds(LootIdSet& ids_set) +uint32 LootStore::LoadAndCollectLootIds(LootIdSet& lootIdSet) { uint32 count = LoadLootTable(); for (LootTemplateMap::const_iterator tab = m_LootTemplates.begin(); tab != m_LootTemplates.end(); ++tab) - ids_set.insert(tab->first); + lootIdSet.insert(tab->first); return count; } @@ -221,16 +220,16 @@ void LootStore::CheckLootRefs(LootIdSet* ref_set) const ltItr->second->CheckLootRefs(m_LootTemplates, ref_set); } -void LootStore::ReportUnusedIds(LootIdSet const& ids_set) const +void LootStore::ReportUnusedIds(LootIdSet const& lootIdSet) const { // all still listed ids isn't referenced - for (LootIdSet::const_iterator itr = ids_set.begin(); itr != ids_set.end(); ++itr) + for (LootIdSet::const_iterator itr = lootIdSet.begin(); itr != lootIdSet.end(); ++itr) sLog->outErrorDb("Table '%s' entry %d isn't %s and not referenced from loot, and then useless.", GetName(), *itr, GetEntryName()); } void LootStore::ReportNotExistedId(uint32 id) const { - sLog->outErrorDb("Table '%s' entry %d (%s) not exist but used as loot id in DB.", GetName(), id, GetEntryName()); + sLog->outErrorDb("Table '%s' entry %d (%s) does not exist but used as loot id in DB.", GetName(), id, GetEntryName()); } // @@ -296,7 +295,6 @@ bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const sLog->outErrorDb("Table '%s' entry %d item %d: max count (%u) less that min count (%i) - skipped", store.GetName(), entry, itemid, int32(maxcount), mincountOrRef); return false; } - } else // mincountOrRef < 0 { @@ -1420,8 +1418,8 @@ void LoadLootTemplates_Creature() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set, ids_setUsed; - uint32 count = LootTemplates_Creature.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet, lootIdSetUsed; + uint32 count = LootTemplates_Creature.LoadAndCollectLootIds(lootIdSet); // Remove real entries and check loot existence CreatureTemplateContainer const* ctc = sObjectMgr->GetCreatureTemplates(); @@ -1429,18 +1427,18 @@ void LoadLootTemplates_Creature() { if (uint32 lootid = itr->second.lootid) { - if (ids_set.find(lootid) == ids_set.end()) + if (lootIdSet.find(lootid) == lootIdSet.end()) LootTemplates_Creature.ReportNotExistedId(lootid); else - ids_setUsed.insert(lootid); + lootIdSetUsed.insert(lootid); } } - for (LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr) - ids_set.erase(*itr); + for (LootIdSet::const_iterator itr = lootIdSetUsed.begin(); itr != lootIdSetUsed.end(); ++itr) + lootIdSet.erase(*itr); // output error for any still listed (not referenced from appropriate table) ids - LootTemplates_Creature.ReportUnusedIds(ids_set); + LootTemplates_Creature.ReportUnusedIds(lootIdSet); if (count) sLog->outString(">> Loaded %u creature loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -1456,7 +1454,7 @@ void LoadLootTemplates_Disenchant() uint32 oldMSTime = getMSTime(); - LootIdSet lootIdSet, loodIdSetUsed; + LootIdSet lootIdSet, lootIdSetUsed; uint32 count = LootTemplates_Disenchant.LoadAndCollectLootIds(lootIdSet); ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore(); @@ -1467,11 +1465,11 @@ void LoadLootTemplates_Disenchant() if (lootIdSet.find(lootid) == lootIdSet.end()) LootTemplates_Disenchant.ReportNotExistedId(lootid); else - loodIdSetUsed.insert(lootid); + lootIdSetUsed.insert(lootid); } } - for (LootIdSet::const_iterator itr = loodIdSetUsed.begin(); itr != loodIdSetUsed.end(); ++itr) + for (LootIdSet::const_iterator itr = lootIdSetUsed.begin(); itr != lootIdSetUsed.end(); ++itr) lootIdSet.erase(*itr); // output error for any still listed (not referenced from appropriate table) ids @@ -1490,17 +1488,17 @@ void LoadLootTemplates_Fishing() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set; - uint32 count = LootTemplates_Fishing.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet; + uint32 count = LootTemplates_Fishing.LoadAndCollectLootIds(lootIdSet); // remove real entries and check existence loot for (uint32 i = 1; i < sAreaStore.GetNumRows(); ++i) if (AreaTableEntry const* areaEntry = sAreaStore.LookupEntry(i)) - if (ids_set.find(areaEntry->ID) != ids_set.end()) - ids_set.erase(areaEntry->ID); + if (lootIdSet.find(areaEntry->ID) != lootIdSet.end()) + lootIdSet.erase(areaEntry->ID); // output error for any still listed (not referenced from appropriate table) ids - LootTemplates_Fishing.ReportUnusedIds(ids_set); + LootTemplates_Fishing.ReportUnusedIds(lootIdSet); if (count) sLog->outString(">> Loaded %u fishing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -1516,8 +1514,8 @@ void LoadLootTemplates_Gameobject() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set, ids_setUsed; - uint32 count = LootTemplates_Gameobject.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet, lootIdSetUsed; + uint32 count = LootTemplates_Gameobject.LoadAndCollectLootIds(lootIdSet); // remove real entries and check existence loot GameObjectTemplateContainer const* gotc = sObjectMgr->GetGameObjectTemplates(); @@ -1525,18 +1523,18 @@ void LoadLootTemplates_Gameobject() { if (uint32 lootid = itr->second.GetLootId()) { - if (sObjectMgr->IsGoOfSpecificEntrySpawned(itr->second.entry) && ids_set.find(lootid) == ids_set.end()) + if (sObjectMgr->IsGoOfSpecificEntrySpawned(itr->second.entry) && lootIdSet.find(lootid) == lootIdSet.end()) LootTemplates_Gameobject.ReportNotExistedId(lootid); else - ids_setUsed.insert(lootid); + lootIdSetUsed.insert(lootid); } } - for (LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr) - ids_set.erase(*itr); + for (LootIdSet::const_iterator itr = lootIdSetUsed.begin(); itr != lootIdSetUsed.end(); ++itr) + lootIdSet.erase(*itr); // output error for any still listed (not referenced from appropriate table) ids - LootTemplates_Gameobject.ReportUnusedIds(ids_set); + LootTemplates_Gameobject.ReportUnusedIds(lootIdSet); if (count) sLog->outString(">> Loaded %u gameobject loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -1552,17 +1550,17 @@ void LoadLootTemplates_Item() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set; - uint32 count = LootTemplates_Item.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet; + uint32 count = LootTemplates_Item.LoadAndCollectLootIds(lootIdSet); // remove real entries and check existence loot ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore(); for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr) - if (ids_set.find(itr->second.ItemId) != ids_set.end() && itr->second.Flags & ITEM_PROTO_FLAG_OPENABLE) - ids_set.erase(itr->second.ItemId); + if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end() && itr->second.Flags & ITEM_PROTO_FLAG_OPENABLE) + lootIdSet.erase(itr->second.ItemId); // output error for any still listed (not referenced from appropriate table) ids - LootTemplates_Item.ReportUnusedIds(ids_set); + LootTemplates_Item.ReportUnusedIds(lootIdSet); if (count) sLog->outString(">> Loaded %u prospecting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -1578,8 +1576,8 @@ void LoadLootTemplates_Milling() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set; - uint32 count = LootTemplates_Milling.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet; + uint32 count = LootTemplates_Milling.LoadAndCollectLootIds(lootIdSet); // remove real entries and check existence loot ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore(); @@ -1588,12 +1586,12 @@ void LoadLootTemplates_Milling() if (!(itr->second.Flags & ITEM_PROTO_FLAG_MILLABLE)) continue; - if (ids_set.find(itr->second.ItemId) != ids_set.end()) - ids_set.erase(itr->second.ItemId); + if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end()) + lootIdSet.erase(itr->second.ItemId); } // output error for any still listed (not referenced from appropriate table) ids - LootTemplates_Milling.ReportUnusedIds(ids_set); + LootTemplates_Milling.ReportUnusedIds(lootIdSet); if (count) sLog->outString(">> Loaded %u milling loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -1609,8 +1607,8 @@ void LoadLootTemplates_Pickpocketing() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set, ids_setUsed; - uint32 count = LootTemplates_Pickpocketing.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet, lootIdSetUsed; + uint32 count = LootTemplates_Pickpocketing.LoadAndCollectLootIds(lootIdSet); // Remove real entries and check loot existence CreatureTemplateContainer const* ctc = sObjectMgr->GetCreatureTemplates(); @@ -1618,18 +1616,18 @@ void LoadLootTemplates_Pickpocketing() { if (uint32 lootid = itr->second.pickpocketLootId) { - if (ids_set.find(lootid) == ids_set.end()) + if (lootIdSet.find(lootid) == lootIdSet.end()) LootTemplates_Pickpocketing.ReportNotExistedId(lootid); else - ids_setUsed.insert(lootid); + lootIdSetUsed.insert(lootid); } } - for (LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr) - ids_set.erase(*itr); + for (LootIdSet::const_iterator itr = lootIdSetUsed.begin(); itr != lootIdSetUsed.end(); ++itr) + lootIdSet.erase(*itr); // output error for any still listed (not referenced from appropriate table) ids - LootTemplates_Pickpocketing.ReportUnusedIds(ids_set); + LootTemplates_Pickpocketing.ReportUnusedIds(lootIdSet); if (count) sLog->outString(">> Loaded %u pickpocketing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -1645,8 +1643,8 @@ void LoadLootTemplates_Prospecting() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set; - uint32 count = LootTemplates_Prospecting.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet; + uint32 count = LootTemplates_Prospecting.LoadAndCollectLootIds(lootIdSet); // remove real entries and check existence loot ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore(); @@ -1655,12 +1653,12 @@ void LoadLootTemplates_Prospecting() if (!(itr->second.Flags & ITEM_PROTO_FLAG_PROSPECTABLE)) continue; - if (ids_set.find(itr->second.ItemId) != ids_set.end()) - ids_set.erase(itr->second.ItemId); + if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end()) + lootIdSet.erase(itr->second.ItemId); } // output error for any still listed (not referenced from appropriate table) ids - LootTemplates_Prospecting.ReportUnusedIds(ids_set); + LootTemplates_Prospecting.ReportUnusedIds(lootIdSet); if (count) sLog->outString(">> Loaded %u prospecting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -1676,17 +1674,17 @@ void LoadLootTemplates_Mail() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set; - uint32 count = LootTemplates_Mail.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet; + uint32 count = LootTemplates_Mail.LoadAndCollectLootIds(lootIdSet); // remove real entries and check existence loot for (uint32 i = 1; i < sMailTemplateStore.GetNumRows(); ++i) if (sMailTemplateStore.LookupEntry(i)) - if (ids_set.find(i) != ids_set.end()) - ids_set.erase(i); + if (lootIdSet.find(i) != lootIdSet.end()) + lootIdSet.erase(i); // output error for any still listed (not referenced from appropriate table) ids - LootTemplates_Mail.ReportUnusedIds(ids_set); + LootTemplates_Mail.ReportUnusedIds(lootIdSet); if (count) sLog->outString(">> Loaded %u mail loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -1702,8 +1700,8 @@ void LoadLootTemplates_Skinning() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set, ids_setUsed; - uint32 count = LootTemplates_Skinning.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet, lootIdSetUsed; + uint32 count = LootTemplates_Skinning.LoadAndCollectLootIds(lootIdSet); // remove real entries and check existence loot CreatureTemplateContainer const* ctc = sObjectMgr->GetCreatureTemplates(); @@ -1711,18 +1709,18 @@ void LoadLootTemplates_Skinning() { if (uint32 lootid = itr->second.SkinLootId) { - if (ids_set.find(lootid) == ids_set.end()) + if (lootIdSet.find(lootid) == lootIdSet.end()) LootTemplates_Skinning.ReportNotExistedId(lootid); else - ids_setUsed.insert(lootid); + lootIdSetUsed.insert(lootid); } } - for (LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr) - ids_set.erase(*itr); + for (LootIdSet::const_iterator itr = lootIdSetUsed.begin(); itr != lootIdSetUsed.end(); ++itr) + lootIdSet.erase(*itr); // output error for any still listed (not referenced from appropriate table) ids - LootTemplates_Skinning.ReportUnusedIds(ids_set); + LootTemplates_Skinning.ReportUnusedIds(lootIdSet); if (count) sLog->outString(">> Loaded %u skinning loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -1738,8 +1736,8 @@ void LoadLootTemplates_Spell() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set; - uint32 count = LootTemplates_Spell.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet; + uint32 count = LootTemplates_Spell.LoadAndCollectLootIds(lootIdSet); // remove real entries and check existence loot for (uint32 spell_id = 1; spell_id < sSpellMgr->GetSpellInfoStoreSize(); ++spell_id) @@ -1752,7 +1750,7 @@ void LoadLootTemplates_Spell() if (!spellInfo->IsLootCrafting()) continue; - if (ids_set.find(spell_id) == ids_set.end()) + if (lootIdSet.find(spell_id) == lootIdSet.end()) { // not report about not trainable spells (optionally supported by DB) // ignore 61756 (Northrend Inscription Research (FAST QA VERSION) for example @@ -1762,11 +1760,11 @@ void LoadLootTemplates_Spell() } } else - ids_set.erase(spell_id); + lootIdSet.erase(spell_id); } // output error for any still listed (not referenced from appropriate table) ids - LootTemplates_Spell.ReportUnusedIds(ids_set); + LootTemplates_Spell.ReportUnusedIds(lootIdSet); if (count) sLog->outString(">> Loaded %u spell loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -1781,24 +1779,24 @@ void LoadLootTemplates_Reference() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set; - LootTemplates_Reference.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet; + LootTemplates_Reference.LoadAndCollectLootIds(lootIdSet); // check references and remove used - LootTemplates_Creature.CheckLootRefs(&ids_set); - LootTemplates_Fishing.CheckLootRefs(&ids_set); - LootTemplates_Gameobject.CheckLootRefs(&ids_set); - LootTemplates_Item.CheckLootRefs(&ids_set); - LootTemplates_Milling.CheckLootRefs(&ids_set); - LootTemplates_Pickpocketing.CheckLootRefs(&ids_set); - LootTemplates_Skinning.CheckLootRefs(&ids_set); - LootTemplates_Disenchant.CheckLootRefs(&ids_set); - LootTemplates_Prospecting.CheckLootRefs(&ids_set); - LootTemplates_Mail.CheckLootRefs(&ids_set); - LootTemplates_Reference.CheckLootRefs(&ids_set); + LootTemplates_Creature.CheckLootRefs(&lootIdSet); + LootTemplates_Fishing.CheckLootRefs(&lootIdSet); + LootTemplates_Gameobject.CheckLootRefs(&lootIdSet); + LootTemplates_Item.CheckLootRefs(&lootIdSet); + LootTemplates_Milling.CheckLootRefs(&lootIdSet); + LootTemplates_Pickpocketing.CheckLootRefs(&lootIdSet); + LootTemplates_Skinning.CheckLootRefs(&lootIdSet); + LootTemplates_Disenchant.CheckLootRefs(&lootIdSet); + LootTemplates_Prospecting.CheckLootRefs(&lootIdSet); + LootTemplates_Mail.CheckLootRefs(&lootIdSet); + LootTemplates_Reference.CheckLootRefs(&lootIdSet); // output error for any still listed ids (not referenced from any loot table) - LootTemplates_Reference.ReportUnusedIds(ids_set); + LootTemplates_Reference.ReportUnusedIds(lootIdSet); sLog->outString(">> Loaded refence loot templates in %u ms", GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h index 4faacc1f7b7..bf00514000e 100755 --- a/src/server/game/Miscellaneous/Formulas.h +++ b/src/server/game/Miscellaneous/Formulas.h @@ -162,8 +162,8 @@ namespace Trinity if (u->GetTypeId() == TYPEID_UNIT && (((Creature*)u)->isTotem() || ((Creature*)u)->isPet() || - (((Creature*)u)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) || - ((Creature*)u)->GetCreatureInfo()->type == CREATURE_TYPE_CRITTER)) + (((Creature*)u)->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) || + ((Creature*)u)->GetCreatureTemplate()->type == CREATURE_TYPE_CRITTER)) gain = 0; else { diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index cb79bd00776..8403bc3deb7 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5912,15 +5912,15 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster) // move loot to player inventory and despawn target if (caster && caster->GetTypeId() == TYPEID_PLAYER && target->GetTypeId() == TYPEID_UNIT && - target->ToCreature()->GetCreatureInfo()->type == CREATURE_TYPE_GAS_CLOUD) + target->ToCreature()->GetCreatureTemplate()->type == CREATURE_TYPE_GAS_CLOUD) { Player* player = caster->ToPlayer(); Creature* creature = target->ToCreature(); // missing lootid has been reported on startup - just return - if (!creature->GetCreatureInfo()->SkinLootId) + if (!creature->GetCreatureTemplate()->SkinLootId) return; - player->AutoStoreLoot(creature->GetCreatureInfo()->SkinLootId, LootTemplates_Skinning, true); + player->AutoStoreLoot(creature->GetCreatureTemplate()->SkinLootId, LootTemplates_Skinning, true); creature->DespawnOrUnsummon(); } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index e2cd360b844..4f4de7c72cd 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5098,7 +5098,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (creature->GetCreatureType() != CREATURE_TYPE_CRITTER && !creature->loot.isLooted()) return SPELL_FAILED_TARGET_NOT_LOOTED; - uint32 skill = creature->GetCreatureInfo()->GetRequiredLootSkill(); + uint32 skill = creature->GetCreatureTemplate()->GetRequiredLootSkill(); int32 skillValue = m_caster->ToPlayer()->GetSkillValue(skill); int32 TargetLevel = m_targets.GetUnitTarget()->getLevel(); @@ -5366,7 +5366,7 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_FAILED_HIGHLEVEL; // use SMSG_PET_TAME_FAILURE? - if (!target->GetCreatureInfo()->isTameable (m_caster->ToPlayer()->CanTameExoticPets())) + if (!target->GetCreatureTemplate()->isTameable (m_caster->ToPlayer()->CanTameExoticPets())) return SPELL_FAILED_BAD_TARGETS; if (m_caster->GetPetGUID()) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 2f04099f86b..511d2877f24 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2438,8 +2438,8 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) if (!summon || !summon->HasUnitTypeMask(UNIT_MASK_MINION)) return; - summon->SelectLevel(summon->GetCreatureInfo()); // some summoned creaters have different from 1 DB data for level/hp - summon->SetUInt32Value(UNIT_NPC_FLAGS, summon->GetCreatureInfo()->npcflag); + summon->SelectLevel(summon->GetCreatureTemplate()); // some summoned creaters have different from 1 DB data for level/hp + summon->SetUInt32Value(UNIT_NPC_FLAGS, summon->GetCreatureTemplate()->npcflag); summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); @@ -5521,7 +5521,7 @@ void Spell::EffectSkinning(SpellEffIndex /*effIndex*/) Creature* creature = unitTarget->ToCreature(); int32 targetLevel = creature->getLevel(); - uint32 skill = creature->GetCreatureInfo()->GetRequiredLootSkill(); + uint32 skill = creature->GetCreatureTemplate()->GetRequiredLootSkill(); m_caster->ToPlayer()->SendLoot(creature->GetGUID(), LOOT_SKINNING); creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index fcabaaa7e5b..ae573577d7e 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -248,7 +248,7 @@ public: return false; } - CreatureTemplate const* creatureInfo = pet->GetCreatureInfo(); + CreatureTemplate const* creatureInfo = pet->GetCreatureTemplate(); if (!creatureInfo) { handler->SendSysMessage(LANG_WRONG_PET_TYPE); diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 57932ef56c6..67ac6f8ff76 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -462,7 +462,7 @@ public: // Faction is set in creature_template - not inside creature // Update in memory.. - if (CreatureTemplate const* cinfo = creature->GetCreatureInfo()) + if (CreatureTemplate const* cinfo = creature->GetCreatureTemplate()) { const_cast(cinfo)->faction_A = factionId; const_cast(cinfo)->faction_H = factionId; @@ -547,7 +547,7 @@ public: uint32 displayid = target->GetDisplayId(); uint32 nativeid = target->GetNativeDisplayId(); uint32 Entry = target->GetEntry(); - CreatureTemplate const* cInfo = target->GetCreatureInfo(); + CreatureTemplate const* cInfo = target->GetCreatureTemplate(); int64 curRespawnDelay = target->GetRespawnTimeEx()-time(NULL); if (curRespawnDelay < 0) @@ -1148,7 +1148,7 @@ public: return false; } - CreatureTemplate const* cInfo = creatureTarget->GetCreatureInfo(); + CreatureTemplate const* cInfo = creatureTarget->GetCreatureTemplate(); if (!cInfo->isTameable (player->CanTameExoticPets())) { diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp index 0d8cabcf89c..22f3513b157 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp @@ -117,7 +117,7 @@ public: // Interrupt any spell casting me->InterruptNonMeleeSpells(false); // Gyth model - me->SetDisplayId(me->GetCreatureInfo()->Modelid1); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); me->SummonCreature(NPC_WARCHIEF_REND_BLACKHAND, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900 * IN_MILLISECONDS); events.ScheduleEvent(EVENT_CORROSIVE_ACID, 8 * IN_MILLISECONDS); events.ScheduleEvent(EVENT_FREEZE, 11 * IN_MILLISECONDS); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index 14add92fd16..35a9f854d58 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -297,7 +297,7 @@ public: SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); //damage - const CreatureTemplate* cinfo = me->GetCreatureInfo(); + const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg); me->UpdateDamagePhysical(BASE_ATTACK); @@ -420,7 +420,7 @@ public: SetEquipmentSlots(false, EQUIP_ID_AXE, EQUIP_ID_AXE, EQUIP_NO_CHANGE); //damage - const CreatureTemplate* cinfo = me->GetCreatureInfo(); + const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 2*cinfo->mindmg); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 2*cinfo->maxdmg); me->UpdateDamagePhysical(BASE_ATTACK); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 342c0d18dc9..a264c7afa98 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -108,7 +108,7 @@ public: if (!me->GetEquipmentId()) if (const CreatureTemplate* info = sObjectMgr->GetCreatureTemplate(28406)) if (info->equipmentId) - const_cast(me->GetCreatureInfo())->equipmentId = info->equipmentId; + const_cast(me->GetCreatureTemplate())->equipmentId = info->equipmentId; } uint64 playerGUID; @@ -878,7 +878,7 @@ public: npc_scarlet_miner_cartAI(Creature* c) : PassiveAI(c), minerGUID(0) { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - me->SetDisplayId(me->GetCreatureInfo()->Modelid1); // Modelid2 is a horse. + me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); // Modelid2 is a horse. } uint64 minerGUID; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp index 27ddc215543..737a8fade57 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp @@ -237,7 +237,7 @@ class boss_arlokk : public CreatureScript me->SetDisplayId(MODEL_ID_PANTHER); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - const CreatureTemplate* cinfo = me->GetCreatureInfo(); + const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); me->UpdateDamagePhysical(BASE_ATTACK); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp index 38d9be78f2a..d0f1aea21ba 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp @@ -156,7 +156,7 @@ class boss_marli : public CreatureScript { DoScriptText(SAY_TRANSFORM, me); DoCast(me, SPELL_SPIDER_FORM); - const CreatureTemplate* cinfo = me->GetCreatureInfo(); + const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); me->UpdateDamagePhysical(BASE_ATTACK); @@ -196,7 +196,7 @@ class boss_marli : public CreatureScript if (TransformBack_Timer <= diff) { me->SetDisplayId(15220); - const CreatureTemplate* cinfo = me->GetCreatureInfo(); + const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1))); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1))); me->UpdateDamagePhysical(BASE_ATTACK); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index 4185ba2f3e7..dc9521b028b 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -201,7 +201,7 @@ class boss_thekal : public CreatureScript me->SetStandState(UNIT_STAND_STATE_STAND); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFullHealth(); - const CreatureTemplate* cinfo = me->GetCreatureInfo(); + const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 40))); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 40))); me->UpdateDamagePhysical(BASE_ATTACK); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index a9e41d90899..7dcdaa28879 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -572,7 +572,7 @@ class mob_frost_sphere : public CreatureScript _isFalling = false; me->SetReactState(REACT_PASSIVE); me->SetFlying(true); - me->SetDisplayId(me->GetCreatureInfo()->Modelid2); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); me->SetSpeed(MOVE_RUN, 0.5f, false); me->GetMotionMaster()->MoveRandom(20.0f); DoCast(SPELL_FROST_SPHERE); @@ -604,7 +604,7 @@ class mob_frost_sphere : public CreatureScript { case POINT_FALL_GROUND: me->RemoveAurasDueToSpell(SPELL_FROST_SPHERE); - me->SetDisplayId(me->GetCreatureInfo()->Modelid1); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); DoCast(SPELL_PERMAFROST_VISUAL); DoCast(SPELL_PERMAFROST); me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.0f); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 7ca371d1c82..e0fa0e2b75a 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -1222,7 +1222,7 @@ class npc_tirion_fordring_tft : public CreatureScript void sGossipSelect(Player* /*player*/, uint32 sender, uint32 action) { - if (me->GetCreatureInfo()->GossipMenuId == sender && !action) + if (me->GetCreatureTemplate()->GossipMenuId == sender && !action) { _events.SetPhase(PHASE_INTRO); me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index aae1995e204..408ebf3cc96 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -577,7 +577,7 @@ class boss_flame_leviathan_seat : public CreatureScript { ASSERT(vehicle); me->SetReactState(REACT_PASSIVE); - me->SetDisplayId(me->GetCreatureInfo()->Modelid2); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); instance = creature->GetInstanceScript(); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index 33f50d0b3de..60c4ec68e82 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp @@ -179,7 +179,7 @@ class npc_flash_freeze : public CreatureScript npc_flash_freezeAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); - me->SetDisplayId(me->GetCreatureInfo()->Modelid2); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED); } @@ -246,7 +246,7 @@ class npc_ice_block : public CreatureScript npc_ice_blockAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); - me->SetDisplayId(me->GetCreatureInfo()->Modelid2); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED); targetGUID = 0; } @@ -512,7 +512,7 @@ class npc_icicle : public CreatureScript { npc_icicleAI(Creature* creature) : ScriptedAI(creature) { - me->SetDisplayId(me->GetCreatureInfo()->Modelid1); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_PASSIVE); } @@ -560,7 +560,7 @@ class npc_snowpacked_icicle : public CreatureScript { npc_snowpacked_icicleAI(Creature* creature) : ScriptedAI(creature) { - me->SetDisplayId(me->GetCreatureInfo()->Modelid2); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED); me->SetReactState(REACT_PASSIVE); } @@ -881,7 +881,7 @@ class npc_toasty_fire : public CreatureScript { npc_toasty_fireAI(Creature* creature) : ScriptedAI(creature) { - me->SetDisplayId(me->GetCreatureInfo()->Modelid2); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); } void Reset() diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index 7ad859e3e8d..d245c77b9df 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp @@ -177,7 +177,7 @@ class boss_razorscale_controller : public CreatureScript { boss_razorscale_controllerAI(Creature* creature) : BossAI(creature, DATA_RAZORSCALE_CONTROL) { - me->SetDisplayId(me->GetCreatureInfo()->Modelid2); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); } void Reset() diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index a8fcd6139da..e97cc5e205b 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -139,7 +139,7 @@ public: case 7: DoCast(me, SPELL_EXPLODE_CART, true); if (Player* caster = Unit::GetPlayer(*me, casterGuid)) - caster->KilledMonster(me->GetCreatureInfo(), me->GetGUID()); + caster->KilledMonster(me->GetCreatureTemplate(), me->GetGUID()); uiPhaseTimer = 5000; Phase = 8; break; diff --git a/src/server/scripts/Northrend/zuldrak.cpp b/src/server/scripts/Northrend/zuldrak.cpp index 1bf04bc624c..835ad144501 100644 --- a/src/server/scripts/Northrend/zuldrak.cpp +++ b/src/server/scripts/Northrend/zuldrak.cpp @@ -92,7 +92,7 @@ public: if (Creature* pRageclaw = Unit::GetCreature(*me, RageclawGUID)) { UnlockRageclaw(pCaster); - pCaster->ToPlayer()->KilledMonster(pRageclaw->GetCreatureInfo(), RageclawGUID); + pCaster->ToPlayer()->KilledMonster(pRageclaw->GetCreatureTemplate(), RageclawGUID); me->DisappearAndDie(); } else @@ -156,7 +156,7 @@ public: me->RemoveAurasDueToSpell(SPELL_KNEEL); - me->setFaction(me->GetCreatureInfo()->faction_H); + me->setFaction(me->GetCreatureTemplate()->faction_H); DoCast(me, SPELL_UNSHACKLED, true); me->MonsterSay(SAY_RAGECLAW, LANG_UNIVERSAL, 0); diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index b0a42614ee3..de9ef5cd67f 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -502,7 +502,7 @@ public: void SummonedCreatureDespawn(Creature* summon) { - if (summon->GetCreatureInfo()->Entry == FLAME_OF_AZZINOTH) + if (summon->GetCreatureTemplate()->Entry == FLAME_OF_AZZINOTH) { for (uint8 i = 0; i < 2; ++i) if (summon->GetGUID() == FlameGUID[i]) diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index f99851f013e..bd23b06a5ea 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -523,7 +523,7 @@ public: me->GetMotionMaster()->MoveTargetedHome(); Creature* Credit = me->FindNearestCreature(NPC_QUEST_CREDIT, 50, true); if (player && Credit) - player->KilledMonster(Credit->GetCreatureInfo(), Credit->GetGUID()); + player->KilledMonster(Credit->GetCreatureTemplate(), Credit->GetGUID()); } } diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index eb42b377128..ee554f4875a 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -341,7 +341,7 @@ class spell_dk_death_pact : public SpellScriptLoader { if ((*itr)->GetTypeId() == TYPEID_UNIT && (*itr)->GetOwnerGUID() == GetCaster()->GetGUID() - && (*itr)->ToCreature()->GetCreatureInfo()->type == CREATURE_TYPE_UNDEAD) + && (*itr)->ToCreature()->GetCreatureTemplate()->type == CREATURE_TYPE_UNDEAD) { unit_to_add = (*itr); break; diff --git a/src/server/scripts/World/mob_generic_creature.cpp b/src/server/scripts/World/mob_generic_creature.cpp index 3a61b9f9e18..ce8b0a2de14 100644 --- a/src/server/scripts/World/mob_generic_creature.cpp +++ b/src/server/scripts/World/mob_generic_creature.cpp @@ -105,7 +105,7 @@ public: else info = SelectSpell(me->getVictim(), 0, 0, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE); //50% chance if elite or higher, 20% chance if not, to replace our white hit with a spell - if (info && (rand() % (me->GetCreatureInfo()->rank > 1 ? 2 : 5) == 0) && !GlobalCooldown) + if (info && (rand() % (me->GetCreatureTemplate()->rank > 1 ? 2 : 5) == 0) && !GlobalCooldown) { //Cast the spell if (Healing)DoCastSpell(me, info); diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 8513eae5876..10bc722fc1b 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1650,7 +1650,7 @@ public: { SpellTimer = 0; - CreatureTemplate const* Info = me->GetCreatureInfo(); + CreatureTemplate const* Info = me->GetCreatureTemplate(); IsViper = Info->Entry == C_VIPER ? true : false; From b8310cb2fbaeea95dc123a22a0f9df36f034bf5d Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Mon, 27 Feb 2012 17:20:07 +0100 Subject: [PATCH 0059/1149] DB/Loot: add gold drops to ICC Partial fix for #5449 --- sql/updates/world/2012_02_27_world_creature_template.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 sql/updates/world/2012_02_27_world_creature_template.sql diff --git a/sql/updates/world/2012_02_27_world_creature_template.sql b/sql/updates/world/2012_02_27_world_creature_template.sql new file mode 100644 index 00000000000..b8936774e36 --- /dev/null +++ b/sql/updates/world/2012_02_27_world_creature_template.sql @@ -0,0 +1,8 @@ +-- Update gold drops in ICC bosses based on old.wowhead.com data +UPDATE `creature_template` SET `mingold`=250000,`maxgold`=300000 WHERE `entry` IN(36612,37957,37958,37959); -- Lord Marrowgar +UPDATE `creature_template` SET `mingold`=175000,`maxgold`=225000 WHERE `entry` IN (36626,37504,37505,37506); -- Festergut +UPDATE `creature_template` SET `mingold`=400000,`maxgold`=500000 WHERE `entry` IN (36627,38390,38549,38550); -- Rotface +UPDATE `creature_template` SET `mingold`=400000,`maxgold`=500000 WHERE `entry` IN (36678,38431,38585,38586); -- Professor Putricide +UPDATE `creature_template` SET `mingold`=300000,`maxgold`=350000 WHERE `entry` IN (37955,38434,38435,38436); -- Blood-Queen Lana'thel +UPDATE `creature_template` SET `mingold`=1330000,`maxgold`=1400000 WHERE `entry` IN (36853,38265,38266,38267); -- Sindragosa +UPDATE `creature_template` SET `mingold`=1300000,`maxgold`=1500000 WHERE `entry` IN (36597,39166,39167,39168); -- The Lich King From f402bad5326f2186a184de53d7a53abc7c299139 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Mon, 27 Feb 2012 20:19:43 +0100 Subject: [PATCH 0060/1149] Core/MovementGenerators: Ensure correct virtual function overrides are called. May/should/will/could/might fix various different movement related issues. Please report back. --- src/server/game/Movement/MovementGenerator.h | 6 +++--- .../MovementGenerators/FleeingMovementGenerator.cpp | 2 +- .../Movement/MovementGenerators/FleeingMovementGenerator.h | 2 +- .../Movement/MovementGenerators/IdleMovementGenerator.cpp | 4 ++-- .../Movement/MovementGenerators/IdleMovementGenerator.h | 6 +++--- .../Movement/MovementGenerators/PointMovementGenerator.cpp | 2 +- .../Movement/MovementGenerators/PointMovementGenerator.h | 2 +- .../MovementGenerators/WaypointMovementGenerator.cpp | 2 +- .../Movement/MovementGenerators/WaypointMovementGenerator.h | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/server/game/Movement/MovementGenerator.h b/src/server/game/Movement/MovementGenerator.h index dd9ba32f337..0a2ebcfaeee 100755 --- a/src/server/game/Movement/MovementGenerator.h +++ b/src/server/game/Movement/MovementGenerator.h @@ -38,7 +38,7 @@ class MovementGenerator virtual void Reset(Unit &) = 0; - virtual bool Update(Unit &, const uint32 time_diff) = 0; + virtual bool Update(Unit &, const uint32& time_diff) = 0; virtual MovementGeneratorType GetMovementGeneratorType() = 0; @@ -64,7 +64,7 @@ class MovementGeneratorMedium : public MovementGenerator //u->AssertIsType(); (static_cast(this))->Reset(*((T*)&u)); } - bool Update(Unit &u, const uint32 time_diff) + bool Update(Unit &u, const uint32& time_diff) { //u->AssertIsType(); return (static_cast(this))->Update(*((T*)&u), time_diff); @@ -74,7 +74,7 @@ class MovementGeneratorMedium : public MovementGenerator void Initialize(T &u); void Finalize(T &u); void Reset(T &u); - bool Update(T &u, const uint32 time_diff); + bool Update(T &u, const uint32& time_diff); }; struct SelectableMovement : public FactoryHolder diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp index 216afbb2b20..ecf314c8bbc 100755 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp @@ -399,7 +399,7 @@ void TimedFleeingMovementGenerator::Finalize(Unit &owner) } } -bool TimedFleeingMovementGenerator::Update(Unit & owner, const uint32 time_diff) +bool TimedFleeingMovementGenerator::Update(Unit & owner, const uint32& time_diff) { if (!owner.isAlive()) return false; diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h index 750db52bb5a..f795a002821 100755 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h @@ -64,7 +64,7 @@ class TimedFleeingMovementGenerator i_totalFleeTime(time) {} MovementGeneratorType GetMovementGeneratorType() { return TIMED_FLEEING_MOTION_TYPE; } - bool Update(Unit &, const uint32); + bool Update(Unit &, const uint32&); void Finalize(Unit &); private: diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp index 36561e00b93..9f4568df113 100755 --- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp @@ -49,7 +49,7 @@ void RotateMovementGenerator::Initialize(Unit& owner) owner.AttackStop(); } -bool RotateMovementGenerator::Update(Unit& owner, const uint32 diff) +bool RotateMovementGenerator::Update(Unit& owner, const uint32& diff) { float angle = owner.GetOrientation(); if (m_direction == ROTATE_DIRECTION_LEFT) @@ -93,7 +93,7 @@ DistractMovementGenerator::Finalize(Unit& owner) } bool -DistractMovementGenerator::Update(Unit& /*owner*/, const uint32 time_diff) +DistractMovementGenerator::Update(Unit& /*owner*/, const uint32& time_diff) { if (time_diff > m_timer) return false; diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h index 8180a86c49b..7acec82af98 100755 --- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h @@ -28,7 +28,7 @@ class IdleMovementGenerator : public MovementGenerator void Initialize(Unit &); void Finalize(Unit &) { } void Reset(Unit &); - bool Update(Unit &, const uint32) { return true; } + bool Update(Unit &, const uint32&) { return true; } MovementGeneratorType GetMovementGeneratorType() { return IDLE_MOTION_TYPE; } }; @@ -42,7 +42,7 @@ class RotateMovementGenerator : public MovementGenerator void Initialize(Unit& owner); void Finalize(Unit& owner); void Reset(Unit& owner) { Initialize(owner); } - bool Update(Unit& owner, const uint32 time_diff); + bool Update(Unit& owner, const uint32& time_diff); MovementGeneratorType GetMovementGeneratorType() { return ROTATE_MOTION_TYPE; } private: @@ -58,7 +58,7 @@ class DistractMovementGenerator : public MovementGenerator void Initialize(Unit& owner); void Finalize(Unit& owner); void Reset(Unit& owner) { Initialize(owner); } - bool Update(Unit& owner, const uint32 time_diff); + bool Update(Unit& owner, const uint32& time_diff); MovementGeneratorType GetMovementGeneratorType() { return DISTRACT_MOTION_TYPE; } private: diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index c565e150740..57e8f869b4f 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -107,7 +107,7 @@ void AssistanceMovementGenerator::Finalize(Unit &unit) unit.GetMotionMaster()->MoveSeekAssistanceDistract(sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY)); } -bool EffectMovementGenerator::Update(Unit &unit, const uint32) +bool EffectMovementGenerator::Update(Unit &unit, const uint32&) { return !unit.movespline->Finalized(); } diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h index e47f3d93450..82578da5f9b 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h @@ -65,7 +65,7 @@ class EffectMovementGenerator : public MovementGenerator void Initialize(Unit &) {} void Finalize(Unit &unit); void Reset(Unit &) {} - bool Update(Unit &u, const uint32); + bool Update(Unit &u, const uint32&); MovementGeneratorType GetMovementGeneratorType() { return EFFECT_MOTION_TYPE; } private: uint32 m_Id; diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index a8602153de3..8458232c336 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -240,7 +240,7 @@ void FlightPathMovementGenerator::Reset(Player & player) init.Launch(); } -bool FlightPathMovementGenerator::Update(Player &player, const uint32 /*diff*/) +bool FlightPathMovementGenerator::Update(Player &player, const uint32& /*diff*/) { uint32 pointId = (uint32)player.movespline->currentPathIdx(); if (pointId > i_currentNode) diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h index 9c2475267f6..b5b43fcae64 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h @@ -123,7 +123,7 @@ public PathMovementBase void Initialize(Player &); void Reset(Player &); void Finalize(Player &); - bool Update(Player &, const uint32); + bool Update(Player &, const uint32&); MovementGeneratorType GetMovementGeneratorType() { return FLIGHT_MOTION_TYPE; } TaxiPathNodeList const& GetPath() { return *i_path; } From dc55d9ed13f203941382c24c935b275b096e2ee1 Mon Sep 17 00:00:00 2001 From: QAston Date: Mon, 27 Feb 2012 21:07:59 +0100 Subject: [PATCH 0061/1149] Fix sql update in 8653016bddc6cfe591ce7d4b9b569fe36d50c77b - thanks to RedSonja --- sql/updates/world/2012_02_26_01_world_spell_script_names.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/updates/world/2012_02_26_01_world_spell_script_names.sql b/sql/updates/world/2012_02_26_01_world_spell_script_names.sql index d066218db8f..7bb38d5f2e0 100644 --- a/sql/updates/world/2012_02_26_01_world_spell_script_names.sql +++ b/sql/updates/world/2012_02_26_01_world_spell_script_names.sql @@ -1,4 +1,4 @@ DELETE FROM `spell_script_names` WHERE `spell_id` IN (48018, 48020); -INSERT INTO `spell_script_names` VALUES (`spell_id`,`ScriptName`) -(48018,'spell_warl_demonic_circle_summon'), +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(48018,'spell_warl_demonic_circle_summon'), (48020,'spell_warl_demonic_circle_teleport'); From c044eb571143960b74540f30e2e7effacd91a267 Mon Sep 17 00:00:00 2001 From: Elron103 Date: Mon, 27 Feb 2012 23:41:19 +0100 Subject: [PATCH 0062/1149] Core/Auction House: Delete item_instance entries correctly, prevent invalid entries --- src/server/game/Handlers/AuctionHouseHandler.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 223bb7dd5c7..f82c52204fb 100755 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -241,6 +241,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) else AH->auctioneer = GUID_LOPART(auctioneer); + // Required stack size of auction matches to current item stack size, just move item to auctionhouse if (itemsCount == 1 && item->GetCount() == count[i]) { if (GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) @@ -278,7 +279,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1); return; } - else + else // Required stack size of auction does not match to current item stack size, clone item and set correct stack size { Item* newItem = item->CloneItem(finalCount, _player); if (!newItem) @@ -313,16 +314,17 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) { Item* item2 = items[j]; + // Item stack count equals required count, ready to delete item - cloned item will be used for auction if (item2->GetCount() == count[j]) { _player->MoveItemFromInventory(item2->GetBagSlot(), item2->GetSlot(), true); SQLTransaction trans = CharacterDatabase.BeginTransaction(); item2->DeleteFromInventoryDB(trans); - item2->SaveToDB(trans); + item2->DeleteFromDB(trans); CharacterDatabase.CommitTransaction(trans); } - else + else // Item stack count is bigger than required count, update item stack count and save to database - cloned item will be used for auction { item2->SetCount(item2->GetCount() - count[j]); item2->SetState(ITEM_CHANGED, _player); From 2c23fdf9123d24816aab74e2c9828904884bf6e6 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 27 Feb 2012 17:49:43 -0500 Subject: [PATCH 0063/1149] Core/Channels: Players should not be able to invite non-visible GMs to channels closes #5467 --- src/server/game/Chat/Channels/Channel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index b6e9dd30d28..92cf4d750a8 100755 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -671,7 +671,7 @@ void Channel::Invite(uint64 p, const char *newname) } Player* newp = sObjectAccessor->FindPlayerByName(newname); - if (!newp) + if (!newp || !newp->isGMVisible()) { WorldPacket data; MakePlayerNotFound(&data, newname); From 3ea9fe4022f5614553b1e9ec9be4e731d7809419 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Tue, 28 Feb 2012 00:16:09 +0100 Subject: [PATCH 0064/1149] Core/Movement: Remove a redundant check in EffectMovementGenerator that could prevent MovementInform from being called --- .../game/Movement/MovementGenerators/PointMovementGenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index 57e8f869b4f..fddfe5f8fb0 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -117,7 +117,7 @@ void EffectMovementGenerator::Finalize(Unit &unit) if (unit.GetTypeId() != TYPEID_UNIT) return; - if (((Creature&)unit).AI() && unit.movespline->Finalized()) + if (((Creature&)unit).AI()) ((Creature&)unit).AI()->MovementInform(EFFECT_MOTION_TYPE, m_Id); // Need restore previous movement since we have no proper states system //if (unit.isAlive() && !unit.HasUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_FLEEING)) From 218ed813d0a2d26fd594ddafa2132cc7c5209bb4 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Tue, 28 Feb 2012 14:51:50 +0100 Subject: [PATCH 0065/1149] Core/Misc: Add more extensive ByteBuffer exceptions to trace down seemingly random crashes. --- src/server/shared/Packets/ByteBuffer.h | 68 +++++++++++++++++++------- 1 file changed, 51 insertions(+), 17 deletions(-) diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 6b99b79625d..abd0ed357e4 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -27,22 +27,49 @@ class ByteBufferException { public: - ByteBufferException(bool _add, size_t _pos, size_t _esize, size_t _size) - : add(_add), pos(_pos), esize(_esize), size(_size) + ByteBufferException(size_t pos, size_t size, size_t valueSize) + : Pos(pos), Size(size), ValueSize(valueSize) { - PrintPosError(); + PrintError(); } - void PrintPosError() const + protected: + virtual void PrintError() const = 0; + + size_t Pos; + size_t Size; + size_t ValueSize; +}; + +class ByteBufferPositionException : public ByteBufferException +{ + public: + ByteBufferPositionException(bool add, size_t pos, size_t size, size_t valueSize) + : ByteBufferException(pos, size, valueSize), _add(add) {} + + protected: + void PrintError() const override { - sLog->outError("Attempted to %s in ByteBuffer (pos: " SIZEFMTD " size: "SIZEFMTD") value with size: " SIZEFMTD, - (add ? "put" : "get"), pos, size, esize); + sLog->outError("Attempted to %s value with size: "SIZEFMTD" in ByteBuffer (pos: " SIZEFMTD " size: "SIZEFMTD") " , + ValueSize, (_add ? "put" : "get"), Pos, Size); } + private: - bool add; - size_t pos; - size_t esize; - size_t size; + bool _add; +}; + +class ByteBufferSourceException : public ByteBufferException +{ + public: + ByteBufferSourceException(size_t pos, size_t size, size_t valueSize) + : ByteBufferException(pos, size, valueSize) {} + + protected: + void PrintError() const override + { + sLog->outError("Attempted to put a %s in ByteBuffer (pos: "SIZEFMTD" size: "SIZEFMTD")", + (ValueSize > 0 ? "NULL-pointer" : "zero-sized value"), Pos, Size); + } }; class ByteBuffer @@ -271,7 +298,7 @@ class ByteBuffer void read_skip(size_t skip) { if (_rpos + skip > size()) - throw ByteBufferException(false, _rpos, skip, size()); + throw ByteBufferPositionException(false, _rpos, skip, size()); _rpos += skip; } @@ -285,7 +312,7 @@ class ByteBuffer template T read(size_t pos) const { if (pos + sizeof(T) > size()) - throw ByteBufferException(false, pos, sizeof(T), size()); + throw ByteBufferPositionException(false, pos, sizeof(T), size()); T val = *((T const*)&_storage[pos]); EndianConvert(val); return val; @@ -294,7 +321,7 @@ class ByteBuffer void read(uint8 *dest, size_t len) { if (_rpos + len > size()) - throw ByteBufferException(false, _rpos, len, size()); + throw ByteBufferPositionException(false, _rpos, len, size()); memcpy(dest, &_storage[_rpos], len); _rpos += len; } @@ -302,7 +329,7 @@ class ByteBuffer void readPackGUID(uint64& guid) { if (rpos() + 1 > size()) - throw ByteBufferException(false, _rpos, 1, size()); + throw ByteBufferPositionException(false, _rpos, 1, size()); guid = 0; @@ -314,7 +341,7 @@ class ByteBuffer if (guidmark & (uint8(1) << i)) { if (rpos() + 1 > size()) - throw ByteBufferException(false, _rpos, 1, size()); + throw ByteBufferPositionException(false, _rpos, 1, size()); uint8 bit; (*this) >> bit; @@ -359,7 +386,10 @@ class ByteBuffer void append(const uint8 *src, size_t cnt) { if (!cnt) - return; + throw ByteBufferSourceException(_wpos, size(), cnt); + + if (!src) + throw ByteBufferSourceException(_wpos, size(), cnt); ASSERT(size() < 10000000); @@ -407,7 +437,11 @@ class ByteBuffer void put(size_t pos, const uint8 *src, size_t cnt) { if (pos + cnt > size()) - throw ByteBufferException(true, pos, cnt, size()); + throw ByteBufferPositionException(true, pos, cnt, size()); + + if (!src) + throw ByteBufferSourceException(_wpos, size(), cnt); + memcpy(&_storage[pos], src, cnt); } From 02b0cc825e14f1f5c899ee1599a21b856ee802b8 Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 28 Feb 2012 15:00:32 -0500 Subject: [PATCH 0066/1149] DB/Wintergrasp: added spawn data for wintergrasp mobs --- ...2012_02_28_00_world_wintergrasp_spawns.sql | 366 ++++++++++++++++++ 1 file changed, 366 insertions(+) create mode 100644 sql/updates/world/2012_02_28_00_world_wintergrasp_spawns.sql diff --git a/sql/updates/world/2012_02_28_00_world_wintergrasp_spawns.sql b/sql/updates/world/2012_02_28_00_world_wintergrasp_spawns.sql new file mode 100644 index 00000000000..99c2444f20b --- /dev/null +++ b/sql/updates/world/2012_02_28_00_world_wintergrasp_spawns.sql @@ -0,0 +1,366 @@ +-- Delete unused creature_data rows +DELETE FROM `creature_addon` WHERE `guid` IN (131728,131282,131283,131284,131285,131286,131287,131288,131289,131290,131291,131292,131293,131294,131295,131296,131297,131298,131299,131300,131301,131302,131303,131304,131305,131306,131307,131308,131309,131310,131311,131312,131313,131314,131315,131316,131317,131318,131319,131320,131321,131322,131326,131327,131328,131350,131351,131352,131353,131354,131376,131377,131378,131379,131380,131392,131437,131458,131631,131632,131633,131634,131635,131636,131706,131727,13128,131729,131730,131731); + +-- Replace Wintergrasp spawns with properly phased spawns +SET @GUID := 88310; +DELETE FROM `creature` WHERE `id` IN (31841,31842,30400,30499,30489,30869,31036,31051,31052,31054,31108,31109,31153,39172,30870,31053,31091,31101,31102,31106,31107,31151,32294,39173,32296,30488); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +-- Taunka Spirit Guide (Horde) +(@GUID+0,31841,571,1,0x00000010,0,0,4318.436,2408.06738,392.675751,6.23082542,120,0,0,1,0,0), -- Eastspark Workshop +(@GUID+1,31841,571,1,0x00000010,0,0,4336.25439,3235.51978,390.334,0.628318548,120,0,0,1,0,0), -- Westspark Workshop +(@GUID+2,31841,571,1,0x00000010,0,0,5104.753,2300.9458,368.568054,0.7330383,120,0,0,1,0,0), -- The Sunken Ring +(@GUID+3,31841,571,1,0x00000010,0,0,5103.133,3462.128,368.568054,5.270895,120,0,0,1,0,0), -- The Chilled Quagmire "Outside broker Temple" +(@GUID+4,31841,571,1,0x00000040,0,0,5537.482,2898.90674,517.2589,4.86946869,120,0,0,1,0,0), -- Fortress +(@GUID+5,31841,571,1,0x00000001,0,0,5031.84131,3710.74878,372.4835,0,120,5,0,1,0,0), -- Horde Landing Zone +-- Dwarven Spirit Guide (Alliance) +(@GUID+6,31842,571,1,0x00000020,0,0,4318.436,2408.06738,392.675751,6.23082542,120,0,0,1,0,0), -- Eastspark Workshop +(@GUID+7,31842,571,1,0x00000020,0,0,4336.25439,3235.51978,390.334,0.628318548,120,0,0,1,0,0), -- Westspark Workshop +(@GUID+8,31842,571,1,0x00000020,0,0,5104.753,2300.9458,368.568054,0.7330383,120,0,0,1,0,0), -- The Sunken Ring +(@GUID+9,31842,571,1,0x00000020,0,0,5103.133,3462.128,368.568054,5.270895,120,0,0,1,0,0), -- The Chilled Quagmire "Outside The Broken Temple" +(@GUID+10,31842,571,1,0x00000080,0,0,5537.482,2898.90674,517.2589,4.86946869,120,0,0,1,0,0), -- Fortress +(@GUID+11,31842,571,1,0x00000001,0,0,5140.7876,2179.12451,390.9512,1.97222209,120,0,0,1,0,0), -- Aliance Landing Zone +-- Goblin Mechanic (Horde) +(@GUID+12,30400,571,1,0x00000010,0,0,4964.89,3383.06,382.911,6.12611,180,0,0,1,0,0), -- The Broken Temple +(@GUID+13,30400,571,1,0x00000010,0,0,4939.76,2389.06,326.153,3.26377,180,0,0,1,0,0), -- The Sunken Ring +(@GUID+14,30400,571,1,0x00000010,0,0,4357.67,2357.99,382.007,1.67552,180,0,0,1,0,0), -- Eastspark Workshop +(@GUID+15,30400,571,1,0x00000010,0,0,4354.15,3312.82,378.046,1.67552,180,0,0,1,0,0), -- Westspark Workshop +(@GUID+16,30400,571,1,0x00000040,0,0,5391.61,2707.72,415.051,4.55531,180,0,0,1,0,0), -- Wintergrasp Fortress +(@GUID+17,30400,571,1,0x00000040,0,0,5392.91,2975.26,415.223,4.55531,180,0,0,1,0,0), -- Wintergrasp Fortress +-- Gnomish Engineer (Alliance) +(@GUID+18,30499,571,1,0x00000020,0,0,4964.89,3383.06,382.911,6.12611,180,0,0,1,0,0), -- The Broken Temple +(@GUID+19,30499,571,1,0x00000020,0,0,4939.76,2389.06,326.153,3.26377,180,0,0,1,0,0), -- The Sunken Ring +(@GUID+20,30499,571,1,0x00000020,0,0,4357.67,2357.99,382.007,1.67552,180,0,0,1,0,0), -- Eastspark Workshop +(@GUID+21,30499,571,1,0x00000020,0,0,4354.15,3312.82,378.046,1.67552,180,0,0,1,0,0), -- Westspark Workshop +(@GUID+22,30499,571,1,0x00000080,0,0,5391.61,2707.72,415.051,4.55531,180,0,0,1,0,0), -- Wintergrasp Fortress +(@GUID+23,30499,571,1,0x00000080,0,0,5392.91,2975.26,415.223,4.55531,180,0,0,1,0,0), -- Wintergrasp Fortress +-- Alliance NPC's +(@GUID+24,30489,571,1,0x00000080,0,0,5369.973,2874.83081,409.3225,3.12413931,120,0,0,1,0,0), -- Morgan Day +(@GUID+25,30869,571,1,0x00000001,0,0,5102.75049,2187.82837,365.707855,3.996804,120,0,0,1,0,0), -- Arzo Safeflight +(@GUID+26,31036,571,1,0x00000040,0,0,5078.281,2183.704,365.028564,1.46607661,120,0,0,1,0,0), -- Commander Zanneth +(@GUID+27,31036,571,1,0x00000080,0,0,5358.641,2841.76416,409.3225,1.13262534,120,0,0,1,0,0), +(@GUID+28,31051,571,1,0x00000040,0,0,5081.697,2173.73,365.8777,0.8552113,120,0,0,1,0,0), -- Sorceress Kaylana +(@GUID+29,31051,571,1,0x00000080,0,0,5296.869,2887.67114,409.274658,5.60250664,120,0,0,1,0,0), +(@GUID+30,31052,571,1,0x00000040,0,0,5100.06543,2168.89,365.7788,1.97222209,120,0,0,1,0,0), -- Bowyer Randolph +(@GUID+31,31052,571,1,0x00000080,0,0,5302.57373,2750.40332,409.274658,5.46288061,120,0,0,1,0,0), +(@GUID+32,31054,571,1,0x00000040,0,0,5088.611,2167.66235,365.688751,0.6806784,120,0,0,1,0,0), -- Anchorite Tessa +(@GUID+33,31054,571,1,0x00000080,0,0,5372.05859,3028.33618,409.206024,0.012565271,120,0,0,1,0,0), +(@GUID+34,31108,571,1,0x00000040,0,0,5095.673,2193.284,365.9236,4.939282,120,0,0,1,0,0), -- Siege Master Stouthandle +(@GUID+35,31108,571,1,0x00000080,0,0,5298.267,2924.97632,409.274658,0.9075712,120,0,0,1,0,0), +(@GUID+36,31109,571,1,0x00000040,0,0,5080.403,2199.00244,359.4894,2.96705961,120,0,0,1,0,0), -- Senior Demolitionist Legoso +(@GUID+37,31109,571,1,0x00000080,0,0,5228.2915,2809.888,409.274658,3.19395256,120,0,0,1,0,0), +(@GUID+38,31153,571,1,0x00000040,0,0,5088.48633,2188.17871,365.646973,5.253441,120,0,0,1,0,0), -- Tactical Officer Ahbramis +(@GUID+39,31153,571,1,0x00000080,0,0,5364.784,2835.135,409.3225,3.12413931,120,0,0,1,0,0), +(@GUID+40,32294,571,1,0x00000080,0,0,5374.568,2790.784,409.3225,2.72271371,120,0,0,1,0,0), -- Knight Dameron +(@GUID+41,39172,571,1,0x00000080,0,0,5372.672,2786.74048,409.4423,2.80998015,120,0,0,1,0,0), -- Marshal Magruder +(@GUID+42,30488,571,1,0x00000080,0,0,5370.428,2814.274,409.3225,3.054326,120,0,0,1,0,0), -- Travis Day +-- Horde NPC's +(@GUID+43,30870,571,1,0x00000001,0,0,5023.4043,3686.03345,363.1192,5.131268,120,0,0,1,0,0), -- Herzo Safeflight +(@GUID+44,31053,571,1,0x00000040,0,0,5379.875,3027.43359,409.206024,0,120,0,0,1,0,0), -- Primalist Mulfort +(@GUID+45,31053,571,1,0x00000080,0,0,5034.703125,3666.703125,363.273865,4.310963,120,0,0,1,0,0), +(@GUID+46,31091,571,1,0x00000040,0,0,5347.7915,2837.38574,409.3466,2.62603331,120,0,0,1,0,0), -- Commander Dardosh +(@GUID+47,31091,571,1,0x00000080,0,0,5018.662109,3672.279541,362.862885,2.209141,120,0,0,1,0,0), +(@GUID+48,31101,571,1,0x00000040,0,0,5296.564,2789.87378,409.274658,0.7330383,120,0,0,1,0,0), -- Hoodoo Master Fu'jin +(@GUID+49,31101,571,1,0x00000080,0,0,5014.065430,3678.846436,362.995575,5.096361,120,0,0,1,0,0), +(@GUID+50,31102,571,1,0x00000040,0,0,5295.455,2732.87549,409.274658,4.7211113,120,0,0,1,0,0), -- Vieron Blazefeather +(@GUID+51,31102,571,1,0x00000080,0,0,5031.676270,3655.820801,362.234558,5.131268,120,0,0,1,0,0), +(@GUID+52,31106,571,1,0x00000040,0,0,5295.56348,2926.67188,409.274658,0.87266463,120,0,0,1,0,0), -- Siegesmith Stronghoof +(@GUID+53,31106,571,1,0x00000080,0,0,5037.602051,3675.459717,363.147888,3.176499,120,0,0,1,0,0), +(@GUID+54,31107,571,1,0x00000040,0,0,5230.09033,2876.635,409.316254,-2.19854617,120,0,0,1,0,0), -- Lieutenant Murp +(@GUID+55,31107,571,1,0x00000080,0,0,5004.455078,3661.089111,361.335785,3.979351,120,0,0,1,0,0), +(@GUID+56,31151,571,1,0x00000040,0,0,5363.2876,2834.52954,409.3606,2.76273036,120,0,0,1,0,0), -- Tactical Officer Kilrath +(@GUID+57,31151,571,1,0x00000080,0,0,5034.698242,3683.268799,363.129120,4.310963,120,0,0,1,0,0), +(@GUID+58,32296,571,1,0x00000040,0,0,5374.568,2790.784,409.3225,2.60054,120,0,0,1,0,0), -- Stone Guard Mukar +-- Missing noc in fortress +(@GUID+60,39173,571,1,0x00000040,0,0,5372.672,2786.74048,409.4423,2.80998015,120,0,0,1,0,0); -- Champion Ros'slai + +-- corrects previously inserted creature +UPDATE `creature` SET `spawndist`=0 WHERE `guid`=88315; + +-- Pathing for Anchorite Tessa Entry: 31054 +SET @NPC := @GUID+33; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,5382.507,3028.468,409.206,0,0,0,100,0), +(@PATH,2,5392.744,3028.737,409.206,0,0,0,100,0), +(@PATH,3,5382.507,3028.468,409.206,0,0,0,100,0), +(@PATH,4,5371.491,3028.329,409.206,0,0,0,100,0), +(@PATH,5,5360.032,3028.516,409.3161,0,0,0,100,0), +(@PATH,6,5371.491,3028.329,409.206,0,0,0,100,0); + +-- Pathing for Commander Zanneth Entry: 31036 +SET @NPC := @GUID+27; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=5358.854,`position_y`=2859.232,`position_z`=409.5425 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,14337, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,5359.788,2846.359,409.3642,0,0,0,100,0), +(@PATH,2,5359.187,2839.211,409.3642,0,0,0,100,0), +(@PATH,3,5360.083,2823.116,409.5381,0,0,0,100,0), +(@PATH,4,5359.187,2839.211,409.3642,0,0,0,100,0), +(@PATH,5,5359.788,2846.359,409.3642,0,0,0,100,0), +(@PATH,6,5358.854,2859.232,409.5425,0,0,0,100,0); + +-- Pathing for Commander Dardosh Entry: 31091 +SET @NPC := @GUID+46; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `MovementType`=2,`position_x`=5359.546,`position_y`=2858.049,`position_z`=409.3642 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,257,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,5359.202,2843.208,409.3642,0,0,0,100,0), +(@PATH,2,5358.997,2827.974,409.3639,0,0,0,100,0), +(@PATH,3,5359.202,2843.208,409.3642,0,0,0,100,0), +(@PATH,4,5359.546,2858.049,409.3642,0,0,0,100,0); + +-- Pathing for Commander Dardosh Entry: 31091 +SET @NPC := @GUID+47; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `MovementType`=2,`position_x`=5018.411133,`position_y`=3672.615967,`position_z`=362.863525 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,257,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,5022.827637,3666.665771,362.205750,0,0,0,100,0), +(@PATH,2,5024.270508,3658.739258,361.705750,0,0,0,100,0), +(@PATH,3,5022.827637,3666.665771,362.205750,0,0,0,100,0), +(@PATH,4,5018.411133,3672.615967,362.863525,0,0,0,100,0); + +-- Pathing for Primalist Mulfort Entry: 31053 +SET @NPC := @GUID+44; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,257,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,5390.624,3027.994,409.206,0,0,0,100,0), +(@PATH,2,5379.875,3027.434,409.206,0,0,0,100,0), +(@PATH,3,5371.404,3026.511,409.206,0,0,0,100,0), +(@PATH,4,5379.875,3027.434,409.206,0,0,0,100,0); + +-- Pathing for Vieron Blazefeather Entry: 31102 +SET @NPC := @GUID+50; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `MovementType`=2,`position_x`=5296.644,`position_y`=2731.107,`position_z`=409.3163 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,5295.544,2722.631,409.3163,0,0,0,100,0), +(@PATH,2,5296.644,2731.107,409.3163,0,0,0,100,0), +(@PATH,3,5297.874,2738.155,409.3163,0,0,0,100,0), +(@PATH,4,5305.192,2746.161,409.3061,0,0,0,100,0), +(@PATH,5,5297.874,2738.155,409.3163,0,0,0,100,0), +(@PATH,6,5296.644,2731.107,409.3163,0,0,0,100,0); + +-- Guards "Alliance" (Valiance Expedition Champion) +SET @GUID := 88371; +DELETE FROM `creature` WHERE `id`=30740; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +-- Fortress +(@GUID+0,30740,571,1,0x00000080,0,0,5150.26855,2786.02173,409.5469,3.22885919,120,0,0,1,0,0), +(@GUID+1,30740,571,1,0x00000080,0,0,5150.657,2777.9502,409.4053,2.94960642,120,0,0,1,0,0), +(@GUID+2,30740,571,1,0x00000080,0,0,5193.632,2734.172,409.272552,4.694936,120,0,0,1,0,0), +(@GUID+3,30740,571,1,0x00000080,0,0,5200.497,2733.88843,409.272552,4.677482,120,0,0,1,0,0), +(@GUID+4,30740,571,1,0x00000080,0,0,5264.64648,2670.1936,409.1819,3.07177949,120,0,0,1,0,0), +(@GUID+5,30740,571,1,0x00000080,0,0,5265.30566,2663.15381,409.1819,3.12413931,120,0,0,1,0,0), +(@GUID+6,30740,571,1,0x00000080,0,0,5307.02051,2613.89771,409.172363,4.694936,120,0,0,1,0,0), +(@GUID+7,30740,571,1,0x00000080,0,0,5311.133,3061.04248,408.809937,1.50098312,120,0,0,1,0,0), +(@GUID+8,30740,571,1,0x00000080,0,0,5315.87354,2614.21924,408.972748,4.677482,120,0,0,1,0,0), +(@GUID+9,30740,571,1,0x00000080,0,0,5318.09,3060.634,408.882782,1.62315619,120,0,0,1,0,0), +(@GUID+10,30740,571,1,0x00000080,0,0,5149.395,2897.044,409.304443,3.03687286,120,0,0,1,0,0), +(@GUID+11,30740,571,1,0x00000080,0,0,5149.51953,2904.19336,409.276062,3.07177949,120,0,0,1,0,0), +(@GUID+12,30740,571,1,0x00000080,0,0,5192.79248,2948.454,409.2746,1.50098312,120,0,0,1,0,0), +(@GUID+13,30740,571,1,0x00000080,0,0,5201.645,2948.77612,409.2746,1.62315619,120,0,0,1,0,0), +(@GUID+14,30740,571,1,0x00000080,0,0,5265.28,3010.10083,408.895782,2.82743335,120,0,0,1,0,0), +(@GUID+15,30740,571,1,0x00000080,0,0,5265.47559,3017.39941,408.582977,3.07177949,120,0,0,1,0,0), +(@GUID+16,30740,571,1,0x00000080,0,0,5367.91455,2826.52026,409.3225,3.33357882,120,0,0,1,0,0), +(@GUID+17,30740,571,1,0x00000080,0,0,5368.71338,2856.36035,409.3225,2.94960642,120,0,0,1,0,0), +(@GUID+18,30740,571,1,0x00000080,0,0,5388.56,2834.76782,418.7585,3.07177949,120,0,0,1,0,0), +(@GUID+19,30740,571,1,0x00000080,0,0,5389.272,2847.36816,418.7585,3.106686,120,0,0,1,0,0), +(@GUID+20,30740,571,1,0x00000080,0,0,4684.475,2414.28979,369.9621,-2.85779858,120,0,0,1,0,0), +(@GUID+21,30740,571,1,0x00000080,0,0,4692.75635,2392.88574,369.0177,-2.82921553,120,0,0,1,0,0), +(@GUID+22,30740,571,1,0x00000080,0,0,5327.264648,2659.455322,409.178711,3.069901,120,0,0,1,0,0), -- F1307814000A2DAD path +(@GUID+23,30740,571,1,0x00000080,0,0,5154.225586,2833.824219,409.262451,3.124139,120,0,0,1,0,0), +(@GUID+24,30740,571,1,0x00000080,0,0,5154.119629,2847.892822,409.247559,3.071779,120,0,0,1,0,0), +(@GUID+25,30740,571,1,0x00000080,0,0,5179.111328,2837.129639,409.274658,3.211406,120,0,0,1,0,0), +(@GUID+26,30740,571,1,0x00000080,0,0,5179.666504,2846.597900,409.274658,3.089233,120,0,0,1,0,0), +(@GUID+27,30740,571,1,0x00000080,0,0,5270.163086,2833.479248,409.274658,3.124139,120,0,0,1,0,0), +(@GUID+28,30740,571,1,0x00000080,0,0,5270.057129,2847.547607,409.274658,3.071779,120,0,0,1,0,0), +(@GUID+29,30740,571,1,0x00000080,0,0,5307.750000,3008.872559,409.193024,4.781681,120,0,0,1,0,0), -- F1307814000A43AE path +(@GUID+30,30740,571,1,0x00000080,0,0,5335.117188,2916.802002,409.443756,1.500983,120,0,0,1,0,0), +(@GUID+31,30740,571,1,0x00000080,0,0,5350.681152,2917.011719,409.274658,1.466077,120,0,0,1,0,0), +(@GUID+32,30740,571,1,0x00000080,0,0,5335.306152,2764.110352,409.274567,4.834562,120,0,0,1,0,0), +(@GUID+33,30740,571,1,0x00000080,0,0,5349.811523,2763.634766,409.333374,4.660029,120,0,0,1,0,0), +-- Eastspark Workshop +(@GUID+34,30740,571,1,0x00000080,0,0,4349.537,2411.25781,374.743317,2.05948853,120,0,0,1,0,0), +(@GUID+35,30740,571,1,0x00000080,0,0,4388.13135,2411.97827,374.743317,1.6406095,120,0,0,1,0,0), +(@GUID+36,30740,571,1,0x00000080,0,0,4391.6665,2300.60913,374.7433,4.92182827,120,0,0,1,0,0), +(@GUID+37,30740,571,1,0x00000080,0,0,4413.42969,2393.44946,376.3599,1.06465089,120,0,0,1,0,0), +(@GUID+38,30740,571,1,0x00000080,0,0,4417.92,2331.237,370.9189,5.846853,120,0,0,1,0,0), +(@GUID+39,30740,571,1,0x00000080,0,0,4349.11768,2299.27954,374.7433,4.904375,120,0,0,1,0,0), +(@GUID+40,30740,571,1,0x00000080,0,0,4418.608,2355.28735,372.4907,6.02138567,120,0,0,1,0,0); + +-- banners +SET @OGUID := 75939; +DELETE FROM `gameobject` WHERE `id` IN (192254,192255,192269,192284,192285,192286,192287,192292,192299,192304,192305,192306,192307,192308,192309,192310,192312,192313,192314,192316,192317,192318,192319,192320,192321, + 192322,192323,192324,192325,192326,192327,192328,192329,192330,192331,192332,192333,192334,192335,192336,192338,192339,192349,192350,192351,192352,192353,192354,192355,192356, + 192357,192358,192359,192360,192361,192362,192363,192364,192366,192367,192368,192369,192370,192371,192372,192373,192374,192375,192376,192377,192378,192379,192487,192488,192501, + 192502); +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID AND @OGUID+115; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +-- Fortress Banners "Alliance" +(@OGUID+0,192286,571,1,128,5371.44873,2820.79346,409.426575,3.124123,0,0,0,0,120,0,1), +(@OGUID+1,192287,571,1,128,5372.42432,2862.47925,409.3659,3.14159274,0,0,0,0,120,0,1), +(@OGUID+2,192292,571,1,128,5154.35059,2862.08423,445.0105,3.14159274,0,0,0,0,120,0,1), +(@OGUID+3,192299,571,1,128,5155.21631,2820.63013,444.9789,-3.115388,0,0,0,0,120,0,1), +(@OGUID+4,192304,571,1,128,5398.03564,2873.013,455.203552,3.132858,0,0,0,0,120,0,1), +(@OGUID+5,192305,571,1,128,5397.31348,2809.264,455.101624,3.132858,0,0,0,0,120,0,1), +(@OGUID+6,192306,571,1,128,5270.55469,2861.68237,444.917236,-3.124123,0,0,0,0,120,0,1), +(@OGUID+7,192307,571,1,128,5271.16064,2820.10864,445.109,-3.132858,0,0,0,0,120,0,1), +(@OGUID+8,192308,571,1,128,5235.12744,2942.12329,444.2792,1.58824873,0,0,0,0,120,0,1), +(@OGUID+9,192309,571,1,128,5272.549,2976.54175,444.493,3.132858,0,0,0,0,120,0,1), +(@OGUID+10,192310,571,1,128,5352.19775,3055.0166,444.5646,1.57952213,0,0,0,0,120,0,1), +(@OGUID+11,192312,571,1,128,5236.315,2739.21533,444.992828,-1.60570168,0,0,0,0,120,0,1), +(@OGUID+12,192313,571,1,128,5271.634,2704.829,445.182617,-3.124123,0,0,0,0,120,0,1), +(@OGUID+13,192314,571,1,128,5350.905,2622.48,444.649323,-1.56206989,0,0,0,0,120,0,1), +(@OGUID+14,192316,571,1,128,5322.013,2781.13281,435.6727,1.57952213,0,0,0,0,120,0,1), +(@OGUID+15,192317,571,1,128,5363.387,2781.27856,435.634125,1.58824873,0,0,0,0,120,0,1), +(@OGUID+16,192318,571,1,128,5322.24854,2898.94629,435.642975,-1.57952213,0,0,0,0,120,0,1), +(@OGUID+17,192319,571,1,128,5364.30371,2899.216,435.690826,-1.55334139,0,0,0,0,120,0,1), +(@OGUID+18,192320,571,1,128,5289.048,2820.22656,435.6738,0,0,0,0,0,120,0,1), +(@OGUID+19,192321,571,1,128,5288.847,2861.82128,435.590485,0.0261791088,0,0,0,0,120,0,1), +(@OGUID+20,192322,571,1,128,5322.89258,2917.14233,445.1543,1.56206989,0,0,0,0,120,0,1), +(@OGUID+21,192323,571,1,128,5364.283,2917.264,445.332184,1.58824611,0,0,0,0,120,0,1), +(@OGUID+22,192324,571,1,128,5290.514,2976.56177,435.087463,0.008724241,0,0,0,0,120,0,1), +(@OGUID+23,192325,571,1,128,5352.37744,3036.95483,435.111053,-1.56206989,0,0,0,0,120,0,1), +(@OGUID+24,192326,571,1,128,5392.64063,3036.967,433.648682,-1.51843357,0,0,0,0,120,0,1), +(@OGUID+25,192327,571,1,128,5172.336,2862.57544,435.65802,0,0,0,0,0,120,0,1), +(@OGUID+26,192328,571,1,128,5173.12842,2820.95654,435.657623,0.0261791088,0,0,0,0,120,0,1), +(@OGUID+27,192329,571,1,128,5235.32227,2924.31079,434.8981,-1.56206989,0,0,0,0,120,0,1), +(@OGUID+28,192330,571,1,128,5237.02344,2757.35669,435.625641,1.55334139,0,0,0,0,120,0,1), +(@OGUID+29,192331,571,1,128,5289.78125,2704.62158,435.714325,0.008724241,0,0,0,0,120,0,1), +(@OGUID+30,192332,571,1,128,5350.93945,2640.43066,435.2642,1.56206989,0,0,0,0,120,0,1), +(@OGUID+31,192333,571,1,128,5392.28027,2639.84033,435.207916,1.52716041,0,0,0,0,120,0,1), +(@OGUID+32,192334,571,1,128,5322.17041,2763.20142,444.9744,-1.56206715,0,0,0,0,120,0,1), +(@OGUID+33,192335,571,1,128,5363.71631,2763.24731,445.023132,-1.54461551,0,0,0,0,120,0,1), +(@OGUID+34,192487,571,1,128,5145.11133,2934.948,433.254852,-3.10665226,0,0,0,0,120,0,1), +(@OGUID+35,192487,571,1,128,5146.04443,2747.30249,433.527039,3.124123,0,0,0,0,120,0,1), +(@OGUID+36,192487,571,1,128,5158.71,2882.90161,431.27417,3.14159274,0,0,0,0,120,0,1), +(@OGUID+37,192487,571,1,128,5160.28369,2798.59766,430.6037,-3.124123,0,0,0,0,120,0,1), +(@OGUID+38,192487,571,1,128,5162.90674,2952.59766,433.368,1.57079577,0,0,0,0,120,0,1), +(@OGUID+39,192487,571,1,128,5163.85,2729.677,433.327545,-1.60570168,0,0,0,0,120,0,1), +(@OGUID+40,192487,571,1,128,5260.82471,2631.81763,433.181061,3.124123,0,0,0,0,120,0,1), +(@OGUID+41,192487,571,1,128,5262.544,3047.93018,431.96524,3.124123,0,0,0,0,120,0,1), +(@OGUID+42,192487,571,1,128,5278.43066,2613.83276,433.294434,-1.62315571,0,0,0,0,120,0,1), +(@OGUID+43,192487,571,1,128,5280.894,3064.95386,431.9758,1.55334139,0,0,0,0,120,0,1), +-- Fortress Banners "Horde" +(@OGUID+44,192269,571,1,64,4526.46,2810.18,391.2,-2.99322,0,0,0,1,180,0,1), +(@OGUID+45,192284,571,1,64,5372.48,2862.5,409.049,3.14159,0,0,0,1,180,0,1), +(@OGUID+46,192285,571,1,64,5371.49,2820.8,409.177,3.14159,0,0,0,1,180,0,1), +(@OGUID+47,192338,571,1,64,5397.76,2873.08,455.461,3.10665,0,0,0,1,180,0,1), +(@OGUID+48,192339,571,1,64,5397.39,2809.33,455.344,3.10665,0,0,0,1,180,0,1), +(@OGUID+49,192349,571,1,64,5155.31,2820.74,444.979,-3.13286,0,0,0,1,180,0,1), +(@OGUID+50,192350,571,1,64,5270.69,2861.78,445.058,-3.11539,0,0,0,1,180,0,1), +(@OGUID+51,192351,571,1,64,5271.28,2820.16,445.201,-3.13286,0,0,0,1,180,0,1), +(@OGUID+52,192352,571,1,64,5173.02,2820.93,435.72,0.017452,0,0,0,1,180,0,1), +(@OGUID+53,192353,571,1,64,5172.11,2862.57,435.721,0.017452,0,0,0,1,180,0,1), +(@OGUID+54,192354,571,1,64,5288.41,2861.79,435.721,0.017452,0,0,0,1,180,0,1), +(@OGUID+55,192355,571,1,64,5288.92,2820.22,435.721,0.017452,0,0,0,1,180,0,1), +(@OGUID+56,192356,571,1,64,5237.07,2757.03,435.796,1.51844,0,0,0,1,180,0,1), +(@OGUID+57,192357,571,1,64,5235.34,2924.34,435.04,-1.5708,0,0,0,1,180,0,1), +(@OGUID+58,192358,571,1,64,5322.23,2899.43,435.808,-1.58825,0,0,0,1,180,0,1), +(@OGUID+59,192359,571,1,64,5364.35,2899.4,435.839,-1.5708,0,0,0,1,180,0,1), +(@OGUID+60,192360,571,1,64,5352.37,3037.09,435.252,-1.5708,0,0,0,1,180,0,1), +(@OGUID+61,192361,571,1,64,5392.65,3037.11,433.713,-1.52716,0,0,0,1,180,0,1), +(@OGUID+62,192362,571,1,64,5322.12,2763.61,444.974,-1.55334,0,0,0,1,180,0,1), +(@OGUID+63,192363,571,1,64,5363.61,2763.39,445.024,-1.54462,0,0,0,1,180,0,1), +(@OGUID+64,192364,571,1,64,5350.88,2622.72,444.686,-1.5708,0,0,0,1,180,0,1), +(@OGUID+65,192366,571,1,64,5236.27,2739.46,444.992,-1.59698,0,0,0,1,180,0,1), +(@OGUID+66,192367,571,1,64,5271.8,2704.87,445.183,-3.13286,0,0,0,1,180,0,1), +(@OGUID+67,192368,571,1,64,5289.46,2704.68,435.875,-0.017451,0,0,0,1,180,0,1), +(@OGUID+68,192369,571,1,64,5350.95,2640.36,435.408,1.5708,0,0,0,1,180,0,1), +(@OGUID+69,192370,571,1,64,5392.27,2639.74,435.331,1.50971,0,0,0,1,180,0,1), +(@OGUID+70,192371,571,1,64,5364.29,2916.94,445.331,1.57952,0,0,0,1,180,0,1), +(@OGUID+71,192372,571,1,64,5322.86,2916.95,445.154,1.56207,0,0,0,1,180,0,1), +(@OGUID+72,192373,571,1,64,5290.35,2976.56,435.221,0.017452,0,0,0,1,180,0,1), +(@OGUID+73,192374,571,1,64,5272.94,2976.55,444.492,3.12412,0,0,0,1,180,0,1), +(@OGUID+74,192375,571,1,64,5235.19,2941.9,444.278,1.58825,0,0,0,1,180,0,1), +(@OGUID+75,192376,571,1,64,5352.19775,3055.0166,444.5646,1.57952,0,0,0,0,120,0,1), +(@OGUID+76,192377,571,1,64,5414.19,3069.8,415.187,1.64061,0,0,0,1,180,0,1), +(@OGUID+77,192378,571,1,64,5322.02,2781.13,435.811,1.5708,0,0,0,1,180,0,1), +(@OGUID+78,192379,571,1,64,5363.42,2781.03,435.763,1.5708,0,0,0,1,180,0,1), +(@OGUID+79,192254,571,1,64,5154.46,2828.94,409.189,3.14159,0,0,0,1,180,0,1), +(@OGUID+80,192255,571,1,64,5154.52,2853.31,409.183,3.14159,0,0,0,1,180,0,1), +(@OGUID+81,192336,571,1,64,5154.49,2862.15,445.012,3.14159,0,0,0,1,180,0,1), +(@OGUID+82,192488,571,1,64,5160.34,2798.61,430.769,3.14159,0,0,0,1,180,0,1), +(@OGUID+83,192488,571,1,64,5158.81,2883.13,431.618,3.14159,0,0,0,1,180,0,1), +(@OGUID+84,192488,571,1,64,5278.38,2613.83,433.409,-1.58825,0,0,0,1,180,0,1), +(@OGUID+85,192488,571,1,64,5260.82,2631.8,433.324,3.05433,0,0,0,1,180,0,1), +(@OGUID+86,192488,571,1,64,5163.13,2952.59,433.503,1.53589,0,0,0,1,180,0,1), +(@OGUID+87,192488,571,1,64,5145.11,2935,433.386,3.14159,0,0,0,1,180,0,1), +(@OGUID+88,192488,571,1,64,5262.54,3047.95,432.055,3.10665,0,0,0,1,180,0,1), +(@OGUID+89,192488,571,1,64,5146.04,2747.21,433.584,3.07177,0,0,0,1,180,0,1), +(@OGUID+90,192488,571,1,64,5163.78,2729.68,433.394,-1.58825,0,0,0,1,180,0,1), +(@OGUID+91,192488,571,1,64,5280.894,3064.95386,431.9758,1.55334139,0,0,0,0,120,0,1), +-- Tower Banners "Alliance" +(@OGUID+92,192501,571,1,64,4398.82,2804.7,429.792,-1.58825,0,0,0,1,180,0,1), +(@OGUID+93,192501,571,1,64,4416,2822.67,429.851,-0.017452,0,0,0,1,180,0,1), +(@OGUID+94,192501,571,1,64,4559.11,3606.22,419.999,-1.48353,0,0,0,1,180,0,1), +(@OGUID+95,192501,571,1,64,4539.42,3622.49,420.034,-3.07177,0,0,0,1,180,0,1), +(@OGUID+96,192501,571,1,64,4555.26,3641.65,419.974,1.67551,0,0,0,1,180,0,1), +(@OGUID+97,192501,571,1,64,4574.87,3625.91,420.079,0.087266,0,0,0,1,180,0,1), +(@OGUID+98,192501,571,1,64,4466.79,1960.42,459.144,1.15192,0,0,0,1,180,0,1), +(@OGUID+99,192501,571,1,64,4475.35,1937.03,459.07,-0.436332,0,0,0,1,180,0,1), +(@OGUID+100,192501,571,1,64,4451.76,1928.1,459.076,-2.00713,0,0,0,1,180,0,1), +(@OGUID+101,192501,571,1,64,4442.99,1951.9,459.093,2.74016,0,0,0,1,180,0,1), +(@OGUID+102,192501,571,1,64,4380.36328,2822.38013,429.8818,-3.106652,0,0,0,0,120,0,1), +(@OGUID+103,192501,571,1,64,4397.6626,2840.299,429.921661,1.58824873,0,0,0,0,120,0,1), +-- Tower Banners "Horde" +(@OGUID+104,192502,571,1,128,4398.82,2804.7,429.792,-1.58825,0,0,0,1,180,0,1), +(@OGUID+105,192502,571,1,128,4416,2822.67,429.851,-0.017452,0,0,0,1,180,0,1), +(@OGUID+106,192502,571,1,128,4559.11,3606.22,419.999,-1.48353,0,0,0,1,180,0,1), +(@OGUID+107,192502,571,1,128,4539.42,3622.49,420.034,-3.07177,0,0,0,1,180,0,1), +(@OGUID+108,192502,571,1,128,4555.26,3641.65,419.974,1.67551,0,0,0,1,180,0,1), +(@OGUID+109,192502,571,1,128,4574.87,3625.91,420.079,0.087266,0,0,0,1,180,0,1), +(@OGUID+110,192502,571,1,128,4466.79,1960.42,459.144,1.15192,0,0,0,1,180,0,1), +(@OGUID+111,192502,571,1,128,4475.35,1937.03,459.07,-0.436332,0,0,0,1,180,0,1), +(@OGUID+112,192502,571,1,128,4451.76,1928.1,459.076,-2.00713,0,0,0,1,180,0,1), +(@OGUID+113,192502,571,1,128,4442.99,1951.9,459.093,2.74016,0,0,0,1,180,0,1), +(@OGUID+114,192502,571,1,128,4380.36328,2822.38013,429.8818,-3.106652,0,0,0,0,120,0,1), +(@OGUID+115,192502,571,1,128,4397.6626,2840.299,429.921661,1.58824873,0,0,0,0,120,0,1); + +SET @OGUID := 17780; +DELETE FROM `gameobject` WHERE `id` IN (192458,192459,192460,192461,192289,192290,192434,192435,192280,192283,192425,192426,192427,192428,192288,192291,192400,192401,192281,192282); +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +-- The Sunken Ring "Horde" +(@OGUID+0,192458,571,1,16,4811.4,2441.9,358.207,-2.0333,0,0,0,1,180,0,1), +(@OGUID+1,192459,571,1,16,4805.67,2407.48,358.191,1.78023,0,0,0,1,180,0,1), +(@OGUID+2,192460,571,1,16,5004.35,2486.36,358.449,2.17294,0,0,0,1,180,0,1), +(@OGUID+3,192461,571,1,16,4983.28,2503.09,358.177,-0.427603,0,0,0,1,180,0,1), +(@OGUID+4,192289,571,1,16,4778.19,2438.06,345.644,-2.94088,0,0,0,1,180,0,1), +(@OGUID+5,192290,571,1,16,5024.57,2532.75,344.023,-1.93732,0,0,0,1,180,0,1), +-- The Sunken Ring "Alliance" +(@OGUID+6,192425,571,1,32,4811.435,2441.84546,357.982483,-2.02457881,0,0,0,0,120,0,1), +(@OGUID+7,192426,571,1,32,4805.514,2407.84375,357.940765,1.7715075,0,0,0,0,120,0,1), +(@OGUID+8,192427,571,1,32,5004.35,2486.36,358.449,2.17294,0,0,0,1,180,0,1), +(@OGUID+9,192428,571,1,32,4983.221,2503.27271,357.959534,-0.43633157,0,0,0,0,120,0,1), +(@OGUID+10,192288,571,1,32,4778.065,2438.02441,345.7063,-2.932139,0,0,0,0,120,0,1), +(@OGUID+11,192291,571,1,32,5024.608,2532.72583,344.4308,-1.94604158,0,0,0,0,120,0,1), +-- The Broken Temple "Horde" +(@OGUID+12,192434,571,1,16,5041.61,3294.4,382.15,-1.63188,0,0,0,1,180,0,1), +(@OGUID+13,192435,571,1,16,4855.63,3297.62,376.739,-3.13286,0,0,0,1,180,0,1), +(@OGUID+14,192280,571,1,16,4857.97,3335.44,368.881,-2.94959,0,0,0,1,180,0,1), +(@OGUID+15,192283,571,1,16,5006.34,3280.4,371.163,2.22529,0,0,0,1,180,0,1), +-- The Broken Temple "Alliance" +(@OGUID+16,192400,571,1,32,5041.650879,3294.318604,381.919952,-1.605702,0,0,0,1,180,0,1), +(@OGUID+17,192401,571,1,32,4855.444336,3297.600830,376.495758,-3.115388,0,0,0,1,180,0,1), +(@OGUID+18,192281,571,1,32,4857.971191,3335.415771,369.291901,-2.888511,0,0,0,1,180,0,1), +(@OGUID+19,192282,571,1,32,5006.322754,3280.362061,371.242249,2.242746,0,0,0,1,180,0,1); \ No newline at end of file From 77c848b93743db59eec8009a2ff0293479560dbe Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 28 Feb 2012 23:03:38 +0100 Subject: [PATCH 0067/1149] Fixed build broken in 218ed813d0a2d26fd594ddafa2132cc7c5209bb4 --- src/server/shared/Packets/ByteBuffer.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index abd0ed357e4..46e34126ae1 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -34,8 +34,8 @@ class ByteBufferException } protected: - virtual void PrintError() const = 0; - + virtual void PrintError() const = 0 {}; + size_t Pos; size_t Size; size_t ValueSize; @@ -48,7 +48,7 @@ class ByteBufferPositionException : public ByteBufferException : ByteBufferException(pos, size, valueSize), _add(add) {} protected: - void PrintError() const override + void PrintError() const { sLog->outError("Attempted to %s value with size: "SIZEFMTD" in ByteBuffer (pos: " SIZEFMTD " size: "SIZEFMTD") " , ValueSize, (_add ? "put" : "get"), Pos, Size); @@ -64,8 +64,8 @@ class ByteBufferSourceException : public ByteBufferException ByteBufferSourceException(size_t pos, size_t size, size_t valueSize) : ByteBufferException(pos, size, valueSize) {} - protected: - void PrintError() const override + protected: + void PrintError() const { sLog->outError("Attempted to put a %s in ByteBuffer (pos: "SIZEFMTD" size: "SIZEFMTD")", (ValueSize > 0 ? "NULL-pointer" : "zero-sized value"), Pos, Size); @@ -437,7 +437,7 @@ class ByteBuffer void put(size_t pos, const uint8 *src, size_t cnt) { if (pos + cnt > size()) - throw ByteBufferPositionException(true, pos, cnt, size()); + throw ByteBufferPositionException(true, pos, cnt, size()); if (!src) throw ByteBufferSourceException(_wpos, size(), cnt); From 66fc6482de180857b6ec3de8931d0c7887653baa Mon Sep 17 00:00:00 2001 From: leak Date: Tue, 28 Feb 2012 22:56:35 +0100 Subject: [PATCH 0068/1149] Core/Warden: Switch to multi-threaded packet processing for warden --- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Warden/WardenCheckMgr.cpp | 18 +++--------------- src/server/game/Warden/WardenCheckMgr.h | 2 ++ src/server/game/Warden/WardenWin.cpp | 4 ++++ 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index e2e6772f230..e5b5b20dcfa 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -769,7 +769,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x2E4*/ { "SMSG_AREA_SPIRIT_HEALER_TIME", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x2E5*/ { "CMSG_GM_UNTEACH", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x2E6*/ { "SMSG_WARDEN_DATA", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2E7*/ { "CMSG_WARDEN_DATA", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleWardenDataOpcode }, + /*0x2E7*/ { "CMSG_WARDEN_DATA", STATUS_AUTHED, PROCESS_THREADSAFE, &WorldSession::HandleWardenDataOpcode }, /*0x2E8*/ { "SMSG_GROUP_JOINED_BATTLEGROUND", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x2E9*/ { "MSG_BATTLEGROUND_PLAYER_POSITIONS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlegroundPlayerPositionsOpcode}, /*0x2EA*/ { "CMSG_PET_STOP_ATTACK", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetStopAttack }, diff --git a/src/server/game/Warden/WardenCheckMgr.cpp b/src/server/game/Warden/WardenCheckMgr.cpp index 29f29fe5b88..7567b3976db 100644 --- a/src/server/game/Warden/WardenCheckMgr.cpp +++ b/src/server/game/Warden/WardenCheckMgr.cpp @@ -25,7 +25,6 @@ #include "WardenCheckMgr.h" #include "Warden.h" - WardenCheckMgr::WardenCheckMgr() { } @@ -49,17 +48,6 @@ void WardenCheckMgr::LoadWardenChecks() return; } - // For reload case - for (uint16 i = 0; i < CheckStore.size(); ++i) - delete CheckStore[i]; - - CheckStore.clear(); - - for (CheckResultContainer::iterator itr = CheckResultStore.begin(); itr != CheckResultStore.end(); ++itr) - delete itr->second; - CheckResultStore.clear(); - - QueryResult result = WorldDatabase.Query("SELECT MAX(id) FROM warden_checks"); if (!result) @@ -166,13 +154,13 @@ void WardenCheckMgr::LoadWardenOverrides() return; } - Field* fields = result->Fetch(); - uint32 count = 0; + ACE_WRITE_GUARD(ACE_RW_Mutex, g, _checkStoreLock); + do { - fields = result->Fetch(); + Field* fields = result->Fetch(); uint16 checkId = fields[0].GetUInt16(); uint8 action = fields[1].GetUInt8(); diff --git a/src/server/game/Warden/WardenCheckMgr.h b/src/server/game/Warden/WardenCheckMgr.h index 1b790d16716..45de18081c2 100644 --- a/src/server/game/Warden/WardenCheckMgr.h +++ b/src/server/game/Warden/WardenCheckMgr.h @@ -64,6 +64,8 @@ class WardenCheckMgr void LoadWardenChecks(); void LoadWardenOverrides(); + ACE_RW_Mutex _checkStoreLock; + private: CheckContainer CheckStore; CheckResultContainer CheckResultStore; diff --git a/src/server/game/Warden/WardenWin.cpp b/src/server/game/Warden/WardenWin.cpp index 53d167082d6..3e028254f28 100644 --- a/src/server/game/Warden/WardenWin.cpp +++ b/src/server/game/Warden/WardenWin.cpp @@ -212,6 +212,8 @@ void WardenWin::RequestData() ByteBuffer buff; buff << uint8(WARDEN_SMSG_CHEAT_CHECKS_REQUEST); + ACE_READ_GUARD(ACE_RW_Mutex, g, sWardenCheckMgr->_checkStoreLock); + for (uint32 i = 0; i < sWorld->getIntConfig(CONFIG_WARDEN_NUM_OTHER_CHECKS); ++i) { // If todo list is done break loop (will be filled on next Update() run) @@ -377,6 +379,8 @@ void WardenWin::HandleData(ByteBuffer &buff) uint8 type; uint16 checkFailed = 0; + ACE_READ_GUARD(ACE_RW_Mutex, g, sWardenCheckMgr->_checkStoreLock); + for (std::list::iterator itr = _currentChecks.begin(); itr != _currentChecks.end(); ++itr) { rd = sWardenCheckMgr->GetWardenDataById(*itr); From 7eff1c8f53dd896ada4afaaedbb5233792caa6d8 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 29 Feb 2012 12:02:28 +0100 Subject: [PATCH 0069/1149] Core: Build fix (for real this time) and warning fix --- src/server/game/Globals/ObjectMgr.cpp | 2 +- src/server/shared/Packets/ByteBuffer.cpp | 22 ++++++++++++++++++++++ src/server/shared/Packets/ByteBuffer.h | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 src/server/shared/Packets/ByteBuffer.cpp diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 7834a1cc4a3..11977280177 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -7079,7 +7079,7 @@ void ObjectMgr::LoadNPCSpellClickSpells() uint32 oldMSTime = getMSTime(); _spellClickInfoStore.clear(); - // 0 1 2 3 + // 0 1 2 3 QueryResult result = WorldDatabase.Query("SELECT npc_entry, spell_id, cast_flags, user_type FROM npc_spellclick_spells"); if (!result) diff --git a/src/server/shared/Packets/ByteBuffer.cpp b/src/server/shared/Packets/ByteBuffer.cpp new file mode 100644 index 00000000000..a64bb926d04 --- /dev/null +++ b/src/server/shared/Packets/ByteBuffer.cpp @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include "ByteBuffer.h" + +void ByteBufferException::PrintError() const +{ +} diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 46e34126ae1..3cd6ff73b1e 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -34,7 +34,7 @@ class ByteBufferException } protected: - virtual void PrintError() const = 0 {}; + virtual void PrintError() const = 0; size_t Pos; size_t Size; From eb1a2a36729a1fcc91d3610eb37bc81ff4625bcc Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 29 Feb 2012 12:43:59 +0100 Subject: [PATCH 0070/1149] Core/Object: - Corrected the flag and use of UPDATEFLAG_LOWGUID. - Send proper positions for objects on transports. - Rename UPDATEFLAG_HAS_POSITION -> UPDATEFLAG_STATIONARY_POSITION - Added some comments --- src/server/game/Entities/Corpse/Corpse.cpp | 2 +- .../Entities/DynamicObject/DynamicObject.cpp | 2 +- .../game/Entities/GameObject/GameObject.cpp | 2 +- src/server/game/Entities/Item/Item.cpp | 2 +- src/server/game/Entities/Object/Object.cpp | 87 ++++++++++--------- src/server/game/Entities/Object/Object.h | 22 ++--- .../game/Entities/Object/Updates/UpdateData.h | 22 ++--- src/server/game/Entities/Player/Player.cpp | 4 +- src/server/game/Entities/Player/Player.h | 8 +- .../game/Entities/Transport/Transport.cpp | 2 +- src/server/game/Entities/Unit/Unit.cpp | 4 +- src/server/game/Globals/ObjectAccessor.cpp | 2 +- 12 files changed, 84 insertions(+), 75 deletions(-) diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp index da5975aafbe..5b7c40e5494 100755 --- a/src/server/game/Entities/Corpse/Corpse.cpp +++ b/src/server/game/Entities/Corpse/Corpse.cpp @@ -32,7 +32,7 @@ Corpse::Corpse(CorpseType type) : WorldObject(type != CORPSE_BONES) m_objectType |= TYPEMASK_CORPSE; m_objectTypeId = TYPEID_CORPSE; - m_updateFlag = (UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_POSITION); + m_updateFlag = (UPDATEFLAG_LOWGUID | UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_POSITION); m_valuesCount = CORPSE_END; diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp index fa975e0cd39..0a4e4c73f42 100755 --- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp +++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp @@ -33,7 +33,7 @@ DynamicObject::DynamicObject(bool isWorldObject) : WorldObject(isWorldObject), m_objectType |= TYPEMASK_DYNAMICOBJECT; m_objectTypeId = TYPEID_DYNAMICOBJECT; - m_updateFlag = (UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_POSITION); + m_updateFlag = (UPDATEFLAG_LOWGUID | UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_POSITION); m_valuesCount = DYNAMICOBJECT_END; } diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index a06cee891e7..c7101e918ba 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -38,7 +38,7 @@ GameObject::GameObject() : WorldObject(false), m_model(NULL), m_goValue(new Game m_objectType |= TYPEMASK_GAMEOBJECT; m_objectTypeId = TYPEID_GAMEOBJECT; - m_updateFlag = (UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_POSITION | UPDATEFLAG_ROTATION); + m_updateFlag = (UPDATEFLAG_LOWGUID | UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_POSITION | UPDATEFLAG_ROTATION); m_valuesCount = GAMEOBJECT_END; m_respawnTime = 0; diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 0fc53a65258..90f6f4a217c 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -237,7 +237,7 @@ Item::Item() m_objectType |= TYPEMASK_ITEM; m_objectTypeId = TYPEID_ITEM; - m_updateFlag = UPDATEFLAG_HIGHGUID; + m_updateFlag = UPDATEFLAG_LOWGUID; m_valuesCount = ITEM_END; m_slot = 0; diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index c1ecc3b74e7..92534113609 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -209,7 +209,7 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c if (target == this) // building packet for yourself flags |= UPDATEFLAG_SELF; - if (flags & UPDATEFLAG_HAS_POSITION) + if (flags & UPDATEFLAG_STATIONARY_POSITION) { // UPDATETYPE_CREATE_OBJECT2 dynamic objects, corpses... if (isType(TYPEMASK_DYNAMICOBJECT) || isType(TYPEMASK_CORPSE) || isType(TYPEMASK_PLAYER)) @@ -293,19 +293,21 @@ void Object::BuildOutOfRangeUpdateBlock(UpdateData* data) const data->AddOutOfRangeGUID(GetGUID()); } -void Object::DestroyForPlayer(Player* target, bool anim) const +void Object::DestroyForPlayer(Player* target, bool onDeath) const { ASSERT(target); WorldPacket data(SMSG_DESTROY_OBJECT, 8 + 1); data << uint64(GetGUID()); - data << uint8(anim ? 1 : 0); // WotLK (bool), may be despawn animation + //! If the following bool is true, the client will call "void CGUnit_C::OnDeath()" for this object. + //! OnDeath() does for eg trigger death animation and interrupts certain spells/missiles/auras/sounds... + data << uint8(onDeath ? 1 : 0); target->GetSession()->SendPacket(&data); } -void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const +void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const { - *data << (uint16)flags; // update flags + *data << uint16(flags); // update flags // 0x20 if (flags & UPDATEFLAG_LIVING) @@ -330,13 +332,29 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const { if (flags & UPDATEFLAG_POSITION) { - *data << uint8(0); // unk PGUID! - *data << ((WorldObject*)this)->GetPositionX(); - *data << ((WorldObject*)this)->GetPositionY(); - *data << ((WorldObject*)this)->GetPositionZ(); + Transport* transport = ((WorldObject*)this)->GetTransport(); + if (transport) + data->append(transport->GetPackGUID()); + else + *data << uint8(0); + *data << ((WorldObject*)this)->GetPositionX(); *data << ((WorldObject*)this)->GetPositionY(); *data << ((WorldObject*)this)->GetPositionZ(); + + if (transport) + { + *data << ((WorldObject*)this)->GetTransOffsetX(); + *data << ((WorldObject*)this)->GetTransOffsetY(); + *data << ((WorldObject*)this)->GetTransOffsetZ(); + } + else + { + *data << ((WorldObject*)this)->GetPositionX(); + *data << ((WorldObject*)this)->GetPositionY(); + *data << ((WorldObject*)this)->GetPositionZ(); + } + *data << ((WorldObject*)this)->GetOrientation(); if (GetTypeId() == TYPEID_CORPSE) @@ -347,28 +365,17 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const else { // 0x40 - if (flags & UPDATEFLAG_HAS_POSITION) + if (flags & UPDATEFLAG_STATIONARY_POSITION) { - // 0x02 - if (flags & UPDATEFLAG_TRANSPORT && ((GameObject*)this)->GetGoType() == GAMEOBJECT_TYPE_MO_TRANSPORT) - { - *data << (float)0; - *data << (float)0; - *data << (float)0; - *data << ((WorldObject*)this)->GetOrientation(); - } - else - { - *data << ((WorldObject*)this)->GetPositionX(); - *data << ((WorldObject*)this)->GetPositionY(); - *data << ((WorldObject*)this)->GetPositionZ(); - *data << ((WorldObject*)this)->GetOrientation(); - } + *data << ((WorldObject*)this)->GetPositionX(); + *data << ((WorldObject*)this)->GetPositionY(); + *data << ((WorldObject*)this)->GetPositionZ(); + *data << ((WorldObject*)this)->GetOrientation(); } } } - // 0x8 + // 0x10 if (flags & UPDATEFLAG_LOWGUID) { switch (GetTypeId()) @@ -381,14 +388,16 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const case TYPEID_CORPSE: *data << uint32(GetGUIDLow()); // GetGUIDLow() break; + //! Unit, Player and default here are sending wrong values. + //! TODO: Research the proper formula case TYPEID_UNIT: - *data << uint32(0x0000000B); // unk, can be 0xB or 0xC + *data << uint32(0x0000000B); // unk break; case TYPEID_PLAYER: if (flags & UPDATEFLAG_SELF) - *data << uint32(0x0000002F); // unk, can be 0x15 or 0x22 + *data << uint32(0x0000002F); // unk else - *data << uint32(0x00000008); // unk, can be 0x7 or 0x8 + *data << uint32(0x00000008); // unk break; default: *data << uint32(0x00000000); // unk @@ -396,15 +405,14 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const } } - // 0x10 - if (flags & UPDATEFLAG_HIGHGUID) + // 0x8 + if (flags & UPDATEFLAG_UNKNOWN) { - // not high guid - *data << uint32(GetUInt32Value(OBJECT_FIELD_GUID)); // unk + *data << uint32(0); } // 0x4 - if (flags & UPDATEFLAG_HAS_TARGET) // packed guid (current target guid) + if (flags & UPDATEFLAG_HAS_TARGET) { if (Unit* victim = ((Unit*)this)->getVictim()) data->append(victim->GetPackGUID()); @@ -415,14 +423,15 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const // 0x2 if (flags & UPDATEFLAG_TRANSPORT) { - *data << uint32(getMSTime()); // ms time + *data << uint32(getMSTime()); // Unknown - getMSTime is wrong. } // 0x80 - if (flags & UPDATEFLAG_VEHICLE) // unused for now + if (flags & UPDATEFLAG_VEHICLE) { - *data << uint32(((Unit*)this)->GetVehicleKit()->GetVehicleInfo()->m_ID); // vehicle id - *data << float(((Creature*)this)->GetOrientation()); // facing adjustment + // TODO: Allow players to aquire this updateflag. + *data << uint32(((Unit*)this)->GetVehicleKit()->GetVehicleInfo()->m_ID); + *data << float(((Creature*)this)->GetOrientation()); } // 0x200 @@ -581,7 +590,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* { uint32 dynamicFlags = m_uint32Values[index]; - if (const Creature* creature = ToCreature()) + if (Creature const* creature = ToCreature()) { if (creature->hasLootRecipient()) { diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 7b3fcc4a337..c243527570b 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -147,7 +147,7 @@ class Object void BuildOutOfRangeUpdateBlock(UpdateData* data) const; void BuildMovementUpdateBlock(UpdateData* data, uint32 flags = 0) const; - virtual void DestroyForPlayer(Player* target, bool anim = false) const; + virtual void DestroyForPlayer(Player* target, bool onDeath = false) const; int32 GetInt32Value(uint16 index) const { @@ -299,18 +299,18 @@ class Object // FG: some hacky helpers void ForceValuesUpdateAtIndex(uint32); - Player* ToPlayer(){ if (GetTypeId() == TYPEID_PLAYER) return reinterpret_cast(this); else return NULL; } - const Player* ToPlayer() const { if (GetTypeId() == TYPEID_PLAYER) return (const Player*)((Player*)this); else return NULL; } - Creature* ToCreature(){ if (GetTypeId() == TYPEID_UNIT) return reinterpret_cast(this); else return NULL; } - const Creature* ToCreature() const {if (GetTypeId() == TYPEID_UNIT) return (const Creature*)((Creature*)this); else return NULL; } + Player* ToPlayer() { if (GetTypeId() == TYPEID_PLAYER) return reinterpret_cast(this); else return NULL; } + Player const* ToPlayer() const { if (GetTypeId() == TYPEID_PLAYER) return (Player const*)((Player*)this); else return NULL; } + Creature* ToCreature() { if (GetTypeId() == TYPEID_UNIT) return reinterpret_cast(this); else return NULL; } + Creature const* ToCreature() const { if (GetTypeId() == TYPEID_UNIT) return (Creature const*)((Creature*)this); else return NULL; } - Unit* ToUnit(){ if (GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) return reinterpret_cast(this); else return NULL; } - const Unit* ToUnit() const {if (GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) return (const Unit*)((Unit*)this); else return NULL; } - GameObject* ToGameObject(){ if (GetTypeId() == TYPEID_GAMEOBJECT) return reinterpret_cast(this); else return NULL; } - const GameObject* ToGameObject() const {if (GetTypeId() == TYPEID_GAMEOBJECT) return (const GameObject*)((GameObject*)this); else return NULL; } + Unit* ToUnit() { if (GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) return reinterpret_cast(this); else return NULL; } + Unit const* ToUnit() const { if (GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) return (const Unit*)((Unit*)this); else return NULL; } + GameObject* ToGameObject() { if (GetTypeId() == TYPEID_GAMEOBJECT) return reinterpret_cast(this); else return NULL; } + GameObject const* ToGameObject() const { if (GetTypeId() == TYPEID_GAMEOBJECT) return (const GameObject*)((GameObject*)this); else return NULL; } - Corpse* ToCorpse(){ if (GetTypeId() == TYPEID_CORPSE) return reinterpret_cast(this); else return NULL; } - const Corpse* ToCorpse() const {if (GetTypeId() == TYPEID_CORPSE) return (const Corpse*)((Corpse*)this); else return NULL; } + Corpse* ToCorpse() { if (GetTypeId() == TYPEID_CORPSE) return reinterpret_cast(this); else return NULL; } + Corpse const* ToCorpse() const { if (GetTypeId() == TYPEID_CORPSE) return (const Corpse*)((Corpse*)this); else return NULL; } protected: Object (); diff --git a/src/server/game/Entities/Object/Updates/UpdateData.h b/src/server/game/Entities/Object/Updates/UpdateData.h index e4caaec3117..ff649b7cb2f 100755 --- a/src/server/game/Entities/Object/Updates/UpdateData.h +++ b/src/server/game/Entities/Object/Updates/UpdateData.h @@ -34,17 +34,17 @@ enum OBJECT_UPDATE_TYPE enum OBJECT_UPDATE_FLAGS { - UPDATEFLAG_NONE = 0x0000, - UPDATEFLAG_SELF = 0x0001, - UPDATEFLAG_TRANSPORT = 0x0002, - UPDATEFLAG_HAS_TARGET = 0x0004, - UPDATEFLAG_LOWGUID = 0x0008, - UPDATEFLAG_HIGHGUID = 0x0010, - UPDATEFLAG_LIVING = 0x0020, - UPDATEFLAG_HAS_POSITION = 0x0040, - UPDATEFLAG_VEHICLE = 0x0080, - UPDATEFLAG_POSITION = 0x0100, - UPDATEFLAG_ROTATION = 0x0200 + UPDATEFLAG_NONE = 0x0000, + UPDATEFLAG_SELF = 0x0001, + UPDATEFLAG_TRANSPORT = 0x0002, + UPDATEFLAG_HAS_TARGET = 0x0004, + UPDATEFLAG_UNKNOWN = 0x0008, + UPDATEFLAG_LOWGUID = 0x0010, + UPDATEFLAG_LIVING = 0x0020, + UPDATEFLAG_STATIONARY_POSITION = 0x0040, + UPDATEFLAG_VEHICLE = 0x0080, + UPDATEFLAG_POSITION = 0x0100, + UPDATEFLAG_ROTATION = 0x0200 }; class UpdateData diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 857ae4d845b..75d02d4f23f 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4623,9 +4623,9 @@ void Player::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c Unit::BuildCreateUpdateBlockForPlayer(data, target); } -void Player::DestroyForPlayer(Player* target, bool anim) const +void Player::DestroyForPlayer(Player* target, bool onDeath) const { - Unit::DestroyForPlayer(target, anim); + Unit::DestroyForPlayer(target, onDeath); for (uint8 i = 0; i < INVENTORY_SLOT_BAG_END; ++i) { diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index db055088808..3d510148aa4 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -687,9 +687,9 @@ enum TransferAbortReason TRANSFER_ABORT_UNIQUE_MESSAGE = 0x09, // Until you've escaped TLK's grasp, you cannot leave this place! TRANSFER_ABORT_TOO_MANY_REALM_INSTANCES = 0x0A, // Additional instances cannot be launched, please try again later. TRANSFER_ABORT_NEED_GROUP = 0x0B, // 3.1 - TRANSFER_ABORT_NOT_FOUND2 = 0x0C, // 3.1 - TRANSFER_ABORT_NOT_FOUND3 = 0x0D, // 3.1 - TRANSFER_ABORT_NOT_FOUND4 = 0x0E, // 3.2 + TRANSFER_ABORT_NOT_FOUND1 = 0x0C, // 3.1 + TRANSFER_ABORT_NOT_FOUND2 = 0x0D, // 3.1 + TRANSFER_ABORT_NOT_FOUND3 = 0x0E, // 3.2 TRANSFER_ABORT_REALM_ONLY = 0x0F, // All players on party must be from the same realm. TRANSFER_ABORT_MAP_NOT_ALLOWED = 0x10, // Map can't be entered at this time. }; @@ -1915,7 +1915,7 @@ class Player : public Unit, public GridObject WorldSession* GetSession() const { return m_session; } void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const; - void DestroyForPlayer(Player* target, bool anim = false) const; + void DestroyForPlayer(Player* target, bool onDeath = false) const; void SendLogXPGain(uint32 GivenXP, Unit* victim, uint32 BonusXP, bool recruitAFriend = false, float group_rate=1.0f); // notifiers diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index a425640e36d..24fe75605d2 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -173,7 +173,7 @@ void MapManager::LoadTransportNPCs() Transport::Transport(uint32 period, uint32 script) : GameObject(), m_pathTime(0), m_timer(0), currenttguid(0), m_period(period), ScriptId(script), m_nextNodeTime(0) { - m_updateFlag = (UPDATEFLAG_TRANSPORT | UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_ROTATION); + m_updateFlag = (UPDATEFLAG_TRANSPORT | UPDATEFLAG_LOWGUID | UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_ROTATION); } Transport::~Transport() diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3af6d388ba9..1e46ea7346d 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -158,7 +158,7 @@ m_HostileRefManager(this) m_objectType |= TYPEMASK_UNIT; m_objectTypeId = TYPEID_UNIT; - m_updateFlag = (UPDATEFLAG_HIGHGUID | UPDATEFLAG_LIVING | UPDATEFLAG_HAS_POSITION); + m_updateFlag = (UPDATEFLAG_LIVING | UPDATEFLAG_STATIONARY_POSITION); m_attackTimer[BASE_ATTACK] = 0; m_attackTimer[OFF_ATTACK] = 0; @@ -430,7 +430,7 @@ void Unit::SendMonsterMoveTransport(Unit* vehicleOwner) data.append(GetPackGUID()); data.append(vehicleOwner->GetPackGUID()); data << int8(GetTransSeat()); - data << uint8(GetTypeId() == TYPEID_PLAYER ? 1 : 0); // boolean + data << uint8(0); data << GetPositionX() - vehicleOwner->GetPositionX(); data << GetPositionY() - vehicleOwner->GetPositionY(); data << GetPositionZ() - vehicleOwner->GetPositionZ(); diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp index 1a069a27825..dd5e6189b44 100755 --- a/src/server/game/Globals/ObjectAccessor.cpp +++ b/src/server/game/Globals/ObjectAccessor.cpp @@ -400,4 +400,4 @@ template Pet* ObjectAccessor::GetObjectInWorld(uint32 mapid, float x, float template Creature* ObjectAccessor::GetObjectInWorld(uint32 mapid, float x, float y, uint64 guid, Creature* /*fake*/); template Corpse* ObjectAccessor::GetObjectInWorld(uint32 mapid, float x, float y, uint64 guid, Corpse* /*fake*/); template GameObject* ObjectAccessor::GetObjectInWorld(uint32 mapid, float x, float y, uint64 guid, GameObject* /*fake*/); -template DynamicObject* ObjectAccessor::GetObjectInWorld(uint32 mapid, float x, float y, uint64 guid, DynamicObject* /*fake*/); \ No newline at end of file +template DynamicObject* ObjectAccessor::GetObjectInWorld(uint32 mapid, float x, float y, uint64 guid, DynamicObject* /*fake*/); From 8e8ff7c66037753ffb2a707f5bfde153405e5f35 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Wed, 29 Feb 2012 13:55:57 +0100 Subject: [PATCH 0071/1149] Core/Conditions: Remove some useless checks in Condition::Meets against a value that's _supposed to be_ const 0 in database. --- src/server/game/Conditions/ConditionMgr.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 7d21f94f372..0f1895bf1ed 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -114,7 +114,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) case CONDITION_QUESTREWARDED: { if (Player* player = object->ToPlayer()) - condMeets = (player->GetQuestRewardStatus(ConditionValue1) == !ConditionValue2); + condMeets = player->GetQuestRewardStatus(ConditionValue1); break; } case CONDITION_QUESTTAKEN: @@ -122,7 +122,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) if (Player* player = object->ToPlayer()) { QuestStatus status = player->GetQuestStatus(ConditionValue1); - condMeets = ((status == QUEST_STATUS_INCOMPLETE) == !ConditionValue2); + condMeets = (status == QUEST_STATUS_INCOMPLETE); } break; } @@ -131,7 +131,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) if (Player* player = object->ToPlayer()) { QuestStatus status = player->GetQuestStatus(ConditionValue1); - condMeets = ((status == QUEST_STATUS_COMPLETE && !player->GetQuestRewardStatus(ConditionValue1)) == !ConditionValue2); + condMeets = (status == QUEST_STATUS_COMPLETE && !player->GetQuestRewardStatus(ConditionValue1)); } break; } @@ -140,7 +140,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) if (Player* player = object->ToPlayer()) { QuestStatus status = player->GetQuestStatus(ConditionValue1); - condMeets = ((status == QUEST_STATUS_NONE) == !ConditionValue2); + condMeets = (status == QUEST_STATUS_NONE); } break; } From 8e18726b69c6c700e0e36b7858ac786e5f4ae490 Mon Sep 17 00:00:00 2001 From: teyrnon Date: Wed, 29 Feb 2012 15:09:51 +0200 Subject: [PATCH 0072/1149] Update src/server/shared/Packets/ByteBuffer.h --- src/server/shared/Packets/ByteBuffer.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 3cd6ff73b1e..e6fdcf0f202 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -30,11 +30,9 @@ class ByteBufferException ByteBufferException(size_t pos, size_t size, size_t valueSize) : Pos(pos), Size(size), ValueSize(valueSize) { - PrintError(); } protected: - virtual void PrintError() const = 0; size_t Pos; size_t Size; @@ -45,7 +43,10 @@ class ByteBufferPositionException : public ByteBufferException { public: ByteBufferPositionException(bool add, size_t pos, size_t size, size_t valueSize) - : ByteBufferException(pos, size, valueSize), _add(add) {} + : ByteBufferException(pos, size, valueSize), _add(add) + { + PrintError(); + } protected: void PrintError() const @@ -62,7 +63,10 @@ class ByteBufferSourceException : public ByteBufferException { public: ByteBufferSourceException(size_t pos, size_t size, size_t valueSize) - : ByteBufferException(pos, size, valueSize) {} + : ByteBufferException(pos, size, valueSize) + { + PrintError(); + } protected: void PrintError() const From 413a0c08130976676ac26088ccf0afeefdec2a74 Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 29 Feb 2012 11:08:08 -0500 Subject: [PATCH 0073/1149] Core/Battleground: fix issue with picking up opposite teams flag when returning your teams --- .../game/Battlegrounds/Zones/BattlegroundWS.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index 43a29e93c55..f5ee788b68a 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -435,7 +435,7 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target int32 message_id = 0; ChatMsg type = CHAT_MSG_BG_SYSTEM_NEUTRAL; - + bool flagHandled = false; //alliance flag picked up from base if (Source->GetTeam() == HORDE && this->GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_BASE && this->BgObjects[BG_WS_OBJECT_A_FLAG] == target_obj->GetGUID()) @@ -453,11 +453,12 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target Source->GetAchievementMgr().StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET, BG_WS_SPELL_SILVERWING_FLAG_PICKED); if (_flagState[1] == BG_WS_FLAG_STATE_ON_PLAYER) _bothFlagsKept = true; + flagHandled = true; } //horde flag picked up from base if (Source->GetTeam() == ALLIANCE && this->GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_BASE - && this->BgObjects[BG_WS_OBJECT_H_FLAG] == target_obj->GetGUID()) + && this->BgObjects[BG_WS_OBJECT_H_FLAG] == target_obj->GetGUID() && !flagHandled) { message_id = LANG_BG_WS_PICKEDUP_HF; type = CHAT_MSG_BG_SYSTEM_ALLIANCE; @@ -472,10 +473,11 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target Source->GetAchievementMgr().StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET, BG_WS_SPELL_WARSONG_FLAG_PICKED); if (_flagState[0] == BG_WS_FLAG_STATE_ON_PLAYER) _bothFlagsKept = true; + flagHandled = true; } //Alliance flag on ground(not in base) (returned or picked up again from ground!) - if (GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10)) + if (GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10) && !flagHandled) { if (Source->GetTeam() == ALLIANCE) { @@ -487,6 +489,7 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target PlaySoundToAll(BG_WS_SOUND_FLAG_RETURNED); UpdatePlayerScore(Source, SCORE_FLAG_RETURNS, 1); _bothFlagsKept = false; + flagHandled = true; } else { @@ -503,13 +506,14 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target if (_flagDebuffState == 2) Source->CastSpell(Source, WS_SPELL_BRUTAL_ASSAULT, true); UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, 1); + flagHandled = true; } //called in HandleGameObjectUseOpcode: //target_obj->Delete(); } //Horde flag on ground(not in base) (returned or picked up again) - if (GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10)) + if (GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10) && !flagHandled) { if (Source->GetTeam() == HORDE) { @@ -521,6 +525,7 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target PlaySoundToAll(BG_WS_SOUND_FLAG_RETURNED); UpdatePlayerScore(Source, SCORE_FLAG_RETURNS, 1); _bothFlagsKept = false; + flagHandled = true; } else { @@ -537,6 +542,7 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target if (_flagDebuffState == 2) Source->CastSpell(Source, WS_SPELL_BRUTAL_ASSAULT, true); UpdateWorldState(BG_WS_FLAG_UNK_HORDE, 1); + flagHandled = true; } //called in HandleGameObjectUseOpcode: //target_obj->Delete(); From 56536a6af5ae2e80da34d8aa85523d9671701f5e Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 29 Feb 2012 18:45:31 +0100 Subject: [PATCH 0074/1149] Core: Fixed build warning --- src/server/game/Entities/Player/Player.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 75d02d4f23f..095f9d49361 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -143,8 +143,9 @@ static uint32 copseReclaimDelay[MAX_DEATH_COUNT] = { 30, 60, 120 }; // == PlayerTaxi ================================================ PlayerTaxi::PlayerTaxi() - : m_taximask() -{ } +{ + memset(m_taximask, 0, sizeof(m_taximask)); +} void PlayerTaxi::InitTaxiNodesForLevel(uint32 race, uint32 chrClass, uint8 level) { From 03a7a806871a0447ec272151dd84421340b11d67 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 29 Feb 2012 20:12:11 +0100 Subject: [PATCH 0075/1149] Core/Packets: Fixed exceptions being incorrectly thrown when appending empty strings to packets Closes #5486 Closes #5495 --- src/server/shared/Packets/ByteBuffer.cpp | 22 ---------------------- src/server/shared/Packets/ByteBuffer.h | 12 +++++------- 2 files changed, 5 insertions(+), 29 deletions(-) delete mode 100644 src/server/shared/Packets/ByteBuffer.cpp diff --git a/src/server/shared/Packets/ByteBuffer.cpp b/src/server/shared/Packets/ByteBuffer.cpp deleted file mode 100644 index a64bb926d04..00000000000 --- a/src/server/shared/Packets/ByteBuffer.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#include "ByteBuffer.h" - -void ByteBufferException::PrintError() const -{ -} diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index e6fdcf0f202..f018eb31bb4 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -178,14 +178,17 @@ class ByteBuffer ByteBuffer &operator<<(const std::string &value) { - append((uint8 const*)value.c_str(), value.length()); + if (size_t len = value.length()) + append((uint8 const*)value.c_str(), len); append((uint8)0); return *this; } ByteBuffer &operator<<(const char *str) { - append((uint8 const*)str, str ? strlen(str) : 0); + size_t len = 0; + if (str && (len = strlen(str))) + append((uint8 const*)str, len); append((uint8)0); return *this; } @@ -372,11 +375,6 @@ class ByteBuffer _storage.reserve(ressize); } - void append(const std::string& str) - { - append((uint8 const*)str.c_str(), str.size() + 1); - } - void append(const char *src, size_t cnt) { return append((const uint8 *)src, cnt); From dbec50b89dae9035e8df7817bad67e498551a83f Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Wed, 29 Feb 2012 23:44:06 +0100 Subject: [PATCH 0076/1149] DB/Conditions: Fix a lot of spellclick conditions (conversion didn't properly take ElseGroup into account). Also add primary key to npc_spellclick_spells and remove duplicates. --- .../2012_02_29_00_world_conditions_misc.sql | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sql/updates/world/2012_02_29_00_world_conditions_misc.sql diff --git a/sql/updates/world/2012_02_29_00_world_conditions_misc.sql b/sql/updates/world/2012_02_29_00_world_conditions_misc.sql new file mode 100644 index 00000000000..34eb1261ed1 --- /dev/null +++ b/sql/updates/world/2012_02_29_00_world_conditions_misc.sql @@ -0,0 +1,126 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceGroup` IN(34125,33796,33798,33799,33791,33792,33790, +33795,33793,33800,33794,33843,33842,26421,26477,28161,29856,32788,32790); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`, +`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`Comment`) VALUES +-- Stabled Campagin Warhorse Requires Any of the Dailies +(18,34125,63215,1,9,0,13847,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,2,9,0,13851,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,3,9,0,13852,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,4,9,0,13854,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,5,9,0,13855,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,6,9,0,13856,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,7,9,0,13857,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,8,9,0,13858,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,9,9,0,13859,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,10,9,0,13860,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,11,9,0,13861,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,12,9,0,13862,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,13,9,0,13863,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,14,9,0,13864,0,0,0,'Required quest active for spellclick'), +-- Raptor requires (A) Valiant of Sen'Jin +(18,33796,62784,1,8,0,13693,0,0,0,'Required quest rewarded for spellclick'), +(18,33796,62784,2,8,0,13708,0,0,0,'Required quest rewarded for spellclick'), +-- Forsaken Warhorse requires (A) Valiant of Undercity +(18,33798,62787,1,8,0,13695,0,0,0,'Required quest rewarded for spellclick'), +(18,33798,62787,2,8,0,13710,0,0,0,'Required quest rewarded for spellclick'), +-- Orgrimmar Wolf requires (A) Valiant of Orgrimmar +(18,33799,62783,1,8,0,13691,0,0,0,'Required quest rewarded for spellclick'), +(18,33799,62783,2,8,0,13707,0,0,0,'Required quest rewarded for spellclick'), +-- Silvermoon Hawkstrider requires (A) Valiant of Silvermoon +(18,33791,62786,1,8,0,13696,0,0,0,'Required quest rewarded for spellclick'), +(18,33791,62786,2,8,0,13711,0,0,0,'Required quest rewarded for spellclick'), +-- Thunder Bluff Kodo requires (A) Valiant of Thunder Bluff +(18,33792,62785,1,8,0,13694,0,0,0,'Required quest rewarded for spellclick'), +(18,33792,62785,2,8,0,13709,0,0,0,'Required quest rewarded for spellclick'), +-- Exodar Elekk requires (A) Valiant of the Exodar +(18,33790,62781,1,8,0,13690,0,0,0,'Required quest rewarded for spellclick'), +(18,33790,62781,2,8,0,13705,0,0,0,'Required quest rewarded for spellclick'), +-- Ironforge Ram requires (A) Valiant of Ironforge +(18,33795,62779,1,8,0,13685,0,0,0,'Required quest rewarded for spellclick'), +(18,33795,62779,2,8,0,13703,0,0,0,'Required quest rewarded for spellclick'), +-- Gnomeregan Mechanostrider requires (A) Valiant of Gnomeregan +(18,33793,62780,1,8,0,13688,0,0,0,'Required quest rewarded for spellclick'), +(18,33793,62780,2,8,0,13704,0,0,0,'Required quest rewarded for spellclick'), +-- Stormwind Steed requires (A) Valiant of Stormwind +(18,33800,62774,1,8,0,13593,0,0,0,'Required quest rewarded for spellclick'), +(18,33800,62774,2,8,0,13684,0,0,0,'Required quest rewarded for spellclick'), +-- Darnassian Nightsaber requires (A) Valiant of Darnassus +(18,33794,62782,1,8,0,13689,0,0,0,'Required quest rewarded for spellclick'), +(18,33794,62782,2,8,0,13706,0,0,0,'Required quest rewarded for spellclick'), +-- Stabled Quel'Dorei steeds requires The Argent Tournament rewarded +(18,33843,63792,0,8,0,13667,0,0,0,'Required quest rewarded for spellclick'), +-- Stabled Quel'Dorei steed forbids Alliance Eligibility Marker rewarded +(18,33843,63792,0,8,0,13686,0,0,1,'Forbidden rewarded quest for spellclick'), +-- Sunreaver Hawkstrider requires The Argent Tournament rewarded +(18,33842,63791,0,8,0,13668,0,0,0,'Required quest rewarded for spellclick'), +-- Sunreaver Hawkstrider forbids Horde Eligibility Marker rewarded +(18,33842,63791,0,8,0,13687,0,0,1,'Forbidden rewarded quest for spellclick'), +-- Misc +(18,26421,47575,0,8,0,12092,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26421,47575,0,8,0,12096,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26421,47575,1,9,0,12092,0,0,0,'Required quest active for spellclick'), +(18,26421,47575,2,9,0,12096,0,0,0,'Required quest active for spellclick'), +(18,26477,47096,0,8,0,11999,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26477,47096,0,8,0,12000,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26477,61286,0,8,0,11999,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26477,61286,0,8,0,12000,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26477,61832,0,8,0,11999,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26477,61832,0,8,0,12000,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26477,61286,1,9,0,11999,0,0,0,'Required quest active for spellclick'), +(18,26477,61286,2,9,0,12000,0,0,0,'Required quest active for spellclick'), +(18,26477,47096,1,9,0,11999,0,0,0,'Required quest active for spellclick'), +(18,26477,47096,2,9,0,12000,0,0,0,'Required quest active for spellclick'), +(18,26477,61832,1,9,0,11999,0,0,0,'Required quest active for spellclick'), +(18,26477,61832,2,9,0,12000,0,0,0,'Required quest active for spellclick'), +(18,28161,39996,0,8,0,12532,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28161,39996,0,8,0,12702,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28161,39996,1,9,0,12532,0,0,0,'Required quest active for spellclick'), +(18,28161,39996,2,9,0,12702,0,0,0,'Required quest active for spellclick'), +(18,28161,51037,0,8,0,12532,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28161,51037,0,8,0,12702,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28161,51037,1,9,0,12532,0,0,0,'Required quest active for spellclick'), +(18,28161,51037,2,9,0,12702,0,0,0,'Required quest active for spellclick'), +(18,28161,51961,0,8,0,12532,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28161,51961,0,8,0,12702,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28161,51961,1,9,0,12532,0,0,0,'Required quest active for spellclick'), +(18,28161,51961,2,9,0,12702,0,0,0,'Required quest active for spellclick'), +(18,29856,55363,0,8,0,12629,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,29856,55363,0,8,0,12643,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,29856,55363,1,9,0,12629,0,0,0,'Required quest active for spellclick'), +(18,29856,55363,2,9,0,12643,0,0,0,'Required quest active for spellclick'), +(18,32788,57539,1,8,0,13075,0,0,0,'Required quest rewarded for spellclick'), +(18,32788,57539,2,9,0,13075,0,0,0,'Required quest active for spellclick'), +(18,32790,57654,1,8,0,13073,0,0,0,'Required quest rewarded for spellclick'), +(18,32790,57654,2,9,0,13073,0,0,0,'Required quest active for spellclick'); + +-- Remove duplicate entries in npc_spellclick_spells (leave 1) +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN(34125,26421,26477,28161, +31157,33790,33791,33792,33793,33794,33795,33796,33798,33799,33800,34944,29856,30564,29414,31269); +INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`, `user_type`) VALUES +(26477,47096,2,0), +(26477,61286,2,0), +(26477,61832,0,0), +(29414,18277,1,0), +(29856,55363,2,0), +(31269,46598,1,0), +(33794,62782,1,0), +(28161,51037,2,0), +(28161,39996,1,0), +(30564,57401,1,0), +(34125,63215,1,0), +(34944,68458,1,0), +(33790,62781,1,0), +(33793,62780,1,0), +(33795,62779,1,0), +(33800,62774,1,0), +(33798,62787,1,0), +(31157,46598,1,0), +(26421,47575,1,0), +(28161,51961,1,0), +(33791,62786,1,0), +(33792,62785,1,0), +(33796,62784,1,0), +(33799,62783,1,0); + +-- If this query fails, fix your custom content +ALTER TABLE `npc_spellclick_spells` ADD PRIMARY KEY(`npc_entry`,`spell_id`); \ No newline at end of file From e3e958e293b7b7b27b187dfd9d417897c408f19d Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Thu, 1 Mar 2012 00:10:16 +0100 Subject: [PATCH 0077/1149] DB/Conditions: Proper conditions for The Scarlet Harvest Closes #5422 --- sql/updates/world/2012_02_29_01_world_conditions.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/2012_02_29_01_world_conditions.sql diff --git a/sql/updates/world/2012_02_29_01_world_conditions.sql b/sql/updates/world/2012_02_29_01_world_conditions.sql new file mode 100644 index 00000000000..bae8baf51a9 --- /dev/null +++ b/sql/updates/world/2012_02_29_01_world_conditions.sql @@ -0,0 +1,5 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceGroup`=29488 AND `SourceEntry`=54568; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`, +`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`Comment`) VALUES +(18,29488,54568,15,8,0,12670,0,0,0,'Required quest rewarded for spellclick'), +(18,29488,54568,15,9,0,12670,0,0,0,'Required quest active for spellclick'); From b9b8f27e455ec91aaf842e2ebdfc972f0b230ccc Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Thu, 1 Mar 2012 00:42:18 +0100 Subject: [PATCH 0078/1149] DB/Conditions: *Proper* conditions for The Scarlet Harvest. Saving the file before committing works. --- sql/updates/world/2012_02_29_02_world_conditions.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/2012_02_29_02_world_conditions.sql diff --git a/sql/updates/world/2012_02_29_02_world_conditions.sql b/sql/updates/world/2012_02_29_02_world_conditions.sql new file mode 100644 index 00000000000..a28e6d6424f --- /dev/null +++ b/sql/updates/world/2012_02_29_02_world_conditions.sql @@ -0,0 +1,5 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceGroup`=29488 AND `SourceEntry`=54568; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`, +`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`Comment`) VALUES +(18,29488,54568,1,8,0,12670,0,0,0,'Required quest rewarded for spellclick'), +(18,29488,54568,2,9,0,12670,0,0,0,'Required quest active for spellclick'); From 8692eee01434f3872a72d2f58cb63d0b270eaabd Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 29 Feb 2012 21:15:02 -0330 Subject: [PATCH 0079/1149] DB/Creature_Text: Convert script_texts to creature_text for boss Loken, Halls of Lightning & Added sound. --- .../2012_02_29_03_world_creature_text.sql | 18 +++++++++ .../Ulduar/HallsOfLightning/boss_loken.cpp | 40 +++++++++---------- 2 files changed, 36 insertions(+), 22 deletions(-) create mode 100644 sql/updates/world/2012_02_29_03_world_creature_text.sql diff --git a/sql/updates/world/2012_02_29_03_world_creature_text.sql b/sql/updates/world/2012_02_29_03_world_creature_text.sql new file mode 100644 index 00000000000..2e1d3d77dde --- /dev/null +++ b/sql/updates/world/2012_02_29_03_world_creature_text.sql @@ -0,0 +1,18 @@ +-- NPC talk text insert from sniff +DELETE FROM `script_texts` WHERE `npc_entry`=28923; +DELETE FROM `creature_text` WHERE `entry`=28923; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(28923,0,0, 'I have witnessed the rise and fall of empires... the birth and extinction of entire species... Over countless millennia the foolishness of mortals has remained the only constant. Your presence here confirms this.',14,0,100,0,0,14160, 'Loken'), +(28923,1,0, 'My master has shown me the future, and you have no place in it. Azeroth will be reborn in darkness. Yogg-Saron shall be released! The Pantheon shall fall!',14,0,100,0,0,14161, 'Loken'), +(28923,2,0, 'What hope is there for you? None!',14,0,100,0,0,14162, 'Loken'), +(28923,3,0, 'You cannot hide from fate!',14,0,100,0,0,14163, 'Loken'), +(28923,3,1, 'Come closer. I will make it quick.',14,0,100,0,0,14164, 'Loken'), +(28923,3,2, 'Your flesh cannot hold out for long.',14,0,100,0,0,14165, 'Loken'), +(28923,4,0, 'Only mortal...',14,0,100,0,0,14166, 'Loken'), +(28923,4,1, 'I... am... FOREVER!',14,0,100,0,0,14167, 'Loken'), +(28923,4,2, 'What little time you had, you wasted!',14,0,100,0,0,14168, 'Loken'), +(28923,5,0, 'You stare blindly into the abyss!',14,0,100,0,0,14169, 'Loken'), +(28923,6,0, 'Your ignorance is profound. Can you not see where this path leads?',14,0,100,0,0,14170, 'Loken'), +(28923,7,0, 'You cross the precipice of oblivion!',14,0,100,0,0,14171, 'Loken'), +(28923,8,0, 'My death... heralds the end of this world.',14,0,100,0,0,14172, 'Loken'), +(28923,9,0, '%s begins to cast Lightning Nova!',41,0,100,0,0,0, 'Loken'); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp index 171215c605a..e4f2bb5ce01 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp @@ -30,20 +30,16 @@ enum eEnums { ACHIEV_TIMELY_DEATH_START_EVENT = 20384, - SAY_AGGRO = -1602018, - SAY_INTRO_1 = -1602019, - SAY_INTRO_2 = -1602020, - SAY_SLAY_1 = -1602021, - SAY_SLAY_2 = -1602022, - SAY_SLAY_3 = -1602023, - SAY_DEATH = -1602024, - SAY_NOVA_1 = -1602025, - SAY_NOVA_2 = -1602026, - SAY_NOVA_3 = -1602027, - SAY_75HEALTH = -1602028, - SAY_50HEALTH = -1602029, - SAY_25HEALTH = -1602030, - EMOTE_NOVA = -1602031, + SAY_INTRO_1 = 0, + SAY_INTRO_2 = 1, + SAY_AGGRO = 2, + SAY_NOVA = 3, + SAY_SLAY = 4, + SAY_75HEALTH = 5, + SAY_50HEALTH = 6, + SAY_25HEALTH = 7, + SAY_DEATH = 8, + EMOTE_NOVA = 9, SPELL_ARC_LIGHTNING = 52921, SPELL_LIGHTNING_NOVA_N = 52960, @@ -106,7 +102,7 @@ public: void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); if (m_instance) { @@ -117,7 +113,7 @@ public: void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); if (m_instance) m_instance->SetData(TYPE_LOKEN, DONE); @@ -125,7 +121,7 @@ public: void KilledUnit(Unit* /*victim*/) { - DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me); + Talk(SAY_SLAY); } void UpdateAI(const uint32 uiDiff) @@ -190,8 +186,8 @@ public: if (m_uiLightningNova_Timer <= uiDiff) { - DoScriptText(RAND(SAY_NOVA_1, SAY_NOVA_2, SAY_NOVA_3), me); - DoScriptText(EMOTE_NOVA, me); + Talk(SAY_NOVA); + Talk(EMOTE_NOVA); DoCast(me, SPELL_LIGHTNING_NOVA_N); m_bIsAura = false; @@ -206,9 +202,9 @@ public: { switch (m_uiHealthAmountModifier) { - case 1: DoScriptText(SAY_75HEALTH, me); break; - case 2: DoScriptText(SAY_50HEALTH, me); break; - case 3: DoScriptText(SAY_25HEALTH, me); break; + case 1: Talk(SAY_75HEALTH); break; + case 2: Talk(SAY_50HEALTH); break; + case 3: Talk(SAY_25HEALTH); break; } ++m_uiHealthAmountModifier; From 67e6f9afabe10eadd4b4212cc6d536ed8f7cf381 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 29 Feb 2012 21:35:59 -0330 Subject: [PATCH 0080/1149] DB/Creature_Text: Convert script_texts to creature_text for boss Ionar, Halls of Lightning. --- .../2012_02_29_04_world_creature_text.sql | 11 +++++++++++ .../Ulduar/HallsOfLightning/boss_ionar.cpp | 19 ++++++++----------- 2 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 sql/updates/world/2012_02_29_04_world_creature_text.sql diff --git a/sql/updates/world/2012_02_29_04_world_creature_text.sql b/sql/updates/world/2012_02_29_04_world_creature_text.sql new file mode 100644 index 00000000000..d8b7c2c048a --- /dev/null +++ b/sql/updates/world/2012_02_29_04_world_creature_text.sql @@ -0,0 +1,11 @@ +-- NPC talk text insert from sniff +DELETE FROM `script_texts` WHERE `npc_entry`=28546; +DELETE FROM `creature_text` WHERE `entry`=28546; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(28546,0,0, 'You wish to confront the master? You must first weather the storm!',14,0,100,0,0,14453, 'Ionar'), +(28546,1,0, 'The slightest spark shall be your undoing.',14,0,100,0,0,14454, 'Ionar'), +(28546,1,1, 'No one is safe!',14,0,100,0,0,14455, 'Ionar'), +(28546,2,0, 'Shocking ... I know!',14,0,100,0,0,14456, 'Ionar'), +(28546,2,1, 'You atempt the unpossible.',14,0,100,0,0,14457, 'Ionar'), +(28546,2,2, 'Your spark of light is ... extinguish.',14,0,100,0,0,14458, 'Ionar'), +(28546,3,0, 'Master... you have guests.',14,0,100,0,0,14459, 'Ionar'); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp index 016c4d27cfa..abdf5ecb1e1 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp @@ -41,13 +41,10 @@ enum Spells enum Yells { - SAY_AGGRO = -1602011, - SAY_SLAY_1 = -1602012, - SAY_SLAY_2 = -1602013, - SAY_SLAY_3 = -1602014, - SAY_DEATH = -1602015, - SAY_SPLIT_1 = -1602016, - SAY_SPLIT_2 = -1602017 + SAY_AGGRO = 0, + SAY_SPLIT = 1, + SAY_SLAY = 2, + SAY_DEATH = 3 }; enum Creatures @@ -122,7 +119,7 @@ public: void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); if (instance) instance->SetData(TYPE_IONAR, IN_PROGRESS); @@ -130,7 +127,7 @@ public: void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); lSparkList.DespawnAll(); @@ -140,7 +137,7 @@ public: void KilledUnit(Unit* /*victim*/) { - DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me); + Talk(SAY_SLAY); } void SpellHit(Unit* /*caster*/, const SpellInfo* spell) @@ -278,7 +275,7 @@ public: { bHasDispersed = true; - DoScriptText(RAND(SAY_SPLIT_1, SAY_SPLIT_2), me); + Talk(SAY_SPLIT); if (me->IsNonMeleeSpellCasted(false)) me->InterruptNonMeleeSpells(false); From c531cbc695b4c3ae5fe2716e0d237649ebecc3ce Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 29 Feb 2012 21:56:22 -0330 Subject: [PATCH 0081/1149] DB/Creature_Text: Convert script_texts to creature_text for boss Volkhan, Halls of Lightning. --- .../2012_02_29_05_world_creature_text.sql | 15 +++++++++ .../Ulduar/HallsOfLightning/boss_volkhan.cpp | 32 ++++++++----------- 2 files changed, 29 insertions(+), 18 deletions(-) create mode 100644 sql/updates/world/2012_02_29_05_world_creature_text.sql diff --git a/sql/updates/world/2012_02_29_05_world_creature_text.sql b/sql/updates/world/2012_02_29_05_world_creature_text.sql new file mode 100644 index 00000000000..332fecf6326 --- /dev/null +++ b/sql/updates/world/2012_02_29_05_world_creature_text.sql @@ -0,0 +1,15 @@ +-- NPC talk text insert from sniff +DELETE FROM `script_texts` WHERE `npc_entry`=28587; +DELETE FROM `creature_text` WHERE `entry`=28587; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(28587,0,0, 'It is you who have destroyed my children? You... shall... pay!',14,0,100,0,0,13960, 'Volkhan'), +(28587,1,0, 'Life from lifelessness... death for you.',14,0,100,0,0,13961, 'Volkhan'), +(28587,1,1, 'Nothing is wasted in the process. You will see....',14,0,100,0,0,13962, 'Volkhan'), +(28587,2,0, 'I will crush you beneath my boots!',14,0,100,0,0,13963, 'Volkhan'), +(28587,2,1, 'All my work... undone!',14,0,100,0,0,13964, 'Volkhan'), +(28587,3,0, 'The armies of iron will conquer all!',14,0,100,0,0,13965, 'Volkhan'), +(28587,3,1, 'Ha, pathetic!',14,0,100,0,0,13966, 'Volkhan'), +(28587,3,2, 'You have cost me too much work!',14,0,100,0,0,13967, 'Volkhan'), +(28587,4,0, 'The master was right... to be concerned.',14,0,100,0,0,13968, 'Volkhan'), +(28587,5,0, '%s runs to his anvil!',41,0,100,0,0,0, 'Volkhan'), +(28587,6,0, '%s prepares to shatter his Brittle Golems!',41,0,100,0,0,0, 'Volkhan'); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp index 1fc724c8b6c..83604ed4153 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp @@ -28,17 +28,13 @@ EndScriptData */ enum eEnums { - SAY_AGGRO = -1602032, - SAY_SLAY_1 = -1602033, - SAY_SLAY_2 = -1602034, - SAY_SLAY_3 = -1602035, - SAY_DEATH = -1602036, - SAY_STOMP_1 = -1602037, - SAY_STOMP_2 = -1602038, - SAY_FORGE_1 = -1602039, - SAY_FORGE_2 = -1602040, - EMOTE_TO_ANVIL = -1602041, - EMOTE_SHATTER = -1602042, + SAY_AGGRO = 0, + SAY_FORGE = 1, + SAY_STOMP = 2, + SAY_SLAY = 3, + SAY_DEATH = 4, + EMOTE_TO_ANVIL = 5, + EMOTE_SHATTER = 6, SPELL_HEAT_N = 52387, SPELL_HEAT_H = 59528, @@ -127,7 +123,7 @@ public: void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); if (m_instance) m_instance->SetData(TYPE_VOLKHAN, IN_PROGRESS); @@ -148,7 +144,7 @@ public: void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); DespawnGolem(); if (m_instance) @@ -172,7 +168,7 @@ public: void KilledUnit(Unit* /*victim*/) { - DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me); + Talk(SAY_SLAY); } void DespawnGolem() @@ -263,11 +259,11 @@ public: if (m_uiShatteringStomp_Timer <= uiDiff) { // Should he stomp even if he has no brittle golem to shatter? - DoScriptText(RAND(SAY_STOMP_1, SAY_STOMP_2), me); + Talk(SAY_STOMP); DoCast(me, SPELL_SHATTERING_STOMP_N); - DoScriptText(EMOTE_SHATTER, me); + Talk(EMOTE_SHATTER); m_uiShatteringStomp_Timer = 30000; m_bCanShatterGolem = true; @@ -297,7 +293,7 @@ public: if (me->IsNonMeleeSpellCasted(false)) me->InterruptNonMeleeSpells(false); - DoScriptText(RAND(SAY_FORGE_1, SAY_FORGE_2), me); + Talk(SAY_FORGE); m_bHasTemper = true; @@ -308,7 +304,7 @@ public: { case 1: // 1 - Start run to Anvil - DoScriptText(EMOTE_TO_ANVIL, me); + Talk(EMOTE_TO_ANVIL); me->GetMotionMaster()->MoveTargetedHome(); m_uiSummonPhase = 2; // Set Next Phase break; From b27bd661f00d364c055fef826a172e926f3e53df Mon Sep 17 00:00:00 2001 From: kaelima Date: Thu, 1 Mar 2012 12:12:35 +0100 Subject: [PATCH 0082/1149] Core/Object: Correct the updateflag order in SMSG_UPDATE_OBJECT. --- src/server/game/Entities/Object/Object.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 92534113609..2a2b78f4630 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -375,6 +375,12 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const } } + // 0x8 + if (flags & UPDATEFLAG_UNKNOWN) + { + *data << uint32(0); + } + // 0x10 if (flags & UPDATEFLAG_LOWGUID) { @@ -405,12 +411,6 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const } } - // 0x8 - if (flags & UPDATEFLAG_UNKNOWN) - { - *data << uint32(0); - } - // 0x4 if (flags & UPDATEFLAG_HAS_TARGET) { From b939ea59514489d6fc5e92eb47aa0b5d864b9695 Mon Sep 17 00:00:00 2001 From: kaelima Date: Thu, 1 Mar 2012 12:16:06 +0100 Subject: [PATCH 0083/1149] Script/Commands: Some safer code in wp modify --- src/server/scripts/Commands/cs_wp.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index 8f5e862555c..9249cb3fdbc 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -223,6 +223,7 @@ public: sWaypointMgr->ReloadPath(id); return true; } + static bool HandleWpUnLoadCommand(ChatHandler* handler, const char* /*args*/) { @@ -605,7 +606,7 @@ public: return false; } - if (show == "del" && target) + if (show == "del") { handler->PSendSysMessage("|cff00ff00DEBUG: wp modify del, PathID: |r|cff00ffff%u|r", pathid); @@ -615,9 +616,12 @@ public: if (wpGuid != 0) { wpCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)); - wpCreature->CombatStop(); - wpCreature->DeleteFromDB(); - wpCreature->AddObjectToRemoveList(); + if (wpCreature) + { + wpCreature->CombatStop(); + wpCreature->DeleteFromDB(); + wpCreature->AddObjectToRemoveList(); + } } PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_WAYPOINT_DATA); @@ -638,7 +642,7 @@ public: return true; } // del - if (show == "move" && target) + if (show == "move") { handler->PSendSysMessage("|cff00ff00DEBUG: wp move, PathID: |r|cff00ffff%u|r", pathid); @@ -652,16 +656,20 @@ public: // Respawn the owner of the waypoints if (wpGuid != 0) { - wpCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)); - wpCreature->CombatStop(); - wpCreature->DeleteFromDB(); - wpCreature->AddObjectToRemoveList(); + wpCreature = map->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)); + if (wpCreature) + { + wpCreature->CombatStop(); + wpCreature->DeleteFromDB(); + wpCreature->AddObjectToRemoveList(); + } // re-create Creature* wpCreature2 = new Creature; if (!wpCreature2->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0, 0, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation())) { handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT); delete wpCreature2; + wpCreature2 = NULL; return false; } @@ -672,6 +680,7 @@ public: { handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT); delete wpCreature2; + wpCreature2 = NULL; return false; } //sMapMgr->GetMap(npcCreature->GetMapId())->Add(wpCreature2); From a36a0a77ef75e66933ac5b8802a9ec7906acfd0b Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Thu, 1 Mar 2012 14:22:17 +0100 Subject: [PATCH 0084/1149] Core/Player: Quests with status QUEST_STATUS_NONE(0) shouldn't be loaded into player's queststatus storage. These should be removed since they are remnants from the old queststatus storage system. --- ...2012_03_01_00_characters_character_queststatus.sql | 1 + src/server/game/Entities/Player/Player.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 sql/updates/characters/2012_03_01_00_characters_character_queststatus.sql diff --git a/sql/updates/characters/2012_03_01_00_characters_character_queststatus.sql b/sql/updates/characters/2012_03_01_00_characters_character_queststatus.sql new file mode 100644 index 00000000000..da3a0f786b8 --- /dev/null +++ b/sql/updates/characters/2012_03_01_00_characters_character_queststatus.sql @@ -0,0 +1 @@ +DELETE FROM `character_queststatus` WHERE `status`=0; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 095f9d49361..963cfc308d8 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -17781,12 +17781,19 @@ void Player::_LoadQuestStatus(PreparedQueryResult result) QuestStatusData& questStatusData = m_QuestStatus[quest_id]; uint8 qstatus = fields[1].GetUInt8(); - if (qstatus < MAX_QUEST_STATUS) + if (qstatus < MAX_QUEST_STATUS && qstatus > QUEST_STATUS_NONE) questStatusData.Status = QuestStatus(qstatus); + else if (qstatus == QUEST_STATUS_NONE) + { + sLog->outError("Player %s (GUID: %u) has QUEST_STATUS_NONE for quest %u and should be removed from character_queststatus.", + GetName(), GetGUIDLow(), quest_id); + continue; + } else { questStatusData.Status = QUEST_STATUS_INCOMPLETE; - sLog->outError("Player %s have invalid quest %d status (%u), replaced by QUEST_STATUS_INCOMPLETE(3).", GetName(), quest_id, qstatus); + sLog->outError("Player %s (GUID: %u) has invalid quest %d status (%u), replaced by QUEST_STATUS_INCOMPLETE(3).", + GetName(), GetGUIDLow(), quest_id, qstatus); } questStatusData.Explored = (fields[2].GetUInt8() > 0); From e2c20cca72555dbac2fdfe72ee0314d1c494d8ff Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Thu, 1 Mar 2012 14:30:19 +0100 Subject: [PATCH 0085/1149] Core/Conditions: Small optimization in ConditonMgr, as well as proper rules for spellclick conditions in Clean(), and finally some documentation added on how to add new source types. --- src/server/game/Conditions/ConditionMgr.cpp | 51 +++++++-------------- src/server/game/Conditions/ConditionMgr.h | 27 +++++++++++ 2 files changed, 43 insertions(+), 35 deletions(-) diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 0f1895bf1ed..755b9299352 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -515,7 +515,9 @@ bool ConditionMgr::IsObjectMeetToConditionList(ConditionSourceInfo& sourceInfo, sLog->outDebug(LOG_FILTER_CONDITIONSYS, "ConditionMgr::IsPlayerMeetToConditionList condType: %u val1: %u", (*i)->ConditionType, (*i)->ConditionValue1); if ((*i)->isLoaded()) { + //! Find ElseGroup in ElseGroupStore std::map::const_iterator itr = ElseGroupStore.find((*i)->ElseGroup); + //! If not found, add an entry in the store and set to true (placeholder) if (itr == ElseGroupStore.end()) ElseGroupStore[(*i)->ElseGroup] = true; else if (!(*itr).second) @@ -854,18 +856,6 @@ void ConditionMgr::LoadConditions(bool isReload) break; case CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT: { - //if no list for npc create one - if (SpellClickEventConditionStore.find(cond->SourceGroup) == SpellClickEventConditionStore.end()) - { - ConditionTypeContainer cmap; - SpellClickEventConditionStore[cond->SourceGroup] = cmap; - } - //if no list for spellclick spell create one - if (SpellClickEventConditionStore[cond->SourceGroup].find(cond->SourceEntry) == SpellClickEventConditionStore[cond->SourceGroup].end()) - { - ConditionList clist; - SpellClickEventConditionStore[cond->SourceGroup][cond->SourceEntry] = clist; - } SpellClickEventConditionStore[cond->SourceGroup][cond->SourceEntry].push_back(cond); valid = true; ++count; @@ -877,18 +867,6 @@ void ConditionMgr::LoadConditions(bool isReload) break; case CONDITION_SOURCE_TYPE_VEHICLE_SPELL: { - //if no list for vehicle create one - if (VehicleSpellConditionStore.find(cond->SourceGroup) == VehicleSpellConditionStore.end()) - { - ConditionTypeContainer cmap; - VehicleSpellConditionStore[cond->SourceGroup] = cmap; - } - //if no list for vehicle's spell create one - if (VehicleSpellConditionStore[cond->SourceGroup].find(cond->SourceEntry) == VehicleSpellConditionStore[cond->SourceGroup].end()) - { - ConditionList clist; - VehicleSpellConditionStore[cond->SourceGroup][cond->SourceEntry] = clist; - } VehicleSpellConditionStore[cond->SourceGroup][cond->SourceEntry].push_back(cond); valid = true; ++count; @@ -896,18 +874,8 @@ void ConditionMgr::LoadConditions(bool isReload) } case CONDITION_SOURCE_TYPE_SMART_EVENT: { - // If the entry does not exist, create a new list + //! TODO: PAIR_32 ? std::pair key = std::make_pair(cond->SourceEntry, cond->SourceId); - if (SmartEventConditionStore.find(key) == SmartEventConditionStore.end()) - { - ConditionTypeContainer cmap; - SmartEventConditionStore[key] = cmap; - } - if (SmartEventConditionStore[key].find(cond->SourceGroup) == SmartEventConditionStore[key].end()) - { - ConditionList clist; - SmartEventConditionStore[key][cond->SourceGroup] = clist; - } SmartEventConditionStore[key][cond->SourceGroup].push_back(cond); valid = true; ++count; @@ -1929,6 +1897,19 @@ void ConditionMgr::Clean() SmartEventConditionStore.clear(); + for (CreatureSpellConditionContainer::iterator itr = SpellClickEventConditionStore.begin(); itr != SpellClickEventConditionStore.end(); ++itr) + { + for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it) + { + for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i) + delete *i; + it->second.clear(); + } + itr->second.clear(); + } + + SpellClickEventConditionStore.clear(); + // this is a BIG hack, feel free to fix it if you can figure out the ConditionMgr ;) for (std::list::const_iterator itr = AllocatedMemoryStore.begin(); itr != AllocatedMemoryStore.end(); ++itr) delete *itr; diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 5a5e2dd1c2e..ec6d6dd8453 100755 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -72,6 +72,33 @@ enum ConditionTypes CONDITION_MAX = 39 // MAX }; +/*! Documentation on implementing a new ConditionSourceType: + Step 1: Check for the lowest free ID. Look for CONDITION_SOURCE_TYPE_UNUSED_XX in the enum. + Then define the new source type. + + Step 2: Determine and map the parameters for the new condition type. + + Step 3: Add a case block to ConditionMgr::isSourceTypeValid with the new condition type + and validate the parameters. + + Step 4: If your condition can be grouped (determined in step 2), add a rule for it in + ConditionMgr::CanHaveSourceGroupSet, following the example of the existing types. + + Step 5: Define the maximum available condition targets in ConditionMgr::GetMaxAvailableConditionTargets. + + The following steps only apply if your condition can be grouped: + + Step 6: Determine how you are going to store your conditions. You need to add a new storage container + for it in ConditionMgr class, along with a function like: + ConditionList GetConditionsForXXXYourNewSourceTypeXXX(parameters...) + + The above function should be placed in upper level (practical) code that actually + checks the conditions. + + Step 7: Implement loading for your source type in ConditionMgr::LoadConditions. + + Step 8: Implement memory cleaning for your source type in ConditionMgr::Clean. +*/ enum ConditionSourceType { CONDITION_SOURCE_TYPE_NONE = 0, From 844e2ca857bc130d5f86d673b233a2833301fc22 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Thu, 1 Mar 2012 14:41:58 +0100 Subject: [PATCH 0086/1149] DB/Conditions: Really fix the Scarlet Harvest. Quest automatically had STATUS_COMPLETE, so condition needed to be adjusted --- sql/updates/world/2012_03_01_00_world_conditions.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/2012_03_01_00_world_conditions.sql diff --git a/sql/updates/world/2012_03_01_00_world_conditions.sql b/sql/updates/world/2012_03_01_00_world_conditions.sql new file mode 100644 index 00000000000..794a5ce1210 --- /dev/null +++ b/sql/updates/world/2012_03_01_00_world_conditions.sql @@ -0,0 +1,5 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceGroup`=29488 AND `SourceEntry`=54568; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`, +`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`Comment`) VALUES +(18,29488,54568,1,8,0,12670,0,0,0,'Required quest rewarded for spellclick'), +(18,29488,54568,2,28,0,12670,0,0,0,'Required quest completed for spellclick'); From 6bb689b494f88b1dc6e435ca91e607837612f87c Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Thu, 1 Mar 2012 17:06:41 +0100 Subject: [PATCH 0087/1149] Core/Units: Properly update passenger position if vehicle uses waypoint movement. Fixes e.g. Icefang path --- src/server/game/Entities/Unit/Unit.cpp | 12 ++++++++---- src/server/game/Entities/Unit/Unit.h | 1 + src/server/game/Entities/Vehicle/Vehicle.cpp | 3 +-- src/server/game/Maps/Map.cpp | 5 +++++ 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 1e46ea7346d..138eda962aa 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17171,14 +17171,18 @@ bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool tel GetMap()->CreatureRelocation(ToCreature(), x, y, z, orientation); } else if (turn) - SetOrientation(orientation); - - if ((relocated || turn) && IsVehicle()) - GetVehicleKit()->RelocatePassengers(x, y, z, orientation); + UpdateOrientation(orientation); return (relocated || turn); } +void Unit::UpdateOrientation(float orientation) +{ + SetOrientation(orientation); + if (IsVehicle()) + GetVehicleKit()->RelocatePassengers(GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); +} + void Unit::SendThreatListUpdate() { if (!getThreatManager().isThreatListEmpty()) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 0fe5f3d8ca3..b07f2ae1c16 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1614,6 +1614,7 @@ class Unit : public WorldObject virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport = false); // returns true if unit's position really changed bool UpdatePosition(const Position &pos, bool teleport = false) { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); } + void UpdateOrientation(float orientation); void KnockbackFrom(float x, float y, float speedXY, float speedZ); void JumpTo(float speedXY, float speedZ, bool forward = true); diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index 6693af5c91f..2f552eddb9f 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -431,6 +431,7 @@ void Vehicle::RemovePassenger(Unit* unit) sScriptMgr->OnRemovePassenger(this, unit); } +//! Must be called after m_base::Relocate void Vehicle::RelocatePassengers(float x, float y, float z, float ang) { ASSERT(_me->GetMap()); @@ -440,8 +441,6 @@ void Vehicle::RelocatePassengers(float x, float y, float z, float ang) if (Unit* passenger = ObjectAccessor::GetUnit(*GetBase(), itr->second.Passenger)) { ASSERT(passenger->IsInWorld()); - ASSERT(passenger->IsOnVehicle(GetBase())); - ASSERT(GetSeatForPassenger(passenger)); float px = x + passenger->m_movementInfo.t_pos.m_positionX; float py = y + passenger->m_movementInfo.t_pos.m_positionY; diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 31dc622a724..00b52bf746b 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -32,6 +32,7 @@ #include "Group.h" #include "LFGMgr.h" #include "DynamicTree.h" +#include "Vehicle.h" union u_map_magic { @@ -702,6 +703,8 @@ void Map::PlayerRelocation(Player* player, float x, float y, float z, float orie Cell new_cell(x, y); player->Relocate(x, y, z, orientation); + if (player->IsVehicle()) + player->GetVehicleKit()->RelocatePassengers(x, y, z, orientation); if (old_cell.DiffGrid(new_cell) || old_cell.DiffCell(new_cell)) { @@ -740,6 +743,8 @@ void Map::CreatureRelocation(Creature* creature, float x, float y, float z, floa else { creature->Relocate(x, y, z, ang); + if (creature->IsVehicle()) + creature->GetVehicleKit()->RelocatePassengers(x, y, z, ang); creature->UpdateObjectVisibility(false); RemoveCreatureFromMoveList(creature); } From 4fad1f5b8ffb4eeaf2333c1be3a04b13b85cae49 Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 29 Feb 2012 11:17:34 -0500 Subject: [PATCH 0088/1149] Core/Battlegrounds: cleanup and fix flag issue in previous commit correctly --- .../Battlegrounds/Zones/BattlegroundWS.cpp | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index f5ee788b68a..034de38fd9c 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -435,10 +435,10 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target int32 message_id = 0; ChatMsg type = CHAT_MSG_BG_SYSTEM_NEUTRAL; - bool flagHandled = false; + //alliance flag picked up from base - if (Source->GetTeam() == HORDE && this->GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_BASE - && this->BgObjects[BG_WS_OBJECT_A_FLAG] == target_obj->GetGUID()) + if (Source->GetTeam() == HORDE && GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_BASE + && BgObjects[BG_WS_OBJECT_A_FLAG] == target_obj->GetGUID()) { message_id = LANG_BG_WS_PICKEDUP_AF; type = CHAT_MSG_BG_SYSTEM_HORDE; @@ -453,12 +453,11 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target Source->GetAchievementMgr().StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET, BG_WS_SPELL_SILVERWING_FLAG_PICKED); if (_flagState[1] == BG_WS_FLAG_STATE_ON_PLAYER) _bothFlagsKept = true; - flagHandled = true; } //horde flag picked up from base - if (Source->GetTeam() == ALLIANCE && this->GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_BASE - && this->BgObjects[BG_WS_OBJECT_H_FLAG] == target_obj->GetGUID() && !flagHandled) + if (Source->GetTeam() == ALLIANCE && GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_BASE + && BgObjects[BG_WS_OBJECT_H_FLAG] == target_obj->GetGUID()) { message_id = LANG_BG_WS_PICKEDUP_HF; type = CHAT_MSG_BG_SYSTEM_ALLIANCE; @@ -473,11 +472,10 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target Source->GetAchievementMgr().StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET, BG_WS_SPELL_WARSONG_FLAG_PICKED); if (_flagState[0] == BG_WS_FLAG_STATE_ON_PLAYER) _bothFlagsKept = true; - flagHandled = true; } //Alliance flag on ground(not in base) (returned or picked up again from ground!) - if (GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10) && !flagHandled) + if (GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10) && BgObjects[BG_WS_OBJECT_A_FLAG] == target_obj->GetGUID()) { if (Source->GetTeam() == ALLIANCE) { @@ -489,7 +487,6 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target PlaySoundToAll(BG_WS_SOUND_FLAG_RETURNED); UpdatePlayerScore(Source, SCORE_FLAG_RETURNS, 1); _bothFlagsKept = false; - flagHandled = true; } else { @@ -506,14 +503,13 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target if (_flagDebuffState == 2) Source->CastSpell(Source, WS_SPELL_BRUTAL_ASSAULT, true); UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, 1); - flagHandled = true; } //called in HandleGameObjectUseOpcode: //target_obj->Delete(); } //Horde flag on ground(not in base) (returned or picked up again) - if (GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10) && !flagHandled) + if (GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10) && BgObjects[BG_WS_OBJECT_H_FLAG] == target_obj->GetGUID()) { if (Source->GetTeam() == HORDE) { @@ -525,7 +521,6 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target PlaySoundToAll(BG_WS_SOUND_FLAG_RETURNED); UpdatePlayerScore(Source, SCORE_FLAG_RETURNS, 1); _bothFlagsKept = false; - flagHandled = true; } else { @@ -542,7 +537,6 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target if (_flagDebuffState == 2) Source->CastSpell(Source, WS_SPELL_BRUTAL_ASSAULT, true); UpdateWorldState(BG_WS_FLAG_UNK_HORDE, 1); - flagHandled = true; } //called in HandleGameObjectUseOpcode: //target_obj->Delete(); From 92af6ec647020c47b4897c403198b4c576a29ef3 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 1 Mar 2012 13:39:53 -0500 Subject: [PATCH 0089/1149] Core/Auras: fix stacking for auras that change phase. (thx to manuel) --- src/server/game/Spells/SpellInfo.cpp | 3 --- src/server/game/Spells/SpellInfo.h | 1 - 2 files changed, 4 deletions(-) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 626e0a3653e..5b0e453edc9 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1192,7 +1192,6 @@ bool SpellInfo::IsAuraExclusiveBySpecificWith(SpellInfo const* spellInfo) const SpellSpecificType spellSpec2 = spellInfo->GetSpellSpecific(); switch (spellSpec1) { - case SPELL_SPECIFIC_PHASE: case SPELL_SPECIFIC_TRACKER: case SPELL_SPECIFIC_WARLOCK_ARMOR: case SPELL_SPECIFIC_MAGE_ARMOR: @@ -1911,8 +1910,6 @@ SpellSpecificType SpellInfo::GetSpellSpecific() const case SPELL_AURA_TRACK_RESOURCES: case SPELL_AURA_TRACK_STEALTHED: return SPELL_SPECIFIC_TRACKER; - case SPELL_AURA_PHASE: - return SPELL_SPECIFIC_PHASE; } } } diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 9c33db7f708..b82f7dbd61d 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -166,7 +166,6 @@ enum SpellSpecificType SPELL_SPECIFIC_WARRIOR_ENRAGE = 26, SPELL_SPECIFIC_PRIEST_DIVINE_SPIRIT = 27, SPELL_SPECIFIC_HAND = 28, - SPELL_SPECIFIC_PHASE = 29, }; enum SpellCustomAttributes From 91e7dc8561e48650488f6b85628b85abbef2fd09 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 1 Mar 2012 17:42:49 -0330 Subject: [PATCH 0090/1149] DB/Creature_Text: Convert script_texts to creature_text for boss General Bjarngrim --- .../2012_03_01_01_world_creature_text.sql | 15 ++++++++ .../HallsOfLightning/boss_bjarngrim.cpp | 38 +++++++++---------- 2 files changed, 33 insertions(+), 20 deletions(-) create mode 100644 sql/updates/world/2012_03_01_01_world_creature_text.sql diff --git a/sql/updates/world/2012_03_01_01_world_creature_text.sql b/sql/updates/world/2012_03_01_01_world_creature_text.sql new file mode 100644 index 00000000000..dd4f6693654 --- /dev/null +++ b/sql/updates/world/2012_03_01_01_world_creature_text.sql @@ -0,0 +1,15 @@ +-- NPC talk text insert from sniff +DELETE FROM `script_texts` WHERE `npc_entry`=28586; +DELETE FROM `creature_text` WHERE `entry`=28586; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(28586,0,0, 'I am the greatest of my father''s sons! Your end has come!',14,0,100,0,0,14149, 'General Bjarngrim'), +(28586,1,0, 'Give me your worst!',14,0,100,0,0,14150, 'General Bjarngrim'), +(28586,2,0, 'Defend yourself, for all the good it will do!',14,0,100,0,0,14151, 'General Bjarngrim'), +(28586,3,0, 'GRAAAAAH! Behold the fury of iron and steel!',14,0,100,0,0,14152, 'General Bjarngrim'), +(28586,4,0, 'So ends your curse!',14,0,100,0,0,14153, 'General Bjarngrim'), +(28586,4,1, 'Flesh... is... weak!',14,0,100,0,0,14154, 'General Bjarngrim'), +(28586,4,2, '...',14,0,100,0,0,14155, 'General Bjarngrim'), +(28586,5,0, 'How can it be...? Flesh is not... stronger!',14,0,100,0,0,14156, 'General Bjarngrim'), +(28586,6,0, '%s switches to Defensive Stance!',41,0,100,0,0,0, 'General Bjarngrim'), +(28586,7,0, '%s switches to Battle Stance!',41,0,100,0,0,0, 'General Bjarngrim'), +(28586,8,0, '%s switches to Berserker Stance!',41,0,100,0,0,0, 'General Bjarngrim'); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp index c6f72890d1f..a025cd677bd 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp @@ -29,17 +29,15 @@ EndScriptData */ enum eEnums { //Yell - SAY_AGGRO = -1602000, - SAY_SLAY_1 = -1602001, - SAY_SLAY_2 = -1602002, - SAY_SLAY_3 = -1602003, - SAY_DEATH = -1602004, - SAY_BATTLE_STANCE = -1602005, - EMOTE_BATTLE_STANCE = -1602006, - SAY_BERSEKER_STANCE = -1602007, - EMOTE_BERSEKER_STANCE = -1602008, - SAY_DEFENSIVE_STANCE = -1602009, - EMOTE_DEFENSIVE_STANCE = -1602010, + SAY_AGGRO = 0, + SAY_DEFENSIVE_STANCE = 1, + SAY_BATTLE_STANCE = 2, + SAY_BERSEKER_STANCE = 3, + SAY_SLAY = 4, + SAY_DEATH = 5, + EMOTE_DEFENSIVE_STANCE = 6, + EMOTE_BATTLE_STANCE = 7, + EMOTE_BERSEKER_STANCE = 8, SPELL_DEFENSIVE_STANCE = 53790, //SPELL_DEFENSIVE_AURA = 41105, @@ -185,7 +183,7 @@ public: void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); //must get both lieutenants here and make sure they are with him me->CallForHelp(30.0f); @@ -196,12 +194,12 @@ public: void KilledUnit(Unit* /*victim*/) { - DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me); + Talk(SAY_SLAY), me); } void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); if (m_instance) m_instance->SetData(TYPE_BJARNGRIM, DONE); @@ -249,20 +247,20 @@ public: switch (m_uiStance) { case STANCE_DEFENSIVE: - DoScriptText(SAY_DEFENSIVE_STANCE, me); - DoScriptText(EMOTE_DEFENSIVE_STANCE, me); + Talk(SAY_DEFENSIVE_STANCE); + Talk(EMOTE_DEFENSIVE_STANCE); DoCast(me, SPELL_DEFENSIVE_STANCE); SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SHIELD, EQUIP_NO_CHANGE); break; case STANCE_BERSERKER: - DoScriptText(SAY_BERSEKER_STANCE, me); - DoScriptText(EMOTE_BERSEKER_STANCE, me); + Talk(SAY_BERSEKER_STANCE); + Talk(EMOTE_BERSEKER_STANCE); DoCast(me, SPELL_BERSEKER_STANCE); SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SWORD, EQUIP_NO_CHANGE); break; case STANCE_BATTLE: - DoScriptText(SAY_BATTLE_STANCE, me); - DoScriptText(EMOTE_BATTLE_STANCE, me); + Talk(SAY_BATTLE_STANCE); + Talk(EMOTE_BATTLE_STANCE); DoCast(me, SPELL_BATTLE_STANCE); SetEquipmentSlots(false, EQUIP_MACE, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); break; From 09f0a2c04fd5d01a4a2bbe1392750947b8911b5b Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 1 Mar 2012 22:26:05 +0100 Subject: [PATCH 0091/1149] Core/CreatureTextMgr: Added support for creature_text localization --- ...2_03_01_02_world_locales_creature_text.sql | 15 + .../game/AI/SmartScripts/SmartScript.cpp | 45 +- src/server/game/Texts/CreatureTextMgr.cpp | 413 ++++++++++-------- src/server/game/Texts/CreatureTextMgr.h | 168 ++++++- src/server/game/World/World.cpp | 3 + .../HallsOfLightning/boss_bjarngrim.cpp | 2 +- 6 files changed, 455 insertions(+), 191 deletions(-) create mode 100644 sql/updates/world/2012_03_01_02_world_locales_creature_text.sql diff --git a/sql/updates/world/2012_03_01_02_world_locales_creature_text.sql b/sql/updates/world/2012_03_01_02_world_locales_creature_text.sql new file mode 100644 index 00000000000..c44ca191835 --- /dev/null +++ b/sql/updates/world/2012_03_01_02_world_locales_creature_text.sql @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS `locales_creature_text`; +CREATE TABLE `locales_creature_text` ( + `entry` int(10) UNSIGNED NOT NULL, + `textGroup` tinyint(3) UNSIGNED NOT NULL, + `id` int(10) UNSIGNED NOT NULL, + `text_loc1` text, + `text_loc2` text, + `text_loc3` text, + `text_loc4` text, + `text_loc5` text, + `text_loc6` text, + `text_loc7` text, + `text_loc8` text, + PRIMARY KEY (`entry`,`textGroup`,`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 67d26ea06dd..0498cd1f07e 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -34,6 +34,46 @@ #include "Vehicle.h" #include "ScriptedGossip.h" +class TrinityStringTextBuilder +{ + public: + TrinityStringTextBuilder(WorldObject* obj, ChatMsg msgtype, int32 id, uint32 language, uint64 targetGUID) + : _source(obj), _msgType(msgtype), _textId(id), _language(language), _targetGUID(targetGUID) + { + } + + size_t operator()(WorldPacket* data, LocaleConstant locale) const + { + std::string text = sObjectMgr->GetTrinityString(_textId, locale); + char const* localizedName = _source->GetNameForLocaleIdx(locale); + + *data << uint8(_msgType); + *data << uint32(_language); + *data << uint64(_source->GetGUID()); + *data << uint32(1); // 2.1.0 + *data << uint32(strlen(localizedName)+1); + *data << localizedName; + size_t whisperGUIDpos = data->wpos(); + *data << uint64(_targetGUID); // Unit Target + if (_targetGUID && !IS_PLAYER_GUID(_targetGUID)) + { + *data << uint32(1); // target name length + *data << uint8(0); // target name + } + *data << uint32(text.length() + 1); + *data << text; + *data << uint8(0); // ChatTag + + return whisperGUIDpos; + } + + WorldObject* _source; + ChatMsg _msgType; + int32 _textId; + uint32 _language; + uint64 _targetGUID; +}; + SmartScript::SmartScript() { go = NULL; @@ -695,7 +735,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u me->DoFleeToGetAssistance(); if (e.action.flee.withEmote) - sCreatureTextMgr->SendChatString(me, sObjectMgr->GetTrinityStringForDBCLocale(LANG_FLEE), CHAT_MSG_MONSTER_EMOTE); + { + TrinityStringTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, LANG_FLEE, LANG_UNIVERSAL, 0); + sCreatureTextMgr->SendChatPacket(me, builder, CHAT_MSG_MONSTER_EMOTE); + } sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_FLEE_FOR_ASSIST: Creature %u DoFleeToGetAssistance", me->GetGUIDLow()); break; } diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index e5a12693aa7..f1088f54007 100755 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -17,8 +17,53 @@ #include "Common.h" #include "DatabaseEnv.h" -#include "CreatureTextMgr.h" #include "ObjectMgr.h" +#include "Cell.h" +#include "CellImpl.h" +#include "GridNotifiers.h" +#include "GridNotifiersImpl.h" +#include "CreatureTextMgr.h" + +class CreatureTextBuilder +{ + public: + CreatureTextBuilder(WorldObject* obj, ChatMsg msgtype, uint8 textGroup, uint32 id, uint32 language, uint64 targetGUID) + : _source(obj), _msgType(msgtype), _textGroup(textGroup), _textId(id), _language(language), _targetGUID(targetGUID) + { + } + + size_t operator()(WorldPacket* data, LocaleConstant locale) const + { + std::string text = sCreatureTextMgr->GetLocalizedChatString(_source->GetEntry(), _textGroup, _textId, locale); + char const* localizedName = _source->GetNameForLocaleIdx(locale); + + *data << uint8(_msgType); + *data << uint32(_language); + *data << uint64(_source->GetGUID()); + *data << uint32(1); // 2.1.0 + *data << uint32(strlen(localizedName)+1); + *data << localizedName; + size_t whisperGUIDpos = data->wpos(); + *data << uint64(_targetGUID); // Unit Target + if (_targetGUID && !IS_PLAYER_GUID(_targetGUID)) + { + *data << uint32(1); // target name length + *data << uint8(0); // target name + } + *data << uint32(text.length() + 1); + *data << text; + *data << uint8(0); // ChatTag + + return whisperGUIDpos; + } + + WorldObject* _source; + ChatMsg _msgType; + uint8 _textGroup; + uint32 _textId; + uint32 _language; + uint64 _targetGUID; +}; void CreatureTextMgr::LoadCreatureTexts() { @@ -83,17 +128,8 @@ void CreatureTextMgr::LoadCreatureTexts() } //entry not yet added, add empty TextHolder (list of groups) if (mTextMap.find(temp.entry) == mTextMap.end()) - { ++creatureCount; - CreatureTextHolder TextHolder; - mTextMap[temp.entry] = TextHolder; - } - //group not yet added, add empty TextGroup (list of texts) - if (mTextMap[temp.entry].find(temp.group) == mTextMap[temp.entry].end()) - { - CreatureTextGroup TextGroup; - mTextMap[temp.entry][temp.group] = TextGroup; - } + //add the text into our entry's group mTextMap[temp.entry][temp.group].push_back(temp); @@ -104,42 +140,76 @@ void CreatureTextMgr::LoadCreatureTexts() sLog->outString(); } +void CreatureTextMgr::LoadCreatureTextLocales() +{ + uint32 oldMSTime = getMSTime(); + + mLocaleTextMap.clear(); // for reload case + + QueryResult result = WorldDatabase.Query("SELECT entry, textGroup, id, text_loc1, text_loc2, text_loc3, text_loc4, text_loc5, text_loc6, text_loc7, text_loc8 FROM locales_creature_text"); + + if (!result) + return; + + uint32 textCount = 0; + + do + { + Field* fields = result->Fetch(); + CreatureTextLocale& loc = mLocaleTextMap[CreatureTextId(fields[0].GetUInt32(), uint32(fields[1].GetUInt8()), fields[2].GetUInt32())]; + for (uint8 i = 1; i < TOTAL_LOCALES; ++i) + { + LocaleConstant locale = LocaleConstant(i); + ObjectMgr::AddLocaleString(fields[2 + i - 1].GetString(), locale, loc.Text); + } + + ++textCount; + } while (result->NextRow()); + + sLog->outString(">> Loaded %u creature localized texts in %u ms", textCount, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); +} + uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisperGuid /*= 0*/, ChatMsg msgType /*= CHAT_MSG_ADDON*/, Language language /*= LANG_ADDON*/, TextRange range /*= TEXT_RANGE_NORMAL*/, uint32 sound /*= 0*/, Team team /*= TEAM_OTHER*/, bool gmOnly /*= false*/, Player* srcPlr /*= NULL*/) { if (!source) return 0; + CreatureTextMap::const_iterator sList = mTextMap.find(source->GetEntry()); if (sList == mTextMap.end()) { sLog->outErrorDb("CreatureTextMgr: Could not find Text for Creature(%s) Entry %u in 'creature_text' table. Ignoring.", source->GetName(), source->GetEntry()); return 0; } - CreatureTextHolder TextHolder = (*sList).second; - CreatureTextHolder::const_iterator itr = TextHolder.find(textGroup); - if (itr == TextHolder.end()) + + CreatureTextHolder const& textHolder = sList->second; + CreatureTextHolder::const_iterator itr = textHolder.find(textGroup); + if (itr == textHolder.end()) { sLog->outErrorDb("CreatureTextMgr: Could not find TextGroup %u for Creature(%s) GuidLow %u Entry %u. Ignoring.", uint32(textGroup), source->GetName(), source->GetGUIDLow(), source->GetEntry()); return 0; } - CreatureTextGroup TextGroup = (*itr).second;//has all texts in the group + + CreatureTextGroup const& textGroupContainer = itr->second; //has all texts in the group CreatureTextRepeatIds repeatGroup = GetRepeatGroup(source, textGroup);//has all textIDs from the group that were already said CreatureTextGroup tempGroup;//will use this to talk after sorting repeatGroup - for (CreatureTextGroup::const_iterator giter = TextGroup.begin(); giter != TextGroup.end(); ++giter) - { - if (std::find(repeatGroup.begin(), repeatGroup.end(), (*giter).id) == repeatGroup.end()) - tempGroup.push_back((*giter)); - } + for (CreatureTextGroup::const_iterator giter = textGroupContainer.begin(); giter != textGroupContainer.end(); ++giter) + if (std::find(repeatGroup.begin(), repeatGroup.end(), giter->id) == repeatGroup.end()) + tempGroup.push_back(*giter); + if (tempGroup.empty()) { CreatureTextRepeatMap::iterator mapItr = mTextRepeatMap.find(source->GetGUID()); if (mapItr != mTextRepeatMap.end()) { - CreatureTextRepeatGroup::iterator groupItr = (*mapItr).second.find(textGroup); - (*groupItr).second.clear(); + CreatureTextRepeatGroup::iterator groupItr = mapItr->second.find(textGroup); + groupItr->second.clear(); } - tempGroup = TextGroup; + + tempGroup = textGroupContainer; } + uint8 count = 0; float lastChance = -1; bool isEqualChanced = true; @@ -148,164 +218,60 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisp for (CreatureTextGroup::const_iterator iter = tempGroup.begin(); iter != tempGroup.end(); ++iter) { - if (lastChance >= 0 && lastChance != (*iter).probability) + if (lastChance >= 0 && lastChance != iter->probability) isEqualChanced = false; - lastChance = (*iter).probability; - totalChance += (*iter).probability; - count++; + lastChance = iter->probability; + totalChance += iter->probability; + ++count; } + int32 offset = -1; if (!isEqualChanced) { for (CreatureTextGroup::const_iterator iter = tempGroup.begin(); iter != tempGroup.end(); ++iter) { - uint32 chance = uint32((*iter).probability); + uint32 chance = uint32(iter->probability); uint32 r = urand(0, 100); - offset++; + ++offset; if (r <= chance) break; } } + uint32 pos = 0; if (isEqualChanced || offset < 0) pos = urand(0, count - 1); else if (offset >= 0) pos = offset; + CreatureTextGroup::const_iterator iter = tempGroup.begin() + pos; - ChatMsg finalType = (msgType == CHAT_MSG_ADDON) ? (*iter).type : msgType; - Language finalLang = (language == LANG_ADDON) ? (*iter).lang : language; - uint32 finalSound = sound ? sound : (*iter).sound; + ChatMsg finalType = (msgType == CHAT_MSG_ADDON) ? iter->type : msgType; + Language finalLang = (language == LANG_ADDON) ? iter->lang : language; + uint32 finalSound = sound ? sound : iter->sound; if (finalSound) SendSound(source, finalSound, finalType, whisperGuid, range, team, gmOnly); - if ((*iter).emote) - SendEmote(srcPlr ? srcPlr->ToUnit() : source, (*iter).emote); + Unit* finalSource = source; + if (srcPlr) + finalSource = srcPlr; - SendChatString(srcPlr ? srcPlr->ToUnit() : source, (*iter).text.c_str(), finalType, finalLang, whisperGuid, range, team, gmOnly); + if (iter->emote) + SendEmote(finalSource, iter->emote); + + CreatureTextBuilder builder(finalSource, finalType, iter->group, iter->id, finalLang, whisperGuid); + SendChatPacket(finalSource, builder, finalType, whisperGuid, range, team, gmOnly); if (isEqualChanced || (!isEqualChanced && totalChance == 100.0f)) - SetRepeatId(source, textGroup, (*iter).id); + SetRepeatId(source, textGroup, iter->id); - return (*iter).duration; + return iter->duration; } -void CreatureTextMgr::SendSound(Creature* source, uint32 sound, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) +float CreatureTextMgr::GetRangeForChatType(ChatMsg msgType) const { - if (!sound || !source) - return; - WorldPacket data(SMSG_PLAY_SOUND, 4); - data << uint32(sound); - SendChatPacket(&data, source, msgType, whisperGuid, range, team, gmOnly); -} - -void CreatureTextMgr::SendEmote(Unit* source, uint32 emote) -{ - if (!source) return; - source->HandleEmoteCommand(emote); -} - -void CreatureTextMgr::SetRepeatId(Creature* source, uint8 textGroup, uint8 id) -{ - if (!source) - return; - - if (mTextRepeatMap.find(source->GetGUID()) == mTextRepeatMap.end()) - { - CreatureTextRepeatGroup TextGroup; - mTextRepeatMap[source->GetGUID()] = TextGroup; - } - if (mTextRepeatMap[source->GetGUID()].find(textGroup) == mTextRepeatMap[source->GetGUID()].end()) - { - CreatureTextRepeatIds ids; - mTextRepeatMap[source->GetGUID()][textGroup] = ids; - } - if (std::find(mTextRepeatMap[source->GetGUID()][textGroup].begin(), mTextRepeatMap[source->GetGUID()][textGroup].end(), id) == mTextRepeatMap[source->GetGUID()][textGroup].end()) - { - mTextRepeatMap[source->GetGUID()][textGroup].push_back(id); - } - else - sLog->outErrorDb("CreatureTextMgr: TextGroup %u for Creature(%s) GuidLow %u Entry %u, id %u already added", uint32(textGroup), source->GetName(), source->GetGUIDLow(), source->GetEntry(), uint32(id)); -} - -CreatureTextRepeatIds CreatureTextMgr::GetRepeatGroup(Creature* source, uint8 textGroup) -{ - ASSERT(source);//should never happen - CreatureTextRepeatIds ids; - - CreatureTextRepeatMap::const_iterator mapItr = mTextRepeatMap.find(source->GetGUID()); - if (mapItr != mTextRepeatMap.end()) - { - CreatureTextRepeatGroup::const_iterator groupItr = (*mapItr).second.find(textGroup); - if (groupItr != (*mapItr).second.end()) - { - ids = (*groupItr).second; - } - } - return ids; -} - -void CreatureTextMgr::SendChatString(WorldObject* source, char const* text, ChatMsg msgtype /*= CHAT_MSG_MONSTER_SAY*/, Language language /*= LANG_UNIVERSAL*/, uint64 whisperGuid /*= 0*/, TextRange range /*= TEXT_RANGE_NORMAL*/, Team team /*= TEAM_OTHER*/, bool gmOnly /*= false*/) const -{ - if (!source) - return; - - WorldPacket data(SMSG_MESSAGECHAT, 200); - BuildMonsterChat(&data, source, msgtype, text, language, whisperGuid);//build our packet - SendChatPacket(&data, source, msgtype, whisperGuid, range, team, gmOnly);//send our packet -} - -void CreatureTextMgr::BuildMonsterChat(WorldPacket* data, WorldObject* source, ChatMsg msgType, char const* text, Language language, uint64 whisperGuid) const -{ - if (!source) - return; - - switch (msgType) - { - case CHAT_MSG_MONSTER_WHISPER: - if (!whisperGuid) - { - sLog->outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent CHAT_TYPE_WHISPER with targetGuid 0. Ignoring.", source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow()); - return; - } - break; - case CHAT_MSG_RAID_BOSS_WHISPER: - if (!whisperGuid) - { - sLog->outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent CHAT_TYPE_BOSS_WHISPER with targetGuid 0. Ignoring.", source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow()); - return; - } - break; - default: - break; - } - *data << uint8(msgType); - *data << uint32(language); - *data << uint64(source->GetGUID()); - *data << uint32(0); // 2.1.0 - *data << uint32(strlen(source->GetName()) + 1); - *data << source->GetName(); - *data << uint64(whisperGuid); // Unit Target - if (whisperGuid && !IS_PLAYER_GUID(whisperGuid)) //can only whisper players - { - sLog->outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent WHISPER msg to Non-Player target. Ignoring.", source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow()); - return; - // *data << (uint32)1; // target name length - // *data << (uint8)0; // target name - } - *data << uint32(strlen(text) + 1); - *data << text; - *data << uint8(0); // ChatTag -} - -void CreatureTextMgr::SendChatPacket(WorldPacket* data, WorldObject* source, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) const -{ - if (!source) - return; - float dist = sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY); - switch (msgType) { case CHAT_MSG_MONSTER_YELL: @@ -315,6 +281,29 @@ void CreatureTextMgr::SendChatPacket(WorldPacket* data, WorldObject* source, Cha case CHAT_MSG_RAID_BOSS_EMOTE: dist = sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE); break; + default: + break; + } + + return dist; +} + +void CreatureTextMgr::SendSound(Creature* source, uint32 sound, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) +{ + if (!sound || !source) + return; + + WorldPacket data(SMSG_PLAY_SOUND, 4); + data << uint32(sound); + SendNonChatPacket(source, &data, msgType, whisperGuid, range, team, gmOnly); +} + +void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket* data, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) const +{ + float dist = GetRangeForChatType(msgType); + + switch (msgType) + { case CHAT_MSG_MONSTER_WHISPER: case CHAT_MSG_RAID_BOSS_WHISPER: { @@ -337,83 +326,135 @@ void CreatureTextMgr::SendChatPacket(WorldPacket* data, WorldObject* source, Cha case TEXT_RANGE_AREA: { uint32 areaId = source->GetAreaId(); - Map::PlayerList const& pList = source->GetMap()->GetPlayers(); - for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr) - { + Map::PlayerList const& players = source->GetMap()->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) if (itr->getSource()->GetAreaId() == areaId && (!team || Team(itr->getSource()->GetTeam()) == team) && (!gmOnly || itr->getSource()->isGameMaster())) - { - if (data->GetOpcode() == SMSG_MESSAGECHAT)//override whisperguid with actual player's guid - data->put(1+4+8+4+4+(int32)(strlen(source->GetName())+1), uint64(itr->getSource()->GetGUID())); - (itr->getSource())->GetSession()->SendPacket(data); - } - } + itr->getSource()->GetSession()->SendPacket(data); return; } case TEXT_RANGE_ZONE: { uint32 zoneId = source->GetZoneId(); - Map::PlayerList const& pList = source->GetMap()->GetPlayers(); - for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr) - { + Map::PlayerList const& players = source->GetMap()->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) if (itr->getSource()->GetZoneId() == zoneId && (!team || Team(itr->getSource()->GetTeam()) == team) && (!gmOnly || itr->getSource()->isGameMaster())) - { - if (data->GetOpcode() == SMSG_MESSAGECHAT)//override whisperguid with actual player's guid - data->put(1+4+8+4+4+(int32)(strlen(source->GetName())+1), uint64(itr->getSource()->GetGUID())); - (itr->getSource())->GetSession()->SendPacket(data); - } - } + itr->getSource()->GetSession()->SendPacket(data); return; } case TEXT_RANGE_MAP: { - Map::PlayerList const& pList = source->GetMap()->GetPlayers(); - for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr) - { - if (data->GetOpcode() == SMSG_MESSAGECHAT)//override whisperguid with actual player's guid - data->put(1+4+8+4+4+(int32)(strlen(source->GetName())+1), uint64(itr->getSource()->GetGUID())); + Map::PlayerList const& players = source->GetMap()->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) if ((!team || Team(itr->getSource()->GetTeam()) == team) && (!gmOnly || itr->getSource()->isGameMaster())) - (itr->getSource())->GetSession()->SendPacket(data); - } + itr->getSource()->GetSession()->SendPacket(data); return; } case TEXT_RANGE_WORLD: { - const SessionMap smap = sWorld->GetAllSessions(); + SessionMap const& smap = sWorld->GetAllSessions(); for (SessionMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter) - { - if (Player* player = (*iter).second->GetPlayer()) - { - if (data->GetOpcode() == SMSG_MESSAGECHAT)//override whisperguid with actual player's guid - data->put(1+4+8+4+4+(int32)(strlen(source->GetName())+1), uint64(player->GetGUID())); + if (Player* player = iter->second->GetPlayer()) if (player->GetSession() && (!team || Team(player->GetTeam()) == team) && (!gmOnly || player->isGameMaster())) player->GetSession()->SendPacket(data); - } - } return; } case TEXT_RANGE_NORMAL: default: break; } + source->SendMessageToSetInRange(data, dist, true); } +void CreatureTextMgr::SendEmote(Unit* source, uint32 emote) +{ + if (!source) + return; + + source->HandleEmoteCommand(emote); +} + +void CreatureTextMgr::SetRepeatId(Creature* source, uint8 textGroup, uint8 id) +{ + if (!source) + return; + + CreatureTextRepeatIds& repeats = mTextRepeatMap[source->GetGUID()][textGroup]; + if (std::find(repeats.begin(), repeats.end(), id) == repeats.end()) + repeats.push_back(id); + else + sLog->outErrorDb("CreatureTextMgr: TextGroup %u for Creature(%s) GuidLow %u Entry %u, id %u already added", uint32(textGroup), source->GetName(), source->GetGUIDLow(), source->GetEntry(), uint32(id)); +} + +CreatureTextRepeatIds CreatureTextMgr::GetRepeatGroup(Creature* source, uint8 textGroup) +{ + ASSERT(source);//should never happen + CreatureTextRepeatIds ids; + + CreatureTextRepeatMap::const_iterator mapItr = mTextRepeatMap.find(source->GetGUID()); + if (mapItr != mTextRepeatMap.end()) + { + CreatureTextRepeatGroup::const_iterator groupItr = (*mapItr).second.find(textGroup); + if (groupItr != mapItr->second.end()) + ids = groupItr->second; + } + return ids; +} + bool CreatureTextMgr::TextExist(uint32 sourceEntry, uint8 textGroup) { if (!sourceEntry) return false; + CreatureTextMap::const_iterator sList = mTextMap.find(sourceEntry); if (sList == mTextMap.end()) { sLog->outDebug(LOG_FILTER_UNITS, "CreatureTextMgr::TextExist: Could not find Text for Creature (entry %u) in 'creature_text' table.", sourceEntry); return false; } - CreatureTextHolder TextHolder = (*sList).second; - CreatureTextHolder::const_iterator itr = TextHolder.find(textGroup); - if (itr == TextHolder.end()) + + CreatureTextHolder const& textHolder = sList->second; + CreatureTextHolder::const_iterator itr = textHolder.find(textGroup); + if (itr == textHolder.end()) { sLog->outDebug(LOG_FILTER_UNITS, "CreatureTextMgr::TextExist: Could not find TextGroup %u for Creature (entry %u).", uint32(textGroup), sourceEntry); return false; } + return true; } + +std::string CreatureTextMgr::GetLocalizedChatString(uint32 entry, uint8 textGroup, uint32 id, LocaleConstant locale) const +{ + CreatureTextMap::const_iterator mapitr = mTextMap.find(entry); + if (mapitr == mTextMap.end()) + return ""; + + CreatureTextHolder::const_iterator holderItr = mapitr->second.find(textGroup); + if (holderItr == mapitr->second.end()) + return ""; + + CreatureTextGroup::const_iterator groupItr = holderItr->second.begin(); + for (; groupItr != holderItr->second.end(); ++groupItr) + if (groupItr->id == id) + break; + + if (groupItr == holderItr->second.end()) + return ""; + + std::string baseText = groupItr->text; + if (locale == DEFAULT_LOCALE) + return baseText; + + if (locale > MAX_LOCALES) + return baseText; + + LocaleCreatureTextMap::const_iterator locItr = mLocaleTextMap.find(CreatureTextId(entry, uint32(textGroup), id)); + if (locItr == mLocaleTextMap.end()) + return baseText; + + if (locItr->second.Text[locale].length()) + return locItr->second.Text[locale]; + + return baseText; +} diff --git a/src/server/game/Texts/CreatureTextMgr.h b/src/server/game/Texts/CreatureTextMgr.h index 0c80e2d568f..c9e3d44f346 100755 --- a/src/server/game/Texts/CreatureTextMgr.h +++ b/src/server/game/Texts/CreatureTextMgr.h @@ -44,10 +44,33 @@ enum TextRange TEXT_RANGE_WORLD = 4 }; +struct CreatureTextLocale +{ + StringVector Text; +}; + +struct CreatureTextId +{ + CreatureTextId(uint32 e, uint32 g, uint32 i) : entry(e), textGroup(g), textId(i) + { + } + + bool operator<(CreatureTextId const& right) const + { + return memcmp(this, &right, sizeof(CreatureTextId)) < 0; + } + + uint32 entry; + uint32 textGroup; + uint32 textId; +}; + typedef std::vector CreatureTextGroup; //texts in a group typedef UNORDERED_MAP CreatureTextHolder; //groups for a creature by groupid typedef UNORDERED_MAP CreatureTextMap; //all creatures by entry +typedef std::map LocaleCreatureTextMap; + //used for handling non-repeatable random texts typedef std::vector CreatureTextRepeatIds; typedef UNORDERED_MAP CreatureTextRepeatGroup; @@ -57,9 +80,11 @@ class CreatureTextMgr { friend class ACE_Singleton; CreatureTextMgr() {}; + public: ~CreatureTextMgr() {}; void LoadCreatureTexts(); + void LoadCreatureTextLocales(); CreatureTextMap const& GetTextMap() const { return mTextMap; } void SendSound(Creature* source, uint32 sound, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly); @@ -67,17 +92,154 @@ class CreatureTextMgr //if sent, returns the 'duration' of the text else 0 if error uint32 SendChat(Creature* source, uint8 textGroup, uint64 whisperGuid = 0, ChatMsg msgType = CHAT_MSG_ADDON, Language language = LANG_ADDON, TextRange range = TEXT_RANGE_NORMAL, uint32 sound = 0, Team team = TEAM_OTHER, bool gmOnly = false, Player* srcPlr = NULL); - void SendChatString(WorldObject* source, char const* text, ChatMsg msgtype = CHAT_MSG_MONSTER_SAY, Language language = LANG_UNIVERSAL, uint64 whisperGuid = 0, TextRange range = TEXT_RANGE_NORMAL, Team team = TEAM_OTHER, bool gmOnly = false) const; bool TextExist(uint32 sourceEntry, uint8 textGroup); + std::string GetLocalizedChatString(uint32 entry, uint8 textGroup, uint32 id, LocaleConstant locale) const; + + template + void SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, uint64 whisperGuid = 0, TextRange range = TEXT_RANGE_NORMAL, Team team = TEAM_OTHER, bool gmOnly = false) const; private: CreatureTextRepeatIds GetRepeatGroup(Creature* source, uint8 textGroup); void SetRepeatId(Creature* source, uint8 textGroup, uint8 id); - void BuildMonsterChat(WorldPacket* data, WorldObject* source, ChatMsg msgType, char const* text, Language language, uint64 whisperGuid) const; - void SendChatPacket(WorldPacket* data, WorldObject* source, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) const; + + void SendNonChatPacket(WorldObject* source, WorldPacket* data, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) const; + float GetRangeForChatType(ChatMsg msgType) const; CreatureTextMap mTextMap; CreatureTextRepeatMap mTextRepeatMap; + LocaleCreatureTextMap mLocaleTextMap; }; #define sCreatureTextMgr ACE_Singleton::instance() + +template +class CreatureTextLocalizer +{ + public: + CreatureTextLocalizer(Builder const& builder, ChatMsg msgType) : _builder(builder), _msgType(msgType) + { + _packetCache.resize(TOTAL_LOCALES, NULL); + } + + ~CreatureTextLocalizer() + { + for (size_t i = 0; i < _packetCache.size(); ++i) + { + if (_packetCache[i]) + delete _packetCache[i]->first; + delete _packetCache[i]; + } + } + + void operator()(Player* player) + { + LocaleConstant loc_idx = player->GetSession()->GetSessionDbLocaleIndex(); + WorldPacket* messageTemplate; + size_t whisperGUIDpos; + + // create if not cached yet + if (!_packetCache[loc_idx]) + { + messageTemplate = new WorldPacket(SMSG_MESSAGECHAT, 200); + whisperGUIDpos = _builder(messageTemplate, loc_idx); + _packetCache[loc_idx] = new std::pair(messageTemplate, whisperGUIDpos); + } + else + { + messageTemplate = _packetCache[loc_idx]->first; + whisperGUIDpos = _packetCache[loc_idx]->second; + } + + WorldPacket data(*messageTemplate); + switch (_msgType) + { + case CHAT_MSG_MONSTER_WHISPER: + case CHAT_MSG_RAID_BOSS_WHISPER: + data.put(whisperGUIDpos, player->GetGUID()); + break; + } + + player->SendDirectMessage(&data); + } + + private: + std::vector* > _packetCache; + Builder const& _builder; + ChatMsg _msgType; +}; + +template +void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) const +{ + if (!source) + return; + + CreatureTextLocalizer localizer(builder, msgType); + + switch (msgType) + { + case CHAT_MSG_MONSTER_WHISPER: + case CHAT_MSG_RAID_BOSS_WHISPER: + { + if (range == TEXT_RANGE_NORMAL) //ignores team and gmOnly + { + Player* player = ObjectAccessor::FindPlayer(whisperGuid); + if (!player || !player->GetSession()) + return; + + localizer(player); + return; + } + break; + } + default: + break; + } + + switch (range) + { + case TEXT_RANGE_AREA: + { + uint32 areaId = source->GetAreaId(); + Map::PlayerList const& players = source->GetMap()->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + if (itr->getSource()->GetAreaId() == areaId && (!team || Team(itr->getSource()->GetTeam()) == team) && (!gmOnly || itr->getSource()->isGameMaster())) + localizer(itr->getSource()); + return; + } + case TEXT_RANGE_ZONE: + { + uint32 zoneId = source->GetZoneId(); + Map::PlayerList const& players = source->GetMap()->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + if (itr->getSource()->GetZoneId() == zoneId && (!team || Team(itr->getSource()->GetTeam()) == team) && (!gmOnly || itr->getSource()->isGameMaster())) + localizer(itr->getSource()); + return; + } + case TEXT_RANGE_MAP: + { + Map::PlayerList const& players = source->GetMap()->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + if ((!team || Team(itr->getSource()->GetTeam()) == team) && (!gmOnly || itr->getSource()->isGameMaster())) + localizer(itr->getSource()); + return; + } + case TEXT_RANGE_WORLD: + { + SessionMap const& smap = sWorld->GetAllSessions(); + for (SessionMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter) + if (Player* player = iter->second->GetPlayer()) + if (player->GetSession() && (!team || Team(player->GetTeam()) == team) && (!gmOnly || player->isGameMaster())) + localizer(player); + return; + } + case TEXT_RANGE_NORMAL: + default: + break; + } + + float dist = GetRangeForChatType(msgType); + Trinity::PlayerDistWorker > worker(source, dist, localizer); + source->VisitNearbyWorldObject(dist, worker); +} + #endif diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index fcdb6b7fcd6..3efa976e1d3 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1651,6 +1651,9 @@ void World::SetInitialWorldSettings() sLog->outString("Loading Creature Texts..."); sCreatureTextMgr->LoadCreatureTexts(); + sLog->outString("Loading Creature Text Locales..."); + sCreatureTextMgr->LoadCreatureTextLocales(); + sLog->outString("Initializing Scripts..."); sScriptMgr->Initialize(); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp index a025cd677bd..284babb7193 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp @@ -194,7 +194,7 @@ public: void KilledUnit(Unit* /*victim*/) { - Talk(SAY_SLAY), me); + Talk(SAY_SLAY); } void JustDied(Unit* /*killer*/) From 254256668b9751177051a72135a400387fac1d19 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 1 Mar 2012 23:45:07 +0100 Subject: [PATCH 0092/1149] Core: Fixed compile without PCH --- src/server/game/AI/CreatureAI.cpp | 1 + src/server/game/AI/CreatureAI.h | 2 +- src/server/game/AI/SmartScripts/SmartAI.h | 1 - src/server/game/AI/SmartScripts/SmartScript.cpp | 1 + src/server/game/AI/SmartScripts/SmartScript.h | 1 - src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 1 + src/server/game/AI/SmartScripts/SmartScriptMgr.h | 1 - src/server/game/Texts/CreatureTextMgr.h | 2 ++ .../CullingOfStratholme/instance_culling_of_stratholme.cpp | 1 + .../scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp | 1 + 10 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index c8818f84e5b..9c236cbd039 100755 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -25,6 +25,7 @@ #include "Log.h" #include "MapReference.h" #include "Player.h" +#include "CreatureTextMgr.h" //Disable CreatureAI when charmed void CreatureAI::OnCharmed(bool /*apply*/) diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h index dafd3e4e137..423b00291e7 100755 --- a/src/server/game/AI/CreatureAI.h +++ b/src/server/game/AI/CreatureAI.h @@ -19,9 +19,9 @@ #ifndef TRINITY_CREATUREAI_H #define TRINITY_CREATUREAI_H +#include "Creature.h" #include "UnitAI.h" #include "Common.h" -#include "CreatureTextMgr.h" class WorldObject; class Unit; diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h index e82b35ec87a..c2501199f77 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.h +++ b/src/server/game/AI/SmartScripts/SmartAI.h @@ -23,7 +23,6 @@ #include "CreatureAI.h" #include "Unit.h" #include "ConditionMgr.h" -#include "CreatureTextMgr.h" #include "Spell.h" #include "SmartScript.h" diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 0498cd1f07e..80ded6681c9 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -33,6 +33,7 @@ #include "Group.h" #include "Vehicle.h" #include "ScriptedGossip.h" +#include "CreatureTextMgr.h" class TrinityStringTextBuilder { diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h index f7524582ab7..faba3c05394 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.h +++ b/src/server/game/AI/SmartScripts/SmartScript.h @@ -23,7 +23,6 @@ #include "CreatureAI.h" #include "Unit.h" #include "ConditionMgr.h" -#include "CreatureTextMgr.h" #include "Spell.h" #include "GridNotifiers.h" diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 3fc3f233b4b..fe2a89de9aa 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -27,6 +27,7 @@ #include "InstanceScript.h" #include "ScriptedCreature.h" #include "GameEventMgr.h" +#include "CreatureTextMgr.h" #include "SmartScriptMgr.h" diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 0d182e1beb3..9af0c4de9fc 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -23,7 +23,6 @@ #include "CreatureAI.h" #include "Unit.h" #include "ConditionMgr.h" -#include "CreatureTextMgr.h" #include "Spell.h" //#include "SmartScript.h" diff --git a/src/server/game/Texts/CreatureTextMgr.h b/src/server/game/Texts/CreatureTextMgr.h index c9e3d44f346..ddf10568411 100755 --- a/src/server/game/Texts/CreatureTextMgr.h +++ b/src/server/game/Texts/CreatureTextMgr.h @@ -19,6 +19,8 @@ #define TRINITY_CREATURE_TEXT_MGR_H #include "Creature.h" +#include "GridNotifiers.h" +#include "ObjectAccessor.h" #include "SharedDefines.h" struct CreatureTextEntry diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp index 9a91e1e232b..b232cae4657 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp @@ -16,6 +16,7 @@ */ #include "ScriptPCH.h" +#include "CreatureTextMgr.h" #include "culling_of_stratholme.h" #define MAX_ENCOUNTER 5 diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index e0fa0e2b75a..19a8e42e14b 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -26,6 +26,7 @@ #include "CellImpl.h" #include "GridNotifiers.h" #include "GridNotifiersImpl.h" +#include "CreatureTextMgr.h" #include "icecrown_citadel.h" enum Texts From 394dbf0cdceea425a1ad63ecebc614e29728d365 Mon Sep 17 00:00:00 2001 From: kaelima Date: Fri, 2 Mar 2012 12:23:16 +0100 Subject: [PATCH 0093/1149] Core/Misc: Fix a crash in CalendarMgr::AddAction and initialize some wild pointers. --- src/server/game/Calendar/CalendarMgr.cpp | 7 +++++-- src/server/game/Entities/Unit/Unit.cpp | 15 ++------------- src/server/game/Maps/MapInstanced.cpp | 24 +++++++++++++----------- 3 files changed, 20 insertions(+), 26 deletions(-) diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index b286abba81e..761bbb9b496 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -375,7 +375,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) uint64 eventId = action.Invite.GetEventId(); uint64 inviteId = action.Invite.GetInviteId(); - CalendarEvent* calendarEvent; + CalendarEvent* calendarEvent = NULL; if (action.GetInviteId() != action.Invite.GetInviteId()) calendarEvent = CheckPermisions(eventId, action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); else @@ -395,7 +395,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) uint64 eventId = action.Invite.GetEventId(); uint64 inviteId = action.Invite.GetInviteId(); - CalendarEvent* calendarEvent; + CalendarEvent* calendarEvent = NULL; if (action.GetInviteId() != action.Invite.GetInviteId()) calendarEvent = CheckPermisions(eventId, action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_OWNER); else @@ -420,6 +420,9 @@ void CalendarMgr::AddAction(CalendarAction const& action) // already checked in CheckPermisions CalendarInvite* invite = GetInvite(inviteId); + if (!invite) + return; + if (calendarEvent->GetCreatorGUID() == invite->GetInvitee()) { action.GetPlayer()->GetSession()->SendCalendarCommandResult(CALENDAR_ERROR_DELETE_CREATOR_FAILED); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 138eda962aa..dbbb8acf759 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -784,20 +784,9 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam // last damage from duel opponent if (duel_hasEnded) { - Player* he; + Player* he = duel_wasMounted ? victim->GetCharmer()->ToPlayer() : victim->ToPlayer(); - if (duel_wasMounted) - { - ASSERT(victim->GetCharmer()->GetTypeId() == TYPEID_PLAYER); - he = victim->GetCharmer()->ToPlayer(); - } - else - { - ASSERT(victim->GetTypeId() == TYPEID_PLAYER); - he = victim->ToPlayer(); - } - - ASSERT(he->duel); + ASSERT(he && he->duel); if (duel_wasMounted) // In this case victim==mount victim->SetHealth(1); diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index fbe609bee23..5543251e115 100755 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -116,19 +116,21 @@ Map* MapInstanced::CreateInstanceForPlayer(const uint32 mapId, Player* player) return NULL; Map* map = NULL; - uint32 NewInstanceId = 0; // instanceId of the resulting map + uint32 newInstanceId = 0; // instanceId of the resulting map if (IsBattlegroundOrArena()) { // instantiate or find existing bg map for player // the instance id is set in battlegroundid - NewInstanceId = player->GetBattlegroundId(); - if (!NewInstanceId) return NULL; - map = sMapMgr->FindMap(mapId, NewInstanceId); + newInstanceId = player->GetBattlegroundId(); + if (!newInstanceId) + return NULL; + + map = sMapMgr->FindMap(mapId, newInstanceId); if (!map) { if (Battleground* bg = player->GetBattleground()) - map = CreateBattleground(NewInstanceId, bg); + map = CreateBattleground(newInstanceId, bg); else { player->TeleportToBGEntryPoint(); @@ -158,24 +160,24 @@ Map* MapInstanced::CreateInstanceForPlayer(const uint32 mapId, Player* player) if (pSave) { // solo/perm/group - NewInstanceId = pSave->GetInstanceId(); - map = FindInstanceMap(NewInstanceId); + newInstanceId = pSave->GetInstanceId(); + map = FindInstanceMap(newInstanceId); // it is possible that the save exists but the map doesn't if (!map) - map = CreateInstance(NewInstanceId, pSave, pSave->GetDifficulty()); + map = CreateInstance(newInstanceId, pSave, pSave->GetDifficulty()); } else { // if no instanceId via group members or instance saves is found // the instance will be created for the first time - NewInstanceId = sMapMgr->GenerateInstanceId(); + newInstanceId = sMapMgr->GenerateInstanceId(); Difficulty diff = player->GetGroup() ? player->GetGroup()->GetDifficulty(IsRaid()) : player->GetDifficulty(IsRaid()); //Seems it is now possible, but I do not know if it should be allowed //ASSERT(!FindInstanceMap(NewInstanceId)); - map = FindInstanceMap(NewInstanceId); + map = FindInstanceMap(newInstanceId); if (!map) - map = CreateInstance(NewInstanceId, NULL, diff); + map = CreateInstance(newInstanceId, NULL, diff); } } From c1270bd7580960c1e756cb84409b7ec251f88e63 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 2 Mar 2012 09:42:17 -0500 Subject: [PATCH 0094/1149] Core/Scripting: added OnPlayerUpdateZone for player scripts --- src/server/game/Entities/Player/Player.cpp | 2 ++ src/server/game/Scripting/ScriptMgr.cpp | 5 +++++ src/server/game/Scripting/ScriptMgr.h | 3 +++ 3 files changed, 10 insertions(+) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 963cfc308d8..870b6f683b8 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7421,6 +7421,8 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) } } + sScriptMgr->OnPlayerUpdateZone(this, newZone, newArea); + // in PvP, any not controlled zone (except zone->team == 6, default case) // in PvE, only opposition team capital switch (zone->team) diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 47751338d66..473f7978a4f 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -1295,6 +1295,11 @@ void ScriptMgr::OnPlayerBindToInstance(Player* player, Difficulty difficulty, ui FOREACH_SCRIPT(PlayerScript)->OnBindToInstance(player, difficulty, mapid, permanent); } +void ScriptMgr::OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 newArea) +{ + FOREACH_SCRIPT(PlayerScript)->OnUpdateZone(player, newZone, newArea); +} + // Guild void ScriptMgr::OnGuildAddMember(Guild* guild, Player* player, uint8& plRank) { diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 048a7581215..eee91789120 100755 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -724,6 +724,8 @@ class PlayerScript : public ScriptObject // Called when a player is bound to an instance virtual void OnBindToInstance(Player* /*player*/, Difficulty /*difficulty*/, uint32 /*mapId*/, bool /*permanent*/) { } + + virtual void OnUpdateZone(Player* /*player*/, uint32 /*newZone*/, uint32 /*newArea*/) { } }; class GuildScript : public ScriptObject @@ -993,6 +995,7 @@ class ScriptMgr void OnPlayerCreate(Player* player); void OnPlayerDelete(uint64 guid); void OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapid, bool permanent); + void OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 newArea); public: /* GuildScript */ From 42454640cf9dea81687b3aef242167fe85cdb9a7 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 2 Mar 2012 09:49:44 -0500 Subject: [PATCH 0095/1149] Core/Scripting: codestyle and comment for previous commit --- src/server/game/Scripting/ScriptMgr.cpp | 2 +- src/server/game/Scripting/ScriptMgr.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 473f7978a4f..ac15bd5c985 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -1297,7 +1297,7 @@ void ScriptMgr::OnPlayerBindToInstance(Player* player, Difficulty difficulty, ui void ScriptMgr::OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 newArea) { - FOREACH_SCRIPT(PlayerScript)->OnUpdateZone(player, newZone, newArea); + FOREACH_SCRIPT(PlayerScript)->OnUpdateZone(player, newZone, newArea); } // Guild diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index eee91789120..3b65a5cf256 100755 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -725,6 +725,7 @@ class PlayerScript : public ScriptObject // Called when a player is bound to an instance virtual void OnBindToInstance(Player* /*player*/, Difficulty /*difficulty*/, uint32 /*mapId*/, bool /*permanent*/) { } + // Called when a player switches to a new zone virtual void OnUpdateZone(Player* /*player*/, uint32 /*newZone*/, uint32 /*newArea*/) { } }; From c119c0ce13ab85e775ff399f7e28a38d72ac4e45 Mon Sep 17 00:00:00 2001 From: Souler Date: Sat, 25 Feb 2012 17:27:19 +0100 Subject: [PATCH 0096/1149] Core/Arenas/Dalaran Sewers: Players who stay on the pipe after the battle has begun should be knocked into the arena. Also corrected the orientation of horde starting position --- .../world/2012_02_25_01_world_misc.sql | 11 ++++++ .../Battlegrounds/Zones/BattlegroundDS.cpp | 25 +++++++++++- .../game/Battlegrounds/Zones/BattlegroundDS.h | 32 +++++++++++++++- src/server/scripts/Spells/spell_generic.cpp | 38 +++++++++++++++++++ 4 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 sql/updates/world/2012_02_25_01_world_misc.sql diff --git a/sql/updates/world/2012_02_25_01_world_misc.sql b/sql/updates/world/2012_02_25_01_world_misc.sql new file mode 100644 index 00000000000..deedd50a819 --- /dev/null +++ b/sql/updates/world/2012_02_25_01_world_misc.sql @@ -0,0 +1,11 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (61698); +INSERT INTO `spell_script_names`(`spell_id`,`ScriptName`) VALUES +(61698,'spell_gen_ds_flush_knockback'); + +DELETE FROM `spell_dbc` WHERE `id`=61698; +INSERT INTO `spell_dbc` (`Id`, `Dispel`, `Mechanic`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `AttributesEx4`, `AttributesEx5`, `AttributesEx6`, `AttributesEx7`, `Stances`, `StancesNot`, `Targets`, `CastingTimeIndex`, `AuraInterruptFlags`, `ProcFlags`, `ProcChance`, `ProcCharges`, `MaxLevel`, `BaseLevel`, `SpellLevel`, `DurationIndex`, `RangeIndex`, `StackAmount`, `EquippedItemClass`, `EquippedItemSubClassMask`, `EquippedItemInventoryTypeMask`, `Effect1`, `Effect2`, `Effect3`, `EffectDieSides1`, `EffectDieSides2`, `EffectDieSides3`, `EffectRealPointsPerLevel1`, `EffectRealPointsPerLevel2`, `EffectRealPointsPerLevel3`, `EffectBasePoints1`, `EffectBasePoints2`, `EffectBasePoints3`, `EffectMechanic1`, `EffectMechanic2`, `EffectMechanic3`, `EffectImplicitTargetA1`, `EffectImplicitTargetA2`, `EffectImplicitTargetA3`, `EffectImplicitTargetB1`, `EffectImplicitTargetB2`, `EffectImplicitTargetB3`, `EffectRadiusIndex1`, `EffectRadiusIndex2`, `EffectRadiusIndex3`, `EffectApplyAuraName1`, `EffectApplyAuraName2`, `EffectApplyAuraName3`, `EffectAmplitude1`, `EffectAmplitude2`, `EffectAmplitude3`, `EffectMultipleValue1`, `EffectMultipleValue2`, `EffectMultipleValue3`, `EffectMiscValue1`, `EffectMiscValue2`, `EffectMiscValue3`, `EffectMiscValueB1`, `EffectMiscValueB2`, `EffectMiscValueB3`, `EffectTriggerSpell1`, `EffectTriggerSpell2`, `EffectTriggerSpell3`, `EffectSpellClassMaskA1`, `EffectSpellClassMaskA2`, `EffectSpellClassMaskA3`, `EffectSpellClassMaskB1`, `EffectSpellClassMaskB2`, `EffectSpellClassMaskB3`, `EffectSpellClassMaskC1`, `EffectSpellClassMaskC2`, `EffectSpellClassMaskC3`, `MaxTargetLevel`, `SpellFamilyName`, `SpellFamilyFlags1`, `SpellFamilyFlags2`, `SpellFamilyFlags3`, `MaxAffectedTargets`, `DmgClass`, `PreventionType`, `DmgMultiplier1`, `DmgMultiplier2`, `DmgMultiplier3`, `AreaGroupId`, `SchoolMask`, `Comment`) VALUES +(61698,0,0,536871296,269058048,67108868,268894272,2048,0,1024,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,-1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'Flush - Knockback effect'); + +UPDATE `battleground_template` SET `HordeStartO`=3.14159 WHERE `id`=10; + +UPDATE `creature_template` SET `flags_extra`=128 WHERE `entry`=28567; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp index d24058cdd8a..aec828ef62f 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp @@ -27,6 +27,7 @@ BattlegroundDS::BattlegroundDS() { BgObjects.resize(BG_DS_OBJECT_MAX); + BgCreatures.resize(BG_DS_NPC_MAX); StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M; StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S; @@ -49,6 +50,21 @@ void BattlegroundDS::PostUpdateImpl(uint32 diff) if (GetStatus() != STATUS_IN_PROGRESS) return; + if (getPipeKnockBackCount() < BG_DS_PIPE_KNOCKBACK_TOTAL_COUNT) + { + if (getPipeKnockBackTimer() < diff) + { + for (uint32 i = BG_DS_NPC_PIPE_KNOCKBACK_1; i <= BG_DS_NPC_PIPE_KNOCKBACK_2; ++i) + if (Creature* waterSpout = GetBgMap()->GetCreature(BgCreatures[i])) + waterSpout->CastSpell(waterSpout, BG_DS_SPELL_FLUSH, true); + + setPipeKnockBackCount(getPipeKnockBackCount() + 1); + setPipeKnockBackTimer(BG_DS_PIPE_KNOCKBACK_DELAY); + } + else + setPipeKnockBackTimer(getPipeKnockBackTimer() - diff); + } + if (getWaterFallTimer() < diff) { if (getWaterFallStatus() == BG_DS_WATERFALL_STATUS_OFF) // Add the water @@ -97,6 +113,9 @@ void BattlegroundDS::StartingEventOpenDoors() setWaterFallTimer(urand(BG_DS_WATERFALL_TIMER_MIN, BG_DS_WATERFALL_TIMER_MAX)); setWaterFallStatus(BG_DS_WATERFALL_STATUS_OFF); + setPipeKnockBackTimer(BG_DS_PIPE_KNOCKBACK_FIRST_DELAY); + setPipeKnockBackCount(0); + SpawnBGObject(BG_DS_OBJECT_WATER_2, RESPAWN_IMMEDIATELY); DoorOpen(BG_DS_OBJECT_WATER_2); @@ -187,7 +206,11 @@ bool BattlegroundDS::SetupBattleground() || !AddObject(BG_DS_OBJECT_WATER_2, BG_DS_OBJECT_TYPE_WATER_2, 1291.56f, 790.837f, 7.1f, 3.14238f, 0, 0, 0.694215f, -0.719768f, 120) // buffs || !AddObject(BG_DS_OBJECT_BUFF_1, BG_DS_OBJECT_TYPE_BUFF_1, 1291.7f, 813.424f, 7.11472f, 4.64562f, 0, 0, 0.730314f, -0.683111f, 120) - || !AddObject(BG_DS_OBJECT_BUFF_2, BG_DS_OBJECT_TYPE_BUFF_2, 1291.7f, 768.911f, 7.11472f, 1.55194f, 0, 0, 0.700409f, 0.713742f, 120)) + || !AddObject(BG_DS_OBJECT_BUFF_2, BG_DS_OBJECT_TYPE_BUFF_2, 1291.7f, 768.911f, 7.11472f, 1.55194f, 0, 0, 0.700409f, 0.713742f, 120) + // knockback creatures + || !AddCreature(BG_DS_NPC_TYPE_WATER_SPOUT, BG_DS_NPC_WATERFALL_KNOCKBACK, 0, 1292.587f, 790.2205f, 7.19796f, 3.054326f, RESPAWN_IMMEDIATELY) + || !AddCreature(BG_DS_NPC_TYPE_WATER_SPOUT, BG_DS_NPC_PIPE_KNOCKBACK_1, 0, 1369.977f, 817.2882f, 16.08718f, 3.106686f, RESPAWN_IMMEDIATELY) + || !AddCreature(BG_DS_NPC_TYPE_WATER_SPOUT, BG_DS_NPC_PIPE_KNOCKBACK_2, 0, 1212.833f, 765.3871f, 16.09484f, 0.0f, RESPAWN_IMMEDIATELY)) { sLog->outErrorDb("BatteGroundDS: Failed to spawn some object!"); return false; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h index 7efc6e1caa7..034749d1be8 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h @@ -42,12 +42,34 @@ enum BattlegroundDSObjects BG_DS_OBJECT_TYPE_BUFF_2 = 184664 }; +enum BattlegroundDSCreatureTypes +{ + BG_DS_NPC_WATERFALL_KNOCKBACK = 0, + BG_DS_NPC_PIPE_KNOCKBACK_1 = 1, + BG_DS_NPC_PIPE_KNOCKBACK_2 = 2, + BG_DS_NPC_MAX = 3 +}; + +enum BattlegroundDSCreatures +{ + BG_DS_NPC_TYPE_WATER_SPOUT = 28567, +}; + +enum BattlegroundDSSpells +{ + BG_DS_SPELL_FLUSH = 57405, // Visual and target selector for the starting knockback from the pipe + BG_DS_SPELL_FLUSH_KNOCKBACK = 61698, // Knockback effect for previous spell (triggered, not need to be casted) +}; + enum BattlegroundDSData { // These values are NOT blizzlike... need the correct data! BG_DS_WATERFALL_TIMER_MIN = 30000, BG_DS_WATERFALL_TIMER_MAX = 60000, BG_DS_WATERFALL_WARNING_DURATION = 7000, BG_DS_WATERFALL_DURATION = 10000, + BG_DS_PIPE_KNOCKBACK_FIRST_DELAY = 5000, + BG_DS_PIPE_KNOCKBACK_DELAY = 3000, + BG_DS_PIPE_KNOCKBACK_TOTAL_COUNT = 2, BG_DS_WATERFALL_STATUS_WARNING = 1, // Water starting to fall, but no LoS Blocking nor movement blocking BG_DS_WATERFALL_STATUS_ON = 2, // LoS and Movement blocking active @@ -83,12 +105,18 @@ class BattlegroundDS : public Battleground private: uint32 _waterfallTimer; uint8 _waterfallStatus; + uint32 _pipeKnockBackTimer; + uint8 _pipeKnockBackCount; virtual void PostUpdateImpl(uint32 diff); protected: uint32 getWaterFallStatus() { return _waterfallStatus; }; - void setWaterFallStatus(uint32 status) { _waterfallStatus = status; }; - void setWaterFallTimer(uint32 timer) { _waterfallTimer = timer; }; + void setWaterFallStatus(uint8 status) { _waterfallStatus = status; }; uint32 getWaterFallTimer() { return _waterfallTimer; }; + void setWaterFallTimer(uint32 timer) { _waterfallTimer = timer; }; + uint8 getPipeKnockBackCount() { return _pipeKnockBackCount; }; + void setPipeKnockBackCount(uint8 count) { _pipeKnockBackCount = count; }; + uint32 getPipeKnockBackTimer() { return _pipeKnockBackTimer; }; + void setPipeKnockBackTimer(uint32 timer) { _pipeKnockBackTimer = timer; }; }; #endif diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index db33a9e0332..f2a48b0f9d2 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2548,6 +2548,43 @@ class spell_gen_chaos_blast : public SpellScriptLoader }; +class spell_gen_ds_flush_knockback : public SpellScriptLoader +{ + public: + spell_gen_ds_flush_knockback() : SpellScriptLoader("spell_gen_ds_flush_knockback") {} + + class spell_gen_ds_flush_knockback_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_ds_flush_knockback_SpellScript); + + void HandleScript(SpellEffIndex /*effIndex*/) + { + // Here the target is the water spout and determines the position where the player is knocked from + if (Unit* target = GetHitUnit()) + { + if (Player* player = GetCaster()->ToPlayer()) + { + float horizontalSpeed = 20.0f + (40.0f - GetCaster()->GetDistance(target)); + float verticalSpeed = 8.0f; + // This method relies on the Dalaran Sewer map disposition and Water Spout position + // What we do is knock the player from a position exactly behind him and at the end of the pipe + player->KnockbackFrom(target->GetPositionX(), player->GetPositionY(), horizontalSpeed, verticalSpeed); + } + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_ds_flush_knockback_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_ds_flush_knockback_SpellScript(); + } +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -2597,4 +2634,5 @@ void AddSC_generic_spell_scripts() new spell_gen_on_tournament_mount(); new spell_gen_tournament_pennant(); new spell_gen_chaos_blast(); + new spell_gen_ds_flush_knockback(); } From d70c708093e602da35ede43874adf407aa080110 Mon Sep 17 00:00:00 2001 From: Souler Date: Tue, 28 Feb 2012 11:27:46 +0100 Subject: [PATCH 0097/1149] Core/Arenas/Dalaran Sewers: Reset the knockback effect if someone manages to get back to the starting pipes. --- src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp index aec828ef62f..cb0f6ac6cd7 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp @@ -170,6 +170,10 @@ void BattlegroundDS::HandleAreaTrigger(Player* Source, uint32 Trigger) { case 5347: case 5348: + // Someone has get back into the pipes and the knockback has already been performed, + // so we reset the knockback count for kicking the player again into the arena. + if (getPipeKnockBackCount() >= BG_DS_PIPE_KNOCKBACK_TOTAL_COUNT) + setPipeKnockBackCount(0); break; default: sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); From b825573c2919af5a06b6482f3a437c0638171b92 Mon Sep 17 00:00:00 2001 From: Souler Date: Fri, 2 Mar 2012 17:19:52 +0100 Subject: [PATCH 0098/1149] Core/Arenas/Dalaran Sewers: Knockback players near the central waterfall when it fully activates. --- src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp | 5 ++++- src/server/game/Battlegrounds/Zones/BattlegroundDS.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp index cb0f6ac6cd7..7db03381407 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp @@ -73,8 +73,11 @@ void BattlegroundDS::PostUpdateImpl(uint32 diff) setWaterFallTimer(BG_DS_WATERFALL_WARNING_DURATION); setWaterFallStatus(BG_DS_WATERFALL_STATUS_WARNING); } - else if (getWaterFallStatus() == BG_DS_WATERFALL_STATUS_WARNING) // Active collision + else if (getWaterFallStatus() == BG_DS_WATERFALL_STATUS_WARNING) // Active collision and perform knockback { + if (Creature* waterSpout = GetBgMap()->GetCreature(BgCreatures[BG_DS_NPC_WATERFALL_KNOCKBACK])) + waterSpout->CastSpell(waterSpout, BG_DS_SPELL_WATER_SPOUT, true); + if (GameObject* gob = GetBgMap()->GetGameObject(BgObjects[BG_DS_OBJECT_WATER_1])) gob->SetGoState(GO_STATE_READY); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h index 034749d1be8..a10e75eb6f4 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h @@ -59,6 +59,7 @@ enum BattlegroundDSSpells { BG_DS_SPELL_FLUSH = 57405, // Visual and target selector for the starting knockback from the pipe BG_DS_SPELL_FLUSH_KNOCKBACK = 61698, // Knockback effect for previous spell (triggered, not need to be casted) + BG_DS_SPELL_WATER_SPOUT = 58873, // Knockback effect of the central waterfall }; enum BattlegroundDSData From e1b544d129190b921afc5f394379f5df906a7172 Mon Sep 17 00:00:00 2001 From: QAston Date: Fri, 2 Mar 2012 17:57:26 +0100 Subject: [PATCH 0099/1149] Core/Spells: Remove some obsolete code --- src/server/game/Spells/Spell.cpp | 34 +++----------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 4f4de7c72cd..9ae298ebb13 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -826,7 +826,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar m_targets.SetSrc(*m_caster); break; default: - ASSERT("Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_SRC"); + ASSERT(false && "Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_SRC"); break; } break; @@ -843,7 +843,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar SelectImplicitDestDestTargets(effIndex, targetType); break; default: - ASSERT("Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_DEST"); + ASSERT(false && "Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_DEST"); break; } break; @@ -857,7 +857,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar SelectImplicitTargetObjectTargets(effIndex, targetType); break; default: - ASSERT("Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT"); + ASSERT(false && "Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT"); break; } break; @@ -2861,34 +2861,6 @@ bool Spell::UpdateChanneledTargetList() return channelTargetEffectMask == 0; } -// Helper for Chain Healing -// Spell target first -// Raidmates then descending by injury suffered (MaxHealth - Health) -// Other players/mobs then descending by injury suffered (MaxHealth - Health) -struct ChainHealingOrder : public std::binary_function -{ - const Unit* MainTarget; - ChainHealingOrder(Unit const* Target) : MainTarget(Target) {}; - // functor for operator ">" - bool operator()(Unit const* _Left, Unit const* _Right) const - { - return (ChainHealingHash(_Left) < ChainHealingHash(_Right)); - } - - int32 ChainHealingHash(Unit const* Target) const - { - if (Target->GetTypeId() == TYPEID_PLAYER && MainTarget->GetTypeId() == TYPEID_PLAYER && Target->ToPlayer()->IsInSameRaidWith(MainTarget->ToPlayer())) - { - if (Target->IsFullHealth()) - return 40000; - else - return 20000 - Target->GetMaxHealth() + Target->GetHealth(); - } - else - return 40000 - Target->GetMaxHealth() + Target->GetHealth(); - } -}; - void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggeredByAura) { if (m_CastItem) From b0985b4d5f98186a28b82fb9d92380de1fadafd1 Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 2 Mar 2012 17:14:14 -0500 Subject: [PATCH 0100/1149] Core/Misc: Remove redundant implicit template types in some std::make_pair calls. Should allow the build in Visual Studio 2011 --- src/server/game/AI/CoreAI/PetAI.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 30ebd06745f..eedba4d8b7e 100755 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -174,7 +174,7 @@ void PetAI::UpdateAI(const uint32 diff) if (spell->CanAutoCast(target)) { - targetSpellStore.push_back(std::make_pair(target, spell)); + targetSpellStore.push_back(std::make_pair(target, spell)); spellUsed = true; break; } @@ -186,7 +186,7 @@ void PetAI::UpdateAI(const uint32 diff) { Spell* spell = new Spell(me, spellInfo, TRIGGERED_NONE, 0); if (spell->CanAutoCast(me->getVictim())) - targetSpellStore.push_back(std::make_pair(me->getVictim(), spell)); + targetSpellStore.push_back(std::make_pair(me->getVictim(), spell)); else delete spell; } From a08fe16d6967798b3dcb92ef03399b34c29e2597 Mon Sep 17 00:00:00 2001 From: QAston Date: Sat, 3 Mar 2012 00:19:00 +0100 Subject: [PATCH 0101/1149] Core/Spells: Allow spell effects to have multiple destinations. Spells like: 49814, 10869 and similar are now properly selecting destination targets. --- src/server/game/Spells/Spell.cpp | 241 +++++++++++------- src/server/game/Spells/Spell.h | 41 +-- src/server/game/Spells/SpellEffects.cpp | 99 +++---- src/server/game/Spells/SpellInfo.cpp | 4 +- src/server/game/Spells/SpellScript.cpp | 17 +- src/server/game/Spells/SpellScript.h | 3 +- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 6 +- src/server/scripts/Spells/spell_dk.cpp | 6 +- 8 files changed, 223 insertions(+), 194 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 9ae298ebb13..2ffa94371f9 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -56,6 +56,35 @@ extern pEffect SpellEffects[TOTAL_SPELL_EFFECTS]; +SpellDestination::SpellDestination() +{ + _position.Relocate(0, 0, 0, 0); + _transportGUID = 0; + _transportOffset.Relocate(0, 0, 0, 0); +} + +SpellDestination::SpellDestination(float x, float y, float z, float orientation, uint32 mapId) +{ + _position.Relocate(x, y, z, orientation); + _transportGUID = 0; + _position.m_mapId = mapId; +} + +SpellDestination::SpellDestination(Position const& pos) +{ + _position.Relocate(pos); + _transportGUID = 0; +} + +SpellDestination::SpellDestination(WorldObject const& wObj) +{ + _transportGUID = wObj.GetTransGUID(); + _transportOffset.Relocate(wObj.GetTransOffsetX(), wObj.GetTransOffsetY(), wObj.GetTransOffsetZ(), wObj.GetTransOffsetO()); + _position.Relocate(wObj); + _position.SetOrientation(wObj.GetOrientation()); +} + + SpellCastTargets::SpellCastTargets() : m_elevation(0), m_speed(0) { m_objectTarget = NULL; @@ -65,12 +94,6 @@ SpellCastTargets::SpellCastTargets() : m_elevation(0), m_speed(0) m_itemTargetGUID = 0; m_itemTargetEntry = 0; - m_srcTransGUID = 0; - m_srcTransOffset.Relocate(0, 0, 0, 0); - m_srcPos.Relocate(0, 0, 0, 0); - m_dstTransGUID = 0; - m_dstTransOffset.Relocate(0, 0, 0, 0); - m_dstPos.Relocate(0, 0, 0, 0); m_strTarget = ""; m_targetMask = 0; } @@ -94,36 +117,36 @@ void SpellCastTargets::Read(ByteBuffer& data, Unit* caster) if (m_targetMask & TARGET_FLAG_SOURCE_LOCATION) { - data.readPackGUID(m_srcTransGUID); - if (m_srcTransGUID) - data >> m_srcTransOffset.PositionXYZStream(); + data.readPackGUID(m_src._transportGUID); + if (m_src._transportGUID) + data >> m_src._transportOffset.PositionXYZStream(); else - data >> m_srcPos.PositionXYZStream(); + data >> m_src._position.PositionXYZStream(); } else { - m_srcTransGUID = caster->GetTransGUID(); - if (m_srcTransGUID) - m_srcTransOffset.Relocate(caster->GetTransOffsetX(), caster->GetTransOffsetY(), caster->GetTransOffsetZ(), caster->GetTransOffsetO()); + m_src._transportGUID = caster->GetTransGUID(); + if (m_src._transportGUID) + m_src._transportOffset.Relocate(caster->GetTransOffsetX(), caster->GetTransOffsetY(), caster->GetTransOffsetZ(), caster->GetTransOffsetO()); else - m_srcPos.Relocate(caster); + m_src._position.Relocate(caster); } if (m_targetMask & TARGET_FLAG_DEST_LOCATION) { - data.readPackGUID(m_dstTransGUID); - if (m_dstTransGUID) - data >> m_dstTransOffset.PositionXYZStream(); + data.readPackGUID(m_dst._transportGUID); + if (m_dst._transportGUID) + data >> m_dst._transportOffset.PositionXYZStream(); else - data >> m_dstPos.PositionXYZStream(); + data >> m_dst._position.PositionXYZStream(); } else { - m_dstTransGUID = caster->GetTransGUID(); - if (m_dstTransGUID) - m_dstTransOffset.Relocate(caster->GetTransOffsetX(), caster->GetTransOffsetY(), caster->GetTransOffsetZ(), caster->GetTransOffsetO()); + m_dst._transportGUID = caster->GetTransGUID(); + if (m_dst._transportGUID) + m_dst._transportOffset.Relocate(caster->GetTransOffsetX(), caster->GetTransOffsetY(), caster->GetTransOffsetZ(), caster->GetTransOffsetO()); else - m_dstPos.Relocate(caster); + m_dst._position.Relocate(caster); } if (m_targetMask & TARGET_FLAG_STRING) @@ -149,20 +172,20 @@ void SpellCastTargets::Write(ByteBuffer& data) if (m_targetMask & TARGET_FLAG_SOURCE_LOCATION) { - data.appendPackGUID(m_srcTransGUID); // relative position guid here - transport for example - if (m_srcTransGUID) - data << m_srcTransOffset.PositionXYZStream(); + data.appendPackGUID(m_src._transportGUID); // relative position guid here - transport for example + if (m_src._transportGUID) + data << m_src._transportOffset.PositionXYZStream(); else - data << m_srcPos.PositionXYZStream(); + data << m_src._position.PositionXYZStream(); } if (m_targetMask & TARGET_FLAG_DEST_LOCATION) { - data.appendPackGUID(m_dstTransGUID); // relative position guid here - transport for example - if (m_dstTransGUID) - data << m_dstTransOffset.PositionXYZStream(); + data.appendPackGUID(m_dst._transportGUID); // relative position guid here - transport for example + if (m_dst._transportGUID) + data << m_dst._transportOffset.PositionXYZStream(); else - data << m_dstPos.PositionXYZStream(); + data << m_dst._position.PositionXYZStream(); } if (m_targetMask & TARGET_FLAG_STRING) @@ -295,31 +318,31 @@ void SpellCastTargets::UpdateTradeSlotItem() } } -Position const* SpellCastTargets::GetSrc() const +SpellDestination const* SpellCastTargets::GetSrc() const { - return &m_srcPos; + return &m_src; +} + +Position const* SpellCastTargets::GetSrcPos() const +{ + return &m_src._position; } void SpellCastTargets::SetSrc(float x, float y, float z) { - m_srcPos.Relocate(x, y, z); - m_srcTransGUID = 0; + m_src = SpellDestination(x, y, z); m_targetMask |= TARGET_FLAG_SOURCE_LOCATION; } void SpellCastTargets::SetSrc(Position const& pos) { - m_srcPos.Relocate(pos); - m_srcTransGUID = 0; + m_src = SpellDestination(pos); m_targetMask |= TARGET_FLAG_SOURCE_LOCATION; } void SpellCastTargets::SetSrc(WorldObject const& wObj) { - uint64 guid = wObj.GetTransGUID(); - m_srcTransGUID = guid; - m_srcTransOffset.Relocate(wObj.GetTransOffsetX(), wObj.GetTransOffsetY(), wObj.GetTransOffsetZ(), wObj.GetTransOffsetO()); - m_srcPos.Relocate(wObj); + m_src = SpellDestination(wObj); m_targetMask |= TARGET_FLAG_SOURCE_LOCATION; } @@ -327,13 +350,13 @@ void SpellCastTargets::ModSrc(Position const& pos) { ASSERT(m_targetMask & TARGET_FLAG_SOURCE_LOCATION); - if (m_srcTransGUID) + if (m_src._transportGUID) { Position offset; - m_srcPos.GetPositionOffsetTo(pos, offset); - m_srcTransOffset.RelocateOffset(offset); + m_src._position.GetPositionOffsetTo(pos, offset); + m_src._transportOffset.RelocateOffset(offset); } - m_srcPos.Relocate(pos); + m_src._position.Relocate(pos); } void SpellCastTargets::RemoveSrc() @@ -341,41 +364,37 @@ void SpellCastTargets::RemoveSrc() m_targetMask &= ~(TARGET_FLAG_SOURCE_LOCATION); } -WorldLocation const* SpellCastTargets::GetDst() const +SpellDestination const* SpellCastTargets::GetDst() const { - return &m_dstPos; + return &m_dst; +} + +WorldLocation const* SpellCastTargets::GetDstPos() const +{ + return &m_dst._position; } void SpellCastTargets::SetDst(float x, float y, float z, float orientation, uint32 mapId) { - m_dstPos.Relocate(x, y, z, orientation); - m_dstTransGUID = 0; + m_dst = SpellDestination(x, y, z, orientation, mapId); m_targetMask |= TARGET_FLAG_DEST_LOCATION; - if (mapId != MAPID_INVALID) - m_dstPos.m_mapId = mapId; } void SpellCastTargets::SetDst(Position const& pos) { - m_dstPos.Relocate(pos); - m_dstTransGUID = 0; + m_dst = SpellDestination(pos); m_targetMask |= TARGET_FLAG_DEST_LOCATION; } void SpellCastTargets::SetDst(WorldObject const& wObj) { - uint64 guid = wObj.GetTransGUID(); - m_dstTransGUID = guid; - m_dstTransOffset.Relocate(wObj.GetTransOffsetX(), wObj.GetTransOffsetY(), wObj.GetTransOffsetZ(), wObj.GetTransOffsetO()); - m_dstPos.Relocate(wObj); + m_dst = SpellDestination(wObj); m_targetMask |= TARGET_FLAG_DEST_LOCATION; } void SpellCastTargets::SetDst(SpellCastTargets const& spellTargets) { - m_dstTransGUID = spellTargets.m_dstTransGUID; - m_dstTransOffset.Relocate(spellTargets.m_dstTransOffset); - m_dstPos.Relocate(spellTargets.m_dstPos); + m_dst = spellTargets.m_dst; m_targetMask |= TARGET_FLAG_DEST_LOCATION; } @@ -383,13 +402,13 @@ void SpellCastTargets::ModDst(Position const& pos) { ASSERT(m_targetMask & TARGET_FLAG_DEST_LOCATION); - if (m_dstTransGUID) + if (m_dst._transportGUID) { Position offset; - m_dstPos.GetPositionOffsetTo(pos, offset); - m_dstTransOffset.RelocateOffset(offset); + m_dst._position.GetPositionOffsetTo(pos, offset); + m_dst._transportOffset.RelocateOffset(offset); } - m_dstPos.Relocate(pos); + m_dst._position.Relocate(pos); } void SpellCastTargets::RemoveDst() @@ -417,21 +436,21 @@ void SpellCastTargets::Update(Unit* caster) } // update positions by transport move - if (HasSrc() && m_srcTransGUID) + if (HasSrc() && m_src._transportGUID) { - if (WorldObject* transport = ObjectAccessor::GetWorldObject(*caster, m_srcTransGUID)) + if (WorldObject* transport = ObjectAccessor::GetWorldObject(*caster, m_src._transportGUID)) { - m_srcPos.Relocate(transport); - m_srcPos.RelocateOffset(m_srcTransOffset); + m_src._position.Relocate(transport); + m_src._position.RelocateOffset(m_src._transportOffset); } } - if (HasDst() && m_dstTransGUID) + if (HasDst() && m_dst._transportGUID) { - if (WorldObject* transport = ObjectAccessor::GetWorldObject(*caster, m_dstTransGUID)) + if (WorldObject* transport = ObjectAccessor::GetWorldObject(*caster, m_dst._transportGUID)) { - m_dstPos.Relocate(transport); - m_dstPos.RelocateOffset(m_dstTransOffset); + m_dst._position.Relocate(transport); + m_dst._position.RelocateOffset(m_dst._transportOffset); } } } @@ -449,9 +468,9 @@ void SpellCastTargets::OutDebug() const if (m_targetMask & TARGET_FLAG_TRADE_ITEM) sLog->outString("Trade item target: " UI64FMTD, m_itemTargetGUID); if (m_targetMask & TARGET_FLAG_SOURCE_LOCATION) - sLog->outString("Source location: transport guid:" UI64FMTD " trans offset: %s position: %s", m_srcTransGUID, m_srcTransOffset.ToString().c_str(), m_srcPos.ToString().c_str()); + sLog->outString("Source location: transport guid:" UI64FMTD " trans offset: %s position: %s", m_src._transportGUID, m_src._transportOffset.ToString().c_str(), m_src._position.ToString().c_str()); if (m_targetMask & TARGET_FLAG_DEST_LOCATION) - sLog->outString("Destination location: transport guid:" UI64FMTD " trans offset: %s position: %s", m_dstTransGUID, m_dstTransOffset.ToString().c_str(), m_dstPos.ToString().c_str()); + sLog->outString("Destination location: transport guid:" UI64FMTD " trans offset: %s position: %s", m_dst._transportGUID, m_dst._transportOffset.ToString().c_str(), m_dst._position.ToString().c_str()); if (m_targetMask & TARGET_FLAG_STRING) sLog->outString("String: %s", m_strTarget.c_str()); sLog->outString("speed: %f", m_speed); @@ -564,6 +583,11 @@ m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharme CleanupTargetList(); CleanupEffectExecuteData(); + + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + m_destTargets[i] = SpellDestination(*m_caster); + } } Spell::~Spell() @@ -720,6 +744,9 @@ void Spell::SelectSpellTargets() // some spell effects don't add anything to target map (confirmed with sniffs) (like SPELL_EFFECT_DESTROY_ALL_TOTEMS) SelectEffectTypeImplicitTargets(i); + if (m_targets.HasDst()) + AddDestTarget(*m_targets.GetDst(), i); + if (m_spellInfo->IsChanneled()) { uint8 mask = (1 << i); @@ -767,7 +794,7 @@ void Spell::SelectSpellTargets() } else if (m_spellInfo->Speed > 0.0f) { - float dist = m_caster->GetDistance(*m_targets.GetDst()); + float dist = m_caster->GetDistance(*m_targets.GetDstPos()); m_delayMoment = (uint64) floor(dist / m_spellInfo->Speed * 1000.0f); } } @@ -1092,10 +1119,10 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge switch (targetType.GetReferenceType()) { case TARGET_REFERENCE_TYPE_SRC: - center = m_targets.GetSrc(); + center = m_targets.GetSrcPos(); break; case TARGET_REFERENCE_TYPE_DEST: - center = m_targets.GetDst(); + center = m_targets.GetDstPos(); break; case TARGET_REFERENCE_TYPE_CASTER: case TARGET_REFERENCE_TYPE_TARGET: @@ -1467,7 +1494,7 @@ void Spell::SelectImplicitDestDestTargets(SpellEffIndex effIndex, SpellImplicitT if (targetType.GetTarget() == TARGET_DEST_DEST_RANDOM) dist *= (float)rand_norm(); - Position pos = *m_targets.GetDst(); + Position pos = *m_targets.GetDstPos(); m_caster->MovePosition(pos, dist, angle); m_targets.ModDst(pos); } @@ -1581,12 +1608,12 @@ void Spell::SelectImplicitTrajTargets() if (!dist2d) return; - float srcToDestDelta = m_targets.GetDst()->m_positionZ - m_targets.GetSrc()->m_positionZ; + float srcToDestDelta = m_targets.GetDstPos()->m_positionZ - m_targets.GetSrcPos()->m_positionZ; std::list targets; - Trinity::WorldObjectSpellTrajTargetCheck check(dist2d, m_targets.GetSrc(), m_caster, m_spellInfo); + Trinity::WorldObjectSpellTrajTargetCheck check(dist2d, m_targets.GetSrcPos(), m_caster, m_spellInfo); Trinity::WorldObjectListSearcher searcher(m_caster, targets, check, GRID_MAP_TYPE_MASK_ALL); - SearchTargets > (searcher, GRID_MAP_TYPE_MASK_ALL, m_caster, m_targets.GetSrc(), dist2d); + SearchTargets > (searcher, GRID_MAP_TYPE_MASK_ALL, m_caster, m_targets.GetSrcPos(), dist2d); if (targets.empty()) return; @@ -1609,8 +1636,8 @@ void Spell::SelectImplicitTrajTargets() const float size = std::max((*itr)->GetObjectSize() * 0.7f, 1.0f); // 1/sqrt(3) // TODO: all calculation should be based on src instead of m_caster - const float objDist2d = m_targets.GetSrc()->GetExactDist2d(*itr) * cos(m_targets.GetSrc()->GetRelativeAngle(*itr)); - const float dz = (*itr)->GetPositionZ() - m_targets.GetSrc()->m_positionZ; + const float objDist2d = m_targets.GetSrcPos()->GetExactDist2d(*itr) * cos(m_targets.GetSrcPos()->GetRelativeAngle(*itr)); + const float dz = (*itr)->GetPositionZ() - m_targets.GetSrcPos()->m_positionZ; DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: check %u, dist between %f %f, height between %f %f.", (*itr)->GetEntry(), objDist2d - size, objDist2d + size, dz - size, dz + size);) @@ -1675,11 +1702,11 @@ void Spell::SelectImplicitTrajTargets() } } - if (m_targets.GetSrc()->GetExactDist2d(m_targets.GetDst()) > bestDist) + if (m_targets.GetSrcPos()->GetExactDist2d(m_targets.GetDstPos()) > bestDist) { - float x = m_targets.GetSrc()->m_positionX + cos(m_caster->GetOrientation()) * bestDist; - float y = m_targets.GetSrc()->m_positionY + sin(m_caster->GetOrientation()) * bestDist; - float z = m_targets.GetSrc()->m_positionZ + bestDist * (a * bestDist + b); + float x = m_targets.GetSrcPos()->m_positionX + cos(m_caster->GetOrientation()) * bestDist; + float y = m_targets.GetSrcPos()->m_positionY + sin(m_caster->GetOrientation()) * bestDist; + float z = m_targets.GetSrcPos()->m_positionZ + bestDist * (a * bestDist + b); if (itr != targets.end()) { @@ -2216,12 +2243,6 @@ void Spell::AddGOTarget(GameObject* go, uint32 effectMask) m_UniqueGOTargetInfo.push_back(target); } -void Spell::AddGOTarget(uint64 goGUID, uint32 effectMask) -{ - if (GameObject* go = m_caster->GetMap()->GetGameObject(goGUID)) - AddGOTarget(go, effectMask); -} - void Spell::AddItemTarget(Item* item, uint32 effectMask) { for (uint32 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex) @@ -2251,6 +2272,11 @@ void Spell::AddItemTarget(Item* item, uint32 effectMask) m_UniqueItemInfo.push_back(target); } +void Spell::AddDestTarget(SpellDestination const& dest, uint32 effIndex) +{ + m_destTargets[effIndex] = dest; +} + void Spell::DoAllEffectOnTarget(TargetInfo* target) { if (!target || target->processed) @@ -4577,6 +4603,7 @@ void Spell::HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOT unitTarget = pUnitTarget; itemTarget = pItemTarget; gameObjTarget = pGOTarget; + destTarget = &m_destTargets[i]._position; uint8 eff = m_spellInfo->Effects[i].Effect; @@ -4817,7 +4844,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_targets.HasDst()) { float x, y, z; - m_targets.GetDst()->GetPosition(x, y, z); + m_targets.GetDstPos()->GetPosition(x, y, z); if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOS(x, y, z)) return SPELL_FAILED_LINE_OF_SIGHT; @@ -5754,9 +5781,9 @@ SpellCastResult Spell::CheckRange(bool strict) if (m_targets.HasDst() && !m_targets.HasTraj()) { - if (!m_caster->IsWithinDist3d(m_targets.GetDst(), max_range)) + if (!m_caster->IsWithinDist3d(m_targets.GetDstPos(), max_range)) return SPELL_FAILED_OUT_OF_RANGE; - if (min_range && m_caster->IsWithinDist3d(m_targets.GetDst(), min_range)) + if (min_range && m_caster->IsWithinDist3d(m_targets.GetDstPos(), min_range)) return SPELL_FAILED_TOO_CLOSE; } @@ -6403,6 +6430,30 @@ void Spell::UpdatePointers() m_CastItem = m_caster->ToPlayer()->GetItemByGuid(m_castItemGUID); m_targets.Update(m_caster); + + // further actions done only for dest targets + if (!m_targets.HasDst()) + return; + + // cache last transport + WorldObject* transport = NULL; + + // update effect destinations (in case of moved transport dest target) + for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex) + { + SpellDestination& dest = m_destTargets[effIndex]; + if (!dest._transportGUID) + continue; + + if (!transport || transport->GetGUID() != dest._transportGUID) + transport = ObjectAccessor::GetWorldObject(*m_caster, dest._transportGUID); + + if (transport) + { + dest._position.Relocate(transport); + dest._position.RelocateOffset(dest._transportOffset); + } + } } CurrentSpellTypes Spell::GetCurrentContainer() const diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 971bc1989ab..f897092e519 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -79,6 +79,18 @@ enum SpellRangeFlag SPELL_RANGE_RANGED = 2, //hunter range and ranged weapon }; +struct SpellDestination +{ + SpellDestination(); + SpellDestination(float x, float y, float z, float orientation = 0.0f, uint32 mapId = MAPID_INVALID); + SpellDestination(Position const& pos); + SpellDestination(WorldObject const& wObj); + + WorldLocation _position; + uint64 _transportGUID; + Position _transportOffset; +}; + class SpellCastTargets { public: @@ -115,14 +127,16 @@ class SpellCastTargets void SetTradeItemTarget(Player* caster); void UpdateTradeSlotItem(); - Position const* GetSrc() const; + SpellDestination const* GetSrc() const; + Position const* GetSrcPos() const; void SetSrc(float x, float y, float z); void SetSrc(Position const& pos); void SetSrc(WorldObject const& wObj); void ModSrc(Position const& pos); void RemoveSrc(); - WorldLocation const* GetDst() const; + SpellDestination const* GetDst() const; + WorldLocation const* GetDstPos() const; void SetDst(float x, float y, float z, float orientation, uint32 mapId = MAPID_INVALID); void SetDst(Position const& pos); void SetDst(WorldObject const& wObj); @@ -139,7 +153,7 @@ class SpellCastTargets float GetSpeed() const { return m_speed; } void SetSpeed(float speed) { m_speed = speed; } - float GetDist2d() const { return m_srcPos.GetExactDist2d(&m_dstPos); } + float GetDist2d() const { return m_src._position.GetExactDist2d(&m_dst._position); } float GetSpeedXY() const { return m_speed * cos(m_elevation); } float GetSpeedZ() const { return m_speed * sin(m_elevation); } @@ -158,13 +172,8 @@ class SpellCastTargets uint64 m_itemTargetGUID; uint32 m_itemTargetEntry; - uint64 m_srcTransGUID; - Position m_srcTransOffset; - Position m_srcPos; - - uint64 m_dstTransGUID; - Position m_dstTransOffset; - WorldLocation m_dstPos; + SpellDestination m_src; + SpellDestination m_dst; float m_elevation, m_speed; std::string m_strTarget; @@ -197,11 +206,6 @@ enum SpellEffectHandleMode SPELL_EFFECT_HANDLE_HIT_TARGET, }; -namespace Trinity -{ - struct SpellNotifierCreatureAndPlayer; -} - class Spell { friend void Unit::SetCurrentCastedSpell(Spell* pSpell); @@ -529,6 +533,7 @@ class Spell Unit* unitTarget; Item* itemTarget; GameObject* gameObjTarget; + WorldLocation* destTarget; int32 damage; SpellEffectHandleMode effectHandleMode; // used in effects handlers @@ -589,10 +594,13 @@ class Spell }; std::list m_UniqueItemInfo; + SpellDestination m_destTargets[MAX_SPELL_EFFECTS]; + void AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid = true); void AddGOTarget(GameObject* target, uint32 effectMask); - void AddGOTarget(uint64 goGUID, uint32 effectMask); void AddItemTarget(Item* item, uint32 effectMask); + void AddDestTarget(SpellDestination const& dest, uint32 effIndex); + void DoAllEffectOnTarget(TargetInfo* target); SpellMissInfo DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleAura); void DoTriggersOnSpellHit(Unit* unit, uint8 effMask); @@ -631,7 +639,6 @@ class Spell HitTriggerSpells m_hitTriggerSpells; // effect helpers - void GetSummonPosition(uint32 i, Position &pos, float radius = 0.0f, uint32 count = 0); void SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* properties, uint32 numSummons); void CalculateJumpSpeeds(uint8 i, float dist, float & speedxy, float & speedz); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 511d2877f24..59b6d8971cf 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -800,7 +800,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) bp = 46585; if (m_targets.HasDst()) - targets.SetDst(*m_targets.GetDst()); + targets.SetDst(*m_targets.GetDstPos()); else { targets.SetDst(*m_caster); @@ -814,8 +814,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) // Raise dead - take reagents and trigger summon spells case 48289: if (m_targets.HasDst()) - targets.SetDst(*m_targets.GetDst()); - + targets.SetDst(*m_targets.GetDstPos()); spell_id = CalculateDamage(0, NULL); break; } @@ -1177,7 +1176,7 @@ void Spell::EffectJumpDest(SpellEffIndex effIndex) // Init dest coordinates float x, y, z; - m_targets.GetDst()->GetPosition(x, y, z); + destTarget->GetPosition(x, y, z); float speedXY, speedZ; CalculateJumpSpeeds(effIndex, m_caster->GetExactDist2d(x, y), speedXY, speedZ); @@ -1250,11 +1249,11 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/) } // Init dest coordinates - uint32 mapid = m_targets.GetDst()->GetMapId(); + uint32 mapid = destTarget->GetMapId(); if (mapid == MAPID_INVALID) mapid = unitTarget->GetMapId(); float x, y, z, orientation; - m_targets.GetDst()->GetPosition(x, y, z, orientation); + destTarget->GetPosition(x, y, z, orientation); if (!orientation && m_targets.GetUnitTarget()) orientation = m_targets.GetUnitTarget()->GetOrientation(); sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTeleportUnits - teleport unit to %u %f %f %f %f\n", mapid, x, y, z, orientation); @@ -1883,7 +1882,7 @@ void Spell::EffectPersistentAA(SpellEffIndex effIndex) if (!caster->IsInWorld()) return; DynamicObject* dynObj = new DynamicObject(false); - if (!dynObj->CreateDynamicObject(sObjectMgr->GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), caster, m_spellInfo->Id, *m_targets.GetDst(), radius, DYNAMIC_OBJECT_AREA_SPELL)) + if (!dynObj->CreateDynamicObject(sObjectMgr->GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), caster, m_spellInfo->Id, *destTarget, radius, DYNAMIC_OBJECT_AREA_SPELL)) { delete dynObj; return; @@ -2357,9 +2356,6 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) if (Player* modOwner = m_originalCaster->GetSpellModOwner()) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration); - Position pos; - GetSummonPosition(effIndex, pos); - TempSummon* summon = NULL; // determine how many units should be summoned @@ -2413,11 +2409,11 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) // Summons a vehicle, but doesn't force anyone to enter it (see SUMMON_CATEGORY_VEHICLE) case SUMMON_TYPE_VEHICLE: case SUMMON_TYPE_VEHICLE2: - summon = m_caster->GetMap()->SummonCreature(entry, pos, properties, duration, m_originalCaster, m_spellInfo->Id); + summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id); break; case SUMMON_TYPE_TOTEM: { - summon = m_caster->GetMap()->SummonCreature(entry, pos, properties, duration, m_originalCaster, m_spellInfo->Id); + summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id); if (!summon || !summon->isTotem()) return; @@ -2434,7 +2430,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) } case SUMMON_TYPE_MINIPET: { - summon = m_caster->GetMap()->SummonCreature(entry, pos, properties, duration, m_originalCaster, m_spellInfo->Id); + summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id); if (!summon || !summon->HasUnitTypeMask(UNIT_MASK_MINION)) return; @@ -2454,9 +2450,14 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) for (uint32 count = 0; count < numSummons; ++count) { - GetSummonPosition(effIndex, pos, radius, count); + Position pos; + if (count == 0) + pos = *destTarget; + else + // randomize position for multiple summons + m_caster->GetRandomPoint(*destTarget, radius, pos); - summon = m_originalCaster->SummonCreature(entry, pos, summonType, duration); + summon = m_originalCaster->SummonCreature(entry, *destTarget, summonType, duration); if (!summon) continue; @@ -2477,14 +2478,14 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) SummonGuardian(effIndex, entry, properties, numSummons); break; case SUMMON_CATEGORY_PUPPET: - summon = m_caster->GetMap()->SummonCreature(entry, pos, properties, duration, m_originalCaster, m_spellInfo->Id); + summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id); break; case SUMMON_CATEGORY_VEHICLE: // Summoning spells (usually triggered by npc_spellclick) that spawn a vehicle and that cause the clicker // to cast a ride vehicle spell on the summoned unit. float x, y, z; m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE); - summon = m_originalCaster->GetMap()->SummonCreature(entry, pos, properties, duration, m_caster, m_spellInfo->Id); + summon = m_originalCaster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_caster, m_spellInfo->Id); if (!summon || !summon->IsVehicle()) return; @@ -2706,7 +2707,7 @@ void Spell::EffectDistract(SpellEffIndex /*effIndex*/) if (unitTarget->HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING)) return; - unitTarget->SetFacingTo(unitTarget->GetAngle(m_targets.GetDst())); + unitTarget->SetFacingTo(unitTarget->GetAngle(destTarget)); unitTarget->ClearUnitState(UNIT_STATE_MOVING); if (unitTarget->GetTypeId() == TYPEID_UNIT) @@ -2745,7 +2746,7 @@ void Spell::EffectAddFarsight(SpellEffIndex effIndex) return; DynamicObject* dynObj = new DynamicObject(true); - if (!dynObj->CreateDynamicObject(sObjectMgr->GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, *m_targets.GetDst(), radius, DYNAMIC_OBJECT_FARSIGHT_FOCUS)) + if (!dynObj->CreateDynamicObject(sObjectMgr->GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, *destTarget, radius, DYNAMIC_OBJECT_FARSIGHT_FOCUS)) { delete dynObj; return; @@ -3689,7 +3690,7 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex) float x, y, z; if (m_targets.HasDst()) - m_targets.GetDst()->GetPosition(x, y, z); + destTarget->GetPosition(x, y, z); else m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE); @@ -4232,7 +4233,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) float radius = m_spellInfo->Effects[effIndex].CalcRadius(); for (uint8 i = 0; i < 15; ++i) { - m_caster->GetRandomPoint(*m_targets.GetDst(), radius, x, y, z); + m_caster->GetRandomPoint(*destTarget, radius, x, y, z); m_caster->CastSpell(x, y, z, 54522, true); } break; @@ -5268,7 +5269,7 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex) float x, y, z; // If dest location if present if (m_targets.HasDst()) - m_targets.GetDst()->GetPosition(x, y, z); + destTarget->GetPosition(x, y, z); // Summon in random point all other units if location present else m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE); @@ -5398,7 +5399,7 @@ void Spell::EffectLeap(SpellEffIndex /*effIndex*/) return; Position pos; - m_targets.GetDst()->GetPosition(&pos); + destTarget->GetPosition(&pos); unitTarget->GetFirstCollisionPosition(pos, unitTarget->GetDistance(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ() + 2.0f), 0.0f); unitTarget->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), unitTarget == m_caster); } @@ -5569,7 +5570,7 @@ void Spell::EffectChargeDest(SpellEffIndex /*effIndex*/) if (m_targets.HasDst()) { Position pos; - m_targets.GetDst()->GetPosition(&pos); + destTarget->GetPosition(&pos); float angle = m_caster->GetRelativeAngle(pos.GetPositionX(), pos.GetPositionY()); float dist = m_caster->GetDistance(pos); m_caster->GetFirstCollisionPosition(pos, dist, angle); @@ -5620,7 +5621,7 @@ void Spell::EffectKnockBack(SpellEffIndex effIndex) if (m_spellInfo->Effects[effIndex].Effect == SPELL_EFFECT_KNOCK_BACK_DEST) { if (m_targets.HasDst()) - m_targets.GetDst()->GetPosition(x, y); + destTarget->GetPosition(x, y); else return; } @@ -5708,7 +5709,7 @@ void Spell::EffectPullTowards(SpellEffIndex effIndex) if (m_spellInfo->Effects[effIndex].Effect == SPELL_EFFECT_PULL_TOWARDS_DEST) { if (m_targets.HasDst()) - pos.Relocate(*m_targets.GetDst()); + pos.Relocate(*destTarget); else return; } @@ -5895,7 +5896,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex) float fx, fy, fz; if (m_targets.HasDst()) - m_targets.GetDst()->GetPosition(fx, fy, fz); + destTarget->GetPosition(fx, fy, fz); //FIXME: this can be better check for most objects but still hack else if (m_spellInfo->Effects[effIndex].HasRadius() && m_spellInfo->Speed == 0) { @@ -6476,7 +6477,11 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* for (uint32 count = 0; count < numGuardians; ++count) { Position pos; - GetSummonPosition(i, pos, radius, count); + if (count == 0) + pos = *destTarget; + else + // randomize position for multiple summons + m_caster->GetRandomPoint(*destTarget, radius, pos); TempSummon* summon = map->SummonCreature(entry, pos, properties, duration, caster, m_spellInfo->Id); if (!summon) @@ -6507,44 +6512,6 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* } } -void Spell::GetSummonPosition(uint32 i, Position &pos, float radius, uint32 count) -{ - pos.SetOrientation(m_caster->GetOrientation()); - - if (m_targets.HasDst()) - { - // Summon 1 unit in dest location - if (count == 0) - pos.Relocate(*m_targets.GetDst()); - // Summon in random point all other units if location present - else - { - //This is a workaround. Do not have time to write much about it - switch (m_spellInfo->Effects[i].TargetA.GetTarget()) - { - case TARGET_DEST_CASTER_SUMMON: - case TARGET_DEST_CASTER_RANDOM: - m_caster->GetNearPosition(pos, radius * (float)rand_norm(), (float)rand_norm()*static_cast(2*M_PI)); - break; - case TARGET_DEST_DEST_RANDOM: - case TARGET_DEST_TARGET_RANDOM: - m_caster->GetRandomPoint(*m_targets.GetDst(), radius, pos); - break; - default: - pos.Relocate(*m_targets.GetDst()); - break; - } - } - } - // Summon if dest location not present near caster - else - { - float x, y, z; - m_caster->GetClosePoint(x, y, z, 3.0f); - pos.Relocate(x, y, z); - } -} - void Spell::EffectRenamePet(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 5b0e453edc9..b95ee766f38 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -99,7 +99,7 @@ float SpellImplicitTargetInfo::CalcDirectionAngle() const case TARGET_DIR_LEFT: return static_cast(M_PI/2); case TARGET_DIR_FRONT_RIGHT: - return static_cast(M_PI/4); + return static_cast(-M_PI/4); case TARGET_DIR_BACK_RIGHT: return static_cast(-3*M_PI/4); case TARGET_DIR_BACK_LEFT: @@ -614,7 +614,7 @@ SpellEffectInfo::StaticData SpellEffectInfo::_data[TOTAL_SPELL_EFFECTS] = {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 66 SPELL_EFFECT_CREATE_MANA_GEM {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 67 SPELL_EFFECT_HEAL_MAX_HEALTH {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 68 SPELL_EFFECT_INTERRUPT_CAST - {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 69 SPELL_EFFECT_DISTRACT + {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT_AND_DEST}, // 69 SPELL_EFFECT_DISTRACT {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 70 SPELL_EFFECT_PULL {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 71 SPELL_EFFECT_PICKPOCKET {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_DEST}, // 72 SPELL_EFFECT_ADD_FARSIGHT diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 03fea614c0d..81f8bbd78c5 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -323,7 +323,7 @@ SpellInfo const* SpellScript::GetSpellInfo() WorldLocation const* SpellScript::GetTargetDest() { if (m_spell->m_targets.HasDst()) - return m_spell->m_targets.GetDst(); + return m_spell->m_targets.GetDstPos(); return NULL; } @@ -403,6 +403,16 @@ GameObject* SpellScript::GetHitGObj() return m_spell->gameObjTarget; } +WorldLocation const* SpellScript::GetHitDest() +{ + if (!IsInEffectHook()) + { + sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitGObj was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + return NULL; + } + return m_spell->destTarget; +} + int32 SpellScript::GetHitDamage() { if (!IsInTargetHook()) @@ -468,11 +478,6 @@ void SpellScript::PreventHitAura() m_spell->m_spellAura->Remove(); } -void SpellScript::GetSummonPosition(uint32 i, Position &pos, float radius = 0.0f, uint32 count = 0) -{ - m_spell->GetSummonPosition(i, pos, radius, count); -} - void SpellScript::PreventHitEffect(SpellEffIndex effIndex) { if (!IsInHitPhase() && !IsInEffectHook()) diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index 1bf8d25adef..e84a56c8dbb 100755 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -324,6 +324,8 @@ class SpellScript : public _SpellScript Item* GetHitItem(); // returns: target of current effect if it was GameObject otherwise NULL GameObject* GetHitGObj(); + // returns: destination of current effect + WorldLocation const* GetHitDest(); // setter/getter for for damage done by spell to target of spell hit // returns damage calculated before hit, and real dmg done after hit int32 GetHitDamage(); @@ -335,7 +337,6 @@ class SpellScript : public _SpellScript void SetHitHeal(int32 heal); void PreventHitHeal() { SetHitHeal(0); } Spell* GetSpell() { return m_spell; } - void GetSummonPosition(uint32 i, Position &pos, float radius, uint32 count); // returns current spell hit target aura Aura* GetHitAura(); // prevents applying aura on current spell hit target diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 408ebf3cc96..98b20f1c424 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -1756,7 +1756,7 @@ class spell_vehicle_throw_passenger : public SpellScriptLoader if (Unit* device = seat->GetPassenger(2)) if (!device->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) { - float dist = unit->GetExactDistSq(targets.GetDst()); + float dist = unit->GetExactDistSq(targets.GetDstPos()); if (dist < minDist) { minDist = dist; @@ -1764,13 +1764,13 @@ class spell_vehicle_throw_passenger : public SpellScriptLoader } } } - if (target && target->IsWithinDist2d(targets.GetDst(), GetSpellInfo()->Effects[effIndex].CalcRadius() * 2)) // now we use *2 because the location of the seat is not correct + if (target && target->IsWithinDist2d(targets.GetDstPos(), GetSpellInfo()->Effects[effIndex].CalcRadius() * 2)) // now we use *2 because the location of the seat is not correct passenger->EnterVehicle(target, 0); else { passenger->ExitVehicle(); float x, y, z; - targets.GetDst()->GetPosition(x, y, z); + targets.GetDstPos()->GetPosition(x, y, z); passenger->GetMotionMaster()->MoveJump(x, y, z, targets.GetSpeedXY(), targets.GetSpeedZ()); } } diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index ee554f4875a..a6128591e71 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -772,13 +772,11 @@ class spell_dk_death_grip : public SpellScriptLoader void HandleDummy(SpellEffIndex effIndex) { int32 damage = GetEffectValue(); - Position pos; + Position const* pos = GetTargetDest(); if (Unit* target = GetHitUnit()) { - GetSummonPosition(effIndex, pos, 0.0f, 0); - if (!target->HasAuraType(SPELL_AURA_DEFLECT_SPELLS)) // Deterrence - target->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), damage, true); + target->CastSpell(pos->GetPositionX(), pos->GetPositionY(), pos->GetPositionZ(), damage, true); } } From d1e4eb051239c51f84e07938077da82f99367e8d Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 3 Mar 2012 16:12:28 +0100 Subject: [PATCH 0102/1149] Core/Commands: Implement .debug moveflags command. With params you can set MoveFlags and MoveFlagsExtra for targeted unit. Without params it will display the current MoveFlags and MoveFlagsExtra. Useful for debugging upcoming changes. --- .../world/2012_03_03_00_world_command.sql | 9 +++++ src/server/game/Miscellaneous/Language.h | 4 ++- src/server/scripts/Commands/cs_debug.cpp | 34 +++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_03_03_00_world_command.sql diff --git a/sql/updates/world/2012_03_03_00_world_command.sql b/sql/updates/world/2012_03_03_00_world_command.sql new file mode 100644 index 00000000000..52938c0b76b --- /dev/null +++ b/sql/updates/world/2012_03_03_00_world_command.sql @@ -0,0 +1,9 @@ +DELETE FROM `command` WHERE `name` LIKE 'debug moveflags'; +INSERT INTO `command` (`name`,`security`,`help`) VALUES +('debug moveflags',3,'Syntax: .debug moveflags [$newMoveFlags [$newMoveFlags2]]\r\nNo params given will output the current moveflags of the target'); + +DELETE FROM `trinity_string` WHERE `entry` IN(1143,1144); +INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES +(1143,'Target''s moveFlags: %u, moveFlagsExtra: %u.'), +(1144,'Target''s moveFlags set to: %u, moveFlagsExtra to: %u'); + diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index e751dbf92fe..547f1679b61 100755 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -811,7 +811,9 @@ enum TrinityStrings LANG_MOVEGENS_FOLLOW_CREATURE = 1140, LANG_MOVEGENS_FOLLOW_NULL = 1141, LANG_MOVEGENS_EFFECT = 1142, - // Room for more level 3 1143-1199 not used + LANG_MOVEFLAGS_GET = 1143, + LANG_MOVEFLAGS_SET = 1144, + // Room for more level 3 1144-1199 not used // Debug commands LANG_CINEMATIC_NOT_EXIST = 1200, diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 8ca40231090..d4c94061e01 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -89,6 +89,7 @@ public: { "itemexpire", SEC_ADMINISTRATOR, false, &HandleDebugItemExpireCommand, "", NULL }, { "areatriggers", SEC_ADMINISTRATOR, false, &HandleDebugAreaTriggersCommand, "", NULL }, { "los", SEC_MODERATOR, false, &HandleDebugLoSCommand, "", NULL }, + { "moveflags", SEC_ADMINISTRATOR, false, &HandleDebugMoveflagsCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = @@ -1283,6 +1284,39 @@ public: handler->PSendSysMessage(LANG_SET_32BIT_FIELD, opcode, value); return true; } + + static bool HandleDebugMoveflagsCommand(ChatHandler* handler, char const* args) + { + Unit* target = handler->getSelectedUnit(); + if (!target) + target = handler->GetSession()->GetPlayer(); + + if (!*args) + { + //! Display case + handler->PSendSysMessage(LANG_MOVEFLAGS_GET, target->GetUnitMovementFlags(), target->GetExtraUnitMovementFlags()); + } + else + { + char* mask1 = strtok((char*)args, " "); + if (!mask1) + return false; + + char* mask2 = strtok(NULL, " \n"); + + uint32 moveFlags = (uint32)atoi(mask1); + target->SetUnitMovementFlags(moveFlags); + + if (mask2) + { + uint32 moveFlagsExtra = uint32(atoi(mask2)); + target->SetExtraUnitMovementFlags(moveFlagsExtra); + } + + target->SendMovementFlagUpdate(); + handler->PSendSysMessage(LANG_MOVEFLAGS_SET, target->GetUnitMovementFlags(), target->GetExtraUnitMovementFlags()); + } + } }; void AddSC_debug_commandscript() From cbee39a4dcece9dc5722e7cc8a30d3365c1057d1 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 3 Mar 2012 16:23:16 +0100 Subject: [PATCH 0103/1149] Fix a warning. --- src/server/scripts/Commands/cs_debug.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index d4c94061e01..9646a881fc0 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1316,6 +1316,8 @@ public: target->SendMovementFlagUpdate(); handler->PSendSysMessage(LANG_MOVEFLAGS_SET, target->GetUnitMovementFlags(), target->GetExtraUnitMovementFlags()); } + + return true; } }; From c4fd6b89dba06ad8e42065f8aebeb8101d4ccaab Mon Sep 17 00:00:00 2001 From: Discover- Date: Sat, 3 Mar 2012 23:41:29 +0100 Subject: [PATCH 0104/1149] Core/SAI: SMART_ACTION_MOVE_TO_POS will now have param1 as PointId. This means you can now (properly) use SMART_EVENT_MOVEMENTINFORM when reaching the point you make the NPC move to. Wiki is updated accordingly. --- src/server/game/AI/SmartScripts/SmartScript.cpp | 6 +++--- src/server/game/AI/SmartScripts/SmartScriptMgr.h | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 80ded6681c9..0523f59da5d 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1373,10 +1373,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u target = targets->front(); } - if(!target) - me->GetMotionMaster()->MovePoint(0, e.target.x, e.target.y, e.target.z); + if (!target) + me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, e.target.x, e.target.y, e.target.z); else - me->GetMotionMaster()->MovePoint(0, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); + me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); break; } case SMART_ACTION_RESPAWN_TARGET: diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 9af0c4de9fc..007b57b52d7 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -441,7 +441,7 @@ enum SMART_ACTION SMART_ACTION_CREATE_TIMED_EVENT = 67, // id, InitialMin, InitialMax, RepeatMin(only if it repeats), RepeatMax(only if it repeats), chance SMART_ACTION_PLAYMOVIE = 68, // entry - SMART_ACTION_MOVE_TO_POS = 69, // xyz + SMART_ACTION_MOVE_TO_POS = 69, // PointId, xyz SMART_ACTION_RESPAWN_TARGET = 70, // SMART_ACTION_EQUIP = 71, // entry, slotmask slot1, slot2, slot3 , only slots with mask set will be sent to client, bits are 1, 2, 4, leaving mask 0 is defaulted to mask 7 (send all), slots1-3 are only used if no entry is set SMART_ACTION_CLOSE_GOSSIP = 72, // none @@ -872,6 +872,11 @@ struct SmartAction uint32 goRespawnTime; } RespawnTarget; + struct + { + uint8 pointId; + } MoveToPos; + struct { uint32 gossipMenuId; From c48a1ad17db9b623795d24bbe83d77247b6ef756 Mon Sep 17 00:00:00 2001 From: Discover- Date: Sun, 4 Mar 2012 02:45:21 +0100 Subject: [PATCH 0105/1149] Scripts/Misc: Script entrance areatriggers for Area 52. --- ...03_04_00_world_creature_template_addon.sql | 13 ++++++ .../scripts/World/areatrigger_scripts.cpp | 43 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 sql/updates/world/2012_03_04_00_world_creature_template_addon.sql diff --git a/sql/updates/world/2012_03_04_00_world_creature_template_addon.sql b/sql/updates/world/2012_03_04_00_world_creature_template_addon.sql new file mode 100644 index 00000000000..358dc651735 --- /dev/null +++ b/sql/updates/world/2012_03_04_00_world_creature_template_addon.sql @@ -0,0 +1,13 @@ +-- Spotlight aura for spotlight NPC +DELETE FROM `creature_template_addon` WHERE `entry`=19913; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(19913,0,0,0,0,'39312'); + +-- Scriptnames for areatriggers +SET @AT_AREA_52_SOUTHSET := 4472; +SET @AT_AREA_52_NORTHSET := 4466; +SET @AT_AREA_52_WESTSET := 4471; +SET @AT_AREA_52_EASTSET := 4422; +DELETE FROM `areatrigger_scripts` WHERE `entry` IN (@AT_AREA_52_SOUTH,@AT_AREA_52_NORTH,@AT_AREA_52_WEST,@AT_AREA_52_EAST) +INSERT INTO `areatrigger_scripts` (`entry`,`ScriptName`) VALUES +(@AT_AREA_52_SOUTH,"at_area_52_entrance"),(@AT_AREA_52_NORTH,"at_area_52_entrance"),(@AT_AREA_52_WEST,"at_area_52_entrance"),(@AT_AREA_52_EAST,"at_area_52_entrance"); diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp index 8f86f760775..77f3a64a13f 100644 --- a/src/server/scripts/World/areatrigger_scripts.cpp +++ b/src/server/scripts/World/areatrigger_scripts.cpp @@ -32,6 +32,7 @@ at_sholazar_waygate q12548 at_nats_landing q11209 at_bring_your_orphan_to q910 q910 q1800 q1479 q1687 q1558 q10951 q10952 at_brewfest +at_area_52_entrance EndContentData */ #include "ScriptPCH.h" @@ -420,6 +421,47 @@ class AreaTrigger_at_brewfest : public AreaTriggerScript std::map _triggerTimes; }; +/*###### +## at_area_52_entrance +######*/ + +enum Area52Entrance +{ + NPC_SPOTLIGHT = 19913, + SUMMON_COOLDOWN = 5, + + AT_AREA_52_SOUTH = 4472, + AT_AREA_52_NORTH = 4466, + AT_AREA_52_WEST = 4471, + AT_AREA_52_EAST = 4422, +}; + +class AreaTrigger_at_area_52_entrance : public AreaTriggerScript +{ + public: + AreaTrigger_at_area_52_entrance() : AreaTriggerScript("at_area_52_entrance") + { + _triggerTimes[AT_AREA_52_SOUTH] = _triggerTimes[AT_AREA_52_NORTH] = _triggerTimes[AT_AREA_52_WEST] = _triggerTimes[AT_AREA_52_EAST] = 0; + } + + bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) + { + if (!player->isAlive()) + return false; + + if (sWorld->GetGameTime() - _triggerTimes[trigger->id] < SUMMON_COOLDOWN) + return false; + + player->SummonCreature(NPC_SPOTLIGHT, trigger->x, trigger->y, trigger->z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000); + + _triggerTimes[trigger->id] = sWorld->GetGameTime(); + return false; + } + + private: + std::map _triggerTimes; +}; + void AddSC_areatrigger_scripts() { new AreaTrigger_at_coilfang_waterfall(); @@ -431,4 +473,5 @@ void AddSC_areatrigger_scripts() new AreaTrigger_at_nats_landing(); new AreaTrigger_at_bring_your_orphan_to(); new AreaTrigger_at_brewfest(); + new AreaTrigger_at_area_52_entrance(); } From 48a4950cac0269d431df630cf7da3550d443120c Mon Sep 17 00:00:00 2001 From: Vincent-Core Date: Sun, 4 Mar 2012 13:19:20 +0100 Subject: [PATCH 0106/1149] Core/Quest: Fix MovementInform handler filter for Quest "The Amphitheater of Anguish: Tuskarrmageddon!" --- src/server/scripts/Northrend/zuldrak.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/Northrend/zuldrak.cpp b/src/server/scripts/Northrend/zuldrak.cpp index 835ad144501..4cea6d8d8aa 100644 --- a/src/server/scripts/Northrend/zuldrak.cpp +++ b/src/server/scripts/Northrend/zuldrak.cpp @@ -617,9 +617,9 @@ public: pWhisker->RemoveFromWorld(); } - void MovementInform(uint32 uiType, uint32 /*uiId*/) + void MovementInform(uint32 type, uint32 /*pointId*/) { - if (uiType != POINT_MOTION_TYPE) + if (type != EFFECT_MOTION_TYPE) return; me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); From 1776b16773cbff1262ef62268b7a6827ac002c07 Mon Sep 17 00:00:00 2001 From: Discover- Date: Sun, 4 Mar 2012 13:19:47 +0100 Subject: [PATCH 0107/1149] DB/Misc: Fix SQL of c48a1ad17db9b623795d24bbe83d77247b6ef756 --- ...template_addon.sql => 2012_03_04_00_world_misc.sql} | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename sql/updates/world/{2012_03_04_00_world_creature_template_addon.sql => 2012_03_04_00_world_misc.sql} (73%) diff --git a/sql/updates/world/2012_03_04_00_world_creature_template_addon.sql b/sql/updates/world/2012_03_04_00_world_misc.sql similarity index 73% rename from sql/updates/world/2012_03_04_00_world_creature_template_addon.sql rename to sql/updates/world/2012_03_04_00_world_misc.sql index 358dc651735..af556f648b8 100644 --- a/sql/updates/world/2012_03_04_00_world_creature_template_addon.sql +++ b/sql/updates/world/2012_03_04_00_world_misc.sql @@ -4,10 +4,10 @@ INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote` (19913,0,0,0,0,'39312'); -- Scriptnames for areatriggers -SET @AT_AREA_52_SOUTHSET := 4472; -SET @AT_AREA_52_NORTHSET := 4466; -SET @AT_AREA_52_WESTSET := 4471; -SET @AT_AREA_52_EASTSET := 4422; -DELETE FROM `areatrigger_scripts` WHERE `entry` IN (@AT_AREA_52_SOUTH,@AT_AREA_52_NORTH,@AT_AREA_52_WEST,@AT_AREA_52_EAST) +SET @AT_AREA_52_SOUTH := 4472; +SET @AT_AREA_52_NORTH := 4466; +SET @AT_AREA_52_WEST := 4471; +SET @AT_AREA_52_EAST := 4422; +DELETE FROM `areatrigger_scripts` WHERE `entry` IN (@AT_AREA_52_SOUTH,@AT_AREA_52_NORTH,@AT_AREA_52_WEST,@AT_AREA_52_EAST); INSERT INTO `areatrigger_scripts` (`entry`,`ScriptName`) VALUES (@AT_AREA_52_SOUTH,"at_area_52_entrance"),(@AT_AREA_52_NORTH,"at_area_52_entrance"),(@AT_AREA_52_WEST,"at_area_52_entrance"),(@AT_AREA_52_EAST,"at_area_52_entrance"); From 4029c2354739a42388b9d3cb4a1f3cdf6a3bff86 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 4 Mar 2012 08:23:19 -0500 Subject: [PATCH 0108/1149] Core/Collisions: Reverted a commit about M2 models. closes #5312 and probably others --- src/server/collision/Management/VMapManager2.cpp | 3 +-- src/server/collision/Management/VMapManager2.h | 2 +- src/server/collision/Maps/MapTree.cpp | 4 ++-- src/server/collision/Models/WorldModel.cpp | 3 --- src/server/collision/Models/WorldModel.h | 1 - 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/server/collision/Management/VMapManager2.cpp b/src/server/collision/Management/VMapManager2.cpp index 81b97f5f352..62abc31831a 100644 --- a/src/server/collision/Management/VMapManager2.cpp +++ b/src/server/collision/Management/VMapManager2.cpp @@ -245,7 +245,7 @@ namespace VMAP return false; } - WorldModel* VMapManager2::acquireModelInstance(const std::string& basepath, const std::string& filename, uint32 flags/* Only used when creating the model */) + WorldModel* VMapManager2::acquireModelInstance(const std::string& basepath, const std::string& filename) { //! Critical section, thread safe access to iLoadedModelFiles TRINITY_GUARD(ACE_Thread_Mutex, LoadedModelFilesLock); @@ -261,7 +261,6 @@ namespace VMAP return NULL; } sLog->outDebug(LOG_FILTER_MAPS, "VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str()); - worldmodel->Flags = flags; model = iLoadedModelFiles.insert(std::pair(filename, ManagedModel())).first; model->second.setModel(worldmodel); } diff --git a/src/server/collision/Management/VMapManager2.h b/src/server/collision/Management/VMapManager2.h index 4b66a2e9fc7..1fba108388a 100755 --- a/src/server/collision/Management/VMapManager2.h +++ b/src/server/collision/Management/VMapManager2.h @@ -103,7 +103,7 @@ namespace VMAP bool getAreaInfo(unsigned int pMapId, float x, float y, float& z, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const; bool GetLiquidLevel(uint32 pMapId, float x, float y, float z, uint8 reqLiquidType, float& level, float& floor, uint32& type) const; - WorldModel* acquireModelInstance(const std::string& basepath, const std::string& filename, uint32 flags = 0); + WorldModel* acquireModelInstance(const std::string& basepath, const std::string& filename); void releaseModelInstance(const std::string& filename); // what's the use of this? o.O diff --git a/src/server/collision/Maps/MapTree.cpp b/src/server/collision/Maps/MapTree.cpp index f94f9bbf52b..f4a3f1c7b30 100644 --- a/src/server/collision/Maps/MapTree.cpp +++ b/src/server/collision/Maps/MapTree.cpp @@ -309,7 +309,7 @@ namespace VMAP #endif if (!iIsTiled && ModelSpawn::readFromFile(rf, spawn)) { - WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name, spawn.flags); + WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name); sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : loading %s", spawn.name.c_str()); if (model) { @@ -380,7 +380,7 @@ namespace VMAP if (result) { // acquire model instance - WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name, spawn.flags); + WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name); if (!model) sLog->outError("StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [%u, %u]", tileX, tileY); diff --git a/src/server/collision/Models/WorldModel.cpp b/src/server/collision/Models/WorldModel.cpp index cda34510058..d4b08dde5dd 100644 --- a/src/server/collision/Models/WorldModel.cpp +++ b/src/server/collision/Models/WorldModel.cpp @@ -421,9 +421,6 @@ namespace VMAP bool WorldModel::IntersectRay(const G3D::Ray &ray, float &distance, bool stopAtFirstHit) const { - // M2 models are not taken into account for LoS calculation - if (Flags & MOD_M2) - return false; // small M2 workaround, maybe better make separate class with virtual intersection funcs // in any case, there's no need to use a bound tree if we only have one submodel if (groupModels.size() == 1) diff --git a/src/server/collision/Models/WorldModel.h b/src/server/collision/Models/WorldModel.h index dbaccb58573..ebf828e4935 100755 --- a/src/server/collision/Models/WorldModel.h +++ b/src/server/collision/Models/WorldModel.h @@ -113,7 +113,6 @@ namespace VMAP bool GetLocationInfo(const G3D::Vector3 &p, const G3D::Vector3 &down, float &dist, LocationInfo &info) const; bool writeFile(const std::string &filename); bool readFile(const std::string &filename); - uint32 Flags; protected: uint32 RootWMOID; std::vector groupModels; From 33a04897dea56ec8d6f60c5cfa12aa3688a7c694 Mon Sep 17 00:00:00 2001 From: leak Date: Sun, 4 Mar 2012 15:18:34 +0100 Subject: [PATCH 0109/1149] Core/Shared: Remove unused functions --- src/server/shared/Cryptography/HMACSHA1.cpp | 12 +----------- src/server/shared/Cryptography/HMACSHA1.h | 2 -- src/server/shared/Cryptography/SHA1.h | 1 - 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/server/shared/Cryptography/HMACSHA1.cpp b/src/server/shared/Cryptography/HMACSHA1.cpp index 447d0b58efc..c9de1191464 100755 --- a/src/server/shared/Cryptography/HMACSHA1.cpp +++ b/src/server/shared/Cryptography/HMACSHA1.cpp @@ -31,19 +31,9 @@ HmacHash::~HmacHash() HMAC_CTX_cleanup(&m_ctx); } -void HmacHash::UpdateBigNumber(BigNumber* bn) -{ - UpdateData(bn->AsByteArray(), bn->GetNumBytes()); -} - -void HmacHash::UpdateData(const uint8 *data, int length) -{ - HMAC_Update(&m_ctx, data, length); -} - void HmacHash::UpdateData(const std::string &str) { - UpdateData((uint8 const*)str.c_str(), str.length()); + HMAC_Update(&m_ctx, (uint8 const*)str.c_str(), str.length()); } void HmacHash::Finalize() diff --git a/src/server/shared/Cryptography/HMACSHA1.h b/src/server/shared/Cryptography/HMACSHA1.h index bd0418b600e..4b7667968ca 100755 --- a/src/server/shared/Cryptography/HMACSHA1.h +++ b/src/server/shared/Cryptography/HMACSHA1.h @@ -33,8 +33,6 @@ class HmacHash public: HmacHash(uint32 len, uint8 *seed); ~HmacHash(); - void UpdateBigNumber(BigNumber* bn); - void UpdateData(const uint8 *data, int length); void UpdateData(const std::string &str); void Finalize(); uint8 *ComputeHash(BigNumber* bn); diff --git a/src/server/shared/Cryptography/SHA1.h b/src/server/shared/Cryptography/SHA1.h index b5bf97fd7d9..7c77defebfa 100755 --- a/src/server/shared/Cryptography/SHA1.h +++ b/src/server/shared/Cryptography/SHA1.h @@ -31,7 +31,6 @@ class SHA1Hash SHA1Hash(); ~SHA1Hash(); - void UpdateFinalizeBigNumbers(BigNumber* bn0, ...); void UpdateBigNumbers(BigNumber* bn0, ...); void UpdateData(const uint8 *dta, int len); From 576c659a9c15dc342fdf7aa97fb9c308d1996aae Mon Sep 17 00:00:00 2001 From: click Date: Sun, 4 Mar 2012 16:17:28 +0100 Subject: [PATCH 0110/1149] Buildsystem/CMake: Enable SFMT as default random number generator (required to get more feedback from community) Also update the revisionheader with the correct year :P --- cmake/options.cmake | 4 ++-- revision.h.in.cmake | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/options.cmake b/cmake/options.cmake index 17edc2697b7..4af22e0ed3d 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -10,9 +10,9 @@ option(SERVERS "Build worldserver and authserver" 1) option(SCRIPTS "Build core with scripts included" 1) -option(TOOLS "Build map/vmap extraction/assembler tools" 0) +option(TOOLS "Build map/vmap extraction/assembler tools" 1) option(USE_SCRIPTPCH "Use precompiled headers when compiling scripts" 1) option(USE_COREPCH "Use precompiled headers when compiling servers" 1) -option(USE_SFMT "Use SFMT as random numbergenerator" 0) +option(USE_SFMT "Use SFMT as random numbergenerator" 1) option(WITH_WARNINGS "Show all warnings during compile" 0) option(WITH_COREDEBUG "Include additional debug-code in core" 0) diff --git a/revision.h.in.cmake b/revision.h.in.cmake index 9212b8060ef..b553bb2f26f 100644 --- a/revision.h.in.cmake +++ b/revision.h.in.cmake @@ -3,7 +3,7 @@ #define _HASH "@rev_hash@" #define _DATE "@rev_date@" #define VER_COMPANYNAME_STR "TrinityCore Developers" - #define VER_LEGALCOPYRIGHT_STR "(c)2008-2011 TrinityCore" + #define VER_LEGALCOPYRIGHT_STR "(c)2008-2012 TrinityCore" #define VER_FILEVERSION 0,0,0 #define VER_FILEVERSION_STR "@rev_date@ (@rev_hash@)" #define VER_PRODUCTVERSION VER_FILEVERSION From ab65bb4b572d928770360a2a8775f728861cb1e8 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sun, 4 Mar 2012 19:24:38 +0200 Subject: [PATCH 0111/1149] Core/Misc: Make ObjectAccessor::FindPlayerByName case-insensitive --- src/server/game/Globals/ObjectAccessor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp index dd5e6189b44..b9b5abc37df 100755 --- a/src/server/game/Globals/ObjectAccessor.cpp +++ b/src/server/game/Globals/ObjectAccessor.cpp @@ -168,7 +168,7 @@ Player* ObjectAccessor::FindPlayerByName(const char* name) TRINITY_READ_GUARD(HashMapHolder::LockType, *HashMapHolder::GetLock()); HashMapHolder::MapType const& m = GetPlayers(); for (HashMapHolder::MapType::const_iterator iter = m.begin(); iter != m.end(); ++iter) - if (iter->second->IsInWorld() && strcmp(name, iter->second->GetName()) == 0) + if (iter->second->IsInWorld() && strcmpi(name, iter->second->GetName()) == 0) return iter->second; return NULL; From 15a3ad7276125b17cdb50c4ac1d832627fbc31f4 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sun, 4 Mar 2012 20:12:55 +0200 Subject: [PATCH 0112/1149] Core/Misc: Fix gcc compile --- src/server/game/Globals/ObjectAccessor.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp index b9b5abc37df..9a99a28c7aa 100755 --- a/src/server/game/Globals/ObjectAccessor.cpp +++ b/src/server/game/Globals/ObjectAccessor.cpp @@ -166,10 +166,18 @@ Unit* ObjectAccessor::FindUnit(uint64 guid) Player* ObjectAccessor::FindPlayerByName(const char* name) { TRINITY_READ_GUARD(HashMapHolder::LockType, *HashMapHolder::GetLock()); + std::string nameStr = name; + std::transform(nameStr.begin(), nameStr.end(), nameStr.begin(), ::tolower); HashMapHolder::MapType const& m = GetPlayers(); for (HashMapHolder::MapType::const_iterator iter = m.begin(); iter != m.end(); ++iter) - if (iter->second->IsInWorld() && strcmpi(name, iter->second->GetName()) == 0) + { + if (!iter->second->IsInWorld()) + continue; + std::string currentName = iter->second->GetName(); + std::transform(currentName.begin(), currentName.end(), currentName.begin(), ::tolower); + if (nameStr.compare(currentName) == 0) return iter->second; + } return NULL; } From 54fc5c0974b1f1edb0512dca0b0c63cd1bb4bb07 Mon Sep 17 00:00:00 2001 From: Souler Date: Sun, 4 Mar 2012 20:45:13 +0100 Subject: [PATCH 0113/1149] Core/Arenas/Dalaran Sewers: Repeat the central waterfall knockback while it stills active. --- .../game/Battlegrounds/Zones/BattlegroundDS.cpp | 14 ++++++++++++++ .../game/Battlegrounds/Zones/BattlegroundDS.h | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp index 7db03381407..1d042f20384 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp @@ -65,6 +65,19 @@ void BattlegroundDS::PostUpdateImpl(uint32 diff) setPipeKnockBackTimer(getPipeKnockBackTimer() - diff); } + if (getWaterFallStatus() == BG_DS_WATERFALL_STATUS_ON) // Repeat knockback while the waterfall still active + { + if (getWaterFallKnockbackTimer() < diff) + { + if (Creature* waterSpout = GetBgMap()->GetCreature(BgCreatures[BG_DS_NPC_WATERFALL_KNOCKBACK])) + waterSpout->CastSpell(waterSpout, BG_DS_SPELL_WATER_SPOUT, true); + + setWaterFallKnockbackTimer(BG_DS_WATERFALL_KNOCKBACK_TIMER); + } + else + setWaterFallKnockbackTimer(getWaterFallKnockbackTimer() - diff); + } + if (getWaterFallTimer() < diff) { if (getWaterFallStatus() == BG_DS_WATERFALL_STATUS_OFF) // Add the water @@ -83,6 +96,7 @@ void BattlegroundDS::PostUpdateImpl(uint32 diff) setWaterFallTimer(BG_DS_WATERFALL_DURATION); setWaterFallStatus(BG_DS_WATERFALL_STATUS_ON); + setWaterFallKnockbackTimer(BG_DS_WATERFALL_KNOCKBACK_TIMER); } else //if (getWaterFallStatus() == BG_DS_WATERFALL_STATUS_ON) // Remove collision and water { diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h index a10e75eb6f4..12ed91fc922 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h @@ -68,6 +68,8 @@ enum BattlegroundDSData BG_DS_WATERFALL_TIMER_MAX = 60000, BG_DS_WATERFALL_WARNING_DURATION = 7000, BG_DS_WATERFALL_DURATION = 10000, + BG_DS_WATERFALL_KNOCKBACK_TIMER = 500, + BG_DS_PIPE_KNOCKBACK_FIRST_DELAY = 5000, BG_DS_PIPE_KNOCKBACK_DELAY = 3000, BG_DS_PIPE_KNOCKBACK_TOTAL_COUNT = 2, @@ -106,6 +108,7 @@ class BattlegroundDS : public Battleground private: uint32 _waterfallTimer; uint8 _waterfallStatus; + uint32 _waterfallKnockbackTimer; uint32 _pipeKnockBackTimer; uint8 _pipeKnockBackCount; @@ -115,6 +118,8 @@ class BattlegroundDS : public Battleground void setWaterFallStatus(uint8 status) { _waterfallStatus = status; }; uint32 getWaterFallTimer() { return _waterfallTimer; }; void setWaterFallTimer(uint32 timer) { _waterfallTimer = timer; }; + uint32 getWaterFallKnockbackTimer() { return _waterfallTimer; }; + void setWaterFallKnockbackTimer(uint32 timer) { _waterfallKnockbackTimer = timer; }; uint8 getPipeKnockBackCount() { return _pipeKnockBackCount; }; void setPipeKnockBackCount(uint8 count) { _pipeKnockBackCount = count; }; uint32 getPipeKnockBackTimer() { return _pipeKnockBackTimer; }; From b0c70f4380fe6c3c5f7857310c63c60c05c2f851 Mon Sep 17 00:00:00 2001 From: Souler Date: Sun, 4 Mar 2012 20:46:13 +0100 Subject: [PATCH 0114/1149] Core/Arenas/Dalaran Sewers: Remove demonic circle on arena start and when players jump off from the pipes. --- src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp index 1d042f20384..065b08b60be 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp @@ -139,6 +139,12 @@ void BattlegroundDS::StartingEventOpenDoors() // Turn off collision if (GameObject* gob = GetBgMap()->GetGameObject(BgObjects[BG_DS_OBJECT_WATER_1])) gob->SetGoState(GO_STATE_ACTIVE); + + // Remove effects of Demonic Circle Summon + for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) + if (Player* player = ObjectAccessor::FindPlayer(itr->first)) + if (itr->HasAura(48018)) + itr->RemoveAurasDueToSpell(48018); } void BattlegroundDS::AddPlayer(Player* player) @@ -187,6 +193,10 @@ void BattlegroundDS::HandleAreaTrigger(Player* Source, uint32 Trigger) { case 5347: case 5348: + // Remove effects of Demonic Circle Summon + if (Source->HasAura(48018)) + Source->RemoveAurasDueToSpell(48018); + // Someone has get back into the pipes and the knockback has already been performed, // so we reset the knockback count for kicking the player again into the arena. if (getPipeKnockBackCount() >= BG_DS_PIPE_KNOCKBACK_TOTAL_COUNT) From 45ef7dbfcba4625d514f5e4d07e34634f3282292 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 4 Mar 2012 16:44:27 -0330 Subject: [PATCH 0115/1149] Add handling for areatriggers at Area 52 entances. --- ...012_03_04_01_world_areatrigger_scripts.sql | 7 +++ .../scripts/World/areatrigger_scripts.cpp | 44 +++++++++++++++---- 2 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 sql/updates/world/2012_03_04_01_world_areatrigger_scripts.sql diff --git a/sql/updates/world/2012_03_04_01_world_areatrigger_scripts.sql b/sql/updates/world/2012_03_04_01_world_areatrigger_scripts.sql new file mode 100644 index 00000000000..ae4a0bc1f77 --- /dev/null +++ b/sql/updates/world/2012_03_04_01_world_areatrigger_scripts.sql @@ -0,0 +1,7 @@ +-- Add Area trigger scripts +DELETE FROM `areatrigger_scripts` WHERE `entry` IN (4422,4466,4471,4472); +INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES +(4422,'at_area_52_entrance'), +(4466,'at_area_52_entrance'), +(4471,'at_area_52_entrance'), +(4472,'at_area_52_entrance'); diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp index 77f3a64a13f..d8a90b2ffd5 100644 --- a/src/server/scripts/World/areatrigger_scripts.cpp +++ b/src/server/scripts/World/areatrigger_scripts.cpp @@ -427,13 +427,14 @@ class AreaTrigger_at_brewfest : public AreaTriggerScript enum Area52Entrance { - NPC_SPOTLIGHT = 19913, - SUMMON_COOLDOWN = 5, + SPELL_A52_NEURALYZER = 34400, + NPC_SPOTLIGHT = 19913, + SUMMON_COOLDOWN = 5, - AT_AREA_52_SOUTH = 4472, - AT_AREA_52_NORTH = 4466, - AT_AREA_52_WEST = 4471, - AT_AREA_52_EAST = 4422, + AT_AREA_52_SOUTH = 4472, + AT_AREA_52_NORTH = 4466, + AT_AREA_52_WEST = 4471, + AT_AREA_52_EAST = 4422, }; class AreaTrigger_at_area_52_entrance : public AreaTriggerScript @@ -446,14 +447,41 @@ class AreaTrigger_at_area_52_entrance : public AreaTriggerScript bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) { + float x, y, z; + if (!player->isAlive()) return false; + uint32 triggerId = trigger->id; if (sWorld->GetGameTime() - _triggerTimes[trigger->id] < SUMMON_COOLDOWN) return false; - player->SummonCreature(NPC_SPOTLIGHT, trigger->x, trigger->y, trigger->z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000); + switch (triggerId) + { + case AT_AREA_52_EAST: + x = 3044.176f; + y = 3610.692f; + z = 143.61f; + break; + case AT_AREA_52_NORTH: + x = 3114.87f; + y = 3687.619f; + z = 143.62f; + break; + case AT_AREA_52_WEST: + x = 3017.79f; + y = 3746.806f; + z = 144.27f; + break; + case AT_AREA_52_SOUTH: + x = 2950.63f; + y = 3719.905f; + z = 143.33f; + break; + } + player->SummonCreature(NPC_SPOTLIGHT, x, y, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000); + player->AddAura(SPELL_A52_NEURALYZER, player); _triggerTimes[trigger->id] = sWorld->GetGameTime(); return false; } @@ -474,4 +502,4 @@ void AddSC_areatrigger_scripts() new AreaTrigger_at_bring_your_orphan_to(); new AreaTrigger_at_brewfest(); new AreaTrigger_at_area_52_entrance(); -} +} \ No newline at end of file From 45946e23bac57b1084d7bd42daff1445cb8957e2 Mon Sep 17 00:00:00 2001 From: click Date: Sun, 4 Mar 2012 21:38:57 +0100 Subject: [PATCH 0116/1149] Core: Adjust parameter output values to avoid excessive warning outputs on GCC and some other minor warnings --- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/scripts/Spells/spell_dk.cpp | 2 +- src/server/shared/Packets/ByteBuffer.h | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index dbbb8acf759..3411d285b1e 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16980,7 +16980,7 @@ void Unit::ChangeSeat(int8 seatId, bool next) ASSERT(false); } -void Unit::ExitVehicle(Position const* exitPosition) +void Unit::ExitVehicle(Position const* /*exitPosition*/) { //! This function can be called at upper level code to initialize an exit from the passenger's side. if (!m_vehicle) diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index a6128591e71..e6db50f3f5a 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -769,7 +769,7 @@ class spell_dk_death_grip : public SpellScriptLoader { PrepareSpellScript(spell_dk_death_grip_SpellScript); - void HandleDummy(SpellEffIndex effIndex) + void HandleDummy(SpellEffIndex /*effIndex*/) { int32 damage = GetEffectValue(); Position const* pos = GetTargetDest(); diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index f018eb31bb4..35cb62240d8 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -33,7 +33,6 @@ class ByteBufferException } protected: - size_t Pos; size_t Size; size_t ValueSize; @@ -52,7 +51,7 @@ class ByteBufferPositionException : public ByteBufferException void PrintError() const { sLog->outError("Attempted to %s value with size: "SIZEFMTD" in ByteBuffer (pos: " SIZEFMTD " size: "SIZEFMTD") " , - ValueSize, (_add ? "put" : "get"), Pos, Size); + (_add ? "put" : "get"), ValueSize, Pos, Size); } private: From e9a125f4955c3cc95d70f9654abb013de2a8dbc6 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 4 Mar 2012 22:43:13 +0100 Subject: [PATCH 0117/1149] Buildsystem/CMake: Changed TOOLS building back to off by default --- cmake/options.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/options.cmake b/cmake/options.cmake index 4af22e0ed3d..b9a70339660 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -10,7 +10,7 @@ option(SERVERS "Build worldserver and authserver" 1) option(SCRIPTS "Build core with scripts included" 1) -option(TOOLS "Build map/vmap extraction/assembler tools" 1) +option(TOOLS "Build map/vmap extraction/assembler tools" 0) option(USE_SCRIPTPCH "Use precompiled headers when compiling scripts" 1) option(USE_COREPCH "Use precompiled headers when compiling servers" 1) option(USE_SFMT "Use SFMT as random numbergenerator" 1) From 4b11d67d31bc1851e9029c78ee65fc864e0fa8bf Mon Sep 17 00:00:00 2001 From: Souler Date: Mon, 5 Mar 2012 00:47:59 +0100 Subject: [PATCH 0118/1149] Fix broken-compile introduced in b0c70f4380fe6c3c5f7857310c63c60c05c2f851 --- src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp index 065b08b60be..8a11edf85e6 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp @@ -143,8 +143,8 @@ void BattlegroundDS::StartingEventOpenDoors() // Remove effects of Demonic Circle Summon for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) if (Player* player = ObjectAccessor::FindPlayer(itr->first)) - if (itr->HasAura(48018)) - itr->RemoveAurasDueToSpell(48018); + if (player->HasAura(48018)) + player->RemoveAurasDueToSpell(48018); } void BattlegroundDS::AddPlayer(Player* player) From 680a7083ff0604c1451bd1b83a5c6722edc395a0 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 5 Mar 2012 10:58:52 -0500 Subject: [PATCH 0119/1149] Core/Misc: add level to login/logout logs, it will help to find xp exploits (aokromes) --- src/server/game/Handlers/CharacterHandler.cpp | 4 ++-- src/server/game/Server/WorldSession.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 30119c79d96..15e05ccfbf7 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1002,8 +1002,8 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) SendNotification(LANG_GM_ON); std::string IP_str = GetRemoteAddress(); - sLog->outChar("Account: %d (IP: %s) Login Character:[%s] (GUID: %u)", - GetAccountId(), IP_str.c_str(), pCurrChar->GetName(), pCurrChar->GetGUIDLow()); + sLog->outChar("Account: %d (IP: %s) Login Character:[%s] (GUID: %u) Level: %d", + GetAccountId(), IP_str.c_str(), pCurrChar->GetName(), pCurrChar->GetGUIDLow(), pCurrChar->getLevel()); if (!pCurrChar->IsStandState() && !pCurrChar->HasUnitState(UNIT_STATE_STUNNED)) pCurrChar->SetStandState(UNIT_STAND_STATE_STAND); diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 211ca42d310..48fa95ff6a5 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -537,7 +537,7 @@ void WorldSession::LogoutPlayer(bool Save) // e.g if he got disconnected during a transfer to another map // calls to GetMap in this case may cause crashes _player->CleanupsBeforeDelete(); - sLog->outChar("Account: %d (IP: %s) Logout Character:[%s] (GUID: %u)", GetAccountId(), GetRemoteAddress().c_str(), _player->GetName(), _player->GetGUIDLow()); + sLog->outChar("Account: %d (IP: %s) Logout Character:[%s] (GUID: %u) Level: %d", GetAccountId(), GetRemoteAddress().c_str(), _player->GetName(), _player->GetGUIDLow(), _player->getLevel()); if (Map* _map = _player->FindMap()) _map->RemovePlayerFromMap(_player, true); SetPlayer(NULL); // deleted in Remove call From 429f4b0c20377830a99a6bc7a8da4350ace5c44f Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 5 Mar 2012 11:01:04 -0500 Subject: [PATCH 0120/1149] Core/DBCStruct: update the info for liquidtype (even though it is currently commented out) --- src/server/game/DataStores/DBCStructure.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 1978dbc71f9..0d721e3f832 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1223,16 +1223,19 @@ struct LiquidTypeEntry uint32 type; // 3 0: Water, 1: Ocean, 2: Magma, 3: Slime uint32 soundid; // 4 Reference to SoundEntries.dbc uint32 spellID; // 5 Reference to Spell.dbc - float unk0[4]; // 6-9 - uint32 unk1; // 10 Light? + float maxDarkenDepth // 6 Only Slime (6) and Magma (7) + float fogDarkenIntensity // 7 Only oceans got values here! + float ambDarkenIntensity // 8 Only oceans got values here! + float dirDarkenIntensity // 9 Only oceans got values here! + uint32 lightID // 10 Only Slime (6) and Magma (7) float particleScale // 11 0: Slime, 1: Water/Ocean, 4: Magma - uint32 particleMovement; // 12 - uint32 unk2 // 13 + uint32 particleMovement // 12 + uint32 particleTexSlots // 13 uint32 LiquidMaterialID // 14 Reference to LiquidMaterial.dbc char* texture[6]; // 15-20 - uint32 unk3[2] // 21-22 - float unk4[18]; // 23-40 - uint32 unk5[4] // 41-44 + uint32 color[2] // 21-22 + float floats[18]; // 23-40 Most likely these are attributes for the shaders. Water: (23, TextureTilesPerBlock),(24, Rotation) Magma: (23, AnimationX),(24, AnimationY) + uint32 ints[4] // 41-44 }; */ From a5e598b2c47a0a162da23615324f476b092a3384 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 5 Mar 2012 11:18:36 -0500 Subject: [PATCH 0121/1149] Core/SpellScripts: Fix life tap mana regen (thx to vincent-michael) closes #5536 --- src/server/scripts/Spells/spell_warlock.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 533fd8a2e5c..943834e3f4f 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -388,15 +388,7 @@ class spell_warl_life_tap : public SpellScriptLoader SpellInfo const* spellInfo = GetSpellInfo(); float spFactor = 0.0f; int32 damage = int32(GetEffectValue() + (6.3875 * spellInfo->BaseLevel)); - switch (spellInfo->Id) - { - case SPELL_LIFE_TAP_RANK_6: spFactor = 0.2f; break; - case SPELL_LIFE_TAP_RANK_7: - case SPELL_LIFE_TAP_RANK_8: spFactor = 0.5f; break; - default: break; - } - - int32 mana = int32(damage + (caster->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+SPELL_SCHOOL_SHADOW) * spFactor)); + int32 mana = int32(damage + (caster->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+SPELL_SCHOOL_SHADOW) * 0.5f)); // Shouldn't Appear in Combat Log target->ModifyHealth(-damage); @@ -423,9 +415,7 @@ class spell_warl_life_tap : public SpellScriptLoader SpellCastResult CheckCast() { if ((int32(GetCaster()->GetHealth()) > int32(GetSpellInfo()->Effects[EFFECT_0].CalcValue() + (6.3875 * GetSpellInfo()->BaseLevel)))) - { return SPELL_CAST_OK; - } return SPELL_FAILED_FIZZLE; } From e1550d98e7e3bc931173e049ae2d06284f097db8 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 5 Mar 2012 11:21:53 -0500 Subject: [PATCH 0122/1149] small cleanup --- src/server/scripts/Spells/spell_warlock.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 943834e3f4f..5ae630fcd68 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -348,9 +348,6 @@ class spell_warl_soulshatter : public SpellScriptLoader enum LifeTap { - SPELL_LIFE_TAP_RANK_6 = 11689, - SPELL_LIFE_TAP_RANK_7 = 27222, - SPELL_LIFE_TAP_RANK_8 = 57946, SPELL_LIFE_TAP_ENERGIZE = 31818, SPELL_LIFE_TAP_ENERGIZE_2 = 32553, ICON_ID_IMPROVED_LIFE_TAP = 208, @@ -373,9 +370,7 @@ class spell_warl_life_tap : public SpellScriptLoader bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_RANK_6) || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_RANK_7) - || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_RANK_8) || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_ENERGIZE) - || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_ENERGIZE_2)) + if (!sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_ENERGIZE) || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_ENERGIZE_2)) return false; return true; } From 7683297423e28af82e08170ec9e228c2a1be9d10 Mon Sep 17 00:00:00 2001 From: joschiwald Date: Mon, 5 Mar 2012 23:23:23 +0100 Subject: [PATCH 0123/1149] Core/CreatureTextMgr: Fix typo in LoadCreatureTextLocales() --- src/server/game/Texts/CreatureTextMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index f1088f54007..1651fae9f4c 100755 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -160,7 +160,7 @@ void CreatureTextMgr::LoadCreatureTextLocales() for (uint8 i = 1; i < TOTAL_LOCALES; ++i) { LocaleConstant locale = LocaleConstant(i); - ObjectMgr::AddLocaleString(fields[2 + i - 1].GetString(), locale, loc.Text); + ObjectMgr::AddLocaleString(fields[3 + i - 1].GetString(), locale, loc.Text); } ++textCount; From 96a05600c4eec194d274857547396e3f39c814d7 Mon Sep 17 00:00:00 2001 From: joschiwald Date: Mon, 5 Mar 2012 23:25:32 +0100 Subject: [PATCH 0124/1149] Core/Commands: add command to reload locales_creature_text --- sql/updates/world/2012_03_06_00_world_commands.sql | 3 +++ src/server/scripts/Commands/cs_reload.cpp | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 sql/updates/world/2012_03_06_00_world_commands.sql diff --git a/sql/updates/world/2012_03_06_00_world_commands.sql b/sql/updates/world/2012_03_06_00_world_commands.sql new file mode 100644 index 00000000000..d782a76c70d --- /dev/null +++ b/sql/updates/world/2012_03_06_00_world_commands.sql @@ -0,0 +1,3 @@ +DELETE FROM `command` WHERE `name` = 'reload locales_creature_text'; +INSERT INTO `command` (`name`, `security`, `help`) VALUES +('reload locales_creature_text', 3, 'Syntax: .reload locales_creature_text\nReload locales_creature_text Table.'); \ No newline at end of file diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 361d329ac6b..b6e15ca25ea 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -106,6 +106,7 @@ public: { "lfg_dungeon_rewards", SEC_ADMINISTRATOR, true, &HandleReloadLfgRewardsCommand, "", NULL }, { "locales_achievement_reward", SEC_ADMINISTRATOR, true, &HandleReloadLocalesAchievementRewardCommand, "", NULL }, { "locales_creature", SEC_ADMINISTRATOR, true, &HandleReloadLocalesCreatureCommand, "", NULL }, + { "locales_creature_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesCreatureTextCommand, "", NULL }, { "locales_gameobject", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGameobjectCommand, "", NULL }, { "locales_gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGossipMenuOptionCommand, "", NULL }, { "locales_item", SEC_ADMINISTRATOR, true, &HandleReloadLocalesItemCommand, "", NULL }, @@ -319,6 +320,7 @@ public: { HandleReloadLocalesAchievementRewardCommand(handler, "a"); HandleReloadLocalesCreatureCommand(handler, "a"); + HandleReloadLocalesCreatureTextCommand(handler, "a"); HandleReloadLocalesGameobjectCommand(handler, "a"); HandleReloadLocalesGossipMenuOptionCommand(handler, "a"); HandleReloadLocalesItemCommand(handler, "a"); @@ -1171,6 +1173,14 @@ public: return true; } + static bool HandleReloadLocalesCreatureTextCommand(ChatHandler* handler, const char* /*args*/) + { + sLog->outString("Re-Loading Locales Creature Texts..."); + sCreatureTextMgr->LoadCreatureTextLocales(); + handler->SendGlobalGMSysMessage("DB table `locales_creature_text` reloaded."); + return true; + } + static bool HandleReloadLocalesGameobjectCommand(ChatHandler* handler, const char* /*args*/) { sLog->outString("Re-Loading Locales Gameobject ... "); From 700203ad1efa6e988472188121744453af5c6279 Mon Sep 17 00:00:00 2001 From: leak Date: Tue, 6 Mar 2012 17:21:52 +0100 Subject: [PATCH 0125/1149] Core/Shared: Add thread-safe access to BigNumber::AsByteArray() fixes #5469 --- src/server/shared/Cryptography/BigNumber.cpp | 2 ++ src/server/shared/Cryptography/BigNumber.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/server/shared/Cryptography/BigNumber.cpp b/src/server/shared/Cryptography/BigNumber.cpp index f55e87c99fc..146ea778f48 100755 --- a/src/server/shared/Cryptography/BigNumber.cpp +++ b/src/server/shared/Cryptography/BigNumber.cpp @@ -169,6 +169,8 @@ uint8 *BigNumber::AsByteArray(int minSize, bool reverse) { int length = (minSize >= GetNumBytes()) ? minSize : GetNumBytes(); + ACE_GUARD_RETURN(ACE_Mutex, g, _lock, 0); + if (_array) { delete[] _array; diff --git a/src/server/shared/Cryptography/BigNumber.h b/src/server/shared/Cryptography/BigNumber.h index 7196aae6579..6646245a6a0 100755 --- a/src/server/shared/Cryptography/BigNumber.h +++ b/src/server/shared/Cryptography/BigNumber.h @@ -20,6 +20,7 @@ #define _AUTH_BIGNUMBER_H #include "Define.h" +#include struct bignum_st; @@ -89,6 +90,10 @@ class BigNumber private: struct bignum_st *_bn; uint8 *_array; + + // This mutex only controls thread-safe access to AsByteArray() and should be replaced with a thread-safe implementation of BigNumber + ACE_Mutex _lock; + }; #endif From cd574eb23b185d02a713cd9eb3880b8e14da2273 Mon Sep 17 00:00:00 2001 From: leak Date: Tue, 6 Mar 2012 17:22:31 +0100 Subject: [PATCH 0126/1149] Core/Warden: Move Sent check ids log to debug log --- src/server/game/Warden/WardenWin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Warden/WardenWin.cpp b/src/server/game/Warden/WardenWin.cpp index 3e028254f28..a7485d7da51 100644 --- a/src/server/game/Warden/WardenWin.cpp +++ b/src/server/game/Warden/WardenWin.cpp @@ -325,7 +325,7 @@ void WardenWin::RequestData() for (std::list::iterator itr = _currentChecks.begin(); itr != _currentChecks.end(); ++itr) stream << *itr << " "; - sLog->outWarden("%s", stream.str().c_str()); + sLog->outDebug(LOG_FILTER_WARDEN, "%s", stream.str().c_str()); } void WardenWin::HandleData(ByteBuffer &buff) From f506674ab85107d5866c2f90111e7bf949233711 Mon Sep 17 00:00:00 2001 From: leak Date: Tue, 6 Mar 2012 20:34:09 +0100 Subject: [PATCH 0127/1149] DB/Schema: Convert all world db tables to use MYISAM storage engine --- sql/updates/world/2012_03_06_01_world_misc.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/2012_03_06_01_world_misc.sql diff --git a/sql/updates/world/2012_03_06_01_world_misc.sql b/sql/updates/world/2012_03_06_01_world_misc.sql new file mode 100644 index 00000000000..20893d03ceb --- /dev/null +++ b/sql/updates/world/2012_03_06_01_world_misc.sql @@ -0,0 +1,5 @@ +ALTER TABLE `warden_checks` ENGINE=MYISAM; +ALTER TABLE `achievement_dbc` ENGINE=MYISAM; +ALTER TABLE `character_queststatus_seasonal` ENGINE=MYISAM; +ALTER TABLE `creature_text` ENGINE=MYISAM; +ALTER TABLE `game_event_seasonal_questrelation` ENGINE=MYISAM; From bf5c8d7399a7348e05567a6a95b1afce281c4858 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 6 Mar 2012 22:05:33 +0100 Subject: [PATCH 0128/1149] Scripts/Spells: Fixed target of visual polymorph in Silvermoon city --- src/server/scripts/Spells/spell_mage.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index ea1af10816b..b746c37a090 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -123,6 +123,12 @@ class spell_mage_cold_snap : public SpellScriptLoader } }; +enum SilvermoonPolymorph +{ + NPC_AUROSALIA = 18744, +}; + +// TODO: move out of here and rename - not a mage spell class spell_mage_polymorph_cast_visual : public SpellScriptLoader { public: @@ -132,22 +138,22 @@ class spell_mage_polymorph_cast_visual : public SpellScriptLoader { PrepareSpellScript(spell_mage_polymorph_cast_visual_SpellScript); - static const uint32 spell_list[6]; + static const uint32 PolymorhForms[6]; bool Validate(SpellInfo const* /*spellEntry*/) { // check if spell ids exist in dbc - for (int i = 0; i < 6; i++) - if (!sSpellMgr->GetSpellInfo(spell_list[i])) + for (uint32 i = 0; i < 6; i++) + if (!sSpellMgr->GetSpellInfo(PolymorhForms[i])) return false; return true; } void HandleDummy(SpellEffIndex /*effIndex*/) { - if (Unit* unitTarget = GetHitUnit()) - if (unitTarget->GetTypeId() == TYPEID_UNIT) - unitTarget->CastSpell(unitTarget, spell_list[urand(0, 5)], true); + if (Unit* target = GetCaster()->FindNearestCreature(NPC_AUROSALIA, 30.0f)) + if (target->GetTypeId() == TYPEID_UNIT) + target->CastSpell(target, PolymorhForms[urand(0, 5)], true); } void Register() @@ -163,7 +169,7 @@ class spell_mage_polymorph_cast_visual : public SpellScriptLoader } }; -const uint32 spell_mage_polymorph_cast_visual::spell_mage_polymorph_cast_visual_SpellScript::spell_list[6] = +const uint32 spell_mage_polymorph_cast_visual::spell_mage_polymorph_cast_visual_SpellScript::PolymorhForms[6] = { SPELL_MAGE_SQUIRREL_FORM, SPELL_MAGE_GIRAFFE_FORM, From 1b34965808fe394cf6535c64876068921f3a9726 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 6 Mar 2012 21:22:47 +0000 Subject: [PATCH 0129/1149] DB/World: Remove character_queststatus_seasonal from the world database (if it exists) --- ...re_template.sql => 2012_02_27_00_world_creature_template.sql} | 0 sql/updates/world/2012_03_06_01_world_misc.sql | 1 - sql/updates/world/2012_03_06_02_world_queststatus_seasonal.sql | 1 + 3 files changed, 1 insertion(+), 1 deletion(-) rename sql/updates/world/{2012_02_27_world_creature_template.sql => 2012_02_27_00_world_creature_template.sql} (100%) create mode 100644 sql/updates/world/2012_03_06_02_world_queststatus_seasonal.sql diff --git a/sql/updates/world/2012_02_27_world_creature_template.sql b/sql/updates/world/2012_02_27_00_world_creature_template.sql similarity index 100% rename from sql/updates/world/2012_02_27_world_creature_template.sql rename to sql/updates/world/2012_02_27_00_world_creature_template.sql diff --git a/sql/updates/world/2012_03_06_01_world_misc.sql b/sql/updates/world/2012_03_06_01_world_misc.sql index 20893d03ceb..7eb208a9673 100644 --- a/sql/updates/world/2012_03_06_01_world_misc.sql +++ b/sql/updates/world/2012_03_06_01_world_misc.sql @@ -1,5 +1,4 @@ ALTER TABLE `warden_checks` ENGINE=MYISAM; ALTER TABLE `achievement_dbc` ENGINE=MYISAM; -ALTER TABLE `character_queststatus_seasonal` ENGINE=MYISAM; ALTER TABLE `creature_text` ENGINE=MYISAM; ALTER TABLE `game_event_seasonal_questrelation` ENGINE=MYISAM; diff --git a/sql/updates/world/2012_03_06_02_world_queststatus_seasonal.sql b/sql/updates/world/2012_03_06_02_world_queststatus_seasonal.sql new file mode 100644 index 00000000000..0efbb6609cf --- /dev/null +++ b/sql/updates/world/2012_03_06_02_world_queststatus_seasonal.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS `character_queststatus_seasonal`; From a153e0ca06698e95a35714964c51abadbd72e3c2 Mon Sep 17 00:00:00 2001 From: click Date: Wed, 7 Mar 2012 00:05:34 +0100 Subject: [PATCH 0130/1149] Core: Remove some whitespace and tabs --- src/server/game/Conditions/ConditionMgr.cpp | 2 +- src/server/game/Conditions/ConditionMgr.h | 4 ++-- src/server/game/Handlers/CalendarHandler.cpp | 2 +- .../MovementGenerators/TargetedMovementGenerator.cpp | 4 ++-- src/server/game/Spells/Spell.cpp | 2 +- src/server/scripts/Commands/cs_debug.cpp | 6 +++--- .../Northrend/Nexus/EyeOfEternity/boss_malygos.cpp | 4 ++-- src/server/scripts/Spells/spell_warlock.cpp | 2 +- src/tools/vmap4_extractor/model.cpp | 2 +- src/tools/vmap4_extractor/mpq_libmpq04.h | 10 +++++----- src/tools/vmap4_extractor/vmapexport.h | 4 ++-- 11 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 755b9299352..eadcc5c5fbb 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -1294,7 +1294,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) default: break; } - + switch (spellInfo->Effects[i].TargetB.GetSelectionCategory()) { case TARGET_SELECT_CATEGORY_NEARBY: diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index ec6d6dd8453..2df79eab088 100755 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -89,10 +89,10 @@ enum ConditionTypes The following steps only apply if your condition can be grouped: Step 6: Determine how you are going to store your conditions. You need to add a new storage container - for it in ConditionMgr class, along with a function like: + for it in ConditionMgr class, along with a function like: ConditionList GetConditionsForXXXYourNewSourceTypeXXX(parameters...) - The above function should be placed in upper level (practical) code that actually + The above function should be placed in upper level (practical) code that actually checks the conditions. Step 7: Implement loading for your source type in ConditionMgr::LoadConditions. diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index c9e99af6fed..64acc512add 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -207,7 +207,7 @@ void WorldSession::HandleCalendarGuildFilter(WorldPacket& recvData) void WorldSession::HandleCalendarArenaTeam(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_ARENA_TEAM [" UI64FMTD "]", _player->GetGUID()); - + int32 unk1; recvData >> unk1; diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index 064a8fc8297..6d507a3b694 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -40,12 +40,12 @@ void TargetedMovementGeneratorMedium::_setTargetLocation(T &owner) float x, y, z; //! Following block of code deleted by MrSmite in issue 4891 //! Code kept for learning and diagnostical purposes -// +// // if (i_offset && i_target->IsWithinDistInMap(&owner,2*i_offset)) // { // if (!owner.movespline->Finalized()) // return; -// +// // owner.GetPosition(x, y, z); // } // else diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 2ffa94371f9..65ab9444f58 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -6444,7 +6444,7 @@ void Spell::UpdatePointers() SpellDestination& dest = m_destTargets[effIndex]; if (!dest._transportGUID) continue; - + if (!transport || transport->GetGUID() != dest._transportGUID) transport = ObjectAccessor::GetWorldObject(*m_caster, dest._transportGUID); diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 9646a881fc0..814b18389a7 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1303,10 +1303,10 @@ public: return false; char* mask2 = strtok(NULL, " \n"); - + uint32 moveFlags = (uint32)atoi(mask1); target->SetUnitMovementFlags(moveFlags); - + if (mask2) { uint32 moveFlagsExtra = uint32(atoi(mask2)); @@ -1316,7 +1316,7 @@ public: target->SendMovementFlagUpdate(); handler->PSendSysMessage(LANG_MOVEFLAGS_SET, target->GetUnitMovementFlags(), target->GetExtraUnitMovementFlags()); } - + return true; } }; diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 64060464d7c..e03440cec98 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -241,7 +241,7 @@ public: _cannotMove = true; me->SetFlying(true); - + if (instance) instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } @@ -362,7 +362,7 @@ public: Talk(SAY_AGGRO_P_ONE); DoCast(SPELL_BERSEKER); // periodic aura, first tick in 10 minutes - + if (instance) instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 5ae630fcd68..e4593be295c 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -449,7 +449,7 @@ class spell_warl_demonic_circle_summon : public SpellScriptLoader { if (GameObject* circle = GetTarget()->GetGameObject(GetId())) { - // Here we check if player is in demonic circle teleport range, if so add + // Here we check if player is in demonic circle teleport range, if so add // WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST; allowing him to cast the WARLOCK_DEMONIC_CIRCLE_TELEPORT. // If not in range remove the WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST. diff --git a/src/tools/vmap4_extractor/model.cpp b/src/tools/vmap4_extractor/model.cpp index ac28e1ff086..e81972f521f 100644 --- a/src/tools/vmap4_extractor/model.cpp +++ b/src/tools/vmap4_extractor/model.cpp @@ -167,7 +167,7 @@ ModelInstance::ModelInstance(MPQFile &f,const char* ModelInstName, uint32 mapID, uint16 adtId = 0;// not used for models uint32 flags = MOD_M2; - if(tileX == 65 && tileY == 65) flags |= MOD_WORLDSPAWN; + if(tileX == 65 && tileY == 65) flags |= MOD_WORLDSPAWN; //write mapID, tileX, tileY, Flags, ID, Pos, Rot, Scale, name fwrite(&mapID, sizeof(uint32), 1, pDirfile); fwrite(&tileX, sizeof(uint32), 1, pDirfile); diff --git a/src/tools/vmap4_extractor/mpq_libmpq04.h b/src/tools/vmap4_extractor/mpq_libmpq04.h index 4b0a2465bfd..ed51022de78 100644 --- a/src/tools/vmap4_extractor/mpq_libmpq04.h +++ b/src/tools/vmap4_extractor/mpq_libmpq04.h @@ -24,14 +24,14 @@ public: void close(); void GetFileListTo(vector& filelist) { - uint32 filenum; - if(libmpq__file_number(mpq_a, "(listfile)", &filenum)) return; - libmpq__off_t size, transferred; - libmpq__file_unpacked_size(mpq_a, filenum, &size); + uint32 filenum; + if(libmpq__file_number(mpq_a, "(listfile)", &filenum)) return; + libmpq__off_t size, transferred; + libmpq__file_unpacked_size(mpq_a, filenum, &size); char *buffer = new char[size]; - libmpq__file_read(mpq_a, filenum, (unsigned char*)buffer, size, &transferred); + libmpq__file_read(mpq_a, filenum, (unsigned char*)buffer, size, &transferred); char seps[] = "\n"; char *token; diff --git a/src/tools/vmap4_extractor/vmapexport.h b/src/tools/vmap4_extractor/vmapexport.h index b407e7a106e..0381011efb7 100644 --- a/src/tools/vmap4_extractor/vmapexport.h +++ b/src/tools/vmap4_extractor/vmapexport.h @@ -23,8 +23,8 @@ enum ModelFlags { - MOD_M2 = 1, - MOD_WORLDSPAWN = 1<<1, + MOD_M2 = 1, + MOD_WORLDSPAWN = 1<<1, MOD_HAS_BOUND = 1<<2 }; From 0e18d64050270be1f2283892371ecc50a0909539 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Tue, 6 Mar 2012 20:55:17 -0330 Subject: [PATCH 0131/1149] DB/SAI: SAI for Elrodan & Aurosalia text --- .../world/2012_03_06_03_world_smart_scripts.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 sql/updates/world/2012_03_06_03_world_smart_scripts.sql diff --git a/sql/updates/world/2012_03_06_03_world_smart_scripts.sql b/sql/updates/world/2012_03_06_03_world_smart_scripts.sql new file mode 100644 index 00000000000..cb2468c4d5c --- /dev/null +++ b/sql/updates/world/2012_03_06_03_world_smart_scripts.sql @@ -0,0 +1,17 @@ +-- SAI for Elrodan +SET @ENTRY=18743; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY AND `source_type`=0); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY*100 AND `source_type`=9); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,0,5000,8000,15000,25000,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Elrodan - OOC - run script'), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,11,18744,20,0,0,0,0,0,'Elrodan - Script - Aurosalia say random'), +(@ENTRY*100,9,1,0,0,0,100,0,3000,3000,3000,3000,11,32826,0,0,0,0,0,1,0,0,0,0,0,0,0,'Elrodan - Script - cast Polymorph Cast Visual'); +-- Aurosalia fix model +UPDATE `creature_model_info` SET `modelid_other_gender`=0 WHERE `modelid`=18145; +-- Aurosalia text +DELETE FROM `creature_text` WHERE `entry`=18744; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(18744,0,0, 'Stop!',1,0,100,5,0,0, 'Aurosalia'), +(18744,0,1, 'Will you stop--',1,0,100,274,0,0, 'Aurosalia'), +(18744,0,2, '',1,0,100,6,0,0, 'Aurosalia'); From 9f93681625f16b4a118df755eccb8ac80f713c16 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Tue, 6 Mar 2012 21:02:16 -0330 Subject: [PATCH 0132/1149] DB/text: Fixed text from last commit :) --- sql/updates/world/2012_03_06_04_world_creature_text.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sql/updates/world/2012_03_06_04_world_creature_text.sql diff --git a/sql/updates/world/2012_03_06_04_world_creature_text.sql b/sql/updates/world/2012_03_06_04_world_creature_text.sql new file mode 100644 index 00000000000..f49599e1ba0 --- /dev/null +++ b/sql/updates/world/2012_03_06_04_world_creature_text.sql @@ -0,0 +1,6 @@ +-- Aurosalia text +DELETE FROM `creature_text` WHERE `entry`=18744; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(18744,0,0, 'Stop!',12,1,100,5,0,0, 'Aurosalia'), +(18744,0,1, 'Will you stop--',12,1,100,6,0,0, 'Aurosalia'), +(18744,0,2, '',12,1,100,274,0,0, 'Aurosalia'); From e5d23103f37c40d2e946fa0e2db66d2f527ad9af Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 7 Mar 2012 13:09:35 +0100 Subject: [PATCH 0133/1149] Core/Maps * Corrected liquid type extraction in maps - MCLQ chunk must be parsed together with MH2O (they stack) * Fixed liquid detection in WMO objects * Implemented LiquidType.dbc use, players will now get proper auras in special liquids * Turned off slime damage by default (Naxxramas uses periodic damage aura for this purpose) * Implemented liquid type overrides basing on area/zone * Renamed final temp_gameobject_models to GameObjectModels.dtree (the temporary one produced by vmap extractor remains unaffected) Note: Map and Vmap re-extraction is required --- .../2012_03_07_00_world_trinity_string.sql | 3 + .../collision/Management/VMapManager2.cpp | 2 +- src/server/collision/Maps/TileAssembler.cpp | 2 +- src/server/collision/Models/WorldModel.cpp | 3 +- src/server/collision/VMapDefinitions.h | 6 +- src/server/game/DataStores/DBCStores.cpp | 3 +- src/server/game/DataStores/DBCStores.h | 2 +- src/server/game/DataStores/DBCStructure.h | 42 ++--- src/server/game/DataStores/DBCfmt.h | 4 +- src/server/game/Entities/Player/Player.cpp | 48 +++-- src/server/game/Entities/Player/Player.h | 1 + src/server/game/Maps/Map.cpp | 123 ++++++++++--- src/server/game/Maps/Map.h | 6 +- src/server/scripts/Commands/cs_gps.cpp | 2 +- src/tools/map_extractor/System.cpp | 173 ++++++++++-------- src/tools/vmap4_extractor/vmapexport.cpp | 2 +- src/tools/vmap4_extractor/wmo.cpp | 48 ++++- 17 files changed, 310 insertions(+), 160 deletions(-) create mode 100644 sql/updates/world/2012_03_07_00_world_trinity_string.sql diff --git a/sql/updates/world/2012_03_07_00_world_trinity_string.sql b/sql/updates/world/2012_03_07_00_world_trinity_string.sql new file mode 100644 index 00000000000..96344520236 --- /dev/null +++ b/sql/updates/world/2012_03_07_00_world_trinity_string.sql @@ -0,0 +1,3 @@ +DELETE FROM `trinity_string` WHERE `entry`=175; +INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES +(175, 'Liquid level: %f, ground: %f, type: %u, flags %u, status: %d.'); \ No newline at end of file diff --git a/src/server/collision/Management/VMapManager2.cpp b/src/server/collision/Management/VMapManager2.cpp index 62abc31831a..6139a27fb52 100644 --- a/src/server/collision/Management/VMapManager2.cpp +++ b/src/server/collision/Management/VMapManager2.cpp @@ -233,7 +233,7 @@ namespace VMAP { floor = info.ground_Z; ASSERT(floor < std::numeric_limits::max()); - type = info.hitModel->GetLiquidType(); + type = info.hitModel->GetLiquidType(); // entry from LiquidType.dbc if (reqLiquidType && !(type & reqLiquidType)) return false; if (info.hitInstance->GetLiquidLevel(pos, info, level)) diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp index 68ea3ec80cd..e7693a70de4 100644 --- a/src/server/collision/Maps/TileAssembler.cpp +++ b/src/server/collision/Maps/TileAssembler.cpp @@ -335,7 +335,7 @@ namespace VMAP void TileAssembler::exportGameobjectModels() { - FILE* model_list = fopen((iSrcDir + "/" + GAMEOBJECT_MODELS).c_str(), "rb"); + FILE* model_list = fopen((iSrcDir + "/" + "temp_gameobject_models").c_str(), "rb"); FILE* model_list_copy = fopen((iDestDir + "/" + GAMEOBJECT_MODELS).c_str(), "wb"); if (!model_list || !model_list_copy) return; diff --git a/src/server/collision/Models/WorldModel.cpp b/src/server/collision/Models/WorldModel.cpp index d4b08dde5dd..b818232fb32 100644 --- a/src/server/collision/Models/WorldModel.cpp +++ b/src/server/collision/Models/WorldModel.cpp @@ -392,9 +392,8 @@ namespace VMAP uint32 GroupModel::GetLiquidType() const { - // convert to type mask, matching MAP_LIQUID_TYPE_* defines in Map.h if (iLiquid) - return (1 << iLiquid->GetType()); + return iLiquid->GetType(); return 0; } diff --git a/src/server/collision/VMapDefinitions.h b/src/server/collision/VMapDefinitions.h index 72a62807b4c..cc796d96dd5 100644 --- a/src/server/collision/VMapDefinitions.h +++ b/src/server/collision/VMapDefinitions.h @@ -24,9 +24,9 @@ namespace VMAP { - const char VMAP_MAGIC[] = "VMAP_4.0"; - const char RAW_VMAP_MAGIC[] = "VMAP004"; // used in extracted vmap files with raw data - const char GAMEOBJECT_MODELS[] = "temp_gameobject_models"; + const char VMAP_MAGIC[] = "VMAP_4.1"; + const char RAW_VMAP_MAGIC[] = "VMAP041"; // used in extracted vmap files with raw data + const char GAMEOBJECT_MODELS[] = "GameObjectModels.dtree"; // defined in TileAssembler.cpp currently... bool readChunk(FILE* rf, char *dest, const char *compare, uint32 len); diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index b6c18103f1e..4fa8e09cead 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -119,7 +119,7 @@ DBCStorage sItemRandomSuffixStore(ItemRandomSuffixfmt); DBCStorage sItemSetStore(ItemSetEntryfmt); DBCStorage sLFGDungeonStore(LFGDungeonEntryfmt); -//DBCStorage sLiquidTypeStore(LiquidTypeEntryfmt); +DBCStorage sLiquidTypeStore(LiquidTypefmt); DBCStorage sLockStore(LockEntryfmt); DBCStorage sMailTemplateStore(MailTemplateEntryfmt); @@ -357,6 +357,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sItemSetStore, dbcPath, "ItemSet.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sLFGDungeonStore, dbcPath, "LFGDungeons.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sLiquidTypeStore, dbcPath, "LiquidType.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sLockStore, dbcPath, "Lock.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sMailTemplateStore, dbcPath, "MailTemplate.dbc"); diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 58c85adc11b..0bbf06c5311 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -119,7 +119,7 @@ extern DBCStorage sItemRandomPropertiesStore; extern DBCStorage sItemRandomSuffixStore; extern DBCStorage sItemSetStore; extern DBCStorage sLFGDungeonStore; -//extern DBCStorage sLiquidTypeStore; +extern DBCStorage sLiquidTypeStore; extern DBCStorage sLockStore; extern DBCStorage sMailTemplateStore; extern DBCStorage sMapStore; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 0d721e3f832..1e52866539a 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -527,6 +527,7 @@ struct AreaTableEntry char* area_name[16]; // 11-26 // 27, string flags, unused uint32 team; // 28 + uint32 LiquidTypeOverride[4]; // 29-32 liquid override by type // helpers bool IsSanctuary() const @@ -1214,30 +1215,29 @@ struct LFGDungeonEntry uint32 Entry() const { return ID + (type << 24); } }; -/* + struct LiquidTypeEntry { - uint32 ID; // 0 - char* name; // 1 - uint32 flags; // 2 Water: 1|2|4|8, Magma: 8|16|32|64, Slime: 2|64|256, WMO Ocean: 1|2|4|8|512 - uint32 type; // 3 0: Water, 1: Ocean, 2: Magma, 3: Slime - uint32 soundid; // 4 Reference to SoundEntries.dbc - uint32 spellID; // 5 Reference to Spell.dbc - float maxDarkenDepth // 6 Only Slime (6) and Magma (7) - float fogDarkenIntensity // 7 Only oceans got values here! - float ambDarkenIntensity // 8 Only oceans got values here! - float dirDarkenIntensity // 9 Only oceans got values here! - uint32 lightID // 10 Only Slime (6) and Magma (7) - float particleScale // 11 0: Slime, 1: Water/Ocean, 4: Magma - uint32 particleMovement // 12 - uint32 particleTexSlots // 13 - uint32 LiquidMaterialID // 14 Reference to LiquidMaterial.dbc - char* texture[6]; // 15-20 - uint32 color[2] // 21-22 - float floats[18]; // 23-40 Most likely these are attributes for the shaders. Water: (23, TextureTilesPerBlock),(24, Rotation) Magma: (23, AnimationX),(24, AnimationY) - uint32 ints[4] // 41-44 + uint32 Id; + //char* Name; + //uint32 Flags; + uint32 Type; + //uint32 SoundId; + uint32 SpellId; + //float MaxDarkenDepth; + //float FogDarkenIntensity; + //float AmbDarkenIntensity; + //float DirDarkenIntensity; + //uint32 LightID; + //float ParticleScale; + //uint32 ParticleMovement; + //uint32 ParticleTexSlots; + //uint32 LiquidMaterialID; + //char* Texture[6]; + //uint32 Color[2]; + //float Unk1[18]; + //uint32 Unk2[4]; }; -*/ #define MAX_LOCK_CASE 8 diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 54be02a619e..ce887cac09b 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -23,7 +23,7 @@ const char Achievementfmt[]="niixssssssssssssssssxxxxxxxxxxxxxxxxxxiixixxxxxxxxx const std::string CustomAchievementfmt="pppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaapapaaaaaaaaaaaaaaaaaapp"; const std::string CustomAchievementIndex = "ID"; const char AchievementCriteriafmt[]="niiiiiiiixxxxxxxxxxxxxxxxxiiiix"; -const char AreaTableEntryfmt[]="iiinixxxxxissssssssssssssssxixxxxxxx"; +const char AreaTableEntryfmt[]="iiinixxxxxissssssssssssssssxiiiiixxx"; const char AreaGroupEntryfmt[]="niiiiiii"; const char AreaPOIEntryfmt[]="niiiiiiiiiiifffixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxix"; const char AreaTriggerEntryfmt[]="niffffffff"; @@ -78,7 +78,7 @@ const char ItemRandomPropertiesfmt[]="nxiiixxssssssssssssssssx"; const char ItemRandomSuffixfmt[]="nssssssssssssssssxxiiixxiiixx"; const char ItemSetEntryfmt[]="dssssssssssssssssxiiiiiiiiiixxxxxxxiiiiiiiiiiiiiiiiii"; const char LFGDungeonEntryfmt[]="nxxxxxxxxxxxxxxxxxiiiiiiixixxixixxxxxxxxxxxxxxxxx"; -//const char LiquidTypeEntryfmt[]="nsiiiiffffifiiisssssiiffffffffffffffffffiiii"; +const char LiquidTypefmt[]="nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char LockEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx"; const char MailTemplateEntryfmt[]="nxxxxxxxxxxxxxxxxxssssssssssssssssx"; const char MapEntryfmt[]="nxixxssssssssssssssssxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixiffxiix"; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 870b6f683b8..729a2fe0b00 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -724,6 +724,7 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep for (uint8 i=0; iSpellId)) { // Breath timer not activated - activate it if (m_MirrorTimer[FIRE_TIMER] == DISABLED_MIRROR_TIMER) m_MirrorTimer[FIRE_TIMER] = getMaxTimer(FIRE_TIMER); else { - m_MirrorTimer[FIRE_TIMER]-=time_diff; + m_MirrorTimer[FIRE_TIMER] -= time_diff; if (m_MirrorTimer[FIRE_TIMER] < 0) { m_MirrorTimer[FIRE_TIMER]+= 1*IN_MILLISECONDS; @@ -1434,8 +1435,8 @@ void Player::HandleDrowning(uint32 time_diff) EnvironmentalDamage(DAMAGE_LAVA, damage); // need to skip Slime damage in Undercity, // maybe someone can find better way to handle environmental damage - else if (m_zoneUpdateId != 1497) - EnvironmentalDamage(DAMAGE_SLIME, damage); + //else if (m_zoneUpdateId != 1497) + // EnvironmentalDamage(DAMAGE_SLIME, damage); } } } @@ -23059,15 +23060,34 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z) ZLiquidStatus res = m->getLiquidStatus(x, y, z, MAP_ALL_LIQUIDS, &liquid_status); if (!res) { - m_MirrorTimerFlags &= ~(UNDERWATER_INWATER|UNDERWATER_INLAVA|UNDERWATER_INSLIME|UNDERWARER_INDARKWATER); - // Small hack for enable breath in WMO - /* if (IsInWater()) - m_MirrorTimerFlags|=UNDERWATER_INWATER; */ + m_MirrorTimerFlags &= ~(UNDERWATER_INWATER | UNDERWATER_INLAVA | UNDERWATER_INSLIME | UNDERWARER_INDARKWATER); + if (_lastLiquid && _lastLiquid->SpellId) + RemoveAurasDueToSpell(_lastLiquid->SpellId); + + _lastLiquid = NULL; return; } + if (uint32 liqEntry = liquid_status.entry) + { + LiquidTypeEntry const* liquid = sLiquidTypeStore.LookupEntry(liqEntry); + if (_lastLiquid && _lastLiquid->SpellId && _lastLiquid->Id != liqEntry) + RemoveAurasDueToSpell(_lastLiquid->SpellId); + + if (liquid && liquid->SpellId) + AddAura(liquid->SpellId, this); + + _lastLiquid = liquid; + } + else if (_lastLiquid && _lastLiquid->SpellId) + { + RemoveAurasDueToSpell(_lastLiquid->SpellId); + _lastLiquid = NULL; + } + + // All liquids type - check under water position - if (liquid_status.type&(MAP_LIQUID_TYPE_WATER|MAP_LIQUID_TYPE_OCEAN|MAP_LIQUID_TYPE_MAGMA|MAP_LIQUID_TYPE_SLIME)) + if (liquid_status.type_flags & (MAP_LIQUID_TYPE_WATER | MAP_LIQUID_TYPE_OCEAN | MAP_LIQUID_TYPE_MAGMA | MAP_LIQUID_TYPE_SLIME)) { if (res & LIQUID_MAP_UNDER_WATER) m_MirrorTimerFlags |= UNDERWATER_INWATER; @@ -23076,23 +23096,23 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z) } // Allow travel in dark water on taxi or transport - if ((liquid_status.type & MAP_LIQUID_TYPE_DARK_WATER) && !isInFlight() && !GetTransport()) + if ((liquid_status.type_flags & MAP_LIQUID_TYPE_DARK_WATER) && !isInFlight() && !GetTransport()) m_MirrorTimerFlags |= UNDERWARER_INDARKWATER; else m_MirrorTimerFlags &= ~UNDERWARER_INDARKWATER; // in lava check, anywhere in lava level - if (liquid_status.type&MAP_LIQUID_TYPE_MAGMA) + if (liquid_status.type_flags & MAP_LIQUID_TYPE_MAGMA) { - if (res & (LIQUID_MAP_UNDER_WATER|LIQUID_MAP_IN_WATER|LIQUID_MAP_WATER_WALK)) + if (res & (LIQUID_MAP_UNDER_WATER | LIQUID_MAP_IN_WATER | LIQUID_MAP_WATER_WALK)) m_MirrorTimerFlags |= UNDERWATER_INLAVA; else m_MirrorTimerFlags &= ~UNDERWATER_INLAVA; } // in slime check, anywhere in slime level - if (liquid_status.type&MAP_LIQUID_TYPE_SLIME) + if (liquid_status.type_flags & MAP_LIQUID_TYPE_SLIME) { - if (res & (LIQUID_MAP_UNDER_WATER|LIQUID_MAP_IN_WATER|LIQUID_MAP_WATER_WALK)) + if (res & (LIQUID_MAP_UNDER_WATER | LIQUID_MAP_IN_WATER | LIQUID_MAP_WATER_WALK)) m_MirrorTimerFlags |= UNDERWATER_INSLIME; else m_MirrorTimerFlags &= ~UNDERWATER_INSLIME; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 3d510148aa4..362fd8a9016 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2813,6 +2813,7 @@ class Player : public Unit, public GridObject uint32 m_lastFallTime; float m_lastFallZ; + LiquidTypeEntry const* _lastLiquid; int32 m_MirrorTimer[MAX_TIMERS]; uint8 m_MirrorTimerFlags; uint8 m_MirrorTimerFlagsLast; diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 00b52bf746b..7f27a474534 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -41,7 +41,7 @@ union u_map_magic }; u_map_magic MapMagic = { {'M','A','P','S'} }; -u_map_magic MapVersionMagic = { {'v','1','.','1'} }; +u_map_magic MapVersionMagic = { {'v','1','.','2'} }; u_map_magic MapAreaMagic = { {'A','R','E','A'} }; u_map_magic MapHeightMagic = { {'M','H','G','T'} }; u_map_magic MapLiquidMagic = { {'M','L','I','Q'} }; @@ -1044,7 +1044,8 @@ GridMap::GridMap() _liquidWidth = 0; _liquidHeight = 0; _liquidLevel = INVALID_HEIGHT; - _liquidData = NULL; + _liquidEntry = NULL; + _liquidFlags = NULL; _liquidMap = NULL; } @@ -1106,12 +1107,14 @@ void GridMap::unloadData() delete[] _areaMap; delete[] m_V9; delete[] m_V8; - delete[] _liquidData; + delete[] _liquidEntry; + delete[] _liquidFlags; delete[] _liquidMap; _areaMap = NULL; m_V9 = NULL; m_V8 = NULL; - _liquidData = NULL; + _liquidEntry = NULL; + _liquidFlags = NULL; _liquidMap = NULL; _gridGetHeight = &GridMap::getHeightFromFlat; } @@ -1192,18 +1195,22 @@ bool GridMap::loadLiquidData(FILE* in, uint32 offset, uint32 /*size*/) _liquidOffX = header.offsetX; _liquidOffY = header.offsetY; _liquidWidth = header.width; - _liquidHeight= header.height; + _liquidHeight = header.height; _liquidLevel = header.liquidLevel; if (!(header.flags & MAP_LIQUID_NO_TYPE)) { - _liquidData = new uint8 [16*16]; - if (fread(_liquidData, sizeof(uint8), 16*16, in) != 16*16) + _liquidEntry = new uint16[16*16]; + if (fread(_liquidEntry, sizeof(uint16), 16*16, in) != 16*16) + return false; + + _liquidFlags = new uint8[16*16]; + if (fread(_liquidFlags, sizeof(uint8), 16*16, in) != 16*16) return false; } if (!(header.flags & MAP_LIQUID_NO_HEIGHT)) { - _liquidMap = new float [_liquidWidth*_liquidHeight]; + _liquidMap = new float[_liquidWidth*_liquidHeight]; if (fread(_liquidMap, sizeof(float), _liquidWidth*_liquidHeight, in) != _liquidWidth*_liquidHeight) return false; } @@ -1462,23 +1469,24 @@ float GridMap::getLiquidLevel(float x, float y) return _liquidMap[cx_int*_liquidWidth + cy_int]; } +// Why does this return LIQUID data? uint8 GridMap::getTerrainType(float x, float y) { - if (!_liquidData) + if (!_liquidFlags) return 0; x = 16 * (32 - x/SIZE_OF_GRIDS); y = 16 * (32 - y/SIZE_OF_GRIDS); int lx = (int)x & 15; int ly = (int)y & 15; - return _liquidData[lx*16 + ly]; + return _liquidFlags[lx*16 + ly]; } // Get water state on map inline ZLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData* data) { // Check water type (if no water return) - if (!_liquidType && !_liquidData) + if (!_liquidType && !_liquidFlags) return LIQUID_MAP_NO_WATER; // Get cell @@ -1489,7 +1497,37 @@ inline ZLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 R int y_int = (int)cy & (MAP_RESOLUTION-1); // Check water type in cell - uint8 type = _liquidData ? _liquidData[(x_int>>3)*16 + (y_int>>3)] : _liquidType; + int idx=(x_int>>3)*16 + (y_int>>3); + uint8 type = _liquidFlags ? _liquidFlags[idx] : _liquidType; + uint32 entry = 0; + if (_liquidEntry) + { + if (LiquidTypeEntry const* liquidEntry = sLiquidTypeStore.LookupEntry(_liquidEntry[idx])) + { + entry = liquidEntry->Id; + type &= MAP_LIQUID_TYPE_DARK_WATER; + uint32 liqTypeIdx = liquidEntry->Type; + if (entry < 21) + { + if (AreaTableEntry const* area = GetAreaEntryByAreaFlagAndMap(getArea(x, y), MAPID_INVALID)) + { + uint32 overrideLiquid = area->LiquidTypeOverride[liquidEntry->Type]; + if (!overrideLiquid && area->zone) + if (area = GetAreaEntryByAreaID(area->zone)) + overrideLiquid = area->LiquidTypeOverride[liquidEntry->Type]; + + if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(overrideLiquid)) + { + entry = overrideLiquid; + liqTypeIdx = liq->Type; + } + } + } + + type |= 1 << liqTypeIdx; + } + } + if (type == 0) return LIQUID_MAP_NO_WATER; @@ -1518,20 +1556,20 @@ inline ZLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 R // All ok in water -> store data if (data) { - data->type = type; + data->entry = entry; + data->type_flags = type; data->level = liquid_level; data->depth_level = ground_level; } // For speed check as int values - int delta = int((liquid_level - z) * 10); + float delta = liquid_level - z; - // Get position delta - if (delta > 20) // Under water + if (delta > 2.0f) // Under water return LIQUID_MAP_UNDER_WATER; - if (delta > 0) // In water + if (delta > 0.0f) // In water return LIQUID_MAP_IN_WATER; - if (delta > -1) // Walk on water + if (delta > -0.1f) // Walk on water return LIQUID_MAP_WATER_WALK; // Above water return LIQUID_MAP_ABOVE_WATER; @@ -1722,8 +1760,9 @@ ZLiquidStatus Map::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidTyp { ZLiquidStatus result = LIQUID_MAP_NO_WATER; VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager(); - float liquid_level, ground_level = INVALID_HEIGHT; - uint32 liquid_type; + float liquid_level = INVALID_HEIGHT; + float ground_level = INVALID_HEIGHT; + uint32 liquid_type = 0; if (vmgr->GetLiquidLevel(GetId(), x, y, z, ReqLiquidType, liquid_level, ground_level, liquid_type)) { sLog->outDebug(LOG_FILTER_MAPS, "getLiquidStatus(): vmap liquid level: %f ground: %f type: %u", liquid_level, ground_level, liquid_type); @@ -1733,20 +1772,46 @@ ZLiquidStatus Map::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidTyp // All ok in water -> store data if (data) { - data->type = liquid_type; + // hardcoded in client like this + if (GetId() == 530 && liquid_type == 2) + liquid_type = 15; + + uint32 liquidFlagType = 0; + if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(liquid_type)) + liquidFlagType = liq->Type; + + if (liquid_type && liquid_type < 21) + { + if (AreaTableEntry const* area = GetAreaEntryByAreaFlagAndMap(GetAreaFlag(x, y, z), GetId())) + { + uint32 overrideLiquid = area->LiquidTypeOverride[liquidFlagType]; + if (!overrideLiquid && area->zone) + if (area = GetAreaEntryByAreaID(area->zone)) + overrideLiquid = area->LiquidTypeOverride[liquidFlagType]; + + if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(overrideLiquid)) + { + liquid_type = overrideLiquid; + liquidFlagType = liq->Type; + } + } + } + data->level = liquid_level; data->depth_level = ground_level; + + data->entry = liquid_type; + data->type_flags = 1 << liquidFlagType; } - // For speed check as int values - int delta = int((liquid_level - z) * 10); + float delta = liquid_level - z; // Get position delta - if (delta > 20) // Under water + if (delta > 2.0f) // Under water return LIQUID_MAP_UNDER_WATER; - if (delta > 0 ) // In water + if (delta > 0.0f) // In water return LIQUID_MAP_IN_WATER; - if (delta > -1) // Walk on water + if (delta > -0.1f) // Walk on water return LIQUID_MAP_WATER_WALK; result = LIQUID_MAP_ABOVE_WATER; } @@ -1760,7 +1825,13 @@ ZLiquidStatus Map::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidTyp if (map_result != LIQUID_MAP_NO_WATER && (map_data.level > ground_level)) { if (data) + { + // hardcoded in client like this + if (GetId() == 530 && map_data.entry == 2) + map_data.entry = 15; + *data = map_data; + } return map_result; } } diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index d8db4c947a3..d0f99610262 100755 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -136,7 +136,8 @@ enum ZLiquidStatus struct LiquidData { - uint32 type; + uint32 type_flags; + uint32 entry; float level; float depth_level; }; @@ -163,7 +164,8 @@ class GridMap // Liquid data float _liquidLevel; - uint8* _liquidData; + uint16* _liquidEntry; + uint8* _liquidFlags; float* _liquidMap; uint16 _gridArea; uint16 _liquidType; diff --git a/src/server/scripts/Commands/cs_gps.cpp b/src/server/scripts/Commands/cs_gps.cpp index 589ed4af3b8..59e2ec90905 100644 --- a/src/server/scripts/Commands/cs_gps.cpp +++ b/src/server/scripts/Commands/cs_gps.cpp @@ -122,7 +122,7 @@ public: ZLiquidStatus status = map->getLiquidStatus(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), MAP_ALL_LIQUIDS, &liquidStatus); if (status) - handler->PSendSysMessage(LANG_LIQUID_STATUS, liquidStatus.level, liquidStatus.depth_level, liquidStatus.type, status); + handler->PSendSysMessage(LANG_LIQUID_STATUS, liquidStatus.level, liquidStatus.depth_level, liquidStatus.entry, liquidStatus.type_flags, status); return true; } diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 335fd924be8..bbde9f4675e 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -276,7 +276,7 @@ void ReadLiquidTypeTableDBC() // Map file format data static char const* MAP_MAGIC = "MAPS"; -static char const* MAP_VERSION_MAGIC = "v1.1"; +static char const* MAP_VERSION_MAGIC = "v1.2"; static char const* MAP_AREA_MAGIC = "AREA"; static char const* MAP_HEIGHT_MAGIC = "MHGT"; static char const* MAP_LIQUID_MAGIC = "MLIQ"; @@ -359,7 +359,8 @@ uint16 uint16_V9[ADT_GRID_SIZE+1][ADT_GRID_SIZE+1]; uint8 uint8_V8[ADT_GRID_SIZE][ADT_GRID_SIZE]; uint8 uint8_V9[ADT_GRID_SIZE+1][ADT_GRID_SIZE+1]; -uint8 liquid_type[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID]; +uint16 liquid_entry[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID]; +uint8 liquid_flags[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID]; bool liquid_show[ADT_GRID_SIZE][ADT_GRID_SIZE]; float liquid_height[ADT_GRID_SIZE+1][ADT_GRID_SIZE+1]; @@ -378,7 +379,8 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32 } memset(liquid_show, 0, sizeof(liquid_show)); - memset(liquid_type, 0, sizeof(liquid_type)); + memset(liquid_flags, 0, sizeof(liquid_flags)); + memset(liquid_entry, 0, sizeof(liquid_entry)); // Prepare map header map_fileheader map; @@ -612,13 +614,75 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32 map.heightMapSize+= sizeof(V9) + sizeof(V8); } + // Get from MCLQ chunk (old) + for (int i = 0; i < ADT_CELLS_PER_GRID; i++) + { + for(int j = 0; j < ADT_CELLS_PER_GRID; j++) + { + adt_MCNK *cell = cells->getMCNK(i, j); + if (!cell) + continue; + + adt_MCLQ *liquid = cell->getMCLQ(); + int count = 0; + if (!liquid || cell->sizeMCLQ <= 8) + continue; + + for (int y = 0; y < ADT_CELL_SIZE; y++) + { + int cy = i * ADT_CELL_SIZE + y; + for (int x = 0; x < ADT_CELL_SIZE; x++) + { + int cx = j * ADT_CELL_SIZE + x; + if (liquid->flags[y][x] != 0x0F) + { + liquid_show[cy][cx] = true; + if (liquid->flags[y][x] & (1<<7)) + liquid_flags[i][j] |= MAP_LIQUID_TYPE_DARK_WATER; + ++count; + } + } + } + + uint32 c_flag = cell->flags; + if (c_flag & (1<<2)) + { + liquid_entry[i][j] = 1; + liquid_flags[i][j] |= MAP_LIQUID_TYPE_WATER; // water + } + if (c_flag & (1<<3)) + { + liquid_entry[i][j] = 2; + liquid_flags[i][j] |= MAP_LIQUID_TYPE_OCEAN; // ocean + } + if (c_flag & (1<<4)) + { + liquid_entry[i][j] = 3; + liquid_flags[i][j] |= MAP_LIQUID_TYPE_MAGMA; // magma/slime + } + + if (!count && liquid_flags[i][j]) + fprintf(stderr, "Wrong liquid detect in MCLQ chunk"); + + for (int y = 0; y <= ADT_CELL_SIZE; y++) + { + int cy = i * ADT_CELL_SIZE + y; + for (int x = 0; x <= ADT_CELL_SIZE; x++) + { + int cx = j * ADT_CELL_SIZE + x; + liquid_height[cy][cx] = liquid->liquid[y][x].height; + } + } + } + } + // Get liquid map for grid (in WOTLK used MH2O chunk) adt_MH2O * h2o = adt.a_grid->getMH2O(); if (h2o) { - for (int i=0;igetLiquidData(i,j); if (!h) @@ -626,41 +690,41 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32 int count = 0; uint64 show = h2o->getLiquidShowMap(h); - for (int y=0; y < h->height;y++) + for (int y = 0; y < h->height; y++) { - int cy = i*ADT_CELL_SIZE + y + h->yOffset; - for (int x=0; x < h->width; x++) + int cy = i * ADT_CELL_SIZE + y + h->yOffset; + for (int x = 0; x < h->width; x++) { - int cx = j*ADT_CELL_SIZE + x + h->xOffset; + int cx = j * ADT_CELL_SIZE + x + h->xOffset; if (show & 1) { liquid_show[cy][cx] = true; ++count; } - show>>=1; + show >>= 1; } } - uint32 type = LiqType[h->liquidType]; - switch (type) + liquid_entry[i][j] = h->liquidType; + switch (LiqType[h->liquidType]) { - case LIQUID_TYPE_WATER: liquid_type[i][j] |= MAP_LIQUID_TYPE_WATER; break; - case LIQUID_TYPE_OCEAN: liquid_type[i][j] |= MAP_LIQUID_TYPE_OCEAN; break; - case LIQUID_TYPE_MAGMA: liquid_type[i][j] |= MAP_LIQUID_TYPE_MAGMA; break; - case LIQUID_TYPE_SLIME: liquid_type[i][j] |= MAP_LIQUID_TYPE_SLIME; break; + case LIQUID_TYPE_WATER: liquid_flags[i][j] |= MAP_LIQUID_TYPE_WATER; break; + case LIQUID_TYPE_OCEAN: liquid_flags[i][j] |= MAP_LIQUID_TYPE_OCEAN; break; + case LIQUID_TYPE_MAGMA: liquid_flags[i][j] |= MAP_LIQUID_TYPE_MAGMA; break; + case LIQUID_TYPE_SLIME: liquid_flags[i][j] |= MAP_LIQUID_TYPE_SLIME; break; default: printf("\nCan't find Liquid type %u for map %s\nchunk %d,%d\n", h->liquidType, filename, i, j); break; } // Dark water detect - if (type == LIQUID_TYPE_OCEAN) + if (LiqType[h->liquidType] == LIQUID_TYPE_OCEAN) { uint8 *lm = h2o->getLiquidLightMap(h); if (!lm) - liquid_type[i][j]|=MAP_LIQUID_TYPE_DARK_WATER; + liquid_flags[i][j] |= MAP_LIQUID_TYPE_DARK_WATER; } - if (!count && liquid_type[i][j]) + if (!count && liquid_flags[i][j]) printf("Wrong liquid detect in MH2O chunk"); float *height = h2o->getLiquidHeightMap(h); @@ -681,72 +745,16 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32 } } } - else - { - // Get from MCLQ chunk (old) - for (int i=0;igetMCNK(i, j); - if (!cell) - continue; - - adt_MCLQ *liquid = cell->getMCLQ(); - int count = 0; - if (!liquid || cell->sizeMCLQ <= 8) - continue; - - for (int y=0; y < ADT_CELL_SIZE; y++) - { - int cy = i*ADT_CELL_SIZE + y; - for (int x=0; x < ADT_CELL_SIZE; x++) - { - int cx = j*ADT_CELL_SIZE + x; - if (liquid->flags[y][x] != 0x0F) - { - liquid_show[cy][cx] = true; - if (liquid->flags[y][x]&(1<<7)) - liquid_type[i][j]|=MAP_LIQUID_TYPE_DARK_WATER; - ++count; - } - } - } - - uint32 c_flag = cell->flags; - if(c_flag & (1<<2)) - liquid_type[i][j]|=MAP_LIQUID_TYPE_WATER; // water - if(c_flag & (1<<3)) - liquid_type[i][j]|=MAP_LIQUID_TYPE_OCEAN; // ochean - if(c_flag & (1<<4)) - liquid_type[i][j]|=MAP_LIQUID_TYPE_MAGMA; // magma/slime - - if (!count && liquid_type[i][j]) - printf("Wrong liquid detect in MCLQ chunk"); - - for (int y=0; y <= ADT_CELL_SIZE; y++) - { - int cy = i*ADT_CELL_SIZE + y; - for (int x=0; x<= ADT_CELL_SIZE; x++) - { - int cx = j*ADT_CELL_SIZE + x; - liquid_height[cy][cx] = liquid->liquid[y][x].height; - } - } - } - } - } - //============================================ // Pack liquid data //============================================ - uint8 type = liquid_type[0][0]; + uint8 type = liquid_flags[0][0]; bool fullType = false; for (int y=0;yliquidType & 4) liquidEntry = liquidType; else if (liquidType == 15) - liquidEntry = 1; // first entry, generic "Water" + liquidEntry = 0; else liquidEntry = liquidType + 1; - // overwrite material type in header... - hlq->type = LiqType[liquidEntry]; + + if (!liquidEntry) + { + int v1; // edx@1 + int v2; // eax@1 + + v1 = hlq->xtiles * hlq->ytiles; + v2 = 0; + if (v1 > 0) + { + while ((LiquBytes[v2] & 0xF) == 15) + { + ++v2; + if (v2 >= v1) + break; + } + + if (v2 < v1 && (LiquBytes[v2] & 0xF) != 15) + liquidEntry = (LiquBytes[v2] & 0xF) + 1; + } + } + + if (liquidEntry && liquidEntry < 21) + { + switch (((uint8)liquidEntry - 1) & 3) + { + case 0: + liquidEntry = ((mogpFlags & 0x80000) != 0) + 13; + break; + case 1: + liquidEntry = 14; + break; + case 2: + liquidEntry = 19; + break; + case 3: + liquidEntry = 20; + break; + default: + break; + } + } + + hlq->type = liquidEntry; /* std::ofstream llog("Buildings/liquid.log", ios_base::out | ios_base::app); llog << filename; From f495e0efe4aff18d702fdc74ecc4f43e249aea9a Mon Sep 17 00:00:00 2001 From: Spp Date: Wed, 7 Mar 2012 14:08:30 +0100 Subject: [PATCH 0134/1149] Warning fixes and some random cleanup here and there --- src/server/game/Guilds/Guild.cpp | 94 +++++----- src/server/game/Guilds/GuildMgr.cpp | 1 - src/server/game/Handlers/LootHandler.cpp | 4 +- src/server/game/Scripting/MapScripts.cpp | 82 ++++----- src/server/game/Texts/CreatureTextMgr.h | 2 + src/server/scripts/Commands/cs_debug.cpp | 10 +- src/server/scripts/Commands/cs_reload.cpp | 4 +- .../BlackrockDepths/blackrock_depths.cpp | 85 +++++---- .../boss_ambassador_flamelash.cpp | 4 +- .../BlackrockDepths/boss_anubshiah.cpp | 10 +- .../boss_emperor_dagran_thaurissan.cpp | 8 +- .../boss_general_angerforge.cpp | 10 +- .../boss_gorosh_the_dervish.cpp | 4 +- .../BlackrockDepths/boss_grizzle.cpp | 4 +- .../boss_high_interrogator_gerstahn.cpp | 8 +- .../BlackrockDepths/boss_magmus.cpp | 4 +- .../boss_moira_bronzebeard.cpp | 8 +- .../BlackrockDepths/boss_tomb_of_seven.cpp | 14 +- .../instance_blackrock_depths.cpp | 80 ++++----- .../boss_broodlord_lashlayer.cpp | 8 +- .../BlackwingLair/boss_nefarian.cpp | 14 +- .../BlackwingLair/boss_vaelastrasz.cpp | 32 ++-- .../BlackwingLair/boss_victor_nefarius.cpp | 18 +- .../Deadmines/boss_mr_smite.cpp | 3 - .../EasternKingdoms/Deadmines/deadmines.cpp | 3 +- .../EasternKingdoms/Deadmines/deadmines.h | 1 - .../EasternKingdoms/Gnomeregan/gnomeregan.cpp | 4 +- .../EasternKingdoms/Karazhan/bosses_opera.cpp | 4 +- .../EasternKingdoms/Karazhan/karazhan.cpp | 8 +- .../MagistersTerrace/magisters_terrace.cpp | 4 +- .../MoltenCore/boss_majordomo_executus.cpp | 2 +- .../ScarletEnclave/chapter1.cpp | 4 +- .../ScarletEnclave/chapter5.cpp | 4 +- .../boss_interrogator_vishas.cpp | 2 +- .../ShadowfangKeep/shadowfang_keep.cpp | 4 +- .../EasternKingdoms/ZulAman/boss_janalai.cpp | 6 +- .../EasternKingdoms/ZulAman/zulaman.cpp | 4 +- .../EasternKingdoms/ZulGurub/boss_venoxis.cpp | 4 +- .../scripts/EasternKingdoms/blasted_lands.cpp | 5 +- .../scripts/EasternKingdoms/boss_kruul.cpp | 1 - .../EasternKingdoms/burning_steppes.cpp | 5 +- .../scripts/EasternKingdoms/duskwood.cpp | 2 - .../EasternKingdoms/eastern_plaguelands.cpp | 13 +- .../EasternKingdoms/eversong_woods.cpp | 6 - .../scripts/EasternKingdoms/ghostlands.cpp | 10 +- .../scripts/EasternKingdoms/hinterlands.cpp | 2 - .../scripts/EasternKingdoms/ironforge.cpp | 5 +- .../EasternKingdoms/isle_of_queldanas.cpp | 2 - .../scripts/EasternKingdoms/loch_modan.cpp | 5 +- .../EasternKingdoms/redridge_mountains.cpp | 1 - .../EasternKingdoms/silvermoon_city.cpp | 1 - .../EasternKingdoms/silverpine_forest.cpp | 3 - .../EasternKingdoms/stormwind_city.cpp | 15 +- .../EasternKingdoms/stranglethorn_vale.cpp | 1 - .../EasternKingdoms/tirisfal_glades.cpp | 3 - .../scripts/EasternKingdoms/undercity.cpp | 9 +- .../EasternKingdoms/western_plaguelands.cpp | 13 +- .../scripts/EasternKingdoms/westfall.cpp | 2 - .../scripts/EasternKingdoms/wetlands.cpp | 2 - .../scripts/Examples/example_creature.cpp | 4 +- .../scripts/Examples/example_escort.cpp | 4 +- .../Examples/example_gossip_codebox.cpp | 10 +- src/server/scripts/Examples/example_spell.cpp | 2 +- .../BlackfathomDeeps/blackfathom_deeps.cpp | 2 +- .../BattleForMountHyjal/hyjal.cpp | 12 +- .../CavernsOfTime/DarkPortal/dark_portal.cpp | 4 +- .../EscapeFromDurnholdeKeep/old_hillsbrad.cpp | 16 +- .../Kalimdor/RazorfenDowns/razorfen_downs.cpp | 6 +- .../WailingCaverns/wailing_caverns.cpp | 4 +- .../scripts/Kalimdor/ZulFarrak/zulfarrak.cpp | 8 +- src/server/scripts/Kalimdor/azshara.cpp | 8 +- .../scripts/Kalimdor/azuremyst_isle.cpp | 4 +- .../scripts/Kalimdor/bloodmyst_isle.cpp | 4 +- src/server/scripts/Kalimdor/darkshore.cpp | 4 +- .../scripts/Kalimdor/dustwallow_marsh.cpp | 16 +- src/server/scripts/Kalimdor/felwood.cpp | 4 +- src/server/scripts/Kalimdor/feralas.cpp | 6 +- src/server/scripts/Kalimdor/moonglade.cpp | 12 +- src/server/scripts/Kalimdor/mulgore.cpp | 4 +- src/server/scripts/Kalimdor/orgrimmar.cpp | 4 +- src/server/scripts/Kalimdor/silithus.cpp | 8 +- .../scripts/Kalimdor/stonetalon_mountains.cpp | 6 +- src/server/scripts/Kalimdor/tanaris.cpp | 12 +- src/server/scripts/Kalimdor/the_barrens.cpp | 8 +- .../scripts/Kalimdor/thousand_needles.cpp | 4 +- src/server/scripts/Kalimdor/thunder_bluff.cpp | 4 +- src/server/scripts/Kalimdor/winterspring.cpp | 12 +- .../trial_of_the_champion.cpp | 4 +- .../ForgeOfSouls/forge_of_souls.cpp | 8 +- .../HallsOfReflection/halls_of_reflection.cpp | 6 +- .../Naxxramas/boss_four_horsemen.cpp | 8 +- .../scripts/Northrend/Nexus/Oculus/oculus.cpp | 8 +- .../Ulduar/HallsOfStone/halls_of_stone.cpp | 4 +- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 8 +- .../Northrend/VioletHold/violet_hold.cpp | 4 +- .../scripts/Northrend/borean_tundra.cpp | 22 +-- src/server/scripts/Northrend/dalaran.cpp | 6 +- src/server/scripts/Northrend/dragonblight.cpp | 4 +- .../scripts/Northrend/howling_fjord.cpp | 8 +- src/server/scripts/Northrend/icecrown.cpp | 8 +- .../scripts/Northrend/sholazar_basin.cpp | 16 +- src/server/scripts/Northrend/storm_peaks.cpp | 24 +-- src/server/scripts/Northrend/zuldrak.cpp | 8 +- .../Outland/BlackTemple/black_temple.cpp | 4 +- .../Outland/BlackTemple/boss_illidan.cpp | 4 +- .../BlackTemple/boss_shade_of_akama.cpp | 4 +- .../scripts/Outland/blades_edge_mountains.cpp | 16 +- .../scripts/Outland/hellfire_peninsula.cpp | 20 +-- src/server/scripts/Outland/nagrand.cpp | 4 +- src/server/scripts/Outland/netherstorm.cpp | 13 +- .../scripts/Outland/shadowmoon_valley.cpp | 37 ++-- src/server/scripts/Outland/shattrath_city.cpp | 35 ++-- .../scripts/Outland/terokkar_forest.cpp | 39 ++--- src/server/scripts/Outland/zangarmarsh.cpp | 20 +-- src/server/scripts/Spells/spell_warlock.cpp | 1 - .../scripts/World/areatrigger_scripts.cpp | 4 +- src/server/scripts/World/go_scripts.cpp | 12 +- src/server/scripts/World/guards.cpp | 1 - src/server/scripts/World/item_scripts.cpp | 14 +- src/server/scripts/World/npc_innkeeper.cpp | 6 +- src/server/scripts/World/npc_professions.cpp | 162 +++++++++--------- src/server/scripts/World/npc_taxi.cpp | 11 +- src/server/scripts/World/npcs_special.cpp | 66 ++++--- 123 files changed, 682 insertions(+), 800 deletions(-) diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 5691dcab862..f97b907828a 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1349,12 +1349,12 @@ void Guild::HandleSetMemberNote(WorldSession* session, const std::string& name, if (!_HasRankRight(session->GetPlayer(), officer ? GR_RIGHT_EOFFNOTE : GR_RIGHT_EPNOTE)) SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); // Noted player must be a member of guild - else if (Member* pMember = GetMember(session, name)) + else if (Member* member = GetMember(session, name)) { if (officer) - pMember->SetOfficerNote(note); + member->SetOfficerNote(note); else - pMember->SetPublicNote(note); + member->SetPublicNote(note); HandleRoster(session); } } @@ -1499,17 +1499,17 @@ void Guild::HandleRemoveMember(WorldSession* session, const std::string& name) if (!_HasRankRight(player, GR_RIGHT_REMOVE)) SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); // Removed player must be a member of guild - else if (Member* pMember = GetMember(session, name)) + else if (Member* member = GetMember(session, name)) { // Leader cannot be removed - if (pMember->IsRank(GR_GUILDMASTER)) + if (member->IsRank(GR_GUILDMASTER)) SendCommandResult(session, GUILD_QUIT_S, ERR_GUILD_LEADER_LEAVE); // Do not allow to remove player with the same rank or higher - else if (pMember->IsRankNotLower(player->GetRank())) + else if (member->IsRankNotLower(player->GetRank())) SendCommandResult(session, GUILD_QUIT_S, ERR_GUILD_RANK_TOO_HIGH_S, name); else { - uint64 guid = pMember->GetGUID(); + uint64 guid = member->GetGUID(); // After call to DeleteMember pointer to member becomes invalid DeleteMember(guid, false, true); _LogEvent(GUILD_EVENT_LOG_UNINVITE_PLAYER, player->GetGUIDLow(), GUID_LOPART(guid)); @@ -1525,10 +1525,10 @@ void Guild::HandleUpdateMemberRank(WorldSession* session, const std::string& nam if (!_HasRankRight(player, demote ? GR_RIGHT_DEMOTE : GR_RIGHT_PROMOTE)) SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); // Promoted player must be a member of guild - else if (Member* pMember = GetMember(session, name)) + else if (Member* member = GetMember(session, name)) { // Player cannot promote himself - if (pMember->IsSamePlayer(player->GetGUID())) + if (member->IsSamePlayer(player->GetGUID())) { SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_NAME_INVALID); return; @@ -1537,13 +1537,13 @@ void Guild::HandleUpdateMemberRank(WorldSession* session, const std::string& nam if (demote) { // Player can demote only lower rank members - if (pMember->IsRankNotLower(player->GetRank())) + if (member->IsRankNotLower(player->GetRank())) { SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_RANK_TOO_HIGH_S, name); return; } // Lowest rank cannot be demoted - if (pMember->GetRankId() >= _GetLowestRankId()) + if (member->GetRankId() >= _GetLowestRankId()) { SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_RANK_TOO_LOW_S, name); return; @@ -1552,8 +1552,8 @@ void Guild::HandleUpdateMemberRank(WorldSession* session, const std::string& nam else { // Allow to promote only to lower rank than member's rank - // pMember->GetRank() + 1 is the highest rank that current player can promote to - if (pMember->IsRankNotLower(player->GetRank() + 1)) + // member->GetRank() + 1 is the highest rank that current player can promote to + if (member->IsRankNotLower(player->GetRank() + 1)) { SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_RANK_TOO_HIGH_S, name); return; @@ -1561,9 +1561,9 @@ void Guild::HandleUpdateMemberRank(WorldSession* session, const std::string& nam } // When promoting player, rank is decreased, when demoting - increased - uint32 newRankId = pMember->GetRankId() + (demote ? 1 : -1); - pMember->ChangeRank(newRankId); - _LogEvent(demote ? GUILD_EVENT_LOG_DEMOTE_PLAYER : GUILD_EVENT_LOG_PROMOTE_PLAYER, player->GetGUIDLow(), GUID_LOPART(pMember->GetGUID()), newRankId); + uint32 newRankId = member->GetRankId() + (demote ? 1 : -1); + member->ChangeRank(newRankId); + _LogEvent(demote ? GUILD_EVENT_LOG_DEMOTE_PLAYER : GUILD_EVENT_LOG_PROMOTE_PLAYER, player->GetGUIDLow(), GUID_LOPART(member->GetGUID()), newRankId); _BroadcastEvent(demote ? GE_DEMOTION : GE_PROMOTION, 0, player->GetName(), name.c_str(), _GetRankName(newRankId).c_str()); } } @@ -1672,8 +1672,8 @@ bool Guild::HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool SQLTransaction trans = CharacterDatabase.BeginTransaction(); // Update remaining money amount if (remainingMoney < uint32(GUILD_WITHDRAW_MONEY_UNLIMITED)) - if (Member* pMember = GetMember(player->GetGUID())) - pMember->DecreaseBankRemainingValue(trans, GUILD_BANK_MAX_TABS, amount); + if (Member* member = GetMember(player->GetGUID())) + member->DecreaseBankRemainingValue(trans, GUILD_BANK_MAX_TABS, amount); // Remove money from bank _ModifyBankMoney(trans, amount, false); // Add money to player (if required) @@ -1699,10 +1699,10 @@ bool Guild::HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool void Guild::HandleMemberLogout(WorldSession* session) { Player* player = session->GetPlayer(); - if (Member* pMember = GetMember(player->GetGUID())) + if (Member* member = GetMember(player->GetGUID())) { - pMember->SetStats(player); - pMember->UpdateLogoutTime(); + member->SetStats(player); + member->UpdateLogoutTime(); } _BroadcastEvent(GE_SIGNED_OFF, player->GetGUID(), player->GetName()); } @@ -1868,14 +1868,14 @@ void Guild::LoadRankFromDB(Field* fields) bool Guild::LoadMemberFromDB(Field* fields) { uint32 lowguid = fields[1].GetUInt32(); - Member *pMember = new Member(m_id, MAKE_NEW_GUID(lowguid, 0, HIGHGUID_PLAYER), fields[2].GetUInt8()); - if (!pMember->LoadFromDB(fields)) + Member *member = new Member(m_id, MAKE_NEW_GUID(lowguid, 0, HIGHGUID_PLAYER), fields[2].GetUInt8()); + if (!member->LoadFromDB(fields)) { _DeleteMemberFromDB(lowguid); - delete pMember; + delete member; return false; } - m_members[lowguid] = pMember; + m_members[lowguid] = member; return true; } @@ -2087,9 +2087,9 @@ bool Guild::AddMember(uint64 guid, uint8 rankId) if (rankId == GUILD_RANK_NONE) rankId = _GetLowestRankId(); - Member* pMember = new Member(m_id, guid, rankId); + Member* member = new Member(m_id, guid, rankId); if (player) - pMember->SetStats(player); + member->SetStats(player); else { bool ok = false; @@ -2099,25 +2099,25 @@ bool Guild::AddMember(uint64 guid, uint8 rankId) if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) { Field* fields = result->Fetch(); - pMember->SetStats( + member->SetStats( fields[0].GetString(), fields[1].GetUInt8(), fields[2].GetUInt8(), fields[3].GetUInt16(), fields[4].GetUInt32()); - ok = pMember->CheckStats(); + ok = member->CheckStats(); } if (!ok) { - delete pMember; + delete member; return false; } } - m_members[lowguid] = pMember; + m_members[lowguid] = member; SQLTransaction trans(NULL); - pMember->SaveToDB(trans); + member->SaveToDB(trans); // If player not in game data in will be loaded from guild tables, so no need to update it! if (player) { @@ -2174,8 +2174,8 @@ void Guild::DeleteMember(uint64 guid, bool isDisbanding, bool isKicked) // Call script on remove before member is acutally removed from guild (and database) sScriptMgr->OnGuildRemoveMember(this, player, isDisbanding, isKicked); - if (Member* pMember = GetMember(guid)) - delete pMember; + if (Member* member = GetMember(guid)) + delete member; m_members.erase(lowguid); // If player not online data in data field will be loaded from guild tabs no need to update it !! @@ -2193,9 +2193,9 @@ void Guild::DeleteMember(uint64 guid, bool isDisbanding, bool isKicked) bool Guild::ChangeMemberRank(uint64 guid, uint8 newRank) { if (newRank <= _GetLowestRankId()) // Validate rank (allow only existing ranks) - if (Member* pMember = GetMember(guid)) + if (Member* member = GetMember(guid)) { - pMember->ChangeRank(newRank); + member->ChangeRank(newRank); return true; } return false; @@ -2338,8 +2338,8 @@ bool Guild::_IsLeader(Player* player) const { if (player->GetGUID() == m_leaderGuid) return true; - if (const Member* pMember = GetMember(player->GetGUID())) - return pMember->IsRank(GR_GUILDMASTER); + if (const Member* member = GetMember(player->GetGUID())) + return member->IsRank(GR_GUILDMASTER); return false; } @@ -2452,15 +2452,15 @@ inline uint8 Guild::_GetRankBankTabRights(uint8 rankId, uint8 tabId) const inline uint32 Guild::_GetMemberRemainingSlots(uint64 guid, uint8 tabId) const { - if (const Member* pMember = GetMember(guid)) - return pMember->GetBankRemainingValue(tabId, this); + if (const Member* member = GetMember(guid)) + return member->GetBankRemainingValue(tabId, this); return 0; } inline uint32 Guild::_GetMemberRemainingMoney(uint64 guid) const { - if (const Member* pMember = GetMember(guid)) - return pMember->GetBankRemainingValue(GUILD_BANK_MAX_TABS, this); + if (const Member* member = GetMember(guid)) + return member->GetBankRemainingValue(GUILD_BANK_MAX_TABS, this); return 0; } @@ -2470,18 +2470,18 @@ inline void Guild::_DecreaseMemberRemainingSlots(SQLTransaction& trans, uint64 g if (uint32 remainingSlots = _GetMemberRemainingSlots(guid, tabId)) // Ignore guild master if (remainingSlots < uint32(GUILD_WITHDRAW_SLOT_UNLIMITED)) - if (Member* pMember = GetMember(guid)) - pMember->DecreaseBankRemainingValue(trans, tabId, 1); + if (Member* member = GetMember(guid)) + member->DecreaseBankRemainingValue(trans, tabId, 1); } inline bool Guild::_MemberHasTabRights(uint64 guid, uint8 tabId, uint32 rights) const { - if (const Member* pMember = GetMember(guid)) + if (const Member* member = GetMember(guid)) { // Leader always has full rights - if (pMember->IsRank(GR_GUILDMASTER) || m_leaderGuid == guid) + if (member->IsRank(GR_GUILDMASTER) || m_leaderGuid == guid) return true; - return (_GetRankBankTabRights(pMember->GetRankId(), tabId) & rights) == rights; + return (_GetRankBankTabRights(member->GetRankId(), tabId) & rights) == rights; } return false; } diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp index 67260daf638..106be2a605d 100644 --- a/src/server/game/Guilds/GuildMgr.cpp +++ b/src/server/game/Guilds/GuildMgr.cpp @@ -221,7 +221,6 @@ void GuildMgr::LoadGuilds() // Delete orphaned guild bank right entries before loading the valid ones CharacterDatabase.DirectExecute("DELETE gbr FROM guild_bank_right gbr LEFT JOIN guild g ON gbr.guildId = g.guildId WHERE g.guildId IS NULL"); - // 0 1 2 3 4 QueryResult result = CharacterDatabase.Query("SELECT guildid, TabId, rid, gbright, SlotPerDay FROM guild_bank_right ORDER BY guildid ASC, TabId ASC"); diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 496eae34133..8e4b41a9be4 100755 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -80,9 +80,9 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data) { Creature* creature = GetPlayer()->GetMap()->GetCreature(lguid); - bool ok_loot = creature && creature->isAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed); + bool lootAllowed = creature && creature->isAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed); - if (!ok_loot || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE)) + if (!lootAllowed || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE)) { player->SendLootRelease(lguid); return; diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index fb2590ebbfe..e73839c8071 100755 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -375,22 +375,22 @@ void Map::ScriptsProcess() } if (step.script->Talk.Flags & SF_TALK_USE_PLAYER) { - if (Player* pSource = _GetScriptPlayerSourceOrTarget(source, target, step.script)) + if (Player* player = _GetScriptPlayerSourceOrTarget(source, target, step.script)) { - LocaleConstant loc_idx = pSource->GetSession()->GetSessionDbLocaleIndex(); + LocaleConstant loc_idx = player->GetSession()->GetSessionDbLocaleIndex(); std::string text(sObjectMgr->GetTrinityString(step.script->Talk.TextID, loc_idx)); switch (step.script->Talk.ChatType) { case CHAT_TYPE_SAY: - pSource->Say(text, LANG_UNIVERSAL); + player->Say(text, LANG_UNIVERSAL); break; case CHAT_TYPE_YELL: - pSource->Yell(text, LANG_UNIVERSAL); + player->Yell(text, LANG_UNIVERSAL); break; case CHAT_TYPE_TEXT_EMOTE: case CHAT_TYPE_BOSS_EMOTE: - pSource->TextEmote(text); + player->TextEmote(text); break; case CHAT_TYPE_WHISPER: case CHAT_MSG_RAID_BOSS_WHISPER: @@ -399,7 +399,7 @@ void Map::ScriptsProcess() if (!targetGUID || !IS_PLAYER_GUID(targetGUID)) sLog->outError("%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str()); else - pSource->Whisper(text, LANG_UNIVERSAL, targetGUID); + player->Whisper(text, LANG_UNIVERSAL, targetGUID); break; } default: @@ -524,8 +524,8 @@ void Map::ScriptsProcess() else { // Source or target must be Player. - if (Player* pSource = _GetScriptPlayerSourceOrTarget(source, target, step.script)) - pSource->TeleportTo(step.script->TeleportTo.MapID, step.script->TeleportTo.DestX, step.script->TeleportTo.DestY, step.script->TeleportTo.DestZ, step.script->TeleportTo.Orientation); + if (Player* player = _GetScriptPlayerSourceOrTarget(source, target, step.script)) + player->TeleportTo(step.script->TeleportTo.MapID, step.script->TeleportTo.DestX, step.script->TeleportTo.DestY, step.script->TeleportTo.DestZ, step.script->TeleportTo.Orientation); } break; @@ -544,8 +544,8 @@ void Map::ScriptsProcess() // when script called for item spell casting then target == (unit or GO) and source is player WorldObject* worldObject; - Player* plrTarget = target->ToPlayer(); - if (plrTarget) + Player* player = target->ToPlayer(); + if (player) { if (source->GetTypeId() != TYPEID_UNIT && source->GetTypeId() != TYPEID_GAMEOBJECT && source->GetTypeId() != TYPEID_PLAYER) { @@ -557,8 +557,8 @@ void Map::ScriptsProcess() } else { - plrTarget = source->ToPlayer(); - if (plrTarget) + player = source->ToPlayer(); + if (player) { if (target->GetTypeId() != TYPEID_UNIT && target->GetTypeId() != TYPEID_GAMEOBJECT && target->GetTypeId() != TYPEID_PLAYER) { @@ -579,22 +579,22 @@ void Map::ScriptsProcess() // quest id and flags checked at script loading if ((worldObject->GetTypeId() != TYPEID_UNIT || ((Unit*)worldObject)->isAlive()) && - (step.script->QuestExplored.Distance == 0 || worldObject->IsWithinDistInMap(plrTarget, float(step.script->QuestExplored.Distance)))) - plrTarget->AreaExploredOrEventHappens(step.script->QuestExplored.QuestID); + (step.script->QuestExplored.Distance == 0 || worldObject->IsWithinDistInMap(player, float(step.script->QuestExplored.Distance)))) + player->AreaExploredOrEventHappens(step.script->QuestExplored.QuestID); else - plrTarget->FailQuest(step.script->QuestExplored.QuestID); + player->FailQuest(step.script->QuestExplored.QuestID); break; } case SCRIPT_COMMAND_KILL_CREDIT: // Source or target must be Player. - if (Player* pSource = _GetScriptPlayerSourceOrTarget(source, target, step.script)) + if (Player* player = _GetScriptPlayerSourceOrTarget(source, target, step.script)) { if (step.script->KillCredit.Flags & SF_KILLCREDIT_REWARD_GROUP) - pSource->RewardPlayerAndGroupAtEvent(step.script->KillCredit.CreatureEntry, pSource); + player->RewardPlayerAndGroupAtEvent(step.script->KillCredit.CreatureEntry, player); else - pSource->KilledMonsterCredit(step.script->KillCredit.CreatureEntry, 0); + player->KilledMonsterCredit(step.script->KillCredit.CreatureEntry, 0); } break; @@ -665,7 +665,7 @@ void Map::ScriptsProcess() case SCRIPT_COMMAND_ACTIVATE_OBJECT: // Source must be Unit. - if (Unit* pSource = _GetScriptUnit(source, true, step.script)) + if (Unit* unit = _GetScriptUnit(source, true, step.script)) { // Target must be GameObject. if (!target) @@ -682,7 +682,7 @@ void Map::ScriptsProcess() } if (GameObject* pGO = target->ToGameObject()) - pGO->Use(pSource); + pGO->Use(unit); } break; @@ -690,8 +690,8 @@ void Map::ScriptsProcess() { // Source (datalong2 != 0) or target (datalong2 == 0) must be Unit. bool bReverse = step.script->RemoveAura.Flags & SF_REMOVEAURA_REVERSE; - if (Unit* pTarget = _GetScriptUnit(bReverse ? source : target, bReverse, step.script)) - pTarget->RemoveAurasDueToSpell(step.script->RemoveAura.SpellID); + if (Unit* unit = _GetScriptUnit(bReverse ? source : target, bReverse, step.script)) + unit->RemoveAurasDueToSpell(step.script->RemoveAura.SpellID); break; } @@ -752,23 +752,23 @@ void Map::ScriptsProcess() case SCRIPT_COMMAND_PLAY_SOUND: // Source must be WorldObject. - if (WorldObject* pSource = _GetScriptWorldObject(source, true, step.script)) + if (WorldObject* object = _GetScriptWorldObject(source, true, step.script)) { // PlaySound.Flags bitmask: 0/1=anyone/target - Player* pTarget = NULL; + Player* player = NULL; if (step.script->PlaySound.Flags & SF_PLAYSOUND_TARGET_PLAYER) { // Target must be Player. - pTarget = _GetScriptPlayer(target, false, step.script); - if (!pTarget) + player = _GetScriptPlayer(target, false, step.script); + if (!target) break; } // PlaySound.Flags bitmask: 0/2=without/with distance dependent if (step.script->PlaySound.Flags & SF_PLAYSOUND_DISTANCE_SOUND) - pSource->PlayDistanceSound(step.script->PlaySound.SoundID, pTarget); + object->PlayDistanceSound(step.script->PlaySound.SoundID, player); else - pSource->PlayDirectSound(step.script->PlaySound.SoundID, pTarget); + object->PlayDirectSound(step.script->PlaySound.SoundID, player); } break; @@ -796,12 +796,12 @@ void Map::ScriptsProcess() case SCRIPT_COMMAND_LOAD_PATH: // Source must be Unit. - if (Unit* pSource = _GetScriptUnit(source, true, step.script)) + if (Unit* unit = _GetScriptUnit(source, true, step.script)) { if (!sWaypointMgr->GetPath(step.script->LoadPath.PathID)) sLog->outError("%s source object has an invalid path (%u), skipping.", step.script->GetDebugInfo().c_str(), step.script->LoadPath.PathID); else - pSource->GetMotionMaster()->MovePath(step.script->LoadPath.PathID, step.script->LoadPath.IsRepeatable); + unit->GetMotionMaster()->MovePath(step.script->LoadPath.PathID, step.script->LoadPath.IsRepeatable); } break; @@ -876,21 +876,21 @@ void Map::ScriptsProcess() case SCRIPT_COMMAND_ORIENTATION: // Source must be Unit. - if (Unit* pSource = _GetScriptUnit(source, true, step.script)) + if (Unit* sourceUnit = _GetScriptUnit(source, true, step.script)) { - if (step.script->Orientation.Flags& SF_ORIENTATION_FACE_TARGET) + if (step.script->Orientation.Flags & SF_ORIENTATION_FACE_TARGET) { // Target must be Unit. - Unit* pTarget = _GetScriptUnit(target, false, step.script); - if (!pTarget) + Unit* targetUnit = _GetScriptUnit(target, false, step.script); + if (!targetUnit) break; - pSource->SetInFront(pTarget); + sourceUnit->SetInFront(targetUnit); } else - pSource->SetOrientation(step.script->Orientation.Orientation); + sourceUnit->SetOrientation(step.script->Orientation.Orientation); - pSource->SendMovementFlagUpdate(); + sourceUnit->SendMovementFlagUpdate(); } break; @@ -908,14 +908,14 @@ void Map::ScriptsProcess() case SCRIPT_COMMAND_CLOSE_GOSSIP: // Source must be Player. - if (Player* pSource = _GetScriptPlayer(source, true, step.script)) - pSource->PlayerTalkClass->SendCloseGossip(); + if (Player* player = _GetScriptPlayer(source, true, step.script)) + player->PlayerTalkClass->SendCloseGossip(); break; case SCRIPT_COMMAND_PLAYMOVIE: // Source must be Player. - if (Player* pSource = _GetScriptPlayer(source, true, step.script)) - pSource->SendMovieStart(step.script->PlayMovie.MovieID); + if (Player* player = _GetScriptPlayer(source, true, step.script)) + player->SendMovieStart(step.script->PlayMovie.MovieID); break; default: diff --git a/src/server/game/Texts/CreatureTextMgr.h b/src/server/game/Texts/CreatureTextMgr.h index ddf10568411..8ed0b01fcd5 100755 --- a/src/server/game/Texts/CreatureTextMgr.h +++ b/src/server/game/Texts/CreatureTextMgr.h @@ -158,6 +158,8 @@ class CreatureTextLocalizer case CHAT_MSG_RAID_BOSS_WHISPER: data.put(whisperGUIDpos, player->GetGUID()); break; + default: + break; } player->SendDirectMessage(&data); diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 814b18389a7..679bb450800 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -46,7 +46,7 @@ public: { "cinematic", SEC_MODERATOR, false, &HandleDebugPlayCinematicCommand, "", NULL }, { "movie", SEC_MODERATOR, false, &HandleDebugPlayMovieCommand, "", NULL }, { "sound", SEC_MODERATOR, false, &HandleDebugPlaySoundCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { NULL, SEC_PLAYER, false, NULL, "", NULL } }; static ChatCommand debugSendCommandTable[] = { @@ -61,7 +61,7 @@ public: { "sellerror", SEC_ADMINISTRATOR, false, &HandleDebugSendSellErrorCommand, "", NULL }, { "setphaseshift", SEC_ADMINISTRATOR, false, &HandleDebugSendSetPhaseShiftCommand, "", NULL }, { "spellfail", SEC_ADMINISTRATOR, false, &HandleDebugSendSpellFailCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { NULL, SEC_PLAYER, false, NULL, "", NULL } }; static ChatCommand debugCommandTable[] = { @@ -90,12 +90,12 @@ public: { "areatriggers", SEC_ADMINISTRATOR, false, &HandleDebugAreaTriggersCommand, "", NULL }, { "los", SEC_MODERATOR, false, &HandleDebugLoSCommand, "", NULL }, { "moveflags", SEC_ADMINISTRATOR, false, &HandleDebugMoveflagsCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { NULL, SEC_PLAYER, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { { "debug", SEC_MODERATOR, true, NULL, "", debugCommandTable }, - { NULL, 0, false, NULL, "", NULL } + { NULL, SEC_PLAYER, false, NULL, "", NULL } }; return commandTable; } @@ -1198,7 +1198,7 @@ public: int currentValue = (int)handler->GetSession()->GetPlayer()->GetUInt32Value(opcode); currentValue += value; - handler->GetSession()->GetPlayer()->SetUInt32Value(opcode , (uint32)currentValue); + handler->GetSession()->GetPlayer()->SetUInt32Value(opcode, (uint32)currentValue); handler->PSendSysMessage(LANG_CHANGE_32BIT_FIELD, opcode, currentValue); diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index b6e15ca25ea..28920f7c109 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -153,7 +153,7 @@ public: { "spell_threats", SEC_ADMINISTRATOR, true, &HandleReloadSpellThreatsCommand, "", NULL }, { "spell_group_stack_rules", SEC_ADMINISTRATOR, true, &HandleReloadSpellGroupStackRulesCommand, "", NULL }, { "trinity_string", SEC_ADMINISTRATOR, true, &HandleReloadTrinityStringCommand, "", NULL }, - { "warden_action", SEC_ADMINISTRATOR, true, &HandleReloadWardenActionCommand, "", NULL }, + { "warden_action", SEC_ADMINISTRATOR, true, &HandleReloadWardenactionCommand, "", NULL }, { "waypoint_scripts", SEC_ADMINISTRATOR, true, &HandleReloadWpScriptsCommand, "", NULL }, { "waypoint_data", SEC_ADMINISTRATOR, true, &HandleReloadWpCommand, "", NULL }, { "vehicle_accessory", SEC_ADMINISTRATOR, true, &HandleReloadVehicleAccessoryCommand, "", NULL }, @@ -728,7 +728,7 @@ public: return true; } - static bool HandleReloadWardenActionCommand(ChatHandler* handler, const char* /*args*/) + static bool HandleReloadWardenactionCommand(ChatHandler* handler, const char* /*args*/) { if (!sWorld->getBoolConfig(CONFIG_WARDEN_ENABLED)) { diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp index 7ef11e5256a..15c418d2919 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp @@ -126,11 +126,11 @@ public: InstanceScript* instance; - uint8 EventPhase; + uint8 EventPhase; uint32 Event_Timer; - uint8 MobSpawnId; - uint8 MobCount; + uint8 MobSpawnId; + uint8 MobCount; uint32 MobDeath_Timer; uint64 RingMobGUID[4]; @@ -142,16 +142,16 @@ public: { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - EventPhase = 0; - Event_Timer = 1000; + EventPhase = 0; + Event_Timer = 1000; - MobCount = 0; - MobDeath_Timer = 0; + MobCount = 0; + MobDeath_Timer = 0; for (uint8 i = 0; i < MAX_MOB_AMOUNT; ++i) RingMobGUID[i] = 0; - RingBossGUID = 0; + RingBossGUID = 0; CanWalk = false; } @@ -183,24 +183,24 @@ public: { case 0: DoScriptText(SCRIPT_TEXT1, me);//2 - CanWalk = false; - Event_Timer = 5000; + CanWalk = false; + Event_Timer = 5000; break; case 1: DoScriptText(SCRIPT_TEXT2, me);//4 - CanWalk = false; - Event_Timer = 5000; + CanWalk = false; + Event_Timer = 5000; break; case 2: - CanWalk = false; + CanWalk = false; break; case 3: DoScriptText(SCRIPT_TEXT3, me);//5 break; case 4: DoScriptText(SCRIPT_TEXT4, me);//6 - CanWalk = false; - Event_Timer = 5000; + CanWalk = false; + Event_Timer = 5000; break; case 5: if (instance) @@ -227,16 +227,16 @@ public: { if (MobDeath_Timer <= diff) { - MobDeath_Timer = 2500; + MobDeath_Timer = 2500; if (RingBossGUID) { Creature* boss = Unit::GetCreature(*me, RingBossGUID); if (boss && !boss->isAlive() && boss->isDead()) { - RingBossGUID = 0; - Event_Timer = 5000; - MobDeath_Timer = 0; + RingBossGUID = 0; + Event_Timer = 5000; + MobDeath_Timer = 0; return; } return; @@ -247,7 +247,7 @@ public: Creature* mob = Unit::GetCreature(*me, RingMobGUID[i]); if (mob && !mob->isAlive() && mob->isDead()) { - RingMobGUID[i] = 0; + RingMobGUID[i] = 0; --MobCount; //seems all are gone, so set timer to continue and discontinue this @@ -363,9 +363,9 @@ public: void Reset() { - ThunderClap_Timer = 12000; - FireballVolley_Timer = 0; - MightyBlow_Timer = 15000; + ThunderClap_Timer = 12000; + FireballVolley_Timer = 0; + MightyBlow_Timer = 15000; } void UpdateAI(const uint32 diff) @@ -426,7 +426,7 @@ class npc_kharan_mighthammer : public CreatureScript public: npc_kharan_mighthammer() : CreatureScript("npc_kharan_mighthammer") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*Sender*/, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); switch (action) @@ -520,7 +520,7 @@ class npc_lokhtos_darkbargainer : public CreatureScript public: npc_lokhtos_darkbargainer() : CreatureScript("npc_lokhtos_darkbargainer") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*Sender*/, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); if (action == GOSSIP_ACTION_INFO_DEF + 1) @@ -564,7 +564,6 @@ enum DughalQuests QUEST_JAIL_BREAK = 4322 }; -// DELETE THIS IF IT IS NOT NEEDED! #define SAY_DUGHAL_FREE "Thank you, $N! I'm free!!!" #define GOSSIP_DUGHAL "You're free, Dughal! Get out of here!" @@ -585,7 +584,7 @@ public: return dughal_stormwingAI; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 Sender, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); if (action == GOSSIP_ACTION_INFO_DEF + 1) @@ -619,7 +618,7 @@ public: case 0:me->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID); break; case 1:instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; case 2: - me->SetVisibility(VISIBILITY_OFF); + me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED); @@ -634,7 +633,7 @@ public: { if (IsBeingEscorted && killer == me) { - me->SetVisibility(VISIBILITY_OFF); + me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED); @@ -646,13 +645,13 @@ public: if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; if ((instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_ENDED) { - me->SetVisibility(VISIBILITY_OFF); + me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } else { - me->SetVisibility(VISIBILITY_ON); + me->SetVisible(true); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -767,7 +766,7 @@ public: instance->SetData(DATA_GATE_SC, 0); break; case 19: - me->SetVisibility(VISIBILITY_OFF); + me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR, 403.61f, -51.71f, -63.92f, 3.600434f, TEMPSUMMON_DEAD_DESPAWN, 0); @@ -810,13 +809,13 @@ public: } if ((instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& instance->GetData(DATA_SUPPLY_ROOM) == ENCOUNTER_STATE_ENDED) { - me->SetVisibility(VISIBILITY_OFF); + me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } else { - me->SetVisibility(VISIBILITY_ON); + me->SetVisible(true); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -1065,7 +1064,7 @@ public: return tobias_seecherAI; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 Sender, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); if (action == GOSSIP_ACTION_INFO_DEF + 1) @@ -1099,7 +1098,7 @@ public: { if (IsBeingEscorted && killer == me) { - me->SetVisibility(VISIBILITY_OFF); + me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_ENDED); @@ -1114,7 +1113,7 @@ public: case 2: instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; case 4: - me->SetVisibility(VISIBILITY_OFF); + me->SetVisible(false); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_ENDED); @@ -1127,13 +1126,13 @@ public: if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; if ((instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& instance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_ENDED) { - me->SetVisibility(VISIBILITY_OFF); + me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } else { - me->SetVisibility(VISIBILITY_ON); + me->SetVisible(true); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -1217,8 +1216,8 @@ public: if (HasEscortState(STATE_ESCORT_ESCORTING)) return; - BreakKeg_Timer = 0; - BreakDoor_Timer = 0; + BreakKeg_Timer = 0; + BreakDoor_Timer = 0; } void DoGo(uint32 id, uint32 state) @@ -1263,8 +1262,8 @@ public: if (BreakKeg_Timer <= diff) { DoGo(DATA_GO_BAR_KEG, 0); - BreakKeg_Timer = 0; - BreakDoor_Timer = 1000; + BreakKeg_Timer = 0; + BreakDoor_Timer = 1000; } else BreakKeg_Timer -= diff; } diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp index 2e8dc029d44..ff0f1a4cedd 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp @@ -42,8 +42,8 @@ public: void Reset() { - FireBlast_Timer = 2000; - Spirit_Timer = 24000; + FireBlast_Timer = 2000; + Spirit_Timer = 24000; } void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp index b4a4c416693..2585796e28e 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp @@ -49,11 +49,11 @@ public: void Reset() { - ShadowBolt_Timer = 7000; - CurseOfTongues_Timer = 24000; - CurseOfWeakness_Timer = 12000; - DemonArmor_Timer = 3000; - EnvelopingWeb_Timer = 16000; + ShadowBolt_Timer = 7000; + CurseOfTongues_Timer = 24000; + CurseOfWeakness_Timer = 12000; + DemonArmor_Timer = 3000; + EnvelopingWeb_Timer = 16000; } void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp index e894fd35bd1..fea8657496b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp @@ -55,9 +55,9 @@ public: void Reset() { - HandOfThaurissan_Timer = 4000; - AvatarOfFlame_Timer = 25000; - //Counter = 0; + HandOfThaurissan_Timer = 4000; + AvatarOfFlame_Timer = 25000; + //Counter= 0; } void EnterCombat(Unit* /*who*/) @@ -100,7 +100,7 @@ public: //else //{ HandOfThaurissan_Timer = 5000; - //Counter = 0; + //Counter = 0; //} } else HandOfThaurissan_Timer -= diff; diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp index 69808386423..703f684cc9f 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp @@ -47,11 +47,11 @@ public: void Reset() { - MightyBlow_Timer = 8000; - HamString_Timer = 12000; - Cleave_Timer = 16000; - Adds_Timer = 0; - Medics = false; + MightyBlow_Timer = 8000; + HamString_Timer = 12000; + Cleave_Timer = 16000; + Adds_Timer = 0; + Medics = false; } void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp index 883c601709e..b2c93d949c2 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp @@ -43,8 +43,8 @@ public: void Reset() { - WhirlWind_Timer = 12000; - MortalStrike_Timer = 22000; + WhirlWind_Timer = 12000; + MortalStrike_Timer = 22000; } void EnterCombat(Unit* /*who*/) diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp index 7686ece3c2e..63d945ade90 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp @@ -43,8 +43,8 @@ public: void Reset() { - GroundTremor_Timer = 12000; - Frenzy_Timer = 0; + GroundTremor_Timer = 12000; + Frenzy_Timer =0; } void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp index 26e2bc80eb2..f4f245be4be 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp @@ -47,10 +47,10 @@ public: void Reset() { - ShadowWordPain_Timer = 4000; - ManaBurn_Timer = 14000; - PsychicScream_Timer = 32000; - ShadowShield_Timer = 8000; + ShadowWordPain_Timer = 4000; + ManaBurn_Timer = 14000; + PsychicScream_Timer = 32000; + ShadowShield_Timer = 8000; } void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp index 141b8307b7b..52d78487776 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp @@ -48,8 +48,8 @@ public: void Reset() { - FieryBurst_Timer = 5000; - WarStomp_Timer = 0; + FieryBurst_Timer = 5000; + WarStomp_Timer =0; } void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp index 72a60daea2d..e6f65ab4252 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp @@ -49,10 +49,10 @@ public: void Reset() { - Heal_Timer = 12000; // These times are probably wrong - MindBlast_Timer = 16000; - ShadowWordPain_Timer = 2000; - Smite_Timer = 8000; + Heal_Timer = 12000; //These times are probably wrong + MindBlast_Timer = 16000; + ShadowWordPain_Timer = 2000; + Smite_Timer = 8000; } void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp index 3c8d5fc4fa8..de520fa8a58 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp @@ -45,7 +45,7 @@ class boss_gloomrel : public CreatureScript public: boss_gloomrel() : CreatureScript("boss_gloomrel") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*Sender*/, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); switch (action) @@ -104,7 +104,7 @@ class boss_doomrel : public CreatureScript public: boss_doomrel() : CreatureScript("boss_doomrel") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*Sender*/, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); switch (action) @@ -156,11 +156,11 @@ public: void Reset() { - ShadowVolley_Timer = 10000; - Immolate_Timer = 18000; - CurseOfWeakness_Timer = 5000; - DemonArmor_Timer = 16000; - Voidwalkers = false; + ShadowVolley_Timer = 10000; + Immolate_Timer = 18000; + CurseOfWeakness_Timer = 5000; + DemonArmor_Timer = 16000; + Voidwalkers = false; me->setFaction(FACTION_FRIEND); diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp index 2ef3ef48ecb..03cb077936b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp @@ -115,57 +115,57 @@ public: { memset(&encounter, 0, sizeof(encounter)); - EmperorGUID = 0; - PhalanxGUID = 0; - MagmusGUID = 0; - MoiraGUID = 0; + EmperorGUID = 0; + PhalanxGUID = 0; + MagmusGUID = 0; + MoiraGUID = 0; - GoArena1GUID = 0; - GoArena2GUID = 0; - GoArena3GUID = 0; - GoArena4GUID = 0; - GoShadowLockGUID = 0; - GoShadowMechGUID = 0; - GoShadowGiantGUID = 0; - GoShadowDummyGUID = 0; - GoBarKegGUID = 0; - GoBarKegTrapGUID = 0; - GoBarDoorGUID = 0; - GoTombEnterGUID = 0; - GoTombExitGUID = 0; - GoLyceumGUID = 0; - GoSFSGUID = 0; - GoSFNGUID = 0; - GoGolemNGUID = 0; - GoGolemSGUID = 0; - GoThroneGUID = 0; - GoChestGUID = 0; - GoSpectralChaliceGUID = 0; + GoArena1GUID = 0; + GoArena2GUID = 0; + GoArena3GUID = 0; + GoArena4GUID = 0; + GoShadowLockGUID = 0; + GoShadowMechGUID = 0; + GoShadowGiantGUID = 0; + GoShadowDummyGUID = 0; + GoBarKegGUID = 0; + GoBarKegTrapGUID = 0; + GoBarDoorGUID = 0; + GoTombEnterGUID = 0; + GoTombExitGUID = 0; + GoLyceumGUID = 0; + GoSFSGUID = 0; + GoSFNGUID = 0; + GoGolemNGUID = 0; + GoGolemSGUID = 0; + GoThroneGUID = 0; + GoChestGUID = 0; + GoSpectralChaliceGUID = 0; - BarAleCount = 0; - GhostKillCount = 0; - TombEventStarterGUID = 0; + BarAleCount = 0; + GhostKillCount = 0; + TombEventStarterGUID = 0; TombTimer = TIMER_TOMBOFTHESEVEN; - TombEventCounter = 0; + TombEventCounter = 0; for (uint8 i = 0; i < 7; ++i) - TombBossGUIDs[i] = 0; + TombBossGUIDs[i] = 0; } void OnCreatureCreate(Creature* creature) { switch (creature->GetEntry()) { - case NPC_EMPEROR: EmperorGUID = creature->GetGUID(); break; - case NPC_PHALANX: PhalanxGUID = creature->GetGUID(); break; - case NPC_MOIRA: MoiraGUID = creature->GetGUID(); break; - case NPC_DOOMREL: TombBossGUIDs[0] = creature->GetGUID(); break; - case NPC_DOPEREL: TombBossGUIDs[1] = creature->GetGUID(); break; - case NPC_HATEREL: TombBossGUIDs[2] = creature->GetGUID(); break; - case NPC_VILEREL: TombBossGUIDs[3] = creature->GetGUID(); break; - case NPC_SEETHREL: TombBossGUIDs[4] = creature->GetGUID(); break; - case NPC_GLOOMREL: TombBossGUIDs[5] = creature->GetGUID(); break; - case NPC_ANGERREL: TombBossGUIDs[6] = creature->GetGUID(); break; + case NPC_EMPEROR: EmperorGUID = creature->GetGUID(); break; + case NPC_PHALANX: PhalanxGUID = creature->GetGUID(); break; + case NPC_MOIRA: MoiraGUID = creature->GetGUID(); break; + case NPC_DOOMREL: TombBossGUIDs[0] = creature->GetGUID(); break; + case NPC_DOPEREL: TombBossGUIDs[1] = creature->GetGUID(); break; + case NPC_HATEREL: TombBossGUIDs[2] = creature->GetGUID(); break; + case NPC_VILEREL: TombBossGUIDs[3] = creature->GetGUID(); break; + case NPC_SEETHREL: TombBossGUIDs[4] = creature->GetGUID(); break; + case NPC_GLOOMREL: TombBossGUIDs[5] = creature->GetGUID(); break; + case NPC_ANGERREL: TombBossGUIDs[6] = creature->GetGUID(); break; case NPC_MAGMUS: MagmusGUID = creature->GetGUID(); if (!creature->isAlive()) diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp index 7a4ba5777d1..af0dfd38ae8 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp @@ -59,10 +59,10 @@ public: void Reset() { - Cleave_Timer = 8000; // These times are probably wrong - BlastWave_Timer = 12000; - MortalStrike_Timer = 20000; - KnockBack_Timer = 30000; + Cleave_Timer = 8000; // These times are probably wrong + BlastWave_Timer = 12000; + MortalStrike_Timer = 20000; + KnockBack_Timer = 30000; } void EnterCombat(Unit* /*who*/) diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp index c4e0d6ea715..1e539449fe3 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp @@ -92,15 +92,15 @@ public: void Reset() { - ShadowFlame_Timer = 12000; // These times are probably wrong - BellowingRoar_Timer = 30000; - VeilOfShadow_Timer = 15000; - Cleave_Timer = 7000; - TailLash_Timer = 10000; - ClassCall_Timer = 35000; // 35-40 seconds + ShadowFlame_Timer = 12000; // These times are probably wrong + BellowingRoar_Timer = 30000; + VeilOfShadow_Timer = 15000; + Cleave_Timer = 7000; + TailLash_Timer = 10000; + ClassCall_Timer = 35000; // 35-40 seconds Phase3 = false; - DespawnTimer = 5000; + DespawnTimer = 5000; } void KilledUnit(Unit* Victim) diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp index 4a72bd0ca38..5bcb6d051bb 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp @@ -51,20 +51,20 @@ class boss_vaelastrasz : public CreatureScript public: boss_vaelastrasz() : CreatureScript("boss_vaelastrasz") { } - void SendDefaultMenu(Player* player, Creature* creature, uint32 Action) + void SendDefaultMenu(Player* player, Creature* creature, uint32 action) { - if (Action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time + if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time { player->CLOSE_GOSSIP_MENU(); CAST_AI(boss_vaelastrasz::boss_vaelAI, creature->AI())->BeginSpeech(player); } } - bool OnGossipSelect(Player* player, Creature* creature, uint32 Sender, uint32 Action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (Sender == GOSSIP_SENDER_MAIN) - SendDefaultMenu(player, creature, Action); + if (sender == GOSSIP_SENDER_MAIN) + SendDefaultMenu(player, creature, action); return true; } @@ -108,17 +108,17 @@ public: void Reset() { - PlayerGUID = 0; - SpeechTimer = 0; - SpeechNum = 0; - Cleave_Timer = 8000; //These times are probably wrong - FlameBreath_Timer = 11000; - BurningAdrenalineCaster_Timer = 15000; - BurningAdrenalineTank_Timer = 45000; - FireNova_Timer = 5000; - TailSwipe_Timer = 20000; - HasYelled = false; - DoingSpeech = false; + PlayerGUID = 0; + SpeechTimer = 0; + SpeechNum = 0; + Cleave_Timer = 8000; // These times are probably wrong + FlameBreath_Timer = 11000; + BurningAdrenalineCaster_Timer = 15000; + BurningAdrenalineTank_Timer = 45000; + FireNova_Timer = 5000; + TailSwipe_Timer = 20000; + HasYelled = false; + DoingSpeech = false; } void BeginSpeech(Unit* target) diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp index 2c7cd73c604..668b84d38dd 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp @@ -83,10 +83,10 @@ class boss_victor_nefarius : public CreatureScript public: boss_victor_nefarius() : CreatureScript("boss_victor_nefarius") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*Sender*/, uint32 Action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (Action) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -220,13 +220,13 @@ public: void Reset() { - SpawnedAdds = 0; - AddSpawnTimer = 10000; - ShadowBoltTimer = 5000; - FearTimer = 8000; - ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier - NefarianGUID = 0; - NefCheckTime = 2000; + SpawnedAdds = 0; + AddSpawnTimer = 10000; + ShadowBoltTimer = 5000; + FearTimer = 8000; + ResetTimer = 900000; // On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier + NefarianGUID = 0; + NefCheckTime = 2000; me->SetUInt32Value(UNIT_NPC_FLAGS, 1); me->setFaction(35); diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp index 9830563ac87..aa62e1277f8 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp @@ -158,7 +158,6 @@ public: me->GetMotionMaster()->MoveChase(me->getVictim(), me->m_CombatDistance); uiPhase = 0; break; - } } else uiTimer -= uiDiff; } @@ -174,9 +173,7 @@ public: uiTimer = 1500; uiPhase = 1; } - }; - }; void AddSC_boss_mr_smite() diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp index fffd8d41264..0d473a5adf1 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp @@ -45,7 +45,7 @@ public: player->GetSession()->SendNotification("Instance script not initialized"); return true; } - if (instance->GetData(EVENT_STATE)!= CANNON_NOT_USED) + if (instance->GetData(EVENT_STATE) != CANNON_NOT_USED) return false; if (targets.GetGOTarget() && targets.GetGOTarget()->GetEntry() == GO_DEFIAS_CANNON) { @@ -55,7 +55,6 @@ public: player->DestroyItemCount(item->GetEntry(), 1, true); return true; } - }; void AddSC_deadmines() diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h index 55726fb2a8e..419af40ee36 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h +++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h @@ -47,4 +47,3 @@ enum GameObjects GO_MR_SMITE_CHEST = 144111 }; #endif - diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp index cd5566007ee..12f2cef2d0b 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp @@ -95,10 +95,10 @@ public: return new npc_blastmaster_emi_shortfuseAI(creature); } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { if (npc_escortAI* pEscortAI = CAST_AI(npc_blastmaster_emi_shortfuse::npc_blastmaster_emi_shortfuseAI, creature->AI())) pEscortAI->Start(true, false, player->GetGUID()); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index b15cb7d3da1..39be500e487 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -769,10 +769,10 @@ class npc_grandmother : public CreatureScript public: npc_grandmother() : CreatureScript("npc_grandmother") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { if (Creature* pBigBadWolf = creature->SummonCreature(CREATURE_BIG_BAD_WOLF, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS)) pBigBadWolf->AI()->AttackStart(player); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index 30fc8a2f9c4..b4345c61a77 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -324,12 +324,12 @@ public: } }; - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); npc_barnesAI* pBarnesAI = CAST_AI(npc_barnes::npc_barnesAI, creature->AI()); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -414,10 +414,10 @@ class npc_berthold : public CreatureScript public: npc_berthold() : CreatureScript("npc_berthold") { } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + if (action == GOSSIP_ACTION_INFO_DEF + 1) player->CastSpell(player, SPELL_TELEPORT, true); player->CLOSE_GOSSIP_MENU(); diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp index 679db023b63..ccaaa0ec68d 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp @@ -56,10 +56,10 @@ class npc_kalecgos : public CreatureScript public: npc_kalecgos() : CreatureScript("npc_kalecgos") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp index 862a980394a..f085e15fcb7 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp @@ -200,7 +200,7 @@ class boss_majordomo : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 /*uiAction*/) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/) { player->CLOSE_GOSSIP_MENU(); creature->AI()->DoAction(ACTION_START_RAGNAROS); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index a264c7afa98..a55694ad419 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -362,10 +362,10 @@ class npc_death_knight_initiate : public CreatureScript public: npc_death_knight_initiate() : CreatureScript("npc_death_knight_initiate") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { player->CLOSE_GOSSIP_MENU(); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 2df31971275..505bf2cbf5c 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -287,10 +287,10 @@ class npc_highlord_darion_mograine : public CreatureScript public: npc_highlord_darion_mograine() : CreatureScript("npc_highlord_darion_mograine") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp index 058c688641f..4517b1741d4 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp @@ -83,7 +83,7 @@ public: if (!instance) return; - //Any other actions to do with vorrel? setStandState? + //Any other Actions to do with vorrel? setStandState? if (Unit* vorrel = Unit::GetUnit(*me, instance->GetData64(DATA_VORREL))) DoScriptText(SAY_TRIGGER_VORREL, vorrel); } diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp index dded75e193c..9cb30eda060 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp @@ -63,10 +63,10 @@ public: return new npc_shadowfang_prisonerAI(creature); } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index dd2bef556c4..8bbcdd6c036 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -226,7 +226,7 @@ class boss_janalai : public CreatureScript BombCount = 0; } - bool HatchAllEggs(uint32 uiAction) //1: reset, 2: isHatching all + bool HatchAllEggs(uint32 action) //1: reset, 2: isHatching all { std::list templist; float x, y, z; @@ -251,9 +251,9 @@ class boss_janalai : public CreatureScript for (std::list::const_iterator i = templist.begin(); i != templist.end(); ++i) { - if (uiAction == 1) + if (action == 1) (*i)->SetDisplayId(10056); - else if (uiAction == 2 &&(*i)->GetDisplayId() != 11686) + else if (action == 2 &&(*i)->GetDisplayId() != 11686) (*i)->CastSpell(*i, SPELL_HATCH_EGG, false); } return true; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index bf951dd186c..df90f80db4c 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -157,10 +157,10 @@ class npc_zulaman_hostage : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + if (action == GOSSIP_ACTION_INFO_DEF + 1) player->CLOSE_GOSSIP_MENU(); if (!creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp index bd6f6ec4748..f9fdd3a9587 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp @@ -186,7 +186,7 @@ class boss_venoxis : public CreatureScript events.ScheduleEvent(EVENT_THRASH, urand(10000, 20000)); break; - // troll form spells and actions (first part) + // troll form spells and Actions (first part) case EVENT_DISPEL_MAGIC: DoCast(me, SPELL_DISPEL_MAGIC); events.ScheduleEvent(EVENT_DISPEL_MAGIC, urand(15000, 20000), 0, PHASE_ONE); @@ -224,7 +224,7 @@ class boss_venoxis : public CreatureScript break; // - // snake form spells and actions + // snake form spells and Actions // case EVENT_VENOM_SPIT: diff --git a/src/server/scripts/EasternKingdoms/blasted_lands.cpp b/src/server/scripts/EasternKingdoms/blasted_lands.cpp index 2ad03f8b504..2042e5313c3 100644 --- a/src/server/scripts/EasternKingdoms/blasted_lands.cpp +++ b/src/server/scripts/EasternKingdoms/blasted_lands.cpp @@ -44,10 +44,10 @@ class npc_deathly_usher : public CreatureScript public: npc_deathly_usher() : CreatureScript("npc_deathly_usher") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, SPELL_TELEPORT_SINGLE, true); @@ -65,7 +65,6 @@ public: return true; } - }; void AddSC_blasted_lands() diff --git a/src/server/scripts/EasternKingdoms/boss_kruul.cpp b/src/server/scripts/EasternKingdoms/boss_kruul.cpp index 126f55838b9..810875abf0c 100644 --- a/src/server/scripts/EasternKingdoms/boss_kruul.cpp +++ b/src/server/scripts/EasternKingdoms/boss_kruul.cpp @@ -151,7 +151,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_kruul() diff --git a/src/server/scripts/EasternKingdoms/burning_steppes.cpp b/src/server/scripts/EasternKingdoms/burning_steppes.cpp index 1d2725b10ee..fb6024f1cb5 100644 --- a/src/server/scripts/EasternKingdoms/burning_steppes.cpp +++ b/src/server/scripts/EasternKingdoms/burning_steppes.cpp @@ -51,10 +51,10 @@ class npc_ragged_john : public CreatureScript public: npc_ragged_john() : CreatureScript("npc_ragged_john") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); @@ -147,7 +147,6 @@ public: void EnterCombat(Unit* /*who*/) {} }; - }; void AddSC_burning_steppes() diff --git a/src/server/scripts/EasternKingdoms/duskwood.cpp b/src/server/scripts/EasternKingdoms/duskwood.cpp index 5d04489bbca..a9f413268c2 100644 --- a/src/server/scripts/EasternKingdoms/duskwood.cpp +++ b/src/server/scripts/EasternKingdoms/duskwood.cpp @@ -60,7 +60,6 @@ public: } return false; }; - }; /*###### @@ -133,7 +132,6 @@ public: DoMeleeAttackIfReady(); }; }; - }; void AddSC_duskwood() diff --git a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp index 2b4bb61c603..451648a0da9 100644 --- a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp @@ -60,7 +60,6 @@ public: me->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000); } }; - }; /*###### @@ -72,10 +71,10 @@ class npc_augustus_the_touched : public CreatureScript public: npc_augustus_the_touched() : CreatureScript("npc_augustus_the_touched") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; } @@ -91,7 +90,6 @@ public: player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; } - }; /*###### @@ -129,9 +127,7 @@ public: } void EnterCombat(Unit* /*who*/) {} - }; - }; /*###### @@ -148,10 +144,10 @@ class npc_tirion_fordring : public CreatureScript public: npc_tirion_fordring() : CreatureScript("npc_tirion_fordring") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); @@ -185,7 +181,6 @@ public: return true; } - }; void AddSC_eastern_plaguelands() diff --git a/src/server/scripts/EasternKingdoms/eversong_woods.cpp b/src/server/scripts/EasternKingdoms/eversong_woods.cpp index 4797774ef49..b0ced22bd8b 100644 --- a/src/server/scripts/EasternKingdoms/eversong_woods.cpp +++ b/src/server/scripts/EasternKingdoms/eversong_woods.cpp @@ -124,7 +124,6 @@ public: void Reset() { - timer = 2000; questPhase = 0; summonerGuid = 0; @@ -366,10 +365,8 @@ public: void StartEvent() { - if (questPhase == 1) { // no player check, quest can be finished as group, so no complex PlayerGUID/group search code - for (uint8 i = 0; i < 4; ++i) if (Creature* summoned = DoSpawnCreature(PaladinEntry[i], SpawnPosition[i].x, SpawnPosition[i].y, SpawnPosition[i].z, SpawnPosition[i].o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 180000)) paladinGuid[i] = summoned->GetGUID(); @@ -428,7 +425,6 @@ public: return true; } - }; /*###### @@ -512,7 +508,6 @@ public: } } }; - }; /*###### @@ -621,7 +616,6 @@ public: } else WaveTimer -= diff; } }; - }; void AddSC_eversong_woods() diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/ghostlands.cpp index effc333d6f8..3bd781ce6f9 100644 --- a/src/server/scripts/EasternKingdoms/ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/ghostlands.cpp @@ -44,10 +44,10 @@ class npc_budd_nedreck : public CreatureScript public: npc_budd_nedreck() : CreatureScript("npc_budd_nedreck") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, 42540, false); @@ -66,7 +66,6 @@ public: player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; } - }; /*###### @@ -78,10 +77,10 @@ class npc_rathis_tomber : public CreatureScript public: npc_rathis_tomber() : CreatureScript("npc_rathis_tomber") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; } @@ -100,7 +99,6 @@ public: return true; } - }; /*###### diff --git a/src/server/scripts/EasternKingdoms/hinterlands.cpp b/src/server/scripts/EasternKingdoms/hinterlands.cpp index a66a01e00e5..08abdc26725 100644 --- a/src/server/scripts/EasternKingdoms/hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/hinterlands.cpp @@ -146,7 +146,6 @@ public: summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); } }; - }; /*###### @@ -345,7 +344,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_hinterlands() diff --git a/src/server/scripts/EasternKingdoms/ironforge.cpp b/src/server/scripts/EasternKingdoms/ironforge.cpp index 5a0ee3c5630..93a8d7423c9 100644 --- a/src/server/scripts/EasternKingdoms/ironforge.cpp +++ b/src/server/scripts/EasternKingdoms/ironforge.cpp @@ -44,10 +44,10 @@ class npc_royal_historian_archesonus : public CreatureScript public: npc_royal_historian_archesonus() : CreatureScript("npc_royal_historian_archesonus") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); @@ -88,7 +88,6 @@ public: return true; } - }; void AddSC_ironforge() diff --git a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp index f2095de49c3..109f4ba1729 100644 --- a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp +++ b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp @@ -85,7 +85,6 @@ public: } } }; - }; /*###### @@ -149,7 +148,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_isle_of_queldanas() diff --git a/src/server/scripts/EasternKingdoms/loch_modan.cpp b/src/server/scripts/EasternKingdoms/loch_modan.cpp index 9ce9de4381a..7ea8a62a5bd 100644 --- a/src/server/scripts/EasternKingdoms/loch_modan.cpp +++ b/src/server/scripts/EasternKingdoms/loch_modan.cpp @@ -47,10 +47,10 @@ class npc_mountaineer_pebblebitty : public CreatureScript public: npc_mountaineer_pebblebitty() : CreatureScript("npc_mountaineer_pebblebitty") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); @@ -95,7 +95,6 @@ public: return true; } - }; void AddSC_loch_modan() diff --git a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp index 310ecbf7b66..f6aaa4e4712 100644 --- a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp @@ -164,7 +164,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_redridge_mountains() diff --git a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp b/src/server/scripts/EasternKingdoms/silvermoon_city.cpp index 8d04e92b9b8..de14416483c 100644 --- a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp +++ b/src/server/scripts/EasternKingdoms/silvermoon_city.cpp @@ -100,7 +100,6 @@ public: } } }; - }; void AddSC_silvermoon_city() diff --git a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp index 4d897c4f3b8..558b02fc675 100644 --- a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp @@ -94,7 +94,6 @@ public: DoScriptText(SAY_QUINN, Quinn); break;} case 26: DoScriptText(SAY_ON_BYE, me, NULL); break; - } } @@ -123,7 +122,6 @@ public: { return new npc_deathstalker_erlandAI(creature); } - }; /*###### @@ -309,7 +307,6 @@ public: ++Phase; //prepare next phase } }; - }; /*###### diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/stormwind_city.cpp index 26267497aa1..ea62014f8a8 100644 --- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/stormwind_city.cpp @@ -47,10 +47,10 @@ class npc_archmage_malin : public CreatureScript public: npc_archmage_malin() : CreatureScript("npc_archmage_malin") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, 42711, true); @@ -71,7 +71,6 @@ public: return true; } - }; /*###### @@ -143,7 +142,6 @@ public: } } }; - }; /*###### @@ -160,10 +158,10 @@ class npc_lady_katrana_prestor : public CreatureScript public: npc_lady_katrana_prestor() : CreatureScript("npc_lady_katrana_prestor") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); @@ -197,7 +195,6 @@ public: return true; } - }; /*###### @@ -370,7 +367,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -457,7 +453,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -606,7 +601,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -636,7 +630,6 @@ public: } return false; } - }; void AddSC_stormwind_city() diff --git a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp index a6effe29ff7..2862ba18bca 100644 --- a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp +++ b/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp @@ -114,7 +114,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### diff --git a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp index 0d72ab6fb2f..4687fa3630f 100644 --- a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp +++ b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp @@ -150,7 +150,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -185,7 +184,6 @@ public: return false; } - }; class go_mausoleum_trigger : public GameObjectScript @@ -207,7 +205,6 @@ public: return false; } - }; void AddSC_tirisfal_glades() diff --git a/src/server/scripts/EasternKingdoms/undercity.cpp b/src/server/scripts/EasternKingdoms/undercity.cpp index 1724572f796..bf3d07ad5ae 100644 --- a/src/server/scripts/EasternKingdoms/undercity.cpp +++ b/src/server/scripts/EasternKingdoms/undercity.cpp @@ -143,7 +143,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -201,7 +200,6 @@ public: } } }; - }; /*###### @@ -219,15 +217,15 @@ class npc_parqual_fintallas : public CreatureScript public: npc_parqual_fintallas() : CreatureScript("npc_parqual_fintallas") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, SPELL_MARK_OF_SHAME, false); } - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + if (action == GOSSIP_ACTION_INFO_DEF+2) { player->CLOSE_GOSSIP_MENU(); player->AreaExploredOrEventHappens(6628); @@ -252,7 +250,6 @@ public: return true; } - }; /*###### diff --git a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp index 4ec8dbb647b..07766455495 100644 --- a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp @@ -49,10 +49,10 @@ class npcs_dithers_and_arbington : public CreatureScript public: npcs_dithers_and_arbington() : CreatureScript("npcs_dithers_and_arbington") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_TRADE: player->GetSession()->SendListInventory(creature->GetGUID()); @@ -100,7 +100,6 @@ public: return true; } - }; /*###### @@ -121,10 +120,10 @@ class npc_myranda_the_hag : public CreatureScript public: npc_myranda_the_hag() : CreatureScript("npc_myranda_the_hag") { } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + if (action == GOSSIP_ACTION_INFO_DEF + 1) { player->CLOSE_GOSSIP_MENU(); player->CastSpell(player, SPELL_SCARLET_ILLUSION, false); @@ -149,7 +148,6 @@ public: return true; } - }; /*###### @@ -229,7 +227,6 @@ public: } } }; - }; /*###### @@ -264,7 +261,6 @@ public: CAST_PLR(who)->KilledMonsterCredit(me->GetEntry(), me->GetGUID()); } }; - }; /*###### @@ -395,7 +391,6 @@ public: m_uiChatTimer = 6000; } }; - }; /*###### diff --git a/src/server/scripts/EasternKingdoms/westfall.cpp b/src/server/scripts/EasternKingdoms/westfall.cpp index 271e1d99d63..f5a0f0e85c4 100644 --- a/src/server/scripts/EasternKingdoms/westfall.cpp +++ b/src/server/scripts/EasternKingdoms/westfall.cpp @@ -185,7 +185,6 @@ public: } else uiShootTimer -= diff; } }; - }; /*###### @@ -258,7 +257,6 @@ public: void Reset() {} }; - }; void AddSC_westfall() diff --git a/src/server/scripts/EasternKingdoms/wetlands.cpp b/src/server/scripts/EasternKingdoms/wetlands.cpp index 3b196720242..e89b8fd7fba 100644 --- a/src/server/scripts/EasternKingdoms/wetlands.cpp +++ b/src/server/scripts/EasternKingdoms/wetlands.cpp @@ -132,7 +132,6 @@ public: } } }; - }; /*###### @@ -161,7 +160,6 @@ public: } return false; } - }; /*###### diff --git a/src/server/scripts/Examples/example_creature.cpp b/src/server/scripts/Examples/example_creature.cpp index f1b336f07f9..412211bd280 100644 --- a/src/server/scripts/Examples/example_creature.cpp +++ b/src/server/scripts/Examples/example_creature.cpp @@ -271,10 +271,10 @@ class example_creature : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); //Set our faction to hostile towards all diff --git a/src/server/scripts/Examples/example_escort.cpp b/src/server/scripts/Examples/example_escort.cpp index cae09266b49..e22c2f85506 100644 --- a/src/server/scripts/Examples/example_escort.cpp +++ b/src/server/scripts/Examples/example_escort.cpp @@ -197,12 +197,12 @@ class example_escort : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); npc_escortAI* pEscortAI = CAST_AI(example_escort::example_escortAI, creature->AI()); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); diff --git a/src/server/scripts/Examples/example_gossip_codebox.cpp b/src/server/scripts/Examples/example_gossip_codebox.cpp index c288123f117..6d57f1ac798 100644 --- a/src/server/scripts/Examples/example_gossip_codebox.cpp +++ b/src/server/scripts/Examples/example_gossip_codebox.cpp @@ -58,10 +58,10 @@ class example_gossip_codebox : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + if (action == GOSSIP_ACTION_INFO_DEF+2) { DoScriptText(SAY_NOT_INTERESTED, creature); player->CLOSE_GOSSIP_MENU(); @@ -70,12 +70,12 @@ class example_gossip_codebox : public CreatureScript return true; } - bool OnGossipSelectCode(Player* player, Creature* creature, uint32 uiSender, uint32 uiAction, const char* code) + bool OnGossipSelectCode(Player* player, Creature* creature, uint32 sender, uint32 action, const char* code) { player->PlayerTalkClass->ClearMenus(); - if (uiSender == GOSSIP_SENDER_MAIN) + if (sender == GOSSIP_SENDER_MAIN) { - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: if (std::strcmp(code, player->GetName()) != 0) diff --git a/src/server/scripts/Examples/example_spell.cpp b/src/server/scripts/Examples/example_spell.cpp index 71dbd7f4fb0..8c721c141af 100644 --- a/src/server/scripts/Examples/example_spell.cpp +++ b/src/server/scripts/Examples/example_spell.cpp @@ -92,7 +92,7 @@ class spell_ex_5581 : public SpellScriptLoader void HandleAfterCast() { - sLog->outString("All immediate actions for the spell are finished now"); + sLog->outString("All immediate Actions for the spell are finished now"); // this is a safe for triggering additional effects for a spell without interfering // with visuals or with other effects of the spell //GetCaster()->CastSpell(target, SPELL_TRIGGERED, true); diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp index 3bfaa448b85..20f738c95ed 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp @@ -201,7 +201,7 @@ class npc_morridune : public CreatureScript public: npc_morridune() : CreatureScript("npc_morridune") { } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*Sender*/, uint32 action) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); switch (action) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp index 12485293650..28457b3b461 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp @@ -50,11 +50,11 @@ class npc_jaina_proudmoore : public CreatureScript public: npc_jaina_proudmoore() : CreatureScript("npc_jaina_proudmoore") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); hyjalAI* ai = CAST_AI(hyjalAI, creature->AI()); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: ai->StartEvent(player); @@ -126,12 +126,12 @@ class npc_thrall : public CreatureScript public: npc_thrall() : CreatureScript("npc_thrall") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); hyjalAI* ai = CAST_AI(hyjalAI, creature->AI()); ai->DeSpawnVeins();//despawn the alliance veins - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: ai->StartEvent(player); @@ -212,10 +212,10 @@ public: return ai; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { ItemPosCountVec dest; uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_TEAR_OF_GODDESS, 1); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp index 4ff34fc3349..63035ef2699 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp @@ -370,10 +370,10 @@ class npc_saat : public CreatureScript public: npc_saat() : CreatureScript("npc_saat") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, SPELL_CHRONO_BEACON, false); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp index f5745f0f894..71945f649cb 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp @@ -51,10 +51,10 @@ class npc_erozion : public CreatureScript public: npc_erozion() : CreatureScript("npc_erozion") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { ItemPosCountVec dest; uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_ENTRY_BOMBS, 1); @@ -64,7 +64,7 @@ public: } player->SEND_GOSSIP_MENU(9515, creature->GetGUID()); } - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + if (action == GOSSIP_ACTION_INFO_DEF+2) { player->CLOSE_GOSSIP_MENU(); } @@ -198,11 +198,11 @@ public: return new npc_thrall_old_hillsbradAI(creature); } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); InstanceScript* instance = creature->GetInstanceScript(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); @@ -581,16 +581,16 @@ public: return new npc_tarethaAI(creature); } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); InstanceScript* instance = creature->GetInstanceScript(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); player->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH2, creature->GetGUID()); } - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + if (action == GOSSIP_ACTION_INFO_DEF+2) { player->CLOSE_GOSSIP_MENU(); diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp index ac9bf524e7a..5cf970e60f3 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp @@ -52,16 +52,16 @@ class npc_henry_stern : public CreatureScript public: npc_henry_stern() : CreatureScript("npc_henry_stern") { } - bool OnGossipSelect (Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect (Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + if (action == GOSSIP_ACTION_INFO_DEF + 1) { player->CastSpell(player, SPELL_TEACHING_GOLDTHORN_TEA, true); player->SEND_GOSSIP_MENU(GOSSIP_TEXT_TEA_ANSWER, creature->GetGUID()); } - if (uiAction == GOSSIP_ACTION_INFO_DEF + 2) + if (action == GOSSIP_ACTION_INFO_DEF + 2) { player->CastSpell(player, SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION, true); player->SEND_GOSSIP_MENU(GOSSIP_TEXT_POTION_ANSWER, creature->GetGUID()); diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp index 8eb3d20d528..ea2846185f8 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp +++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp @@ -85,11 +85,11 @@ public: return new npc_disciple_of_naralexAI(creature); } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); InstanceScript* instance = creature->GetInstanceScript(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + if (action == GOSSIP_ACTION_INFO_DEF + 1) { player->CLOSE_GOSSIP_MENU(); if (instance) diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp index 98de619c127..f8b1364437b 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp @@ -61,10 +61,10 @@ class npc_sergeant_bly : public CreatureScript public: npc_sergeant_bly() : CreatureScript("npc_sergeant_bly") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); CAST_AI(npc_sergeant_bly::npc_sergeant_blyAI, creature->AI())->PlayerGUID = player->GetGUID(); @@ -258,10 +258,10 @@ class npc_weegli_blastfuse : public CreatureScript public: npc_weegli_blastfuse() : CreatureScript("npc_weegli_blastfuse") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); //here we make him run to door, set the charge and run away off to nowhere diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp index 2e621c4a3ba..802867f4171 100644 --- a/src/server/scripts/Kalimdor/azshara.cpp +++ b/src/server/scripts/Kalimdor/azshara.cpp @@ -120,10 +120,10 @@ class npc_loramus_thalipedes : public CreatureScript public: npc_loramus_thalipedes() : CreatureScript("npc_loramus_thalipedes") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); @@ -267,10 +267,10 @@ class mob_rizzle_sprysprocket : public CreatureScript public: mob_rizzle_sprysprocket() : CreatureScript("mob_rizzle_sprysprocket") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1 && player->GetQuestStatus(10994) == QUEST_STATUS_INCOMPLETE) + if (action == GOSSIP_ACTION_INFO_DEF + 1 && player->GetQuestStatus(10994) == QUEST_STATUS_INCOMPLETE) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, SPELL_GIVE_SOUTHFURY_MOONSTONE, true); diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp index 09f4b9415a9..6f17ab16d15 100644 --- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/azuremyst_isle.cpp @@ -195,10 +195,10 @@ class npc_engineer_spark_overgrind : public CreatureScript public: npc_engineer_spark_overgrind() : CreatureScript("npc_engineer_spark_overgrind") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { player->CLOSE_GOSSIP_MENU(); creature->setFaction(FACTION_HOSTILE); diff --git a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp index c114c02b16d..10555d252a6 100644 --- a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp +++ b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp @@ -101,10 +101,10 @@ class npc_captured_sunhawk_agent : public CreatureScript public: npc_captured_sunhawk_agent() : CreatureScript("npc_captured_sunhawk_agent") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_CSA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); diff --git a/src/server/scripts/Kalimdor/darkshore.cpp b/src/server/scripts/Kalimdor/darkshore.cpp index a2c10b94ff9..0d83ea5ad03 100644 --- a/src/server/scripts/Kalimdor/darkshore.cpp +++ b/src/server/scripts/Kalimdor/darkshore.cpp @@ -331,10 +331,10 @@ class npc_threshwackonator : public CreatureScript public: npc_threshwackonator() : CreatureScript("npc_threshwackonator") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp index 1a6ba36bbb1..94702a85d64 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp @@ -157,11 +157,11 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_SENDER_INFO) + if (action == GOSSIP_SENDER_INFO) { player->CLOSE_GOSSIP_MENU(); switch (urand(0, 1)) @@ -255,11 +255,11 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_SENDER_INFO) + if (action == GOSSIP_SENDER_INFO) { player->CLOSE_GOSSIP_MENU(); player->KilledMonsterCredit(NPC_THERAMORE_GUARD, 0); @@ -337,10 +337,10 @@ class npc_lady_jaina_proudmoore : public CreatureScript public: npc_lady_jaina_proudmoore() : CreatureScript("npc_lady_jaina_proudmoore") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_SENDER_INFO) + if (action == GOSSIP_SENDER_INFO) { player->SEND_GOSSIP_MENU(7012, creature->GetGUID()); player->CastSpell(player, SPELL_JAINAS_AUTOGRAPH, false); @@ -377,10 +377,10 @@ class npc_nat_pagle : public CreatureScript public: npc_nat_pagle() : CreatureScript("npc_nat_pagle") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; diff --git a/src/server/scripts/Kalimdor/felwood.cpp b/src/server/scripts/Kalimdor/felwood.cpp index 91d8a875f17..d540d522326 100644 --- a/src/server/scripts/Kalimdor/felwood.cpp +++ b/src/server/scripts/Kalimdor/felwood.cpp @@ -40,10 +40,10 @@ class npcs_riverbreeze_and_silversky : public CreatureScript public: npcs_riverbreeze_and_silversky() : CreatureScript("npcs_riverbreeze_and_silversky") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, 15120, false); diff --git a/src/server/scripts/Kalimdor/feralas.cpp b/src/server/scripts/Kalimdor/feralas.cpp index 37a0e4e8f88..82e85c16564 100644 --- a/src/server/scripts/Kalimdor/feralas.cpp +++ b/src/server/scripts/Kalimdor/feralas.cpp @@ -37,15 +37,15 @@ class npc_gregan_brewspewer : public CreatureScript public: npc_gregan_brewspewer() : CreatureScript("npc_gregan_brewspewer") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); player->SEND_GOSSIP_MENU(2434, creature->GetGUID()); } - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; } diff --git a/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/moonglade.cpp index 2d6e34ab9ee..833224b0e98 100644 --- a/src/server/scripts/Kalimdor/moonglade.cpp +++ b/src/server/scripts/Kalimdor/moonglade.cpp @@ -54,10 +54,10 @@ class npc_bunthen_plainswind : public CreatureScript public: npc_bunthen_plainswind() : CreatureScript("npc_bunthen_plainswind") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: player->CLOSE_GOSSIP_MENU(); @@ -113,10 +113,10 @@ class npc_great_bear_spirit : public CreatureScript public: npc_great_bear_spirit() : CreatureScript("npc_great_bear_spirit") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); @@ -169,10 +169,10 @@ class npc_silva_filnaveth : public CreatureScript public: npc_silva_filnaveth() : CreatureScript("npc_silva_filnaveth") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: player->CLOSE_GOSSIP_MENU(); diff --git a/src/server/scripts/Kalimdor/mulgore.cpp b/src/server/scripts/Kalimdor/mulgore.cpp index c689d6954a4..19be3ce21cc 100644 --- a/src/server/scripts/Kalimdor/mulgore.cpp +++ b/src/server/scripts/Kalimdor/mulgore.cpp @@ -43,10 +43,10 @@ class npc_skorn_whitecloud : public CreatureScript public: npc_skorn_whitecloud() : CreatureScript("npc_skorn_whitecloud") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) player->SEND_GOSSIP_MENU(523, creature->GetGUID()); return true; diff --git a/src/server/scripts/Kalimdor/orgrimmar.cpp b/src/server/scripts/Kalimdor/orgrimmar.cpp index 629abb84fc1..63916968ca2 100644 --- a/src/server/scripts/Kalimdor/orgrimmar.cpp +++ b/src/server/scripts/Kalimdor/orgrimmar.cpp @@ -149,10 +149,10 @@ class npc_thrall_warchief : public CreatureScript public: npc_thrall_warchief() : CreatureScript("npc_thrall_warchief") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp index 71cc92da438..2c21ac18752 100644 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ b/src/server/scripts/Kalimdor/silithus.cpp @@ -49,10 +49,10 @@ class npc_highlord_demitrian : public CreatureScript public: npc_highlord_demitrian() : CreatureScript("npc_highlord_demitrian") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); @@ -134,10 +134,10 @@ class npcs_rutgar_and_frankal : public CreatureScript public: npcs_rutgar_and_frankal() : CreatureScript("npcs_rutgar_and_frankal") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); diff --git a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp index c31a7731865..66731574ec9 100644 --- a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp +++ b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp @@ -46,16 +46,16 @@ class npc_braug_dimspirit : public CreatureScript public: npc_braug_dimspirit() : CreatureScript("npc_braug_dimspirit") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, 6766, false); } - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + if (action == GOSSIP_ACTION_INFO_DEF+2) { player->CLOSE_GOSSIP_MENU(); player->AreaExploredOrEventHappens(6627); diff --git a/src/server/scripts/Kalimdor/tanaris.cpp b/src/server/scripts/Kalimdor/tanaris.cpp index ff6cdccb66a..dcca1ed29b4 100644 --- a/src/server/scripts/Kalimdor/tanaris.cpp +++ b/src/server/scripts/Kalimdor/tanaris.cpp @@ -244,10 +244,10 @@ class npc_marin_noggenfogger : public CreatureScript public: npc_marin_noggenfogger() : CreatureScript("npc_marin_noggenfogger") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; @@ -287,10 +287,10 @@ public: return false; } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + if (action == GOSSIP_ACTION_INFO_DEF + 1) player->CastSpell(player, 34891, true); //(Flight through Caverns) return true; @@ -330,10 +330,10 @@ class npc_stone_watcher_of_norgannon : public CreatureScript public: npc_stone_watcher_of_norgannon() : CreatureScript("npc_stone_watcher_of_norgannon") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); diff --git a/src/server/scripts/Kalimdor/the_barrens.cpp b/src/server/scripts/Kalimdor/the_barrens.cpp index e12897c1def..ca87c350cda 100644 --- a/src/server/scripts/Kalimdor/the_barrens.cpp +++ b/src/server/scripts/Kalimdor/the_barrens.cpp @@ -51,10 +51,10 @@ class npc_beaten_corpse : public CreatureScript public: npc_beaten_corpse() : CreatureScript("npc_beaten_corpse") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF +1) + if (action == GOSSIP_ACTION_INFO_DEF +1) { player->SEND_GOSSIP_MENU(3558, creature->GetGUID()); player->TalkedToCreature(creature->GetEntry(), creature->GetGUID()); @@ -186,10 +186,10 @@ class npc_sputtervalve : public CreatureScript public: npc_sputtervalve() : CreatureScript("npc_sputtervalve") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { player->SEND_GOSSIP_MENU(2013, creature->GetGUID()); player->AreaExploredOrEventHappens(6981); diff --git a/src/server/scripts/Kalimdor/thousand_needles.cpp b/src/server/scripts/Kalimdor/thousand_needles.cpp index 2349b4493ce..77788d0fcfa 100644 --- a/src/server/scripts/Kalimdor/thousand_needles.cpp +++ b/src/server/scripts/Kalimdor/thousand_needles.cpp @@ -299,10 +299,10 @@ class npc_plucky : public CreatureScript public: npc_plucky() : CreatureScript("npc_plucky") { } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); diff --git a/src/server/scripts/Kalimdor/thunder_bluff.cpp b/src/server/scripts/Kalimdor/thunder_bluff.cpp index 67a876c40b2..36873190e8c 100644 --- a/src/server/scripts/Kalimdor/thunder_bluff.cpp +++ b/src/server/scripts/Kalimdor/thunder_bluff.cpp @@ -42,10 +42,10 @@ class npc_cairne_bloodhoof : public CreatureScript public: npc_cairne_bloodhoof() : CreatureScript("npc_cairne_bloodhoof") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_SENDER_INFO) + if (action == GOSSIP_SENDER_INFO) { player->CastSpell(player, 23123, false); player->SEND_GOSSIP_MENU(7014, creature->GetGUID()); diff --git a/src/server/scripts/Kalimdor/winterspring.cpp b/src/server/scripts/Kalimdor/winterspring.cpp index 00bb250d64d..3547b09a34b 100644 --- a/src/server/scripts/Kalimdor/winterspring.cpp +++ b/src/server/scripts/Kalimdor/winterspring.cpp @@ -48,10 +48,10 @@ class npc_lorax : public CreatureScript public: npc_lorax() : CreatureScript("npc_lorax") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); @@ -105,10 +105,10 @@ class npc_rivern_frostwind : public CreatureScript public: npc_rivern_frostwind() : CreatureScript("npc_rivern_frostwind") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; @@ -140,10 +140,10 @@ class npc_witch_doctor_mauari : public CreatureScript public: npc_witch_doctor_mauari() : CreatureScript("npc_witch_doctor_mauari") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, 16351, false); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp index c17ea7411a0..a2919de0149 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp @@ -488,10 +488,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); CAST_AI(npc_announcer_toc5::npc_announcer_toc5AI, creature->AI())->StartEncounter(); diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp index c8f18dba1d0..3158d58716f 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp @@ -251,10 +251,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); @@ -388,10 +388,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index 1583bdbdcd4..9b627281775 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -157,10 +157,10 @@ private: public: npc_jaina_or_sylvanas_hor(bool isSylvana, const char* name) : CreatureScript(name), m_isSylvana(isSylvana) { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); @@ -248,7 +248,7 @@ public: { case EVENT_START_INTRO: me->GetMotionMaster()->MovePoint(0, MoveThronePos); - // Begining of intro is differents between factions as the speech sequence and timers are differents. + // Begining of intro is differents between fActions as the speech sequence and timers are differents. if (instance->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE) events.ScheduleEvent(EVENT_INTRO_A2_1, 0); else diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp index 05206102762..1d82e1c29f3 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp @@ -113,7 +113,7 @@ public: void Reset() { if (!encounterActionReset) - DoEncounterAction(NULL, false, true, false); + DoEncounteraction(NULL, false, true, false); if (instance) instance->SetData(DATA_HORSEMEN0 + id, NOT_STARTED); @@ -131,7 +131,7 @@ public: _Reset(); } - bool DoEncounterAction(Unit* who, bool attack, bool reset, bool checkAllDead) + bool DoEncounteraction(Unit* who, bool attack, bool reset, bool checkAllDead) { if (!instance) return false; @@ -272,7 +272,7 @@ public: BeginFourHorsemenMovement(); if (!encounterActionAttack) - DoEncounterAction(who, true, false, false); + DoEncounteraction(who, true, false, false); } else if (movementCompleted && movementStarted) { @@ -302,7 +302,7 @@ public: if (instance) instance->SetData(DATA_HORSEMEN0 + id, DONE); - if (instance && DoEncounterAction(NULL, false, false, true)) + if (instance && DoEncounteraction(NULL, false, false, true)) { instance->SetBossState(BOSS_HORSEMEN, DONE); instance->SaveToDB(); diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index 11433bfde37..23f55a3033b 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -61,13 +61,13 @@ class npc_oculus_drake : public CreatureScript public: npc_oculus_drake() : CreatureScript("npc_oculus_drake") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); switch (creature->GetEntry()) { case NPC_VERDISA: //Verdisa - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: if (!HAS_ESSENCE(player)) @@ -97,7 +97,7 @@ public: } break; case NPC_BELGARISTRASZ: //Belgaristrasz - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: if (!HAS_ESSENCE(player)) @@ -127,7 +127,7 @@ public: } break; case NPC_ETERNOS: //Eternos - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: if (!HAS_ESSENCE(player)) diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp index 1c8d9380a2b..1a09db675c6 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp @@ -268,10 +268,10 @@ class npc_brann_hos : public CreatureScript public: npc_brann_hos() : CreatureScript("npc_brann_hos") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1 || uiAction == GOSSIP_ACTION_INFO_DEF+2) + if (action == GOSSIP_ACTION_INFO_DEF+1 || action == GOSSIP_ACTION_INFO_DEF+2) { player->CLOSE_GOSSIP_MENU(); CAST_AI(npc_brann_hos::npc_brann_hosAI, creature->AI())->StartWP(); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 98b20f1c424..20a46c953ab 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -171,7 +171,7 @@ enum Yells enum MiscellanousData { - // Other actions are in Ulduar.h + // Other Actions are in Ulduar.h ACTION_START_HARD_MODE = 5, ACTION_SPAWN_VEHICLES = 6, // Amount of seats depending on Raid mode @@ -1155,7 +1155,7 @@ class npc_lorekeeper : public CreatureScript } }; - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); InstanceScript* instance = creature->GetInstanceScript(); @@ -1228,10 +1228,10 @@ class npc_brann_bronzebeard : public CreatureScript public: npc_brann_bronzebeard() : CreatureScript("npc_brann_bronzebeard") { } - //bool OnGossipSelect(Player* player, Creature* creature, uint32 uiSender, uint32 uiAction) + //bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) //{ // player->PlayerTalkClass->ClearMenus(); - // switch(uiAction) + // switch(action) // { // case GOSSIP_ACTION_INFO_DEF+1: // if (player) diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp index d9e8798b179..a0fe468a91b 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp @@ -253,10 +253,10 @@ class npc_sinclari_vh : public CreatureScript public: npc_sinclari_vh() : CreatureScript("npc_sinclari_vh") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index e97cc5e205b..3f0a85ce561 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -228,10 +228,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + if (action == GOSSIP_ACTION_INFO_DEF + 1) { player->CLOSE_GOSSIP_MENU(); player->CastSpell(player, SPELL_TELEPORT_TO_SARAGOSA, true); @@ -273,10 +273,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); @@ -317,10 +317,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CastSpell(player, SPELL_CREATURE_TOTEM_OF_ISSLIRUK, true); @@ -1256,10 +1256,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); @@ -2540,18 +2540,18 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); creature->AI()->SetGUID(player->GetGUID()); creature->AI()->DoAction(1); } - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; diff --git a/src/server/scripts/Northrend/dalaran.cpp b/src/server/scripts/Northrend/dalaran.cpp index 258d038ee4b..e7b92732066 100644 --- a/src/server/scripts/Northrend/dalaran.cpp +++ b/src/server/scripts/Northrend/dalaran.cpp @@ -153,13 +153,13 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRAIN) + if (action == GOSSIP_ACTION_TRAIN) player->GetSession()->SendTrainerList(creature->GetGUID()); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; diff --git a/src/server/scripts/Northrend/dragonblight.cpp b/src/server/scripts/Northrend/dragonblight.cpp index 0c1837ec37d..4cbe280a9f2 100644 --- a/src/server/scripts/Northrend/dragonblight.cpp +++ b/src/server/scripts/Northrend/dragonblight.cpp @@ -56,10 +56,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); player->SendMovieStart(MOVIE_ID_GATES); diff --git a/src/server/scripts/Northrend/howling_fjord.cpp b/src/server/scripts/Northrend/howling_fjord.cpp index 5e4b7dafdb4..e29b6462835 100644 --- a/src/server/scripts/Northrend/howling_fjord.cpp +++ b/src/server/scripts/Northrend/howling_fjord.cpp @@ -254,10 +254,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_RAZAEL2, creature->GetGUID()); @@ -303,10 +303,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MG_II, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); diff --git a/src/server/scripts/Northrend/icecrown.cpp b/src/server/scripts/Northrend/icecrown.cpp index 8da992af8fb..fb2e0f6c389 100644 --- a/src/server/scripts/Northrend/icecrown.cpp +++ b/src/server/scripts/Northrend/icecrown.cpp @@ -75,10 +75,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); @@ -149,10 +149,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); creature->SummonCreature(NPC_ARGENT_VALIANT, 8575.451f, 952.472f, 547.554f, 0.38f); diff --git a/src/server/scripts/Northrend/sholazar_basin.cpp b/src/server/scripts/Northrend/sholazar_basin.cpp index 36dc6177f64..f0445273d43 100644 --- a/src/server/scripts/Northrend/sholazar_basin.cpp +++ b/src/server/scripts/Northrend/sholazar_basin.cpp @@ -132,10 +132,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); CAST_AI(npc_escortAI, (creature->AI()))->SetMaxPlayerDistance(35.0f); @@ -206,10 +206,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_VEKJIK_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -263,10 +263,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AOF2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -647,11 +647,11 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); uint32 spellId = 0; - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: spellId = SPELL_ADD_ORANGE; break; case GOSSIP_ACTION_INFO_DEF + 2: spellId = SPELL_ADD_BANANAS; break; diff --git a/src/server/scripts/Northrend/storm_peaks.cpp b/src/server/scripts/Northrend/storm_peaks.cpp index 4e0864e01e4..a6874b582dd 100644 --- a/src/server/scripts/Northrend/storm_peaks.cpp +++ b/src/server/scripts/Northrend/storm_peaks.cpp @@ -61,10 +61,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { DoScriptText(SAY_AGGRO, creature); player->CLOSE_GOSSIP_MENU(); @@ -106,10 +106,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -166,10 +166,10 @@ public: return false; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(0, GOSSIP_SN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -270,10 +270,10 @@ public: return false; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); creature->setFaction(14); @@ -326,10 +326,10 @@ public: return false; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOKLIRACRONE1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -437,12 +437,12 @@ public: return false; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); npc_escortAI* pEscortAI = CAST_AI(npc_injured_goblin::npc_injured_goblinAI, creature->AI()); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { pEscortAI->Start(true, true, player->GetGUID()); creature->setFaction(113); diff --git a/src/server/scripts/Northrend/zuldrak.cpp b/src/server/scripts/Northrend/zuldrak.cpp index 4cea6d8d8aa..b4bcab9e731 100644 --- a/src/server/scripts/Northrend/zuldrak.cpp +++ b/src/server/scripts/Northrend/zuldrak.cpp @@ -223,10 +223,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); player->CastSpell(player, SPELL_GYMER, true); @@ -1365,10 +1365,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF +1) + if (action == GOSSIP_ACTION_INFO_DEF +1) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, SPELL_QUEST_CREDIT, true); diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.cpp b/src/server/scripts/Outland/BlackTemple/black_temple.cpp index a934d5587c2..546f9ee1e7d 100644 --- a/src/server/scripts/Outland/BlackTemple/black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/black_temple.cpp @@ -42,10 +42,10 @@ class npc_spirit_of_olum : public CreatureScript public: npc_spirit_of_olum() : CreatureScript("npc_spirit_of_olum") { } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + if (action == GOSSIP_ACTION_INFO_DEF + 1) player->CLOSE_GOSSIP_MENU(); player->InterruptNonMeleeSpells(false); diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index de9ef5cd67f..ace1a2ab717 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -1801,10 +1801,10 @@ public: } }; - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) // Time to begin the Event + if (action == GOSSIP_ACTION_INFO_DEF) // Time to begin the Event { player->CLOSE_GOSSIP_MENU(); CAST_AI(npc_akama_illidan::npc_akama_illidanAI, creature->AI())->EnterPhase(PHASE_CHANNEL); diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp index 08b188f7301..4ae41931bd4 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -541,10 +541,10 @@ class npc_akama_shade : public CreatureScript public: npc_akama_shade() : CreatureScript("npc_akama_shade") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time + if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time { player->CLOSE_GOSSIP_MENU(); CAST_AI(npc_akama_shade::npc_akamaAI, creature->AI())->BeginEvent(player); diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index bd23b06a5ea..d5b08d83c71 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -73,7 +73,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -253,7 +252,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -299,7 +297,6 @@ public: ScriptedAI::MoveInLineOfSight(who); } }; - }; /*###### @@ -313,10 +310,10 @@ class npc_overseer_nuaar : public CreatureScript public: npc_overseer_nuaar() : CreatureScript("npc_overseer_nuaar") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->SEND_GOSSIP_MENU(10533, creature->GetGUID()); player->AreaExploredOrEventHappens(10682); @@ -333,7 +330,6 @@ public: return true; } - }; /*###### @@ -348,10 +344,10 @@ class npc_saikkal_the_elder : public CreatureScript public: npc_saikkal_the_elder() : CreatureScript("npc_saikkal_the_elder") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_STE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -374,7 +370,6 @@ public: return true; } - }; /*###### @@ -423,7 +418,6 @@ public: return true; } - }; /*###### @@ -469,7 +463,6 @@ public: void UpdateAI(const uint32 /*uiDiff*/) {} }; - }; /*###### @@ -534,7 +527,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### diff --git a/src/server/scripts/Outland/hellfire_peninsula.cpp b/src/server/scripts/Outland/hellfire_peninsula.cpp index 7d4de409b8b..707dfd65135 100644 --- a/src/server/scripts/Outland/hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/hellfire_peninsula.cpp @@ -124,7 +124,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -198,7 +197,6 @@ public: } } }; - }; /*###### @@ -215,7 +213,6 @@ public: go->SummonCreature(C_AERANAS, -1321.79f, 4043.80f, 116.24f, 1.25f, TEMPSUMMON_TIMED_DESPAWN, 180000); return false; } - }; /*###### @@ -234,10 +231,10 @@ class npc_naladu : public CreatureScript public: npc_naladu() : CreatureScript("npc_naladu") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_NALADU1, creature->GetGUID()); return true; @@ -252,7 +249,6 @@ public: player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; } - }; /*###### @@ -274,10 +270,10 @@ class npc_tracy_proudwell : public CreatureScript public: npc_tracy_proudwell() : CreatureScript("npc_tracy_proudwell") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TRACY_PROUDWELL_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); @@ -308,7 +304,6 @@ public: player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; } - }; /*###### @@ -331,10 +326,10 @@ class npc_trollbane : public CreatureScript public: npc_trollbane() : CreatureScript("npc_trollbane") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TROLLBANE_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); @@ -361,7 +356,6 @@ public: player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; } - }; /*###### @@ -456,7 +450,6 @@ public: summoned->AI()->AttackStart(me); } }; - }; /*###### @@ -529,7 +522,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_hellfire_peninsula() diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp index f1aaf82cb67..5d1a77953a7 100644 --- a/src/server/scripts/Outland/nagrand.cpp +++ b/src/server/scripts/Outland/nagrand.cpp @@ -57,10 +57,10 @@ class npc_greatmother_geyah : public CreatureScript public: npc_greatmother_geyah() : CreatureScript("npc_greatmother_geyah") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp index 79811069402..d28a1f23795 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/netherstorm.cpp @@ -295,7 +295,6 @@ public: } } }; - }; /*###### @@ -350,7 +349,6 @@ public: } return true; } - }; /*###### @@ -633,7 +631,6 @@ public: } } }; - }; class at_commander_dawnforge : public AreaTriggerScript @@ -659,7 +656,6 @@ public: } return false; } - }; /*###### @@ -690,10 +686,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { creature->CastSpell(player, SPELL_PHASE_DISTRUPTOR, false); player->CLOSE_GOSSIP_MENU(); @@ -714,7 +710,6 @@ public: return true; } - }; /*###### @@ -849,7 +844,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -888,7 +882,6 @@ public: struct npc_bessyAI : public npc_escortAI { - npc_bessyAI(Creature* c) : npc_escortAI(c) {} void JustDied(Unit* /*killer*/) @@ -937,9 +930,7 @@ public: { me->RestoreFaction(); } - }; - }; /*###### diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index 6acd9bf6c99..79d284d779a 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -96,12 +96,12 @@ public: CastTimer = 5000; } - void SpellHit(Unit* pCaster, SpellInfo const* pSpell) + void SpellHit(Unit* pCaster, SpellInfo const* spell) { if (bCanEat || bIsEating) return; - if (pCaster->GetTypeId() == TYPEID_PLAYER && pSpell->Id == SPELL_PLACE_CARCASS && !me->HasAura(SPELL_JUST_EATEN)) + if (pCaster->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_PLACE_CARCASS && !me->HasAura(SPELL_JUST_EATEN)) { uiPlayerGUID = pCaster->GetGUID(); bCanEat = true; @@ -179,7 +179,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*### @@ -321,7 +320,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*##### @@ -401,7 +399,6 @@ public: } } }; - }; /*###### @@ -413,10 +410,10 @@ class npc_drake_dealer_hurlunk : public CreatureScript public: npc_drake_dealer_hurlunk() : CreatureScript("npc_drake_dealer_hurlunk") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; @@ -431,7 +428,6 @@ public: return true; } - }; /*###### @@ -446,10 +442,10 @@ class npcs_flanis_swiftwing_and_kagrosh : public CreatureScript public: npcs_flanis_swiftwing_and_kagrosh() : CreatureScript("npcs_flanis_swiftwing_and_kagrosh") { } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { ItemPosCountVec dest; uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 30658, 1, NULL); @@ -459,7 +455,7 @@ public: player->PlayerTalkClass->ClearMenus(); } } - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + if (action == GOSSIP_ACTION_INFO_DEF+2) { ItemPosCountVec dest; uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 30659, 1, NULL); @@ -483,7 +479,6 @@ public: return true; } - }; /*###### @@ -504,10 +499,10 @@ class npc_murkblood_overseer : public CreatureScript public: npc_murkblood_overseer() : CreatureScript("npc_murkblood_overseer") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -552,7 +547,6 @@ public: player->SEND_GOSSIP_MENU(10940, creature->GetGUID()); return true; } - }; /*###### @@ -572,10 +566,10 @@ class npc_oronok_tornheart : public CreatureScript public: npc_oronok_tornheart() : CreatureScript("npc_oronok_tornheart") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_TRADE: player->GetSession()->SendListInventory(creature->GetGUID()); @@ -628,7 +622,6 @@ public: return true; } - }; /*#### @@ -884,7 +877,6 @@ public: } else ConversationTimer -= diff; } }; - }; /*#### @@ -1061,7 +1053,6 @@ public: } } }; - }; /*##### @@ -1265,7 +1256,6 @@ public: me->CombatStop(); } else if (!Timers) { - SpellTimer1 = SpawnCast[6].Timer1; SpellTimer2 = SpawnCast[7].Timer1; SpellTimer3 = SpawnCast[8].Timer1; @@ -1321,7 +1311,6 @@ public: } } }; - }; /*##### @@ -1467,7 +1456,6 @@ public: EnterEvadeMode(); } }; - }; /*###### @@ -1586,7 +1574,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void npc_lord_illidan_stormrage::npc_lord_illidan_stormrageAI::SummonNextWave() @@ -1680,7 +1667,6 @@ public: } return true; } - }; /*#### @@ -1801,7 +1787,6 @@ public: } } }; - }; /*##### diff --git a/src/server/scripts/Outland/shattrath_city.cpp b/src/server/scripts/Outland/shattrath_city.cpp index ed68f55aeb5..2421af6af75 100644 --- a/src/server/scripts/Outland/shattrath_city.cpp +++ b/src/server/scripts/Outland/shattrath_city.cpp @@ -55,10 +55,10 @@ class npc_raliq_the_drunk : public CreatureScript public: npc_raliq_the_drunk() : CreatureScript("npc_raliq_the_drunk") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); creature->setFaction(FACTION_HOSTILE_RD); @@ -111,7 +111,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -187,12 +186,11 @@ public: DoMeleeAttackIfReady(); } }; - }; /* ################################################## -Shattrath City Flask Vendors provides flasks to people exalted with 3 factions: +Shattrath City Flask Vendors provides flasks to people exalted with 3 fActions: Haldor the Compulsive Arcanist Xorith Both sell special flasks for use in Outlands 25man raids only, @@ -206,10 +204,10 @@ class npc_shattrathflaskvendors : public CreatureScript public: npc_shattrathflaskvendors() : CreatureScript("npc_shattrathflaskvendors") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; @@ -247,7 +245,6 @@ public: return true; } - }; /*###### @@ -261,10 +258,10 @@ class npc_zephyr : public CreatureScript public: npc_zephyr() : CreatureScript("npc_zephyr") { } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) player->CastSpell(player, 37778, false); return true; @@ -279,7 +276,6 @@ public: return true; } - }; /*###### @@ -543,10 +539,10 @@ public: } }; - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { CAST_AI(npc_dirty_larry::npc_dirty_larryAI, creature->AI())->Event = true; CAST_AI(npc_dirty_larry::npc_dirty_larryAI, creature->AI())->PlayerGUID = player->GetGUID(); @@ -572,7 +568,6 @@ public: { return new npc_dirty_larryAI (creature); } - }; /*###### @@ -587,12 +582,12 @@ class npc_ishanah : public CreatureScript public: npc_ishanah() : CreatureScript("npc_ishanah") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) player->SEND_GOSSIP_MENU(9458, creature->GetGUID()); - else if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + else if (action == GOSSIP_ACTION_INFO_DEF+2) player->SEND_GOSSIP_MENU(9459, creature->GetGUID()); return true; @@ -610,7 +605,6 @@ public: return true; } - }; /*###### @@ -629,10 +623,10 @@ class npc_khadgar : public CreatureScript public: npc_khadgar() : CreatureScript("npc_khadgar") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -678,7 +672,6 @@ public: return true; } - }; void AddSC_shattrath_city() diff --git a/src/server/scripts/Outland/terokkar_forest.cpp b/src/server/scripts/Outland/terokkar_forest.cpp index 5eb88e6bfb6..bcb5f9f4da1 100644 --- a/src/server/scripts/Outland/terokkar_forest.cpp +++ b/src/server/scripts/Outland/terokkar_forest.cpp @@ -99,12 +99,12 @@ public: { for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { - Player* pGroupie = itr->getSource(); - if (pGroupie && - pGroupie->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE && - pGroupie->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10) + Player* groupie = itr->getSource(); + if (groupie && + groupie->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE && + groupie->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10) { - pGroupie->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE); + groupie->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE); if (!CanDoQuest) CanDoQuest = true; } @@ -150,7 +150,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -183,7 +182,6 @@ public: DoCast(me, 39130, true); } }; - }; /*###### @@ -245,7 +243,6 @@ public: npc_escortAI::UpdateAI(diff); } }; - }; /*###### @@ -278,7 +275,6 @@ public: DoCast(me, 39134, true); } }; - }; /*###### @@ -331,7 +327,6 @@ public: } } }; - }; /*###### @@ -358,15 +353,15 @@ class npc_floon : public CreatureScript public: npc_floon() : CreatureScript("npc_floon") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLOON2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(9443, creature->GetGUID()); } - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); creature->setFaction(FACTION_HOSTILE_FL); @@ -439,7 +434,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -533,7 +527,6 @@ public: { return new npc_isla_starmaneAI(creature); } - }; /*###### @@ -549,12 +542,12 @@ class go_skull_pile : public GameObjectScript public: go_skull_pile() : GameObjectScript("go_skull_pile") { } - bool OnGossipSelect(Player* player, GameObject* go, uint32 uiSender, uint32 uiAction) + bool OnGossipSelect(Player* player, GameObject* go, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiSender) + switch (sender) { - case GOSSIP_SENDER_MAIN: SendActionMenu(player, go, uiAction); break; + case GOSSIP_SENDER_MAIN: SendActionMenu(player, go, action); break; } return true; } @@ -573,9 +566,9 @@ public: return true; } - void SendActionMenu(Player* player, GameObject* /*go*/, uint32 uiAction) + void SendActionMenu(Player* player, GameObject* /*go*/, uint32 action) { - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: player->CastSpell(player, 40642, false); @@ -607,10 +600,10 @@ class npc_slim : public CreatureScript public: npc_slim() : CreatureScript("npc_slim") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; @@ -628,7 +621,6 @@ public: return true; } - }; /*######## @@ -695,7 +687,6 @@ public: summon->AI()->AttackStart(me); } }; - }; void AddSC_terokkar_forest() diff --git a/src/server/scripts/Outland/zangarmarsh.cpp b/src/server/scripts/Outland/zangarmarsh.cpp index fc7a3f4d667..6d8a47c693e 100644 --- a/src/server/scripts/Outland/zangarmarsh.cpp +++ b/src/server/scripts/Outland/zangarmarsh.cpp @@ -64,10 +64,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { creature->setPowerType(POWER_MANA); creature->SetMaxPower(POWER_MANA, 200); //set a "fake" mana value, we can't depend on database doing it in this case @@ -195,10 +195,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { player->CLOSE_GOSSIP_MENU(); creature->setFaction(FACTION_HOSTILE_CO); @@ -231,10 +231,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KUR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); @@ -284,10 +284,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; } @@ -404,10 +404,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TIMOTHY_DANIELS1, creature->GetGUID()); diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index e4593be295c..80ba1972437 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -381,7 +381,6 @@ class spell_warl_life_tap : public SpellScriptLoader if (Unit* target = GetHitUnit()) { SpellInfo const* spellInfo = GetSpellInfo(); - float spFactor = 0.0f; int32 damage = int32(GetEffectValue() + (6.3875 * spellInfo->BaseLevel)); int32 mana = int32(damage + (caster->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+SPELL_SCHOOL_SHADOW) * 0.5f)); diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp index d8a90b2ffd5..1220a4a24fb 100644 --- a/src/server/scripts/World/areatrigger_scripts.cpp +++ b/src/server/scripts/World/areatrigger_scripts.cpp @@ -447,7 +447,7 @@ class AreaTrigger_at_area_52_entrance : public AreaTriggerScript bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) { - float x, y, z; + float x = 0.0f, y = 0.0f, z = 0.0f; if (!player->isAlive()) return false; @@ -502,4 +502,4 @@ void AddSC_areatrigger_scripts() new AreaTrigger_at_bring_your_orphan_to(); new AreaTrigger_at_brewfest(); new AreaTrigger_at_area_52_entrance(); -} \ No newline at end of file +} diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 59ed06788cb..d67c09c8d02 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -564,10 +564,10 @@ public: return true; } - bool OnGossipSelect(Player* player, GameObject* pGO, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, GameObject* pGO, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->CastSpell(player, SPELL_CREATE_1_FLASK_OF_BEAST, false); @@ -623,10 +623,10 @@ public: return true; } - bool OnGossipSelect(Player* player, GameObject* pGO, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, GameObject* pGO, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->CastSpell(player, SPELL_CREATE_1_FLASK_OF_SORCERER, false); @@ -1087,10 +1087,10 @@ public: return true; } - bool OnGossipSelect(Player* player, GameObject* pGO, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, GameObject* pGO, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF +1) + if (action == GOSSIP_ACTION_INFO_DEF +1) { player->CLOSE_GOSSIP_MENU(); Creature* target = GetClosestCreatureWithEntry(player, NPC_OUTHOUSE_BUNNY, 3.0f); diff --git a/src/server/scripts/World/guards.cpp b/src/server/scripts/World/guards.cpp index 9bc511931b9..294f1cd291a 100644 --- a/src/server/scripts/World/guards.cpp +++ b/src/server/scripts/World/guards.cpp @@ -177,7 +177,6 @@ public: //Set our global cooldown globalCooldown = GENERIC_CREATURE_COOLDOWN; - } //If no spells available and we arn't moving run to target else if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE) { diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index 165ef9f18b1..cf55bb14895 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -64,8 +64,8 @@ public: disabled = true; break; case 34475: - if (const SpellInfo* pSpellInfo = sSpellMgr->GetSpellInfo(SPELL_ARCANE_CHARGES)) - Spell::SendCastResult(player, pSpellInfo, 1, SPELL_FAILED_NOT_ON_GROUND); + if (const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(SPELL_ARCANE_CHARGES)) + Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_ON_GROUND); break; } @@ -264,7 +264,7 @@ class item_petrov_cluster_bombs : public ItemScript public: item_petrov_cluster_bombs() : ItemScript("item_petrov_cluster_bombs") { } - bool OnUse(Player* player, Item* pItem, const SpellCastTargets & /*pTargets*/) + bool OnUse(Player* player, Item* pItem, const SpellCastTargets & /*targets*/) { if (player->GetZoneId() != ZONE_ID_HOWLING) return false; @@ -273,8 +273,8 @@ public: { player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); - if (const SpellInfo* pSpellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB)) - Spell::SendCastResult(player, pSpellInfo, 1, SPELL_FAILED_NOT_HERE); + if (const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB)) + Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_HERE); return true; } @@ -330,7 +330,7 @@ class item_dehta_trap_smasher : public ItemScript public: item_dehta_trap_smasher() : ItemScript("item_dehta_trap_smasher") { } - bool OnUse(Player* player, Item* /*pItem*/, const SpellCastTargets & /*pTargets*/) + bool OnUse(Player* player, Item* /*pItem*/, const SpellCastTargets & /*targets*/) { if (player->GetQuestStatus(QUEST_CANNOT_HELP_THEMSELVES) != QUEST_STATUS_INCOMPLETE) return false; @@ -367,7 +367,7 @@ class item_trident_of_nazjan : public ItemScript public: item_trident_of_nazjan() : ItemScript("item_Trident_of_Nazjan") { } - bool OnUse(Player* player, Item* pItem, const SpellCastTargets & /*pTargets*/) + bool OnUse(Player* player, Item* pItem, const SpellCastTargets & /*targets*/) { if (player->GetQuestStatus(QUEST_THE_EMISSARY) == QUEST_STATUS_INCOMPLETE) { diff --git a/src/server/scripts/World/npc_innkeeper.cpp b/src/server/scripts/World/npc_innkeeper.cpp index 334eb48cb05..fb7c0833d22 100644 --- a/src/server/scripts/World/npc_innkeeper.cpp +++ b/src/server/scripts/World/npc_innkeeper.cpp @@ -79,10 +79,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID && IsEventActive(HALLOWEEN_EVENTID) && !player->HasAura(SPELL_TRICK_OR_TREATED)) + if (action == GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID && IsEventActive(HALLOWEEN_EVENTID) && !player->HasAura(SPELL_TRICK_OR_TREATED)) { player->CastSpell(player, SPELL_TRICK_OR_TREATED, true); @@ -116,7 +116,7 @@ public: player->CLOSE_GOSSIP_MENU(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_TRADE: player->GetSession()->SendListInventory(creature->GetGUID()); break; case GOSSIP_ACTION_INN: player->SetBindPoint(creature->GetGUID()); break; diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index 336e232236d..a1920e06ad1 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -213,7 +213,7 @@ int32 DoLowUnlearnCost(Player* player) //blacksmith return 100000; } -void ProcessCastAction(Player* player, Creature* creature, uint32 spellId, uint32 triggeredSpellId, int32 cost) +void ProcessCastaction(Player* player, Creature* creature, uint32 spellId, uint32 triggeredSpellId, int32 cost) { if (!(spellId && player->HasSpell(spellId)) && player->HasEnoughMoney(cost)) { @@ -424,9 +424,9 @@ public: return true; } - void SendActionMenu(Player* player, Creature* creature, uint32 uiAction) + void SendActionMenu(Player* player, Creature* creature, uint32 action) { - switch (uiAction) + switch (action) { case GOSSIP_ACTION_TRADE: player->GetSession()->SendListInventory(creature->GetGUID()); @@ -436,45 +436,45 @@ public: break; //Learn Alchemy case GOSSIP_ACTION_INFO_DEF + 1: - ProcessCastAction(player, creature, S_TRANSMUTE, S_LEARN_TRANSMUTE, DoLearnCost(player)); + ProcessCastaction(player, creature, S_TRANSMUTE, S_LEARN_TRANSMUTE, DoLearnCost(player)); break; case GOSSIP_ACTION_INFO_DEF + 2: - ProcessCastAction(player, creature, S_ELIXIR, S_LEARN_ELIXIR, DoLearnCost(player)); + ProcessCastaction(player, creature, S_ELIXIR, S_LEARN_ELIXIR, DoLearnCost(player)); break; case GOSSIP_ACTION_INFO_DEF + 3: - ProcessCastAction(player, creature, S_POTION, S_LEARN_POTION, DoLearnCost(player)); + ProcessCastaction(player, creature, S_POTION, S_LEARN_POTION, DoLearnCost(player)); break; //Unlearn Alchemy case GOSSIP_ACTION_INFO_DEF + 4: - ProcessCastAction(player, creature, 0, S_UNLEARN_TRANSMUTE, DoHighUnlearnCost(player)); + ProcessCastaction(player, creature, 0, S_UNLEARN_TRANSMUTE, DoHighUnlearnCost(player)); break; case GOSSIP_ACTION_INFO_DEF + 5: - ProcessCastAction(player, creature, 0, S_UNLEARN_ELIXIR, DoHighUnlearnCost(player)); + ProcessCastaction(player, creature, 0, S_UNLEARN_ELIXIR, DoHighUnlearnCost(player)); break; case GOSSIP_ACTION_INFO_DEF + 6: - ProcessCastAction(player, creature, 0, S_UNLEARN_POTION, DoHighUnlearnCost(player)); + ProcessCastaction(player, creature, 0, S_UNLEARN_POTION, DoHighUnlearnCost(player)); break; } } - void SendConfirmLearn(Player* player, Creature* creature, uint32 uiAction) + void SendConfirmLearn(Player* player, Creature* creature, uint32 action) { - if (uiAction) + if (action) { switch (creature->GetEntry()) { case 22427: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_TRANSMUTE, GOSSIP_SENDER_CHECK, uiAction); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_TRANSMUTE, GOSSIP_SENDER_CHECK, action); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 19052: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_ELIXIR, GOSSIP_SENDER_CHECK, uiAction); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_ELIXIR, GOSSIP_SENDER_CHECK, action); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 17909: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_POTION, GOSSIP_SENDER_CHECK, uiAction); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_POTION, GOSSIP_SENDER_CHECK, action); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; @@ -482,24 +482,24 @@ public: } } - void SendConfirmUnlearn(Player* player, Creature* creature, uint32 uiAction) + void SendConfirmUnlearn(Player* player, Creature* creature, uint32 action) { - if (uiAction) + if (action) { switch (creature->GetEntry()) { case 22427: //Zarevhi - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_TRANSMUTE, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_TRANSMUTE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player), false); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 19052: //Lorokeem - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_ELIXIR, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_ELIXIR, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player), false); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 17909: //Lauranna Thar'well - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_POTION, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_POTION, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player), false); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; @@ -507,15 +507,15 @@ public: } } - bool OnGossipSelect(Player* player, Creature* creature, uint32 uiSender, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiSender) + switch (sender) { - case GOSSIP_SENDER_MAIN: SendActionMenu(player, creature, uiAction); break; - case GOSSIP_SENDER_LEARN: SendConfirmLearn(player, creature, uiAction); break; - case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn(player, creature, uiAction); break; - case GOSSIP_SENDER_CHECK: SendActionMenu(player, creature, uiAction); break; + case GOSSIP_SENDER_MAIN: SendActionMenu(player, creature, action); break; + case GOSSIP_SENDER_LEARN: SendConfirmLearn(player, creature, action); break; + case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn(player, creature, action); break; + case GOSSIP_SENDER_CHECK: SendActionMenu(player, creature, action); break; } return true; } @@ -599,9 +599,9 @@ public: return true; } - void SendActionMenu(Player* player, Creature* creature, uint32 uiAction) + void SendActionMenu(Player* player, Creature* creature, uint32 action) { - switch (uiAction) + switch (action) { case GOSSIP_ACTION_TRADE: player->GetSession()->SendListInventory(creature->GetGUID()); @@ -665,24 +665,24 @@ public: } } - void SendConfirmLearn(Player* player, Creature* creature, uint32 uiAction) + void SendConfirmLearn(Player* player, Creature* creature, uint32 action) { - if (uiAction) + if (action) { switch (creature->GetEntry()) { case 11191: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_HAMMER, GOSSIP_SENDER_CHECK, uiAction); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_HAMMER, GOSSIP_SENDER_CHECK, action); //unknown textID (TALK_HAMMER_LEARN) player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 11192: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_AXE, GOSSIP_SENDER_CHECK, uiAction); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_AXE, GOSSIP_SENDER_CHECK, action); //unknown textID (TALK_AXE_LEARN) player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 11193: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SWORD, GOSSIP_SENDER_CHECK, uiAction); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SWORD, GOSSIP_SENDER_CHECK, action); //unknown textID (TALK_SWORD_LEARN) player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; @@ -690,9 +690,9 @@ public: } } - void SendConfirmUnlearn(Player* player, Creature* creature, uint32 uiAction) + void SendConfirmUnlearn(Player* player, Creature* creature, uint32 action) { - if (uiAction) + if (action) { switch (creature->GetEntry()) { @@ -700,23 +700,23 @@ public: case 11178: //Borgosh Corebender case 5164: //Grumnus Steelshaper case 11177: //Okothos Ironrager - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SMITH_SPEC, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_ARMORORWEAPON, DoLowUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SMITH_SPEC, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ARMORORWEAPON, DoLowUnlearnCost(player), false); //unknown textID (TALK_UNLEARN_AXEORWEAPON) player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 11191: - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_HAMMER, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_HAMMER, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player), false); //unknown textID (TALK_HAMMER_UNLEARN) player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 11192: - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_AXE, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_AXE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player), false); //unknown textID (TALK_AXE_UNLEARN) player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 11193: - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SWORD, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SWORD, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player), false); //unknown textID (TALK_SWORD_UNLEARN) player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; @@ -724,15 +724,15 @@ public: } } - bool OnGossipSelect(Player* player, Creature* creature, uint32 uiSender, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiSender) + switch (sender) { - case GOSSIP_SENDER_MAIN: SendActionMenu(player, creature, uiAction); break; - case GOSSIP_SENDER_LEARN: SendConfirmLearn(player, creature, uiAction); break; - case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn(player, creature, uiAction); break; - case GOSSIP_SENDER_CHECK: SendActionMenu(player, creature, uiAction); break; + case GOSSIP_SENDER_MAIN: SendActionMenu(player, creature, action); break; + case GOSSIP_SENDER_LEARN: SendConfirmLearn(player, creature, action); break; + case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn(player, creature, action); break; + case GOSSIP_SENDER_CHECK: SendActionMenu(player, creature, action); break; } return true; } @@ -824,16 +824,16 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 uiSender, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + if (action == GOSSIP_ACTION_INFO_DEF + 1) player->CLOSE_GOSSIP_MENU(); - if (uiSender != creature->GetEntry()) + if (sender != creature->GetEntry()) return true; - switch (uiSender) + switch (sender) { case NPC_ZAP: player->CastSpell(player, SPELL_LEARN_TO_EVERLOOK, false); @@ -897,9 +897,9 @@ public: return true; } - void SendActionMenu(Player* player, Creature* creature, uint32 uiAction) + void SendActionMenu(Player* player, Creature* creature, uint32 action) { - switch (uiAction) + switch (action) { case GOSSIP_ACTION_TRADE: player->GetSession()->SendListInventory(creature->GetGUID()); @@ -920,27 +920,27 @@ public: } } - void SendConfirmUnlearn(Player* player, Creature* creature, uint32 uiAction) + void SendConfirmUnlearn(Player* player, Creature* creature, uint32 action) { - if (uiAction) + if (action) { switch (creature->GetEntry()) { case 7866: //Peter Galen case 7867: //Thorkaf Dragoneye - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_DRAGON, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_DRAGON, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player), false); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 7868: //Sarah Tanner case 7869: //Brumn Winterhoof - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_ELEMENTAL, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_ELEMENTAL, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player), false); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 7870: //Caryssia Moonhunter case 7871: //Se'Jib - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_TRIBAL, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_TRIBAL, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player), false); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; @@ -948,14 +948,14 @@ public: } } - bool OnGossipSelect(Player* player, Creature* creature, uint32 uiSender, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiSender) + switch (sender) { - case GOSSIP_SENDER_MAIN: SendActionMenu(player, creature, uiAction); break; - case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn(player, creature, uiAction); break; - case GOSSIP_SENDER_CHECK: SendActionMenu(player, creature, uiAction); break; + case GOSSIP_SENDER_MAIN: SendActionMenu(player, creature, action); break; + case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn(player, creature, action); break; + case GOSSIP_SENDER_CHECK: SendActionMenu(player, creature, action); break; } return true; } @@ -1017,9 +1017,9 @@ public: return true; } - void SendActionMenu(Player* player, Creature* creature, uint32 uiAction) + void SendActionMenu(Player* player, Creature* creature, uint32 action) { - switch (uiAction) + switch (action) { case GOSSIP_ACTION_TRADE: player->GetSession()->SendListInventory(creature->GetGUID()); @@ -1029,13 +1029,13 @@ public: break; //Learn Tailor case GOSSIP_ACTION_INFO_DEF + 1: - ProcessCastAction(player, creature, S_SPELLFIRE, S_LEARN_SPELLFIRE, DoLearnCost(player)); + ProcessCastaction(player, creature, S_SPELLFIRE, S_LEARN_SPELLFIRE, DoLearnCost(player)); break; case GOSSIP_ACTION_INFO_DEF + 2: - ProcessCastAction(player, creature, S_MOONCLOTH, S_LEARN_MOONCLOTH, DoLearnCost(player)); + ProcessCastaction(player, creature, S_MOONCLOTH, S_LEARN_MOONCLOTH, DoLearnCost(player)); break; case GOSSIP_ACTION_INFO_DEF + 3: - ProcessCastAction(player, creature, S_SHADOWEAVE, S_LEARN_SHADOWEAVE, DoLearnCost(player)); + ProcessCastaction(player, creature, S_SHADOWEAVE, S_LEARN_SHADOWEAVE, DoLearnCost(player)); break; //Unlearn Tailor case GOSSIP_ACTION_INFO_DEF + 4: @@ -1050,24 +1050,24 @@ public: } } - void SendConfirmLearn(Player* player, Creature* creature, uint32 uiAction) + void SendConfirmLearn(Player* player, Creature* creature, uint32 action) { - if (uiAction) + if (action) { switch (creature->GetEntry()) { case 22213: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, uiAction); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, action); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 22208: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, uiAction); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, action); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 22212: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, uiAction); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, action); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; @@ -1075,24 +1075,24 @@ public: } } - void SendConfirmUnlearn(Player* player, Creature* creature, uint32 uiAction) + void SendConfirmUnlearn(Player* player, Creature* creature, uint32 action) { - if (uiAction) + if (action) { switch (creature->GetEntry()) { case 22213: //Gidge Spellweaver - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player), false); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 22208: //Nasmara Moonsong - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player), false); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 22212: //Andrion Darkspinner - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player), false); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; @@ -1100,15 +1100,15 @@ public: } } - bool OnGossipSelect(Player* player, Creature* creature, uint32 uiSender, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiSender) + switch (sender) { - case GOSSIP_SENDER_MAIN: SendActionMenu(player, creature, uiAction); break; - case GOSSIP_SENDER_LEARN: SendConfirmLearn(player, creature, uiAction); break; - case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn(player, creature, uiAction); break; - case GOSSIP_SENDER_CHECK: SendActionMenu(player, creature, uiAction); break; + case GOSSIP_SENDER_MAIN: SendActionMenu(player, creature, action); break; + case GOSSIP_SENDER_LEARN: SendConfirmLearn(player, creature, action); break; + case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn(player, creature, action); break; + case GOSSIP_SENDER_CHECK: SendActionMenu(player, creature, action); break; } return true; } diff --git a/src/server/scripts/World/npc_taxi.cpp b/src/server/scripts/World/npc_taxi.cpp index aff326e152d..ceda8e0f6ac 100644 --- a/src/server/scripts/World/npc_taxi.cpp +++ b/src/server/scripts/World/npc_taxi.cpp @@ -38,7 +38,7 @@ EndScriptData #define GOSSIP_BRACK2 "Fly me to The Abyssal Shelf" #define GOSSIP_BRACK3 "Fly me to Spinebreaker Post" #define GOSSIP_IRENA "Fly me to Skettis please" -#define GOSSIP_CLOUDBREAKER1 "Speaking of uiAction, I've been ordered to undertake an air strike." +#define GOSSIP_CLOUDBREAKER1 "Speaking of action, I've been ordered to undertake an air strike." #define GOSSIP_CLOUDBREAKER2 "I need to intercept the Dawnblade reinforcements." #define GOSSIP_DRAGONHAWK "" #define GOSSIP_VERONIA "Fly me to Manaforge Coruu please" @@ -186,10 +186,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: //spellId is correct, however it gives flight a somewhat funny effect //TaxiPath 506. @@ -201,9 +201,10 @@ public: player->ActivateTaxiPathTo(627); //TaxiPath 627 (possibly 627+628(152->153->154->155)) break; case GOSSIP_ACTION_INFO_DEF + 2: - if (!player->HasItemCount(25853, 1)) { + if (!player->HasItemCount(25853, 1)) player->SEND_GOSSIP_MENU(9780, creature->GetGUID()); - } else { + else + { player->CLOSE_GOSSIP_MENU(); player->ActivateTaxiPathTo(534); //TaxiPath 534 } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 10bc722fc1b..b7aee4a3f07 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1495,7 +1495,6 @@ public: else me->SetReactState(REACT_AGGRESSIVE); } - }; CreatureAI* GetAI(Creature* creature) const @@ -1754,14 +1753,12 @@ public: struct mob_mojoAI : public ScriptedAI { mob_mojoAI(Creature* c) : ScriptedAI(c) {Reset();} - - uint32 Hearts; - uint64 VictimGUID; - + uint32 hearts; + uint64 victimGUID; void Reset() { - VictimGUID = 0; - Hearts = 15000; + victimGUID = 0; + hearts = 15000; if (Unit* own = me->GetOwner()) me->GetMotionMaster()->MoveFollow(own, 0, 0); } @@ -1772,12 +1769,11 @@ public: { if (me->HasAura(20372)) { - if (Hearts <= diff) + if (hearts <= diff) { me->RemoveAurasDueToSpell(20372); - Hearts = 15000; - } - Hearts -= diff; + hearts = 15000; + } hearts -= diff; } } @@ -1821,14 +1817,14 @@ public: } me->MonsterWhisper(whisp.c_str(), player->GetGUID()); - if (VictimGUID) - if (Player* victim = Unit::GetPlayer(*me, VictimGUID)) + if (victimGUID) + if (Player* victim = Unit::GetPlayer(*me, victimGUID)) victim->RemoveAura(43906);//remove polymorph frog thing me->AddAura(43906, player);//add polymorph frog thing - VictimGUID = player->GetGUID(); + victimGUID = player->GetGUID(); DoCast(me, 20372, true);//tag.hearts me->GetMotionMaster()->MoveFollow(player, 0, 0); - Hearts = 15000; + hearts = 15000; } } }; @@ -1894,7 +1890,7 @@ public: { npc_ebon_gargoyleAI(Creature* c) : CasterAI(c) {} - uint32 DespawnTimer; + uint32 despawnTimer; void InitializeAI() { @@ -1903,7 +1899,7 @@ public: if (!ownerGuid) return; // Not needed to be despawned now - DespawnTimer = 0; + despawnTimer = 0; // Find victim of Summon Gargoyle spell std::list targets; Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(me, me, 30); @@ -1952,15 +1948,15 @@ public: me->GetMotionMaster()->MovePoint(0, x, y, z); // Despawn as soon as possible - DespawnTimer = 4 * IN_MILLISECONDS; + despawnTimer = 4 * IN_MILLISECONDS; } void UpdateAI(const uint32 diff) { - if (DespawnTimer > 0) + if (despawnTimer > 0) { - if (DespawnTimer > diff) - DespawnTimer -= diff; + if (despawnTimer > diff) + despawnTimer -= diff; else me->DespawnOrUnsummon(); return; @@ -2021,20 +2017,20 @@ public: { npc_training_dummyAI(Creature* creature) : Scripted_NoMovementAI(creature) { - Entry = creature->GetEntry(); + entry = creature->GetEntry(); } - uint32 Entry; - uint32 ResetTimer; - uint32 DespawnTimer; + uint32 entry; + uint32 resetTimer; + uint32 despawnTimer; void Reset() { me->SetControlled(true, UNIT_STATE_STUNNED);//disable rotate me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);//imune to knock aways like blast wave - ResetTimer = 5000; - DespawnTimer = 15000; + resetTimer = 5000; + despawnTimer = 15000; } void EnterEvadeMode() @@ -2047,13 +2043,13 @@ public: void DamageTaken(Unit* /*doneBy*/, uint32& damage) { - ResetTimer = 5000; + resetTimer = 5000; damage = 0; } void EnterCombat(Unit* /*who*/) { - if (Entry != NPC_ADVANCED_TARGET_DUMMY && Entry != NPC_TARGET_DUMMY) + if (entry != NPC_ADVANCED_TARGET_DUMMY && entry != NPC_TARGET_DUMMY) return; } @@ -2065,23 +2061,23 @@ public: if (!me->HasUnitState(UNIT_STATE_STUNNED)) me->SetControlled(true, UNIT_STATE_STUNNED);//disable rotate - if (Entry != NPC_ADVANCED_TARGET_DUMMY && Entry != NPC_TARGET_DUMMY) + if (entry != NPC_ADVANCED_TARGET_DUMMY && entry != NPC_TARGET_DUMMY) { - if (ResetTimer <= diff) + if (resetTimer <= diff) { EnterEvadeMode(); - ResetTimer = 5000; + resetTimer = 5000; } else - ResetTimer -= diff; + resetTimer -= diff; return; } else { - if (DespawnTimer <= diff) + if (despawnTimer <= diff) me->DespawnOrUnsummon(); else - DespawnTimer -= diff; + despawnTimer -= diff; } } void MoveInLineOfSight(Unit* /*who*/){return;} From c23ff109dfda710c5518b7ec0e7d0a4c09e48159 Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 7 Mar 2012 09:16:52 -0500 Subject: [PATCH 0135/1149] Core/Spells: attempt to fix damage for life tap (thx again vincent-michael) --- src/server/scripts/Spells/spell_warlock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 80ba1972437..e4220cce6c7 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -381,7 +381,7 @@ class spell_warl_life_tap : public SpellScriptLoader if (Unit* target = GetHitUnit()) { SpellInfo const* spellInfo = GetSpellInfo(); - int32 damage = int32(GetEffectValue() + (6.3875 * spellInfo->BaseLevel)); + int32 damage = GetEffectValue(); int32 mana = int32(damage + (caster->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+SPELL_SCHOOL_SHADOW) * 0.5f)); // Shouldn't Appear in Combat Log From 2e58d7b515a74944f4c4caca9fa29186e8f56586 Mon Sep 17 00:00:00 2001 From: kandera Date: Wed, 7 Mar 2012 10:15:40 -0500 Subject: [PATCH 0136/1149] Core/Spells: cleanup warning for life tap --- src/server/scripts/Spells/spell_warlock.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index e4220cce6c7..29a52406279 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -380,7 +380,6 @@ class spell_warl_life_tap : public SpellScriptLoader Player* caster = GetCaster()->ToPlayer(); if (Unit* target = GetHitUnit()) { - SpellInfo const* spellInfo = GetSpellInfo(); int32 damage = GetEffectValue(); int32 mana = int32(damage + (caster->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+SPELL_SCHOOL_SHADOW) * 0.5f)); From a1a7a2d7c06e9a8d1cbf3a8901d8d134dcd1ee6a Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 7 Mar 2012 18:57:47 +0100 Subject: [PATCH 0137/1149] Core/Players * Add liquid special aura only if player is in it (not when above) * Use CastSpell instead of AddAura - checks all dbc conditions on spell --- src/server/collision/Management/VMapManager2.cpp | 3 ++- src/server/game/DataStores/DBCStores.cpp | 8 ++++++++ src/server/game/DataStores/DBCStores.h | 2 ++ src/server/game/Entities/Player/Player.cpp | 7 ++++++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/server/collision/Management/VMapManager2.cpp b/src/server/collision/Management/VMapManager2.cpp index 6139a27fb52..b9f0f25c2f9 100644 --- a/src/server/collision/Management/VMapManager2.cpp +++ b/src/server/collision/Management/VMapManager2.cpp @@ -30,6 +30,7 @@ #include #include #include "DisableMgr.h" +#include "DBCStores.h" using G3D::Vector3; @@ -234,7 +235,7 @@ namespace VMAP floor = info.ground_Z; ASSERT(floor < std::numeric_limits::max()); type = info.hitModel->GetLiquidType(); // entry from LiquidType.dbc - if (reqLiquidType && !(type & reqLiquidType)) + if (reqLiquidType && !(GetLiquidFlags(type) & reqLiquidType)) return false; if (info.hitInstance->GetLiquidLevel(pos, info, level)) return true; diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 4fa8e09cead..acc130dcddf 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -864,6 +864,14 @@ uint32 const* GetTalentTabPages(uint8 cls) return sTalentTabPages[cls]; } +uint32 GetLiquidFlags(uint32 liquidType) +{ + if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(liquidType)) + return 1 << liq->Type; + + return 0; +} + // script support functions DBCStorage const* GetSoundEntriesStore() { return &sSoundEntriesStore; } DBCStorage const* GetSpellRangeStore() { return &sSpellRangeStore; } diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 0bbf06c5311..3f8d19c1f5e 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -60,6 +60,8 @@ MapDifficulty const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &di uint32 const* /*[MAX_TALENT_TABS]*/ GetTalentTabPages(uint8 cls); +uint32 GetLiquidFlags(uint32 liquidType); + PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level); PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 729a2fe0b00..54178cd6720 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -23075,7 +23075,12 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z) RemoveAurasDueToSpell(_lastLiquid->SpellId); if (liquid && liquid->SpellId) - AddAura(liquid->SpellId, this); + { + if (res & (LIQUID_MAP_UNDER_WATER | LIQUID_MAP_IN_WATER | LIQUID_MAP_WATER_WALK)) + CastSpell(this, liquid->SpellId, this); + else + RemoveAurasDueToSpell(liquid->SpellId); + } _lastLiquid = liquid; } From f1949b20a6545b11361d6fa223907393a0070327 Mon Sep 17 00:00:00 2001 From: Spp Date: Fri, 9 Mar 2012 13:42:52 +0100 Subject: [PATCH 0138/1149] Some random cleanup here and there --- src/server/game/Accounts/AccountMgr.h | 34 +-- src/server/game/Entities/Corpse/Corpse.h | 1 - .../game/Entities/Creature/Creature.cpp | 30 +-- .../game/Entities/Creature/TemporarySummon.h | 1 - .../Entities/DynamicObject/DynamicObject.cpp | 4 +- .../game/Entities/GameObject/GameObject.cpp | 2 - .../game/Entities/GameObject/GameObject.h | 1 - src/server/game/Entities/Player/Player.cpp | 76 +++---- src/server/game/Entities/Player/Player.h | 8 +- src/server/game/Entities/Totem/Totem.h | 1 - .../game/Handlers/BattleGroundHandler.cpp | 4 +- src/server/game/Handlers/QuestHandler.cpp | 197 +++++++++--------- src/server/game/Handlers/SkillHandler.cpp | 1 - src/server/game/Handlers/TaxiHandler.cpp | 2 +- src/server/game/Handlers/TradeHandler.cpp | 10 +- src/server/game/Instances/InstanceSaveMgr.cpp | 2 +- src/server/game/Mails/Mail.h | 1 + src/server/game/OutdoorPvP/OutdoorPvP.cpp | 10 +- src/server/game/Scripting/ScriptLoader.h | 19 +- src/server/game/Scripting/ScriptSystem.cpp | 9 +- src/server/game/Scripting/ScriptSystem.h | 1 + src/server/game/Server/Protocol/Opcodes.h | 2 +- src/server/game/Server/WorldSession.cpp | 14 +- src/server/game/Server/WorldSession.h | 2 +- src/server/game/Skills/SkillDiscovery.cpp | 4 +- src/server/game/Skills/SkillDiscovery.h | 1 - src/server/game/Skills/SkillExtraItems.cpp | 1 - src/server/game/Skills/SkillExtraItems.h | 1 - src/server/game/Weather/Weather.h | 1 - .../scripts/OutdoorPvP/OutdoorPvPEP.cpp | 1 - src/server/scripts/OutdoorPvP/OutdoorPvPEP.h | 1 - .../scripts/OutdoorPvP/OutdoorPvPZM.cpp | 1 - 32 files changed, 219 insertions(+), 224 deletions(-) diff --git a/src/server/game/Accounts/AccountMgr.h b/src/server/game/Accounts/AccountMgr.h index 1b1ecfa994a..467972cdf65 100755 --- a/src/server/game/Accounts/AccountMgr.h +++ b/src/server/game/Accounts/AccountMgr.h @@ -36,25 +36,25 @@ enum AccountOpResult namespace AccountMgr { - AccountOpResult CreateAccount(std::string username, std::string password); - AccountOpResult DeleteAccount(uint32 accountId); - AccountOpResult ChangeUsername(uint32 accountId, std::string newUsername, std::string newPassword); - AccountOpResult ChangePassword(uint32 accountId, std::string newPassword); - bool CheckPassword(uint32 accountId, std::string password); + AccountOpResult CreateAccount(std::string username, std::string password); + AccountOpResult DeleteAccount(uint32 accountId); + AccountOpResult ChangeUsername(uint32 accountId, std::string newUsername, std::string newPassword); + AccountOpResult ChangePassword(uint32 accountId, std::string newPassword); + bool CheckPassword(uint32 accountId, std::string password); - uint32 GetId(std::string username); - uint32 GetSecurity(uint32 accountId); - uint32 GetSecurity(uint64 accountId, int32 realmId); - bool GetName(uint32 accountId, std::string& name); - uint32 GetCharactersCount(uint32 accountId); - std::string CalculateShaPassHash(std::string& name, std::string& password); + uint32 GetId(std::string username); + uint32 GetSecurity(uint32 accountId); + uint32 GetSecurity(uint64 accountId, int32 realmId); + bool GetName(uint32 accountId, std::string& name); + uint32 GetCharactersCount(uint32 accountId); + std::string CalculateShaPassHash(std::string& name, std::string& password); - bool normalizeString(std::string& utf8String); - bool IsPlayerAccount(uint32 gmlevel); - bool IsModeratorAccount(uint32 gmlevel); - bool IsGMAccount(uint32 gmlevel); - bool IsAdminAccount(uint32 gmlevel); - bool IsConsoleAccount(uint32 gmlevel); + bool normalizeString(std::string& utf8String); + bool IsPlayerAccount(uint32 gmlevel); + bool IsModeratorAccount(uint32 gmlevel); + bool IsGMAccount(uint32 gmlevel); + bool IsAdminAccount(uint32 gmlevel); + bool IsConsoleAccount(uint32 gmlevel); }; #endif diff --git a/src/server/game/Entities/Corpse/Corpse.h b/src/server/game/Entities/Corpse/Corpse.h index 1aaf56eaf27..afac900df32 100755 --- a/src/server/game/Entities/Corpse/Corpse.h +++ b/src/server/game/Entities/Corpse/Corpse.h @@ -91,4 +91,3 @@ class Corpse : public WorldObject, public GridObject GridCoord _gridCoord; // gride for corpse position for fast search }; #endif - diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 0fe2016950b..2b4f1275993 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1663,9 +1663,9 @@ bool Creature::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) return Unit::IsImmunedToSpellEffect(spellInfo, index); } -SpellInfo const* Creature::reachWithSpellAttack(Unit* pVictim) +SpellInfo const* Creature::reachWithSpellAttack(Unit* victim) { - if (!pVictim) + if (!victim) return NULL; for (uint32 i=0; i < CREATURE_MAX_SPELLS; ++i) @@ -1698,7 +1698,7 @@ SpellInfo const* Creature::reachWithSpellAttack(Unit* pVictim) continue; float range = spellInfo->GetMaxRange(false); float minrange = spellInfo->GetMinRange(false); - float dist = GetDistance(pVictim); + float dist = GetDistance(victim); if (dist > range || dist < minrange) continue; if (spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED)) @@ -1710,9 +1710,9 @@ SpellInfo const* Creature::reachWithSpellAttack(Unit* pVictim) return NULL; } -SpellInfo const* Creature::reachWithSpellCure(Unit* pVictim) +SpellInfo const* Creature::reachWithSpellCure(Unit* victim) { - if (!pVictim) + if (!victim) return NULL; for (uint32 i=0; i < CREATURE_MAX_SPELLS; ++i) @@ -1742,8 +1742,8 @@ SpellInfo const* Creature::reachWithSpellCure(Unit* pVictim) float range = spellInfo->GetMaxRange(true); float minrange = spellInfo->GetMinRange(true); - float dist = GetDistance(pVictim); - //if (!isInFront(pVictim, range) && spellInfo->AttributesEx) + float dist = GetDistance(victim); + //if (!isInFront(victim, range) && spellInfo->AttributesEx) // continue; if (dist > range || dist < minrange) continue; @@ -1980,30 +1980,30 @@ void Creature::SaveRespawnTime() } // this should not be called by petAI or -bool Creature::canCreatureAttack(Unit const* pVictim, bool /*force*/) const +bool Creature::canCreatureAttack(Unit const* victim, bool /*force*/) const { - if (!pVictim->IsInMap(this)) + if (!victim->IsInMap(this)) return false; - if (!IsValidAttackTarget(pVictim)) + if (!IsValidAttackTarget(victim)) return false; - if (!pVictim->isInAccessiblePlaceFor(this)) + if (!victim->isInAccessiblePlaceFor(this)) return false; - if (IsAIEnabled && !AI()->CanAIAttack(pVictim)) + if (IsAIEnabled && !AI()->CanAIAttack(victim)) return false; if (sMapStore.LookupEntry(GetMapId())->IsDungeon()) return true; //Use AttackDistance in distance check if threat radius is lower. This prevents creature bounce in and out of combat every update tick. - float dist = std::max(GetAttackDistance(pVictim), sWorld->getFloatConfig(CONFIG_THREAT_RADIUS)) + m_CombatDistance; + float dist = std::max(GetAttackDistance(victim), sWorld->getFloatConfig(CONFIG_THREAT_RADIUS)) + m_CombatDistance; if (Unit* unit = GetCharmerOrOwner()) - return pVictim->IsWithinDist(unit, dist); + return victim->IsWithinDist(unit, dist); else - return pVictim->IsInDist(&m_homePosition, dist); + return victim->IsInDist(&m_homePosition, dist); } CreatureAddon const* Creature::GetCreatureAddon() const diff --git a/src/server/game/Entities/Creature/TemporarySummon.h b/src/server/game/Entities/Creature/TemporarySummon.h index fa1e134b1ac..829eb73bf80 100755 --- a/src/server/game/Entities/Creature/TemporarySummon.h +++ b/src/server/game/Entities/Creature/TemporarySummon.h @@ -107,4 +107,3 @@ private: TempSummon& m_owner; }; #endif - diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp index 0a4e4c73f42..abeae0656ee 100755 --- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp +++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp @@ -116,7 +116,7 @@ bool DynamicObject::CreateDynamicObject(uint32 guidlow, Unit* caster, uint32 spe void DynamicObject::Update(uint32 p_time) { - // caster has to be always avalible and in the same map + // caster has to be always available and in the same map ASSERT(_caster); ASSERT(_caster->GetMap() == GetMap()); @@ -127,7 +127,7 @@ void DynamicObject::Update(uint32 p_time) if (!_aura->IsRemoved()) _aura->UpdateOwner(p_time, this); - // m_aura may be set to null in Aura::UpdateOwner call + // _aura may be set to null in Aura::UpdateOwner call if (_aura && (_aura->IsRemoved() || _aura->IsExpired())) expired = true; } diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index c7101e918ba..0ba46609945 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -223,7 +223,6 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa SetGoArtKit(0); // unknown what this is SetByteValue(GAMEOBJECT_BYTES_1, 2, artKit); - switch (goinfo->type) { case GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING: @@ -252,7 +251,6 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa m_invisibility.AddFlag(INVISIBILITY_TRAP); m_invisibility.AddValue(INVISIBILITY_TRAP, 300); } - break; default: SetGoAnimProgress(animprogress); diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index a4fece4d301..ee643648a6a 100755 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -402,7 +402,6 @@ struct GameObjectTemplate } raw; }; - std::string AIName; uint32 ScriptId; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 54178cd6720..127b45e1739 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -11547,7 +11547,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest uint32 count = pItem->GetCount(); - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, pItem->GetEntry(), pItem->GetCount()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, pItem->GetEntry(), pItem->GetCount()); ItemTemplate const* pProto = pItem->GetTemplate(); if (!pProto) return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND; @@ -11731,7 +11731,7 @@ InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const { if (pItem) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseItem item = %u", pItem->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseItem item = %u", pItem->GetEntry()); if (!isAlive() && not_loading) return EQUIP_ERR_YOU_ARE_DEAD; @@ -11914,7 +11914,7 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje InventoryResult Player::CanUseAmmo(uint32 item) const { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseAmmo item = %u", item); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseAmmo item = %u", item); if (!isAlive()) return EQUIP_ERR_YOU_ARE_DEAD; //if (isStunned()) @@ -12060,7 +12060,7 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool uint8 bag = pos >> 8; uint8 slot = pos & 255; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: StoreItem bag = %u, slot = %u, item = %u, count = %u, guid = %u", bag, slot, pItem->GetEntry(), count, pItem->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: StoreItem bag = %u, slot = %u, item = %u, count = %u, guid = %u", bag, slot, pItem->GetEntry(), count, pItem->GetGUIDLow()); Item* pItem2 = GetItemByPos(bag, slot); @@ -12316,7 +12316,7 @@ void Player::VisualizeItem(uint8 slot, Item* pItem) if (pItem->GetTemplate()->Bonding == BIND_WHEN_EQUIPED || pItem->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || pItem->GetTemplate()->Bonding == BIND_QUEST_ITEM) pItem->SetBinding(true); - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: EquipItem slot = %u, item = %u", slot, pItem->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: EquipItem slot = %u, item = %u", slot, pItem->GetEntry()); m_items[slot] = pItem; SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), pItem->GetGUID()); @@ -12341,7 +12341,7 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update) Item* pItem = GetItemByPos(bag, slot); if (pItem) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); RemoveEnchantmentDurations(pItem); RemoveItemDurations(pItem); @@ -12460,7 +12460,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) Item* pItem = GetItemByPos(bag, slot); if (pItem) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); // Also remove all contained items if the item is a bag. // This if () prevents item saving crashes if the condition for a bag to be empty before being destroyed was bypassed somehow. if (pItem->IsNotEmptyBag()) @@ -12551,7 +12551,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequip_check) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item = %u, count = %u", item, count); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item = %u, count = %u", item, count); uint32 remcount = 0; // in inventory @@ -12680,7 +12680,7 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ void Player::DestroyZoneLimitedItem(bool update, uint32 new_zone) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyZoneLimitedItem in map %u and area %u", GetMapId(), new_zone); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyZoneLimitedItem in map %u and area %u", GetMapId(), new_zone); // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) @@ -12712,7 +12712,7 @@ void Player::DestroyConjuredItems(bool update) { // used when entering arena // destroys all conjured items - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyConjuredItems"); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyConjuredItems"); // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) @@ -12763,7 +12763,7 @@ void Player::DestroyItemCount(Item* pItem, uint32 &count, bool update) if (!pItem) return; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", pItem->GetGUIDLow(), pItem->GetEntry(), count); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", pItem->GetGUIDLow(), pItem->GetEntry(), count); if (pItem->GetCount() <= count) { @@ -12826,7 +12826,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count) return; } - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SplitItem bag = %u, slot = %u, item = %u, count = %u", dstbag, dstslot, pSrcItem->GetEntry(), count); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SplitItem bag = %u, slot = %u, item = %u, count = %u", dstbag, dstslot, pSrcItem->GetEntry(), count); Item* pNewItem = pSrcItem->CloneItem(count, this); if (!pNewItem) { @@ -12911,7 +12911,7 @@ void Player::SwapItem(uint16 src, uint16 dst) if (!pSrcItem) return; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SwapItem bag = %u, slot = %u, item = %u", dstbag, dstslot, pSrcItem->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SwapItem bag = %u, slot = %u, item = %u", dstbag, dstslot, pSrcItem->GetEntry()); if (!isAlive()) { @@ -12941,7 +12941,7 @@ void Player::SwapItem(uint16 src, uint16 dst) } // prevent put equipped/bank bag in self - if (IsBagPos (src) && srcslot == dstbag) + if (IsBagPos(src) && srcslot == dstbag) { SendEquipError(EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG, pSrcItem, pDstItem); return; @@ -12999,7 +12999,7 @@ void Player::SwapItem(uint16 src, uint16 dst) if (IsBankPos(src)) ItemAddedQuestCheck(pSrcItem->GetEntry(), pSrcItem->GetCount()); } - else if (IsBankPos (dst)) + else if (IsBankPos(dst)) { ItemPosCountVec dest; InventoryResult msg = CanBankItem(dstbag, dstslot, dest, pSrcItem, false); @@ -13013,7 +13013,7 @@ void Player::SwapItem(uint16 src, uint16 dst) BankItem(dest, pSrcItem, true); ItemRemovedQuestCheck(pSrcItem->GetEntry(), pSrcItem->GetCount()); } - else if (IsEquipmentPos (dst)) + else if (IsEquipmentPos(dst)) { uint16 dest; InventoryResult msg = CanEquipItem(dstslot, dest, pSrcItem, false); @@ -13039,9 +13039,9 @@ void Player::SwapItem(uint16 src, uint16 dst) uint16 eDest = 0; if (IsInventoryPos(dst)) msg = CanStoreItem(dstbag, dstslot, sDest, pSrcItem, false); - else if (IsBankPos (dst)) + else if (IsBankPos(dst)) msg = CanBankItem(dstbag, dstslot, sDest, pSrcItem, false); - else if (IsEquipmentPos (dst)) + else if (IsEquipmentPos(dst)) msg = CanEquipItem(dstslot, eDest, pSrcItem, false); else return; @@ -13055,9 +13055,9 @@ void Player::SwapItem(uint16 src, uint16 dst) if (IsInventoryPos(dst)) StoreItem(sDest, pSrcItem, true); - else if (IsBankPos (dst)) + else if (IsBankPos(dst)) BankItem(sDest, pSrcItem, true); - else if (IsEquipmentPos (dst)) + else if (IsEquipmentPos(dst)) { EquipItem(eDest, pSrcItem, true); AutoUnequipOffhandIfNeed(); @@ -13287,7 +13287,7 @@ void Player::AddItemToBuyBackSlot(Item* pItem) } RemoveItemFromBuyBackSlot(slot, true); - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", pItem->GetEntry(), slot); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", pItem->GetEntry(), slot); m_items[slot] = pItem; time_t base = time(NULL); @@ -13295,8 +13295,8 @@ void Player::AddItemToBuyBackSlot(Item* pItem) uint32 eslot = slot - BUYBACK_SLOT_START; SetUInt64Value(PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), pItem->GetGUID()); - if (ItemTemplate const* pProto = pItem->GetTemplate()) - SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, pProto->SellPrice * pItem->GetCount()); + if (ItemTemplate const* proto = pItem->GetTemplate()) + SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, proto->SellPrice * pItem->GetCount()); else SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, 0); SetUInt32Value(PLAYER_FIELD_BUYBACK_TIMESTAMP_1 + eslot, (uint32)etime); @@ -13309,7 +13309,7 @@ void Player::AddItemToBuyBackSlot(Item* pItem) Item* Player::GetItemFromBuyBackSlot(uint32 slot) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: GetItemFromBuyBackSlot slot = %u", slot); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: GetItemFromBuyBackSlot slot = %u", slot); if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END) return m_items[slot]; return NULL; @@ -13317,7 +13317,7 @@ Item* Player::GetItemFromBuyBackSlot(uint32 slot) void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItemFromBuyBackSlot slot = %u", slot); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItemFromBuyBackSlot slot = %u", slot); if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END) { Item* pItem = m_items[slot]; @@ -14374,7 +14374,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men return; } - GetSession()->SendBattlegGroundList(guid, bgTypeId); + GetSession()->SendBattleGroundList(guid, bgTypeId); break; } } @@ -14429,15 +14429,15 @@ uint32 Player::GetDefaultGossipMenuForSource(WorldObject* source) void Player::PrepareQuestMenu(uint64 guid) { - QuestRelationBounds pObjectQR; - QuestRelationBounds pObjectQIR; + QuestRelationBounds objectQR; + QuestRelationBounds objectQIR; // pets also can have quests Creature* creature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid); if (creature) { - pObjectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry()); - pObjectQIR = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(creature->GetEntry()); + objectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry()); + objectQIR = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(creature->GetEntry()); } else { @@ -14448,8 +14448,8 @@ void Player::PrepareQuestMenu(uint64 guid) GameObject* pGameObject = _map->GetGameObject(guid); if (pGameObject) { - pObjectQR = sObjectMgr->GetGOQuestRelationBounds(pGameObject->GetEntry()); - pObjectQIR = sObjectMgr->GetGOQuestInvolvedRelationBounds(pGameObject->GetEntry()); + objectQR = sObjectMgr->GetGOQuestRelationBounds(pGameObject->GetEntry()); + objectQIR = sObjectMgr->GetGOQuestInvolvedRelationBounds(pGameObject->GetEntry()); } else return; @@ -14458,7 +14458,7 @@ void Player::PrepareQuestMenu(uint64 guid) QuestMenu &qm = PlayerTalkClass->GetQuestMenu(); qm.ClearMenu(); - for (QuestRelations::const_iterator i = pObjectQIR.first; i != pObjectQIR.second; ++i) + for (QuestRelations::const_iterator i = objectQIR.first; i != objectQIR.second; ++i) { uint32 quest_id = i->second; QuestStatus status = GetQuestStatus(quest_id); @@ -14470,7 +14470,7 @@ void Player::PrepareQuestMenu(uint64 guid) // qm.AddMenuItem(quest_id, 2); } - for (QuestRelations::const_iterator i = pObjectQR.first; i != pObjectQR.second; ++i) + for (QuestRelations::const_iterator i = objectQR.first; i != objectQR.second; ++i) { uint32 quest_id = i->second; Quest const* quest = sObjectMgr->GetQuestTemplate(quest_id); @@ -14590,11 +14590,11 @@ bool Player::IsActiveQuest(uint32 quest_id) const Quest const* Player::GetNextQuest(uint64 guid, Quest const* quest) { - QuestRelationBounds pObjectQR; + QuestRelationBounds objectQR; Creature* creature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid); if (creature) - pObjectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry()); + objectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry()); else { //we should obtain map pointer from GetMap() in 99% of cases. Special case @@ -14603,13 +14603,13 @@ Quest const* Player::GetNextQuest(uint64 guid, Quest const* quest) ASSERT(_map); GameObject* pGameObject = _map->GetGameObject(guid); if (pGameObject) - pObjectQR = sObjectMgr->GetGOQuestRelationBounds(pGameObject->GetEntry()); + objectQR = sObjectMgr->GetGOQuestRelationBounds(pGameObject->GetEntry()); else return NULL; } uint32 nextQuestID = quest->GetNextQuestInChain(); - for (QuestRelations::const_iterator itr = pObjectQR.first; itr != pObjectQR.second; ++itr) + for (QuestRelations::const_iterator itr = objectQR.first; itr != objectQR.second; ++itr) { if (itr->second == nextQuestID) return sObjectMgr->GetQuestTemplate(nextQuestID); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 362fd8a9016..bd58827c0e4 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1543,7 +1543,7 @@ class Player : public Unit, public GridObject void setRegenTimerCount(uint32 time) {m_regenTimerCount = time;} void setWeaponChangeTimer(uint32 time) {m_weaponChangeTimer = time;} - uint32 GetMoney() const { return GetUInt32Value (PLAYER_FIELD_COINAGE); } + uint32 GetMoney() const { return GetUInt32Value(PLAYER_FIELD_COINAGE); } void ModifyMoney(int32 d); bool HasEnoughMoney(uint32 amount) const { return (GetMoney() >= amount); } bool HasEnoughMoney(int32 amount) const @@ -1555,13 +1555,13 @@ class Player : public Unit, public GridObject void SetMoney(uint32 value) { - SetUInt32Value (PLAYER_FIELD_COINAGE, value); + SetUInt32Value(PLAYER_FIELD_COINAGE, value); MoneyChanged(value); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED); } RewardedQuestSet const& getRewardedQuests() const { return m_RewardedQuests; } - QuestStatusMap& getQuestStatusMap() { return m_QuestStatus; }; + QuestStatusMap& getQuestStatusMap() { return m_QuestStatus; } size_t GetRewardedQuestCount() const { return m_RewardedQuests.size(); } bool IsQuestRewarded(uint32 quest_id) const @@ -1574,7 +1574,7 @@ class Player : public Unit, public GridObject Player* GetSelectedPlayer() const; void SetSelection(uint64 guid) { m_curSelection = guid; SetUInt64Value(UNIT_FIELD_TARGET, guid); } - uint8 GetComboPoints() { return m_comboPoints; } + uint8 GetComboPoints() const { return m_comboPoints; } uint64 GetComboTarget() const { return m_comboTarget; } void AddComboPoints(Unit* target, int8 count, Spell* spell = NULL); diff --git a/src/server/game/Entities/Totem/Totem.h b/src/server/game/Entities/Totem/Totem.h index 8b00da34d73..c33b8776660 100755 --- a/src/server/game/Entities/Totem/Totem.h +++ b/src/server/game/Entities/Totem/Totem.h @@ -60,4 +60,3 @@ class Totem : public Minion uint32 m_duration; }; #endif - diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index d1aa0021a75..e11f6e5b4e2 100755 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -60,10 +60,10 @@ void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recv_data) return; } - SendBattlegGroundList(guid, bgTypeId); + SendBattleGroundList(guid, bgTypeId); } -void WorldSession::SendBattlegGroundList(uint64 guid, BattlegroundTypeId bgTypeId) +void WorldSession::SendBattleGroundList(uint64 guid, BattlegroundTypeId bgTypeId) { WorldPacket data; sBattlegroundMgr->BuildBattlegroundListPacket(&data, guid, _player, bgTypeId, 0); diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index 6725992b48a..73bbc58c445 100755 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -53,7 +53,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc, guid = %u", uint32(GUID_LOPART(guid))); Creature* cr_questgiver=questgiver->ToCreature(); - if (!cr_questgiver->IsHostileTo(_player)) // not show quest status to enemies + if (!cr_questgiver->IsHostileTo(_player)) // do not show quest status to enemies { questStatus = sScriptMgr->GetDialogStatus(_player, cr_questgiver); if (questStatus > 6) @@ -112,17 +112,17 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data) void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) { uint64 guid; - uint32 quest; + uint32 questId; uint32 unk1; - recv_data >> guid >> quest >> unk1; + recv_data >> guid >> questId >> unk1; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_ACCEPT_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), quest, unk1); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_ACCEPT_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), questId, unk1); - Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT|TYPEMASK_ITEM|TYPEMASK_PLAYER); + Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT|TYPEMASK_ITEM|TYPEMASK_PLAYER); // no or incorrect quest giver - if (!pObject || (pObject->GetTypeId() != TYPEID_PLAYER && !pObject->hasQuest(quest)) || - (pObject->GetTypeId() == TYPEID_PLAYER && !pObject->ToPlayer()->CanShareQuest(quest))) + if (!object || (object->GetTypeId() != TYPEID_PLAYER && !object->hasQuest(questId)) || + (object->GetTypeId() == TYPEID_PLAYER && !object->ToPlayer()->CanShareQuest(questId))) { _player->PlayerTalkClass->SendCloseGossip(); _player->SetDivider(0); @@ -130,14 +130,13 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) } // some kind of WPE protection - if (!_player->CanInteractWithQuestGiver(pObject)) + if (!_player->CanInteractWithQuestGiver(object)) return; - Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest); - if (qInfo) + if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) { // prevent cheating - if (!GetPlayer()->CanTakeQuest(qInfo, true)) + if (!GetPlayer()->CanTakeQuest(quest, true)) { _player->PlayerTalkClass->SendCloseGossip(); _player->SetDivider(0); @@ -154,11 +153,11 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) } } - if (_player->CanAddQuest(qInfo, true)) + if (_player->CanAddQuest(quest, true)) { - _player->AddQuest(qInfo, pObject); + _player->AddQuest(quest, object); - if (qInfo->HasFlag(QUEST_FLAGS_PARTY_ACCEPT)) + if (quest->HasFlag(QUEST_FLAGS_PARTY_ACCEPT)) { if (Group* group = _player->GetGroup()) { @@ -169,38 +168,38 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) if (!player || player == _player) // not self continue; - if (player->CanTakeQuest(qInfo, true)) + if (player->CanTakeQuest(quest, true)) { player->SetDivider(_player->GetGUID()); //need confirmation that any gossip window will close player->PlayerTalkClass->SendCloseGossip(); - _player->SendQuestConfirmAccept(qInfo, player); + _player->SendQuestConfirmAccept(quest, player); } } } } - if (_player->CanCompleteQuest(quest)) - _player->CompleteQuest(quest); + if (_player->CanCompleteQuest(questId)) + _player->CompleteQuest(questId); - switch (pObject->GetTypeId()) + switch (object->GetTypeId()) { case TYPEID_UNIT: - sScriptMgr->OnQuestAccept(_player, (pObject->ToCreature()), qInfo); - (pObject->ToCreature())->AI()->sQuestAccept(_player, qInfo); + sScriptMgr->OnQuestAccept(_player, (object->ToCreature()), quest); + (object->ToCreature())->AI()->sQuestAccept(_player, quest); break; case TYPEID_ITEM: case TYPEID_CONTAINER: { - sScriptMgr->OnQuestAccept(_player, ((Item*)pObject), qInfo); + sScriptMgr->OnQuestAccept(_player, ((Item*)object), quest); // destroy not required for quest finish quest starting item bool destroyItem = true; for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { - if ((qInfo->RequiredItemId[i] == ((Item*)pObject)->GetEntry()) && (((Item*)pObject)->GetTemplate()->MaxCount > 0)) + if ((quest->RequiredItemId[i] == ((Item*)object)->GetEntry()) && (((Item*)object)->GetTemplate()->MaxCount > 0)) { destroyItem = false; break; @@ -208,21 +207,21 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) } if (destroyItem) - _player->DestroyItem(((Item*)pObject)->GetBagSlot(), ((Item*)pObject)->GetSlot(), true); + _player->DestroyItem(((Item*)object)->GetBagSlot(), ((Item*)object)->GetSlot(), true); break; } case TYPEID_GAMEOBJECT: - sScriptMgr->OnQuestAccept(_player, ((GameObject*)pObject), qInfo); - (pObject->ToGameObject())->AI()->QuestAccept(_player, qInfo); + sScriptMgr->OnQuestAccept(_player, ((GameObject*)object), quest); + (object->ToGameObject())->AI()->QuestAccept(_player, quest); break; default: break; } _player->PlayerTalkClass->SendCloseGossip(); - if (qInfo->GetSrcSpell() > 0) - _player->CastSpell(_player, qInfo->GetSrcSpell(), true); + if (quest->GetSrcSpell() > 0) + _player->CastSpell(_player, quest->GetSrcSpell(), true); return; } @@ -247,8 +246,7 @@ void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket & recv_data) return; } - Quest const* quest = sObjectMgr->GetQuestTemplate(questId); - if (quest) + if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) { // not sure here what should happen to quests with QUEST_FLAGS_AUTOCOMPLETE // if this breaks them, add && object->GetTypeId() == TYPEID_ITEM to this check @@ -275,15 +273,12 @@ void WorldSession::HandleQuestQueryOpcode(WorldPacket & recv_data) if (!_player) return; - uint32 quest; - recv_data >> quest; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_QUERY quest = %u", quest); + uint32 questId; + recv_data >> questId; + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_QUERY quest = %u", questId); - Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest); - if (pQuest) - { - _player->PlayerTalkClass->SendQuestQueryResponse(pQuest); - } + if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) + _player->PlayerTalkClass->SendQuestQueryResponse(quest); } void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data) @@ -372,28 +367,28 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data) void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket & recv_data) { - uint32 quest; + uint32 questId; uint64 guid; - recv_data >> guid >> quest; + recv_data >> guid >> questId; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc = %u, quest = %u", uint32(GUID_LOPART(guid)), quest); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc = %u, quest = %u", uint32(GUID_LOPART(guid)), questId); - Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); - if (!pObject || !pObject->hasInvolvedQuest(quest)) + Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); + if (!object || !object->hasInvolvedQuest(questId)) return; // some kind of WPE protection - if (!_player->CanInteractWithQuestGiver(pObject)) + if (!_player->CanInteractWithQuestGiver(object)) return; - if (_player->CanCompleteQuest(quest)) - _player->CompleteQuest(quest); + if (_player->CanCompleteQuest(questId)) + _player->CompleteQuest(questId); - if (_player->GetQuestStatus(quest) != QUEST_STATUS_COMPLETE) + if (_player->GetQuestStatus(questId) != QUEST_STATUS_COMPLETE) return; - if (Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest)) - _player->PlayerTalkClass->SendQuestGiverOfferReward(pQuest, guid, true); + if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) + _player->PlayerTalkClass->SendQuestGiverOfferReward(quest, guid, true); } void WorldSession::HandleQuestgiverCancel(WorldPacket& /*recv_data*/) @@ -425,22 +420,22 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data) if (slot < MAX_QUEST_LOG_SIZE) { - if (uint32 quest = _player->GetQuestSlotQuestId(slot)) + if (uint32 questId = _player->GetQuestSlotQuestId(slot)) { - if (!_player->TakeQuestSourceItem(quest, true)) + if (!_player->TakeQuestSourceItem(questId, true)) return; // can't un-equip some items, reject quest cancel - if (const Quest *pQuest = sObjectMgr->GetQuestTemplate(quest)) + if (const Quest *quest = sObjectMgr->GetQuestTemplate(questId)) { - if (pQuest->HasFlag(QUEST_TRINITY_FLAGS_TIMED)) - _player->RemoveTimedQuest(quest); + if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED)) + _player->RemoveTimedQuest(questId); } - _player->TakeQuestSourceItem(quest, true); // remove quest src item from player - _player->RemoveActiveQuest(quest); - _player->GetAchievementMgr().RemoveTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, quest); + _player->TakeQuestSourceItem(questId, true); // remove quest src item from player + _player->RemoveActiveQuest(questId); + _player->GetAchievementMgr().RemoveTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, questId); - sLog->outDetail("Player %u abandoned quest %u", _player->GetGUIDLow(), quest); + sLog->outDetail("Player %u abandoned quest %u", _player->GetGUIDLow(), questId); } _player->SetQuestSlot(slot, 0); @@ -451,14 +446,14 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data) void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data) { - uint32 quest; - recv_data >> quest; + uint32 questId; + recv_data >> questId; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT quest = %u", quest); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT quest = %u", questId); - if (const Quest* pQuest = sObjectMgr->GetQuestTemplate(quest)) + if (const Quest* quest = sObjectMgr->GetQuestTemplate(questId)) { - if (!pQuest->HasFlag(QUEST_FLAGS_PARTY_ACCEPT)) + if (!quest->HasFlag(QUEST_FLAGS_PARTY_ACCEPT)) return; Player* pOriginalPlayer = ObjectAccessor::FindPlayer(_player->GetDivider()); @@ -466,7 +461,7 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data) if (!pOriginalPlayer) return; - if (pQuest->IsRaidQuest()) + if (quest->IsRaidQuest()) { if (!_player->IsInSameRaidWith(pOriginalPlayer)) return; @@ -477,8 +472,8 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data) return; } - if (_player->CanAddQuest(pQuest, true)) - _player->AddQuest(pQuest, NULL); // NULL, this prevent DB script from duplicate running + if (_player->CanAddQuest(quest, true)) + _player->AddQuest(quest, NULL); // NULL, this prevent DB script from duplicate running _player->SetDivider(0); } @@ -486,48 +481,48 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data) void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recv_data) { - uint32 quest; + uint32 questId; uint64 guid; - recv_data >> guid >> quest; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, quest = %u", uint32(GUID_LOPART(guid)), quest); + recv_data >> guid >> questId; - Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); - if (!pObject || !pObject->hasInvolvedQuest(quest)) + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, quest = %u", uint32(GUID_LOPART(guid)), questId); + + Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); + if (!object || !object->hasInvolvedQuest(questId)) return; // some kind of WPE protection - if (!_player->CanInteractWithQuestGiver(pObject)) + if (!_player->CanInteractWithQuestGiver(object)) return; - Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest); - if (pQuest) + if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) { - if (!_player->CanSeeStartQuest(pQuest) && _player->GetQuestStatus(quest)==QUEST_STATUS_NONE) + if (!_player->CanSeeStartQuest(quest) && _player->GetQuestStatus(questId) == QUEST_STATUS_NONE) { sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to complete quest [entry: %u] without being in possession of the quest!", - _player->GetName(), _player->GetGUIDLow(), quest); + _player->GetName(), _player->GetGUIDLow(), questId); return; } // TODO: need a virtual function if (_player->InBattleground()) if (Battleground* bg = _player->GetBattleground()) if (bg->GetTypeID() == BATTLEGROUND_AV) - ((BattlegroundAV*)bg)->HandleQuestComplete(quest, _player); + ((BattlegroundAV*)bg)->HandleQuestComplete(questId, _player); - if (_player->GetQuestStatus(quest) != QUEST_STATUS_COMPLETE) + if (_player->GetQuestStatus(questId) != QUEST_STATUS_COMPLETE) { - if (pQuest->IsRepeatable()) - _player->PlayerTalkClass->SendQuestGiverRequestItems(pQuest, guid, _player->CanCompleteRepeatableQuest(pQuest), false); + if (quest->IsRepeatable()) + _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, guid, _player->CanCompleteRepeatableQuest(quest), false); else - _player->PlayerTalkClass->SendQuestGiverRequestItems(pQuest, guid, _player->CanRewardQuest(pQuest, false), false); + _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, guid, _player->CanRewardQuest(quest, false), false); } else { - if (pQuest->GetReqItemsCount()) // some items required - _player->PlayerTalkClass->SendQuestGiverRequestItems(pQuest, guid, _player->CanRewardQuest(pQuest, false), false); + if (quest->GetReqItemsCount()) // some items required + _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, guid, _player->CanRewardQuest(quest, false), false); else // no items required - _player->PlayerTalkClass->SendQuestGiverOfferReward(pQuest, guid, true); + _player->PlayerTalkClass->SendQuestGiverOfferReward(quest, guid, true); } } } @@ -544,7 +539,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PUSHQUESTTOPARTY quest = %u", questId); - if (Quest const* pQuest = sObjectMgr->GetQuestTemplate(questId)) + if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) { if (Group* group = _player->GetGroup()) { @@ -557,7 +552,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) _player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_SHARING_QUEST); - if (!player->SatisfyQuestStatus(pQuest, false)) + if (!player->SatisfyQuestStatus(quest, false)) { _player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_HAVE_QUEST); continue; @@ -569,7 +564,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) continue; } - if (!player->CanTakeQuest(pQuest, false)) + if (!player->CanTakeQuest(quest, false)) { _player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_CANT_TAKE_QUEST); continue; @@ -587,7 +582,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) continue; } - player->PlayerTalkClass->SendQuestGiverQuestDetails(pQuest, _player->GetGUID(), true); + player->PlayerTalkClass->SendQuestGiverQuestDetails(quest, _player->GetGUID(), true); player->SetDivider(_player->GetGUID()); } } @@ -647,18 +642,18 @@ uint32 WorldSession::getDialogStatus(Player* player, Object* questgiver, uint32 { uint32 result2 = 0; uint32 quest_id = i->second; - Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id); - if (!pQuest) continue; + Quest const* quest = sObjectMgr->GetQuestTemplate(quest_id); + if (!quest) continue; - ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, pQuest->GetQuestId()); + ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, quest->GetQuestId()); if (!sConditionMgr->IsObjectMeetToConditions(player, conditions)) continue; QuestStatus status = player->GetQuestStatus(quest_id); if ((status == QUEST_STATUS_COMPLETE && !player->GetQuestRewardStatus(quest_id)) || - (pQuest->IsAutoComplete() && player->CanTakeQuest(pQuest, false))) + (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))) { - if (pQuest->IsAutoComplete() && pQuest->IsRepeatable()) + if (quest->IsAutoComplete() && quest->IsRepeatable()) result2 = DIALOG_STATUS_REWARD_REP; else result2 = DIALOG_STATUS_REWARD; @@ -674,26 +669,26 @@ uint32 WorldSession::getDialogStatus(Player* player, Object* questgiver, uint32 { uint32 result2 = 0; uint32 quest_id = i->second; - Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id); - if (!pQuest) + Quest const* quest = sObjectMgr->GetQuestTemplate(quest_id); + if (!quest) continue; - ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, pQuest->GetQuestId()); + ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, quest->GetQuestId()); if (!sConditionMgr->IsObjectMeetToConditions(player, conditions)) continue; QuestStatus status = player->GetQuestStatus(quest_id); if (status == QUEST_STATUS_NONE) { - if (player->CanSeeStartQuest(pQuest)) + if (player->CanSeeStartQuest(quest)) { - if (player->SatisfyQuestLevel(pQuest, false)) + if (player->SatisfyQuestLevel(quest, false)) { - if (pQuest->IsAutoComplete() || (pQuest->IsRepeatable() && player->IsQuestRewarded(quest_id))) + if (quest->IsAutoComplete() || (quest->IsRepeatable() && player->IsQuestRewarded(quest_id))) result2 = DIALOG_STATUS_REWARD_REP; - else if (player->getLevel() <= ((player->GetQuestLevel(pQuest) == -1) ? player->getLevel() : player->GetQuestLevel(pQuest) + sWorld->getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF))) + else if (player->getLevel() <= ((player->GetQuestLevel(quest) == -1) ? player->getLevel() : player->GetQuestLevel(quest) + sWorld->getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF))) { - if (pQuest->HasFlag(QUEST_FLAGS_DAILY) || pQuest->HasFlag(QUEST_FLAGS_WEEKLY)) + if (quest->HasFlag(QUEST_FLAGS_DAILY) || quest->HasFlag(QUEST_FLAGS_WEEKLY)) result2 = DIALOG_STATUS_AVAILABLE_REP; else result2 = DIALOG_STATUS_AVAILABLE; diff --git a/src/server/game/Handlers/SkillHandler.cpp b/src/server/game/Handlers/SkillHandler.cpp index 355effba0c6..f9731ba85db 100755 --- a/src/server/game/Handlers/SkillHandler.cpp +++ b/src/server/game/Handlers/SkillHandler.cpp @@ -90,4 +90,3 @@ void WorldSession::HandleUnlearnSkillOpcode(WorldPacket & recv_data) recv_data >> skill_id; GetPlayer()->SetSkill(skill_id, 0, 0, 0); } - diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp index 44889e6dda8..b774fbcba70 100755 --- a/src/server/game/Handlers/TaxiHandler.cpp +++ b/src/server/game/Handlers/TaxiHandler.cpp @@ -103,7 +103,7 @@ void WorldSession::SendTaxiMenu(Creature* unit) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_TAXINODE_STATUS_QUERY %u ", curloc); - WorldPacket data(SMSG_SHOWTAXINODES, (4+8+4+8*4)); + WorldPacket data(SMSG_SHOWTAXINODES, (4 + 8 + 4 + 8 * 4)); data << uint32(1); data << uint64(unit->GetGUID()); data << uint32(curloc); diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index 4c39992f344..17617c399e4 100755 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -546,15 +546,12 @@ void WorldSession::HandleCancelTradeOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) { - if (GetPlayer()->m_trade) - { - recvPacket.rfinish(); - return; - } - uint64 ID; recvPacket >> ID; + if (GetPlayer()->m_trade) + return; + if (!GetPlayer()->isAlive()) { SendTradeStatus(TRADE_STATUS_YOU_DEAD); @@ -728,4 +725,3 @@ void WorldSession::HandleClearTradeItemOpcode(WorldPacket& recvPacket) my_trade->SetItem(TradeSlots(tradeSlot), NULL); } - diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index 722b7089a17..557977f9468 100755 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -639,4 +639,4 @@ uint32 InstanceSaveManager::GetNumBoundGroupsTotal() ret += itr->second->GetGroupCount(); return ret; -} \ No newline at end of file +} diff --git a/src/server/game/Mails/Mail.h b/src/server/game/Mails/Mail.h index 6615d59160a..dbd03bd96ee 100755 --- a/src/server/game/Mails/Mail.h +++ b/src/server/game/Mails/Mail.h @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ + #ifndef TRINITY_MAIL_H #define TRINITY_MAIL_H diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp index 9f6ec547342..465fca75030 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp @@ -436,20 +436,20 @@ void OutdoorPvP::HandleKill(Player* killer, Unit* killed) { for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { - Player* pGroupGuy = itr->getSource(); + Player* groupGuy = itr->getSource(); - if (!pGroupGuy) + if (!groupGuy) continue; // skip if too far away - if (!pGroupGuy->IsAtGroupRewardDistance(killed)) + if (!groupGuy->IsAtGroupRewardDistance(killed)) continue; // creature kills must be notified, even if not inside objective / not outdoor pvp active // player kills only count if active and inside objective - if ((pGroupGuy->IsOutdoorPvPActive() && IsInsideObjective(pGroupGuy)) || killed->GetTypeId() == TYPEID_UNIT) + if ((groupGuy->IsOutdoorPvPActive() && IsInsideObjective(groupGuy)) || killed->GetTypeId() == TYPEID_UNIT) { - HandleKillImpl(pGroupGuy, killed); + HandleKillImpl(groupGuy, killed); } } } diff --git a/src/server/game/Scripting/ScriptLoader.h b/src/server/game/Scripting/ScriptLoader.h index 409b3db4b7f..0db6917a0d4 100644 --- a/src/server/game/Scripting/ScriptLoader.h +++ b/src/server/game/Scripting/ScriptLoader.h @@ -1,6 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software licensed under GPL version 2 -* Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ #ifndef SC_SCRIPTLOADER_H #define SC_SCRIPTLOADER_H diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp index 56d3109a6a0..65e855cd887 100755 --- a/src/server/game/Scripting/ScriptSystem.cpp +++ b/src/server/game/Scripting/ScriptSystem.cpp @@ -79,7 +79,8 @@ void SystemMgr::LoadScriptTexts() m_mTextDataMap[iId] = temp; ++uiCount; - } while (result->NextRow()); + } + while (result->NextRow()); sLog->outString(">> Loaded %u additional Script Texts data in %u ms", uiCount, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); @@ -140,7 +141,8 @@ void SystemMgr::LoadScriptTextsCustom() m_mTextDataMap[iId] = temp; ++uiCount; - } while (result->NextRow()); + } + while (result->NextRow()); sLog->outString(">> Loaded %u additional Custom Texts data.", uiCount); sLog->outString(); @@ -199,7 +201,8 @@ void SystemMgr::LoadScriptWaypoints() m_mPointMoveMap[uiEntry].push_back(temp); ++count; - } while (result->NextRow()); + } + while (result->NextRow()); sLog->outString(">> Loaded %u Script Waypoint nodes in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); diff --git a/src/server/game/Scripting/ScriptSystem.h b/src/server/game/Scripting/ScriptSystem.h index daa7fe0d596..cf6332b22f2 100644 --- a/src/server/game/Scripting/ScriptSystem.h +++ b/src/server/game/Scripting/ScriptSystem.h @@ -4,6 +4,7 @@ #ifndef SC_SYSTEM_H #define SC_SYSTEM_H + #include #define TEXT_SOURCE_RANGE -1000000 //the amount of entries each text source has available diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 81a37ece4f9..775b832d79a 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -26,7 +26,7 @@ #include "Common.h" // Note: this include need for be sure have full definition of class WorldSession -// if this class definition not complite then VS for x64 release use different size for +// if this class definition not complete then VS for x64 release use different size for // struct OpcodeHandler in this header and Opcode.cpp and get totally wrong data from // table opcodeTable in source when Opcode.h included but WorldSession.h not included #include "WorldSession.h" diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 48fa95ff6a5..c88c5c6e087 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -47,7 +47,7 @@ bool MapSessionFilter::Process(WorldPacket* packet) { - OpcodeHandler const &opHandle = opcodeTable[packet->GetOpcode()]; + OpcodeHandler const& opHandle = opcodeTable[packet->GetOpcode()]; //let's check if our opcode can be really processed in Map::Update() if (opHandle.packetProcessing == PROCESS_INPLACE) @@ -69,7 +69,7 @@ bool MapSessionFilter::Process(WorldPacket* packet) //OR packet handler is not thread-safe! bool WorldSessionFilter::Process(WorldPacket* packet) { - OpcodeHandler const &opHandle = opcodeTable[packet->GetOpcode()]; + OpcodeHandler const& opHandle = opcodeTable[packet->GetOpcode()]; //check if packet handler is supposed to be safe if (opHandle.packetProcessing == PROCESS_INPLACE) return true; @@ -105,7 +105,7 @@ isRecruiter(isARecruiter), timeLastWhoCommand(0) m_Address = sock->GetRemoteAddress(); sock->AddReference(); ResetTimeOutTime(); - LoginDatabase.PExecute("UPDATE account SET online = 1 WHERE id = %u;", GetAccountId()); // One-time query + LoginDatabase.PExecute("UPDATE account SET online = 1 WHERE id = %u;", GetAccountId()); } InitializeQueryCallbackParameters(); @@ -134,10 +134,10 @@ WorldSession::~WorldSession() while (_recvQueue.next(packet)) delete packet; - LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId()); // One-time query + LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId()); } -void WorldSession::SizeError(WorldPacket const &packet, uint32 size) const +void WorldSession::SizeError(WorldPacket const& packet, uint32 size) const { sLog->outError("Client (account %u) send packet %s (%u) with size " SIZEFMTD " but expected %u (attempt to crash server?), skipped", GetAccountId(), LookupOpcodeName(packet.GetOpcode()), packet.GetOpcode(), packet.size(), size); @@ -345,7 +345,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) break; } } - catch (ByteBufferException &) + catch(ByteBufferException &) { sLog->outError("WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i. Skipped packet.", packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId()); @@ -896,7 +896,7 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data) ByteBuffer addonInfo; addonInfo.resize(size); - if (uncompress(const_cast(addonInfo.contents()), &uSize, const_cast(data.contents() + pos), data.size() - pos) == Z_OK) + if (uncompress(const_cast(addonInfo.contents()), &uSize, const_cast(data.contents() + pos), data.size() - pos) == Z_OK) { uint32 addonsCount; addonInfo >> addonsCount; // addons count diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index a18067ff612..0fce0a372ff 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -294,7 +294,7 @@ class WorldSession void SendAttackStop(Unit const* enemy); - void SendBattlegGroundList(uint64 guid, BattlegroundTypeId bgTypeId); + void SendBattleGroundList(uint64 guid, BattlegroundTypeId bgTypeId); void SendTradeStatus(TradeStatus status); void SendUpdateTrade(bool trader_data = true); diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp index 466d3ac83a2..3ece4b57741 100755 --- a/src/server/game/Skills/SkillDiscovery.cpp +++ b/src/server/game/Skills/SkillDiscovery.cpp @@ -132,7 +132,8 @@ void LoadSkillDiscoveryTable() } ++count; - } while (result->NextRow()); + } + while (result->NextRow()); if (!ssNonDiscoverableEntries.str().empty()) sLog->outErrorDb("Some items can't be successfully discovered: have in chance field value < 0.000001 in `skill_discovery_template` DB table . List:\n%s", ssNonDiscoverableEntries.str().c_str()); @@ -246,4 +247,3 @@ uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player) return 0; } - diff --git a/src/server/game/Skills/SkillDiscovery.h b/src/server/game/Skills/SkillDiscovery.h index 110adb91cf2..ba5542e0189 100755 --- a/src/server/game/Skills/SkillDiscovery.h +++ b/src/server/game/Skills/SkillDiscovery.h @@ -28,4 +28,3 @@ uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player); bool HasDiscoveredAllSpells(uint32 spellId, Player* player); uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player); #endif - diff --git a/src/server/game/Skills/SkillExtraItems.cpp b/src/server/game/Skills/SkillExtraItems.cpp index b5b6b5d7b96..c68e3cdcfe0 100755 --- a/src/server/game/Skills/SkillExtraItems.cpp +++ b/src/server/game/Skills/SkillExtraItems.cpp @@ -138,4 +138,3 @@ bool canCreateExtraItems(Player* player, uint32 spellId, float &additionalChance // enable extra item creation return true; } - diff --git a/src/server/game/Skills/SkillExtraItems.h b/src/server/game/Skills/SkillExtraItems.h index c4e20b9fbef..0cf49021e1c 100755 --- a/src/server/game/Skills/SkillExtraItems.h +++ b/src/server/game/Skills/SkillExtraItems.h @@ -28,4 +28,3 @@ bool canCreateExtraItems(Player* player, uint32 spellId, float &additionalChance // function to load the extra item creation info from DB void LoadSkillExtraItemTable(); #endif - diff --git a/src/server/game/Weather/Weather.h b/src/server/game/Weather/Weather.h index 0c17cfd1efe..dadd1151a53 100755 --- a/src/server/game/Weather/Weather.h +++ b/src/server/game/Weather/Weather.h @@ -89,4 +89,3 @@ class Weather WeatherData const* m_weatherChances; }; #endif - diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp index 6eb306b52af..1db4fb4dfc9 100755 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp @@ -244,7 +244,6 @@ void OPvPCapturePointEP_NPT::ChangeState() // complete quest objective if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H) SendObjectiveComplete(EP_NPT_CM, 0); - } void OPvPCapturePointEP_NPT::SendChangePhase() diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h index e019ba7ed7b..14712e0150d 100755 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h @@ -329,4 +329,3 @@ class OutdoorPvPEP : public OutdoorPvP }; #endif - diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp index 5b3468de203..38fed30f542 100755 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp @@ -176,7 +176,6 @@ OutdoorPvPZM::OutdoorPvPZM() m_GraveYard = NULL; m_AllianceTowersControlled = 0; m_HordeTowersControlled = 0; - } bool OutdoorPvPZM::SetupOutdoorPvP() From c9b6d736158d2bdccc71a6d7802e00b5e6a5604d Mon Sep 17 00:00:00 2001 From: kandera Date: Fri, 9 Mar 2012 09:18:34 -0500 Subject: [PATCH 0139/1149] Core/Player: Fix auras getting applied on water walk --- src/server/game/Entities/Player/Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 127b45e1739..92a21dfb52c 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -23076,7 +23076,7 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z) if (liquid && liquid->SpellId) { - if (res & (LIQUID_MAP_UNDER_WATER | LIQUID_MAP_IN_WATER | LIQUID_MAP_WATER_WALK)) + if (res & (LIQUID_MAP_UNDER_WATER | LIQUID_MAP_IN_WATER)) CastSpell(this, liquid->SpellId, this); else RemoveAurasDueToSpell(liquid->SpellId); From 593d003b7c930ce91157bf8189286a818f9fdd09 Mon Sep 17 00:00:00 2001 From: click Date: Fri, 9 Mar 2012 21:53:47 +0100 Subject: [PATCH 0140/1149] Core. Fix non-PCH build --- src/server/shared/Cryptography/BigNumber.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/shared/Cryptography/BigNumber.cpp b/src/server/shared/Cryptography/BigNumber.cpp index 146ea778f48..364ee76ec75 100755 --- a/src/server/shared/Cryptography/BigNumber.cpp +++ b/src/server/shared/Cryptography/BigNumber.cpp @@ -16,6 +16,8 @@ * with this program. If not, see . */ +#include + #include "Cryptography/BigNumber.h" #include #include From 7c42cd76e44d416b091aa98d9fa31f2cfd0759a8 Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 9 Mar 2012 17:15:22 -0500 Subject: [PATCH 0141/1149] Core/Conditions: Prevent crash at Spell::CheckCast if Condition::Meets returned prematurely --- src/server/game/Spells/Spell.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 65ab9444f58..a804c5b1b90 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4784,14 +4784,15 @@ SpellCastResult Spell::CheckCast(bool strict) // TODO: using WorldSession::SendNotification is not blizzlike if (Player* playerCaster = m_caster->ToPlayer()) { - if (playerCaster->GetSession() + // mLastFailedCondition can be NULL if there was an error processing the condition in Condition::Meets (i.e. wrong data for ConditionTarget or others) + if (playerCaster->GetSession() && condInfo.mLastFailedCondition && condInfo.mLastFailedCondition->ErrorTextId) { playerCaster->GetSession()->SendNotification(condInfo.mLastFailedCondition->ErrorTextId); return SPELL_FAILED_DONT_REPORT; } } - if (!condInfo.mLastFailedCondition->ConditionTarget) + if (!condInfo.mLastFailedCondition || !condInfo.mLastFailedCondition->ConditionTarget) return SPELL_FAILED_CASTER_AURASTATE; return SPELL_FAILED_BAD_TARGETS; } From 0ad6238a969c4bcb7e5d17148c07850c1c91429c Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 10 Mar 2012 06:37:15 -0330 Subject: [PATCH 0142/1149] DB/SAI,Waypoints,creature: Some updates for Silvermoon City --- .../world/2012_03_10_00_world_creature.sql | 21 +++ .../world/2012_03_10_00_world_smart_scripts | 129 ++++++++++++++++++ .../2012_03_10_00_world_waypoint_data.sql | 25 ++++ 3 files changed, 175 insertions(+) create mode 100644 sql/updates/world/2012_03_10_00_world_creature.sql create mode 100644 sql/updates/world/2012_03_10_00_world_smart_scripts create mode 100644 sql/updates/world/2012_03_10_00_world_waypoint_data.sql diff --git a/sql/updates/world/2012_03_10_00_world_creature.sql b/sql/updates/world/2012_03_10_00_world_creature.sql new file mode 100644 index 00000000000..3a0f9dbda58 --- /dev/null +++ b/sql/updates/world/2012_03_10_00_world_creature.sql @@ -0,0 +1,21 @@ +-- Add some missing guids +SET @GUID := 42153; +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+4; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@GUID,32666,530,1,0,0,0,9830.201,-7389.711,13.68803,5.532694,120,0,0,1,0,0), +(@GUID+1,32667,530,1,0,0,0,9859.044,-7406.975,13.7113,1.658063,120,0,0,1,0,0), +(@GUID+2,31144,530,1,0,0,0,9869.401,-7389.657,13.69022,3.90953755,120,0,0,1,0,0), +(@GUID+3,31144,530,1,0,0,0,9871.973,-7392.763,13.6818113,3.35103226,120,0,0,1,0,0), +(@GUID+4,31146,530,1,0,0,0,9850.529,-7395.442,13.72216,4.694936,120,0,0,1,0,0); +-- Addons +DELETE FROM `creature_addon` WHERE `guid` BETWEEN @GUID AND @GUID+4; +DELETE FROM `creature_addon` WHERE `guid`=66686; +INSERT INTO `creature_addon` (`guid`,`bytes2`,`auras`) VALUES +(@GUID,1, '7056 61573'), +(@GUID+1,1, '7056 61573'), +(@GUID+2,1, '7056 61573'), +(@GUID+3,1, '7056 61573'), +(@GUID+4,1, '7056 61573'), +(66686,1, '7056'); +-- convert npc to trigger +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128 WHERE `entry`=18504; diff --git a/sql/updates/world/2012_03_10_00_world_smart_scripts b/sql/updates/world/2012_03_10_00_world_smart_scripts new file mode 100644 index 00000000000..aaa02c2e3df --- /dev/null +++ b/sql/updates/world/2012_03_10_00_world_smart_scripts @@ -0,0 +1,129 @@ +-- SAI for Champion Vranesh +SET @ENTRY=18146; +UPDATE `creature` SET `position_x`=9834.044,`position_y`=-7480.845,`position_z`=14.93467 WHERE `id`=@ENTRY; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +UPDATE `creature_template_addon` SET `mount`=0 WHERE `entry`=@ENTRY; -- 19085 +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (@ENTRY*100,@ENTRY*100+1,@ENTRY*100+2,@ENTRY*100+3,@ENTRY*100+4); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +-- AI +(@ENTRY,0,0,0,11,0,100,1,0,0,0,0,53,0,@ENTRY,1,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On respawn - load path'), +(@ENTRY,0,1,2,40,0,100,0,7,@ENTRY,0,0,54,6000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Pause Path'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Run Script'), +(@ENTRY,0,3,4,40,0,100,0,11,@ENTRY,0,0,54,1000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Pause Path'), +(@ENTRY,0,4,0,61,0,100,0,0,0,0,0,80,@ENTRY*100+1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Run Script'), +(@ENTRY,0,5,6,40,0,100,0,25,@ENTRY,0,0,54,8000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Pause Path'), +(@ENTRY,0,6,0,61,0,100,0,0,0,0,0,80,@ENTRY*100+2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Run Script'), +(@ENTRY,0,7,8,40,0,100,0,34,@ENTRY,0,0,54,8000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Pause Path'), +(@ENTRY,0,8,0,61,0,100,0,0,0,0,0,80,@ENTRY*100+3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Run Script'), +(@ENTRY,0,9,10,40,0,100,0,50,@ENTRY,0,0,54,7000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Pause Path'), +(@ENTRY,0,10,0,61,0,100,0,0,0,0,0,80,@ENTRY*100+4,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Run Script'), +(@ENTRY,0,11,0,40,0,100,0,57,@ENTRY,0,0,54,600000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Pause Path'), +-- Script 0 +(@ENTRY*100,9,0,0,0,0,100,0,3500,3500,3500,3500,5,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - Script 0 - emote bow'), +-- Script 1 +(@ENTRY*100+1,9,0,0,0,0,100,0,100,100,100,100,43,0,19085,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - Script 1 - mount horse'), +(@ENTRY*100+1,9,1,0,0,0,100,0,100,100,100,100,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - Script 1 - say 0'), +(@ENTRY*100+1,9,2,0,0,0,100,0,100,100,100,100,5,16,0,0,0,0,0,11,16222,10,0,0,0,0,0,'Champion Vranesh - Script 1 - Silvermoon City Guardian emote bow'), +(@ENTRY*100+1,9,3,0,0,0,100,0,100,100,100,100,1,0,0,0,0,0,0,19,16222,10,0,0,0,0,0,'Champion Vranesh - Script 1 - Silvermoon City Guardian say 0'), +-- Script 2 +(@ENTRY*100+2,9,0,0,0,0,100,0,3000,3000,3000,3000,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - Script 2 - say 1'), +(@ENTRY*100+2,9,1,0,0,0,100,0,100,100,100,100,5,16,0,0,0,0,0,11,16222,18,0,0,0,0,0,'Champion Vranesh - Script 2 - Silvermoon City Guardian emote bow'), +(@ENTRY*100+2,9,2,0,0,0,100,0,100,100,100,100,1,1,0,0,0,0,0,19,16222,18,0,0,0,0,0,'Champion Vranesh - Script 2 - Silvermoon City Guardian say 1'), +-- Script 3 +(@ENTRY*100+3,9,0,0,0,0,100,0,3000,3000,3000,3000,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - Script 3 - say 2'), +(@ENTRY*100+3,9,1,0,0,0,100,0,100,100,100,100,5,16,0,0,0,0,0,11,16222,30,0,0,0,0,0,'Champion Vranesh - Script 3 - Silvermoon City Guardian emote bow'), +-- Script 4 +(@ENTRY*100+4,9,0,0,0,0,100,0,1000,1000,1000,1000,43,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - Script 4 - dismount horse'), +(@ENTRY*100+4,9,1,0,0,0,100,0,1000,1000,1000,1000,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - Script 3 - say 3'); + +-- NPC talk text for Champion Vranesh and Silvermoon City Guardian +DELETE FROM `creature_text` WHERE `entry` IN (@ENTRY,16222); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0, 'Champion Vranesh inclines his head slightly to the pair of guardians in greeting.',16,1,100,0,0,0, 'Champion Vranesh'), +(@ENTRY,1,0, 'Champion Vranesh arches a scrulpled brow at the guards. a disapproving scowl on his face',16,1,100,0,0,0, 'Champion Vranesh'), +(@ENTRY,2,0, 'Champion Vranesh glances from guard to guard.',16,1,100,0,0,0, 'Champion Vranesh'), +(@ENTRY,3,0, 'Champion Vranesh surveys the small ranger practice ground with a condescending smirk.',16,1,100,0,0,0, 'Champion Vranesh'), +(16222,0,0, 'Glory to the Sun K-- ah... Silvermoon!',12,1,100,0,0,0, 'Silvermoon City Guardian'), +(16222,1,0, 'Our lives are yours, Blood Knight.',12,1,100,0,0,0, 'Silvermoon City Guardian'); + +-- Pathing for Champion Vranesh +DELETE FROM `waypoints` WHERE `entry`=@ENTRY; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,9834.044,-7480.845,14.93467, 'Champion Vranesh'), +(@ENTRY,2,9829.106,-7493.609,14.93653, 'Champion Vranesh'), +(@ENTRY,3,9826.172,-7516.15,19.73714, 'Champion Vranesh'), +(@ENTRY,4,9841.332,-7518.849,19.70547, 'Champion Vranesh'), +(@ENTRY,5,9845.063,-7512.885,19.68096, 'Champion Vranesh'), +(@ENTRY,6,9850.942,-7512.470,19.71548, 'Champion Vranesh'), +(@ENTRY,7,9850.934,-7513.604,19.71813, 'Champion Vranesh'), -- pause 6000 +(@ENTRY,8,9872.733,-7517.256,19.75283, 'Champion Vranesh'), +(@ENTRY,9,9872.419,-7489.979,14.91272, 'Champion Vranesh'), +(@ENTRY,10,9851.401,-7490.209,14.93464, 'Champion Vranesh'), +(@ENTRY,11,9850.948,-7470.096,14.91403, 'Champion Vranesh'), -- pause 1000 +(@ENTRY,12,9851.16,-7469.154,14.91319, 'Champion Vranesh'), +(@ENTRY,13,9849.688,-7442.579,13.50931, 'Champion Vranesh'), +(@ENTRY,14,9848.726,-7423.561,13.31949, 'Champion Vranesh'), +(@ENTRY,15,9816.583,-7423.817,13.30332, 'Champion Vranesh'), +(@ENTRY,16,9794.673,-7424.877,13.50989, 'Champion Vranesh'), +(@ENTRY,17,9794.48,-7442.293,14.40225, 'Champion Vranesh'), +(@ENTRY,18,9767.989,-7442.611,14.39258, 'Champion Vranesh'), +(@ENTRY,19,9767.406,-7422.982,13.35852, 'Champion Vranesh'), +(@ENTRY,20,9739.563,-7422.83,13.28878, 'Champion Vranesh'), +(@ENTRY,21,9736.46,-7440.873,13.53963, 'Champion Vranesh'), +(@ENTRY,22,9740.345,-7464.682,13.57483, 'Champion Vranesh'), +(@ENTRY,23,9746.739,-7482.594,13.55744, 'Champion Vranesh'), +(@ENTRY,24,9748.767,-7486.576,13.54981, 'Champion Vranesh'), +(@ENTRY,25,9753.25,-7486.52,13.5461, 'Champion Vranesh'), -- pause 8000 +(@ENTRY,26,9720.037,-7486.478,13.52865, 'Champion Vranesh'), +(@ENTRY,27,9681.502,-7475.868,13.52783, 'Champion Vranesh'), +(@ENTRY,28,9666.59,-7479.547,13.53783, 'Champion Vranesh'), +(@ENTRY,29,9638.033,-7492.629,13.50889, 'Champion Vranesh'), +(@ENTRY,30,9620.123,-7488.486,13.53853, 'Champion Vranesh'), +(@ENTRY,31,9605.795,-7475.276,13.55774, 'Champion Vranesh'), +(@ENTRY,32,9597.921,-7460.307,13.54336, 'Champion Vranesh'), +(@ENTRY,33,9594.605,-7450.369,13.5353, 'Champion Vranesh'), +(@ENTRY,34,9592.944,-7450.381,13.53116, 'Champion Vranesh'), -- pause 8000 +(@ENTRY,35,9594.605,-7450.369,13.5353, 'Champion Vranesh'), +(@ENTRY,36,9615.793,-7419.515,13.30549, 'Champion Vranesh'), +(@ENTRY,37,9654.939,-7420.383,13.29342, 'Champion Vranesh'), +(@ENTRY,38,9673.072,-7429.818,13.2933, 'Champion Vranesh'), +(@ENTRY,39,9689.373,-7431.429,13.2933, 'Champion Vranesh'), +(@ENTRY,40,9709.577,-7422.25,13.2933, 'Champion Vranesh'), +(@ENTRY,41,9722.3,-7415.217,13.39988, 'Champion Vranesh'), +(@ENTRY,42,9748.049,-7414.597,13.32135, 'Champion Vranesh'), +(@ENTRY,43,9766.792,-7413.542,13.38617, 'Champion Vranesh'), +(@ENTRY,44,9767.26,-7396.828,14.43101, 'Champion Vranesh'), +(@ENTRY,45,9793.145,-7395.393,14.3936, 'Champion Vranesh'), +(@ENTRY,46,9794.217,-7415.122,13.48684, 'Champion Vranesh'), +(@ENTRY,47,9817.575,-7415.299,13.30596, 'Champion Vranesh'), +(@ENTRY,48,9837.021,-7414.861,13.30863, 'Champion Vranesh'), +(@ENTRY,49,9848.048,-7414.794,13.31137, 'Champion Vranesh'), +(@ENTRY,50,9848.199,-7414.07,13.31068, 'Champion Vranesh'), -- pause 7000 +(@ENTRY,51,9847.695,-7415.903,13.31243, 'Champion Vranesh'), +(@ENTRY,52,9848.259,-7428.576,13.33225, 'Champion Vranesh'), +(@ENTRY,53,9846.748,-7446.964,13.56501, 'Champion Vranesh'), +(@ENTRY,54,9850.373,-7465.03,14.9097, 'Champion Vranesh'), +(@ENTRY,55,9850.84,-7480.409,14.93768, 'Champion Vranesh'), +(@ENTRY,56,9840.165,-7480.267,14.92917, 'Champion Vranesh'), +(@ENTRY,57,9843.284,-7480.133,14.92655, 'Champion Vranesh'); -- pause 60000 + +-- SAI for Silvermoon Farstrider +SET @ENTRY=18507; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,25,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Silvermoon Farstrider - Reset - Set Phase 1'), +(@ENTRY,0,1,2,1,1,100,0,3000,3000,5000,5000,11,36802,0,0,0,0,0,1,0,0,0,0,0,0,0,'Silvermoon Farstrider - OOC - Cast Spell (Phase 1)'), +(@ENTRY,0,2,0,61,1,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Silvermoon Farstrider - OOC - Set Phase 2 (Phase 1)'), +(@ENTRY,0,3,4,1,2,100,0,3000,3000,5000,5000,11,36803,0,0,0,0,0,1,0,0,0,0,0,0,0,'Silvermoon Farstrider - OOC - Cast Spell (Phase 2)'), +(@ENTRY,0,4,0,61,2,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Silvermoon Farstrider - OOC - Set Phase 1 (Phase 2)'); +-- SAI for Silvermoon Ranger +SET @ENTRY=18147; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (-64950,-64951,-64952,-64953); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(-64950,0,0,0,1,0,100,0,18000,22000,18000,22000,11,29121,0,0,0,0,0,1,0,0,0,0,0,0,0,'Silvermoon Ranger - OOC - Cast Spell'), +(-64951,0,0,0,1,0,100,0,18000,22000,18000,22000,11,29121,0,0,0,0,0,1,0,0,0,0,0,0,0,'Silvermoon Ranger - OOC - Cast Spell'), +(-64952,0,0,0,1,0,100,0,18000,22000,18000,22000,11,29120,0,0,0,0,0,1,0,0,0,0,0,0,0,'Silvermoon Ranger - OOC - Cast Spell'), +(-64953,0,0,0,1,0,100,0,18000,22000,18000,22000,11,29122,0,0,0,0,0,1,0,0,0,0,0,0,0,'Silvermoon Ranger - OOC - Cast Spell'); diff --git a/sql/updates/world/2012_03_10_00_world_waypoint_data.sql b/sql/updates/world/2012_03_10_00_world_waypoint_data.sql new file mode 100644 index 00000000000..01c2bc50402 --- /dev/null +++ b/sql/updates/world/2012_03_10_00_world_waypoint_data.sql @@ -0,0 +1,25 @@ +-- Silvermoon City Guardian pathing +SET @NPC := 56902; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=9595.755,`position_y`=-7366.754,`position_z`=13.50131 WHERE `guid`=@NPC; +UPDATE `creature_addon` SET `path_id`=@PATH WHERE `guid`=@NPC; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,9595.755,-7366.754,13.50131,0,0,0,100,0), +(@PATH,2,9594.553,-7336.536,14.15131,0,0,0,100,0), +(@PATH,3,9586.897,-7325.241,14.1312,0,0,0,100,0), +(@PATH,4,9561.705,-7326.179,14.05934,0,0,0,100,0), +(@PATH,5,9519.901,-7327.064,14.12175,0,0,0,100,0), +(@PATH,6,9508.228,-7352.014,14.33403,0,0,0,100,0), +(@PATH,7,9505.697,-7394.406,14.32095,0,0,0,100,0), +(@PATH,8,9535.751,-7396.176,16.8303,0,0,0,100,0), +(@PATH,9,9564.451,-7396.184,16.84703,0,0,0,100,0), +(@PATH,10,9563.777,-7415.961,19.47212,0,0,0,100,0), +(@PATH,11,9559.149,-7418.953,19.47643,0,0,0,100,0), +(@PATH,12,9563.34,-7432.895,15.4851,0,0,0,100,0), +(@PATH,13,9564.645,-7464.229,15.51088,0,0,0,100,0), +(@PATH,14,9588.409,-7464.643,13.52051,0,0,0,100,0), +(@PATH,15,9603.896,-7430.126,13.30448,0,0,0,100,0), +(@PATH,16,9595.137,-7387.862,13.52731,0,0,0,100,0), +(@PATH,17,9572.599,-7384.971,14.39343,0,0,0,100,0), +(@PATH,18,9573.106,-7369.531,14.40827,0,0,0,100,0); From 73282f9789724e30f45c89b80bd26fc8e618e8b0 Mon Sep 17 00:00:00 2001 From: click Date: Sat, 10 Mar 2012 15:10:36 +0100 Subject: [PATCH 0143/1149] SQL: Fix one of the filenames from commit 0ad6238a96 --- ..._world_smart_scripts => 2012_03_10_00_world_smart_scripts.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sql/updates/world/{2012_03_10_00_world_smart_scripts => 2012_03_10_00_world_smart_scripts.sql} (100%) diff --git a/sql/updates/world/2012_03_10_00_world_smart_scripts b/sql/updates/world/2012_03_10_00_world_smart_scripts.sql similarity index 100% rename from sql/updates/world/2012_03_10_00_world_smart_scripts rename to sql/updates/world/2012_03_10_00_world_smart_scripts.sql From 1ddf039de8a67b4b23df854c3d7aac22cb3d56d5 Mon Sep 17 00:00:00 2001 From: joschiwald Date: Sat, 10 Mar 2012 20:21:27 +0100 Subject: [PATCH 0144/1149] Core/CreatureTextMgr: Fix crash in GetLocalizedChatString() --- src/server/game/Texts/CreatureTextMgr.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index 1651fae9f4c..2f79eaff06a 100755 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -453,8 +453,7 @@ std::string CreatureTextMgr::GetLocalizedChatString(uint32 entry, uint8 textGrou if (locItr == mLocaleTextMap.end()) return baseText; - if (locItr->second.Text[locale].length()) - return locItr->second.Text[locale]; + ObjectMgr::GetLocaleString(locItr->second.Text, locale, baseText); return baseText; } From 609728a17b22d8f53b54bfb2778762b4bdb752cd Mon Sep 17 00:00:00 2001 From: frozenarmor Date: Sun, 11 Mar 2012 00:52:06 +0500 Subject: [PATCH 0145/1149] Update forgotten copyright-headers for 2012. Signed-off-by: frozenarmor --- src/server/scripts/Commands/CMakeLists.txt | 2 +- src/server/scripts/Custom/CMakeLists.txt | 2 +- src/server/scripts/EasternKingdoms/CMakeLists.txt | 2 +- src/server/scripts/Examples/CMakeLists.txt | 2 +- src/server/scripts/Kalimdor/CMakeLists.txt | 2 +- src/server/scripts/Northrend/CMakeLists.txt | 2 +- src/server/scripts/OutdoorPvP/CMakeLists.txt | 2 +- src/server/scripts/Outland/CMakeLists.txt | 2 +- src/server/scripts/Spells/CMakeLists.txt | 2 +- src/server/scripts/World/CMakeLists.txt | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index b17350c265d..d14e71aac4a 100644 --- a/src/server/scripts/Commands/CMakeLists.txt +++ b/src/server/scripts/Commands/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/src/server/scripts/Custom/CMakeLists.txt b/src/server/scripts/Custom/CMakeLists.txt index 1570ca17312..62abde25905 100644 --- a/src/server/scripts/Custom/CMakeLists.txt +++ b/src/server/scripts/Custom/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/src/server/scripts/EasternKingdoms/CMakeLists.txt b/src/server/scripts/EasternKingdoms/CMakeLists.txt index 5af9dd2f23e..129e88a4e3b 100644 --- a/src/server/scripts/EasternKingdoms/CMakeLists.txt +++ b/src/server/scripts/EasternKingdoms/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/src/server/scripts/Examples/CMakeLists.txt b/src/server/scripts/Examples/CMakeLists.txt index 14002100713..dde6fe2c37c 100644 --- a/src/server/scripts/Examples/CMakeLists.txt +++ b/src/server/scripts/Examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/src/server/scripts/Kalimdor/CMakeLists.txt b/src/server/scripts/Kalimdor/CMakeLists.txt index 9c68451122f..7f63c521594 100644 --- a/src/server/scripts/Kalimdor/CMakeLists.txt +++ b/src/server/scripts/Kalimdor/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/src/server/scripts/Northrend/CMakeLists.txt b/src/server/scripts/Northrend/CMakeLists.txt index 53b47884e57..31aa924365d 100644 --- a/src/server/scripts/Northrend/CMakeLists.txt +++ b/src/server/scripts/Northrend/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/src/server/scripts/OutdoorPvP/CMakeLists.txt b/src/server/scripts/OutdoorPvP/CMakeLists.txt index 450f0f6cc7d..237b974aa9d 100644 --- a/src/server/scripts/OutdoorPvP/CMakeLists.txt +++ b/src/server/scripts/OutdoorPvP/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/src/server/scripts/Outland/CMakeLists.txt b/src/server/scripts/Outland/CMakeLists.txt index 229f7de72ec..6056fa8b143 100644 --- a/src/server/scripts/Outland/CMakeLists.txt +++ b/src/server/scripts/Outland/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/src/server/scripts/Spells/CMakeLists.txt b/src/server/scripts/Spells/CMakeLists.txt index 496324e4de9..04dcee9287c 100644 --- a/src/server/scripts/Spells/CMakeLists.txt +++ b/src/server/scripts/Spells/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/src/server/scripts/World/CMakeLists.txt b/src/server/scripts/World/CMakeLists.txt index 41ba775efec..f081a5225e4 100644 --- a/src/server/scripts/World/CMakeLists.txt +++ b/src/server/scripts/World/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without From f85fdbebe7db448d895bb97ee5eafa393a1f6547 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 10 Mar 2012 20:53:26 +0100 Subject: [PATCH 0146/1149] Core/DBC: Remove store getters (useless since we don't have scripts as external dll) --- src/server/game/AI/EventAI/CreatureEventAI.cpp | 2 +- src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 2 +- src/server/game/Conditions/ConditionMgr.cpp | 2 +- src/server/game/DataStores/DBCStores.cpp | 9 --------- src/server/game/DataStores/DBCStores.h | 9 --------- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Scripting/ScriptMgr.cpp | 2 +- src/server/game/Scripting/ScriptSystem.cpp | 4 ++-- src/server/scripts/Commands/cs_achievement.cpp | 2 +- .../scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp | 2 +- .../scripts/Northrend/Naxxramas/boss_sapphiron.cpp | 2 +- .../Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp | 2 +- 12 files changed, 11 insertions(+), 29 deletions(-) diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp index 730606becb5..11887611ae8 100755 --- a/src/server/game/AI/EventAI/CreatureEventAI.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp @@ -1252,7 +1252,7 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* source, Unit* t if ((*i).second.SoundId) { - if (GetSoundEntriesStore()->LookupEntry((*i).second.SoundId)) + if (sSoundEntriesStore.LookupEntry((*i).second.SoundId)) source->PlayDirectSound((*i).second.SoundId); else sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process invalid sound id %u.", textEntry, (*i).second.SoundId); diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index bd6c901f99c..5c1bbf0ad06 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -171,7 +171,7 @@ void ScriptedAI::DoPlaySoundToSet(WorldObject* source, uint32 soundId) if (!source) return; - if (!GetSoundEntriesStore()->LookupEntry(soundId)) + if (!sSoundEntriesStore.LookupEntry(soundId)) { sLog->outError("TSCR: Invalid soundId %u used in DoPlaySoundToSet (Source: TypeId %u, GUID %u)", soundId, source->GetTypeId(), source->GetGUIDLow()); return; diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index eadcc5c5fbb..7fe6df14679 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -1545,7 +1545,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) } case CONDITION_ACHIEVEMENT: { - AchievementEntry const* achievement = GetAchievementStore()->LookupEntry(cond->ConditionValue1); + AchievementEntry const* achievement = sAchievementStore.LookupEntry(cond->ConditionValue1); if (!achievement) { sLog->outErrorDb("Achivement condition has non existing achivement id (%u), skipped", cond->ConditionValue1); diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index acc130dcddf..cbff5c900f6 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -872,12 +872,3 @@ uint32 GetLiquidFlags(uint32 liquidType) return 0; } -// script support functions - DBCStorage const* GetSoundEntriesStore() { return &sSoundEntriesStore; } - DBCStorage const* GetSpellRangeStore() { return &sSpellRangeStore; } - DBCStorage const* GetFactionStore() { return &sFactionStore; } - DBCStorage const* GetItemDisplayStore() { return &sItemStore; } - DBCStorage const* GetCreatureDisplayStore() { return &sCreatureDisplayInfoStore; } - DBCStorage const* GetEmotesStore() { return &sEmotesStore; } - DBCStorage const* GetEmotesTextStore() { return &sEmotesTextStore; } - DBCStorage const* GetAchievementStore() { return &sAchievementStore; } diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 3f8d19c1f5e..cd30ed587f8 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -175,13 +175,4 @@ extern DBCStorage sWorldSafeLocsStore; void LoadDBCStores(const std::string& dataPath); -// script support functions - DBCStorage const* GetSoundEntriesStore(); - DBCStorage const* GetSpellRangeStore(); - DBCStorage const* GetFactionStore(); - DBCStorage const* GetItemDisplayStore(); - DBCStorage const* GetCreatureDisplayStore(); - DBCStorage const* GetEmotesStore(); - DBCStorage const* GetEmotesTextStore(); - DBCStorage const* GetAchievementStore(); #endif diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 92a21dfb52c..8318bd246d0 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -23077,7 +23077,7 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z) if (liquid && liquid->SpellId) { if (res & (LIQUID_MAP_UNDER_WATER | LIQUID_MAP_IN_WATER)) - CastSpell(this, liquid->SpellId, this); + CastSpell(this, liquid->SpellId, true); else RemoveAurasDueToSpell(liquid->SpellId); } diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index ac15bd5c985..fba6b460ec9 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -181,7 +181,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* target) if (pData->uiSoundId) { - if (GetSoundEntriesStore()->LookupEntry(pData->uiSoundId)) + if (sSoundEntriesStore.LookupEntry(pData->uiSoundId)) pSource->SendPlaySound(pData->uiSoundId, false); else sLog->outError("TSCR: DoScriptText entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId); diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp index 65e855cd887..ecb82a80a8d 100755 --- a/src/server/game/Scripting/ScriptSystem.cpp +++ b/src/server/game/Scripting/ScriptSystem.cpp @@ -67,7 +67,7 @@ void SystemMgr::LoadScriptTexts() if (temp.uiSoundId) { - if (!GetSoundEntriesStore()->LookupEntry(temp.uiSoundId)) + if (!sSoundEntriesStore.LookupEntry(temp.uiSoundId)) sLog->outErrorDb("TSCR: Entry %i in table `script_texts` has soundId %u but sound does not exist.", iId, temp.uiSoundId); } @@ -129,7 +129,7 @@ void SystemMgr::LoadScriptTextsCustom() if (temp.uiSoundId) { - if (!GetSoundEntriesStore()->LookupEntry(temp.uiSoundId)) + if (!sSoundEntriesStore.LookupEntry(temp.uiSoundId)) sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` has soundId %u but sound does not exist.", iId, temp.uiSoundId); } diff --git a/src/server/scripts/Commands/cs_achievement.cpp b/src/server/scripts/Commands/cs_achievement.cpp index f136cba46ab..7667e79ece7 100644 --- a/src/server/scripts/Commands/cs_achievement.cpp +++ b/src/server/scripts/Commands/cs_achievement.cpp @@ -67,7 +67,7 @@ public: return false; } - if (AchievementEntry const* achievementEntry = GetAchievementStore()->LookupEntry(achievementId)) + if (AchievementEntry const* achievementEntry = sAchievementStore.LookupEntry(achievementId)) target->CompletedAchievement(achievementEntry); return true; diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp index ea2846185f8..23e64d756f5 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp +++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp @@ -315,7 +315,7 @@ public: eventTimer = 3000; if (Creature* naralex = instance->instance->GetCreature(instance->GetData64(DATA_NARALEX))) { - AchievementEntry const* AchievWC = GetAchievementStore()->LookupEntry(ACHIEVEMENT_WAILING_CAVERNS); + AchievementEntry const* AchievWC = sAchievementStore.LookupEntry(ACHIEVEMENT_WAILING_CAVERNS); if (AchievWC) { Map* map = me->GetMap(); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp index 63f7c653c5a..abd16cd9c93 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp @@ -153,7 +153,7 @@ public: CheckPlayersFrostResist(); if (CanTheHundredClub) { - AchievementEntry const* AchievTheHundredClub = GetAchievementStore()->LookupEntry(ACHIEVEMENT_THE_HUNDRED_CLUB); + AchievementEntry const* AchievTheHundredClub = sAchievementStore.LookupEntry(ACHIEVEMENT_THE_HUNDRED_CLUB); if (AchievTheHundredClub) { if (map && map->IsDungeon()) diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp index 83604ed4153..13ba85f646c 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp @@ -152,7 +152,7 @@ public: if (IsHeroic() && GolemsShattered < 5) { - AchievementEntry const* AchievShatterResistant = GetAchievementStore()->LookupEntry(ACHIEVEMENT_SHATTER_RESISTANT); + AchievementEntry const* AchievShatterResistant = sAchievementStore.LookupEntry(ACHIEVEMENT_SHATTER_RESISTANT); if (AchievShatterResistant) { Map* map = me->GetMap(); From b1a8570a309e73b07d2b332ad6c4e30024c0787f Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 11 Mar 2012 14:52:11 +0100 Subject: [PATCH 0147/1149] Core/Spells: Fix item target selection in Spell:SelectImplicitTargetObjectTargets. Typo spotted by zwerg --- src/server/game/Spells/Spell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index a804c5b1b90..ae5b14989af 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1548,7 +1548,7 @@ void Spell::SelectImplicitTargetObjectTargets(SpellEffIndex effIndex, SpellImpli else if (GameObject* gobj = m_targets.GetGOTarget()) AddGOTarget(gobj, 1 << effIndex); else - AddItemTarget(m_targets.GetItemTarget(), effIndex); + AddItemTarget(m_targets.GetItemTarget(), 1 << effIndex); if (WorldObject* target = m_targets.GetObjectTarget()) SelectImplicitChainTargets(effIndex, targetType, target, 1 << effIndex); From 3cf8b9a15afee5e65b368721a74b4a942c027134 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 11 Mar 2012 15:03:29 +0100 Subject: [PATCH 0148/1149] Scripts/Serpentshrine Cavern: Fixed crashes caused by uninitialized variables, patch by PuniCZ Closes #4988 Closes #5645 --- .../SerpentShrine/boss_lady_vashj.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index 2db259744df..6de4c1c60ca 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -608,24 +608,21 @@ public: VashjGUID = 0; - for (int i = 0; i<8; ++i)//search for nearest waypoint (up on stairs) + x = ElementWPPos[0][0]; + y = ElementWPPos[0][1]; + z = ElementWPPos[0][2]; + + //search for nearest waypoint (up on stairs) + for (uint32 i = 1; i < 8; ++i) { - if (!x || !y || !z) + if (me->GetDistance(ElementWPPos[i][0], ElementWPPos[i][1], ElementWPPos[i][2]) < me->GetDistance(x, y, z)) { x = ElementWPPos[i][0]; y = ElementWPPos[i][1]; z = ElementWPPos[i][2]; } - else - { - if (me->GetDistance(ElementWPPos[i][0], ElementWPPos[i][1], ElementWPPos[i][2]) < me->GetDistance(x, y, z)) - { - x = ElementWPPos[i][0]; - y = ElementWPPos[i][1]; - z = ElementWPPos[i][2]; - } - } } + if (instance) VashjGUID = instance->GetData64(DATA_LADYVASHJ); } From e36027e90b03164c06337a5eb52bcf3f46cf5341 Mon Sep 17 00:00:00 2001 From: Elron103 Date: Sun, 11 Mar 2012 15:45:21 +0100 Subject: [PATCH 0149/1149] Core/Misc: Add a validity check for coordinates, prevents crashes --- src/server/game/Entities/Object/Object.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index c1ecc3b74e7..a86a007c76a 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2674,6 +2674,14 @@ void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float pos.m_positionZ += 2.0f; destx = pos.m_positionX + dist * cos(angle); desty = pos.m_positionY + dist * sin(angle); + + // Prevent invalid coordinates here, position is unchanged + if (!Trinity::IsValidMapCoord(destx, desty)) + { + sLog->outCrash("WorldObject::MovePositionToFirstCollision invalid coordinates X: %f and Y: %f were passed!", destx, desty); + return; + } + ground = GetMap()->GetHeight(GetPhaseMask(), destx, desty, MAX_HEIGHT, true); floor = GetMap()->GetHeight(GetPhaseMask(), destx, desty, pos.m_positionZ, true); destz = fabs(ground - pos.m_positionZ) <= fabs(floor - pos.m_positionZ) ? ground : floor; From 51e3a687d5be8b2b7a86c4ec7a698e85c707d8b9 Mon Sep 17 00:00:00 2001 From: Elron103 Date: Sun, 11 Mar 2012 15:50:41 +0100 Subject: [PATCH 0150/1149] Core/Movement: Fix random position finding near edges, avoid big z-coordinate differences --- src/server/game/Entities/Object/Object.cpp | 38 ++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index c1ecc3b74e7..3528a7f3053 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2659,8 +2659,42 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float void WorldObject::MovePosition(Position &pos, float dist, float angle) { angle += m_orientation; - pos.m_positionX += dist * cos(angle); - pos.m_positionY += dist * sin(angle); + float destx, desty, destz, ground, floor; + destx = pos.m_positionX + dist * cos(angle); + desty = pos.m_positionY + dist * sin(angle); + + // Prevent invalid coordinates here, position is unchanged + if (!Trinity::IsValidMapCoord(destx, desty)) + { + sLog->outCrash("WorldObject::MovePosition invalid coordinates X: %f and Y: %f were passed!", destx, desty); + return; + } + + ground = GetMap()->GetHeight(GetPhaseMask(), destx, desty, MAX_HEIGHT, true); + floor = GetMap()->GetHeight(GetPhaseMask(), destx, desty, pos.m_positionZ, true); + destz = fabs(ground - pos.m_positionZ) <= fabs(floor - pos.m_positionZ) ? ground : floor; + + float step = dist/10.0f; + + for (uint8 j = 0; j < 10; ++j) + { + // do not allow too big z changes + if (fabs(pos.m_positionZ - destz) > 6) + { + destx -= step * cos(angle); + desty -= step * sin(angle); + ground = GetMap()->GetHeight(GetPhaseMask(), destx, desty, MAX_HEIGHT, true); + floor = GetMap()->GetHeight(GetPhaseMask(), destx, desty, pos.m_positionZ, true); + destz = fabs(ground - pos.m_positionZ) <= fabs(floor - pos.m_positionZ) ? ground : floor; + } + // we have correct destz now + else + { + pos.Relocate(destx, desty, destz); + break; + } + } + Trinity::NormalizeMapCoord(pos.m_positionX); Trinity::NormalizeMapCoord(pos.m_positionY); UpdateGroundPositionZ(pos.m_positionX, pos.m_positionY, pos.m_positionZ); From 2b2d054f64f1fa137364d2f840c7005e7936bdc2 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 11 Mar 2012 16:59:17 +0000 Subject: [PATCH 0151/1149] R.I.P SimpleAI - Convert SimpleAI to (DB) SmartAI - Spell ids corrected (and completed some of the scripts) - Random cleanup (code style) in some scripts --- sql/updates/world/2012_03_11_00_world_sai.sql | 59 ++ .../game/AI/ScriptedAI/ScriptedSimpleAI.cpp | 280 -------- .../game/AI/ScriptedAI/ScriptedSimpleAI.h | 73 -- src/server/game/Scripting/ScriptLoader.cpp | 2 - src/server/scripts/CMakeLists.txt | 1 - .../scripts/EasternKingdoms/CMakeLists.txt | 1 - .../Karazhan/boss_shade_of_aran.cpp | 26 - .../MoltenCore/molten_core.cpp | 86 --- .../SerpentShrine/boss_lady_vashj.cpp | 635 +++++++----------- .../SerpentShrine/boss_lurker_below.cpp | 148 ++-- 10 files changed, 373 insertions(+), 938 deletions(-) create mode 100644 sql/updates/world/2012_03_11_00_world_sai.sql delete mode 100755 src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp delete mode 100644 src/server/game/AI/ScriptedAI/ScriptedSimpleAI.h delete mode 100644 src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp diff --git a/sql/updates/world/2012_03_11_00_world_sai.sql b/sql/updates/world/2012_03_11_00_world_sai.sql new file mode 100644 index 00000000000..e5eee10f6f1 --- /dev/null +++ b/sql/updates/world/2012_03_11_00_world_sai.sql @@ -0,0 +1,59 @@ +-- Coilfang Guardian + +DELETE FROM `smart_scripts` WHERE (`entryorguid`=21873 AND `source_type`=0); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(21873, 0, 0, 0, 0, 0, 0, 0, 5000, 5000, 15000, 15000, 11, 28168, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Guardian - IC - Cast Arcing Smash'), +(21873, 0, 1, 0, 0, 0, 0, 0, 2000, 2000, 10000, 10000, 11, 9080, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Guardian - IC - Cast Harmstring'), +(21873, 0, 2, 0, 0, 0, 50, 0, 3000, 4000, 10000, 20000, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Guardian - IC - Say 0'); -- randomly guessed timers + +DELETE FROM `creature_text` WHERE `entry`=21873; +INSERT INTO `world`.`creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(21873, 0, 0, 'By Nazjatar''s Depths!', 12, 0, 0, 0, 0, 0, 'Coilfang Guardian'), +(21873, 0, 1, 'Die, warmblood!', 12, 0, 0, 0, 0, 0, 'Coilfang Guardian'), +(21873, 0, 2, 'For the Master!', 12, 0, 0, 0, 0, 0, 'Coilfang Guardian'), +(21873, 0, 3, 'Illidan reigns!', 12, 0, 0, 0, 0, 0, 'Coilfang Guardian'), +(21873, 0, 4, 'My blood is like venom!', 12, 0, 0, 0, 0, 0, 'Coilfang Guardian'); + +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=21873; + +-- Coilfang Strider + +DELETE FROM `smart_scripts` WHERE (`entryorguid`=22056 AND `source_type`=0); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(22056, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 11, 38257, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Strider - On Reset - Cast Panic Periodic'), +(22056, 0, 1, 0, 0, 0, 0, 0, 8000, 8000, 30000, 40000, 11, 38259, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Strider - IC - Cast Mind Blast'); + +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=22056; + +-- Coilfang Elite + +DELETE FROM `smart_scripts` WHERE (`entryorguid`=22055 AND `source_type`=0); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(22055, 0, 0, 0, 0, 0, 0, 0, 5000, 5000, 15000, 20000, 11, 38260, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Elite - IC - Cast Cleave'), +(22055, 0, 1, 0, 0, 0, 0, 0, 2000, 2000, 10000, 10000, 11, 38262, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Elite - IC - Cast Harmstring'); + +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=22055; + +-- Core Hound + +DELETE FROM `smart_scripts` WHERE (`entryorguid`=11673 AND `source_type`=0); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(11673, 0, 0, 0, 0, 0, 0, 0, 10000, 10000, 7000, 7000, 11, 19272, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - IC - Cast Lava Breath'), +(11673, 0, 1, 0, 0, 0, 0, 0, 4000, 4000, 6000, 6000, 11, 19319, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - IC - Cast Vicious Bite'), +(11673, 0, 2, 0, 0, 0, 0, 0, 15000, 15000, 24000, 24000, 88, 11673*100+0, 11673*100+5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - IC - Call random script'), +(11673*100+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19364, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 0 - Cast Ground Stomp'), +(11673*100+1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19366, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 1 - Cast Cauterizing Flames'), +(11673*100+2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19367, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 2 - Cast Withering Heat'), +(11673*100+3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19369, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 3 - Cast Ancient Despair'), +(11673*100+4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19372, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 4 - Cast Ancient Hysteria'), +(11673*100+5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19365, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 5 - Cast Ancient Dread'); + +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=11673; + +-- Shadow of Aran + +DELETE FROM `smart_scripts` WHERE (`entryorguid`=18254 AND `source_type`=0); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(18254, 0, 0, 0, 0, 0, 0, 0, 1000, 1000, 5000, 5000, 11, 29978, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Shadow of Aran - IC - Cast Pyro Blast'); + +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=18254; diff --git a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp deleted file mode 100755 index 25c7f6f44b7..00000000000 --- a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: SimpleAI -SD%Complete: 100 -SDComment: Base Class for SimpleAI creatures -SDCategory: Creatures -EndScriptData */ - -#include "ScriptPCH.h" -#include "ScriptedSimpleAI.h" - -SimpleAI::SimpleAI(Creature* c) : ScriptedAI(c) -{ - //Clear all data - Aggro_TextId[0] = 0; - Aggro_TextId[1] = 0; - Aggro_TextId[2] = 0; - Aggro_Sound[0] = 0; - Aggro_Sound[1] = 0; - Aggro_Sound[2] = 0; - - Death_TextId[0] = 0; - Death_TextId[1] = 0; - Death_TextId[2] = 0; - Death_Sound[0] = 0; - Death_Sound[1] = 0; - Death_Sound[2] = 0; - Death_Spell = 0; - Death_Target_Type = 0; - - Kill_TextId[0] = 0; - Kill_TextId[1] = 0; - Kill_TextId[2] = 0; - Kill_Sound[0] = 0; - Kill_Sound[1] = 0; - Kill_Sound[2] = 0; - Kill_Spell = 0; - Kill_Target_Type = 0; - - memset(Spell, 0, sizeof(Spell)); - - EnterEvadeMode(); -} - -void SimpleAI::Reset() -{ -} - -void SimpleAI::EnterCombat(Unit* who) -{ - //Reset cast timers - if (Spell[0].First_Cast >= 0) - Spell_Timer[0] = Spell[0].First_Cast; - else Spell_Timer[0] = 1000; - if (Spell[1].First_Cast >= 0) - Spell_Timer[1] = Spell[1].First_Cast; - else Spell_Timer[1] = 1000; - if (Spell[2].First_Cast >= 0) - Spell_Timer[2] = Spell[2].First_Cast; - else Spell_Timer[2] = 1000; - if (Spell[3].First_Cast >= 0) - Spell_Timer[3] = Spell[3].First_Cast; - else Spell_Timer[3] = 1000; - if (Spell[4].First_Cast >= 0) - Spell_Timer[4] = Spell[4].First_Cast; - else Spell_Timer[4] = 1000; - if (Spell[5].First_Cast >= 0) - Spell_Timer[5] = Spell[5].First_Cast; - else Spell_Timer[5] = 1000; - if (Spell[6].First_Cast >= 0) - Spell_Timer[6] = Spell[6].First_Cast; - else Spell_Timer[6] = 1000; - if (Spell[7].First_Cast >= 0) - Spell_Timer[7] = Spell[7].First_Cast; - else Spell_Timer[7] = 1000; - if (Spell[8].First_Cast >= 0) - Spell_Timer[8] = Spell[8].First_Cast; - else Spell_Timer[8] = 1000; - if (Spell[9].First_Cast >= 0) - Spell_Timer[9] = Spell[9].First_Cast; - else Spell_Timer[9] = 1000; - - uint8 random_text = urand(0, 2); - - //Random text - if (Aggro_TextId[random_text]) - DoScriptText(Aggro_TextId[random_text], me, who); - - //Random sound - if (Aggro_Sound[random_text]) - DoPlaySoundToSet(me, Aggro_Sound[random_text]); -} - -void SimpleAI::KilledUnit(Unit* victim) -{ - uint8 random_text = urand(0, 2); - - //Random yell - if (Kill_TextId[random_text]) - DoScriptText(Kill_TextId[random_text], me, victim); - - //Random sound - if (Kill_Sound[random_text]) - DoPlaySoundToSet(me, Kill_Sound[random_text]); - - if (!Kill_Spell) - return; - - Unit* target = NULL; - - switch (Kill_Target_Type) - { - case CAST_SELF: - target = me; - break; - case CAST_HOSTILE_TARGET: - target = me->getVictim(); - break; - case CAST_HOSTILE_SECOND_AGGRO: - target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1); - break; - case CAST_HOSTILE_LAST_AGGRO: - target = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0); - break; - case CAST_HOSTILE_RANDOM: - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - break; - case CAST_KILLEDUNIT_VICTIM: - target = victim; - break; - } - - //Target is ok, cast a spell on it - if (target) - DoCast(target, Kill_Spell); -} - -void SimpleAI::DamageTaken(Unit* killer, uint32& damage) -{ - //Return if damage taken won't kill us - if (me->GetHealth() > damage) - return; - - uint8 random_text = urand(0, 2); - - //Random yell - if (Death_TextId[random_text]) - DoScriptText(Death_TextId[random_text], me, killer); - - //Random sound - if (Death_Sound[random_text]) - DoPlaySoundToSet(me, Death_Sound[random_text]); - - if (!Death_Spell) - return; - - Unit* target = NULL; - - switch (Death_Target_Type) - { - case CAST_SELF: - target = me; - break; - case CAST_HOSTILE_TARGET: - target = me->getVictim(); - break; - case CAST_HOSTILE_SECOND_AGGRO: - target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1); - break; - case CAST_HOSTILE_LAST_AGGRO: - target = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0); - break; - case CAST_HOSTILE_RANDOM: - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - break; - case CAST_JUSTDIED_KILLER: - target = killer; - break; - } - - //Target is ok, cast a spell on it - if (target) - DoCast(target, Death_Spell); -} - -void SimpleAI::UpdateAI(const uint32 diff) -{ - //Return since we have no target - if (!UpdateVictim()) - return; - - //Spells - for (uint32 i = 0; i < MAX_SIMPLEAI_SPELLS; ++i) - { - //Spell not valid - if (!Spell[i].Enabled || !Spell[i].Spell_Id) - continue; - - if (Spell_Timer[i] <= diff) - { - //Check if this is a percentage based - if (Spell[i].First_Cast < 0 && Spell[i].First_Cast > -100 && HealthAbovePct(uint32(-Spell[i].First_Cast))) - continue; - - //Check Current spell - if (!(Spell[i].InterruptPreviousCast && me->IsNonMeleeSpellCasted(false))) - { - Unit* target = NULL; - - switch (Spell[i].Cast_Target_Type) - { - case CAST_SELF: - target = me; - break; - case CAST_HOSTILE_TARGET: - target = me->getVictim(); - break; - case CAST_HOSTILE_SECOND_AGGRO: - target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1); - break; - case CAST_HOSTILE_LAST_AGGRO: - target = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0); - break; - case CAST_HOSTILE_RANDOM: - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - break; - } - - //Target is ok, cast a spell on it and then do our random yell - if (target) - { - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(false); - - DoCast(target, Spell[i].Spell_Id); - - //Yell and sound use the same number so that you can make - //the Creature yell with the correct sound effect attached - uint8 random_text = urand(0, 2); - - //Random yell - if (Spell[i].TextId[random_text]) - DoScriptText(Spell[i].TextId[random_text], me, target); - - //Random sound - if (Spell[i].Text_Sound[random_text]) - DoPlaySoundToSet(me, Spell[i].Text_Sound[random_text]); - } - - } - - //Spell will cast agian when the cooldown is up - if (Spell[i].CooldownRandomAddition) - Spell_Timer[i] = Spell[i].Cooldown + (rand() % Spell[i].CooldownRandomAddition); - else Spell_Timer[i] = Spell[i].Cooldown; - - } else Spell_Timer[i] -= diff; - - } - - DoMeleeAttackIfReady(); -} - diff --git a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.h b/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.h deleted file mode 100644 index a38bdf85e14..00000000000 --- a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.h +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software licensed under GPL version 2 -* Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef SC_SIMPLEAI_H -#define SC_SIMPLEAI_H - -enum CastTarget -{ - CAST_SELF = 0, //Self cast - CAST_HOSTILE_TARGET, //Our current target (ie: highest aggro) - CAST_HOSTILE_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks) - CAST_HOSTILE_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for) - CAST_HOSTILE_RANDOM, //Just any random target on our threat list - CAST_FRIENDLY_RANDOM, //NOT YET IMPLEMENTED - - //Special cases - CAST_KILLEDUNIT_VICTIM, //Only works within KilledUnit function - CAST_JUSTDIED_KILLER, //Only works within JustDied function -}; - -#define MAX_SIMPLEAI_SPELLS 10 - -struct SimpleAI : public ScriptedAI -{ - SimpleAI(Creature* c);// : ScriptedAI(c); - - void Reset(); - - void EnterCombat(Unit* /*who*/); - - void KilledUnit(Unit* /*victim*/); - - void DamageTaken(Unit* killer, uint32& damage); - - void UpdateAI(const uint32 diff); - -public: - - int32 Aggro_TextId[3]; - uint32 Aggro_Sound[3]; - - int32 Death_TextId[3]; - uint32 Death_Sound[3]; - uint32 Death_Spell; - uint32 Death_Target_Type; - - int32 Kill_TextId[3]; - uint32 Kill_Sound[3]; - uint32 Kill_Spell; - uint32 Kill_Target_Type; - - struct SimpleAI_Spell - { - uint32 Spell_Id; //Spell ID to cast - int32 First_Cast; //Delay for first cast - uint32 Cooldown; //Cooldown between casts - uint32 CooldownRandomAddition; //Random addition to cooldown (in range from 0 - CooldownRandomAddition) - uint32 Cast_Target_Type; //Target type (note that certain spells may ignore this) - bool InterruptPreviousCast; //Interrupt a previous cast if this spell needs to be cast - bool Enabled; //Spell enabled or disabled (default: false) - - //3 texts to many? - int32 TextId[3]; - uint32 Text_Sound[3]; - }Spell[MAX_SIMPLEAI_SPELLS]; - -protected: - uint32 Spell_Timer[MAX_SIMPLEAI_SPELLS]; -}; - -#endif - diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 1207b654817..76c3f1c073c 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -151,7 +151,6 @@ void AddSC_boss_sulfuron(); void AddSC_boss_majordomo(); void AddSC_boss_ragnaros(); void AddSC_instance_molten_core(); -void AddSC_molten_core(); void AddSC_the_scarlet_enclave(); //Scarlet Enclave void AddSC_the_scarlet_enclave_c1(); void AddSC_the_scarlet_enclave_c2(); @@ -761,7 +760,6 @@ void AddEasternKingdomsScripts() AddSC_boss_majordomo(); AddSC_boss_ragnaros(); AddSC_instance_molten_core(); - AddSC_molten_core(); AddSC_the_scarlet_enclave(); //Scarlet Enclave AddSC_the_scarlet_enclave_c1(); AddSC_the_scarlet_enclave_c2(); diff --git a/src/server/scripts/CMakeLists.txt b/src/server/scripts/CMakeLists.txt index 62336e95ff6..728d95a0851 100644 --- a/src/server/scripts/CMakeLists.txt +++ b/src/server/scripts/CMakeLists.txt @@ -34,7 +34,6 @@ set(scripts_STAT_SRCS ../game/AI/ScriptedAI/ScriptedEscortAI.cpp ../game/AI/ScriptedAI/ScriptedCreature.cpp ../game/AI/ScriptedAI/ScriptedFollowerAI.cpp - ../game/AI/ScriptedAI/ScriptedSimpleAI.cpp ) if(SCRIPTS) diff --git a/src/server/scripts/EasternKingdoms/CMakeLists.txt b/src/server/scripts/EasternKingdoms/CMakeLists.txt index 129e88a4e3b..5dc3b52dec1 100644 --- a/src/server/scripts/EasternKingdoms/CMakeLists.txt +++ b/src/server/scripts/EasternKingdoms/CMakeLists.txt @@ -84,7 +84,6 @@ set(scripts_STAT_SRCS EasternKingdoms/MoltenCore/instance_molten_core.cpp EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp EasternKingdoms/MoltenCore/boss_magmadar.cpp - EasternKingdoms/MoltenCore/molten_core.cpp EasternKingdoms/MoltenCore/boss_shazzrah.cpp EasternKingdoms/Stratholme/boss_baroness_anastari.cpp EasternKingdoms/Stratholme/boss_nerubenkan.cpp diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp index 119cb7d9de6..d3d8ad38a43 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp @@ -24,7 +24,6 @@ SDCategory: Karazhan EndScriptData */ #include "ScriptPCH.h" -#include "ScriptedSimpleAI.h" #include "karazhan.h" #include "GameObject.h" @@ -549,33 +548,8 @@ public: }; -// CONVERT TO ACID -class mob_shadow_of_aran : public CreatureScript -{ -public: - mob_shadow_of_aran() : CreatureScript("mob_shadow_of_aran") { } - - CreatureAI* GetAI(Creature* creature) const - { - sLog->outString("TSCR: Convert simpleAI script for Creature Entry %u to ACID", creature->GetEntry()); - SimpleAI* ai = new SimpleAI (creature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = SPELL_SHADOW_PYRO; - ai->Spell[0].Cooldown = 5000; - ai->Spell[0].First_Cast = 1000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; - - ai->EnterEvadeMode(); - - return ai; - } - -}; - void AddSC_boss_shade_of_aran() { new boss_shade_of_aran(); - new mob_shadow_of_aran(); new mob_aran_elemental(); } diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp deleted file mode 100644 index 801a11fbfc8..00000000000 --- a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Molten_Core -SD%Complete: 100 -SDComment: -SDCategory: Molten Core -EndScriptData */ - -/* ContentData -mob_ancient_core_hound -EndContentData */ - -#include "ScriptPCH.h" -#include "ScriptedSimpleAI.h" - -enum Spells -{ - SPELL_CONE_OF_FIRE = 19630, - SPELL_BITE = 19771, - - //Random Debuff (each hound has only one of these) - SPELL_GROUND_STOMP = 19364, - SPELL_ANCIENT_DREAD = 19365, - SPELL_CAUTERIZING_FLAMES = 19366, - SPELL_WITHERING_HEAT = 19367, - SPELL_ANCIENT_DESPAIR = 19369, - SPELL_ANCIENT_HYSTERIA = 19372 -}; - -class mob_ancient_core_hound : public CreatureScript -{ -public: - mob_ancient_core_hound() : CreatureScript("mob_ancient_core_hound") { } - - CreatureAI* GetAI(Creature* creature) const - { - SimpleAI* ai = new SimpleAI(creature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = SPELL_CONE_OF_FIRE; - ai->Spell[0].Cooldown = 7000; - ai->Spell[0].First_Cast = 10000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; - - uint32 RandDebuff = RAND(SPELL_GROUND_STOMP, SPELL_ANCIENT_DREAD, SPELL_CAUTERIZING_FLAMES, - SPELL_WITHERING_HEAT, SPELL_ANCIENT_DESPAIR, SPELL_ANCIENT_HYSTERIA); - - ai->Spell[1].Enabled = true; - ai->Spell[1].Spell_Id = RandDebuff; - ai->Spell[1].Cooldown = 24000; - ai->Spell[1].First_Cast = 15000; - ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET; - - ai->Spell[2].Enabled = true; - ai->Spell[2].Spell_Id = SPELL_BITE; - ai->Spell[2].Cooldown = 6000; - ai->Spell[2].First_Cast = 4000; - ai->Spell[2].Cast_Target_Type = CAST_HOSTILE_TARGET; - - ai->EnterEvadeMode(); - - return ai; - } -}; - -void AddSC_molten_core() -{ - new mob_ancient_core_hound(); -} diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index 6de4c1c60ca..fbafb9615f7 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -25,7 +25,6 @@ EndScriptData */ #include "ScriptPCH.h" #include "serpent_shrine.h" -#include "ScriptedSimpleAI.h" #include "Spell.h" #define SAY_INTRO -1548042 @@ -132,7 +131,6 @@ float ShieldGeneratorChannelPos[4][4] = {49.3126f, -943.398f, 42.5501f, 2.40174f} }; -//Lady Vashj AI class boss_lady_vashj : public CreatureScript { public: @@ -147,29 +145,29 @@ public: { boss_lady_vashjAI (Creature* c) : ScriptedAI(c) { - instance = c->GetInstanceScript(); + Instance = c->GetInstanceScript(); Intro = false; JustCreated = true; - c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //set it only once on Creature create (no need do intro if wiped) + c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // set it only once on Creature create (no need do intro if wiped) } - InstanceScript* instance; + InstanceScript* Instance; uint64 ShieldGeneratorChannel[4]; uint32 AggroTimer; - uint32 ShockBlast_Timer; - uint32 Entangle_Timer; - uint32 StaticCharge_Timer; - uint32 ForkedLightning_Timer; - uint32 Check_Timer; - uint32 EnchantedElemental_Timer; - uint32 TaintedElemental_Timer; - uint32 CoilfangElite_Timer; - uint32 CoilfangStrider_Timer; - uint32 SummonSporebat_Timer; - uint32 SummonSporebat_StaticTimer; - uint8 EnchantedElemental_Pos; + uint32 ShockBlastTimer; + uint32 EntangleTimer; + uint32 StaticChargeTimer; + uint32 ForkedLightningTimer; + uint32 CheckTimer; + uint32 EnchantedElementalTimer; + uint32 TaintedElementalTimer; + uint32 CoilfangEliteTimer; + uint32 CoilfangStriderTimer; + uint32 SummonSporebatTimer; + uint32 SummonSporebatStaticTimer; + uint8 EnchantedElementalPos; uint8 Phase; bool Entangle; @@ -180,18 +178,18 @@ public: void Reset() { AggroTimer = 19000; - ShockBlast_Timer = 1+rand()%60000; - Entangle_Timer = 30000; - StaticCharge_Timer = 10000+rand()%15000; - ForkedLightning_Timer = 2000; - Check_Timer = 15000; - EnchantedElemental_Timer = 5000; - TaintedElemental_Timer = 50000; - CoilfangElite_Timer = 45000+rand()%5000; - CoilfangStrider_Timer = 60000+rand()%10000; - SummonSporebat_Timer = 10000; - SummonSporebat_StaticTimer = 30000; - EnchantedElemental_Pos = 0; + ShockBlastTimer = 1+rand()%60000; + EntangleTimer = 30000; + StaticChargeTimer = 10000+rand()%15000; + ForkedLightningTimer = 2000; + CheckTimer = 15000; + EnchantedElementalTimer = 5000; + TaintedElementalTimer = 50000; + CoilfangEliteTimer = 45000+rand()%5000; + CoilfangStriderTimer = 60000+rand()%10000; + SummonSporebatTimer = 10000; + SummonSporebatStaticTimer = 30000; + EnchantedElementalPos = 0; Phase = 0; Entangle = false; @@ -201,16 +199,13 @@ public: JustCreated = false; } else CanAttack = true; - Unit* remo; + for (uint8 i = 0; i < 4; ++i) - { - remo = Unit::GetUnit(*me, ShieldGeneratorChannel[i]); - if (remo) + if (Unit* remo = Unit::GetUnit(*me, ShieldGeneratorChannel[i])) remo->setDeathState(JUST_DIED); - } - if (instance) - instance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED); + if (Instance) + Instance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED); ShieldGeneratorChannel[0] = 0; ShieldGeneratorChannel[1] = 0; ShieldGeneratorChannel[2] = 0; @@ -219,12 +214,12 @@ public: me->SetCorpseDelay(1000*60*60); } - //Called when a tainted elemental dies + // Called when a tainted elemental dies void EventTaintedElementalDeath() { - //the next will spawn 50 seconds after the previous one's death - if (TaintedElemental_Timer > 50000) - TaintedElemental_Timer = 50000; + // the next will spawn 50 seconds after the previous one's death + if (TaintedElementalTimer > 50000) + TaintedElementalTimer = 50000; } void KilledUnit(Unit* /*victim*/) { @@ -235,8 +230,8 @@ public: { DoScriptText(SAY_DEATH, me); - if (instance) - instance->SetData(DATA_LADYVASHJEVENT, DONE); + if (Instance) + Instance->SetData(DATA_LADYVASHJEVENT, DONE); } void StartEvent() @@ -245,26 +240,22 @@ public: Phase = 1; - if (instance) - instance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS); + if (Instance) + Instance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS); } void EnterCombat(Unit* who) { - if (instance) + if (Instance) { - //remove old tainted cores to prevent cheating in phase 2 + // remove old tainted cores to prevent cheating in phase 2 Map* map = me->GetMap(); Map::PlayerList const &PlayerList = map->GetPlayers(); - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (Player* i_pl = i->getSource()) - { - i_pl->DestroyItemCount(31088, 1, true); - } - } + for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr) + if (Player* player = itr->getSource()) + player->DestroyItemCount(31088, 1, true); } - StartEvent();//this is EnterCombat(), so were are 100% in combat, start the event + StartEvent(); // this is EnterCombat(), so were are 100% in combat, start the event if (Phase != 2) AttackStart(who); @@ -287,10 +278,7 @@ public: float attackRadius = me->GetAttackDistance(who); if (me->IsWithinDistInMap(who, attackRadius) && me->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && me->IsWithinLOSInMap(who)) { - //if (who->HasStealthAura()) - // who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - - if (!me->isInCombat())//AttackStart() sets UNIT_FLAG_IN_COMBAT, so this msut be before attacking + if (!me->isInCombat()) // AttackStart() sets UNIT_FLAG_IN_COMBAT, so this msut be before attacking StartEvent(); if (Phase != 2) @@ -304,13 +292,13 @@ public: switch (urand(0, 1)) { case 0: - //Shoot - //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage. + // Shoot + // Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage. DoCast(me->getVictim(), SPELL_SHOOT); break; case 1: - //Multishot - //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage. + // Multishot + // Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage. DoCast(me->getVictim(), SPELL_MULTI_SHOT); break; } @@ -329,231 +317,209 @@ public: CanAttack = true; me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); AggroTimer=19000; - }else + } + else { AggroTimer-=diff; return; } } - //to prevent abuses during phase 2 + // to prevent abuses during phase 2 if (Phase == 2 && !me->getVictim() && me->isInCombat()) { EnterEvadeMode(); return; } - //Return since we have no target + // Return since we have no target if (!UpdateVictim()) return; if (Phase == 1 || Phase == 3) { - //ShockBlast_Timer - if (ShockBlast_Timer <= diff) + // ShockBlastTimer + if (ShockBlastTimer <= diff) { - //Shock Burst - //Randomly used in Phases 1 and 3 on Vashj's target, it's a Shock spell doing 8325-9675 nature damage and stunning the target for 5 seconds, during which she will not attack her target but switch to the next person on the aggro list. + // Shock Burst + // Randomly used in Phases 1 and 3 on Vashj's target, it's a Shock spell doing 8325-9675 nature damage and stunning the target for 5 seconds, during which she will not attack her target but switch to the next person on the aggro list. DoCast(me->getVictim(), SPELL_SHOCK_BLAST); me->TauntApply(me->getVictim()); - ShockBlast_Timer = 1000+rand()%14000; //random cooldown - } else ShockBlast_Timer -= diff; + ShockBlastTimer = 1000+rand()%14000; // random cooldown + } else ShockBlastTimer -= diff; - //StaticCharge_Timer - if (StaticCharge_Timer <= diff) + // StaticChargeTimer + if (StaticChargeTimer <= diff) { - //Static Charge - //Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic. - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true); + // Static Charge + // Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic. + Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true); + if (target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER)) + DoCast(target, SPELL_STATIC_CHARGE_TRIGGER); // cast Static Charge every 2 seconds for 20 seconds - if (target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER)) - //cast Static Charge every 2 seconds for 20 seconds - DoCast(target, SPELL_STATIC_CHARGE_TRIGGER); + StaticChargeTimer = 10000+rand()%20000; + } else StaticChargeTimer -= diff; - StaticCharge_Timer = 10000+rand()%20000; //blizzlike - } else StaticCharge_Timer -= diff; - - //Entangle_Timer - if (Entangle_Timer <= diff) + // EntangleTimer + if (EntangleTimer <= diff) { if (!Entangle) { - //Entangle - //Used in Phases 1 and 3, it casts Entangling Roots on everybody in a 15 yard radius of Vashj, immobilzing them for 10 seconds and dealing 500 damage every 2 seconds. It's not a magic effect so it cannot be dispelled, but is removed by various buffs such as Cloak of Shadows or Blessing of Freedom. + // Entangle + // Used in Phases 1 and 3, it casts Entangling Roots on everybody in a 15 yard radius of Vashj, immobilzing them for 10 seconds and dealing 500 damage every 2 seconds. It's not a magic effect so it cannot be dispelled, but is removed by various buffs such as Cloak of Shadows or Blessing of Freedom. DoCast(me->getVictim(), SPELL_ENTANGLE); Entangle = true; - Entangle_Timer = 10000; + EntangleTimer = 10000; } else { CastShootOrMultishot(); Entangle = false; - Entangle_Timer = 20000+rand()%5000; + EntangleTimer = 20000+rand()%5000; } - } else Entangle_Timer -= diff; + } else EntangleTimer -= diff; - //Phase 1 + // Phase 1 if (Phase == 1) { - //Start phase 2 + // Start phase 2 if (HealthBelowPct(70)) { - //Phase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable. + // Phase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable. Phase = 2; me->GetMotionMaster()->Clear(); DoTeleportTo(MIDDLE_X, MIDDLE_Y, MIDDLE_Z); - Creature* creature; for (uint8 i = 0; i < 4; ++i) - { - creature = me->SummonCreature(SHIED_GENERATOR_CHANNEL, ShieldGeneratorChannelPos[i][0], ShieldGeneratorChannelPos[i][1], ShieldGeneratorChannelPos[i][2], ShieldGeneratorChannelPos[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0); - if (creature) + if (Creature* creature = me->SummonCreature(SHIED_GENERATOR_CHANNEL, ShieldGeneratorChannelPos[i][0], ShieldGeneratorChannelPos[i][1], ShieldGeneratorChannelPos[i][2], ShieldGeneratorChannelPos[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0)) ShieldGeneratorChannel[i] = creature->GetGUID(); - } + DoScriptText(SAY_PHASE2, me); } } - //Phase 3 + // Phase 3 else { - //SummonSporebat_Timer - if (SummonSporebat_Timer <= diff) + // SummonSporebatTimer + if (SummonSporebatTimer <= diff) { - Creature* Sporebat = NULL; - Sporebat = me->SummonCreature(TOXIC_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (Creature* sporebat = me->SummonCreature(TOXIC_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_CORPSE_DESPAWN, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + sporebat->AI()->AttackStart(target); - if (Sporebat) - { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target) - Sporebat->AI()->AttackStart(target); - } + // summon sporebats faster and faster + if (SummonSporebatStaticTimer > 1000) + SummonSporebatStaticTimer -= 1000; - //summon sporebats faster and faster - if (SummonSporebat_StaticTimer > 1000) - SummonSporebat_StaticTimer -= 1000; + SummonSporebatTimer = SummonSporebatStaticTimer; - SummonSporebat_Timer = SummonSporebat_StaticTimer; + if (SummonSporebatTimer < 5000) + SummonSporebatTimer = 5000; - if (SummonSporebat_Timer < 5000) - SummonSporebat_Timer = 5000; - - } else SummonSporebat_Timer -= diff; + } else SummonSporebatTimer -= diff; } - //Melee attack + // Melee attack DoMeleeAttackIfReady(); - //Check_Timer - used to check if somebody is in melee range - if (Check_Timer <= diff) + // CheckTimer - used to check if somebody is in melee range + if (CheckTimer <= diff) { - bool InMeleeRange = false; - Unit* target; + bool inMeleeRange = false; std::list t_list = me->getThreatManager().getThreatList(); for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) { - target = Unit::GetUnit(*me, (*itr)->getUnitGuid()); - //if in melee range - if (target && target->IsWithinDistInMap(me, 5)) + Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid()); + if (target && target->IsWithinDistInMap(me, 5)) // if in melee range { - InMeleeRange = true; + inMeleeRange = true; break; } } - //if nobody is in melee range - if (!InMeleeRange) + // if nobody is in melee range + if (!inMeleeRange) CastShootOrMultishot(); - Check_Timer = 5000; - } else Check_Timer -= diff; + CheckTimer = 5000; + } else CheckTimer -= diff; } - //Phase 2 + // Phase 2 else { - //ForkedLightning_Timer - if (ForkedLightning_Timer <= diff) + // ForkedLightningTimer + if (ForkedLightningTimer <= diff) { - //Forked Lightning - //Used constantly in Phase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage. - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); + // Forked Lightning + // Used constantly in Phase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage. + Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); if (!target) target = me->getVictim(); DoCast(target, SPELL_FORKED_LIGHTNING); - ForkedLightning_Timer = 2000+rand()%6000; //blizzlike - } else ForkedLightning_Timer -= diff; + ForkedLightningTimer = 2000+rand()%6000; + } else ForkedLightningTimer -= diff; - //EnchantedElemental_Timer - if (EnchantedElemental_Timer <= diff) + // EnchantedElementalTimer + if (EnchantedElementalTimer <= diff) { - me->SummonCreature(ENCHANTED_ELEMENTAL, ElementPos[EnchantedElemental_Pos][0], ElementPos[EnchantedElemental_Pos][1], ElementPos[EnchantedElemental_Pos][2], ElementPos[EnchantedElemental_Pos][3], TEMPSUMMON_CORPSE_DESPAWN, 0); + me->SummonCreature(ENCHANTED_ELEMENTAL, ElementPos[EnchantedElementalPos][0], ElementPos[EnchantedElementalPos][1], ElementPos[EnchantedElementalPos][2], ElementPos[EnchantedElementalPos][3], TEMPSUMMON_CORPSE_DESPAWN, 0); - if (EnchantedElemental_Pos == 7) - EnchantedElemental_Pos = 0; + if (EnchantedElementalPos == 7) + EnchantedElementalPos = 0; else - ++EnchantedElemental_Pos; + ++EnchantedElementalPos; - EnchantedElemental_Timer = 10000+rand()%5000; - } else EnchantedElemental_Timer -= diff; + EnchantedElementalTimer = 10000+rand()%5000; + } else EnchantedElementalTimer -= diff; - //TaintedElemental_Timer - if (TaintedElemental_Timer <= diff) + // TaintedElementalTimer + if (TaintedElementalTimer <= diff) { uint32 pos = rand()%8; me->SummonCreature(TAINTED_ELEMENTAL, ElementPos[pos][0], ElementPos[pos][1], ElementPos[pos][2], ElementPos[pos][3], TEMPSUMMON_DEAD_DESPAWN, 0); - TaintedElemental_Timer = 120000; - } else TaintedElemental_Timer -= diff; + TaintedElementalTimer = 120000; + } else TaintedElementalTimer -= diff; - //CoilfangElite_Timer - if (CoilfangElite_Timer <= diff) + // CoilfangEliteTimer + if (CoilfangEliteTimer <= diff) { uint32 pos = rand()%3; - Creature* CoilfangElite = NULL; - CoilfangElite = me->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if (CoilfangElite) + Creature* coilfangElite = me->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if (coilfangElite) { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target) - CoilfangElite->AI()->AttackStart(target); + if (Unit* target = target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + coilfangElite->AI()->AttackStart(target); else if (me->getVictim()) - CoilfangElite->AI()->AttackStart(me->getVictim()); + coilfangElite->AI()->AttackStart(me->getVictim()); } - CoilfangElite_Timer = 45000+rand()%5000; - } else CoilfangElite_Timer -= diff; + CoilfangEliteTimer = 45000+rand()%5000; + } else CoilfangEliteTimer -= diff; - //CoilfangStrider_Timer - if (CoilfangStrider_Timer <= diff) + // CoilfangStriderTimer + if (CoilfangStriderTimer <= diff) { uint32 pos = rand()%3; - Creature* CoilfangStrider = NULL; - CoilfangStrider = me->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if (CoilfangStrider) + if (Creature* CoilfangStrider = me->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000)) { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) CoilfangStrider->AI()->AttackStart(target); else if (me->getVictim()) CoilfangStrider->AI()->AttackStart(me->getVictim()); } - CoilfangStrider_Timer = 60000+rand()%10000; - } else CoilfangStrider_Timer -= diff; + CoilfangStriderTimer = 60000+rand()%10000; + } else CoilfangStriderTimer -= diff; - //Check_Timer - if (Check_Timer <= diff) + // CheckTimer + if (CheckTimer <= diff) { - //Start Phase 3 - if (instance && instance->GetData(DATA_CANSTARTPHASE3)) + // Start Phase 3 + if (Instance && Instance->GetData(DATA_CANSTARTPHASE3)) { - //set life 50% + // set life 50% me->SetHealth(me->CountPctFromMaxHealth(50)); me->RemoveAurasDueToSpell(SPELL_MAGIC_BARRIER); @@ -562,19 +528,19 @@ public: Phase = 3; - //return to the tank + // return to the tank me->GetMotionMaster()->MoveChase(me->getVictim()); } - Check_Timer = 1000; - } else Check_Timer -= diff; + CheckTimer = 1000; + } else CheckTimer -= diff; } } }; }; -//Enchanted Elemental -//If one of them reaches Vashj he will increase her damage done by 5%. +// Enchanted Elemental +// If one of them reaches Vashj he will increase her damage done by 5%. class mob_enchanted_elemental : public CreatureScript { public: @@ -589,42 +555,42 @@ public: { mob_enchanted_elementalAI(Creature* c) : ScriptedAI(c) { - instance = c->GetInstanceScript(); + Instance = c->GetInstanceScript(); } - InstanceScript* instance; - uint32 move; - uint32 phase; - float x, y, z; + InstanceScript* Instance; + uint32 Move; + uint32 Phase; + float X, Y, Z; uint64 VashjGUID; void Reset() { - me->SetSpeed(MOVE_WALK, 0.6f);//walk - me->SetSpeed(MOVE_RUN, 0.6f);//run - move = 0; - phase = 1; + me->SetSpeed(MOVE_WALK, 0.6f); // walk + me->SetSpeed(MOVE_RUN, 0.6f); // run + Move = 0; + Phase = 1; VashjGUID = 0; - x = ElementWPPos[0][0]; - y = ElementWPPos[0][1]; - z = ElementWPPos[0][2]; + X = ElementWPPos[0][0]; + Y = ElementWPPos[0][1]; + Z = ElementWPPos[0][2]; //search for nearest waypoint (up on stairs) for (uint32 i = 1; i < 8; ++i) { - if (me->GetDistance(ElementWPPos[i][0], ElementWPPos[i][1], ElementWPPos[i][2]) < me->GetDistance(x, y, z)) + if (me->GetDistance(ElementWPPos[i][0], ElementWPPos[i][1], ElementWPPos[i][2]) < me->GetDistance(X, Y, Z)) { - x = ElementWPPos[i][0]; - y = ElementWPPos[i][1]; - z = ElementWPPos[i][2]; + X = ElementWPPos[i][0]; + Y = ElementWPPos[i][1]; + Z = ElementWPPos[i][2]; } } - if (instance) - VashjGUID = instance->GetData64(DATA_LADYVASHJ); + if (Instance) + VashjGUID = Instance->GetData64(DATA_LADYVASHJ); } void EnterCombat(Unit* /*who*/) {} @@ -633,47 +599,42 @@ public: void UpdateAI(const uint32 diff) { - if (!instance) + if (!Instance) return; if (!VashjGUID) return; - if (move <= diff) + if (Move <= diff) { me->SetWalk(true); - if (phase == 1) - me->GetMotionMaster()->MovePoint(0, x, y, z); - if (phase == 1 && me->IsWithinDist3d(x, y, z, 0.1f)) - phase = 2; - if (phase == 2) + if (Phase == 1) + me->GetMotionMaster()->MovePoint(0, X, Y, Z); + if (Phase == 1 && me->IsWithinDist3d(X, Y, Z, 0.1f)) + Phase = 2; + if (Phase == 2) { me->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z); - phase = 3; + Phase = 3; } - if (phase == 3) + if (Phase == 3) { me->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z); if (me->IsWithinDist3d(MIDDLE_X, MIDDLE_Y, MIDDLE_Z, 3)) DoCast(me, SPELL_SURGE); } - if (Creature* Vashj = Unit::GetCreature(*me, VashjGUID)) - { - if (!Vashj->isInCombat() || CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->AI())->Phase != 2 || Vashj->isDead()) - { - //call Unsummon() + if (Creature* vashj = Unit::GetCreature(*me, VashjGUID)) + if (!vashj->isInCombat() || CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->Phase != 2 || vashj->isDead()) me->Kill(me); - } - } - move = 1000; - } else move -= diff; + Move = 1000; + } else Move -= diff; } }; }; -//Tainted Elemental -//This mob has 7, 900 life, doesn't move, and shoots Poison Bolts at one person anywhere in the area, doing 3, 000 nature damage and placing a posion doing 2, 000 damage every 2 seconds. He will switch targets often, or sometimes just hang on a single player, but there is nothing you can do about it except heal the damage and kill the Tainted Elemental +// Tainted Elemental +// This mob has 7, 900 life, doesn't move, and shoots Poison Bolts at one person anywhere in the area, doing 3, 000 nature damage and placing a posion doing 2, 000 damage every 2 seconds. He will switch targets often, or sometimes just hang on a single player, but there is nothing you can do about it except heal the damage and kill the Tainted Elemental class mob_tainted_elemental : public CreatureScript { public: @@ -688,30 +649,25 @@ public: { mob_tainted_elementalAI(Creature* c) : ScriptedAI(c) { - instance = c->GetInstanceScript(); + Instance = c->GetInstanceScript(); } - InstanceScript* instance; + InstanceScript* Instance; - uint32 PoisonBolt_Timer; - uint32 Despawn_Timer; + uint32 PoisonBoltTimer; + uint32 DespawnTimer; void Reset() { - PoisonBolt_Timer = 5000+rand()%5000; - Despawn_Timer = 30000; + PoisonBoltTimer = 5000+rand()%5000; + DespawnTimer = 30000; } void JustDied(Unit* /*killer*/) { - if (instance) - { - Creature* Vashj = NULL; - Vashj = (Unit::GetCreature((*me), instance->GetData64(DATA_LADYVASHJ))); - - if (Vashj) - CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->AI())->EventTaintedElementalDeath(); - } + if (Instance) + if (Creature* vashj = Unit::GetCreature((*me), Instance->GetData64(DATA_LADYVASHJ))) + CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->EventTaintedElementalDeath(); } void EnterCombat(Unit* who) @@ -721,27 +677,26 @@ public: void UpdateAI(const uint32 diff) { - //PoisonBolt_Timer - if (PoisonBolt_Timer <= diff) + // PoisonBoltTimer + if (PoisonBoltTimer <= diff) { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); + Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); if (target && target->IsWithinDistInMap(me, 30)) DoCast(target, SPELL_POISON_BOLT); - PoisonBolt_Timer = 5000+rand()%5000; - } else PoisonBolt_Timer -= diff; + PoisonBoltTimer = 5000+rand()%5000; + } else PoisonBoltTimer -= diff; - //Despawn_Timer - if (Despawn_Timer <= diff) + // DespawnTimer + if (DespawnTimer <= diff) { - //call Unsummon() + // call Unsummon() me->setDeathState(DEAD); - //to prevent crashes - Despawn_Timer = 1000; - } else Despawn_Timer -= diff; + // to prevent crashes + DespawnTimer = 1000; + } else DespawnTimer -= diff; } }; @@ -763,35 +718,29 @@ public: { mob_toxic_sporebatAI(Creature* c) : ScriptedAI(c) { - instance = c->GetInstanceScript(); + Instance = c->GetInstanceScript(); EnterEvadeMode(); } - InstanceScript* instance; + InstanceScript* Instance; - uint32 movement_timer; - uint32 ToxicSpore_Timer; - uint32 bolt_timer; - uint32 Check_Timer; + uint32 MovementTimer; + uint32 ToxicSporeTimer; + uint32 BoltTimer; + uint32 CheckTimer; void Reset() { me->SetLevitate(true); me->setFaction(14); - movement_timer = 0; - ToxicSpore_Timer = 5000; - bolt_timer = 5500; - Check_Timer = 1000; - } - - void EnterCombat(Unit* /*who*/) - { - + MovementTimer = 0; + ToxicSporeTimer = 5000; + BoltTimer = 5500; + CheckTimer = 1000; } void MoveInLineOfSight(Unit* /*who*/) { - } void MovementInform(uint32 type, uint32 id) @@ -800,113 +749,57 @@ public: return; if (id == 1) - movement_timer = 0; + MovementTimer = 0; } void UpdateAI (const uint32 diff) { - //Random movement - if (movement_timer <= diff) + // Random movement + if (MovementTimer <= diff) { uint32 rndpos = rand()%8; me->GetMotionMaster()->MovePoint(1, SporebatWPPos[rndpos][0], SporebatWPPos[rndpos][1], SporebatWPPos[rndpos][2]); - movement_timer = 6000; - } else movement_timer -= diff; + MovementTimer = 6000; + } else MovementTimer -= diff; - //toxic spores - if (bolt_timer <= diff) + // toxic spores + if (BoltTimer <= diff) { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { - Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000); - if (trig) + if (Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000)) { trig->setFaction(14); trig->CastSpell(trig, SPELL_TOXIC_SPORES, true); } } - bolt_timer = 10000+rand()%5000; + BoltTimer = 10000+rand()%5000; } - else bolt_timer -= diff; + else BoltTimer -= diff; - //Check_Timer - if (Check_Timer <= diff) + // CheckTimer + if (CheckTimer <= diff) { - if (instance) + if (Instance) { - //check if vashj is death - Unit* Vashj = NULL; - Vashj = Unit::GetUnit((*me), instance->GetData64(DATA_LADYVASHJ)); + // check if vashj is death + Unit* Vashj = Unit::GetUnit((*me), Instance->GetData64(DATA_LADYVASHJ)); if (!Vashj || (Vashj && !Vashj->isAlive()) || (Vashj && CAST_AI(boss_lady_vashj::boss_lady_vashjAI, CAST_CRE(Vashj)->AI())->Phase != 3)) { - //remove + // remove me->setDeathState(DEAD); me->RemoveCorpse(); me->setFaction(35); } } - Check_Timer = 1000; - } else Check_Timer -= diff; + CheckTimer = 1000; + } else CheckTimer -= diff; } }; }; -//Coilfang Elite -//It's an elite Naga mob with 170, 000 HP. It does about 5000 damage on plate, and has a nasty cleave hitting for about 7500 damage -class mob_coilfang_elite : public CreatureScript -{ -public: - mob_coilfang_elite() : CreatureScript("mob_coilfang_elite") { } - - CreatureAI* GetAI(Creature* creature) const - { - SimpleAI* ai = new SimpleAI (creature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = 31345; //Cleave - ai->Spell[0].Cooldown = 15000; - ai->Spell[0].CooldownRandomAddition = 5000; - ai->Spell[0].First_Cast = 5000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_RANDOM; - - ai->EnterEvadeMode(); - - return ai; - } - -}; - -//Coilfang Strider -//It hits plate for about 8000 damage, has a Mind Blast spell doing about 3000 shadow damage, and a Psychic Scream Aura, which fears everybody in a 8 yard range of it every 2-3 seconds, for 5 seconds and increasing their movement speed by 150% during the fear. -class mob_coilfang_strider : public CreatureScript -{ -public: - mob_coilfang_strider() : CreatureScript("mob_coilfang_strider") { } - - CreatureAI* GetAI(Creature* creature) const - { - SimpleAI* ai = new SimpleAI (creature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = 41374; //Mind Blast - ai->Spell[0].Cooldown = 30000; - ai->Spell[0].CooldownRandomAddition = 10000; - ai->Spell[0].First_Cast = 8000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; - - //Scream aura not implemented - - ai->EnterEvadeMode(); - - return ai; - } - -}; - class mob_shield_generator_channel : public CreatureScript { public: @@ -921,46 +814,44 @@ public: { mob_shield_generator_channelAI(Creature* c) : ScriptedAI(c) { - instance = c->GetInstanceScript(); + Instance = c->GetInstanceScript(); } - InstanceScript* instance; - uint32 Check_Timer; + InstanceScript* Instance; + uint32 CheckTimer; bool Casted; + void Reset() { - Check_Timer = 0; + CheckTimer = 0; Casted = false; - me->SetDisplayId(11686); //invisible + me->SetDisplayId(11686); // invisible me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } - void EnterCombat(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} void UpdateAI (const uint32 diff) { - if (!instance) + if (!Instance) return; - if (Check_Timer <= diff) + if (CheckTimer <= diff) { - Unit* Vashj = NULL; - Vashj = Unit::GetUnit((*me), instance->GetData64(DATA_LADYVASHJ)); + Unit* vashj = Unit::GetUnit((*me), Instance->GetData64(DATA_LADYVASHJ)); - if (Vashj && Vashj->isAlive()) + if (vashj && vashj->isAlive()) { - //start visual channel - if (!Casted || !Vashj->HasAura(SPELL_MAGIC_BARRIER)) + // start visual channel + if (!Casted || !vashj->HasAura(SPELL_MAGIC_BARRIER)) { - DoCast(Vashj, SPELL_MAGIC_BARRIER, true); + DoCast(vashj, SPELL_MAGIC_BARRIER, true); Casted = true; } } - Check_Timer = 1000; - } else Check_Timer -= diff; + CheckTimer = 1000; + } else CheckTimer -= diff; } }; @@ -971,7 +862,7 @@ class item_tainted_core : public ItemScript public: item_tainted_core() : ItemScript("item_tainted_core") { } - bool OnUse(Player* player, Item* /*_Item*/, SpellCastTargets const& targets) + bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const& targets) { InstanceScript* instance = player->GetInstanceScript(); @@ -981,31 +872,30 @@ public: return true; } - Creature* Vashj = NULL; - Vashj = (Unit::GetCreature((*player), instance->GetData64(DATA_LADYVASHJ))); - if (Vashj && (CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->AI())->Phase == 2)) + Creature* vashj = Unit::GetCreature((*player), instance->GetData64(DATA_LADYVASHJ)); + if (vashj && (CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->Phase == 2)) { if (GameObject* gObj = targets.GetGOTarget()) { uint32 identifier; - uint8 channel_identifier; + uint8 channelIdentifier; switch (gObj->GetEntry()) { case 185052: identifier = DATA_SHIELDGENERATOR1; - channel_identifier = 0; + channelIdentifier = 0; break; case 185053: identifier = DATA_SHIELDGENERATOR2; - channel_identifier = 1; + channelIdentifier = 1; break; case 185051: identifier = DATA_SHIELDGENERATOR3; - channel_identifier = 2; + channelIdentifier = 2; break; case 185054: identifier = DATA_SHIELDGENERATOR4; - channel_identifier = 3; + channelIdentifier = 3; break; default: return true; @@ -1017,18 +907,17 @@ public: return true; } - //get and remove channel - Unit* Channel = NULL; - Channel = Unit::GetCreature(*Vashj, CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->AI())->ShieldGeneratorChannel[channel_identifier]); - if (Channel) + // get and remove channel + + if (Unit* channel = Unit::GetCreature(*vashj, CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->ShieldGeneratorChannel[channelIdentifier])) { - //call Unsummon() - Channel->setDeathState(JUST_DIED); + // call Unsummon() + channel->setDeathState(JUST_DIED); } instance->SetData(identifier, 1); - //remove this item + // remove this item player->DestroyItemCount(31088, 1, true); return true; } @@ -1052,8 +941,6 @@ void AddSC_boss_lady_vashj() new mob_enchanted_elemental(); new mob_tainted_elemental(); new mob_toxic_sporebat(); - new mob_coilfang_elite(); - new mob_coilfang_strider(); new mob_shield_generator_channel(); new item_tainted_core(); } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp index 0ed9d8e7833..4af20d70816 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp @@ -25,7 +25,6 @@ EndScriptData */ #include "ScriptPCH.h" #include "serpent_shrine.h" -#include "ScriptedSimpleAI.h" #include "Spell.h" #define SPELL_SPOUT 37433 @@ -55,15 +54,16 @@ EndScriptData */ float AddPos[9][3] = { - {2.8553810f, -459.823914f, -19.182686f}, //MOVE_AMBUSHER_1 X, Y, Z - {12.400000f, -466.042267f, -19.182686f}, //MOVE_AMBUSHER_2 X, Y, Z - {51.366653f, -460.836060f, -19.182686f}, //MOVE_AMBUSHER_3 X, Y, Z - {62.597980f, -457.433044f, -19.182686f}, //MOVE_AMBUSHER_4 X, Y, Z - {77.607452f, -384.302765f, -19.182686f}, //MOVE_AMBUSHER_5 X, Y, Z - {63.897900f, -378.984924f, -19.182686f}, //MOVE_AMBUSHER_6 X, Y, Z - {34.447250f, -387.333618f, -19.182686f}, //MOVE_GUARDIAN_1 X, Y, Z - {14.388216f, -423.468018f, -19.625271f}, //MOVE_GUARDIAN_2 X, Y, Z - {42.471519f, -445.115295f, -19.769423f} //MOVE_GUARDIAN_3 X, Y, Z + // MOVE_AMBUSHER_1 X, Y, Z + {2.8553810f, -459.823914f, -19.182686f}, + {12.400000f, -466.042267f, -19.182686f}, + {51.366653f, -460.836060f, -19.182686f}, + {62.597980f, -457.433044f, -19.182686f}, + {77.607452f, -384.302765f, -19.182686f}, + {63.897900f, -378.984924f, -19.182686f}, + {34.447250f, -387.333618f, -19.182686f}, + {14.388216f, -423.468018f, -19.625271f}, + {42.471519f, -445.115295f, -19.769423f} }; class boss_the_lurker_below : public CreatureScript @@ -80,10 +80,10 @@ public: { boss_the_lurker_belowAI(Creature* c) : Scripted_NoMovementAI(c), Summons(me) { - instance = c->GetInstanceScript(); + Instance = c->GetInstanceScript(); } - InstanceScript* instance; + InstanceScript* Instance; SummonList Summons; bool Spawned; @@ -103,7 +103,7 @@ public: bool CheckCanStart()//check if players fished { - if (instance && instance->GetData(DATA_STRANGE_POOL) == NOT_STARTED) + if (Instance && Instance->GetData(DATA_STRANGE_POOL) == NOT_STARTED) return false; return true; } @@ -112,39 +112,39 @@ public: me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING); SpoutAnimTimer = 1000; RotTimer = 0; - WaterboltTimer = 15000;//give time to get in range when fight starts + WaterboltTimer = 15000; // give time to get in range when fight starts SpoutTimer = 45000; - WhirlTimer = 18000;//after avery spout + WhirlTimer = 18000; // after avery spout PhaseTimer = 120000; GeyserTimer = rand()%5000 + 15000; - CheckTimer = 15000;//give time to get in range when fight starts - WaitTimer = 60000;//never reached - WaitTimer2 = 60000;//never reached + CheckTimer = 15000; // give time to get in range when fight starts + WaitTimer = 60000; // never reached + WaitTimer2 = 60000; // never reached - Submerged = true;//will be false at combat start + Submerged = true; // will be false at combat start Spawned = false; InRange = false; CanStartEvent = false; Summons.DespawnAll(); - if (instance) + if (Instance) { - instance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED); - instance->SetData(DATA_STRANGE_POOL, NOT_STARTED); + Instance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED); + Instance->SetData(DATA_STRANGE_POOL, NOT_STARTED); } - DoCast(me, SPELL_SUBMERGE);//submerge anim - me->SetVisible(false);//we start invis under water, submerged + DoCast(me, SPELL_SUBMERGE); // submerge anim + me->SetVisible(false); // we start invis under water, submerged me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { - if (instance) + if (Instance) { - instance->SetData(DATA_THELURKERBELOWEVENT, DONE); - instance->SetData(DATA_STRANGE_POOL, IN_PROGRESS); + Instance->SetData(DATA_THELURKERBELOWEVENT, DONE); + Instance->SetData(DATA_STRANGE_POOL, IN_PROGRESS); } Summons.DespawnAll(); @@ -152,22 +152,20 @@ public: void EnterCombat(Unit* who) { - if (instance) - instance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS); + if (Instance) + Instance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS); Scripted_NoMovementAI::EnterCombat(who); } void MoveInLineOfSight(Unit* who) { - if (!CanStartEvent)//boss is invisible, don't attack + if (!CanStartEvent) // boss is invisible, don't attack return; if (!me->getVictim() && who->IsValidAttackTarget(me)) { float attackRadius = me->GetAttackDistance(who); if (me->IsWithinDistInMap(who, attackRadius)) - { AttackStart(who); - } } } @@ -179,7 +177,7 @@ public: void UpdateAI(const uint32 diff) { - if (!CanStartEvent)//boss is invisible, don't attack + if (!CanStartEvent) // boss is invisible, don't attack { if (CheckCanStart()) { @@ -190,21 +188,21 @@ public: WaitTimer2 = 500; } - if (!Submerged && WaitTimer2 <= diff)//wait 500ms before emerge anim + if (!Submerged && WaitTimer2 <= diff) // wait 500ms before emerge anim { me->RemoveAllAuras(); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); DoCast(me, SPELL_EMERGE, false); - WaitTimer2 = 60000;//never reached + WaitTimer2 = 60000; // never reached WaitTimer = 3000; } else WaitTimer2 -= diff; - if (WaitTimer <= diff)//wait 3secs for emerge anim, then attack + if (WaitTimer <= diff) // wait 3secs for emerge anim, then attack { WaitTimer = 3000; - CanStartEvent = true;//fresh fished from pool + CanStartEvent = true; // fresh fished from pool me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } @@ -214,7 +212,7 @@ public: return; } - if (me->getThreatManager().getThreatList().empty())//check if should evade + if (me->getThreatManager().getThreatList().empty()) // check if should evade { if (me->isInCombat()) EnterEvadeMode(); @@ -226,7 +224,7 @@ public: { me->InterruptNonMeleeSpells(false); DoCast(me, SPELL_SUBMERGE); - PhaseTimer = 60000;//60secs submerged + PhaseTimer = 60000; // 60secs submerged Submerged = true; } else PhaseTimer-=diff; @@ -236,12 +234,12 @@ public: me->SetReactState(REACT_PASSIVE); me->GetMotionMaster()->MoveRotate(20000, urand(0, 1) ? ROTATE_DIRECTION_LEFT : ROTATE_DIRECTION_RIGHT); SpoutTimer = 45000; - WhirlTimer = 20000;//whirl directly after spout + WhirlTimer = 20000; // whirl directly after spout RotTimer = 20000; return; } else SpoutTimer -= diff; - //Whirl directly after a Spout and at random times + // Whirl directly after a Spout and at random times if (WhirlTimer <= diff) { WhirlTimer = 18000; @@ -273,7 +271,7 @@ public: for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { if (i->getSource() && i->getSource()->isAlive() && me->HasInArc(float(diff/20000*M_PI*2), i->getSource()) && me->IsWithinDist(i->getSource(), SPOUT_DIST) && !i->getSource()->IsInWater()) - DoCast(i->getSource(), SPELL_SPOUT, true);//only knock back palyers in arc, in 100yards, not in water + DoCast(i->getSource(), SPELL_SPOUT, true); // only knock back players in arc, in 100yards, not in water } } @@ -300,7 +298,7 @@ public: GeyserTimer = rand()%5000 + 15000; } else GeyserTimer -= diff; - if (!InRange)//if on players in melee range cast Waterbolt + if (!InRange) // if on players in melee range cast Waterbolt { if (WaterboltTimer <= diff) { @@ -318,12 +316,13 @@ public: DoMeleeAttackIfReady(); - }else//submerged + } + else // submerged { if (PhaseTimer <= diff) { Submerged = false; - me->InterruptNonMeleeSpells(false);//shouldn't be any + me->InterruptNonMeleeSpells(false); // shouldn't be any me->RemoveAllAuras(); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->RemoveFlag(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED); @@ -334,28 +333,22 @@ public: return; } else PhaseTimer-=diff; - if (me->getThreatManager().getThreatList().empty())//check if should evade + if (me->getThreatManager().getThreatList().empty()) // check if should evade { EnterEvadeMode(); return; } + if (!me->isInCombat()) DoZoneInCombat(); if (!Spawned) { me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - //spawn adds + // spawn adds for (uint8 i = 0; i < 9; ++i) - { - Creature* Summoned; - if (i < 6) - Summoned = me->SummonCreature(MOB_COILFANG_AMBUSHER, AddPos[i][0], AddPos[i][1], AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - else Summoned = me->SummonCreature(MOB_COILFANG_GUARDIAN, AddPos[i][0], AddPos[i][1], AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (Summoned) - Summons.Summon(Summoned); - } + if (Creature* summoned = me->SummonCreature(i < 6 ? MOB_COILFANG_AMBUSHER : MOB_COILFANG_GUARDIAN, AddPos[i][0], AddPos[i][1], AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0)) + Summons.Summon(summoned); Spawned = true; } } @@ -363,32 +356,6 @@ public: }; }; -class mob_coilfang_guardian : public CreatureScript -{ -public: - mob_coilfang_guardian() : CreatureScript("mob_coilfang_guardian") { } - - CreatureAI* GetAI(Creature* creature) const - { - SimpleAI* ai = new SimpleAI (creature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = SPELL_ARCINGSMASH; - ai->Spell[0].Cooldown = 15000; - ai->Spell[0].First_Cast = 5000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; - - ai->Spell[1].Enabled = true; - ai->Spell[1].Spell_Id = SPELL_HAMSTRING; - ai->Spell[1].Cooldown = 10000; - ai->Spell[1].First_Cast = 2000; - ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET; - - return ai; - } - -}; - class mob_coilfang_ambusher : public CreatureScript { public: @@ -412,12 +379,6 @@ public: { MultiShotTimer = 10000; ShootBowTimer = 4000; - - } - - void EnterCombat(Unit* /*who*/) - { - } void MoveInLineOfSight(Unit* who) @@ -438,18 +399,16 @@ public: DoCast(me->getVictim(), SPELL_SPREAD_SHOT, true); MultiShotTimer = 10000+rand()%10000; - ShootBowTimer += 1500;//add global cooldown + ShootBowTimer += 1500; // add global cooldown } else MultiShotTimer -= diff; if (ShootBowTimer <= diff) { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); int bp0 = 1100; - if (target) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) me->CastCustomSpell(target, SPELL_SHOOT, &bp0, NULL, NULL, true); ShootBowTimer = 4000+rand()%5000; - MultiShotTimer += 1500;//add global cooldown + MultiShotTimer += 1500; // add global cooldown } else ShootBowTimer -= diff; } }; @@ -482,7 +441,6 @@ class go_strange_pool : public GameObjectScript void AddSC_boss_the_lurker_below() { new boss_the_lurker_below(); - new mob_coilfang_guardian(); new mob_coilfang_ambusher(); new go_strange_pool(); } From 6ffdef1e6c6aab91b70f78df44e4adda63a2c010 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 11 Mar 2012 17:10:27 +0000 Subject: [PATCH 0152/1149] SQL: Fix some failures in previous commit (2b2d054) Please, re-apply the SQL files. --- .../world/2012_03_10_00_world_creature.sql | 10 ++++---- sql/updates/world/2012_03_11_00_world_sai.sql | 25 ++++++++++--------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/sql/updates/world/2012_03_10_00_world_creature.sql b/sql/updates/world/2012_03_10_00_world_creature.sql index 3a0f9dbda58..a0143af73c7 100644 --- a/sql/updates/world/2012_03_10_00_world_creature.sql +++ b/sql/updates/world/2012_03_10_00_world_creature.sql @@ -2,11 +2,11 @@ SET @GUID := 42153; DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+4; INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES -(@GUID,32666,530,1,0,0,0,9830.201,-7389.711,13.68803,5.532694,120,0,0,1,0,0), -(@GUID+1,32667,530,1,0,0,0,9859.044,-7406.975,13.7113,1.658063,120,0,0,1,0,0), -(@GUID+2,31144,530,1,0,0,0,9869.401,-7389.657,13.69022,3.90953755,120,0,0,1,0,0), -(@GUID+3,31144,530,1,0,0,0,9871.973,-7392.763,13.6818113,3.35103226,120,0,0,1,0,0), -(@GUID+4,31146,530,1,0,0,0,9850.529,-7395.442,13.72216,4.694936,120,0,0,1,0,0); +(@GUID,32666,530,1,1,0,0,9830.201,-7389.711,13.68803,5.532694,120,0,0,1,0,0), +(@GUID+1,32667,530,1,1,0,0,9859.044,-7406.975,13.7113,1.658063,120,0,0,1,0,0), +(@GUID+2,31144,530,1,1,0,0,9869.401,-7389.657,13.69022,3.90953755,120,0,0,1,0,0), +(@GUID+3,31144,530,1,1,0,0,9871.973,-7392.763,13.6818113,3.35103226,120,0,0,1,0,0), +(@GUID+4,31146,530,1,1,0,0,9850.529,-7395.442,13.72216,4.694936,120,0,0,1,0,0); -- Addons DELETE FROM `creature_addon` WHERE `guid` BETWEEN @GUID AND @GUID+4; DELETE FROM `creature_addon` WHERE `guid`=66686; diff --git a/sql/updates/world/2012_03_11_00_world_sai.sql b/sql/updates/world/2012_03_11_00_world_sai.sql index e5eee10f6f1..a8cab265ac0 100644 --- a/sql/updates/world/2012_03_11_00_world_sai.sql +++ b/sql/updates/world/2012_03_11_00_world_sai.sql @@ -1,13 +1,13 @@ -- Coilfang Guardian -DELETE FROM `smart_scripts` WHERE (`entryorguid`=21873 AND `source_type`=0); +DELETE FROM `smart_scripts` WHERE `entryorguid`=21873 AND `source_type`=0; INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES (21873, 0, 0, 0, 0, 0, 0, 0, 5000, 5000, 15000, 15000, 11, 28168, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Guardian - IC - Cast Arcing Smash'), (21873, 0, 1, 0, 0, 0, 0, 0, 2000, 2000, 10000, 10000, 11, 9080, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Guardian - IC - Cast Harmstring'), (21873, 0, 2, 0, 0, 0, 50, 0, 3000, 4000, 10000, 20000, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Guardian - IC - Say 0'); -- randomly guessed timers DELETE FROM `creature_text` WHERE `entry`=21873; -INSERT INTO `world`.`creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES (21873, 0, 0, 'By Nazjatar''s Depths!', 12, 0, 0, 0, 0, 0, 'Coilfang Guardian'), (21873, 0, 1, 'Die, warmblood!', 12, 0, 0, 0, 0, 0, 'Coilfang Guardian'), (21873, 0, 2, 'For the Master!', 12, 0, 0, 0, 0, 0, 'Coilfang Guardian'), @@ -18,7 +18,7 @@ UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry` -- Coilfang Strider -DELETE FROM `smart_scripts` WHERE (`entryorguid`=22056 AND `source_type`=0); +DELETE FROM `smart_scripts` WHERE `entryorguid`=22056 AND `source_type`=0; INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES (22056, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 11, 38257, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Strider - On Reset - Cast Panic Periodic'), (22056, 0, 1, 0, 0, 0, 0, 0, 8000, 8000, 30000, 40000, 11, 38259, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Strider - IC - Cast Mind Blast'); @@ -27,7 +27,7 @@ UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry` -- Coilfang Elite -DELETE FROM `smart_scripts` WHERE (`entryorguid`=22055 AND `source_type`=0); +DELETE FROM `smart_scripts` WHERE `entryorguid`=22055 AND `source_type`=0; INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES (22055, 0, 0, 0, 0, 0, 0, 0, 5000, 5000, 15000, 20000, 11, 38260, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Elite - IC - Cast Cleave'), (22055, 0, 1, 0, 0, 0, 0, 0, 2000, 2000, 10000, 10000, 11, 38262, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Elite - IC - Cast Harmstring'); @@ -36,23 +36,24 @@ UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry` -- Core Hound -DELETE FROM `smart_scripts` WHERE (`entryorguid`=11673 AND `source_type`=0); +DELETE FROM `smart_scripts` WHERE `entryorguid`=11673 AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` BETWEEN 11673*100+0 AND 11673*100+5 AND `source_type`=9; INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES (11673, 0, 0, 0, 0, 0, 0, 0, 10000, 10000, 7000, 7000, 11, 19272, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - IC - Cast Lava Breath'), (11673, 0, 1, 0, 0, 0, 0, 0, 4000, 4000, 6000, 6000, 11, 19319, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - IC - Cast Vicious Bite'), (11673, 0, 2, 0, 0, 0, 0, 0, 15000, 15000, 24000, 24000, 88, 11673*100+0, 11673*100+5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - IC - Call random script'), -(11673*100+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19364, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 0 - Cast Ground Stomp'), -(11673*100+1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19366, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 1 - Cast Cauterizing Flames'), -(11673*100+2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19367, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 2 - Cast Withering Heat'), -(11673*100+3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19369, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 3 - Cast Ancient Despair'), -(11673*100+4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19372, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 4 - Cast Ancient Hysteria'), -(11673*100+5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19365, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 5 - Cast Ancient Dread'); +(11673*100+0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19364, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 0 - Cast Ground Stomp'), +(11673*100+1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19366, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 1 - Cast Cauterizing Flames'), +(11673*100+2, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19367, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 2 - Cast Withering Heat'), +(11673*100+3, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19369, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 3 - Cast Ancient Despair'), +(11673*100+4, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19372, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 4 - Cast Ancient Hysteria'), +(11673*100+5, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19365, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 5 - Cast Ancient Dread'); UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=11673; -- Shadow of Aran -DELETE FROM `smart_scripts` WHERE (`entryorguid`=18254 AND `source_type`=0); +DELETE FROM `smart_scripts` WHERE `entryorguid`=18254 AND `source_type`=0; INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES (18254, 0, 0, 0, 0, 0, 0, 0, 1000, 1000, 5000, 5000, 11, 29978, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Shadow of Aran - IC - Cast Pyro Blast'); From 0c178320bfe176a74351fcf66e8a5c2de9b9e8ec Mon Sep 17 00:00:00 2001 From: thomas33 Date: Sun, 11 Mar 2012 20:53:08 +0100 Subject: [PATCH 0153/1149] update forgotten copyright-headers for 2012 --- cmake/genrev.cmake | 2 +- cmake/macros/CheckBuildDir.cmake | 2 +- cmake/options.cmake | 2 +- contrib/conf_merge/tc-conf-merger.pl | 2 +- dep/SFMT/SFMT.h | 2 +- dep/SFMT/randomc.h | 2 +- doc/UnixInstall.txt | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmake/genrev.cmake b/cmake/genrev.cmake index 37cea9b3deb..b1112d13c12 100644 --- a/cmake/genrev.cmake +++ b/cmake/genrev.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2010 Trinity +# Copyright (C) 2008-2012 Trinity # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/cmake/macros/CheckBuildDir.cmake b/cmake/macros/CheckBuildDir.cmake index 868643285ef..d67f930df99 100644 --- a/cmake/macros/CheckBuildDir.cmake +++ b/cmake/macros/CheckBuildDir.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2010 Trinity +# Copyright (C) 2008-2012 Trinity # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/cmake/options.cmake b/cmake/options.cmake index b9a70339660..71424cc3776 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2010 Trinity +# Copyright (C) 2008-2012 Trinity # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/contrib/conf_merge/tc-conf-merger.pl b/contrib/conf_merge/tc-conf-merger.pl index d4902aba279..138d51705d7 100644 --- a/contrib/conf_merge/tc-conf-merger.pl +++ b/contrib/conf_merge/tc-conf-merger.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # Author: leak # Date: 2010-12-06 # Note: Based on conf file format of rev 10507 diff --git a/dep/SFMT/SFMT.h b/dep/SFMT/SFMT.h index 6c65cd12433..5498b9ac5fb 100644 --- a/dep/SFMT/SFMT.h +++ b/dep/SFMT/SFMT.h @@ -7,7 +7,7 @@ * in effect in addition to the GNU General Public License. * Copyright (c) 2006, 2007 by Mutsuo Saito, Makoto Matsumoto and Hiroshima University. * Copyright (c) 2008 by Agner Fog. - * Copyright (c) 2010 Trinity Core + * Copyright (c) 2012 Trinity Core * * BSD License: * Redistribution and use in source and binary forms, with or without diff --git a/dep/SFMT/randomc.h b/dep/SFMT/randomc.h index 5370a701c0e..ee5ad9aa43b 100644 --- a/dep/SFMT/randomc.h +++ b/dep/SFMT/randomc.h @@ -7,7 +7,7 @@ * in effect in addition to the GNU General Public License. * Copyright (c) 2006, 2007 by Mutsuo Saito, Makoto Matsumoto and Hiroshima University. * Copyright (c) 2008 by Agner Fog. - * Copyright (c) 2010 Trinity Core + * Copyright (c) 2012 Trinity Core * * BSD License: * Redistribution and use in source and binary forms, with or without diff --git a/doc/UnixInstall.txt b/doc/UnixInstall.txt index 8691e5cf559..71ee4282a7c 100644 --- a/doc/UnixInstall.txt +++ b/doc/UnixInstall.txt @@ -1,5 +1,5 @@ = TrinityCore -- Linux installation = -Copyright (C) 2008-2011 TrinityCore (http://www.trinitycore.org) +Copyright (C) 2008-2012 TrinityCore (http://www.trinitycore.org) ========================================================= WARNING: THIS DOCUMENTATION IS NOT ALWAYS UP TO DATE. From 286786cee05d382f5e3517a90d28ba4ae3e01e5c Mon Sep 17 00:00:00 2001 From: thomas33 Date: Sun, 11 Mar 2012 22:03:43 +0100 Subject: [PATCH 0154/1149] update headers ... sorry ^^ --- PreLoad.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PreLoad.cmake b/PreLoad.cmake index a6dc928b906..0f1c0f6ce19 100644 --- a/PreLoad.cmake +++ b/PreLoad.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2005-2010 Trinity +# Copyright (C) 2005-2012 Trinity # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without From 03a24a84e493f914d46488e8c4ae9e9d663c21d7 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Mon, 12 Mar 2012 00:45:58 +0100 Subject: [PATCH 0155/1149] Core/Units: - Implement UNIT_FIELD_HOVERHEIGHT (requires DB data). This field, sent in update object packet, will determine the height at which a creature hovers if it has movementflag_hover applied. Note that hovering will now update the server-sided z-coordinate by the value of this field, and that all subsequent positional updates to the client will need to send z coordinate MINUS the hover height offset, or the hoverheight will be visually doubled client side. - Correct our usage of movementflag_flying, movementflag_can_fly, movementflag_hover and movementflag_disable_gravity (previously levitate), and how they relate to InhabitType in the database. This fixes "flying creatures on steroids" bug (wings flapping too fast), and potentially a lot of visual issues in AI scripts. Note that a lot of scripts still set wrong movementflags, these need to be fixed on a case by case basis. - Send correct packets for SPELL_AURA_FEATHER_FALL, SPELL_AURA_WATER_WALK and SPELL_AURA_HOVER apply/unapply. - Send correct packet contents for movement update in Unit::SetSpeed. - Misc. cleanup in affected scripts. --- .../2012_03_12_00_world_creature_template.sql | 1 + src/server/game/AI/CoreAI/GuardAI.cpp | 2 +- .../game/AI/ScriptedAI/ScriptedEscortAI.cpp | 2 +- .../game/AI/ScriptedAI/ScriptedFollowerAI.cpp | 2 +- src/server/game/AI/SmartScripts/SmartAI.cpp | 12 +- .../game/Entities/Creature/Creature.cpp | 102 +++++++++++----- src/server/game/Entities/Creature/Creature.h | 6 +- src/server/game/Entities/Object/Object.cpp | 19 ++- src/server/game/Entities/Object/Object.h | 3 +- src/server/game/Entities/Player/Player.cpp | 20 ++++ src/server/game/Entities/Player/Player.h | 9 +- src/server/game/Entities/Unit/Unit.cpp | 113 ++++++++++++------ src/server/game/Entities/Unit/Unit.h | 45 ++++--- src/server/game/Globals/ObjectMgr.cpp | 49 +++++--- src/server/game/Maps/Map.cpp | 12 ++ .../PointMovementGenerator.cpp | 2 +- .../RandomMovementGenerator.cpp | 2 +- .../game/Movement/Spline/MoveSplineInit.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 6 +- .../game/Spells/Auras/SpellAuraEffects.cpp | 41 +++---- src/server/scripts/Commands/cs_reload.cpp | 35 +++--- .../Karazhan/boss_nightbane.cpp | 4 +- .../EasternKingdoms/Karazhan/karazhan.cpp | 2 +- .../boss_felblood_kaelthas.cpp | 4 +- .../ScarletEnclave/the_scarlet_enclave.cpp | 2 +- .../boss_headless_horseman.cpp | 4 +- .../SunwellPlateau/boss_brutallus.cpp | 2 +- .../SunwellPlateau/boss_felmyst.cpp | 6 +- .../SunwellPlateau/boss_kalecgos.cpp | 8 +- .../SunwellPlateau/boss_kiljaeden.cpp | 6 +- .../EasternKingdoms/ZulAman/boss_akilzon.cpp | 6 +- .../EasternKingdoms/ZulAman/boss_janalai.cpp | 2 +- .../scripts/EasternKingdoms/undercity.cpp | 4 +- .../EasternKingdoms/western_plaguelands.cpp | 2 +- .../BattleForMountHyjal/hyjal_trash.cpp | 6 +- .../Kalimdor/OnyxiasLair/boss_onyxia.cpp | 4 +- src/server/scripts/Kalimdor/silithus.cpp | 8 +- .../Ahnkahet/boss_prince_taldaram.cpp | 1 + .../RubySanctum/boss_saviana_ragefire.cpp | 12 +- .../boss_anubarak_trial.cpp | 5 +- .../TrialOfTheCrusader/boss_twin_valkyr.cpp | 4 +- .../PitOfSaron/boss_krickandick.cpp | 4 +- .../PitOfSaron/boss_scourgelord_tyrannus.cpp | 2 +- .../boss_blood_prince_council.cpp | 2 +- .../boss_blood_queen_lana_thel.cpp | 36 +++--- .../boss_deathbringer_saurfang.cpp | 10 +- .../IcecrownCitadel/boss_sindragosa.cpp | 40 +++---- .../IcecrownCitadel/boss_the_lich_king.cpp | 8 +- .../IcecrownCitadel/icecrown_citadel.cpp | 4 +- .../Northrend/Naxxramas/boss_sapphiron.cpp | 4 +- .../Nexus/EyeOfEternity/boss_malygos.cpp | 20 ++-- .../Northrend/Nexus/Oculus/boss_urom.cpp | 4 +- .../Northrend/Nexus/Oculus/boss_varos.cpp | 1 + .../Ulduar/Ulduar/boss_assembly_of_iron.cpp | 2 +- .../Ulduar/Ulduar/boss_razorscale.cpp | 8 +- .../UtgardeKeep/boss_ingvar_the_plunderer.cpp | 1 + .../UtgardePinnacle/boss_palehoof.cpp | 1 + .../UtgardePinnacle/boss_skadi.cpp | 6 +- .../UtgardePinnacle/boss_svala.cpp | 96 +++------------ .../UtgardePinnacle/boss_ymiron.cpp | 2 +- .../scripts/Northrend/sholazar_basin.cpp | 2 +- .../SethekkHalls/boss_tailonking_ikiss.cpp | 2 +- .../Outland/BlackTemple/boss_illidan.cpp | 6 +- .../SerpentShrine/boss_lady_vashj.cpp | 2 +- .../SerpentShrine/boss_lurker_below.cpp | 2 +- .../SerpentShrine/instance_serpent_shrine.cpp | 2 +- .../boss_vazruden_the_herald.cpp | 4 +- .../boss_watchkeeper_gargolmar.cpp | 2 +- .../Outland/TempestKeep/Eye/boss_alar.cpp | 6 +- .../Outland/TempestKeep/Eye/boss_kaelthas.cpp | 2 +- .../Outland/TempestKeep/arcatraz/arcatraz.cpp | 2 +- .../scripts/Outland/blades_edge_mountains.cpp | 2 +- .../scripts/Outland/shadowmoon_valley.cpp | 8 +- src/server/scripts/World/npcs_special.cpp | 3 +- 74 files changed, 489 insertions(+), 384 deletions(-) create mode 100644 sql/updates/world/2012_03_12_00_world_creature_template.sql diff --git a/sql/updates/world/2012_03_12_00_world_creature_template.sql b/sql/updates/world/2012_03_12_00_world_creature_template.sql new file mode 100644 index 00000000000..cc70ff7a557 --- /dev/null +++ b/sql/updates/world/2012_03_12_00_world_creature_template.sql @@ -0,0 +1 @@ +ALTER TABLE `creature_template` ADD COLUMN `HoverHeight` FLOAT NOT NULL DEFAULT 1 AFTER `InhabitType`; diff --git a/src/server/game/AI/CoreAI/GuardAI.cpp b/src/server/game/AI/CoreAI/GuardAI.cpp index b78fec7c142..df29d485cba 100755 --- a/src/server/game/AI/CoreAI/GuardAI.cpp +++ b/src/server/game/AI/CoreAI/GuardAI.cpp @@ -54,7 +54,7 @@ bool GuardAI::CanSeeAlways(WorldObject const* obj) void GuardAI::MoveInLineOfSight(Unit* unit) { // Ignore Z for flying creatures - if (!me->canFly() && me->GetDistanceZ(unit) > CREATURE_Z_ATTACK_RANGE) + if (!me->CanFly() && me->GetDistanceZ(unit) > CREATURE_Z_ATTACK_RANGE) return; if (!me->getVictim() && me->IsValidAttackTarget(unit) && diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 1e0c3f5c1fc..688d48b41ad 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -95,7 +95,7 @@ void npc_escortAI::MoveInLineOfSight(Unit* who) if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(who)) return; - if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; if (me->IsHostileTo(who)) diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index e0fe12082f1..13bbbe2c338 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -93,7 +93,7 @@ void FollowerAI::MoveInLineOfSight(Unit* who) if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(who)) return; - if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; if (me->IsHostileTo(who)) diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 50c7aba0360..4cf438da5a4 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -729,17 +729,7 @@ void SmartAI::SetRun(bool run) void SmartAI::SetFly(bool fly) { - if (fly) - { - me->SetLevitate(true); - me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); - } - else - { - me->SetLevitate(false); - me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); - } - me->SetFlying(fly); + me->SetDisableGravity(fly); me->SendMovementFlagUpdate(); } diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 2b4f1275993..1fb972ccfdf 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -334,7 +334,8 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data SetSpeed(MOVE_FLIGHT, 1.0f); // using 1.0 rate SetFloatValue(OBJECT_FIELD_SCALE_X, cinfo->scale); - SetLevitate(canFly()); + + SetFloatValue(UNIT_FIELD_HOVERHEIGHT, cinfo->HoverHeight); // checked at loading m_defaultMovementType = MovementGeneratorType(cinfo->MovementType); @@ -418,10 +419,25 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data) ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true); } - // TODO: In fact monster move flags should be set - not movement flags. - if (cInfo->InhabitType & INHABIT_AIR) - AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING); + //! Suspect it works this way: + //! If creature can walk and fly (usually with pathing) + //! Set MOVEMENTFLAG_CAN_FLY. Otherwise if it can only fly + //! Set MOVEMENTFLAG_DISABLE_GRAVITY + //! The only time I saw Movement Flags: DisableGravity, CanFly, Flying (50332672) on the same unit + //! it was a vehicle + if (cInfo->InhabitType & INHABIT_AIR && cInfo->InhabitType & INHABIT_GROUND) + SetCanFly(true); + else if (cInfo->InhabitType & INHABIT_AIR) + SetDisableGravity(true); + /*! Implemented in LoadCreatureAddon. Suspect there's a rule for UNIT_BYTE_1_FLAG_HOVER + in relation to DisableGravity also. + else if (GetByteValue(UNIT_FIELD_BYTES_1, 3) & UNIT_BYTE_1_FLAG_HOVER) + SetHover(true); + + */ + + // TODO: Shouldn't we check whether or not the creature is in water first? if (cInfo->InhabitType & INHABIT_WATER) AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); @@ -742,6 +758,14 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, return false; } + //oX = x; oY = y; dX = x; dY = y; m_moveTime = 0; m_startMove = 0; + if (!CreateFromProto(guidlow, Entry, vehId, team, data)) + return false; + + //! Need to be called after CreateFromProto + if (HasUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY)) + z += GetFloatValue(UNIT_FIELD_HOVERHEIGHT); + Relocate(x, y, z, ang); if (!IsPositionValid()) @@ -750,10 +774,6 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, return false; } - //oX = x; oY = y; dX = x; dY = y; m_moveTime = 0; m_startMove = 0; - if (!CreateFromProto(guidlow, Entry, vehId, team, data)) - return false; - switch (GetCreatureTemplate()->rank) { case CREATURE_ELITE_RARE: @@ -783,17 +803,6 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, SetByteValue(UNIT_FIELD_BYTES_0, 2, minfo->gender); } - if (GetCreatureTemplate()->InhabitType & INHABIT_AIR) - { - if (GetDefaultMovementType() == IDLE_MOTION_TYPE) - AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); - else - SetFlying(true); - } - - if (GetCreatureTemplate()->InhabitType & INHABIT_WATER) - AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); - LastUsedScriptID = GetCreatureTemplate()->ScriptID; // TODO: Replace with spell, handle from DB @@ -1065,11 +1074,11 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) data.equipmentId = GetEquipmentId(); data.posX = GetPositionX(); data.posY = GetPositionY(); - data.posZ = GetPositionZ(); + data.posZ = GetPositionZMinusOffset(); data.orientation = GetOrientation(); data.spawntimesecs = m_respawnDelay; // prevent add data integrity problems - data.spawndist = GetDefaultMovementType() == IDLE_MOTION_TYPE ? 0 : m_respawnradius; + data.spawndist = GetDefaultMovementType() == IDLE_MOTION_TYPE ? 0.0f : m_respawnradius; data.currentwaypoint = 0; data.curhealth = GetHealth(); data.curmana = GetPower(POWER_MANA); @@ -1287,7 +1296,7 @@ bool Creature::LoadCreatureFromDB(uint32 guid, Map* map, bool addToMap) if (m_respawnTime) // respawn on Update { m_deathState = DEAD; - if (canFly()) + if (CanFly()) { float tz = map->GetHeight(GetPhaseMask(), data->posX, data->posY, data->posZ, false); if (data->posZ - tz > 0.1f) @@ -1420,7 +1429,7 @@ bool Creature::canStartAttack(Unit const* who, bool force) const if (who->GetTypeId() == TYPEID_UNIT && who->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET) return false; - if (!canFly() && (GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE + m_CombatDistance)) + if (!CanFly() && (GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE + m_CombatDistance)) //|| who->IsControlledByPlayer() && who->IsFlying())) // we cannot check flying for other creatures, too much map/vmap calculation // TODO: should switch to range attack @@ -1517,7 +1526,7 @@ void Creature::setDeathState(DeathState s) if (m_formation && m_formation->getLeader() == this) m_formation->FormationReset(true); - if ((canFly() || IsFlying())) + if ((CanFly() || IsFlying())) i_motionMaster.MoveFall(); Unit::setDeathState(CORPSE); @@ -1532,7 +1541,7 @@ void Creature::setDeathState(DeathState s) CreatureTemplate const* cinfo = GetCreatureTemplate(); SetWalk(true); if (GetCreatureTemplate()->InhabitType & INHABIT_AIR) - AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING); + SetDisableGravity(true); if (GetCreatureTemplate()->InhabitType & INHABIT_WATER) AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); @@ -2040,6 +2049,12 @@ bool Creature::LoadCreaturesAddon(bool reload) SetByteValue(UNIT_FIELD_BYTES_1, 1, 0); SetByteValue(UNIT_FIELD_BYTES_1, 2, uint8((cainfo->bytes1 >> 16) & 0xFF)); SetByteValue(UNIT_FIELD_BYTES_1, 3, uint8((cainfo->bytes1 >> 24) & 0xFF)); + + //! Suspected correlation between UNIT_FIELD_BYTES_1, offset 3, value 0x2: + //! If no inhabittype_fly (if no MovementFlag_DisableGravity flag found in sniffs) + //! Set MovementFlag_Hover. Otherwise do nothing. + if (GetByteValue(UNIT_FIELD_BYTES_1, 3) & UNIT_BYTE1_FLAG_HOVER && !IsLevitating()) + AddUnitMovementFlag(MOVEMENTFLAG_HOVER); } if (cainfo->bytes2 != 0) @@ -2088,6 +2103,7 @@ bool Creature::LoadCreaturesAddon(bool reload) sLog->outDebug(LOG_FILTER_UNITS, "Spell: %u added to creature (GUID: %u Entry: %u)", *itr, GetGUIDLow(), GetEntry()); } } + return true; } @@ -2415,17 +2431,43 @@ bool Creature::SetWalk(bool enable) WorldPacket data(enable ? SMSG_SPLINE_MOVE_SET_WALK_MODE : SMSG_SPLINE_MOVE_SET_RUN_MODE, 9); data.append(GetPackGUID()); - SendMessageToSet(&data, true); + SendMessageToSet(&data, false); return true; } -bool Creature::SetLevitate(bool enable) +bool Creature::SetDisableGravity(bool disable, bool packetOnly/*=false*/) { - if (!Unit::SetLevitate(enable)) + //! It's possible only a packet is sent but moveflags are not updated + //! Need more research on this + if (!packetOnly && !Unit::SetDisableGravity(disable)) return false; - WorldPacket data(enable ? SMSG_SPLINE_MOVE_GRAVITY_DISABLE : SMSG_SPLINE_MOVE_GRAVITY_ENABLE, 9); + if (!movespline->Initialized()) + return true; + + WorldPacket data(disable ? SMSG_SPLINE_MOVE_GRAVITY_DISABLE : SMSG_SPLINE_MOVE_GRAVITY_ENABLE, 9); data.append(GetPackGUID()); - SendMessageToSet(&data, true); + SendMessageToSet(&data, false); + return true; +} + +bool Creature::SetHover(bool enable) +{ + if (!Unit::SetHover(enable)) + return false; + + //! Unconfirmed for players: + if (enable) + SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_HOVER); + else + RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_HOVER); + + if (!movespline->Initialized()) + return true; + + //! Not always a packet is sent + WorldPacket data(enable ? SMSG_SPLINE_MOVE_SET_HOVER : SMSG_SPLINE_MOVE_UNSET_HOVER, 9); + data.append(GetPackGUID()); + SendMessageToSet(&data, false); return true; } diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index f986e09e7cb..2f9549fd70a 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -134,6 +134,7 @@ struct CreatureTemplate std::string AIName; uint32 MovementType; uint32 InhabitType; + float HoverHeight; float ModHealth; float ModMana; float ModArmor; @@ -467,7 +468,7 @@ class Creature : public Unit, public GridObject, public MapCreature bool isGuard() const { return GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_GUARD; } bool canWalk() const { return GetCreatureTemplate()->InhabitType & INHABIT_GROUND; } bool canSwim() const { return GetCreatureTemplate()->InhabitType & INHABIT_WATER; } - //bool canFly() const { return GetCreatureTemplate()->InhabitType & INHABIT_AIR; } + bool CanFly() const { return GetCreatureTemplate()->InhabitType & INHABIT_AIR; } void SetReactState(ReactStates st) { m_reactState = st; } ReactStates GetReactState() { return m_reactState; } @@ -521,7 +522,8 @@ class Creature : public Unit, public GridObject, public MapCreature CreatureAI* AI() const { return (CreatureAI*)i_AI; } bool SetWalk(bool enable); - bool SetLevitate(bool enable); + bool SetDisableGravity(bool disable, bool packetOnly = false); + bool SetHover(bool enable); uint32 GetShieldBlockValue() const //dunno mob block value { diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 2a2b78f4630..56ddd14dc3a 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -340,7 +340,10 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const *data << ((WorldObject*)this)->GetPositionX(); *data << ((WorldObject*)this)->GetPositionY(); - *data << ((WorldObject*)this)->GetPositionZ(); + if (isType(TYPEMASK_UNIT)) + *data << ((Unit*)this)->GetPositionZMinusOffset(); + else + *data << ((WorldObject*)this)->GetPositionZ(); if (transport) { @@ -352,7 +355,10 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const { *data << ((WorldObject*)this)->GetPositionX(); *data << ((WorldObject*)this)->GetPositionY(); - *data << ((WorldObject*)this)->GetPositionZ(); + if (isType(TYPEMASK_UNIT)) + *data << ((Unit*)this)->GetPositionZMinusOffset(); + else + *data << ((WorldObject*)this)->GetPositionZ(); } *data << ((WorldObject*)this)->GetOrientation(); @@ -369,7 +375,10 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const { *data << ((WorldObject*)this)->GetPositionX(); *data << ((WorldObject*)this)->GetPositionY(); - *data << ((WorldObject*)this)->GetPositionZ(); + if (isType(TYPEMASK_UNIT)) + *data << ((Unit*)this)->GetPositionZMinusOffset(); + else + *data << ((WorldObject*)this)->GetPositionZ(); *data << ((WorldObject*)this)->GetOrientation(); } } @@ -1557,7 +1566,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const { // non fly unit don't must be in air // non swim unit must be at ground (mostly speedup, because it don't must be in water and water level check less fast - if (!ToCreature()->canFly()) + if (!ToCreature()->CanFly()) { bool canSwim = ToCreature()->canSwim(); float ground_z = z; @@ -1583,7 +1592,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const case TYPEID_PLAYER: { // for server controlled moves playr work same as creature (but it can always swim) - if (!ToPlayer()->canFly()) + if (!ToPlayer()->CanFly()) { float ground_z = z; float max_z = GetBaseMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK)); diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index c243527570b..fd8deb1b841 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -776,7 +776,8 @@ class WorldObject : public Object, public WorldLocation GetClosePoint(x, y, z, GetObjectSize()); ang = GetOrientation(); } - Position pos = {x, y, z, ang}; + Position pos; + pos.Relocate(x, y, z, ang); return SummonCreature(id, pos, spwtype, despwtime, 0); } GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 8318bd246d0..f3f376dae04 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -22170,6 +22170,18 @@ void Player::SendAurasForTarget(Unit* target) if (!target || target->GetVisibleAuras()->empty()) // speedup things return; + /*! Blizz sends certain movement packets sometimes even before CreateObject + These movement packets are usually found in SMSG_COMPRESSED_MOVES + */ + if (target->HasAuraType(SPELL_AURA_FEATHER_FALL)) + target->SendMovementFeatherFall(); + + if (target->HasAuraType(SPELL_AURA_WATER_WALK)) + target->SendMovementWaterWalking(); + + if (target->HasAuraType(SPELL_AURA_HOVER)) + target->SendMovementHover(); + WorldPacket data(SMSG_AURA_UPDATE_ALL); data.append(target->GetPackGUID()); @@ -25158,3 +25170,11 @@ bool Player::IsInWhisperWhiteList(uint64 guid) } return false; } + +bool Player::SetHover(bool enable) +{ + if (!Unit::SetHover(enable)) + return false; + + return true; +} diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index bd58827c0e4..7f6b2322e93 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2287,6 +2287,8 @@ class Player : public Unit, public GridObject m_mover->m_movedPlayer = this; } + bool SetHover(bool enable); + void SetSeer(WorldObject* target) { m_seer = target; } void SetViewpoint(WorldObject* target, bool apply); WorldObject* GetViewpoint() const; @@ -2479,6 +2481,10 @@ class Player : public Unit, public GridObject void AddWhisperWhiteList(uint64 guid) { WhisperList.push_back(guid); } bool IsInWhisperWhiteList(uint64 guid); + #pragma region Player Movement + + bool CanFly() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY); } + //! Return collision height sent to client float GetCollisionHeight(bool mounted) { @@ -2511,8 +2517,9 @@ class Player : public Unit, public GridObject return modelData->CollisionHeight; } - //! TODO: Need a proper calculation for collision height when mounted } + #pragma endregion Player Movement + protected: // Gamemaster whisper whitelist diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3411d285b1e..6d4963f1960 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3049,7 +3049,7 @@ bool Unit::isInAccessiblePlaceFor(Creature const* c) const if (IsInWater()) return c->canSwim(); else - return c->canWalk() || c->canFly(); + return c->canWalk() || c->CanFly(); } bool Unit::IsInWater() const @@ -12597,15 +12597,7 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) return; } - data.append(GetPackGUID()); - data << uint32(0); // movement flags - data << uint16(0); // unk flags - data << uint32(getMSTime()); - data << float(GetPositionX()); - data << float(GetPositionY()); - data << float(GetPositionZ()); - data << float(GetOrientation()); - data << uint32(0); // fall time + BuildMovementPacket(&data); data << float(GetSpeed(mtype)); SendMessageToSet(&data, true); } @@ -12664,14 +12656,6 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) } } -void Unit::SetHover(bool on) -{ - if (on) - CastSpell(this, 11010, true); - else - RemoveAurasDueToSpell(11010); -} - void Unit::setDeathState(DeathState s) { // death state needs to be updated before RemoveAllAurasOnDeath() calls HandleChannelDeathItem(..) so that @@ -17058,12 +17042,12 @@ void Unit::_ExitVehicle(Position const* exitPosition) void Unit::BuildMovementPacket(ByteBuffer *data) const { - *data << uint32(GetUnitMovementFlags()); // movement flags - *data << uint16(m_movementInfo.flags2); // 2.3.0 - *data << uint32(getMSTime()); // time + *data << uint32(GetUnitMovementFlags()); // movement flags + *data << uint16(GetExtraUnitMovementFlags()); // 2.3.0 + *data << uint32(getMSTime()); // time / counter *data << GetPositionX(); *data << GetPositionY(); - *data << GetPositionZ(); + *data << GetPositionZMinusOffset(); *data << GetOrientation(); // 0x00000200 @@ -17108,18 +17092,12 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const *data << (float)m_movementInfo.splineElevation; } -void Unit::SetFlying(bool apply) +void Unit::SetCanFly(bool apply) { if (apply) - { - SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02); - AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING); - } + AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); else - { - RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02); - RemoveUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING); - } + RemoveUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); } void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool casting /*= false*/) @@ -17165,11 +17143,20 @@ bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool tel return (relocated || turn); } +//! Only server-side orientation update, does not broadcast to client void Unit::UpdateOrientation(float orientation) { SetOrientation(orientation); if (IsVehicle()) - GetVehicleKit()->RelocatePassengers(GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); + GetVehicleKit()->RelocatePassengers(GetPositionX(), GetPositionY(), GetPositionZ(), orientation); +} + +//! Only server-side height update, does not broadcast to client +void Unit::UpdateHeight(float newZ) +{ + Relocate(GetPositionX(), GetPositionY(), newZ); + if (IsVehicle()) + GetVehicleKit()->RelocatePassengers(GetPositionX(), GetPositionY(), newZ, GetOrientation()); } void Unit::SendThreatListUpdate() @@ -17457,15 +17444,65 @@ bool Unit::SetWalk(bool enable) return true; } -bool Unit::SetLevitate(bool enable) +bool Unit::SetDisableGravity(bool disable) { - if (enable == IsLevitating()) + if (disable == IsLevitating()) return false; - - if (enable) - AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + + if (disable) + AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); else - RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + RemoveUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); return true; } + +bool Unit::SetHover(bool enable) +{ + if (enable == HasUnitMovementFlag(MOVEMENTFLAG_HOVER)) + return false; + + if (enable) + { + //! No need to check height on ascent + AddUnitMovementFlag(MOVEMENTFLAG_HOVER); + if (float hh = GetFloatValue(UNIT_FIELD_HOVERHEIGHT)) + UpdateHeight(GetPositionZ() + hh); + } + else + { + RemoveUnitMovementFlag(MOVEMENTFLAG_HOVER); + if (float hh = GetFloatValue(UNIT_FIELD_HOVERHEIGHT)) + { + float newZ = GetPositionZ() - hh; + UpdateAllowedPositionZ(GetPositionX(), GetPositionY(), newZ); + UpdateHeight(newZ); + } + } + + return true; +} + +void Unit::SendMovementHover() +{ + WorldPacket data(MSG_MOVE_HOVER, 64); + data.append(GetPackGUID()); + BuildMovementPacket(&data); + SendMessageToSet(&data, true); +} + +void Unit::SendMovementWaterWalking() +{ + WorldPacket data(MSG_MOVE_WATER_WALK, 64); + data.append(GetPackGUID()); + BuildMovementPacket(&data); + SendMessageToSet(&data, true); +} + +void Unit::SendMovementFeatherFall() +{ + WorldPacket data(MSG_MOVE_FEATHER_FALL, 64); + data.append(GetPackGUID()); + BuildMovementPacket(&data); + SendMessageToSet(&data, true); +} diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index b07f2ae1c16..79ed0ec2f3d 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -184,10 +184,10 @@ enum UnitStandFlags // byte flags value (UNIT_FIELD_BYTES_1, 3) enum UnitBytes1_Flags { - UNIT_BYTE1_FLAG_ALWAYS_STAND = 0x01, - UNIT_BYTE1_FLAG_UNK_2 = 0x02, - UNIT_BYTE1_FLAG_UNK_3 = 0x04, - UNIT_BYTE1_FLAG_ALL = 0xFF + UNIT_BYTE1_FLAG_ALWAYS_STAND = 0x01, + UNIT_BYTE1_FLAG_HOVER = 0x02, + UNIT_BYTE1_FLAG_UNK_3 = 0x04, + UNIT_BYTE1_FLAG_ALL = 0xFF }; // high byte (3 from 0..3) of UNIT_FIELD_BYTES_2 @@ -676,7 +676,7 @@ enum MovementFlags MOVEMENTFLAG_PITCH_DOWN = 0x00000080, MOVEMENTFLAG_WALKING = 0x00000100, // Walking MOVEMENTFLAG_ONTRANSPORT = 0x00000200, // Used for flying on some creatures - MOVEMENTFLAG_LEVITATING = 0x00000400, + MOVEMENTFLAG_DISABLE_GRAVITY = 0x00000400, // Former MOVEMENTFLAG_LEVITATING. This is used when walking is not possible. MOVEMENTFLAG_ROOT = 0x00000800, // Must not be set along with MOVEMENTFLAG_MASK_MOVING MOVEMENTFLAG_JUMPING = 0x00001000, MOVEMENTFLAG_FALLING = 0x00002000, // damage dealt on that type of falling @@ -690,8 +690,8 @@ enum MovementFlags MOVEMENTFLAG_SWIMMING = 0x00200000, // appears with fly flag also MOVEMENTFLAG_ASCENDING = 0x00400000, // press "space" when flying MOVEMENTFLAG_DESCENDING = 0x00800000, - MOVEMENTFLAG_CAN_FLY = 0x01000000, // can fly - MOVEMENTFLAG_FLYING = 0x02000000, // hover + MOVEMENTFLAG_CAN_FLY = 0x01000000, // Appears when unit can fly AND also walk + MOVEMENTFLAG_FLYING = 0x02000000, // unit is actually flying. pretty sure this is only used for players. creatures use disable_gravity MOVEMENTFLAG_SPLINE_ELEVATION = 0x04000000, // used for flight paths MOVEMENTFLAG_SPLINE_ENABLED = 0x08000000, // used for flight paths MOVEMENTFLAG_WATERWALKING = 0x10000000, // prevent unit from falling through water @@ -706,6 +706,10 @@ enum MovementFlags MOVEMENTFLAG_MASK_TURNING = MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT, + + //! TODO if needed: add more flags to this masks that are exclusive to players + MOVEMENTFLAG_MASK_PLAYER_ONLY = + MOVEMENTFLAG_FLYING, }; enum MovementFlags2 { @@ -1615,6 +1619,7 @@ class Unit : public WorldObject // returns true if unit's position really changed bool UpdatePosition(const Position &pos, bool teleport = false) { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); } void UpdateOrientation(float orientation); + void UpdateHeight(float newZ); void KnockbackFrom(float x, float y, float speedXY, float speedZ); void JumpTo(float speedXY, float speedZ, bool forward = true); @@ -1626,10 +1631,14 @@ class Unit : public WorldObject //void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = NULL); void SendMonsterMoveTransport(Unit* vehicleOwner); void SendMovementFlagUpdate(); - bool IsLevitating() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_LEVITATING);} + void SendMovementHover(); + void SendMovementFeatherFall(); + void SendMovementWaterWalking(); + bool IsLevitating() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);} bool IsWalking() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING);} virtual bool SetWalk(bool enable); - virtual bool SetLevitate(bool enable); + virtual bool SetDisableGravity(bool disable); + bool SetHover(bool enable); void SetInFront(Unit const* target); void SetFacingTo(float ori); @@ -2053,7 +2062,6 @@ class Unit : public WorldObject void SetSpeed(UnitMoveType mtype, float rate, bool forced = false); float m_TempSpeed; - void SetHover(bool on); bool isHover() const { return HasAuraType(SPELL_AURA_HOVER); } float ApplyEffectModifiers(SpellInfo const* spellProto, uint8 effect_index, float value) const; @@ -2077,7 +2085,7 @@ class Unit : public WorldObject void AddUnitMovementFlag(uint32 f) { m_movementInfo.flags |= f; } void RemoveUnitMovementFlag(uint32 f) { m_movementInfo.flags &= ~f; } - uint32 HasUnitMovementFlag(uint32 f) const { return m_movementInfo.flags & f; } + bool HasUnitMovementFlag(uint32 f) const { return (m_movementInfo.flags & f) == f; } uint32 GetUnitMovementFlags() const { return m_movementInfo.flags; } void SetUnitMovementFlags(uint32 f) { m_movementInfo.flags = f; } @@ -2087,6 +2095,15 @@ class Unit : public WorldObject uint16 GetExtraUnitMovementFlags() const { return m_movementInfo.flags2; } void SetExtraUnitMovementFlags(uint16 f) { m_movementInfo.flags2 = f; } + float GetPositionZMinusOffset() const + { + float offset = 0.0f; + if (HasUnitMovementFlag(MOVEMENTFLAG_HOVER)) + offset = GetFloatValue(UNIT_FIELD_HOVERHEIGHT); + + return GetPositionZ() - offset; + } + void SetControlled(bool apply, UnitState state); void AddComboPointHolder(uint32 lowguid) { m_ComboPointHolders.insert(lowguid); } @@ -2171,9 +2188,9 @@ class Unit : public WorldObject bool isMoving() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_MASK_MOVING); } bool isTurning() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_MASK_TURNING); } - bool canFly() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY); } - bool IsFlying() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING); } - void SetFlying(bool apply); + virtual bool CanFly() const = 0; + bool IsFlying() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_DISABLE_GRAVITY); } + void SetCanFly(bool apply); void RewardRage(uint32 damage, uint32 weaponSpeedHitFactor, bool attacker); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 11977280177..f2b867b91ff 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -377,9 +377,9 @@ void ObjectMgr::LoadCreatureTemplates() // 54 55 56 57 58 59 60 61 62 63 64 65 66 "spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, " // 67 68 69 70 71 72 73 74 75 76 77 - "InhabitType, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, " + "InhabitType, HoverHeight, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, " // 78 79 80 81 82 83 - "movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName " + " questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName " "FROM creature_template;"); if (!result) @@ -463,20 +463,21 @@ void ObjectMgr::LoadCreatureTemplates() creatureTemplate.AIName = fields[65].GetString(); creatureTemplate.MovementType = uint32(fields[66].GetUInt8()); creatureTemplate.InhabitType = uint32(fields[67].GetUInt8()); - creatureTemplate.ModHealth = fields[68].GetFloat(); - creatureTemplate.ModMana = fields[69].GetFloat(); - creatureTemplate.ModArmor = fields[70].GetFloat(); - creatureTemplate.RacialLeader = fields[71].GetBool(); + creatureTemplate.HoverHeight = fields[68].GetFloat(); + creatureTemplate.ModHealth = fields[69].GetFloat(); + creatureTemplate.ModMana = fields[70].GetFloat(); + creatureTemplate.ModArmor = fields[71].GetFloat(); + creatureTemplate.RacialLeader = fields[72].GetBool(); for (uint8 i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i) - creatureTemplate.questItems[i] = fields[72 + i].GetUInt32(); + creatureTemplate.questItems[i] = fields[73 + i].GetUInt32(); - creatureTemplate.movementId = fields[78].GetUInt32(); - creatureTemplate.RegenHealth = fields[79].GetBool(); - creatureTemplate.equipmentId = fields[80].GetUInt32(); - creatureTemplate.MechanicImmuneMask = fields[81].GetUInt32(); - creatureTemplate.flags_extra = fields[82].GetUInt32(); - creatureTemplate.ScriptID = GetScriptId(fields[83].GetCString()); + creatureTemplate.movementId = fields[79].GetUInt32(); + creatureTemplate.RegenHealth = fields[80].GetBool(); + creatureTemplate.equipmentId = fields[81].GetUInt32(); + creatureTemplate.MechanicImmuneMask = fields[82].GetUInt32(); + creatureTemplate.flags_extra = fields[83].GetUInt32(); + creatureTemplate.ScriptID = GetScriptId(fields[84].GetCString()); ++count; } @@ -494,7 +495,7 @@ void ObjectMgr::LoadCreatureTemplateAddons() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 6 + // 0 1 2 3 4 5 6 QueryResult result = WorldDatabase.Query("SELECT entry, path_id, mount, bytes1, bytes2, emote, auras FROM creature_template_addon"); if (!result) @@ -549,7 +550,10 @@ void ObjectMgr::LoadCreatureTemplateAddons() } if (!sEmotesStore.LookupEntry(creatureAddon.emote)) - sLog->outErrorDb("Creature (Entry: %u) has invalid emote (%u) defined in `creature_template_addon`.", entry, creatureAddon.emote); + { + sLog->outErrorDb("Creature (Entry: %u) has invalid emote (%u) defined in `creature_addon`.", entry, creatureAddon.emote); + creatureAddon.emote = 0; + } ++count; } @@ -793,6 +797,12 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) const_cast(cInfo)->InhabitType = INHABIT_ANYWHERE; } + if (cInfo->HoverHeight < 0.0f) + { + sLog->outErrorDb("Creature (Entry: %u) has wrong value (%f) in `HoverHeight`", cInfo->Entry, cInfo->HoverHeight); + const_cast(cInfo)->HoverHeight = 1.0f; + } + if (cInfo->VehicleId) { VehicleEntry const* vehId = sVehicleStore.LookupEntry(cInfo->VehicleId); @@ -862,7 +872,7 @@ void ObjectMgr::LoadCreatureAddons() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 6 + // 0 1 2 3 4 5 6 QueryResult result = WorldDatabase.Query("SELECT guid, path_id, mount, bytes1, bytes2, emote, auras FROM creature_addon"); if (!result) @@ -899,7 +909,7 @@ void ObjectMgr::LoadCreatureAddons() creatureAddon.bytes1 = fields[3].GetUInt32(); creatureAddon.bytes2 = fields[4].GetUInt32(); creatureAddon.emote = fields[5].GetUInt32(); - + Tokens tokens(fields[6].GetString(), ' '); uint8 i = 0; creatureAddon.auras.resize(tokens.size()); @@ -914,7 +924,7 @@ void ObjectMgr::LoadCreatureAddons() creatureAddon.auras[i++] = uint32(atol(*itr)); } - if (creatureAddon.mount) + if (creatureAddon.mount) { if (!sCreatureDisplayInfoStore.LookupEntry(creatureAddon.mount)) { @@ -924,7 +934,10 @@ void ObjectMgr::LoadCreatureAddons() } if (!sEmotesStore.LookupEntry(creatureAddon.emote)) + { sLog->outErrorDb("Creature (GUID: %u) has invalid emote (%u) defined in `creature_addon`.", guid, creatureAddon.emote); + creatureAddon.emote = 0; + } ++count; } diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 7f27a474534..7403a86a47f 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -702,6 +702,12 @@ void Map::PlayerRelocation(Player* player, float x, float y, float z, float orie Cell old_cell(player->GetPositionX(), player->GetPositionY()); Cell new_cell(x, y); + //! If hovering, always increase our server-side Z position + //! Client automatically projects correct position based on Z coord sent in monster move + //! and UNIT_FIELD_HOVERHEIGHT sent in object updates + if (player->HasUnitMovementFlag(MOVEMENTFLAG_HOVER)) + z += player->GetFloatValue(UNIT_FIELD_HOVERHEIGHT); + player->Relocate(x, y, z, orientation); if (player->IsVehicle()) player->GetVehicleKit()->RelocatePassengers(x, y, z, orientation); @@ -731,6 +737,12 @@ void Map::CreatureRelocation(Creature* creature, float x, float y, float z, floa if (!respawnRelocationOnFail && !getNGrid(new_cell.GridX(), new_cell.GridY())) return; + //! If hovering, always increase our server-side Z position + //! Client automatically projects correct position based on Z coord sent in monster move + //! and UNIT_FIELD_HOVERHEIGHT sent in object updates + if (creature->HasUnitMovementFlag(MOVEMENTFLAG_HOVER)) + z += creature->GetFloatValue(UNIT_FIELD_HOVERHEIGHT); + // delay creature move for grid/cell to grid/cell moves if (old_cell.DiffCell(new_cell) || old_cell.DiffGrid(new_cell)) { diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index fddfe5f8fb0..91b50344ccb 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -57,7 +57,7 @@ bool PointMovementGenerator::Update(T &unit, const uint32 & /*diff*/) } template -void PointMovementGenerator:: Finalize(T &unit) +void PointMovementGenerator::Finalize(T &unit) { unit.ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE); diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index b65fa210723..e520253eb46 100755 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -42,7 +42,7 @@ void RandomMovementGenerator::_setRandomLocation(Creature& creature) // For 2D/3D system selection //bool is_land_ok = creature.CanWalk(); // not used? //bool is_water_ok = creature.CanSwim(); // not used? - bool is_air_ok = creature.canFly(); + bool is_air_ok = creature.CanFly(); const float angle = float(rand_norm()) * static_cast(M_PI*2.0f); const float range = float(rand_norm()) * wander_distance; diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index b5ae923dc32..f5d2ae59329 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -100,7 +100,7 @@ namespace Movement { // mix existing state into new args.flags.walkmode = unit.m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING); - args.flags.flying = unit.m_movementInfo.HasMovementFlag((MovementFlags)(MOVEMENTFLAG_FLYING|MOVEMENTFLAG_LEVITATING)); + args.flags.flying = unit.m_movementInfo.HasMovementFlag((MovementFlags)(MOVEMENTFLAG_CAN_FLY|MOVEMENTFLAG_DISABLE_GRAVITY)); } void MoveSplineInit::SetFacing(const Unit * target) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index e5b5b20dcfa..c6ccfaa8004 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -270,10 +270,10 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x0F1*/ { "MSG_MOVE_KNOCK_BACK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x0F2*/ { "SMSG_MOVE_FEATHER_FALL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x0F3*/ { "SMSG_MOVE_NORMAL_FALL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0F4*/ { "SMSG_MOVE_SET_HOVER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0F5*/ { "SMSG_MOVE_UNSET_HOVER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, + /*0x0F4*/ { "SMSG_MOVE_SET_HOVER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, + /*0x0F5*/ { "SMSG_MOVE_UNSET_HOVER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x0F6*/ { "CMSG_MOVE_HOVER_ACK", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveHoverAck }, - /*0x0F7*/ { "MSG_MOVE_HOVER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, + /*0x0F7*/ { "MSG_MOVE_HOVER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x0F8*/ { "CMSG_TRIGGER_CINEMATIC_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x0F9*/ { "CMSG_OPENING_CINEMATIC", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x0FA*/ { "SMSG_TRIGGER_CINEMATIC", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 56bca65788c..387f76bbc7f 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2845,7 +2845,7 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode } if (target->GetTypeId() == TYPEID_UNIT) - target->SetFlying(apply); + target->SetCanFly(apply); if (Player* player = target->m_movedPlayer) { @@ -2856,7 +2856,7 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode else data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 12); data.append(target->GetPackGUID()); - data << uint32(0); // unk + data << uint32(0); // movement counter player->SendDirectMessage(&data); } } @@ -2875,14 +2875,16 @@ void AuraEffect::HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, return; } - WorldPacket data; if (apply) - data.Initialize(SMSG_MOVE_WATER_WALK, 8+4); + { + target->AddUnitMovementFlag(MOVEMENTFLAG_WATERWALKING); + target->SendMovementWaterWalking(); + } else - data.Initialize(SMSG_MOVE_LAND_WALK, 8+4); - data.append(target->GetPackGUID()); - data << uint32(0); - target->SendMessageToSet(&data, true); + { + target->RemoveUnitMovementFlag(MOVEMENTFLAG_WATERWALKING); + target->SendMovementFlagUpdate(); + } } void AuraEffect::HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -2899,14 +2901,16 @@ void AuraEffect::HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode return; } - WorldPacket data; if (apply) - data.Initialize(SMSG_MOVE_FEATHER_FALL, 8+4); + { + target->AddUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW); + target->SendMovementFeatherFall(); + } else - data.Initialize(SMSG_MOVE_NORMAL_FALL, 8+4); - data.append(target->GetPackGUID()); - data << uint32(0); - target->SendMessageToSet(&data, true); + { + target->RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW); + target->SendMovementFlagUpdate(); + } // start fall from current height if (!apply && target->GetTypeId() == TYPEID_PLAYER) @@ -2927,14 +2931,11 @@ void AuraEffect::HandleAuraHover(AuraApplication const* aurApp, uint8 mode, bool return; } - WorldPacket data; + target->SetHover(apply); //! Sets movementflags if (apply) - data.Initialize(SMSG_MOVE_SET_HOVER, 8+4); + target->SendMovementHover(); else - data.Initialize(SMSG_MOVE_UNSET_HOVER, 8+4); - data.append(target->GetPackGUID()); - data << uint32(0); - target->SendMessageToSet(&data, true); + target->SendMovementFlagUpdate(); } void AuraEffect::HandleWaterBreathing(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 28920f7c109..1520a944f6e 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -413,7 +413,7 @@ public: for (Tokens::const_iterator itr = entries.begin(); itr != entries.end(); ++itr) { uint32 entry = uint32(atoi(*itr)); - QueryResult result = WorldDatabase.PQuery("SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = %u", entry); + QueryResult result = WorldDatabase.PQuery("SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = %u", entry); if (!result) { handler->PSendSysMessage(LANG_COMMAND_CREATURETEMPLATE_NOTFOUND, entry); @@ -498,22 +498,23 @@ public: const_cast(cInfo)->AIName = fields[64].GetString(); const_cast(cInfo)->MovementType = fields[65].GetUInt32(); const_cast(cInfo)->InhabitType = fields[66].GetUInt32(); - const_cast(cInfo)->ModHealth = fields[67].GetFloat(); - const_cast(cInfo)->ModMana = fields[68].GetFloat(); - const_cast(cInfo)->ModArmor = fields[69].GetFloat(); - const_cast(cInfo)->RacialLeader = fields[70].GetBool(); - const_cast(cInfo)->questItems[0] = fields[71].GetUInt32(); - const_cast(cInfo)->questItems[1] = fields[72].GetUInt32(); - const_cast(cInfo)->questItems[2] = fields[73].GetUInt32(); - const_cast(cInfo)->questItems[3] = fields[74].GetUInt32(); - const_cast(cInfo)->questItems[4] = fields[75].GetUInt32(); - const_cast(cInfo)->questItems[5] = fields[76].GetUInt32(); - const_cast(cInfo)->movementId = fields[77].GetUInt32(); - const_cast(cInfo)->RegenHealth = fields[78].GetBool(); - const_cast(cInfo)->equipmentId = fields[79].GetUInt32(); - const_cast(cInfo)->MechanicImmuneMask = fields[80].GetUInt32(); - const_cast(cInfo)->flags_extra = fields[81].GetUInt32(); - const_cast(cInfo)->ScriptID = sObjectMgr->GetScriptId(fields[82].GetCString()); + const_cast(cInfo)->HoverHeight = fields[67].GetFloat(); + const_cast(cInfo)->ModHealth = fields[68].GetFloat(); + const_cast(cInfo)->ModMana = fields[69].GetFloat(); + const_cast(cInfo)->ModArmor = fields[70].GetFloat(); + const_cast(cInfo)->RacialLeader = fields[71].GetBool(); + const_cast(cInfo)->questItems[0] = fields[72].GetUInt32(); + const_cast(cInfo)->questItems[1] = fields[73].GetUInt32(); + const_cast(cInfo)->questItems[2] = fields[74].GetUInt32(); + const_cast(cInfo)->questItems[3] = fields[75].GetUInt32(); + const_cast(cInfo)->questItems[4] = fields[76].GetUInt32(); + const_cast(cInfo)->questItems[5] = fields[77].GetUInt32(); + const_cast(cInfo)->movementId = fields[78].GetUInt32(); + const_cast(cInfo)->RegenHealth = fields[79].GetBool(); + const_cast(cInfo)->equipmentId = fields[80].GetUInt32(); + const_cast(cInfo)->MechanicImmuneMask = fields[81].GetUInt32(); + const_cast(cInfo)->flags_extra = fields[82].GetUInt32(); + const_cast(cInfo)->ScriptID = sObjectMgr->GetScriptId(fields[83].GetCString()); sObjectMgr->CheckCreatureTemplate(cInfo); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index 2a8676d7915..0cf68852041 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -121,7 +121,7 @@ public: MovePhase = 0; me->SetSpeed(MOVE_RUN, 2.0f); - me->SetLevitate(true); + me->SetDisableGravity(true); me->SetWalk(false); me->setActive(true); @@ -240,7 +240,7 @@ public: me->InterruptSpell(CURRENT_GENERIC_SPELL); me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - me->SetLevitate(true); + me->SetDisableGravity(true); (*me).GetMotionMaster()->Clear(false); (*me).GetMotionMaster()->MovePoint(0, IntroWay[2][0], IntroWay[2][1], IntroWay[2][2]); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index b4345c61a77..fd5a77fb816 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -527,7 +527,7 @@ public: if (!Arcanagos) return; ArcanagosGUID = Arcanagos->GetGUID(); - Arcanagos->SetLevitate(true); + Arcanagos->SetDisableGravity(true); (*Arcanagos).GetMotionMaster()->MovePoint(0, ArcanagosPos[0], ArcanagosPos[1], ArcanagosPos[2]); Arcanagos->SetOrientation(ArcanagosPos[3]); me->SetOrientation(MedivPos[3]); diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index a46037f2662..0c1017edfdb 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -497,7 +497,7 @@ public: void Reset() { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); - me->SetLevitate(true); + me->SetDisableGravity(true); DoCast(me, SPELL_PHOENIX_BURN, true); BurnTimer = 2000; Death_Timer = 3000; @@ -651,7 +651,7 @@ public: ChangeTargetTimer = urand(6000, 12000); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetLevitate(true); + me->SetDisableGravity(true); me->setFaction(14); DoCast(me, SPELL_ARCANE_SPHERE_PASSIVE, true); } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp index 4f4622b6d4a..bf09e008dff 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp @@ -46,7 +46,7 @@ public: me->setActive(true); me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetFlying(true); + me->SetCanFly(true); FlyBackTimer = 500; phase = 0; diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 77099f2e2d7..b71f0ef8b9a 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -429,7 +429,7 @@ public: { me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); + me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); me->SetSpeed(MOVE_WALK, 5.0f, true); wp_reached = false; count = 0; @@ -462,7 +462,7 @@ public: instance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject break; case 19: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); break; case 20: { diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp index 78d00e19cdf..5089c3b8074 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp @@ -216,7 +216,7 @@ public: break; case 3: DoCast(me, SPELL_INTRO_FROST_BLAST); - Madrigosa->SetLevitate(true); + Madrigosa->SetDisableGravity(true); me->AttackStop(); Madrigosa->AttackStop(); IntroFrostBoltTimer = 3000; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp index 0d98efd703b..b3ea89c1d66 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp @@ -137,7 +137,7 @@ public: uiFlightCount = 0; - me->SetLevitate(true); + me->SetDisableGravity(true); me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); @@ -254,7 +254,7 @@ public: events.ScheduleEvent(EVENT_FLIGHT, 60000); break; case PHASE_FLIGHT: - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 1000); uiFlightCount = 0; uiBreathCount = 0; @@ -391,7 +391,7 @@ public: } break; case 10: - me->SetLevitate(false); + me->SetDisableGravity(false); me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); EnterPhase(PHASE_GROUND); AttackStart(SelectTarget(SELECT_TARGET_TOPAGGRO)); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index 1735c0c4f07..45153c21ea6 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -159,7 +159,7 @@ public: if (!bJustReset) //first reset at create { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - me->SetLevitate(false); + me->SetDisableGravity(false); me->SetVisible(true); me->SetStandState(UNIT_STAND_STATE_SLEEP); } @@ -231,7 +231,7 @@ public: if (ResetTimer <= diff) { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); - me->SetLevitate(false); + me->SetDisableGravity(false); me->SetVisible(true); me->SetStandState(UNIT_STAND_STATE_SLEEP); ResetTimer = 10000; @@ -400,7 +400,7 @@ public: TalkTimer = 10000; break; case 3: - me->SetLevitate(true); + me->SetDisableGravity(true); me->GetMotionMaster()->MovePoint(0, FLY_X, FLY_Y, FLY_Z); TalkTimer = 600000; break; @@ -418,7 +418,7 @@ public: TalkTimer = 3000; break; case 2: - me->SetLevitate(true); + me->SetDisableGravity(true); me->GetMotionMaster()->MovePoint(0, FLY_X, FLY_Y, FLY_Z); TalkTimer = 15000; break; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index 02a8de14fdf..e9101d123dc 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -264,7 +264,7 @@ public: { OrbsEmpowered = 0; EmpowerCount = 0; - me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); + me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->setActive(true); @@ -451,7 +451,7 @@ public: summoned->CastSpell(summoned, SPELL_SHADOW_CHANNELING, false); break; case CREATURE_ANVEENA: - summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); + summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); summoned->CastSpell(summoned, SPELL_ANVEENA_PRISON, true); summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); break; @@ -1188,7 +1188,7 @@ public: void Reset() { - me->SetLevitate(true); + me->SetDisableGravity(true); bPointReached = true; uiTimer = urand(500, 1000); uiCheckTimer = 1000; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index eee6b08d834..df8d9bb83f8 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -324,14 +324,14 @@ class boss_akilzon : public CreatureScript target->GetPosition(x, y, z); if (target) { - target->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + target->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); target->MonsterMoveWithSpeed(x, y, me->GetPositionZ()+15, 0); } Unit* Cloud = me->SummonTrigger(x, y, me->GetPositionZ()+16, 0, 15000); if (Cloud) { CloudGUID = Cloud->GetGUID(); - Cloud->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + Cloud->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); Cloud->StopMoving(); Cloud->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); Cloud->setFaction(35); @@ -409,7 +409,7 @@ class mob_akilzon_eagle : public CreatureScript EagleSwoop_Timer = urand(5000, 10000); arrived = true; TargetGUID = 0; - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); } void EnterCombat(Unit* /*who*/) {DoZoneInCombat();} diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index 8bbcdd6c036..8d29cfefc6e 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -632,7 +632,7 @@ class mob_janalai_hatchling : public CreatureScript else me->GetMotionMaster()->MovePoint(0, hatcherway[1][3][0]+rand()%4-2, 1150.0f+rand()%4-2, hatcherway[1][3][2]); - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); } void EnterCombat(Unit* /*who*/) {/*DoZoneInCombat();*/} diff --git a/src/server/scripts/EasternKingdoms/undercity.cpp b/src/server/scripts/EasternKingdoms/undercity.cpp index bf3d07ad5ae..3f088bf00b9 100644 --- a/src/server/scripts/EasternKingdoms/undercity.cpp +++ b/src/server/scripts/EasternKingdoms/undercity.cpp @@ -114,7 +114,7 @@ public: summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false); } - summoned->SetLevitate(true); + summoned->SetDisableGravity(true); targetGUID = summoned->GetGUID(); } } @@ -184,7 +184,7 @@ public: { if (EventMove_Timer <= diff) { - me->SetLevitate(true); + me->SetDisableGravity(true); me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetDistance(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW) / (5000 * 0.001f)); me->SetPosition(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetOrientation()); EventMove = false; diff --git a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp index 07766455495..1a31c29f5bb 100644 --- a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp @@ -355,7 +355,7 @@ public: break; case 23: Ughost = me->SummonCreature(NPC_GHOST_UTHER, 971.86f, -1825.42f, 81.99f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - Ughost->SetLevitate(true); + Ughost->SetDisableGravity(true); DoScriptText(SAY_WP_4, Ughost, me); m_uiChatTimer = 4000; break; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index ecc6b865b3d..e1d7d97e0b8 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -459,7 +459,7 @@ public: { trigger->SetVisible(false); trigger->setFaction(me->getFaction()); - trigger->SetLevitate(true); + trigger->SetDisableGravity(true); trigger->CastSpell(me, SPELL_METEOR, true); } me->GetMotionMaster()->Clear(); @@ -1176,7 +1176,7 @@ public: { FrostBreathTimer = 5000; MoveTimer = 0; - me->SetLevitate(true); + me->SetDisableGravity(true); } void WaypointReached(uint32 i) @@ -1298,7 +1298,7 @@ public: Zpos = 10.0f; StrikeTimer = 2000+rand()%5000; MoveTimer = 0; - me->SetLevitate(true); + me->SetDisableGravity(true); } void WaypointReached(uint32 i) diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index 3b42fc3ed7b..3b3dfae92b2 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -261,7 +261,7 @@ public: m_uiBellowingRoarTimer = 1000; break; case 10: - me->SetFlying(true); + me->SetCanFly(true); me->GetMotionMaster()->MovePoint(11, Phase2Location.GetPositionX(), Phase2Location.GetPositionY(), Phase2Location.GetPositionZ()+25); me->SetSpeed(MOVE_FLIGHT, 1.0f); DoScriptText(SAY_PHASE_2_TRANS, me); @@ -414,7 +414,7 @@ public: DoScriptText(SAY_PHASE_3_TRANS, me); SetCombatMovement(true); - me->SetFlying(false); + me->SetCanFly(false); m_bIsMoving = false; me->GetMotionMaster()->MovePoint(9, me->GetHomePosition()); return; diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp index 2c21ac18752..2c498cfdc43 100644 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ b/src/server/scripts/Kalimdor/silithus.cpp @@ -576,7 +576,7 @@ public: break; case 10: Merithra->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - Merithra->SetLevitate(true); + Merithra->SetDisableGravity(true); Merithra->GetMotionMaster()->MoveCharge(-8065, 1530, 6.61f, 3); break; case 11: @@ -603,7 +603,7 @@ public: break; case 18: Arygos->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - Arygos->SetLevitate(true); + Arygos->SetDisableGravity(true); Arygos->GetMotionMaster()->MoveCharge(-8065, 1530, 6.61f, 42); break; case 19: @@ -630,7 +630,7 @@ public: break; case 26: Caelestrasz->HandleEmoteCommand(254); - Caelestrasz->SetLevitate(true); + Caelestrasz->SetDisableGravity(true); Caelestrasz->GetMotionMaster()->MoveCharge(-8065, 1530, 7.61f, 4); break; case 27: @@ -769,7 +769,7 @@ public: break; case 63: me->HandleEmoteCommand(254); - me->SetLevitate(true); + me->SetDisableGravity(true); break; case 64: me->GetMotionMaster()->MoveCharge(-8000, 1400, 150, 9); diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp index 636be5e29be..c756aa4f232 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp @@ -349,6 +349,7 @@ public: void Reset() { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //! HACK: Creature's can't have MOVEMENTFLAG_FLYING me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING); me->setFaction(16); me->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp index 03a04648793..3407b42b2a7 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp @@ -105,8 +105,8 @@ class boss_saviana_ragefire : public CreatureScript Talk(SAY_CONFLAGRATION); break; case POINT_LAND: - me->SetFlying(false); - me->SetLevitate(false); + me->SetCanFly(false); + me->SetDisableGravity(false); me->SetReactState(REACT_AGGRESSIVE); if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); @@ -120,8 +120,8 @@ class boss_saviana_ragefire : public CreatureScript void JustReachedHome() { _JustReachedHome(); - me->SetFlying(false); - me->SetLevitate(false); + me->SetCanFly(false); + me->SetDisableGravity(false); } void KilledUnit(Unit* victim) @@ -146,8 +146,8 @@ class boss_saviana_ragefire : public CreatureScript { case EVENT_FLIGHT: { - me->SetFlying(true); - me->SetLevitate(true); + me->SetCanFly(true); + me->SetDisableGravity(true); me->SetReactState(REACT_PASSIVE); me->GetMotionMaster()->MovePoint(POINT_FLIGHT, SavianaRagefireFlyPos); events.ScheduleEvent(EVENT_FLIGHT, 50000); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index 7dcdaa28879..b64e324d4da 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -571,7 +571,10 @@ class mob_frost_sphere : public CreatureScript { _isFalling = false; me->SetReactState(REACT_PASSIVE); - me->SetFlying(true); + //! Confirmed sniff 3.3.5.a + me->SetDisableGravity(true); + me->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); + //! end me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); me->SetSpeed(MOVE_RUN, 0.5f, false); me->GetMotionMaster()->MoveRandom(20.0f); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index 0e604566276..3e2427d66b3 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -576,8 +576,8 @@ struct mob_unleashed_ballAI : public ScriptedAI { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_PASSIVE); - me->SetLevitate(true); - me->SetFlying(true); + me->SetDisableGravity(true); + me->SetCanFly(true); SetCombatMovement(false); MoveToNextPoint(); m_uiRangeCheckTimer = IN_MILLISECONDS; diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp index 8e211cbd2cb..6520d58da20 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp @@ -347,7 +347,7 @@ class boss_krick : public CreatureScript else tyrannusPtr = me->SummonCreature(NPC_TYRANNUS_EVENTS, outroPos[1], TEMPSUMMON_MANUAL_DESPAWN); - tyrannusPtr->SetFlying(true); + tyrannusPtr->SetCanFly(true); me->GetMotionMaster()->MovePoint(POINT_KRICK_INTRO, outroPos[0].GetPositionX(), outroPos[0].GetPositionY(), outroPos[0].GetPositionZ()); tyrannusPtr->SetFacingToObject(me); } @@ -439,6 +439,7 @@ class boss_krick : public CreatureScript _events.ScheduleEvent(EVENT_OUTRO_8, 5000); break; case EVENT_OUTRO_8: + //! HACK: Creature's can't have MOVEMENTFLAG_FLYING me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING); me->GetMotionMaster()->MovePoint(0, outroPos[5]); DoCast(me, SPELL_STRANGULATING); @@ -453,6 +454,7 @@ class boss_krick : public CreatureScript _events.ScheduleEvent(EVENT_OUTRO_10, 1000); break; case EVENT_OUTRO_10: + //! HACK: Creature's can't have MOVEMENTFLAG_FLYING me->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING); me->AddUnitMovementFlag(MOVEMENTFLAG_FALLING); me->GetMotionMaster()->MovePoint(0, outroPos[6]); diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp index d6b2c2e3a97..88e9bedcd07 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp @@ -295,7 +295,7 @@ class boss_rimefang : public CreatureScript _events.SetPhase(PHASE_NONE); _currentWaypoint = 0; _hoarfrostTargetGUID = 0; - me->SetFlying(true); + me->SetCanFly(true); me->SetReactState(REACT_PASSIVE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index 8ee0ef02cbd..c557b6ad831 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -1058,7 +1058,7 @@ class npc_blood_queen_lana_thel : public CreatureScript void Reset() { _events.Reset(); - me->SetLevitate(true); + me->SetDisableGravity(true); if (_instance->GetBossState(DATA_BLOOD_PRINCE_COUNCIL) == DONE) { me->SetVisible(false); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index 5eeb941d9aa..784cda8f595 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -198,8 +198,8 @@ class boss_blood_queen_lana_thel : public CreatureScript if (Creature* minchar = me->FindNearestCreature(NPC_INFILTRATOR_MINCHAR_BQ, 200.0f)) { minchar->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - minchar->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); - minchar->SetFlying(false); + minchar->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND); + minchar->SetCanFly(false); minchar->SendMovementFlagUpdate(); minchar->RemoveAllAuras(); minchar->GetMotionMaster()->MoveCharge(4629.3711f, 2782.6089f, 401.5301f, SPEED_CHARGE/3.0f); @@ -216,9 +216,9 @@ class boss_blood_queen_lana_thel : public CreatureScript _killMinchar = true; else { - me->SetLevitate(true); - me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); - me->SetFlying(true); + me->SetDisableGravity(true); + me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND); + me->SetCanFly(true); me->SendMovementFlagUpdate(); me->GetMotionMaster()->MovePoint(POINT_MINCHAR, mincharPos); } @@ -230,9 +230,9 @@ class boss_blood_queen_lana_thel : public CreatureScript if (_killMinchar) { _killMinchar = false; - me->SetLevitate(true); - me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); - me->SetFlying(true); + me->SetDisableGravity(true); + me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND); + me->SetCanFly(true); me->GetMotionMaster()->MovePoint(POINT_MINCHAR, mincharPos); } else @@ -244,9 +244,9 @@ class boss_blood_queen_lana_thel : public CreatureScript void JustReachedHome() { - me->SetLevitate(false); - me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); - me->SetFlying(false); + me->SetDisableGravity(false); + me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND); + me->SetCanFly(false); me->SetReactState(REACT_AGGRESSIVE); _JustReachedHome(); Talk(SAY_WIPE); @@ -295,9 +295,9 @@ class boss_blood_queen_lana_thel : public CreatureScript events.ScheduleEvent(EVENT_AIR_FLY_DOWN, 10000); break; case POINT_GROUND: - me->SetLevitate(false); - me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); - me->SetFlying(false); + me->SetDisableGravity(false); + me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND); + me->SetCanFly(false); me->SendMovementFlagUpdate(); me->SetReactState(REACT_AGGRESSIVE); if (Unit* victim = me->SelectVictim()) @@ -372,7 +372,7 @@ class boss_blood_queen_lana_thel : public CreatureScript break; } case EVENT_DELIRIOUS_SLASH: - if (_offtank && !me->HasByteFlag(UNIT_FIELD_BYTES_1, 3, 0x03)) + if (_offtank && !me->HasByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER)) DoCast(_offtank, SPELL_DELIRIOUS_SLASH); events.ScheduleEvent(EVENT_DELIRIOUS_SLASH, urand(20000, 24000), EVENT_GROUP_NORMAL); break; @@ -424,9 +424,9 @@ class boss_blood_queen_lana_thel : public CreatureScript me->GetMotionMaster()->MovePoint(POINT_CENTER, centerPos); break; case EVENT_AIR_START_FLYING: - me->SetLevitate(true); - me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); - me->SetFlying(true); + me->SetDisableGravity(true); + me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND); + me->SetCanFly(true); me->SendMovementFlagUpdate(); me->GetMotionMaster()->MovePoint(POINT_AIR, airPos); break; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 5177f65f670..e57fd7bbcb8 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -605,7 +605,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript _events.ScheduleEvent(EVENT_OUTRO_HORDE_3, 18000); // say _events.ScheduleEvent(EVENT_OUTRO_HORDE_4, 24000); // cast _events.ScheduleEvent(EVENT_OUTRO_HORDE_5, 30000); // move - me->SetLevitate(false); + me->SetDisableGravity(false); me->SendMovementFlagUpdate(); me->Relocate(me->GetPositionX(), me->GetPositionY(), 539.2917f); me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 0.0f); @@ -629,7 +629,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript { if (spell->Id == SPELL_GRIP_OF_AGONY) { - me->SetLevitate(true); + me->SetDisableGravity(true); me->GetMotionMaster()->MovePoint(POINT_CHOKE, chokePos[0]); } } @@ -812,7 +812,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript { me->RemoveAurasDueToSpell(SPELL_GRIP_OF_AGONY); Talk(SAY_OUTRO_ALLIANCE_1); - me->SetLevitate(false); + me->SetDisableGravity(false); me->SendMovementFlagUpdate(); me->Relocate(me->GetPositionX(), me->GetPositionY(), 539.2917f); me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 0.0f); @@ -832,7 +832,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript { if (spell->Id == SPELL_GRIP_OF_AGONY) { - me->SetLevitate(true); + me->SetDisableGravity(true); me->GetMotionMaster()->MovePoint(POINT_CHOKE, chokePos[0]); } } @@ -934,7 +934,7 @@ class npc_saurfang_event : public CreatureScript { if (spell->Id == SPELL_GRIP_OF_AGONY) { - me->SetLevitate(true); + me->SetDisableGravity(true); me->GetMotionMaster()->MovePoint(POINT_CHOKE, chokePos[_index]); } } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 01879240e3a..649efc59681 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -198,8 +198,8 @@ class boss_sindragosa : public CreatureScript if (instance->GetData(DATA_SINDRAGOSA_FROSTWYRMS) != 255) { - me->SetFlying(true); - me->SetLevitate(true); + me->SetCanFly(true); + me->SetDisableGravity(true); } } @@ -228,8 +228,8 @@ class boss_sindragosa : public CreatureScript { BossAI::JustReachedHome(); instance->SetBossState(DATA_SINDRAGOSA, FAIL); - me->SetFlying(false); - me->SetLevitate(false); + me->SetCanFly(false); + me->SetDisableGravity(false); } void KilledUnit(Unit* victim) @@ -275,8 +275,8 @@ class boss_sindragosa : public CreatureScript { case POINT_FROSTWYRM_LAND: me->setActive(false); - me->SetFlying(false); - me->SetLevitate(false); + me->SetCanFly(false); + me->SetDisableGravity(false); me->SetHomePosition(SindragosaLandPos); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetSpeed(MOVE_FLIGHT, 2.0f); @@ -292,8 +292,8 @@ class boss_sindragosa : public CreatureScript events.ScheduleEvent(EVENT_FROST_BOMB, 8000); break; case POINT_LAND: - me->SetFlying(false); - me->SetLevitate(false); + me->SetCanFly(false); + me->SetDisableGravity(false); me->SetReactState(REACT_DEFENSIVE); if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); @@ -425,8 +425,8 @@ class boss_sindragosa : public CreatureScript { _isInAirPhase = true; Talk(SAY_AIR_PHASE); - me->SetFlying(true); - me->SetLevitate(true); + me->SetCanFly(true); + me->SetDisableGravity(true); me->SetReactState(REACT_PASSIVE); Position pos; pos.Relocate(me); @@ -617,8 +617,8 @@ class npc_spinestalker : public CreatureScript if (_instance->GetData(DATA_SPINESTALKER) != 255) { - me->SetFlying(true); - me->SetLevitate(true); + me->SetCanFly(true); + me->SetDisableGravity(true); } } @@ -660,8 +660,8 @@ class npc_spinestalker : public CreatureScript return; me->setActive(false); - me->SetFlying(false); - me->SetLevitate(false); + me->SetCanFly(false); + me->SetDisableGravity(false); me->SetHomePosition(SpinestalkerLandPos); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -742,8 +742,8 @@ class npc_rimefang : public CreatureScript if (_instance->GetData(DATA_RIMEFANG) != 255) { - me->SetFlying(true); - me->SetLevitate(true); + me->SetCanFly(true); + me->SetDisableGravity(true); } } @@ -785,8 +785,8 @@ class npc_rimefang : public CreatureScript return; me->setActive(false); - me->SetFlying(false); - me->SetLevitate(false); + me->SetCanFly(false); + me->SetDisableGravity(false); me->SetHomePosition(RimefangLandPos); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } @@ -819,7 +819,7 @@ class npc_rimefang : public CreatureScript _icyBlastCounter = RAID_MODE(5, 7, 6, 8); me->SetReactState(REACT_PASSIVE); me->AttackStop(); - me->SetFlying(true); + me->SetCanFly(true); me->GetMotionMaster()->MovePoint(POINT_FROSTWYRM_FLY_IN, RimefangFlyPos); float moveTime = me->GetExactDist(&RimefangFlyPos)/(me->GetSpeed(MOVE_FLIGHT)*0.001f); _events.ScheduleEvent(EVENT_ICY_BLAST, uint64(moveTime) + urand(60000, 70000)); @@ -840,7 +840,7 @@ class npc_rimefang : public CreatureScript { me->SetReactState(REACT_DEFENSIVE); AttackStart(victim); - me->SetFlying(false); + me->SetCanFly(false); } break; default: diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 19a8e42e14b..554ac228be0 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -500,8 +500,8 @@ class boss_the_lich_king : public CreatureScript { _JustDied(); DoCastAOE(SPELL_PLAY_MOVIE, false); - me->SetLevitate(false); - me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x03); + me->SetDisableGravity(false); + me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_UNK_3); me->GetMotionMaster()->MoveFall(); } @@ -1073,8 +1073,8 @@ class boss_the_lich_king : public CreatureScript DoCastAOE(SPELL_SOUL_BARRAGE); sCreatureTextMgr->SendSound(me, SOUND_PAIN, CHAT_MSG_MONSTER_YELL, 0, TEXT_RANGE_NORMAL, TEAM_OTHER, false); // set flight - me->SetLevitate(true); - me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x03); + me->SetDisableGravity(true); + me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_UNK_3); me->GetMotionMaster()->MovePoint(POINT_LK_OUTRO_2, OutroFlying); break; case EVENT_OUTRO_TALK_7: diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 60e85165cd5..ef222963dfb 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -796,7 +796,7 @@ class boss_sister_svalna : public CreatureScript { _JustReachedHome(); me->SetReactState(REACT_PASSIVE); - me->SetFlying(false); + me->SetCanFly(false); } void DoAction(int32 const action) @@ -844,7 +844,7 @@ class boss_sister_svalna : public CreatureScript _isEventInProgress = false; me->setActive(false); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); - me->SetFlying(false); + me->SetCanFly(false); } void SpellHitTarget(Unit* target, SpellInfo const* spell) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp index abd16cd9c93..e37ceb6925f 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp @@ -296,7 +296,7 @@ public: { case EVENT_LIFTOFF: me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - me->SetLevitate(true); + me->SetDisableGravity(true); me->SendMovementFlagUpdate(); events.ScheduleEvent(EVENT_ICEBOLT, 1500); iceboltCount = RAID_MODE(2, 3); @@ -340,7 +340,7 @@ public: return; case EVENT_LAND: me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); - me->SetLevitate(false); + me->SetDisableGravity(false); me->SendMovementFlagUpdate(); events.ScheduleEvent(EVENT_GROUND, 1500); return; diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index e03440cec98..9e889bb9941 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -240,7 +240,7 @@ public: _cannotMove = true; - me->SetFlying(true); + me->SetCanFly(true); if (instance) instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); @@ -271,7 +271,7 @@ public: { me->SetHomePosition(_homePosition); - me->SetLevitate(true); + me->SetDisableGravity(true); BossAI::EnterEvadeMode(); @@ -354,8 +354,8 @@ public: { _EnterCombat(); - me->SetLevitate(false); - me->SetFlying(false); + me->SetDisableGravity(false); + me->SetCanFly(false); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -412,8 +412,8 @@ public: void PrepareForVortex() { - me->SetLevitate(true); - me->SetFlying(true); + me->SetDisableGravity(true); + me->SetCanFly(true); me->GetMotionMaster()->MovementExpired(); me->GetMotionMaster()->MovePoint(MOVE_VORTEX, MalygosPositions[1].GetPositionX(), MalygosPositions[1].GetPositionY(), MalygosPositions[1].GetPositionZ()); @@ -461,8 +461,8 @@ public: { SetPhase(PHASE_TWO, true); - me->SetLevitate(true); - me->SetFlying(true); + me->SetDisableGravity(true); + me->SetCanFly(true); me->GetMotionMaster()->MoveIdle(); me->GetMotionMaster()->MovePoint(MOVE_DEEP_BREATH_ROTATION, MalygosPhaseTwoWaypoints[0]); @@ -704,8 +704,8 @@ class spell_malygos_vortex_visual : public SpellScriptLoader // Anyway even with this issue, the boss does not enter in evade mode - this prevents iterate an empty list in the next vortex execution. malygos->SetInCombatWithZone(); - malygos->SetLevitate(false); - malygos->SetFlying(false); + malygos->SetDisableGravity(false); + malygos->SetCanFly(false); malygos->GetMotionMaster()->MoveChase(caster->getVictim()); malygos->RemoveAura(SPELL_VORTEX_1); diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp index 9671d59bcec..357b0bad13c 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp @@ -316,7 +316,9 @@ public: LeaveCombat(); break; case SPELL_TELEPORT: - me->AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); // with out it the npc will fall down while is casting + //! Unconfirmed, previous below + me->SetDisableGravity(true); + //me->AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); // with out it the npc will fall down while is casting canCast = true; break; default: diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp index 187dbed6901..7ebaac1e938 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp @@ -170,6 +170,7 @@ class npc_azure_ring_captain : public CreatureScript targetGUID = 0; me->SetWalk(true); + //! HACK: Creature's can't have MOVEMENTFLAG_FLYING me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING); me->SetReactState(REACT_AGGRESSIVE); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp index 1671953aba1..f7c523d1521 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp @@ -575,7 +575,7 @@ class boss_stormcaller_brundir : public CreatureScript _Reset(); phase = 0; me->RemoveAllAuras(); - me->SetLevitate(false); + me->SetDisableGravity(false); me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, false); // Should be interruptable unless overridden by spell (Overload) me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_STUN, false); // Reset immumity, Brundir should be stunnable by default RespawnEncounter(instance, me); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index d245c77b9df..85b5c13c6ee 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp @@ -330,7 +330,7 @@ class boss_razorscale : public CreatureScript void Reset() { _Reset(); - me->SetFlying(true); + me->SetCanFly(true); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_PASSIVE); PermaGround = false; @@ -419,7 +419,7 @@ class boss_razorscale : public CreatureScript case EVENT_FLIGHT: phase = PHASE_FLIGHT; events.SetPhase(PHASE_FLIGHT); - me->SetFlying(true); + me->SetCanFly(true); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_PASSIVE); me->AttackStop(); @@ -430,7 +430,7 @@ class boss_razorscale : public CreatureScript ++FlyCount; return; case EVENT_LAND: - me->SetFlying(false); + me->SetCanFly(false); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED); if (Creature* commander = ObjectAccessor::GetCreature(*me, instance ? instance->GetData64(DATA_EXPEDITION_COMMANDER) : 0)) @@ -524,7 +524,7 @@ class boss_razorscale : public CreatureScript me->MonsterTextEmote(EMOTE_PERMA, 0, true); phase = PHASE_PERMAGROUND; events.SetPhase(PHASE_PERMAGROUND); - me->SetFlying(false); + me->SetCanFly(false); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_AGGRESSIVE); me->RemoveAurasDueToSpell(SPELL_HARPOON_TRIGGER); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp index a11f88fc6af..7d37621e787 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp @@ -321,6 +321,7 @@ public: void Reset() { + //! HACK: Creature's can't have MOVEMENTFLAG_FLYING me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_HOVER); me->SetSpeed(MOVE_SWIM, 1.0f); me->SetSpeed(MOVE_RUN, 1.0f); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp index 656b2931abb..d40dba22fcd 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp @@ -765,6 +765,7 @@ public: { currentPhase = PHASE_NONE; SummonTimer = 5000; + //! HACK: Creature's can't have MOVEMENTFLAG_FLYING me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING); me->RemoveAurasDueToSpell(SPELL_ORB_VISUAL); me->SetSpeed(MOVE_FLIGHT, 0.5f); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index dd3557071cd..5ce26ab1467 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -217,7 +217,7 @@ public: void JustReachedHome() { - me->SetFlying(false); + me->SetCanFly(false); me->Dismount(); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); if (Unit::GetCreature((*me), m_uiGraufGUID) == NULL) @@ -284,7 +284,7 @@ public: if (m_uiSpellHitCount >= 3) { Phase = SKADI; - me->SetFlying(false); + me->SetCanFly(false); me->Dismount(); if (Creature* pGrauf = me->SummonCreature(CREATURE_GRAUF, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3*IN_MILLISECONDS)) { @@ -328,7 +328,7 @@ public: if (m_uiMountTimer && m_uiMountTimer <= diff) { me->Mount(DATA_MOUNT); - me->SetFlying(true); + me->SetCanFly(true); m_uiMountTimer = 0; } else m_uiMountTimer -= diff; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index a4289b2eb06..10dc8957d93 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -91,12 +91,6 @@ enum SvalaPhase INTRO, NORMAL, SACRIFICING, - SVALADEAD -}; - -enum SvalaPoint -{ - POINT_FALL_GROUND = 1, }; #define DATA_INCREDIBLE_HULK 2043 @@ -158,15 +152,11 @@ public: summons.DespawnAll(); me->RemoveAllAuras(); - if (Phase > INTRO) - { - me->SetFlying(true); - me->SetLevitate(true); - } - if (Phase > NORMAL) Phase = NORMAL; + me->SetDisableGravity(Phase == NORMAL); + introTimer = 1 * IN_MILLISECONDS; introPhase = 0; arthasGUID = 0; @@ -178,17 +168,6 @@ public: } } - void JustReachedHome() - { - if (Phase > INTRO) - { - me->SetFlying(false); - me->SetLevitate(false); - me->SetOrientation(1.58f); - me->SendMovementFlagUpdate(); - } - } - void EnterCombat(Unit* /*who*/) { Talk(SAY_AGGRO); @@ -240,44 +219,13 @@ public: Talk(SAY_SLAY); } - void DamageTaken(Unit* attacker, uint32 &damage) - { - if (Phase == SVALADEAD) - { - if (attacker != me) - damage = 0; - return; - } - - if (damage >= me->GetHealth()) - { - if (Phase == SACRIFICING) - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); - - damage = 0; - Phase = SVALADEAD; - me->InterruptNonMeleeSpells(true); - me->RemoveAllAuras(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetHealth(1); - - SetCombatMovement(false); - me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH); - me->GetMotionMaster()->MoveFall(POINT_FALL_GROUND); - } - } - - void MovementInform(uint32 motionType, uint32 pointId) - { - if (motionType != EFFECT_MOTION_TYPE) - return; - - if (pointId == POINT_FALL_GROUND) - me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - void JustDied(Unit* /*killer*/) { + if (Phase == SACRIFICING) + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); + + me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH); + summons.DespawnAll(); if (instance) @@ -325,8 +273,6 @@ public: break; case 2: arthas->CastSpell(me, SPELL_TRANSFORMING_CHANNEL, false); - me->SetFlying(true); - me->SetLevitate(true); pos.Relocate(me); pos.m_positionZ += 8.0f; me->GetMotionMaster()->MoveTakeoff(0, pos, 3.30078125f); @@ -382,14 +328,13 @@ public: introTimer = 13800; break; case 8: - me->SetFlying(false); - me->SetLevitate(false); - me->SendMovementFlagUpdate(); pos.Relocate(me); pos.m_positionX = me->GetHomePosition().GetPositionX(); pos.m_positionY = me->GetHomePosition().GetPositionY(); pos.m_positionZ = 90.6065f; me->GetMotionMaster()->MoveLand(0, pos, 6.247422f); + me->SetDisableGravity(false, true); + me->SetHover(true); ++introPhase; introTimer = 3000; break; @@ -403,7 +348,8 @@ public: break; } } - else introTimer -= diff; + else + introTimer -= diff; return; } @@ -414,33 +360,29 @@ public: if (!UpdateVictim()) return; - if (me->IsWithinMeleeRange(me->getVictim()) && me->HasUnitMovementFlag(MOVEMENTFLAG_LEVITATING)) - { - me->SetFlying(false); - me->SetLevitate(false); - me->SendMovementFlagUpdate(); - } - if (sinsterStrikeTimer <= diff) { DoCast(me->getVictim(), SPELL_SINSTER_STRIKE); sinsterStrikeTimer = urand(5 * IN_MILLISECONDS, 9 * IN_MILLISECONDS); - } else sinsterStrikeTimer -= diff; + } + else + sinsterStrikeTimer -= diff; if (callFlamesTimer <= diff) { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true)) { DoCast(target, SPELL_CALL_FLAMES); callFlamesTimer = urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS); } - } else callFlamesTimer -= diff; + } + else callFlamesTimer -= diff; if (!sacrificed) { if (HealthBelowPct(50)) { - if (Unit* sacrificeTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 80, true)) + if (Unit* sacrificeTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 80.0f, true)) { if (instance) instance->SetData64(DATA_SACRIFICED_PLAYER, sacrificeTarget->GetGUID()); @@ -450,8 +392,6 @@ public: DoCast(sacrificeTarget, SPELL_RITUAL_PREPARATION); SetCombatMovement(false); - me->SetFlying(true); - me->SetLevitate(true); Phase = SACRIFICING; sacrePhase = 0; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp index 35bbb98fd77..0d8e22ff630 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp @@ -218,7 +218,7 @@ public: m_uiActivedCreatureGUID = temp->GetGUID(); temp->CastSpell(me, SPELL_CHANNEL_SPIRIT_TO_YMIRON, true); temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); - temp->SetLevitate(true); + temp->SetDisableGravity(true); switch (m_uiActiveOrder[m_uiActivedNumber]) { case 0: m_bIsActiveWithBJORN = true; break; diff --git a/src/server/scripts/Northrend/sholazar_basin.cpp b/src/server/scripts/Northrend/sholazar_basin.cpp index f0445273d43..d43cf6fb98f 100644 --- a/src/server/scripts/Northrend/sholazar_basin.cpp +++ b/src/server/scripts/Northrend/sholazar_basin.cpp @@ -92,7 +92,7 @@ public: me->RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING); me->RemoveUnitMovementFlag(MOVEMENTFLAG_JUMPING); me->SetSpeed(MOVE_SWIM, 0.85f, true); - me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING); + me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_DISABLE_GRAVITY); break; case 19: me->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING); diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp index c3c53416a9b..51271cdfe42 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp @@ -101,7 +101,7 @@ public: DoScriptText(SAY_INTRO, me); } - if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; float attackRadius = me->GetAttackDistance(who); diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index ace1a2ab717..93b687d3f3d 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -798,7 +798,7 @@ public: { case 1: // lift off me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); me->StopMoving(); me->MonsterYell(SAY_TAKEOFF, LANG_UNIVERSAL, 0); DoPlaySoundToSet(me, SOUND_TAKEOFF); @@ -867,7 +867,7 @@ public: Timer[EVENT_FLIGHT_SEQUENCE] = 2000; break; case 9: // land - me->SetLevitate(false); + me->SetDisableGravity(false); me->StopMoving(); me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); for (uint8 i = 0; i < 2; ++i) @@ -1869,7 +1869,7 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::Reset() me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - me->SetLevitate(false); + me->SetDisableGravity(false); me->setActive(false); Summons.DespawnAll(); } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index fbafb9615f7..2df9e0e65ba 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -731,7 +731,7 @@ public: void Reset() { - me->SetLevitate(true); + me->SetDisableGravity(true); me->setFaction(14); MovementTimer = 0; ToxicSporeTimer = 5000; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp index 4af20d70816..41a8b12dd51 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp @@ -109,7 +109,7 @@ public: } void Reset() { - me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING); + me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_DISABLE_GRAVITY); SpoutAnimTimer = 1000; RotTimer = 0; WaterboltTimer = 15000; // give time to get in range when fight starts diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp index 6c4019c7989..3ed3d1a82de 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp @@ -153,7 +153,7 @@ class instance_serpent_shrine : public InstanceMapScript if (Creature* frenzy = player->SummonCreature(MOB_COILFANG_FRENZY, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 2000)) { frenzy->Attack(player, false); - frenzy->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING); + frenzy->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_DISABLE_GRAVITY); } DoSpawnFrenzy = false; } diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp index 4f422da35ad..66d445c1f39 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp @@ -145,7 +145,7 @@ class boss_nazan : public CreatureScript flight = false; BellowingRoar_Timer = 6000; ConeOfFire_Timer = 12000; - me->SetLevitate(false); + me->SetDisableGravity(false); me->SetWalk(true); me->GetMotionMaster()->Clear(); if (Unit* victim = SelectTarget(SELECT_TARGET_NEAREST, 0)) @@ -374,7 +374,7 @@ class boss_vazruden_the_herald : public CreatureScript if (summoned->GetEntry() == ENTRY_NAZAN) { CAST_AI(boss_nazan::boss_nazanAI, summoned->AI())->VazrudenGUID = VazrudenGUID; - summoned->SetLevitate(true); + summoned->SetDisableGravity(true); summoned->SetSpeed(MOVE_FLIGHT, 2.5f); if (victim) AttackStartNoMove(victim); diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp index b2f8af2c80d..cc732b86ea4 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp @@ -87,7 +87,7 @@ class boss_watchkeeper_gargolmar : public CreatureScript { if (!me->getVictim() && me->canCreatureAttack(who)) { - if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; float attackRadius = me->GetAttackDistance(who); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index fcfe6c0ea16..97ac0b9da5e 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -130,7 +130,7 @@ class boss_alar : public CreatureScript //me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); //me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->setActive(false); } @@ -140,7 +140,7 @@ class boss_alar : public CreatureScript if (instance) instance->SetData(DATA_ALAREVENT, IN_PROGRESS); - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); // after enterevademode will be set walk movement + me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); // after enterevademode will be set walk movement DoZoneInCombat(); me->setActive(true); } @@ -470,7 +470,7 @@ class mob_ember_of_alar : public CreatureScript mob_ember_of_alarAI(Creature* creature) : ScriptedAI(creature) { instance = creature->GetInstanceScript(); - creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + creature->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); } diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index 904b2851816..577c8bf9f54 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -399,7 +399,7 @@ class boss_kaelthas : public CreatureScript { if (!me->HasUnitState(UNIT_STATE_STUNNED) && me->canCreatureAttack(who)) { - if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; float attackRadius = me->GetAttackDistance(who); diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp index db95f60f556..24ea29702f5 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp @@ -316,7 +316,7 @@ class npc_warden_mellichar : public CreatureScript if (!me->getVictim() && me->canCreatureAttack(who)) { - if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; if (who->GetTypeId() != TYPEID_PLAYER) return; diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index d5b08d83c71..f46f7f1d745 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -751,7 +751,7 @@ class npc_simon_bunny : public CreatureScript // Used for getting involved player guid. Parameter id is used for defining if is a large(Monument) or small(Relic) node void SetGUID(uint64 guid, int32 id) { - me->SetFlying(true); + me->SetCanFly(true); large = (bool)id; playerGUID = guid; diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index 79d284d779a..be0166b6d19 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -223,7 +223,7 @@ public: me->setFaction(FACTION_DEFAULT); FlyTimer = 10000; - me->SetLevitate(false); + me->SetDisableGravity(false); me->SetVisible(true); } @@ -270,7 +270,7 @@ public: PlayerGUID = 0; } me->SetVisible(false); - me->SetLevitate(false); + me->SetDisableGravity(false); me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); me->RemoveCorpse(); } @@ -308,7 +308,7 @@ public: pos.m_positionZ += 25; } - me->SetLevitate(true); + me->SetDisableGravity(true); me->GetMotionMaster()->MovePoint(1, pos); } } @@ -808,7 +808,7 @@ public: case 19: DoScriptText(LORD_ILLIDAN_SAY_7, Illi); return 5000; break; case 20: Illi->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - Illi->SetLevitate(true); + Illi->SetDisableGravity(true); return 500; break; case 21: DoScriptText(OVERLORD_SAY_5, me); return 500; break; case 22: diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index b7aee4a3f07..67b04dab29d 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -421,7 +421,7 @@ public: float x, y, z; me->GetPosition(x, y, z); me->Relocate(x, y, z + 0.94f); - me->SetLevitate(true); + me->SetDisableGravity(true); me->HandleEmoteCommand(EMOTE_ONESHOT_DANCE); WorldPacket data; //send update position to client me->BuildHeartBeatMsg(&data); @@ -1937,6 +1937,7 @@ public: me->CastSpell(me, 54661, true); me->SetReactState(REACT_PASSIVE); + //! HACK: Creature's can't have MOVEMENTFLAG_FLYING // Fly Away me->AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY|MOVEMENTFLAG_ASCENDING|MOVEMENTFLAG_FLYING); me->SetSpeed(MOVE_FLIGHT, 0.75f, true); From 8af0067016e72e87b02c353589f0fac8d3baef5d Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Mon, 12 Mar 2012 01:10:02 +0100 Subject: [PATCH 0156/1149] Scripts/ICC/Lich King: Typo correction in unit_field_bytes_1 usage related to hover, introduced in previous commit (thankfully the only one). --- .../scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 554ac228be0..d352871ba6d 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -501,7 +501,7 @@ class boss_the_lich_king : public CreatureScript _JustDied(); DoCastAOE(SPELL_PLAY_MOVIE, false); me->SetDisableGravity(false); - me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_UNK_3); + me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->GetMotionMaster()->MoveFall(); } @@ -1074,7 +1074,7 @@ class boss_the_lich_king : public CreatureScript sCreatureTextMgr->SendSound(me, SOUND_PAIN, CHAT_MSG_MONSTER_YELL, 0, TEXT_RANGE_NORMAL, TEAM_OTHER, false); // set flight me->SetDisableGravity(true); - me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_UNK_3); + me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->GetMotionMaster()->MovePoint(POINT_LK_OUTRO_2, OutroFlying); break; case EVENT_OUTRO_TALK_7: From 62175836279bbbc83ccc5d0b4bad9d58b3d3e5d8 Mon Sep 17 00:00:00 2001 From: kaelima Date: Mon, 12 Mar 2012 04:33:24 +0100 Subject: [PATCH 0157/1149] Core/Map: - Remove mysterious restriction in visibilityhelper for gameobjects - Some cleanup in CheckAreaExploreAndOutdoor() and GridDefines.h - Set nocreate for cells visited in Map::VisitNearbyCellsOf --- src/server/game/Entities/Player/Player.cpp | 29 ++++++++----------- src/server/game/Grids/GridDefines.h | 18 ++++++------ .../game/Grids/Notifiers/GridNotifiers.cpp | 2 +- src/server/game/Maps/Map.cpp | 7 +++-- 4 files changed, 26 insertions(+), 30 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f3f376dae04..5ebfb02f205 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -6790,7 +6790,7 @@ void Player::CheckAreaExploreAndOutdoor() if (sWorld->getBoolConfig(CONFIG_VMAP_INDOOR_CHECK) && !isOutdoor) RemoveAurasWithAttribute(SPELL_ATTR0_OUTDOORS_ONLY); - if (areaFlag==0xffff) + if (areaFlag == 0xffff) return; int offset = areaFlag / 32; @@ -6809,21 +6809,23 @@ void Player::CheckAreaExploreAndOutdoor() GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA); - AreaTableEntry const* p = GetAreaEntryByAreaFlagAndMap(areaFlag, GetMapId()); - if (!p) + AreaTableEntry const* areaEntry = GetAreaEntryByAreaFlagAndMap(areaFlag, GetMapId()); + if (!areaEntry) { - sLog->outError("PLAYER: Player %u discovered unknown area (x: %f y: %f map: %u", GetGUIDLow(), GetPositionX(), GetPositionY(), GetMapId()); + sLog->outError("Player %u discovered unknown area (x: %f y: %f z: %f map: %u", GetGUIDLow(), GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId()); + return; } - else if (p->area_level > 0) + + if (areaEntry->area_level > 0) { - uint32 area = p->ID; + uint32 area = areaEntry->ID; if (getLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { SendExplorationExperience(area, 0); } else { - int32 diff = int32(getLevel()) - p->area_level; + int32 diff = int32(getLevel()) - areaEntry->area_level; uint32 XP = 0; if (diff < -5) { @@ -6837,17 +6839,17 @@ void Player::CheckAreaExploreAndOutdoor() else if (exploration_percent < 0) exploration_percent = 0; - XP = uint32(sObjectMgr->GetBaseXP(p->area_level)*exploration_percent/100*sWorld->getRate(RATE_XP_EXPLORE)); + XP = uint32(sObjectMgr->GetBaseXP(areaEntry->area_level)*exploration_percent/100*sWorld->getRate(RATE_XP_EXPLORE)); } else { - XP = uint32(sObjectMgr->GetBaseXP(p->area_level)*sWorld->getRate(RATE_XP_EXPLORE)); + XP = uint32(sObjectMgr->GetBaseXP(areaEntry->area_level)*sWorld->getRate(RATE_XP_EXPLORE)); } GiveXP(XP, NULL); SendExplorationExperience(area, XP); } - sLog->outDetail("PLAYER: Player %u discovered a new area: %u", GetGUIDLow(), area); + sLog->outDetail("Player %u discovered a new area: %u", GetGUIDLow(), area); } } } @@ -21464,13 +21466,6 @@ inline void UpdateVisibilityOf_helper(std::set& s64, T* target, std::set s64.insert(target->GetGUID()); } -template<> -inline void UpdateVisibilityOf_helper(std::set& s64, GameObject* target, std::set& /*v*/) -{ - if (!target->IsTransport()) - s64.insert(target->GetGUID()); -} - template<> inline void UpdateVisibilityOf_helper(std::set& s64, Creature* target, std::set& v) { diff --git a/src/server/game/Grids/GridDefines.h b/src/server/game/Grids/GridDefines.h index d096bb7ab63..7bd0da34a46 100644 --- a/src/server/game/Grids/GridDefines.h +++ b/src/server/game/Grids/GridDefines.h @@ -67,12 +67,12 @@ typedef GridRefManager PlayerMapType; enum GridMapTypeMask { - GRID_MAP_TYPE_MASK_CORPSE = 0x01, - GRID_MAP_TYPE_MASK_CREATURE = 0x02, - GRID_MAP_TYPE_MASK_DYNAMICOBJECT = 0x04, - GRID_MAP_TYPE_MASK_GAMEOBJECT = 0x08, - GRID_MAP_TYPE_MASK_PLAYER = 0x10, - GRID_MAP_TYPE_MASK_ALL = 0x1F + GRID_MAP_TYPE_MASK_CORPSE = 0x01, + GRID_MAP_TYPE_MASK_CREATURE = 0x02, + GRID_MAP_TYPE_MASK_DYNAMICOBJECT = 0x04, + GRID_MAP_TYPE_MASK_GAMEOBJECT = 0x08, + GRID_MAP_TYPE_MASK_PLAYER = 0x10, + GRID_MAP_TYPE_MASK_ALL = 0x1F }; typedef Grid GridType; @@ -172,14 +172,14 @@ typedef CoordPair CellCoord; namespace Trinity { template - inline RET_TYPE Compute(float x, float y, float center_offset, float size) + inline RET_TYPE Compute(float x, float y, float center_offset, float size) { // calculate and store temporary values in double format for having same result as same mySQL calculations double x_offset = (double(x) - center_offset)/size; double y_offset = (double(y) - center_offset)/size; - int x_val = int(x_offset+CENTER_VAL + 0.5f); - int y_val = int(y_offset+CENTER_VAL + 0.5f); + int x_val = int(x_offset + CENTER_VAL + 0.5f); + int y_val = int(y_offset + CENTER_VAL + 0.5f); return RET_TYPE(x_val, y_val); } diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.cpp b/src/server/game/Grids/Notifiers/GridNotifiers.cpp index 17d3066e64d..a02c18ca008 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.cpp +++ b/src/server/game/Grids/Notifiers/GridNotifiers.cpp @@ -120,7 +120,7 @@ inline void CreatureUnitRelocationWorker(Creature* c, Unit* u) void PlayerRelocationNotifier::Visit(PlayerMapType &m) { - for (PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) + for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { Player* player = iter->getSource(); diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 7403a86a47f..91ebea9f321 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -493,6 +493,7 @@ void Map::VisitNearbyCellsOf(WorldObject* obj, TypeContainerVisitorIsInWorld()) { //player->Update(t_diff); - WorldSession* pSession = player->GetSession(); - MapSessionFilter updater(pSession); - pSession->Update(t_diff, updater); + WorldSession* session = player->GetSession(); + MapSessionFilter updater(session); + session->Update(t_diff, updater); } } /// update active cells around players and active objects From a48216e1226601817a76605b12ee7bafbaf66a78 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Mon, 12 Mar 2012 08:41:13 +0100 Subject: [PATCH 0158/1149] Scripts/UP/Svala: Temp compile fix for Svala. Currently rewriting the entire script. --- .../scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index 10dc8957d93..29b8f2e7f48 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -91,6 +91,7 @@ enum SvalaPhase INTRO, NORMAL, SACRIFICING, + SVALADEAD }; #define DATA_INCREDIBLE_HULK 2043 From 671fd4176a2000b5dd8cdb5b009bc13046dc9bc1 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 12 Mar 2012 18:07:34 +0100 Subject: [PATCH 0159/1149] Core/GameObjects: Chests will now remain locked for players who left the group if loot from that boss is stored in it (note: this is just an implementation of locking the chest, they still need to be linked to a boss - not yet implemented) --- .../game/Entities/GameObject/GameObject.cpp | 56 +++++++++++++++++++ .../game/Entities/GameObject/GameObject.h | 7 +++ src/server/game/Entities/Object/Object.cpp | 13 +++++ 3 files changed, 76 insertions(+) diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 0ba46609945..2e8e68cf8b2 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -55,6 +55,8 @@ GameObject::GameObject() : WorldObject(false), m_model(NULL), m_goValue(new Game m_DBTableGuid = 0; m_rotation = 0; + m_lootRecipient = 0; + m_lootRecipientGroup = 0; m_groupLootTimer = 0; lootingGroupLowGUID = 0; @@ -1968,3 +1970,57 @@ void GameObject::UpdateModel() if (m_model) GetMap()->Insert(*m_model); } + +Player* GameObject::GetLootRecipient() const +{ + if (!m_lootRecipient) + return NULL; + return ObjectAccessor::FindPlayer(m_lootRecipient); +} + +Group* GameObject::GetLootRecipientGroup() const +{ + if (!m_lootRecipientGroup) + return NULL; + return sGroupMgr->GetGroupByGUID(m_lootRecipientGroup); +} + +void GameObject::SetLootRecipient(Unit* unit) +{ + // set the player whose group should receive the right + // to loot the creature after it dies + // should be set to NULL after the loot disappears + + if (!unit) + { + m_lootRecipient = 0; + m_lootRecipientGroup = 0; + return; + } + + if (unit->GetTypeId() != TYPEID_PLAYER && !unit->IsVehicle()) + return; + + Player* player = unit->GetCharmerOrOwnerPlayerOrPlayerItself(); + if (!player) // normal creature, no player involved + return; + + m_lootRecipient = player->GetGUID(); + if (Group* group = player->GetGroup()) + m_lootRecipientGroup = group->GetLowGUID(); +} + +bool GameObject::IsLootAllowedFor(Player const* player) const +{ + if (!m_lootRecipient && !m_lootRecipientGroup) + return true; + + if (player->GetGUID() == m_lootRecipient) + return true; + + Group const* playerGroup = player->GetGroup(); + if (!playerGroup || playerGroup != GetLootRecipientGroup()) // if we dont have a group we arent the recipient + return false; // if go doesnt have group bound it means it was solo killed by someone else + + return true; +} diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index ee643648a6a..bde8780e78f 100755 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -745,6 +745,11 @@ class GameObject : public WorldObject, public GridObject Loot loot; + Player* GetLootRecipient() const; + Group* GetLootRecipientGroup() const; + void SetLootRecipient(Unit* unit); + bool IsLootAllowedFor(Player const* player) const; + bool HasLootRecipient() const { return m_lootRecipient || m_lootRecipientGroup; } uint32 m_groupLootTimer; // (msecs)timer used for group loot uint32 lootingGroupLowGUID; // used to find group which is looting @@ -821,6 +826,8 @@ class GameObject : public WorldObject, public GridObject uint64 m_rotation; + uint64 m_lootRecipient; + uint32 m_lootRecipientGroup; uint16 m_LootMode; // bitmask, default LOOT_MODE_DEFAULT, determines what loot will be lootable private: void RemoveFromOwner(); diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 56ddd14dc3a..d8ee305230e 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -486,6 +486,10 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* } updateMask->SetBit(GAMEOBJECT_DYNAMIC); updateMask->SetBit(GAMEOBJECT_BYTES_1); + + if (ToGameObject()->GetGoType() == GAMEOBJECT_TYPE_CHEST && ToGameObject()->GetGOInfo()->chest.groupLootRules && + ToGameObject()->HasLootRecipient()) + updateMask->SetBit(GAMEOBJECT_FLAGS); } else if (isType(TYPEMASK_UNIT)) { @@ -709,6 +713,15 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* *data << uint16(-1); } } + else if (index == GAMEOBJECT_FLAGS) + { + uint32 flags = m_uint32Values[index]; + if (ToGameObject()->GetGoType() == GAMEOBJECT_TYPE_CHEST) + if (ToGameObject()->GetGOInfo()->chest.groupLootRules && !ToGameObject()->IsLootAllowedFor(target)) + flags |= GO_FLAG_LOCKED | GO_FLAG_NOT_SELECTABLE; + + *data << flags; + } else *data << m_uint32Values[index]; // other cases } From c0165ec7f84845c511ad426e318e96e5420687db Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 12 Mar 2012 18:09:06 +0100 Subject: [PATCH 0160/1149] Scripts/Icecrown Citadel: Lock Deathbringer Saurfang and Valithria Dreamwalker chests to players who fought them --- .../world/2012_03_12_01_world_conditions.sql | 3 + .../world/2012_03_12_01_world_gameobject.sql | 4 ++ ...2012_03_12_01_world_spell_script_names.sql | 3 + .../boss_deathbringer_saurfang.cpp | 72 ++++++++++++++++--- .../IcecrownCitadel/boss_the_lich_king.cpp | 9 ++- .../boss_valithria_dreamwalker.cpp | 7 +- .../IcecrownCitadel/icecrown_citadel.h | 4 ++ .../instance_icecrown_citadel.cpp | 16 ++++- 8 files changed, 102 insertions(+), 16 deletions(-) create mode 100644 sql/updates/world/2012_03_12_01_world_conditions.sql create mode 100644 sql/updates/world/2012_03_12_01_world_gameobject.sql create mode 100644 sql/updates/world/2012_03_12_01_world_spell_script_names.sql diff --git a/sql/updates/world/2012_03_12_01_world_conditions.sql b/sql/updates/world/2012_03_12_01_world_conditions.sql new file mode 100644 index 00000000000..d58d8f54ddf --- /dev/null +++ b/sql/updates/world/2012_03_12_01_world_conditions.sql @@ -0,0 +1,3 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=72257; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,72257,0,0,32,0,144,0,0,0,0,'','Remove Marks of the Fallen Champion - target player'); diff --git a/sql/updates/world/2012_03_12_01_world_gameobject.sql b/sql/updates/world/2012_03_12_01_world_gameobject.sql new file mode 100644 index 00000000000..38c615a3b0a --- /dev/null +++ b/sql/updates/world/2012_03_12_01_world_gameobject.sql @@ -0,0 +1,4 @@ +UPDATE `gameobject_template` SET `flags`=0x32 WHERE `entry` IN (202239,202240,202238,202241,201959,202339,202338,202340); + +-- Set Deathbringer's Cache spawned by default +UPDATE `gameobject` SET `spawntimesecs`=604800 WHERE `id` IN (202239,202240,202238,202241); diff --git a/sql/updates/world/2012_03_12_01_world_spell_script_names.sql b/sql/updates/world/2012_03_12_01_world_spell_script_names.sql new file mode 100644 index 00000000000..db98aa0fbea --- /dev/null +++ b/sql/updates/world/2012_03_12_01_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_deathbringer_remove_marks'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(72257,'spell_deathbringer_remove_marks'); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index e57fd7bbcb8..b794970d24e 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -111,6 +111,8 @@ enum Spells SPELL_RIDE_VEHICLE = 70640, // Outro SPELL_ACHIEVEMENT = 72928, + SPELL_REMOVE_MARKS_OF_THE_FALLEN_CHAMPION = 72257, + SPELL_PERMANENT_FEIGN_DEATH = 70628, }; // Helper to get id of the aura on different modes (HasAura(baseId) wont work) @@ -254,6 +256,7 @@ class boss_deathbringer_saurfang : public CreatureScript me->SetReactState(REACT_DEFENSIVE); events.SetPhase(PHASE_COMBAT); _frenzied = false; + _dead = false; me->SetPower(POWER_ENERGY, 0); DoCast(me, SPELL_ZERO_POWER, true); DoCast(me, SPELL_BLOOD_LINK, true); @@ -303,13 +306,6 @@ class boss_deathbringer_saurfang : public CreatureScript void JustDied(Unit* /*killer*/) { - _JustDied(); - DoCast(me, SPELL_ACHIEVEMENT, true); - Talk(SAY_DEATH); - - instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MARK_OF_THE_FALLEN_CHAMPION); - if (Creature* creature = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_SAURFANG_EVENT_NPC))) - creature->AI()->DoAction(ACTION_START_OUTRO); } void AttackStart(Unit* victim) @@ -348,6 +344,22 @@ class boss_deathbringer_saurfang : public CreatureScript DoCast(me, SPELL_FRENZY); Talk(SAY_FRENZY); } + + if (!_dead && me->GetHealth() < FightWonValue) + { + _dead = true; + _JustDied(); + _EnterEvadeMode(); + + DoCastAOE(SPELL_REMOVE_MARKS_OF_THE_FALLEN_CHAMPION); + DoCast(me, SPELL_ACHIEVEMENT, true); + Talk(SAY_DEATH); + + //instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MARK_OF_THE_FALLEN_CHAMPION); + DoCast(me, SPELL_PERMANENT_FEIGN_DEATH); + if (Creature* creature = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_SAURFANG_EVENT_NPC))) + creature->AI()->DoAction(ACTION_START_OUTRO); + } } void JustSummoned(Creature* summon) @@ -542,10 +554,13 @@ class boss_deathbringer_saurfang : public CreatureScript } } + static uint32 const FightWonValue; + private: uint32 _fallenChampionCastCount; bool _introDone; bool _frenzied; // faster than iterating all auras to find Frenzy + bool _dead; }; CreatureAI* GetAI(Creature* creature) const @@ -554,6 +569,8 @@ class boss_deathbringer_saurfang : public CreatureScript } }; +uint32 const boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::FightWonValue = 100000; + class npc_high_overlord_saurfang_icc : public CreatureScript { public: @@ -655,7 +672,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript { deathbringer->CastSpell(me, SPELL_RIDE_VEHICLE, true); // for the packet logs. deathbringer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - deathbringer->setDeathState(ALIVE); + deathbringer->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DROWNED); } _events.ScheduleEvent(EVENT_OUTRO_HORDE_5, 1000); // move _events.ScheduleEvent(EVENT_OUTRO_HORDE_6, 4000); // say @@ -818,6 +835,10 @@ class npc_muradin_bronzebeard_icc : public CreatureScript me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 0.0f); for (std::list::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr) (*itr)->AI()->DoAction(ACTION_DESPAWN); + + // temp until outro fully done - to put deathbringer on respawn timer (until next reset) + if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_DEATHBRINGER_SAURFANG))) + deathbringer->DespawnOrUnsummon(5000); break; } case ACTION_INTERRUPT_INTRO: @@ -1175,6 +1196,9 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader void FilterTargetsInitial(std::list& unitList) { + if (unitList.empty()) + return; + // select one random target, with preference of ranged targets uint32 targetsAtRange = 0; uint32 const minTargets = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 10 : 4); @@ -1189,7 +1213,9 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader if (targetsAtRange < minTargets) targetsAtRange = std::min(unitList.size() - 1, minTargets); - target = SelectRandomContainerElement(unitList); + std::list::const_iterator itr = unitList.begin(); + std::advance(itr, urand(0, targetsAtRange)); + target = *itr; unitList.clear(); unitList.push_back(target); } @@ -1256,6 +1282,33 @@ class spell_deathbringer_boiling_blood : public SpellScriptLoader } }; +class spell_deathbringer_remove_marks : public SpellScriptLoader +{ + public: + spell_deathbringer_remove_marks() : SpellScriptLoader("spell_deathbringer_remove_marks") { } + + class spell_deathbringer_remove_marks_SpellScript : public SpellScript + { + PrepareSpellScript(spell_deathbringer_remove_marks_SpellScript); + + void HandleScript(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + GetHitUnit()->RemoveAurasDueToSpell(uint32(GetEffectValue())); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_deathbringer_remove_marks_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_deathbringer_remove_marks_SpellScript(); + } +}; + class achievement_ive_gone_and_made_a_mess : public AchievementCriteriaScript { public: @@ -1285,5 +1338,6 @@ void AddSC_boss_deathbringer_saurfang() new spell_deathbringer_blood_nova(); new spell_deathbringer_blood_nova_targeting(); new spell_deathbringer_boiling_blood(); + new spell_deathbringer_remove_marks(); new achievement_ive_gone_and_made_a_mess(); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index d352871ba6d..90ee6e1af71 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -585,8 +585,8 @@ class boss_the_lich_king : public CreatureScript SendLightOverride(0, 5000); break; case ACTION_BREAK_FROSTMOURNE: - DoCastAOE(SPELL_SUMMON_BROKEN_FROSTMOURNE); - DoCastAOE(SPELL_SUMMON_BROKEN_FROSTMOURNE_2); + me->CastSpell((Unit*)NULL, SPELL_SUMMON_BROKEN_FROSTMOURNE, TRIGGERED_IGNORE_CAST_IN_PROGRESS); + me->CastSpell((Unit*)NULL, SPELL_SUMMON_BROKEN_FROSTMOURNE_2, TRIGGERED_IGNORE_CAST_IN_PROGRESS); SetEquipmentSlots(false, EQUIP_BROKEN_FROSTMOURNE); events.ScheduleEvent(EVENT_OUTRO_TALK_6, 2500, 0, PHASE_OUTRO); break; @@ -1065,12 +1065,11 @@ class boss_the_lich_king : public CreatureScript Talk(SAY_LK_OUTRO_6); if (Creature* tirion = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HIGHLORD_TIRION_FORDRING))) tirion->SetFacingToObject(me); - me->ClearUnitState(UNIT_STATE_CASTING); - DoCastAOE(SPELL_SUMMON_BROKEN_FROSTMOURNE_3); + me->CastSpell((Unit*)NULL, SPELL_SUMMON_BROKEN_FROSTMOURNE_3, TRIGGERED_IGNORE_CAST_IN_PROGRESS); SetEquipmentSlots(false, EQUIP_UNEQUIP); break; case EVENT_OUTRO_SOUL_BARRAGE: - DoCastAOE(SPELL_SOUL_BARRAGE); + me->CastSpell((Unit*)NULL, SPELL_SOUL_BARRAGE, TRIGGERED_IGNORE_CAST_IN_PROGRESS); sCreatureTextMgr->SendSound(me, SOUND_PAIN, CHAT_MSG_MONSTER_YELL, 0, TEXT_RANGE_NORMAL, TEAM_OTHER, false); // set flight me->SetDisableGravity(true); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index e0993178890..36594d5a684 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -329,8 +329,13 @@ class boss_valithria_dreamwalker : public CreatureScript _events.ScheduleEvent(EVENT_BERSERK, 420000); } - void HealReceived(Unit* /*healer*/, uint32& heal) + void HealReceived(Unit* healer, uint32& heal) { + if (!me->hasLootRecipient()) + me->SetLootRecipient(healer); + + me->LowerPlayerDamageReq(heal); + // encounter complete if (me->HealthAbovePctHealed(100, heal) && !_done) { diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h index 085aea139a3..224777c3db7 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h @@ -331,6 +331,10 @@ enum GameObjectsIds GO_DOODAD_ICECROWN_ROOSTPORTCULLIS_02 = 201381, GO_DOODAD_ICECROWN_ROOSTPORTCULLIS_03 = 201382, GO_DOODAD_ICECROWN_ROOSTPORTCULLIS_04 = 201383, + GO_CACHE_OF_THE_DREAMWALKER_10N = 201959, + GO_CACHE_OF_THE_DREAMWALKER_25N = 202339, + GO_CACHE_OF_THE_DREAMWALKER_10H = 202338, + GO_CACHE_OF_THE_DREAMWALKER_25H = 202340, // Sindragosa GO_SINDRAGOSA_ENTRANCE_DOOR = 201373, diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index 98f5c04ba42..cb83efc748f 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -452,6 +452,14 @@ class instance_icecrown_citadel : public InstanceMapScript case GO_DRINK_ME: PutricideTableGUID = go->GetGUID(); break; + case GO_CACHE_OF_THE_DREAMWALKER_10N: + case GO_CACHE_OF_THE_DREAMWALKER_25N: + case GO_CACHE_OF_THE_DREAMWALKER_10H: + case GO_CACHE_OF_THE_DREAMWALKER_25H: + if (Creature* valithria = instance->GetCreature(ValithriaDreamwalkerGUID)) + go->SetLootRecipient(valithria->GetLootRecipient()); + go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED | GO_FLAG_NOT_SELECTABLE | GO_FLAG_NODESPAWN); + break; case GO_ARTHAS_PLATFORM: // this enables movement at The Frozen Throne, when printed this value is 0.000000f // however, when represented as integer client will accept only this value @@ -638,7 +646,13 @@ class instance_icecrown_citadel : public InstanceMapScript switch (state) { case DONE: - DoRespawnGameObject(DeathbringersCacheGUID, 7*DAY); + if (GameObject* loot = instance->GetGameObject(DeathbringersCacheGUID)) + { + if (Creature* deathbringer = instance->GetCreature(DeathbringerSaurfangGUID)) + loot->SetLootRecipient(deathbringer->GetLootRecipient()); + loot->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED | GO_FLAG_NOT_SELECTABLE | GO_FLAG_NODESPAWN); + } + // no break case NOT_STARTED: if (GameObject* teleporter = instance->GetGameObject(SaurfangTeleportGUID)) { From 11b71bfa4b0b2ae9adbd9aa370ab386515e01bae Mon Sep 17 00:00:00 2001 From: Bezo Date: Tue, 13 Mar 2012 01:16:04 +0200 Subject: [PATCH 0161/1149] Logs/Arena: Add match type for extended arena logs for statistics Add match type for winner logs. --- src/server/game/Battlegrounds/Battleground.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 10c0e75ed88..36da0e9a97e 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -743,7 +743,7 @@ void Battleground::EndBattleground(uint32 winner) winner_matchmaker_rating = GetArenaMatchmakerRating(winner); winner_matchmaker_change = winner_arena_team->WonAgainst(winner_matchmaker_rating, loser_matchmaker_rating, winner_change); loser_matchmaker_change = loser_arena_team->LostAgainst(loser_matchmaker_rating, winner_matchmaker_rating, loser_change); - sLog->outArena("--- Winner: old rating: %u, rating gain: %d, old MMR: %u, MMR gain: %d --- Loser: old rating: %u, rating loss: %d, old MMR: %u, MMR loss: %d ---", winner_team_rating, winner_change, winner_matchmaker_rating, + sLog->outArena("match Type: %u --- Winner: old rating: %u, rating gain: %d, old MMR: %u, MMR gain: %d --- Loser: old rating: %u, rating loss: %d, old MMR: %u, MMR loss: %d ---", m_ArenaType, winner_team_rating, winner_change, winner_matchmaker_rating, winner_matchmaker_change, loser_team_rating, loser_change, loser_matchmaker_rating, loser_matchmaker_change); SetArenaMatchmakerRating(winner, winner_matchmaker_rating + winner_matchmaker_change); SetArenaMatchmakerRating(GetOtherTeam(winner), loser_matchmaker_rating + loser_matchmaker_change); @@ -753,7 +753,7 @@ void Battleground::EndBattleground(uint32 winner) if (sWorld->getBoolConfig(CONFIG_ARENA_LOG_EXTENDED_INFO)) for (Battleground::BattlegroundScoreMap::const_iterator itr = GetPlayerScoresBegin(); itr != GetPlayerScoresEnd(); ++itr) if (Player* player = ObjectAccessor::FindPlayer(itr->first)) - sLog->outArena("Statistics for %s (GUID: " UI64FMTD ", Team: %d, IP: %s): %u damage, %u healing, %u killing blows", player->GetName(), itr->first, player->GetArenaTeamId(m_ArenaType == 5 ? 2 : m_ArenaType == 3), player->GetSession()->GetRemoteAddress().c_str(), itr->second->DamageDone, itr->second->HealingDone, itr->second->KillingBlows); + sLog->outArena("Statistics match Type: %u for %s (GUID: " UI64FMTD ", Team: %d, IP: %s): %u damage, %u healing, %u killing blows", m_ArenaType, player->GetName(), itr->first, player->GetArenaTeamId(m_ArenaType == 5 ? 2 : m_ArenaType == 3), player->GetSession()->GetRemoteAddress().c_str(), itr->second->DamageDone, itr->second->HealingDone, itr->second->KillingBlows); } // Deduct 16 points from each teams arena-rating if there are no winners after 45+2 minutes else From 0532afed90bd60b66d6ba874fb1471db6f50f0d2 Mon Sep 17 00:00:00 2001 From: thomas33 Date: Tue, 13 Mar 2012 14:53:36 +0100 Subject: [PATCH 0162/1149] more cleanup --- src/server/game/Entities/Creature/Creature.h | 6 +- src/server/game/Entities/Player/Player.cpp | 56 ++++++------ src/server/game/Entities/Unit/Unit.cpp | 4 +- src/server/game/Entities/Unit/Unit.h | 90 +++++++++---------- .../game/Grids/Notifiers/GridNotifiers.h | 6 +- 5 files changed, 81 insertions(+), 81 deletions(-) diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 2f9549fd70a..a8664047b89 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -487,7 +487,7 @@ class Creature : public Unit, public GridObject, public MapCreature bool isCanTrainingOf(Player* player, bool msg) const; bool isCanInteractWithBattleMaster(Player* player, bool msg) const; bool isCanTrainingAndResetTalentsOf(Player* player) const; - bool canCreatureAttack(Unit const* pVictim, bool force = true) const; + bool canCreatureAttack(Unit const* victim, bool force = true) const; bool IsImmunedToSpell(SpellInfo const* spellInfo); // redefine Unit::IsImmunedToSpell bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const; @@ -604,8 +604,8 @@ class Creature : public Unit, public GridObject, public MapCreature void RemoveLootMode(uint16 lootMode) { m_LootMode &= ~lootMode; } void ResetLootMode() { m_LootMode = LOOT_MODE_DEFAULT; } - SpellInfo const* reachWithSpellAttack(Unit* pVictim); - SpellInfo const* reachWithSpellCure(Unit* pVictim); + SpellInfo const* reachWithSpellAttack(Unit* victim); + SpellInfo const* reachWithSpellCure(Unit* victim); uint32 m_spells[CREATURE_MAX_SPELLS]; CreatureSpellCooldowns m_CreatureSpellCooldowns; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 5ebfb02f205..29a346091ff 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4079,10 +4079,10 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) // most likely will never be used, haven't heard of cases where players unlearn a mount if (Has310Flyer(false) && _spell_idx->second->skillId == SKILL_MOUNTS) { - SpellInfo const* pSpellInfo = sSpellMgr->GetSpellInfo(spell_id); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (pSpellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED && - pSpellInfo->Effects[i].CalcValue() == 310) + if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED && + spellInfo->Effects[i].CalcValue() == 310) Has310Flyer(true, spell_id); // with true as first argument its also used to set/remove the flag } } @@ -4161,7 +4161,7 @@ bool Player::Has310Flyer(bool checkAllSpells, uint32 excludeSpellId) else { SetHas310Flyer(false); - SpellInfo const* pSpellInfo; + SpellInfo const* spellInfo; for (PlayerSpellMap::iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr) { if (itr->first == excludeSpellId) @@ -4173,10 +4173,10 @@ bool Player::Has310Flyer(bool checkAllSpells, uint32 excludeSpellId) if (_spell_idx->second->skillId != SKILL_MOUNTS) break; // We can break because mount spells belong only to one skillline (at least 310 flyers do) - pSpellInfo = sSpellMgr->GetSpellInfo(itr->first); + spellInfo = sSpellMgr->GetSpellInfo(itr->first); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (pSpellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED && - pSpellInfo->Effects[i].CalcValue() == 310) + if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED && + spellInfo->Effects[i].CalcValue() == 310) { SetHas310Flyer(true); return true; @@ -6916,15 +6916,15 @@ int32 Player::CalculateReputationGain(uint32 creatureOrQuestLevel, int32 rep, in } //Calculates how many reputation points player gains in victim's enemy factions -void Player::RewardReputation(Unit* pVictim, float rate) +void Player::RewardReputation(Unit* victim, float rate) { - if (!pVictim || pVictim->GetTypeId() == TYPEID_PLAYER) + if (!victim || victim->GetTypeId() == TYPEID_PLAYER) return; - if (pVictim->ToCreature()->IsReputationGainDisabled()) + if (victim->ToCreature()->IsReputationGainDisabled()) return; - ReputationOnKillEntry const* Rep = sObjectMgr->GetReputationOnKilEntry(pVictim->ToCreature()->GetCreatureTemplate()->Entry); + ReputationOnKillEntry const* Rep = sObjectMgr->GetReputationOnKilEntry(victim->ToCreature()->GetCreatureTemplate()->Entry); if (!Rep) return; @@ -6966,7 +6966,7 @@ void Player::RewardReputation(Unit* pVictim, float rate) if (Rep->RepFaction1 && (!Rep->TeamDependent || team == ALLIANCE)) { - int32 donerep1 = CalculateReputationGain(pVictim->getLevel(), Rep->RepValue1, ChampioningFaction ? ChampioningFaction : Rep->RepFaction1, false); + int32 donerep1 = CalculateReputationGain(victim->getLevel(), Rep->RepValue1, ChampioningFaction ? ChampioningFaction : Rep->RepFaction1, false); donerep1 = int32(donerep1*(rate + favored_rep_mult)); if (recruitAFriend) @@ -6980,7 +6980,7 @@ void Player::RewardReputation(Unit* pVictim, float rate) if (Rep->RepFaction2 && (!Rep->TeamDependent || team == HORDE)) { - int32 donerep2 = CalculateReputationGain(pVictim->getLevel(), Rep->RepValue2, ChampioningFaction ? ChampioningFaction : Rep->RepFaction2, false); + int32 donerep2 = CalculateReputationGain(victim->getLevel(), Rep->RepValue2, ChampioningFaction ? ChampioningFaction : Rep->RepFaction2, false); donerep2 = int32(donerep2*(rate + favored_rep_mult)); if (recruitAFriend) @@ -7112,14 +7112,14 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool pvpt if (uVictim->GetTypeId() == TYPEID_PLAYER) { - Player* pVictim = uVictim->ToPlayer(); + Player* victim = uVictim->ToPlayer(); - if (GetTeam() == pVictim->GetTeam() && !sWorld->IsFFAPvPRealm()) + if (GetTeam() == victim->GetTeam() && !sWorld->IsFFAPvPRealm()) return false; uint8 k_level = getLevel(); uint8 k_grey = Trinity::XP::GetGrayLevel(k_level); - uint8 v_level = pVictim->getLevel(); + uint8 v_level = victim->getLevel(); if (v_level <= k_grey) return false; @@ -7130,7 +7130,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool pvpt // [15..28] Horde honor titles and player name // [29..38] Other title and player name // [39+] Nothing - uint32 victim_title = pVictim->GetUInt32Value(PLAYER_CHOSEN_TITLE); + uint32 victim_title = victim->GetUInt32Value(PLAYER_CHOSEN_TITLE); // Get Killer titles, CharTitlesEntry::bit_index // Ranks: // title[1..14] -> rank[5..18] @@ -7152,10 +7152,10 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool pvpt // and those in a lifetime ApplyModUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 1, true); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS, pVictim->getClass()); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_RACE, pVictim->getRace()); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS, victim->getClass()); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_RACE, victim->getRace()); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA, GetAreaId()); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, 1, 0, pVictim); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, 1, 0, victim); } else { @@ -22649,20 +22649,20 @@ uint32 Player::GetResurrectionSpellId() } // Used in triggers for check "Only to targets that grant experience or honor" req -bool Player::isHonorOrXPTarget(Unit* pVictim) +bool Player::isHonorOrXPTarget(Unit* victim) { - uint8 v_level = pVictim->getLevel(); + uint8 v_level = victim->getLevel(); uint8 k_grey = Trinity::XP::GetGrayLevel(getLevel()); // Victim level less gray level if (v_level <= k_grey) return false; - if (pVictim->GetTypeId() == TYPEID_UNIT) + if (victim->GetTypeId() == TYPEID_UNIT) { - if (pVictim->ToCreature()->isTotem() || - pVictim->ToCreature()->isPet() || - pVictim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) + if (victim->ToCreature()->isTotem() || + victim->ToCreature()->isPet() || + victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) return false; } return true; @@ -22709,9 +22709,9 @@ bool Player::GetsRecruitAFriendBonus(bool forXP) return recruitAFriend; } -void Player::RewardPlayerAndGroupAtKill(Unit* pVictim, bool isBattleGround) +void Player::RewardPlayerAndGroupAtKill(Unit* victim, bool isBattleGround) { - KillRewarder(this, pVictim, isBattleGround).Reward(); + KillRewarder(this, victim, isBattleGround).Reward(); } void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewardSource) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 6d4963f1960..e89d289ba4e 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17421,14 +17421,14 @@ void Unit::SetFacingTo(float ori) init.Launch(); } -void Unit::SetFacingToObject(WorldObject* pObject) +void Unit::SetFacingToObject(WorldObject* object) { // never face when already moving if (!IsStopped()) return; // TODO: figure out under what conditions creature will move towards object instead of facing it where it currently is. - SetFacingTo(GetAngle(pObject)); + SetFacingTo(GetAngle(object)); } bool Unit::SetWalk(bool enable) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 79ed0ec2f3d..88eb0068f45 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1305,7 +1305,7 @@ class Unit : public WorldObject void StopAttackFaction(uint32 faction_id); Unit* SelectNearbyTarget(Unit* exclude = NULL, float dist = NOMINAL_MELEE_RANGE) const; void SendMeleeAttackStop(Unit* victim = NULL); - void SendMeleeAttackStart(Unit* pVictim); + void SendMeleeAttackStart(Unit* victim); void AddUnitState(uint32 f) { m_state |= f; } bool HasUnitState(const uint32 f) const { return (m_state & f); } @@ -1437,12 +1437,12 @@ class Unit : public WorldObject void Dismount(); uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; } - void DealDamageMods(Unit* pVictim, uint32 &damage, uint32* absorb); - uint32 DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDamage = NULL, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = NULL, bool durabilityLoss = true); - void Kill(Unit* pVictim, bool durabilityLoss = true); - int32 DealHeal(Unit* pVictim, uint32 addhealth); + void DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb); + uint32 DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDamage = NULL, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = NULL, bool durabilityLoss = true); + void Kill(Unit* victim, bool durabilityLoss = true); + int32 DealHeal(Unit* victim, uint32 addhealth); - void ProcDamageAndSpell(Unit* pVictim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpell = NULL, SpellInfo const* procAura = NULL); + void ProcDamageAndSpell(Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpell = NULL, SpellInfo const* procAura = NULL); void ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpell, uint32 damage, SpellInfo const* procAura = NULL); void GetProcAurasTriggeredOnEvent(std::list& aurasTriggeringProc, std::list* procAuras, ProcEventInfo eventInfo); @@ -1451,9 +1451,9 @@ class Unit : public WorldObject void TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, std::list& procAuras); void HandleEmoteCommand(uint32 anim_id); - void AttackerStateUpdate (Unit* pVictim, WeaponAttackType attType = BASE_ATTACK, bool extra = false); + void AttackerStateUpdate (Unit* victim, WeaponAttackType attType = BASE_ATTACK, bool extra = false); - void CalculateMeleeDamage(Unit* pVictim, uint32 damage, CalcDamageInfo* damageInfo, WeaponAttackType attackType = BASE_ATTACK); + void CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* damageInfo, WeaponAttackType attackType = BASE_ATTACK); void DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss); void HandleProcExtraAttackFor(Unit* victim); @@ -1475,18 +1475,18 @@ class Unit : public WorldObject uint32 GetRangedDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_CRIT_TAKEN_RANGED, 2.0f, 100.0f, damage); } uint32 GetSpellDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_CRIT_TAKEN_SPELL, 2.0f, 100.0f, damage); } - void ApplyResilience(const Unit* pVictim, float * crit, int32 * damage, bool isCrit, CombatRating type) const; + void ApplyResilience(const Unit* victim, float * crit, int32 * damage, bool isCrit, CombatRating type) const; - float MeleeSpellMissChance(const Unit* pVictim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const; - SpellMissInfo MeleeSpellHitResult(Unit* pVictim, SpellInfo const* spell); - SpellMissInfo MagicSpellHitResult(Unit* pVictim, SpellInfo const* spell); - SpellMissInfo SpellHitResult(Unit* pVictim, SpellInfo const* spell, bool canReflect = false); + float MeleeSpellMissChance(const Unit* victim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const; + SpellMissInfo MeleeSpellHitResult(Unit* victim, SpellInfo const* spell); + SpellMissInfo MagicSpellHitResult(Unit* victim, SpellInfo const* spell); + SpellMissInfo SpellHitResult(Unit* victim, SpellInfo const* spell, bool canReflect = false); float GetUnitDodgeChance() const; float GetUnitParryChance() const; float GetUnitBlockChance() const; float GetUnitMissChance(WeaponAttackType attType) const; - float GetUnitCriticalChance(WeaponAttackType attackType, const Unit* pVictim) const; + float GetUnitCriticalChance(WeaponAttackType attackType, const Unit* victim) const; int32 GetMechanicResistChance(const SpellInfo* spell); bool CanUseAttackType(uint8 attacktype) const { @@ -1520,8 +1520,8 @@ class Unit : public WorldObject float GetWeaponProcChance() const; float GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellInfo* spellProto) const; - MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit* pVictim, WeaponAttackType attType) const; - MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit* pVictim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance) const; + MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackType attType) const; + MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance) const; bool isVendor() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_VENDOR); } bool isTrainer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_TRAINER); } @@ -1581,11 +1581,11 @@ class Unit : public WorldObject virtual bool IsUnderWater() const; bool isInAccessiblePlaceFor(Creature const* c) const; - void SendHealSpellLog(Unit* pVictim, uint32 SpellID, uint32 Damage, uint32 OverHeal, uint32 Absorb, bool critical = false); - int32 HealBySpell(Unit* pVictim, SpellInfo const* spellInfo, uint32 addHealth, bool critical = false); - void SendEnergizeSpellLog(Unit* pVictim, uint32 SpellID, uint32 Damage, Powers powertype); - void EnergizeBySpell(Unit* pVictim, uint32 SpellID, uint32 Damage, Powers powertype); - uint32 SpellNonMeleeDamageLog(Unit* pVictim, uint32 spellID, uint32 damage); + void SendHealSpellLog(Unit* victim, uint32 SpellID, uint32 Damage, uint32 OverHeal, uint32 Absorb, bool critical = false); + int32 HealBySpell(Unit* victim, SpellInfo const* spellInfo, uint32 addHealth, bool critical = false); + void SendEnergizeSpellLog(Unit* victim, uint32 SpellID, uint32 Damage, Powers powertype); + void EnergizeBySpell(Unit* victim, uint32 SpellID, uint32 Damage, Powers powertype); + uint32 SpellNonMeleeDamageLog(Unit* victim, uint32 spellID, uint32 damage); void CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo, CustomSpellValues const* value, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0); void CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0); @@ -1642,7 +1642,7 @@ class Unit : public WorldObject void SetInFront(Unit const* target); void SetFacingTo(float ori); - void SetFacingToObject(WorldObject* pObject); + void SetFacingToObject(WorldObject* object); void SendChangeCurrentVictimOpcode(HostileReference* pHostileReference); void SendClearThreatListOpcode(); @@ -1967,10 +1967,10 @@ class Unit : public WorldObject // Threat related methods bool CanHaveThreatList() const; - void AddThreat(Unit* pVictim, float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = NULL); + void AddThreat(Unit* victim, float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = NULL); float ApplyTotalThreatModifier(float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL); void DeleteThreatList(); - void TauntApply(Unit* pVictim); + void TauntApply(Unit* victim); void TauntFadeOut(Unit* taunter); ThreatManager& getThreatManager() { return m_ThreatManager; } void addHatedBy(HostileReference* pHostileReference) { m_HostileRefManager.insertFirst(pHostileReference); }; @@ -2023,22 +2023,22 @@ class Unit : public WorldObject Unit* GetMeleeHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo = NULL); int32 SpellBaseDamageBonus(SpellSchoolMask schoolMask); int32 SpellBaseHealingBonus(SpellSchoolMask schoolMask); - int32 SpellBaseDamageBonusForVictim(SpellSchoolMask schoolMask, Unit* pVictim); - int32 SpellBaseHealingBonusForVictim(SpellSchoolMask schoolMask, Unit* pVictim); - uint32 SpellDamageBonus(Unit* pVictim, SpellInfo const* spellProto, uint32 damage, DamageEffectType damagetype, uint32 stack = 1); - uint32 SpellHealingBonus(Unit* pVictim, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1); - bool isSpellBlocked(Unit* pVictim, SpellInfo const* spellProto, WeaponAttackType attackType = BASE_ATTACK); + int32 SpellBaseDamageBonusForVictim(SpellSchoolMask schoolMask, Unit* victim); + int32 SpellBaseHealingBonusForVictim(SpellSchoolMask schoolMask, Unit* victim); + uint32 SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 damage, DamageEffectType damagetype, uint32 stack = 1); + uint32 SpellHealingBonus(Unit* victim, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1); + bool isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType = BASE_ATTACK); bool isBlockCritical(); - bool isSpellCrit(Unit* pVictim, SpellInfo const* spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType = BASE_ATTACK) const; - uint32 SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage, Unit* pVictim); - uint32 SpellCriticalHealingBonus(SpellInfo const* spellProto, uint32 damage, Unit* pVictim); + bool isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType = BASE_ATTACK) const; + uint32 SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage, Unit* victim); + uint32 SpellCriticalHealingBonus(SpellInfo const* spellProto, uint32 damage, Unit* victim); void SetLastManaUse(uint32 spellCastTime) { m_lastManaUse = spellCastTime; } bool IsUnderLastManaUseEffect() const; void SetContestedPvP(Player* attackedPlayer = NULL); - void MeleeDamageBonus(Unit* pVictim, uint32 *damage, WeaponAttackType attType, SpellInfo const* spellProto = NULL); + void MeleeDamageBonus(Unit* victim, uint32 *damage, WeaponAttackType attType, SpellInfo const* spellProto = NULL); uint32 GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime); uint32 GetRemainingPeriodicAmount(uint64 caster, uint32 spellId, AuraType auraType, uint8 effectIndex = 0) const; @@ -2052,9 +2052,9 @@ class Unit : public WorldObject virtual bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const; // redefined in Creature static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const* spellInfo = NULL, uint8 effIndex = MAX_SPELL_EFFECTS); - uint32 CalcArmorReducedDamage(Unit* pVictim, const uint32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType=MAX_ATTACK); - void CalcAbsorbResist(Unit* pVictim, SpellSchoolMask schoolMask, DamageEffectType damagetype, const uint32 damage, uint32 *absorb, uint32 *resist, SpellInfo const* spellInfo = NULL); - void CalcHealAbsorb(Unit* pVictim, const SpellInfo* spellProto, uint32 &healAmount, uint32 &absorb); + uint32 CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType=MAX_ATTACK); + void CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, const uint32 damage, uint32 *absorb, uint32 *resist, SpellInfo const* spellInfo = NULL); + void CalcHealAbsorb(Unit* victim, const SpellInfo* spellProto, uint32 &healAmount, uint32 &absorb); void UpdateSpeed(UnitMoveType mtype, bool forced); float GetSpeed(UnitMoveType mtype) const; @@ -2313,15 +2313,15 @@ class Unit : public WorldObject void DisableSpline(); private: - bool IsTriggeredAtSpellProcEvent(Unit* pVictim, Aura* aura, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const* & spellProcEvent); - bool HandleDummyAuraProc(Unit* pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - bool HandleHasteAuraProc(Unit* pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - bool HandleSpellCritChanceAuraProc(Unit* pVictim, uint32 damage, AuraEffect* triggredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - bool HandleObsModEnergyAuraProc(Unit* pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - bool HandleModDamagePctTakenAuraProc(Unit* pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - bool HandleAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, bool * handled); - bool HandleProcTriggerSpell(Unit* pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - bool HandleOverrideClassScriptAuraProc(Unit* pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 cooldown); + bool IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const* & spellProcEvent); + bool HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + bool HandleHasteAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + bool HandleSpellCritChanceAuraProc(Unit* victim, uint32 damage, AuraEffect* triggredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + bool HandleObsModEnergyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + bool HandleModDamagePctTakenAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + bool HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, bool * handled); + bool HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + bool HandleOverrideClassScriptAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 cooldown); bool HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura); bool HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura); diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 7ffdf687561..7c3e5cf1c52 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -1188,7 +1188,7 @@ namespace Trinity class AllGameObjectsWithEntryInRange { public: - AllGameObjectsWithEntryInRange(const WorldObject* pObject, uint32 uiEntry, float fMaxRange) : m_pObject(pObject), m_uiEntry(uiEntry), m_fRange(fMaxRange) {} + AllGameObjectsWithEntryInRange(const WorldObject* object, uint32 uiEntry, float fMaxRange) : m_pObject(object), m_uiEntry(uiEntry), m_fRange(fMaxRange) {} bool operator() (GameObject* go) { if (go->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(go, m_fRange, false)) @@ -1205,7 +1205,7 @@ namespace Trinity class AllCreaturesOfEntryInRange { public: - AllCreaturesOfEntryInRange(const WorldObject* pObject, uint32 uiEntry, float fMaxRange) : m_pObject(pObject), m_uiEntry(uiEntry), m_fRange(fMaxRange) {} + AllCreaturesOfEntryInRange(const WorldObject* object, uint32 uiEntry, float fMaxRange) : m_pObject(object), m_uiEntry(uiEntry), m_fRange(fMaxRange) {} bool operator() (Unit* unit) { if (unit->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(unit, m_fRange, false)) @@ -1257,7 +1257,7 @@ namespace Trinity class AllWorldObjectsInRange { public: - AllWorldObjectsInRange(const WorldObject* pObject, float fMaxRange) : m_pObject(pObject), m_fRange(fMaxRange) {} + AllWorldObjectsInRange(const WorldObject* object, float fMaxRange) : m_pObject(object), m_fRange(fMaxRange) {} bool operator() (WorldObject* go) { return m_pObject->IsWithinDist(go, m_fRange, false); From cae662d1913d99597441c777492167f1c5aadd2b Mon Sep 17 00:00:00 2001 From: thomas33 Date: Tue, 13 Mar 2012 15:48:18 +0100 Subject: [PATCH 0163/1149] cleanup --- src/server/game/Grids/Notifiers/GridNotifiers.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 7c3e5cf1c52..c639da15113 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -1188,7 +1188,7 @@ namespace Trinity class AllGameObjectsWithEntryInRange { public: - AllGameObjectsWithEntryInRange(const WorldObject* object, uint32 uiEntry, float fMaxRange) : m_pObject(object), m_uiEntry(uiEntry), m_fRange(fMaxRange) {} + AllGameObjectsWithEntryInRange(const WorldObject* object, uint32 entry, float maxRange) : m_pObject(object), m_uiEntry(entry), m_fRange(maxRange) {} bool operator() (GameObject* go) { if (go->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(go, m_fRange, false)) @@ -1205,7 +1205,7 @@ namespace Trinity class AllCreaturesOfEntryInRange { public: - AllCreaturesOfEntryInRange(const WorldObject* object, uint32 uiEntry, float fMaxRange) : m_pObject(object), m_uiEntry(uiEntry), m_fRange(fMaxRange) {} + AllCreaturesOfEntryInRange(const WorldObject* object, uint32 entry, float maxRange) : m_pObject(object), m_uiEntry(entry), m_fRange(maxRange) {} bool operator() (Unit* unit) { if (unit->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(unit, m_fRange, false)) @@ -1257,7 +1257,7 @@ namespace Trinity class AllWorldObjectsInRange { public: - AllWorldObjectsInRange(const WorldObject* object, float fMaxRange) : m_pObject(object), m_fRange(fMaxRange) {} + AllWorldObjectsInRange(const WorldObject* object, float maxRange) : m_pObject(object), m_fRange(maxRange) {} bool operator() (WorldObject* go) { return m_pObject->IsWithinDist(go, m_fRange, false); From 1dde22394c880a0839ced6bb70f778340800ec1c Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 14 Mar 2012 00:21:46 +0100 Subject: [PATCH 0164/1149] Core: Corrected conflicting variable names --- src/server/game/Calendar/CalendarMgr.cpp | 4 ++-- src/server/game/Entities/Player/Player.cpp | 10 +++++----- src/server/game/Handlers/CalendarHandler.cpp | 5 ++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index 761bbb9b496..cef68891890 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -469,9 +469,9 @@ bool CalendarMgr::RemoveEvent(uint64 eventId) bool val = true; CalendarInviteIdList const& invites = itr->second.GetInviteIdList(); - for (CalendarInviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) + for (CalendarInviteIdList::const_iterator itrInvites = invites.begin(); itrInvites != invites.end(); ++itrInvites) { - CalendarInvite* invite = GetInvite(*itr); + CalendarInvite* invite = GetInvite(*itrInvites); if (!invite || !RemovePlayerEvent(invite->GetInvitee(), eventId)) val = false; } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 29a346091ff..f0b974fa673 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4079,11 +4079,11 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) // most likely will never be used, haven't heard of cases where players unlearn a mount if (Has310Flyer(false) && _spell_idx->second->skillId == SKILL_MOUNTS) { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id); - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED && - spellInfo->Effects[i].CalcValue() == 310) - Has310Flyer(true, spell_id); // with true as first argument its also used to set/remove the flag + if (spellInfo) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED && + spellInfo->Effects[i].CalcValue() == 310) + Has310Flyer(true, spell_id); // with true as first argument its also used to set/remove the flag } } } diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 64acc512add..d1277d154cc 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -590,11 +590,10 @@ void WorldSession::HandleCalendarGetNumPending(WorldPacket& /*recvData*/) void WorldSession::SendCalendarEvent(CalendarEvent const& calendarEvent, CalendarSendEventType sendEventType) { - uint64 guid = _player->GetGUID(); uint64 eventId = calendarEvent.GetEventId(); sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_SEND_EVENT [" UI64FMTD "] EventId [" - UI64FMTD "] SendType %u", guid, eventId, sendEventType); + UI64FMTD "] SendType %u", _player->GetGUID(), eventId, sendEventType); WorldPacket data(SMSG_CALENDAR_SEND_EVENT); data << uint8(sendEventType); @@ -632,7 +631,7 @@ void WorldSession::SendCalendarEvent(CalendarEvent const& calendarEvent, Calenda } else { - data.appendPackGUID(guid); + data.appendPackGUID(_player->GetGUID()); data << uint8(0) << uint8(0) << uint8(0) << uint8(0) << uint64(0) << uint32(0) << uint8(0); From e8f414e143d9f716298a18f0c290149d2a154229 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Wed, 14 Mar 2012 09:20:36 +0800 Subject: [PATCH 0165/1149] Core/Script: Clean-Up in Scripts. Creature* c -> Creature* creature Signed-off-by: Gyx <2359980687@qq.com> --- .../BlackrockDepths/blackrock_depths.cpp | 10 ++--- .../EasternKingdoms/Karazhan/boss_curator.cpp | 2 +- .../Karazhan/boss_maiden_of_virtue.cpp | 2 +- .../Karazhan/boss_midnight.cpp | 4 +- .../EasternKingdoms/Karazhan/boss_moroes.cpp | 11 +++-- .../Karazhan/boss_netherspite.cpp | 4 +- .../Karazhan/boss_nightbane.cpp | 4 +- .../Karazhan/boss_prince_malchezaar.cpp | 6 +-- .../Karazhan/boss_shade_of_aran.cpp | 6 +-- .../Karazhan/boss_terestian_illhoof.cpp | 12 ++--- .../EasternKingdoms/Karazhan/bosses_opera.cpp | 36 +++++++-------- .../EasternKingdoms/Karazhan/karazhan.cpp | 8 ++-- .../boss_felblood_kaelthas.cpp | 14 +++--- .../boss_priestess_delrissa.cpp | 8 ++-- .../MagistersTerrace/boss_selin_fireheart.cpp | 6 +-- .../MagistersTerrace/boss_vexallus.cpp | 6 +-- .../MoltenCore/boss_ragnaros.cpp | 2 +- .../ScarletEnclave/chapter1.cpp | 14 +++--- .../Scholomance/boss_darkmaster_gandling.cpp | 2 +- .../boss_death_knight_darkreaver.cpp | 2 +- .../boss_doctor_theolen_krastinov.cpp | 2 +- .../Scholomance/boss_illucia_barov.cpp | 2 +- .../Scholomance/boss_instructor_malicia.cpp | 2 +- .../Scholomance/boss_jandice_barov.cpp | 4 +- .../Scholomance/boss_kormok.cpp | 2 +- .../Scholomance/boss_lord_alexei_barov.cpp | 2 +- .../Scholomance/boss_lorekeeper_polkelt.cpp | 2 +- .../Scholomance/boss_ras_frostwhisper.cpp | 2 +- .../Scholomance/boss_the_ravenian.cpp | 2 +- .../Scholomance/boss_vectus.cpp | 2 +- .../ShadowfangKeep/shadowfang_keep.cpp | 6 +-- .../Stratholme/boss_baron_rivendare.cpp | 2 +- .../Stratholme/boss_baroness_anastari.cpp | 2 +- .../Stratholme/boss_cannon_master_willey.cpp | 2 +- .../Stratholme/boss_dathrohan_balnazzar.cpp | 2 +- .../Stratholme/boss_magistrate_barthilas.cpp | 2 +- .../Stratholme/boss_maleki_the_pallid.cpp | 2 +- .../Stratholme/boss_nerubenkan.cpp | 2 +- .../Stratholme/boss_order_of_silver_hand.cpp | 4 +- .../Stratholme/boss_postmaster_malown.cpp | 2 +- .../Stratholme/boss_ramstein_the_gorger.cpp | 2 +- .../Stratholme/boss_timmy_the_cruel.cpp | 2 +- .../EasternKingdoms/Stratholme/stratholme.cpp | 6 +-- .../SunwellPlateau/boss_brutallus.cpp | 4 +- .../SunwellPlateau/boss_eredar_twins.cpp | 10 ++--- .../SunwellPlateau/boss_felmyst.cpp | 8 ++-- .../SunwellPlateau/boss_kalecgos.cpp | 12 ++--- .../SunwellPlateau/boss_kiljaeden.cpp | 28 ++++++------ .../SunwellPlateau/boss_muru.cpp | 20 ++++----- .../Uldaman/boss_archaedas.cpp | 2 +- .../EasternKingdoms/ZulAman/boss_akilzon.cpp | 6 +-- .../EasternKingdoms/ZulAman/boss_halazzi.cpp | 6 +-- .../EasternKingdoms/ZulAman/boss_hexlord.cpp | 8 ++-- .../EasternKingdoms/ZulAman/boss_janalai.cpp | 14 +++--- .../EasternKingdoms/ZulAman/boss_nalorakk.cpp | 4 +- .../EasternKingdoms/ZulAman/boss_zuljin.cpp | 6 +-- .../EasternKingdoms/ZulAman/zulaman.cpp | 6 +-- .../ZulGurub/boss_gahzranka.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_grilek.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_hakkar.cpp | 4 +- .../ZulGurub/boss_hazzarah.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_jeklik.cpp | 8 ++-- .../EasternKingdoms/ZulGurub/boss_jindo.cpp | 8 ++-- .../ZulGurub/boss_mandokir.cpp | 8 ++-- .../EasternKingdoms/ZulGurub/boss_marli.cpp | 6 +-- .../ZulGurub/boss_renataki.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_thekal.cpp | 12 ++--- .../ZulGurub/boss_wushoolay.cpp | 2 +- .../EasternKingdoms/arathi_highlands.cpp | 2 +- .../scripts/EasternKingdoms/boss_kruul.cpp | 2 +- .../EasternKingdoms/burning_steppes.cpp | 2 +- .../scripts/EasternKingdoms/duskwood.cpp | 2 +- .../EasternKingdoms/eastern_plaguelands.cpp | 4 +- .../EasternKingdoms/eversong_woods.cpp | 6 +-- .../scripts/EasternKingdoms/ghostlands.cpp | 2 +- .../EasternKingdoms/isle_of_queldanas.cpp | 4 +- .../EasternKingdoms/silvermoon_city.cpp | 2 +- .../EasternKingdoms/silverpine_forest.cpp | 4 +- .../EasternKingdoms/stormwind_city.cpp | 4 +- .../EasternKingdoms/stranglethorn_vale.cpp | 2 +- .../scripts/EasternKingdoms/undercity.cpp | 4 +- .../EasternKingdoms/western_plaguelands.cpp | 4 +- .../scripts/EasternKingdoms/westfall.cpp | 2 +- .../scripts/Examples/example_creature.cpp | 2 +- .../BattleForMountHyjal/boss_anetheron.cpp | 8 ++-- .../BattleForMountHyjal/boss_archimonde.cpp | 12 ++--- .../BattleForMountHyjal/boss_azgalor.cpp | 8 ++-- .../BattleForMountHyjal/boss_kazrogal.cpp | 4 +- .../boss_rage_winterchill.cpp | 4 +- .../BattleForMountHyjal/hyjalAI.cpp | 4 +- .../BattleForMountHyjal/hyjalAI.h | 2 +- .../BattleForMountHyjal/hyjal_trash.cpp | 42 +++++++++--------- .../BattleForMountHyjal/hyjal_trash.h | 2 +- .../CullingOfStratholme/boss_epoch.cpp | 4 +- .../CullingOfStratholme/boss_infinite.cpp | 4 +- .../CullingOfStratholme/boss_mal_ganis.cpp | 4 +- .../CullingOfStratholme/boss_meathook.cpp | 4 +- .../CullingOfStratholme/boss_salramm.cpp | 4 +- .../CavernsOfTime/DarkPortal/boss_aeonus.cpp | 4 +- .../DarkPortal/boss_chrono_lord_deja.cpp | 4 +- .../DarkPortal/boss_temporus.cpp | 4 +- .../CavernsOfTime/DarkPortal/dark_portal.cpp | 8 ++-- .../boss_captain_skarloc.cpp | 4 +- .../boss_epoch_hunter.cpp | 4 +- .../boss_leutenant_drake.cpp | 2 +- .../EscapeFromDurnholdeKeep/old_hillsbrad.cpp | 8 ++-- .../boss_amnennar_the_coldbringer.cpp | 2 +- .../Kalimdor/RazorfenKraul/razorfen_kraul.cpp | 2 +- .../TempleOfAhnQiraj/boss_bug_trio.cpp | 12 ++--- .../Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp | 18 ++++---- .../TempleOfAhnQiraj/boss_fankriss.cpp | 2 +- .../TempleOfAhnQiraj/boss_huhuran.cpp | 2 +- .../Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp | 2 +- .../TempleOfAhnQiraj/boss_sartura.cpp | 4 +- .../Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp | 2 +- .../TempleOfAhnQiraj/boss_twinemperors.cpp | 4 +- .../mob_anubisath_sentinel.cpp | 2 +- .../WailingCaverns/wailing_caverns.cpp | 4 +- src/server/scripts/Kalimdor/ashenvale.cpp | 2 +- src/server/scripts/Kalimdor/azshara.cpp | 6 +-- .../scripts/Kalimdor/azuremyst_isle.cpp | 18 ++++---- .../scripts/Kalimdor/bloodmyst_isle.cpp | 2 +- src/server/scripts/Kalimdor/boss_azuregos.cpp | 2 +- src/server/scripts/Kalimdor/durotar.cpp | 2 +- src/server/scripts/Kalimdor/moonglade.cpp | 2 +- src/server/scripts/Kalimdor/mulgore.cpp | 4 +- src/server/scripts/Kalimdor/orgrimmar.cpp | 4 +- src/server/scripts/Kalimdor/silithus.cpp | 6 +-- .../scripts/Kalimdor/stonetalon_mountains.cpp | 2 +- src/server/scripts/Kalimdor/tanaris.cpp | 6 +-- src/server/scripts/Kalimdor/the_barrens.cpp | 6 +-- .../scripts/Kalimdor/thousand_needles.cpp | 4 +- src/server/scripts/Kalimdor/thunder_bluff.cpp | 2 +- src/server/scripts/Kalimdor/ungoro_crater.cpp | 2 +- .../AzjolNerub/Ahnkahet/boss_amanitar.cpp | 6 +-- .../AzjolNerub/Ahnkahet/boss_elder_nadox.cpp | 6 +-- .../Ahnkahet/boss_jedoga_shadowseeker.cpp | 12 ++--- .../Ahnkahet/boss_prince_taldaram.cpp | 8 ++-- .../AzjolNerub/AzjolNerub/boss_hadronox.cpp | 4 +- .../boss_krikthir_the_gatewatcher.cpp | 18 ++++---- .../Northrend/DraktharonKeep/boss_novos.cpp | 12 ++--- .../DraktharonKeep/boss_tharon_ja.cpp | 4 +- .../DraktharonKeep/boss_trollgore.cpp | 4 +- .../HallsOfReflection/halls_of_reflection.cpp | 10 ++--- .../scripts/Northrend/Gundrak/boss_eck.cpp | 8 ++-- .../Northrend/Gundrak/boss_gal_darah.cpp | 4 +- .../Northrend/Gundrak/boss_slad_ran.cpp | 8 ++-- .../Northrend/Naxxramas/boss_thaddius.cpp | 8 ++-- .../Nexus/Nexus/boss_keristrasza.cpp | 4 +- .../Nexus/Nexus/boss_magus_telestra.cpp | 4 +- .../Northrend/Nexus/Nexus/boss_ormorok.cpp | 8 ++-- .../Nexus/Nexus/commander_kolurg.cpp | 2 +- .../Nexus/Nexus/commander_stoutbeard.cpp | 2 +- .../Ulduar/HallsOfStone/boss_krystallus.cpp | 4 +- .../HallsOfStone/boss_maiden_of_grief.cpp | 2 +- .../Ulduar/HallsOfStone/boss_sjonnir.cpp | 10 ++--- .../Ulduar/HallsOfStone/halls_of_stone.cpp | 8 ++-- .../Northrend/Ulduar/Ulduar/boss_algalon.cpp | 4 +- .../UtgardeKeep/boss_ingvar_the_plunderer.cpp | 6 +-- .../UtgardeKeep/boss_skarvald_dalronn.cpp | 8 ++-- .../UtgardeKeep/UtgardeKeep/utgarde_keep.cpp | 4 +- .../UtgardePinnacle/boss_palehoof.cpp | 24 +++++----- .../UtgardePinnacle/boss_skadi.cpp | 4 +- .../UtgardePinnacle/boss_ymiron.cpp | 4 +- .../VaultOfArchavon/boss_toravon.cpp | 2 +- .../Northrend/VioletHold/boss_cyanigosa.cpp | 4 +- .../Northrend/VioletHold/boss_erekem.cpp | 8 ++-- .../Northrend/VioletHold/boss_lavanthor.cpp | 4 +- .../Northrend/VioletHold/boss_moragg.cpp | 4 +- .../Northrend/VioletHold/boss_zuramat.cpp | 4 +- .../Northrend/VioletHold/violet_hold.cpp | 44 +++++++++---------- .../scripts/Northrend/borean_tundra.cpp | 20 ++++----- .../scripts/Northrend/grizzly_hills.cpp | 4 +- .../scripts/Northrend/sholazar_basin.cpp | 2 +- src/server/scripts/OutdoorPvP/OutdoorPvPZM.h | 2 +- .../AuchenaiCrypts/boss_exarch_maladaar.cpp | 6 +-- .../boss_shirrak_the_dead_watcher.cpp | 4 +- .../ManaTombs/boss_nexusprince_shaffar.cpp | 6 +-- .../Auchindoun/ManaTombs/boss_pandemonius.cpp | 2 +- .../SethekkHalls/boss_darkweaver_syth.cpp | 10 ++--- .../SethekkHalls/boss_tailonking_ikiss.cpp | 4 +- .../boss_blackheart_the_inciter.cpp | 4 +- .../boss_grandmaster_vorpil.cpp | 6 +-- .../ShadowLabyrinth/boss_murmur.cpp | 2 +- .../Outland/BlackTemple/boss_bloodboil.cpp | 4 +- .../Outland/BlackTemple/boss_illidan.cpp | 20 ++++----- .../BlackTemple/boss_mother_shahraz.cpp | 4 +- .../BlackTemple/boss_reliquary_of_souls.cpp | 12 ++--- .../BlackTemple/boss_shade_of_akama.cpp | 12 ++--- .../Outland/BlackTemple/boss_supremus.cpp | 6 +-- .../BlackTemple/boss_teron_gorefiend.cpp | 8 ++-- .../BlackTemple/boss_warlord_najentus.cpp | 4 +- .../Outland/BlackTemple/illidari_council.cpp | 10 ++--- .../boss_fathomlord_karathress.cpp | 16 +++---- .../boss_hydross_the_unstable.cpp | 4 +- .../SerpentShrine/boss_lady_vashj.cpp | 22 +++++----- .../boss_leotheras_the_blind.cpp | 14 +++--- .../SerpentShrine/boss_lurker_below.cpp | 6 +-- .../boss_morogrim_tidewalker.cpp | 6 +-- .../SteamVault/boss_hydromancer_thespia.cpp | 6 +-- .../SteamVault/boss_mekgineer_steamrigger.cpp | 8 ++-- .../SteamVault/boss_warlord_kalithresh.cpp | 8 ++-- .../underbog/boss_hungarfen.cpp | 4 +- .../underbog/boss_the_black_stalker.cpp | 2 +- .../scripts/Outland/GruulsLair/boss_gruul.cpp | 4 +- .../GruulsLair/boss_high_king_maulgar.cpp | 20 ++++----- .../scripts/Outland/blades_edge_mountains.cpp | 6 +-- .../scripts/Outland/hellfire_peninsula.cpp | 4 +- src/server/scripts/Outland/nagrand.cpp | 2 +- src/server/scripts/Outland/netherstorm.cpp | 8 ++-- .../scripts/Outland/shadowmoon_valley.cpp | 16 +++---- src/server/scripts/Outland/shattrath_city.cpp | 10 ++--- .../scripts/Outland/terokkar_forest.cpp | 18 ++++---- src/server/scripts/Outland/zangarmarsh.cpp | 6 +-- .../scripts/World/mob_generic_creature.cpp | 2 +- src/server/scripts/World/npcs_special.cpp | 26 +++++------ 216 files changed, 687 insertions(+), 688 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp index 15c418d2919..8edf6260f58 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp @@ -355,7 +355,7 @@ public: struct mob_phalanxAI : public ScriptedAI { - mob_phalanxAI(Creature* c) : ScriptedAI(c) {} + mob_phalanxAI(Creature* creature) : ScriptedAI(creature) {} uint32 ThunderClap_Timer; uint32 FireballVolley_Timer; @@ -609,7 +609,7 @@ public: struct npc_dughal_stormwingAI : public npc_escortAI { - npc_dughal_stormwingAI(Creature* c) : npc_escortAI(c) {} + npc_dughal_stormwingAI(Creature* creature) : npc_escortAI(creature) {} void WaypointReached(uint32 i) { @@ -725,9 +725,9 @@ public: struct npc_marshal_windsorAI : public npc_escortAI { - npc_marshal_windsorAI(Creature* c) : npc_escortAI(c) + npc_marshal_windsorAI(Creature* creature) : npc_escortAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } void WaypointReached(uint32 i) @@ -896,7 +896,7 @@ public: struct npc_marshal_reginald_windsorAI : public npc_escortAI { - npc_marshal_reginald_windsorAI(Creature* c) : npc_escortAI(c) + npc_marshal_reginald_windsorAI(Creature* creature) : npc_escortAI(creature) { } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp index b1fa4d54eb6..6de67e9371f 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp @@ -55,7 +55,7 @@ public: struct boss_curatorAI : public ScriptedAI { - boss_curatorAI(Creature* c) : ScriptedAI(c) {} + boss_curatorAI(Creature* creature) : ScriptedAI(creature) {} uint32 AddTimer; uint32 HatefulBoltTimer; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp index 66de84abbc2..5446f4c0158 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp @@ -51,7 +51,7 @@ public: struct boss_maiden_of_virtueAI : public ScriptedAI { - boss_maiden_of_virtueAI(Creature* c) : ScriptedAI(c) {} + boss_maiden_of_virtueAI(Creature* creature) : ScriptedAI(creature) {} uint32 Repentance_Timer; uint32 Holyfire_Timer; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp index 65b758b55e7..4e04284354e 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp @@ -58,7 +58,7 @@ public: struct boss_attumenAI : public ScriptedAI { - boss_attumenAI(Creature* c) : ScriptedAI(c) + boss_attumenAI(Creature* creature) : ScriptedAI(creature) { Phase = 1; @@ -119,7 +119,7 @@ public: struct boss_midnightAI : public ScriptedAI { - boss_midnightAI(Creature* c) : ScriptedAI(c) {} + boss_midnightAI(Creature* creature) : ScriptedAI(creature) {} uint64 Attumen; uint8 Phase; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp index 484515be0f8..ec80ae02ca9 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -72,13 +72,12 @@ public: struct boss_moroesAI : public ScriptedAI { - boss_moroesAI(Creature* c) : ScriptedAI(c) + boss_moroesAI(Creature* creature) : ScriptedAI(creature) { for (uint8 i = 0; i < 4; ++i) - { AddId[i] = 0; - } - instance = c->GetInstanceScript(); + + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -322,12 +321,12 @@ struct boss_moroes_guestAI : public ScriptedAI uint64 GuestGUID[4]; - boss_moroes_guestAI(Creature* c) : ScriptedAI(c) + boss_moroes_guestAI(Creature* creature) : ScriptedAI(creature) { for (uint8 i = 0; i < 4; ++i) GuestGUID[i] = 0; - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } void Reset() diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp index c1fe9c9c56c..f89abca76cf 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp @@ -70,9 +70,9 @@ public: struct boss_netherspiteAI : public ScriptedAI { - boss_netherspiteAI(Creature* c) : ScriptedAI(c) + boss_netherspiteAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); for (int i=0; i<3; ++i) { diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index 0cf68852041..ded5e6903a5 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -70,9 +70,9 @@ public: struct boss_nightbaneAI : public ScriptedAI { - boss_nightbaneAI(Creature* c) : ScriptedAI(c) + boss_nightbaneAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); Intro = true; } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index 35a9f854d58..596f07fec64 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -108,7 +108,7 @@ public: struct netherspite_infernalAI : public ScriptedAI { - netherspite_infernalAI(Creature* c) : ScriptedAI(c), + netherspite_infernalAI(Creature* creature) : ScriptedAI(creature), HellfireTimer(0), CleanupTimer(0), malchezaar(0), point(NULL) {} uint32 HellfireTimer; @@ -183,9 +183,9 @@ public: struct boss_malchezaarAI : public ScriptedAI { - boss_malchezaarAI(Creature* c) : ScriptedAI(c) + boss_malchezaarAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp index d3d8ad38a43..120bd03b719 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp @@ -92,9 +92,9 @@ public: struct boss_aranAI : public ScriptedAI { - boss_aranAI(Creature* c) : ScriptedAI(c) + boss_aranAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -522,7 +522,7 @@ public: struct water_elementalAI : public ScriptedAI { - water_elementalAI(Creature* c) : ScriptedAI(c) {} + water_elementalAI(Creature* creature) : ScriptedAI(creature) {} uint32 CastTimer; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp index 15750c5b9c5..d0716a0b565 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp @@ -68,9 +68,9 @@ public: struct mob_kilrekAI : public ScriptedAI { - mob_kilrekAI(Creature* c) : ScriptedAI(c) + mob_kilrekAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -140,7 +140,7 @@ public: struct mob_demon_chainAI : public ScriptedAI { - mob_demon_chainAI(Creature* c) : ScriptedAI(c) {} + mob_demon_chainAI(Creature* creature) : ScriptedAI(creature) {} uint64 SacrificeGUID; @@ -215,7 +215,7 @@ public: struct mob_fiendish_impAI : public ScriptedAI { - mob_fiendish_impAI(Creature* c) : ScriptedAI(c) {} + mob_fiendish_impAI(Creature* creature) : ScriptedAI(creature) {} uint32 FireboltTimer; @@ -258,11 +258,11 @@ public: struct boss_terestianAI : public ScriptedAI { - boss_terestianAI(Creature* c) : ScriptedAI(c) + boss_terestianAI(Creature* creature) : ScriptedAI(creature) { for (uint8 i = 0; i < 2; ++i) PortalGUID[i] = 0; - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index 39be500e487..c2aeedbd1d3 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -114,9 +114,9 @@ public: struct boss_dorotheeAI : public ScriptedAI { - boss_dorotheeAI(Creature* c) : ScriptedAI(c) + boss_dorotheeAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -229,7 +229,7 @@ public: struct mob_titoAI : public ScriptedAI { - mob_titoAI(Creature* c) : ScriptedAI(c) {} + mob_titoAI(Creature* creature) : ScriptedAI(creature) {} uint64 DorotheeGUID; uint32 YipTimer; @@ -296,9 +296,9 @@ public: struct boss_strawmanAI : public ScriptedAI { - boss_strawmanAI(Creature* c) : ScriptedAI(c) + boss_strawmanAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -411,9 +411,9 @@ public: struct boss_tinheadAI : public ScriptedAI { - boss_tinheadAI(Creature* c) : ScriptedAI(c) + boss_tinheadAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -521,9 +521,9 @@ public: struct boss_roarAI : public ScriptedAI { - boss_roarAI(Creature* c) : ScriptedAI(c) + boss_roarAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -630,9 +630,9 @@ public: struct boss_croneAI : public ScriptedAI { - boss_croneAI(Creature* c) : ScriptedAI(c) + boss_croneAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -712,7 +712,7 @@ public: struct mob_cycloneAI : public ScriptedAI { - mob_cycloneAI(Creature* c) : ScriptedAI(c) {} + mob_cycloneAI(Creature* creature) : ScriptedAI(creature) {} uint32 MoveTimer; @@ -805,9 +805,9 @@ public: struct boss_bigbadwolfAI : public ScriptedAI { - boss_bigbadwolfAI(Creature* c) : ScriptedAI(c) + boss_bigbadwolfAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -1004,9 +1004,9 @@ public: struct boss_julianneAI : public ScriptedAI { - boss_julianneAI(Creature* c) : ScriptedAI(c) + boss_julianneAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); EntryYellTimer = 1000; AggroYellTimer = 10000; IsFakingDeath = false; @@ -1127,9 +1127,9 @@ public: struct boss_romuloAI : public ScriptedAI { - boss_romuloAI(Creature* c) : ScriptedAI(c) + boss_romuloAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); EntryYellTimer = 8000; AggroYellTimer = 15000; } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index fd5a77fb816..a61fd235753 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -109,11 +109,11 @@ public: struct npc_barnesAI : public npc_escortAI { - npc_barnesAI(Creature* c) : npc_escortAI(c) + npc_barnesAI(Creature* creature) : npc_escortAI(creature) { RaidWiped = false; m_uiEventId = 0; - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -474,9 +474,9 @@ public: struct npc_image_of_medivhAI : public ScriptedAI { - npc_image_of_medivhAI(Creature* c) : ScriptedAI(c) + npc_image_of_medivhAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index 0c1017edfdb..31f6d1cb2af 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -89,9 +89,9 @@ public: struct boss_felblood_kaelthasAI : public ScriptedAI { - boss_felblood_kaelthasAI(Creature* c) : ScriptedAI(c) + boss_felblood_kaelthasAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -441,7 +441,7 @@ public: struct mob_felkael_flamestrikeAI : public ScriptedAI { - mob_felkael_flamestrikeAI(Creature* c) : ScriptedAI(c) + mob_felkael_flamestrikeAI(Creature* creature) : ScriptedAI(creature) { } @@ -483,9 +483,9 @@ public: struct mob_felkael_phoenixAI : public ScriptedAI { - mob_felkael_phoenixAI(Creature* c) : ScriptedAI(c) + mob_felkael_phoenixAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -603,7 +603,7 @@ public: struct mob_felkael_phoenix_eggAI : public ScriptedAI { - mob_felkael_phoenix_eggAI(Creature* c) : ScriptedAI(c) {} + mob_felkael_phoenix_eggAI(Creature* creature) : ScriptedAI(creature) {} uint32 HatchTimer; @@ -640,7 +640,7 @@ public: struct mob_arcane_sphereAI : public ScriptedAI { - mob_arcane_sphereAI(Creature* c) : ScriptedAI(c) { Reset(); } + mob_arcane_sphereAI(Creature* creature) : ScriptedAI(creature) { Reset(); } uint32 DespawnTimer; uint32 ChangeTargetTimer; diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp index b9d4f600329..9984554208f 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp @@ -99,9 +99,9 @@ public: struct boss_priestess_delrissaAI : public ScriptedAI { - boss_priestess_delrissaAI(Creature* c) : ScriptedAI(c) + boss_priestess_delrissaAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); memset(&m_auiLackeyGUID, 0, sizeof(m_auiLackeyGUID)); LackeyEntryList.clear(); } @@ -341,9 +341,9 @@ enum eHealingPotion //all 8 possible lackey use this common struct boss_priestess_lackey_commonAI : public ScriptedAI { - boss_priestess_lackey_commonAI(Creature* c) : ScriptedAI(c) + boss_priestess_lackey_commonAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); memset(&m_auiLackeyGUIDs, 0, sizeof(m_auiLackeyGUIDs)); AcquireGUIDs(); } diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp index 62acd96d0a9..af7deda4545 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp @@ -63,9 +63,9 @@ public: struct boss_selin_fireheartAI : public ScriptedAI { - boss_selin_fireheartAI(Creature* c) : ScriptedAI(c) + boss_selin_fireheartAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); Crystals.clear(); //GUIDs per instance is static, so we only need to load them once. @@ -333,7 +333,7 @@ public: struct mob_fel_crystalAI : public ScriptedAI { - mob_fel_crystalAI(Creature* c) : ScriptedAI(c) {} + mob_fel_crystalAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp index 5f3716d9dea..bae2dd71b6d 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp @@ -71,9 +71,9 @@ public: struct boss_vexallusAI : public ScriptedAI { - boss_vexallusAI(Creature* c) : ScriptedAI(c) + boss_vexallusAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -206,7 +206,7 @@ public: struct mob_pure_energyAI : public ScriptedAI { - mob_pure_energyAI(Creature* c) : ScriptedAI(c) {} + mob_pure_energyAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp index 47d50925d56..f3797f0feb3 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp @@ -316,7 +316,7 @@ class mob_son_of_flame : public CreatureScript struct mob_son_of_flameAI : public ScriptedAI //didnt work correctly in EAI for me... { - mob_son_of_flameAI(Creature* c) : ScriptedAI(c) + mob_son_of_flameAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index a55694ad419..0b45144f51b 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -102,7 +102,7 @@ public: struct npc_unworthy_initiateAI : public ScriptedAI { - npc_unworthy_initiateAI(Creature* c) : ScriptedAI(c) + npc_unworthy_initiateAI(Creature* creature) : ScriptedAI(creature) { me->SetReactState(REACT_PASSIVE); if (!me->GetEquipmentId()) @@ -531,7 +531,7 @@ public: struct npc_dark_rider_of_acherusAI : public ScriptedAI { - npc_dark_rider_of_acherusAI(Creature* c) : ScriptedAI(c) {} + npc_dark_rider_of_acherusAI(Creature* creature) : ScriptedAI(creature) {} uint32 PhaseTimer; uint32 Phase; @@ -623,7 +623,7 @@ public: struct npc_salanar_the_horsemanAI : public ScriptedAI { - npc_salanar_the_horsemanAI(Creature* c) : ScriptedAI(c) {} + npc_salanar_the_horsemanAI(Creature* creature) : ScriptedAI(creature) {} void SpellHit(Unit* caster, const SpellInfo* spell) { @@ -692,7 +692,7 @@ public: struct npc_ros_dark_riderAI : public ScriptedAI { - npc_ros_dark_riderAI(Creature* c) : ScriptedAI(c) {} + npc_ros_dark_riderAI(Creature* creature) : ScriptedAI(creature) {} void EnterCombat(Unit* /*who*/) { @@ -743,7 +743,7 @@ public: struct npc_dkc1_gothikAI : public ScriptedAI { - npc_dkc1_gothikAI(Creature* c) : ScriptedAI(c) {} + npc_dkc1_gothikAI(Creature* creature) : ScriptedAI(creature) {} void MoveInLineOfSight(Unit* who) { @@ -785,7 +785,7 @@ public: struct npc_scarlet_ghoulAI : public ScriptedAI { - npc_scarlet_ghoulAI(Creature* c) : ScriptedAI(c) + npc_scarlet_ghoulAI(Creature* creature) : ScriptedAI(creature) { // Ghouls should display their Birth Animation // Crawling out of the ground @@ -931,7 +931,7 @@ public: struct npc_scarlet_minerAI : public npc_escortAI { - npc_scarlet_minerAI(Creature* c) : npc_escortAI(c) + npc_scarlet_minerAI(Creature* creature) : npc_escortAI(creature) { me->SetReactState(REACT_PASSIVE); } diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp index 4ddc240a03c..2bc0320b81d 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp @@ -62,7 +62,7 @@ public: struct boss_darkmaster_gandlingAI : public ScriptedAI { - boss_darkmaster_gandlingAI(Creature* c) : ScriptedAI(c) + boss_darkmaster_gandlingAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp index 693cad06bd5..967f771fe7a 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp @@ -37,7 +37,7 @@ public: struct boss_death_knight_darkreaverAI : public ScriptedAI { - boss_death_knight_darkreaverAI(Creature* c) : ScriptedAI(c) {} + boss_death_knight_darkreaverAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp index 05d662c4fe3..82f4dc85060 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp @@ -45,7 +45,7 @@ public: struct boss_theolenkrastinovAI : public ScriptedAI { - boss_theolenkrastinovAI(Creature* c) : ScriptedAI(c) {} + boss_theolenkrastinovAI(Creature* creature) : ScriptedAI(creature) {} uint32 m_uiRend_Timer; uint32 m_uiBackhand_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp index 92f0fcd25c4..e438ae56a2b 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp @@ -43,7 +43,7 @@ public: struct boss_illuciabarovAI : public ScriptedAI { - boss_illuciabarovAI(Creature* c) : ScriptedAI(c) {} + boss_illuciabarovAI(Creature* creature) : ScriptedAI(creature) {} uint32 CurseOfAgony_Timer; uint32 ShadowShock_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp index 295d9440d2e..498e6596b06 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp @@ -44,7 +44,7 @@ public: struct boss_instructormaliciaAI : public ScriptedAI { - boss_instructormaliciaAI(Creature* c) : ScriptedAI(c) {} + boss_instructormaliciaAI(Creature* creature) : ScriptedAI(creature) {} uint32 CallOfGraves_Timer; uint32 Corruption_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp index 48bf000745c..064faa5643d 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp @@ -43,7 +43,7 @@ public: struct boss_jandicebarovAI : public ScriptedAI { - boss_jandicebarovAI(Creature* c) : ScriptedAI(c) {} + boss_jandicebarovAI(Creature* creature) : ScriptedAI(creature) {} uint32 CurseOfBlood_Timer; uint32 Illusion_Timer; @@ -165,7 +165,7 @@ public: struct mob_illusionofjandicebarovAI : public ScriptedAI { - mob_illusionofjandicebarovAI(Creature* c) : ScriptedAI(c) {} + mob_illusionofjandicebarovAI(Creature* creature) : ScriptedAI(creature) {} uint32 Cleave_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp index 7c279e726a6..5fd5a96d605 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp @@ -40,7 +40,7 @@ public: struct boss_kormokAI : public ScriptedAI { - boss_kormokAI(Creature* c) : ScriptedAI(c) {} + boss_kormokAI(Creature* creature) : ScriptedAI(creature) {} uint32 ShadowVolley_Timer; uint32 BoneShield_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp index 5109e6e1468..327c1df921d 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp @@ -41,7 +41,7 @@ public: struct boss_lordalexeibarovAI : public ScriptedAI { - boss_lordalexeibarovAI(Creature* c) : ScriptedAI(c) {} + boss_lordalexeibarovAI(Creature* creature) : ScriptedAI(creature) {} uint32 Immolate_Timer; uint32 VeilofShadow_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp index 754640bff9e..1919a1ba099 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp @@ -43,7 +43,7 @@ public: struct boss_lorekeeperpolkeltAI : public ScriptedAI { - boss_lorekeeperpolkeltAI(Creature* c) : ScriptedAI(c) {} + boss_lorekeeperpolkeltAI(Creature* creature) : ScriptedAI(creature) {} uint32 VolatileInfection_Timer; uint32 Darkplague_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp index 902838da152..fd10c6374a6 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp @@ -44,7 +44,7 @@ public: struct boss_rasfrostAI : public ScriptedAI { - boss_rasfrostAI(Creature* c) : ScriptedAI(c) {} + boss_rasfrostAI(Creature* creature) : ScriptedAI(creature) {} uint32 IceArmor_Timer; uint32 Frostbolt_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp index 13fa450f5ee..a28cecf3772 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp @@ -43,7 +43,7 @@ public: struct boss_theravenianAI : public ScriptedAI { - boss_theravenianAI(Creature* c) : ScriptedAI(c) {} + boss_theravenianAI(Creature* creature) : ScriptedAI(creature) {} uint32 Trample_Timer; uint32 Cleave_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp index 657b458e148..f5f453c30bd 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp @@ -45,7 +45,7 @@ public: struct boss_vectusAI : public ScriptedAI { - boss_vectusAI(Creature* c) : ScriptedAI(c) {} + boss_vectusAI(Creature* creature) : ScriptedAI(creature) {} uint32 m_uiFireShield_Timer; uint32 m_uiBlastWave_Timer; diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp index 9cb30eda060..09832007a0b 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp @@ -90,10 +90,10 @@ public: struct npc_shadowfang_prisonerAI : public npc_escortAI { - npc_shadowfang_prisonerAI(Creature* c) : npc_escortAI(c) + npc_shadowfang_prisonerAI(Creature* creature) : npc_escortAI(creature) { - instance = c->GetInstanceScript(); - uiNpcEntry = c->GetEntry(); + instance = creature->GetInstanceScript(); + uiNpcEntry = creature->GetEntry(); } InstanceScript* instance; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp index 0c659117f5d..32da9334adf 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp @@ -89,7 +89,7 @@ public: struct boss_baron_rivendareAI : public ScriptedAI { - boss_baron_rivendareAI(Creature* c) : ScriptedAI(c) + boss_baron_rivendareAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp index a01846cb862..46aa3c96176 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp @@ -43,7 +43,7 @@ public: struct boss_baroness_anastariAI : public ScriptedAI { - boss_baroness_anastariAI(Creature* c) : ScriptedAI(c) + boss_baroness_anastariAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp index d84bd489dab..2e97281b98f 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp @@ -88,7 +88,7 @@ public: struct boss_cannon_master_willeyAI : public ScriptedAI { - boss_cannon_master_willeyAI(Creature* c) : ScriptedAI(c) {} + boss_cannon_master_willeyAI(Creature* creature) : ScriptedAI(creature) {} uint32 KnockAway_Timer; uint32 Pummel_Timer; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp index 8a14f1e2401..b2637c496b2 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp @@ -77,7 +77,7 @@ public: struct boss_dathrohan_balnazzarAI : public ScriptedAI { - boss_dathrohan_balnazzarAI(Creature* c) : ScriptedAI(c) {} + boss_dathrohan_balnazzarAI(Creature* creature) : ScriptedAI(creature) {} uint32 m_uiCrusadersHammer_Timer; uint32 m_uiCrusaderStrike_Timer; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp index 48b1fc2acc7..b9b1ea6458f 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp @@ -46,7 +46,7 @@ public: struct boss_magistrate_barthilasAI : public ScriptedAI { - boss_magistrate_barthilasAI(Creature* c) : ScriptedAI(c) {} + boss_magistrate_barthilasAI(Creature* creature) : ScriptedAI(creature) {} uint32 DrainingBlow_Timer; uint32 CrowdPummel_Timer; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp index 1dc22a20d08..61f1a100cfe 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp @@ -43,7 +43,7 @@ public: struct boss_maleki_the_pallidAI : public ScriptedAI { - boss_maleki_the_pallidAI(Creature* c) : ScriptedAI(c) + boss_maleki_the_pallidAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp index a7c91c3636d..e8030248f43 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp @@ -43,7 +43,7 @@ public: struct boss_nerubenkanAI : public ScriptedAI { - boss_nerubenkanAI(Creature* c) : ScriptedAI(c) + boss_nerubenkanAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp index 3393b9e5797..99806e6cfdf 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp @@ -54,9 +54,9 @@ public: struct boss_silver_hand_bossesAI : public ScriptedAI { - boss_silver_hand_bossesAI(Creature* c) : ScriptedAI(c) + boss_silver_hand_bossesAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp index 869a82011ad..cf8b10a2ee5 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp @@ -48,7 +48,7 @@ public: struct boss_postmaster_malownAI : public ScriptedAI { - boss_postmaster_malownAI(Creature* c) : ScriptedAI(c) {} + boss_postmaster_malownAI(Creature* creature) : ScriptedAI(creature) {} uint32 WailingDead_Timer; uint32 Backhand_Timer; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp index f35bcc05ec2..a2fe87beb04 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp @@ -43,7 +43,7 @@ public: struct boss_ramstein_the_gorgerAI : public ScriptedAI { - boss_ramstein_the_gorgerAI(Creature* c) : ScriptedAI(c) + boss_ramstein_the_gorgerAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp index 405527ab383..a281c1b59c6 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp @@ -41,7 +41,7 @@ public: struct boss_timmy_the_cruelAI : public ScriptedAI { - boss_timmy_the_cruelAI(Creature* c) : ScriptedAI(c) {} + boss_timmy_the_cruelAI(Creature* creature) : ScriptedAI(creature) {} uint32 RavenousClaw_Timer; bool HasYelled; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp index 5b2b2fd46c1..48bf4ae2305 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp @@ -99,7 +99,7 @@ public: struct mob_freed_soulAI : public ScriptedAI { - mob_freed_soulAI(Creature* c) : ScriptedAI(c) {} + mob_freed_soulAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { @@ -133,7 +133,7 @@ public: struct mob_restless_soulAI : public ScriptedAI { - mob_restless_soulAI(Creature* c) : ScriptedAI(c) {} + mob_restless_soulAI(Creature* creature) : ScriptedAI(creature) {} uint64 Tagger; uint32 Die_Timer; @@ -211,7 +211,7 @@ public: struct mobs_spectral_ghostly_citizenAI : public ScriptedAI { - mobs_spectral_ghostly_citizenAI(Creature* c) : ScriptedAI(c) {} + mobs_spectral_ghostly_citizenAI(Creature* creature) : ScriptedAI(creature) {} uint32 Die_Timer; bool Tagged; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp index 5089c3b8074..3352c4c06d2 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp @@ -78,9 +78,9 @@ public: struct boss_brutallusAI : public ScriptedAI { - boss_brutallusAI(Creature* c) : ScriptedAI(c) + boss_brutallusAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); Intro = true; } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp index 56d7909336c..086a927d07d 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp @@ -97,9 +97,9 @@ public: struct boss_sacrolashAI : public ScriptedAI { - boss_sacrolashAI(Creature* c) : ScriptedAI(c) + boss_sacrolashAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -355,9 +355,9 @@ public: struct boss_alythessAI : public Scripted_NoMovementAI { - boss_alythessAI(Creature* c) : Scripted_NoMovementAI(c) + boss_alythessAI(Creature* creature) : Scripted_NoMovementAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); IntroStepCounter = 10; } @@ -684,7 +684,7 @@ public: struct mob_shadow_imageAI : public ScriptedAI { - mob_shadow_imageAI(Creature* c) : ScriptedAI(c) {} + mob_shadow_imageAI(Creature* creature) : ScriptedAI(creature) {} uint32 ShadowfuryTimer; uint32 KillTimer; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp index b3ea89c1d66..2fb50fec89e 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp @@ -115,9 +115,9 @@ public: struct boss_felmystAI : public ScriptedAI { - boss_felmystAI(Creature* c) : ScriptedAI(c) + boss_felmystAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -522,7 +522,7 @@ public: struct mob_felmyst_vaporAI : public ScriptedAI { - mob_felmyst_vaporAI(Creature* c) : ScriptedAI(c) + mob_felmyst_vaporAI(Creature* creature) : ScriptedAI(creature) { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetSpeed(MOVE_RUN, 0.8f); @@ -555,7 +555,7 @@ public: struct mob_felmyst_trailAI : public ScriptedAI { - mob_felmyst_trailAI(Creature* c) : ScriptedAI(c) + mob_felmyst_trailAI(Creature* creature) : ScriptedAI(creature) { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); DoCast(me, SPELL_TRAIL_TRIGGER, true); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index 45153c21ea6..7ac42ff8193 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -115,9 +115,9 @@ public: struct boss_kalecgosAI : public ScriptedAI { - boss_kalecgosAI(Creature* c) : ScriptedAI(c) + boss_kalecgosAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); SathGUID = 0; DoorGUID = 0; bJustReset = false; @@ -456,9 +456,9 @@ public: bool isEnraged; // if demon is enraged - boss_kalecAI(Creature* c) : ScriptedAI(c) + boss_kalecAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } void Reset() @@ -575,9 +575,9 @@ public: struct boss_sathrovarrAI : public ScriptedAI { - boss_sathrovarrAI(Creature* c) : ScriptedAI(c) + boss_sathrovarrAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); KalecGUID = 0; KalecgosGUID = 0; } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index e9101d123dc..30a2da32ef3 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -251,9 +251,9 @@ public: struct boss_kalecgos_kjAI : public ScriptedAI { - boss_kalecgos_kjAI(Creature* c) : ScriptedAI(c) + boss_kalecgos_kjAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -406,9 +406,9 @@ public: struct mob_kiljaeden_controllerAI : public Scripted_NoMovementAI { - mob_kiljaeden_controllerAI(Creature* c) : Scripted_NoMovementAI(c), summons(me) + mob_kiljaeden_controllerAI(Creature* creature) : Scripted_NoMovementAI(creature), summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -506,9 +506,9 @@ public: struct boss_kiljaedenAI : public Scripted_NoMovementAI { - boss_kiljaedenAI(Creature* c) : Scripted_NoMovementAI(c), summons(me) + boss_kiljaedenAI(Creature* creature) : Scripted_NoMovementAI(creature), summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -914,9 +914,9 @@ public: struct mob_hand_of_the_deceiverAI : public ScriptedAI { - mob_hand_of_the_deceiverAI(Creature* c) : ScriptedAI(c) + mob_hand_of_the_deceiverAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -1015,7 +1015,7 @@ public: struct mob_felfire_portalAI : public Scripted_NoMovementAI { - mob_felfire_portalAI(Creature* c) : Scripted_NoMovementAI(c) {} + mob_felfire_portalAI(Creature* creature) : Scripted_NoMovementAI(creature) {} uint32 uiSpawnFiendTimer; @@ -1060,7 +1060,7 @@ public: struct mob_volatile_felfire_fiendAI : public ScriptedAI { - mob_volatile_felfire_fiendAI(Creature* c) : ScriptedAI(c) {} + mob_volatile_felfire_fiendAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiExplodeTimer; @@ -1118,7 +1118,7 @@ public: struct mob_armageddonAI : public Scripted_NoMovementAI { - mob_armageddonAI(Creature* c) : Scripted_NoMovementAI(c) {} + mob_armageddonAI(Creature* creature) : Scripted_NoMovementAI(creature) {} uint8 spell; uint32 uiTimer; @@ -1173,9 +1173,9 @@ public: struct mob_shield_orbAI : public ScriptedAI { - mob_shield_orbAI(Creature* c) : ScriptedAI(c) + mob_shield_orbAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -1261,7 +1261,7 @@ public: struct mob_sinster_reflectionAI : public ScriptedAI { - mob_sinster_reflectionAI(Creature* c) : ScriptedAI(c) {} + mob_sinster_reflectionAI(Creature* creature) : ScriptedAI(creature) {} uint8 victimClass; uint32 uiTimer[3]; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index 9b5d941589b..66030a1c78c 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -113,9 +113,9 @@ public: struct boss_entropiusAI : public ScriptedAI { - boss_entropiusAI(Creature* c) : ScriptedAI(c), Summons(me) + boss_entropiusAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -213,9 +213,9 @@ public: struct boss_muruAI : public Scripted_NoMovementAI { - boss_muruAI(Creature* c) : Scripted_NoMovementAI(c), Summons(me) + boss_muruAI(Creature* creature) : Scripted_NoMovementAI(creature), Summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -378,9 +378,9 @@ public: struct npc_muru_portalAI : public Scripted_NoMovementAI { - npc_muru_portalAI(Creature* c) : Scripted_NoMovementAI(c), Summons(me) + npc_muru_portalAI(Creature* creature) : Scripted_NoMovementAI(creature), Summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -462,7 +462,7 @@ public: struct npc_dark_fiendAI : public ScriptedAI { - npc_dark_fiendAI(Creature* c) : ScriptedAI(c) {} + npc_dark_fiendAI(Creature* creature) : ScriptedAI(creature) {} uint32 WaitTimer; bool InAction; @@ -525,7 +525,7 @@ public: struct npc_void_sentinelAI : public ScriptedAI { - npc_void_sentinelAI(Creature* c) : ScriptedAI(c){} + npc_void_sentinelAI(Creature* creature) : ScriptedAI(creature){} uint32 PulseTimer; uint32 VoidBlastTimer; @@ -581,9 +581,9 @@ public: struct npc_blackholeAI : public ScriptedAI { - npc_blackholeAI(Creature* c) : ScriptedAI(c) + npc_blackholeAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp index 0872ac9adca..4e7192e966c 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp @@ -232,7 +232,7 @@ class mob_archaedas_minions : public CreatureScript struct mob_archaedas_minionsAI : public ScriptedAI { - mob_archaedas_minionsAI(Creature* c) : ScriptedAI(c) + mob_archaedas_minionsAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index df8d9bb83f8..a5eb76545ee 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -72,9 +72,9 @@ class boss_akilzon : public CreatureScript struct boss_akilzonAI : public ScriptedAI { - boss_akilzonAI(Creature* c) : ScriptedAI(c) + boss_akilzonAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -398,7 +398,7 @@ class mob_akilzon_eagle : public CreatureScript struct mob_akilzon_eagleAI : public ScriptedAI { - mob_akilzon_eagleAI(Creature* c) : ScriptedAI(c) {} + mob_akilzon_eagleAI(Creature* creature) : ScriptedAI(creature) {} uint32 EagleSwoop_Timer; bool arrived; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp index db0e201298c..3d53274a0db 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp @@ -83,9 +83,9 @@ class boss_halazzi : public CreatureScript struct boss_halazziAI : public ScriptedAI { - boss_halazziAI(Creature* c) : ScriptedAI(c) + boss_halazziAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -352,7 +352,7 @@ class mob_halazzi_lynx : public CreatureScript struct mob_halazzi_lynxAI : public ScriptedAI { - mob_halazzi_lynxAI(Creature* c) : ScriptedAI(c) {} + mob_halazzi_lynxAI(Creature* creature) : ScriptedAI(creature) {} uint32 FrenzyTimer; uint32 shredder_timer; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp index 5efd4af55ea..944d13cc1be 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp @@ -179,9 +179,9 @@ struct boss_hexlord_addAI : public ScriptedAI { InstanceScript* instance; - boss_hexlord_addAI(Creature* c) : ScriptedAI(c) + boss_hexlord_addAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } void Reset() {} @@ -211,9 +211,9 @@ class boss_hexlord_malacrass : public CreatureScript struct boss_hex_lord_malacrassAI : public ScriptedAI { - boss_hex_lord_malacrassAI(Creature* c) : ScriptedAI(c) + boss_hex_lord_malacrassAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); SelectAddEntry(); for (uint8 i = 0; i < 4; ++i) AddGUID[i] = 0; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index 8d29cfefc6e..3cf4f315cad 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -113,9 +113,9 @@ class boss_janalai : public CreatureScript struct boss_janalaiAI : public ScriptedAI { - boss_janalaiAI(Creature* c) : ScriptedAI(c) + boss_janalaiAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -448,7 +448,7 @@ class mob_janalai_firebomb : public CreatureScript struct mob_janalai_firebombAI : public ScriptedAI { - mob_janalai_firebombAI(Creature* c) : ScriptedAI(c){} + mob_janalai_firebombAI(Creature* creature) : ScriptedAI(creature){} void Reset() {} @@ -484,9 +484,9 @@ class mob_janalai_hatcher : public CreatureScript struct mob_janalai_hatcherAI : public ScriptedAI { - mob_janalai_hatcherAI(Creature* c) : ScriptedAI(c) + mob_janalai_hatcherAI(Creature* creature) : ScriptedAI(creature) { - instance =c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -616,9 +616,9 @@ class mob_janalai_hatchling : public CreatureScript struct mob_janalai_hatchlingAI : public ScriptedAI { - mob_janalai_hatchlingAI(Creature* c) : ScriptedAI(c) + mob_janalai_hatchlingAI(Creature* creature) : ScriptedAI(creature) { - instance =c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp index a6b74ddf06e..2a2fdf1346e 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp @@ -101,11 +101,11 @@ class boss_nalorakk : public CreatureScript struct boss_nalorakkAI : public ScriptedAI { - boss_nalorakkAI(Creature* c) : ScriptedAI(c) + boss_nalorakkAI(Creature* creature) : ScriptedAI(creature) { MoveEvent = true; MovePhase = 0; - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp index b5130630d05..f7d5ae25e7a 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -151,9 +151,9 @@ class boss_zuljin : public CreatureScript struct boss_zuljinAI : public ScriptedAI { - boss_zuljinAI(Creature* c) : ScriptedAI(c), Summons(me) + boss_zuljinAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -604,7 +604,7 @@ class mob_zuljin_vortex : public CreatureScript struct mob_zuljin_vortexAI : public ScriptedAI { - mob_zuljin_vortexAI(Creature* c) : ScriptedAI(c) {} + mob_zuljin_vortexAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index df90f80db4c..a78ec29be99 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -49,9 +49,9 @@ class npc_forest_frog : public CreatureScript struct npc_forest_frogAI : public ScriptedAI { - npc_forest_frogAI(Creature* c) : ScriptedAI(c) + npc_forest_frogAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -128,7 +128,7 @@ class npc_zulaman_hostage : public CreatureScript struct npc_zulaman_hostageAI : public ScriptedAI { - npc_zulaman_hostageAI(Creature* c) : ScriptedAI(c) {IsLoot = false;} + npc_zulaman_hostageAI(Creature* creature) : ScriptedAI(creature) {IsLoot = false;} bool IsLoot; uint64 PlayerGUID; void Reset() {} diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp index a944a857f74..84e3de71b1d 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp @@ -40,7 +40,7 @@ class boss_gahzranka : public CreatureScript struct boss_gahzrankaAI : public ScriptedAI { - boss_gahzrankaAI(Creature* c) : ScriptedAI(c) {} + boss_gahzrankaAI(Creature* creature) : ScriptedAI(creature) {} uint32 Frostbreath_Timer; uint32 MassiveGeyser_Timer; uint32 Slam_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp index 68ae6dbbf0c..19d0a04b9a6 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp @@ -40,7 +40,7 @@ class boss_grilek : public CreatureScript struct boss_grilekAI : public ScriptedAI { - boss_grilekAI(Creature* c) : ScriptedAI(c) {} + boss_grilekAI(Creature* creature) : ScriptedAI(creature) {} uint32 Avartar_Timer; uint32 GroundTremor_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp index 6a1309983c3..b3dcfb5112b 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp @@ -55,9 +55,9 @@ class boss_hakkar : public CreatureScript struct boss_hakkarAI : public ScriptedAI { - boss_hakkarAI(Creature* c) : ScriptedAI(c) + boss_hakkarAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + m_instance = creature->GetInstanceScript(); } InstanceScript* m_instance; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp index 69a4f5dbab5..27c46b8e0f2 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp @@ -40,7 +40,7 @@ class boss_hazzarah : public CreatureScript struct boss_hazzarahAI : public ScriptedAI { - boss_hazzarahAI(Creature* c) : ScriptedAI(c) {} + boss_hazzarahAI(Creature* creature) : ScriptedAI(creature) {} uint32 ManaBurn_Timer; uint32 Sleep_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp index d2ac4f3bceb..15933e3ed4d 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp @@ -54,9 +54,9 @@ class boss_jeklik : public CreatureScript struct boss_jeklikAI : public ScriptedAI { - boss_jeklikAI(Creature* c) : ScriptedAI(c) + boss_jeklikAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + m_instance = creature->GetInstanceScript(); } InstanceScript* m_instance; @@ -236,9 +236,9 @@ class mob_batrider : public CreatureScript struct mob_batriderAI : public ScriptedAI { - mob_batriderAI(Creature* c) : ScriptedAI(c) + mob_batriderAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + m_instance = creature->GetInstanceScript(); } InstanceScript* m_instance; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp index 132812c932a..d7901d663f3 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp @@ -52,7 +52,7 @@ class boss_jindo : public CreatureScript struct boss_jindoAI : public ScriptedAI { - boss_jindoAI(Creature* c) : ScriptedAI(c) {} + boss_jindoAI(Creature* creature) : ScriptedAI(creature) {} uint32 BrainWashTotem_Timer; uint32 HealingWard_Timer; @@ -187,9 +187,9 @@ class mob_healing_ward : public CreatureScript struct mob_healing_wardAI : public ScriptedAI { - mob_healing_wardAI(Creature* c) : ScriptedAI(c) + mob_healing_wardAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 Heal_Timer; @@ -241,7 +241,7 @@ class mob_shade_of_jindo : public CreatureScript struct mob_shade_of_jindoAI : public ScriptedAI { - mob_shade_of_jindoAI(Creature* c) : ScriptedAI(c) {} + mob_shade_of_jindoAI(Creature* creature) : ScriptedAI(creature) {} uint32 ShadowShock_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 10708cd7f95..6b8d4b11439 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -55,9 +55,9 @@ class boss_mandokir : public CreatureScript struct boss_mandokirAI : public ScriptedAI { - boss_mandokirAI(Creature* c) : ScriptedAI(c) + boss_mandokirAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + m_instance = creature->GetInstanceScript(); } uint32 KillCount; @@ -294,9 +294,9 @@ class mob_ohgan : public CreatureScript struct mob_ohganAI : public ScriptedAI { - mob_ohganAI(Creature* c) : ScriptedAI(c) + mob_ohganAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + m_instance = creature->GetInstanceScript(); } uint32 SunderArmor_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp index d0f1aea21ba..2016fe4cb5d 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp @@ -51,9 +51,9 @@ class boss_marli : public CreatureScript struct boss_marliAI : public ScriptedAI { - boss_marliAI(Creature* c) : ScriptedAI(c) + boss_marliAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + m_instance = creature->GetInstanceScript(); } InstanceScript* m_instance; @@ -230,7 +230,7 @@ class mob_spawn_of_marli : public CreatureScript struct mob_spawn_of_marliAI : public ScriptedAI { - mob_spawn_of_marliAI(Creature* c) : ScriptedAI(c) {} + mob_spawn_of_marliAI(Creature* creature) : ScriptedAI(creature) {} uint32 LevelUp_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp index f988d0df77a..81260c28d73 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp @@ -42,7 +42,7 @@ class boss_renataki : public CreatureScript struct boss_renatakiAI : public ScriptedAI { - boss_renatakiAI(Creature* c) : ScriptedAI(c) {} + boss_renatakiAI(Creature* creature) : ScriptedAI(creature) {} uint32 Invisible_Timer; uint32 Ambush_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index dc9521b028b..a58c66c8584 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -66,9 +66,9 @@ class boss_thekal : public CreatureScript struct boss_thekalAI : public ScriptedAI { - boss_thekalAI(Creature* c) : ScriptedAI(c) + boss_thekalAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + m_instance = creature->GetInstanceScript(); } uint32 MortalCleave_Timer; @@ -277,9 +277,9 @@ class mob_zealot_lorkhan : public CreatureScript struct mob_zealot_lorkhanAI : public ScriptedAI { - mob_zealot_lorkhanAI(Creature* c) : ScriptedAI(c) + mob_zealot_lorkhanAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + m_instance = creature->GetInstanceScript(); } uint32 Shield_Timer; @@ -437,9 +437,9 @@ class mob_zealot_zath : public CreatureScript struct mob_zealot_zathAI : public ScriptedAI { - mob_zealot_zathAI(Creature* c) : ScriptedAI(c) + mob_zealot_zathAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + m_instance = creature->GetInstanceScript(); } uint32 SweepingStrikes_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp index 702a69207ba..b22630f51bb 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp @@ -40,7 +40,7 @@ class boss_wushoolay : public CreatureScript struct boss_wushoolayAI : public ScriptedAI { - boss_wushoolayAI(Creature* c) : ScriptedAI(c) {} + boss_wushoolayAI(Creature* creature) : ScriptedAI(creature) {} uint32 LightningCloud_Timer; uint32 LightningWave_Timer; diff --git a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp index 82b09b9dc18..4e0a942b7e8 100644 --- a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp @@ -62,7 +62,7 @@ class npc_professor_phizzlethorpe : public CreatureScript struct npc_professor_phizzlethorpeAI : public npc_escortAI { - npc_professor_phizzlethorpeAI(Creature* c) : npc_escortAI(c) {} + npc_professor_phizzlethorpeAI(Creature* creature) : npc_escortAI(creature) {} void WaypointReached(uint32 uiPointId) { diff --git a/src/server/scripts/EasternKingdoms/boss_kruul.cpp b/src/server/scripts/EasternKingdoms/boss_kruul.cpp index 810875abf0c..8749c943a6f 100644 --- a/src/server/scripts/EasternKingdoms/boss_kruul.cpp +++ b/src/server/scripts/EasternKingdoms/boss_kruul.cpp @@ -45,7 +45,7 @@ public: struct boss_kruulAI : public ScriptedAI { - boss_kruulAI(Creature* c) : ScriptedAI(c) {} + boss_kruulAI(Creature* creature) : ScriptedAI(creature) {} uint32 ShadowVolley_Timer; uint32 Cleave_Timer; diff --git a/src/server/scripts/EasternKingdoms/burning_steppes.cpp b/src/server/scripts/EasternKingdoms/burning_steppes.cpp index fb6024f1cb5..b526246f670 100644 --- a/src/server/scripts/EasternKingdoms/burning_steppes.cpp +++ b/src/server/scripts/EasternKingdoms/burning_steppes.cpp @@ -127,7 +127,7 @@ public: struct npc_ragged_johnAI : public ScriptedAI { - npc_ragged_johnAI(Creature* c) : ScriptedAI(c) {} + npc_ragged_johnAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} diff --git a/src/server/scripts/EasternKingdoms/duskwood.cpp b/src/server/scripts/EasternKingdoms/duskwood.cpp index a9f413268c2..10cb5987ce5 100644 --- a/src/server/scripts/EasternKingdoms/duskwood.cpp +++ b/src/server/scripts/EasternKingdoms/duskwood.cpp @@ -82,7 +82,7 @@ public: struct boss_twilight_corrupterAI : public ScriptedAI { - boss_twilight_corrupterAI(Creature* c) : ScriptedAI(c) {} + boss_twilight_corrupterAI(Creature* creature) : ScriptedAI(creature) {} uint32 SoulCorruption_Timer; uint32 CreatureOfNightmare_Timer; diff --git a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp index 451648a0da9..9fa8dad116e 100644 --- a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp @@ -48,7 +48,7 @@ public: struct mobs_ghoul_flayerAI : public ScriptedAI { - mobs_ghoul_flayerAI(Creature* c) : ScriptedAI(c) {} + mobs_ghoul_flayerAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} @@ -118,7 +118,7 @@ public: struct npc_darrowshire_spiritAI : public ScriptedAI { - npc_darrowshire_spiritAI(Creature* c) : ScriptedAI(c) {} + npc_darrowshire_spiritAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { diff --git a/src/server/scripts/EasternKingdoms/eversong_woods.cpp b/src/server/scripts/EasternKingdoms/eversong_woods.cpp index b0ced22bd8b..49fd582a662 100644 --- a/src/server/scripts/EasternKingdoms/eversong_woods.cpp +++ b/src/server/scripts/EasternKingdoms/eversong_woods.cpp @@ -293,7 +293,7 @@ public: struct master_kelerun_bloodmournAI : public ScriptedAI { - master_kelerun_bloodmournAI(Creature* c) : ScriptedAI(c) {} + master_kelerun_bloodmournAI(Creature* creature) : ScriptedAI(creature) {} uint8 questPhase; uint8 paladinPhase; @@ -457,7 +457,7 @@ public: struct npc_apprentice_mirvedaAI : public ScriptedAI { - npc_apprentice_mirvedaAI(Creature* c) : ScriptedAI(c), Summons(me) {} + npc_apprentice_mirvedaAI(Creature* creature) : ScriptedAI(creature), Summons(me) {} uint32 KillCount; uint64 PlayerGUID; @@ -547,7 +547,7 @@ public: struct npc_infused_crystalAI : public Scripted_NoMovementAI { - npc_infused_crystalAI(Creature* c) : Scripted_NoMovementAI(c) {} + npc_infused_crystalAI(Creature* creature) : Scripted_NoMovementAI(creature) {} uint32 EndTimer; uint32 WaveTimer; diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/ghostlands.cpp index 3bd781ce6f9..02bfcef45a3 100644 --- a/src/server/scripts/EasternKingdoms/ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/ghostlands.cpp @@ -128,7 +128,7 @@ public: struct npc_ranger_lilathaAI : public npc_escortAI { - npc_ranger_lilathaAI(Creature* c) : npc_escortAI(c) {} + npc_ranger_lilathaAI(Creature* creature) : npc_escortAI(creature) {} void WaypointReached(uint32 i) { diff --git a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp index 109f4ba1729..98ac2ff4cc1 100644 --- a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp +++ b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp @@ -51,7 +51,7 @@ public: struct npc_converted_sentryAI : public ScriptedAI { - npc_converted_sentryAI(Creature* c) : ScriptedAI(c) {} + npc_converted_sentryAI(Creature* creature) : ScriptedAI(creature) {} bool Credit; uint32 Timer; @@ -108,7 +108,7 @@ public: struct npc_greengill_slaveAI : public ScriptedAI { - npc_greengill_slaveAI(Creature* c) : ScriptedAI(c) {} + npc_greengill_slaveAI(Creature* creature) : ScriptedAI(creature) {} uint64 PlayerGUID; diff --git a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp b/src/server/scripts/EasternKingdoms/silvermoon_city.cpp index de14416483c..e6595a83b66 100644 --- a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp +++ b/src/server/scripts/EasternKingdoms/silvermoon_city.cpp @@ -53,7 +53,7 @@ public: struct npc_blood_knight_stillbladeAI : public ScriptedAI { - npc_blood_knight_stillbladeAI(Creature* c) : ScriptedAI(c) {} + npc_blood_knight_stillbladeAI(Creature* creature) : ScriptedAI(creature) {} uint32 lifeTimer; bool spellHit; diff --git a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp index 558b02fc675..ad76f29a634 100644 --- a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp @@ -64,7 +64,7 @@ public: struct npc_deathstalker_erlandAI : public npc_escortAI { - npc_deathstalker_erlandAI(Creature* c) : npc_escortAI(c) {} + npc_deathstalker_erlandAI(Creature* creature) : npc_escortAI(creature) {} void WaypointReached(uint32 i) { @@ -175,7 +175,7 @@ public: struct pyrewood_ambushAI : public ScriptedAI { - pyrewood_ambushAI(Creature* c) : ScriptedAI(c), Summons(me) + pyrewood_ambushAI(Creature* creature) : ScriptedAI(creature), Summons(me) { QuestInProgress = false; } diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/stormwind_city.cpp index ea62014f8a8..3852a1de3b0 100644 --- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/stormwind_city.cpp @@ -105,9 +105,9 @@ public: struct npc_bartlebyAI : public ScriptedAI { - npc_bartlebyAI(Creature* c) : ScriptedAI(c) + npc_bartlebyAI(Creature* creature) : ScriptedAI(creature) { - m_uiNormalFaction = c->getFaction(); + m_uiNormalFaction = creature->getFaction(); } uint32 m_uiNormalFaction; diff --git a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp index 2862ba18bca..03f92ce6d61 100644 --- a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp +++ b/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp @@ -45,7 +45,7 @@ public: struct mob_yennikuAI : public ScriptedAI { - mob_yennikuAI(Creature* c) : ScriptedAI(c) + mob_yennikuAI(Creature* creature) : ScriptedAI(creature) { bReset = false; } diff --git a/src/server/scripts/EasternKingdoms/undercity.cpp b/src/server/scripts/EasternKingdoms/undercity.cpp index 3f088bf00b9..0522e214012 100644 --- a/src/server/scripts/EasternKingdoms/undercity.cpp +++ b/src/server/scripts/EasternKingdoms/undercity.cpp @@ -88,7 +88,7 @@ public: struct npc_lady_sylvanas_windrunnerAI : public ScriptedAI { - npc_lady_sylvanas_windrunnerAI(Creature* c) : ScriptedAI(c) {} + npc_lady_sylvanas_windrunnerAI(Creature* creature) : ScriptedAI(creature) {} uint32 LamentEvent_Timer; bool LamentEvent; @@ -161,7 +161,7 @@ public: struct npc_highborne_lamenterAI : public ScriptedAI { - npc_highborne_lamenterAI(Creature* c) : ScriptedAI(c) {} + npc_highborne_lamenterAI(Creature* creature) : ScriptedAI(creature) {} uint32 EventMove_Timer; uint32 EventCast_Timer; diff --git a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp index 1a31c29f5bb..f36f5b5950e 100644 --- a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp @@ -166,7 +166,7 @@ public: struct npc_the_scourge_cauldronAI : public ScriptedAI { - npc_the_scourge_cauldronAI(Creature* c) : ScriptedAI(c) {} + npc_the_scourge_cauldronAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} @@ -250,7 +250,7 @@ public: struct npc_andorhal_towerAI : public Scripted_NoMovementAI { - npc_andorhal_towerAI(Creature* c) : Scripted_NoMovementAI(c) {} + npc_andorhal_towerAI(Creature* creature) : Scripted_NoMovementAI(creature) {} void MoveInLineOfSight(Unit* who) { diff --git a/src/server/scripts/EasternKingdoms/westfall.cpp b/src/server/scripts/EasternKingdoms/westfall.cpp index f5a0f0e85c4..2285d3877e4 100644 --- a/src/server/scripts/EasternKingdoms/westfall.cpp +++ b/src/server/scripts/EasternKingdoms/westfall.cpp @@ -224,7 +224,7 @@ public: struct npc_defias_traitorAI : public npc_escortAI { - npc_defias_traitorAI(Creature* c) : npc_escortAI(c) { Reset(); } + npc_defias_traitorAI(Creature* creature) : npc_escortAI(creature) { Reset(); } void WaypointReached(uint32 i) { diff --git a/src/server/scripts/Examples/example_creature.cpp b/src/server/scripts/Examples/example_creature.cpp index 412211bd280..7f75a0fb481 100644 --- a/src/server/scripts/Examples/example_creature.cpp +++ b/src/server/scripts/Examples/example_creature.cpp @@ -90,7 +90,7 @@ class example_creature : public CreatureScript { // *** HANDLED FUNCTION *** //This is the constructor, called only once when the Creature is first created - example_creatureAI(Creature* c) : ScriptedAI(c) {} + example_creatureAI(Creature* creature) : ScriptedAI(creature) {} // *** CUSTOM VARIABLES **** //These variables are for use only by this individual script. diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index 6bc179bba40..e4fa3804b9b 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -64,9 +64,9 @@ public: struct boss_anetheronAI : public hyjal_trashAI { - boss_anetheronAI(Creature* c) : hyjal_trashAI(c) + boss_anetheronAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; pos = 0; } @@ -248,9 +248,9 @@ public: struct mob_towering_infernalAI : public ScriptedAI { - mob_towering_infernalAI(Creature* c) : ScriptedAI(c) + mob_towering_infernalAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); if (instance) AnetheronGUID = instance->GetData64(DATA_ANETHERON); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index a5239e5a649..8419ce50fc7 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -86,9 +86,9 @@ public: struct mob_ancient_wispAI : public ScriptedAI { - mob_ancient_wispAI(Creature* c) : ScriptedAI(c) + mob_ancient_wispAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); ArchimondeGUID = 0; } @@ -142,7 +142,7 @@ public: struct mob_doomfireAI : public ScriptedAI { - mob_doomfireAI(Creature* c) : ScriptedAI(c) {} + mob_doomfireAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { } @@ -167,7 +167,7 @@ public: struct mob_doomfire_targettingAI : public ScriptedAI { - mob_doomfire_targettingAI(Creature* c) : ScriptedAI(c) {} + mob_doomfire_targettingAI(Creature* creature) : ScriptedAI(creature) {} uint64 TargetGUID; uint32 ChangeTargetTimer; @@ -233,9 +233,9 @@ public: struct boss_archimondeAI : public hyjal_trashAI { - boss_archimondeAI(Creature* c) : hyjal_trashAI(c) + boss_archimondeAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index 2885276f2b6..96a9d3b8bb6 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -55,9 +55,9 @@ public: struct boss_azgalorAI : public hyjal_trashAI { - boss_azgalorAI(Creature* c) : hyjal_trashAI(c) + boss_azgalorAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; pos = 0; } @@ -215,9 +215,9 @@ public: struct mob_lesser_doomguardAI : public hyjal_trashAI { - mob_lesser_doomguardAI(Creature* c) : hyjal_trashAI(c) + mob_lesser_doomguardAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); if (instance) AzgalorGUID = instance->GetData64(DATA_AZGALOR); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index 7d1b292fd12..fa475da24a1 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -52,9 +52,9 @@ public: struct boss_kazrogalAI : public hyjal_trashAI { - boss_kazrogalAI(Creature* c) : hyjal_trashAI(c) + boss_kazrogalAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; pos = 0; } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp index 3f39b61192a..f6578c5bf6e 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp @@ -58,9 +58,9 @@ public: struct boss_rage_winterchillAI : public hyjal_trashAI { - boss_rage_winterchillAI(Creature* c) : hyjal_trashAI(c) + boss_rage_winterchillAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; pos = 0; } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index 8a0ea30ca6a..0bcf33229f1 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -310,9 +310,9 @@ float HordeFirePos[65][8]=//spawn points for the fire visuals (GO) in the horde {5545.43f, -2647.82f, 1483.05f, 5.38848f, 0, 0, 0.432578f, -0.901596f} }; -hyjalAI::hyjalAI(Creature* c) : npc_escortAI(c), Summons(me) +hyjalAI::hyjalAI(Creature* creature) : npc_escortAI(creature), Summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); VeinsSpawned[0] = false; VeinsSpawned[1] = false; for (uint8 i=0; i<14; ++i) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h index d91c2ead123..6abd5dd7e03 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h @@ -171,7 +171,7 @@ const Yells ThrallQuotes[]= struct hyjalAI : public npc_escortAI { - hyjalAI(Creature* c); + hyjalAI(Creature* creature); void Reset(); // Generically used to reset our variables. Do *not* call in EnterEvadeMode as this may make problems if the raid is still in combat diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index e1d7d97e0b8..496e720fb31 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -155,9 +155,9 @@ float HordeOverrunWP[21][3]=//waypoints in the horde base used in the end in the {5429.91f, -2718.44f, 1493.42f}//20 end 2 }; -hyjal_trashAI::hyjal_trashAI(Creature* c) : npc_escortAI(c) +hyjal_trashAI::hyjal_trashAI(Creature* creature) : npc_escortAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); IsEvent = false; Delay = 0; LastOverronPos = 0; @@ -395,9 +395,9 @@ public: struct mob_giant_infernalAI : public hyjal_trashAI { - mob_giant_infernalAI(Creature* c) : hyjal_trashAI(c) + mob_giant_infernalAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); meteor = false;//call once! CanMove = false; Delay = rand()%30000; @@ -539,9 +539,9 @@ public: struct mob_abominationAI : public hyjal_trashAI { - mob_abominationAI(Creature* c) : hyjal_trashAI(c) + mob_abominationAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; pos = 0; Reset(); @@ -640,9 +640,9 @@ public: struct mob_ghoulAI : public hyjal_trashAI { - mob_ghoulAI(Creature* c) : hyjal_trashAI(c) + mob_ghoulAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; pos = 0; Reset(); @@ -749,9 +749,9 @@ public: struct mob_necromancerAI : public hyjal_trashAI { - mob_necromancerAI(Creature* c) : hyjal_trashAI(c), summons(me) + mob_necromancerAI(Creature* creature) : hyjal_trashAI(creature), summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; pos = 0; Reset(); @@ -870,9 +870,9 @@ public: struct mob_bansheeAI : public hyjal_trashAI { - mob_bansheeAI(Creature* c) : hyjal_trashAI(c) + mob_bansheeAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; pos = 0; Reset(); @@ -975,9 +975,9 @@ public: struct mob_crypt_fiendAI : public hyjal_trashAI { - mob_crypt_fiendAI(Creature* c) : hyjal_trashAI(c) + mob_crypt_fiendAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; pos = 0; Reset(); @@ -1067,9 +1067,9 @@ public: struct mob_fel_stalkerAI : public hyjal_trashAI { - mob_fel_stalkerAI(Creature* c) : hyjal_trashAI(c) + mob_fel_stalkerAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; pos = 0; Reset(); @@ -1159,9 +1159,9 @@ public: struct mob_frost_wyrmAI : public hyjal_trashAI { - mob_frost_wyrmAI(Creature* c) : hyjal_trashAI(c) + mob_frost_wyrmAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; pos = 0; Reset(); @@ -1276,9 +1276,9 @@ public: struct mob_gargoyleAI : public hyjal_trashAI { - mob_gargoyleAI(Creature* c) : hyjal_trashAI(c) + mob_gargoyleAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; pos = 0; DummyTarget[0] = 0;DummyTarget[1] = 0;DummyTarget[2] = 0; @@ -1416,7 +1416,7 @@ public: struct alliance_riflemanAI : public Scripted_NoMovementAI { - alliance_riflemanAI(Creature* c) : Scripted_NoMovementAI(c) + alliance_riflemanAI(Creature* creature) : Scripted_NoMovementAI(creature) { Reset(); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h index 047c0dc308e..cb994167641 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h @@ -25,7 +25,7 @@ struct hyjal_trashAI : public npc_escortAI { - hyjal_trashAI(Creature* c); + hyjal_trashAI(Creature* creature); void UpdateAI(const uint32 diff); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp index 35c1848456b..b2853f25a33 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp @@ -60,9 +60,9 @@ public: struct boss_epochAI : public ScriptedAI { - boss_epochAI(Creature* c) : ScriptedAI(c) + boss_epochAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint8 uiStep; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp index 7947c9be48d..ccf60f9bd0b 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp @@ -43,9 +43,9 @@ public: struct boss_infinite_corruptorAI : public ScriptedAI { - boss_infinite_corruptorAI(Creature* c) : ScriptedAI(c) + boss_infinite_corruptorAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp index b61838a253a..a038a06f815 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp @@ -77,9 +77,9 @@ public: struct boss_mal_ganisAI : public ScriptedAI { - boss_mal_ganisAI(Creature* c) : ScriptedAI(c) + boss_mal_ganisAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiCarrionSwarmTimer; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp index c36b98ed510..d5dd597960f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp @@ -57,9 +57,9 @@ public: struct boss_meathookAI : public ScriptedAI { - boss_meathookAI(Creature* c) : ScriptedAI(c) + boss_meathookAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); if (instance) DoScriptText(SAY_SPAWN, me); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp index 7a5e0d06158..7828d172e1e 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp @@ -66,9 +66,9 @@ public: struct boss_salrammAI : public ScriptedAI { - boss_salrammAI(Creature* c) : ScriptedAI(c) + boss_salrammAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); if (instance) DoScriptText(SAY_SPAWN, me); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp index b895b56379c..5d1c65c63ea 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp @@ -55,9 +55,9 @@ public: struct boss_aeonusAI : public ScriptedAI { - boss_aeonusAI(Creature* c) : ScriptedAI(c) + boss_aeonusAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp index 99e43495c96..caf2a225e79 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp @@ -55,9 +55,9 @@ public: struct boss_chrono_lord_dejaAI : public ScriptedAI { - boss_chrono_lord_dejaAI(Creature* c) : ScriptedAI(c) + boss_chrono_lord_dejaAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp index 9b272491717..93fb6153b76 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp @@ -54,9 +54,9 @@ public: struct boss_temporusAI : public ScriptedAI { - boss_temporusAI(Creature* c) : ScriptedAI(c) + boss_temporusAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp index 63035ef2699..7625d22119f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp @@ -68,9 +68,9 @@ public: struct npc_medivh_bmAI : public ScriptedAI { - npc_medivh_bmAI(Creature* c) : ScriptedAI(c) + npc_medivh_bmAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -261,9 +261,9 @@ public: struct npc_time_riftAI : public ScriptedAI { - npc_time_riftAI(Creature* c) : ScriptedAI(c) + npc_time_riftAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp index 89877f2cc7b..ab03d8895f8 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp @@ -52,9 +52,9 @@ public: struct boss_captain_skarlocAI : public ScriptedAI { - boss_captain_skarlocAI(Creature* c) : ScriptedAI(c) + boss_captain_skarlocAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp index 8307eb44013..cd49a2470e3 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp @@ -54,9 +54,9 @@ public: struct boss_epoch_hunterAI : public ScriptedAI { - boss_epoch_hunterAI(Creature* c) : ScriptedAI(c) + boss_epoch_hunterAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp index 1f0ba93645f..b18cee43664 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp @@ -111,7 +111,7 @@ public: struct boss_lieutenant_drakeAI : public ScriptedAI { - boss_lieutenant_drakeAI(Creature* c) : ScriptedAI(c) {} + boss_lieutenant_drakeAI(Creature* creature) : ScriptedAI(creature) {} bool CanPatrol; uint32 wpId; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp index 71945f649cb..195e402e7a0 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp @@ -282,9 +282,9 @@ public: struct npc_thrall_old_hillsbradAI : public npc_escortAI { - npc_thrall_old_hillsbradAI(Creature* c) : npc_escortAI(c) + npc_thrall_old_hillsbradAI(Creature* creature) : npc_escortAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); HadMount = false; me->setActive(true); } @@ -624,9 +624,9 @@ public: struct npc_tarethaAI : public npc_escortAI { - npc_tarethaAI(Creature* c) : npc_escortAI(c) + npc_tarethaAI(Creature* creature) : npc_escortAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp index d0da864809c..bda5267713d 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp @@ -48,7 +48,7 @@ public: struct boss_amnennar_the_coldbringerAI : public ScriptedAI { - boss_amnennar_the_coldbringerAI(Creature* c) : ScriptedAI(c) {} + boss_amnennar_the_coldbringerAI(Creature* creature) : ScriptedAI(creature) {} uint32 AmnenarsWrath_Timer; uint32 FrostBolt_Timer; diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp index 1bc0a3b7a19..747a2f2880f 100644 --- a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp +++ b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp @@ -70,7 +70,7 @@ public: struct npc_willixAI : public npc_escortAI { - npc_willixAI(Creature* c) : npc_escortAI(c) {} + npc_willixAI(Creature* creature) : npc_escortAI(creature) {} void WaypointReached(uint32 i) { diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp index eaeec50ef7b..41e0e0f2a06 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp @@ -49,9 +49,9 @@ public: struct boss_kriAI : public ScriptedAI { - boss_kriAI(Creature* c) : ScriptedAI(c) + boss_kriAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -146,9 +146,9 @@ public: struct boss_vemAI : public ScriptedAI { - boss_vemAI(Creature* c) : ScriptedAI(c) + boss_vemAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -239,9 +239,9 @@ public: struct boss_yaujAI : public ScriptedAI { - boss_yaujAI(Creature* c) : ScriptedAI(c) + boss_yaujAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index a6409ca056f..4935fb6b906 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -176,9 +176,9 @@ public: struct eye_of_cthunAI : public Scripted_NoMovementAI { - eye_of_cthunAI(Creature* c) : Scripted_NoMovementAI(c) + eye_of_cthunAI(Creature* creature) : Scripted_NoMovementAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); if (!instance) sLog->outError("TSCR: No Instance eye_of_cthunAI"); } @@ -480,11 +480,11 @@ public: struct cthunAI : public Scripted_NoMovementAI { - cthunAI(Creature* c) : Scripted_NoMovementAI(c) + cthunAI(Creature* creature) : Scripted_NoMovementAI(creature) { SetCombatMovement(false); - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); if (!instance) sLog->outError("TSCR: No Instance eye_of_cthunAI"); } @@ -935,7 +935,7 @@ public: struct eye_tentacleAI : public Scripted_NoMovementAI { - eye_tentacleAI(Creature* c) : Scripted_NoMovementAI(c) + eye_tentacleAI(Creature* creature) : Scripted_NoMovementAI(creature) { if (Creature* pPortal = me->SummonCreature(MOB_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) { @@ -1008,7 +1008,7 @@ public: struct claw_tentacleAI : public Scripted_NoMovementAI { - claw_tentacleAI(Creature* c) : Scripted_NoMovementAI(c) + claw_tentacleAI(Creature* creature) : Scripted_NoMovementAI(creature) { SetCombatMovement(false); @@ -1118,7 +1118,7 @@ public: struct giant_claw_tentacleAI : public Scripted_NoMovementAI { - giant_claw_tentacleAI(Creature* c) : Scripted_NoMovementAI(c) + giant_claw_tentacleAI(Creature* creature) : Scripted_NoMovementAI(creature) { SetCombatMovement(false); @@ -1237,7 +1237,7 @@ public: struct giant_eye_tentacleAI : public Scripted_NoMovementAI { - giant_eye_tentacleAI(Creature* c) : Scripted_NoMovementAI(c) + giant_eye_tentacleAI(Creature* creature) : Scripted_NoMovementAI(creature) { SetCombatMovement(false); @@ -1301,7 +1301,7 @@ public: struct flesh_tentacleAI : public Scripted_NoMovementAI { - flesh_tentacleAI(Creature* c) : Scripted_NoMovementAI(c) + flesh_tentacleAI(Creature* creature) : Scripted_NoMovementAI(creature) { SetCombatMovement(false); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp index 9ccff0bff48..613bc91182b 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp @@ -49,7 +49,7 @@ public: struct boss_fankrissAI : public ScriptedAI { - boss_fankrissAI(Creature* c) : ScriptedAI(c) {} + boss_fankrissAI(Creature* creature) : ScriptedAI(creature) {} uint32 MortalWound_Timer; uint32 SpawnHatchlings_Timer; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp index c0ccd55f219..53fac3ee3ec 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp @@ -47,7 +47,7 @@ public: struct boss_huhuranAI : public ScriptedAI { - boss_huhuranAI(Creature* c) : ScriptedAI(c) {} + boss_huhuranAI(Creature* creature) : ScriptedAI(creature) {} uint32 Frenzy_Timer; uint32 Wyvern_Timer; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp index b0e5112aa6b..81205780e7d 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp @@ -45,7 +45,7 @@ public: struct boss_ouroAI : public ScriptedAI { - boss_ouroAI(Creature* c) : ScriptedAI(c) {} + boss_ouroAI(Creature* creature) : ScriptedAI(creature) {} uint32 Sweep_Timer; uint32 SandBlast_Timer; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp index 4d5aff16770..0d934305ba7 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp @@ -49,7 +49,7 @@ public: struct boss_sarturaAI : public ScriptedAI { - boss_sarturaAI(Creature* c) : ScriptedAI(c) {} + boss_sarturaAI(Creature* creature) : ScriptedAI(creature) {} uint32 WhirlWind_Timer; uint32 WhirlWindRandom_Timer; @@ -192,7 +192,7 @@ public: struct mob_sartura_royal_guardAI : public ScriptedAI { - mob_sartura_royal_guardAI(Creature* c) : ScriptedAI(c) {} + mob_sartura_royal_guardAI(Creature* creature) : ScriptedAI(creature) {} uint32 WhirlWind_Timer; uint32 WhirlWindRandom_Timer; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp index 7f3c19ac69c..3f91ba62f0c 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp @@ -63,7 +63,7 @@ public: struct boss_skeramAI : public ScriptedAI { - boss_skeramAI(Creature* c) : ScriptedAI(c) + boss_skeramAI(Creature* creature) : ScriptedAI(creature) { IsImage = false; } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index b03d2dc3a4a..6578680fd8b 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -61,9 +61,9 @@ EndScriptData */ struct boss_twinemperorsAI : public ScriptedAI { - boss_twinemperorsAI(Creature* c): ScriptedAI(c) + boss_twinemperorsAI(Creature* creature): ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp index 45e9797328e..558b634b8de 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp @@ -86,7 +86,7 @@ public: } } - aqsentinelAI(Creature* c) : ScriptedAI(c) + aqsentinelAI(Creature* creature) : ScriptedAI(creature) { ClearBuddyList(); abselected = 0; // just initialization of variable diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp index 23e64d756f5..cabddc3b6d9 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp +++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp @@ -136,9 +136,9 @@ public: struct npc_disciple_of_naralexAI : public npc_escortAI { - npc_disciple_of_naralexAI(Creature* c) : npc_escortAI(c) + npc_disciple_of_naralexAI(Creature* creature) : npc_escortAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); eventTimer = 0; currentEvent = 0; eventProgress = 0; diff --git a/src/server/scripts/Kalimdor/ashenvale.cpp b/src/server/scripts/Kalimdor/ashenvale.cpp index 5d26653a1a8..9d0423181de 100644 --- a/src/server/scripts/Kalimdor/ashenvale.cpp +++ b/src/server/scripts/Kalimdor/ashenvale.cpp @@ -185,7 +185,7 @@ class npc_ruul_snowhoof : public CreatureScript struct npc_ruul_snowhoofAI : public npc_escortAI { - npc_ruul_snowhoofAI(Creature* c) : npc_escortAI(c) {} + npc_ruul_snowhoofAI(Creature* creature) : npc_escortAI(creature) {} void WaypointReached(uint32 i) { diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp index 802867f4171..2b74420ff3a 100644 --- a/src/server/scripts/Kalimdor/azshara.cpp +++ b/src/server/scripts/Kalimdor/azshara.cpp @@ -50,7 +50,7 @@ public: struct mobs_spitelashesAI : public ScriptedAI { - mobs_spitelashesAI(Creature* c) : ScriptedAI(c) {} + mobs_spitelashesAI(Creature* creature) : ScriptedAI(creature) {} uint32 morphtimer; bool spellhit; @@ -296,7 +296,7 @@ public: struct mob_rizzle_sprysprocketAI : public ScriptedAI { - mob_rizzle_sprysprocketAI(Creature* c) : ScriptedAI(c) {} + mob_rizzle_sprysprocketAI(Creature* creature) : ScriptedAI(creature) {} uint32 spellEscape_Timer; uint32 Teleport_Timer; @@ -470,7 +470,7 @@ public: struct mob_depth_chargeAI : public ScriptedAI { - mob_depth_chargeAI(Creature* c) : ScriptedAI(c) {} + mob_depth_chargeAI(Creature* creature) : ScriptedAI(creature) {} bool we_must_die; uint32 must_die_timer; diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp index 6f17ab16d15..6c322a1dee1 100644 --- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/azuremyst_isle.cpp @@ -69,7 +69,7 @@ public: struct npc_draenei_survivorAI : public ScriptedAI { - npc_draenei_survivorAI(Creature* c) : ScriptedAI(c) {} + npc_draenei_survivorAI(Creature* creature) : ScriptedAI(creature) {} uint64 pCaster; @@ -223,12 +223,12 @@ public: struct npc_engineer_spark_overgrindAI : public ScriptedAI { - npc_engineer_spark_overgrindAI(Creature* c) : ScriptedAI(c) + npc_engineer_spark_overgrindAI(Creature* creature) : ScriptedAI(creature) { - NormFaction = c->getFaction(); - NpcFlags = c->GetUInt32Value(UNIT_NPC_FLAGS); + NormFaction = creature->getFaction(); + NpcFlags = creature->GetUInt32Value(UNIT_NPC_FLAGS); - if (c->GetAreaId() == AREA_COVE || c->GetAreaId() == AREA_ISLE) + if (creature->GetAreaId() == AREA_COVE || creature->GetAreaId() == AREA_ISLE) IsTreeEvent = true; } @@ -301,7 +301,7 @@ public: struct npc_injured_draeneiAI : public ScriptedAI { - npc_injured_draeneiAI(Creature* c) : ScriptedAI(c) {} + npc_injured_draeneiAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { @@ -367,7 +367,7 @@ public: struct npc_magwinAI : public npc_escortAI { - npc_magwinAI(Creature* c) : npc_escortAI(c) {} + npc_magwinAI(Creature* creature) : npc_escortAI(creature) {} void WaypointReached(uint32 i) { @@ -443,7 +443,7 @@ public: struct npc_geezleAI : public ScriptedAI { - npc_geezleAI(Creature* c) : ScriptedAI(c) {} + npc_geezleAI(Creature* creature) : ScriptedAI(creature) {} uint64 SparkGUID; @@ -613,7 +613,7 @@ public: struct npc_death_ravagerAI : public ScriptedAI { - npc_death_ravagerAI(Creature* c) : ScriptedAI(c){} + npc_death_ravagerAI(Creature* creature) : ScriptedAI(creature){} uint32 RendTimer; uint32 EnragingBiteTimer; diff --git a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp index 10555d252a6..f60777c431d 100644 --- a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp +++ b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp @@ -49,7 +49,7 @@ public: struct mob_webbed_creatureAI : public ScriptedAI { - mob_webbed_creatureAI(Creature* c) : ScriptedAI(c) {} + mob_webbed_creatureAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { diff --git a/src/server/scripts/Kalimdor/boss_azuregos.cpp b/src/server/scripts/Kalimdor/boss_azuregos.cpp index 4c415014eef..37d3753377b 100644 --- a/src/server/scripts/Kalimdor/boss_azuregos.cpp +++ b/src/server/scripts/Kalimdor/boss_azuregos.cpp @@ -47,7 +47,7 @@ public: struct boss_azuregosAI : public ScriptedAI { - boss_azuregosAI(Creature* c) : ScriptedAI(c) {} + boss_azuregosAI(Creature* creature) : ScriptedAI(creature) {} uint32 MarkOfFrost_Timer; uint32 ManaStorm_Timer; diff --git a/src/server/scripts/Kalimdor/durotar.cpp b/src/server/scripts/Kalimdor/durotar.cpp index ea3a093990e..710f1e55871 100644 --- a/src/server/scripts/Kalimdor/durotar.cpp +++ b/src/server/scripts/Kalimdor/durotar.cpp @@ -48,7 +48,7 @@ public: struct npc_lazy_peonAI : public ScriptedAI { - npc_lazy_peonAI(Creature* c) : ScriptedAI(c) {} + npc_lazy_peonAI(Creature* creature) : ScriptedAI(creature) {} uint64 uiPlayerGUID; diff --git a/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/moonglade.cpp index 833224b0e98..6e5ead0a870 100644 --- a/src/server/scripts/Kalimdor/moonglade.cpp +++ b/src/server/scripts/Kalimdor/moonglade.cpp @@ -296,7 +296,7 @@ public: struct npc_clintar_spiritAI : public npc_escortAI { public: - npc_clintar_spiritAI(Creature* c) : npc_escortAI(c) {} + npc_clintar_spiritAI(Creature* creature) : npc_escortAI(creature) {} uint32 Step; uint32 CurrWP; diff --git a/src/server/scripts/Kalimdor/mulgore.cpp b/src/server/scripts/Kalimdor/mulgore.cpp index 19be3ce21cc..bd4cf55b7b2 100644 --- a/src/server/scripts/Kalimdor/mulgore.cpp +++ b/src/server/scripts/Kalimdor/mulgore.cpp @@ -96,7 +96,7 @@ public: struct npc_kyle_frenziedAI : public ScriptedAI { - npc_kyle_frenziedAI(Creature* c) : ScriptedAI(c) {} + npc_kyle_frenziedAI(Creature* creature) : ScriptedAI(creature) {} bool bEvent; bool m_bIsMovingToLunch; @@ -269,7 +269,7 @@ public: struct npc_plains_visionAI : public ScriptedAI { - npc_plains_visionAI(Creature* c) : ScriptedAI(c) {} + npc_plains_visionAI(Creature* creature) : ScriptedAI(creature) {} bool newWaypoint; uint8 WayPointId; diff --git a/src/server/scripts/Kalimdor/orgrimmar.cpp b/src/server/scripts/Kalimdor/orgrimmar.cpp index 63916968ca2..2ff2d28768a 100644 --- a/src/server/scripts/Kalimdor/orgrimmar.cpp +++ b/src/server/scripts/Kalimdor/orgrimmar.cpp @@ -61,7 +61,7 @@ public: struct npc_shenthulAI : public ScriptedAI { - npc_shenthulAI(Creature* c) : ScriptedAI(c) {} + npc_shenthulAI(Creature* creature) : ScriptedAI(creature) {} bool CanTalk; bool CanEmote; @@ -205,7 +205,7 @@ public: struct npc_thrall_warchiefAI : public ScriptedAI { - npc_thrall_warchiefAI(Creature* c) : ScriptedAI(c) {} + npc_thrall_warchiefAI(Creature* creature) : ScriptedAI(creature) {} uint32 ChainLightning_Timer; uint32 Shock_Timer; diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp index 2c498cfdc43..66986ebd5ae 100644 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ b/src/server/scripts/Kalimdor/silithus.cpp @@ -492,7 +492,7 @@ public: struct npc_anachronos_the_ancientAI : public ScriptedAI { - npc_anachronos_the_ancientAI(Creature* c) : ScriptedAI(c) {} + npc_anachronos_the_ancientAI(Creature* creature) : ScriptedAI(creature) {} uint32 AnimationTimer; uint8 AnimationCount; @@ -820,7 +820,7 @@ public: struct mob_qiraj_war_spawnAI : public ScriptedAI { - mob_qiraj_war_spawnAI(Creature* c) : ScriptedAI(c) {} + mob_qiraj_war_spawnAI(Creature* creature) : ScriptedAI(creature) {} uint64 MobGUID; uint64 PlayerGUID; @@ -935,7 +935,7 @@ public: struct npc_anachronos_quest_triggerAI : public ScriptedAI { - npc_anachronos_quest_triggerAI(Creature* c) : ScriptedAI(c) {} + npc_anachronos_quest_triggerAI(Creature* creature) : ScriptedAI(creature) {} uint64 PlayerGUID; diff --git a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp index 66731574ec9..0141564a140 100644 --- a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp +++ b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp @@ -112,7 +112,7 @@ public: struct npc_kaya_flathoofAI : public npc_escortAI { - npc_kaya_flathoofAI(Creature* c) : npc_escortAI(c) {} + npc_kaya_flathoofAI(Creature* creature) : npc_escortAI(creature) {} void WaypointReached(uint32 i) { diff --git a/src/server/scripts/Kalimdor/tanaris.cpp b/src/server/scripts/Kalimdor/tanaris.cpp index dcca1ed29b4..c1a5d9de10e 100644 --- a/src/server/scripts/Kalimdor/tanaris.cpp +++ b/src/server/scripts/Kalimdor/tanaris.cpp @@ -58,7 +58,7 @@ public: struct mob_aquementasAI : public ScriptedAI { - mob_aquementasAI(Creature* c) : ScriptedAI(c) {} + mob_aquementasAI(Creature* creature) : ScriptedAI(creature) {} uint32 SendItem_Timer; uint32 SwitchFaction_Timer; @@ -170,7 +170,7 @@ public: struct npc_custodian_of_timeAI : public npc_escortAI { - npc_custodian_of_timeAI(Creature* c) : npc_escortAI(c) {} + npc_custodian_of_timeAI(Creature* creature) : npc_escortAI(creature) {} void WaypointReached(uint32 i) { @@ -426,7 +426,7 @@ public: struct npc_OOX17AI : public npc_escortAI { - npc_OOX17AI(Creature* c) : npc_escortAI(c) {} + npc_OOX17AI(Creature* creature) : npc_escortAI(creature) {} void WaypointReached(uint32 i) { diff --git a/src/server/scripts/Kalimdor/the_barrens.cpp b/src/server/scripts/Kalimdor/the_barrens.cpp index ca87c350cda..f05d7691c61 100644 --- a/src/server/scripts/Kalimdor/the_barrens.cpp +++ b/src/server/scripts/Kalimdor/the_barrens.cpp @@ -234,9 +234,9 @@ public: struct npc_taskmaster_fizzuleAI : public ScriptedAI { - npc_taskmaster_fizzuleAI(Creature* c) : ScriptedAI(c) + npc_taskmaster_fizzuleAI(Creature* creature) : ScriptedAI(creature) { - factionNorm = c->getFaction(); + factionNorm = creature->getFaction(); } uint32 factionNorm; @@ -350,7 +350,7 @@ public: struct npc_twiggy_flatheadAI : public ScriptedAI { - npc_twiggy_flatheadAI(Creature* c) : ScriptedAI(c) {} + npc_twiggy_flatheadAI(Creature* creature) : ScriptedAI(creature) {} bool EventInProgress; bool EventGrate; diff --git a/src/server/scripts/Kalimdor/thousand_needles.cpp b/src/server/scripts/Kalimdor/thousand_needles.cpp index 77788d0fcfa..c6824447e1b 100644 --- a/src/server/scripts/Kalimdor/thousand_needles.cpp +++ b/src/server/scripts/Kalimdor/thousand_needles.cpp @@ -328,7 +328,7 @@ public: struct npc_pluckyAI : public ScriptedAI { - npc_pluckyAI(Creature* c) : ScriptedAI(c) { m_uiNormFaction = c->getFaction(); } + npc_pluckyAI(Creature* creature) : ScriptedAI(creature) { m_uiNormFaction = creature->getFaction(); } uint32 m_uiNormFaction; uint32 m_uiResetTimer; @@ -437,7 +437,7 @@ public: struct npc_enraged_pantherAI : public ScriptedAI { - npc_enraged_pantherAI(Creature* c) : ScriptedAI(c) {} + npc_enraged_pantherAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { diff --git a/src/server/scripts/Kalimdor/thunder_bluff.cpp b/src/server/scripts/Kalimdor/thunder_bluff.cpp index 36873190e8c..5aa55ddea66 100644 --- a/src/server/scripts/Kalimdor/thunder_bluff.cpp +++ b/src/server/scripts/Kalimdor/thunder_bluff.cpp @@ -73,7 +73,7 @@ public: struct npc_cairne_bloodhoofAI : public ScriptedAI { - npc_cairne_bloodhoofAI(Creature* c) : ScriptedAI(c) {} + npc_cairne_bloodhoofAI(Creature* creature) : ScriptedAI(creature) {} uint32 BerserkerCharge_Timer; uint32 Cleave_Timer; diff --git a/src/server/scripts/Kalimdor/ungoro_crater.cpp b/src/server/scripts/Kalimdor/ungoro_crater.cpp index 0e2a1b2c4d9..fc720f04ad1 100644 --- a/src/server/scripts/Kalimdor/ungoro_crater.cpp +++ b/src/server/scripts/Kalimdor/ungoro_crater.cpp @@ -74,7 +74,7 @@ public: struct npc_ameAI : public npc_escortAI { - npc_ameAI(Creature* c) : npc_escortAI(c) {} + npc_ameAI(Creature* creature) : npc_escortAI(creature) {} uint32 DEMORALIZINGSHOUT_Timer; diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp index b16ad9934d8..516d3b21622 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp @@ -48,9 +48,9 @@ public: struct boss_amanitarAI : public ScriptedAI { - boss_amanitarAI(Creature* c) : ScriptedAI(c) + boss_amanitarAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); bFirstTime = true; } @@ -167,7 +167,7 @@ public: struct mob_amanitar_mushroomsAI : public Scripted_NoMovementAI { - mob_amanitar_mushroomsAI(Creature* c) : Scripted_NoMovementAI(c) {} + mob_amanitar_mushroomsAI(Creature* creature) : Scripted_NoMovementAI(creature) {} uint32 uiAuraTimer; uint32 uiDeathTimer; diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp index 85abaa46a5d..7b8157486e8 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp @@ -278,10 +278,10 @@ public: struct mob_nadox_eggsAI : public Scripted_NoMovementAI { - mob_nadox_eggsAI(Creature* c) : Scripted_NoMovementAI(c) + mob_nadox_eggsAI(Creature* creature) : Scripted_NoMovementAI(creature) { - c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); - c->UpdateAllStats(); + creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + creature->UpdateAllStats(); } void Reset() {} void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp index 2789bc48a4c..ceefcece71e 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp @@ -73,9 +73,9 @@ public: struct boss_jedoga_shadowseekerAI : public ScriptedAI { - boss_jedoga_shadowseekerAI(Creature* c) : ScriptedAI(c) + boss_jedoga_shadowseekerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); bFirstTime = true; bPreDone = false; } @@ -355,9 +355,9 @@ public: struct mob_jedoga_initiandAI : public ScriptedAI { - mob_jedoga_initiandAI(Creature* c) : ScriptedAI(c) + mob_jedoga_initiandAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -531,9 +531,9 @@ public: struct npc_jedogas_aufseher_triggerAI : public Scripted_NoMovementAI { - npc_jedogas_aufseher_triggerAI(Creature* c) : Scripted_NoMovementAI(c) + npc_jedogas_aufseher_triggerAI(Creature* creature) : Scripted_NoMovementAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); bRemoved = false; bRemoved2 = false; bCasted = false; diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp index c756aa4f232..5ec693c58b2 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp @@ -79,9 +79,9 @@ public: struct boss_taldaramAI : public ScriptedAI { - boss_taldaramAI(Creature* c) : ScriptedAI(c) + boss_taldaramAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -338,9 +338,9 @@ public: struct mob_taldaram_flamesphereAI : public ScriptedAI { - mob_taldaram_flamesphereAI(Creature* c) : ScriptedAI(c) + mob_taldaram_flamesphereAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiDespawnTimer; diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp index da629fd45e9..699043b3269 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp @@ -51,9 +51,9 @@ public: struct boss_hadronoxAI : public ScriptedAI { - boss_hadronoxAI(Creature* c) : ScriptedAI(c) + boss_hadronoxAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); fMaxDistance = 50.0f; bFirstTime = true; } diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp index 878e1f7555f..4d83be53c93 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp @@ -94,9 +94,9 @@ public: struct boss_krik_thirAI : public ScriptedAI { - boss_krik_thirAI(Creature* c) : ScriptedAI(c) + boss_krik_thirAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -212,7 +212,7 @@ public: struct npc_skittering_infectorAI : public ScriptedAI { - npc_skittering_infectorAI(Creature* c) : ScriptedAI(c) {} + npc_skittering_infectorAI(Creature* creature) : ScriptedAI(creature) {} void JustDied(Unit* /*killer*/) { @@ -234,7 +234,7 @@ public: struct npc_anub_ar_skirmisherAI : public ScriptedAI { - npc_anub_ar_skirmisherAI(Creature* c) : ScriptedAI(c) {} + npc_anub_ar_skirmisherAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiChargeTimer; uint32 uiBackstabTimer; @@ -285,7 +285,7 @@ public: struct npc_anub_ar_shadowcasterAI : public ScriptedAI { - npc_anub_ar_shadowcasterAI(Creature* c) : ScriptedAI(c) {} + npc_anub_ar_shadowcasterAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiShadowBoltTimer; uint32 uiShadowNovaTimer; @@ -331,7 +331,7 @@ public: struct npc_anub_ar_warriorAI : public ScriptedAI { - npc_anub_ar_warriorAI(Creature* c) : ScriptedAI(c){} + npc_anub_ar_warriorAI(Creature* creature) : ScriptedAI(creature){} uint32 uiCleaveTimer; uint32 uiStrikeTimer; @@ -376,7 +376,7 @@ public: struct npc_watcher_gashraAI : public ScriptedAI { - npc_watcher_gashraAI(Creature* c) : ScriptedAI(c) {} + npc_watcher_gashraAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiWebWrapTimer; uint32 uiInfectedBiteTimer; @@ -427,7 +427,7 @@ public: struct npc_watcher_narjilAI : public ScriptedAI { - npc_watcher_narjilAI(Creature* c) : ScriptedAI(c) {} + npc_watcher_narjilAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiWebWrapTimer; uint32 uiInfectedBiteTimer; @@ -481,7 +481,7 @@ public: struct npc_watcher_silthikAI : public ScriptedAI { - npc_watcher_silthikAI(Creature* c) : ScriptedAI(c) {} + npc_watcher_silthikAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiWebWrapTimer; uint32 uiInfectedBiteTimer; diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp index 5418cf8c4d0..9ff8ee9c9ed 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp @@ -72,9 +72,9 @@ public: struct boss_novosAI : public Scripted_NoMovementAI { - boss_novosAI(Creature* c) : Scripted_NoMovementAI(c), lSummons(me) + boss_novosAI(Creature* creature) : Scripted_NoMovementAI(creature), lSummons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiTimer; @@ -260,9 +260,9 @@ public: struct mob_crystal_handlerAI : public ScriptedAI { - mob_crystal_handlerAI(Creature* c) : ScriptedAI(c) + mob_crystal_handlerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiFlashOfDarknessTimer; @@ -317,9 +317,9 @@ public: struct mob_novos_minionAI : public ScriptedAI { - mob_novos_minionAI(Creature* c) : ScriptedAI(c) + mob_novos_minionAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp index 97f2ee4e9a1..b1d588a0d0d 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp @@ -71,9 +71,9 @@ public: struct boss_tharon_jaAI : public ScriptedAI { - boss_tharon_jaAI(Creature* c) : ScriptedAI(c) + boss_tharon_jaAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiPhaseTimer; diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp index 9fc964000e3..26e4e9db99e 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp @@ -61,9 +61,9 @@ public: struct boss_trollgoreAI : public ScriptedAI { - boss_trollgoreAI(Creature* c) : ScriptedAI(c), lSummons(me) + boss_trollgoreAI(Creature* creature) : ScriptedAI(creature), lSummons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiConsumeTimer; diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index 9b627281775..8f9d5584c4c 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -633,7 +633,7 @@ public: struct npc_ghostly_priestAI: public ScriptedAI { - npc_ghostly_priestAI(Creature* c) : ScriptedAI(c) + npc_ghostly_priestAI(Creature* creature) : ScriptedAI(creature) { } @@ -715,7 +715,7 @@ public: struct npc_phantom_mageAI: public ScriptedAI { - npc_phantom_mageAI(Creature* c) : ScriptedAI(c) + npc_phantom_mageAI(Creature* creature) : ScriptedAI(creature) { } @@ -816,7 +816,7 @@ public: struct npc_shadowy_mercenaryAI: public ScriptedAI { - npc_shadowy_mercenaryAI(Creature* c) : ScriptedAI(c) + npc_shadowy_mercenaryAI(Creature* creature) : ScriptedAI(creature) { } @@ -887,7 +887,7 @@ public: struct npc_spectral_footmanAI: public ScriptedAI { - npc_spectral_footmanAI(Creature* c) : ScriptedAI(c) + npc_spectral_footmanAI(Creature* creature) : ScriptedAI(creature) { } @@ -952,7 +952,7 @@ public: struct npc_tortured_riflemanAI : public ScriptedAI { - npc_tortured_riflemanAI(Creature* c) : ScriptedAI(c) + npc_tortured_riflemanAI(Creature* creature) : ScriptedAI(creature) { } diff --git a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp index c665d3cdf5a..b79e4d1edfd 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp @@ -41,9 +41,9 @@ public: struct boss_eckAI : public ScriptedAI { - boss_eckAI(Creature* c) : ScriptedAI(c) + boss_eckAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiBerserkTimer; @@ -145,9 +145,9 @@ public: struct npc_ruins_dwellerAI : public ScriptedAI { - npc_ruins_dwellerAI(Creature* c) : ScriptedAI(c) + npc_ruins_dwellerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp index daa5ee86483..be9b09a1263 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp @@ -75,9 +75,9 @@ public: struct boss_gal_darahAI : public ScriptedAI { - boss_gal_darahAI(Creature* c) : ScriptedAI(c) + boss_gal_darahAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiStampedeTimer; diff --git a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp index 5071802f897..b827f43dc99 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp @@ -80,9 +80,9 @@ public: struct boss_slad_ranAI : public ScriptedAI { - boss_slad_ranAI(Creature* c) : ScriptedAI(c), lSummons(me) + boss_slad_ranAI(Creature* creature) : ScriptedAI(creature), lSummons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiPoisonNovaTimer; @@ -219,7 +219,7 @@ public: struct mob_slad_ran_constrictorAI : public ScriptedAI { - mob_slad_ran_constrictorAI(Creature* c) : ScriptedAI(c) {} + mob_slad_ran_constrictorAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiGripOfSladRanTimer; @@ -272,7 +272,7 @@ public: struct mob_slad_ran_viperAI : public ScriptedAI { - mob_slad_ran_viperAI(Creature* c) : ScriptedAI(c) {} + mob_slad_ran_viperAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiVenomousBiteTimer; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp index e64099da3ac..04360d25be3 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp @@ -295,9 +295,9 @@ public: struct mob_stalaggAI : public ScriptedAI { - mob_stalaggAI(Creature* c) : ScriptedAI(c) + mob_stalaggAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -381,9 +381,9 @@ public: struct mob_feugenAI : public ScriptedAI { - mob_feugenAI(Creature* c) : ScriptedAI(c) + mob_feugenAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp index 44c6c25fa3e..91333098560 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp @@ -61,9 +61,9 @@ public: struct boss_keristraszaAI : public ScriptedAI { - boss_keristraszaAI(Creature* c) : ScriptedAI(c) + boss_keristraszaAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp index 03f467ce180..ad188738c12 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp @@ -67,9 +67,9 @@ public: struct boss_magus_telestraAI : public ScriptedAI { - boss_magus_telestraAI(Creature* c) : ScriptedAI(c) + boss_magus_telestraAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp index 4453ec94494..577bc3cc822 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp @@ -61,9 +61,9 @@ public: struct boss_ormorokAI : public ScriptedAI { - boss_ormorokAI(Creature* c) : ScriptedAI(c) + boss_ormorokAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -234,7 +234,7 @@ public: struct mob_crystal_spikeAI : public Scripted_NoMovementAI { - mob_crystal_spikeAI(Creature* c) : Scripted_NoMovementAI(c) + mob_crystal_spikeAI(Creature* creature) : Scripted_NoMovementAI(creature) { } @@ -277,7 +277,7 @@ public: struct mob_crystalline_tanglerAI : public ScriptedAI { - mob_crystalline_tanglerAI(Creature* c) : ScriptedAI(c) {} + mob_crystalline_tanglerAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiRootsTimer; diff --git a/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp b/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp index 6d07ac960b5..5ea3eb32c1d 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp @@ -49,7 +49,7 @@ public: struct boss_commander_kolurgAI : public ScriptedAI { - boss_commander_kolurgAI(Creature* c) : ScriptedAI(c) {} + boss_commander_kolurgAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp b/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp index 71a153c802a..da4b49740c1 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp @@ -49,7 +49,7 @@ public: struct boss_commander_stoutbeardAI : public ScriptedAI { - boss_commander_stoutbeardAI(Creature* c) : ScriptedAI(c) {} + boss_commander_stoutbeardAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} void EnterCombat(Unit* /*who*/) diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp index d1aba800094..bc57ce21a4d 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp @@ -61,9 +61,9 @@ public: struct boss_krystallusAI : public ScriptedAI { - boss_krystallusAI(Creature* c) : ScriptedAI(c) + boss_krystallusAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiBoulderTossTimer; diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp index cd4d7ae94a1..65711643827 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp @@ -65,7 +65,7 @@ public: struct boss_maiden_of_griefAI : public ScriptedAI { - boss_maiden_of_griefAI(Creature* c) : ScriptedAI(c) + boss_maiden_of_griefAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp index 2c7026207e5..c2a8e905950 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp @@ -90,9 +90,9 @@ public: struct boss_sjonnirAI : public ScriptedAI { - boss_sjonnirAI(Creature* c) : ScriptedAI(c), lSummons(me) + boss_sjonnirAI(Creature* creature) : ScriptedAI(creature), lSummons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } bool bIsFrenzy; @@ -258,7 +258,7 @@ public: struct mob_malformed_oozeAI : public ScriptedAI { - mob_malformed_oozeAI(Creature* c) : ScriptedAI(c) {} + mob_malformed_oozeAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiMergeTimer; @@ -301,9 +301,9 @@ public: struct mob_iron_sludgeAI : public ScriptedAI { - mob_iron_sludgeAI(Creature* c) : ScriptedAI(c) + mob_iron_sludgeAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp index 1a09db675c6..cba123e6efc 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp @@ -142,9 +142,9 @@ public: struct mob_tribuna_controllerAI : public ScriptedAI { - mob_tribuna_controllerAI(Creature* c) : ScriptedAI(c) + mob_tribuna_controllerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); SetCombatMovement(false); } @@ -298,9 +298,9 @@ public: struct npc_brann_hosAI : public npc_escortAI { - npc_brann_hosAI(Creature* c) : npc_escortAI(c) + npc_brann_hosAI(Creature* creature) : npc_escortAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiStep; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon.cpp index e54d8a898de..2dd13e7ce07 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon.cpp @@ -81,9 +81,9 @@ public: struct boss_algalonAI : public ScriptedAI { - boss_algalonAI(Creature* c) : ScriptedAI(c) + boss_algalonAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); Summon = false; // not in reset. intro speech done only once. } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp index 7d37621e787..e1f025f01c0 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp @@ -309,9 +309,9 @@ public: struct mob_annhylde_the_callerAI : public ScriptedAI { - mob_annhylde_the_callerAI(Creature* c) : ScriptedAI(c) + mob_annhylde_the_callerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } float x, y, z; @@ -424,7 +424,7 @@ public: struct mob_ingvar_throw_dummyAI : public ScriptedAI { - mob_ingvar_throw_dummyAI(Creature* c) : ScriptedAI(c) + mob_ingvar_throw_dummyAI(Creature* creature) : ScriptedAI(creature) { } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp index 333278daa10..17ad7b36439 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp @@ -69,9 +69,9 @@ public: struct boss_skarvald_the_constructorAI : public ScriptedAI { - boss_skarvald_the_constructorAI(Creature* c) : ScriptedAI(c) + boss_skarvald_the_constructorAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -221,9 +221,9 @@ public: struct boss_dalronn_the_controllerAI : public ScriptedAI { - boss_dalronn_the_controllerAI(Creature* c) : ScriptedAI(c) + boss_dalronn_the_controllerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp index d660b1516b3..50417b0ac07 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp @@ -37,9 +37,9 @@ public: struct npc_dragonflayer_forge_masterAI : public ScriptedAI { - npc_dragonflayer_forge_masterAI(Creature* c) : ScriptedAI(c) + npc_dragonflayer_forge_masterAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); fm_Type = 0; } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp index d40dba22fcd..474f7f2ba06 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp @@ -94,9 +94,9 @@ public: struct boss_palehoofAI : public ScriptedAI { - boss_palehoofAI(Creature* c) : ScriptedAI(c) + boss_palehoofAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiArcingSmashTimer; @@ -297,9 +297,9 @@ public: struct mob_ravenous_furbolgAI : public ScriptedAI { - mob_ravenous_furbolgAI(Creature* c) : ScriptedAI(c) + mob_ravenous_furbolgAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiChainLightingTimer; @@ -410,9 +410,9 @@ public: struct mob_frenzied_worgenAI : public ScriptedAI { - mob_frenzied_worgenAI(Creature* c) : ScriptedAI(c) + mob_frenzied_worgenAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiMortalWoundTimer; @@ -526,9 +526,9 @@ public: struct mob_ferocious_rhinoAI : public ScriptedAI { - mob_ferocious_rhinoAI(Creature* c) : ScriptedAI(c) + mob_ferocious_rhinoAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiStompTimer; @@ -646,9 +646,9 @@ public: struct mob_massive_jormungarAI : public ScriptedAI { - mob_massive_jormungarAI(Creature* c) : ScriptedAI(c) + mob_massive_jormungarAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiAcidSpitTimer; @@ -752,9 +752,9 @@ public: struct mob_palehoof_orbAI : public ScriptedAI { - mob_palehoof_orbAI(Creature* c) : ScriptedAI(c) + mob_palehoof_orbAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index 5ce26ab1467..093fa0be1a6 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -168,9 +168,9 @@ public: struct boss_skadiAI : public ScriptedAI { - boss_skadiAI(Creature* c) : ScriptedAI(c), Summons(me) + boss_skadiAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - m_instance = c->GetInstanceScript(); + m_instance = creature->GetInstanceScript(); } InstanceScript* m_instance; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp index 0d8e22ff630..f9251c637ba 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp @@ -108,9 +108,9 @@ public: struct boss_ymironAI : public ScriptedAI { - boss_ymironAI(Creature* c) : ScriptedAI(c) + boss_ymironAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); for (int i = 0; i < 4; ++i) m_uiActiveOrder[i] = i; for (int i = 0; i < 3; ++i) diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp index 162f59fa5b7..100f1fccac8 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp @@ -125,7 +125,7 @@ class mob_frost_warder : public CreatureScript struct mob_frost_warderAI : public ScriptedAI { - mob_frost_warderAI(Creature* c) : ScriptedAI(c) {} + mob_frost_warderAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { diff --git a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp index 74fc2505969..df33ffff01a 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp @@ -57,9 +57,9 @@ public: struct boss_cyanigosaAI : public ScriptedAI { - boss_cyanigosaAI(Creature* c) : ScriptedAI(c) + boss_cyanigosaAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiArcaneVacuumTimer; diff --git a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp index 63f0cd39893..31902acfc46 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp @@ -55,9 +55,9 @@ public: struct boss_erekemAI : public ScriptedAI { - boss_erekemAI(Creature* c) : ScriptedAI(c) + boss_erekemAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiBloodlustTimer; @@ -270,9 +270,9 @@ public: struct mob_erekem_guardAI : public ScriptedAI { - mob_erekem_guardAI(Creature* c) : ScriptedAI(c) + mob_erekem_guardAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiGushingWoundTimer; diff --git a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp index c5b2cb3c327..7a8254ad2b6 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp @@ -41,9 +41,9 @@ public: struct boss_lavanthorAI : public ScriptedAI { - boss_lavanthorAI(Creature* c) : ScriptedAI(c) + boss_lavanthorAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiFireboltTimer; diff --git a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp index 84b04579681..1a70846e1b6 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp @@ -37,9 +37,9 @@ public: struct boss_moraggAI : public ScriptedAI { - boss_moraggAI(Creature* c) : ScriptedAI(c) + boss_moraggAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiOpticLinkTimer; diff --git a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp index ff2009c2a17..4569741e459 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp @@ -61,9 +61,9 @@ public: struct boss_zuramatAI : public ScriptedAI { - boss_zuramatAI(Creature* c) : ScriptedAI(c) + boss_zuramatAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp index a0fe468a91b..0ca9ca84b57 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp @@ -426,9 +426,9 @@ public: struct mob_azure_saboteurAI : public npc_escortAI { - mob_azure_saboteurAI(Creature* c):npc_escortAI(c) + mob_azure_saboteurAI(Creature* creature):npc_escortAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); bHasGotMovingPoints = false; uiBoss = 0; Reset(); @@ -550,9 +550,9 @@ public: struct npc_teleportation_portalAI : public ScriptedAI { - npc_teleportation_portalAI(Creature* c) : ScriptedAI(c), listOfMobs(me) + npc_teleportation_portalAI(Creature* creature) : ScriptedAI(creature), listOfMobs(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); uiTypeOfMobsPortal = urand(0, 1); // 0 - elite mobs 1 - portal guardian or portal keeper with regular mobs bPortalGuardianOrKeeperOrEliteSpawn = false; } @@ -675,9 +675,9 @@ public: struct violet_hold_trashAI : public npc_escortAI { - violet_hold_trashAI(Creature* c):npc_escortAI(c) + violet_hold_trashAI(Creature* creature):npc_escortAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); bHasGotMovingPoints = false; if (instance) portalLocationID = instance->GetData(DATA_PORTAL_LOCATION); @@ -808,9 +808,9 @@ public: struct mob_azure_invaderAI : public violet_hold_trashAI { - mob_azure_invaderAI(Creature* c) : violet_hold_trashAI(c) + mob_azure_invaderAI(Creature* creature) : violet_hold_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiCleaveTimer; @@ -886,9 +886,9 @@ public: struct mob_azure_binderAI : public violet_hold_trashAI { - mob_azure_binderAI(Creature* c) : violet_hold_trashAI(c) + mob_azure_binderAI(Creature* creature) : violet_hold_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiArcaneExplosionTimer; @@ -964,9 +964,9 @@ public: struct mob_azure_mage_slayerAI : public violet_hold_trashAI { - mob_azure_mage_slayerAI(Creature* c) : violet_hold_trashAI(c) + mob_azure_mage_slayerAI(Creature* creature) : violet_hold_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiArcaneEmpowermentTimer; @@ -1024,9 +1024,9 @@ public: struct mob_azure_raiderAI : public violet_hold_trashAI { - mob_azure_raiderAI(Creature* c) : violet_hold_trashAI(c) + mob_azure_raiderAI(Creature* creature) : violet_hold_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiConcussionBlowTimer; @@ -1076,9 +1076,9 @@ public: struct mob_azure_stalkerAI : public violet_hold_trashAI { - mob_azure_stalkerAI(Creature* c) : violet_hold_trashAI(c) + mob_azure_stalkerAI(Creature* creature) : violet_hold_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiBackstabTimer; uint32 uiTacticalBlinkTimer; @@ -1135,9 +1135,9 @@ public: struct mob_azure_spellbreakerAI : public violet_hold_trashAI { - mob_azure_spellbreakerAI(Creature* c) : violet_hold_trashAI(c) + mob_azure_spellbreakerAI(Creature* creature) : violet_hold_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiArcaneBlastTimer; @@ -1219,9 +1219,9 @@ public: struct mob_azure_captainAI : public violet_hold_trashAI { - mob_azure_captainAI(Creature* c) : violet_hold_trashAI(c) + mob_azure_captainAI(Creature* creature) : violet_hold_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiMortalStrikeTimer; @@ -1271,9 +1271,9 @@ public: struct mob_azure_sorcerorAI : public violet_hold_trashAI { - mob_azure_sorcerorAI(Creature* c) : violet_hold_trashAI(c) + mob_azure_sorcerorAI(Creature* creature) : violet_hold_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiArcaneStreamTimer; diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index 3f0a85ce561..97155d8cd67 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -60,7 +60,7 @@ public: struct npc_sinkhole_kill_creditAI : public ScriptedAI { - npc_sinkhole_kill_creditAI(Creature* c) : ScriptedAI(c){} + npc_sinkhole_kill_creditAI(Creature* creature) : ScriptedAI(creature){} uint32 uiPhaseTimer; uint8 Phase; @@ -170,7 +170,7 @@ public: struct npc_khunok_the_behemothAI : public ScriptedAI { - npc_khunok_the_behemothAI(Creature* c) : ScriptedAI(c) {} + npc_khunok_the_behemothAI(Creature* creature) : ScriptedAI(creature) {} void MoveInLineOfSight(Unit* who) { @@ -350,7 +350,7 @@ public: struct mob_nerubar_victimAI : public ScriptedAI { - mob_nerubar_victimAI(Creature* c) : ScriptedAI(c) {} + mob_nerubar_victimAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} void EnterCombat(Unit* /*who*/) {} @@ -575,7 +575,7 @@ public: struct npc_nesingwary_trapperAI : public ScriptedAI { - npc_nesingwary_trapperAI(Creature* c) : ScriptedAI(c) { c->SetVisible(false); } + npc_nesingwary_trapperAI(Creature* creature) : ScriptedAI(creature) { creature->SetVisible(false); } uint64 go_caribouGUID; uint8 Phase; @@ -1841,7 +1841,7 @@ public: struct npc_mootoo_the_youngerAI : public npc_escortAI { - npc_mootoo_the_youngerAI(Creature* c) : npc_escortAI(c) {} + npc_mootoo_the_youngerAI(Creature* creature) : npc_escortAI(creature) {} void Reset() { @@ -1926,7 +1926,7 @@ public: struct npc_bonker_togglevoltAI : public npc_escortAI { - npc_bonker_togglevoltAI(Creature* c) : npc_escortAI(c) {} + npc_bonker_togglevoltAI(Creature* creature) : npc_escortAI(creature) {} uint32 Bonker_agro; void Reset() @@ -2026,7 +2026,7 @@ public: struct npc_trapped_mammoth_calfAI : public ScriptedAI { - npc_trapped_mammoth_calfAI(Creature* c) : ScriptedAI(c) {} + npc_trapped_mammoth_calfAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiTimer; bool bStarted; @@ -2114,7 +2114,7 @@ public: struct npc_magmoth_crusherAI : public ScriptedAI { - npc_magmoth_crusherAI(Creature* c) : ScriptedAI(c) {} + npc_magmoth_crusherAI(Creature* creature) : ScriptedAI(creature) {} void JustDied(Unit* killer) { @@ -2150,7 +2150,7 @@ public: struct npc_seaforium_depth_chargeAI : public ScriptedAI { - npc_seaforium_depth_chargeAI(Creature* c) : ScriptedAI(c) {} + npc_seaforium_depth_chargeAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiExplosionTimer; void Reset() @@ -2203,7 +2203,7 @@ public: struct npc_valiance_keep_cannoneerAI : public ScriptedAI { - npc_valiance_keep_cannoneerAI(Creature* c) : ScriptedAI(c) {} + npc_valiance_keep_cannoneerAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiTimer; diff --git a/src/server/scripts/Northrend/grizzly_hills.cpp b/src/server/scripts/Northrend/grizzly_hills.cpp index fdebe3b7ab1..7894d87df7c 100644 --- a/src/server/scripts/Northrend/grizzly_hills.cpp +++ b/src/server/scripts/Northrend/grizzly_hills.cpp @@ -233,7 +233,7 @@ public: struct npc_mrfloppyAI : public ScriptedAI { - npc_mrfloppyAI(Creature* c) : ScriptedAI(c) {} + npc_mrfloppyAI(Creature* creature) : ScriptedAI(creature) {} uint64 EmilyGUID; uint64 RWORGGUID; @@ -471,7 +471,7 @@ public: struct npc_wounded_skirmisherAI : public ScriptedAI { - npc_wounded_skirmisherAI(Creature* c) : ScriptedAI(c) {} + npc_wounded_skirmisherAI(Creature* creature) : ScriptedAI(creature) {} uint64 uiPlayerGUID; diff --git a/src/server/scripts/Northrend/sholazar_basin.cpp b/src/server/scripts/Northrend/sholazar_basin.cpp index d43cf6fb98f..5260ea33eb6 100644 --- a/src/server/scripts/Northrend/sholazar_basin.cpp +++ b/src/server/scripts/Northrend/sholazar_basin.cpp @@ -55,7 +55,7 @@ public: struct npc_injured_rainspeaker_oracleAI : public npc_escortAI { - npc_injured_rainspeaker_oracleAI(Creature* c) : npc_escortAI(c) { c_guid = c->GetGUID(); } + npc_injured_rainspeaker_oracleAI(Creature* creature) : npc_escortAI(creature) { c_guid = creature->GetGUID(); } uint64 c_guid; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h index 2a11139a701..8d2124a3791 100755 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h @@ -219,7 +219,7 @@ class OPvPCapturePointZM_GraveYard : public OPvPCapturePoint bool HandleDropFlag(Player* player, uint32 spellId); - bool CanTalkTo(Player* player, Creature* c, GossipMenuItems const& gso); + bool CanTalkTo(Player* player, Creature* creature, GossipMenuItems const& gso); uint32 GetGraveYardState() const; diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp index ef160a3a5c5..11725965d6d 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp @@ -53,7 +53,7 @@ public: struct mob_stolen_soulAI : public ScriptedAI { - mob_stolen_soulAI(Creature* c) : ScriptedAI(c) {} + mob_stolen_soulAI(Creature* creature) : ScriptedAI(creature) {} uint8 myClass; uint32 Class_Timer; @@ -162,7 +162,7 @@ public: struct boss_exarch_maladaarAI : public ScriptedAI { - boss_exarch_maladaarAI(Creature* c) : ScriptedAI(c) + boss_exarch_maladaarAI(Creature* creature) : ScriptedAI(creature) { HasTaunted = false; } @@ -319,7 +319,7 @@ public: struct mob_avatar_of_martyredAI : public ScriptedAI { - mob_avatar_of_martyredAI(Creature* c) : ScriptedAI(c) {} + mob_avatar_of_martyredAI(Creature* creature) : ScriptedAI(creature) {} uint32 Mortal_Strike_timer; diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp index d359917ab28..5fc912f2a01 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp @@ -52,7 +52,7 @@ public: struct boss_shirrak_the_dead_watcherAI : public ScriptedAI { - boss_shirrak_the_dead_watcherAI(Creature* c) : ScriptedAI(c) + boss_shirrak_the_dead_watcherAI(Creature* creature) : ScriptedAI(creature) { } @@ -170,7 +170,7 @@ public: struct mob_focus_fireAI : public ScriptedAI { - mob_focus_fireAI(Creature* c) : ScriptedAI(c) + mob_focus_fireAI(Creature* creature) : ScriptedAI(creature) { } diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp index aa63f1adf18..9fa0bedde68 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp @@ -67,7 +67,7 @@ public: struct boss_nexusprince_shaffarAI : public ScriptedAI { - boss_nexusprince_shaffarAI(Creature* c) : ScriptedAI(c), summons(me) { HasTaunted = false; } + boss_nexusprince_shaffarAI(Creature* creature) : ScriptedAI(creature), summons(me) { HasTaunted = false; } uint32 Blink_Timer; uint32 Beacon_Timer; @@ -233,7 +233,7 @@ public: struct mob_ethereal_beaconAI : public ScriptedAI { - mob_ethereal_beaconAI(Creature* c) : ScriptedAI(c) + mob_ethereal_beaconAI(Creature* creature) : ScriptedAI(creature) { } @@ -325,7 +325,7 @@ public: struct mob_ethereal_apprenticeAI : public ScriptedAI { - mob_ethereal_apprenticeAI(Creature* c) : ScriptedAI(c) {} + mob_ethereal_apprenticeAI(Creature* creature) : ScriptedAI(creature) {} uint32 Cast_Timer; diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp index d9ba99fcf24..2b4574ef6ac 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp @@ -53,7 +53,7 @@ public: struct boss_pandemoniusAI : public ScriptedAI { - boss_pandemoniusAI(Creature* c) : ScriptedAI(c) + boss_pandemoniusAI(Creature* creature) : ScriptedAI(creature) { } diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp index 2fd7498ea82..89bf5c6c342 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp @@ -65,7 +65,7 @@ public: struct boss_darkweaver_sythAI : public ScriptedAI { - boss_darkweaver_sythAI(Creature* c) : ScriptedAI(c) + boss_darkweaver_sythAI(Creature* creature) : ScriptedAI(creature) { } @@ -206,7 +206,7 @@ public: struct mob_syth_fireAI : public ScriptedAI { - mob_syth_fireAI(Creature* c) : ScriptedAI(c) + mob_syth_fireAI(Creature* creature) : ScriptedAI(creature) { } @@ -265,7 +265,7 @@ public: struct mob_syth_arcaneAI : public ScriptedAI { - mob_syth_arcaneAI(Creature* c) : ScriptedAI(c) + mob_syth_arcaneAI(Creature* creature) : ScriptedAI(creature) { } @@ -319,7 +319,7 @@ public: struct mob_syth_frostAI : public ScriptedAI { - mob_syth_frostAI(Creature* c) : ScriptedAI(c) + mob_syth_frostAI(Creature* creature) : ScriptedAI(creature) { } @@ -374,7 +374,7 @@ public: struct mob_syth_shadowAI : public ScriptedAI { - mob_syth_shadowAI(Creature* c) : ScriptedAI(c) + mob_syth_shadowAI(Creature* creature) : ScriptedAI(creature) { } diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp index 51271cdfe42..bfb9ee4e8cb 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp @@ -64,9 +64,9 @@ public: struct boss_talon_king_ikissAI : public ScriptedAI { - boss_talon_king_ikissAI(Creature* c) : ScriptedAI(c) + boss_talon_king_ikissAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp index f7032d78bb6..0e1fe24f3d7 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp @@ -66,9 +66,9 @@ public: struct boss_blackheart_the_inciterAI : public ScriptedAI { - boss_blackheart_the_inciterAI(Creature* c) : ScriptedAI(c) + boss_blackheart_the_inciterAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp index 81a7750d512..7e99b968b2d 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp @@ -74,7 +74,7 @@ public: struct mob_voidtravelerAI : public ScriptedAI { - mob_voidtravelerAI(Creature* c) : ScriptedAI(c) + mob_voidtravelerAI(Creature* creature) : ScriptedAI(creature) { } @@ -147,9 +147,9 @@ public: struct boss_grandmaster_vorpilAI : public ScriptedAI { - boss_grandmaster_vorpilAI(Creature* c) : ScriptedAI(c) + boss_grandmaster_vorpilAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); Intro = false; } diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp index 5fd908c44e8..be4f3107d05 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp @@ -48,7 +48,7 @@ public: struct boss_murmurAI : public ScriptedAI { - boss_murmurAI(Creature* c) : ScriptedAI(c) + boss_murmurAI(Creature* creature) : ScriptedAI(creature) { SetCombatMovement(false); } diff --git a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp index 3227e685fc4..956b28f4c9b 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp @@ -67,9 +67,9 @@ public: struct boss_gurtogg_bloodboilAI : public ScriptedAI { - boss_gurtogg_bloodboilAI(Creature* c) : ScriptedAI(c) + boss_gurtogg_bloodboilAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 93b687d3f3d..7208fd97f90 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -379,7 +379,7 @@ public: struct flame_of_azzinothAI : public ScriptedAI { - flame_of_azzinothAI(Creature* c) : ScriptedAI(c) {} + flame_of_azzinothAI(Creature* creature) : ScriptedAI(creature) {} uint32 FlameBlastTimer; uint32 CheckTimer; @@ -471,9 +471,9 @@ public: struct boss_illidan_stormrageAI : public ScriptedAI { - boss_illidan_stormrageAI(Creature* c) : ScriptedAI(c), Summons(me) + boss_illidan_stormrageAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); DoCast(me, SPELL_DUAL_WIELD, true); } @@ -1157,7 +1157,7 @@ public: struct boss_maievAI : public ScriptedAI { - boss_maievAI(Creature* c) : ScriptedAI(c) {}; + boss_maievAI(Creature* creature) : ScriptedAI(creature) {}; uint64 IllidanGUID; @@ -1372,9 +1372,9 @@ public: struct npc_akama_illidanAI : public ScriptedAI { - npc_akama_illidanAI(Creature* c) : ScriptedAI(c) + npc_akama_illidanAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); JustCreated = true; } bool JustCreated; @@ -2019,7 +2019,7 @@ public: struct cage_trap_triggerAI : public ScriptedAI { - cage_trap_triggerAI(Creature* c) : ScriptedAI(c) {} + cage_trap_triggerAI(Creature* creature) : ScriptedAI(creature) {} uint64 IllidanGUID; uint32 DespawnTimer; @@ -2117,7 +2117,7 @@ public: struct shadow_demonAI : public ScriptedAI { - shadow_demonAI(Creature* c) : ScriptedAI(c) {} + shadow_demonAI(Creature* creature) : ScriptedAI(creature) {} uint64 TargetGUID; @@ -2192,9 +2192,9 @@ public: // Shadowfiends interact with Illidan, setting more targets in Illidan's hashmap struct mob_parasitic_shadowfiendAI : public ScriptedAI { - mob_parasitic_shadowfiendAI(Creature* c) : ScriptedAI(c) + mob_parasitic_shadowfiendAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp index 3c7f0d3b89c..e9dd3e516b6 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -90,9 +90,9 @@ public: struct boss_shahrazAI : public ScriptedAI { - boss_shahrazAI(Creature* c) : ScriptedAI(c) + boss_shahrazAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp index b0c29afda34..fc2d663951d 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -113,7 +113,7 @@ public: struct npc_enslaved_soulAI : public ScriptedAI { - npc_enslaved_soulAI(Creature* c) : ScriptedAI(c) {} + npc_enslaved_soulAI(Creature* creature) : ScriptedAI(creature) {} uint64 ReliquaryGUID; @@ -142,9 +142,9 @@ public: struct boss_reliquary_of_soulsAI : public ScriptedAI { - boss_reliquary_of_soulsAI(Creature* c) : ScriptedAI(c) + boss_reliquary_of_soulsAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); EssenceGUID = 0; } @@ -379,7 +379,7 @@ public: struct boss_essence_of_sufferingAI : public ScriptedAI { - boss_essence_of_sufferingAI(Creature* c) : ScriptedAI(c) {} + boss_essence_of_sufferingAI(Creature* creature) : ScriptedAI(creature) {} uint64 StatAuraGUID; @@ -504,7 +504,7 @@ public: struct boss_essence_of_desireAI : public ScriptedAI { - boss_essence_of_desireAI(Creature* c) : ScriptedAI(c) {} + boss_essence_of_desireAI(Creature* creature) : ScriptedAI(creature) {} uint32 RuneShieldTimer; uint32 DeadenTimer; @@ -607,7 +607,7 @@ public: struct boss_essence_of_angerAI : public ScriptedAI { - boss_essence_of_angerAI(Creature* c) : ScriptedAI(c) {} + boss_essence_of_angerAI(Creature* creature) : ScriptedAI(creature) {} uint64 AggroTargetGUID; diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp index 4ae41931bd4..88b1648219b 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -121,7 +121,7 @@ public: struct mob_ashtongue_channelerAI : public ScriptedAI { - mob_ashtongue_channelerAI(Creature* c) : ScriptedAI(c) {ShadeGUID = 0;} + mob_ashtongue_channelerAI(Creature* creature) : ScriptedAI(creature) {ShadeGUID = 0;} uint64 ShadeGUID; @@ -147,7 +147,7 @@ public: struct mob_ashtongue_sorcererAI : public ScriptedAI { - mob_ashtongue_sorcererAI(Creature* c) : ScriptedAI(c) {ShadeGUID = 0;} + mob_ashtongue_sorcererAI(Creature* creature) : ScriptedAI(creature) {ShadeGUID = 0;} uint64 ShadeGUID; uint32 CheckTimer; @@ -202,9 +202,9 @@ public: struct boss_shade_of_akamaAI : public ScriptedAI { - boss_shade_of_akamaAI(Creature* c) : ScriptedAI(c), summons(me) + boss_shade_of_akamaAI(Creature* creature) : ScriptedAI(creature), summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); AkamaGUID = instance ? instance->GetData64(DATA_AKAMA_SHADE) : 0; me->setActive(true);//if view distance is too low me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); @@ -571,11 +571,11 @@ public: struct npc_akamaAI : public ScriptedAI { - npc_akamaAI(Creature* c) : ScriptedAI(c), summons(me) + npc_akamaAI(Creature* creature) : ScriptedAI(creature), summons(me) { ShadeHasDied = false; StartCombat = false; - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); if (instance) ShadeGUID = instance->GetData64(DATA_SHADEOFAKAMA); else diff --git a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp index 5a02ffc891f..6cd74dea985 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp @@ -91,9 +91,9 @@ public: struct boss_supremusAI : public ScriptedAI { - boss_supremusAI(Creature* c) : ScriptedAI(c), summons(me) + boss_supremusAI(Creature* creature) : ScriptedAI(creature), summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -263,7 +263,7 @@ public: struct npc_volcanoAI : public Scripted_NoMovementAI { - npc_volcanoAI(Creature* c) : Scripted_NoMovementAI(c) {} + npc_volcanoAI(Creature* creature) : Scripted_NoMovementAI(creature) {} void Reset() { diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp index 278488eac9e..49323af0952 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp @@ -63,7 +63,7 @@ public: struct mob_doom_blossomAI : public ScriptedAI { - mob_doom_blossomAI(Creature* c) : ScriptedAI(c) {} + mob_doom_blossomAI(Creature* creature) : ScriptedAI(creature) {} uint32 CheckTeronTimer; uint32 ShadowBoltTimer; @@ -129,7 +129,7 @@ public: struct mob_shadowy_constructAI : public ScriptedAI { - mob_shadowy_constructAI(Creature* c) : ScriptedAI(c) {} + mob_shadowy_constructAI(Creature* creature) : ScriptedAI(creature) {} uint64 GhostGUID; uint64 TeronGUID; @@ -219,9 +219,9 @@ public: struct boss_teron_gorefiendAI : public ScriptedAI { - boss_teron_gorefiendAI(Creature* c) : ScriptedAI(c) + boss_teron_gorefiendAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp index 47f82447a80..7d1c07ac91a 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp @@ -72,9 +72,9 @@ public: struct boss_najentusAI : public ScriptedAI { - boss_najentusAI(Creature* c) : ScriptedAI(c) + boss_najentusAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index b0c6dcdda41..c313a2138a6 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -122,7 +122,7 @@ public: struct mob_blood_elf_council_voice_triggerAI : public ScriptedAI { - mob_blood_elf_council_voice_triggerAI(Creature* c) : ScriptedAI(c) + mob_blood_elf_council_voice_triggerAI(Creature* creature) : ScriptedAI(creature) { for (uint8 i = 0; i < 4; ++i) Council[i] = 0; @@ -217,9 +217,9 @@ public: struct mob_illidari_councilAI : public ScriptedAI { - mob_illidari_councilAI(Creature* c) : ScriptedAI(c) + mob_illidari_councilAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); for (uint8 i = 0; i < 4; ++i) Council[i] = 0; } @@ -378,9 +378,9 @@ public: struct boss_illidari_councilAI : public ScriptedAI { - boss_illidari_councilAI(Creature* c) : ScriptedAI(c) + boss_illidari_councilAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); for (uint8 i = 0; i < 4; ++i) Council[i] = 0; LoadedGUIDs = false; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp index 9edc7179d5e..287b5ff8a43 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -107,9 +107,9 @@ public: struct boss_fathomlord_karathressAI : public ScriptedAI { - boss_fathomlord_karathressAI(Creature* c) : ScriptedAI(c) + boss_fathomlord_karathressAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); Advisors[0] = 0; Advisors[1] = 0; Advisors[2] = 0; @@ -317,9 +317,9 @@ public: struct boss_fathomguard_sharkkisAI : public ScriptedAI { - boss_fathomguard_sharkkisAI(Creature* c) : ScriptedAI(c) + boss_fathomguard_sharkkisAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -471,9 +471,9 @@ public: struct boss_fathomguard_tidalvessAI : public ScriptedAI { - boss_fathomguard_tidalvessAI(Creature* c) : ScriptedAI(c) + boss_fathomguard_tidalvessAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -598,9 +598,9 @@ public: struct boss_fathomguard_caribdisAI : public ScriptedAI { - boss_fathomguard_caribdisAI(Creature* c) : ScriptedAI(c) + boss_fathomguard_caribdisAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp index 6f020c16402..11b3d147540 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp @@ -88,9 +88,9 @@ public: struct boss_hydross_the_unstableAI : public ScriptedAI { - boss_hydross_the_unstableAI(Creature* c) : ScriptedAI(c), Summons(me) + boss_hydross_the_unstableAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index 2df9e0e65ba..505704bef51 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -143,12 +143,12 @@ public: struct boss_lady_vashjAI : public ScriptedAI { - boss_lady_vashjAI (Creature* c) : ScriptedAI(c) + boss_lady_vashjAI (Creature* creature) : ScriptedAI(creature) { - Instance = c->GetInstanceScript(); + Instance = creature->GetInstanceScript(); Intro = false; JustCreated = true; - c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // set it only once on Creature create (no need do intro if wiped) + creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // set it only once on Creature create (no need do intro if wiped) } InstanceScript* Instance; @@ -553,9 +553,9 @@ public: struct mob_enchanted_elementalAI : public ScriptedAI { - mob_enchanted_elementalAI(Creature* c) : ScriptedAI(c) + mob_enchanted_elementalAI(Creature* creature) : ScriptedAI(creature) { - Instance = c->GetInstanceScript(); + Instance = creature->GetInstanceScript(); } InstanceScript* Instance; @@ -647,9 +647,9 @@ public: struct mob_tainted_elementalAI : public ScriptedAI { - mob_tainted_elementalAI(Creature* c) : ScriptedAI(c) + mob_tainted_elementalAI(Creature* creature) : ScriptedAI(creature) { - Instance = c->GetInstanceScript(); + Instance = creature->GetInstanceScript(); } InstanceScript* Instance; @@ -716,9 +716,9 @@ public: struct mob_toxic_sporebatAI : public ScriptedAI { - mob_toxic_sporebatAI(Creature* c) : ScriptedAI(c) + mob_toxic_sporebatAI(Creature* creature) : ScriptedAI(creature) { - Instance = c->GetInstanceScript(); + Instance = creature->GetInstanceScript(); EnterEvadeMode(); } @@ -812,9 +812,9 @@ public: struct mob_shield_generator_channelAI : public ScriptedAI { - mob_shield_generator_channelAI(Creature* c) : ScriptedAI(c) + mob_shield_generator_channelAI(Creature* creature) : ScriptedAI(creature) { - Instance = c->GetInstanceScript(); + Instance = creature->GetInstanceScript(); } InstanceScript* Instance; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp index 5111a8eaa8e..19d0cfbbc94 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp @@ -79,7 +79,7 @@ public: struct mob_inner_demonAI : public ScriptedAI { - mob_inner_demonAI(Creature* c) : ScriptedAI(c) + mob_inner_demonAI(Creature* creature) : ScriptedAI(creature) { victimGUID = 0; } @@ -170,10 +170,10 @@ public: struct boss_leotheras_the_blindAI : public ScriptedAI { - boss_leotheras_the_blindAI(Creature* c) : ScriptedAI(c) + boss_leotheras_the_blindAI(Creature* creature) : ScriptedAI(creature) { - c->GetPosition(x, y, z); - instance = c->GetInstanceScript(); + creature->GetPosition(x, y, z); + instance = creature->GetInstanceScript(); Demon = 0; for (uint8 i = 0; i < 3; ++i)//clear guids @@ -600,7 +600,7 @@ public: struct boss_leotheras_the_blind_demonformAI : public ScriptedAI { - boss_leotheras_the_blind_demonformAI(Creature* c) : ScriptedAI(c) {} + boss_leotheras_the_blind_demonformAI(Creature* creature) : ScriptedAI(creature) {} uint32 ChaosBlast_Timer; bool DealDamage; @@ -673,9 +673,9 @@ public: struct mob_greyheart_spellbinderAI : public ScriptedAI { - mob_greyheart_spellbinderAI(Creature* c) : ScriptedAI(c) + mob_greyheart_spellbinderAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); leotherasGUID = 0; AddedBanish = false; } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp index 41a8b12dd51..7b08b2a4853 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp @@ -78,9 +78,9 @@ public: struct boss_the_lurker_belowAI : public Scripted_NoMovementAI { - boss_the_lurker_belowAI(Creature* c) : Scripted_NoMovementAI(c), Summons(me) + boss_the_lurker_belowAI(Creature* creature) : Scripted_NoMovementAI(creature), Summons(me) { - Instance = c->GetInstanceScript(); + Instance = creature->GetInstanceScript(); } InstanceScript* Instance; @@ -368,7 +368,7 @@ public: struct mob_coilfang_ambusherAI : public Scripted_NoMovementAI { - mob_coilfang_ambusherAI(Creature* c) : Scripted_NoMovementAI(c) + mob_coilfang_ambusherAI(Creature* creature) : Scripted_NoMovementAI(creature) { } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp index eeef50e3f9c..e1147f9c18f 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp @@ -89,9 +89,9 @@ public: struct boss_morogrim_tidewalkerAI : public ScriptedAI { - boss_morogrim_tidewalkerAI(Creature* c) : ScriptedAI(c) + boss_morogrim_tidewalkerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -296,7 +296,7 @@ public: struct mob_water_globuleAI : public ScriptedAI { - mob_water_globuleAI(Creature* c) : ScriptedAI(c) {} + mob_water_globuleAI(Creature* creature) : ScriptedAI(creature) {} uint32 Check_Timer; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp index c3203621dbb..383f1467566 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp @@ -58,9 +58,9 @@ public: struct boss_thespiaAI : public ScriptedAI { - boss_thespiaAI(Creature* c) : ScriptedAI(c) + boss_thespiaAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -158,7 +158,7 @@ public: struct mob_coilfang_waterelementalAI : public ScriptedAI { - mob_coilfang_waterelementalAI(Creature* c) : ScriptedAI(c) {} + mob_coilfang_waterelementalAI(Creature* creature) : ScriptedAI(creature) {} uint32 WaterBoltVolley_Timer; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp index ce73e467c0c..b27bbe36dc5 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp @@ -60,9 +60,9 @@ public: struct boss_mekgineer_steamriggerAI : public ScriptedAI { - boss_mekgineer_steamriggerAI(Creature* c) : ScriptedAI(c) + boss_mekgineer_steamriggerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -204,9 +204,9 @@ public: struct mob_steamrigger_mechanicAI : public ScriptedAI { - mob_steamrigger_mechanicAI(Creature* c) : ScriptedAI(c) + mob_steamrigger_mechanicAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp index bfbeff81d3e..8c700313ca5 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp @@ -54,9 +54,9 @@ public: struct mob_naga_distillerAI : public ScriptedAI { - mob_naga_distillerAI(Creature* c) : ScriptedAI(c) + mob_naga_distillerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -112,9 +112,9 @@ public: struct boss_warlord_kalithreshAI : public ScriptedAI { - boss_warlord_kalithreshAI(Creature* c) : ScriptedAI(c) + boss_warlord_kalithreshAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp index aebd71bbd47..42d617992ed 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp @@ -40,7 +40,7 @@ public: struct boss_hungarfenAI : public ScriptedAI { - boss_hungarfenAI(Creature* c) : ScriptedAI(c) + boss_hungarfenAI(Creature* creature) : ScriptedAI(creature) { } @@ -112,7 +112,7 @@ public: struct mob_underbog_mushroomAI : public ScriptedAI { - mob_underbog_mushroomAI(Creature* c) : ScriptedAI(c) {} + mob_underbog_mushroomAI(Creature* creature) : ScriptedAI(creature) {} bool Stop; uint32 Grow_Timer; diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp index fb3be660b5e..c76be6bbb5f 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp @@ -47,7 +47,7 @@ public: struct boss_the_black_stalkerAI : public ScriptedAI { - boss_the_black_stalkerAI(Creature* c) : ScriptedAI(c) + boss_the_black_stalkerAI(Creature* creature) : ScriptedAI(creature) { } diff --git a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp index b7604c41794..895ea71f139 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp @@ -66,9 +66,9 @@ public: struct boss_gruulAI : public ScriptedAI { - boss_gruulAI(Creature* c) : ScriptedAI(c) + boss_gruulAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp index 4636334e668..ee8e64029f9 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp @@ -118,9 +118,9 @@ public: struct boss_high_king_maulgarAI : public ScriptedAI { - boss_high_king_maulgarAI(Creature* c) : ScriptedAI(c) + boss_high_king_maulgarAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); for (uint8 i = 0; i < 4; ++i) Council[i] = 0; } @@ -317,9 +317,9 @@ public: struct boss_olm_the_summonerAI : public ScriptedAI { - boss_olm_the_summonerAI(Creature* c) : ScriptedAI(c) + boss_olm_the_summonerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 DarkDecay_Timer; @@ -445,9 +445,9 @@ public: struct boss_kiggler_the_crazedAI : public ScriptedAI { - boss_kiggler_the_crazedAI(Creature* c) : ScriptedAI(c) + boss_kiggler_the_crazedAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 GreaterPolymorph_Timer; @@ -567,9 +567,9 @@ public: struct boss_blindeye_the_seerAI : public ScriptedAI { - boss_blindeye_the_seerAI(Creature* c) : ScriptedAI(c) + boss_blindeye_the_seerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 GreaterPowerWordShield_Timer; @@ -677,9 +677,9 @@ public: struct boss_krosh_firehandAI : public ScriptedAI { - boss_krosh_firehandAI(Creature* c) : ScriptedAI(c) + boss_krosh_firehandAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 GreaterFireball_Timer; diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index f46f7f1d745..2d4e870629f 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -61,7 +61,7 @@ public: struct mobs_bladespire_ogreAI : public ScriptedAI { - mobs_bladespire_ogreAI(Creature* c) : ScriptedAI(c) {} + mobs_bladespire_ogreAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { } @@ -112,7 +112,7 @@ public: struct mobs_nether_drakeAI : public ScriptedAI { - mobs_nether_drakeAI(Creature* c) : ScriptedAI(c) {} + mobs_nether_drakeAI(Creature* creature) : ScriptedAI(creature) {} bool IsNihil; uint32 NihilSpeech_Timer; @@ -276,7 +276,7 @@ public: struct npc_daranelleAI : public ScriptedAI { - npc_daranelleAI(Creature* c) : ScriptedAI(c) {} + npc_daranelleAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { } diff --git a/src/server/scripts/Outland/hellfire_peninsula.cpp b/src/server/scripts/Outland/hellfire_peninsula.cpp index 707dfd65135..75a402a5338 100644 --- a/src/server/scripts/Outland/hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/hellfire_peninsula.cpp @@ -66,7 +66,7 @@ public: struct npc_aeranasAI : public ScriptedAI { - npc_aeranasAI(Creature* c) : ScriptedAI(c) {} + npc_aeranasAI(Creature* creature) : ScriptedAI(creature) {} uint32 Faction_Timer; uint32 EnvelopingWinds_Timer; @@ -400,7 +400,7 @@ public: struct npc_wounded_blood_elfAI : public npc_escortAI { - npc_wounded_blood_elfAI(Creature* c) : npc_escortAI(c) {} + npc_wounded_blood_elfAI(Creature* creature) : npc_escortAI(creature) {} void WaypointReached(uint32 i) { diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp index 5d1a77953a7..d53bb4c24a4 100644 --- a/src/server/scripts/Outland/nagrand.cpp +++ b/src/server/scripts/Outland/nagrand.cpp @@ -330,7 +330,7 @@ public: struct npc_creditmarker_visit_with_ancestorsAI : public ScriptedAI { - npc_creditmarker_visit_with_ancestorsAI(Creature* c) : ScriptedAI(c) {} + npc_creditmarker_visit_with_ancestorsAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp index d28a1f23795..8b24d94169b 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/netherstorm.cpp @@ -78,7 +78,7 @@ public: struct npc_manaforge_control_consoleAI : public ScriptedAI { - npc_manaforge_control_consoleAI(Creature* c) : ScriptedAI(c) {} + npc_manaforge_control_consoleAI(Creature* creature) : ScriptedAI(creature) {} uint32 Event_Timer; uint32 Wave_Timer; @@ -394,7 +394,7 @@ public: struct npc_commander_dawnforgeAI : public ScriptedAI { - npc_commander_dawnforgeAI(Creature* c) : ScriptedAI(c) { Reset (); } + npc_commander_dawnforgeAI(Creature* creature) : ScriptedAI(creature) { Reset (); } uint64 PlayerGUID; uint64 ardonisGUID; @@ -745,7 +745,7 @@ public: struct mob_phase_hunterAI : public ScriptedAI { - mob_phase_hunterAI(Creature* c) : ScriptedAI(c) {} + mob_phase_hunterAI(Creature* creature) : ScriptedAI(creature) {} bool Weak; bool Materialize; @@ -882,7 +882,7 @@ public: struct npc_bessyAI : public npc_escortAI { - npc_bessyAI(Creature* c) : npc_escortAI(c) {} + npc_bessyAI(Creature* creature) : npc_escortAI(creature) {} void JustDied(Unit* /*killer*/) { diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index be0166b6d19..94e71e55a67 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -75,7 +75,7 @@ public: struct mob_mature_netherwing_drakeAI : public ScriptedAI { - mob_mature_netherwing_drakeAI(Creature* c) : ScriptedAI(c) { } + mob_mature_netherwing_drakeAI(Creature* creature) : ScriptedAI(creature) { } uint64 uiPlayerGUID; @@ -206,7 +206,7 @@ public: struct mob_enslaved_netherwing_drakeAI : public ScriptedAI { - mob_enslaved_netherwing_drakeAI(Creature* c) : ScriptedAI(c) + mob_enslaved_netherwing_drakeAI(Creature* creature) : ScriptedAI(creature) { PlayerGUID = 0; Tapped = false; @@ -338,7 +338,7 @@ public: struct mob_dragonmaw_peonAI : public ScriptedAI { - mob_dragonmaw_peonAI(Creature* c) : ScriptedAI(c) {} + mob_dragonmaw_peonAI(Creature* creature) : ScriptedAI(creature) {} uint64 PlayerGUID; bool Tapped; @@ -714,7 +714,7 @@ public: struct npc_overlord_morghorAI : public ScriptedAI { - npc_overlord_morghorAI(Creature* c) : ScriptedAI(c) {} + npc_overlord_morghorAI(Creature* creature) : ScriptedAI(creature) {} uint64 PlayerGUID; uint64 IllidanGUID; @@ -1167,7 +1167,7 @@ public: struct mob_torloth_the_magnificentAI : public ScriptedAI { - mob_torloth_the_magnificentAI(Creature* c) : ScriptedAI(c) {} + mob_torloth_the_magnificentAI(Creature* creature) : ScriptedAI(creature) {} uint32 AnimationTimer, SpellTimer1, SpellTimer2, SpellTimer3; @@ -1329,7 +1329,7 @@ public: struct npc_lord_illidan_stormrageAI : public ScriptedAI { - npc_lord_illidan_stormrageAI(Creature* c) : ScriptedAI(c) {} + npc_lord_illidan_stormrageAI(Creature* creature) : ScriptedAI(creature) {} uint64 PlayerGUID; @@ -1474,7 +1474,7 @@ public: struct mob_illidari_spawnAI : public ScriptedAI { - mob_illidari_spawnAI(Creature* c) : ScriptedAI(c) {} + mob_illidari_spawnAI(Creature* creature) : ScriptedAI(creature) {} uint64 LordIllidanGUID; uint32 SpellTimer1, SpellTimer2, SpellTimer3; @@ -1725,7 +1725,7 @@ public: struct npc_enraged_spiritAI : public ScriptedAI { - npc_enraged_spiritAI(Creature* c) : ScriptedAI(c) {} + npc_enraged_spiritAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { } diff --git a/src/server/scripts/Outland/shattrath_city.cpp b/src/server/scripts/Outland/shattrath_city.cpp index 2421af6af75..f5d725364c0 100644 --- a/src/server/scripts/Outland/shattrath_city.cpp +++ b/src/server/scripts/Outland/shattrath_city.cpp @@ -83,9 +83,9 @@ public: struct npc_raliq_the_drunkAI : public ScriptedAI { - npc_raliq_the_drunkAI(Creature* c) : ScriptedAI(c) + npc_raliq_the_drunkAI(Creature* creature) : ScriptedAI(creature) { - m_uiNormFaction = c->getFaction(); + m_uiNormFaction = creature->getFaction(); } uint32 m_uiNormFaction; @@ -151,7 +151,7 @@ public: struct npc_salsalabimAI : public ScriptedAI { - npc_salsalabimAI(Creature* c) : ScriptedAI(c) {} + npc_salsalabimAI(Creature* creature) : ScriptedAI(creature) {} uint32 MagneticPull_Timer; @@ -317,7 +317,7 @@ public: struct npc_kservantAI : public npc_escortAI { public: - npc_kservantAI(Creature* c) : npc_escortAI(c) {} + npc_kservantAI(Creature* creature) : npc_escortAI(creature) {} void WaypointReached(uint32 i) { @@ -402,7 +402,7 @@ public: struct npc_dirty_larryAI : public ScriptedAI { - npc_dirty_larryAI(Creature* c) : ScriptedAI(c) {} + npc_dirty_larryAI(Creature* creature) : ScriptedAI(creature) {} bool Event; bool Attack; diff --git a/src/server/scripts/Outland/terokkar_forest.cpp b/src/server/scripts/Outland/terokkar_forest.cpp index bcb5f9f4da1..67852e9be84 100644 --- a/src/server/scripts/Outland/terokkar_forest.cpp +++ b/src/server/scripts/Outland/terokkar_forest.cpp @@ -62,7 +62,7 @@ public: struct mob_unkor_the_ruthlessAI : public ScriptedAI { - mob_unkor_the_ruthlessAI(Creature* c) : ScriptedAI(c) {} + mob_unkor_the_ruthlessAI(Creature* creature) : ScriptedAI(creature) {} bool CanDoQuest; uint32 UnkorUnfriendly_Timer; @@ -168,7 +168,7 @@ public: struct mob_infested_root_walkerAI : public ScriptedAI { - mob_infested_root_walkerAI(Creature* c) : ScriptedAI(c) {} + mob_infested_root_walkerAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { } void EnterCombat(Unit* /*who*/) { } @@ -200,7 +200,7 @@ public: struct npc_skywingAI : public npc_escortAI { public: - npc_skywingAI(Creature* c) : npc_escortAI(c) {} + npc_skywingAI(Creature* creature) : npc_escortAI(creature) {} void WaypointReached(uint32 i) { @@ -261,7 +261,7 @@ public: struct mob_rotting_forest_ragerAI : public ScriptedAI { - mob_rotting_forest_ragerAI(Creature* c) : ScriptedAI(c) {} + mob_rotting_forest_ragerAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { } void EnterCombat(Unit* /*who*/) { } @@ -300,7 +300,7 @@ public: struct mob_netherweb_victimAI : public ScriptedAI { - mob_netherweb_victimAI(Creature* c) : ScriptedAI(c) {} + mob_netherweb_victimAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { } void EnterCombat(Unit* /*who*/) { } @@ -387,9 +387,9 @@ public: struct npc_floonAI : public ScriptedAI { - npc_floonAI(Creature* c) : ScriptedAI(c) + npc_floonAI(Creature* creature) : ScriptedAI(creature) { - m_uiNormFaction = c->getFaction(); + m_uiNormFaction = creature->getFaction(); } uint32 m_uiNormFaction; @@ -459,7 +459,7 @@ public: struct npc_isla_starmaneAI : public npc_escortAI { - npc_isla_starmaneAI(Creature* c) : npc_escortAI(c) {} + npc_isla_starmaneAI(Creature* creature) : npc_escortAI(creature) {} void WaypointReached(uint32 i) { @@ -660,7 +660,7 @@ public: struct npc_akunoAI : public npc_escortAI { - npc_akunoAI(Creature* c) : npc_escortAI(c) {} + npc_akunoAI(Creature* creature) : npc_escortAI(creature) {} void WaypointReached(uint32 i) { diff --git a/src/server/scripts/Outland/zangarmarsh.cpp b/src/server/scripts/Outland/zangarmarsh.cpp index 6d8a47c693e..296c95dcbd7 100644 --- a/src/server/scripts/Outland/zangarmarsh.cpp +++ b/src/server/scripts/Outland/zangarmarsh.cpp @@ -149,9 +149,9 @@ public: struct npc_cooshcooshAI : public ScriptedAI { - npc_cooshcooshAI(Creature* c) : ScriptedAI(c) + npc_cooshcooshAI(Creature* creature) : ScriptedAI(creature) { - m_uiNormFaction = c->getFaction(); + m_uiNormFaction = creature->getFaction(); } uint32 m_uiNormFaction; @@ -317,7 +317,7 @@ public: struct npc_kayra_longmaneAI : public npc_escortAI { - npc_kayra_longmaneAI(Creature* c) : npc_escortAI(c) {} + npc_kayra_longmaneAI(Creature* creature) : npc_escortAI(creature) {} void Reset() { } diff --git a/src/server/scripts/World/mob_generic_creature.cpp b/src/server/scripts/World/mob_generic_creature.cpp index ce8b0a2de14..6970d5ae367 100644 --- a/src/server/scripts/World/mob_generic_creature.cpp +++ b/src/server/scripts/World/mob_generic_creature.cpp @@ -34,7 +34,7 @@ public: struct generic_creatureAI : public ScriptedAI { - generic_creatureAI(Creature* c) : ScriptedAI(c) {} + generic_creatureAI(Creature* creature) : ScriptedAI(creature) {} uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds) uint32 BuffTimer; //This variable keeps track of buffs diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 67b04dab29d..046890b498d 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -315,7 +315,7 @@ public: struct npc_chicken_cluckAI : public ScriptedAI { - npc_chicken_cluckAI(Creature* c) : ScriptedAI(c) {} + npc_chicken_cluckAI(Creature* creature) : ScriptedAI(creature) {} uint32 ResetFlagTimer; @@ -407,7 +407,7 @@ public: struct npc_dancing_flamesAI : public ScriptedAI { - npc_dancing_flamesAI(Creature* c) : ScriptedAI(c) {} + npc_dancing_flamesAI(Creature* creature) : ScriptedAI(creature) {} bool Active; uint32 CanIteract; @@ -558,7 +558,7 @@ public: struct npc_doctorAI : public ScriptedAI { - npc_doctorAI(Creature* c) : ScriptedAI(c) {} + npc_doctorAI(Creature* creature) : ScriptedAI(creature) {} uint64 PlayerGUID; @@ -703,7 +703,7 @@ public: struct npc_injured_patientAI : public ScriptedAI { - npc_injured_patientAI(Creature* c) : ScriptedAI(c) {} + npc_injured_patientAI(Creature* creature) : ScriptedAI(creature) {} uint64 DoctorGUID; Location* Coord; @@ -905,7 +905,7 @@ public: struct npc_garments_of_questsAI : public npc_escortAI { - npc_garments_of_questsAI(Creature* c) : npc_escortAI(c) {Reset();} + npc_garments_of_questsAI(Creature* creature) : npc_escortAI(creature) {Reset();} uint64 CasterGUID; @@ -1105,7 +1105,7 @@ public: struct npc_guardianAI : public ScriptedAI { - npc_guardianAI(Creature* c) : ScriptedAI(c) {} + npc_guardianAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { @@ -1477,7 +1477,7 @@ public: struct npc_steam_tonkAI : public ScriptedAI { - npc_steam_tonkAI(Creature* c) : ScriptedAI(c) {} + npc_steam_tonkAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} void EnterCombat(Unit* /*who*/) {} @@ -1512,7 +1512,7 @@ public: struct npc_tonk_mineAI : public ScriptedAI { - npc_tonk_mineAI(Creature* c) : ScriptedAI(c) + npc_tonk_mineAI(Creature* creature) : ScriptedAI(creature) { me->SetReactState(REACT_PASSIVE); } @@ -1557,7 +1557,7 @@ public: struct npc_brewfest_revelerAI : public ScriptedAI { - npc_brewfest_revelerAI(Creature* c) : ScriptedAI(c) {} + npc_brewfest_revelerAI(Creature* creature) : ScriptedAI(creature) {} void ReceiveEmote(Player* player, uint32 emote) { if (!IsHolidayActive(HOLIDAY_BREWFEST)) @@ -1593,7 +1593,7 @@ class npc_winter_reveler : public CreatureScript struct npc_winter_revelerAI : public ScriptedAI { - npc_winter_revelerAI(Creature* c) : ScriptedAI(c) {} + npc_winter_revelerAI(Creature* creature) : ScriptedAI(creature) {} void ReceiveEmote(Player* player, uint32 emote) { @@ -1638,7 +1638,7 @@ public: struct npc_snake_trap_serpentsAI : public ScriptedAI { - npc_snake_trap_serpentsAI(Creature* c) : ScriptedAI(c) {} + npc_snake_trap_serpentsAI(Creature* creature) : ScriptedAI(creature) {} uint32 SpellTimer; bool IsViper; @@ -1752,7 +1752,7 @@ public: struct mob_mojoAI : public ScriptedAI { - mob_mojoAI(Creature* c) : ScriptedAI(c) {Reset();} + mob_mojoAI(Creature* creature) : ScriptedAI(creature) {Reset();} uint32 hearts; uint64 victimGUID; void Reset() @@ -3028,7 +3028,7 @@ public: struct npc_spring_rabbitAI : public ScriptedAI { - npc_spring_rabbitAI(Creature* c) : ScriptedAI(c) { } + npc_spring_rabbitAI(Creature* creature) : ScriptedAI(creature) { } bool inLove; uint32 jumpTimer; From 117fbb9010743a0e688b837dd00a35c28fb16f25 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Wed, 14 Mar 2012 09:30:06 +0800 Subject: [PATCH 0166/1149] Core/Script: Clean-Up in Scripts. InstanceScript* Instance -> InstanceScript* instance Signed-off-by: Gyx <2359980687@qq.com> --- .../IcecrownCitadel/icecrown_citadel.cpp | 10 ++-- .../SerpentShrine/boss_lady_vashj.cpp | 54 +++++++++---------- .../SerpentShrine/boss_lurker_below.cpp | 22 ++++---- 3 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index ef222963dfb..5720ce0e423 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -1204,7 +1204,7 @@ class npc_crok_scourgebane : public CreatureScript struct npc_argent_captainAI : public ScriptedAI { public: - npc_argent_captainAI(Creature* creature) : ScriptedAI(creature), Instance(creature->GetInstanceScript()), _firstDeath(true) + npc_argent_captainAI(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript()), _firstDeath(true) { FollowAngle = PET_FOLLOW_ANGLE; FollowDist = PET_FOLLOW_DIST; @@ -1232,7 +1232,7 @@ struct npc_argent_captainAI : public ScriptedAI { if (action == ACTION_START_GAUNTLET) { - if (Creature* crok = ObjectAccessor::GetCreature(*me, Instance->GetData64(DATA_CROK_SCOURGEBANE))) + if (Creature* crok = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_CROK_SCOURGEBANE))) { me->SetReactState(REACT_DEFENSIVE); FollowAngle = me->GetAngle(crok) + me->GetOrientation(); @@ -1276,7 +1276,7 @@ struct npc_argent_captainAI : public ScriptedAI if (!me->GetVehicle()) { me->GetMotionMaster()->Clear(false); - if (Creature* crok = ObjectAccessor::GetCreature(*me, Instance->GetData64(DATA_CROK_SCOURGEBANE))) + if (Creature* crok = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_CROK_SCOURGEBANE))) me->GetMotionMaster()->MoveFollow(crok, FollowDist, FollowAngle, MOTION_SLOT_IDLE); } @@ -1309,14 +1309,14 @@ struct npc_argent_captainAI : public ScriptedAI } Talk(SAY_CAPTAIN_RESURRECTED); - me->UpdateEntry(newEntry, Instance->GetData(DATA_TEAM_IN_INSTANCE), me->GetCreatureData()); + me->UpdateEntry(newEntry, instance->GetData(DATA_TEAM_IN_INSTANCE), me->GetCreatureData()); DoCast(me, SPELL_UNDEATH, true); } } protected: EventMap Events; - InstanceScript* Instance; + InstanceScript* instance; float FollowAngle; float FollowDist; bool IsUndead; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index 505704bef51..76c3f04846e 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -145,13 +145,13 @@ public: { boss_lady_vashjAI (Creature* creature) : ScriptedAI(creature) { - Instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); Intro = false; JustCreated = true; creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // set it only once on Creature create (no need do intro if wiped) } - InstanceScript* Instance; + InstanceScript* instance; uint64 ShieldGeneratorChannel[4]; @@ -204,8 +204,8 @@ public: if (Unit* remo = Unit::GetUnit(*me, ShieldGeneratorChannel[i])) remo->setDeathState(JUST_DIED); - if (Instance) - Instance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED); + if (instance) + instance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED); ShieldGeneratorChannel[0] = 0; ShieldGeneratorChannel[1] = 0; ShieldGeneratorChannel[2] = 0; @@ -230,8 +230,8 @@ public: { DoScriptText(SAY_DEATH, me); - if (Instance) - Instance->SetData(DATA_LADYVASHJEVENT, DONE); + if (instance) + instance->SetData(DATA_LADYVASHJEVENT, DONE); } void StartEvent() @@ -240,13 +240,13 @@ public: Phase = 1; - if (Instance) - Instance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS); + if (instance) + instance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS); } void EnterCombat(Unit* who) { - if (Instance) + if (instance) { // remove old tainted cores to prevent cheating in phase 2 Map* map = me->GetMap(); @@ -517,7 +517,7 @@ public: if (CheckTimer <= diff) { // Start Phase 3 - if (Instance && Instance->GetData(DATA_CANSTARTPHASE3)) + if (instance && instance->GetData(DATA_CANSTARTPHASE3)) { // set life 50% me->SetHealth(me->CountPctFromMaxHealth(50)); @@ -555,10 +555,10 @@ public: { mob_enchanted_elementalAI(Creature* creature) : ScriptedAI(creature) { - Instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* Instance; + InstanceScript* instance; uint32 Move; uint32 Phase; float X, Y, Z; @@ -589,8 +589,8 @@ public: } } - if (Instance) - VashjGUID = Instance->GetData64(DATA_LADYVASHJ); + if (instance) + VashjGUID = instance->GetData64(DATA_LADYVASHJ); } void EnterCombat(Unit* /*who*/) {} @@ -599,7 +599,7 @@ public: void UpdateAI(const uint32 diff) { - if (!Instance) + if (!instance) return; if (!VashjGUID) @@ -649,10 +649,10 @@ public: { mob_tainted_elementalAI(Creature* creature) : ScriptedAI(creature) { - Instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* Instance; + InstanceScript* instance; uint32 PoisonBoltTimer; uint32 DespawnTimer; @@ -665,8 +665,8 @@ public: void JustDied(Unit* /*killer*/) { - if (Instance) - if (Creature* vashj = Unit::GetCreature((*me), Instance->GetData64(DATA_LADYVASHJ))) + if (instance) + if (Creature* vashj = Unit::GetCreature((*me), instance->GetData64(DATA_LADYVASHJ))) CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->EventTaintedElementalDeath(); } @@ -718,11 +718,11 @@ public: { mob_toxic_sporebatAI(Creature* creature) : ScriptedAI(creature) { - Instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); EnterEvadeMode(); } - InstanceScript* Instance; + InstanceScript* instance; uint32 MovementTimer; uint32 ToxicSporeTimer; @@ -780,10 +780,10 @@ public: // CheckTimer if (CheckTimer <= diff) { - if (Instance) + if (instance) { // check if vashj is death - Unit* Vashj = Unit::GetUnit((*me), Instance->GetData64(DATA_LADYVASHJ)); + Unit* Vashj = Unit::GetUnit((*me), instance->GetData64(DATA_LADYVASHJ)); if (!Vashj || (Vashj && !Vashj->isAlive()) || (Vashj && CAST_AI(boss_lady_vashj::boss_lady_vashjAI, CAST_CRE(Vashj)->AI())->Phase != 3)) { // remove @@ -814,10 +814,10 @@ public: { mob_shield_generator_channelAI(Creature* creature) : ScriptedAI(creature) { - Instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* Instance; + InstanceScript* instance; uint32 CheckTimer; bool Casted; @@ -834,12 +834,12 @@ public: void UpdateAI (const uint32 diff) { - if (!Instance) + if (!instance) return; if (CheckTimer <= diff) { - Unit* vashj = Unit::GetUnit((*me), Instance->GetData64(DATA_LADYVASHJ)); + Unit* vashj = Unit::GetUnit((*me), instance->GetData64(DATA_LADYVASHJ)); if (vashj && vashj->isAlive()) { diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp index 7b08b2a4853..8ed1f897f3c 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp @@ -80,10 +80,10 @@ public: { boss_the_lurker_belowAI(Creature* creature) : Scripted_NoMovementAI(creature), Summons(me) { - Instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* Instance; + InstanceScript* instance; SummonList Summons; bool Spawned; @@ -103,7 +103,7 @@ public: bool CheckCanStart()//check if players fished { - if (Instance && Instance->GetData(DATA_STRANGE_POOL) == NOT_STARTED) + if (instance && instance->GetData(DATA_STRANGE_POOL) == NOT_STARTED) return false; return true; } @@ -128,10 +128,10 @@ public: Summons.DespawnAll(); - if (Instance) + if (instance) { - Instance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED); - Instance->SetData(DATA_STRANGE_POOL, NOT_STARTED); + instance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED); + instance->SetData(DATA_STRANGE_POOL, NOT_STARTED); } DoCast(me, SPELL_SUBMERGE); // submerge anim me->SetVisible(false); // we start invis under water, submerged @@ -141,10 +141,10 @@ public: void JustDied(Unit* /*killer*/) { - if (Instance) + if (instance) { - Instance->SetData(DATA_THELURKERBELOWEVENT, DONE); - Instance->SetData(DATA_STRANGE_POOL, IN_PROGRESS); + instance->SetData(DATA_THELURKERBELOWEVENT, DONE); + instance->SetData(DATA_STRANGE_POOL, IN_PROGRESS); } Summons.DespawnAll(); @@ -152,8 +152,8 @@ public: void EnterCombat(Unit* who) { - if (Instance) - Instance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS); + if (instance) + instance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS); Scripted_NoMovementAI::EnterCombat(who); } From 20cd4c71ee6336610daab304959909b2f6397287 Mon Sep 17 00:00:00 2001 From: thomas33 Date: Wed, 14 Mar 2012 17:51:11 +0100 Subject: [PATCH 0167/1149] Core: more more cleanup --- .../game/AuctionHouse/AuctionHouseMgr.cpp | 20 +- .../game/AuctionHouse/AuctionHouseMgr.h | 2 +- .../game/Entities/Item/Container/Bag.cpp | 36 +- src/server/game/Entities/Item/Container/Bag.h | 2 +- src/server/game/Entities/Item/Item.cpp | 10 +- src/server/game/Entities/Player/Player.cpp | 946 +++++++++--------- src/server/game/Entities/Player/Player.h | 54 +- src/server/game/Groups/Group.cpp | 8 +- src/server/game/Guilds/Guild.cpp | 128 +-- src/server/game/Guilds/Guild.h | 22 +- .../game/Handlers/AuctionHouseHandler.cpp | 6 +- src/server/game/Handlers/ItemHandler.cpp | 124 +-- src/server/game/Handlers/LootHandler.cpp | 22 +- src/server/game/Handlers/SpellHandler.cpp | 38 +- src/server/game/Mails/Mail.cpp | 4 +- src/server/game/Scripting/ScriptMgr.cpp | 4 +- src/server/game/Scripting/ScriptMgr.h | 4 +- .../game/Spells/Auras/SpellAuraEffects.cpp | 18 +- src/server/game/Spells/Spell.cpp | 36 +- src/server/game/Spells/SpellEffects.cpp | 18 +- src/server/scripts/Commands/cs_npc.cpp | 12 +- .../boss_grand_champions.cpp | 6 +- .../trial_of_the_champion.cpp | 12 +- .../Outland/BlackTemple/illidari_council.cpp | 30 +- src/server/scripts/Spells/spell_item.cpp | 4 +- src/server/scripts/World/item_scripts.cpp | 34 +- src/server/scripts/World/npc_professions.cpp | 8 +- 27 files changed, 804 insertions(+), 804 deletions(-) diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index a2e958d680f..43f3ff50fd8 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -64,9 +64,9 @@ AuctionHouseObject* AuctionHouseMgr::GetAuctionsMap(uint32 factionTemplateId) return &mNeutralAuctions; } -uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* pItem, uint32 count) +uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* item, uint32 count) { - uint32 MSV = pItem->GetTemplate()->SellPrice; + uint32 MSV = item->GetTemplate()->SellPrice; if (MSV <= 0) return AH_MINIMUM_DEPOSIT; @@ -89,8 +89,8 @@ uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 //does not clear ram void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& trans) { - Item* pItem = GetAItem(auction->item_guidlow); - if (!pItem) + Item* item = GetAItem(auction->item_guidlow); + if (!item) return; uint32 bidder_accId = 0; @@ -127,7 +127,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& uint32 owner_accid = sObjectMgr->GetPlayerAccountIdByGUID(auction->owner); sLog->outCommand(bidder_accId, "GM %s (Account: %u) won item in auction: %s (Entry: %u Count: %u) and pay money: %u. Original owner %s (Account: %u)", - bidder_name.c_str(), bidder_accId, pItem->GetTemplate()->Name1.c_str(), pItem->GetEntry(), pItem->GetCount(), auction->bid, owner_name.c_str(), owner_accid); + bidder_name.c_str(), bidder_accId, item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount(), auction->bid, owner_name.c_str(), owner_accid); } } @@ -147,7 +147,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& // owner in `data` will set at mail receive and item extracting PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ITEM_OWNER); stmt->setUInt32(0, auction->bidder); - stmt->setUInt32(1, pItem->GetGUIDLow()); + stmt->setUInt32(1, item->GetGUIDLow()); trans->Append(stmt); if (bidder) @@ -158,7 +158,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& } MailDraft(msgAuctionWonSubject.str(), msgAuctionWonBody.str()) - .AddItem(pItem) + .AddItem(item) .SendMailTo(trans, MailReceiver(bidder, auction->bidder), auction, MAIL_CHECK_MASK_COPIED); } } @@ -234,8 +234,8 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry* auction, SQLTransa void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry* auction, SQLTransaction& trans) { //return an item in auction to its owner by mail - Item* pItem = GetAItem(auction->item_guidlow); - if (!pItem) + Item* item = GetAItem(auction->item_guidlow); + if (!item) return; uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER); @@ -251,7 +251,7 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry* auction, SQLTransacti owner->GetSession()->SendAuctionOwnerNotification(auction); MailDraft(subject.str(), "") // TODO: fix body - .AddItem(pItem) + .AddItem(item) .SendMailTo(trans, MailReceiver(owner, auction->owner), auction, MAIL_CHECK_MASK_COPIED, 0); } } diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.h b/src/server/game/AuctionHouse/AuctionHouseMgr.h index 190fbcc5107..d5432f7b00c 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.h +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.h @@ -154,7 +154,7 @@ class AuctionHouseMgr void SendAuctionOutbiddedMail(AuctionEntry* auction, uint32 newPrice, Player* newBidder, SQLTransaction& trans); void SendAuctionCancelledToBidderMail(AuctionEntry* auction, SQLTransaction& trans); - static uint32 GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* pItem, uint32 count); + static uint32 GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* item, uint32 count); static AuctionHouseEntry const* GetAuctionHouseEntry(uint32 factionTemplateId); public: diff --git a/src/server/game/Entities/Item/Container/Bag.cpp b/src/server/game/Entities/Item/Container/Bag.cpp index 4eede93bd37..1b9d5c12978 100755 --- a/src/server/game/Entities/Item/Container/Bag.cpp +++ b/src/server/game/Entities/Item/Container/Bag.cpp @@ -153,18 +153,18 @@ void Bag::RemoveItem(uint8 slot, bool /*update*/) SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (slot * 2), 0); } -void Bag::StoreItem(uint8 slot, Item* pItem, bool /*update*/) +void Bag::StoreItem(uint8 slot, Item* item, bool /*update*/) { ASSERT(slot < MAX_BAG_SIZE); - if (pItem && pItem->GetGUID() != this->GetGUID()) + if (item && item->GetGUID() != this->GetGUID()) { - m_bagslot[slot] = pItem; - SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (slot * 2), pItem->GetGUID()); - pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); - pItem->SetUInt64Value(ITEM_FIELD_OWNER, GetOwnerGUID()); - pItem->SetContainer(this); - pItem->SetSlot(slot); + m_bagslot[slot] = item; + SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (slot * 2), item->GetGUID()); + item->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); + item->SetUInt64Value(ITEM_FIELD_OWNER, GetOwnerGUID()); + item->SetContainer(this); + item->SetSlot(slot); } } @@ -189,22 +189,22 @@ bool Bag::IsEmpty() const uint32 Bag::GetItemCount(uint32 item, Item* eItem) const { - Item* pItem; + Item* item; uint32 count = 0; for (uint32 i=0; i < GetBagSize(); ++i) { - pItem = m_bagslot[i]; - if (pItem && pItem != eItem && pItem->GetEntry() == item) - count += pItem->GetCount(); + item = m_bagslot[i]; + if (item && item != eItem && item->GetEntry() == item) + count += item->GetCount(); } if (eItem && eItem->GetTemplate()->GemProperties) { for (uint32 i=0; i < GetBagSize(); ++i) { - pItem = m_bagslot[i]; - if (pItem && pItem != eItem && pItem->GetTemplate()->Socket[0].Color) - count += pItem->GetGemCountWithID(item); + item = m_bagslot[i]; + if (item && item != eItem && item->GetTemplate()->Socket[0].Color) + count += item->GetGemCountWithID(item); } } @@ -215,9 +215,9 @@ uint32 Bag::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem) { uint32 count = 0; for (uint32 i = 0; i < GetBagSize(); ++i) - if (Item* pItem = m_bagslot[i]) - if (pItem != skipItem) - if (ItemTemplate const* pProto = pItem->GetTemplate()) + if (Item* item = m_bagslot[i]) + if (item != skipItem) + if (ItemTemplate const* pProto = item->GetTemplate()) if (pProto->ItemLimitCategory == limitCategory) count += m_bagslot[i]->GetCount(); diff --git a/src/server/game/Entities/Item/Container/Bag.h b/src/server/game/Entities/Item/Container/Bag.h index 5a533d9cf57..79acd9ba4af 100755 --- a/src/server/game/Entities/Item/Container/Bag.h +++ b/src/server/game/Entities/Item/Container/Bag.h @@ -38,7 +38,7 @@ class Bag : public Item bool Create(uint32 guidlow, uint32 itemid, Player const* owner); void Clear(); - void StoreItem(uint8 slot, Item* pItem, bool update); + void StoreItem(uint8 slot, Item* item, bool update); void RemoveItem(uint8 slot, bool update); Item* GetItemByPos(uint8 slot) const; diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 90f6f4a217c..4e76ddfe0a8 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1021,14 +1021,14 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player) ASSERT(count !=0 && "pProto->Stackable == 0 but checked at loading already"); - Item* pItem = NewItemOrBag(pProto); - if (pItem->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), item, player)) + Item* item = NewItemOrBag(pProto); + if (item->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), item, player)) { - pItem->SetCount(count); - return pItem; + item->SetCount(count); + return item; } else - delete pItem; + delete item; } else ASSERT(false); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f0b974fa673..a1e8ddd95d1 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1160,31 +1160,31 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) // or ammo not equipped in special bag for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) { - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { uint16 eDest; // equip offhand weapon/shield if it attempt equipped before main-hand weapon - InventoryResult msg = CanEquipItem(NULL_SLOT, eDest, pItem, false); + InventoryResult msg = CanEquipItem(NULL_SLOT, eDest, item, false); if (msg == EQUIP_ERR_OK) { RemoveItem(INVENTORY_SLOT_BAG_0, i, true); - EquipItem(eDest, pItem, true); + EquipItem(eDest, item, true); } // move other items to more appropriate slots (ammo not equipped in special bag) else { ItemPosCountVec sDest; - msg = CanStoreItem(NULL_BAG, NULL_SLOT, sDest, pItem, false); + msg = CanStoreItem(NULL_BAG, NULL_SLOT, sDest, item, false); if (msg == EQUIP_ERR_OK) { RemoveItem(INVENTORY_SLOT_BAG_0, i, true); - pItem = StoreItem(sDest, pItem, true); + item = StoreItem(sDest, item, true); } // if this is ammo then use it - msg = CanUseAmmo(pItem->GetEntry()); + msg = CanUseAmmo(item->GetEntry()); if (msg == EQUIP_ERR_OK) - SetAmmo(pItem->GetEntry()); + SetAmmo(item->GetEntry()); } } } @@ -4854,15 +4854,15 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC continue; } - Item* pItem = NewItemOrBag(itemProto); - if (!pItem->LoadFromDB(item_guidlow, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER), fields, item_template)) + Item* item = NewItemOrBag(itemProto); + if (!item->LoadFromDB(item_guidlow, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER), fields, item_template)) { - pItem->FSetState(ITEM_REMOVED); - pItem->SaveToDB(trans); // it also deletes item object! + item->FSetState(ITEM_REMOVED); + item->SaveToDB(trans); // it also deletes item object! continue; } - draft.AddItem(pItem); + draft.AddItem(item); } while (resultItems->NextRow()); } @@ -5270,8 +5270,8 @@ Corpse* Player::GetCorpse() const void Player::DurabilityLossAll(double percent, bool inventory) { for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; i++) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - DurabilityLoss(pItem, percent); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + DurabilityLoss(item, percent); if (inventory) { @@ -5279,8 +5279,8 @@ void Player::DurabilityLossAll(double percent, bool inventory) // for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - DurabilityLoss(pItem, percent); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + DurabilityLoss(item, percent); // keys not have durability //for (int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++) @@ -5288,8 +5288,8 @@ void Player::DurabilityLossAll(double percent, bool inventory) for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) - if (Item* pItem = GetItemByPos(i, j)) - DurabilityLoss(pItem, percent); + if (Item* item = GetItemByPos(i, j)) + DurabilityLoss(item, percent); } } @@ -5314,8 +5314,8 @@ void Player::DurabilityLoss(Item* item, double percent) void Player::DurabilityPointsLossAll(int32 points, bool inventory) { for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; i++) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - DurabilityPointsLoss(pItem, points); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + DurabilityPointsLoss(item, points); if (inventory) { @@ -5323,8 +5323,8 @@ void Player::DurabilityPointsLossAll(int32 points, bool inventory) // for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - DurabilityPointsLoss(pItem, points); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + DurabilityPointsLoss(item, points); // keys not have durability //for (int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++) @@ -5332,8 +5332,8 @@ void Player::DurabilityPointsLossAll(int32 points, bool inventory) for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) - if (Item* pItem = GetItemByPos(i, j)) - DurabilityPointsLoss(pItem, points); + if (Item* item = GetItemByPos(i, j)) + DurabilityPointsLoss(item, points); } } @@ -5366,8 +5366,8 @@ void Player::DurabilityPointsLoss(Item* item, int32 points) void Player::DurabilityPointLossForEquipSlot(EquipmentSlots slot) { - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) - DurabilityPointsLoss(pItem, 1); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) + DurabilityPointsLoss(item, 1); } uint32 Player::DurabilityRepairAll(bool cost, float discountMod, bool guildBank) @@ -9916,13 +9916,13 @@ InventoryResult Player::CanUnequipItems(uint32 item, uint32 count) const InventoryResult res = EQUIP_ERR_OK; for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->GetEntry() == item) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->GetEntry() == item) { InventoryResult ires = CanUnequipItem(INVENTORY_SLOT_BAG_0 << 8 | i, false); if (ires == EQUIP_ERR_OK) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) return EQUIP_ERR_OK; } @@ -9931,19 +9931,19 @@ InventoryResult Player::CanUnequipItems(uint32 item, uint32 count) const } for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->GetEntry() == item) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->GetEntry() == item) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) return EQUIP_ERR_OK; } for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->GetEntry() == item) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->GetEntry() == item) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) return EQUIP_ERR_OK; } @@ -9951,10 +9951,10 @@ InventoryResult Player::CanUnequipItems(uint32 item, uint32 count) const for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); ++j) - if (Item* pItem = GetItemByPos(i, j)) - if (pItem->GetEntry() == item) + if (Item* item = GetItemByPos(i, j)) + if (item->GetEntry() == item) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) return EQUIP_ERR_OK; } @@ -9967,14 +9967,14 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const { uint32 count = 0; for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; i++) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem != skipItem && pItem->GetEntry() == item) - count += pItem->GetCount(); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item != skipItem && item->GetEntry() == item) + count += item->GetCount(); for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem != skipItem && pItem->GetEntry() == item) - count += pItem->GetCount(); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item != skipItem && item->GetEntry() == item) + count += item->GetCount(); for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) @@ -9982,16 +9982,16 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const if (skipItem && skipItem->GetTemplate()->GemProperties) for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem != skipItem && pItem->GetTemplate()->Socket[0].Color) - count += pItem->GetGemCountWithID(item); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item != skipItem && item->GetTemplate()->Socket[0].Color) + count += item->GetGemCountWithID(item); if (inBankAlso) { for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem != skipItem && pItem->GetEntry() == item) - count += pItem->GetCount(); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item != skipItem && item->GetEntry() == item) + count += item->GetCount(); for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) @@ -9999,9 +9999,9 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const if (skipItem && skipItem->GetTemplate()->GemProperties) for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem != skipItem && pItem->GetTemplate()->Socket[0].Color) - count += pItem->GetGemCountWithID(item); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item != skipItem && item->GetTemplate()->Socket[0].Color) + count += item->GetGemCountWithID(item); } return count; @@ -10011,29 +10011,29 @@ uint32 Player::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipIte { uint32 count = 0; for (int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem != skipItem) - if (ItemTemplate const* pProto = pItem->GetTemplate()) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item != skipItem) + if (ItemTemplate const* pProto = item->GetTemplate()) if (pProto->ItemLimitCategory == limitCategory) - count += pItem->GetCount(); + count += item->GetCount(); for (int i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem != skipItem) - if (ItemTemplate const* pProto = pItem->GetTemplate()) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item != skipItem) + if (ItemTemplate const* pProto = item->GetTemplate()) if (pProto->ItemLimitCategory == limitCategory) - count += pItem->GetCount(); + count += item->GetCount(); for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) count += pBag->GetItemCountWithLimitCategory(limitCategory, skipItem); for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem != skipItem) - if (ItemTemplate const* pProto = pItem->GetTemplate()) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item != skipItem) + if (ItemTemplate const* pProto = item->GetTemplate()) if (pProto->ItemLimitCategory == limitCategory) - count += pItem->GetCount(); + count += item->GetCount(); for (int i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) @@ -10045,33 +10045,33 @@ uint32 Player::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipIte Item* Player::GetItemByGuid(uint64 guid) const { for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->GetGUID() == guid) - return pItem; + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->GetGUID() == guid) + return item; for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->GetGUID() == guid) - return pItem; + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->GetGUID() == guid) + return item; for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->GetGUID() == guid) - return pItem; + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->GetGUID() == guid) + return item; for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); ++j) - if (Item* pItem = pBag->GetItemByPos(j)) - if (pItem->GetGUID() == guid) - return pItem; + if (Item* item = pBag->GetItemByPos(j)) + if (item->GetGUID() == guid) + return item; for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); ++j) - if (Item* pItem = pBag->GetItemByPos(j)) - if (pItem->GetGUID() == guid) - return pItem; + if (Item* item = pBag->GetItemByPos(j)) + if (item->GetGUID() == guid) + return item; return NULL; } @@ -10262,20 +10262,20 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const uint32 tempcount = 0; for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; i++) { - Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) + Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (item && item->GetEntry() == item && !item->IsInTrade()) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) return true; } } for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) { - Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) + Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (item && item->GetEntry() == item && !item->IsInTrade()) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) return true; } @@ -10286,10 +10286,10 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const { for (uint32 j = 0; j < pBag->GetBagSize(); j++) { - Item* pItem = GetItemByPos(i, j); - if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) + Item* item = GetItemByPos(i, j); + if (item && item->GetEntry() == item && !item->IsInTrade()) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) return true; } @@ -10301,10 +10301,10 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const { for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; i++) { - Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) + Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (item && item->GetEntry() == item && !item->IsInTrade()) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) return true; } @@ -10315,10 +10315,10 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const { for (uint32 j = 0; j < pBag->GetBagSize(); j++) { - Item* pItem = GetItemByPos(i, j); - if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) + Item* item = GetItemByPos(i, j); + if (item && item->GetEntry() == item && !item->IsInTrade()) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) return true; } @@ -10338,10 +10338,10 @@ bool Player::HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_ if (i == except_slot) continue; - Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem && pItem->GetEntry() == item) + Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (item && item->GetEntry() == item) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) return true; } @@ -10355,10 +10355,10 @@ bool Player::HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_ if (i == except_slot) continue; - Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem && pItem->GetTemplate()->Socket[0].Color) + Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (item && item->GetTemplate()->Socket[0].Color) { - tempcount += pItem->GetGemCountWithID(item); + tempcount += item->GetGemCountWithID(item); if (tempcount >= count) return true; } @@ -10376,24 +10376,24 @@ bool Player::HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 if (i == except_slot) continue; - Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (!pItem) + Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (!item) continue; - ItemTemplate const* pProto = pItem->GetTemplate(); + ItemTemplate const* pProto = item->GetTemplate(); if (!pProto) continue; if (pProto->ItemLimitCategory == limitCategory) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) return true; } - if (pProto->Socket[0].Color || pItem->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT)) + if (pProto->Socket[0].Color || item->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT)) { - tempcount += pItem->GetGemCountWithLimitCategory(limitCategory); + tempcount += item->GetGemCountWithLimitCategory(limitCategory); if (tempcount >= count) return true; } @@ -10402,7 +10402,7 @@ bool Player::HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 return false; } -InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count) const +InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* item, uint32* no_space_count) const { ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(entry); if (!pProto) @@ -10412,7 +10412,7 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; } - if (pItem && pItem->m_lootGenerated) + if (item && item->m_lootGenerated) return EQUIP_ERR_ALREADY_LOOTED; // no maximum @@ -10421,7 +10421,7 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item if (pProto->MaxCount > 0) { - uint32 curcount = GetItemCount(pProto->ItemId, true, pItem); + uint32 curcount = GetItemCount(pProto->ItemId, true, item); if (curcount + count > uint32(pProto->MaxCount)) { if (no_space_count) @@ -10443,7 +10443,7 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item if (limitEntry->mode == ITEM_LIMIT_CATEGORY_MODE_HAVE) { - uint32 curcount = GetItemCountWithLimitCategory(pProto->ItemLimitCategory, pItem); + uint32 curcount = GetItemCountWithLimitCategory(pProto->ItemLimitCategory, item); if (curcount + count > uint32(limitEntry->maxCount)) { if (no_space_count) @@ -10458,17 +10458,17 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item bool Player::HasItemTotemCategory(uint32 TotemCategory) const { - Item* pItem; + Item* item; for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) { - pItem = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem && IsTotemCategoryCompatiableWith(pItem->GetTemplate()->TotemCategory, TotemCategory)) + item = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, i); + if (item && IsTotemCategoryCompatiableWith(item->GetTemplate()->TotemCategory, TotemCategory)) return true; } for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) { - pItem = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem && IsTotemCategoryCompatiableWith(pItem->GetTemplate()->TotemCategory, TotemCategory)) + item = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, i); + if (item && IsTotemCategoryCompatiableWith(item->GetTemplate()->TotemCategory, TotemCategory)) return true; } for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) @@ -10477,8 +10477,8 @@ bool Player::HasItemTotemCategory(uint32 TotemCategory) const { for (uint32 j = 0; j < pBag->GetBagSize(); ++j) { - pItem = GetUseableItemByPos(i, j); - if (pItem && IsTotemCategoryCompatiableWith(pItem->GetTemplate()->TotemCategory, TotemCategory)) + item = GetUseableItemByPos(i, j); + if (item && IsTotemCategoryCompatiableWith(item->GetTemplate()->TotemCategory, TotemCategory)) return true; } } @@ -10681,7 +10681,7 @@ InventoryResult Player::CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 sl return EQUIP_ERR_OK; } -InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 entry, uint32 count, Item* pItem, bool swap, uint32* no_space_count) const +InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 entry, uint32 count, Item* item, bool swap, uint32* no_space_count) const { sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, entry, count); @@ -10693,17 +10693,17 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED :EQUIP_ERR_ITEM_NOT_FOUND; } - if (pItem) + if (item) { // item used - if (pItem->m_lootGenerated) + if (item->m_lootGenerated) { if (no_space_count) *no_space_count = count; return EQUIP_ERR_ALREADY_LOOTED; } - if (pItem->IsBindedNotWith(this)) + if (item->IsBindedNotWith(this)) { if (no_space_count) *no_space_count = count; @@ -10713,7 +10713,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des // check count of items (skip for auto move for same player from bank) uint32 no_similar_count = 0; // can't store this amount similar items - InventoryResult res = CanTakeMoreSimilarItems(entry, count, pItem, &no_similar_count); + InventoryResult res = CanTakeMoreSimilarItems(entry, count, item, &no_similar_count); if (res != EQUIP_ERR_OK) { if (count == no_similar_count) @@ -10728,7 +10728,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des // in specific slot if (bag != NULL_BAG && slot != NULL_SLOT) { - res = CanStoreItem_InSpecificSlot(bag, slot, dest, pProto, count, swap, pItem); + res = CanStoreItem_InSpecificSlot(bag, slot, dest, pProto, count, swap, item); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10757,7 +10757,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des { if (bag == INVENTORY_SLOT_BAG_0) // inventory { - res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, true, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, true, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10775,7 +10775,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; } - res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, true, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, true, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10796,9 +10796,9 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des else // equipped bag { // we need check 2 time (specialized/non_specialized), use NULL_BAG to prevent skipping bag - res = CanStoreItem_InBag(bag, dest, pProto, count, true, false, pItem, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, true, false, item, NULL_BAG, slot); if (res != EQUIP_ERR_OK) - res = CanStoreItem_InBag(bag, dest, pProto, count, true, true, pItem, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, true, true, item, NULL_BAG, slot); if (res != EQUIP_ERR_OK) { @@ -10826,7 +10826,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des if (pProto->BagFamily & BAG_FAMILY_MASK_KEYS) { uint32 keyringSize = GetMaxKeyringSize(); - res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, KEYRING_SLOT_START+keyringSize, dest, pProto, count, false, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, KEYRING_SLOT_START+keyringSize, dest, pProto, count, false, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10844,7 +10844,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; } - res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10864,7 +10864,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } else if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS) { - res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10883,7 +10883,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } } - res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10903,9 +10903,9 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } else // equipped bag { - res = CanStoreItem_InBag(bag, dest, pProto, count, false, false, pItem, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, false, false, item, NULL_BAG, slot); if (res != EQUIP_ERR_OK) - res = CanStoreItem_InBag(bag, dest, pProto, count, false, true, pItem, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, false, true, item, NULL_BAG, slot); if (res != EQUIP_ERR_OK) { @@ -10931,7 +10931,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des // search stack for merge to if (pProto->Stackable != 1) { - res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, true, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, true, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10949,7 +10949,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; } - res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, true, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, true, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10971,7 +10971,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des { for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, true, false, pItem, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, true, false, item, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -10989,7 +10989,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, true, true, pItem, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, true, true, item, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11011,7 +11011,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des if (pProto->BagFamily & BAG_FAMILY_MASK_KEYS) { uint32 keyringSize = GetMaxKeyringSize(); - res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, KEYRING_SLOT_START+keyringSize, dest, pProto, count, false, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, KEYRING_SLOT_START+keyringSize, dest, pProto, count, false, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -11031,7 +11031,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } else if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS) { - res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -11052,7 +11052,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, false, false, pItem, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, false, false, item, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11068,11 +11068,11 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } } - if (pItem && pItem->IsNotEmptyBag()) + if (item && item->IsNotEmptyBag()) return EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG; // search free slot - res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -11092,7 +11092,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, false, true, pItem, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, false, true, item, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11162,30 +11162,30 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const // check free space for all items for (int k = 0; k < count; ++k) { - Item* pItem = pItems[k]; + Item* item = pItems[k]; // no item - if (!pItem) continue; + if (!item) continue; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItems %i. item = %u, count = %u", k + 1, pItem->GetEntry(), pItem->GetCount()); - ItemTemplate const* pProto = pItem->GetTemplate(); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItems %i. item = %u, count = %u", k + 1, item->GetEntry(), item->GetCount()); + ItemTemplate const* pProto = item->GetTemplate(); // strange item if (!pProto) return EQUIP_ERR_ITEM_NOT_FOUND; // item used - if (pItem->m_lootGenerated) + if (item->m_lootGenerated) return EQUIP_ERR_ALREADY_LOOTED; // item it 'bind' - if (pItem->IsBindedNotWith(this)) + if (item->IsBindedNotWith(this)) return EQUIP_ERR_DONT_OWN_THAT_ITEM; ItemTemplate const* pBagProto; // item is 'one item only' - InventoryResult res = CanTakeMoreSimilarItems(pItem); + InventoryResult res = CanTakeMoreSimilarItems(item); if (res != EQUIP_ERR_OK) return res; @@ -11197,9 +11197,9 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const for (uint8 t = KEYRING_SLOT_START; t < KEYRING_SLOT_END; ++t) { pItem2 = GetItemByPos(INVENTORY_SLOT_BAG_0, t); - if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_keys[t-KEYRING_SLOT_START] + pItem->GetCount() <= pProto->GetMaxStackSize()) + if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_keys[t-KEYRING_SLOT_START] + item->GetCount() <= pProto->GetMaxStackSize()) { - inv_keys[t-KEYRING_SLOT_START] += pItem->GetCount(); + inv_keys[t-KEYRING_SLOT_START] += item->GetCount(); b_found = true; break; } @@ -11209,9 +11209,9 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const for (int t = CURRENCYTOKEN_SLOT_START; t < CURRENCYTOKEN_SLOT_END; ++t) { pItem2 = GetItemByPos(INVENTORY_SLOT_BAG_0, t); - if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_tokens[t-CURRENCYTOKEN_SLOT_START] + pItem->GetCount() <= pProto->GetMaxStackSize()) + if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_tokens[t-CURRENCYTOKEN_SLOT_START] + item->GetCount() <= pProto->GetMaxStackSize()) { - inv_tokens[t-CURRENCYTOKEN_SLOT_START] += pItem->GetCount(); + inv_tokens[t-CURRENCYTOKEN_SLOT_START] += item->GetCount(); b_found = true; break; } @@ -11221,9 +11221,9 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const for (int t = INVENTORY_SLOT_ITEM_START; t < INVENTORY_SLOT_ITEM_END; ++t) { pItem2 = GetItemByPos(INVENTORY_SLOT_BAG_0, t); - if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_slot_items[t-INVENTORY_SLOT_ITEM_START] + pItem->GetCount() <= pProto->GetMaxStackSize()) + if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_slot_items[t-INVENTORY_SLOT_ITEM_START] + item->GetCount() <= pProto->GetMaxStackSize()) { - inv_slot_items[t-INVENTORY_SLOT_ITEM_START] += pItem->GetCount(); + inv_slot_items[t-INVENTORY_SLOT_ITEM_START] += item->GetCount(); b_found = true; break; } @@ -11234,14 +11234,14 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const { if (Bag* bag = GetBagByPos(t)) { - if (ItemCanGoIntoBag(pItem->GetTemplate(), bag->GetTemplate())) + if (ItemCanGoIntoBag(item->GetTemplate(), bag->GetTemplate())) { for (uint32 j = 0; j < bag->GetBagSize(); j++) { pItem2 = GetItemByPos(t, j); - if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_bags[t-INVENTORY_SLOT_BAG_START][j] + pItem->GetCount() <= pProto->GetMaxStackSize()) + if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_bags[t-INVENTORY_SLOT_BAG_START][j] + item->GetCount() <= pProto->GetMaxStackSize()) { - inv_bags[t-INVENTORY_SLOT_BAG_START][j] += pItem->GetCount(); + inv_bags[t-INVENTORY_SLOT_BAG_START][j] += item->GetCount(); b_found = true; break; } @@ -11360,35 +11360,35 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const InventoryResult Player::CanEquipNewItem(uint8 slot, uint16 &dest, uint32 item, bool swap) const { dest = 0; - Item* pItem = Item::CreateItem(item, 1, this); - if (pItem) + Item* item = Item::CreateItem(item, 1, this); + if (item) { - InventoryResult result = CanEquipItem(slot, dest, pItem, swap); - delete pItem; + InventoryResult result = CanEquipItem(slot, dest, item, swap); + delete item; return result; } return EQUIP_ERR_ITEM_NOT_FOUND; } -InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool swap, bool not_loading) const +InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* item, bool swap, bool not_loading) const { dest = 0; - if (pItem) + if (item) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanEquipItem slot = %u, item = %u, count = %u", slot, pItem->GetEntry(), pItem->GetCount()); - ItemTemplate const* pProto = pItem->GetTemplate(); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanEquipItem slot = %u, item = %u, count = %u", slot, item->GetEntry(), item->GetCount()); + ItemTemplate const* pProto = item->GetTemplate(); if (pProto) { // item used - if (pItem->m_lootGenerated) + if (item->m_lootGenerated) return EQUIP_ERR_ALREADY_LOOTED; - if (pItem->IsBindedNotWith(this)) + if (item->IsBindedNotWith(this)) return EQUIP_ERR_DONT_OWN_THAT_ITEM; // check count of items (skip for auto move for same player from bank) - InventoryResult res = CanTakeMoreSimilarItems(pItem); + InventoryResult res = CanTakeMoreSimilarItems(item); if (res != EQUIP_ERR_OK) return res; @@ -11429,7 +11429,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool if (eslot == NULL_SLOT) return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED; - res = CanUseItem(pItem, not_loading); + res = CanUseItem(item, not_loading); if (res != EQUIP_ERR_OK) return res; @@ -11437,7 +11437,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool return EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE; // if swap ignore item (equipped also) - InventoryResult res2 = CanEquipUniqueItem(pItem, swap ? eslot : uint8(NULL_SLOT)); + InventoryResult res2 = CanEquipUniqueItem(item, swap ? eslot : uint8(NULL_SLOT)); if (res2 != EQUIP_ERR_OK) return res2; @@ -11445,7 +11445,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool if (pProto->Class == ITEM_CLASS_QUIVER) for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Item* pBag = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pBag != pItem) + if (pBag != item) if (ItemTemplate const* pBagProto = pBag->GetTemplate()) if (pBagProto->Class == pProto->Class && (!swap || pBag->GetSlot() != eslot)) return (pBagProto->SubClass == ITEM_SUBCLASS_AMMO_POUCH) @@ -11507,20 +11507,20 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const if (!IsEquipmentPos(pos) && !IsBagPos(pos)) return EQUIP_ERR_OK; - Item* pItem = GetItemByPos(pos); + Item* item = GetItemByPos(pos); // Applied only to existed equipped item - if (!pItem) + if (!item) return EQUIP_ERR_OK; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUnequipItem slot = %u, item = %u, count = %u", pos, pItem->GetEntry(), pItem->GetCount()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUnequipItem slot = %u, item = %u, count = %u", pos, item->GetEntry(), item->GetCount()); - ItemTemplate const* pProto = pItem->GetTemplate(); + ItemTemplate const* pProto = item->GetTemplate(); if (!pProto) return EQUIP_ERR_ITEM_NOT_FOUND; // item used - if (pItem->m_lootGenerated) + if (item->m_lootGenerated) return EQUIP_ERR_ALREADY_LOOTED; // do not allow unequipping gear except weapons, offhands, projectiles, relics in @@ -11536,42 +11536,42 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const return EQUIP_ERR_NOT_DURING_ARENA_MATCH; } - if (!swap && pItem->IsNotEmptyBag()) + if (!swap && item->IsNotEmptyBag()) return EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS; return EQUIP_ERR_OK; } -InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item* pItem, bool swap, bool not_loading) const +InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item* item, bool swap, bool not_loading) const { - if (!pItem) + if (!item) return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND; - uint32 count = pItem->GetCount(); + uint32 count = item->GetCount(); - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, pItem->GetEntry(), pItem->GetCount()); - ItemTemplate const* pProto = pItem->GetTemplate(); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, item->GetEntry(), item->GetCount()); + ItemTemplate const* pProto = item->GetTemplate(); if (!pProto) return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND; // item used - if (pItem->m_lootGenerated) + if (item->m_lootGenerated) return EQUIP_ERR_ALREADY_LOOTED; - if (pItem->IsBindedNotWith(this)) + if (item->IsBindedNotWith(this)) return EQUIP_ERR_DONT_OWN_THAT_ITEM; // Currency tokens are not supposed to be swapped out of their hidden bag - uint8 pItemslot = pItem->GetSlot(); + uint8 pItemslot = item->GetSlot(); if (pItemslot >= CURRENCYTOKEN_SLOT_START && pItemslot < CURRENCYTOKEN_SLOT_END) { sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to move token [guid: %u, entry: %u] out of the currency bag!", - GetName(), GetGUIDLow(), pItem->GetGUIDLow(), pProto->ItemId); + GetName(), GetGUIDLow(), item->GetGUIDLow(), pProto->ItemId); return EQUIP_ERR_ITEMS_CANT_BE_SWAPPED; } // check count of items (skip for auto move for same player from bank) - InventoryResult res = CanTakeMoreSimilarItems(pItem); + InventoryResult res = CanTakeMoreSimilarItems(item); if (res != EQUIP_ERR_OK) return res; @@ -11580,18 +11580,18 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest { if (slot >= BANK_SLOT_BAG_START && slot < BANK_SLOT_BAG_END) { - if (!pItem->IsBag()) + if (!item->IsBag()) return EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT; if (slot - BANK_SLOT_BAG_START >= GetBankBagSlotCount()) return EQUIP_ERR_MUST_PURCHASE_THAT_BAG_SLOT; - res = CanUseItem(pItem, not_loading); + res = CanUseItem(item, not_loading); if (res != EQUIP_ERR_OK) return res; } - res = CanStoreItem_InSpecificSlot(bag, slot, dest, pProto, count, swap, pItem); + res = CanStoreItem_InSpecificSlot(bag, slot, dest, pProto, count, swap, item); if (res != EQUIP_ERR_OK) return res; @@ -11604,7 +11604,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest // in specific bag if (bag != NULL_BAG) { - if (pItem->IsNotEmptyBag()) + if (item->IsNotEmptyBag()) return EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG; // search stack in bag for merge to @@ -11612,7 +11612,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest { if (bag == INVENTORY_SLOT_BAG_0) { - res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, true, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, true, item, bag, slot); if (res != EQUIP_ERR_OK) return res; @@ -11621,9 +11621,9 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest } else { - res = CanStoreItem_InBag(bag, dest, pProto, count, true, false, pItem, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, true, false, item, NULL_BAG, slot); if (res != EQUIP_ERR_OK) - res = CanStoreItem_InBag(bag, dest, pProto, count, true, true, pItem, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, true, true, item, NULL_BAG, slot); if (res != EQUIP_ERR_OK) return res; @@ -11636,7 +11636,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest // search free slot in bag if (bag == INVENTORY_SLOT_BAG_0) { - res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, false, item, bag, slot); if (res != EQUIP_ERR_OK) return res; @@ -11645,9 +11645,9 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest } else { - res = CanStoreItem_InBag(bag, dest, pProto, count, false, false, pItem, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, false, false, item, NULL_BAG, slot); if (res != EQUIP_ERR_OK) - res = CanStoreItem_InBag(bag, dest, pProto, count, false, true, pItem, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, false, true, item, NULL_BAG, slot); if (res != EQUIP_ERR_OK) return res; @@ -11663,7 +11663,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest if (pProto->Stackable != 1) { // in slots - res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, true, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, true, item, bag, slot); if (res != EQUIP_ERR_OK) return res; @@ -11675,7 +11675,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest { for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, true, false, pItem, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, true, false, item, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11686,7 +11686,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, true, true, pItem, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, true, true, item, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11700,7 +11700,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest { for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, false, false, pItem, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, false, false, item, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11710,7 +11710,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest } // search free space - res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, false, item, bag, slot); if (res != EQUIP_ERR_OK) return res; @@ -11719,7 +11719,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, false, true, pItem, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, false, true, item, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11729,11 +11729,11 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest return EQUIP_ERR_BANK_FULL; } -InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const +InventoryResult Player::CanUseItem(Item* item, bool not_loading) const { - if (pItem) + if (item) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseItem item = %u", pItem->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseItem item = %u", item->GetEntry()); if (!isAlive() && not_loading) return EQUIP_ERR_YOU_ARE_DEAD; @@ -11741,20 +11741,20 @@ InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const //if (isStunned()) // return EQUIP_ERR_YOU_ARE_STUNNED; - ItemTemplate const* pProto = pItem->GetTemplate(); + ItemTemplate const* pProto = item->GetTemplate(); if (pProto) { - if (pItem->IsBindedNotWith(this)) + if (item->IsBindedNotWith(this)) return EQUIP_ERR_DONT_OWN_THAT_ITEM; InventoryResult res = CanUseItem(pProto); if (res != EQUIP_ERR_OK) return res; - if (pItem->GetSkill() != 0) + if (item->GetSkill() != 0) { bool allowEquip = false; - uint32 itemSkill = pItem->GetSkill(); + uint32 itemSkill = item->GetSkill(); // Armor that is binded to account can "morph" from plate to mail, etc. if skill is not learned yet. if (pProto->Quality == ITEM_QUALITY_HEIRLOOM && pProto->Class == ITEM_CLASS_ARMOR && !HasSkill(itemSkill)) { @@ -11985,33 +11985,33 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update return StoreNewItem(dest, item, update, randomPropertyId, allowedLooters); } -// Return stored item (if stored to stack, it can diff. from pItem). And pItem ca be deleted in this case. +// Return stored item (if stored to stack, it can diff. from item). And item ca be deleted in this case. Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update, int32 randomPropertyId, AllowedLooterSet& allowedLooters) { uint32 count = 0; for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); ++itr) count += itr->count; - Item* pItem = Item::CreateItem(item, count, this); - if (pItem) + Item* item = Item::CreateItem(item, count, this); + if (item) { ItemAddedQuestCheck(item, count); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item, count); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, item, 1); if (randomPropertyId) - pItem->SetItemRandomProperties(randomPropertyId); - pItem = StoreItem(dest, pItem, update); + item->SetItemRandomProperties(randomPropertyId); + item = StoreItem(dest, item, update); - const ItemTemplate* proto = pItem->GetTemplate(); + const ItemTemplate* proto = item->GetTemplate(); for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) if (proto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE && proto->Spells[i].SpellId > 0) // On obtain trigger - CastSpell(this, proto->Spells[i].SpellId, true, pItem); + CastSpell(this, proto->Spells[i].SpellId, true, item); - if (allowedLooters.size() > 1 && pItem->GetTemplate()->GetMaxStackSize() == 1 && pItem->IsSoulBound()) + if (allowedLooters.size() > 1 && item->GetTemplate()->GetMaxStackSize() == 1 && item->IsSoulBound()) { - pItem->SetSoulboundTradeable(allowedLooters); - pItem->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, GetTotalPlayedTime()); - AddTradeableItem(pItem); + item->SetSoulboundTradeable(allowedLooters); + item->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, GetTotalPlayedTime()); + AddTradeableItem(item); // save data std::ostringstream ss; @@ -12021,20 +12021,20 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update ss << ' ' << *itr; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEM_BOP_TRADE); - stmt->setUInt32(0, pItem->GetGUIDLow()); + stmt->setUInt32(0, item->GetGUIDLow()); stmt->setString(1, ss.str()); CharacterDatabase.Execute(stmt); } } - return pItem; + return item; } -Item* Player::StoreItem(ItemPosCountVec const& dest, Item* pItem, bool update) +Item* Player::StoreItem(ItemPosCountVec const& dest, Item* item, bool update) { - if (!pItem) + if (!item) return NULL; - Item* lastItem = pItem; + Item* lastItem = item; for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end();) { uint16 pos = itr->pos; @@ -12044,75 +12044,75 @@ Item* Player::StoreItem(ItemPosCountVec const& dest, Item* pItem, bool update) if (itr == dest.end()) { - lastItem = _StoreItem(pos, pItem, count, false, update); + lastItem = _StoreItem(pos, item, count, false, update); break; } - lastItem = _StoreItem(pos, pItem, count, true, update); + lastItem = _StoreItem(pos, item, count, true, update); } return lastItem; } -// Return stored item (if stored to stack, it can diff. from pItem). And pItem ca be deleted in this case. -Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool update) +// Return stored item (if stored to stack, it can diff. from item). And item ca be deleted in this case. +Item* Player::_StoreItem(uint16 pos, Item* item, uint32 count, bool clone, bool update) { - if (!pItem) + if (!item) return NULL; uint8 bag = pos >> 8; uint8 slot = pos & 255; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: StoreItem bag = %u, slot = %u, item = %u, count = %u, guid = %u", bag, slot, pItem->GetEntry(), count, pItem->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: StoreItem bag = %u, slot = %u, item = %u, count = %u, guid = %u", bag, slot, item->GetEntry(), count, item->GetGUIDLow()); Item* pItem2 = GetItemByPos(bag, slot); if (!pItem2) { if (clone) - pItem = pItem->CloneItem(count, this); + item = item->CloneItem(count, this); else - pItem->SetCount(count); + item->SetCount(count); - if (!pItem) + if (!item) return NULL; - if (pItem->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || - pItem->GetTemplate()->Bonding == BIND_QUEST_ITEM || - (pItem->GetTemplate()->Bonding == BIND_WHEN_EQUIPED && IsBagPos(pos))) - pItem->SetBinding(true); + if (item->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || + item->GetTemplate()->Bonding == BIND_QUEST_ITEM || + (item->GetTemplate()->Bonding == BIND_WHEN_EQUIPED && IsBagPos(pos))) + item->SetBinding(true); Bag* pBag = (bag == INVENTORY_SLOT_BAG_0) ? NULL : GetBagByPos(bag); if (!pBag) { - m_items[slot] = pItem; - SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), pItem->GetGUID()); - pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); - pItem->SetUInt64Value(ITEM_FIELD_OWNER, GetGUID()); + m_items[slot] = item; + SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), item->GetGUID()); + item->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); + item->SetUInt64Value(ITEM_FIELD_OWNER, GetGUID()); - pItem->SetSlot(slot); - pItem->SetContainer(NULL); + item->SetSlot(slot); + item->SetContainer(NULL); // need update known currency if (slot >= CURRENCYTOKEN_SLOT_START && slot < CURRENCYTOKEN_SLOT_END) - AddKnownCurrency(pItem->GetEntry()); + AddKnownCurrency(item->GetEntry()); } else - pBag->StoreItem(slot, pItem, update); + pBag->StoreItem(slot, item, update); if (IsInWorld() && update) { - pItem->AddToWorld(); - pItem->SendUpdateToPlayer(this); + item->AddToWorld(); + item->SendUpdateToPlayer(this); } - pItem->SetState(ITEM_CHANGED, this); + item->SetState(ITEM_CHANGED, this); if (pBag) pBag->SetState(ITEM_CHANGED, this); - AddEnchantmentDurations(pItem); - AddItemDurations(pItem); + AddEnchantmentDurations(item); + AddItemDurations(item); - return pItem; + return item; } else { @@ -12130,18 +12130,18 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool // delete item (it not in any slot currently) if (IsInWorld() && update) { - pItem->RemoveFromWorld(); - pItem->DestroyForPlayer(this); + item->RemoveFromWorld(); + item->DestroyForPlayer(this); } - RemoveEnchantmentDurations(pItem); - RemoveItemDurations(pItem); + RemoveEnchantmentDurations(item); + RemoveItemDurations(item); - pItem->SetOwnerGUID(GetGUID()); // prevent error at next SetState in case trade/mail/buy from vendor - pItem->SetNotRefundable(this); - pItem->ClearSoulboundTradeable(this); - RemoveTradeableItem(pItem); - pItem->SetState(ITEM_REMOVED, this); + item->SetOwnerGUID(GetGUID()); // prevent error at next SetState in case trade/mail/buy from vendor + item->SetNotRefundable(this); + item->ClearSoulboundTradeable(this); + RemoveTradeableItem(item); + item->SetState(ITEM_REMOVED, this); } AddEnchantmentDurations(pItem2); @@ -12154,20 +12154,20 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool Item* Player::EquipNewItem(uint16 pos, uint32 item, bool update) { - if (Item* pItem = Item::CreateItem(item, 1, this)) + if (Item* item = Item::CreateItem(item, 1, this)) { ItemAddedQuestCheck(item, 1); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item, 1); - return EquipItem(pos, pItem, update); + return EquipItem(pos, item, update); } return NULL; } -Item* Player::EquipItem(uint16 pos, Item* pItem, bool update) +Item* Player::EquipItem(uint16 pos, Item* item, bool update) { - AddEnchantmentDurations(pItem); - AddItemDurations(pItem); + AddEnchantmentDurations(item); + AddItemDurations(item); uint8 bag = pos >> 8; uint8 slot = pos & 255; @@ -12176,17 +12176,17 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update) if (!pItem2) { - VisualizeItem(slot, pItem); + VisualizeItem(slot, item); if (isAlive()) { - ItemTemplate const* pProto = pItem->GetTemplate(); + ItemTemplate const* pProto = item->GetTemplate(); // item set bonuses applied only at equip and removed at unequip, and still active for broken items if (pProto && pProto->ItemSet) - AddItemsSetItem(this, pItem); + AddItemsSetItem(this, item); - _ApplyItemMods(pItem, slot, true); + _ApplyItemMods(item, slot, true); if (pProto && isInCombat() && (pProto->Class == ITEM_CLASS_WEAPON || pProto->InventoryType == INVTYPE_RELIC) && m_weaponChangeTimer == 0) { @@ -12213,11 +12213,11 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update) if (IsInWorld() && update) { - pItem->AddToWorld(); - pItem->SendUpdateToPlayer(this); + item->AddToWorld(); + item->SendUpdateToPlayer(this); } - ApplyEquipCooldown(pItem); + ApplyEquipCooldown(item); // update expertise and armor penetration - passive auras may need it @@ -12239,26 +12239,26 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update) } else { - pItem2->SetCount(pItem2->GetCount() + pItem->GetCount()); + pItem2->SetCount(pItem2->GetCount() + item->GetCount()); if (IsInWorld() && update) pItem2->SendUpdateToPlayer(this); // delete item (it not in any slot currently) - //pItem->DeleteFromDB(); + //item->DeleteFromDB(); if (IsInWorld() && update) { - pItem->RemoveFromWorld(); - pItem->DestroyForPlayer(this); + item->RemoveFromWorld(); + item->DestroyForPlayer(this); } - RemoveEnchantmentDurations(pItem); - RemoveItemDurations(pItem); + RemoveEnchantmentDurations(item); + RemoveItemDurations(item); - pItem->SetOwnerGUID(GetGUID()); // prevent error at next SetState in case trade/mail/buy from vendor - pItem->SetNotRefundable(this); - pItem->ClearSoulboundTradeable(this); - RemoveTradeableItem(pItem); - pItem->SetState(ITEM_REMOVED, this); + item->SetOwnerGUID(GetGUID()); // prevent error at next SetState in case trade/mail/buy from vendor + item->SetNotRefundable(this); + item->ClearSoulboundTradeable(this); + RemoveTradeableItem(item); + item->SetState(ITEM_REMOVED, this); pItem2->SetState(ITEM_CHANGED, this); ApplyEquipCooldown(pItem2); @@ -12267,40 +12267,40 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update) } // only for full equip instead adding to stack - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry()); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, pItem->GetEntry(), slot); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, item->GetEntry()); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, item->GetEntry(), slot); - return pItem; + return item; } -void Player::QuickEquipItem(uint16 pos, Item* pItem) +void Player::QuickEquipItem(uint16 pos, Item* item) { - if (pItem) + if (item) { - AddEnchantmentDurations(pItem); - AddItemDurations(pItem); + AddEnchantmentDurations(item); + AddItemDurations(item); uint8 slot = pos & 255; - VisualizeItem(slot, pItem); + VisualizeItem(slot, item); if (IsInWorld()) { - pItem->AddToWorld(); - pItem->SendUpdateToPlayer(this); + item->AddToWorld(); + item->SendUpdateToPlayer(this); } - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry()); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, pItem->GetEntry(), slot); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, item->GetEntry()); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, item->GetEntry(), slot); } } -void Player::SetVisibleItemSlot(uint8 slot, Item* pItem) +void Player::SetVisibleItemSlot(uint8 slot, Item* item) { - if (pItem) + if (item) { - SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2), pItem->GetEntry()); - SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 0, pItem->GetEnchantmentId(PERM_ENCHANTMENT_SLOT)); - SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 1, pItem->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT)); + SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2), item->GetEntry()); + SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 0, item->GetEnchantmentId(PERM_ENCHANTMENT_SLOT)); + SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 1, item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT)); } else { @@ -12309,28 +12309,28 @@ void Player::SetVisibleItemSlot(uint8 slot, Item* pItem) } } -void Player::VisualizeItem(uint8 slot, Item* pItem) +void Player::VisualizeItem(uint8 slot, Item* item) { - if (!pItem) + if (!item) return; // check also BIND_WHEN_PICKED_UP and BIND_QUEST_ITEM for .additem or .additemset case by GM (not binded at adding to inventory) - if (pItem->GetTemplate()->Bonding == BIND_WHEN_EQUIPED || pItem->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || pItem->GetTemplate()->Bonding == BIND_QUEST_ITEM) - pItem->SetBinding(true); + if (item->GetTemplate()->Bonding == BIND_WHEN_EQUIPED || item->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || item->GetTemplate()->Bonding == BIND_QUEST_ITEM) + item->SetBinding(true); - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: EquipItem slot = %u, item = %u", slot, pItem->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: EquipItem slot = %u, item = %u", slot, item->GetEntry()); - m_items[slot] = pItem; - SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), pItem->GetGUID()); - pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); - pItem->SetUInt64Value(ITEM_FIELD_OWNER, GetGUID()); - pItem->SetSlot(slot); - pItem->SetContainer(NULL); + m_items[slot] = item; + SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), item->GetGUID()); + item->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); + item->SetUInt64Value(ITEM_FIELD_OWNER, GetGUID()); + item->SetSlot(slot); + item->SetContainer(NULL); if (slot < EQUIPMENT_SLOT_END) - SetVisibleItemSlot(slot, pItem); + SetVisibleItemSlot(slot, item); - pItem->SetState(ITEM_CHANGED, this); + item->SetState(ITEM_CHANGED, this); } void Player::RemoveItem(uint8 bag, uint8 slot, bool update) @@ -12340,44 +12340,44 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update) // note2: if removeitem is to be used for delinking // the item must be removed from the player's updatequeue - Item* pItem = GetItemByPos(bag, slot); - if (pItem) + Item* item = GetItemByPos(bag, slot); + if (item) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItem bag = %u, slot = %u, item = %u", bag, slot, item->GetEntry()); - RemoveEnchantmentDurations(pItem); - RemoveItemDurations(pItem); - RemoveTradeableItem(pItem); + RemoveEnchantmentDurations(item); + RemoveItemDurations(item); + RemoveTradeableItem(item); if (bag == INVENTORY_SLOT_BAG_0) { if (slot < INVENTORY_SLOT_BAG_END) { - ItemTemplate const* pProto = pItem->GetTemplate(); + ItemTemplate const* pProto = item->GetTemplate(); // item set bonuses applied only at equip and removed at unequip, and still active for broken items if (pProto && pProto->ItemSet) RemoveItemsSetItem(this, pProto); - _ApplyItemMods(pItem, slot, false); + _ApplyItemMods(item, slot, false); // remove item dependent auras and casts (only weapon and armor slots) if (slot < EQUIPMENT_SLOT_END) { - RemoveItemDependentAurasAndCasts(pItem); + RemoveItemDependentAurasAndCasts(item); // remove held enchantments, update expertise if (slot == EQUIPMENT_SLOT_MAINHAND) { - if (pItem->GetItemSuffixFactor()) + if (item->GetItemSuffixFactor()) { - pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_3); - pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_4); + item->ClearEnchantment(PROP_ENCHANTMENT_SLOT_3); + item->ClearEnchantment(PROP_ENCHANTMENT_SLOT_4); } else { - pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_0); - pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_1); + item->ClearEnchantment(PROP_ENCHANTMENT_SLOT_0); + item->ClearEnchantment(PROP_ENCHANTMENT_SLOT_1); } UpdateExpertise(BASE_ATTACK); @@ -12406,11 +12406,11 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update) else if (Bag* pBag = GetBagByPos(bag)) pBag->RemoveItem(slot, update); - pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); - // pItem->SetUInt64Value(ITEM_FIELD_OWNER, 0); not clear owner at remove (it will be set at store). This used in mail and auction code - pItem->SetSlot(NULL_SLOT); + item->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); + // item->SetUInt64Value(ITEM_FIELD_OWNER, 0); not clear owner at remove (it will be set at store). This used in mail and auction code + item->SetSlot(NULL_SLOT); if (IsInWorld() && update) - pItem->SendUpdateToPlayer(this); + item->SendUpdateToPlayer(this); } } @@ -12432,17 +12432,17 @@ void Player::MoveItemFromInventory(uint8 bag, uint8 slot, bool update) } // Common operation need to add item from inventory without delete in trade, guild bank, mail.... -void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool update, bool in_characterInventoryDB) +void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* item, bool update, bool in_characterInventoryDB) { // update quest counters - ItemAddedQuestCheck(pItem->GetEntry(), pItem->GetCount()); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, pItem->GetEntry(), pItem->GetCount()); + ItemAddedQuestCheck(item->GetEntry(), item->GetCount()); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item->GetEntry(), item->GetCount()); // store item - Item* pLastItem = StoreItem(dest, pItem, update); + Item* pLastItem = StoreItem(dest, item, update); - // only set if not merged to existed stack (pItem can be deleted already but we can compare pointers any way) - if (pLastItem == pItem) + // only set if not merged to existed stack (item can be deleted already but we can compare pointers any way) + if (pLastItem == item) { // update owner for last item (this can be original item with wrong owner if (pLastItem->GetOwnerGUID() != GetGUID()) @@ -12459,38 +12459,38 @@ void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool void Player::DestroyItem(uint8 bag, uint8 slot, bool update) { - Item* pItem = GetItemByPos(bag, slot); - if (pItem) + Item* item = GetItemByPos(bag, slot); + if (item) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, item->GetEntry()); // Also remove all contained items if the item is a bag. // This if () prevents item saving crashes if the condition for a bag to be empty before being destroyed was bypassed somehow. - if (pItem->IsNotEmptyBag()) + if (item->IsNotEmptyBag()) for (uint8 i = 0; i < MAX_BAG_SIZE; ++i) DestroyItem(slot, i, update); - if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) + if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT); - stmt->setUInt32(0, pItem->GetGUIDLow()); + stmt->setUInt32(0, item->GetGUIDLow()); CharacterDatabase.Execute(stmt); } - RemoveEnchantmentDurations(pItem); - RemoveItemDurations(pItem); + RemoveEnchantmentDurations(item); + RemoveItemDurations(item); - pItem->SetNotRefundable(this); - pItem->ClearSoulboundTradeable(this); - RemoveTradeableItem(pItem); + item->SetNotRefundable(this); + item->ClearSoulboundTradeable(this); + RemoveTradeableItem(item); - const ItemTemplate* proto = pItem->GetTemplate(); + const ItemTemplate* proto = item->GetTemplate(); for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) if (proto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE && proto->Spells[i].SpellId > 0) // On obtain trigger RemoveAurasDueToSpell(proto->Spells[i].SpellId); - ItemRemovedQuestCheck(pItem->GetEntry(), pItem->GetCount()); + ItemRemovedQuestCheck(item->GetEntry(), item->GetCount()); if (bag == INVENTORY_SLOT_BAG_0) { @@ -12499,19 +12499,19 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) // equipment and equipped bags can have applied bonuses if (slot < INVENTORY_SLOT_BAG_END) { - ItemTemplate const* pProto = pItem->GetTemplate(); + ItemTemplate const* pProto = item->GetTemplate(); // item set bonuses applied only at equip and removed at unequip, and still active for broken items if (pProto && pProto->ItemSet) RemoveItemsSetItem(this, pProto); - _ApplyItemMods(pItem, slot, false); + _ApplyItemMods(item, slot, false); } if (slot < EQUIPMENT_SLOT_END) { // remove item dependent auras and casts (only weapon and armor slots) - RemoveItemDependentAurasAndCasts(pItem); + RemoveItemDependentAurasAndCasts(item); // update expertise and armor penetration - passive auras may need it switch (slot) @@ -12540,14 +12540,14 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) if (IsInWorld() && update) { - pItem->RemoveFromWorld(); - pItem->DestroyForPlayer(this); + item->RemoveFromWorld(); + item->DestroyForPlayer(this); } - //pItem->SetOwnerGUID(0); - pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); - pItem->SetSlot(NULL_SLOT); - pItem->SetState(ITEM_REMOVED, this); + //item->SetOwnerGUID(0); + item->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); + item->SetSlot(NULL_SLOT); + item->SetState(ITEM_REMOVED, this); } } @@ -12559,14 +12559,14 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i) { - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { - if (pItem->GetEntry() == item && !pItem->IsInTrade()) + if (item->GetEntry() == item && !item->IsInTrade()) { - if (pItem->GetCount() + remcount <= count) + if (item->GetCount() + remcount <= count) { // all items in inventory can unequipped - remcount += pItem->GetCount(); + remcount += item->GetCount(); DestroyItem(INVENTORY_SLOT_BAG_0, i, update); if (remcount >= count) @@ -12574,11 +12574,11 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ } else { - ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount); - pItem->SetCount(pItem->GetCount() - count + remcount); + ItemRemovedQuestCheck(item->GetEntry(), count - remcount); + item->SetCount(item->GetCount() - count + remcount); if (IsInWorld() & update) - pItem->SendUpdateToPlayer(this); - pItem->SetState(ITEM_CHANGED, this); + item->SendUpdateToPlayer(this); + item->SetState(ITEM_CHANGED, this); return; } } @@ -12587,14 +12587,14 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) { - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { - if (pItem->GetEntry() == item && !pItem->IsInTrade()) + if (item->GetEntry() == item && !item->IsInTrade()) { - if (pItem->GetCount() + remcount <= count) + if (item->GetCount() + remcount <= count) { // all keys can be unequipped - remcount += pItem->GetCount(); + remcount += item->GetCount(); DestroyItem(INVENTORY_SLOT_BAG_0, i, update); if (remcount >= count) @@ -12602,11 +12602,11 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ } else { - ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount); - pItem->SetCount(pItem->GetCount() - count + remcount); + ItemRemovedQuestCheck(item->GetEntry(), count - remcount); + item->SetCount(item->GetCount() - count + remcount); if (IsInWorld() & update) - pItem->SendUpdateToPlayer(this); - pItem->SetState(ITEM_CHANGED, this); + item->SendUpdateToPlayer(this); + item->SetState(ITEM_CHANGED, this); return; } } @@ -12620,14 +12620,14 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ { for (uint32 j = 0; j < pBag->GetBagSize(); j++) { - if (Item* pItem = pBag->GetItemByPos(j)) + if (Item* item = pBag->GetItemByPos(j)) { - if (pItem->GetEntry() == item && !pItem->IsInTrade()) + if (item->GetEntry() == item && !item->IsInTrade()) { // all items in bags can be unequipped - if (pItem->GetCount() + remcount <= count) + if (item->GetCount() + remcount <= count) { - remcount += pItem->GetCount(); + remcount += item->GetCount(); DestroyItem(i, j, update); if (remcount >= count) @@ -12635,11 +12635,11 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ } else { - ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount); - pItem->SetCount(pItem->GetCount() - count + remcount); + ItemRemovedQuestCheck(item->GetEntry(), count - remcount); + item->SetCount(item->GetCount() - count + remcount); if (IsInWorld() && update) - pItem->SendUpdateToPlayer(this); - pItem->SetState(ITEM_CHANGED, this); + item->SendUpdateToPlayer(this); + item->SetState(ITEM_CHANGED, this); return; } } @@ -12651,15 +12651,15 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ // in equipment and bag list for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++) { - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { - if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) + if (item && item->GetEntry() == item && !item->IsInTrade()) { - if (pItem->GetCount() + remcount <= count) + if (item->GetCount() + remcount <= count) { if (!unequip_check || CanUnequipItem(INVENTORY_SLOT_BAG_0 << 8 | i, false) == EQUIP_ERR_OK) { - remcount += pItem->GetCount(); + remcount += item->GetCount(); DestroyItem(INVENTORY_SLOT_BAG_0, i, update); if (remcount >= count) @@ -12668,11 +12668,11 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ } else { - ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount); - pItem->SetCount(pItem->GetCount() - count + remcount); + ItemRemovedQuestCheck(item->GetEntry(), count - remcount); + item->SetCount(item->GetCount() - count + remcount); if (IsInWorld() & update) - pItem->SendUpdateToPlayer(this); - pItem->SetState(ITEM_CHANGED, this); + item->SendUpdateToPlayer(this); + item->SetState(ITEM_CHANGED, this); return; } } @@ -12686,27 +12686,27 @@ void Player::DestroyZoneLimitedItem(bool update, uint32 new_zone) // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) DestroyItem(INVENTORY_SLOT_BAG_0, i, update); for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) DestroyItem(INVENTORY_SLOT_BAG_0, i, update); // in inventory bags for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) - if (Item* pItem = pBag->GetItemByPos(j)) - if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) + if (Item* item = pBag->GetItemByPos(j)) + if (item->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) DestroyItem(i, j, update); // in equipment and bag list for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) DestroyItem(INVENTORY_SLOT_BAG_0, i, update); } @@ -12718,22 +12718,22 @@ void Player::DestroyConjuredItems(bool update) // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->IsConjuredConsumable()) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->IsConjuredConsumable()) DestroyItem(INVENTORY_SLOT_BAG_0, i, update); // in inventory bags for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) - if (Item* pItem = pBag->GetItemByPos(j)) - if (pItem->IsConjuredConsumable()) + if (Item* item = pBag->GetItemByPos(j)) + if (item->IsConjuredConsumable()) DestroyItem(i, j, update); // in equipment and bag list for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->IsConjuredConsumable()) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->IsConjuredConsumable()) DestroyItem(INVENTORY_SLOT_BAG_0, i, update); } @@ -12741,46 +12741,46 @@ Item* Player::GetItemByEntry(uint32 entry) const { // in inventory for (int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->GetEntry() == entry) - return pItem; + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->GetEntry() == entry) + return item; for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); ++j) - if (Item* pItem = pBag->GetItemByPos(j)) - if (pItem->GetEntry() == entry) - return pItem; + if (Item* item = pBag->GetItemByPos(j)) + if (item->GetEntry() == entry) + return item; for (int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->GetEntry() == entry) - return pItem; + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->GetEntry() == entry) + return item; return NULL; } -void Player::DestroyItemCount(Item* pItem, uint32 &count, bool update) +void Player::DestroyItemCount(Item* item, uint32 &count, bool update) { - if (!pItem) + if (!item) return; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", pItem->GetGUIDLow(), pItem->GetEntry(), count); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", item->GetGUIDLow(), item->GetEntry(), count); - if (pItem->GetCount() <= count) + if (item->GetCount() <= count) { - count -= pItem->GetCount(); + count -= item->GetCount(); - DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), update); + DestroyItem(item->GetBagSlot(), item->GetSlot(), update); } else { - ItemRemovedQuestCheck(pItem->GetEntry(), count); - pItem->SetCount(pItem->GetCount() - count); + ItemRemovedQuestCheck(item->GetEntry(), count); + item->SetCount(item->GetCount() - count); count = 0; if (IsInWorld() & update) - pItem->SendUpdateToPlayer(this); - pItem->SetState(ITEM_CHANGED, this); + item->SendUpdateToPlayer(this); + item->SetState(ITEM_CHANGED, this); } } @@ -13255,9 +13255,9 @@ void Player::SwapItem(uint16 src, uint16 dst) AutoUnequipOffhandIfNeed(); } -void Player::AddItemToBuyBackSlot(Item* pItem) +void Player::AddItemToBuyBackSlot(Item* item) { - if (pItem) + if (item) { uint32 slot = m_currentBuybackSlot; // if current back slot non-empty search oldest or free @@ -13289,16 +13289,16 @@ void Player::AddItemToBuyBackSlot(Item* pItem) } RemoveItemFromBuyBackSlot(slot, true); - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", pItem->GetEntry(), slot); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", item->GetEntry(), slot); - m_items[slot] = pItem; + m_items[slot] = item; time_t base = time(NULL); uint32 etime = uint32(base - m_logintime + (30 * 3600)); uint32 eslot = slot - BUYBACK_SLOT_START; - SetUInt64Value(PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), pItem->GetGUID()); - if (ItemTemplate const* proto = pItem->GetTemplate()) - SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, proto->SellPrice * pItem->GetCount()); + SetUInt64Value(PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), item->GetGUID()); + if (ItemTemplate const* proto = item->GetTemplate()) + SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, proto->SellPrice * item->GetCount()); else SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, 0); SetUInt32Value(PLAYER_FIELD_BUYBACK_TIMESTAMP_1 + eslot, (uint32)etime); @@ -13322,12 +13322,12 @@ void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItemFromBuyBackSlot slot = %u", slot); if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END) { - Item* pItem = m_items[slot]; - if (pItem) + Item* item = m_items[slot]; + if (item) { - pItem->RemoveFromWorld(); + item->RemoveFromWorld(); if (del) - pItem->SetState(ITEM_REMOVED, this); + item->SetState(ITEM_REMOVED, this); } m_items[slot] = NULL; @@ -13343,7 +13343,7 @@ void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del) } } -void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint32 itemid) +void Player::SendEquipError(InventoryResult msg, Item* item, Item* pItem2, uint32 itemid) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg); WorldPacket data(SMSG_INVENTORY_CHANGE_FAILURE, (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I ? 22 : 18)); @@ -13351,7 +13351,7 @@ void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint if (msg != EQUIP_ERR_OK) { - data << uint64(pItem ? pItem->GetGUID() : 0); + data << uint64(item ? item->GetGUID() : 0); data << uint64(pItem2 ? pItem2->GetGUID() : 0); data << uint8(0); // bag type subclass, used with EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM and EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG2 @@ -13360,7 +13360,7 @@ void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint case EQUIP_ERR_CANT_EQUIP_LEVEL_I: case EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW: { - ItemTemplate const* proto = pItem ? pItem->GetTemplate() : sObjectMgr->GetItemTemplate(itemid); + ItemTemplate const* proto = item ? item->GetTemplate() : sObjectMgr->GetItemTemplate(itemid); data << uint32(proto ? proto->RequiredLevel : 0); break; } @@ -13375,7 +13375,7 @@ void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED: case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED: { - ItemTemplate const* proto = pItem ? pItem->GetTemplate() : sObjectMgr->GetItemTemplate(itemid); + ItemTemplate const* proto = item ? item->GetTemplate() : sObjectMgr->GetItemTemplate(itemid); data << uint32(proto ? proto->ItemLimitCategory : 0); break; } @@ -13565,17 +13565,17 @@ void Player::RemoveArenaEnchantments(EnchantmentSlot slot) // NOTE: no need to remove these from stats, since these aren't equipped // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->GetEnchantmentId(slot)) - pItem->ClearEnchantment(slot); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->GetEnchantmentId(slot)) + item->ClearEnchantment(slot); // in inventory bags for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) - if (Item* pItem = pBag->GetItemByPos(j)) - if (pItem->GetEnchantmentId(slot)) - pItem->ClearEnchantment(slot); + if (Item* item = pBag->GetItemByPos(j)) + if (item->GetEnchantmentId(slot)) + item->ClearEnchantment(slot); } // duration == 0 will remove item enchant @@ -21217,14 +21217,14 @@ void Player::CorrectMetaGemEnchants(uint8 exceptslot, bool apply) if (slot == exceptslot) continue; - Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, slot); + Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, slot); - if (!pItem || !pItem->GetTemplate()->Socket[0].Color) + if (!item || !item->GetTemplate()->Socket[0].Color) continue; for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot) { - uint32 enchant_id = pItem->GetEnchantmentId(EnchantmentSlot(enchant_slot)); + uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(enchant_slot)); if (!enchant_id) continue; @@ -21242,7 +21242,7 @@ void Player::CorrectMetaGemEnchants(uint8 exceptslot, bool apply) { // ignore item gem conditions //if state changed, (dis)apply enchant - ApplyEnchantment(pItem, EnchantmentSlot(enchant_slot), !wasactive, true, true); + ApplyEnchantment(item, EnchantmentSlot(enchant_slot), !wasactive, true, true); } } } @@ -21259,15 +21259,15 @@ void Player::ToggleMetaGemsActive(uint8 exceptslot, bool apply) if (slot == exceptslot) continue; - Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, slot); + Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, slot); - if (!pItem || !pItem->GetTemplate()->Socket[0].Color) //if item has no sockets or no item is equipped go to next item + if (!item || !item->GetTemplate()->Socket[0].Color) //if item has no sockets or no item is equipped go to next item continue; //cycle all (gem)enchants for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot) { - uint32 enchant_id = pItem->GetEnchantmentId(EnchantmentSlot(enchant_slot)); + uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(enchant_slot)); if (!enchant_id) //if no enchant go to next enchant(slot) continue; @@ -21278,7 +21278,7 @@ void Player::ToggleMetaGemsActive(uint8 exceptslot, bool apply) //only metagems to be (de)activated, so only enchants with condition uint32 condition = enchantEntry->EnchantmentCondition; if (condition) - ApplyEnchantment(pItem, EnchantmentSlot(enchant_slot), apply); + ApplyEnchantment(item, EnchantmentSlot(enchant_slot), apply); } } } @@ -21940,14 +21940,14 @@ void Player::SendInstanceResetWarning(uint32 mapid, Difficulty difficulty, uint3 GetSession()->SendPacket(&data); } -void Player::ApplyEquipCooldown(Item* pItem) +void Player::ApplyEquipCooldown(Item* item) { - if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_PROTO_FLAG_NO_EQUIP_COOLDOWN)) + if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_PROTO_FLAG_NO_EQUIP_COOLDOWN)) return; for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) { - _Spell const& spellData = pItem->GetTemplate()->Spells[i]; + _Spell const& spellData = item->GetTemplate()->Spells[i]; // no spell if (!spellData.SpellId) @@ -21957,10 +21957,10 @@ void Player::ApplyEquipCooldown(Item* pItem) if (spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_USE) continue; - AddSpellCooldown(spellData.SpellId, pItem->GetEntry(), time(NULL) + 30); + AddSpellCooldown(spellData.SpellId, item->GetEntry(), time(NULL) + 30); WorldPacket data(SMSG_ITEM_COOLDOWN, 12); - data << pItem->GetGUID(); + data << item->GetGUID(); data << uint32(spellData.SpellId); GetSession()->SendPacket(&data); } @@ -22574,7 +22574,7 @@ bool Player::CanNoReagentCast(SpellInfo const* spellInfo) const return false; } -void Player::RemoveItemDependentAurasAndCasts(Item* pItem) +void Player::RemoveItemDependentAurasAndCasts(Item* item) { for (AuraMap::iterator itr = m_ownedAuras.begin(); itr != m_ownedAuras.end();) { @@ -22589,7 +22589,7 @@ void Player::RemoveItemDependentAurasAndCasts(Item* pItem) } // skip if not item dependent or have alternative item - if (HasItemFitToSpellRequirements(spellInfo, pItem)) + if (HasItemFitToSpellRequirements(spellInfo, item)) { ++itr; continue; @@ -22602,7 +22602,7 @@ void Player::RemoveItemDependentAurasAndCasts(Item* pItem) // currently casted spells can be dependent from item for (uint32 i = 0; i < CURRENT_MAX_SPELL; ++i) if (Spell* spell = GetCurrentSpell(CurrentSpellTypes(i))) - if (spell->getState() != SPELL_STATE_DELAYED && !HasItemFitToSpellRequirements(spell->m_spellInfo, pItem)) + if (spell->getState() != SPELL_STATE_DELAYED && !HasItemFitToSpellRequirements(spell->m_spellInfo, item)) InterruptSpell(CurrentSpellTypes(i)); } @@ -23548,8 +23548,8 @@ void Player::AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore cons continue; } - Item* pItem = StoreNewItem(dest, lootItem->itemid, true, lootItem->randomPropertyId); - SendNewItem(pItem, lootItem->count, false, false, broadcast); + Item* item = StoreNewItem(dest, lootItem->itemid, true, lootItem->randomPropertyId); + SendNewItem(item, lootItem->count, false, false, broadcast); } } @@ -23780,9 +23780,9 @@ uint32 Player::GetPhaseMaskForSpawn() const return PHASEMASK_NORMAL; } -InventoryResult Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limit_count) const +InventoryResult Player::CanEquipUniqueItem(Item* item, uint8 eslot, uint32 limit_count) const { - ItemTemplate const* pProto = pItem->GetTemplate(); + ItemTemplate const* pProto = item->GetTemplate(); // proto based limitations if (InventoryResult res = CanEquipUniqueItem(pProto, eslot, limit_count)) @@ -23791,7 +23791,7 @@ InventoryResult Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limi // check unique-equipped on gems for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot) { - uint32 enchant_id = pItem->GetEnchantmentId(EnchantmentSlot(enchant_slot)); + uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(enchant_slot)); if (!enchant_id) continue; SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id); @@ -23803,8 +23803,8 @@ InventoryResult Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limi continue; // include for check equip another gems with same limit category for not equipped item (and then not counted) - uint32 gem_limit_count = !pItem->IsEquipped() && pGem->ItemLimitCategory - ? pItem->GetGemCountWithLimitCategory(pGem->ItemLimitCategory) : 1; + uint32 gem_limit_count = !item->IsEquipped() && pGem->ItemLimitCategory + ? item->GetGemCountWithLimitCategory(pGem->ItemLimitCategory) : 1; if (InventoryResult res = CanEquipUniqueItem(pGem, eslot, gem_limit_count)) return res; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 7f6b2322e93..0ee2743e319 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1233,70 +1233,70 @@ class Player : public Unit, public GridObject bool CanNoReagentCast(SpellInfo const* spellInfo) const; bool HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_slot = NULL_SLOT) const; bool HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 count, uint8 except_slot = NULL_SLOT) const; - InventoryResult CanTakeMoreSimilarItems(Item* pItem) const { return CanTakeMoreSimilarItems(pItem->GetEntry(), pItem->GetCount(), pItem); } + InventoryResult CanTakeMoreSimilarItems(Item* item) const { return CanTakeMoreSimilarItems(item->GetEntry(), item->GetCount(), item); } InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count) const { return CanTakeMoreSimilarItems(entry, count, NULL); } InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 item, uint32 count, uint32* no_space_count = NULL) const { return CanStoreItem(bag, slot, dest, item, count, NULL, false, no_space_count); } - InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* pItem, bool swap = false) const + InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* item, bool swap = false) const { - if (!pItem) + if (!item) return EQUIP_ERR_ITEM_NOT_FOUND; - uint32 count = pItem->GetCount(); - return CanStoreItem(bag, slot, dest, pItem->GetEntry(), count, pItem, swap, NULL); + uint32 count = item->GetCount(); + return CanStoreItem(bag, slot, dest, item->GetEntry(), count, item, swap, NULL); } - InventoryResult CanStoreItems(Item** pItem, int count) const; + InventoryResult CanStoreItems(Item** item, int count) const; InventoryResult CanEquipNewItem(uint8 slot, uint16& dest, uint32 item, bool swap) const; - InventoryResult CanEquipItem(uint8 slot, uint16& dest, Item* pItem, bool swap, bool not_loading = true) const; + InventoryResult CanEquipItem(uint8 slot, uint16& dest, Item* item, bool swap, bool not_loading = true) const; - InventoryResult CanEquipUniqueItem(Item* pItem, uint8 except_slot = NULL_SLOT, uint32 limit_count = 1) const; + InventoryResult CanEquipUniqueItem(Item* item, uint8 except_slot = NULL_SLOT, uint32 limit_count = 1) const; InventoryResult CanEquipUniqueItem(ItemTemplate const* itemProto, uint8 except_slot = NULL_SLOT, uint32 limit_count = 1) const; InventoryResult CanUnequipItems(uint32 item, uint32 count) const; InventoryResult CanUnequipItem(uint16 src, bool swap) const; - InventoryResult CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* pItem, bool swap, bool not_loading = true) const; - InventoryResult CanUseItem(Item* pItem, bool not_loading = true) const; + InventoryResult CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* item, bool swap, bool not_loading = true) const; + InventoryResult CanUseItem(Item* item, bool not_loading = true) const; bool HasItemTotemCategory(uint32 TotemCategory) const; - InventoryResult CanUseItem(ItemTemplate const* pItem) const; + InventoryResult CanUseItem(ItemTemplate const* item) const; InventoryResult CanUseAmmo(uint32 item) const; InventoryResult CanRollForItemInLFG(ItemTemplate const* item, WorldObject const* lootedObject) const; Item* StoreNewItem(ItemPosCountVec const& pos, uint32 item, bool update, int32 randomPropertyId = 0); Item* StoreNewItem(ItemPosCountVec const& pos, uint32 item, bool update, int32 randomPropertyId, AllowedLooterSet &allowedLooters); - Item* StoreItem(ItemPosCountVec const& pos, Item* pItem, bool update); + Item* StoreItem(ItemPosCountVec const& pos, Item* item, bool update); Item* EquipNewItem(uint16 pos, uint32 item, bool update); - Item* EquipItem(uint16 pos, Item* pItem, bool update); + Item* EquipItem(uint16 pos, Item* item, bool update); void AutoUnequipOffhandIfNeed(bool force = false); bool StoreNewItemInBestSlots(uint32 item_id, uint32 item_count); void AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store, bool broadcast = false); void AutoStoreLoot(uint32 loot_id, LootStore const& store, bool broadcast = false) { AutoStoreLoot(NULL_BAG, NULL_SLOT, loot_id, store, broadcast); } void StoreLootItem(uint8 lootSlot, Loot* loot); - InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = NULL) const; - InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item* pItem = NULL, bool swap = false, uint32* no_space_count = NULL) const; + InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* item, uint32* no_space_count = NULL) const; + InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item* item = NULL, bool swap = false, uint32* no_space_count = NULL) const; void AddRefundReference(uint32 it); void DeleteRefundReference(uint32 it); - void ApplyEquipCooldown(Item* pItem); + void ApplyEquipCooldown(Item* item); void SetAmmo(uint32 item); void RemoveAmmo(); float GetAmmoDPS() const { return m_ammoDPS; } bool CheckAmmoCompatibility(const ItemTemplate* ammo_proto) const; - void QuickEquipItem(uint16 pos, Item* pItem); - void VisualizeItem(uint8 slot, Item* pItem); - void SetVisibleItemSlot(uint8 slot, Item* pItem); - Item* BankItem(ItemPosCountVec const& dest, Item* pItem, bool update) + void QuickEquipItem(uint16 pos, Item* item); + void VisualizeItem(uint8 slot, Item* item); + void SetVisibleItemSlot(uint8 slot, Item* item); + Item* BankItem(ItemPosCountVec const& dest, Item* item, bool update) { - return StoreItem(dest, pItem, update); + return StoreItem(dest, item, update); } - Item* BankItem(uint16 pos, Item* pItem, bool update); + Item* BankItem(uint16 pos, Item* item, bool update); void RemoveItem(uint8 bag, uint8 slot, bool update); void MoveItemFromInventory(uint8 bag, uint8 slot, bool update); // in trade, auction, guild bank, mail.... - void MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool update, bool in_characterInventoryDB = false); + void MoveItemToInventory(ItemPosCountVec const& dest, Item* item, bool update, bool in_characterInventoryDB = false); // in trade, guild bank, mail.... - void RemoveItemDependentAurasAndCasts(Item* pItem); + void RemoveItemDependentAurasAndCasts(Item* item); void DestroyItem(uint8 bag, uint8 slot, bool update); void DestroyItemCount(uint32 item, uint32 count, bool update, bool unequip_check = false); void DestroyItemCount(Item* item, uint32& count, bool update); @@ -1304,11 +1304,11 @@ class Player : public Unit, public GridObject void DestroyZoneLimitedItem(bool update, uint32 new_zone); void SplitItem(uint16 src, uint16 dst, uint32 count); void SwapItem(uint16 src, uint16 dst); - void AddItemToBuyBackSlot(Item* pItem); + void AddItemToBuyBackSlot(Item* item); Item* GetItemFromBuyBackSlot(uint32 slot); void RemoveItemFromBuyBackSlot(uint32 slot, bool del); uint32 GetMaxKeyringSize() const { return KEYRING_SLOT_END-KEYRING_SLOT_START; } - void SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2 = NULL, uint32 itemid = 0); + void SendEquipError(InventoryResult msg, Item* item, Item* pItem2 = NULL, uint32 itemid = 0); void SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 param); void SendSellError(SellResult msg, Creature* creature, uint64 guid, uint32 param); void AddWeaponProficiency(uint32 newflag) { m_WeaponProficiency |= newflag; } @@ -2789,7 +2789,7 @@ class Player : public Unit, public GridObject InventoryResult CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVec& dest, ItemTemplate const* pProto, uint32& count, bool swap, Item* pSrcItem) const; InventoryResult CanStoreItem_InBag(uint8 bag, ItemPosCountVec& dest, ItemTemplate const* pProto, uint32& count, bool merge, bool non_specialized, Item* pSrcItem, uint8 skip_bag, uint8 skip_slot) const; InventoryResult CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 slot_end, ItemPosCountVec& dest, ItemTemplate const* pProto, uint32& count, bool merge, Item* pSrcItem, uint8 skip_bag, uint8 skip_slot) const; - Item* _StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool update); + Item* _StoreItem(uint16 pos, Item* item, uint32 count, bool clone, bool update); Item* _LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, Field* fields); std::set m_refundableItems; diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 9879ef7ff3b..396e01cb269 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1927,12 +1927,12 @@ void Group::BroadcastGroupUpdate(void) void Group::ResetMaxEnchantingLevel() { m_maxEnchantingLevel = 0; - Player* pMember = NULL; + Player* member = NULL; for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr) { - pMember = ObjectAccessor::FindPlayer(citr->guid); - if (pMember && m_maxEnchantingLevel < pMember->GetSkillValue(SKILL_ENCHANTING)) - m_maxEnchantingLevel = pMember->GetSkillValue(SKILL_ENCHANTING); + member = ObjectAccessor::FindPlayer(citr->guid); + if (member && m_maxEnchantingLevel < member->GetSkillValue(SKILL_ENCHANTING)) + m_maxEnchantingLevel = member->GetSkillValue(SKILL_ENCHANTING); } } diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index f97b907828a..9a453ed8033 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -348,8 +348,8 @@ bool Guild::BankTab::LoadItemFromDB(Field* fields) return false; } - Item* pItem = NewItemOrBag(proto); - if (!pItem->LoadFromDB(itemGuid, 0, fields, itemEntry)) + Item* item = NewItemOrBag(proto); + if (!item->LoadFromDB(itemGuid, 0, fields, itemEntry)) { sLog->outError("Item (GUID %u, id: %u) not found in item_instance, deleting from guild bank!", itemGuid, itemEntry); @@ -359,12 +359,12 @@ bool Guild::BankTab::LoadItemFromDB(Field* fields) stmt->setUInt8 (2, slotId); CharacterDatabase.Execute(stmt); - delete pItem; + delete item; return false; } - pItem->AddToWorld(); - m_items[slotId] = pItem; + item->AddToWorld(); + m_items[slotId] = item; return true; } @@ -372,13 +372,13 @@ bool Guild::BankTab::LoadItemFromDB(Field* fields) void Guild::BankTab::Delete(SQLTransaction& trans, bool removeItemsFromDB) { for (uint8 slotId = 0; slotId < GUILD_BANK_MAX_SLOTS; ++slotId) - if (Item* pItem = m_items[slotId]) + if (Item* item = m_items[slotId]) { - pItem->RemoveFromWorld(); + item->RemoveFromWorld(); if (removeItemsFromDB) - pItem->DeleteFromDB(trans); - delete pItem; - pItem = NULL; + item->DeleteFromDB(trans); + delete item; + item = NULL; } } @@ -392,29 +392,29 @@ inline void Guild::BankTab::WritePacket(WorldPacket& data) const // Writes information about contents of specified slot into packet. void Guild::BankTab::WriteSlotPacket(WorldPacket& data, uint8 slotId) const { - Item* pItem = GetItem(slotId); - uint32 itemEntry = pItem ? pItem->GetEntry() : 0; + Item* item = GetItem(slotId); + uint32 itemEntry = item ? item->GetEntry() : 0; data << uint8(slotId); data << uint32(itemEntry); if (itemEntry) { data << uint32(0); // 3.3.0 (0x00018020, 0x00018000) - data << uint32(pItem->GetItemRandomPropertyId()); // Random item property id + data << uint32(item->GetItemRandomPropertyId()); // Random item property id - if (pItem->GetItemRandomPropertyId()) - data << uint32(pItem->GetItemSuffixFactor()); // SuffixFactor + if (item->GetItemRandomPropertyId()) + data << uint32(item->GetItemSuffixFactor()); // SuffixFactor - data << uint32(pItem->GetCount()); // ITEM_FIELD_STACK_COUNT + data << uint32(item->GetCount()); // ITEM_FIELD_STACK_COUNT data << uint32(0); - data << uint8(abs(pItem->GetSpellCharges())); // Spell charges + data << uint8(abs(item->GetSpellCharges())); // Spell charges uint8 enchCount = 0; size_t enchCountPos = data.wpos(); data << uint8(enchCount); // Number of enchantments for (uint32 i = PERM_ENCHANTMENT_SLOT; i < MAX_ENCHANTMENT_SLOT; ++i) - if (uint32 enchId = pItem->GetEnchantmentId(EnchantmentSlot(i))) + if (uint32 enchId = item->GetEnchantmentId(EnchantmentSlot(i))) { data << uint8(i); data << uint32(enchId); @@ -456,13 +456,13 @@ void Guild::BankTab::SetText(const std::string& text) } // Sets/removes contents of specified slot. -// If pItem == NULL contents are removed. -bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* pItem) +// If item == NULL contents are removed. +bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* item) { if (slotId >= GUILD_BANK_MAX_SLOTS) return false; - m_items[slotId] = pItem; + m_items[slotId] = item; PreparedStatement* stmt = NULL; @@ -472,19 +472,19 @@ bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* pItem) stmt->setUInt8 (2, slotId); CharacterDatabase.ExecuteOrAppend(trans, stmt); - if (pItem) + if (item) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_BANK_ITEM); stmt->setUInt32(0, m_guildId); stmt->setUInt8 (1, m_tabId); stmt->setUInt8 (2, slotId); - stmt->setUInt32(3, pItem->GetGUIDLow()); + stmt->setUInt32(3, item->GetGUIDLow()); CharacterDatabase.ExecuteOrAppend(trans, stmt); - pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); - pItem->SetUInt64Value(ITEM_FIELD_OWNER, 0); - pItem->FSetState(ITEM_NEW); - pItem->SaveToDB(trans); // Not in inventory and can be saved standalone + item->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); + item->SetUInt64Value(ITEM_FIELD_OWNER, 0); + item->FSetState(ITEM_NEW); + item->SaveToDB(trans); // Not in inventory and can be saved standalone } return true; } @@ -759,12 +759,12 @@ bool Guild::MoveItemData::CheckItem(uint32& splitedAmount) return true; } -bool Guild::MoveItemData::CanStore(Item* pItem, bool swap, bool sendError) +bool Guild::MoveItemData::CanStore(Item* item, bool swap, bool sendError) { m_vec.clear(); - InventoryResult msg = CanStore(pItem, swap); + InventoryResult msg = CanStore(item, swap); if (sendError && msg != EQUIP_ERR_OK) - m_pPlayer->SendEquipError(msg, pItem); + m_pPlayer->SendEquipError(msg, item); return (msg == EQUIP_ERR_OK); } @@ -834,12 +834,12 @@ void Guild::PlayerMoveItemData::RemoveItem(SQLTransaction& trans, MoveItemData* } } -Item* Guild::PlayerMoveItemData::StoreItem(SQLTransaction& trans, Item* pItem) +Item* Guild::PlayerMoveItemData::StoreItem(SQLTransaction& trans, Item* item) { - ASSERT(pItem); - m_pPlayer->MoveItemToInventory(m_vec, pItem, true); + ASSERT(item); + m_pPlayer->MoveItemToInventory(m_vec, item, true); m_pPlayer->SaveInventoryAndGoldToDB(trans); - return pItem; + return item; } void Guild::PlayerMoveItemData::LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const @@ -850,9 +850,9 @@ void Guild::PlayerMoveItemData::LogBankEvent(SQLTransaction& trans, MoveItemData pFrom->GetItem()->GetEntry(), count); } -inline InventoryResult Guild::PlayerMoveItemData::CanStore(Item* pItem, bool swap) +inline InventoryResult Guild::PlayerMoveItemData::CanStore(Item* item, bool swap) { - return m_pPlayer->CanStoreItem(m_container, m_slotId, m_vec, pItem, swap); + return m_pPlayer->CanStoreItem(m_container, m_slotId, m_vec, item, swap); } /////////////////////////////////////////////////////////////////////////////// @@ -900,24 +900,24 @@ void Guild::BankMoveItemData::RemoveItem(SQLTransaction& trans, MoveItemData* pO m_pGuild->_DecreaseMemberRemainingSlots(trans, m_pPlayer->GetGUID(), m_container); } -Item* Guild::BankMoveItemData::StoreItem(SQLTransaction& trans, Item* pItem) +Item* Guild::BankMoveItemData::StoreItem(SQLTransaction& trans, Item* item) { - if (!pItem) + if (!item) return NULL; BankTab* pTab = m_pGuild->GetBankTab(m_container); if (!pTab) return NULL; - Item* pLastItem = pItem; + Item* pLastItem = item; for (ItemPosCountVec::const_iterator itr = m_vec.begin(); itr != m_vec.end(); ) { ItemPosCount pos(*itr); ++itr; sLog->outDebug(LOG_FILTER_GUILD, "GUILD STORAGE: StoreItem tab = %u, slot = %u, item = %u, count = %u", - m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); - pLastItem = _StoreItem(trans, pTab, pItem, pos, itr != m_vec.end()); + m_container, m_slotId, item->GetEntry(), item->GetCount()); + pLastItem = _StoreItem(trans, pTab, item, pos, itr != m_vec.end()); } return pLastItem; } @@ -946,7 +946,7 @@ void Guild::BankMoveItemData::LogAction(MoveItemData* pFrom) const m_pGuild->GetId()); } -Item* Guild::BankMoveItemData::_StoreItem(SQLTransaction& trans, BankTab* pTab, Item* pItem, ItemPosCount& pos, bool clone) const +Item* Guild::BankMoveItemData::_StoreItem(SQLTransaction& trans, BankTab* pTab, Item* item, ItemPosCount& pos, bool clone) const { uint8 slotId = uint8(pos.pos); uint32 count = pos.count; @@ -957,20 +957,20 @@ Item* Guild::BankMoveItemData::_StoreItem(SQLTransaction& trans, BankTab* pTab, pItemDest->SaveToDB(trans); if (!clone) { - pItem->RemoveFromWorld(); - pItem->DeleteFromDB(trans); - delete pItem; + item->RemoveFromWorld(); + item->DeleteFromDB(trans); + delete item; } return pItemDest; } if (clone) - pItem = pItem->CloneItem(count); + item = item->CloneItem(count); else - pItem->SetCount(count); + item->SetCount(count); - if (pItem && pTab->SetItem(trans, slotId, pItem)) - return pItem; + if (item && pTab->SetItem(trans, slotId, item)) + return item; return NULL; } @@ -979,13 +979,13 @@ Item* Guild::BankMoveItemData::_StoreItem(SQLTransaction& trans, BankTab* pTab, // If item in destination slot exists it must be the item of the same entry // and stack must have enough space to take at least one item. // Returns false if destination item specified and it cannot be used to reserve space. -bool Guild::BankMoveItemData::_ReserveSpace(uint8 slotId, Item* pItem, Item* pItemDest, uint32& count) +bool Guild::BankMoveItemData::_ReserveSpace(uint8 slotId, Item* item, Item* pItemDest, uint32& count) { - uint32 requiredSpace = pItem->GetMaxStackCount(); + uint32 requiredSpace = item->GetMaxStackCount(); if (pItemDest) { // Make sure source and destination items match and destination item has space for more stacks. - if (pItemDest->GetEntry() != pItem->GetEntry() || pItemDest->GetCount() >= pItem->GetMaxStackCount()) + if (pItemDest->GetEntry() != item->GetEntry() || pItemDest->GetCount() >= item->GetMaxStackCount()) return false; requiredSpace -= pItemDest->GetCount(); } @@ -1002,7 +1002,7 @@ bool Guild::BankMoveItemData::_ReserveSpace(uint8 slotId, Item* pItem, Item* pIt return true; } -void Guild::BankMoveItemData::CanStoreItemInTab(Item* pItem, uint8 skipSlotId, bool merge, uint32& count) +void Guild::BankMoveItemData::CanStoreItemInTab(Item* item, uint8 skipSlotId, bool merge, uint32& count) { for (uint8 slotId = 0; (slotId < GUILD_BANK_MAX_SLOTS) && (count > 0); ++slotId) { @@ -1011,25 +1011,25 @@ void Guild::BankMoveItemData::CanStoreItemInTab(Item* pItem, uint8 skipSlotId, b continue; Item* pItemDest = m_pGuild->_GetItem(m_container, slotId); - if (pItemDest == pItem) + if (pItemDest == item) pItemDest = NULL; // If merge skip empty, if not merge skip non-empty if ((pItemDest != NULL) != merge) continue; - _ReserveSpace(slotId, pItem, pItemDest, count); + _ReserveSpace(slotId, item, pItemDest, count); } } -InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap) +InventoryResult Guild::BankMoveItemData::CanStore(Item* item, bool swap) { sLog->outDebug(LOG_FILTER_GUILD, "GUILD STORAGE: CanStore() tab = %u, slot = %u, item = %u, count = %u", - m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); + m_container, m_slotId, item->GetEntry(), item->GetCount()); - uint32 count = pItem->GetCount(); + uint32 count = item->GetCount(); // Soulbound items cannot be moved - if (pItem->IsSoulBound()) + if (item->IsSoulBound()) return EQUIP_ERR_CANT_DROP_SOULBOUND; // Make sure destination bank tab exists @@ -1041,10 +1041,10 @@ InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap) { Item* pItemDest = m_pGuild->_GetItem(m_container, m_slotId); // Ignore swapped item (this slot will be empty after move) - if ((pItemDest == pItem) || swap) + if ((pItemDest == item) || swap) pItemDest = NULL; - if (!_ReserveSpace(m_slotId, pItem, pItemDest, count)) + if (!_ReserveSpace(m_slotId, item, pItemDest, count)) return EQUIP_ERR_ITEM_CANT_STACK; if (count == 0) @@ -1053,15 +1053,15 @@ InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap) // Slot was not specified or it has not enough space for all the items in stack // Search for stacks to merge with - if (pItem->GetMaxStackCount() > 1) + if (item->GetMaxStackCount() > 1) { - CanStoreItemInTab(pItem, m_slotId, true, count); + CanStoreItemInTab(item, m_slotId, true, count); if (count == 0) return EQUIP_ERR_OK; } // Search free slot for item - CanStoreItemInTab(pItem, m_slotId, false, count); + CanStoreItemInTab(item, m_slotId, false, count); if (count == 0) return EQUIP_ERR_OK; diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index e18e62e51b7..6454a979a79 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -476,7 +476,7 @@ private: void SendText(const Guild* guild, WorldSession* session) const; inline Item* GetItem(uint8 slotId) const { return slotId < GUILD_BANK_MAX_SLOTS ? m_items[slotId] : NULL; } - bool SetItem(SQLTransaction& trans, uint8 slotId, Item* pItem); + bool SetItem(SQLTransaction& trans, uint8 slotId, Item* item); private: uint32 m_guildId; @@ -506,13 +506,13 @@ private: // Defines if player has rights to withdraw item from container virtual bool HasWithdrawRights(MoveItemData* /*pOther*/) const { return true; } // Checks if container can store specified item - bool CanStore(Item* pItem, bool swap, bool sendError); + bool CanStore(Item* item, bool swap, bool sendError); // Clones stored item bool CloneItem(uint32 count); // Remove item from container (if splited update items fields) virtual void RemoveItem(SQLTransaction& trans, MoveItemData* pOther, uint32 splitedAmount = 0) = 0; // Saves item to container - virtual Item* StoreItem(SQLTransaction& trans, Item* pItem) = 0; + virtual Item* StoreItem(SQLTransaction& trans, Item* item) = 0; // Log bank event virtual void LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const = 0; // Log GM action @@ -524,7 +524,7 @@ private: uint8 GetContainer() const { return m_container; } uint8 GetSlotId() const { return m_slotId; } protected: - virtual InventoryResult CanStore(Item* pItem, bool swap) = 0; + virtual InventoryResult CanStore(Item* item, bool swap) = 0; Guild* m_pGuild; Player* m_pPlayer; @@ -544,10 +544,10 @@ private: bool IsBank() const { return false; } bool InitItem(); void RemoveItem(SQLTransaction& trans, MoveItemData* pOther, uint32 splitedAmount = 0); - Item* StoreItem(SQLTransaction& trans, Item* pItem); + Item* StoreItem(SQLTransaction& trans, Item* item); void LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const; protected: - InventoryResult CanStore(Item* pItem, bool swap); + InventoryResult CanStore(Item* item, bool swap); }; class BankMoveItemData : public MoveItemData @@ -561,17 +561,17 @@ private: bool HasStoreRights(MoveItemData* pOther) const; bool HasWithdrawRights(MoveItemData* pOther) const; void RemoveItem(SQLTransaction& trans, MoveItemData* pOther, uint32 splitedAmount); - Item* StoreItem(SQLTransaction& trans, Item* pItem); + Item* StoreItem(SQLTransaction& trans, Item* item); void LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const; void LogAction(MoveItemData* pFrom) const; protected: - InventoryResult CanStore(Item* pItem, bool swap); + InventoryResult CanStore(Item* item, bool swap); private: - Item* _StoreItem(SQLTransaction& trans, BankTab* pTab, Item* pItem, ItemPosCount& pos, bool clone) const; - bool _ReserveSpace(uint8 slotId, Item* pItem, Item* pItemDest, uint32& count); - void CanStoreItemInTab(Item* pItem, uint8 skipSlotId, bool merge, uint32& count); + Item* _StoreItem(SQLTransaction& trans, BankTab* pTab, Item* item, ItemPosCount& pos, bool clone) const; + bool _ReserveSpace(uint8 slotId, Item* item, Item* pItemDest, uint32& count); + void CanStoreItemInTab(Item* item, uint8 skipSlotId, bool merge, uint32& count); }; typedef UNORDERED_MAP Members; diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index f82c52204fb..2188667d042 100755 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -504,8 +504,8 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) SQLTransaction trans = CharacterDatabase.BeginTransaction(); if (auction && auction->owner == player->GetGUIDLow()) { - Item* pItem = sAuctionMgr->GetAItem(auction->item_guidlow); - if (pItem) + Item* item = sAuctionMgr->GetAItem(auction->item_guidlow); + if (item) { if (auction->bidder > 0) // If we have a bidder, we have to send him the money he paid { @@ -522,7 +522,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) // item will deleted or added to received mail list MailDraft(msgAuctionCanceledOwner.str(), "") // TODO: fix body - .AddItem(pItem) + .AddItem(item) .SendMailTo(trans, player, auction, MAIL_CHECK_MASK_COPIED); } else diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 2434ba6eaa7..9e637665f55 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -255,14 +255,14 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data) } } - Item* pItem = _player->GetItemByPos(bag, slot); - if (!pItem) + Item* item = _player->GetItemByPos(bag, slot); + if (!item) { _player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); return; } - if (pItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_INDESTRUCTIBLE) + if (item->GetTemplate()->Flags & ITEM_PROTO_FLAG_INDESTRUCTIBLE) { _player->SendEquipError(EQUIP_ERR_CANT_DROP_SOULBOUND, NULL, NULL); return; @@ -271,7 +271,7 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data) if (count) { uint32 i_count = count; - _player->DestroyItemCount(pItem, i_count, true); + _player->DestroyItemCount(item, i_count, true); } else _player->DestroyItem(bag, slot, true); @@ -445,13 +445,13 @@ void WorldSession::HandleReadItem(WorldPacket & recv_data) recv_data >> bag >> slot; //sLog->outDetail("STORAGE: Read bag = %u, slot = %u", bag, slot); - Item* pItem = _player->GetItemByPos(bag, slot); + Item* item = _player->GetItemByPos(bag, slot); - if (pItem && pItem->GetTemplate()->PageText) + if (item && item->GetTemplate()->PageText) { WorldPacket data; - InventoryResult msg = _player->CanUseItem(pItem); + InventoryResult msg = _player->CanUseItem(item); if (msg == EQUIP_ERR_OK) { data.Initialize (SMSG_READ_ITEM_OK, 8); @@ -461,9 +461,9 @@ void WorldSession::HandleReadItem(WorldPacket & recv_data) { data.Initialize(SMSG_READ_ITEM_FAILED, 8); sLog->outDetail("STORAGE: Unable to read item"); - _player->SendEquipError(msg, pItem, NULL); + _player->SendEquipError(msg, item, NULL); } - data << pItem->GetGUID(); + data << item->GetGUID(); SendPacket(&data); } else @@ -506,25 +506,25 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - Item* pItem = _player->GetItemByGuid(itemguid); - if (pItem) + Item* item = _player->GetItemByGuid(itemguid); + if (item) { // prevent sell not owner item - if (_player->GetGUID() != pItem->GetOwnerGUID()) + if (_player->GetGUID() != item->GetOwnerGUID()) { _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); return; } // prevent sell non empty bag by drag-and-drop at vendor's item list - if (pItem->IsNotEmptyBag()) + if (item->IsNotEmptyBag()) { _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); return; } // prevent sell currently looted item - if (_player->GetLootGUID() == pItem->GetGUID()) + if (_player->GetLootGUID() == item->GetGUID()) { _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); return; @@ -533,44 +533,44 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) // prevent selling item for sellprice when the item is still refundable // this probably happens when right clicking a refundable item, the client sends both // CMSG_SELL_ITEM and CMSG_REFUND_ITEM (unverified) - if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) + if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) return; // Therefore, no feedback to client // special case at auto sell (sell all) if (count == 0) { - count = pItem->GetCount(); + count = item->GetCount(); } else { // prevent sell more items that exist in stack (possible only not from client) - if (count > pItem->GetCount()) + if (count > item->GetCount()) { _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); return; } } - ItemTemplate const* pProto = pItem->GetTemplate(); + ItemTemplate const* pProto = item->GetTemplate(); if (pProto) { if (pProto->SellPrice > 0) { - if (count < pItem->GetCount()) // need split items + if (count < item->GetCount()) // need split items { - Item* pNewItem = pItem->CloneItem(count, _player); + Item* pNewItem = item->CloneItem(count, _player); if (!pNewItem) { - sLog->outError("WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", pItem->GetEntry(), count); + sLog->outError("WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", item->GetEntry(), count); _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); return; } - pItem->SetCount(pItem->GetCount() - count); - _player->ItemRemovedQuestCheck(pItem->GetEntry(), count); + item->SetCount(item->GetCount() - count); + _player->ItemRemovedQuestCheck(item->GetEntry(), count); if (_player->IsInWorld()) - pItem->SendUpdateToPlayer(_player); - pItem->SetState(ITEM_CHANGED, _player); + item->SendUpdateToPlayer(_player); + item->SetState(ITEM_CHANGED, _player); _player->AddItemToBuyBackSlot(pNewItem); if (_player->IsInWorld()) @@ -578,10 +578,10 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) } else { - _player->ItemRemovedQuestCheck(pItem->GetEntry(), pItem->GetCount()); - _player->RemoveItem(pItem->GetBagSlot(), pItem->GetSlot(), true); - pItem->RemoveFromUpdateQueueOf(_player); - _player->AddItemToBuyBackSlot(pItem); + _player->ItemRemovedQuestCheck(item->GetEntry(), item->GetCount()); + _player->RemoveItem(item->GetBagSlot(), item->GetSlot(), true); + item->RemoveFromUpdateQueueOf(_player); + _player->AddItemToBuyBackSlot(item); } uint32 money = pProto->SellPrice * count; @@ -617,28 +617,28 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data) if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - Item* pItem = _player->GetItemFromBuyBackSlot(slot); - if (pItem) + Item* item = _player->GetItemFromBuyBackSlot(slot); + if (item) { uint32 price = _player->GetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + slot - BUYBACK_SLOT_START); if (!_player->HasEnoughMoney(price)) { - _player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, pItem->GetEntry(), 0); + _player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, item->GetEntry(), 0); return; } ItemPosCountVec dest; - InventoryResult msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, pItem, false); + InventoryResult msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, item, false); if (msg == EQUIP_ERR_OK) { _player->ModifyMoney(-(int32)price); _player->RemoveItemFromBuyBackSlot(slot, false); - _player->ItemAddedQuestCheck(pItem->GetEntry(), pItem->GetCount()); - _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, pItem->GetEntry(), pItem->GetCount()); - _player->StoreItem(dest, pItem, true); + _player->ItemAddedQuestCheck(item->GetEntry(), item->GetCount()); + _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item->GetEntry(), item->GetCount()); + _player->StoreItem(dest, item, true); } else - _player->SendEquipError(msg, pItem, NULL); + _player->SendEquipError(msg, item, NULL); return; } else @@ -815,8 +815,8 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) recv_data >> srcbag >> srcslot >> dstbag; //sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u", srcbag, srcslot, dstbag); - Item* pItem = _player->GetItemByPos(srcbag, srcslot); - if (!pItem) + Item* item = _player->GetItemByPos(srcbag, srcslot); + if (!item) return; if (!_player->IsValidPos(dstbag, NULL_SLOT, false)) // can be autostore pos @@ -825,7 +825,7 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) return; } - uint16 src = pItem->GetPos(); + uint16 src = item->GetPos(); // check unequip potability for equipped items and bank bags if (_player->IsEquipmentPos (src) || _player->IsBagPos (src)) @@ -833,16 +833,16 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) InventoryResult msg = _player->CanUnequipItem(src, !_player->IsBagPos (src)); if (msg != EQUIP_ERR_OK) { - _player->SendEquipError(msg, pItem, NULL); + _player->SendEquipError(msg, item, NULL); return; } } ItemPosCountVec dest; - InventoryResult msg = _player->CanStoreItem(dstbag, NULL_SLOT, dest, pItem, false); + InventoryResult msg = _player->CanStoreItem(dstbag, NULL_SLOT, dest, item, false); if (msg != EQUIP_ERR_OK) { - _player->SendEquipError(msg, pItem, NULL); + _player->SendEquipError(msg, item, NULL); return; } @@ -850,12 +850,12 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) if (dest.size() == 1 && dest[0].pos == src) { // just remove grey item state - _player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); + _player->SendEquipError(EQUIP_ERR_NONE, item, NULL); return; } _player->RemoveItem(srcbag, srcslot, true); - _player->StoreItem(dest, pItem, true); + _player->StoreItem(dest, item, true); } void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) @@ -919,27 +919,27 @@ void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket) recvPacket >> srcbag >> srcslot; sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); - Item* pItem = _player->GetItemByPos(srcbag, srcslot); - if (!pItem) + Item* item = _player->GetItemByPos(srcbag, srcslot); + if (!item) return; ItemPosCountVec dest; - InventoryResult msg = _player->CanBankItem(NULL_BAG, NULL_SLOT, dest, pItem, false); + InventoryResult msg = _player->CanBankItem(NULL_BAG, NULL_SLOT, dest, item, false); if (msg != EQUIP_ERR_OK) { - _player->SendEquipError(msg, pItem, NULL); + _player->SendEquipError(msg, item, NULL); return; } - if (dest.size() == 1 && dest[0].pos == pItem->GetPos()) + if (dest.size() == 1 && dest[0].pos == item->GetPos()) { - _player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); + _player->SendEquipError(EQUIP_ERR_NONE, item, NULL); return; } _player->RemoveItem(srcbag, srcslot, true); - _player->ItemRemovedQuestCheck(pItem->GetEntry(), pItem->GetCount()); - _player->BankItem(dest, pItem, true); + _player->ItemRemovedQuestCheck(item->GetEntry(), item->GetCount()); + _player->BankItem(dest, item, true); } void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket) @@ -950,36 +950,36 @@ void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket) recvPacket >> srcbag >> srcslot; sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); - Item* pItem = _player->GetItemByPos(srcbag, srcslot); - if (!pItem) + Item* item = _player->GetItemByPos(srcbag, srcslot); + if (!item) return; if (_player->IsBankPos(srcbag, srcslot)) // moving from bank to inventory { ItemPosCountVec dest; - InventoryResult msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, pItem, false); + InventoryResult msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, item, false); if (msg != EQUIP_ERR_OK) { - _player->SendEquipError(msg, pItem, NULL); + _player->SendEquipError(msg, item, NULL); return; } _player->RemoveItem(srcbag, srcslot, true); - _player->StoreItem(dest, pItem, true); - _player->ItemAddedQuestCheck(pItem->GetEntry(), pItem->GetCount()); + _player->StoreItem(dest, item, true); + _player->ItemAddedQuestCheck(item->GetEntry(), item->GetCount()); } else // moving from inventory to bank { ItemPosCountVec dest; - InventoryResult msg = _player->CanBankItem(NULL_BAG, NULL_SLOT, dest, pItem, false); + InventoryResult msg = _player->CanBankItem(NULL_BAG, NULL_SLOT, dest, item, false); if (msg != EQUIP_ERR_OK) { - _player->SendEquipError(msg, pItem, NULL); + _player->SendEquipError(msg, item, NULL); return; } _player->RemoveItem(srcbag, srcslot, true); - _player->BankItem(dest, pItem, true); + _player->BankItem(dest, item, true); } } diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 8e4b41a9be4..b4d6db5e80c 100755 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -55,15 +55,15 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data) } else if (IS_ITEM_GUID(lguid)) { - Item* pItem = player->GetItemByGuid(lguid); + Item* item = player->GetItemByGuid(lguid); - if (!pItem) + if (!item) { player->SendLootRelease(lguid); return; } - loot = &pItem->loot; + loot = &item->loot; } else if (IS_CORPSE_GUID(lguid)) { @@ -357,29 +357,29 @@ void WorldSession::DoLootRelease(uint64 lguid) } else if (IS_ITEM_GUID(lguid)) { - Item* pItem = player->GetItemByGuid(lguid); - if (!pItem) + Item* item = player->GetItemByGuid(lguid); + if (!item) return; - ItemTemplate const* proto = pItem->GetTemplate(); + ItemTemplate const* proto = item->GetTemplate(); // destroy only 5 items from stack in case prospecting and milling if (proto->Flags & (ITEM_PROTO_FLAG_PROSPECTABLE | ITEM_PROTO_FLAG_MILLABLE)) { - pItem->m_lootGenerated = false; - pItem->loot.clear(); + item->m_lootGenerated = false; + item->loot.clear(); - uint32 count = pItem->GetCount(); + uint32 count = item->GetCount(); // >=5 checked in spell code, but will work for cheating cases also with removing from another stacks. if (count > 5) count = 5; - player->DestroyItemCount(pItem, count, true); + player->DestroyItemCount(item, count, true); } else // FIXME: item must not be deleted in case not fully looted state. But this pre-request implement loot saving in DB at item save. Or cheating possible. - player->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true); + player->DestroyItem(item->GetBagSlot(), item->GetSlot(), true); return; // item can be looted only single player } else diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 9ea0e124112..a8ebb4722dd 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -86,53 +86,53 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) return; } - Item* pItem = pUser->GetUseableItemByPos(bagIndex, slot); - if (!pItem) + Item* item = pUser->GetUseableItemByPos(bagIndex, slot); + if (!item) { pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); return; } - if (pItem->GetGUID() != itemGUID) + if (item->GetGUID() != itemGUID) { pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); return; } - sLog->outDetail("WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, castCount: %u, spellId: %u, Item: %u, glyphIndex: %u, data length = %i", bagIndex, slot, castCount, spellId, pItem->GetEntry(), glyphIndex, (uint32)recvPacket.size()); + sLog->outDetail("WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, castCount: %u, spellId: %u, Item: %u, glyphIndex: %u, data length = %i", bagIndex, slot, castCount, spellId, item->GetEntry(), glyphIndex, (uint32)recvPacket.size()); - ItemTemplate const* proto = pItem->GetTemplate(); + ItemTemplate const* proto = item->GetTemplate(); if (!proto) { - pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, pItem, NULL); + pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, item, NULL); return; } // some item classes can be used only in equipped state - if (proto->InventoryType != INVTYPE_NON_EQUIP && !pItem->IsEquipped()) + if (proto->InventoryType != INVTYPE_NON_EQUIP && !item->IsEquipped()) { - pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, pItem, NULL); + pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, item, NULL); return; } - InventoryResult msg = pUser->CanUseItem(pItem); + InventoryResult msg = pUser->CanUseItem(item); if (msg != EQUIP_ERR_OK) { - pUser->SendEquipError(msg, pItem, NULL); + pUser->SendEquipError(msg, item, NULL); return; } // only allow conjured consumable, bandage, poisons (all should have the 2^21 item flag set in DB) if (proto->Class == ITEM_CLASS_CONSUMABLE && !(proto->Flags & ITEM_PROTO_FLAG_USEABLE_IN_ARENA) && pUser->InArena()) { - pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, pItem, NULL); + pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, item, NULL); return; } // don't allow items banned in arena if (proto->Flags & ITEM_PROTO_FLAG_NOT_USEABLE_IN_ARENA && pUser->InArena()) { - pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, pItem, NULL); + pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, item, NULL); return; } @@ -144,7 +144,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) { if (!spellInfo->CanBeUsedInCombat()) { - pUser->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT, pItem, NULL); + pUser->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT, item, NULL); return; } } @@ -152,12 +152,12 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) } // check also BIND_WHEN_PICKED_UP and BIND_QUEST_ITEM for .additem or .additemset case by GM (not binded at adding to inventory) - if (pItem->GetTemplate()->Bonding == BIND_WHEN_USE || pItem->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || pItem->GetTemplate()->Bonding == BIND_QUEST_ITEM) + if (item->GetTemplate()->Bonding == BIND_WHEN_USE || item->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || item->GetTemplate()->Bonding == BIND_QUEST_ITEM) { - if (!pItem->IsSoulBound()) + if (!item->IsSoulBound()) { - pItem->SetState(ITEM_CHANGED, pUser); - pItem->SetBinding(true); + item->SetState(ITEM_CHANGED, pUser); + item->SetBinding(true); } } @@ -166,10 +166,10 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) HandleClientCastFlags(recvPacket, castFlags, targets); // Note: If script stop casting it must send appropriate data to client to prevent stuck item in gray state. - if (!sScriptMgr->OnItemUse(pUser, pItem, targets)) + if (!sScriptMgr->OnItemUse(pUser, item, targets)) { // no script or script not process request by self - pUser->CastItemUseSpell(pItem, targets, castCount, glyphIndex); + pUser->CastItemUseSpell(item, targets, castCount, glyphIndex); } } diff --git a/src/server/game/Mails/Mail.cpp b/src/server/game/Mails/Mail.cpp index 3c3888eb9f8..3511e5016fd 100755 --- a/src/server/game/Mails/Mail.cpp +++ b/src/server/game/Mails/Mail.cpp @@ -219,10 +219,10 @@ void MailDraft::SendMailTo(SQLTransaction& trans, MailReceiver const& receiver, for (MailItemMap::const_iterator mailItemIter = m_items.begin(); mailItemIter != m_items.end(); ++mailItemIter) { - Item* pItem = mailItemIter->second; + Item* item = mailItemIter->second; stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_MAIL_ITEM); stmt->setUInt32(0, mailId); - stmt->setUInt32(1, pItem->GetGUIDLow()); + stmt->setUInt32(1, item->GetGUIDLow()); stmt->setUInt32(2, receiver.GetPlayerGUIDLow()); trans->Append(stmt); } diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index fba6b460ec9..15c46a81494 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -1341,10 +1341,10 @@ void ScriptMgr::OnGuildMemberDepositMoney(Guild* guild, Player* player, uint32 & FOREACH_SCRIPT(GuildScript)->OnMemberDepositMoney(guild, player, amount); } -void ScriptMgr::OnGuildItemMove(Guild* guild, Player* player, Item* pItem, bool isSrcBank, uint8 srcContainer, uint8 srcSlotId, +void ScriptMgr::OnGuildItemMove(Guild* guild, Player* player, Item* item, bool isSrcBank, uint8 srcContainer, uint8 srcSlotId, bool isDestBank, uint8 destContainer, uint8 destSlotId) { - FOREACH_SCRIPT(GuildScript)->OnItemMove(guild, player, pItem, isSrcBank, srcContainer, srcSlotId, isDestBank, destContainer, destSlotId); + FOREACH_SCRIPT(GuildScript)->OnItemMove(guild, player, item, isSrcBank, srcContainer, srcSlotId, isDestBank, destContainer, destSlotId); } void ScriptMgr::OnGuildEvent(Guild* guild, uint8 eventType, uint32 playerGuid1, uint32 playerGuid2, uint8 newRank) diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 3b65a5cf256..13c14113627 100755 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -764,7 +764,7 @@ class GuildScript : public ScriptObject virtual void OnMemberDepositMoney(Guild* /*guild*/, Player* /*player*/, uint32& /*amount*/) { } // Called when a guild member moves an item in a guild bank. - virtual void OnItemMove(Guild* /*guild*/, Player* /*player*/, Item* /*pItem*/, bool /*isSrcBank*/, uint8 /*srcContainer*/, uint8 /*srcSlotId*/, + virtual void OnItemMove(Guild* /*guild*/, Player* /*player*/, Item* /*item*/, bool /*isSrcBank*/, uint8 /*srcContainer*/, uint8 /*srcSlotId*/, bool /*isDestBank*/, uint8 /*destContainer*/, uint8 /*destSlotId*/) { } virtual void OnEvent(Guild* /*guild*/, uint8 /*eventType*/, uint32 /*playerGuid1*/, uint32 /*playerGuid2*/, uint8 /*newRank*/) { } @@ -1008,7 +1008,7 @@ class ScriptMgr void OnGuildDisband(Guild* guild); void OnGuildMemberWitdrawMoney(Guild* guild, Player* player, uint32 &amount, bool isRepair); void OnGuildMemberDepositMoney(Guild* guild, Player* player, uint32 &amount); - void OnGuildItemMove(Guild* guild, Player* player, Item* pItem, bool isSrcBank, uint8 srcContainer, uint8 srcSlotId, + void OnGuildItemMove(Guild* guild, Player* player, Item* item, bool isSrcBank, uint8 srcContainer, uint8 srcSlotId, bool isDestBank, uint8 destContainer, uint8 destSlotId); void OnGuildEvent(Guild* guild, uint8 eventType, uint32 playerGuid1, uint32 playerGuid2, uint8 newRank); void OnGuildBankEvent(Guild* guild, uint8 eventType, uint8 tabId, uint32 playerGuid, uint32 itemOrMoney, uint16 itemStackCount, uint8 destTabId); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 387f76bbc7f..a8e7d33e9eb 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2102,9 +2102,9 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo // and also HandleAuraModDisarm is not triggered if (!target->CanUseAttackType(BASE_ATTACK)) { - if (Item* pItem = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND)) + if (Item* item = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND)) { - target->ToPlayer()->_ApplyWeaponDamage(EQUIPMENT_SLOT_MAINHAND, pItem->GetTemplate(), NULL, apply); + target->ToPlayer()->_ApplyWeaponDamage(EQUIPMENT_SLOT_MAINHAND, item->GetTemplate(), NULL, apply); } } } @@ -2536,14 +2536,14 @@ void AuraEffect::HandleAuraModDisarm(AuraApplication const* aurApp, uint8 mode, // Handle damage modification, shapeshifted druids are not affected if (target->GetTypeId() == TYPEID_PLAYER && !target->IsInFeralForm()) { - if (Item* pItem = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) + if (Item* item = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) { uint8 attacktype = Player::GetAttackBySlot(slot); if (attacktype < MAX_ATTACK) { - target->ToPlayer()->_ApplyWeaponDamage(slot, pItem->GetTemplate(), NULL, !apply); - target->ToPlayer()->_ApplyWeaponDependentAuraMods(pItem, WeaponAttackType(attacktype), !apply); + target->ToPlayer()->_ApplyWeaponDamage(slot, item->GetTemplate(), NULL, !apply); + target->ToPlayer()->_ApplyWeaponDependentAuraMods(item, WeaponAttackType(attacktype), !apply); } } } @@ -4082,8 +4082,8 @@ void AuraEffect::HandleAuraModWeaponCritPercent(AuraApplication const* aurApp, u return; for (int i = 0; i < MAX_ATTACK; ++i) - if (Item* pItem = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true)) - target->ToPlayer()->_ApplyWeaponDependentAuraCritMod(pItem, WeaponAttackType(i), this, apply); + if (Item* item = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true)) + target->ToPlayer()->_ApplyWeaponDependentAuraCritMod(item, WeaponAttackType(i), this, apply); // mods must be applied base at equipped weapon class and subclass comparison // with spell->EquippedItemClass and EquippedItemSubClassMask and EquippedItemInventoryTypeMask @@ -4395,8 +4395,8 @@ void AuraEffect::HandleModDamageDone(AuraApplication const* aurApp, uint8 mode, if (target->GetTypeId() == TYPEID_PLAYER) { for (int i = 0; i < MAX_ATTACK; ++i) - if (Item* pItem = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true)) - target->ToPlayer()->_ApplyWeaponDependentAuraDamageMod(pItem, WeaponAttackType(i), this, apply); + if (Item* item = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true)) + target->ToPlayer()->_ApplyWeaponDependentAuraDamageMod(item, WeaponAttackType(i), this, apply); } // GetMiscValue() is bitmask of spell schools diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index ae5b14989af..2d3bd095360 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -530,8 +530,8 @@ m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharme if (m_attackType == RANGED_ATTACK) // wand case if ((m_caster->getClassMask() & CLASSMASK_WAND_USERS) != 0 && m_caster->GetTypeId() == TYPEID_PLAYER) - if (Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK)) - m_spellSchoolMask = SpellSchoolMask(1 << pItem->GetTemplate()->Damage[0].DamageType); + if (Item* item = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK)) + m_spellSchoolMask = SpellSchoolMask(1 << item->GetTemplate()->Damage[0].DamageType); if (originalCasterGUID) m_originalCasterGUID = originalCasterGUID; @@ -3952,12 +3952,12 @@ void Spell::WriteAmmoToPacket(WorldPacket* data) if (m_caster->GetTypeId() == TYPEID_PLAYER) { - Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK); - if (pItem) + Item* item = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK); + if (item) { - ammoInventoryType = pItem->GetTemplate()->InventoryType; + ammoInventoryType = item->GetTemplate()->InventoryType; if (ammoInventoryType == INVTYPE_THROWN) - ammoDisplayID = pItem->GetTemplate()->DisplayInfoID; + ammoDisplayID = item->GetTemplate()->DisplayInfoID; else { uint32 ammoID = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID); @@ -4361,15 +4361,15 @@ void Spell::TakeAmmo() { if (m_attackType == RANGED_ATTACK && m_caster->GetTypeId() == TYPEID_PLAYER) { - Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK); + Item* item = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK); // wands don't have ammo - if (!pItem || pItem->IsBroken() || pItem->GetTemplate()->SubClass == ITEM_SUBCLASS_WEAPON_WAND) + if (!item || item->IsBroken() || item->GetTemplate()->SubClass == ITEM_SUBCLASS_WEAPON_WAND) return; - if (pItem->GetTemplate()->InventoryType == INVTYPE_THROWN) + if (item->GetTemplate()->InventoryType == INVTYPE_THROWN) { - if (pItem->GetMaxStackCount() == 1) + if (item->GetMaxStackCount() == 1) { // decrease durability for non-stackable throw weapon m_caster->ToPlayer()->DurabilityPointLossForEquipSlot(EQUIPMENT_SLOT_RANGED); @@ -4378,7 +4378,7 @@ void Spell::TakeAmmo() { // decrease items amount for stackable throw weapon uint32 count = 1; - m_caster->ToPlayer()->DestroyItemCount(pItem, count, true); + m_caster->ToPlayer()->DestroyItemCount(item, count, true); } } else if (uint32 ammo = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID)) @@ -6216,15 +6216,15 @@ SpellCastResult Spell::CheckItems() if (m_caster->GetTypeId() != TYPEID_PLAYER) return SPELL_FAILED_TARGET_NOT_PLAYER; if (m_attackType != RANGED_ATTACK) break; - Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(m_attackType); - if (!pItem || pItem->IsBroken()) + Item* item = m_caster->ToPlayer()->GetWeaponForAttack(m_attackType); + if (!item || item->IsBroken()) return SPELL_FAILED_EQUIPPED_ITEM; - switch (pItem->GetTemplate()->SubClass) + switch (item->GetTemplate()->SubClass) { case ITEM_SUBCLASS_WEAPON_THROWN: { - uint32 ammo = pItem->GetEntry(); + uint32 ammo = item->GetEntry(); if (!m_caster->ToPlayer()->HasItemCount(ammo, 1)) return SPELL_FAILED_NO_AMMO; }; break; @@ -6250,7 +6250,7 @@ SpellCastResult Spell::CheckItems() return SPELL_FAILED_NO_AMMO; // check ammo ws. weapon compatibility - switch (pItem->GetTemplate()->SubClass) + switch (item->GetTemplate()->SubClass) { case ITEM_SUBCLASS_WEAPON_BOW: case ITEM_SUBCLASS_WEAPON_CROSSBOW: @@ -6286,10 +6286,10 @@ SpellCastResult Spell::CheckItems() if (!pProto) return SPELL_FAILED_ITEM_AT_MAX_CHARGES; - if (Item* pitem = p_caster->GetItemByEntry(item_id)) + if (Item* item = p_caster->GetItemByEntry(item_id)) { for (int x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) - if (pProto->Spells[x].SpellCharges != 0 && pitem->GetSpellCharges(x) == pProto->Spells[x].SpellCharges) + if (pProto->Spells[x].SpellCharges != 0 && item->GetSpellCharges(x) == pProto->Spells[x].SpellCharges) return SPELL_FAILED_ITEM_AT_MAX_CHARGES; } break; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 59b6d8971cf..07b7921e6e3 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1777,22 +1777,22 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype) if (num_to_add) { // create the new item and store it - Item* pItem = player->StoreNewItem(dest, newitemid, true, Item::GenerateItemRandomPropertyId(newitemid)); + Item* item = player->StoreNewItem(dest, newitemid, true, Item::GenerateItemRandomPropertyId(newitemid)); // was it successful? return error if not - if (!pItem) + if (!item) { player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); return; } // set the "Crafted by ..." property of the item - if (pItem->GetTemplate()->Class != ITEM_CLASS_CONSUMABLE && pItem->GetTemplate()->Class != ITEM_CLASS_QUEST && newitemid != 6265 && newitemid != 6948) - pItem->SetUInt32Value(ITEM_FIELD_CREATOR, player->GetGUIDLow()); + if (item->GetTemplate()->Class != ITEM_CLASS_CONSUMABLE && item->GetTemplate()->Class != ITEM_CLASS_QUEST && newitemid != 6265 && newitemid != 6948) + item->SetUInt32Value(ITEM_FIELD_CREATOR, player->GetGUIDLow()); // send info to the client - if (pItem) - player->SendNewItem(pItem, num_to_add, true, bgType == 0); + if (item) + player->SendNewItem(item, num_to_add, true, bgType == 0); // we succeeded in creating at least one item, so a levelup is possible if (bgType == 0) @@ -6672,11 +6672,11 @@ void Spell::EffectRechargeManaGem(SpellEffIndex /*effIndex*/) return; } - if (Item* pItem = player->GetItemByEntry(item_id)) + if (Item* item = player->GetItemByEntry(item_id)) { for (int x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) - pItem->SetSpellCharges(x, pProto->Spells[x].SpellCharges); - pItem->SetState(ITEM_CHANGED, player); + item->SetSpellCharges(x, pProto->Spells[x].SpellCharges); + item->SetState(ITEM_CHANGED, player); } } diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 67ac6f8ff76..8d803a54096 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -163,15 +163,15 @@ public: if (!*args) return false; - char* pitem = handler->extractKeyFromLink((char*)args, "Hitem"); - if (!pitem) + char* item = handler->extractKeyFromLink((char*)args, "Hitem"); + if (!item) { handler->SendSysMessage(LANG_COMMAND_NEEDITEMSEND); handler->SetSentErrorMessage(true); return false; } - int32 item_int = atol(pitem); + int32 item_int = atol(item); if (item_int <= 0) return false; @@ -411,14 +411,14 @@ public: return false; } - char* pitem = handler->extractKeyFromLink((char*)args, "Hitem"); - if (!pitem) + char* item = handler->extractKeyFromLink((char*)args, "Hitem"); + if (!item) { handler->SendSysMessage(LANG_COMMAND_NEEDITEMSEND); handler->SetSentErrorMessage(true); return false; } - uint32 itemId = atol(pitem); + uint32 itemId = atol(item); if (!sObjectMgr->RemoveVendorItem(vendor->GetEntry(), itemId)) { diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp index 7c82454ba87..10227910ec8 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -267,11 +267,11 @@ public: //dosen't work at all if (uiShieldBreakerTimer <= uiDiff) { - Vehicle* pVehicle = me->GetVehicleKit(); - if (!pVehicle) + Vehicle* vehicle = me->GetVehicleKit(); + if (!vehicle) return; - if (Unit* pPassenger = pVehicle->GetPassenger(SEAT_ID_0)) + if (Unit* pPassenger = vehicle->GetPassenger(SEAT_ID_0)) { Map::PlayerList const& players = me->GetMap()->GetPlayers(); if (me->GetMap()->IsDungeon() && !players.isEmpty()) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp index a2919de0149..7f12853ef0b 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp @@ -221,8 +221,8 @@ public: { uiVehicle1GUID = pBoss->GetGUID(); uint64 uiGrandChampionBoss1 = 0; - if (Vehicle* pVehicle = pBoss->GetVehicleKit()) - if (Unit* unit = pVehicle->GetPassenger(0)) + if (Vehicle* vehicle = pBoss->GetVehicleKit()) + if (Unit* unit = vehicle->GetPassenger(0)) uiGrandChampionBoss1 = unit->GetGUID(); if (instance) { @@ -236,8 +236,8 @@ public: { uiVehicle2GUID = pBoss->GetGUID(); uint64 uiGrandChampionBoss2 = 0; - if (Vehicle* pVehicle = pBoss->GetVehicleKit()) - if (Unit* unit = pVehicle->GetPassenger(0)) + if (Vehicle* vehicle = pBoss->GetVehicleKit()) + if (Unit* unit = vehicle->GetPassenger(0)) uiGrandChampionBoss2 = unit->GetGUID(); if (instance) { @@ -251,8 +251,8 @@ public: { uiVehicle3GUID = pBoss->GetGUID(); uint64 uiGrandChampionBoss3 = 0; - if (Vehicle* pVehicle = pBoss->GetVehicleKit()) - if (Unit* unit = pVehicle->GetPassenger(0)) + if (Vehicle* vehicle = pBoss->GetVehicleKit()) + if (Unit* unit = vehicle->GetPassenger(0)) uiGrandChampionBoss3 = unit->GetGUID(); if (instance) { diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index c313a2138a6..fab0188de4d 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -176,9 +176,9 @@ public: { if (AggroYellTimer <= diff) { - if (Unit* pMember = Unit::GetUnit(*me, Council[YellCounter])) + if (Unit* member = Unit::GetUnit(*me, Council[YellCounter])) { - DoScriptText(CouncilAggro[YellCounter].entry, pMember); + DoScriptText(CouncilAggro[YellCounter].entry, member); AggroYellTimer = CouncilAggro[YellCounter].timer; } ++YellCounter; @@ -191,10 +191,10 @@ public: { if (EnrageTimer <= diff) { - if (Unit* pMember = Unit::GetUnit(*me, Council[YellCounter])) + if (Unit* member = Unit::GetUnit(*me, Council[YellCounter])) { - pMember->CastSpell(pMember, SPELL_BERSERK, true); - DoScriptText(CouncilEnrage[YellCounter].entry, pMember); + member->CastSpell(member, SPELL_BERSERK, true); + DoScriptText(CouncilEnrage[YellCounter].entry, member); EnrageTimer = CouncilEnrage[YellCounter].timer; } ++YellCounter; @@ -242,19 +242,19 @@ public: DeathCount = 0; - Creature* pMember = NULL; + Creature* member = NULL; for (uint8 i = 0; i < 4; ++i) { - pMember = Unit::GetCreature((*me), Council[i]); - if (!pMember) + member = Unit::GetCreature((*me), Council[i]); + if (!member) continue; - if (!pMember->isAlive()) + if (!member->isAlive()) { - pMember->RemoveCorpse(); - pMember->Respawn(); + member->RemoveCorpse(); + member->Respawn(); } - pMember->AI()->EnterEvadeMode(); + member->AI()->EnterEvadeMode(); } if (instance) @@ -332,9 +332,9 @@ public: return; } - Creature* pMember = (Unit::GetCreature(*me, Council[DeathCount])); - if (pMember && pMember->isAlive()) - pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + Creature* member = (Unit::GetCreature(*me, Council[DeathCount])); + if (member && member->isAlive()) + member->DealDamage(member, member->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); ++DeathCount; EndEventTimer = 1500; } else EndEventTimer -= diff; diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 079221a97e8..f2f2f9e3cdd 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -55,8 +55,8 @@ class spell_item_trigger_spell : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { Unit* caster = GetCaster(); - if (Item* pItem = GetCastItem()) - caster->CastSpell(caster, _triggeredSpellId, true, pItem); + if (Item* item = GetCastItem()) + caster->CastSpell(caster, _triggeredSpellId, true, item); } void Register() diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index cf55bb14895..bb5d7380695 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -47,9 +47,9 @@ class item_only_for_flight : public ItemScript public: item_only_for_flight() : ItemScript("item_only_for_flight") { } - bool OnUse(Player* player, Item* pItem, SpellCastTargets const& /*targets*/) + bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/) { - uint32 itemId = pItem->GetEntry(); + uint32 itemId = item->GetEntry(); bool disabled = false; //for special scripts @@ -74,7 +74,7 @@ public: return false; // error - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); + player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); return true; } }; @@ -110,13 +110,13 @@ class item_gor_dreks_ointment : public ItemScript public: item_gor_dreks_ointment() : ItemScript("item_gor_dreks_ointment") { } - bool OnUse(Player* player, Item* pItem, SpellCastTargets const& targets) + bool OnUse(Player* player, Item* item, SpellCastTargets const& targets) { if (targets.GetUnitTarget() && targets.GetUnitTarget()->GetTypeId() == TYPEID_UNIT && targets.GetUnitTarget()->GetEntry() == 20748 && !targets.GetUnitTarget()->HasAura(32578)) return false; - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); + player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); return true; } }; @@ -130,13 +130,13 @@ class item_incendiary_explosives : public ItemScript public: item_incendiary_explosives() : ItemScript("item_incendiary_explosives") { } - bool OnUse(Player* player, Item* pItem, SpellCastTargets const & /*targets*/) + bool OnUse(Player* player, Item* item, SpellCastTargets const & /*targets*/) { if (player->FindNearestCreature(26248, 15) || player->FindNearestCreature(26249, 15)) return false; else { - player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL); + player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL); return true; } } @@ -219,7 +219,7 @@ class item_pile_fake_furs : public ItemScript public: item_pile_fake_furs() : ItemScript("item_pile_fake_furs") { } - bool OnUse(Player* player, Item* /*pItem*/, SpellCastTargets const & /*targets*/) + bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const & /*targets*/) { GameObject* go = NULL; for (uint8 i = 0; i < CaribouTrapsNum; ++i) @@ -264,14 +264,14 @@ class item_petrov_cluster_bombs : public ItemScript public: item_petrov_cluster_bombs() : ItemScript("item_petrov_cluster_bombs") { } - bool OnUse(Player* player, Item* pItem, const SpellCastTargets & /*targets*/) + bool OnUse(Player* player, Item* item, const SpellCastTargets & /*targets*/) { if (player->GetZoneId() != ZONE_ID_HOWLING) return false; if (!player->GetTransport() || player->GetAreaId() != AREA_ID_SHATTERED_STRAITS) { - player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); + player->SendEquipError(EQUIP_ERR_NONE, item, NULL); if (const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB)) Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_HERE); @@ -330,7 +330,7 @@ class item_dehta_trap_smasher : public ItemScript public: item_dehta_trap_smasher() : ItemScript("item_dehta_trap_smasher") { } - bool OnUse(Player* player, Item* /*pItem*/, const SpellCastTargets & /*targets*/) + bool OnUse(Player* player, Item* /*item*/, const SpellCastTargets & /*targets*/) { if (player->GetQuestStatus(QUEST_CANNOT_HELP_THEMSELVES) != QUEST_STATUS_INCOMPLETE) return false; @@ -367,7 +367,7 @@ class item_trident_of_nazjan : public ItemScript public: item_trident_of_nazjan() : ItemScript("item_Trident_of_Nazjan") { } - bool OnUse(Player* player, Item* pItem, const SpellCastTargets & /*targets*/) + bool OnUse(Player* player, Item* item, const SpellCastTargets & /*targets*/) { if (player->GetQuestStatus(QUEST_THE_EMISSARY) == QUEST_STATUS_INCOMPLETE) { @@ -376,9 +376,9 @@ public: pLeviroth->AI()->AttackStart(player); return false; } else - player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL); + player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL); } else - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); + player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); return true; } }; @@ -394,17 +394,17 @@ class item_captured_frog : public ItemScript public: item_captured_frog() : ItemScript("item_captured_frog") { } - bool OnUse(Player* player, Item* pItem, SpellCastTargets const& /*targets*/) + bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/) { if (player->GetQuestStatus(QUEST_THE_PERFECT_SPIES) == QUEST_STATUS_INCOMPLETE) { if (player->FindNearestCreature(NPC_VANIRAS_SENTRY_TOTEM, 10.0f)) return false; else - player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL); + player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL); } else - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); + player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); return true; } }; diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index a1920e06ad1..48be9bdba33 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -241,14 +241,14 @@ bool EquippedOk(Player* player, uint32 spellId) if (!reqSpell) continue; - Item* pItem; + Item* item; for (uint8 j = EQUIPMENT_SLOT_START; j < EQUIPMENT_SLOT_END; ++j) { - pItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, j); - if (pItem && pItem->GetTemplate()->RequiredSpell == reqSpell) + item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, j); + if (item && item->GetTemplate()->RequiredSpell == reqSpell) { //player has item equipped that require specialty. Not allow to unlearn, player has to unequip first - sLog->outDebug(LOG_FILTER_TSCR, "TSCR: player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, pItem->GetEntry()); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, item->GetEntry()); return false; } } From b02a012b4784e2073593a75315616e093327e738 Mon Sep 17 00:00:00 2001 From: kandera Date: Wed, 14 Mar 2012 14:05:39 -0300 Subject: [PATCH 0168/1149] Core/SpellScripts: fix crash caused my spell_gen_vehicle_scaling. closes #5703 (thx vincent-michael) --- src/server/scripts/Spells/spell_generic.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index f2a48b0f9d2..929206dec05 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1312,6 +1312,11 @@ class spell_gen_launch : public SpellScriptLoader } }; +enum VehicleScaling +{ + SPELL_GEAR_SCALING = 66668, +}; + class spell_gen_vehicle_scaling : public SpellScriptLoader { public: @@ -1323,7 +1328,7 @@ class spell_gen_vehicle_scaling : public SpellScriptLoader bool Load() { - return GetCaster()->GetTypeId() == TYPEID_PLAYER; + return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER; } void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) @@ -1335,7 +1340,7 @@ class spell_gen_vehicle_scaling : public SpellScriptLoader // TODO: Reserach coeffs for different vehicles switch (GetId()) { - case 66668: + case SPELL_GEAR_SCALING: factor = 1.0f; baseItemLevel = 205; break; From 2a5caef4a64645f788f6d3e33d6159725358f1dd Mon Sep 17 00:00:00 2001 From: leak Date: Wed, 14 Mar 2012 18:51:51 +0100 Subject: [PATCH 0169/1149] Revert "Core: more more cleanup" - Build test anyone? This reverts commit 20cd4c71ee6336610daab304959909b2f6397287. --- .../game/AuctionHouse/AuctionHouseMgr.cpp | 20 +- .../game/AuctionHouse/AuctionHouseMgr.h | 2 +- .../game/Entities/Item/Container/Bag.cpp | 36 +- src/server/game/Entities/Item/Container/Bag.h | 2 +- src/server/game/Entities/Item/Item.cpp | 10 +- src/server/game/Entities/Player/Player.cpp | 946 +++++++++--------- src/server/game/Entities/Player/Player.h | 54 +- src/server/game/Groups/Group.cpp | 8 +- src/server/game/Guilds/Guild.cpp | 128 +-- src/server/game/Guilds/Guild.h | 22 +- .../game/Handlers/AuctionHouseHandler.cpp | 6 +- src/server/game/Handlers/ItemHandler.cpp | 124 +-- src/server/game/Handlers/LootHandler.cpp | 22 +- src/server/game/Handlers/SpellHandler.cpp | 38 +- src/server/game/Mails/Mail.cpp | 4 +- src/server/game/Scripting/ScriptMgr.cpp | 4 +- src/server/game/Scripting/ScriptMgr.h | 4 +- .../game/Spells/Auras/SpellAuraEffects.cpp | 18 +- src/server/game/Spells/Spell.cpp | 36 +- src/server/game/Spells/SpellEffects.cpp | 18 +- src/server/scripts/Commands/cs_npc.cpp | 12 +- .../boss_grand_champions.cpp | 6 +- .../trial_of_the_champion.cpp | 12 +- .../Outland/BlackTemple/illidari_council.cpp | 30 +- src/server/scripts/Spells/spell_item.cpp | 4 +- src/server/scripts/World/item_scripts.cpp | 34 +- src/server/scripts/World/npc_professions.cpp | 8 +- 27 files changed, 804 insertions(+), 804 deletions(-) diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 43f3ff50fd8..a2e958d680f 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -64,9 +64,9 @@ AuctionHouseObject* AuctionHouseMgr::GetAuctionsMap(uint32 factionTemplateId) return &mNeutralAuctions; } -uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* item, uint32 count) +uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* pItem, uint32 count) { - uint32 MSV = item->GetTemplate()->SellPrice; + uint32 MSV = pItem->GetTemplate()->SellPrice; if (MSV <= 0) return AH_MINIMUM_DEPOSIT; @@ -89,8 +89,8 @@ uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 //does not clear ram void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& trans) { - Item* item = GetAItem(auction->item_guidlow); - if (!item) + Item* pItem = GetAItem(auction->item_guidlow); + if (!pItem) return; uint32 bidder_accId = 0; @@ -127,7 +127,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& uint32 owner_accid = sObjectMgr->GetPlayerAccountIdByGUID(auction->owner); sLog->outCommand(bidder_accId, "GM %s (Account: %u) won item in auction: %s (Entry: %u Count: %u) and pay money: %u. Original owner %s (Account: %u)", - bidder_name.c_str(), bidder_accId, item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount(), auction->bid, owner_name.c_str(), owner_accid); + bidder_name.c_str(), bidder_accId, pItem->GetTemplate()->Name1.c_str(), pItem->GetEntry(), pItem->GetCount(), auction->bid, owner_name.c_str(), owner_accid); } } @@ -147,7 +147,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& // owner in `data` will set at mail receive and item extracting PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ITEM_OWNER); stmt->setUInt32(0, auction->bidder); - stmt->setUInt32(1, item->GetGUIDLow()); + stmt->setUInt32(1, pItem->GetGUIDLow()); trans->Append(stmt); if (bidder) @@ -158,7 +158,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& } MailDraft(msgAuctionWonSubject.str(), msgAuctionWonBody.str()) - .AddItem(item) + .AddItem(pItem) .SendMailTo(trans, MailReceiver(bidder, auction->bidder), auction, MAIL_CHECK_MASK_COPIED); } } @@ -234,8 +234,8 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry* auction, SQLTransa void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry* auction, SQLTransaction& trans) { //return an item in auction to its owner by mail - Item* item = GetAItem(auction->item_guidlow); - if (!item) + Item* pItem = GetAItem(auction->item_guidlow); + if (!pItem) return; uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER); @@ -251,7 +251,7 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry* auction, SQLTransacti owner->GetSession()->SendAuctionOwnerNotification(auction); MailDraft(subject.str(), "") // TODO: fix body - .AddItem(item) + .AddItem(pItem) .SendMailTo(trans, MailReceiver(owner, auction->owner), auction, MAIL_CHECK_MASK_COPIED, 0); } } diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.h b/src/server/game/AuctionHouse/AuctionHouseMgr.h index d5432f7b00c..190fbcc5107 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.h +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.h @@ -154,7 +154,7 @@ class AuctionHouseMgr void SendAuctionOutbiddedMail(AuctionEntry* auction, uint32 newPrice, Player* newBidder, SQLTransaction& trans); void SendAuctionCancelledToBidderMail(AuctionEntry* auction, SQLTransaction& trans); - static uint32 GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* item, uint32 count); + static uint32 GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* pItem, uint32 count); static AuctionHouseEntry const* GetAuctionHouseEntry(uint32 factionTemplateId); public: diff --git a/src/server/game/Entities/Item/Container/Bag.cpp b/src/server/game/Entities/Item/Container/Bag.cpp index 1b9d5c12978..4eede93bd37 100755 --- a/src/server/game/Entities/Item/Container/Bag.cpp +++ b/src/server/game/Entities/Item/Container/Bag.cpp @@ -153,18 +153,18 @@ void Bag::RemoveItem(uint8 slot, bool /*update*/) SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (slot * 2), 0); } -void Bag::StoreItem(uint8 slot, Item* item, bool /*update*/) +void Bag::StoreItem(uint8 slot, Item* pItem, bool /*update*/) { ASSERT(slot < MAX_BAG_SIZE); - if (item && item->GetGUID() != this->GetGUID()) + if (pItem && pItem->GetGUID() != this->GetGUID()) { - m_bagslot[slot] = item; - SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (slot * 2), item->GetGUID()); - item->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); - item->SetUInt64Value(ITEM_FIELD_OWNER, GetOwnerGUID()); - item->SetContainer(this); - item->SetSlot(slot); + m_bagslot[slot] = pItem; + SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (slot * 2), pItem->GetGUID()); + pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); + pItem->SetUInt64Value(ITEM_FIELD_OWNER, GetOwnerGUID()); + pItem->SetContainer(this); + pItem->SetSlot(slot); } } @@ -189,22 +189,22 @@ bool Bag::IsEmpty() const uint32 Bag::GetItemCount(uint32 item, Item* eItem) const { - Item* item; + Item* pItem; uint32 count = 0; for (uint32 i=0; i < GetBagSize(); ++i) { - item = m_bagslot[i]; - if (item && item != eItem && item->GetEntry() == item) - count += item->GetCount(); + pItem = m_bagslot[i]; + if (pItem && pItem != eItem && pItem->GetEntry() == item) + count += pItem->GetCount(); } if (eItem && eItem->GetTemplate()->GemProperties) { for (uint32 i=0; i < GetBagSize(); ++i) { - item = m_bagslot[i]; - if (item && item != eItem && item->GetTemplate()->Socket[0].Color) - count += item->GetGemCountWithID(item); + pItem = m_bagslot[i]; + if (pItem && pItem != eItem && pItem->GetTemplate()->Socket[0].Color) + count += pItem->GetGemCountWithID(item); } } @@ -215,9 +215,9 @@ uint32 Bag::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem) { uint32 count = 0; for (uint32 i = 0; i < GetBagSize(); ++i) - if (Item* item = m_bagslot[i]) - if (item != skipItem) - if (ItemTemplate const* pProto = item->GetTemplate()) + if (Item* pItem = m_bagslot[i]) + if (pItem != skipItem) + if (ItemTemplate const* pProto = pItem->GetTemplate()) if (pProto->ItemLimitCategory == limitCategory) count += m_bagslot[i]->GetCount(); diff --git a/src/server/game/Entities/Item/Container/Bag.h b/src/server/game/Entities/Item/Container/Bag.h index 79acd9ba4af..5a533d9cf57 100755 --- a/src/server/game/Entities/Item/Container/Bag.h +++ b/src/server/game/Entities/Item/Container/Bag.h @@ -38,7 +38,7 @@ class Bag : public Item bool Create(uint32 guidlow, uint32 itemid, Player const* owner); void Clear(); - void StoreItem(uint8 slot, Item* item, bool update); + void StoreItem(uint8 slot, Item* pItem, bool update); void RemoveItem(uint8 slot, bool update); Item* GetItemByPos(uint8 slot) const; diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 4e76ddfe0a8..90f6f4a217c 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1021,14 +1021,14 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player) ASSERT(count !=0 && "pProto->Stackable == 0 but checked at loading already"); - Item* item = NewItemOrBag(pProto); - if (item->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), item, player)) + Item* pItem = NewItemOrBag(pProto); + if (pItem->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), item, player)) { - item->SetCount(count); - return item; + pItem->SetCount(count); + return pItem; } else - delete item; + delete pItem; } else ASSERT(false); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a1e8ddd95d1..f0b974fa673 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1160,31 +1160,31 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) // or ammo not equipped in special bag for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) { - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { uint16 eDest; // equip offhand weapon/shield if it attempt equipped before main-hand weapon - InventoryResult msg = CanEquipItem(NULL_SLOT, eDest, item, false); + InventoryResult msg = CanEquipItem(NULL_SLOT, eDest, pItem, false); if (msg == EQUIP_ERR_OK) { RemoveItem(INVENTORY_SLOT_BAG_0, i, true); - EquipItem(eDest, item, true); + EquipItem(eDest, pItem, true); } // move other items to more appropriate slots (ammo not equipped in special bag) else { ItemPosCountVec sDest; - msg = CanStoreItem(NULL_BAG, NULL_SLOT, sDest, item, false); + msg = CanStoreItem(NULL_BAG, NULL_SLOT, sDest, pItem, false); if (msg == EQUIP_ERR_OK) { RemoveItem(INVENTORY_SLOT_BAG_0, i, true); - item = StoreItem(sDest, item, true); + pItem = StoreItem(sDest, pItem, true); } // if this is ammo then use it - msg = CanUseAmmo(item->GetEntry()); + msg = CanUseAmmo(pItem->GetEntry()); if (msg == EQUIP_ERR_OK) - SetAmmo(item->GetEntry()); + SetAmmo(pItem->GetEntry()); } } } @@ -4854,15 +4854,15 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC continue; } - Item* item = NewItemOrBag(itemProto); - if (!item->LoadFromDB(item_guidlow, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER), fields, item_template)) + Item* pItem = NewItemOrBag(itemProto); + if (!pItem->LoadFromDB(item_guidlow, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER), fields, item_template)) { - item->FSetState(ITEM_REMOVED); - item->SaveToDB(trans); // it also deletes item object! + pItem->FSetState(ITEM_REMOVED); + pItem->SaveToDB(trans); // it also deletes item object! continue; } - draft.AddItem(item); + draft.AddItem(pItem); } while (resultItems->NextRow()); } @@ -5270,8 +5270,8 @@ Corpse* Player::GetCorpse() const void Player::DurabilityLossAll(double percent, bool inventory) { for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; i++) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - DurabilityLoss(item, percent); + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + DurabilityLoss(pItem, percent); if (inventory) { @@ -5279,8 +5279,8 @@ void Player::DurabilityLossAll(double percent, bool inventory) // for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - DurabilityLoss(item, percent); + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + DurabilityLoss(pItem, percent); // keys not have durability //for (int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++) @@ -5288,8 +5288,8 @@ void Player::DurabilityLossAll(double percent, bool inventory) for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) - if (Item* item = GetItemByPos(i, j)) - DurabilityLoss(item, percent); + if (Item* pItem = GetItemByPos(i, j)) + DurabilityLoss(pItem, percent); } } @@ -5314,8 +5314,8 @@ void Player::DurabilityLoss(Item* item, double percent) void Player::DurabilityPointsLossAll(int32 points, bool inventory) { for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; i++) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - DurabilityPointsLoss(item, points); + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + DurabilityPointsLoss(pItem, points); if (inventory) { @@ -5323,8 +5323,8 @@ void Player::DurabilityPointsLossAll(int32 points, bool inventory) // for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - DurabilityPointsLoss(item, points); + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + DurabilityPointsLoss(pItem, points); // keys not have durability //for (int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++) @@ -5332,8 +5332,8 @@ void Player::DurabilityPointsLossAll(int32 points, bool inventory) for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) - if (Item* item = GetItemByPos(i, j)) - DurabilityPointsLoss(item, points); + if (Item* pItem = GetItemByPos(i, j)) + DurabilityPointsLoss(pItem, points); } } @@ -5366,8 +5366,8 @@ void Player::DurabilityPointsLoss(Item* item, int32 points) void Player::DurabilityPointLossForEquipSlot(EquipmentSlots slot) { - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) - DurabilityPointsLoss(item, 1); + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) + DurabilityPointsLoss(pItem, 1); } uint32 Player::DurabilityRepairAll(bool cost, float discountMod, bool guildBank) @@ -9916,13 +9916,13 @@ InventoryResult Player::CanUnequipItems(uint32 item, uint32 count) const InventoryResult res = EQUIP_ERR_OK; for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->GetEntry() == item) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->GetEntry() == item) { InventoryResult ires = CanUnequipItem(INVENTORY_SLOT_BAG_0 << 8 | i, false); if (ires == EQUIP_ERR_OK) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return EQUIP_ERR_OK; } @@ -9931,19 +9931,19 @@ InventoryResult Player::CanUnequipItems(uint32 item, uint32 count) const } for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->GetEntry() == item) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->GetEntry() == item) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return EQUIP_ERR_OK; } for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->GetEntry() == item) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->GetEntry() == item) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return EQUIP_ERR_OK; } @@ -9951,10 +9951,10 @@ InventoryResult Player::CanUnequipItems(uint32 item, uint32 count) const for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); ++j) - if (Item* item = GetItemByPos(i, j)) - if (item->GetEntry() == item) + if (Item* pItem = GetItemByPos(i, j)) + if (pItem->GetEntry() == item) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return EQUIP_ERR_OK; } @@ -9967,14 +9967,14 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const { uint32 count = 0; for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; i++) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item != skipItem && item->GetEntry() == item) - count += item->GetCount(); + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem != skipItem && pItem->GetEntry() == item) + count += pItem->GetCount(); for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item != skipItem && item->GetEntry() == item) - count += item->GetCount(); + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem != skipItem && pItem->GetEntry() == item) + count += pItem->GetCount(); for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) @@ -9982,16 +9982,16 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const if (skipItem && skipItem->GetTemplate()->GemProperties) for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item != skipItem && item->GetTemplate()->Socket[0].Color) - count += item->GetGemCountWithID(item); + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem != skipItem && pItem->GetTemplate()->Socket[0].Color) + count += pItem->GetGemCountWithID(item); if (inBankAlso) { for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item != skipItem && item->GetEntry() == item) - count += item->GetCount(); + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem != skipItem && pItem->GetEntry() == item) + count += pItem->GetCount(); for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) @@ -9999,9 +9999,9 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const if (skipItem && skipItem->GetTemplate()->GemProperties) for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item != skipItem && item->GetTemplate()->Socket[0].Color) - count += item->GetGemCountWithID(item); + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem != skipItem && pItem->GetTemplate()->Socket[0].Color) + count += pItem->GetGemCountWithID(item); } return count; @@ -10011,29 +10011,29 @@ uint32 Player::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipIte { uint32 count = 0; for (int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item != skipItem) - if (ItemTemplate const* pProto = item->GetTemplate()) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem != skipItem) + if (ItemTemplate const* pProto = pItem->GetTemplate()) if (pProto->ItemLimitCategory == limitCategory) - count += item->GetCount(); + count += pItem->GetCount(); for (int i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item != skipItem) - if (ItemTemplate const* pProto = item->GetTemplate()) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem != skipItem) + if (ItemTemplate const* pProto = pItem->GetTemplate()) if (pProto->ItemLimitCategory == limitCategory) - count += item->GetCount(); + count += pItem->GetCount(); for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) count += pBag->GetItemCountWithLimitCategory(limitCategory, skipItem); for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item != skipItem) - if (ItemTemplate const* pProto = item->GetTemplate()) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem != skipItem) + if (ItemTemplate const* pProto = pItem->GetTemplate()) if (pProto->ItemLimitCategory == limitCategory) - count += item->GetCount(); + count += pItem->GetCount(); for (int i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) @@ -10045,33 +10045,33 @@ uint32 Player::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipIte Item* Player::GetItemByGuid(uint64 guid) const { for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->GetGUID() == guid) - return item; + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->GetGUID() == guid) + return pItem; for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->GetGUID() == guid) - return item; + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->GetGUID() == guid) + return pItem; for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->GetGUID() == guid) - return item; + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->GetGUID() == guid) + return pItem; for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); ++j) - if (Item* item = pBag->GetItemByPos(j)) - if (item->GetGUID() == guid) - return item; + if (Item* pItem = pBag->GetItemByPos(j)) + if (pItem->GetGUID() == guid) + return pItem; for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); ++j) - if (Item* item = pBag->GetItemByPos(j)) - if (item->GetGUID() == guid) - return item; + if (Item* pItem = pBag->GetItemByPos(j)) + if (pItem->GetGUID() == guid) + return pItem; return NULL; } @@ -10262,20 +10262,20 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const uint32 tempcount = 0; for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; i++) { - Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (item && item->GetEntry() == item && !item->IsInTrade()) + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return true; } } for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) { - Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (item && item->GetEntry() == item && !item->IsInTrade()) + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return true; } @@ -10286,10 +10286,10 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const { for (uint32 j = 0; j < pBag->GetBagSize(); j++) { - Item* item = GetItemByPos(i, j); - if (item && item->GetEntry() == item && !item->IsInTrade()) + Item* pItem = GetItemByPos(i, j); + if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return true; } @@ -10301,10 +10301,10 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const { for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; i++) { - Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (item && item->GetEntry() == item && !item->IsInTrade()) + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return true; } @@ -10315,10 +10315,10 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const { for (uint32 j = 0; j < pBag->GetBagSize(); j++) { - Item* item = GetItemByPos(i, j); - if (item && item->GetEntry() == item && !item->IsInTrade()) + Item* pItem = GetItemByPos(i, j); + if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return true; } @@ -10338,10 +10338,10 @@ bool Player::HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_ if (i == except_slot) continue; - Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (item && item->GetEntry() == item) + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (pItem && pItem->GetEntry() == item) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return true; } @@ -10355,10 +10355,10 @@ bool Player::HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_ if (i == except_slot) continue; - Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (item && item->GetTemplate()->Socket[0].Color) + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (pItem && pItem->GetTemplate()->Socket[0].Color) { - tempcount += item->GetGemCountWithID(item); + tempcount += pItem->GetGemCountWithID(item); if (tempcount >= count) return true; } @@ -10376,24 +10376,24 @@ bool Player::HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 if (i == except_slot) continue; - Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (!item) + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (!pItem) continue; - ItemTemplate const* pProto = item->GetTemplate(); + ItemTemplate const* pProto = pItem->GetTemplate(); if (!pProto) continue; if (pProto->ItemLimitCategory == limitCategory) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return true; } - if (pProto->Socket[0].Color || item->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT)) + if (pProto->Socket[0].Color || pItem->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT)) { - tempcount += item->GetGemCountWithLimitCategory(limitCategory); + tempcount += pItem->GetGemCountWithLimitCategory(limitCategory); if (tempcount >= count) return true; } @@ -10402,7 +10402,7 @@ bool Player::HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 return false; } -InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* item, uint32* no_space_count) const +InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count) const { ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(entry); if (!pProto) @@ -10412,7 +10412,7 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; } - if (item && item->m_lootGenerated) + if (pItem && pItem->m_lootGenerated) return EQUIP_ERR_ALREADY_LOOTED; // no maximum @@ -10421,7 +10421,7 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item if (pProto->MaxCount > 0) { - uint32 curcount = GetItemCount(pProto->ItemId, true, item); + uint32 curcount = GetItemCount(pProto->ItemId, true, pItem); if (curcount + count > uint32(pProto->MaxCount)) { if (no_space_count) @@ -10443,7 +10443,7 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item if (limitEntry->mode == ITEM_LIMIT_CATEGORY_MODE_HAVE) { - uint32 curcount = GetItemCountWithLimitCategory(pProto->ItemLimitCategory, item); + uint32 curcount = GetItemCountWithLimitCategory(pProto->ItemLimitCategory, pItem); if (curcount + count > uint32(limitEntry->maxCount)) { if (no_space_count) @@ -10458,17 +10458,17 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item bool Player::HasItemTotemCategory(uint32 TotemCategory) const { - Item* item; + Item* pItem; for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) { - item = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, i); - if (item && IsTotemCategoryCompatiableWith(item->GetTemplate()->TotemCategory, TotemCategory)) + pItem = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, i); + if (pItem && IsTotemCategoryCompatiableWith(pItem->GetTemplate()->TotemCategory, TotemCategory)) return true; } for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) { - item = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, i); - if (item && IsTotemCategoryCompatiableWith(item->GetTemplate()->TotemCategory, TotemCategory)) + pItem = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, i); + if (pItem && IsTotemCategoryCompatiableWith(pItem->GetTemplate()->TotemCategory, TotemCategory)) return true; } for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) @@ -10477,8 +10477,8 @@ bool Player::HasItemTotemCategory(uint32 TotemCategory) const { for (uint32 j = 0; j < pBag->GetBagSize(); ++j) { - item = GetUseableItemByPos(i, j); - if (item && IsTotemCategoryCompatiableWith(item->GetTemplate()->TotemCategory, TotemCategory)) + pItem = GetUseableItemByPos(i, j); + if (pItem && IsTotemCategoryCompatiableWith(pItem->GetTemplate()->TotemCategory, TotemCategory)) return true; } } @@ -10681,7 +10681,7 @@ InventoryResult Player::CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 sl return EQUIP_ERR_OK; } -InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 entry, uint32 count, Item* item, bool swap, uint32* no_space_count) const +InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 entry, uint32 count, Item* pItem, bool swap, uint32* no_space_count) const { sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, entry, count); @@ -10693,17 +10693,17 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED :EQUIP_ERR_ITEM_NOT_FOUND; } - if (item) + if (pItem) { // item used - if (item->m_lootGenerated) + if (pItem->m_lootGenerated) { if (no_space_count) *no_space_count = count; return EQUIP_ERR_ALREADY_LOOTED; } - if (item->IsBindedNotWith(this)) + if (pItem->IsBindedNotWith(this)) { if (no_space_count) *no_space_count = count; @@ -10713,7 +10713,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des // check count of items (skip for auto move for same player from bank) uint32 no_similar_count = 0; // can't store this amount similar items - InventoryResult res = CanTakeMoreSimilarItems(entry, count, item, &no_similar_count); + InventoryResult res = CanTakeMoreSimilarItems(entry, count, pItem, &no_similar_count); if (res != EQUIP_ERR_OK) { if (count == no_similar_count) @@ -10728,7 +10728,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des // in specific slot if (bag != NULL_BAG && slot != NULL_SLOT) { - res = CanStoreItem_InSpecificSlot(bag, slot, dest, pProto, count, swap, item); + res = CanStoreItem_InSpecificSlot(bag, slot, dest, pProto, count, swap, pItem); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10757,7 +10757,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des { if (bag == INVENTORY_SLOT_BAG_0) // inventory { - res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, true, item, bag, slot); + res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10775,7 +10775,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; } - res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, true, item, bag, slot); + res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10796,9 +10796,9 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des else // equipped bag { // we need check 2 time (specialized/non_specialized), use NULL_BAG to prevent skipping bag - res = CanStoreItem_InBag(bag, dest, pProto, count, true, false, item, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, true, false, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) - res = CanStoreItem_InBag(bag, dest, pProto, count, true, true, item, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, true, true, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) { @@ -10826,7 +10826,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des if (pProto->BagFamily & BAG_FAMILY_MASK_KEYS) { uint32 keyringSize = GetMaxKeyringSize(); - res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, KEYRING_SLOT_START+keyringSize, dest, pProto, count, false, item, bag, slot); + res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, KEYRING_SLOT_START+keyringSize, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10844,7 +10844,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; } - res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, item, bag, slot); + res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10864,7 +10864,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } else if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS) { - res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, item, bag, slot); + res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10883,7 +10883,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } } - res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, item, bag, slot); + res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10903,9 +10903,9 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } else // equipped bag { - res = CanStoreItem_InBag(bag, dest, pProto, count, false, false, item, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, false, false, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) - res = CanStoreItem_InBag(bag, dest, pProto, count, false, true, item, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, false, true, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) { @@ -10931,7 +10931,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des // search stack for merge to if (pProto->Stackable != 1) { - res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, true, item, bag, slot); + res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10949,7 +10949,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; } - res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, true, item, bag, slot); + res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10971,7 +10971,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des { for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, true, false, item, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, true, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -10989,7 +10989,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, true, true, item, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, true, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11011,7 +11011,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des if (pProto->BagFamily & BAG_FAMILY_MASK_KEYS) { uint32 keyringSize = GetMaxKeyringSize(); - res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, KEYRING_SLOT_START+keyringSize, dest, pProto, count, false, item, bag, slot); + res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, KEYRING_SLOT_START+keyringSize, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -11031,7 +11031,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } else if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS) { - res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, item, bag, slot); + res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -11052,7 +11052,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, false, false, item, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, false, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11068,11 +11068,11 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } } - if (item && item->IsNotEmptyBag()) + if (pItem && pItem->IsNotEmptyBag()) return EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG; // search free slot - res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, item, bag, slot); + res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -11092,7 +11092,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, false, true, item, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, false, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11162,30 +11162,30 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const // check free space for all items for (int k = 0; k < count; ++k) { - Item* item = pItems[k]; + Item* pItem = pItems[k]; // no item - if (!item) continue; + if (!pItem) continue; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItems %i. item = %u, count = %u", k + 1, item->GetEntry(), item->GetCount()); - ItemTemplate const* pProto = item->GetTemplate(); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItems %i. item = %u, count = %u", k + 1, pItem->GetEntry(), pItem->GetCount()); + ItemTemplate const* pProto = pItem->GetTemplate(); // strange item if (!pProto) return EQUIP_ERR_ITEM_NOT_FOUND; // item used - if (item->m_lootGenerated) + if (pItem->m_lootGenerated) return EQUIP_ERR_ALREADY_LOOTED; // item it 'bind' - if (item->IsBindedNotWith(this)) + if (pItem->IsBindedNotWith(this)) return EQUIP_ERR_DONT_OWN_THAT_ITEM; ItemTemplate const* pBagProto; // item is 'one item only' - InventoryResult res = CanTakeMoreSimilarItems(item); + InventoryResult res = CanTakeMoreSimilarItems(pItem); if (res != EQUIP_ERR_OK) return res; @@ -11197,9 +11197,9 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const for (uint8 t = KEYRING_SLOT_START; t < KEYRING_SLOT_END; ++t) { pItem2 = GetItemByPos(INVENTORY_SLOT_BAG_0, t); - if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_keys[t-KEYRING_SLOT_START] + item->GetCount() <= pProto->GetMaxStackSize()) + if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_keys[t-KEYRING_SLOT_START] + pItem->GetCount() <= pProto->GetMaxStackSize()) { - inv_keys[t-KEYRING_SLOT_START] += item->GetCount(); + inv_keys[t-KEYRING_SLOT_START] += pItem->GetCount(); b_found = true; break; } @@ -11209,9 +11209,9 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const for (int t = CURRENCYTOKEN_SLOT_START; t < CURRENCYTOKEN_SLOT_END; ++t) { pItem2 = GetItemByPos(INVENTORY_SLOT_BAG_0, t); - if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_tokens[t-CURRENCYTOKEN_SLOT_START] + item->GetCount() <= pProto->GetMaxStackSize()) + if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_tokens[t-CURRENCYTOKEN_SLOT_START] + pItem->GetCount() <= pProto->GetMaxStackSize()) { - inv_tokens[t-CURRENCYTOKEN_SLOT_START] += item->GetCount(); + inv_tokens[t-CURRENCYTOKEN_SLOT_START] += pItem->GetCount(); b_found = true; break; } @@ -11221,9 +11221,9 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const for (int t = INVENTORY_SLOT_ITEM_START; t < INVENTORY_SLOT_ITEM_END; ++t) { pItem2 = GetItemByPos(INVENTORY_SLOT_BAG_0, t); - if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_slot_items[t-INVENTORY_SLOT_ITEM_START] + item->GetCount() <= pProto->GetMaxStackSize()) + if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_slot_items[t-INVENTORY_SLOT_ITEM_START] + pItem->GetCount() <= pProto->GetMaxStackSize()) { - inv_slot_items[t-INVENTORY_SLOT_ITEM_START] += item->GetCount(); + inv_slot_items[t-INVENTORY_SLOT_ITEM_START] += pItem->GetCount(); b_found = true; break; } @@ -11234,14 +11234,14 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const { if (Bag* bag = GetBagByPos(t)) { - if (ItemCanGoIntoBag(item->GetTemplate(), bag->GetTemplate())) + if (ItemCanGoIntoBag(pItem->GetTemplate(), bag->GetTemplate())) { for (uint32 j = 0; j < bag->GetBagSize(); j++) { pItem2 = GetItemByPos(t, j); - if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_bags[t-INVENTORY_SLOT_BAG_START][j] + item->GetCount() <= pProto->GetMaxStackSize()) + if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_bags[t-INVENTORY_SLOT_BAG_START][j] + pItem->GetCount() <= pProto->GetMaxStackSize()) { - inv_bags[t-INVENTORY_SLOT_BAG_START][j] += item->GetCount(); + inv_bags[t-INVENTORY_SLOT_BAG_START][j] += pItem->GetCount(); b_found = true; break; } @@ -11360,35 +11360,35 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const InventoryResult Player::CanEquipNewItem(uint8 slot, uint16 &dest, uint32 item, bool swap) const { dest = 0; - Item* item = Item::CreateItem(item, 1, this); - if (item) + Item* pItem = Item::CreateItem(item, 1, this); + if (pItem) { - InventoryResult result = CanEquipItem(slot, dest, item, swap); - delete item; + InventoryResult result = CanEquipItem(slot, dest, pItem, swap); + delete pItem; return result; } return EQUIP_ERR_ITEM_NOT_FOUND; } -InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* item, bool swap, bool not_loading) const +InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool swap, bool not_loading) const { dest = 0; - if (item) + if (pItem) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanEquipItem slot = %u, item = %u, count = %u", slot, item->GetEntry(), item->GetCount()); - ItemTemplate const* pProto = item->GetTemplate(); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanEquipItem slot = %u, item = %u, count = %u", slot, pItem->GetEntry(), pItem->GetCount()); + ItemTemplate const* pProto = pItem->GetTemplate(); if (pProto) { // item used - if (item->m_lootGenerated) + if (pItem->m_lootGenerated) return EQUIP_ERR_ALREADY_LOOTED; - if (item->IsBindedNotWith(this)) + if (pItem->IsBindedNotWith(this)) return EQUIP_ERR_DONT_OWN_THAT_ITEM; // check count of items (skip for auto move for same player from bank) - InventoryResult res = CanTakeMoreSimilarItems(item); + InventoryResult res = CanTakeMoreSimilarItems(pItem); if (res != EQUIP_ERR_OK) return res; @@ -11429,7 +11429,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* item, bool if (eslot == NULL_SLOT) return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED; - res = CanUseItem(item, not_loading); + res = CanUseItem(pItem, not_loading); if (res != EQUIP_ERR_OK) return res; @@ -11437,7 +11437,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* item, bool return EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE; // if swap ignore item (equipped also) - InventoryResult res2 = CanEquipUniqueItem(item, swap ? eslot : uint8(NULL_SLOT)); + InventoryResult res2 = CanEquipUniqueItem(pItem, swap ? eslot : uint8(NULL_SLOT)); if (res2 != EQUIP_ERR_OK) return res2; @@ -11445,7 +11445,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* item, bool if (pProto->Class == ITEM_CLASS_QUIVER) for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Item* pBag = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pBag != item) + if (pBag != pItem) if (ItemTemplate const* pBagProto = pBag->GetTemplate()) if (pBagProto->Class == pProto->Class && (!swap || pBag->GetSlot() != eslot)) return (pBagProto->SubClass == ITEM_SUBCLASS_AMMO_POUCH) @@ -11507,20 +11507,20 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const if (!IsEquipmentPos(pos) && !IsBagPos(pos)) return EQUIP_ERR_OK; - Item* item = GetItemByPos(pos); + Item* pItem = GetItemByPos(pos); // Applied only to existed equipped item - if (!item) + if (!pItem) return EQUIP_ERR_OK; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUnequipItem slot = %u, item = %u, count = %u", pos, item->GetEntry(), item->GetCount()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUnequipItem slot = %u, item = %u, count = %u", pos, pItem->GetEntry(), pItem->GetCount()); - ItemTemplate const* pProto = item->GetTemplate(); + ItemTemplate const* pProto = pItem->GetTemplate(); if (!pProto) return EQUIP_ERR_ITEM_NOT_FOUND; // item used - if (item->m_lootGenerated) + if (pItem->m_lootGenerated) return EQUIP_ERR_ALREADY_LOOTED; // do not allow unequipping gear except weapons, offhands, projectiles, relics in @@ -11536,42 +11536,42 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const return EQUIP_ERR_NOT_DURING_ARENA_MATCH; } - if (!swap && item->IsNotEmptyBag()) + if (!swap && pItem->IsNotEmptyBag()) return EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS; return EQUIP_ERR_OK; } -InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item* item, bool swap, bool not_loading) const +InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item* pItem, bool swap, bool not_loading) const { - if (!item) + if (!pItem) return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND; - uint32 count = item->GetCount(); + uint32 count = pItem->GetCount(); - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, item->GetEntry(), item->GetCount()); - ItemTemplate const* pProto = item->GetTemplate(); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, pItem->GetEntry(), pItem->GetCount()); + ItemTemplate const* pProto = pItem->GetTemplate(); if (!pProto) return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND; // item used - if (item->m_lootGenerated) + if (pItem->m_lootGenerated) return EQUIP_ERR_ALREADY_LOOTED; - if (item->IsBindedNotWith(this)) + if (pItem->IsBindedNotWith(this)) return EQUIP_ERR_DONT_OWN_THAT_ITEM; // Currency tokens are not supposed to be swapped out of their hidden bag - uint8 pItemslot = item->GetSlot(); + uint8 pItemslot = pItem->GetSlot(); if (pItemslot >= CURRENCYTOKEN_SLOT_START && pItemslot < CURRENCYTOKEN_SLOT_END) { sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to move token [guid: %u, entry: %u] out of the currency bag!", - GetName(), GetGUIDLow(), item->GetGUIDLow(), pProto->ItemId); + GetName(), GetGUIDLow(), pItem->GetGUIDLow(), pProto->ItemId); return EQUIP_ERR_ITEMS_CANT_BE_SWAPPED; } // check count of items (skip for auto move for same player from bank) - InventoryResult res = CanTakeMoreSimilarItems(item); + InventoryResult res = CanTakeMoreSimilarItems(pItem); if (res != EQUIP_ERR_OK) return res; @@ -11580,18 +11580,18 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest { if (slot >= BANK_SLOT_BAG_START && slot < BANK_SLOT_BAG_END) { - if (!item->IsBag()) + if (!pItem->IsBag()) return EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT; if (slot - BANK_SLOT_BAG_START >= GetBankBagSlotCount()) return EQUIP_ERR_MUST_PURCHASE_THAT_BAG_SLOT; - res = CanUseItem(item, not_loading); + res = CanUseItem(pItem, not_loading); if (res != EQUIP_ERR_OK) return res; } - res = CanStoreItem_InSpecificSlot(bag, slot, dest, pProto, count, swap, item); + res = CanStoreItem_InSpecificSlot(bag, slot, dest, pProto, count, swap, pItem); if (res != EQUIP_ERR_OK) return res; @@ -11604,7 +11604,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest // in specific bag if (bag != NULL_BAG) { - if (item->IsNotEmptyBag()) + if (pItem->IsNotEmptyBag()) return EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG; // search stack in bag for merge to @@ -11612,7 +11612,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest { if (bag == INVENTORY_SLOT_BAG_0) { - res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, true, item, bag, slot); + res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) return res; @@ -11621,9 +11621,9 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest } else { - res = CanStoreItem_InBag(bag, dest, pProto, count, true, false, item, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, true, false, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) - res = CanStoreItem_InBag(bag, dest, pProto, count, true, true, item, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, true, true, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) return res; @@ -11636,7 +11636,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest // search free slot in bag if (bag == INVENTORY_SLOT_BAG_0) { - res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, false, item, bag, slot); + res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) return res; @@ -11645,9 +11645,9 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest } else { - res = CanStoreItem_InBag(bag, dest, pProto, count, false, false, item, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, false, false, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) - res = CanStoreItem_InBag(bag, dest, pProto, count, false, true, item, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, false, true, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) return res; @@ -11663,7 +11663,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest if (pProto->Stackable != 1) { // in slots - res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, true, item, bag, slot); + res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) return res; @@ -11675,7 +11675,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest { for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, true, false, item, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, true, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11686,7 +11686,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, true, true, item, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, true, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11700,7 +11700,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest { for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, false, false, item, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, false, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11710,7 +11710,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest } // search free space - res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, false, item, bag, slot); + res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) return res; @@ -11719,7 +11719,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, false, true, item, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, false, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11729,11 +11729,11 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest return EQUIP_ERR_BANK_FULL; } -InventoryResult Player::CanUseItem(Item* item, bool not_loading) const +InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const { - if (item) + if (pItem) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseItem item = %u", item->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseItem item = %u", pItem->GetEntry()); if (!isAlive() && not_loading) return EQUIP_ERR_YOU_ARE_DEAD; @@ -11741,20 +11741,20 @@ InventoryResult Player::CanUseItem(Item* item, bool not_loading) const //if (isStunned()) // return EQUIP_ERR_YOU_ARE_STUNNED; - ItemTemplate const* pProto = item->GetTemplate(); + ItemTemplate const* pProto = pItem->GetTemplate(); if (pProto) { - if (item->IsBindedNotWith(this)) + if (pItem->IsBindedNotWith(this)) return EQUIP_ERR_DONT_OWN_THAT_ITEM; InventoryResult res = CanUseItem(pProto); if (res != EQUIP_ERR_OK) return res; - if (item->GetSkill() != 0) + if (pItem->GetSkill() != 0) { bool allowEquip = false; - uint32 itemSkill = item->GetSkill(); + uint32 itemSkill = pItem->GetSkill(); // Armor that is binded to account can "morph" from plate to mail, etc. if skill is not learned yet. if (pProto->Quality == ITEM_QUALITY_HEIRLOOM && pProto->Class == ITEM_CLASS_ARMOR && !HasSkill(itemSkill)) { @@ -11985,33 +11985,33 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update return StoreNewItem(dest, item, update, randomPropertyId, allowedLooters); } -// Return stored item (if stored to stack, it can diff. from item). And item ca be deleted in this case. +// Return stored item (if stored to stack, it can diff. from pItem). And pItem ca be deleted in this case. Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update, int32 randomPropertyId, AllowedLooterSet& allowedLooters) { uint32 count = 0; for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); ++itr) count += itr->count; - Item* item = Item::CreateItem(item, count, this); - if (item) + Item* pItem = Item::CreateItem(item, count, this); + if (pItem) { ItemAddedQuestCheck(item, count); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item, count); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, item, 1); if (randomPropertyId) - item->SetItemRandomProperties(randomPropertyId); - item = StoreItem(dest, item, update); + pItem->SetItemRandomProperties(randomPropertyId); + pItem = StoreItem(dest, pItem, update); - const ItemTemplate* proto = item->GetTemplate(); + const ItemTemplate* proto = pItem->GetTemplate(); for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) if (proto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE && proto->Spells[i].SpellId > 0) // On obtain trigger - CastSpell(this, proto->Spells[i].SpellId, true, item); + CastSpell(this, proto->Spells[i].SpellId, true, pItem); - if (allowedLooters.size() > 1 && item->GetTemplate()->GetMaxStackSize() == 1 && item->IsSoulBound()) + if (allowedLooters.size() > 1 && pItem->GetTemplate()->GetMaxStackSize() == 1 && pItem->IsSoulBound()) { - item->SetSoulboundTradeable(allowedLooters); - item->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, GetTotalPlayedTime()); - AddTradeableItem(item); + pItem->SetSoulboundTradeable(allowedLooters); + pItem->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, GetTotalPlayedTime()); + AddTradeableItem(pItem); // save data std::ostringstream ss; @@ -12021,20 +12021,20 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update ss << ' ' << *itr; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEM_BOP_TRADE); - stmt->setUInt32(0, item->GetGUIDLow()); + stmt->setUInt32(0, pItem->GetGUIDLow()); stmt->setString(1, ss.str()); CharacterDatabase.Execute(stmt); } } - return item; + return pItem; } -Item* Player::StoreItem(ItemPosCountVec const& dest, Item* item, bool update) +Item* Player::StoreItem(ItemPosCountVec const& dest, Item* pItem, bool update) { - if (!item) + if (!pItem) return NULL; - Item* lastItem = item; + Item* lastItem = pItem; for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end();) { uint16 pos = itr->pos; @@ -12044,75 +12044,75 @@ Item* Player::StoreItem(ItemPosCountVec const& dest, Item* item, bool update) if (itr == dest.end()) { - lastItem = _StoreItem(pos, item, count, false, update); + lastItem = _StoreItem(pos, pItem, count, false, update); break; } - lastItem = _StoreItem(pos, item, count, true, update); + lastItem = _StoreItem(pos, pItem, count, true, update); } return lastItem; } -// Return stored item (if stored to stack, it can diff. from item). And item ca be deleted in this case. -Item* Player::_StoreItem(uint16 pos, Item* item, uint32 count, bool clone, bool update) +// Return stored item (if stored to stack, it can diff. from pItem). And pItem ca be deleted in this case. +Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool update) { - if (!item) + if (!pItem) return NULL; uint8 bag = pos >> 8; uint8 slot = pos & 255; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: StoreItem bag = %u, slot = %u, item = %u, count = %u, guid = %u", bag, slot, item->GetEntry(), count, item->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: StoreItem bag = %u, slot = %u, item = %u, count = %u, guid = %u", bag, slot, pItem->GetEntry(), count, pItem->GetGUIDLow()); Item* pItem2 = GetItemByPos(bag, slot); if (!pItem2) { if (clone) - item = item->CloneItem(count, this); + pItem = pItem->CloneItem(count, this); else - item->SetCount(count); + pItem->SetCount(count); - if (!item) + if (!pItem) return NULL; - if (item->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || - item->GetTemplate()->Bonding == BIND_QUEST_ITEM || - (item->GetTemplate()->Bonding == BIND_WHEN_EQUIPED && IsBagPos(pos))) - item->SetBinding(true); + if (pItem->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || + pItem->GetTemplate()->Bonding == BIND_QUEST_ITEM || + (pItem->GetTemplate()->Bonding == BIND_WHEN_EQUIPED && IsBagPos(pos))) + pItem->SetBinding(true); Bag* pBag = (bag == INVENTORY_SLOT_BAG_0) ? NULL : GetBagByPos(bag); if (!pBag) { - m_items[slot] = item; - SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), item->GetGUID()); - item->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); - item->SetUInt64Value(ITEM_FIELD_OWNER, GetGUID()); + m_items[slot] = pItem; + SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), pItem->GetGUID()); + pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); + pItem->SetUInt64Value(ITEM_FIELD_OWNER, GetGUID()); - item->SetSlot(slot); - item->SetContainer(NULL); + pItem->SetSlot(slot); + pItem->SetContainer(NULL); // need update known currency if (slot >= CURRENCYTOKEN_SLOT_START && slot < CURRENCYTOKEN_SLOT_END) - AddKnownCurrency(item->GetEntry()); + AddKnownCurrency(pItem->GetEntry()); } else - pBag->StoreItem(slot, item, update); + pBag->StoreItem(slot, pItem, update); if (IsInWorld() && update) { - item->AddToWorld(); - item->SendUpdateToPlayer(this); + pItem->AddToWorld(); + pItem->SendUpdateToPlayer(this); } - item->SetState(ITEM_CHANGED, this); + pItem->SetState(ITEM_CHANGED, this); if (pBag) pBag->SetState(ITEM_CHANGED, this); - AddEnchantmentDurations(item); - AddItemDurations(item); + AddEnchantmentDurations(pItem); + AddItemDurations(pItem); - return item; + return pItem; } else { @@ -12130,18 +12130,18 @@ Item* Player::_StoreItem(uint16 pos, Item* item, uint32 count, bool clone, bool // delete item (it not in any slot currently) if (IsInWorld() && update) { - item->RemoveFromWorld(); - item->DestroyForPlayer(this); + pItem->RemoveFromWorld(); + pItem->DestroyForPlayer(this); } - RemoveEnchantmentDurations(item); - RemoveItemDurations(item); + RemoveEnchantmentDurations(pItem); + RemoveItemDurations(pItem); - item->SetOwnerGUID(GetGUID()); // prevent error at next SetState in case trade/mail/buy from vendor - item->SetNotRefundable(this); - item->ClearSoulboundTradeable(this); - RemoveTradeableItem(item); - item->SetState(ITEM_REMOVED, this); + pItem->SetOwnerGUID(GetGUID()); // prevent error at next SetState in case trade/mail/buy from vendor + pItem->SetNotRefundable(this); + pItem->ClearSoulboundTradeable(this); + RemoveTradeableItem(pItem); + pItem->SetState(ITEM_REMOVED, this); } AddEnchantmentDurations(pItem2); @@ -12154,20 +12154,20 @@ Item* Player::_StoreItem(uint16 pos, Item* item, uint32 count, bool clone, bool Item* Player::EquipNewItem(uint16 pos, uint32 item, bool update) { - if (Item* item = Item::CreateItem(item, 1, this)) + if (Item* pItem = Item::CreateItem(item, 1, this)) { ItemAddedQuestCheck(item, 1); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item, 1); - return EquipItem(pos, item, update); + return EquipItem(pos, pItem, update); } return NULL; } -Item* Player::EquipItem(uint16 pos, Item* item, bool update) +Item* Player::EquipItem(uint16 pos, Item* pItem, bool update) { - AddEnchantmentDurations(item); - AddItemDurations(item); + AddEnchantmentDurations(pItem); + AddItemDurations(pItem); uint8 bag = pos >> 8; uint8 slot = pos & 255; @@ -12176,17 +12176,17 @@ Item* Player::EquipItem(uint16 pos, Item* item, bool update) if (!pItem2) { - VisualizeItem(slot, item); + VisualizeItem(slot, pItem); if (isAlive()) { - ItemTemplate const* pProto = item->GetTemplate(); + ItemTemplate const* pProto = pItem->GetTemplate(); // item set bonuses applied only at equip and removed at unequip, and still active for broken items if (pProto && pProto->ItemSet) - AddItemsSetItem(this, item); + AddItemsSetItem(this, pItem); - _ApplyItemMods(item, slot, true); + _ApplyItemMods(pItem, slot, true); if (pProto && isInCombat() && (pProto->Class == ITEM_CLASS_WEAPON || pProto->InventoryType == INVTYPE_RELIC) && m_weaponChangeTimer == 0) { @@ -12213,11 +12213,11 @@ Item* Player::EquipItem(uint16 pos, Item* item, bool update) if (IsInWorld() && update) { - item->AddToWorld(); - item->SendUpdateToPlayer(this); + pItem->AddToWorld(); + pItem->SendUpdateToPlayer(this); } - ApplyEquipCooldown(item); + ApplyEquipCooldown(pItem); // update expertise and armor penetration - passive auras may need it @@ -12239,26 +12239,26 @@ Item* Player::EquipItem(uint16 pos, Item* item, bool update) } else { - pItem2->SetCount(pItem2->GetCount() + item->GetCount()); + pItem2->SetCount(pItem2->GetCount() + pItem->GetCount()); if (IsInWorld() && update) pItem2->SendUpdateToPlayer(this); // delete item (it not in any slot currently) - //item->DeleteFromDB(); + //pItem->DeleteFromDB(); if (IsInWorld() && update) { - item->RemoveFromWorld(); - item->DestroyForPlayer(this); + pItem->RemoveFromWorld(); + pItem->DestroyForPlayer(this); } - RemoveEnchantmentDurations(item); - RemoveItemDurations(item); + RemoveEnchantmentDurations(pItem); + RemoveItemDurations(pItem); - item->SetOwnerGUID(GetGUID()); // prevent error at next SetState in case trade/mail/buy from vendor - item->SetNotRefundable(this); - item->ClearSoulboundTradeable(this); - RemoveTradeableItem(item); - item->SetState(ITEM_REMOVED, this); + pItem->SetOwnerGUID(GetGUID()); // prevent error at next SetState in case trade/mail/buy from vendor + pItem->SetNotRefundable(this); + pItem->ClearSoulboundTradeable(this); + RemoveTradeableItem(pItem); + pItem->SetState(ITEM_REMOVED, this); pItem2->SetState(ITEM_CHANGED, this); ApplyEquipCooldown(pItem2); @@ -12267,40 +12267,40 @@ Item* Player::EquipItem(uint16 pos, Item* item, bool update) } // only for full equip instead adding to stack - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, item->GetEntry()); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, item->GetEntry(), slot); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry()); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, pItem->GetEntry(), slot); - return item; + return pItem; } -void Player::QuickEquipItem(uint16 pos, Item* item) +void Player::QuickEquipItem(uint16 pos, Item* pItem) { - if (item) + if (pItem) { - AddEnchantmentDurations(item); - AddItemDurations(item); + AddEnchantmentDurations(pItem); + AddItemDurations(pItem); uint8 slot = pos & 255; - VisualizeItem(slot, item); + VisualizeItem(slot, pItem); if (IsInWorld()) { - item->AddToWorld(); - item->SendUpdateToPlayer(this); + pItem->AddToWorld(); + pItem->SendUpdateToPlayer(this); } - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, item->GetEntry()); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, item->GetEntry(), slot); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry()); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, pItem->GetEntry(), slot); } } -void Player::SetVisibleItemSlot(uint8 slot, Item* item) +void Player::SetVisibleItemSlot(uint8 slot, Item* pItem) { - if (item) + if (pItem) { - SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2), item->GetEntry()); - SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 0, item->GetEnchantmentId(PERM_ENCHANTMENT_SLOT)); - SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 1, item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT)); + SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2), pItem->GetEntry()); + SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 0, pItem->GetEnchantmentId(PERM_ENCHANTMENT_SLOT)); + SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 1, pItem->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT)); } else { @@ -12309,28 +12309,28 @@ void Player::SetVisibleItemSlot(uint8 slot, Item* item) } } -void Player::VisualizeItem(uint8 slot, Item* item) +void Player::VisualizeItem(uint8 slot, Item* pItem) { - if (!item) + if (!pItem) return; // check also BIND_WHEN_PICKED_UP and BIND_QUEST_ITEM for .additem or .additemset case by GM (not binded at adding to inventory) - if (item->GetTemplate()->Bonding == BIND_WHEN_EQUIPED || item->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || item->GetTemplate()->Bonding == BIND_QUEST_ITEM) - item->SetBinding(true); + if (pItem->GetTemplate()->Bonding == BIND_WHEN_EQUIPED || pItem->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || pItem->GetTemplate()->Bonding == BIND_QUEST_ITEM) + pItem->SetBinding(true); - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: EquipItem slot = %u, item = %u", slot, item->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: EquipItem slot = %u, item = %u", slot, pItem->GetEntry()); - m_items[slot] = item; - SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), item->GetGUID()); - item->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); - item->SetUInt64Value(ITEM_FIELD_OWNER, GetGUID()); - item->SetSlot(slot); - item->SetContainer(NULL); + m_items[slot] = pItem; + SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), pItem->GetGUID()); + pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); + pItem->SetUInt64Value(ITEM_FIELD_OWNER, GetGUID()); + pItem->SetSlot(slot); + pItem->SetContainer(NULL); if (slot < EQUIPMENT_SLOT_END) - SetVisibleItemSlot(slot, item); + SetVisibleItemSlot(slot, pItem); - item->SetState(ITEM_CHANGED, this); + pItem->SetState(ITEM_CHANGED, this); } void Player::RemoveItem(uint8 bag, uint8 slot, bool update) @@ -12340,44 +12340,44 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update) // note2: if removeitem is to be used for delinking // the item must be removed from the player's updatequeue - Item* item = GetItemByPos(bag, slot); - if (item) + Item* pItem = GetItemByPos(bag, slot); + if (pItem) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItem bag = %u, slot = %u, item = %u", bag, slot, item->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); - RemoveEnchantmentDurations(item); - RemoveItemDurations(item); - RemoveTradeableItem(item); + RemoveEnchantmentDurations(pItem); + RemoveItemDurations(pItem); + RemoveTradeableItem(pItem); if (bag == INVENTORY_SLOT_BAG_0) { if (slot < INVENTORY_SLOT_BAG_END) { - ItemTemplate const* pProto = item->GetTemplate(); + ItemTemplate const* pProto = pItem->GetTemplate(); // item set bonuses applied only at equip and removed at unequip, and still active for broken items if (pProto && pProto->ItemSet) RemoveItemsSetItem(this, pProto); - _ApplyItemMods(item, slot, false); + _ApplyItemMods(pItem, slot, false); // remove item dependent auras and casts (only weapon and armor slots) if (slot < EQUIPMENT_SLOT_END) { - RemoveItemDependentAurasAndCasts(item); + RemoveItemDependentAurasAndCasts(pItem); // remove held enchantments, update expertise if (slot == EQUIPMENT_SLOT_MAINHAND) { - if (item->GetItemSuffixFactor()) + if (pItem->GetItemSuffixFactor()) { - item->ClearEnchantment(PROP_ENCHANTMENT_SLOT_3); - item->ClearEnchantment(PROP_ENCHANTMENT_SLOT_4); + pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_3); + pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_4); } else { - item->ClearEnchantment(PROP_ENCHANTMENT_SLOT_0); - item->ClearEnchantment(PROP_ENCHANTMENT_SLOT_1); + pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_0); + pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_1); } UpdateExpertise(BASE_ATTACK); @@ -12406,11 +12406,11 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update) else if (Bag* pBag = GetBagByPos(bag)) pBag->RemoveItem(slot, update); - item->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); - // item->SetUInt64Value(ITEM_FIELD_OWNER, 0); not clear owner at remove (it will be set at store). This used in mail and auction code - item->SetSlot(NULL_SLOT); + pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); + // pItem->SetUInt64Value(ITEM_FIELD_OWNER, 0); not clear owner at remove (it will be set at store). This used in mail and auction code + pItem->SetSlot(NULL_SLOT); if (IsInWorld() && update) - item->SendUpdateToPlayer(this); + pItem->SendUpdateToPlayer(this); } } @@ -12432,17 +12432,17 @@ void Player::MoveItemFromInventory(uint8 bag, uint8 slot, bool update) } // Common operation need to add item from inventory without delete in trade, guild bank, mail.... -void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* item, bool update, bool in_characterInventoryDB) +void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool update, bool in_characterInventoryDB) { // update quest counters - ItemAddedQuestCheck(item->GetEntry(), item->GetCount()); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item->GetEntry(), item->GetCount()); + ItemAddedQuestCheck(pItem->GetEntry(), pItem->GetCount()); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, pItem->GetEntry(), pItem->GetCount()); // store item - Item* pLastItem = StoreItem(dest, item, update); + Item* pLastItem = StoreItem(dest, pItem, update); - // only set if not merged to existed stack (item can be deleted already but we can compare pointers any way) - if (pLastItem == item) + // only set if not merged to existed stack (pItem can be deleted already but we can compare pointers any way) + if (pLastItem == pItem) { // update owner for last item (this can be original item with wrong owner if (pLastItem->GetOwnerGUID() != GetGUID()) @@ -12459,38 +12459,38 @@ void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* item, bool u void Player::DestroyItem(uint8 bag, uint8 slot, bool update) { - Item* item = GetItemByPos(bag, slot); - if (item) + Item* pItem = GetItemByPos(bag, slot); + if (pItem) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, item->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); // Also remove all contained items if the item is a bag. // This if () prevents item saving crashes if the condition for a bag to be empty before being destroyed was bypassed somehow. - if (item->IsNotEmptyBag()) + if (pItem->IsNotEmptyBag()) for (uint8 i = 0; i < MAX_BAG_SIZE; ++i) DestroyItem(slot, i, update); - if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) + if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT); - stmt->setUInt32(0, item->GetGUIDLow()); + stmt->setUInt32(0, pItem->GetGUIDLow()); CharacterDatabase.Execute(stmt); } - RemoveEnchantmentDurations(item); - RemoveItemDurations(item); + RemoveEnchantmentDurations(pItem); + RemoveItemDurations(pItem); - item->SetNotRefundable(this); - item->ClearSoulboundTradeable(this); - RemoveTradeableItem(item); + pItem->SetNotRefundable(this); + pItem->ClearSoulboundTradeable(this); + RemoveTradeableItem(pItem); - const ItemTemplate* proto = item->GetTemplate(); + const ItemTemplate* proto = pItem->GetTemplate(); for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) if (proto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE && proto->Spells[i].SpellId > 0) // On obtain trigger RemoveAurasDueToSpell(proto->Spells[i].SpellId); - ItemRemovedQuestCheck(item->GetEntry(), item->GetCount()); + ItemRemovedQuestCheck(pItem->GetEntry(), pItem->GetCount()); if (bag == INVENTORY_SLOT_BAG_0) { @@ -12499,19 +12499,19 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) // equipment and equipped bags can have applied bonuses if (slot < INVENTORY_SLOT_BAG_END) { - ItemTemplate const* pProto = item->GetTemplate(); + ItemTemplate const* pProto = pItem->GetTemplate(); // item set bonuses applied only at equip and removed at unequip, and still active for broken items if (pProto && pProto->ItemSet) RemoveItemsSetItem(this, pProto); - _ApplyItemMods(item, slot, false); + _ApplyItemMods(pItem, slot, false); } if (slot < EQUIPMENT_SLOT_END) { // remove item dependent auras and casts (only weapon and armor slots) - RemoveItemDependentAurasAndCasts(item); + RemoveItemDependentAurasAndCasts(pItem); // update expertise and armor penetration - passive auras may need it switch (slot) @@ -12540,14 +12540,14 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) if (IsInWorld() && update) { - item->RemoveFromWorld(); - item->DestroyForPlayer(this); + pItem->RemoveFromWorld(); + pItem->DestroyForPlayer(this); } - //item->SetOwnerGUID(0); - item->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); - item->SetSlot(NULL_SLOT); - item->SetState(ITEM_REMOVED, this); + //pItem->SetOwnerGUID(0); + pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); + pItem->SetSlot(NULL_SLOT); + pItem->SetState(ITEM_REMOVED, this); } } @@ -12559,14 +12559,14 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i) { - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { - if (item->GetEntry() == item && !item->IsInTrade()) + if (pItem->GetEntry() == item && !pItem->IsInTrade()) { - if (item->GetCount() + remcount <= count) + if (pItem->GetCount() + remcount <= count) { // all items in inventory can unequipped - remcount += item->GetCount(); + remcount += pItem->GetCount(); DestroyItem(INVENTORY_SLOT_BAG_0, i, update); if (remcount >= count) @@ -12574,11 +12574,11 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ } else { - ItemRemovedQuestCheck(item->GetEntry(), count - remcount); - item->SetCount(item->GetCount() - count + remcount); + ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount); + pItem->SetCount(pItem->GetCount() - count + remcount); if (IsInWorld() & update) - item->SendUpdateToPlayer(this); - item->SetState(ITEM_CHANGED, this); + pItem->SendUpdateToPlayer(this); + pItem->SetState(ITEM_CHANGED, this); return; } } @@ -12587,14 +12587,14 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) { - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { - if (item->GetEntry() == item && !item->IsInTrade()) + if (pItem->GetEntry() == item && !pItem->IsInTrade()) { - if (item->GetCount() + remcount <= count) + if (pItem->GetCount() + remcount <= count) { // all keys can be unequipped - remcount += item->GetCount(); + remcount += pItem->GetCount(); DestroyItem(INVENTORY_SLOT_BAG_0, i, update); if (remcount >= count) @@ -12602,11 +12602,11 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ } else { - ItemRemovedQuestCheck(item->GetEntry(), count - remcount); - item->SetCount(item->GetCount() - count + remcount); + ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount); + pItem->SetCount(pItem->GetCount() - count + remcount); if (IsInWorld() & update) - item->SendUpdateToPlayer(this); - item->SetState(ITEM_CHANGED, this); + pItem->SendUpdateToPlayer(this); + pItem->SetState(ITEM_CHANGED, this); return; } } @@ -12620,14 +12620,14 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ { for (uint32 j = 0; j < pBag->GetBagSize(); j++) { - if (Item* item = pBag->GetItemByPos(j)) + if (Item* pItem = pBag->GetItemByPos(j)) { - if (item->GetEntry() == item && !item->IsInTrade()) + if (pItem->GetEntry() == item && !pItem->IsInTrade()) { // all items in bags can be unequipped - if (item->GetCount() + remcount <= count) + if (pItem->GetCount() + remcount <= count) { - remcount += item->GetCount(); + remcount += pItem->GetCount(); DestroyItem(i, j, update); if (remcount >= count) @@ -12635,11 +12635,11 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ } else { - ItemRemovedQuestCheck(item->GetEntry(), count - remcount); - item->SetCount(item->GetCount() - count + remcount); + ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount); + pItem->SetCount(pItem->GetCount() - count + remcount); if (IsInWorld() && update) - item->SendUpdateToPlayer(this); - item->SetState(ITEM_CHANGED, this); + pItem->SendUpdateToPlayer(this); + pItem->SetState(ITEM_CHANGED, this); return; } } @@ -12651,15 +12651,15 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ // in equipment and bag list for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++) { - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { - if (item && item->GetEntry() == item && !item->IsInTrade()) + if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { - if (item->GetCount() + remcount <= count) + if (pItem->GetCount() + remcount <= count) { if (!unequip_check || CanUnequipItem(INVENTORY_SLOT_BAG_0 << 8 | i, false) == EQUIP_ERR_OK) { - remcount += item->GetCount(); + remcount += pItem->GetCount(); DestroyItem(INVENTORY_SLOT_BAG_0, i, update); if (remcount >= count) @@ -12668,11 +12668,11 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ } else { - ItemRemovedQuestCheck(item->GetEntry(), count - remcount); - item->SetCount(item->GetCount() - count + remcount); + ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount); + pItem->SetCount(pItem->GetCount() - count + remcount); if (IsInWorld() & update) - item->SendUpdateToPlayer(this); - item->SetState(ITEM_CHANGED, this); + pItem->SendUpdateToPlayer(this); + pItem->SetState(ITEM_CHANGED, this); return; } } @@ -12686,27 +12686,27 @@ void Player::DestroyZoneLimitedItem(bool update, uint32 new_zone) // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) DestroyItem(INVENTORY_SLOT_BAG_0, i, update); for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) DestroyItem(INVENTORY_SLOT_BAG_0, i, update); // in inventory bags for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) - if (Item* item = pBag->GetItemByPos(j)) - if (item->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) + if (Item* pItem = pBag->GetItemByPos(j)) + if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) DestroyItem(i, j, update); // in equipment and bag list for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) DestroyItem(INVENTORY_SLOT_BAG_0, i, update); } @@ -12718,22 +12718,22 @@ void Player::DestroyConjuredItems(bool update) // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->IsConjuredConsumable()) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->IsConjuredConsumable()) DestroyItem(INVENTORY_SLOT_BAG_0, i, update); // in inventory bags for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) - if (Item* item = pBag->GetItemByPos(j)) - if (item->IsConjuredConsumable()) + if (Item* pItem = pBag->GetItemByPos(j)) + if (pItem->IsConjuredConsumable()) DestroyItem(i, j, update); // in equipment and bag list for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->IsConjuredConsumable()) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->IsConjuredConsumable()) DestroyItem(INVENTORY_SLOT_BAG_0, i, update); } @@ -12741,46 +12741,46 @@ Item* Player::GetItemByEntry(uint32 entry) const { // in inventory for (int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->GetEntry() == entry) - return item; + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->GetEntry() == entry) + return pItem; for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); ++j) - if (Item* item = pBag->GetItemByPos(j)) - if (item->GetEntry() == entry) - return item; + if (Item* pItem = pBag->GetItemByPos(j)) + if (pItem->GetEntry() == entry) + return pItem; for (int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->GetEntry() == entry) - return item; + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->GetEntry() == entry) + return pItem; return NULL; } -void Player::DestroyItemCount(Item* item, uint32 &count, bool update) +void Player::DestroyItemCount(Item* pItem, uint32 &count, bool update) { - if (!item) + if (!pItem) return; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", item->GetGUIDLow(), item->GetEntry(), count); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", pItem->GetGUIDLow(), pItem->GetEntry(), count); - if (item->GetCount() <= count) + if (pItem->GetCount() <= count) { - count -= item->GetCount(); + count -= pItem->GetCount(); - DestroyItem(item->GetBagSlot(), item->GetSlot(), update); + DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), update); } else { - ItemRemovedQuestCheck(item->GetEntry(), count); - item->SetCount(item->GetCount() - count); + ItemRemovedQuestCheck(pItem->GetEntry(), count); + pItem->SetCount(pItem->GetCount() - count); count = 0; if (IsInWorld() & update) - item->SendUpdateToPlayer(this); - item->SetState(ITEM_CHANGED, this); + pItem->SendUpdateToPlayer(this); + pItem->SetState(ITEM_CHANGED, this); } } @@ -13255,9 +13255,9 @@ void Player::SwapItem(uint16 src, uint16 dst) AutoUnequipOffhandIfNeed(); } -void Player::AddItemToBuyBackSlot(Item* item) +void Player::AddItemToBuyBackSlot(Item* pItem) { - if (item) + if (pItem) { uint32 slot = m_currentBuybackSlot; // if current back slot non-empty search oldest or free @@ -13289,16 +13289,16 @@ void Player::AddItemToBuyBackSlot(Item* item) } RemoveItemFromBuyBackSlot(slot, true); - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", item->GetEntry(), slot); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", pItem->GetEntry(), slot); - m_items[slot] = item; + m_items[slot] = pItem; time_t base = time(NULL); uint32 etime = uint32(base - m_logintime + (30 * 3600)); uint32 eslot = slot - BUYBACK_SLOT_START; - SetUInt64Value(PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), item->GetGUID()); - if (ItemTemplate const* proto = item->GetTemplate()) - SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, proto->SellPrice * item->GetCount()); + SetUInt64Value(PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), pItem->GetGUID()); + if (ItemTemplate const* proto = pItem->GetTemplate()) + SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, proto->SellPrice * pItem->GetCount()); else SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, 0); SetUInt32Value(PLAYER_FIELD_BUYBACK_TIMESTAMP_1 + eslot, (uint32)etime); @@ -13322,12 +13322,12 @@ void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItemFromBuyBackSlot slot = %u", slot); if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END) { - Item* item = m_items[slot]; - if (item) + Item* pItem = m_items[slot]; + if (pItem) { - item->RemoveFromWorld(); + pItem->RemoveFromWorld(); if (del) - item->SetState(ITEM_REMOVED, this); + pItem->SetState(ITEM_REMOVED, this); } m_items[slot] = NULL; @@ -13343,7 +13343,7 @@ void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del) } } -void Player::SendEquipError(InventoryResult msg, Item* item, Item* pItem2, uint32 itemid) +void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint32 itemid) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg); WorldPacket data(SMSG_INVENTORY_CHANGE_FAILURE, (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I ? 22 : 18)); @@ -13351,7 +13351,7 @@ void Player::SendEquipError(InventoryResult msg, Item* item, Item* pItem2, uint3 if (msg != EQUIP_ERR_OK) { - data << uint64(item ? item->GetGUID() : 0); + data << uint64(pItem ? pItem->GetGUID() : 0); data << uint64(pItem2 ? pItem2->GetGUID() : 0); data << uint8(0); // bag type subclass, used with EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM and EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG2 @@ -13360,7 +13360,7 @@ void Player::SendEquipError(InventoryResult msg, Item* item, Item* pItem2, uint3 case EQUIP_ERR_CANT_EQUIP_LEVEL_I: case EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW: { - ItemTemplate const* proto = item ? item->GetTemplate() : sObjectMgr->GetItemTemplate(itemid); + ItemTemplate const* proto = pItem ? pItem->GetTemplate() : sObjectMgr->GetItemTemplate(itemid); data << uint32(proto ? proto->RequiredLevel : 0); break; } @@ -13375,7 +13375,7 @@ void Player::SendEquipError(InventoryResult msg, Item* item, Item* pItem2, uint3 case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED: case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED: { - ItemTemplate const* proto = item ? item->GetTemplate() : sObjectMgr->GetItemTemplate(itemid); + ItemTemplate const* proto = pItem ? pItem->GetTemplate() : sObjectMgr->GetItemTemplate(itemid); data << uint32(proto ? proto->ItemLimitCategory : 0); break; } @@ -13565,17 +13565,17 @@ void Player::RemoveArenaEnchantments(EnchantmentSlot slot) // NOTE: no need to remove these from stats, since these aren't equipped // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->GetEnchantmentId(slot)) - item->ClearEnchantment(slot); + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->GetEnchantmentId(slot)) + pItem->ClearEnchantment(slot); // in inventory bags for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) - if (Item* item = pBag->GetItemByPos(j)) - if (item->GetEnchantmentId(slot)) - item->ClearEnchantment(slot); + if (Item* pItem = pBag->GetItemByPos(j)) + if (pItem->GetEnchantmentId(slot)) + pItem->ClearEnchantment(slot); } // duration == 0 will remove item enchant @@ -21217,14 +21217,14 @@ void Player::CorrectMetaGemEnchants(uint8 exceptslot, bool apply) if (slot == exceptslot) continue; - Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, slot); + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, slot); - if (!item || !item->GetTemplate()->Socket[0].Color) + if (!pItem || !pItem->GetTemplate()->Socket[0].Color) continue; for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot) { - uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(enchant_slot)); + uint32 enchant_id = pItem->GetEnchantmentId(EnchantmentSlot(enchant_slot)); if (!enchant_id) continue; @@ -21242,7 +21242,7 @@ void Player::CorrectMetaGemEnchants(uint8 exceptslot, bool apply) { // ignore item gem conditions //if state changed, (dis)apply enchant - ApplyEnchantment(item, EnchantmentSlot(enchant_slot), !wasactive, true, true); + ApplyEnchantment(pItem, EnchantmentSlot(enchant_slot), !wasactive, true, true); } } } @@ -21259,15 +21259,15 @@ void Player::ToggleMetaGemsActive(uint8 exceptslot, bool apply) if (slot == exceptslot) continue; - Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, slot); + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, slot); - if (!item || !item->GetTemplate()->Socket[0].Color) //if item has no sockets or no item is equipped go to next item + if (!pItem || !pItem->GetTemplate()->Socket[0].Color) //if item has no sockets or no item is equipped go to next item continue; //cycle all (gem)enchants for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot) { - uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(enchant_slot)); + uint32 enchant_id = pItem->GetEnchantmentId(EnchantmentSlot(enchant_slot)); if (!enchant_id) //if no enchant go to next enchant(slot) continue; @@ -21278,7 +21278,7 @@ void Player::ToggleMetaGemsActive(uint8 exceptslot, bool apply) //only metagems to be (de)activated, so only enchants with condition uint32 condition = enchantEntry->EnchantmentCondition; if (condition) - ApplyEnchantment(item, EnchantmentSlot(enchant_slot), apply); + ApplyEnchantment(pItem, EnchantmentSlot(enchant_slot), apply); } } } @@ -21940,14 +21940,14 @@ void Player::SendInstanceResetWarning(uint32 mapid, Difficulty difficulty, uint3 GetSession()->SendPacket(&data); } -void Player::ApplyEquipCooldown(Item* item) +void Player::ApplyEquipCooldown(Item* pItem) { - if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_PROTO_FLAG_NO_EQUIP_COOLDOWN)) + if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_PROTO_FLAG_NO_EQUIP_COOLDOWN)) return; for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) { - _Spell const& spellData = item->GetTemplate()->Spells[i]; + _Spell const& spellData = pItem->GetTemplate()->Spells[i]; // no spell if (!spellData.SpellId) @@ -21957,10 +21957,10 @@ void Player::ApplyEquipCooldown(Item* item) if (spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_USE) continue; - AddSpellCooldown(spellData.SpellId, item->GetEntry(), time(NULL) + 30); + AddSpellCooldown(spellData.SpellId, pItem->GetEntry(), time(NULL) + 30); WorldPacket data(SMSG_ITEM_COOLDOWN, 12); - data << item->GetGUID(); + data << pItem->GetGUID(); data << uint32(spellData.SpellId); GetSession()->SendPacket(&data); } @@ -22574,7 +22574,7 @@ bool Player::CanNoReagentCast(SpellInfo const* spellInfo) const return false; } -void Player::RemoveItemDependentAurasAndCasts(Item* item) +void Player::RemoveItemDependentAurasAndCasts(Item* pItem) { for (AuraMap::iterator itr = m_ownedAuras.begin(); itr != m_ownedAuras.end();) { @@ -22589,7 +22589,7 @@ void Player::RemoveItemDependentAurasAndCasts(Item* item) } // skip if not item dependent or have alternative item - if (HasItemFitToSpellRequirements(spellInfo, item)) + if (HasItemFitToSpellRequirements(spellInfo, pItem)) { ++itr; continue; @@ -22602,7 +22602,7 @@ void Player::RemoveItemDependentAurasAndCasts(Item* item) // currently casted spells can be dependent from item for (uint32 i = 0; i < CURRENT_MAX_SPELL; ++i) if (Spell* spell = GetCurrentSpell(CurrentSpellTypes(i))) - if (spell->getState() != SPELL_STATE_DELAYED && !HasItemFitToSpellRequirements(spell->m_spellInfo, item)) + if (spell->getState() != SPELL_STATE_DELAYED && !HasItemFitToSpellRequirements(spell->m_spellInfo, pItem)) InterruptSpell(CurrentSpellTypes(i)); } @@ -23548,8 +23548,8 @@ void Player::AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore cons continue; } - Item* item = StoreNewItem(dest, lootItem->itemid, true, lootItem->randomPropertyId); - SendNewItem(item, lootItem->count, false, false, broadcast); + Item* pItem = StoreNewItem(dest, lootItem->itemid, true, lootItem->randomPropertyId); + SendNewItem(pItem, lootItem->count, false, false, broadcast); } } @@ -23780,9 +23780,9 @@ uint32 Player::GetPhaseMaskForSpawn() const return PHASEMASK_NORMAL; } -InventoryResult Player::CanEquipUniqueItem(Item* item, uint8 eslot, uint32 limit_count) const +InventoryResult Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limit_count) const { - ItemTemplate const* pProto = item->GetTemplate(); + ItemTemplate const* pProto = pItem->GetTemplate(); // proto based limitations if (InventoryResult res = CanEquipUniqueItem(pProto, eslot, limit_count)) @@ -23791,7 +23791,7 @@ InventoryResult Player::CanEquipUniqueItem(Item* item, uint8 eslot, uint32 limit // check unique-equipped on gems for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot) { - uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(enchant_slot)); + uint32 enchant_id = pItem->GetEnchantmentId(EnchantmentSlot(enchant_slot)); if (!enchant_id) continue; SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id); @@ -23803,8 +23803,8 @@ InventoryResult Player::CanEquipUniqueItem(Item* item, uint8 eslot, uint32 limit continue; // include for check equip another gems with same limit category for not equipped item (and then not counted) - uint32 gem_limit_count = !item->IsEquipped() && pGem->ItemLimitCategory - ? item->GetGemCountWithLimitCategory(pGem->ItemLimitCategory) : 1; + uint32 gem_limit_count = !pItem->IsEquipped() && pGem->ItemLimitCategory + ? pItem->GetGemCountWithLimitCategory(pGem->ItemLimitCategory) : 1; if (InventoryResult res = CanEquipUniqueItem(pGem, eslot, gem_limit_count)) return res; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 0ee2743e319..7f6b2322e93 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1233,70 +1233,70 @@ class Player : public Unit, public GridObject bool CanNoReagentCast(SpellInfo const* spellInfo) const; bool HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_slot = NULL_SLOT) const; bool HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 count, uint8 except_slot = NULL_SLOT) const; - InventoryResult CanTakeMoreSimilarItems(Item* item) const { return CanTakeMoreSimilarItems(item->GetEntry(), item->GetCount(), item); } + InventoryResult CanTakeMoreSimilarItems(Item* pItem) const { return CanTakeMoreSimilarItems(pItem->GetEntry(), pItem->GetCount(), pItem); } InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count) const { return CanTakeMoreSimilarItems(entry, count, NULL); } InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 item, uint32 count, uint32* no_space_count = NULL) const { return CanStoreItem(bag, slot, dest, item, count, NULL, false, no_space_count); } - InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* item, bool swap = false) const + InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* pItem, bool swap = false) const { - if (!item) + if (!pItem) return EQUIP_ERR_ITEM_NOT_FOUND; - uint32 count = item->GetCount(); - return CanStoreItem(bag, slot, dest, item->GetEntry(), count, item, swap, NULL); + uint32 count = pItem->GetCount(); + return CanStoreItem(bag, slot, dest, pItem->GetEntry(), count, pItem, swap, NULL); } - InventoryResult CanStoreItems(Item** item, int count) const; + InventoryResult CanStoreItems(Item** pItem, int count) const; InventoryResult CanEquipNewItem(uint8 slot, uint16& dest, uint32 item, bool swap) const; - InventoryResult CanEquipItem(uint8 slot, uint16& dest, Item* item, bool swap, bool not_loading = true) const; + InventoryResult CanEquipItem(uint8 slot, uint16& dest, Item* pItem, bool swap, bool not_loading = true) const; - InventoryResult CanEquipUniqueItem(Item* item, uint8 except_slot = NULL_SLOT, uint32 limit_count = 1) const; + InventoryResult CanEquipUniqueItem(Item* pItem, uint8 except_slot = NULL_SLOT, uint32 limit_count = 1) const; InventoryResult CanEquipUniqueItem(ItemTemplate const* itemProto, uint8 except_slot = NULL_SLOT, uint32 limit_count = 1) const; InventoryResult CanUnequipItems(uint32 item, uint32 count) const; InventoryResult CanUnequipItem(uint16 src, bool swap) const; - InventoryResult CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* item, bool swap, bool not_loading = true) const; - InventoryResult CanUseItem(Item* item, bool not_loading = true) const; + InventoryResult CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* pItem, bool swap, bool not_loading = true) const; + InventoryResult CanUseItem(Item* pItem, bool not_loading = true) const; bool HasItemTotemCategory(uint32 TotemCategory) const; - InventoryResult CanUseItem(ItemTemplate const* item) const; + InventoryResult CanUseItem(ItemTemplate const* pItem) const; InventoryResult CanUseAmmo(uint32 item) const; InventoryResult CanRollForItemInLFG(ItemTemplate const* item, WorldObject const* lootedObject) const; Item* StoreNewItem(ItemPosCountVec const& pos, uint32 item, bool update, int32 randomPropertyId = 0); Item* StoreNewItem(ItemPosCountVec const& pos, uint32 item, bool update, int32 randomPropertyId, AllowedLooterSet &allowedLooters); - Item* StoreItem(ItemPosCountVec const& pos, Item* item, bool update); + Item* StoreItem(ItemPosCountVec const& pos, Item* pItem, bool update); Item* EquipNewItem(uint16 pos, uint32 item, bool update); - Item* EquipItem(uint16 pos, Item* item, bool update); + Item* EquipItem(uint16 pos, Item* pItem, bool update); void AutoUnequipOffhandIfNeed(bool force = false); bool StoreNewItemInBestSlots(uint32 item_id, uint32 item_count); void AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store, bool broadcast = false); void AutoStoreLoot(uint32 loot_id, LootStore const& store, bool broadcast = false) { AutoStoreLoot(NULL_BAG, NULL_SLOT, loot_id, store, broadcast); } void StoreLootItem(uint8 lootSlot, Loot* loot); - InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* item, uint32* no_space_count = NULL) const; - InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item* item = NULL, bool swap = false, uint32* no_space_count = NULL) const; + InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = NULL) const; + InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item* pItem = NULL, bool swap = false, uint32* no_space_count = NULL) const; void AddRefundReference(uint32 it); void DeleteRefundReference(uint32 it); - void ApplyEquipCooldown(Item* item); + void ApplyEquipCooldown(Item* pItem); void SetAmmo(uint32 item); void RemoveAmmo(); float GetAmmoDPS() const { return m_ammoDPS; } bool CheckAmmoCompatibility(const ItemTemplate* ammo_proto) const; - void QuickEquipItem(uint16 pos, Item* item); - void VisualizeItem(uint8 slot, Item* item); - void SetVisibleItemSlot(uint8 slot, Item* item); - Item* BankItem(ItemPosCountVec const& dest, Item* item, bool update) + void QuickEquipItem(uint16 pos, Item* pItem); + void VisualizeItem(uint8 slot, Item* pItem); + void SetVisibleItemSlot(uint8 slot, Item* pItem); + Item* BankItem(ItemPosCountVec const& dest, Item* pItem, bool update) { - return StoreItem(dest, item, update); + return StoreItem(dest, pItem, update); } - Item* BankItem(uint16 pos, Item* item, bool update); + Item* BankItem(uint16 pos, Item* pItem, bool update); void RemoveItem(uint8 bag, uint8 slot, bool update); void MoveItemFromInventory(uint8 bag, uint8 slot, bool update); // in trade, auction, guild bank, mail.... - void MoveItemToInventory(ItemPosCountVec const& dest, Item* item, bool update, bool in_characterInventoryDB = false); + void MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool update, bool in_characterInventoryDB = false); // in trade, guild bank, mail.... - void RemoveItemDependentAurasAndCasts(Item* item); + void RemoveItemDependentAurasAndCasts(Item* pItem); void DestroyItem(uint8 bag, uint8 slot, bool update); void DestroyItemCount(uint32 item, uint32 count, bool update, bool unequip_check = false); void DestroyItemCount(Item* item, uint32& count, bool update); @@ -1304,11 +1304,11 @@ class Player : public Unit, public GridObject void DestroyZoneLimitedItem(bool update, uint32 new_zone); void SplitItem(uint16 src, uint16 dst, uint32 count); void SwapItem(uint16 src, uint16 dst); - void AddItemToBuyBackSlot(Item* item); + void AddItemToBuyBackSlot(Item* pItem); Item* GetItemFromBuyBackSlot(uint32 slot); void RemoveItemFromBuyBackSlot(uint32 slot, bool del); uint32 GetMaxKeyringSize() const { return KEYRING_SLOT_END-KEYRING_SLOT_START; } - void SendEquipError(InventoryResult msg, Item* item, Item* pItem2 = NULL, uint32 itemid = 0); + void SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2 = NULL, uint32 itemid = 0); void SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 param); void SendSellError(SellResult msg, Creature* creature, uint64 guid, uint32 param); void AddWeaponProficiency(uint32 newflag) { m_WeaponProficiency |= newflag; } @@ -2789,7 +2789,7 @@ class Player : public Unit, public GridObject InventoryResult CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVec& dest, ItemTemplate const* pProto, uint32& count, bool swap, Item* pSrcItem) const; InventoryResult CanStoreItem_InBag(uint8 bag, ItemPosCountVec& dest, ItemTemplate const* pProto, uint32& count, bool merge, bool non_specialized, Item* pSrcItem, uint8 skip_bag, uint8 skip_slot) const; InventoryResult CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 slot_end, ItemPosCountVec& dest, ItemTemplate const* pProto, uint32& count, bool merge, Item* pSrcItem, uint8 skip_bag, uint8 skip_slot) const; - Item* _StoreItem(uint16 pos, Item* item, uint32 count, bool clone, bool update); + Item* _StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool update); Item* _LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, Field* fields); std::set m_refundableItems; diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 396e01cb269..9879ef7ff3b 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1927,12 +1927,12 @@ void Group::BroadcastGroupUpdate(void) void Group::ResetMaxEnchantingLevel() { m_maxEnchantingLevel = 0; - Player* member = NULL; + Player* pMember = NULL; for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr) { - member = ObjectAccessor::FindPlayer(citr->guid); - if (member && m_maxEnchantingLevel < member->GetSkillValue(SKILL_ENCHANTING)) - m_maxEnchantingLevel = member->GetSkillValue(SKILL_ENCHANTING); + pMember = ObjectAccessor::FindPlayer(citr->guid); + if (pMember && m_maxEnchantingLevel < pMember->GetSkillValue(SKILL_ENCHANTING)) + m_maxEnchantingLevel = pMember->GetSkillValue(SKILL_ENCHANTING); } } diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 9a453ed8033..f97b907828a 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -348,8 +348,8 @@ bool Guild::BankTab::LoadItemFromDB(Field* fields) return false; } - Item* item = NewItemOrBag(proto); - if (!item->LoadFromDB(itemGuid, 0, fields, itemEntry)) + Item* pItem = NewItemOrBag(proto); + if (!pItem->LoadFromDB(itemGuid, 0, fields, itemEntry)) { sLog->outError("Item (GUID %u, id: %u) not found in item_instance, deleting from guild bank!", itemGuid, itemEntry); @@ -359,12 +359,12 @@ bool Guild::BankTab::LoadItemFromDB(Field* fields) stmt->setUInt8 (2, slotId); CharacterDatabase.Execute(stmt); - delete item; + delete pItem; return false; } - item->AddToWorld(); - m_items[slotId] = item; + pItem->AddToWorld(); + m_items[slotId] = pItem; return true; } @@ -372,13 +372,13 @@ bool Guild::BankTab::LoadItemFromDB(Field* fields) void Guild::BankTab::Delete(SQLTransaction& trans, bool removeItemsFromDB) { for (uint8 slotId = 0; slotId < GUILD_BANK_MAX_SLOTS; ++slotId) - if (Item* item = m_items[slotId]) + if (Item* pItem = m_items[slotId]) { - item->RemoveFromWorld(); + pItem->RemoveFromWorld(); if (removeItemsFromDB) - item->DeleteFromDB(trans); - delete item; - item = NULL; + pItem->DeleteFromDB(trans); + delete pItem; + pItem = NULL; } } @@ -392,29 +392,29 @@ inline void Guild::BankTab::WritePacket(WorldPacket& data) const // Writes information about contents of specified slot into packet. void Guild::BankTab::WriteSlotPacket(WorldPacket& data, uint8 slotId) const { - Item* item = GetItem(slotId); - uint32 itemEntry = item ? item->GetEntry() : 0; + Item* pItem = GetItem(slotId); + uint32 itemEntry = pItem ? pItem->GetEntry() : 0; data << uint8(slotId); data << uint32(itemEntry); if (itemEntry) { data << uint32(0); // 3.3.0 (0x00018020, 0x00018000) - data << uint32(item->GetItemRandomPropertyId()); // Random item property id + data << uint32(pItem->GetItemRandomPropertyId()); // Random item property id - if (item->GetItemRandomPropertyId()) - data << uint32(item->GetItemSuffixFactor()); // SuffixFactor + if (pItem->GetItemRandomPropertyId()) + data << uint32(pItem->GetItemSuffixFactor()); // SuffixFactor - data << uint32(item->GetCount()); // ITEM_FIELD_STACK_COUNT + data << uint32(pItem->GetCount()); // ITEM_FIELD_STACK_COUNT data << uint32(0); - data << uint8(abs(item->GetSpellCharges())); // Spell charges + data << uint8(abs(pItem->GetSpellCharges())); // Spell charges uint8 enchCount = 0; size_t enchCountPos = data.wpos(); data << uint8(enchCount); // Number of enchantments for (uint32 i = PERM_ENCHANTMENT_SLOT; i < MAX_ENCHANTMENT_SLOT; ++i) - if (uint32 enchId = item->GetEnchantmentId(EnchantmentSlot(i))) + if (uint32 enchId = pItem->GetEnchantmentId(EnchantmentSlot(i))) { data << uint8(i); data << uint32(enchId); @@ -456,13 +456,13 @@ void Guild::BankTab::SetText(const std::string& text) } // Sets/removes contents of specified slot. -// If item == NULL contents are removed. -bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* item) +// If pItem == NULL contents are removed. +bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* pItem) { if (slotId >= GUILD_BANK_MAX_SLOTS) return false; - m_items[slotId] = item; + m_items[slotId] = pItem; PreparedStatement* stmt = NULL; @@ -472,19 +472,19 @@ bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* item) stmt->setUInt8 (2, slotId); CharacterDatabase.ExecuteOrAppend(trans, stmt); - if (item) + if (pItem) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_BANK_ITEM); stmt->setUInt32(0, m_guildId); stmt->setUInt8 (1, m_tabId); stmt->setUInt8 (2, slotId); - stmt->setUInt32(3, item->GetGUIDLow()); + stmt->setUInt32(3, pItem->GetGUIDLow()); CharacterDatabase.ExecuteOrAppend(trans, stmt); - item->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); - item->SetUInt64Value(ITEM_FIELD_OWNER, 0); - item->FSetState(ITEM_NEW); - item->SaveToDB(trans); // Not in inventory and can be saved standalone + pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); + pItem->SetUInt64Value(ITEM_FIELD_OWNER, 0); + pItem->FSetState(ITEM_NEW); + pItem->SaveToDB(trans); // Not in inventory and can be saved standalone } return true; } @@ -759,12 +759,12 @@ bool Guild::MoveItemData::CheckItem(uint32& splitedAmount) return true; } -bool Guild::MoveItemData::CanStore(Item* item, bool swap, bool sendError) +bool Guild::MoveItemData::CanStore(Item* pItem, bool swap, bool sendError) { m_vec.clear(); - InventoryResult msg = CanStore(item, swap); + InventoryResult msg = CanStore(pItem, swap); if (sendError && msg != EQUIP_ERR_OK) - m_pPlayer->SendEquipError(msg, item); + m_pPlayer->SendEquipError(msg, pItem); return (msg == EQUIP_ERR_OK); } @@ -834,12 +834,12 @@ void Guild::PlayerMoveItemData::RemoveItem(SQLTransaction& trans, MoveItemData* } } -Item* Guild::PlayerMoveItemData::StoreItem(SQLTransaction& trans, Item* item) +Item* Guild::PlayerMoveItemData::StoreItem(SQLTransaction& trans, Item* pItem) { - ASSERT(item); - m_pPlayer->MoveItemToInventory(m_vec, item, true); + ASSERT(pItem); + m_pPlayer->MoveItemToInventory(m_vec, pItem, true); m_pPlayer->SaveInventoryAndGoldToDB(trans); - return item; + return pItem; } void Guild::PlayerMoveItemData::LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const @@ -850,9 +850,9 @@ void Guild::PlayerMoveItemData::LogBankEvent(SQLTransaction& trans, MoveItemData pFrom->GetItem()->GetEntry(), count); } -inline InventoryResult Guild::PlayerMoveItemData::CanStore(Item* item, bool swap) +inline InventoryResult Guild::PlayerMoveItemData::CanStore(Item* pItem, bool swap) { - return m_pPlayer->CanStoreItem(m_container, m_slotId, m_vec, item, swap); + return m_pPlayer->CanStoreItem(m_container, m_slotId, m_vec, pItem, swap); } /////////////////////////////////////////////////////////////////////////////// @@ -900,24 +900,24 @@ void Guild::BankMoveItemData::RemoveItem(SQLTransaction& trans, MoveItemData* pO m_pGuild->_DecreaseMemberRemainingSlots(trans, m_pPlayer->GetGUID(), m_container); } -Item* Guild::BankMoveItemData::StoreItem(SQLTransaction& trans, Item* item) +Item* Guild::BankMoveItemData::StoreItem(SQLTransaction& trans, Item* pItem) { - if (!item) + if (!pItem) return NULL; BankTab* pTab = m_pGuild->GetBankTab(m_container); if (!pTab) return NULL; - Item* pLastItem = item; + Item* pLastItem = pItem; for (ItemPosCountVec::const_iterator itr = m_vec.begin(); itr != m_vec.end(); ) { ItemPosCount pos(*itr); ++itr; sLog->outDebug(LOG_FILTER_GUILD, "GUILD STORAGE: StoreItem tab = %u, slot = %u, item = %u, count = %u", - m_container, m_slotId, item->GetEntry(), item->GetCount()); - pLastItem = _StoreItem(trans, pTab, item, pos, itr != m_vec.end()); + m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); + pLastItem = _StoreItem(trans, pTab, pItem, pos, itr != m_vec.end()); } return pLastItem; } @@ -946,7 +946,7 @@ void Guild::BankMoveItemData::LogAction(MoveItemData* pFrom) const m_pGuild->GetId()); } -Item* Guild::BankMoveItemData::_StoreItem(SQLTransaction& trans, BankTab* pTab, Item* item, ItemPosCount& pos, bool clone) const +Item* Guild::BankMoveItemData::_StoreItem(SQLTransaction& trans, BankTab* pTab, Item* pItem, ItemPosCount& pos, bool clone) const { uint8 slotId = uint8(pos.pos); uint32 count = pos.count; @@ -957,20 +957,20 @@ Item* Guild::BankMoveItemData::_StoreItem(SQLTransaction& trans, BankTab* pTab, pItemDest->SaveToDB(trans); if (!clone) { - item->RemoveFromWorld(); - item->DeleteFromDB(trans); - delete item; + pItem->RemoveFromWorld(); + pItem->DeleteFromDB(trans); + delete pItem; } return pItemDest; } if (clone) - item = item->CloneItem(count); + pItem = pItem->CloneItem(count); else - item->SetCount(count); + pItem->SetCount(count); - if (item && pTab->SetItem(trans, slotId, item)) - return item; + if (pItem && pTab->SetItem(trans, slotId, pItem)) + return pItem; return NULL; } @@ -979,13 +979,13 @@ Item* Guild::BankMoveItemData::_StoreItem(SQLTransaction& trans, BankTab* pTab, // If item in destination slot exists it must be the item of the same entry // and stack must have enough space to take at least one item. // Returns false if destination item specified and it cannot be used to reserve space. -bool Guild::BankMoveItemData::_ReserveSpace(uint8 slotId, Item* item, Item* pItemDest, uint32& count) +bool Guild::BankMoveItemData::_ReserveSpace(uint8 slotId, Item* pItem, Item* pItemDest, uint32& count) { - uint32 requiredSpace = item->GetMaxStackCount(); + uint32 requiredSpace = pItem->GetMaxStackCount(); if (pItemDest) { // Make sure source and destination items match and destination item has space for more stacks. - if (pItemDest->GetEntry() != item->GetEntry() || pItemDest->GetCount() >= item->GetMaxStackCount()) + if (pItemDest->GetEntry() != pItem->GetEntry() || pItemDest->GetCount() >= pItem->GetMaxStackCount()) return false; requiredSpace -= pItemDest->GetCount(); } @@ -1002,7 +1002,7 @@ bool Guild::BankMoveItemData::_ReserveSpace(uint8 slotId, Item* item, Item* pIte return true; } -void Guild::BankMoveItemData::CanStoreItemInTab(Item* item, uint8 skipSlotId, bool merge, uint32& count) +void Guild::BankMoveItemData::CanStoreItemInTab(Item* pItem, uint8 skipSlotId, bool merge, uint32& count) { for (uint8 slotId = 0; (slotId < GUILD_BANK_MAX_SLOTS) && (count > 0); ++slotId) { @@ -1011,25 +1011,25 @@ void Guild::BankMoveItemData::CanStoreItemInTab(Item* item, uint8 skipSlotId, bo continue; Item* pItemDest = m_pGuild->_GetItem(m_container, slotId); - if (pItemDest == item) + if (pItemDest == pItem) pItemDest = NULL; // If merge skip empty, if not merge skip non-empty if ((pItemDest != NULL) != merge) continue; - _ReserveSpace(slotId, item, pItemDest, count); + _ReserveSpace(slotId, pItem, pItemDest, count); } } -InventoryResult Guild::BankMoveItemData::CanStore(Item* item, bool swap) +InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap) { sLog->outDebug(LOG_FILTER_GUILD, "GUILD STORAGE: CanStore() tab = %u, slot = %u, item = %u, count = %u", - m_container, m_slotId, item->GetEntry(), item->GetCount()); + m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); - uint32 count = item->GetCount(); + uint32 count = pItem->GetCount(); // Soulbound items cannot be moved - if (item->IsSoulBound()) + if (pItem->IsSoulBound()) return EQUIP_ERR_CANT_DROP_SOULBOUND; // Make sure destination bank tab exists @@ -1041,10 +1041,10 @@ InventoryResult Guild::BankMoveItemData::CanStore(Item* item, bool swap) { Item* pItemDest = m_pGuild->_GetItem(m_container, m_slotId); // Ignore swapped item (this slot will be empty after move) - if ((pItemDest == item) || swap) + if ((pItemDest == pItem) || swap) pItemDest = NULL; - if (!_ReserveSpace(m_slotId, item, pItemDest, count)) + if (!_ReserveSpace(m_slotId, pItem, pItemDest, count)) return EQUIP_ERR_ITEM_CANT_STACK; if (count == 0) @@ -1053,15 +1053,15 @@ InventoryResult Guild::BankMoveItemData::CanStore(Item* item, bool swap) // Slot was not specified or it has not enough space for all the items in stack // Search for stacks to merge with - if (item->GetMaxStackCount() > 1) + if (pItem->GetMaxStackCount() > 1) { - CanStoreItemInTab(item, m_slotId, true, count); + CanStoreItemInTab(pItem, m_slotId, true, count); if (count == 0) return EQUIP_ERR_OK; } // Search free slot for item - CanStoreItemInTab(item, m_slotId, false, count); + CanStoreItemInTab(pItem, m_slotId, false, count); if (count == 0) return EQUIP_ERR_OK; diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 6454a979a79..e18e62e51b7 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -476,7 +476,7 @@ private: void SendText(const Guild* guild, WorldSession* session) const; inline Item* GetItem(uint8 slotId) const { return slotId < GUILD_BANK_MAX_SLOTS ? m_items[slotId] : NULL; } - bool SetItem(SQLTransaction& trans, uint8 slotId, Item* item); + bool SetItem(SQLTransaction& trans, uint8 slotId, Item* pItem); private: uint32 m_guildId; @@ -506,13 +506,13 @@ private: // Defines if player has rights to withdraw item from container virtual bool HasWithdrawRights(MoveItemData* /*pOther*/) const { return true; } // Checks if container can store specified item - bool CanStore(Item* item, bool swap, bool sendError); + bool CanStore(Item* pItem, bool swap, bool sendError); // Clones stored item bool CloneItem(uint32 count); // Remove item from container (if splited update items fields) virtual void RemoveItem(SQLTransaction& trans, MoveItemData* pOther, uint32 splitedAmount = 0) = 0; // Saves item to container - virtual Item* StoreItem(SQLTransaction& trans, Item* item) = 0; + virtual Item* StoreItem(SQLTransaction& trans, Item* pItem) = 0; // Log bank event virtual void LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const = 0; // Log GM action @@ -524,7 +524,7 @@ private: uint8 GetContainer() const { return m_container; } uint8 GetSlotId() const { return m_slotId; } protected: - virtual InventoryResult CanStore(Item* item, bool swap) = 0; + virtual InventoryResult CanStore(Item* pItem, bool swap) = 0; Guild* m_pGuild; Player* m_pPlayer; @@ -544,10 +544,10 @@ private: bool IsBank() const { return false; } bool InitItem(); void RemoveItem(SQLTransaction& trans, MoveItemData* pOther, uint32 splitedAmount = 0); - Item* StoreItem(SQLTransaction& trans, Item* item); + Item* StoreItem(SQLTransaction& trans, Item* pItem); void LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const; protected: - InventoryResult CanStore(Item* item, bool swap); + InventoryResult CanStore(Item* pItem, bool swap); }; class BankMoveItemData : public MoveItemData @@ -561,17 +561,17 @@ private: bool HasStoreRights(MoveItemData* pOther) const; bool HasWithdrawRights(MoveItemData* pOther) const; void RemoveItem(SQLTransaction& trans, MoveItemData* pOther, uint32 splitedAmount); - Item* StoreItem(SQLTransaction& trans, Item* item); + Item* StoreItem(SQLTransaction& trans, Item* pItem); void LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const; void LogAction(MoveItemData* pFrom) const; protected: - InventoryResult CanStore(Item* item, bool swap); + InventoryResult CanStore(Item* pItem, bool swap); private: - Item* _StoreItem(SQLTransaction& trans, BankTab* pTab, Item* item, ItemPosCount& pos, bool clone) const; - bool _ReserveSpace(uint8 slotId, Item* item, Item* pItemDest, uint32& count); - void CanStoreItemInTab(Item* item, uint8 skipSlotId, bool merge, uint32& count); + Item* _StoreItem(SQLTransaction& trans, BankTab* pTab, Item* pItem, ItemPosCount& pos, bool clone) const; + bool _ReserveSpace(uint8 slotId, Item* pItem, Item* pItemDest, uint32& count); + void CanStoreItemInTab(Item* pItem, uint8 skipSlotId, bool merge, uint32& count); }; typedef UNORDERED_MAP Members; diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 2188667d042..f82c52204fb 100755 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -504,8 +504,8 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) SQLTransaction trans = CharacterDatabase.BeginTransaction(); if (auction && auction->owner == player->GetGUIDLow()) { - Item* item = sAuctionMgr->GetAItem(auction->item_guidlow); - if (item) + Item* pItem = sAuctionMgr->GetAItem(auction->item_guidlow); + if (pItem) { if (auction->bidder > 0) // If we have a bidder, we have to send him the money he paid { @@ -522,7 +522,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) // item will deleted or added to received mail list MailDraft(msgAuctionCanceledOwner.str(), "") // TODO: fix body - .AddItem(item) + .AddItem(pItem) .SendMailTo(trans, player, auction, MAIL_CHECK_MASK_COPIED); } else diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 9e637665f55..2434ba6eaa7 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -255,14 +255,14 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data) } } - Item* item = _player->GetItemByPos(bag, slot); - if (!item) + Item* pItem = _player->GetItemByPos(bag, slot); + if (!pItem) { _player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); return; } - if (item->GetTemplate()->Flags & ITEM_PROTO_FLAG_INDESTRUCTIBLE) + if (pItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_INDESTRUCTIBLE) { _player->SendEquipError(EQUIP_ERR_CANT_DROP_SOULBOUND, NULL, NULL); return; @@ -271,7 +271,7 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data) if (count) { uint32 i_count = count; - _player->DestroyItemCount(item, i_count, true); + _player->DestroyItemCount(pItem, i_count, true); } else _player->DestroyItem(bag, slot, true); @@ -445,13 +445,13 @@ void WorldSession::HandleReadItem(WorldPacket & recv_data) recv_data >> bag >> slot; //sLog->outDetail("STORAGE: Read bag = %u, slot = %u", bag, slot); - Item* item = _player->GetItemByPos(bag, slot); + Item* pItem = _player->GetItemByPos(bag, slot); - if (item && item->GetTemplate()->PageText) + if (pItem && pItem->GetTemplate()->PageText) { WorldPacket data; - InventoryResult msg = _player->CanUseItem(item); + InventoryResult msg = _player->CanUseItem(pItem); if (msg == EQUIP_ERR_OK) { data.Initialize (SMSG_READ_ITEM_OK, 8); @@ -461,9 +461,9 @@ void WorldSession::HandleReadItem(WorldPacket & recv_data) { data.Initialize(SMSG_READ_ITEM_FAILED, 8); sLog->outDetail("STORAGE: Unable to read item"); - _player->SendEquipError(msg, item, NULL); + _player->SendEquipError(msg, pItem, NULL); } - data << item->GetGUID(); + data << pItem->GetGUID(); SendPacket(&data); } else @@ -506,25 +506,25 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - Item* item = _player->GetItemByGuid(itemguid); - if (item) + Item* pItem = _player->GetItemByGuid(itemguid); + if (pItem) { // prevent sell not owner item - if (_player->GetGUID() != item->GetOwnerGUID()) + if (_player->GetGUID() != pItem->GetOwnerGUID()) { _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); return; } // prevent sell non empty bag by drag-and-drop at vendor's item list - if (item->IsNotEmptyBag()) + if (pItem->IsNotEmptyBag()) { _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); return; } // prevent sell currently looted item - if (_player->GetLootGUID() == item->GetGUID()) + if (_player->GetLootGUID() == pItem->GetGUID()) { _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); return; @@ -533,44 +533,44 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) // prevent selling item for sellprice when the item is still refundable // this probably happens when right clicking a refundable item, the client sends both // CMSG_SELL_ITEM and CMSG_REFUND_ITEM (unverified) - if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) + if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) return; // Therefore, no feedback to client // special case at auto sell (sell all) if (count == 0) { - count = item->GetCount(); + count = pItem->GetCount(); } else { // prevent sell more items that exist in stack (possible only not from client) - if (count > item->GetCount()) + if (count > pItem->GetCount()) { _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); return; } } - ItemTemplate const* pProto = item->GetTemplate(); + ItemTemplate const* pProto = pItem->GetTemplate(); if (pProto) { if (pProto->SellPrice > 0) { - if (count < item->GetCount()) // need split items + if (count < pItem->GetCount()) // need split items { - Item* pNewItem = item->CloneItem(count, _player); + Item* pNewItem = pItem->CloneItem(count, _player); if (!pNewItem) { - sLog->outError("WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", item->GetEntry(), count); + sLog->outError("WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", pItem->GetEntry(), count); _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); return; } - item->SetCount(item->GetCount() - count); - _player->ItemRemovedQuestCheck(item->GetEntry(), count); + pItem->SetCount(pItem->GetCount() - count); + _player->ItemRemovedQuestCheck(pItem->GetEntry(), count); if (_player->IsInWorld()) - item->SendUpdateToPlayer(_player); - item->SetState(ITEM_CHANGED, _player); + pItem->SendUpdateToPlayer(_player); + pItem->SetState(ITEM_CHANGED, _player); _player->AddItemToBuyBackSlot(pNewItem); if (_player->IsInWorld()) @@ -578,10 +578,10 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) } else { - _player->ItemRemovedQuestCheck(item->GetEntry(), item->GetCount()); - _player->RemoveItem(item->GetBagSlot(), item->GetSlot(), true); - item->RemoveFromUpdateQueueOf(_player); - _player->AddItemToBuyBackSlot(item); + _player->ItemRemovedQuestCheck(pItem->GetEntry(), pItem->GetCount()); + _player->RemoveItem(pItem->GetBagSlot(), pItem->GetSlot(), true); + pItem->RemoveFromUpdateQueueOf(_player); + _player->AddItemToBuyBackSlot(pItem); } uint32 money = pProto->SellPrice * count; @@ -617,28 +617,28 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data) if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - Item* item = _player->GetItemFromBuyBackSlot(slot); - if (item) + Item* pItem = _player->GetItemFromBuyBackSlot(slot); + if (pItem) { uint32 price = _player->GetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + slot - BUYBACK_SLOT_START); if (!_player->HasEnoughMoney(price)) { - _player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, item->GetEntry(), 0); + _player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, pItem->GetEntry(), 0); return; } ItemPosCountVec dest; - InventoryResult msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, item, false); + InventoryResult msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, pItem, false); if (msg == EQUIP_ERR_OK) { _player->ModifyMoney(-(int32)price); _player->RemoveItemFromBuyBackSlot(slot, false); - _player->ItemAddedQuestCheck(item->GetEntry(), item->GetCount()); - _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item->GetEntry(), item->GetCount()); - _player->StoreItem(dest, item, true); + _player->ItemAddedQuestCheck(pItem->GetEntry(), pItem->GetCount()); + _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, pItem->GetEntry(), pItem->GetCount()); + _player->StoreItem(dest, pItem, true); } else - _player->SendEquipError(msg, item, NULL); + _player->SendEquipError(msg, pItem, NULL); return; } else @@ -815,8 +815,8 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) recv_data >> srcbag >> srcslot >> dstbag; //sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u", srcbag, srcslot, dstbag); - Item* item = _player->GetItemByPos(srcbag, srcslot); - if (!item) + Item* pItem = _player->GetItemByPos(srcbag, srcslot); + if (!pItem) return; if (!_player->IsValidPos(dstbag, NULL_SLOT, false)) // can be autostore pos @@ -825,7 +825,7 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) return; } - uint16 src = item->GetPos(); + uint16 src = pItem->GetPos(); // check unequip potability for equipped items and bank bags if (_player->IsEquipmentPos (src) || _player->IsBagPos (src)) @@ -833,16 +833,16 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) InventoryResult msg = _player->CanUnequipItem(src, !_player->IsBagPos (src)); if (msg != EQUIP_ERR_OK) { - _player->SendEquipError(msg, item, NULL); + _player->SendEquipError(msg, pItem, NULL); return; } } ItemPosCountVec dest; - InventoryResult msg = _player->CanStoreItem(dstbag, NULL_SLOT, dest, item, false); + InventoryResult msg = _player->CanStoreItem(dstbag, NULL_SLOT, dest, pItem, false); if (msg != EQUIP_ERR_OK) { - _player->SendEquipError(msg, item, NULL); + _player->SendEquipError(msg, pItem, NULL); return; } @@ -850,12 +850,12 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) if (dest.size() == 1 && dest[0].pos == src) { // just remove grey item state - _player->SendEquipError(EQUIP_ERR_NONE, item, NULL); + _player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); return; } _player->RemoveItem(srcbag, srcslot, true); - _player->StoreItem(dest, item, true); + _player->StoreItem(dest, pItem, true); } void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) @@ -919,27 +919,27 @@ void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket) recvPacket >> srcbag >> srcslot; sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); - Item* item = _player->GetItemByPos(srcbag, srcslot); - if (!item) + Item* pItem = _player->GetItemByPos(srcbag, srcslot); + if (!pItem) return; ItemPosCountVec dest; - InventoryResult msg = _player->CanBankItem(NULL_BAG, NULL_SLOT, dest, item, false); + InventoryResult msg = _player->CanBankItem(NULL_BAG, NULL_SLOT, dest, pItem, false); if (msg != EQUIP_ERR_OK) { - _player->SendEquipError(msg, item, NULL); + _player->SendEquipError(msg, pItem, NULL); return; } - if (dest.size() == 1 && dest[0].pos == item->GetPos()) + if (dest.size() == 1 && dest[0].pos == pItem->GetPos()) { - _player->SendEquipError(EQUIP_ERR_NONE, item, NULL); + _player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); return; } _player->RemoveItem(srcbag, srcslot, true); - _player->ItemRemovedQuestCheck(item->GetEntry(), item->GetCount()); - _player->BankItem(dest, item, true); + _player->ItemRemovedQuestCheck(pItem->GetEntry(), pItem->GetCount()); + _player->BankItem(dest, pItem, true); } void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket) @@ -950,36 +950,36 @@ void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket) recvPacket >> srcbag >> srcslot; sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); - Item* item = _player->GetItemByPos(srcbag, srcslot); - if (!item) + Item* pItem = _player->GetItemByPos(srcbag, srcslot); + if (!pItem) return; if (_player->IsBankPos(srcbag, srcslot)) // moving from bank to inventory { ItemPosCountVec dest; - InventoryResult msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, item, false); + InventoryResult msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, pItem, false); if (msg != EQUIP_ERR_OK) { - _player->SendEquipError(msg, item, NULL); + _player->SendEquipError(msg, pItem, NULL); return; } _player->RemoveItem(srcbag, srcslot, true); - _player->StoreItem(dest, item, true); - _player->ItemAddedQuestCheck(item->GetEntry(), item->GetCount()); + _player->StoreItem(dest, pItem, true); + _player->ItemAddedQuestCheck(pItem->GetEntry(), pItem->GetCount()); } else // moving from inventory to bank { ItemPosCountVec dest; - InventoryResult msg = _player->CanBankItem(NULL_BAG, NULL_SLOT, dest, item, false); + InventoryResult msg = _player->CanBankItem(NULL_BAG, NULL_SLOT, dest, pItem, false); if (msg != EQUIP_ERR_OK) { - _player->SendEquipError(msg, item, NULL); + _player->SendEquipError(msg, pItem, NULL); return; } _player->RemoveItem(srcbag, srcslot, true); - _player->BankItem(dest, item, true); + _player->BankItem(dest, pItem, true); } } diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index b4d6db5e80c..8e4b41a9be4 100755 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -55,15 +55,15 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data) } else if (IS_ITEM_GUID(lguid)) { - Item* item = player->GetItemByGuid(lguid); + Item* pItem = player->GetItemByGuid(lguid); - if (!item) + if (!pItem) { player->SendLootRelease(lguid); return; } - loot = &item->loot; + loot = &pItem->loot; } else if (IS_CORPSE_GUID(lguid)) { @@ -357,29 +357,29 @@ void WorldSession::DoLootRelease(uint64 lguid) } else if (IS_ITEM_GUID(lguid)) { - Item* item = player->GetItemByGuid(lguid); - if (!item) + Item* pItem = player->GetItemByGuid(lguid); + if (!pItem) return; - ItemTemplate const* proto = item->GetTemplate(); + ItemTemplate const* proto = pItem->GetTemplate(); // destroy only 5 items from stack in case prospecting and milling if (proto->Flags & (ITEM_PROTO_FLAG_PROSPECTABLE | ITEM_PROTO_FLAG_MILLABLE)) { - item->m_lootGenerated = false; - item->loot.clear(); + pItem->m_lootGenerated = false; + pItem->loot.clear(); - uint32 count = item->GetCount(); + uint32 count = pItem->GetCount(); // >=5 checked in spell code, but will work for cheating cases also with removing from another stacks. if (count > 5) count = 5; - player->DestroyItemCount(item, count, true); + player->DestroyItemCount(pItem, count, true); } else // FIXME: item must not be deleted in case not fully looted state. But this pre-request implement loot saving in DB at item save. Or cheating possible. - player->DestroyItem(item->GetBagSlot(), item->GetSlot(), true); + player->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true); return; // item can be looted only single player } else diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index a8ebb4722dd..9ea0e124112 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -86,53 +86,53 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) return; } - Item* item = pUser->GetUseableItemByPos(bagIndex, slot); - if (!item) + Item* pItem = pUser->GetUseableItemByPos(bagIndex, slot); + if (!pItem) { pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); return; } - if (item->GetGUID() != itemGUID) + if (pItem->GetGUID() != itemGUID) { pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); return; } - sLog->outDetail("WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, castCount: %u, spellId: %u, Item: %u, glyphIndex: %u, data length = %i", bagIndex, slot, castCount, spellId, item->GetEntry(), glyphIndex, (uint32)recvPacket.size()); + sLog->outDetail("WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, castCount: %u, spellId: %u, Item: %u, glyphIndex: %u, data length = %i", bagIndex, slot, castCount, spellId, pItem->GetEntry(), glyphIndex, (uint32)recvPacket.size()); - ItemTemplate const* proto = item->GetTemplate(); + ItemTemplate const* proto = pItem->GetTemplate(); if (!proto) { - pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, item, NULL); + pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, pItem, NULL); return; } // some item classes can be used only in equipped state - if (proto->InventoryType != INVTYPE_NON_EQUIP && !item->IsEquipped()) + if (proto->InventoryType != INVTYPE_NON_EQUIP && !pItem->IsEquipped()) { - pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, item, NULL); + pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, pItem, NULL); return; } - InventoryResult msg = pUser->CanUseItem(item); + InventoryResult msg = pUser->CanUseItem(pItem); if (msg != EQUIP_ERR_OK) { - pUser->SendEquipError(msg, item, NULL); + pUser->SendEquipError(msg, pItem, NULL); return; } // only allow conjured consumable, bandage, poisons (all should have the 2^21 item flag set in DB) if (proto->Class == ITEM_CLASS_CONSUMABLE && !(proto->Flags & ITEM_PROTO_FLAG_USEABLE_IN_ARENA) && pUser->InArena()) { - pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, item, NULL); + pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, pItem, NULL); return; } // don't allow items banned in arena if (proto->Flags & ITEM_PROTO_FLAG_NOT_USEABLE_IN_ARENA && pUser->InArena()) { - pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, item, NULL); + pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, pItem, NULL); return; } @@ -144,7 +144,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) { if (!spellInfo->CanBeUsedInCombat()) { - pUser->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT, item, NULL); + pUser->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT, pItem, NULL); return; } } @@ -152,12 +152,12 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) } // check also BIND_WHEN_PICKED_UP and BIND_QUEST_ITEM for .additem or .additemset case by GM (not binded at adding to inventory) - if (item->GetTemplate()->Bonding == BIND_WHEN_USE || item->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || item->GetTemplate()->Bonding == BIND_QUEST_ITEM) + if (pItem->GetTemplate()->Bonding == BIND_WHEN_USE || pItem->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || pItem->GetTemplate()->Bonding == BIND_QUEST_ITEM) { - if (!item->IsSoulBound()) + if (!pItem->IsSoulBound()) { - item->SetState(ITEM_CHANGED, pUser); - item->SetBinding(true); + pItem->SetState(ITEM_CHANGED, pUser); + pItem->SetBinding(true); } } @@ -166,10 +166,10 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) HandleClientCastFlags(recvPacket, castFlags, targets); // Note: If script stop casting it must send appropriate data to client to prevent stuck item in gray state. - if (!sScriptMgr->OnItemUse(pUser, item, targets)) + if (!sScriptMgr->OnItemUse(pUser, pItem, targets)) { // no script or script not process request by self - pUser->CastItemUseSpell(item, targets, castCount, glyphIndex); + pUser->CastItemUseSpell(pItem, targets, castCount, glyphIndex); } } diff --git a/src/server/game/Mails/Mail.cpp b/src/server/game/Mails/Mail.cpp index 3511e5016fd..3c3888eb9f8 100755 --- a/src/server/game/Mails/Mail.cpp +++ b/src/server/game/Mails/Mail.cpp @@ -219,10 +219,10 @@ void MailDraft::SendMailTo(SQLTransaction& trans, MailReceiver const& receiver, for (MailItemMap::const_iterator mailItemIter = m_items.begin(); mailItemIter != m_items.end(); ++mailItemIter) { - Item* item = mailItemIter->second; + Item* pItem = mailItemIter->second; stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_MAIL_ITEM); stmt->setUInt32(0, mailId); - stmt->setUInt32(1, item->GetGUIDLow()); + stmt->setUInt32(1, pItem->GetGUIDLow()); stmt->setUInt32(2, receiver.GetPlayerGUIDLow()); trans->Append(stmt); } diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 15c46a81494..fba6b460ec9 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -1341,10 +1341,10 @@ void ScriptMgr::OnGuildMemberDepositMoney(Guild* guild, Player* player, uint32 & FOREACH_SCRIPT(GuildScript)->OnMemberDepositMoney(guild, player, amount); } -void ScriptMgr::OnGuildItemMove(Guild* guild, Player* player, Item* item, bool isSrcBank, uint8 srcContainer, uint8 srcSlotId, +void ScriptMgr::OnGuildItemMove(Guild* guild, Player* player, Item* pItem, bool isSrcBank, uint8 srcContainer, uint8 srcSlotId, bool isDestBank, uint8 destContainer, uint8 destSlotId) { - FOREACH_SCRIPT(GuildScript)->OnItemMove(guild, player, item, isSrcBank, srcContainer, srcSlotId, isDestBank, destContainer, destSlotId); + FOREACH_SCRIPT(GuildScript)->OnItemMove(guild, player, pItem, isSrcBank, srcContainer, srcSlotId, isDestBank, destContainer, destSlotId); } void ScriptMgr::OnGuildEvent(Guild* guild, uint8 eventType, uint32 playerGuid1, uint32 playerGuid2, uint8 newRank) diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 13c14113627..3b65a5cf256 100755 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -764,7 +764,7 @@ class GuildScript : public ScriptObject virtual void OnMemberDepositMoney(Guild* /*guild*/, Player* /*player*/, uint32& /*amount*/) { } // Called when a guild member moves an item in a guild bank. - virtual void OnItemMove(Guild* /*guild*/, Player* /*player*/, Item* /*item*/, bool /*isSrcBank*/, uint8 /*srcContainer*/, uint8 /*srcSlotId*/, + virtual void OnItemMove(Guild* /*guild*/, Player* /*player*/, Item* /*pItem*/, bool /*isSrcBank*/, uint8 /*srcContainer*/, uint8 /*srcSlotId*/, bool /*isDestBank*/, uint8 /*destContainer*/, uint8 /*destSlotId*/) { } virtual void OnEvent(Guild* /*guild*/, uint8 /*eventType*/, uint32 /*playerGuid1*/, uint32 /*playerGuid2*/, uint8 /*newRank*/) { } @@ -1008,7 +1008,7 @@ class ScriptMgr void OnGuildDisband(Guild* guild); void OnGuildMemberWitdrawMoney(Guild* guild, Player* player, uint32 &amount, bool isRepair); void OnGuildMemberDepositMoney(Guild* guild, Player* player, uint32 &amount); - void OnGuildItemMove(Guild* guild, Player* player, Item* item, bool isSrcBank, uint8 srcContainer, uint8 srcSlotId, + void OnGuildItemMove(Guild* guild, Player* player, Item* pItem, bool isSrcBank, uint8 srcContainer, uint8 srcSlotId, bool isDestBank, uint8 destContainer, uint8 destSlotId); void OnGuildEvent(Guild* guild, uint8 eventType, uint32 playerGuid1, uint32 playerGuid2, uint8 newRank); void OnGuildBankEvent(Guild* guild, uint8 eventType, uint8 tabId, uint32 playerGuid, uint32 itemOrMoney, uint16 itemStackCount, uint8 destTabId); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index a8e7d33e9eb..387f76bbc7f 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2102,9 +2102,9 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo // and also HandleAuraModDisarm is not triggered if (!target->CanUseAttackType(BASE_ATTACK)) { - if (Item* item = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND)) + if (Item* pItem = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND)) { - target->ToPlayer()->_ApplyWeaponDamage(EQUIPMENT_SLOT_MAINHAND, item->GetTemplate(), NULL, apply); + target->ToPlayer()->_ApplyWeaponDamage(EQUIPMENT_SLOT_MAINHAND, pItem->GetTemplate(), NULL, apply); } } } @@ -2536,14 +2536,14 @@ void AuraEffect::HandleAuraModDisarm(AuraApplication const* aurApp, uint8 mode, // Handle damage modification, shapeshifted druids are not affected if (target->GetTypeId() == TYPEID_PLAYER && !target->IsInFeralForm()) { - if (Item* item = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) + if (Item* pItem = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) { uint8 attacktype = Player::GetAttackBySlot(slot); if (attacktype < MAX_ATTACK) { - target->ToPlayer()->_ApplyWeaponDamage(slot, item->GetTemplate(), NULL, !apply); - target->ToPlayer()->_ApplyWeaponDependentAuraMods(item, WeaponAttackType(attacktype), !apply); + target->ToPlayer()->_ApplyWeaponDamage(slot, pItem->GetTemplate(), NULL, !apply); + target->ToPlayer()->_ApplyWeaponDependentAuraMods(pItem, WeaponAttackType(attacktype), !apply); } } } @@ -4082,8 +4082,8 @@ void AuraEffect::HandleAuraModWeaponCritPercent(AuraApplication const* aurApp, u return; for (int i = 0; i < MAX_ATTACK; ++i) - if (Item* item = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true)) - target->ToPlayer()->_ApplyWeaponDependentAuraCritMod(item, WeaponAttackType(i), this, apply); + if (Item* pItem = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true)) + target->ToPlayer()->_ApplyWeaponDependentAuraCritMod(pItem, WeaponAttackType(i), this, apply); // mods must be applied base at equipped weapon class and subclass comparison // with spell->EquippedItemClass and EquippedItemSubClassMask and EquippedItemInventoryTypeMask @@ -4395,8 +4395,8 @@ void AuraEffect::HandleModDamageDone(AuraApplication const* aurApp, uint8 mode, if (target->GetTypeId() == TYPEID_PLAYER) { for (int i = 0; i < MAX_ATTACK; ++i) - if (Item* item = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true)) - target->ToPlayer()->_ApplyWeaponDependentAuraDamageMod(item, WeaponAttackType(i), this, apply); + if (Item* pItem = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true)) + target->ToPlayer()->_ApplyWeaponDependentAuraDamageMod(pItem, WeaponAttackType(i), this, apply); } // GetMiscValue() is bitmask of spell schools diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 2d3bd095360..ae5b14989af 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -530,8 +530,8 @@ m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharme if (m_attackType == RANGED_ATTACK) // wand case if ((m_caster->getClassMask() & CLASSMASK_WAND_USERS) != 0 && m_caster->GetTypeId() == TYPEID_PLAYER) - if (Item* item = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK)) - m_spellSchoolMask = SpellSchoolMask(1 << item->GetTemplate()->Damage[0].DamageType); + if (Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK)) + m_spellSchoolMask = SpellSchoolMask(1 << pItem->GetTemplate()->Damage[0].DamageType); if (originalCasterGUID) m_originalCasterGUID = originalCasterGUID; @@ -3952,12 +3952,12 @@ void Spell::WriteAmmoToPacket(WorldPacket* data) if (m_caster->GetTypeId() == TYPEID_PLAYER) { - Item* item = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK); - if (item) + Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK); + if (pItem) { - ammoInventoryType = item->GetTemplate()->InventoryType; + ammoInventoryType = pItem->GetTemplate()->InventoryType; if (ammoInventoryType == INVTYPE_THROWN) - ammoDisplayID = item->GetTemplate()->DisplayInfoID; + ammoDisplayID = pItem->GetTemplate()->DisplayInfoID; else { uint32 ammoID = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID); @@ -4361,15 +4361,15 @@ void Spell::TakeAmmo() { if (m_attackType == RANGED_ATTACK && m_caster->GetTypeId() == TYPEID_PLAYER) { - Item* item = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK); + Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK); // wands don't have ammo - if (!item || item->IsBroken() || item->GetTemplate()->SubClass == ITEM_SUBCLASS_WEAPON_WAND) + if (!pItem || pItem->IsBroken() || pItem->GetTemplate()->SubClass == ITEM_SUBCLASS_WEAPON_WAND) return; - if (item->GetTemplate()->InventoryType == INVTYPE_THROWN) + if (pItem->GetTemplate()->InventoryType == INVTYPE_THROWN) { - if (item->GetMaxStackCount() == 1) + if (pItem->GetMaxStackCount() == 1) { // decrease durability for non-stackable throw weapon m_caster->ToPlayer()->DurabilityPointLossForEquipSlot(EQUIPMENT_SLOT_RANGED); @@ -4378,7 +4378,7 @@ void Spell::TakeAmmo() { // decrease items amount for stackable throw weapon uint32 count = 1; - m_caster->ToPlayer()->DestroyItemCount(item, count, true); + m_caster->ToPlayer()->DestroyItemCount(pItem, count, true); } } else if (uint32 ammo = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID)) @@ -6216,15 +6216,15 @@ SpellCastResult Spell::CheckItems() if (m_caster->GetTypeId() != TYPEID_PLAYER) return SPELL_FAILED_TARGET_NOT_PLAYER; if (m_attackType != RANGED_ATTACK) break; - Item* item = m_caster->ToPlayer()->GetWeaponForAttack(m_attackType); - if (!item || item->IsBroken()) + Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(m_attackType); + if (!pItem || pItem->IsBroken()) return SPELL_FAILED_EQUIPPED_ITEM; - switch (item->GetTemplate()->SubClass) + switch (pItem->GetTemplate()->SubClass) { case ITEM_SUBCLASS_WEAPON_THROWN: { - uint32 ammo = item->GetEntry(); + uint32 ammo = pItem->GetEntry(); if (!m_caster->ToPlayer()->HasItemCount(ammo, 1)) return SPELL_FAILED_NO_AMMO; }; break; @@ -6250,7 +6250,7 @@ SpellCastResult Spell::CheckItems() return SPELL_FAILED_NO_AMMO; // check ammo ws. weapon compatibility - switch (item->GetTemplate()->SubClass) + switch (pItem->GetTemplate()->SubClass) { case ITEM_SUBCLASS_WEAPON_BOW: case ITEM_SUBCLASS_WEAPON_CROSSBOW: @@ -6286,10 +6286,10 @@ SpellCastResult Spell::CheckItems() if (!pProto) return SPELL_FAILED_ITEM_AT_MAX_CHARGES; - if (Item* item = p_caster->GetItemByEntry(item_id)) + if (Item* pitem = p_caster->GetItemByEntry(item_id)) { for (int x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) - if (pProto->Spells[x].SpellCharges != 0 && item->GetSpellCharges(x) == pProto->Spells[x].SpellCharges) + if (pProto->Spells[x].SpellCharges != 0 && pitem->GetSpellCharges(x) == pProto->Spells[x].SpellCharges) return SPELL_FAILED_ITEM_AT_MAX_CHARGES; } break; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 07b7921e6e3..59b6d8971cf 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1777,22 +1777,22 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype) if (num_to_add) { // create the new item and store it - Item* item = player->StoreNewItem(dest, newitemid, true, Item::GenerateItemRandomPropertyId(newitemid)); + Item* pItem = player->StoreNewItem(dest, newitemid, true, Item::GenerateItemRandomPropertyId(newitemid)); // was it successful? return error if not - if (!item) + if (!pItem) { player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); return; } // set the "Crafted by ..." property of the item - if (item->GetTemplate()->Class != ITEM_CLASS_CONSUMABLE && item->GetTemplate()->Class != ITEM_CLASS_QUEST && newitemid != 6265 && newitemid != 6948) - item->SetUInt32Value(ITEM_FIELD_CREATOR, player->GetGUIDLow()); + if (pItem->GetTemplate()->Class != ITEM_CLASS_CONSUMABLE && pItem->GetTemplate()->Class != ITEM_CLASS_QUEST && newitemid != 6265 && newitemid != 6948) + pItem->SetUInt32Value(ITEM_FIELD_CREATOR, player->GetGUIDLow()); // send info to the client - if (item) - player->SendNewItem(item, num_to_add, true, bgType == 0); + if (pItem) + player->SendNewItem(pItem, num_to_add, true, bgType == 0); // we succeeded in creating at least one item, so a levelup is possible if (bgType == 0) @@ -6672,11 +6672,11 @@ void Spell::EffectRechargeManaGem(SpellEffIndex /*effIndex*/) return; } - if (Item* item = player->GetItemByEntry(item_id)) + if (Item* pItem = player->GetItemByEntry(item_id)) { for (int x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) - item->SetSpellCharges(x, pProto->Spells[x].SpellCharges); - item->SetState(ITEM_CHANGED, player); + pItem->SetSpellCharges(x, pProto->Spells[x].SpellCharges); + pItem->SetState(ITEM_CHANGED, player); } } diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 8d803a54096..67ac6f8ff76 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -163,15 +163,15 @@ public: if (!*args) return false; - char* item = handler->extractKeyFromLink((char*)args, "Hitem"); - if (!item) + char* pitem = handler->extractKeyFromLink((char*)args, "Hitem"); + if (!pitem) { handler->SendSysMessage(LANG_COMMAND_NEEDITEMSEND); handler->SetSentErrorMessage(true); return false; } - int32 item_int = atol(item); + int32 item_int = atol(pitem); if (item_int <= 0) return false; @@ -411,14 +411,14 @@ public: return false; } - char* item = handler->extractKeyFromLink((char*)args, "Hitem"); - if (!item) + char* pitem = handler->extractKeyFromLink((char*)args, "Hitem"); + if (!pitem) { handler->SendSysMessage(LANG_COMMAND_NEEDITEMSEND); handler->SetSentErrorMessage(true); return false; } - uint32 itemId = atol(item); + uint32 itemId = atol(pitem); if (!sObjectMgr->RemoveVendorItem(vendor->GetEntry(), itemId)) { diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp index 10227910ec8..7c82454ba87 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -267,11 +267,11 @@ public: //dosen't work at all if (uiShieldBreakerTimer <= uiDiff) { - Vehicle* vehicle = me->GetVehicleKit(); - if (!vehicle) + Vehicle* pVehicle = me->GetVehicleKit(); + if (!pVehicle) return; - if (Unit* pPassenger = vehicle->GetPassenger(SEAT_ID_0)) + if (Unit* pPassenger = pVehicle->GetPassenger(SEAT_ID_0)) { Map::PlayerList const& players = me->GetMap()->GetPlayers(); if (me->GetMap()->IsDungeon() && !players.isEmpty()) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp index 7f12853ef0b..a2919de0149 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp @@ -221,8 +221,8 @@ public: { uiVehicle1GUID = pBoss->GetGUID(); uint64 uiGrandChampionBoss1 = 0; - if (Vehicle* vehicle = pBoss->GetVehicleKit()) - if (Unit* unit = vehicle->GetPassenger(0)) + if (Vehicle* pVehicle = pBoss->GetVehicleKit()) + if (Unit* unit = pVehicle->GetPassenger(0)) uiGrandChampionBoss1 = unit->GetGUID(); if (instance) { @@ -236,8 +236,8 @@ public: { uiVehicle2GUID = pBoss->GetGUID(); uint64 uiGrandChampionBoss2 = 0; - if (Vehicle* vehicle = pBoss->GetVehicleKit()) - if (Unit* unit = vehicle->GetPassenger(0)) + if (Vehicle* pVehicle = pBoss->GetVehicleKit()) + if (Unit* unit = pVehicle->GetPassenger(0)) uiGrandChampionBoss2 = unit->GetGUID(); if (instance) { @@ -251,8 +251,8 @@ public: { uiVehicle3GUID = pBoss->GetGUID(); uint64 uiGrandChampionBoss3 = 0; - if (Vehicle* vehicle = pBoss->GetVehicleKit()) - if (Unit* unit = vehicle->GetPassenger(0)) + if (Vehicle* pVehicle = pBoss->GetVehicleKit()) + if (Unit* unit = pVehicle->GetPassenger(0)) uiGrandChampionBoss3 = unit->GetGUID(); if (instance) { diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index fab0188de4d..c313a2138a6 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -176,9 +176,9 @@ public: { if (AggroYellTimer <= diff) { - if (Unit* member = Unit::GetUnit(*me, Council[YellCounter])) + if (Unit* pMember = Unit::GetUnit(*me, Council[YellCounter])) { - DoScriptText(CouncilAggro[YellCounter].entry, member); + DoScriptText(CouncilAggro[YellCounter].entry, pMember); AggroYellTimer = CouncilAggro[YellCounter].timer; } ++YellCounter; @@ -191,10 +191,10 @@ public: { if (EnrageTimer <= diff) { - if (Unit* member = Unit::GetUnit(*me, Council[YellCounter])) + if (Unit* pMember = Unit::GetUnit(*me, Council[YellCounter])) { - member->CastSpell(member, SPELL_BERSERK, true); - DoScriptText(CouncilEnrage[YellCounter].entry, member); + pMember->CastSpell(pMember, SPELL_BERSERK, true); + DoScriptText(CouncilEnrage[YellCounter].entry, pMember); EnrageTimer = CouncilEnrage[YellCounter].timer; } ++YellCounter; @@ -242,19 +242,19 @@ public: DeathCount = 0; - Creature* member = NULL; + Creature* pMember = NULL; for (uint8 i = 0; i < 4; ++i) { - member = Unit::GetCreature((*me), Council[i]); - if (!member) + pMember = Unit::GetCreature((*me), Council[i]); + if (!pMember) continue; - if (!member->isAlive()) + if (!pMember->isAlive()) { - member->RemoveCorpse(); - member->Respawn(); + pMember->RemoveCorpse(); + pMember->Respawn(); } - member->AI()->EnterEvadeMode(); + pMember->AI()->EnterEvadeMode(); } if (instance) @@ -332,9 +332,9 @@ public: return; } - Creature* member = (Unit::GetCreature(*me, Council[DeathCount])); - if (member && member->isAlive()) - member->DealDamage(member, member->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + Creature* pMember = (Unit::GetCreature(*me, Council[DeathCount])); + if (pMember && pMember->isAlive()) + pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); ++DeathCount; EndEventTimer = 1500; } else EndEventTimer -= diff; diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index f2f2f9e3cdd..079221a97e8 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -55,8 +55,8 @@ class spell_item_trigger_spell : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { Unit* caster = GetCaster(); - if (Item* item = GetCastItem()) - caster->CastSpell(caster, _triggeredSpellId, true, item); + if (Item* pItem = GetCastItem()) + caster->CastSpell(caster, _triggeredSpellId, true, pItem); } void Register() diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index bb5d7380695..cf55bb14895 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -47,9 +47,9 @@ class item_only_for_flight : public ItemScript public: item_only_for_flight() : ItemScript("item_only_for_flight") { } - bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/) + bool OnUse(Player* player, Item* pItem, SpellCastTargets const& /*targets*/) { - uint32 itemId = item->GetEntry(); + uint32 itemId = pItem->GetEntry(); bool disabled = false; //for special scripts @@ -74,7 +74,7 @@ public: return false; // error - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); + player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); return true; } }; @@ -110,13 +110,13 @@ class item_gor_dreks_ointment : public ItemScript public: item_gor_dreks_ointment() : ItemScript("item_gor_dreks_ointment") { } - bool OnUse(Player* player, Item* item, SpellCastTargets const& targets) + bool OnUse(Player* player, Item* pItem, SpellCastTargets const& targets) { if (targets.GetUnitTarget() && targets.GetUnitTarget()->GetTypeId() == TYPEID_UNIT && targets.GetUnitTarget()->GetEntry() == 20748 && !targets.GetUnitTarget()->HasAura(32578)) return false; - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); + player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); return true; } }; @@ -130,13 +130,13 @@ class item_incendiary_explosives : public ItemScript public: item_incendiary_explosives() : ItemScript("item_incendiary_explosives") { } - bool OnUse(Player* player, Item* item, SpellCastTargets const & /*targets*/) + bool OnUse(Player* player, Item* pItem, SpellCastTargets const & /*targets*/) { if (player->FindNearestCreature(26248, 15) || player->FindNearestCreature(26249, 15)) return false; else { - player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL); + player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL); return true; } } @@ -219,7 +219,7 @@ class item_pile_fake_furs : public ItemScript public: item_pile_fake_furs() : ItemScript("item_pile_fake_furs") { } - bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const & /*targets*/) + bool OnUse(Player* player, Item* /*pItem*/, SpellCastTargets const & /*targets*/) { GameObject* go = NULL; for (uint8 i = 0; i < CaribouTrapsNum; ++i) @@ -264,14 +264,14 @@ class item_petrov_cluster_bombs : public ItemScript public: item_petrov_cluster_bombs() : ItemScript("item_petrov_cluster_bombs") { } - bool OnUse(Player* player, Item* item, const SpellCastTargets & /*targets*/) + bool OnUse(Player* player, Item* pItem, const SpellCastTargets & /*targets*/) { if (player->GetZoneId() != ZONE_ID_HOWLING) return false; if (!player->GetTransport() || player->GetAreaId() != AREA_ID_SHATTERED_STRAITS) { - player->SendEquipError(EQUIP_ERR_NONE, item, NULL); + player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); if (const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB)) Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_HERE); @@ -330,7 +330,7 @@ class item_dehta_trap_smasher : public ItemScript public: item_dehta_trap_smasher() : ItemScript("item_dehta_trap_smasher") { } - bool OnUse(Player* player, Item* /*item*/, const SpellCastTargets & /*targets*/) + bool OnUse(Player* player, Item* /*pItem*/, const SpellCastTargets & /*targets*/) { if (player->GetQuestStatus(QUEST_CANNOT_HELP_THEMSELVES) != QUEST_STATUS_INCOMPLETE) return false; @@ -367,7 +367,7 @@ class item_trident_of_nazjan : public ItemScript public: item_trident_of_nazjan() : ItemScript("item_Trident_of_Nazjan") { } - bool OnUse(Player* player, Item* item, const SpellCastTargets & /*targets*/) + bool OnUse(Player* player, Item* pItem, const SpellCastTargets & /*targets*/) { if (player->GetQuestStatus(QUEST_THE_EMISSARY) == QUEST_STATUS_INCOMPLETE) { @@ -376,9 +376,9 @@ public: pLeviroth->AI()->AttackStart(player); return false; } else - player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL); + player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL); } else - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); + player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); return true; } }; @@ -394,17 +394,17 @@ class item_captured_frog : public ItemScript public: item_captured_frog() : ItemScript("item_captured_frog") { } - bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/) + bool OnUse(Player* player, Item* pItem, SpellCastTargets const& /*targets*/) { if (player->GetQuestStatus(QUEST_THE_PERFECT_SPIES) == QUEST_STATUS_INCOMPLETE) { if (player->FindNearestCreature(NPC_VANIRAS_SENTRY_TOTEM, 10.0f)) return false; else - player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL); + player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL); } else - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); + player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); return true; } }; diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index 48be9bdba33..a1920e06ad1 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -241,14 +241,14 @@ bool EquippedOk(Player* player, uint32 spellId) if (!reqSpell) continue; - Item* item; + Item* pItem; for (uint8 j = EQUIPMENT_SLOT_START; j < EQUIPMENT_SLOT_END; ++j) { - item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, j); - if (item && item->GetTemplate()->RequiredSpell == reqSpell) + pItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, j); + if (pItem && pItem->GetTemplate()->RequiredSpell == reqSpell) { //player has item equipped that require specialty. Not allow to unlearn, player has to unequip first - sLog->outDebug(LOG_FILTER_TSCR, "TSCR: player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, item->GetEntry()); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, pItem->GetEntry()); return false; } } From 419e6a4a9eb614859552aa33c01bd7286fc9fa93 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 14 Mar 2012 20:51:54 +0100 Subject: [PATCH 0170/1149] Scripts/Magister's Terrace: Fix Translocation Orb Activation and correct some codestyle --- .../boss_felblood_kaelthas.cpp | 10 +- .../instance_magisters_terrace.cpp | 132 +++++++++++++----- .../MagistersTerrace/magisters_terrace.h | 46 +++--- 3 files changed, 129 insertions(+), 59 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index 31f6d1cb2af..a2c32e2c3eb 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -154,14 +154,18 @@ public: if (!instance) return; - instance->HandleGameObject(instance->GetData64(DATA_KAEL_DOOR), true); // Open the encounter door + instance->HandleGameObject(instance->GetData64(DATA_KAEL_DOOR), true); + + // Enable the Translocation Orb Exit + if (GameObject* escapeOrb = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_ESCAPE_ORB))) + escapeOrb->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); } void DamageTaken(Unit* /*done_by*/, uint32 &damage) { if (damage > me->GetHealth()) - RemoveGravityLapse(); // Remove Gravity Lapse so that players fall to ground if they kill him when in air. + RemoveGravityLapse(); // Remove Gravity Lapse so that players fall to ground if they kill him when in air. } void EnterCombat(Unit* /*who*/) @@ -169,8 +173,8 @@ public: if (!instance) return; + //Close the encounter door, open it in JustDied/Reset instance->HandleGameObject(instance->GetData64(DATA_KAEL_DOOR), false); - //Close the encounter door, open it in JustDied/Reset } void MoveInLineOfSight(Unit* who) diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp index 642f7955b2e..aa43cb3702f 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp @@ -35,6 +35,25 @@ EndScriptData */ 3 - Kael'thas Sunstrider */ +enum Creatures +{ + NPC_SELIN = 24723, + NPC_DELRISSA = 24560, + NPC_FELCRYSTALS = 24722 +}; + +enum GameObjects +{ + GO_VEXALLUS_DOOR = 187896, + GO_SELIN_DOOR = 187979, + GO_SELIN_ENCOUNTER_DOOR = 188065, + GO_DELRISSA_DOOR = 187770, + GO_KAEL_DOOR = 188064, + GO_KAEL_STATUE_1 = 188165, + GO_KAEL_STATUE_2 = 188166, + GO_ESCAPE_ORB = 188173 +}; + class instance_magisters_terrace : public InstanceMapScript { public: @@ -49,7 +68,7 @@ public: { instance_magisters_terrace_InstanceMapScript(Map* map) : InstanceScript(map) {} - uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint32 Encounter[MAX_ENCOUNTER]; uint32 DelrissaDeathCount; std::list FelCrystals; @@ -63,12 +82,13 @@ public: uint64 DelrissaDoorGUID; uint64 KaelDoorGUID; uint64 KaelStatue[2]; + uint64 EscapeOrbGUID; bool InitializedItr; void Initialize() { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + memset(&Encounter, 0, sizeof(Encounter)); FelCrystals.clear(); @@ -83,6 +103,7 @@ public: KaelDoorGUID = 0; KaelStatue[0] = 0; KaelStatue[1] = 0; + EscapeOrbGUID = 0; InitializedItr = false; } @@ -90,7 +111,7 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) + if (Encounter[i] == IN_PROGRESS) return true; return false; } @@ -99,12 +120,18 @@ public: { switch (identifier) { - case DATA_SELIN_EVENT: return m_auiEncounter[0]; - case DATA_VEXALLUS_EVENT: return m_auiEncounter[1]; - case DATA_DELRISSA_EVENT: return m_auiEncounter[2]; - case DATA_KAELTHAS_EVENT: return m_auiEncounter[3]; - case DATA_DELRISSA_DEATH_COUNT: return DelrissaDeathCount; - case DATA_FEL_CRYSTAL_SIZE: return FelCrystals.size(); + case DATA_SELIN_EVENT: + return Encounter[0]; + case DATA_VEXALLUS_EVENT: + return Encounter[1]; + case DATA_DELRISSA_EVENT: + return Encounter[2]; + case DATA_KAELTHAS_EVENT: + return Encounter[3]; + case DATA_DELRISSA_DEATH_COUNT: + return DelrissaDeathCount; + case DATA_FEL_CRYSTAL_SIZE: + return FelCrystals.size(); } return 0; } @@ -113,21 +140,24 @@ public: { switch (identifier) { - case DATA_SELIN_EVENT: m_auiEncounter[0] = data; break; + case DATA_SELIN_EVENT: + Encounter[0] = data; + break; case DATA_VEXALLUS_EVENT: if (data == DONE) DoUseDoorOrButton(VexallusDoorGUID); - m_auiEncounter[1] = data; + Encounter[1] = data; break; case DATA_DELRISSA_EVENT: if (data == DONE) DoUseDoorOrButton(DelrissaDoorGUID); if (data == IN_PROGRESS) DelrissaDeathCount = 0; - m_auiEncounter[2] = data; + Encounter[2] = data; + break; + case DATA_KAELTHAS_EVENT: + Encounter[3] = data; break; - case DATA_KAELTHAS_EVENT: m_auiEncounter[3] = data; break; - case DATA_DELRISSA_DEATH_COUNT: if (data == SPECIAL) ++DelrissaDeathCount; @@ -141,9 +171,15 @@ public: { switch (creature->GetEntry()) { - case 24723: SelinGUID = creature->GetGUID(); break; - case 24560: DelrissaGUID = creature->GetGUID(); break; - case 24722: FelCrystals.push_back(creature->GetGUID()); break; + case NPC_SELIN: + SelinGUID = creature->GetGUID(); + break; + case NPC_DELRISSA: + DelrissaGUID = creature->GetGUID(); + break; + case NPC_FELCRYSTALS: + FelCrystals.push_back(creature->GetGUID()); + break; } } @@ -151,15 +187,30 @@ public: { switch (go->GetEntry()) { - case 187896: VexallusDoorGUID = go->GetGUID(); break; - //SunwellRaid Gate 02 - case 187979: SelinDoorGUID = go->GetGUID(); break; - //Assembly Chamber Door - case 188065: SelinEncounterDoorGUID = go->GetGUID(); break; - case 187770: DelrissaDoorGUID = go->GetGUID(); break; - case 188064: KaelDoorGUID = go->GetGUID(); break; - case 188165: KaelStatue[0] = go->GetGUID(); break; - case 188166: KaelStatue[1] = go->GetGUID(); break; + case GO_VEXALLUS_DOOR: + VexallusDoorGUID = go->GetGUID(); + break; + case GO_SELIN_DOOR: + SelinDoorGUID = go->GetGUID(); + break; + case GO_SELIN_ENCOUNTER_DOOR: + SelinEncounterDoorGUID = go->GetGUID(); + break; + case GO_DELRISSA_DOOR: + DelrissaDoorGUID = go->GetGUID(); + break; + case GO_KAEL_DOOR: + KaelDoorGUID = go->GetGUID(); + break; + case GO_KAEL_STATUE_1: + KaelStatue[0] = go->GetGUID(); + break; + case GO_KAEL_STATUE_2: + KaelStatue[1] = go->GetGUID(); + break; + case GO_ESCAPE_ORB: + EscapeOrbGUID = go->GetGUID(); + break; } } @@ -167,15 +218,26 @@ public: { switch (identifier) { - case DATA_SELIN: return SelinGUID; - case DATA_DELRISSA: return DelrissaGUID; - case DATA_VEXALLUS_DOOR: return VexallusDoorGUID; - case DATA_SELIN_DOOR: return SelinDoorGUID; - case DATA_SELIN_ENCOUNTER_DOOR: return SelinEncounterDoorGUID; - case DATA_DELRISSA_DOOR: return DelrissaDoorGUID; - case DATA_KAEL_DOOR: return KaelDoorGUID; - case DATA_KAEL_STATUE_LEFT: return KaelStatue[0]; - case DATA_KAEL_STATUE_RIGHT: return KaelStatue[1]; + case DATA_SELIN: + return SelinGUID; + case DATA_DELRISSA: + return DelrissaGUID; + case DATA_VEXALLUS_DOOR: + return VexallusDoorGUID; + case DATA_SELIN_DOOR: + return SelinDoorGUID; + case DATA_SELIN_ENCOUNTER_DOOR: + return SelinEncounterDoorGUID; + case DATA_DELRISSA_DOOR: + return DelrissaDoorGUID; + case DATA_KAEL_DOOR: + return KaelDoorGUID; + case DATA_KAEL_STATUE_LEFT: + return KaelStatue[0]; + case DATA_KAEL_STATUE_RIGHT: + return KaelStatue[1]; + case DATA_ESCAPE_ORB: + return EscapeOrbGUID; case DATA_FEL_CRYSTAL: { diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h index dcea4424bf5..78aa14b9102 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h @@ -19,27 +19,31 @@ #ifndef DEF_MAGISTERS_TERRACE_H #define DEF_MAGISTERS_TERRACE_H -#define DATA_SELIN_EVENT 1 -#define DATA_VEXALLUS_EVENT 2 -#define DATA_DELRISSA_EVENT 3 -#define DATA_KAELTHAS_EVENT 4 - -#define DATA_SELIN 5 -#define DATA_FEL_CRYSTAL 6 -#define DATA_FEL_CRYSTAL_SIZE 7 - -#define DATA_VEXALLUS_DOOR 8 -#define DATA_SELIN_DOOR 9 -#define DATA_DELRISSA 10 -#define DATA_DELRISSA_DOOR 11 -#define DATA_SELIN_ENCOUNTER_DOOR 12 - -#define DATA_KAEL_DOOR 13 -#define DATA_KAEL_STATUE_LEFT 14 -#define DATA_KAEL_STATUE_RIGHT 15 - -#define DATA_DELRISSA_DEATH_COUNT 16 - #define ERROR_INST_DATA "TSCR Error: Instance Data not set properly for Magister's Terrace instance (map 585). Encounters will be buggy." #endif +enum Data +{ + DATA_SELIN_EVENT = 0, + DATA_VEXALLUS_EVENT = 1, + DATA_DELRISSA_EVENT = 2, + DATA_KAELTHAS_EVENT = 3, + + DATA_SELIN = 4, + DATA_FEL_CRYSTAL = 5, + DATA_FEL_CRYSTAL_SIZE = 6, + + DATA_VEXALLUS_DOOR = 7, + DATA_SELIN_DOOR = 8, + DATA_DELRISSA = 9, + DATA_DELRISSA_DOOR = 10, + DATA_SELIN_ENCOUNTER_DOOR = 11, + + DATA_KAEL_DOOR = 12, + DATA_KAEL_STATUE_LEFT = 13, + DATA_KAEL_STATUE_RIGHT = 14, + + DATA_DELRISSA_DEATH_COUNT = 15, + + DATA_ESCAPE_ORB = 16 +}; From afaed98b7adcd1cbd72224439afaf08e7ba56efa Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Thu, 15 Mar 2012 10:03:25 +0100 Subject: [PATCH 0171/1149] Core/Movement: Send correct packet to client when unapplying hover, feather fall and water walking auras. Closes #5704 --- .../game/Spells/Auras/SpellAuraEffects.cpp | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 387f76bbc7f..ddef7fdd749 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2876,15 +2876,12 @@ void AuraEffect::HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, } if (apply) - { target->AddUnitMovementFlag(MOVEMENTFLAG_WATERWALKING); - target->SendMovementWaterWalking(); - } - else - { + else target->RemoveUnitMovementFlag(MOVEMENTFLAG_WATERWALKING); - target->SendMovementFlagUpdate(); - } + + target->SendMovementWaterWalking(); + } void AuraEffect::HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -2902,15 +2899,11 @@ void AuraEffect::HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode } if (apply) - { target->AddUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW); - target->SendMovementFeatherFall(); - } else - { target->RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW); - target->SendMovementFlagUpdate(); - } + + target->SendMovementFeatherFall(); // start fall from current height if (!apply && target->GetTypeId() == TYPEID_PLAYER) @@ -2932,10 +2925,7 @@ void AuraEffect::HandleAuraHover(AuraApplication const* aurApp, uint8 mode, bool } target->SetHover(apply); //! Sets movementflags - if (apply) - target->SendMovementHover(); - else - target->SendMovementFlagUpdate(); + target->SendMovementHover(); } void AuraEffect::HandleWaterBreathing(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const From e17a9cfb85602617f1c0b94d27ad0c5c8ce77a54 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Thu, 15 Mar 2012 10:12:43 +0100 Subject: [PATCH 0172/1149] Core/Movement: Add server side filters for MOVEMENTFLAG_WATERWALKING, _FALLING_SLOW and _HOVER depending on required aura types. Fixes exploiting when aura unapply packets (such as corrected in previous commit) are blocked/altered before reaching the client. --- src/server/game/Server/WorldSession.cpp | 31 ++++++++++++++++++------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index c88c5c6e087..84907937de5 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -807,35 +807,48 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) if (mi->HasMovementFlag(MOVEMENTFLAG_SPLINE_ELEVATION)) data >> mi->splineElevation; - // This must be a packet spoofing attempt. MOVEMENTFLAG_ROOT sent from the client is not valid, - // and when used in conjunction with any of the moving movement flags such as MOVEMENTFLAG_FORWARD - // it will freeze clients that receive this player's movement info. + /*! This must be a packet spoofing attempt. MOVEMENTFLAG_ROOT sent from the client is not valid, + and when used in conjunction with any of the moving movement flags such as MOVEMENTFLAG_FORWARD + it will freeze clients that receive this player's movement info. + */ if (mi->HasMovementFlag(MOVEMENTFLAG_ROOT)) mi->flags &= ~MOVEMENTFLAG_ROOT; - // Cannot hover and jump at the same time + //! Cannot hover and jump at the same time if (mi->HasMovementFlag(MOVEMENTFLAG_HOVER) && mi->HasMovementFlag(MOVEMENTFLAG_JUMPING)) mi->flags &= ~MOVEMENTFLAG_JUMPING; - // Cannot ascend and descend at the same time + //! Cannot ascend and descend at the same time if (mi->HasMovementFlag(MOVEMENTFLAG_ASCENDING) && mi->HasMovementFlag(MOVEMENTFLAG_DESCENDING)) mi->flags &= ~(MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING); - // Cannot move left and right at the same time + //! Cannot move left and right at the same time if (mi->HasMovementFlag(MOVEMENTFLAG_LEFT) && mi->HasMovementFlag(MOVEMENTFLAG_RIGHT)) mi->flags &= ~(MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT); - // Cannot strafe left and right at the same time + //! Cannot strafe left and right at the same time if (mi->HasMovementFlag(MOVEMENTFLAG_STRAFE_LEFT) && mi->HasMovementFlag(MOVEMENTFLAG_STRAFE_RIGHT)) mi->flags &= ~(MOVEMENTFLAG_STRAFE_LEFT | MOVEMENTFLAG_STRAFE_RIGHT); - // Cannot pitch up and down at the same time + //! Cannot pitch up and down at the same time if (mi->HasMovementFlag(MOVEMENTFLAG_PITCH_UP) && mi->HasMovementFlag(MOVEMENTFLAG_PITCH_DOWN)) mi->flags &= ~(MOVEMENTFLAG_PITCH_UP | MOVEMENTFLAG_PITCH_DOWN); - // Cannot move forwards and backwards at the same time + //! Cannot move forwards and backwards at the same time if (mi->HasMovementFlag(MOVEMENTFLAG_FORWARD) && mi->HasMovementFlag(MOVEMENTFLAG_BACKWARD)) mi->flags &= ~(MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_BACKWARD); + + //! Cannot walk on water without SPELL_AURA_WATER_WALK + if (mi->HasMovementFlag(MOVEMENTFLAG_WATERWALKING) && !GetPlayer()->HasAuraType(SPELL_AURA_WATER_WALK)) + mi->flags &= ~MOVEMENTFLAG_WATERWALKING; + + //! Cannot feather fall without SPELL_AURA_FEATHER_FALL + if (mi->HasMovementFlag(MOVEMENTFLAG_FALLING_SLOW) && !GetPlayer()->HasAuraType(SPELL_AURA_FEATHER_FALL)) + mi->flags &= ~MOVEMENTFLAG_FALLING_SLOW; + + //! Cannot hover without SPELL_AURA_HOVER + if (mi->HasMovementFlag(MOVEMENTFLAG_HOVER) && !GetPlayer()->HasAuraType(SPELL_AURA_HOVER)) + mi->flags &= ~MOVEMENTFLAG_HOVER; } void WorldSession::WriteMovementInfo(WorldPacket* data, MovementInfo* mi) From 7d60290c2e7bf7a04a7ebe862387aaa4389985cd Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Thu, 15 Mar 2012 10:16:08 +0100 Subject: [PATCH 0173/1149] Core/Units: Offset z coordinate only if MOVEMENTFLAG_HOVER is present, not MOVEMENTFLAG_DISABLE_GRAVITY. (Remnant from an early incorrect version of my UNIT_FIELD_HOVERHEIGHT patch) --- src/server/game/Entities/Creature/Creature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 1fb972ccfdf..94dfa938cb8 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -763,7 +763,7 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, return false; //! Need to be called after CreateFromProto - if (HasUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY)) + if (HasUnitMovementFlag(MOVEMENTFLAG_HOVER)) z += GetFloatValue(UNIT_FIELD_HOVERHEIGHT); Relocate(x, y, z, ang); From 4a96ae22a98b1e4b9865c53e9194fe9e133226a1 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 15 Mar 2012 13:10:42 +0100 Subject: [PATCH 0174/1149] Scripts/Icecrown Citadel: Corrected flying animations for frostwyrms in Sindragosa's Lair and prevent reentering combat with Deathbringer Saurfang after encounter is won --- .../world/2012_03_14_00_world_creature_addon.sql | 2 ++ .../IcecrownCitadel/boss_deathbringer_saurfang.cpp | 9 ++++++++- .../Northrend/IcecrownCitadel/boss_sindragosa.cpp | 10 +++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 sql/updates/world/2012_03_14_00_world_creature_addon.sql diff --git a/sql/updates/world/2012_03_14_00_world_creature_addon.sql b/sql/updates/world/2012_03_14_00_world_creature_addon.sql new file mode 100644 index 00000000000..c7e4edb97ed --- /dev/null +++ b/sql/updates/world/2012_03_14_00_world_creature_addon.sql @@ -0,0 +1,2 @@ +UPDATE `creature_addon` SET `bytes1`=0x3000000 WHERE `guid`=207210; +UPDATE `creature_addon` SET `bytes1`=0x3000000 WHERE `guid`=207211; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index b794970d24e..3ce62d939d3 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -269,6 +269,9 @@ class boss_deathbringer_saurfang : public CreatureScript void EnterCombat(Unit* who) { + if (_dead) + return; + if (!instance->CheckRequiredBosses(DATA_DEATHBRINGER_SAURFANG, who->ToPlayer())) { EnterEvadeMode(); @@ -336,8 +339,11 @@ class boss_deathbringer_saurfang : public CreatureScript Talk(SAY_KILL); } - void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/) + void DamageTaken(Unit* /*attacker*/, uint32& damage) { + if (damage >= me->GetHealth()) + damage = me->GetHealth() - 1; + if (!_frenzied && HealthBelowPct(31)) // AT 30%, not below { _frenzied = true; @@ -350,6 +356,7 @@ class boss_deathbringer_saurfang : public CreatureScript _dead = true; _JustDied(); _EnterEvadeMode(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); DoCastAOE(SPELL_REMOVE_MARKS_OF_THE_FALLEN_CHAMPION); DoCast(me, SPELL_ACHIEVEMENT, true); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 649efc59681..c88b3aa8b37 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -250,6 +250,9 @@ class boss_sindragosa : public CreatureScript return; me->setActive(true); + me->SetCanFly(true); + me->SetDisableGravity(true); + me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->SetSpeed(MOVE_FLIGHT, 4.0f); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); float moveTime = me->GetExactDist(&SindragosaFlyPos) / (me->GetSpeed(MOVE_FLIGHT) * 0.001f); @@ -277,9 +280,10 @@ class boss_sindragosa : public CreatureScript me->setActive(false); me->SetCanFly(false); me->SetDisableGravity(false); + me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->SetHomePosition(SindragosaLandPos); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetSpeed(MOVE_FLIGHT, 2.0f); + me->SetSpeed(MOVE_FLIGHT, 2.5f); // Sindragosa enters combat as soon as she lands DoZoneInCombat(); @@ -294,6 +298,7 @@ class boss_sindragosa : public CreatureScript case POINT_LAND: me->SetCanFly(false); me->SetDisableGravity(false); + me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->SetReactState(REACT_DEFENSIVE); if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); @@ -427,6 +432,7 @@ class boss_sindragosa : public CreatureScript Talk(SAY_AIR_PHASE); me->SetCanFly(true); me->SetDisableGravity(true); + me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->SetReactState(REACT_PASSIVE); Position pos; pos.Relocate(me); @@ -662,6 +668,7 @@ class npc_spinestalker : public CreatureScript me->setActive(false); me->SetCanFly(false); me->SetDisableGravity(false); + me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->SetHomePosition(SpinestalkerLandPos); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -787,6 +794,7 @@ class npc_rimefang : public CreatureScript me->setActive(false); me->SetCanFly(false); me->SetDisableGravity(false); + me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->SetHomePosition(RimefangLandPos); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } From 313802a4ede4659cfa5b433bcfd4d30de504be80 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 15 Mar 2012 13:14:42 +0100 Subject: [PATCH 0175/1149] Core/Movement: Added more movement flags that cause units to select flight speed instead of run --- src/server/game/Movement/Spline/MoveSplineInit.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index f5d2ae59329..fe1db906a26 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -25,9 +25,13 @@ namespace Movement { UnitMoveType SelectSpeedType(uint32 moveFlags) { - if (moveFlags & MOVEMENTFLAG_FLYING) + /*! Not sure about MOVEMENTFLAG_CAN_FLY here - do creatures that can fly + but are on ground right now also have it? If yes, this needs a more + dynamic check, such as is flying now + */ + if (moveFlags & (MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_DISABLE_GRAVITY)) { - if ( moveFlags & MOVEMENTFLAG_BACKWARD /*&& speed_obj.flight >= speed_obj.flight_back*/ ) + if (moveFlags & MOVEMENTFLAG_BACKWARD /*&& speed_obj.flight >= speed_obj.flight_back*/) return MOVE_FLIGHT_BACK; else return MOVE_FLIGHT; @@ -41,7 +45,7 @@ namespace Movement } else if (moveFlags & MOVEMENTFLAG_WALKING) { - //if ( speed_obj.run > speed_obj.walk ) + //if (speed_obj.run > speed_obj.walk) return MOVE_WALK; } else if (moveFlags & MOVEMENTFLAG_BACKWARD /*&& speed_obj.run >= speed_obj.run_back*/) From 84891377b5f11c93ba75a925703a654c3778b162 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 15 Mar 2012 13:15:25 +0100 Subject: [PATCH 0176/1149] Core/Spells: Fixed copy paste mistake that caused all area spells to search targets starting from caster's coordinates instead of targeted destination --- src/server/game/Spells/Spell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index ae5b14989af..38e66a218f8 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1891,7 +1891,7 @@ void Spell::SearchAreaTargets(std::list& targets, float range, Pos return; Trinity::WorldObjectSpellAreaTargetCheck check(range, position, m_caster, referer, m_spellInfo, selectionType, condList); Trinity::WorldObjectListSearcher searcher(m_caster, targets, check, containerTypeMask); - SearchTargets > (searcher, containerTypeMask, m_caster, m_caster, range); + SearchTargets > (searcher, containerTypeMask, m_caster, position, range); } void Spell::SearchChainTargets(std::list& targets, uint32 chainTargets, WorldObject* target, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectType, ConditionList* condList, bool isChainHeal) From 01bc6c483bc0756850ee8853f98bd8de4a2316bc Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 13 Mar 2012 13:03:41 -0400 Subject: [PATCH 0177/1149] Core/Spells: add correct checking for dispeling errors. Fixes spammable cleanse. --- src/server/game/Entities/Unit/Unit.cpp | 39 +++++++++++++++++++++++ src/server/game/Entities/Unit/Unit.h | 3 ++ src/server/game/Spells/Spell.cpp | 18 +++++++++++ src/server/game/Spells/SpellEffects.cpp | 41 ++----------------------- 4 files changed, 62 insertions(+), 39 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index e89d289ba4e..01f4a610f6c 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -4113,6 +4113,45 @@ Aura* Unit::GetAuraOfRankedSpell(uint32 spellId, uint64 casterGUID, uint64 itemC return aurApp ? aurApp->GetBase() : NULL; } +void Unit::GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelChargesList& dispelList) +{ + // we should not be able to dispel diseases if the target is affected by unholy blight + if (dispelMask & (1 << DISPEL_DISEASE) && HasAura(50536)) + dispelMask &= ~(1 << DISPEL_DISEASE); + + AuraMap const& auras = GetOwnedAuras(); + for (AuraMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) + { + Aura* aura = itr->second; + AuraApplication * aurApp = aura->GetApplicationOfTarget(GetGUID()); + if (!aurApp) + continue; + + // don't try to remove passive auras + if (aura->IsPassive()) + continue; + + if (aura->GetSpellInfo()->GetDispelMask() & dispelMask) + { + if (aura->GetSpellInfo()->Dispel == DISPEL_MAGIC) + { + // do not remove positive auras if friendly target + // negative auras if non-friendly target + if (aurApp->IsPositive() == IsFriendlyTo(caster)) + continue; + } + + // The charges / stack amounts don't count towards the total number of auras that can be dispelled. + // Ie: A dispel on a target with 5 stacks of Winters Chill and a Polymorph has 1 / (1 + 1) -> 50% chance to dispell + // Polymorph instead of 1 / (5 + 1) -> 16%. + bool dispel_charges = aura->GetSpellInfo()->AttributesEx7 & SPELL_ATTR7_DISPEL_CHARGES; + uint8 charges = dispel_charges ? aura->GetCharges() : aura->GetStackAmount(); + if (charges > 0) + dispelList.push_back(std::make_pair(aura, charges)); + } + } +} + bool Unit::HasAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster) const { for (AuraApplicationMap::const_iterator itr = m_appliedAuras.lower_bound(spellId); itr != m_appliedAuras.upper_bound(spellId); ++itr) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 88eb0068f45..5192b8c5e8f 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -341,6 +341,7 @@ class Transport; class Vehicle; typedef std::list UnitList; +typedef std::list< std::pair > DispelChargesList; struct SpellImmune { @@ -1814,6 +1815,8 @@ class Unit : public WorldObject AuraApplication * GetAuraApplicationOfRankedSpell(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, AuraApplication * except = NULL) const; Aura* GetAuraOfRankedSpell(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0) const; + void GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelChargesList& dispelList); + bool HasAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster = 0) const; uint32 GetAuraCount(uint32 spellId) const; bool HasAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0) const; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 38e66a218f8..6587ce71b61 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4938,6 +4938,24 @@ SpellCastResult Spell::CheckCast(bool strict) if (castResult != SPELL_CAST_OK) return castResult; + bool hasDispellableAura = false; + for (int i = 0; i < MAX_SPELL_EFFECTS; i++) + if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_DISPEL) + if (Unit* target = m_targets.GetUnitTarget()) + { + DispelChargesList dispelList; + uint32 dispelMask = SpellInfo::GetDispelMask(DispelType(m_spellInfo->Effects[i].MiscValue)); + target->GetDispellableAuraList(m_caster, dispelMask, dispelList); + if (!dispelList.empty()) + { + hasDispellableAura = true; + break; + } + } + + if (!hasDispellableAura) + return SPELL_FAILED_NOTHING_TO_DISPEL; + for (int i = 0; i < MAX_SPELL_EFFECTS; i++) { // for effects of spells that have only one target diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 59b6d8971cf..01782ba4312 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2536,7 +2536,6 @@ void Spell::EffectLearnSpell(SpellEffIndex effIndex) } typedef std::list< std::pair > DispelList; -typedef std::list< std::pair > DispelChargesList; void Spell::EffectDispel(SpellEffIndex effIndex) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) @@ -2545,48 +2544,12 @@ void Spell::EffectDispel(SpellEffIndex effIndex) if (!unitTarget) return; - DispelChargesList dispel_list; - // Create dispel mask by dispel type uint32 dispel_type = m_spellInfo->Effects[effIndex].MiscValue; uint32 dispelMask = SpellInfo::GetDispelMask(DispelType(dispel_type)); - // we should not be able to dispel diseases if the target is affected by unholy blight - if (dispelMask & (1 << DISPEL_DISEASE) && unitTarget->HasAura(50536)) - dispelMask &= ~(1 << DISPEL_DISEASE); - - Unit::AuraMap const& auras = unitTarget->GetOwnedAuras(); - for (Unit::AuraMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) - { - Aura* aura = itr->second; - AuraApplication * aurApp = aura->GetApplicationOfTarget(unitTarget->GetGUID()); - if (!aurApp) - continue; - - // don't try to remove passive auras - if (aura->IsPassive()) - continue; - - if (aura->GetSpellInfo()->GetDispelMask() & dispelMask) - { - if (aura->GetSpellInfo()->Dispel == DISPEL_MAGIC) - { - // do not remove positive auras if friendly target - // negative auras if non-friendly target - if (aurApp->IsPositive() == unitTarget->IsFriendlyTo(m_caster)) - continue; - } - - // The charges / stack amounts don't count towards the total number of auras that can be dispelled. - // Ie: A dispel on a target with 5 stacks of Winters Chill and a Polymorph has 1 / (1 + 1) -> 50% chance to dispell - // Polymorph instead of 1 / (5 + 1) -> 16%. - bool dispel_charges = aura->GetSpellInfo()->AttributesEx7 & SPELL_ATTR7_DISPEL_CHARGES; - uint8 charges = dispel_charges ? aura->GetCharges() : aura->GetStackAmount(); - if (charges > 0) - dispel_list.push_back(std::make_pair(aura, charges)); - } - } - + DispelChargesList dispel_list; + unitTarget->GetDispellableAuraList(m_caster, dispelMask, dispel_list); if (dispel_list.empty()) return; From 5e25791bffd89f82bad0e29d5a33817096f0f457 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 15 Mar 2012 11:08:45 -0400 Subject: [PATCH 0178/1149] whitespace cleanup --- src/server/game/Spells/Spell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 6587ce71b61..b18dce77b18 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4951,7 +4951,7 @@ SpellCastResult Spell::CheckCast(bool strict) hasDispellableAura = true; break; } - } + } if (!hasDispellableAura) return SPELL_FAILED_NOTHING_TO_DISPEL; From fe46cf97961a82c43c9f287deecf40049b1fed19 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 15 Mar 2012 12:41:16 -0400 Subject: [PATCH 0179/1149] Core/Spells: Fix being unable to use spells due hasDispellableAura being false if no spell effects were SPELL_EFFECT_DISPEL --- src/server/game/Spells/Spell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index b18dce77b18..b1b23753832 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4953,7 +4953,7 @@ SpellCastResult Spell::CheckCast(bool strict) } } - if (!hasDispellableAura) + if (!hasDispellableAura && m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL)) return SPELL_FAILED_NOTHING_TO_DISPEL; for (int i = 0; i < MAX_SPELL_EFFECTS; i++) From 5406a0fd93d2577834047301a02aba39f0dc971c Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 15 Mar 2012 14:12:40 -0400 Subject: [PATCH 0180/1149] Core/Spells: Fix bugged mass dispel after previous commits --- src/server/game/Spells/Spell.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index b1b23753832..5ef40a06a7e 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4941,6 +4941,12 @@ SpellCastResult Spell::CheckCast(bool strict) bool hasDispellableAura = false; for (int i = 0; i < MAX_SPELL_EFFECTS; i++) if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_DISPEL) + { + if (m_spellInfo->Effects[i].TargetA.IsArea() || m_spellInfo->Effects[i].TargetB.IsArea()) + { + hasDispellableAura = true; + break; + } if (Unit* target = m_targets.GetUnitTarget()) { DispelChargesList dispelList; @@ -4952,6 +4958,7 @@ SpellCastResult Spell::CheckCast(bool strict) break; } } + } if (!hasDispellableAura && m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL)) return SPELL_FAILED_NOTHING_TO_DISPEL; From b23ff228a43e375712e3a2ed3fc6bcd5ff5fcb74 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 15 Mar 2012 14:14:42 -0400 Subject: [PATCH 0181/1149] Core/Spells: Used correct implementation for checking if a spell effect targets an area. --- src/server/game/Spells/Spell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 5ef40a06a7e..b15b9ff3297 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4942,7 +4942,7 @@ SpellCastResult Spell::CheckCast(bool strict) for (int i = 0; i < MAX_SPELL_EFFECTS; i++) if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_DISPEL) { - if (m_spellInfo->Effects[i].TargetA.IsArea() || m_spellInfo->Effects[i].TargetB.IsArea()) + if (m_spellInfo->Effects[i].IsTargetingArea()) { hasDispellableAura = true; break; From acb3fde35504305847f215b6d172589fd928581b Mon Sep 17 00:00:00 2001 From: kaelima Date: Fri, 16 Mar 2012 08:56:06 +0100 Subject: [PATCH 0182/1149] Core/DBC: added cloak mask to armorMod and did some cleanup in ScalingStatValuesEntry --- src/server/game/DataStores/DBCStructure.h | 55 ++++++++++++----------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 1e52866539a..d25578e304a 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1393,60 +1393,63 @@ struct ScalingStatValuesEntry uint32 ssdMultiplier[4]; // 2-5 Multiplier for ScalingStatDistribution uint32 armorMod[4]; // 6-9 Armor for level uint32 dpsMod[6]; // 10-15 DPS mod for level - uint32 spellBonus; // 16 spell power for level + uint32 spellPower; // 16 spell power for level uint32 ssdMultiplier2; // 17 there's data from 3.1 dbc ssdMultiplier[3] uint32 ssdMultiplier3; // 18 3.3 - //uint32 unk2; // 19 unk, probably also Armor for level (flag 0x80000?) - uint32 armorMod2[4]; // 20-23 Armor for level + uint32 armorMod2[5]; // 20-23 Armor for level - uint32 getssdMultiplier(uint32 mask) const + uint32 getssdMultiplier(uint32 mask) const { if (mask & 0x4001F) { - if (mask & 0x00000001) return ssdMultiplier[0]; - if (mask & 0x00000002) return ssdMultiplier[1]; - if (mask & 0x00000004) return ssdMultiplier[2]; + if (mask & 0x00000001) return ssdMultiplier[0]; // Shoulder + if (mask & 0x00000002) return ssdMultiplier[1]; // Trinket + if (mask & 0x00000004) return ssdMultiplier[2]; // Weapon1H if (mask & 0x00000008) return ssdMultiplier2; - if (mask & 0x00000010) return ssdMultiplier[3]; + if (mask & 0x00000010) return ssdMultiplier[3]; // Ranged if (mask & 0x00040000) return ssdMultiplier3; } return 0; } - uint32 getArmorMod(uint32 mask) const + uint32 getArmorMod(uint32 mask) const { if (mask & 0x00F001E0) { - if (mask & 0x00000020) return armorMod[0]; - if (mask & 0x00000040) return armorMod[1]; - if (mask & 0x00000080) return armorMod[2]; - if (mask & 0x00000100) return armorMod[3]; + if (mask & 0x00000020) return armorMod[0]; // Cloth shoulder + if (mask & 0x00000040) return armorMod[1]; // Leather shoulder + if (mask & 0x00000080) return armorMod[2]; // Mail shoulder + if (mask & 0x00000100) return armorMod[3]; // Plate shoulder - if (mask & 0x00100000) return armorMod2[0]; // cloth - if (mask & 0x00200000) return armorMod2[1]; // leather - if (mask & 0x00400000) return armorMod2[2]; // mail - if (mask & 0x00800000) return armorMod2[3]; // plate + if (mask & 0x00080000) return armorMod2[0]; // cloak + if (mask & 0x00100000) return armorMod2[1]; // cloth + if (mask & 0x00200000) return armorMod2[2]; // leather + if (mask & 0x00400000) return armorMod2[3]; // mail + if (mask & 0x00800000) return armorMod2[4]; // plate } return 0; } + uint32 getDPSMod(uint32 mask) const { - if (mask&0x7E00) + if (mask & 0x7E00) { - if (mask & 0x00000200) return dpsMod[0]; - if (mask & 0x00000400) return dpsMod[1]; - if (mask & 0x00000800) return dpsMod[2]; - if (mask & 0x00001000) return dpsMod[3]; - if (mask & 0x00002000) return dpsMod[4]; - if (mask & 0x00004000) return dpsMod[5]; // not used? + if (mask & 0x00000200) return dpsMod[0]; // Weapon 1h + if (mask & 0x00000400) return dpsMod[1]; // Weapon 2h + if (mask & 0x00000800) return dpsMod[2]; // Caster dps 1h + if (mask & 0x00001000) return dpsMod[3]; // Caster dps 2h + if (mask & 0x00002000) return dpsMod[4]; // Ranged + if (mask & 0x00004000) return dpsMod[5]; // Wand } return 0; } + uint32 getSpellBonus(uint32 mask) const { - if (mask & 0x00008000) return spellBonus; + if (mask & 0x00008000) return spellPower; return 0; } + uint32 getFeralBonus(uint32 mask) const // removed in 3.2.x? { if (mask & 0x00010000) return 0; // not used? @@ -1982,7 +1985,7 @@ struct WorldMapAreaEntry float x2; // 7 int32 virtual_map_id; // 8 -1 (map_id have correct map) other: virtual map where zone show (map_id - where zone in fact internally) // int32 dungeonMap_id; // 9 pointer to DungeonMap.dbc (owerride x1, x2, y1, y2 coordinates) - // uint32 someMapID; // 10 + // uint32 parentMapID; // 10 }; #define MAX_WORLD_MAP_OVERLAY_AREA_IDX 4 From dce0a7d18423ecb36ebc0d8c3426dbec26fa9fff Mon Sep 17 00:00:00 2001 From: kaelima Date: Fri, 16 Mar 2012 08:57:42 +0100 Subject: [PATCH 0183/1149] Core/Misc: Random cleanup --- src/server/game/Entities/Unit/Unit.cpp | 16 +++---- src/server/game/Entities/Unit/Unit.h | 3 +- src/server/game/Entities/Vehicle/Vehicle.cpp | 2 +- .../IdleMovementGenerator.cpp | 19 ++++----- .../Movement/Spline/MovementPacketBuilder.cpp | 42 +++++++++++-------- 5 files changed, 39 insertions(+), 43 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 01f4a610f6c..b60abc18753 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -14591,9 +14591,9 @@ Player* Unit::GetSpellModOwner() const } ///----------Pet responses methods----------------- -void Unit::SendPetCastFail(uint32 spellid, SpellCastResult msg) +void Unit::SendPetCastFail(uint32 spellid, SpellCastResult result) { - if (msg == SPELL_CAST_OK) + if (result == SPELL_CAST_OK) return; Unit* owner = GetCharmerOrOwner(); @@ -14601,15 +14601,13 @@ void Unit::SendPetCastFail(uint32 spellid, SpellCastResult msg) return; WorldPacket data(SMSG_PET_CAST_FAILED, 1 + 4 + 1); - data << uint8(0); // cast count? + data << uint8(0); // cast count data << uint32(spellid); - data << uint8(msg); - // uint32 for some reason - // uint32 for some reason + data << uint8(result); owner->ToPlayer()->GetSession()->SendPacket(&data); } -void Unit::SendPetActionFeedback (uint8 msg) +void Unit::SendPetActionFeedback(uint8 msg) { Unit* owner = GetOwner(); if (!owner || owner->GetTypeId() != TYPEID_PLAYER) @@ -14620,7 +14618,7 @@ void Unit::SendPetActionFeedback (uint8 msg) owner->ToPlayer()->GetSession()->SendPacket(&data); } -void Unit::SendPetTalk (uint32 pettalk) +void Unit::SendPetTalk(uint32 pettalk) { Unit* owner = GetOwner(); if (!owner || owner->GetTypeId() != TYPEID_PLAYER) @@ -17045,8 +17043,6 @@ void Unit::_ExitVehicle(Position const* exitPosition) else pos = *exitPosition; - AddUnitState(UNIT_STATE_MOVE); - if (GetTypeId() == TYPEID_PLAYER) ToPlayer()->SetFallInformation(0, GetPositionZ()); else if (HasUnitMovementFlag(MOVEMENTFLAG_ROOT)) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 5192b8c5e8f..f09bf89a9c7 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -499,9 +499,8 @@ enum UnitState UNIT_STATE_CHASE_MOVE = 0x04000000, UNIT_STATE_FOLLOW_MOVE = 0x08000000, UNIT_STATE_UNATTACKABLE = (UNIT_STATE_IN_FLIGHT | UNIT_STATE_ONVEHICLE), - //UNIT_STATE_MOVING = (UNIT_STATE_ROAMING | UNIT_STATE_CHASE), // for real move using movegen check and stop (except unstoppable flight) - UNIT_STATE_MOVING = UNIT_STATE_ROAMING_MOVE | UNIT_STATE_CONFUSED_MOVE | UNIT_STATE_FLEEING_MOVE| UNIT_STATE_CHASE_MOVE | UNIT_STATE_FOLLOW_MOVE , + UNIT_STATE_MOVING = UNIT_STATE_ROAMING_MOVE | UNIT_STATE_CONFUSED_MOVE | UNIT_STATE_FLEEING_MOVE | UNIT_STATE_CHASE_MOVE | UNIT_STATE_FOLLOW_MOVE , UNIT_STATE_CONTROLLED = (UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING), UNIT_STATE_LOST_CONTROL = (UNIT_STATE_CONTROLLED | UNIT_STATE_JUMPING | UNIT_STATE_CHARGING), UNIT_STATE_SIGHTLESS = (UNIT_STATE_LOST_CONTROL | UNIT_STATE_EVADE), diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index 2f552eddb9f..f3d6e8abc79 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -424,7 +424,7 @@ void Vehicle::RemovePassenger(Unit* unit) _me->ToCreature()->AI()->PassengerBoarded(unit, seat->first, false); // only for flyable vehicles - if (unit->HasUnitMovementFlag(MOVEMENTFLAG_FLYING)) + if (unit->IsFlying()) _me->CastSpell(unit, VEHICLE_SPELL_PARACHUTE, true); if (GetBase()->GetTypeId() == TYPEID_UNIT) diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp index 9f4568df113..5a2090cfe28 100755 --- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp @@ -29,16 +29,15 @@ void IdleMovementGenerator::Initialize(Unit &owner) Reset(owner); } -void -IdleMovementGenerator::Reset(Unit& owner) +void IdleMovementGenerator::Reset(Unit& owner) { - if (owner.HasUnitState(UNIT_STATE_MOVE)) + if (!owner.IsStopped()) owner.StopMoving(); } void RotateMovementGenerator::Initialize(Unit& owner) { - if (owner.HasUnitState(UNIT_STATE_MOVE)) + if (!owner.IsStopped()) owner.StopMoving(); if (owner.getVictim()) @@ -80,20 +79,17 @@ void RotateMovementGenerator::Finalize(Unit &unit) unit.ToCreature()->AI()->MovementInform(ROTATE_MOTION_TYPE, 0); } -void -DistractMovementGenerator::Initialize(Unit& owner) +void DistractMovementGenerator::Initialize(Unit& owner) { owner.AddUnitState(UNIT_STATE_DISTRACTED); } -void -DistractMovementGenerator::Finalize(Unit& owner) +void DistractMovementGenerator::Finalize(Unit& owner) { owner.ClearUnitState(UNIT_STATE_DISTRACTED); } -bool -DistractMovementGenerator::Update(Unit& /*owner*/, const uint32& time_diff) +bool DistractMovementGenerator::Update(Unit& /*owner*/, const uint32& time_diff) { if (time_diff > m_timer) return false; @@ -102,8 +98,7 @@ DistractMovementGenerator::Update(Unit& /*owner*/, const uint32& time_diff) return true; } -void -AssistanceDistractMovementGenerator::Finalize(Unit &unit) +void AssistanceDistractMovementGenerator::Finalize(Unit &unit) { unit.ClearUnitState(UNIT_STATE_DISTRACTED); unit.ToCreature()->SetReactState(REACT_AGGRESSIVE); diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp index 73fdbf4c2f6..e9031f95486 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp @@ -44,11 +44,17 @@ namespace Movement void PacketBuilder::WriteCommonMonsterMovePart(const MoveSpline& move_spline, WorldPacket& data) { MoveSplineFlag splineflags = move_spline.splineflags; - /*if (mov.IsBoarded()) + /*if (unit->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) { data.SetOpcode(SMSG_MONSTER_MOVE_TRANSPORT); - data << mov.GetTransport()->Owner.GetPackGUID(); - data << int8(mov.m_unused.transport_seat); + if (unit->GetVehicle()) + data << unit->GetVehicle()->GetBase()->GetPackGUID(); + else if (unit->GetTransport()) + data << unit->GetTransport()->GetPackGUID(); + else + data << uint64(0); + + data << int8(unit->GetTransSeat()); }*/ data << uint8(0); @@ -57,21 +63,21 @@ namespace Movement switch(splineflags & MoveSplineFlag::Mask_Final_Facing) { - default: - data << uint8(MonsterMoveNormal); - break; - case MoveSplineFlag::Final_Target: - data << uint8(MonsterMoveFacingTarget); - data << move_spline.facing.target; - break; - case MoveSplineFlag::Final_Angle: - data << uint8(MonsterMoveFacingAngle); - data << move_spline.facing.angle; - break; - case MoveSplineFlag::Final_Point: - data << uint8(MonsterMoveFacingSpot); - data << move_spline.facing.f.x << move_spline.facing.f.y << move_spline.facing.f.z; - break; + case MoveSplineFlag::Final_Target: + data << uint8(MonsterMoveFacingTarget); + data << move_spline.facing.target; + break; + case MoveSplineFlag::Final_Angle: + data << uint8(MonsterMoveFacingAngle); + data << move_spline.facing.angle; + break; + case MoveSplineFlag::Final_Point: + data << uint8(MonsterMoveFacingSpot); + data << move_spline.facing.f.x << move_spline.facing.f.y << move_spline.facing.f.z; + break; + default: + data << uint8(MonsterMoveNormal); + break; } // add fake Enter_Cycle flag - needed for client-side cyclic movement (client will erase first spline vertex after first cycle done) From ef53bde176e213017c2346d9fcac0ab121b28974 Mon Sep 17 00:00:00 2001 From: kaelima Date: Fri, 16 Mar 2012 08:59:18 +0100 Subject: [PATCH 0184/1149] Core/Spell: Add some missing cast results which require additional data when sent. And rename two researched castflags (thanks TOMRUS) --- src/server/game/Spells/Spell.cpp | 33 ++++++++++++++++++++++++-------- src/server/game/Spells/Spell.h | 4 ++-- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index b15b9ff3297..0b05db07d38 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3751,12 +3751,12 @@ void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 cas case SPELL_FAILED_TOO_MANY_OF_ITEM: { uint32 item = 0; - for (int8 x = 0; x < 3; x++) - if (spellInfo->Effects[x].ItemType) - item = spellInfo->Effects[x].ItemType; - ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item); - if (pProto && pProto->ItemLimitCategory) - data << uint32(pProto->ItemLimitCategory); + for (int8 eff = 0; eff < MAX_SPELL_EFFECTS; eff++) + if (spellInfo->Effects[eff].ItemType) + item = spellInfo->Effects[eff].ItemType; + ItemTemplate const* proto = sObjectMgr->GetItemTemplate(item); + if (proto && proto->ItemLimitCategory) + data << uint32(proto->ItemLimitCategory); break; } case SPELL_FAILED_CUSTOM_ERROR: @@ -3783,6 +3783,23 @@ void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 cas data << uint32(missingItem); // first missing item break; } + case SPELL_FAILED_PREVENTED_BY_MECHANIC: + data << uint32(spellInfo->Mechanic); + break; + case SPELL_FAILED_NEED_EXOTIC_AMMO: + data << uint32(spellInfo->EquippedItemSubClassMask); + break; + case SPELL_FAILED_NEED_MORE_ITEMS: + data << uint32(0); // Item entry + data << uint32(0); // Count + break; + case SPELL_FAILED_MIN_SKILL: + data << uint32(0); // SkillLine.dbc Id + data << uint32(0); // Amount + break; + case SPELL_FAILED_FISHING_TOO_LOW: + data << uint32(0); // Skill level + break; default: break; } @@ -3856,6 +3873,7 @@ void Spell::SendSpellGo() if (m_spellInfo->Attributes & SPELL_ATTR0_REQ_AMMO) castFlags |= CAST_FLAG_AMMO; // arrows/bullets visual + if ((m_caster->GetTypeId() == TYPEID_PLAYER || (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isPet())) && m_spellInfo->PowerType != POWER_HEALTH) @@ -3868,7 +3886,6 @@ void Spell::SendSpellGo() { castFlags |= CAST_FLAG_UNKNOWN_19; // same as in SMSG_SPELL_START castFlags |= CAST_FLAG_RUNE_LIST; // rune cooldowns list - castFlags |= CAST_FLAG_UNKNOWN_9; // ?? } if (m_spellInfo->HasEffect(SPELL_EFFECT_ACTIVATE_RUNE)) @@ -3931,7 +3948,7 @@ void Spell::SendSpellGo() if (castFlags & CAST_FLAG_AMMO) WriteAmmoToPacket(&data); - if (castFlags & CAST_FLAG_UNKNOWN_20) + if (castFlags & CAST_FLAG_VISUAL_CHAIN) { data << uint32(0); data << uint32(0); diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index f897092e519..716c6bec54d 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -57,14 +57,14 @@ enum SpellCastFlags CAST_FLAG_UNKNOWN_17 = 0x00010000, CAST_FLAG_ADJUST_MISSILE = 0x00020000, CAST_FLAG_UNKNOWN_19 = 0x00040000, - CAST_FLAG_UNKNOWN_20 = 0x00080000, + CAST_FLAG_VISUAL_CHAIN = 0x00080000, CAST_FLAG_UNKNOWN_21 = 0x00100000, CAST_FLAG_RUNE_LIST = 0x00200000, CAST_FLAG_UNKNOWN_23 = 0x00400000, CAST_FLAG_UNKNOWN_24 = 0x00800000, CAST_FLAG_UNKNOWN_25 = 0x01000000, CAST_FLAG_UNKNOWN_26 = 0x02000000, - CAST_FLAG_UNKNOWN_27 = 0x04000000, + CAST_FLAG_IMMUNITY = 0x04000000, CAST_FLAG_UNKNOWN_28 = 0x08000000, CAST_FLAG_UNKNOWN_29 = 0x10000000, CAST_FLAG_UNKNOWN_30 = 0x20000000, From fcbb222acaeaeec8ae282709e8f552cc1e256a07 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Fri, 16 Mar 2012 19:21:47 +0800 Subject: [PATCH 0185/1149] Core/Script: Clean-Up in Scripts. Creature* c -> Creature* creature Creature* _Creature -> Creature* creature Creature* Creature -> Creature* creature Signed-off-by: Gyx <2359980687@qq.com> --- .../BlackrockDepths/blackrock_depths.cpp | 2 +- .../EasternKingdoms/Karazhan/boss_moroes.cpp | 12 ++++---- .../Karazhan/boss_terestian_illhoof.cpp | 2 +- .../boss_priestess_delrissa.cpp | 19 +++++++------ .../ScarletEnclave/chapter1.cpp | 12 ++++---- .../ScarletEnclave/the_scarlet_enclave.cpp | 2 +- .../EasternKingdoms/ZulAman/boss_hexlord.cpp | 16 +++++------ .../TempleOfAhnQiraj/boss_twinemperors.cpp | 4 +-- .../HallsOfReflection/halls_of_reflection.cpp | 2 +- .../Northrend/Naxxramas/boss_anubrekhan.cpp | 2 +- .../Naxxramas/boss_four_horsemen.cpp | 2 +- .../Northrend/Naxxramas/boss_gluth.cpp | 2 +- .../Northrend/Naxxramas/boss_grobbulus.cpp | 2 +- .../Northrend/Naxxramas/boss_heigan.cpp | 2 +- .../Northrend/Naxxramas/boss_kelthuzad.cpp | 2 +- .../Northrend/Naxxramas/boss_maexxna.cpp | 4 +-- .../scripts/Northrend/Naxxramas/boss_noth.cpp | 2 +- .../Northrend/Naxxramas/boss_patchwerk.cpp | 2 +- .../Northrend/Naxxramas/boss_razuvious.cpp | 2 +- .../Northrend/Naxxramas/boss_sapphiron.cpp | 2 +- .../Northrend/Naxxramas/boss_thaddius.cpp | 2 +- .../scripts/Northrend/borean_tundra.cpp | 2 +- src/server/scripts/Northrend/storm_peaks.cpp | 2 +- .../Outland/BlackTemple/boss_illidan.cpp | 2 +- .../Outland/BlackTemple/boss_supremus.cpp | 2 +- .../Outland/BlackTemple/illidari_council.cpp | 8 +++--- .../BloodFurnace/boss_broggok.cpp | 4 +-- .../BloodFurnace/boss_kelidan_the_breaker.cpp | 8 +++--- .../BloodFurnace/boss_the_maker.cpp | 4 +-- .../boss_omor_the_unscarred.cpp | 4 +-- .../boss_vazruden_the_herald.cpp | 16 +++++------ .../boss_watchkeeper_gargolmar.cpp | 4 +-- .../MagtheridonsLair/boss_magtheridon.cpp | 12 ++++---- .../ShatteredHalls/boss_nethekurse.cpp | 8 +++--- .../ShatteredHalls/boss_warbringer_omrogg.cpp | 4 +-- .../boss_warchief_kargath_bladefist.cpp | 4 +-- .../Outland/TempestKeep/Eye/boss_alar.cpp | 12 ++++---- .../TempestKeep/Eye/boss_astromancer.cpp | 4 +-- .../Outland/TempestKeep/Eye/boss_kaelthas.cpp | 28 +++++++++---------- .../TempestKeep/Eye/boss_void_reaver.cpp | 4 +-- .../botanica/boss_high_botanist_freywinn.cpp | 4 +-- .../Outland/TempestKeep/botanica/boss_laj.cpp | 4 +-- .../botanica/boss_warp_splinter.cpp | 8 +++--- .../scripts/World/mob_generic_creature.cpp | 4 +-- src/server/scripts/World/npcs_special.cpp | 6 ++-- 45 files changed, 129 insertions(+), 126 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp index 8edf6260f58..566e8c977dc 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp @@ -1089,7 +1089,7 @@ public: struct npc_tobias_seecherAI : public npc_escortAI { - npc_tobias_seecherAI(Creature* c) :npc_escortAI(c) {} + npc_tobias_seecherAI(Creature* creature) : npc_escortAI(creature) {} void EnterCombat(Unit* who) {} void Reset() {} diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp index ec80ae02ca9..447703aa5a7 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -416,7 +416,7 @@ public: struct boss_baroness_dorothea_millstipeAI : public boss_moroes_guestAI { //Shadow Priest - boss_baroness_dorothea_millstipeAI(Creature* c) : boss_moroes_guestAI(c) {} + boss_baroness_dorothea_millstipeAI(Creature* creature) : boss_moroes_guestAI(creature) {} uint32 ManaBurn_Timer; uint32 MindFlay_Timer; @@ -480,7 +480,7 @@ public: struct boss_baron_rafe_dreugerAI : public boss_moroes_guestAI { //Retr Pally - boss_baron_rafe_dreugerAI(Creature* c) : boss_moroes_guestAI(c){} + boss_baron_rafe_dreugerAI(Creature* creature) : boss_moroes_guestAI(creature){} uint32 HammerOfJustice_Timer; uint32 SealOfCommand_Timer; @@ -538,7 +538,7 @@ public: struct boss_lady_catriona_von_indiAI : public boss_moroes_guestAI { //Holy Priest - boss_lady_catriona_von_indiAI(Creature* c) : boss_moroes_guestAI(c) {} + boss_lady_catriona_von_indiAI(Creature* creature) : boss_moroes_guestAI(creature) {} uint32 DispelMagic_Timer; uint32 GreaterHeal_Timer; @@ -609,7 +609,7 @@ public: struct boss_lady_keira_berrybuckAI : public boss_moroes_guestAI { //Holy Pally - boss_lady_keira_berrybuckAI(Creature* c) : boss_moroes_guestAI(c) {} + boss_lady_keira_berrybuckAI(Creature* creature) : boss_moroes_guestAI(creature) {} uint32 Cleanse_Timer; uint32 GreaterBless_Timer; @@ -684,7 +684,7 @@ public: struct boss_lord_robin_darisAI : public boss_moroes_guestAI { //Arms Warr - boss_lord_robin_darisAI(Creature* c) : boss_moroes_guestAI(c) {} + boss_lord_robin_darisAI(Creature* creature) : boss_moroes_guestAI(creature) {} uint32 Hamstring_Timer; uint32 MortalStrike_Timer; @@ -741,7 +741,7 @@ public: struct boss_lord_crispin_ferenceAI : public boss_moroes_guestAI { //Arms Warr - boss_lord_crispin_ferenceAI(Creature* c) : boss_moroes_guestAI(c) {} + boss_lord_crispin_ferenceAI(Creature* creature) : boss_moroes_guestAI(creature) {} uint32 Disarm_Timer; uint32 HeroicStrike_Timer; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp index d0716a0b565..a192a1de267 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp @@ -178,7 +178,7 @@ public: struct mob_fiendish_portalAI : public PassiveAI { - mob_fiendish_portalAI(Creature* c) : PassiveAI(c), summons(me){} + mob_fiendish_portalAI(Creature* creature) : PassiveAI(creature), summons(me){} SummonList summons; diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp index 9984554208f..883932fdb9b 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp @@ -495,7 +495,7 @@ public: struct boss_kagani_nightstrikeAI : public boss_priestess_lackey_commonAI { //Rogue - boss_kagani_nightstrikeAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_kagani_nightstrikeAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} uint32 Gouge_Timer; uint32 Kick_Timer; @@ -600,7 +600,7 @@ public: struct boss_ellris_duskhallowAI : public boss_priestess_lackey_commonAI { //Warlock - boss_ellris_duskhallowAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_ellris_duskhallowAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} uint32 Immolate_Timer; uint32 Shadow_Bolt_Timer; @@ -692,7 +692,7 @@ public: struct boss_eramas_brightblazeAI : public boss_priestess_lackey_commonAI { //Monk - boss_eramas_brightblazeAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_eramas_brightblazeAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} uint32 Knockdown_Timer; uint32 Snap_Kick_Timer; @@ -754,7 +754,7 @@ public: struct boss_yazzaiAI : public boss_priestess_lackey_commonAI { //Mage - boss_yazzaiAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_yazzaiAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} bool HasIceBlocked; @@ -885,7 +885,7 @@ public: struct boss_warlord_salarisAI : public boss_priestess_lackey_commonAI { //Warrior - boss_warlord_salarisAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_warlord_salarisAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} uint32 Intercept_Stun_Timer; uint32 Disarm_Timer; @@ -1006,7 +1006,10 @@ public: struct boss_garaxxasAI : public boss_priestess_lackey_commonAI { //Hunter - boss_garaxxasAI(Creature* c) : boss_priestess_lackey_commonAI(c) { m_uiPetGUID = 0; } + boss_garaxxasAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) + { + m_uiPetGUID = 0; + } uint64 m_uiPetGUID; @@ -1126,7 +1129,7 @@ public: struct boss_apokoAI : public boss_priestess_lackey_commonAI { //Shaman - boss_apokoAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_apokoAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} uint32 Totem_Timer; uint8 Totem_Amount; @@ -1225,7 +1228,7 @@ public: struct boss_zelfanAI : public boss_priestess_lackey_commonAI { //Engineer - boss_zelfanAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_zelfanAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} uint32 Goblin_Dragon_Gun_Timer; uint32 Rocket_Launch_Timer; diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 0b45144f51b..5f8c243f5d5 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -293,7 +293,7 @@ public: struct npc_unworthy_initiate_anchorAI : public PassiveAI { - npc_unworthy_initiate_anchorAI(Creature* c) : PassiveAI(c), prisonerGUID(0) {} + npc_unworthy_initiate_anchorAI(Creature* creature) : PassiveAI(creature), prisonerGUID(0) {} uint64 prisonerGUID; @@ -868,14 +868,14 @@ class npc_scarlet_miner_cart : public CreatureScript public: npc_scarlet_miner_cart() : CreatureScript("npc_scarlet_miner_cart") { } - CreatureAI* GetAI(Creature* _Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new npc_scarlet_miner_cartAI(_Creature); + return new npc_scarlet_miner_cartAI(creature); } struct npc_scarlet_miner_cartAI : public PassiveAI { - npc_scarlet_miner_cartAI(Creature* c) : PassiveAI(c), minerGUID(0) + npc_scarlet_miner_cartAI(Creature* creature) : PassiveAI(creature), minerGUID(0) { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); // Modelid2 is a horse. @@ -924,9 +924,9 @@ class npc_scarlet_miner : public CreatureScript public: npc_scarlet_miner() : CreatureScript("npc_scarlet_miner") { } - CreatureAI* GetAI(Creature* _Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new npc_scarlet_minerAI(_Creature); + return new npc_scarlet_minerAI(creature); } struct npc_scarlet_minerAI : public npc_escortAI diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp index bf09e008dff..0ef2dddda8d 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp @@ -35,7 +35,7 @@ public: struct npc_valkyr_battle_maidenAI : public PassiveAI { - npc_valkyr_battle_maidenAI(Creature* c) : PassiveAI(c) {} + npc_valkyr_battle_maidenAI(Creature* creature) : PassiveAI(creature) {} uint32 FlyBackTimer; float x, y, z; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp index 944d13cc1be..683bed46bb0 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp @@ -488,7 +488,7 @@ class boss_thurg : public CreatureScript struct boss_thurgAI : public boss_hexlord_addAI { - boss_thurgAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_thurgAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 bloodlust_timer; uint32 cleave_timer; @@ -548,7 +548,7 @@ class boss_alyson_antille : public CreatureScript struct boss_alyson_antilleAI : public boss_hexlord_addAI { //Holy Priest - boss_alyson_antilleAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_alyson_antilleAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 flashheal_timer; uint32 dispelmagic_timer; @@ -637,7 +637,7 @@ class boss_alyson_antille : public CreatureScript struct boss_gazakrothAI : public boss_hexlord_addAI { - boss_gazakrothAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_gazakrothAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 firebolt_timer; @@ -691,7 +691,7 @@ class boss_lord_raadan : public CreatureScript struct boss_lord_raadanAI : public boss_hexlord_addAI { - boss_lord_raadanAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_lord_raadanAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 flamebreath_timer; uint32 thunderclap_timer; @@ -744,7 +744,7 @@ class boss_darkheart : public CreatureScript struct boss_darkheartAI : public boss_hexlord_addAI { - boss_darkheartAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_darkheartAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 psychicwail_timer; @@ -787,7 +787,7 @@ class boss_slither : public CreatureScript struct boss_slitherAI : public boss_hexlord_addAI { - boss_slitherAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_slitherAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 venomspit_timer; @@ -847,7 +847,7 @@ class boss_fenstalker : public CreatureScript struct boss_fenstalkerAI : public boss_hexlord_addAI { - boss_fenstalkerAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_fenstalkerAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 volatileinf_timer; @@ -894,7 +894,7 @@ class boss_koragg : public CreatureScript struct boss_koraggAI : public boss_hexlord_addAI { - boss_koraggAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_koraggAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 coldstare_timer; uint32 mightyblow_timer; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index 6578680fd8b..74d2317734d 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -393,7 +393,7 @@ public: struct boss_veknilashAI : public boss_twinemperorsAI { bool IAmVeklor() {return false;} - boss_veknilashAI(Creature* c) : boss_twinemperorsAI(c) {} + boss_veknilashAI(Creature* creature) : boss_twinemperorsAI(creature) {} uint32 UpperCut_Timer; uint32 UnbalancingStrike_Timer; @@ -479,7 +479,7 @@ public: struct boss_veklorAI : public boss_twinemperorsAI { bool IAmVeklor() {return true;} - boss_veklorAI(Creature* c) : boss_twinemperorsAI(c) {} + boss_veklorAI(Creature* creature) : boss_twinemperorsAI(creature) {} uint32 ShadowBolt_Timer; uint32 Blizzard_Timer; diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index 8f9d5584c4c..89ab4205e87 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -792,7 +792,7 @@ public: struct npc_phantom_hallucinationAI : public npc_phantom_mage::npc_phantom_mageAI { - npc_phantom_hallucinationAI(Creature* c) : npc_phantom_mage::npc_phantom_mageAI(c) + npc_phantom_hallucinationAI(Creature* creature) : npc_phantom_mage::npc_phantom_mageAI(creature) { } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp index 942cfd7c5a8..d473643d900 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp @@ -63,7 +63,7 @@ public: struct boss_anubrekhanAI : public BossAI { - boss_anubrekhanAI(Creature* c) : BossAI(c, BOSS_ANUBREKHAN) {} + boss_anubrekhanAI(Creature* creature) : BossAI(creature, BOSS_ANUBREKHAN) {} bool hasTaunted; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp index 1d82e1c29f3..d2f36efc06a 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp @@ -89,7 +89,7 @@ public: struct boss_four_horsemenAI : public BossAI { - boss_four_horsemenAI(Creature* c) : BossAI(c, BOSS_HORSEMEN) + boss_four_horsemenAI(Creature* creature) : BossAI(creature, BOSS_HORSEMEN) { id = Horsemen(0); for (uint8 i = 0; i < 4; ++i) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp index 0ef4e3d74c2..47dfaa7f772 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp @@ -57,7 +57,7 @@ public: struct boss_gluthAI : public BossAI { - boss_gluthAI(Creature* c) : BossAI(c, BOSS_GLUTH) + boss_gluthAI(Creature* creature) : BossAI(creature, BOSS_GLUTH) { // Do not let Gluth be affected by zombies' debuff me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_INFECTED_WOUND, true); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp index e353a71b0b9..039b9b1e007 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp @@ -45,7 +45,7 @@ public: struct boss_grobbulusAI : public BossAI { - boss_grobbulusAI(Creature* c) : BossAI(c, BOSS_GROBBULUS) + boss_grobbulusAI(Creature* creature) : BossAI(creature, BOSS_GROBBULUS) { me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_POISON_CLOUD_ADD, true); } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp index 7a2d3ec55ab..9ab102e2e2b 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp @@ -57,7 +57,7 @@ public: struct boss_heiganAI : public BossAI { - boss_heiganAI(Creature* c) : BossAI(c, BOSS_HEIGAN) {} + boss_heiganAI(Creature* creature) : BossAI(creature, BOSS_HEIGAN) {} uint32 eruptSection; bool eruptDirection; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index 161c9160293..1a51f424dc8 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -266,7 +266,7 @@ public: struct boss_kelthuzadAI : public BossAI { - boss_kelthuzadAI(Creature* c) : BossAI(c, BOSS_KELTHUZAD), spawns(c) + boss_kelthuzadAI(Creature* creature) : BossAI(creature, BOSS_KELTHUZAD), spawns(creature) { uiFaction = me->getFaction(); } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp index 0163101b8ed..3c258f08030 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp @@ -68,7 +68,7 @@ public: struct boss_maexxnaAI : public BossAI { - boss_maexxnaAI(Creature* c) : BossAI(c, BOSS_MAEXXNA) {} + boss_maexxnaAI(Creature* creature) : BossAI(creature, BOSS_MAEXXNA) {} bool enraged; @@ -159,7 +159,7 @@ public: struct mob_webwrapAI : public NullCreatureAI { - mob_webwrapAI(Creature* c) : NullCreatureAI(c), victimGUID(0) {} + mob_webwrapAI(Creature* creature) : NullCreatureAI(creature), victimGUID(0) {} uint64 victimGUID; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp index 7143b940916..e593adfbc66 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp @@ -75,7 +75,7 @@ public: struct boss_nothAI : public BossAI { - boss_nothAI(Creature* c) : BossAI(c, BOSS_NOTH) {} + boss_nothAI(Creature* creature) : BossAI(creature, BOSS_NOTH) {} uint32 waveCount, balconyCount; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp index a9ed499c5e5..37c32edf0db 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp @@ -62,7 +62,7 @@ public: struct boss_patchwerkAI : public BossAI { - boss_patchwerkAI(Creature* c) : BossAI(c, BOSS_PATCHWERK) {} + boss_patchwerkAI(Creature* creature) : BossAI(creature, BOSS_PATCHWERK) {} bool Enraged; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp index b27ab3730da..e06aa6b03c5 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp @@ -64,7 +64,7 @@ public: struct boss_razuviousAI : public BossAI { - boss_razuviousAI(Creature* c) : BossAI(c, BOSS_RAZUVIOUS) {} + boss_razuviousAI(Creature* creature) : BossAI(creature, BOSS_RAZUVIOUS) {} void KilledUnit(Unit* /*victim*/) { diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp index e37ceb6925f..9e05178a8b9 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp @@ -81,7 +81,7 @@ public: struct boss_sapphironAI : public BossAI { - boss_sapphironAI(Creature* c) : BossAI(c, BOSS_SAPPHIRON) + boss_sapphironAI(Creature* creature) : BossAI(creature, BOSS_SAPPHIRON) , phase(PHASE_NULL) { map = me->GetMap(); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp index 04360d25be3..86b77139661 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp @@ -120,7 +120,7 @@ public: struct boss_thaddiusAI : public BossAI { - boss_thaddiusAI(Creature* c) : BossAI(c, BOSS_THADDIUS) + boss_thaddiusAI(Creature* creature) : BossAI(creature, BOSS_THADDIUS) { // init is a bit tricky because thaddius shall track the life of both adds, but not if there was a wipe // and, in particular, if there was a crash after both adds were killed (should not respawn) diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index 97155d8cd67..d2bb4ee08a4 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -849,7 +849,7 @@ public: struct npc_nexus_drake_hatchlingAI : public FollowerAI //The spell who makes the npc follow the player is missing, also we can use FollowerAI! { - npc_nexus_drake_hatchlingAI(Creature* c) : FollowerAI(c) {} + npc_nexus_drake_hatchlingAI(Creature* creature) : FollowerAI(creature) {} uint64 HarpoonerGUID; bool WithRedDragonBlood; diff --git a/src/server/scripts/Northrend/storm_peaks.cpp b/src/server/scripts/Northrend/storm_peaks.cpp index a6874b582dd..8e7d66a33c1 100644 --- a/src/server/scripts/Northrend/storm_peaks.cpp +++ b/src/server/scripts/Northrend/storm_peaks.cpp @@ -709,7 +709,7 @@ class npc_hyldsmeet_protodrake : public CreatureScript class npc_hyldsmeet_protodrakeAI : public CreatureAI { public: - npc_hyldsmeet_protodrakeAI(Creature* c) : CreatureAI(c), _accessoryRespawnTimer(0), _vehicleKit(c->GetVehicleKit()) {} + npc_hyldsmeet_protodrakeAI(Creature* creature) : CreatureAI(creature), _accessoryRespawnTimer(0), _vehicleKit(creature->GetVehicleKit()) {} void PassengerBoarded(Unit* who, int8 /*seat*/, bool apply) { diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 7208fd97f90..7468d522e57 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -2168,7 +2168,7 @@ public: struct blade_of_azzinothAI : public NullCreatureAI { - blade_of_azzinothAI(Creature* c) : NullCreatureAI(c) {} + blade_of_azzinothAI(Creature* creature) : NullCreatureAI(creature) {} void SpellHit(Unit* /*caster*/, const SpellInfo* spell) { diff --git a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp index 6cd74dea985..15b9eebc869 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp @@ -65,7 +65,7 @@ public: struct molten_flameAI : public NullCreatureAI { - molten_flameAI(Creature* c) : NullCreatureAI(c) {} + molten_flameAI(Creature* creature) : NullCreatureAI(creature) {} void InitializeAI() { diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index c313a2138a6..a4cae747bd7 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -475,7 +475,7 @@ public: struct boss_gathios_the_shattererAI : public boss_illidari_councilAI { - boss_gathios_the_shattererAI(Creature* c) : boss_illidari_councilAI(c) {} + boss_gathios_the_shattererAI(Creature* creature) : boss_illidari_councilAI(creature) {} uint32 ConsecrationTimer; uint32 HammerOfJusticeTimer; @@ -602,7 +602,7 @@ public: struct boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI { - boss_high_nethermancer_zerevorAI(Creature* c) : boss_illidari_councilAI(c) {} + boss_high_nethermancer_zerevorAI(Creature* creature) : boss_illidari_councilAI(creature) {} uint32 BlizzardTimer; uint32 FlamestrikeTimer; @@ -706,7 +706,7 @@ public: struct boss_lady_malandeAI : public boss_illidari_councilAI { - boss_lady_malandeAI(Creature* c) : boss_illidari_councilAI(c) {} + boss_lady_malandeAI(Creature* creature) : boss_illidari_councilAI(creature) {} uint32 EmpoweredSmiteTimer; uint32 CircleOfHealingTimer; @@ -784,7 +784,7 @@ public: struct boss_veras_darkshadowAI : public boss_illidari_councilAI { - boss_veras_darkshadowAI(Creature* c) : boss_illidari_councilAI(c) {} + boss_veras_darkshadowAI(Creature* creature) : boss_illidari_councilAI(creature) {} uint64 EnvenomTargetGUID; diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp index 7fa417cacb2..42398b9557b 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp @@ -133,9 +133,9 @@ class boss_broggok : public CreatureScript }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_broggokAI (Creature); + return new boss_broggokAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp index b847500fc36..7aba4db9ad9 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp @@ -268,9 +268,9 @@ class boss_kelidan_the_breaker : public CreatureScript }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_kelidan_the_breakerAI (Creature); + return new boss_kelidan_the_breakerAI(creature); } }; @@ -371,9 +371,9 @@ class mob_shadowmoon_channeler : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_shadowmoon_channelerAI (Creature); + return new mob_shadowmoon_channelerAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp index f056ccd40ee..186b26b2b60 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp @@ -153,9 +153,9 @@ class boss_the_maker : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_the_makerAI (Creature); + return new boss_the_makerAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp index a6adb6b952e..c3b8306cd8d 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp @@ -219,9 +219,9 @@ class boss_omor_the_unscarred : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_omor_the_unscarredAI (Creature); + return new boss_omor_the_unscarredAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp index 66d445c1f39..1867f90bb8a 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp @@ -194,9 +194,9 @@ class boss_nazan : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_nazanAI (Creature); + return new boss_nazanAI(creature); } }; @@ -272,9 +272,9 @@ class boss_vazruden : public CreatureScript DoMeleeAttackIfReady(); } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_vazrudenAI (Creature); + return new boss_vazrudenAI(creature); } }; @@ -453,9 +453,9 @@ class boss_vazruden_the_herald : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_vazruden_the_heraldAI (Creature); + return new boss_vazruden_the_heraldAI(creature); } }; @@ -503,9 +503,9 @@ class mob_hellfire_sentry : public CreatureScript DoMeleeAttackIfReady(); } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_hellfire_sentryAI (Creature); + return new mob_hellfire_sentryAI(creature); } }; void AddSC_boss_vazruden_the_herald() diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp index cc732b86ea4..55ad59e39ce 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp @@ -163,9 +163,9 @@ class boss_watchkeeper_gargolmar : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_watchkeeper_gargolmarAI (Creature); + return new boss_watchkeeper_gargolmarAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp index c355079e0e8..45fcaa5af29 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp @@ -198,9 +198,9 @@ class mob_abyssal : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_abyssalAI(Creature); + return new mob_abyssalAI(creature); } }; @@ -464,9 +464,9 @@ class boss_magtheridon : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_magtheridonAI(Creature); + return new boss_magtheridonAI(creature); } }; @@ -583,9 +583,9 @@ class mob_hellfire_channeler : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_hellfire_channelerAI(Creature); + return new mob_hellfire_channelerAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp index 970c089918e..59c56114bf8 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp @@ -301,9 +301,9 @@ class boss_grand_warlock_nethekurse : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_grand_warlock_nethekurseAI (Creature); + return new boss_grand_warlock_nethekurseAI(creature); } }; @@ -383,9 +383,9 @@ class mob_fel_orc_convert : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_fel_orc_convertAI (Creature); + return new mob_fel_orc_convertAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp index 5e8ed53fa4b..1d5218ae34d 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp @@ -143,9 +143,9 @@ class mob_omrogg_heads : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_omrogg_headsAI (Creature); + return new mob_omrogg_headsAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp index 12e28d42a67..1e80a1b7c99 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp @@ -316,9 +316,9 @@ class boss_warchief_kargath_bladefist : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_warchief_kargath_bladefistAI (Creature); + return new boss_warchief_kargath_bladefistAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index 97ac0b9da5e..63fb4f17169 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -450,9 +450,9 @@ class boss_alar : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_alarAI(Creature); + return new boss_alarAI(creature); } }; @@ -529,9 +529,9 @@ class mob_ember_of_alar : public CreatureScript }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_ember_of_alarAI(Creature); + return new mob_ember_of_alarAI(creature); } }; @@ -554,9 +554,9 @@ class mob_flame_patch_alar : public CreatureScript void UpdateAI(const uint32 /*diff*/) {} }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_flame_patch_alarAI(Creature); + return new mob_flame_patch_alarAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp index 05fad24f35e..f6a5d429182 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp @@ -490,9 +490,9 @@ class mob_solarium_priest : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_solarium_priestAI (Creature); + return new mob_solarium_priestAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index 577c8bf9f54..7d48e2a80b6 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -998,9 +998,9 @@ class boss_kaelthas : public CreatureScript } } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_kaelthasAI(Creature); + return new boss_kaelthasAI(creature); } }; @@ -1096,9 +1096,9 @@ class boss_thaladred_the_darkener : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_thaladred_the_darkenerAI(Creature); + return new boss_thaladred_the_darkenerAI(creature); } }; @@ -1164,9 +1164,9 @@ class boss_lord_sanguinar : public CreatureScript DoMeleeAttackIfReady(); } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_lord_sanguinarAI(Creature); + return new boss_lord_sanguinarAI(creature); } }; //Grand Astromancer Capernian AI @@ -1308,9 +1308,9 @@ class boss_grand_astromancer_capernian : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_grand_astromancer_capernianAI(Creature); + return new boss_grand_astromancer_capernianAI(creature); } }; @@ -1391,9 +1391,9 @@ class boss_master_engineer_telonicus : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_master_engineer_telonicusAI(Creature); + return new boss_master_engineer_telonicusAI(creature); } }; @@ -1455,9 +1455,9 @@ class mob_kael_flamestrike : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_kael_flamestrikeAI(Creature); + return new mob_kael_flamestrikeAI(creature); } }; @@ -1509,9 +1509,9 @@ class mob_phoenix_tk : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_phoenix_tkAI(Creature); + return new mob_phoenix_tkAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp index 576d0a8bbf2..bad35d0a685 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp @@ -76,8 +76,8 @@ class boss_void_reaver : public CreatureScript Enraged = false; - if (instance && me->isAlive()) - instance->SetData(DATA_VOIDREAVEREVENT, NOT_STARTED); + if (instance && me->isAlive()) + instance->SetData(DATA_VOIDREAVEREVENT, NOT_STARTED); } void KilledUnit(Unit* /*victim*/) diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp index ccac73c5dc6..178495ff25a 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp @@ -195,9 +195,9 @@ class boss_high_botanist_freywinn : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_high_botanist_freywinnAI (Creature); + return new boss_high_botanist_freywinnAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp index 488ddba40cf..e8188f892b3 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp @@ -211,9 +211,9 @@ class boss_laj : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_lajAI (Creature); + return new boss_lajAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp index 7e9960225bb..09674fa98d0 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp @@ -118,9 +118,9 @@ class mob_warp_splinter_treant : public CreatureScript DoMeleeAttackIfReady(); } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_warp_splinter_treantAI (Creature); + return new mob_warp_splinter_treantAI(creature); } }; @@ -226,9 +226,9 @@ class boss_warp_splinter : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_warp_splinterAI (Creature); + return new boss_warp_splinterAI(creature); } }; diff --git a/src/server/scripts/World/mob_generic_creature.cpp b/src/server/scripts/World/mob_generic_creature.cpp index 6970d5ae367..208effee61b 100644 --- a/src/server/scripts/World/mob_generic_creature.cpp +++ b/src/server/scripts/World/mob_generic_creature.cpp @@ -174,7 +174,7 @@ public: struct trigger_periodicAI : public NullCreatureAI { - trigger_periodicAI(Creature* c) : NullCreatureAI(c) + trigger_periodicAI(Creature* creature) : NullCreatureAI(creature) { spell = me->m_spells[0] ? sSpellMgr->GetSpellInfo(me->m_spells[0]) : NULL; interval = me->GetAttackTime(BASE_ATTACK); @@ -210,7 +210,7 @@ public: struct trigger_deathAI : public NullCreatureAI { - trigger_deathAI(Creature* c) : NullCreatureAI(c) {} + trigger_deathAI(Creature* creature) : NullCreatureAI(creature) {} void JustDied(Unit* killer) { if (me->m_spells[0]) diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 046890b498d..a6f68b8fb32 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1842,7 +1842,7 @@ public: struct npc_mirror_imageAI : CasterAI { - npc_mirror_imageAI(Creature* c) : CasterAI(c) {} + npc_mirror_imageAI(Creature* creature) : CasterAI(creature) {} void InitializeAI() { @@ -1888,7 +1888,7 @@ public: struct npc_ebon_gargoyleAI : CasterAI { - npc_ebon_gargoyleAI(Creature* c) : CasterAI(c) {} + npc_ebon_gargoyleAI(Creature* creature) : CasterAI(creature) {} uint32 despawnTimer; @@ -1979,7 +1979,7 @@ public: struct npc_lightwellAI : public PassiveAI { - npc_lightwellAI(Creature* c) : PassiveAI(c) {} + npc_lightwellAI(Creature* creature) : PassiveAI(creature) {} void Reset() { From 76c18e00c726d93509d69fba76e585768e771bc1 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Fri, 16 Mar 2012 19:28:10 +0800 Subject: [PATCH 0186/1149] Core/Script: Clean-Up in Scripts. GameObject* pGO -> GameObject* go Signed-off-by: Gyx <2359980687@qq.com> --- .../ScarletEnclave/chapter1.cpp | 2 +- .../Uldaman/boss_archaedas.cpp | 2 +- .../EasternKingdoms/eversong_woods.cpp | 4 +- .../boss_leutenant_drake.cpp | 4 +- .../Kalimdor/RazorfenDowns/razorfen_downs.cpp | 4 +- .../Ahnkahet/boss_prince_taldaram.cpp | 12 +- .../trial_of_the_champion.cpp | 4 +- .../trial_of_the_crusader.cpp | 11 +- .../Northrend/Gundrak/instance_gundrak.cpp | 14 +- .../Nexus/Nexus/boss_keristrasza.cpp | 10 +- .../UtgardePinnacle/boss_palehoof.cpp | 10 +- .../UtgardePinnacle/boss_skadi.cpp | 12 +- .../VioletHold/instance_violet_hold.cpp | 2 +- .../scripts/Northrend/borean_tundra.cpp | 6 +- src/server/scripts/Northrend/zuldrak.cpp | 9 +- .../MagtheridonsLair/boss_magtheridon.cpp | 8 +- src/server/scripts/Outland/netherstorm.cpp | 4 +- src/server/scripts/World/go_scripts.cpp | 200 +++++++++--------- 18 files changed, 159 insertions(+), 159 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 5f8c243f5d5..cffb2d73b1f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -1057,7 +1057,7 @@ class go_inconspicuous_mine_car : public GameObjectScript public: go_inconspicuous_mine_car() : GameObjectScript("go_inconspicuous_mine_car") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->GetQuestStatus(12701) == QUEST_STATUS_INCOMPLETE) { diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp index 4e7192e966c..17d23429537 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp @@ -394,7 +394,7 @@ class go_altar_of_archaedas : public GameObjectScript { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { InstanceScript* instance = player->GetInstanceScript(); if (!instance) diff --git a/src/server/scripts/EasternKingdoms/eversong_woods.cpp b/src/server/scripts/EasternKingdoms/eversong_woods.cpp index 49fd582a662..2655165e59f 100644 --- a/src/server/scripts/EasternKingdoms/eversong_woods.cpp +++ b/src/server/scripts/EasternKingdoms/eversong_woods.cpp @@ -417,10 +417,10 @@ class go_second_trial : public GameObjectScript public: go_second_trial() : GameObjectScript("go_second_trial") { } - bool OnGossipHello(Player* /*player*/, GameObject* pGO) + bool OnGossipHello(Player* /*player*/, GameObject* go) { // find spawn :: master_kelerun_bloodmourn - if (Creature* creature = pGO->FindNearestCreature(MASTER_KELERUN_BLOODMOURN, 30.0f)) + if (Creature* creature = go->FindNearestCreature(MASTER_KELERUN_BLOODMOURN, 30.0f)) CAST_AI(npc_second_trial_controller::master_kelerun_bloodmournAI, creature->AI())->StartEvent(); return true; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp index b18cee43664..934b876d7c3 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp @@ -36,9 +36,9 @@ class go_barrel_old_hillsbrad : public GameObjectScript public: go_barrel_old_hillsbrad() : GameObjectScript("go_barrel_old_hillsbrad") { } - bool OnGossipHello(Player* /*player*/, GameObject* pGO) + bool OnGossipHello(Player* /*player*/, GameObject* go) { - if (InstanceScript* instance = pGO->GetInstanceScript()) + if (InstanceScript* instance = go->GetInstanceScript()) { if (instance->GetData(TYPE_BARREL_DIVERSION) == DONE) return false; diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp index 5cf970e60f3..8cef144f4c5 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp @@ -93,10 +93,10 @@ class go_gong : public GameObjectScript public: go_gong() : GameObjectScript("go_gong") { } - bool OnGossipHello(Player* /*player*/, GameObject* pGO) + bool OnGossipHello(Player* /*player*/, GameObject* go) { //basic support, not blizzlike data is missing... - InstanceScript* instance = pGO->GetInstanceScript(); + InstanceScript* instance = go->GetInstanceScript(); if (instance) { diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp index 5ec693c58b2..65b55d8009c 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp @@ -387,20 +387,20 @@ class prince_taldaram_sphere : public GameObjectScript public: prince_taldaram_sphere() : GameObjectScript("prince_taldaram_sphere") { } - bool OnGossipHello(Player* /*player*/, GameObject* pGO) + bool OnGossipHello(Player* /*player*/, GameObject* go) { - InstanceScript* instance = pGO->GetInstanceScript(); + InstanceScript* instance = go->GetInstanceScript(); if (!instance) return true; - Creature* pPrinceTaldaram = Unit::GetCreature(*pGO, instance->GetData64(DATA_PRINCE_TALDARAM)); + Creature* pPrinceTaldaram = Unit::GetCreature(*go, instance->GetData64(DATA_PRINCE_TALDARAM)); if (pPrinceTaldaram && pPrinceTaldaram->isAlive()) { // maybe these are hacks :( - pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - pGO->SetGoState(GO_STATE_ACTIVE); + go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + go->SetGoState(GO_STATE_ACTIVE); - switch (pGO->GetEntry()) + switch (go->GetEntry()) { case GO_SPHERE1: instance->SetData(DATA_SPHERE1_EVENT, IN_PROGRESS); break; case GO_SPHERE2: instance->SetData(DATA_SPHERE2_EVENT, IN_PROGRESS); break; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp index a2919de0149..c8236ace88c 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp @@ -125,8 +125,8 @@ public: break; case DATA_IN_POSITION: //movement done. me->GetMotionMaster()->MovePoint(1, 735.81f, 661.92f, 412.39f); - if (GameObject* pGO = GameObject::GetGameObject(*me, instance->GetData64(DATA_MAIN_GATE))) - instance->HandleGameObject(pGO->GetGUID(), false); + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_MAIN_GATE))) + instance->HandleGameObject(go->GetGUID(), false); NextStep(10000, false, 3); break; case DATA_LESSER_CHAMPIONS_DEFEATED: diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp index 28110d883c6..4a4f7dcfc7c 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -275,8 +275,11 @@ class boss_lich_king_toc : public CreatureScript void UpdateAI(const uint32 uiDiff) { - if (!m_instance) return; - if (m_instance->GetData(TYPE_EVENT_NPC) != NPC_LICH_KING_1) return; + if (!m_instance) + return; + + if (m_instance->GetData(TYPE_EVENT_NPC) != NPC_LICH_KING_1) + return; m_uiUpdateTimer = m_instance->GetData(TYPE_EVENT_TIMER); if (m_uiUpdateTimer <= uiDiff) @@ -318,8 +321,8 @@ class boss_lich_king_toc : public CreatureScript m_instance->SetData(TYPE_EVENT, 5080); break; case 5080: - if (GameObject* pGoFloor = m_instance->instance->GetGameObject(m_instance->GetData64(GO_ARGENT_COLISEUM_FLOOR))) - pGoFloor->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); + if (GameObject* go = m_instance->instance->GetGameObject(m_instance->GetData64(GO_ARGENT_COLISEUM_FLOOR))) + go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); me->CastSpell(me, 69016, false); if (m_instance) { diff --git a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp index c0fc722385b..aad382e3ad1 100644 --- a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp +++ b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp @@ -519,17 +519,17 @@ class go_gundrak_altar : public GameObjectScript public: go_gundrak_altar() : GameObjectScript("go_gundrak_altar") { } - bool OnGossipHello(Player* /*player*/, GameObject* pGO) + bool OnGossipHello(Player* /*player*/, GameObject* go) { - InstanceScript* instance = pGO->GetInstanceScript(); + InstanceScript* instance = go->GetInstanceScript(); uint64 uiStatue = 0; - pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - pGO->SetGoState(GO_STATE_ACTIVE); + go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + go->SetGoState(GO_STATE_ACTIVE); if (instance) { - switch (pGO->GetEntry()) + switch (go->GetEntry()) { case 192518: uiStatue = instance->GetData64(DATA_SLAD_RAN_STATUE); @@ -545,8 +545,8 @@ public: if (!instance->GetData64(DATA_STATUE_ACTIVATE)) { instance->SetData64(DATA_STATUE_ACTIVATE, uiStatue); - pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - pGO->SetGoState(GO_STATE_ACTIVE); + go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + go->SetGoState(GO_STATE_ACTIVE); } return true; } diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp index 91333098560..5c1dee1d4e4 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp @@ -208,16 +208,16 @@ class containment_sphere : public GameObjectScript public: containment_sphere() : GameObjectScript("containment_sphere") { } - bool OnGossipHello(Player* /*player*/, GameObject* pGO) + bool OnGossipHello(Player* /*player*/, GameObject* go) { - InstanceScript* instance = pGO->GetInstanceScript(); + InstanceScript* instance = go->GetInstanceScript(); - Creature* pKeristrasza = Unit::GetCreature(*pGO, instance ? instance->GetData64(DATA_KERISTRASZA) : 0); + Creature* pKeristrasza = Unit::GetCreature(*go, instance ? instance->GetData64(DATA_KERISTRASZA) : 0); if (pKeristrasza && pKeristrasza->isAlive()) { // maybe these are hacks :( - pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - pGO->SetGoState(GO_STATE_ACTIVE); + go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + go->SetGoState(GO_STATE_ACTIVE); CAST_AI(boss_keristrasza::boss_keristraszaAI, pKeristrasza->AI())->CheckContainmentSpheres(true); } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp index 474f7f2ba06..e2943f491f6 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp @@ -835,15 +835,15 @@ class go_palehoof_sphere : public GameObjectScript public: go_palehoof_sphere() : GameObjectScript("go_palehoof_sphere") { } - bool OnGossipHello(Player* /*player*/, GameObject* pGO) + bool OnGossipHello(Player* /*player*/, GameObject* go) { - InstanceScript* instance = pGO->GetInstanceScript(); + InstanceScript* instance = go->GetInstanceScript(); - Creature* pPalehoof = Unit::GetCreature(*pGO, instance ? instance->GetData64(DATA_GORTOK_PALEHOOF) : 0); + Creature* pPalehoof = Unit::GetCreature(*go, instance ? instance->GetData64(DATA_GORTOK_PALEHOOF) : 0); if (pPalehoof && pPalehoof->isAlive()) { - pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - pGO->SetGoState(GO_STATE_ACTIVE); + go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + go->SetGoState(GO_STATE_ACTIVE); CAST_AI(boss_palehoof::boss_palehoofAI, pPalehoof->AI())->NextPhase(); } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index 093fa0be1a6..b94c88aed86 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -461,15 +461,15 @@ class go_harpoon_launcher : public GameObjectScript public: go_harpoon_launcher() : GameObjectScript("go_harpoon_launcher") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - InstanceScript* m_instance = pGO->GetInstanceScript(); - if (!m_instance) return false; + InstanceScript* m_instance = go->GetInstanceScript(); + if (!m_instance) + return false; - if (Creature* pSkadi = Unit::GetCreature((*pGO), m_instance->GetData64(DATA_SKADI_THE_RUTHLESS))) - { + if (Creature* pSkadi = Unit::GetCreature(*go, m_instance->GetData64(DATA_SKADI_THE_RUTHLESS))) player->CastSpell(pSkadi, SPELL_RAPID_FIRE, true); - } + return false; } diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp index 5980c534595..8c92f474ccf 100644 --- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp @@ -795,7 +795,7 @@ public: } } - void ProcessEvent(WorldObject* /*pGO*/, uint32 uiEventId) + void ProcessEvent(WorldObject* /*go*/, uint32 uiEventId) { switch (uiEventId) { diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index d2bb4ee08a4..078f4321cae 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -403,9 +403,9 @@ public: { me->SetReactState(REACT_PASSIVE); - if (GameObject* pGO = me->FindNearestGameObject(GO_SCOURGE_CAGE, 5.0f)) - if (pGO->GetGoState() == GO_STATE_ACTIVE) - pGO->SetGoState(GO_STATE_READY); + if (GameObject* go = me->FindNearestGameObject(GO_SCOURGE_CAGE, 5.0f)) + if (go->GetGoState() == GO_STATE_ACTIVE) + go->SetGoState(GO_STATE_READY); } }; diff --git a/src/server/scripts/Northrend/zuldrak.cpp b/src/server/scripts/Northrend/zuldrak.cpp index b4bcab9e731..33d295e5970 100644 --- a/src/server/scripts/Northrend/zuldrak.cpp +++ b/src/server/scripts/Northrend/zuldrak.cpp @@ -52,8 +52,7 @@ public: float x, y, z; me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, 0.1f); - if (Unit* summon = me->SummonCreature(NPC_RAGECLAW, x, y, z, - 0, TEMPSUMMON_DEAD_DESPAWN, 1000)) + if (Unit* summon = me->SummonCreature(NPC_RAGECLAW, x, y, z, 0, TEMPSUMMON_DEAD_DESPAWN, 1000)) { RageclawGUID = summon->GetGUID(); LockRageclaw(); @@ -1397,14 +1396,14 @@ class go_scourge_enclosure : public GameObjectScript public: go_scourge_enclosure() : GameObjectScript("go_scourge_enclosure") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { if (player->GetQuestStatus(QUEST_OUR_ONLY_HOPE) == QUEST_STATUS_INCOMPLETE) { - Creature* pGymerDummy = pGO->FindNearestCreature(NPC_GYMER_DUMMY, 20.0f); + Creature* pGymerDummy = go->FindNearestCreature(NPC_GYMER_DUMMY, 20.0f); if (pGymerDummy) { - pGO->UseDoorOrButton(); + go->UseDoorOrButton(); player->KilledMonsterCredit(pGymerDummy->GetEntry(), pGymerDummy->GetGUID()); pGymerDummy->CastSpell(pGymerDummy, 55529, true); pGymerDummy->DisappearAndDie(); diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp index 45fcaa5af29..bdfc3dd3bf3 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp @@ -597,16 +597,16 @@ public: { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - InstanceScript* instance = pGO->GetInstanceScript(); + InstanceScript* instance = go->GetInstanceScript(); if (!instance) return true; if (instance->GetData(DATA_MAGTHERIDON_EVENT) != IN_PROGRESS) return true; - Creature* Magtheridon =Unit::GetCreature(*pGO, instance->GetData64(DATA_MAGTHERIDON)); + Creature* Magtheridon =Unit::GetCreature(*go, instance->GetData64(DATA_MAGTHERIDON)); if (!Magtheridon || !Magtheridon->isAlive()) return true; @@ -617,7 +617,7 @@ public: player->InterruptNonMeleeSpells(false); player->CastSpell(player, SPELL_SHADOW_GRASP, true); player->CastSpell(player, SPELL_SHADOW_GRASP_VISUAL, false); - CAST_AI(boss_magtheridon::boss_magtheridonAI, Magtheridon->AI())->SetClicker(pGO->GetGUID(), player->GetGUID()); + CAST_AI(boss_magtheridon::boss_magtheridonAI, Magtheridon->AI())->SetClicker(go->GetGUID(), player->GetGUID()); return true; } }; diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp index 8b24d94169b..ba152252e0a 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/netherstorm.cpp @@ -1009,12 +1009,12 @@ public: if (uiTakeTimer < uiDiff) { me->HandleEmoteCommand(EMOTE_STATE_NONE); - if (GameObject* pGO = GetClosestGameObjectWithEntry(me, GO_DRAENEI_MACHINE, INTERACTION_DISTANCE)) + if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_DRAENEI_MACHINE, INTERACTION_DISTANCE)) { SetEscortPaused(false); bTake=false; uiTakeTimer = 3000; - pGO->Delete(); + go->Delete(); } } else diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index d67c09c8d02..15a931b056b 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -66,7 +66,7 @@ class go_cat_figurine : public GameObjectScript public: go_cat_figurine() : GameObjectScript("go_cat_figurine") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { player->CastSpell(player, SPELL_SUMMON_GHOST_SABER, true); return false; @@ -81,12 +81,12 @@ class go_northern_crystal_pylon : public GameObjectScript public: go_northern_crystal_pylon() : GameObjectScript("go_northern_crystal_pylon") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - if (pGO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) + if (go->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) { - player->PrepareQuestMenu(pGO->GetGUID()); - player->SendPreparedQuest(pGO->GetGUID()); + player->PrepareQuestMenu(go->GetGUID()); + player->SendPreparedQuest(go->GetGUID()); } if (player->GetQuestStatus(4285) == QUEST_STATUS_INCOMPLETE) @@ -101,12 +101,12 @@ class go_eastern_crystal_pylon : public GameObjectScript public: go_eastern_crystal_pylon() : GameObjectScript("go_eastern_crystal_pylon") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - if (pGO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) + if (go->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) { - player->PrepareQuestMenu(pGO->GetGUID()); - player->SendPreparedQuest(pGO->GetGUID()); + player->PrepareQuestMenu(go->GetGUID()); + player->SendPreparedQuest(go->GetGUID()); } if (player->GetQuestStatus(4287) == QUEST_STATUS_INCOMPLETE) @@ -121,12 +121,12 @@ class go_western_crystal_pylon : public GameObjectScript public: go_western_crystal_pylon() : GameObjectScript("go_western_crystal_pylon") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - if (pGO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) + if (go->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) { - player->PrepareQuestMenu(pGO->GetGUID()); - player->SendPreparedQuest(pGO->GetGUID()); + player->PrepareQuestMenu(go->GetGUID()); + player->SendPreparedQuest(go->GetGUID()); } if (player->GetQuestStatus(4288) == QUEST_STATUS_INCOMPLETE) @@ -145,7 +145,7 @@ class go_barov_journal : public GameObjectScript public: go_barov_journal() : GameObjectScript("go_barov_journal") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->HasSkill(SKILL_TAILORING) && player->GetBaseSkillValue(SKILL_TAILORING) >= 280 && !player->HasSpell(26086)) { @@ -164,7 +164,7 @@ class go_field_repair_bot_74A : public GameObjectScript public: go_field_repair_bot_74A() : GameObjectScript("go_field_repair_bot_74A") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->HasSkill(SKILL_ENGINEERING) && player->GetBaseSkillValue(SKILL_ENGINEERING) >= 300 && !player->HasSpell(22704)) { @@ -188,9 +188,9 @@ class go_gilded_brazier : public GameObjectScript public: go_gilded_brazier() : GameObjectScript("go_gilded_brazier") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER) + if (go->GetGoType() == GAMEOBJECT_TYPE_GOOBER) { if (player->GetQuestStatus(9678) == QUEST_STATUS_INCOMPLETE) { @@ -211,7 +211,7 @@ class go_orb_of_command : public GameObjectScript public: go_orb_of_command() : GameObjectScript("go_orb_of_command") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->GetQuestRewardStatus(7761)) player->CastSpell(player, 23460, true); @@ -229,7 +229,7 @@ class go_tablet_of_madness : public GameObjectScript public: go_tablet_of_madness() : GameObjectScript("go_tablet_of_madness") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->HasSkill(SKILL_ALCHEMY) && player->GetSkillValue(SKILL_ALCHEMY) >= 300 && !player->HasSpell(24266)) { @@ -249,9 +249,9 @@ public: go_tablet_of_the_seven() : GameObjectScript("go_tablet_of_the_seven") { } //TODO: use gossip option ("Transcript the Tablet") instead, if Trinity adds support. - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - if (pGO->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER) + if (go->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER) return true; if (player->GetQuestStatus(4296) == QUEST_STATUS_INCOMPLETE) @@ -270,7 +270,7 @@ class go_jump_a_tron : public GameObjectScript public: go_jump_a_tron() : GameObjectScript("go_jump_a_tron") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->GetQuestStatus(10111) == QUEST_STATUS_INCOMPLETE) player->CastSpell(player, 33382, true); @@ -304,12 +304,11 @@ class go_ethereum_prison : public GameObjectScript public: go_ethereum_prison() : GameObjectScript("go_ethereum_prison") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { int Random = rand() % (sizeof(NpcPrisonEntry) / sizeof(uint32)); - if (Creature* creature = player->SummonCreature(NpcPrisonEntry[Random], - pGO->GetPositionX(), pGO->GetPositionY(), pGO->GetPositionZ(), pGO->GetAngle(player), + if (Creature* creature = player->SummonCreature(NpcPrisonEntry[Random], go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), go->GetAngle(player), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) { if (!creature->IsHostileTo(player)) @@ -354,12 +353,11 @@ class go_ethereum_stasis : public GameObjectScript public: go_ethereum_stasis() : GameObjectScript("go_ethereum_stasis") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { int Random = rand() % (sizeof(NpcStasisEntry) / sizeof(uint32)); - player->SummonCreature(NpcStasisEntry[Random], - pGO->GetPositionX(), pGO->GetPositionY(), pGO->GetPositionZ(), pGO->GetAngle(player), + player->SummonCreature(NpcStasisEntry[Random], go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), go->GetAngle(player), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); return false; @@ -380,10 +378,10 @@ class go_resonite_cask : public GameObjectScript public: go_resonite_cask() : GameObjectScript("go_resonite_cask") { } - bool OnGossipHello(Player* /*player*/, GameObject* pGO) + bool OnGossipHello(Player* /*player*/, GameObject* go) { - if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER) - pGO->SummonCreature(NPC_GOGGEROC, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 300000); + if (go->GetGoType() == GAMEOBJECT_TYPE_GOOBER) + go->SummonCreature(NPC_GOGGEROC, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 300000); return false; } @@ -400,9 +398,9 @@ class go_sacred_fire_of_life : public GameObjectScript public: go_sacred_fire_of_life() : GameObjectScript("go_sacred_fire_of_life") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER) + if (go->GetGoType() == GAMEOBJECT_TYPE_GOOBER) player->SummonCreature(NPC_ARIKARA, -5008.338f, -2118.894f, 83.657f, 0.874f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); return true; @@ -428,14 +426,14 @@ class go_shrine_of_the_birds : public GameObjectScript public: go_shrine_of_the_birds() : GameObjectScript("go_shrine_of_the_birds") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { uint32 BirdEntry = 0; float fX, fY, fZ; - pGO->GetClosePoint(fX, fY, fZ, pGO->GetObjectSize(), INTERACTION_DISTANCE); + go->GetClosePoint(fX, fY, fZ, go->GetObjectSize(), INTERACTION_DISTANCE); - switch (pGO->GetEntry()) + switch (go->GetEntry()) { case GO_SHRINE_HAWK: BirdEntry = NPC_HAWK_GUARD; @@ -449,7 +447,7 @@ public: } if (BirdEntry) - player->SummonCreature(BirdEntry, fX, fY, fZ, pGO->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + player->SummonCreature(BirdEntry, fX, fY, fZ, go->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); return false; } @@ -471,7 +469,7 @@ class go_southfury_moonstone : public GameObjectScript public: go_southfury_moonstone() : GameObjectScript("go_southfury_moonstone") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { //implicitTarget=48 not implemented as of writing this code, and manual summon may be just ok for our purpose //player->CastSpell(player, SPELL_SUMMON_RIZZLE, false); @@ -499,7 +497,7 @@ class go_tele_to_dalaran_crystal : public GameObjectScript public: go_tele_to_dalaran_crystal() : GameObjectScript("go_tele_to_dalaran_crystal") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->GetQuestRewardStatus(QUEST_TELE_CRYSTAL_FLAG)) { @@ -521,7 +519,7 @@ class go_tele_to_violet_stand : public GameObjectScript public: go_tele_to_violet_stand() : GameObjectScript("go_tele_to_violet_stand") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->GetQuestRewardStatus(QUEST_LEARN_LEAVE_RETURN) || player->GetQuestStatus(QUEST_LEARN_LEAVE_RETURN) == QUEST_STATUS_INCOMPLETE) return false; @@ -551,20 +549,20 @@ class go_fel_crystalforge : public GameObjectScript public: go_fel_crystalforge() : GameObjectScript("go_fel_crystalforge") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - if (pGO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) /* != GAMEOBJECT_TYPE_QUESTGIVER) */ - player->PrepareQuestMenu(pGO->GetGUID()); /* return true*/ + if (go->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) /* != GAMEOBJECT_TYPE_QUESTGIVER) */ + player->PrepareQuestMenu(go->GetGUID()); /* return true*/ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_TEXT, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_TEXT, go->GetGUID()); return true; } - bool OnGossipSelect(Player* player, GameObject* pGO, uint32 /*sender*/, uint32 action) + bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); switch (action) @@ -572,17 +570,17 @@ public: case GOSSIP_ACTION_INFO_DEF: player->CastSpell(player, SPELL_CREATE_1_FLASK_OF_BEAST, false); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_RETURN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_ITEM_TEXT_RETURN, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_ITEM_TEXT_RETURN, go->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 1: player->CastSpell(player, SPELL_CREATE_5_FLASK_OF_BEAST, false); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_RETURN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_ITEM_TEXT_RETURN, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_ITEM_TEXT_RETURN, go->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_TEXT, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_TEXT, go->GetGUID()); break; } return true; @@ -610,20 +608,20 @@ class go_bashir_crystalforge : public GameObjectScript public: go_bashir_crystalforge() : GameObjectScript("go_bashir_crystalforge") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - if (pGO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) /* != GAMEOBJECT_TYPE_QUESTGIVER) */ - player->PrepareQuestMenu(pGO->GetGUID()); /* return true*/ + if (go->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) /* != GAMEOBJECT_TYPE_QUESTGIVER) */ + player->PrepareQuestMenu(go->GetGUID()); /* return true*/ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_TEXT, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_TEXT, go->GetGUID()); return true; } - bool OnGossipSelect(Player* player, GameObject* pGO, uint32 /*sender*/, uint32 action) + bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); switch (action) @@ -631,17 +629,17 @@ public: case GOSSIP_ACTION_INFO_DEF: player->CastSpell(player, SPELL_CREATE_1_FLASK_OF_SORCERER, false); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_RETURN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_ITEM_TEXT_RETURN, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_ITEM_TEXT_RETURN, go->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 1: player->CastSpell(player, SPELL_CREATE_5_FLASK_OF_SORCERER, false); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_RETURN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_ITEM_TEXT_RETURN, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_ITEM_TEXT_RETURN, go->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_TEXT, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_TEXT, go->GetGUID()); break; } return true; @@ -674,9 +672,9 @@ class go_matrix_punchograph : public GameObjectScript public: go_matrix_punchograph() : GameObjectScript("go_matrix_punchograph") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - switch (pGO->GetEntry()) + switch (go->GetEntry()) { case MATRIX_PUNCHOGRAPH_3005_A: if (player->HasItemCount(ITEM_WHITE_PUNCH_CARD, 1)) @@ -727,11 +725,11 @@ class go_scourge_cage : public GameObjectScript public: go_scourge_cage() : GameObjectScript("go_scourge_cage") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - if (Creature* pNearestPrisoner = pGO->FindNearestCreature(NPC_SCOURGE_PRISONER, 5.0f, true)) + if (Creature* pNearestPrisoner = go->FindNearestCreature(NPC_SCOURGE_PRISONER, 5.0f, true)) { - pGO->SetGoState(GO_STATE_ACTIVE); + go->SetGoState(GO_STATE_ACTIVE); player->KilledMonsterCredit(NPC_SCOURGE_PRISONER, pNearestPrisoner->GetGUID()); pNearestPrisoner->DisappearAndDie(); } @@ -755,15 +753,15 @@ class go_arcane_prison : public GameObjectScript public: go_arcane_prison() : GameObjectScript("go_arcane_prison") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { if (player->GetQuestStatus(QUEST_PRISON_BREAK) == QUEST_STATUS_INCOMPLETE) { - pGO->SummonCreature(25318, 3485.089844f, 6115.7422188f, 70.966812f, 0, TEMPSUMMON_TIMED_DESPAWN, 60000); + go->SummonCreature(25318, 3485.089844f, 6115.7422188f, 70.966812f, 0, TEMPSUMMON_TIMED_DESPAWN, 60000); player->CastSpell(player, SPELL_ARCANE_PRISONER_KILL_CREDIT, true); return true; - } else - return false; + } + return false; } }; @@ -778,9 +776,9 @@ class go_blood_filled_orb : public GameObjectScript public: go_blood_filled_orb() : GameObjectScript("go_blood_filled_orb") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER) + if (go->GetGoType() == GAMEOBJECT_TYPE_GOOBER) player->SummonCreature(NPC_ZELEMAR, -369.746f, 166.759f, -21.50f, 5.235f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); return true; @@ -809,17 +807,17 @@ class go_jotunheim_cage : public GameObjectScript public: go_jotunheim_cage() : GameObjectScript("go_jotunheim_cage") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - Creature* pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_HUMAN, 5.0f, true); + Creature* pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_HUMAN, 5.0f, true); if (!pPrisoner) { - pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_TROLL, 5.0f, true); + pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_TROLL, 5.0f, true); if (!pPrisoner) { - pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_ORC, 5.0f, true); + pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_ORC, 5.0f, true); if (!pPrisoner) - pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_NE, 5.0f, true); + pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_NE, 5.0f, true); } } if (!pPrisoner || !pPrisoner->isAlive()) @@ -858,12 +856,12 @@ class go_table_theka : public GameObjectScript public: go_table_theka() : GameObjectScript("go_table_theka") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { if (player->GetQuestStatus(QUEST_SPIDER_GOLD) == QUEST_STATUS_INCOMPLETE) player->AreaExploredOrEventHappens(QUEST_SPIDER_GOLD); - player->SEND_GOSSIP_MENU(GOSSIP_TABLE_THEKA, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_TABLE_THEKA, go->GetGUID()); return true; } @@ -884,7 +882,7 @@ class go_inconspicuous_landmark : public GameObjectScript public: go_inconspicuous_landmark() : GameObjectScript("go_inconspicuous_landmark") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->HasItemCount(ITEM_CUERGOS_KEY, 1)) return false; @@ -910,12 +908,12 @@ class go_ethereal_teleport_pad : public GameObjectScript public: go_ethereal_teleport_pad() : GameObjectScript("go_ethereal_teleport_pad") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { if (!player->HasItemCount(ITEM_TELEPORTER_POWER_PACK, 1)) return false; - pGO->SummonCreature(NPC_IMAGE_WIND_TRADER, pGO->GetPositionX(), pGO->GetPositionY(), pGO->GetPositionZ(), pGO->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); + go->SummonCreature(NPC_IMAGE_WIND_TRADER, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), go->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); return true; } @@ -930,9 +928,9 @@ class go_soulwell : public GameObjectScript public: go_soulwell() : GameObjectScript("go_soulwell") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - Unit* caster = pGO->GetOwner(); + Unit* caster = go->GetOwner(); if (!caster || caster->GetTypeId() != TYPEID_PLAYER) return true; @@ -943,7 +941,7 @@ public: // GO scripting with at least On Create and On Update events, the other options are no less // ugly and hacky. uint32 newSpell = 0; - if (pGO->GetEntry() == 193169) // Soulwell for rank 2 + if (go->GetEntry() == 193169) // Soulwell for rank 2 { if (caster->HasAura(18693)) // Improved Healthstone rank 2 newSpell = 58898; @@ -951,7 +949,7 @@ public: newSpell = 58896; else newSpell = 58890; } - else if (pGO->GetEntry() == 181621) // Soulwell for rank 1 + else if (go->GetEntry() == 181621) // Soulwell for rank 1 { if (caster->HasAura(18693)) // Improved Healthstone rank 2 newSpell = 34150; @@ -960,7 +958,7 @@ public: else newSpell = 34130; } - pGO->AddUse(); + go->AddUse(); player->CastSpell(player, newSpell, true); return true; } @@ -985,20 +983,20 @@ class go_dragonflayer_cage : public GameObjectScript public: go_dragonflayer_cage() : GameObjectScript("go_dragonflayer_cage") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { if (player->GetQuestStatus(QUEST_PRISONERS_OF_WYRMSKULL) != QUEST_STATUS_INCOMPLETE) return true; - Creature* pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_PRIEST, 2.0f); + Creature* pPrisoner = go->FindNearestCreature(NPC_PRISONER_PRIEST, 2.0f); if (!pPrisoner) { - pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_MAGE, 2.0f); + pPrisoner = go->FindNearestCreature(NPC_PRISONER_MAGE, 2.0f); if (!pPrisoner) { - pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_WARRIOR, 2.0f); + pPrisoner = go->FindNearestCreature(NPC_PRISONER_WARRIOR, 2.0f); if (!pPrisoner) - pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_PALADIN, 2.0f); + pPrisoner = go->FindNearestCreature(NPC_PRISONER_PALADIN, 2.0f); } } @@ -1032,14 +1030,14 @@ class go_tadpole_cage : public GameObjectScript public: go_tadpole_cage() : GameObjectScript("go_tadpole_cage") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { if (player->GetQuestStatus(QUEST_OH_NOES_THE_TADPOLES) == QUEST_STATUS_INCOMPLETE) { - Creature* pTadpole = pGO->FindNearestCreature(NPC_WINTERFIN_TADPOLE, 1.0f); + Creature* pTadpole = go->FindNearestCreature(NPC_WINTERFIN_TADPOLE, 1.0f); if (pTadpole) { - pGO->UseDoorOrButton(); + go->UseDoorOrButton(); pTadpole->DisappearAndDie(); player->KilledMonsterCredit(NPC_WINTERFIN_TADPOLE, 0); //FIX: Summon minion tadpole @@ -1073,21 +1071,21 @@ class go_amberpine_outhouse : public GameObjectScript public: go_amberpine_outhouse() : GameObjectScript("go_amberpine_outhouse") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { QuestStatus status = player->GetQuestStatus(QUEST_DOING_YOUR_DUTY); if (status == QUEST_STATUS_INCOMPLETE || status == QUEST_STATUS_COMPLETE || status == QUEST_STATUS_REWARDED) { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_USE_OUTHOUSE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(GOSSIP_OUTHOUSE_VACANT, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_OUTHOUSE_VACANT, go->GetGUID()); return true; } else - player->SEND_GOSSIP_MENU(GOSSIP_OUTHOUSE_INUSE, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_OUTHOUSE_INUSE, go->GetGUID()); return true; } - bool OnGossipSelect(Player* player, GameObject* pGO, uint32 /*sender*/, uint32 action) + bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); if (action == GOSSIP_ACTION_INFO_DEF +1) @@ -1097,11 +1095,11 @@ public: if (target) { target->AI()->SetData(1, player->getGender()); - pGO->CastSpell(target, SPELL_INDISPOSED_III); + go->CastSpell(target, SPELL_INDISPOSED_III); } - pGO->CastSpell(player, SPELL_INDISPOSED); + go->CastSpell(player, SPELL_INDISPOSED); if (player->HasItemCount(ITEM_ANDERHOLS_SLIDER_CIDER, 1)) - pGO->CastSpell(player, SPELL_CREATE_AMBERSEEDS); + go->CastSpell(player, SPELL_CREATE_AMBERSEEDS); return true; } else @@ -1129,11 +1127,11 @@ class go_hive_pod : public GameObjectScript public: go_hive_pod() : GameObjectScript("go_hive_pod") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - player->SendLoot(pGO->GetGUID(), LOOT_CORPSE); - pGO->SummonCreature(NPC_HIVE_AMBUSHER, pGO->GetPositionX()+1, pGO->GetPositionY(), pGO->GetPositionZ(), pGO->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); - pGO->SummonCreature(NPC_HIVE_AMBUSHER, pGO->GetPositionX(), pGO->GetPositionY()+1, pGO->GetPositionZ(), pGO->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); + player->SendLoot(go->GetGUID(), LOOT_CORPSE); + go->SummonCreature(NPC_HIVE_AMBUSHER, go->GetPositionX()+1, go->GetPositionY(), go->GetPositionZ(), go->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); + go->SummonCreature(NPC_HIVE_AMBUSHER, go->GetPositionX(), go->GetPositionY()+1, go->GetPositionZ(), go->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); return true; } }; From a3d7caba8a9e852e5b53286b77505823486f86e6 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 16 Mar 2012 12:34:37 +0100 Subject: [PATCH 0187/1149] Core/Opcodes: Defined a new opcode --- src/server/game/Server/Protocol/Opcodes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 775b832d79a..ab6ba7e7796 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1344,7 +1344,7 @@ enum Opcodes CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND = 0x51B, SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT1 = 0x51C, SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2 = 0x51D, - SMSG_COMPRESSED_UNKNOWN_1310 = 0x51E, // some compressed packet? + SMSG_MULTIPLE_MOVES = 0x51E, // uncompressed version of SMSG_COMPRESSED_MOVES NUM_MSG_TYPES = 0x51F }; From ddc0f5d7d609e15ec39a3190a319e6b9dc18bec0 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Fri, 16 Mar 2012 19:35:13 +0800 Subject: [PATCH 0188/1149] Core/Script: Clean-Up in Scripts. InstanceScript* m_instance -> InstanceScript* instance Signed-off-by: Gyx <2359980687@qq.com> --- .../EasternKingdoms/ZulGurub/boss_arlokk.cpp | 18 +- .../EasternKingdoms/ZulGurub/boss_hakkar.cpp | 24 +- .../EasternKingdoms/ZulGurub/boss_jeklik.cpp | 16 +- .../ZulGurub/boss_mandokir.cpp | 20 +- .../EasternKingdoms/ZulGurub/boss_marli.cpp | 8 +- .../EasternKingdoms/ZulGurub/boss_thekal.cpp | 80 +++--- .../Kalimdor/OnyxiasLair/boss_onyxia.cpp | 38 +-- .../boss_anubarak_trial.cpp | 34 +-- .../boss_faction_champions.cpp | 38 +-- .../TrialOfTheCrusader/boss_lord_jaraxxus.cpp | 52 ++-- .../boss_northrend_beasts.cpp | 68 ++--- .../TrialOfTheCrusader/boss_twin_valkyr.cpp | 58 ++-- .../trial_of_the_crusader.cpp | 272 +++++++++--------- .../HallsOfLightning/boss_bjarngrim.cpp | 28 +- .../Ulduar/HallsOfLightning/boss_loken.cpp | 20 +- .../Ulduar/HallsOfLightning/boss_volkhan.cpp | 16 +- .../UtgardePinnacle/boss_skadi.cpp | 26 +- .../boss_ambassador_hellmaw.cpp | 26 +- .../Outland/TempestKeep/Eye/boss_kaelthas.cpp | 66 ++--- 19 files changed, 454 insertions(+), 454 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp index 737a8fade57..4ba0c187973 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp @@ -61,10 +61,10 @@ class boss_arlokk : public CreatureScript { boss_arlokkAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiShadowWordPain_Timer; uint32 m_uiGouge_Timer; @@ -110,8 +110,8 @@ class boss_arlokk : public CreatureScript void JustReachedHome() { - if (m_instance) - m_instance->SetData(DATA_ARLOKK, NOT_STARTED); + if (instance) + instance->SetData(DATA_ARLOKK, NOT_STARTED); //we should be summoned, so despawn me->DespawnOrUnsummon(); @@ -124,8 +124,8 @@ class boss_arlokk : public CreatureScript me->SetDisplayId(MODEL_ID_NORMAL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - if (m_instance) - m_instance->SetData(DATA_ARLOKK, DONE); + if (instance) + instance->SetData(DATA_ARLOKK, DONE); } void DoSummonPhanters() @@ -271,12 +271,12 @@ class go_gong_of_bethekk : public GameObjectScript bool OnGossipHello(Player* /*player*/, GameObject* go) { - if (InstanceScript* m_instance = go->GetInstanceScript()) + if (InstanceScript* instance = go->GetInstanceScript()) { - if (m_instance->GetData(DATA_ARLOKK) == DONE || m_instance->GetData(DATA_ARLOKK) == IN_PROGRESS) + if (instance->GetData(DATA_ARLOKK) == DONE || instance->GetData(DATA_ARLOKK) == IN_PROGRESS) return true; - m_instance->SetData(DATA_ARLOKK, IN_PROGRESS); + instance->SetData(DATA_ARLOKK, IN_PROGRESS); return true; } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp index b3dcfb5112b..9edd82c39b0 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp @@ -57,10 +57,10 @@ class boss_hakkar : public CreatureScript { boss_hakkarAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 BloodSiphon_Timer; uint32 CorruptedBlood_Timer; @@ -156,9 +156,9 @@ class boss_hakkar : public CreatureScript //Checking if Jeklik is dead. If not we cast her Aspect if (CheckJeklik_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_JEKLIK) != DONE) + if (instance->GetData(DATA_JEKLIK) != DONE) { if (AspectOfJeklik_Timer <= diff) { @@ -173,9 +173,9 @@ class boss_hakkar : public CreatureScript //Checking if Venoxis is dead. If not we cast his Aspect if (CheckVenoxis_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_VENOXIS) != DONE) + if (instance->GetData(DATA_VENOXIS) != DONE) { if (AspectOfVenoxis_Timer <= diff) { @@ -190,9 +190,9 @@ class boss_hakkar : public CreatureScript //Checking if Marli is dead. If not we cast her Aspect if (CheckMarli_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_MARLI) != DONE) + if (instance->GetData(DATA_MARLI) != DONE) { if (AspectOfMarli_Timer <= diff) { @@ -208,9 +208,9 @@ class boss_hakkar : public CreatureScript //Checking if Thekal is dead. If not we cast his Aspect if (CheckThekal_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_THEKAL) != DONE) + if (instance->GetData(DATA_THEKAL) != DONE) { if (AspectOfThekal_Timer <= diff) { @@ -225,9 +225,9 @@ class boss_hakkar : public CreatureScript //Checking if Arlokk is dead. If yes we cast her Aspect if (CheckArlokk_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_ARLOKK) != DONE) + if (instance->GetData(DATA_ARLOKK) != DONE) { if (AspectOfArlokk_Timer <= diff) { diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp index 15933e3ed4d..638e2675496 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp @@ -56,10 +56,10 @@ class boss_jeklik : public CreatureScript { boss_jeklikAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 Charge_Timer; uint32 SonicBurst_Timer; @@ -98,8 +98,8 @@ class boss_jeklik : public CreatureScript { DoScriptText(SAY_DEATH, me); - if (m_instance) - m_instance->SetData(DATA_JEKLIK, DONE); + if (instance) + instance->SetData(DATA_JEKLIK, DONE); } void UpdateAI(const uint32 diff) @@ -238,10 +238,10 @@ class mob_batrider : public CreatureScript { mob_batriderAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 Bomb_Timer; uint32 Check_Timer; @@ -274,9 +274,9 @@ class mob_batrider : public CreatureScript //Check_Timer if (Check_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_JEKLIK) == DONE) + if (instance->GetData(DATA_JEKLIK) == DONE) { me->setDeathState(JUST_DIED); me->RemoveCorpse(); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 6b8d4b11439..0ef5c7ac74d 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -57,7 +57,7 @@ class boss_mandokir : public CreatureScript { boss_mandokirAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 KillCount; @@ -72,7 +72,7 @@ class boss_mandokir : public CreatureScript float targetY; float targetZ; - InstanceScript* m_instance; + InstanceScript* instance; bool endWatch; bool someWatched; @@ -116,9 +116,9 @@ class boss_mandokir : public CreatureScript { DoScriptText(SAY_DING_KILL, me); - if (m_instance) + if (instance) { - uint64 JindoGUID = m_instance->GetData64(DATA_JINDO); + uint64 JindoGUID = instance->GetData64(DATA_JINDO); if (JindoGUID) { if (Unit* jTemp = Unit::GetUnit(*me, JindoGUID)) @@ -256,9 +256,9 @@ class boss_mandokir : public CreatureScript //Checking if Ohgan is dead. If yes Mandokir will enrage. if (Check_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_OHGAN) == DONE) + if (instance->GetData(DATA_OHGAN) == DONE) { if (!RaptorDead) { @@ -296,11 +296,11 @@ class mob_ohgan : public CreatureScript { mob_ohganAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 SunderArmor_Timer; - InstanceScript* m_instance; + InstanceScript* instance; void Reset() { @@ -311,8 +311,8 @@ class mob_ohgan : public CreatureScript void JustDied(Unit* /*Killer*/) { - if (m_instance) - m_instance->SetData(DATA_OHGAN, DONE); + if (instance) + instance->SetData(DATA_OHGAN, DONE); } void UpdateAI (const uint32 diff) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp index 2016fe4cb5d..b5149701d1e 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp @@ -53,10 +53,10 @@ class boss_marli : public CreatureScript { boss_marliAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 SpawnStartSpiders_Timer; uint32 PoisonVolley_Timer; @@ -91,8 +91,8 @@ class boss_marli : public CreatureScript void JustDied(Unit* /*Killer*/) { DoScriptText(SAY_DEATH, me); - if (m_instance) - m_instance->SetData(DATA_MARLI, DONE); + if (instance) + instance->SetData(DATA_MARLI, DONE); } void UpdateAI(const uint32 diff) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index a58c66c8584..0504d791a26 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -68,7 +68,7 @@ class boss_thekal : public CreatureScript { boss_thekalAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 MortalCleave_Timer; @@ -81,7 +81,7 @@ class boss_thekal : public CreatureScript uint32 Check_Timer; uint32 Resurrect_Timer; - InstanceScript* m_instance; + InstanceScript* instance; bool Enraged; bool PhaseTwo; bool WasDead; @@ -111,14 +111,14 @@ class boss_thekal : public CreatureScript void JustDied(Unit* /*Killer*/) { DoScriptText(SAY_DEATH, me); - if (m_instance) - m_instance->SetData(DATA_THEKAL, DONE); + if (instance) + instance->SetData(DATA_THEKAL, DONE); } void JustReachedHome() { - if (m_instance) - m_instance->SetData(DATA_THEKAL, NOT_STARTED); + if (instance) + instance->SetData(DATA_THEKAL, NOT_STARTED); } void UpdateAI(const uint32 diff) @@ -129,26 +129,26 @@ class boss_thekal : public CreatureScript //Check_Timer for the death of LorKhan and Zath. if (!WasDead && Check_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_LORKHAN) == SPECIAL) + if (instance->GetData(DATA_LORKHAN) == SPECIAL) { //Resurrect LorKhan - if (Unit* pLorKhan = Unit::GetUnit((*me), m_instance->GetData64(DATA_LORKHAN))) + if (Unit* pLorKhan = Unit::GetUnit((*me), instance->GetData64(DATA_LORKHAN))) { pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pLorKhan->setFaction(14); pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); pLorKhan->SetFullHealth(); - m_instance->SetData(DATA_LORKHAN, DONE); + instance->SetData(DATA_LORKHAN, DONE); } } - if (m_instance->GetData(DATA_ZATH) == SPECIAL) + if (instance->GetData(DATA_ZATH) == SPECIAL) { //Resurrect Zath - Unit* pZath = Unit::GetUnit((*me), m_instance->GetData64(DATA_ZATH)); + Unit* pZath = Unit::GetUnit((*me), instance->GetData64(DATA_ZATH)); if (pZath) { pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); @@ -156,7 +156,7 @@ class boss_thekal : public CreatureScript pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); pZath->SetFullHealth(); - m_instance->SetData(DATA_ZATH, DONE); + instance->SetData(DATA_ZATH, DONE); } } } @@ -185,8 +185,8 @@ class boss_thekal : public CreatureScript me->SetStandState(UNIT_STAND_STATE_SLEEP); me->AttackStop(); - if (m_instance) - m_instance->SetData(DATA_THEKAL, SPECIAL); + if (instance) + instance->SetData(DATA_THEKAL, SPECIAL); WasDead=true; } @@ -279,7 +279,7 @@ class mob_zealot_lorkhan : public CreatureScript { mob_zealot_lorkhanAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 Shield_Timer; @@ -290,7 +290,7 @@ class mob_zealot_lorkhan : public CreatureScript bool FakeDeath; - InstanceScript* m_instance; + InstanceScript* instance; void Reset() { @@ -302,8 +302,8 @@ class mob_zealot_lorkhan : public CreatureScript FakeDeath = false; - if (m_instance) - m_instance->SetData(DATA_LORKHAN, NOT_STARTED); + if (instance) + instance->SetData(DATA_LORKHAN, NOT_STARTED); me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -335,10 +335,10 @@ class mob_zealot_lorkhan : public CreatureScript //Casting Greaterheal to Thekal or Zath if they are in meele range. if (GreaterHeal_Timer <= diff) { - if (m_instance) + if (instance) { - Unit* pThekal = Unit::GetUnit((*me), m_instance->GetData64(DATA_THEKAL)); - Unit* pZath = Unit::GetUnit((*me), m_instance->GetData64(DATA_ZATH)); + Unit* pThekal = Unit::GetUnit((*me), instance->GetData64(DATA_THEKAL)); + Unit* pZath = Unit::GetUnit((*me), instance->GetData64(DATA_ZATH)); if (!pThekal || !pZath) return; @@ -369,12 +369,12 @@ class mob_zealot_lorkhan : public CreatureScript //Check_Timer for the death of LorKhan and Zath. if (!FakeDeath && Check_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_THEKAL) == SPECIAL) + if (instance->GetData(DATA_THEKAL) == SPECIAL) { //Resurrect Thekal - if (Unit* pThekal = Unit::GetUnit((*me), m_instance->GetData64(DATA_THEKAL))) + if (Unit* pThekal = Unit::GetUnit((*me), instance->GetData64(DATA_THEKAL))) { pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -383,10 +383,10 @@ class mob_zealot_lorkhan : public CreatureScript } } - if (m_instance->GetData(DATA_ZATH) == SPECIAL) + if (instance->GetData(DATA_ZATH) == SPECIAL) { //Resurrect Zath - if (Unit* pZath = Unit::GetUnit((*me), m_instance->GetData64(DATA_ZATH))) + if (Unit* pZath = Unit::GetUnit((*me), instance->GetData64(DATA_ZATH))) { pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -409,8 +409,8 @@ class mob_zealot_lorkhan : public CreatureScript me->setFaction(35); me->AttackStop(); - if (m_instance) - m_instance->SetData(DATA_LORKHAN, SPECIAL); + if (instance) + instance->SetData(DATA_LORKHAN, SPECIAL); FakeDeath = true; } @@ -439,7 +439,7 @@ class mob_zealot_zath : public CreatureScript { mob_zealot_zathAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 SweepingStrikes_Timer; @@ -451,7 +451,7 @@ class mob_zealot_zath : public CreatureScript bool FakeDeath; - InstanceScript* m_instance; + InstanceScript* instance; void Reset() { @@ -464,8 +464,8 @@ class mob_zealot_zath : public CreatureScript FakeDeath = false; - if (m_instance) - m_instance->SetData(DATA_ZATH, NOT_STARTED); + if (instance) + instance->SetData(DATA_ZATH, NOT_STARTED); me->SetStandState(UNIT_STAND_STATE_STAND); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -522,12 +522,12 @@ class mob_zealot_zath : public CreatureScript //Check_Timer for the death of LorKhan and Zath. if (!FakeDeath && Check_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_LORKHAN) == SPECIAL) + if (instance->GetData(DATA_LORKHAN) == SPECIAL) { //Resurrect LorKhan - if (Unit* pLorKhan = Unit::GetUnit((*me), m_instance->GetData64(DATA_LORKHAN))) + if (Unit* pLorKhan = Unit::GetUnit((*me), instance->GetData64(DATA_LORKHAN))) { pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -536,10 +536,10 @@ class mob_zealot_zath : public CreatureScript } } - if (m_instance->GetData(DATA_THEKAL) == SPECIAL) + if (instance->GetData(DATA_THEKAL) == SPECIAL) { //Resurrect Thekal - if (Unit* pThekal = Unit::GetUnit((*me), m_instance->GetData64(DATA_THEKAL))) + if (Unit* pThekal = Unit::GetUnit((*me), instance->GetData64(DATA_THEKAL))) { pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -562,8 +562,8 @@ class mob_zealot_zath : public CreatureScript me->setFaction(35); me->AttackStop(); - if (m_instance) - m_instance->SetData(DATA_ZATH, SPECIAL); + if (instance) + instance->SetData(DATA_ZATH, SPECIAL); FakeDeath = true; } diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index 3b3dfae92b2..6e6e089ba02 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -114,11 +114,11 @@ public: { boss_onyxiaAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); Reset(); } - InstanceScript* m_instance; + InstanceScript* instance; SummonList Summons; uint32 m_uiPhase; @@ -169,11 +169,11 @@ public: m_uiSummonWhelpCount = 0; m_bIsMoving = false; - if (m_instance) + if (instance) { - m_instance->SetData(DATA_ONYXIA, NOT_STARTED); - m_instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase); - m_instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); + instance->SetData(DATA_ONYXIA, NOT_STARTED); + instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase); + instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } } @@ -182,17 +182,17 @@ public: DoScriptText(SAY_AGGRO, me); me->SetInCombatWithZone(); - if (m_instance) + if (instance) { - m_instance->SetData(DATA_ONYXIA, IN_PROGRESS); - m_instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); + instance->SetData(DATA_ONYXIA, IN_PROGRESS); + instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } } void JustDied(Unit* /*killer*/) { - if (m_instance) - m_instance->SetData(DATA_ONYXIA, DONE); + if (instance) + instance->SetData(DATA_ONYXIA, DONE); Summons.DespawnAll(); } @@ -265,8 +265,8 @@ public: me->GetMotionMaster()->MovePoint(11, Phase2Location.GetPositionX(), Phase2Location.GetPositionY(), Phase2Location.GetPositionZ()+25); me->SetSpeed(MOVE_FLIGHT, 1.0f); DoScriptText(SAY_PHASE_2_TRANS, me); - if (m_instance) - m_instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase); + if (instance) + instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase); m_uiWhelpTimer = 5000; m_uiLairGuardTimer = 15000; break; @@ -301,9 +301,9 @@ public: (pSpell->Id >= 22267 && pSpell->Id <= 22268)) && (target->GetTypeId() == TYPEID_PLAYER)) { - if (m_instance) + if (instance) { - m_instance->SetData(DATA_SHE_DEEP_BREATH_MORE, FAIL); + instance->SetData(DATA_SHE_DEEP_BREATH_MORE, FAIL); } } } @@ -362,8 +362,8 @@ public: Trinity::GameObjectInRangeCheck check(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 15); Trinity::GameObjectLastSearcher searcher(me, pFloor, check); me->VisitNearbyGridObject(30, searcher); - if (m_instance && pFloor) - m_instance->SetData64(DATA_FLOOR_ERUPTION_GUID, pFloor->GetGUID()); + if (instance && pFloor) + instance->SetData64(DATA_FLOOR_ERUPTION_GUID, pFloor->GetGUID()); m_uiBellowingRoarTimer = 30000; } else @@ -409,8 +409,8 @@ public: if (HealthBelowPct(40)) { m_uiPhase = PHASE_END; - if (m_instance) - m_instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase); + if (instance) + instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase); DoScriptText(SAY_PHASE_3_TRANS, me); SetCombatMovement(true); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index b64e324d4da..940191f68cb 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -141,10 +141,10 @@ public: { boss_anubarak_trialAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; SummonList Summons; std::list m_vBurrowGUID; @@ -195,8 +195,8 @@ public: if (who->GetTypeId() == TYPEID_PLAYER) { DoScriptText(urand(0, 1) ? SAY_KILL1 : SAY_KILL2, me); - if (m_instance) - m_instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0); + if (instance) + instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0); } } @@ -211,8 +211,8 @@ public: void JustReachedHome() { - if (m_instance) - m_instance->SetData(TYPE_ANUBARAK, FAIL); + if (instance) + instance->SetData(TYPE_ANUBARAK, FAIL); //Summon Scarab Swarms neutral at random places for (int i=0; i < 10; i++) if (Creature* temp = me->SummonCreature(NPC_SCARAB, AnubarakLoc[1].GetPositionX()+urand(0, 50)-25, AnubarakLoc[1].GetPositionY()+urand(0, 50)-25, AnubarakLoc[1].GetPositionZ())) @@ -223,8 +223,8 @@ public: { Summons.DespawnAll(); DoScriptText(SAY_DEATH, me); - if (m_instance) - m_instance->SetData(TYPE_ANUBARAK, DONE); + if (instance) + instance->SetData(TYPE_ANUBARAK, DONE); } void JustSummoned(Creature* summoned) @@ -260,8 +260,8 @@ public: DoScriptText(SAY_AGGRO, me); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->SetInCombatWithZone(); - if (m_instance) - m_instance->SetData(TYPE_ANUBARAK, IN_PROGRESS); + if (instance) + instance->SetData(TYPE_ANUBARAK, IN_PROGRESS); //Despawn Scarab Swarms neutral Summons.DoAction(NPC_SCARAB, ACTION_SCARAB_SUBMERGE); //Spawn Burrow @@ -426,10 +426,10 @@ public: { mob_swarm_scarabAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiDeterminationTimer; @@ -493,10 +493,10 @@ public: { mob_nerubian_burrowerAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiSpiderFrenzyTimer; uint32 m_uiSubmergeTimer; @@ -639,10 +639,10 @@ public: { mob_anubarak_spikeAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiIncreaseSpeedTimer; uint8 m_uiSpeed; uint64 m_uiTargetGUID; @@ -674,7 +674,7 @@ public: Unit* target = Unit::GetPlayer(*me, m_uiTargetGUID); if (!target || !target->isAlive() || !target->HasAura(SPELL_MARK)) { - if (Creature* pAnubarak = Unit::GetCreature((*me), m_instance->GetData64(NPC_ANUBARAK))) + if (Creature* pAnubarak = Unit::GetCreature((*me), instance->GetData64(NPC_ANUBARAK))) pAnubarak->CastSpell(pAnubarak, SPELL_SPIKE_TELE, false); me->DisappearAndDie(); return; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp index 2fe0bd3f397..9838f20772c 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp @@ -64,10 +64,10 @@ public: { boss_toc_champion_controllerAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - m_instance = (InstanceScript*) creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; SummonList Summons; uint32 m_uiChampionsNotStarted; uint32 m_uiChampionsFailed; @@ -101,7 +101,7 @@ public: vOtherEntries.push_back(playerTeam == ALLIANCE ? NPC_HORDE_WARRIOR : NPC_ALLIANCE_WARRIOR); uint8 healersSubtracted = 2; - if (m_instance->instance->GetSpawnMode() == RAID_DIFFICULTY_25MAN_NORMAL || m_instance->instance->GetSpawnMode() == RAID_DIFFICULTY_25MAN_HEROIC) + if (instance->instance->GetSpawnMode() == RAID_DIFFICULTY_25MAN_NORMAL || instance->instance->GetSpawnMode() == RAID_DIFFICULTY_25MAN_HEROIC) healersSubtracted = 1; for (uint8 i = 0; i < healersSubtracted; ++i) { @@ -136,7 +136,7 @@ public: vHealersEntries.erase(vHealersEntries.begin()+pos); } - if (m_instance->instance->GetSpawnMode() == RAID_DIFFICULTY_10MAN_NORMAL || m_instance->instance->GetSpawnMode() == RAID_DIFFICULTY_10MAN_HEROIC) + if (instance->instance->GetSpawnMode() == RAID_DIFFICULTY_10MAN_NORMAL || instance->instance->GetSpawnMode() == RAID_DIFFICULTY_10MAN_HEROIC) for (uint8 i = 0; i < 4; ++i) vOtherEntries.erase(vOtherEntries.begin()+urand(0, vOtherEntries.size()-1)); @@ -214,7 +214,7 @@ public: m_uiChampionsFailed++; if (m_uiChampionsFailed + m_uiChampionsKilled >= Summons.size()) { - m_instance->SetData(TYPE_CRUSADERS, FAIL); + instance->SetData(TYPE_CRUSADERS, FAIL); Summons.DespawnAll(); me->DespawnOrUnsummon(); } @@ -227,16 +227,16 @@ public: m_uiChampionsKilled = 0; m_bInProgress = true; Summons.DoZoneInCombat(); - m_instance->SetData(TYPE_CRUSADERS, IN_PROGRESS); + instance->SetData(TYPE_CRUSADERS, IN_PROGRESS); } break; case DONE: m_uiChampionsKilled++; if (m_uiChampionsKilled == 1) - m_instance->SetData(TYPE_CRUSADERS, SPECIAL); + instance->SetData(TYPE_CRUSADERS, SPECIAL); else if (m_uiChampionsKilled >= Summons.size()) { - m_instance->SetData(TYPE_CRUSADERS, DONE); + instance->SetData(TYPE_CRUSADERS, DONE); Summons.DespawnAll(); me->DespawnOrUnsummon(); } @@ -253,11 +253,11 @@ struct boss_faction_championsAI : public ScriptedAI { boss_faction_championsAI(Creature* creature, uint32 aitype) : ScriptedAI(creature) { - m_instance = (InstanceScript*) creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); mAIType = aitype; } - InstanceScript* m_instance; + InstanceScript* instance; uint64 championControllerGUID; uint32 mAIType; @@ -273,8 +273,8 @@ struct boss_faction_championsAI : public ScriptedAI void JustReachedHome() { - if (m_instance) - if (Creature* pChampionController = Unit::GetCreature((*me), m_instance->GetData64(NPC_CHAMPIONS_CONTROLLER))) + if (instance) + if (Creature* pChampionController = Unit::GetCreature((*me), instance->GetData64(NPC_CHAMPIONS_CONTROLLER))) pChampionController->AI()->SetData(2, FAIL); me->DespawnOrUnsummon(); } @@ -326,8 +326,8 @@ struct boss_faction_championsAI : public ScriptedAI void JustDied(Unit* /*killer*/) { if (mAIType != AI_PET) - if (m_instance) - if (Creature* pChampionController = Unit::GetCreature((*me), m_instance->GetData64(NPC_CHAMPIONS_CONTROLLER))) + if (instance) + if (Creature* pChampionController = Unit::GetCreature((*me), instance->GetData64(NPC_CHAMPIONS_CONTROLLER))) pChampionController->AI()->SetData(2, DONE); } @@ -335,8 +335,8 @@ struct boss_faction_championsAI : public ScriptedAI { DoCast(me, SPELL_ANTI_AOE, true); me->SetInCombatWithZone(); - if (m_instance) - if (Creature* pChampionController = Unit::GetCreature((*me), m_instance->GetData64(NPC_CHAMPIONS_CONTROLLER))) + if (instance) + if (Creature* pChampionController = Unit::GetCreature((*me), instance->GetData64(NPC_CHAMPIONS_CONTROLLER))) pChampionController->AI()->SetData(2, IN_PROGRESS); } @@ -351,18 +351,18 @@ struct boss_faction_championsAI : public ScriptedAI if (Player* player = players.begin()->getSource()) TeamInInstance = player->GetTeam(); - if (m_instance) + if (instance) { if (TeamInInstance == ALLIANCE) { - if (Creature* temp = Unit::GetCreature(*me, m_instance->GetData64(NPC_VARIAN))) + if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_VARIAN))) DoScriptText(SAY_VARIAN_KILL_HORDE_PLAYER4+urand(0, 3), temp); // + cause we are on negative } else if (Creature* temp = me->FindNearestCreature(NPC_GARROSH, 300.f)) DoScriptText(SAY_GARROSH_KILL_ALLIANCE_PLAYER4+urand(0, 3), temp); // + cause we are on negative - m_instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0); + instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0); } } } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index 6cd049967c1..a7328b43826 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -106,11 +106,11 @@ public: { boss_jaraxxusAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); Reset(); } - InstanceScript* m_instance; + InstanceScript* instance; SummonList Summons; @@ -124,8 +124,8 @@ public: void Reset() { - if (m_instance) - m_instance->SetData(TYPE_JARAXXUS, NOT_STARTED); + if (instance) + instance->SetData(TYPE_JARAXXUS, NOT_STARTED); SetEquipmentSlots(false, EQUIP_MAIN, EQUIP_OFFHAND, EQUIP_RANGED); m_uiFelFireballTimer = 5*IN_MILLISECONDS; m_uiFelLightningTimer = urand(10*IN_MILLISECONDS, 15*IN_MILLISECONDS); @@ -139,8 +139,8 @@ public: void JustReachedHome() { - if (m_instance) - m_instance->SetData(TYPE_JARAXXUS, FAIL); + if (instance) + instance->SetData(TYPE_JARAXXUS, FAIL); DoCast(me, SPELL_JARAXXUS_CHAINS); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetReactState(REACT_PASSIVE); @@ -150,8 +150,8 @@ public: { if (who->GetTypeId() == TYPEID_PLAYER) { - if (m_instance) - m_instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0); + if (instance) + instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0); } } @@ -159,8 +159,8 @@ public: { Summons.DespawnAll(); DoScriptText(SAY_DEATH, me); - if (m_instance) - m_instance->SetData(TYPE_JARAXXUS, DONE); + if (instance) + instance->SetData(TYPE_JARAXXUS, DONE); } void JustSummoned(Creature* summoned) @@ -171,8 +171,8 @@ public: void EnterCombat(Unit* /*who*/) { me->SetInCombatWithZone(); - if (m_instance) - m_instance->SetData(TYPE_JARAXXUS, IN_PROGRESS); + if (instance) + instance->SetData(TYPE_JARAXXUS, IN_PROGRESS); DoScriptText(SAY_AGGRO, me); } @@ -289,11 +289,11 @@ public: { mob_infernal_volcanoAI(Creature* creature) : Scripted_NoMovementAI(creature), Summons(me) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); Reset(); } - InstanceScript* m_instance; + InstanceScript* instance; SummonList Summons; @@ -344,11 +344,11 @@ public: { mob_fel_infernalAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); Reset(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiFelStreakTimer; void Reset() @@ -368,7 +368,7 @@ public: if (!UpdateVictim()) return; - if (m_instance && m_instance->GetData(TYPE_JARAXXUS) != IN_PROGRESS) + if (instance && instance->GetData(TYPE_JARAXXUS) != IN_PROGRESS) me->DespawnOrUnsummon(); if (m_uiFelStreakTimer <= uiDiff) @@ -398,11 +398,11 @@ public: { mob_nether_portalAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); Reset(); } - InstanceScript* m_instance; + InstanceScript* instance; SummonList Summons; @@ -453,13 +453,13 @@ public: { mob_mistress_of_painAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); - if (m_instance) - m_instance->SetData(DATA_MISTRESS_OF_PAIN_COUNT, INCREASE); + instance = creature->GetInstanceScript(); + if (instance) + instance->SetData(DATA_MISTRESS_OF_PAIN_COUNT, INCREASE); Reset(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiShivanSlashTimer; uint32 m_uiSpinningStrikeTimer; uint32 m_uiMistressKissTimer; @@ -474,13 +474,13 @@ public: void JustDied(Unit* /*killer*/) { - if (m_instance) - m_instance->SetData(DATA_MISTRESS_OF_PAIN_COUNT, DECREASE); + if (instance) + instance->SetData(DATA_MISTRESS_OF_PAIN_COUNT, DECREASE); } void UpdateAI(const uint32 uiDiff) { - if (m_instance && m_instance->GetData(TYPE_JARAXXUS) != IN_PROGRESS) + if (instance && instance->GetData(TYPE_JARAXXUS) != IN_PROGRESS) { me->DespawnOrUnsummon(); return; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index 1eca7edb590..1e5bdff8ee1 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -123,10 +123,10 @@ public: { boss_gormokAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiImpaleTimer; uint32 m_uiStaggeringStompTimer; @@ -151,7 +151,7 @@ public: void EnterEvadeMode() { - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); ScriptedAI::EnterEvadeMode(); } @@ -163,7 +163,7 @@ public: switch (pointId) { case 0: - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_AGGRESSIVE); me->SetInCombatWithZone(); @@ -173,16 +173,16 @@ public: void JustDied(Unit* /*killer*/) { - if (m_instance) - m_instance->SetData(TYPE_NORTHREND_BEASTS, GORMOK_DONE); + if (instance) + instance->SetData(TYPE_NORTHREND_BEASTS, GORMOK_DONE); } void JustReachedHome() { - if (m_instance) + if (instance) { - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); - m_instance->SetData(TYPE_NORTHREND_BEASTS, FAIL); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->SetData(TYPE_NORTHREND_BEASTS, FAIL); } me->DespawnOrUnsummon(); } @@ -190,7 +190,7 @@ public: void EnterCombat(Unit* /*who*/) { me->SetInCombatWithZone(); - m_instance->SetData(TYPE_NORTHREND_BEASTS, GORMOK_IN_PROGRESS); + instance->SetData(TYPE_NORTHREND_BEASTS, GORMOK_IN_PROGRESS); } void JustSummoned(Creature* summon) @@ -263,12 +263,12 @@ public: { mob_snobold_vassalAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); - if (m_instance) - m_instance->SetData(DATA_SNOBOLD_COUNT, INCREASE); + instance = creature->GetInstanceScript(); + if (instance) + instance->SetData(DATA_SNOBOLD_COUNT, INCREASE); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiFireBombTimer; uint32 m_uiBatterTimer; uint32 m_uiHeadCrackTimer; @@ -284,15 +284,15 @@ public: m_uiTargetGUID = 0; m_bTargetDied = false; - if (m_instance) - m_uiBossGUID = m_instance->GetData64(NPC_GORMOK); + if (instance) + m_uiBossGUID = instance->GetData64(NPC_GORMOK); //Workaround for Snobold me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); } void EnterEvadeMode() { - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); ScriptedAI::EnterEvadeMode(); } @@ -328,8 +328,8 @@ public: if (Unit* target = Unit::GetPlayer(*me, m_uiTargetGUID)) if (target->isAlive()) target->RemoveAurasDueToSpell(SPELL_SNOBOLLED); - if (m_instance) - m_instance->SetData(DATA_SNOBOLD_COUNT, DECREASE); + if (instance) + instance->SetData(DATA_SNOBOLD_COUNT, DECREASE); } void UpdateAI(uint32 const diff) @@ -341,9 +341,9 @@ public: { if (!target->isAlive()) { - if (m_instance) + if (instance) { - Unit* gormok = ObjectAccessor::GetCreature(*me, m_instance->GetData64(NPC_GORMOK)); + Unit* gormok = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_GORMOK)); if (gormok && gormok->isAlive()) { SetCombatMovement(false); @@ -757,10 +757,10 @@ public: { boss_icehowlAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiFerociousButtTimer; uint32 m_uiArticBreathTimer; @@ -794,8 +794,8 @@ public: void JustDied(Unit* /*killer*/) { - if (m_instance) - m_instance->SetData(TYPE_NORTHREND_BEASTS, ICEHOWL_DONE); + if (instance) + instance->SetData(TYPE_NORTHREND_BEASTS, ICEHOWL_DONE); } void MovementInform(uint32 type, uint32 pointId) @@ -826,7 +826,7 @@ public: m_bMovementFinish = true; break; case 2: - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_AGGRESSIVE); me->SetInCombatWithZone(); @@ -836,16 +836,16 @@ public: void EnterEvadeMode() { - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); ScriptedAI::EnterEvadeMode(); } void JustReachedHome() { - if (m_instance) + if (instance) { - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); - m_instance->SetData(TYPE_NORTHREND_BEASTS, FAIL); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->SetData(TYPE_NORTHREND_BEASTS, FAIL); } me->DespawnOrUnsummon(); } @@ -854,15 +854,15 @@ public: { if (who->GetTypeId() == TYPEID_PLAYER) { - if (m_instance) - m_instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0); + if (instance) + instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0); } } void EnterCombat(Unit* /*who*/) { - if (m_instance) - m_instance->SetData(TYPE_NORTHREND_BEASTS, ICEHOWL_IN_PROGRESS); + if (instance) + instance->SetData(TYPE_NORTHREND_BEASTS, ICEHOWL_IN_PROGRESS); me->SetInCombatWithZone(); } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index 3e2427d66b3..e61347a5027 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -143,10 +143,10 @@ struct boss_twin_baseAI : public ScriptedAI { boss_twin_baseAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; SummonList Summons; AuraStateType m_uiAuraState; @@ -190,8 +190,8 @@ struct boss_twin_baseAI : public ScriptedAI void JustReachedHome() { - if (m_instance) - m_instance->SetData(TYPE_VALKIRIES, FAIL); + if (instance) + instance->SetData(TYPE_VALKIRIES, FAIL); Summons.DespawnAll(); me->DespawnOrUnsummon(); @@ -204,7 +204,7 @@ struct boss_twin_baseAI : public ScriptedAI switch (uiId) { case 1: - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_AGGRESSIVE); break; @@ -216,8 +216,8 @@ struct boss_twin_baseAI : public ScriptedAI if (who->GetTypeId() == TYPEID_PLAYER) { DoScriptText(urand(0, 1) ? SAY_KILL1 : SAY_KILL2, me); - if (m_instance) - m_instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0); + if (instance) + instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0); } } @@ -231,12 +231,12 @@ struct boss_twin_baseAI : public ScriptedAI switch (summoned->GetEntry()) { case NPC_LIGHT_ESSENCE: - m_instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_LIGHT_ESSENCE_HELPER); - m_instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_POWERING_UP_HELPER); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_LIGHT_ESSENCE_HELPER); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_POWERING_UP_HELPER); break; case NPC_DARK_ESSENCE: - m_instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_DARK_ESSENCE_HELPER); - m_instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_POWERING_UP_HELPER); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_DARK_ESSENCE_HELPER); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_POWERING_UP_HELPER); break; case NPC_BULLET_CONTROLLER: me->m_Events.AddEvent(new OrbsDespawner(me), me->m_Events.CalculateTime(100)); @@ -248,7 +248,7 @@ struct boss_twin_baseAI : public ScriptedAI void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); - if (m_instance) + if (instance) { if (Creature* pSister = GetSister()) { @@ -257,13 +257,13 @@ struct boss_twin_baseAI : public ScriptedAI me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); pSister->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - m_instance->SetData(TYPE_VALKIRIES, DONE); + instance->SetData(TYPE_VALKIRIES, DONE); Summons.DespawnAll(); } else { me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - m_instance->SetData(TYPE_VALKIRIES, SPECIAL); + instance->SetData(TYPE_VALKIRIES, SPECIAL); } } } @@ -273,20 +273,20 @@ struct boss_twin_baseAI : public ScriptedAI // Called when sister pointer needed Creature* GetSister() { - return Unit::GetCreature((*me), m_instance->GetData64(m_uiSisterNpcId)); + return Unit::GetCreature((*me), instance->GetData64(m_uiSisterNpcId)); } void EnterCombat(Unit* /*who*/) { me->SetInCombatWithZone(); - if (m_instance) + if (instance) { if (Creature* pSister = GetSister()) { me->AddAura(m_uiMyEmphatySpellId, pSister); pSister->SetInCombatWithZone(); } - m_instance->SetData(TYPE_VALKIRIES, IN_PROGRESS); + instance->SetData(TYPE_VALKIRIES, IN_PROGRESS); } DoScriptText(SAY_AGGRO, me); @@ -315,7 +315,7 @@ struct boss_twin_baseAI : public ScriptedAI void UpdateAI(const uint32 uiDiff) { - if (!m_instance || !UpdateVictim()) + if (!instance || !UpdateVictim()) return; switch (m_uiStage) @@ -406,10 +406,10 @@ public: { boss_fjolaAI(Creature* creature) : boss_twin_baseAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; void Reset() { boss_twin_baseAI::Reset(); @@ -429,17 +429,17 @@ public: m_uiTouchSpellId = SPELL_LIGHT_TOUCH; m_uiSpikeSpellId = SPELL_LIGHT_TWIN_SPIKE; - if (m_instance) + if (instance) { - m_instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EVENT_START_TWINS_FIGHT); + instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EVENT_START_TWINS_FIGHT); } } void EnterCombat(Unit* who) { - if (m_instance) + if (instance) { - m_instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EVENT_START_TWINS_FIGHT); + instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EVENT_START_TWINS_FIGHT); } me->SummonCreature(NPC_BULLET_CONTROLLER, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 0.0f, TEMPSUMMON_MANUAL_DESPAWN); @@ -448,14 +448,14 @@ public: void EnterEvadeMode() { - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); boss_twin_baseAI::EnterEvadeMode(); } void JustReachedHome() { - if (m_instance) - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + if (instance) + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); boss_twin_baseAI::JustReachedHome(); } @@ -552,10 +552,10 @@ struct mob_unleashed_ballAI : public ScriptedAI { mob_unleashed_ballAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiRangeCheckTimer; void MoveToNextPoint() diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp index 4a4f7dcfc7c..aa1b9e59501 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -106,10 +106,10 @@ class npc_announcer_toc10 : public CreatureScript { npc_announcer_toc10AI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; void Reset() { @@ -239,10 +239,10 @@ class boss_lich_king_toc : public CreatureScript { boss_lich_king_tocAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiUpdateTimer; void Reset() @@ -254,7 +254,7 @@ class boss_lich_king_toc : public CreatureScript summoned->CastSpell(summoned, 51807, false); summoned->SetDisplayId(11686); } - if (m_instance) m_instance->SetData(TYPE_LICH_KING, IN_PROGRESS); + if (instance) instance->SetData(TYPE_LICH_KING, IN_PROGRESS); me->SetWalk(true); } @@ -265,80 +265,80 @@ class boss_lich_king_toc : public CreatureScript switch (uiId) { case 0: - m_instance->SetData(TYPE_EVENT, 5030); + instance->SetData(TYPE_EVENT, 5030); break; case 1: - m_instance->SetData(TYPE_EVENT, 5050); + instance->SetData(TYPE_EVENT, 5050); break; } } void UpdateAI(const uint32 uiDiff) { - if (!m_instance) + if (!instance) return; - if (m_instance->GetData(TYPE_EVENT_NPC) != NPC_LICH_KING_1) + if (instance->GetData(TYPE_EVENT_NPC) != NPC_LICH_KING_1) return; - m_uiUpdateTimer = m_instance->GetData(TYPE_EVENT_TIMER); + m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER); if (m_uiUpdateTimer <= uiDiff) { - switch (m_instance->GetData(TYPE_EVENT)) + switch (instance->GetData(TYPE_EVENT)) { case 5010: DoScriptText(SAY_STAGE_4_02, me); m_uiUpdateTimer = 3000; me->GetMotionMaster()->MovePoint(0, LichKingLoc[0]); - m_instance->SetData(TYPE_EVENT, 5020); + instance->SetData(TYPE_EVENT, 5020); break; case 5030: DoScriptText(SAY_STAGE_4_04, me); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK); m_uiUpdateTimer = 10000; - m_instance->SetData(TYPE_EVENT, 5040); + instance->SetData(TYPE_EVENT, 5040); break; case 5040: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); me->GetMotionMaster()->MovePoint(1, LichKingLoc[1]); m_uiUpdateTimer = 1000; - m_instance->SetData(TYPE_EVENT, 0); + instance->SetData(TYPE_EVENT, 0); break; case 5050: me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 5060); + instance->SetData(TYPE_EVENT, 5060); break; case 5060: DoScriptText(SAY_STAGE_4_05, me); me->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL); m_uiUpdateTimer = 2500; - m_instance->SetData(TYPE_EVENT, 5070); + instance->SetData(TYPE_EVENT, 5070); break; case 5070: me->CastSpell(me, 68198, false); m_uiUpdateTimer = 1500; - m_instance->SetData(TYPE_EVENT, 5080); + instance->SetData(TYPE_EVENT, 5080); break; case 5080: - if (GameObject* go = m_instance->instance->GetGameObject(m_instance->GetData64(GO_ARGENT_COLISEUM_FLOOR))) + if (GameObject* go = instance->instance->GetGameObject(instance->GetData64(GO_ARGENT_COLISEUM_FLOOR))) go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); me->CastSpell(me, 69016, false); - if (m_instance) + if (instance) { - m_instance->SetData(TYPE_LICH_KING, DONE); - Creature* temp = Unit::GetCreature(*me, m_instance->GetData64(NPC_ANUBARAK)); + instance->SetData(TYPE_LICH_KING, DONE); + Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_ANUBARAK)); if (!temp || !temp->isAlive()) temp = me->SummonCreature(NPC_ANUBARAK, AnubarakLoc[0].GetPositionX(), AnubarakLoc[0].GetPositionY(), AnubarakLoc[0].GetPositionZ(), 3, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME); - m_instance->SetData(TYPE_EVENT, 0); + instance->SetData(TYPE_EVENT, 0); } me->DespawnOrUnsummon(); m_uiUpdateTimer = 20000; break; } } else m_uiUpdateTimer -= uiDiff; - m_instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer); + instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer); } }; @@ -358,10 +358,10 @@ class npc_fizzlebang_toc : public CreatureScript { npc_fizzlebang_tocAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - m_instance = (InstanceScript*)me->GetInstanceScript(); + instance = me->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; SummonList Summons; uint32 m_uiUpdateTimer; uint64 m_uiPortalGUID; @@ -370,8 +370,8 @@ class npc_fizzlebang_toc : public CreatureScript void JustDied(Unit* killer) { DoScriptText(SAY_STAGE_1_06, me, killer); - m_instance->SetData(TYPE_EVENT, 1180); - if (Creature* temp = Unit::GetCreature(*me, m_instance->GetData64(NPC_JARAXXUS))) + instance->SetData(TYPE_EVENT, 1180); + if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_JARAXXUS))) { temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); temp->SetReactState(REACT_AGGRESSIVE); @@ -394,11 +394,11 @@ class npc_fizzlebang_toc : public CreatureScript { case 1: me->SetWalk(false); - if (m_instance) + if (instance) { - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); - m_instance->SetData(TYPE_EVENT, 1120); - m_instance->SetData(TYPE_EVENT_TIMER, 1000); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->SetData(TYPE_EVENT, 1120); + instance->SetData(TYPE_EVENT_TIMER, 1000); } break; } @@ -411,22 +411,22 @@ class npc_fizzlebang_toc : public CreatureScript void UpdateAI(const uint32 uiDiff) { - if (!m_instance) return; + if (!instance) return; - if (m_instance->GetData(TYPE_EVENT_NPC) != NPC_FIZZLEBANG) return; + if (instance->GetData(TYPE_EVENT_NPC) != NPC_FIZZLEBANG) return; - m_uiUpdateTimer = m_instance->GetData(TYPE_EVENT_TIMER); + m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER); if (m_uiUpdateTimer <= uiDiff) { - switch (m_instance->GetData(TYPE_EVENT)) + switch (instance->GetData(TYPE_EVENT)) { case 1110: - m_instance->SetData(TYPE_EVENT, 1120); + instance->SetData(TYPE_EVENT, 1120); m_uiUpdateTimer = 4000; break; case 1120: DoScriptText(SAY_STAGE_1_02, me); - m_instance->SetData(TYPE_EVENT, 1130); + instance->SetData(TYPE_EVENT, 1130); m_uiUpdateTimer = 12000; break; case 1130: @@ -440,12 +440,12 @@ class npc_fizzlebang_toc : public CreatureScript pTrigger->SetDisplayId(22862); pTrigger->CastSpell(pTrigger, SPELL_WILFRED_PORTAL, false); } - m_instance->SetData(TYPE_EVENT, 1132); + instance->SetData(TYPE_EVENT, 1132); m_uiUpdateTimer = 4000; break; case 1132: me->GetMotionMaster()->MovementExpired(); - m_instance->SetData(TYPE_EVENT, 1134); + instance->SetData(TYPE_EVENT, 1134); m_uiUpdateTimer = 4000; break; case 1134: @@ -458,10 +458,10 @@ class npc_fizzlebang_toc : public CreatureScript m_uiPortalGUID = pPortal->GetGUID(); } m_uiUpdateTimer = 4000; - m_instance->SetData(TYPE_EVENT, 1135); + instance->SetData(TYPE_EVENT, 1135); break; case 1135: - m_instance->SetData(TYPE_EVENT, 1140); + instance->SetData(TYPE_EVENT, 1140); m_uiUpdateTimer = 3000; break; case 1140: @@ -472,27 +472,27 @@ class npc_fizzlebang_toc : public CreatureScript temp->SetReactState(REACT_PASSIVE); temp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY()-10, ToCCommonLoc[1].GetPositionZ()); } - m_instance->SetData(TYPE_EVENT, 1142); + instance->SetData(TYPE_EVENT, 1142); m_uiUpdateTimer = 5000; break; case 1142: - if (Creature* temp = Unit::GetCreature(*me, m_instance->GetData64(NPC_JARAXXUS))) + if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_JARAXXUS))) temp->SetTarget(me->GetGUID()); if (Creature* pTrigger = Unit::GetCreature(*me, m_uiTriggerGUID)) pTrigger->DespawnOrUnsummon(); if (Creature* pPortal = Unit::GetCreature(*me, m_uiPortalGUID)) pPortal->DespawnOrUnsummon(); - m_instance->SetData(TYPE_EVENT, 1144); + instance->SetData(TYPE_EVENT, 1144); m_uiUpdateTimer = 10000; break; case 1144: - if (Creature* temp = Unit::GetCreature(*me, m_instance->GetData64(NPC_JARAXXUS))) + if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_JARAXXUS))) DoScriptText(SAY_STAGE_1_05, temp); - m_instance->SetData(TYPE_EVENT, 1150); + instance->SetData(TYPE_EVENT, 1150); m_uiUpdateTimer = 5000; break; case 1150: - if (Creature* temp = Unit::GetCreature(*me, m_instance->GetData64(NPC_JARAXXUS))) + if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_JARAXXUS))) { //1-shot Fizzlebang temp->CastSpell(me, 67888, false); @@ -500,12 +500,12 @@ class npc_fizzlebang_toc : public CreatureScript temp->AddThreat(me, 1000.0f); temp->AI()->AttackStart(me); } - m_instance->SetData(TYPE_EVENT, 1160); + instance->SetData(TYPE_EVENT, 1160); m_uiUpdateTimer = 3000; break; } } else m_uiUpdateTimer -= uiDiff; - m_instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer); + instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer); } }; @@ -525,10 +525,10 @@ class npc_tirion_toc : public CreatureScript { npc_tirion_tocAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)me->GetInstanceScript(); + instance = me->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiUpdateTimer; void Reset() {} @@ -537,31 +537,31 @@ class npc_tirion_toc : public CreatureScript void UpdateAI(const uint32 uiDiff) { - if (!m_instance) return; - if (m_instance->GetData(TYPE_EVENT_NPC) != NPC_TIRION) return; + if (!instance) return; + if (instance->GetData(TYPE_EVENT_NPC) != NPC_TIRION) return; - m_uiUpdateTimer = m_instance->GetData(TYPE_EVENT_TIMER); + m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER); if (m_uiUpdateTimer <= uiDiff) { - switch (m_instance->GetData(TYPE_EVENT)) + switch (instance->GetData(TYPE_EVENT)) { case 110: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_TALK); DoScriptText(SAY_STAGE_0_01, me); m_uiUpdateTimer = 22000; - m_instance->SetData(TYPE_EVENT, 120); + instance->SetData(TYPE_EVENT, 120); break; case 140: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_TALK); DoScriptText(SAY_STAGE_0_02, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 150); + instance->SetData(TYPE_EVENT, 150); break; case 150: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); - if (m_instance->GetData(TYPE_BEASTS) != DONE) + if (instance->GetData(TYPE_BEASTS) != DONE) { - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); if (Creature* temp = me->SummonCreature(NPC_GORMOK, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30*IN_MILLISECONDS)) { @@ -571,26 +571,26 @@ class npc_tirion_toc : public CreatureScript } } m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 155); + instance->SetData(TYPE_EVENT, 155); break; case 155: - m_instance->SetData(TYPE_BEASTS, IN_PROGRESS); + instance->SetData(TYPE_BEASTS, IN_PROGRESS); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 160); + instance->SetData(TYPE_EVENT, 160); break; case 200: DoScriptText(SAY_STAGE_0_04, me); m_uiUpdateTimer = 8000; - m_instance->SetData(TYPE_EVENT, 205); + instance->SetData(TYPE_EVENT, 205); break; case 205: m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 210); + instance->SetData(TYPE_EVENT, 210); break; case 210: - if (m_instance->GetData(TYPE_BEASTS) != DONE) + if (instance->GetData(TYPE_BEASTS) != DONE) { - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); if (Creature* temp = me->SummonCreature(NPC_DREADSCALE, ToCSpawnLoc[1].GetPositionX(), ToCSpawnLoc[1].GetPositionY(), ToCSpawnLoc[1].GetPositionZ(), 5, TEMPSUMMON_MANUAL_DESPAWN)) { temp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[8].GetPositionX(), ToCCommonLoc[8].GetPositionY(), ToCCommonLoc[8].GetPositionZ()); @@ -605,24 +605,24 @@ class npc_tirion_toc : public CreatureScript } } m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 220); + instance->SetData(TYPE_EVENT, 220); break; case 220: - m_instance->SetData(TYPE_EVENT, 230); + instance->SetData(TYPE_EVENT, 230); break; case 300: DoScriptText(SAY_STAGE_0_05, me); m_uiUpdateTimer = 8000; - m_instance->SetData(TYPE_EVENT, 305); + instance->SetData(TYPE_EVENT, 305); break; case 305: m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 310); + instance->SetData(TYPE_EVENT, 310); break; case 310: - if (m_instance->GetData(TYPE_BEASTS) != DONE) + if (instance->GetData(TYPE_BEASTS) != DONE) { - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); if (Creature* temp = me->SummonCreature(NPC_ICEHOWL, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5, TEMPSUMMON_DEAD_DESPAWN)) { temp->GetMotionMaster()->MovePoint(2, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ()); @@ -632,92 +632,92 @@ class npc_tirion_toc : public CreatureScript } } m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 315); + instance->SetData(TYPE_EVENT, 315); break; case 315: - m_instance->SetData(TYPE_EVENT, 320); + instance->SetData(TYPE_EVENT, 320); break; case 400: DoScriptText(SAY_STAGE_0_06, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 0); + instance->SetData(TYPE_EVENT, 0); break; case 666: DoScriptText(SAY_STAGE_0_WIPE, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 0); + instance->SetData(TYPE_EVENT, 0); break; case 1010: DoScriptText(SAY_STAGE_1_01, me); m_uiUpdateTimer = 7000; - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); me->SummonCreature(NPC_FIZZLEBANG, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 2, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME); - m_instance->SetData(TYPE_EVENT, 0); + instance->SetData(TYPE_EVENT, 0); break; case 1180: DoScriptText(SAY_STAGE_1_07, me); m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 0); + instance->SetData(TYPE_EVENT, 0); break; case 2000: DoScriptText(SAY_STAGE_1_08, me); m_uiUpdateTimer = 18000; - m_instance->SetData(TYPE_EVENT, 2010); + instance->SetData(TYPE_EVENT, 2010); break; case 2030: DoScriptText(SAY_STAGE_1_11, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 0); + instance->SetData(TYPE_EVENT, 0); break; case 3000: DoScriptText(SAY_STAGE_2_01, me); m_uiUpdateTimer = 12000; - m_instance->SetData(TYPE_EVENT, 3050); + instance->SetData(TYPE_EVENT, 3050); break; case 3001: DoScriptText(SAY_STAGE_2_01, me); m_uiUpdateTimer = 12000; - m_instance->SetData(TYPE_EVENT, 3051); + instance->SetData(TYPE_EVENT, 3051); break; case 3060: DoScriptText(SAY_STAGE_2_03, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 3070); + instance->SetData(TYPE_EVENT, 3070); break; case 3061: DoScriptText(SAY_STAGE_2_03, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 3071); + instance->SetData(TYPE_EVENT, 3071); break; //Summoning crusaders case 3091: if (Creature* pChampionController = me->SummonCreature(NPC_CHAMPIONS_CONTROLLER, ToCCommonLoc[1])) pChampionController->AI()->SetData(0, HORDE); m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 3092); + instance->SetData(TYPE_EVENT, 3092); break; //Summoning crusaders case 3090: if (Creature* pChampionController = me->SummonCreature(NPC_CHAMPIONS_CONTROLLER, ToCCommonLoc[1])) pChampionController->AI()->SetData(0, ALLIANCE); m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 3092); + instance->SetData(TYPE_EVENT, 3092); break; case 3092: - if (Creature* pChampionController = Unit::GetCreature((*me), m_instance->GetData64(NPC_CHAMPIONS_CONTROLLER))) + if (Creature* pChampionController = Unit::GetCreature((*me), instance->GetData64(NPC_CHAMPIONS_CONTROLLER))) pChampionController->AI()->SetData(1, NOT_STARTED); - m_instance->SetData(TYPE_EVENT, 3095); + instance->SetData(TYPE_EVENT, 3095); break; //Crusaders battle end case 3100: DoScriptText(SAY_STAGE_2_06, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 0); + instance->SetData(TYPE_EVENT, 0); break; case 4000: DoScriptText(SAY_STAGE_3_01, me); m_uiUpdateTimer = 13000; - m_instance->SetData(TYPE_EVENT, 4010); + instance->SetData(TYPE_EVENT, 4010); break; case 4010: DoScriptText(SAY_STAGE_3_02, me); @@ -736,72 +736,72 @@ class npc_tirion_toc : public CreatureScript temp->SummonCreature(NPC_DARK_ESSENCE, TwinValkyrsLoc[3].GetPositionX(), TwinValkyrsLoc[3].GetPositionY(), TwinValkyrsLoc[3].GetPositionZ()); } m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 4015); + instance->SetData(TYPE_EVENT, 4015); break; case 4015: - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); - if (Creature* temp = Unit::GetCreature((*me), m_instance->GetData64(NPC_LIGHTBANE))) + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); + if (Creature* temp = Unit::GetCreature((*me), instance->GetData64(NPC_LIGHTBANE))) { temp->GetMotionMaster()->MovePoint(1, ToCCommonLoc[8].GetPositionX(), ToCCommonLoc[8].GetPositionY(), ToCCommonLoc[8].GetPositionZ()); temp->SetVisible(true); } - if (Creature* temp = Unit::GetCreature((*me), m_instance->GetData64(NPC_DARKBANE))) + if (Creature* temp = Unit::GetCreature((*me), instance->GetData64(NPC_DARKBANE))) { temp->GetMotionMaster()->MovePoint(1, ToCCommonLoc[9].GetPositionX(), ToCCommonLoc[9].GetPositionY(), ToCCommonLoc[9].GetPositionZ()); temp->SetVisible(true); } m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 4016); + instance->SetData(TYPE_EVENT, 4016); break; case 4016: - m_instance->SetData(TYPE_EVENT, 4017); + instance->SetData(TYPE_EVENT, 4017); break; case 4040: m_uiUpdateTimer = 60000; - m_instance->SetData(TYPE_EVENT, 5000); + instance->SetData(TYPE_EVENT, 5000); break; case 5000: DoScriptText(SAY_STAGE_4_01, me); m_uiUpdateTimer = 10000; - m_instance->SetData(TYPE_EVENT, 5005); + instance->SetData(TYPE_EVENT, 5005); break; case 5005: m_uiUpdateTimer = 8000; - m_instance->SetData(TYPE_EVENT, 5010); + instance->SetData(TYPE_EVENT, 5010); me->SummonCreature(NPC_LICH_KING_1, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5); break; case 5020: DoScriptText(SAY_STAGE_4_03, me); m_uiUpdateTimer = 1000; - m_instance->SetData(TYPE_EVENT, 0); + instance->SetData(TYPE_EVENT, 0); break; case 6000: me->NearTeleportTo(AnubarakLoc[0].GetPositionX(), AnubarakLoc[0].GetPositionY(), AnubarakLoc[0].GetPositionZ(), 4.0f); m_uiUpdateTimer = 20000; - m_instance->SetData(TYPE_EVENT, 6005); + instance->SetData(TYPE_EVENT, 6005); break; case 6005: DoScriptText(SAY_STAGE_4_06, me); m_uiUpdateTimer = 20000; - m_instance->SetData(TYPE_EVENT, 6010); + instance->SetData(TYPE_EVENT, 6010); break; case 6010: if (IsHeroic()) { DoScriptText(SAY_STAGE_4_07, me); m_uiUpdateTimer = 60000; - m_instance->SetData(TYPE_ANUBARAK, SPECIAL); - m_instance->SetData(TYPE_EVENT, 6020); - } else m_instance->SetData(TYPE_EVENT, 6030); + instance->SetData(TYPE_ANUBARAK, SPECIAL); + instance->SetData(TYPE_EVENT, 6020); + } else instance->SetData(TYPE_EVENT, 6030); break; case 6020: me->DespawnOrUnsummon(); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 6030); + instance->SetData(TYPE_EVENT, 6030); break; } } else m_uiUpdateTimer -= uiDiff; - m_instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer); + instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer); } }; @@ -821,10 +821,10 @@ class npc_garrosh_toc : public CreatureScript { npc_garrosh_tocAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)me->GetInstanceScript(); + instance = me->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiUpdateTimer; void Reset() {} @@ -833,53 +833,53 @@ class npc_garrosh_toc : public CreatureScript void UpdateAI(const uint32 uiDiff) { - if (!m_instance) return; - if (m_instance->GetData(TYPE_EVENT_NPC) != NPC_GARROSH) return; + if (!instance) return; + if (instance->GetData(TYPE_EVENT_NPC) != NPC_GARROSH) return; - m_uiUpdateTimer = m_instance->GetData(TYPE_EVENT_TIMER); + m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER); if (m_uiUpdateTimer <= uiDiff) { - switch (m_instance->GetData(TYPE_EVENT)) + switch (instance->GetData(TYPE_EVENT)) { case 130: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_TALK); DoScriptText(SAY_STAGE_0_03h, me); m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 132); + instance->SetData(TYPE_EVENT, 132); break; case 132: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 140); + instance->SetData(TYPE_EVENT, 140); break; case 2010: DoScriptText(SAY_STAGE_1_09, me); m_uiUpdateTimer = 9000; - m_instance->SetData(TYPE_EVENT, 2020); + instance->SetData(TYPE_EVENT, 2020); break; case 3050: DoScriptText(SAY_STAGE_2_02h, me); m_uiUpdateTimer = 15000; - m_instance->SetData(TYPE_EVENT, 3060); + instance->SetData(TYPE_EVENT, 3060); break; case 3070: DoScriptText(SAY_STAGE_2_04h, me); m_uiUpdateTimer = 6000; - m_instance->SetData(TYPE_EVENT, 3080); + instance->SetData(TYPE_EVENT, 3080); break; case 3081: DoScriptText(SAY_STAGE_2_05h, me); m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 3091); + instance->SetData(TYPE_EVENT, 3091); break; case 4030: DoScriptText(SAY_STAGE_3_03h, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 4040); + instance->SetData(TYPE_EVENT, 4040); break; } } else m_uiUpdateTimer -= uiDiff; - m_instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer); + instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer); } }; @@ -899,10 +899,10 @@ class npc_varian_toc : public CreatureScript { npc_varian_tocAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)me->GetInstanceScript(); + instance = me->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiUpdateTimer; void Reset() {} @@ -911,53 +911,53 @@ class npc_varian_toc : public CreatureScript void UpdateAI(const uint32 uiDiff) { - if (!m_instance) return; - if (m_instance->GetData(TYPE_EVENT_NPC) != NPC_VARIAN) return; + if (!instance) return; + if (instance->GetData(TYPE_EVENT_NPC) != NPC_VARIAN) return; - m_uiUpdateTimer = m_instance->GetData(TYPE_EVENT_TIMER); + m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER); if (m_uiUpdateTimer <= uiDiff) { - switch (m_instance->GetData(TYPE_EVENT)) + switch (instance->GetData(TYPE_EVENT)) { case 120: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_TALK); DoScriptText(SAY_STAGE_0_03a, me); m_uiUpdateTimer = 2000; - m_instance->SetData(TYPE_EVENT, 122); + instance->SetData(TYPE_EVENT, 122); break; case 122: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 130); + instance->SetData(TYPE_EVENT, 130); break; case 2020: DoScriptText(SAY_STAGE_1_10, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 2030); + instance->SetData(TYPE_EVENT, 2030); break; case 3051: DoScriptText(SAY_STAGE_2_02a, me); m_uiUpdateTimer = 10000; - m_instance->SetData(TYPE_EVENT, 3061); + instance->SetData(TYPE_EVENT, 3061); break; case 3071: DoScriptText(SAY_STAGE_2_04a, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 3081); + instance->SetData(TYPE_EVENT, 3081); break; case 3080: DoScriptText(SAY_STAGE_2_05a, me); m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 3090); + instance->SetData(TYPE_EVENT, 3090); break; case 4020: DoScriptText(SAY_STAGE_3_03a, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 4040); + instance->SetData(TYPE_EVENT, 4040); break; } } else m_uiUpdateTimer -= uiDiff; - m_instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer); + instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer); } }; diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp index 284babb7193..9f39cecbb23 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp @@ -93,13 +93,13 @@ public: { boss_bjarngrimAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); m_uiStance = STANCE_DEFENSIVE; memset(&m_auiStormforgedLieutenantGUID, 0, sizeof(m_auiStormforgedLieutenantGUID)); canBuff = true; } - InstanceScript* m_instance; + InstanceScript* instance; bool m_bIsChangingStance; bool canBuff; @@ -167,8 +167,8 @@ public: SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SHIELD, EQUIP_NO_CHANGE); - if (m_instance) - m_instance->SetData(TYPE_BJARNGRIM, NOT_STARTED); + if (instance) + instance->SetData(TYPE_BJARNGRIM, NOT_STARTED); } void EnterEvadeMode() @@ -188,8 +188,8 @@ public: //must get both lieutenants here and make sure they are with him me->CallForHelp(30.0f); - if (m_instance) - m_instance->SetData(TYPE_BJARNGRIM, IN_PROGRESS); + if (instance) + instance->SetData(TYPE_BJARNGRIM, IN_PROGRESS); } void KilledUnit(Unit* /*victim*/) @@ -201,8 +201,8 @@ public: { Talk(SAY_DEATH); - if (m_instance) - m_instance->SetData(TYPE_BJARNGRIM, DONE); + if (instance) + instance->SetData(TYPE_BJARNGRIM, DONE); } //TODO: remove when removal is done by the core @@ -385,10 +385,10 @@ public: { mob_stormforged_lieutenantAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiArcWeld_Timer; uint32 m_uiRenewSteel_Timer; @@ -401,9 +401,9 @@ public: void EnterCombat(Unit* who) { - if (m_instance) + if (instance) { - if (Creature* pBjarngrim = m_instance->instance->GetCreature(m_instance->GetData64(DATA_BJARNGRIM))) + if (Creature* pBjarngrim = instance->instance->GetCreature(instance->GetData64(DATA_BJARNGRIM))) { if (pBjarngrim->isAlive() && !pBjarngrim->getVictim()) pBjarngrim->AI()->AttackStart(who); @@ -427,9 +427,9 @@ public: if (m_uiRenewSteel_Timer <= uiDiff) { - if (m_instance) + if (instance) { - if (Creature* pBjarngrim = m_instance->instance->GetCreature(m_instance->GetData64(DATA_BJARNGRIM))) + if (Creature* pBjarngrim = instance->instance->GetCreature(instance->GetData64(DATA_BJARNGRIM))) { if (pBjarngrim->isAlive()) DoCast(pBjarngrim, SPELL_RENEW_STEEL_N); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp index e4f2bb5ce01..2e2744baa3c 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp @@ -68,10 +68,10 @@ public: { boss_lokenAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; bool m_bIsAura; @@ -93,10 +93,10 @@ public: m_uiHealthAmountModifier = 1; - if (m_instance) + if (instance) { - m_instance->SetData(TYPE_LOKEN, NOT_STARTED); - m_instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMELY_DEATH_START_EVENT); + instance->SetData(TYPE_LOKEN, NOT_STARTED); + instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMELY_DEATH_START_EVENT); } } @@ -104,10 +104,10 @@ public: { Talk(SAY_AGGRO); - if (m_instance) + if (instance) { - m_instance->SetData(TYPE_LOKEN, IN_PROGRESS); - m_instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMELY_DEATH_START_EVENT); + instance->SetData(TYPE_LOKEN, IN_PROGRESS); + instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMELY_DEATH_START_EVENT); } } @@ -115,8 +115,8 @@ public: { Talk(SAY_DEATH); - if (m_instance) - m_instance->SetData(TYPE_LOKEN, DONE); + if (instance) + instance->SetData(TYPE_LOKEN, DONE); } void KilledUnit(Unit* /*victim*/) diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp index 13ba85f646c..5c7bf0d1c1e 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp @@ -79,10 +79,10 @@ public: { boss_volkhanAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; std::list m_lGolemGUIDList; @@ -117,16 +117,16 @@ public: DespawnGolem(); m_lGolemGUIDList.clear(); - if (m_instance) - m_instance->SetData(TYPE_VOLKHAN, NOT_STARTED); + if (instance) + instance->SetData(TYPE_VOLKHAN, NOT_STARTED); } void EnterCombat(Unit* /*who*/) { Talk(SAY_AGGRO); - if (m_instance) - m_instance->SetData(TYPE_VOLKHAN, IN_PROGRESS); + if (instance) + instance->SetData(TYPE_VOLKHAN, IN_PROGRESS); } void AttackStart(Unit* who) @@ -147,8 +147,8 @@ public: Talk(SAY_DEATH); DespawnGolem(); - if (m_instance) - m_instance->SetData(TYPE_VOLKHAN, DONE); + if (instance) + instance->SetData(TYPE_VOLKHAN, DONE); if (IsHeroic() && GolemsShattered < 5) { diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index b94c88aed86..e98bb724f41 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -170,10 +170,10 @@ public: { boss_skadiAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; SummonList Summons; uint64 m_uiGraufGUID; std::vector triggersGUID; @@ -208,10 +208,10 @@ public: me->SetSpeed(MOVE_FLIGHT, 3.0f); if ((Unit::GetCreature((*me), m_uiGraufGUID) == NULL) && !me->IsMounted()) me->SummonCreature(CREATURE_GRAUF, Location[0].GetPositionX(), Location[0].GetPositionY(), Location[0].GetPositionZ(), 3.0f); - if (m_instance) + if (instance) { - m_instance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, NOT_STARTED); - m_instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); + instance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, NOT_STARTED); + instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } } @@ -235,10 +235,10 @@ public: m_uiMovementTimer = 1000; m_uiSummonTimer = 10000; me->SetInCombatWithZone(); - if (m_instance) + if (instance) { - m_instance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, IN_PROGRESS); - m_instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); + instance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, IN_PROGRESS); + instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); me->GetMotionMaster()->MoveJump(Location[0].GetPositionX(), Location[0].GetPositionY(), Location[0].GetPositionZ(), 5.0f, 10.0f); me->SetWalk(false); m_uiMountTimer = 1000; @@ -411,8 +411,8 @@ public: { DoScriptText(SAY_DEATH, me); Summons.DespawnAll(); - if (m_instance) - m_instance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, DONE); + if (instance) + instance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, DONE); } void KilledUnit(Unit* /*victim*/) @@ -463,11 +463,11 @@ public: bool OnGossipHello(Player* player, GameObject* go) { - InstanceScript* m_instance = go->GetInstanceScript(); - if (!m_instance) + InstanceScript* instance = go->GetInstanceScript(); + if (!instance) return false; - if (Creature* pSkadi = Unit::GetCreature(*go, m_instance->GetData64(DATA_SKADI_THE_RUTHLESS))) + if (Creature* pSkadi = Unit::GetCreature(*go, instance->GetData64(DATA_SKADI_THE_RUTHLESS))) player->CastSpell(pSkadi, SPELL_RAPID_FIRE, true); return false; diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp index d3ea73c5ba0..8fd1b163ce3 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp @@ -58,10 +58,10 @@ public: { boss_ambassador_hellmawAI(Creature* creature) : npc_escortAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 EventCheck_Timer; uint32 CorrosiveAcid_Timer; @@ -81,17 +81,17 @@ public: IsBanished = true; Enraged = false; - if (m_instance && me->isAlive()) + if (instance && me->isAlive()) { - if (m_instance->GetData(TYPE_OVERSEER) != DONE) + if (instance->GetData(TYPE_OVERSEER) != DONE) DoCast(me, SPELL_BANISH, true); } } void JustReachedHome() { - if (m_instance) - m_instance->SetData(TYPE_HELLMAW, FAIL); + if (instance) + instance->SetData(TYPE_HELLMAW, FAIL); } void MoveInLineOfSight(Unit* who) @@ -114,15 +114,15 @@ public: IsBanished = false; Intro = true; - if (m_instance) + if (instance) { - if (m_instance->GetData(TYPE_HELLMAW) != FAIL) + if (instance->GetData(TYPE_HELLMAW) != FAIL) { DoScriptText(SAY_INTRO, me); Start(true, false, 0, NULL, false, true); } - m_instance->SetData(TYPE_HELLMAW, IN_PROGRESS); + instance->SetData(TYPE_HELLMAW, IN_PROGRESS); } } @@ -140,8 +140,8 @@ public: { DoScriptText(SAY_DEATH, me); - if (m_instance) - m_instance->SetData(TYPE_HELLMAW, DONE); + if (instance) + instance->SetData(TYPE_HELLMAW, DONE); } void UpdateAI(const uint32 diff) @@ -150,9 +150,9 @@ public: { if (EventCheck_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(TYPE_OVERSEER) == DONE) + if (instance->GetData(TYPE_OVERSEER) == DONE) { DoIntro(); return; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index 7d48e2a80b6..f867612e91e 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -147,11 +147,11 @@ struct advisorbase_ai : public ScriptedAI { advisorbase_ai(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); m_bDoubled_Health = false; } - InstanceScript* m_instance; + InstanceScript* instance; bool FakeDeath; bool m_bDoubled_Health; uint32 DelayRes_Timer; @@ -174,8 +174,8 @@ struct advisorbase_ai : public ScriptedAI me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); //reset encounter - if (m_instance && (m_instance->GetData(DATA_KAELTHASEVENT) == 1 || m_instance->GetData(DATA_KAELTHASEVENT) == 3)) - if (Creature* Kaelthas = Unit::GetCreature((*me), m_instance->GetData64(DATA_KAELTHAS))) + if (instance && (instance->GetData(DATA_KAELTHASEVENT) == 1 || instance->GetData(DATA_KAELTHASEVENT) == 3)) + if (Creature* Kaelthas = Unit::GetCreature((*me), instance->GetData64(DATA_KAELTHAS))) Kaelthas->AI()->EnterEvadeMode(); } @@ -214,14 +214,14 @@ struct advisorbase_ai : public ScriptedAI return; //Prevent glitch if in fake death - if (FakeDeath && m_instance && m_instance->GetData(DATA_KAELTHASEVENT) != 0) + if (FakeDeath && instance && instance->GetData(DATA_KAELTHASEVENT) != 0) { damage = 0; return; } //Don't really die in phase 1 & 3, only die after that - if (m_instance && m_instance->GetData(DATA_KAELTHASEVENT) != 0) + if (instance && instance->GetData(DATA_KAELTHASEVENT) != 0) { //prevent death damage = 0; @@ -280,11 +280,11 @@ class boss_kaelthas : public CreatureScript { boss_kaelthasAI(Creature* creature) : ScriptedAI(creature), summons(me) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); memset(&m_auiAdvisorGuid, 0, sizeof(m_auiAdvisorGuid)); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 Fireball_Timer; uint32 ArcaneDisruption_Timer; @@ -335,8 +335,8 @@ class boss_kaelthas : public CreatureScript me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (m_instance) - m_instance->SetData(DATA_KAELTHASEVENT, 0); + if (instance) + instance->SetData(DATA_KAELTHASEVENT, 0); } void PrepareAdvisors() @@ -355,13 +355,13 @@ class boss_kaelthas : public CreatureScript void StartEvent() { - if (!m_instance) + if (!instance) return; - m_auiAdvisorGuid[0] = m_instance->GetData64(DATA_THALADREDTHEDARKENER); - m_auiAdvisorGuid[1] = m_instance->GetData64(DATA_LORDSANGUINAR); - m_auiAdvisorGuid[2] = m_instance->GetData64(DATA_GRANDASTROMANCERCAPERNIAN); - m_auiAdvisorGuid[3] = m_instance->GetData64(DATA_MASTERENGINEERTELONICUS); + m_auiAdvisorGuid[0] = instance->GetData64(DATA_THALADREDTHEDARKENER); + m_auiAdvisorGuid[1] = instance->GetData64(DATA_LORDSANGUINAR); + m_auiAdvisorGuid[2] = instance->GetData64(DATA_GRANDASTROMANCERCAPERNIAN); + m_auiAdvisorGuid[3] = instance->GetData64(DATA_MASTERENGINEERTELONICUS); if (!m_auiAdvisorGuid[0] || !m_auiAdvisorGuid[1] || !m_auiAdvisorGuid[2] || !m_auiAdvisorGuid[3]) { @@ -371,7 +371,7 @@ class boss_kaelthas : public CreatureScript Phase = 4; - m_instance->SetData(DATA_KAELTHASEVENT, 4); + instance->SetData(DATA_KAELTHASEVENT, 4); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); @@ -386,7 +386,7 @@ class boss_kaelthas : public CreatureScript DoScriptText(SAY_INTRO, me); - m_instance->SetData(DATA_KAELTHASEVENT, 1); + instance->SetData(DATA_KAELTHASEVENT, 1); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); PhaseSubphase = 0; @@ -412,7 +412,7 @@ class boss_kaelthas : public CreatureScript } else if (me->GetMap()->IsDungeon()) { - if (m_instance && !m_instance->GetData(DATA_KAELTHASEVENT) && !Phase) + if (instance && !instance->GetData(DATA_KAELTHASEVENT) && !Phase) StartEvent(); who->SetInCombatWith(me); @@ -424,7 +424,7 @@ class boss_kaelthas : public CreatureScript void EnterCombat(Unit* /*who*/) { - if (m_instance && !m_instance->GetData(DATA_KAELTHASEVENT) && !Phase) + if (instance && !instance->GetData(DATA_KAELTHASEVENT) && !Phase) StartEvent(); } @@ -456,8 +456,8 @@ class boss_kaelthas : public CreatureScript summons.DespawnAll(); - if (m_instance) - m_instance->SetData(DATA_KAELTHASEVENT, 0); + if (instance) + instance->SetData(DATA_KAELTHASEVENT, 0); for (uint8 i = 0; i < MAX_ADVISORS; ++i) { @@ -621,8 +621,8 @@ class boss_kaelthas : public CreatureScript if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) { Phase = 2; - if (m_instance) - m_instance->SetData(DATA_KAELTHASEVENT, 2); + if (instance) + instance->SetData(DATA_KAELTHASEVENT, 2); DoScriptText(SAY_PHASE2_WEAPON, me); @@ -666,8 +666,8 @@ class boss_kaelthas : public CreatureScript if (Phase_Timer <= diff) { DoScriptText(SAY_PHASE3_ADVANCE, me); - if (m_instance) - m_instance->SetData(DATA_KAELTHASEVENT, 3); + if (instance) + instance->SetData(DATA_KAELTHASEVENT, 3); Phase = 3; PhaseSubphase = 0; } @@ -704,8 +704,8 @@ class boss_kaelthas : public CreatureScript DoScriptText(SAY_PHASE4_INTRO2, me); Phase = 4; - if (m_instance) - m_instance->SetData(DATA_KAELTHASEVENT, 4); + if (instance) + instance->SetData(DATA_KAELTHASEVENT, 4); // Sometimes people can collect Aggro in Phase 1-3. Reset threat before releasing Kael. DoResetThreat(); @@ -809,8 +809,8 @@ class boss_kaelthas : public CreatureScript { if (HealthBelowPct(50)) { - if (m_instance) - m_instance->SetData(DATA_KAELTHASEVENT, 4); + if (instance) + instance->SetData(DATA_KAELTHASEVENT, 4); Phase = 5; Phase_Timer = 10000; @@ -1044,7 +1044,7 @@ class boss_thaladred_the_darkener : public CreatureScript void JustDied(Unit* /*killer*/) { - if (m_instance && m_instance->GetData(DATA_KAELTHASEVENT) == 3) + if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3) DoScriptText(SAY_THALADRED_DEATH, me); } @@ -1136,7 +1136,7 @@ class boss_lord_sanguinar : public CreatureScript void JustDied(Unit* /*Killer*/) { - if (m_instance && m_instance->GetData(DATA_KAELTHASEVENT) == 3) + if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3) DoScriptText(SAY_SANGUINAR_DEATH, me); } @@ -1201,7 +1201,7 @@ class boss_grand_astromancer_capernian : public CreatureScript void JustDied(Unit* /*killer*/) { - if (m_instance && m_instance->GetData(DATA_KAELTHASEVENT) == 3) + if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3) DoScriptText(SAY_CAPERNIAN_DEATH, me); } @@ -1340,7 +1340,7 @@ class boss_master_engineer_telonicus : public CreatureScript void JustDied(Unit* /*killer*/) { - if (m_instance && m_instance->GetData(DATA_KAELTHASEVENT) == 3) + if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3) DoScriptText(SAY_TELONICUS_DEATH, me); } From bef1b0c4028a3986d63c3b2c9ebdf532a3c73b5b Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Fri, 16 Mar 2012 19:40:57 +0800 Subject: [PATCH 0189/1149] Core/Script: Code style. Signed-off-by: Gyx <2359980687@qq.com> --- src/server/scripts/Commands/cs_account.cpp | 2 +- src/server/scripts/Commands/cs_modify.cpp | 8 +-- src/server/scripts/Commands/cs_npc.cpp | 17 +++--- src/server/scripts/Commands/cs_wp.cpp | 3 +- .../ScarletEnclave/chapter1.cpp | 14 +++-- .../boss_headless_horseman.cpp | 9 +++- .../SunwellPlateau/boss_kalecgos.cpp | 4 +- .../Uldaman/boss_archaedas.cpp | 2 +- .../Uldaman/instance_uldaman.cpp | 17 +++--- .../EasternKingdoms/ZulAman/boss_janalai.cpp | 4 +- .../ZulAman/instance_zulaman.cpp | 7 ++- .../BattleForMountHyjal/boss_anetheron.cpp | 3 -- .../BattleForMountHyjal/instance_hyjal.cpp | 3 +- .../Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp | 3 +- .../instance_temple_of_ahnqiraj.cpp | 2 +- .../scripts/Kalimdor/ZulFarrak/zulfarrak.cpp | 24 ++++----- src/server/scripts/Kalimdor/durotar.cpp | 2 +- src/server/scripts/Kalimdor/the_barrens.cpp | 9 ++-- .../AzjolNerub/Ahnkahet/instance_ahnkahet.cpp | 6 ++- .../AzjolNerub/AzjolNerub/boss_hadronox.cpp | 3 +- .../AzjolNerub/instance_azjol_nerub.cpp | 3 +- .../boss_faction_champions.cpp | 54 ++++++++++++------- .../boss_northrend_beasts.cpp | 3 +- .../TrialOfTheCrusader/boss_twin_valkyr.cpp | 6 ++- .../trial_of_the_crusader.cpp | 30 +++++++---- .../instance_drak_tharon_keep.cpp | 3 +- .../Northrend/Gundrak/instance_gundrak.cpp | 3 +- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 2 +- .../UtgardeKeep/instance_utgarde_keep.cpp | 3 +- .../UtgardePinnacle/instance_pinnacle.cpp | 3 +- .../VioletHold/instance_violet_hold.cpp | 3 +- .../scripts/Northrend/grizzly_hills.cpp | 2 +- .../scripts/Northrend/howling_fjord.cpp | 2 +- .../instance_shadow_labyrinth.cpp | 3 +- .../Outland/BlackTemple/boss_illidan.cpp | 13 +++-- .../BlackTemple/boss_reliquary_of_souls.cpp | 5 +- .../BlackTemple/boss_shade_of_akama.cpp | 3 +- .../BlackTemple/boss_teron_gorefiend.cpp | 3 +- .../BlackTemple/boss_warlord_najentus.cpp | 4 +- .../Outland/BlackTemple/illidari_council.cpp | 3 +- .../BlackTemple/instance_black_temple.cpp | 3 +- .../boss_leotheras_the_blind.cpp | 3 +- .../SerpentShrine/boss_lurker_below.cpp | 5 +- .../GruulsLair/instance_gruuls_lair.cpp | 3 +- .../BloodFurnace/boss_kelidan_the_breaker.cpp | 4 +- .../instance_magtheridons_lair.cpp | 4 +- .../TempestKeep/Eye/instance_the_eye.cpp | 3 +- .../Mechanar/instance_mechanar.cpp | 2 +- .../arcatraz/instance_arcatraz.cpp | 3 +- .../scripts/Outland/blades_edge_mountains.cpp | 3 +- .../scripts/Outland/boss_doomlord_kazzak.cpp | 2 +- .../scripts/Outland/boss_doomwalker.cpp | 2 +- src/server/scripts/Outland/netherstorm.cpp | 2 +- .../scripts/Outland/shadowmoon_valley.cpp | 5 +- src/server/scripts/World/go_scripts.cpp | 20 +++---- 55 files changed, 220 insertions(+), 137 deletions(-) diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index df83fe8118f..86818e2c931 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -382,7 +382,7 @@ public: // Let set addon state only for lesser (strong) security level // or to self account - if (handler->GetSession() && handler->GetSession()->GetAccountId () != accountId && + if (handler->GetSession() && handler->GetSession()->GetAccountId() != accountId && handler->HasLowerSecurityAccount(NULL, accountId, true)) return false; diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 358eaacd4f7..32ee96dacfe 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -360,7 +360,9 @@ public: //Edit Player Spell static bool HandleModifySpellCommand(ChatHandler* handler, const char* args) { - if (!*args) return false; + if (!*args) + return false; + char* pspellflatid = strtok((char*)args, " "); if (!pspellflatid) return false; @@ -1141,10 +1143,10 @@ public: static bool HandleModifyRepCommand(ChatHandler* handler, const char* args) { - if (!*args) return false; + if (!*args) + return false; Player* target = handler->getSelectedPlayer(); - if (!target) { handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 67ac6f8ff76..af6952cdf40 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -108,6 +108,7 @@ public: { if (!*args) return false; + char* charID = handler->extractKeyFromLink((char*)args, "Hcreature_entry"); if (!charID) return false; @@ -135,7 +136,7 @@ public: return true; } - Creature* creature = new Creature; + Creature* creature = new Creature(); if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, (uint32)teamval, x, y, z, o)) { delete creature; @@ -1036,7 +1037,7 @@ public: } if (/*creature->GetMotionMaster()->empty() ||*/ - creature->GetMotionMaster()->GetCurrentMovementGeneratorType () != FOLLOW_MOTION_TYPE) + creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != FOLLOW_MOTION_TYPE) { handler->PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU, creature->GetName()); handler->SetSentErrorMessage(true); @@ -1131,17 +1132,17 @@ public: //npc tame handling static bool HandleNpcTameCommand(ChatHandler* handler, const char* /*args*/) { - Creature* creatureTarget = handler->getSelectedCreature (); - if (!creatureTarget || creatureTarget->isPet ()) + Creature* creatureTarget = handler->getSelectedCreature(); + if (!creatureTarget || creatureTarget->isPet()) { handler->PSendSysMessage (LANG_SELECT_CREATURE); handler->SetSentErrorMessage (true); return false; } - Player* player = handler->GetSession()->GetPlayer (); + Player* player = handler->GetSession()->GetPlayer(); - if (player->GetPetGUID ()) + if (player->GetPetGUID()) { handler->SendSysMessage (LANG_YOU_ALREADY_HAVE_PET); handler->SetSentErrorMessage (true); @@ -1168,8 +1169,8 @@ public: // place pet before player float x, y, z; - player->GetClosePoint (x, y, z, creatureTarget->GetObjectSize (), CONTACT_DISTANCE); - pet->Relocate (x, y, z, M_PI-player->GetOrientation ()); + player->GetClosePoint (x, y, z, creatureTarget->GetObjectSize(), CONTACT_DISTANCE); + pet->Relocate(x, y, z, M_PI-player->GetOrientation()); // set pet to defensive mode by default (some classes can't control controlled pets in fact). pet->SetReactState(REACT_DEFENSIVE); diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index 9249cb3fdbc..eb59007b40b 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -277,7 +277,8 @@ public: std::string show = show_str; // Check - if ((show != "add") && (show != "mod") && (show != "del") && (show != "listid")) return false; + if ((show != "add") && (show != "mod") && (show != "del") && (show != "listid")) + return false; char* arg_id = strtok(NULL, " "); uint32 id = 0; diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index cffb2d73b1f..aab18cd57be 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -303,9 +303,11 @@ public: prisonerGUID = guid; } - uint64 GetGUID(int32 /*id*/) { return prisonerGUID; } + uint64 GetGUID(int32 /*id*/) + { + return prisonerGUID; + } }; - }; class go_acherus_soul_prison : public GameObjectScript @@ -702,7 +704,9 @@ public: void Reset() { Creature* deathcharger = me->FindNearestCreature(28782, 30); - if (!deathcharger) return; + if (!deathcharger) + return; + deathcharger->RestoreFaction(); deathcharger->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); deathcharger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -713,7 +717,9 @@ public: void JustDied(Unit* killer) { Creature* deathcharger = me->FindNearestCreature(28782, 30); - if (!deathcharger) return; + if (!deathcharger) + return; + if (killer->GetTypeId() == TYPEID_PLAYER && deathcharger->GetTypeId() == TYPEID_UNIT && deathcharger->IsVehicle()) { deathcharger->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index b71f0ef8b9a..1ffed905167 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -319,7 +319,8 @@ public: if (wait <= diff) { wait = 1000; - if (!me->getVictim()) return; + if (!me->getVictim()) + return; me->GetMotionMaster()->Clear(false); me->GetMotionMaster()->MoveFleeing(me->getVictim()); } @@ -803,11 +804,15 @@ public: void Despawn() { - if (!debuffGUID) return; + if (!debuffGUID) + return; + Unit* debuff = Unit::GetUnit((*me), debuffGUID); if (debuff) + { debuff->SetVisible(false); debuffGUID = 0; + } } void JustDied(Unit* /*killer*/) { if (!sprouted) Despawn(); } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index 7ac42ff8193..f783fcc1eb5 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -676,7 +676,9 @@ public: void TeleportAllPlayersBack() { Map* map = me->GetMap(); - if (!map->IsDungeon()) return; + if (!map->IsDungeon()) + return; + Map::PlayerList const &PlayerList = map->GetPlayers(); for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp index 17d23429537..7a946e9d5bf 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp @@ -153,7 +153,7 @@ class boss_archaedas : public CreatureScript // wake a wall minion if (uiWallMinionTimer <= uiDiff) { - instance->SetData (DATA_MINIONS, IN_PROGRESS); + instance->SetData(DATA_MINIONS, IN_PROGRESS); uiWallMinionTimer = 10000; } else uiWallMinionTimer -= uiDiff; diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp index 60d17a7e5d2..fea64c55377 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp @@ -184,8 +184,8 @@ class instance_uldaman : public InstanceMapScript return; // only want the first one we find } // if we get this far than all four are dead so open the door - SetData (DATA_ALTAR_DOORS, DONE); - SetDoor (uiArchaedasTempleDoor, true); //open next the door too + SetData(DATA_ALTAR_DOORS, DONE); + SetDoor(uiArchaedasTempleDoor, true); //open next the door too } void ActivateWallMinions() @@ -320,7 +320,7 @@ class instance_uldaman : public InstanceMapScript uiIronayaSealDoorTimer -= diff; } - void SetData (uint32 type, uint32 data) + void SetData(uint32 type, uint32 data) { switch (type) { @@ -386,7 +386,7 @@ class instance_uldaman : public InstanceMapScript } } - void SetData64 (uint32 type, uint64 data) + void SetData64(uint32 type, uint64 data) { // Archaedas if (type == 0) @@ -425,7 +425,8 @@ class instance_uldaman : public InstanceMapScript void OnCreatureCreate(Creature* creature) { - switch (creature->GetEntry()) { + switch (creature->GetEntry()) + { case 4857: // Stone Keeper SetFrozenState (creature); vStoneKeeper.push_back(creature->GetGUID()); @@ -458,10 +459,10 @@ class instance_uldaman : public InstanceMapScript uiArchaedasGUID = creature->GetGUID(); break; - } // end switch - } // end OnCreatureCreate + } + } - uint64 GetData64 (uint32 identifier) + uint64 GetData64(uint32 identifier) { if (identifier == 0) return uiWhoWokeuiArchaedasGUID; if (identifier == 1) return vVaultWalker[0]; // VaultWalker1 diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index 3cf4f315cad..bbaafa63979 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -374,7 +374,9 @@ class boss_janalai : public CreatureScript //Teleport every Player into the middle Map* map = me->GetMap(); - if (!map->IsDungeon()) return; + if (!map->IsDungeon()) + return; + Map::PlayerList const &PlayerList = map->GetPlayers(); for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) if (Player* i_pl = i->getSource()) diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp index ac1554bd00e..884fe109785 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp @@ -109,7 +109,8 @@ class instance_zulaman : public InstanceMapScript bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } @@ -188,7 +189,9 @@ class instance_zulaman : public InstanceMapScript void Load(const char* load) { - if (!load) return; + if (!load) + return; + std::istringstream ss(load); //sLog->outError("TSCR: Zul'aman loaded, %s.", ss.str().c_str()); char dataHead; // S diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index e4fa3804b9b..ae1b0ba0c67 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -68,7 +68,6 @@ public: { instance = creature->GetInstanceScript(); go = false; - pos = 0; } uint32 SwarmTimer; @@ -76,7 +75,6 @@ public: uint32 AuraTimer; uint32 InfernoTimer; bool go; - uint32 pos; void Reset() { @@ -119,7 +117,6 @@ public: void WaypointReached(uint32 i) { - pos = i; if (i == 7 && instance) { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp index b87379d599f..1eaaf418598 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp @@ -110,7 +110,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index 4935fb6b906..5dd603a7f92 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -607,7 +607,8 @@ public: if (WisperTimer <= diff) { Map* map = me->GetMap(); - if (!map->IsDungeon()) return; + if (!map->IsDungeon()) + return; //Play random sound to the zone Map::PlayerList const &PlayerList = map->GetPlayers(); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp index 38ea8e8748b..f1cc0b401c3 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp @@ -117,7 +117,7 @@ public: return 0; } - uint64 GetData64 (uint32 identifier) + uint64 GetData64(uint32 identifier) { switch (identifier) { diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp index f8b1364437b..91d90ffe202 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp @@ -199,18 +199,6 @@ public: +## go_troll_cage +######*/ -void initBlyCrewMember(InstanceScript* instance, uint32 entry, float x, float y, float z) -{ - if (Creature* crew = instance->instance->GetCreature(instance->GetData64(entry))) - { - crew->SetReactState(REACT_AGGRESSIVE); - crew->SetWalk(true); - crew->SetHomePosition(x, y, z, 0); - crew->GetMotionMaster()->MovePoint(1, x, y, z); - crew->setFaction(FACTION_FREED); - } -} - class go_troll_cage : public GameObjectScript { public: @@ -231,6 +219,18 @@ public: return false; } +private: + void initBlyCrewMember(InstanceScript* instance, uint32 entry, float x, float y, float z) + { + if (Creature* crew = instance->instance->GetCreature(instance->GetData64(entry))) + { + crew->SetReactState(REACT_AGGRESSIVE); + crew->SetWalk(true); + crew->SetHomePosition(x, y, z, 0); + crew->GetMotionMaster()->MovePoint(1, x, y, z); + crew->setFaction(FACTION_FREED); + } + } }; /*###### diff --git a/src/server/scripts/Kalimdor/durotar.cpp b/src/server/scripts/Kalimdor/durotar.cpp index 710f1e55871..88bc3352ea1 100644 --- a/src/server/scripts/Kalimdor/durotar.cpp +++ b/src/server/scripts/Kalimdor/durotar.cpp @@ -55,7 +55,7 @@ public: uint32 m_uiRebuffTimer; bool work; - void Reset () + void Reset() { uiPlayerGUID = 0; m_uiRebuffTimer = 0; diff --git a/src/server/scripts/Kalimdor/the_barrens.cpp b/src/server/scripts/Kalimdor/the_barrens.cpp index f05d7691c61..89f1ac3e7a5 100644 --- a/src/server/scripts/Kalimdor/the_barrens.cpp +++ b/src/server/scripts/Kalimdor/the_barrens.cpp @@ -385,7 +385,8 @@ public: void MoveInLineOfSight(Unit* who) { - if (!who || (!who->isAlive())) return; + if (!who || (!who->isAlive())) + return; if (me->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress) { @@ -433,8 +434,10 @@ public: if (BigWill) { Creature* creature = Unit::GetCreature((*me), BigWill); - if (creature) { - if (creature->isAlive()) { + if (creature) + { + if (creature->isAlive()) + { creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); creature->setDeathState(JUST_DIED); diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp index 3ae78d4053b..ef5214581ce 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp @@ -87,7 +87,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } @@ -236,7 +237,8 @@ public: for (std::set::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr) { Creature* cr = instance->GetCreature(*itr); - if (!cr || (cr && cr->isAlive())) return 0; + if (!cr || (cr && cr->isAlive())) + return 0; } return 1; case DATA_JEDOGA_TRIGGER_SWITCH: return switchtrigger; diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp index 699043b3269..1e5567bda82 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp @@ -136,7 +136,8 @@ public: void UpdateAI(const uint32 diff) { //Return since we have no target - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; // Without he comes up through the air to players on the bridge after krikthir if players crossing this bridge! CheckDistance(fMaxDistance, diff); diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp index e00db5d6494..12622174e29 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp @@ -64,7 +64,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (auiEncounter[i] == IN_PROGRESS) return true; + if (auiEncounter[i] == IN_PROGRESS) + return true; return false; } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp index 9838f20772c..d232be4577a 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp @@ -408,7 +408,8 @@ struct boss_faction_championsAI : public ScriptedAI void AttackStart(Unit* who) { - if (!who) return; + if (!who) + return; if (me->Attack(who, true)) { @@ -494,7 +495,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiNatureGraspTimer <= uiDiff) { @@ -588,7 +590,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiHeroismOrBloodlustTimer <= uiDiff) { @@ -687,7 +690,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiBubbleTimer <= uiDiff) { @@ -786,7 +790,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiPsychicScreamTimer <= uiDiff) { @@ -879,7 +884,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiPsychicScreamTimer <= uiDiff) { @@ -990,7 +996,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiFearTimer <= uiDiff) { @@ -1093,7 +1100,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiCounterspellTimer <= uiDiff) { @@ -1204,7 +1212,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiDisengageTimer <= uiDiff) { @@ -1312,7 +1321,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiBarkskinTimer <= uiDiff) { @@ -1424,7 +1434,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiBladestormTimer <= uiDiff) { @@ -1534,7 +1545,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiIceboundFortitudeTimer <= uiDiff) { @@ -1636,7 +1648,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiFanOfKnivesTimer <= uiDiff) { @@ -1773,7 +1786,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiHeroismOrBloodlustTimer <= uiDiff) { @@ -1873,7 +1887,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiRepeteanceTimer <= uiDiff) { @@ -1951,7 +1966,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiDevourMagicTimer <= uiDiff) { @@ -2000,7 +2016,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiClawTimer <= uiDiff) { @@ -2011,11 +2028,8 @@ public: boss_faction_championsAI::UpdateAI(uiDiff); } }; - }; -/*========================================================*/ - void AddSC_boss_faction_champions() { new boss_toc_champion_controller(); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index 1e5bdff8ee1..5bda32941c2 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -454,7 +454,8 @@ struct boss_jormungarAI : public ScriptedAI void UpdateAI(uint32 const diff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (instanceScript && instanceScript->GetData(TYPE_NORTHREND_BEASTS) == SNAKES_SPECIAL && !enraged) { diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index e61347a5027..c2901d16fa1 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -199,7 +199,8 @@ struct boss_twin_baseAI : public ScriptedAI void MovementInform(uint32 uiType, uint32 uiId) { - if (uiType != POINT_MOTION_TYPE) return; + if (uiType != POINT_MOTION_TYPE) + return; switch (uiId) { @@ -585,7 +586,8 @@ struct mob_unleashed_ballAI : public ScriptedAI void MovementInform(uint32 uiType, uint32 uiId) { - if (uiType != POINT_MOTION_TYPE) return; + if (uiType != POINT_MOTION_TYPE) + return; switch (uiId) { diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp index aa1b9e59501..1d4961eb8b4 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -388,7 +388,8 @@ class npc_fizzlebang_toc : public CreatureScript void MovementInform(uint32 uiType, uint32 uiId) { - if (uiType != POINT_MOTION_TYPE) return; + if (uiType != POINT_MOTION_TYPE) + return; switch (uiId) { @@ -411,9 +412,11 @@ class npc_fizzlebang_toc : public CreatureScript void UpdateAI(const uint32 uiDiff) { - if (!instance) return; + if (!instance) + return; - if (instance->GetData(TYPE_EVENT_NPC) != NPC_FIZZLEBANG) return; + if (instance->GetData(TYPE_EVENT_NPC) != NPC_FIZZLEBANG) + return; m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER); if (m_uiUpdateTimer <= uiDiff) @@ -537,8 +540,11 @@ class npc_tirion_toc : public CreatureScript void UpdateAI(const uint32 uiDiff) { - if (!instance) return; - if (instance->GetData(TYPE_EVENT_NPC) != NPC_TIRION) return; + if (!instance) + return; + + if (instance->GetData(TYPE_EVENT_NPC) != NPC_TIRION) + return; m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER); if (m_uiUpdateTimer <= uiDiff) @@ -833,8 +839,11 @@ class npc_garrosh_toc : public CreatureScript void UpdateAI(const uint32 uiDiff) { - if (!instance) return; - if (instance->GetData(TYPE_EVENT_NPC) != NPC_GARROSH) return; + if (!instance) + return; + + if (instance->GetData(TYPE_EVENT_NPC) != NPC_GARROSH) + return; m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER); if (m_uiUpdateTimer <= uiDiff) @@ -911,8 +920,11 @@ class npc_varian_toc : public CreatureScript void UpdateAI(const uint32 uiDiff) { - if (!instance) return; - if (instance->GetData(TYPE_EVENT_NPC) != NPC_VARIAN) return; + if (!instance) + return; + + if (instance->GetData(TYPE_EVENT_NPC) != NPC_VARIAN) + return; m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER); if (m_uiUpdateTimer <= uiDiff) diff --git a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp index 8e5e7c3e185..aff3f1b8e36 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp @@ -83,7 +83,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } diff --git a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp index aad382e3ad1..c22a0e17cd5 100644 --- a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp +++ b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp @@ -131,7 +131,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 20a46c953ab..1bc5563acfa 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -643,7 +643,7 @@ class boss_flame_leviathan_defense_cannon : public CreatureScript uint32 NapalmTimer; - void Reset () + void Reset() { NapalmTimer = 5*IN_MILLISECONDS; DoCast(me, AURA_STEALTH_DETECTION); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp index 6ecc1883afc..fda4767e16b 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp @@ -100,7 +100,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp index cb596f284c5..26fbbf4d717 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp @@ -97,7 +97,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp index 8c92f474ccf..79c54880430 100644 --- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp @@ -221,7 +221,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } diff --git a/src/server/scripts/Northrend/grizzly_hills.cpp b/src/server/scripts/Northrend/grizzly_hills.cpp index 7894d87df7c..d1ea6742298 100644 --- a/src/server/scripts/Northrend/grizzly_hills.cpp +++ b/src/server/scripts/Northrend/grizzly_hills.cpp @@ -477,7 +477,7 @@ public: uint32 DespawnTimer; - void Reset () + void Reset() { DespawnTimer = 5000; uiPlayerGUID = 0; diff --git a/src/server/scripts/Northrend/howling_fjord.cpp b/src/server/scripts/Northrend/howling_fjord.cpp index e29b6462835..49bf06f55c4 100644 --- a/src/server/scripts/Northrend/howling_fjord.cpp +++ b/src/server/scripts/Northrend/howling_fjord.cpp @@ -71,7 +71,7 @@ public: npc_Apothecary_HanesAI(Creature* creature) : npc_escortAI(creature){} uint32 PotTimer; - void Reset () + void Reset() { SetDespawnAtFar(false); PotTimer = 10000; //10 sec cooldown on potion diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp index 1a9155dacb2..846669552ba 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp @@ -75,7 +75,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 7468d522e57..d5d694fa395 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -566,7 +566,9 @@ public: void KilledUnit(Unit* victim) { - if (victim == me) return; + if (victim == me) + return; + // TODO: Find better way to handle emote switch (urand(0, 1)) { @@ -747,7 +749,8 @@ public: final.y = 2 * final.y - initial.y; Creature* Trigger = me->SummonCreature(23069, initial.x, initial.y, initial.z, 0, TEMPSUMMON_TIMED_DESPAWN, 13000); - if (!Trigger) return; + if (!Trigger) + return; Trigger->SetSpeed(MOVE_WALK, 3); Trigger->SetWalk(true); @@ -2137,9 +2140,11 @@ public: void UpdateAI(const uint32 /*diff*/) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; - if (me->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players. + if (me->getVictim()->GetTypeId() != TYPEID_PLAYER) + return; // Only cast the below on players. if (!me->getVictim()->HasAura(SPELL_PARALYZE)) { diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp index fc2d663951d..c83fa4ac62c 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -197,8 +197,11 @@ public: uint32 random = rand()%6; float x = Coords[random].x; float y = Coords[random].y; + Creature* Soul = me->SummonCreature(CREATURE_ENSLAVED_SOUL, x, y, me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0); - if (!Soul) return false; + if (!Soul) + return false; + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { CAST_AI(npc_enslaved_soul::npc_enslaved_soulAI, Soul->AI())->ReliquaryGUID = me->GetGUID(); diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp index 88b1648219b..005ed337b65 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -320,7 +320,8 @@ public: void AttackStart(Unit* who) { - if (!who || IsBanished) return; + if (!who || IsBanished) + return; if (who->isTargetableForAttack() && who != me) DoStartMovement(who); diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp index 49323af0952..aa0f5be6e07 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp @@ -316,7 +316,8 @@ public: void SetThreatList(Creature* Blossom) { - if (!Blossom) return; + if (!Blossom) + return; std::list& m_threatlist = me->getThreatManager().getThreatList(); std::list::const_iterator i = m_threatlist.begin(); diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp index 7d1c07ac91a..7d88a3b0ad4 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp @@ -130,7 +130,9 @@ public: bool RemoveImpalingSpine() { - if (!SpineTargetGUID) return false; + if (!SpineTargetGUID) + return false; + Unit* target = Unit::GetUnit(*me, SpineTargetGUID); if (target && target->HasAura(SPELL_IMPALING_SPINE)) target->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE); diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index a4cae747bd7..11d47ac29b1 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -313,7 +313,8 @@ public: void UpdateAI(const uint32 diff) { - if (!EventBegun) return; + if (!EventBegun) + return; if (EndEventTimer) { diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp index d4184a0b145..677a47c3a65 100644 --- a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp @@ -118,7 +118,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp index 19d0cfbbc94..ecca909914c 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp @@ -112,7 +112,8 @@ public: void EnterCombat(Unit* /*who*/) { - if (!victimGUID) return; + if (!victimGUID) + return; } void UpdateAI(const uint32 diff) diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp index 8ed1f897f3c..00de1802bc9 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp @@ -383,12 +383,11 @@ public: void MoveInLineOfSight(Unit* who) { - if (!who || me->getVictim()) return; + if (!who || me->getVictim()) + return; if (who->isInAccessiblePlaceFor(me) && me->IsValidAttackTarget(who) && me->IsWithinDistInMap(who, 45)) - { AttackStart(who); - } } void UpdateAI(const uint32 diff) diff --git a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp index bd4f91e8e39..5ea64250689 100644 --- a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp +++ b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp @@ -77,7 +77,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp index 7aba4db9ad9..082d7df10d6 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp @@ -158,7 +158,9 @@ class boss_kelidan_the_breaker : public CreatureScript uint64 GetChanneled(Creature* channeler1) { SummonChannelers(); - if (!channeler1) return 0; + if (!channeler1) + return 0; + uint8 i; for (i=0; i<5; ++i) { diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp index caaedc4c51b..cb55d627f7d 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp @@ -80,7 +80,9 @@ class instance_magtheridons_lair : public InstanceMapScript bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + return false; } diff --git a/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp index 1ec4a6e55ec..f25b6749055 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp @@ -78,7 +78,8 @@ class instance_the_eye : public InstanceMapScript bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp index 9db2b660d2a..ad3c899237f 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp @@ -66,7 +66,7 @@ class instance_mechanar : public InstanceMapScript return false; } - uint64 GetData64 (uint32 /*identifier*/) + uint64 GetData64(uint32 /*identifier*/) { return 0; } diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp index 6a27d295ebc..3b907f1d000 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp @@ -93,7 +93,8 @@ class instance_arcatraz : public InstanceMapScript bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index 2d4e870629f..beab023b679 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -492,7 +492,8 @@ public: void MoveInLineOfSight(Unit* who) { - if (!who || (!who->isAlive())) return; + if (!who || (!who->isAlive())) + return; if (me->IsWithinDistInMap(who, 50.0f)) { diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp index 2f6e0823da1..dbdd369dc82 100644 --- a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp +++ b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp @@ -18,7 +18,7 @@ #include "ScriptPCH.h" -enum Yells +enum Texts { SAY_INTRO = 0, SAY_AGGRO = 1, diff --git a/src/server/scripts/Outland/boss_doomwalker.cpp b/src/server/scripts/Outland/boss_doomwalker.cpp index c4bd232cc85..664ad215c72 100644 --- a/src/server/scripts/Outland/boss_doomwalker.cpp +++ b/src/server/scripts/Outland/boss_doomwalker.cpp @@ -18,7 +18,7 @@ #include "ScriptPCH.h" -enum Yells +enum Texts { SAY_AGGRO = 0, SAY_EARTHQUAKE = 1, diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp index ba152252e0a..13c2a280dbe 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/netherstorm.cpp @@ -394,7 +394,7 @@ public: struct npc_commander_dawnforgeAI : public ScriptedAI { - npc_commander_dawnforgeAI(Creature* creature) : ScriptedAI(creature) { Reset (); } + npc_commander_dawnforgeAI(Creature* creature) : ScriptedAI(creature) { Reset(); } uint64 PlayerGUID; uint64 ardonisGUID; diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index 94e71e55a67..234b672d08b 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -1727,7 +1727,7 @@ public: { npc_enraged_spiritAI(Creature* creature) : ScriptedAI(creature) {} - void Reset() { } + void Reset() { } void EnterCombat(Unit* /*who*/){} @@ -1739,7 +1739,8 @@ public: uint32 entry = 0; uint32 credit = 0; - switch (me->GetEntry()) { + switch (me->GetEntry()) + { case ENTRY_ENRAGED_FIRE_SPIRIT: entry = ENTRY_FIERY_SOUL; //credit = SPELL_FIERY_SOUL_CAPTURED_CREDIT; diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 15a931b056b..60ddf8990a7 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -148,9 +148,8 @@ public: bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->HasSkill(SKILL_TAILORING) && player->GetBaseSkillValue(SKILL_TAILORING) >= 280 && !player->HasSpell(26086)) - { player->CastSpell(player, 26095, false); - } + return true; } }; @@ -167,9 +166,8 @@ public: bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->HasSkill(SKILL_ENGINEERING) && player->GetBaseSkillValue(SKILL_ENGINEERING) >= 300 && !player->HasSpell(22704)) - { player->CastSpell(player, 22864, false); - } + return true; } }; @@ -232,9 +230,8 @@ public: bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->HasSkill(SKILL_ALCHEMY) && player->GetSkillValue(SKILL_ALCHEMY) >= 300 && !player->HasSpell(24266)) - { player->CastSpell(player, 24267, false); - } + return true; } }; @@ -273,7 +270,7 @@ public: bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->GetQuestStatus(10111) == QUEST_STATUS_INCOMPLETE) - player->CastSpell(player, 33382, true); + player->CastSpell(player, 33382, true); return true; } @@ -492,6 +489,7 @@ enum eDalaranCrystal }; #define GO_TELE_TO_DALARAN_CRYSTAL_FAILED "This teleport crystal cannot be used until the teleport crystal in Dalaran has been used at least once." + class go_tele_to_dalaran_crystal : public GameObjectScript { public: @@ -500,11 +498,9 @@ public: bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->GetQuestRewardStatus(QUEST_TELE_CRYSTAL_FLAG)) - { return false; - } - else - player->GetSession()->SendNotification(GO_TELE_TO_DALARAN_CRYSTAL_FAILED); + + player->GetSession()->SendNotification(GO_TELE_TO_DALARAN_CRYSTAL_FAILED); return true; } @@ -577,7 +573,7 @@ public: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_RETURN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_ITEM_TEXT_RETURN, go->GetGUID()); break; - case GOSSIP_ACTION_INFO_DEF + 2: + case GOSSIP_ACTION_INFO_DEF + 2: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_TEXT, go->GetGUID()); From a50fbb45bef6a425f835b3792af6b6f167e73667 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 16 Mar 2012 12:43:07 +0100 Subject: [PATCH 0190/1149] Core/DBC: Updated ScalingStatValues format string --- src/server/game/DataStores/DBCfmt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index ce887cac09b..39d031e96f9 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -91,7 +91,7 @@ const char QuestFactionRewardfmt[]="niiiiiiiiii"; const char PvPDifficultyfmt[]="diiiii"; const char RandomPropertiesPointsfmt[]="niiiiiiiiiiiiiii"; const char ScalingStatDistributionfmt[]="niiiiiiiiiiiiiiiiiiiii"; -const char ScalingStatValuesfmt[]="iniiiiiiiiiiiiiiiiixiiii"; +const char ScalingStatValuesfmt[]="iniiiiiiiiiiiiiiiiiiiiii"; const char SkillLinefmt[]="nixssssssssssssssssxxxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxi"; const char SkillLineAbilityfmt[]="niiiixxiiiiixx"; const char SoundEntriesfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; From cd38e7df2ba09b20f1ea8d778e9b6fe1e0365740 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Fri, 16 Mar 2012 20:31:23 +0800 Subject: [PATCH 0191/1149] Core/Script: Code style. Signed-off-by: Gyx <2359980687@qq.com> --- .../EasternKingdoms/ZulAman/boss_janalai.cpp | 3 ++- .../EasternKingdoms/ZulAman/zulaman.cpp | 21 ++++++++++----- .../CavernsOfTime/DarkPortal/dark_portal.cpp | 4 +-- .../Kalimdor/ZulFarrak/instance_zulfarrak.cpp | 6 +++-- src/server/scripts/Kalimdor/darkshore.cpp | 1 - src/server/scripts/Kalimdor/felwood.cpp | 9 +++---- .../scripts/Northrend/grizzly_hills.cpp | 20 ++++++-------- .../Outland/BlackTemple/boss_illidan.cpp | 5 +++- .../BlackTemple/boss_shade_of_akama.cpp | 26 ++++++++++--------- .../BlackTemple/boss_teron_gorefiend.cpp | 6 +++-- src/server/scripts/World/npc_professions.cpp | 6 ++--- 11 files changed, 59 insertions(+), 48 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index bbaafa63979..f2e6647dc59 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -221,7 +221,8 @@ class boss_janalai : public CreatureScript dy = float(irand(-area_dy/2, area_dy/2)); Creature* bomb = DoSpawnCreature(MOB_FIRE_BOMB, dx, dy, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 15000); - if (bomb) FireBombGUIDs[i] = bomb->GetGUID(); + if (bomb) + FireBombGUIDs[i] = bomb->GetGUID(); } BombCount = 0; } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index a78ec29be99..35b9781ea45 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -120,24 +120,29 @@ static uint32 ChestEntry[] = {186648, 187021, 186672, 186667}; class npc_zulaman_hostage : public CreatureScript { public: - - npc_zulaman_hostage() - : CreatureScript("npc_zulaman_hostage") - { - } + npc_zulaman_hostage() : CreatureScript("npc_zulaman_hostage") { } struct npc_zulaman_hostageAI : public ScriptedAI { - npc_zulaman_hostageAI(Creature* creature) : ScriptedAI(creature) {IsLoot = false;} + npc_zulaman_hostageAI(Creature* creature) : ScriptedAI(creature) + { + IsLoot = false; + } + bool IsLoot; uint64 PlayerGUID; + void Reset() {} + void EnterCombat(Unit* /*who*/) {} + void JustDied(Unit* /*who*/) { Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (player) player->SendLoot(me->GetGUID(), LOOT_CORPSE); + if (player) + player->SendLoot(me->GetGUID(), LOOT_CORPSE); } + void UpdateAI(const uint32 /*diff*/) { if (IsLoot) @@ -160,11 +165,13 @@ class npc_zulaman_hostage : public CreatureScript bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); + if (action == GOSSIP_ACTION_INFO_DEF + 1) player->CLOSE_GOSSIP_MENU(); if (!creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) return true; + creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); InstanceScript* instance = creature->GetInstanceScript(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp index 7625d22119f..0e155be515a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp @@ -111,7 +111,7 @@ public: instance->SetData(TYPE_MEDIVH, IN_PROGRESS); DoCast(me, SPELL_CHANNEL, false); Check_Timer = 5000; - } + } else if (who->GetTypeId() == TYPEID_UNIT && me->IsWithinDistInMap(who, 15.0f)) { if (instance->GetData(TYPE_MEDIVH) != IN_PROGRESS) @@ -170,7 +170,7 @@ public: { if (SpellCorrupt_Timer <= diff) { - instance->SetData(TYPE_MEDIVH, SPECIAL); + instance->SetData(TYPE_MEDIVH, SPECIAL); if (me->HasAura(SPELL_CORRUPT_AEONUS)) SpellCorrupt_Timer = 1000; diff --git a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp index da29c911c9f..b6c69584358 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp @@ -308,7 +308,8 @@ public: } } - void SpawnPyramidWave(uint32 wave){ + void SpawnPyramidWave(uint32 wave) + { for (int i = 0; i < pyramidSpawnTotal; i++) { if (pyramidSpawns[i][0] == (float)wave) @@ -321,7 +322,8 @@ public: } } - bool IsWaveAllDead(){ + bool IsWaveAllDead() + { for (std::list::iterator itr = addsAtBase.begin(); itr != addsAtBase.end(); ++itr) { if (Creature* add = instance->GetCreature((*itr))) diff --git a/src/server/scripts/Kalimdor/darkshore.cpp b/src/server/scripts/Kalimdor/darkshore.cpp index 0d83ea5ad03..a4c8ce3b004 100644 --- a/src/server/scripts/Kalimdor/darkshore.cpp +++ b/src/server/scripts/Kalimdor/darkshore.cpp @@ -234,7 +234,6 @@ public: void WaypointReached(uint32 i) { Player* player = GetPlayerForEscort(); - if (!player) return; diff --git a/src/server/scripts/Kalimdor/felwood.cpp b/src/server/scripts/Kalimdor/felwood.cpp index d540d522326..e1f59ec26be 100644 --- a/src/server/scripts/Kalimdor/felwood.cpp +++ b/src/server/scripts/Kalimdor/felwood.cpp @@ -53,12 +53,12 @@ public: bool OnGossipHello(Player* player, Creature* creature) { - uint32 eCreature = creature->GetEntry(); - if (creature->isQuestGiver()) player->PrepareQuestMenu(creature->GetGUID()); - if (eCreature == 9528) + uint32 creatureId = creature->GetEntry(); + + if (creatureId == 9528) { if (player->GetQuestRewardStatus(4101)) { @@ -70,7 +70,7 @@ public: player->SEND_GOSSIP_MENU(2844, creature->GetGUID()); } - if (eCreature == 9529) + if (creatureId == 9529) { if (player->GetQuestRewardStatus(4102)) { @@ -84,7 +84,6 @@ public: return true; } - }; void AddSC_felwood() diff --git a/src/server/scripts/Northrend/grizzly_hills.cpp b/src/server/scripts/Northrend/grizzly_hills.cpp index d1ea6742298..86e925573ad 100644 --- a/src/server/scripts/Northrend/grizzly_hills.cpp +++ b/src/server/scripts/Northrend/grizzly_hills.cpp @@ -194,9 +194,7 @@ public: if (HasEscortState(STATE_ESCORT_ESCORTING)) { if (m_uiChatTimer <= uiDiff) - { m_uiChatTimer = 12000; - } else m_uiChatTimer -= uiDiff; } @@ -209,9 +207,7 @@ public: { DoScriptText(SAY_QUEST_ACCEPT, creature); if (Creature* Mrfloppy = GetClosestCreatureWithEntry(creature, NPC_MRFLOPPY, 180.0f)) - { Mrfloppy->GetMotionMaster()->MoveFollow(creature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); - } if (npc_escortAI* pEscortAI = CAST_AI(npc_emily::npc_emilyAI, (creature->AI()))) pEscortAI->Start(true, false, player->GetGUID()); @@ -318,7 +314,7 @@ public: void SpellHit(Unit* pCaster, const SpellInfo* pSpell) { if (pSpell->Id == SPELL_OUTHOUSE_GROANS) - { + { ++m_counter; if (m_counter < 5) DoCast(pCaster, SPELL_CAMERA_SHAKE, true); @@ -503,7 +499,6 @@ public: me->SetStandState(UNIT_STAND_STATE_STAND); me->DespawnOrUnsummon(DespawnTimer); } - } } @@ -511,6 +506,7 @@ public: { if (!UpdateVictim()) return; + DoMeleeAttackIfReady(); } }; @@ -695,12 +691,12 @@ public: void AddSC_grizzly_hills() { - new npc_emily; - new npc_mrfloppy; - new npc_outhouse_bunny; - new npc_tallhorn_stag; - new npc_amberpine_woodsman; - new npc_wounded_skirmisher; + new npc_emily(); + new npc_mrfloppy(); + new npc_outhouse_bunny(); + new npc_tallhorn_stag(); + new npc_amberpine_woodsman(); + new npc_wounded_skirmisher(); new npc_lightning_sentry(); new npc_venture_co_straggler(); } diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index d5d694fa395..ad9d9f67ae1 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -430,7 +430,10 @@ public: } } - void SetGlaiveGUID(uint64 guid){ GlaiveGUID = guid; } + void SetGlaiveGUID(uint64 guid) + { + GlaiveGUID = guid; + } void UpdateAI(const uint32 diff) { diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp index 005ed337b65..57a33f6bdd4 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -663,7 +663,8 @@ public: me->CombatStart(Shade); Shade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); Shade->SetTarget(me->GetGUID()); - if (player) Shade->AddThreat(player, 1.0f); + if (player) + Shade->AddThreat(player, 1.0f); DoZoneInCombat(Shade); EventBegun = true; } @@ -676,17 +677,19 @@ public: switch (id) { - case 0: ++WayPointId; break; + case 0: + ++WayPointId; + break; - case 1: - if (Creature* Shade = Unit::GetCreature(*me, ShadeGUID)) - { - me->SetTarget(ShadeGUID); - DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE); - EndingTalkCount = 0; - SoulRetrieveTimer = 16000; - } - break; + case 1: + if (Creature* Shade = Unit::GetCreature(*me, ShadeGUID)) + { + me->SetTarget(ShadeGUID); + DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE); + EndingTalkCount = 0; + SoulRetrieveTimer = 16000; + } + break; } } @@ -879,7 +882,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_shade_of_akama() diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp index aa0f5be6e07..00113181a39 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp @@ -112,9 +112,11 @@ public: return; } - void SetTeronGUID(uint64 guid){ TeronGUID = guid; } + void SetTeronGUID(uint64 guid) + { + TeronGUID = guid; + } }; - }; class mob_shadowy_construct : public CreatureScript diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index a1920e06ad1..e84cd14dd20 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -544,11 +544,11 @@ public: if (creature->isTrainer()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); - uint32 eCreature = creature->GetEntry(); + uint32 creatureId = creature->GetEntry(); //WEAPONSMITH & ARMORSMITH if (player->GetBaseSkillValue(SKILL_BLACKSMITHING) >= 225) { - switch (eCreature) + switch (creatureId) { case 11145: //Myolor Sunderfury case 11176: //Krathok Moltenfist @@ -572,7 +572,7 @@ public: //WEAPONSMITH SPEC if (player->HasSpell(S_WEAPON) && player->getLevel() > 49 && player->GetBaseSkillValue(SKILL_BLACKSMITHING) >= 250) { - switch (eCreature) + switch (creatureId) { case 11191: //Lilith the Lithe if (!HasWeaponSub(player)) From e5afa4a950a2de40fd84f0e0fb1cc14468041087 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Fri, 16 Mar 2012 20:57:13 +0800 Subject: [PATCH 0192/1149] Core/Script: Clean-Up in Scripts. Item* pItem -> Item* item Signed-off-by: Gyx <2359980687@qq.com> --- src/server/scripts/Spells/spell_item.cpp | 4 +-- src/server/scripts/World/item_scripts.cpp | 34 ++++++++++---------- src/server/scripts/World/npc_professions.cpp | 8 ++--- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 079221a97e8..f2f2f9e3cdd 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -55,8 +55,8 @@ class spell_item_trigger_spell : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { Unit* caster = GetCaster(); - if (Item* pItem = GetCastItem()) - caster->CastSpell(caster, _triggeredSpellId, true, pItem); + if (Item* item = GetCastItem()) + caster->CastSpell(caster, _triggeredSpellId, true, item); } void Register() diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index cf55bb14895..bb5d7380695 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -47,9 +47,9 @@ class item_only_for_flight : public ItemScript public: item_only_for_flight() : ItemScript("item_only_for_flight") { } - bool OnUse(Player* player, Item* pItem, SpellCastTargets const& /*targets*/) + bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/) { - uint32 itemId = pItem->GetEntry(); + uint32 itemId = item->GetEntry(); bool disabled = false; //for special scripts @@ -74,7 +74,7 @@ public: return false; // error - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); + player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); return true; } }; @@ -110,13 +110,13 @@ class item_gor_dreks_ointment : public ItemScript public: item_gor_dreks_ointment() : ItemScript("item_gor_dreks_ointment") { } - bool OnUse(Player* player, Item* pItem, SpellCastTargets const& targets) + bool OnUse(Player* player, Item* item, SpellCastTargets const& targets) { if (targets.GetUnitTarget() && targets.GetUnitTarget()->GetTypeId() == TYPEID_UNIT && targets.GetUnitTarget()->GetEntry() == 20748 && !targets.GetUnitTarget()->HasAura(32578)) return false; - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); + player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); return true; } }; @@ -130,13 +130,13 @@ class item_incendiary_explosives : public ItemScript public: item_incendiary_explosives() : ItemScript("item_incendiary_explosives") { } - bool OnUse(Player* player, Item* pItem, SpellCastTargets const & /*targets*/) + bool OnUse(Player* player, Item* item, SpellCastTargets const & /*targets*/) { if (player->FindNearestCreature(26248, 15) || player->FindNearestCreature(26249, 15)) return false; else { - player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL); + player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL); return true; } } @@ -219,7 +219,7 @@ class item_pile_fake_furs : public ItemScript public: item_pile_fake_furs() : ItemScript("item_pile_fake_furs") { } - bool OnUse(Player* player, Item* /*pItem*/, SpellCastTargets const & /*targets*/) + bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const & /*targets*/) { GameObject* go = NULL; for (uint8 i = 0; i < CaribouTrapsNum; ++i) @@ -264,14 +264,14 @@ class item_petrov_cluster_bombs : public ItemScript public: item_petrov_cluster_bombs() : ItemScript("item_petrov_cluster_bombs") { } - bool OnUse(Player* player, Item* pItem, const SpellCastTargets & /*targets*/) + bool OnUse(Player* player, Item* item, const SpellCastTargets & /*targets*/) { if (player->GetZoneId() != ZONE_ID_HOWLING) return false; if (!player->GetTransport() || player->GetAreaId() != AREA_ID_SHATTERED_STRAITS) { - player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); + player->SendEquipError(EQUIP_ERR_NONE, item, NULL); if (const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB)) Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_HERE); @@ -330,7 +330,7 @@ class item_dehta_trap_smasher : public ItemScript public: item_dehta_trap_smasher() : ItemScript("item_dehta_trap_smasher") { } - bool OnUse(Player* player, Item* /*pItem*/, const SpellCastTargets & /*targets*/) + bool OnUse(Player* player, Item* /*item*/, const SpellCastTargets & /*targets*/) { if (player->GetQuestStatus(QUEST_CANNOT_HELP_THEMSELVES) != QUEST_STATUS_INCOMPLETE) return false; @@ -367,7 +367,7 @@ class item_trident_of_nazjan : public ItemScript public: item_trident_of_nazjan() : ItemScript("item_Trident_of_Nazjan") { } - bool OnUse(Player* player, Item* pItem, const SpellCastTargets & /*targets*/) + bool OnUse(Player* player, Item* item, const SpellCastTargets & /*targets*/) { if (player->GetQuestStatus(QUEST_THE_EMISSARY) == QUEST_STATUS_INCOMPLETE) { @@ -376,9 +376,9 @@ public: pLeviroth->AI()->AttackStart(player); return false; } else - player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL); + player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL); } else - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); + player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); return true; } }; @@ -394,17 +394,17 @@ class item_captured_frog : public ItemScript public: item_captured_frog() : ItemScript("item_captured_frog") { } - bool OnUse(Player* player, Item* pItem, SpellCastTargets const& /*targets*/) + bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/) { if (player->GetQuestStatus(QUEST_THE_PERFECT_SPIES) == QUEST_STATUS_INCOMPLETE) { if (player->FindNearestCreature(NPC_VANIRAS_SENTRY_TOTEM, 10.0f)) return false; else - player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL); + player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL); } else - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); + player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); return true; } }; diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index e84cd14dd20..0a04d049eaa 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -241,14 +241,14 @@ bool EquippedOk(Player* player, uint32 spellId) if (!reqSpell) continue; - Item* pItem; + Item* item = NULL; for (uint8 j = EQUIPMENT_SLOT_START; j < EQUIPMENT_SLOT_END; ++j) { - pItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, j); - if (pItem && pItem->GetTemplate()->RequiredSpell == reqSpell) + item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, j); + if (item && item->GetTemplate()->RequiredSpell == reqSpell) { //player has item equipped that require specialty. Not allow to unlearn, player has to unequip first - sLog->outDebug(LOG_FILTER_TSCR, "TSCR: player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, pItem->GetEntry()); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, item->GetEntry()); return false; } } From bea8fcfbfae74130cdf81937e059834b00b83239 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 16 Mar 2012 09:08:46 -0400 Subject: [PATCH 0193/1149] Core/Spells: fix shield slam giving nothing to dispel error. --- src/server/game/Spells/Spell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 0b05db07d38..3af200f7a56 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4959,7 +4959,7 @@ SpellCastResult Spell::CheckCast(bool strict) for (int i = 0; i < MAX_SPELL_EFFECTS; i++) if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_DISPEL) { - if (m_spellInfo->Effects[i].IsTargetingArea()) + if (m_spellInfo->Effects[i].IsTargetingArea() || m_spellInfo->AttributesEx & SPELL_ATTR1_MELEE_COMBAT_START) { hasDispellableAura = true; break; From d8b4bc590a55d6c062f88275e21661f0b31078ad Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Fri, 16 Mar 2012 21:41:15 +0800 Subject: [PATCH 0194/1149] Core/Script: Code style and remove unused core. Signed-off-by: Gyx <2359980687@qq.com> --- .../boss_headless_horseman.cpp | 22 +- .../ShadowfangKeep/shadowfang_keep.cpp | 5 +- .../scripts/EasternKingdoms/ghostlands.cpp | 2 +- .../BattleForMountHyjal/boss_azgalor.cpp | 3 - .../BattleForMountHyjal/boss_kazrogal.cpp | 3 - .../boss_rage_winterchill.cpp | 3 - .../BattleForMountHyjal/hyjal_trash.cpp | 48 ++-- .../ObsidianSanctum/boss_sartharion.cpp | 4 - .../Northrend/Ulduar/Ulduar/boss_kologarn.cpp | 7 +- .../UtgardeKeep/boss_ingvar_the_plunderer.cpp | 2 +- .../Outland/BlackTemple/boss_illidan.cpp | 6 +- .../BlackTemple/boss_shade_of_akama.cpp | 10 +- .../Outland/BlackTemple/boss_supremus.cpp | 11 +- .../Outland/TempestKeep/Eye/boss_kaelthas.cpp | 5 +- src/server/scripts/Outland/netherstorm.cpp | 1 - .../scripts/Outland/shadowmoon_valley.cpp | 228 +++++++++++++----- src/server/scripts/World/item_scripts.cpp | 4 +- 17 files changed, 240 insertions(+), 124 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 1ffed905167..31dc23d24af 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -296,8 +296,11 @@ public: if (spell->Id == SPELL_FLYING_HEAD) { - if (Phase < 3) ++Phase; - else Phase = 3; + if (Phase < 3) + ++Phase; + else + Phase = 3; + withbody = false; if (!bodyGUID) bodyGUID = caster->GetGUID(); @@ -486,12 +489,18 @@ public: instance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS); DoZoneInCombat(); } - void AttackStart(Unit* who) {ScriptedAI::AttackStart(who);} + + void AttackStart(Unit* who) + { + ScriptedAI::AttackStart(who); + } + void MoveInLineOfSight(Unit* who) { if (withhead && Phase != 0) ScriptedAI::MoveInLineOfSight(who); } + void KilledUnit(Unit* player) { if (player->GetTypeId() == TYPEID_PLAYER) @@ -596,6 +605,7 @@ public: if (!headGUID) headGUID = DoSpawnCreature(HEAD, float(rand()%6), float(rand()%6), 0, 0, TEMPSUMMON_DEAD_DESPAWN, 0)->GetGUID(); + Unit* Head = Unit::GetUnit((*me), headGUID); if (Head && Head->isAlive()) { @@ -815,7 +825,11 @@ public: } } - void JustDied(Unit* /*killer*/) { if (!sprouted) Despawn(); } + void JustDied(Unit* /*killer*/) + { + if (!sprouted) + Despawn(); + } void MoveInLineOfSight(Unit* who) { diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp index 09832007a0b..0ea55d170b3 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp @@ -175,10 +175,7 @@ public: if (uiDarkOffering <= uiDiff) { if (Creature* pFriend = me->FindNearestCreature(me->GetEntry(), 25.0f, true)) - { - if (pFriend) - DoCast(pFriend, SPELL_DARK_OFFERING); - } + DoCast(pFriend, SPELL_DARK_OFFERING); else DoCast(me, SPELL_DARK_OFFERING); uiDarkOffering = urand(4400, 12500); diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/ghostlands.cpp index 02bfcef45a3..841e577e333 100644 --- a/src/server/scripts/EasternKingdoms/ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/ghostlands.cpp @@ -183,7 +183,7 @@ public: DoScriptText(SAY_END2, me, player); Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50); if (CaptainHelios) - DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player); + DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player); break; } } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index 96a9d3b8bb6..dbcfbc8ed58 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -59,7 +59,6 @@ public: { instance = creature->GetInstanceScript(); go = false; - pos = 0; } uint32 RainTimer; @@ -70,7 +69,6 @@ public: bool enraged; bool go; - uint32 pos; void Reset() { @@ -115,7 +113,6 @@ public: void WaypointReached(uint32 i) { - pos = i; if (i == 7 && instance) { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index fa475da24a1..e58f9c3bf45 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -56,7 +56,6 @@ public: { instance = creature->GetInstanceScript(); go = false; - pos = 0; } uint32 CleaveTimer; @@ -64,7 +63,6 @@ public: uint32 MarkTimer; uint32 MarkTimerBase; bool go; - uint32 pos; void Reset() { @@ -107,7 +105,6 @@ public: void WaypointReached(uint32 i) { - pos = i; if (i == 7 && instance) { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp index f6578c5bf6e..7e628c0efa5 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp @@ -62,7 +62,6 @@ public: { instance = creature->GetInstanceScript(); go = false; - pos = 0; } uint32 FrostArmorTimer; @@ -70,7 +69,6 @@ public: uint32 NovaTimer; uint32 IceboltTimer; bool go; - uint32 pos; void Reset() { @@ -109,7 +107,6 @@ public: void WaypointReached(uint32 i) { - pos = i; if (i == 7 && instance) { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index 496e720fb31..23a04bece09 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -405,7 +405,6 @@ public: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetDisplayId(MODEL_INVIS); go = false; - pos = 0; Reset(); } @@ -413,7 +412,6 @@ public: bool CanMove; bool WpEnabled; bool go; - uint32 pos; uint32 spawnTimer; uint32 FlameBuffetTimer; bool imol; @@ -429,7 +427,6 @@ public: void WaypointReached(uint32 i) { - pos = i; if (i == 0 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall @@ -543,13 +540,11 @@ public: { instance = creature->GetInstanceScript(); go = false; - pos = 0; Reset(); } bool go; uint32 KnockDownTimer; - uint32 pos; void Reset() { KnockDownTimer = 10000; @@ -557,7 +552,6 @@ public: void WaypointReached(uint32 i) { - pos = i; if (i == 7 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall @@ -644,13 +638,11 @@ public: { instance = creature->GetInstanceScript(); go = false; - pos = 0; Reset(); } bool go; uint32 FrenzyTimer; - uint32 pos; uint32 MoveTimer; bool RandomMove; void Reset() @@ -662,7 +654,6 @@ public: void WaypointReached(uint32 i) { - pos = i; if (i == 7 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall @@ -753,13 +744,13 @@ public: { instance = creature->GetInstanceScript(); go = false; - pos = 0; Reset(); } + SummonList summons; bool go; uint32 ShadowBoltTimer; - uint32 pos; + void Reset() { ShadowBoltTimer = 1000+rand()%5000; @@ -773,10 +764,14 @@ public: summon->Attack(target, false); summons.Summon(summon); } - void SummonedCreatureDespawn(Creature* summon) {summons.Despawn(summon);} + + void SummonedCreatureDespawn(Creature* summon) + { + summons.Despawn(summon); + } + void WaypointReached(uint32 i) { - pos = i; if (i == 7 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall @@ -815,8 +810,10 @@ public: void UpdateAI(const uint32 diff) { hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) npc_escortAI::UpdateAI(diff); + if (IsEvent) { if (!go) @@ -840,8 +837,10 @@ public: } } } + if (!UpdateVictim()) return; + if (ShadowBoltTimer <= diff) { DoCast(me->getVictim(), SPELL_SHADOW_BOLT); @@ -874,7 +873,6 @@ public: { instance = creature->GetInstanceScript(); go = false; - pos = 0; Reset(); } @@ -882,7 +880,7 @@ public: uint32 CourseTimer; uint32 WailTimer; uint32 ShellTimer; - uint32 pos; + void Reset() { CourseTimer = 20000+rand()%5000; @@ -892,7 +890,6 @@ public: void WaypointReached(uint32 i) { - pos = i; if (i == 7 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall @@ -979,13 +976,12 @@ public: { instance = creature->GetInstanceScript(); go = false; - pos = 0; Reset(); } bool go; uint32 WebTimer; - uint32 pos; + void Reset() { WebTimer = 20000+rand()%5000; @@ -993,7 +989,6 @@ public: void WaypointReached(uint32 i) { - pos = i; if (i == 7 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall @@ -1071,13 +1066,12 @@ public: { instance = creature->GetInstanceScript(); go = false; - pos = 0; Reset(); } bool go; uint32 ManaBurnTimer; - uint32 pos; + void Reset() { ManaBurnTimer = 9000+rand()%5000; @@ -1085,7 +1079,6 @@ public: void WaypointReached(uint32 i) { - pos = i; if (i == 7 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall @@ -1163,13 +1156,11 @@ public: { instance = creature->GetInstanceScript(); go = false; - pos = 0; Reset(); } bool go; uint32 FrostBreathTimer; - uint32 pos; uint32 MoveTimer; void Reset() @@ -1181,7 +1172,6 @@ public: void WaypointReached(uint32 i) { - pos = i; if (i == 2 && instance && !IsOverrun) { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); @@ -1280,14 +1270,12 @@ public: { instance = creature->GetInstanceScript(); go = false; - pos = 0; DummyTarget[0] = 0;DummyTarget[1] = 0;DummyTarget[2] = 0; Reset(); } bool go; uint32 StrikeTimer; - uint32 pos; uint32 MoveTimer; float Zpos; bool forcemove; @@ -1303,7 +1291,6 @@ public: void WaypointReached(uint32 i) { - pos = i; if (i == 2 && instance && !IsOverrun) { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); @@ -1382,8 +1369,9 @@ public: float x, y, z; me->getVictim()->GetPosition(x, y, z); me->GetMotionMaster()->MovePoint(0, x, y, z+Zpos); - Zpos-=1.0f; - if (Zpos <= 0)Zpos=0; + Zpos -= 1.0f; + if (Zpos <= 0) + Zpos = 0; MoveTimer = 2000; } else MoveTimer-=diff; } diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp index 547544fb754..eeba4a8717d 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp @@ -926,9 +926,7 @@ struct dummy_dragonAI : public ScriptedAI if (instance && instance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS) instance->SetData(TYPE_SHADRON_PREKILLED, 1); if (Creature* pAcolyte = me->FindNearestCreature(NPC_ACOLYTE_OF_SHADRON, 100.0f)) - { pAcolyte->Kill(pAcolyte); - } break; case NPC_VESPERON: iTextId = SAY_VESPERON_DEATH; @@ -936,9 +934,7 @@ struct dummy_dragonAI : public ScriptedAI if (instance && instance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS) instance->SetData(TYPE_VESPERON_PREKILLED, 1); if (Creature* pAcolyte = me->FindNearestCreature(NPC_ACOLYTE_OF_VESPERON, 100.0f)) - { pAcolyte->Kill(pAcolyte); - } break; } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp index d5034e4827e..dd4a1c23d39 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp @@ -184,11 +184,8 @@ class boss_kologarn : public CreatureScript if (Creature* rubbleStalker = who->FindNearestCreature(NPC_RUBBLE_STALKER, 70.0f)) { - if (rubbleStalker) - { - rubbleStalker->CastSpell(rubbleStalker, SPELL_FALLING_RUBBLE, true); - rubbleStalker->CastSpell(rubbleStalker, SPELL_SUMMON_RUBBLE, true); - } + rubbleStalker->CastSpell(rubbleStalker, SPELL_FALLING_RUBBLE, true); + rubbleStalker->CastSpell(rubbleStalker, SPELL_SUMMON_RUBBLE, true); } if (!right && !left) diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp index e1f025f01c0..26ac516f209 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp @@ -445,6 +445,7 @@ public: void AttackStart(Unit* /*who*/) {} void MoveInLineOfSight(Unit* /*who*/) {} void EnterCombat(Unit* /*who*/) {} + void UpdateAI(const uint32 diff) { if (uiDespawnTimer <= diff) @@ -455,7 +456,6 @@ public: } else uiDespawnTimer -= diff; } }; - }; void AddSC_boss_ingvar_the_plunderer() diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index ad9d9f67ae1..6c14a54e42d 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -1187,7 +1187,11 @@ public: void EnterCombat(Unit* /*who*/) {} void MoveInLineOfSight(Unit* /*who*/) {} void EnterEvadeMode() {} - void GetIllidanGUID(uint64 guid) { IllidanGUID = guid; } + + void GetIllidanGUID(uint64 guid) + { + IllidanGUID = guid; + } void DamageTaken(Unit* done_by, uint32 &damage) { diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp index 57a33f6bdd4..630e44429fa 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -121,7 +121,10 @@ public: struct mob_ashtongue_channelerAI : public ScriptedAI { - mob_ashtongue_channelerAI(Creature* creature) : ScriptedAI(creature) {ShadeGUID = 0;} + mob_ashtongue_channelerAI(Creature* creature) : ScriptedAI(creature) + { + ShadeGUID = 0; + } uint64 ShadeGUID; @@ -147,7 +150,10 @@ public: struct mob_ashtongue_sorcererAI : public ScriptedAI { - mob_ashtongue_sorcererAI(Creature* creature) : ScriptedAI(creature) {ShadeGUID = 0;} + mob_ashtongue_sorcererAI(Creature* creature) : ScriptedAI(creature) + { + ShadeGUID = 0; + } uint64 ShadeGUID; uint32 CheckTimer; diff --git a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp index 15b9eebc869..cd804ad0d03 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp @@ -165,8 +165,15 @@ public: summons.DespawnAll(); } - void JustSummoned(Creature* summon) {summons.Summon(summon);} - void SummonedCreatureDespawn(Creature* summon) {summons.Despawn(summon);} + void JustSummoned(Creature* summon) + { + summons.Summon(summon); + } + + void SummonedCreatureDespawn(Creature* summon) + { + summons.Despawn(summon); + } Unit* CalculateHatefulStrikeTarget() { diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index f867612e91e..a70aabe3d85 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -445,7 +445,10 @@ class boss_kaelthas : public CreatureScript } } - void SummonedCreatureDespawn(Creature* summon) {summons.Despawn(summon);} + void SummonedCreatureDespawn(Creature* summon) + { + summons.Despawn(summon); + } void JustDied(Unit* /*Killer*/) { diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp index 13c2a280dbe..5bd6ff795eb 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/netherstorm.cpp @@ -647,7 +647,6 @@ public: if (player->isAlive() && player->GetQuestStatus(QUEST_INFO_GATHERING) == QUEST_STATUS_INCOMPLETE) { Creature* Dawnforge = player->FindNearestCreature(CreatureEntry[1], 30.0f); - if (!Dawnforge) return false; diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index 234b672d08b..96b1247c152 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -241,7 +241,6 @@ public: DoCast(caster, SPELL_FORCE_OF_NELTHARAKU, true); Unit* Dragonmaw = me->FindNearestCreature(CREATURE_DRAGONMAW_SUBJUGATOR, 50); - if (Dragonmaw) { me->AddThreat(Dragonmaw, 100000.0f); @@ -760,7 +759,6 @@ public: uint32 NextStep(uint32 Step) { Unit* player = Unit::GetUnit((*me), PlayerGUID); - Unit* Illi = Unit::GetUnit((*me), IllidanGUID); if (!player || !Illi) @@ -771,27 +769,88 @@ public: switch (Step) { - case 0: return 0; break; - case 1: me->GetMotionMaster()->MovePoint(0, -5104.41f, 595.297f, 85.6838f); return 9000; break; - case 2: DoScriptText(OVERLORD_YELL_1, me, player); return 4500; break; - case 3: me->SetInFront(player); return 3200; break; - case 4: DoScriptText(OVERLORD_SAY_2, me, player); return 2000; break; - case 5: Illi->SetVisible(true); - Illi->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); return 350; break; + case 0: + return 0; + break; + + case 1: + me->GetMotionMaster()->MovePoint(0, -5104.41f, 595.297f, 85.6838f); + return 9000; + break; + + case 2: + DoScriptText(OVERLORD_YELL_1, me, player); + return 4500; + break; + + case 3: + me->SetInFront(player); + return 3200; + break; + + case 4: + DoScriptText(OVERLORD_SAY_2, me, player); + return 2000; + break; + + case 5: + Illi->SetVisible(true); + Illi->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + return 350; + break; + case 6: Illi->CastSpell(Illi, SPELL_ONE, true); Illi->SetTarget(me->GetGUID()); me->SetTarget(IllidanGUID); - return 2000; break; - case 7: DoScriptText(OVERLORD_YELL_2, me); return 4500; break; - case 8: me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); return 2500; break; - case 9: DoScriptText(OVERLORD_SAY_3, me); return 6500; break; - case 10: DoScriptText(LORD_ILLIDAN_SAY_1, Illi); return 5000; break; - case 11: DoScriptText(OVERLORD_SAY_4, me, player); return 6000; break; - case 12: DoScriptText(LORD_ILLIDAN_SAY_2, Illi); return 5500; break; - case 13: DoScriptText(LORD_ILLIDAN_SAY_3, Illi); return 4000; break; - case 14: Illi->SetTarget(PlayerGUID); return 1500; break; - case 15: DoScriptText(LORD_ILLIDAN_SAY_4, Illi); return 1500; break; + return 2000; + break; + + case 7: + DoScriptText(OVERLORD_YELL_2, me); + return 4500; + break; + + case 8: + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); + return 2500; + break; + + case 9: + DoScriptText(OVERLORD_SAY_3, me); + return 6500; + break; + + case 10: + DoScriptText(LORD_ILLIDAN_SAY_1, Illi); + return 5000; + break; + + case 11: + DoScriptText(OVERLORD_SAY_4, me, player); + return 6000; + break; + + case 12: + DoScriptText(LORD_ILLIDAN_SAY_2, Illi); + return 5500; + break; + + case 13: + DoScriptText(LORD_ILLIDAN_SAY_3, Illi); + return 4000; + break; + + case 14: + Illi->SetTarget(PlayerGUID); + return 1500; + break; + + case 15: + DoScriptText(LORD_ILLIDAN_SAY_4, Illi); + return 1500; + break; + case 16: if (player) { @@ -799,67 +858,124 @@ public: player->RemoveAurasDueToSpell(SPELL_THREE); player->RemoveAurasDueToSpell(SPELL_FOUR); return 5000; - }else{ - CAST_PLR(player)->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE); Step = 30; return 100; + } + else + { + CAST_PLR(player)->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE); + Step = 30; + return 100; } break; - case 17: DoScriptText(LORD_ILLIDAN_SAY_5, Illi); return 5000; break; - case 18: DoScriptText(LORD_ILLIDAN_SAY_6, Illi); return 5000; break; - case 19: DoScriptText(LORD_ILLIDAN_SAY_7, Illi); return 5000; break; + + case 17: + DoScriptText(LORD_ILLIDAN_SAY_5, Illi); + return 5000; + break; + + case 18: + DoScriptText(LORD_ILLIDAN_SAY_6, Illi); + return 5000; + break; + + case 19: + DoScriptText(LORD_ILLIDAN_SAY_7, Illi); + return 5000; + break; + case 20: Illi->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); Illi->SetDisableGravity(true); - return 500; break; - case 21: DoScriptText(OVERLORD_SAY_5, me); return 500; break; + return 500; + break; + + case 21: + DoScriptText(OVERLORD_SAY_5, me); + return 500; + break; + case 22: Illi->SetVisible(false); Illi->setDeathState(JUST_DIED); - return 1000; break; - case 23: me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); return 2000; break; - case 24: me->SetTarget(PlayerGUID); return 5000; break; - case 25: DoScriptText(OVERLORD_SAY_6, me); return 2000; break; + return 1000; + break; + + case 23: + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + return 2000; + break; + + case 24: + me->SetTarget(PlayerGUID); + return 5000; + break; + + case 25: + DoScriptText(OVERLORD_SAY_6, me); + return 2000; + break; + case 26: if (player) CAST_PLR(player)->GroupEventHappens(QUEST_LORD_ILLIDAN_STORMRAGE, me); - return 6000; break; + return 6000; + break; + case 27: { - Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); - if (Yarzill) - Yarzill->SetTarget(PlayerGUID); - return 500; } - break; + Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); + if (Yarzill) + Yarzill->SetTarget(PlayerGUID); + return 500; + } + break; + case 28: player->RemoveAurasDueToSpell(SPELL_TWO); player->RemoveAurasDueToSpell(41519); player->CastSpell(player, SPELL_THREE, true); player->CastSpell(player, SPELL_FOUR, true); - return 1000; break; + return 1000; + break; + case 29: { - Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); - if (Yarzill) - DoScriptText(YARZILL_THE_MERC_SAY, Yarzill, player); - return 5000; } - break; + Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); + if (Yarzill) + DoScriptText(YARZILL_THE_MERC_SAY, Yarzill, player); + return 5000; + } + break; + case 30: { - Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); - if (Yarzill) - Yarzill->SetTarget(0); - return 5000; } - break; + Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); + if (Yarzill) + Yarzill->SetTarget(0); + return 5000; + } + break; + case 31: { - Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); - if (Yarzill) - Yarzill->CastSpell(player, 41540, true); - return 1000;} - break; - case 32: me->GetMotionMaster()->MovePoint(0, -5085.77f, 577.231f, 86.6719f); return 5000; break; - case 33: Reset(); return 100; break; + Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); + if (Yarzill) + Yarzill->CastSpell(player, 41540, true); + return 1000; + } + break; - default : return 0; + case 32: + me->GetMotionMaster()->MovePoint(0, -5085.77f, 577.231f, 86.6719f); return 5000; + break; + + case 33: + Reset(); + return 100; + break; + + default : + return 0; + break; } } @@ -871,9 +987,7 @@ public: if (ConversationTimer <= diff) { if (Event && IllidanGUID && PlayerGUID) - { ConversationTimer = NextStep(++Step); - } } else ConversationTimer -= diff; } }; diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index bb5d7380695..cb9b6162f0c 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -150,6 +150,7 @@ class item_mysterious_egg : public ItemScript { public: item_mysterious_egg() : ItemScript("item_mysterious_egg") { } + bool OnExpire(Player* player, ItemTemplate const* /*pItemProto*/) { ItemPosCountVec dest; @@ -335,8 +336,7 @@ public: if (player->GetQuestStatus(QUEST_CANNOT_HELP_THEMSELVES) != QUEST_STATUS_INCOMPLETE) return false; - Creature* pMammoth; - pMammoth = player->FindNearestCreature(NPC_TRAPPED_MAMMOTH_CALF, 5.0f); + Creature* pMammoth = player->FindNearestCreature(NPC_TRAPPED_MAMMOTH_CALF, 5.0f); if (!pMammoth) return false; From f8c04b1bc56fa67553a3e8706a07f5edf2ce183e Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Fri, 16 Mar 2012 17:10:01 +0100 Subject: [PATCH 0195/1149] Core/Movement: Fix players still able to fly on SPELL_AURA_FLY and SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED unapply. Closes #5731 --- src/server/game/Entities/Player/Player.cpp | 18 ++++++++ src/server/game/Entities/Player/Player.h | 7 ++++ src/server/game/Entities/Unit/Unit.cpp | 33 +++++++++++++++ src/server/game/Entities/Unit/Unit.h | 9 ++++ .../game/Spells/Auras/SpellAuraEffects.cpp | 42 +++++++------------ 5 files changed, 83 insertions(+), 26 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f0b974fa673..ffa216dd605 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -25173,3 +25173,21 @@ bool Player::SetHover(bool enable) return true; } + +void Player::SendMovementSetCanFly(bool apply) +{ + WorldPacket data(apply ? SMSG_MOVE_SET_CAN_FLY : SMSG_MOVE_UNSET_CAN_FLY, 12); + data.append(GetPackGUID()); + data << uint32(0); //! movement counter + SendDirectMessage(&data); +} + +void Player::SendMovementSetCanTransitionBetweenSwimAndFly(bool apply) +{ + WorldPacket data(apply ? + SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY : + SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, 12); + data.append(GetPackGUID()); + data << uint32(0); //! movement counter + SendDirectMessage(&data); +} diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 7f6b2322e93..a238247b3c1 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2483,6 +2483,13 @@ class Player : public Unit, public GridObject #pragma region Player Movement + + /*! These methods send different packets to the client in apply and unapply case. + These methods are only sent to the current unit. + */ + void SendMovementSetCanFly(bool apply); + void SendMovementSetCanTransitionBetweenSwimAndFly(bool apply); + bool CanFly() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY); } //! Return collision height sent to client diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index b60abc18753..202c26bd645 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17541,3 +17541,36 @@ void Unit::SendMovementFeatherFall() BuildMovementPacket(&data); SendMessageToSet(&data, true); } + +void Unit::SendMovementGravityChange() +{ + WorldPacket data(MSG_MOVE_GRAVITY_CHNG, 64); + data.append(GetPackGUID()); + BuildMovementPacket(&data); + SendMessageToSet(&data, true); +} + +void Unit::SendMovementCanFlyChange() +{ + /*! + if ( a3->MoveFlags & MOVEMENTFLAG_CAN_FLY ) + { + v4->MoveFlags |= 0x1000000u; + result = 1; + } + else + { + if ( v4->MoveFlags & MOVEMENTFLAG_FLYING ) + CMovement::DisableFlying(v4); + v4->MoveFlags &= 0xFEFFFFFFu; + result = 1; + } + */ + if (GetTypeId() == TYPEID_PLAYER) + ToPlayer()->SendMovementSetCanFly(CanFly()); + + WorldPacket data(MSG_MOVE_UPDATE_CAN_FLY, 64); + data.append(GetPackGUID()); + BuildMovementPacket(&data); + SendMessageToSet(&data, true); +} diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index f09bf89a9c7..0e24fdffa9d 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1631,9 +1631,18 @@ class Unit : public WorldObject //void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = NULL); void SendMonsterMoveTransport(Unit* vehicleOwner); void SendMovementFlagUpdate(); + + /*! These methods send the same packet to the client in apply and unapply case. + The client-side interpretation of this packet depends on the presence of relevant movementflags + which are sent with movementinfo. Furthermore, these packets are broadcast to nearby players as well + as the current unit. + */ void SendMovementHover(); void SendMovementFeatherFall(); void SendMovementWaterWalking(); + void SendMovementGravityChange(); + void SendMovementCanFlyChange(); + bool IsLevitating() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);} bool IsWalking() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING);} virtual bool SetWalk(bool enable); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index ddef7fdd749..1e0d1e3b08d 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2844,21 +2844,14 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode return; } - if (target->GetTypeId() == TYPEID_UNIT) - target->SetCanFly(apply); + //! Not entirely sure if this should be sent for creatures as well, but I don't think so. + target->SetCanFly(apply); + Player* player = target->ToPlayer(); + if (!player) + player = target->m_movedPlayer; - if (Player* player = target->m_movedPlayer) - { - // allow flying - WorldPacket data; - if (apply) - data.Initialize(SMSG_MOVE_SET_CAN_FLY, 12); - else - data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 12); - data.append(target->GetPackGUID()); - data << uint32(0); // movement counter - player->SendDirectMessage(&data); - } + if (player) + player->SendMovementCanFlyChange(); } void AuraEffect::HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -3231,25 +3224,22 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp, Unit* target = aurApp->GetTarget(); - // Enable Fly mode for flying mounts + //! Update ability to fly if (GetAuraType() == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) { // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit if (mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK && (apply || (!target->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !target->HasAuraType(SPELL_AURA_FLY)))) { - if (Player* player = target->m_movedPlayer) - { - WorldPacket data; - if (apply) - data.Initialize(SMSG_MOVE_SET_CAN_FLY, 12); - else - data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 12); - data.append(player->GetPackGUID()); - data << uint32(0); // unknown - player->SendDirectMessage(&data); - } + target->SetCanFly(apply); + Player* player = target->ToPlayer(); + if (!player) + player = target->m_movedPlayer; + + if (player) + player->SendMovementCanFlyChange(); } + //! Someone should clean up these hacks and remove it from this function. It doesn't even belong here. if (mode & AURA_EFFECT_HANDLE_REAL) { //Players on flying mounts must be immune to polymorph From df31af5b4f53a6fd9c43236418e719dab6c81cc5 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Fri, 16 Mar 2012 17:21:15 +0100 Subject: [PATCH 0196/1149] Core/Movement: Add server-side check for movementflag correction in previous commit. This effectively prevents (most if not all) flyhacking. --- src/server/game/Server/WorldSession.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 84907937de5..081abbd9e31 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -849,6 +849,17 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) //! Cannot hover without SPELL_AURA_HOVER if (mi->HasMovementFlag(MOVEMENTFLAG_HOVER) && !GetPlayer()->HasAuraType(SPELL_AURA_HOVER)) mi->flags &= ~MOVEMENTFLAG_HOVER; + + /*! Cannot fly if no fly auras present. Exception is being a GM. + Note that we check for account level instead of Player::IsGameMaster() because in some + situations it may be feasable to use .gm fly on as a GM without having .gm on, + e.g. aerial combat. + */ + + if (mi->HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY) && GetSecurity() == SEC_PLAYER && + !GetPlayer()->HasAuraType(SPELL_AURA_FLY) && + !GetPlayer()->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)) + mi->flags &= ~(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY); } void WorldSession::WriteMovementInfo(WorldPacket* data, MovementInfo* mi) From cca93c7a22b13bbfb6da5c895f6aa94091bcbfdc Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Fri, 16 Mar 2012 17:27:24 +0100 Subject: [PATCH 0197/1149] Minor typo, major consequences. --- src/server/game/Server/WorldSession.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 081abbd9e31..66d79884e95 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -857,8 +857,8 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) */ if (mi->HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY) && GetSecurity() == SEC_PLAYER && - !GetPlayer()->HasAuraType(SPELL_AURA_FLY) && - !GetPlayer()->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)) + !GetPlayer()->m_mover->HasAuraType(SPELL_AURA_FLY) && + !GetPlayer()->m_mover->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)) mi->flags &= ~(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY); } From 65453620e8b9775507d9d4c895f485e639f16b07 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Fri, 16 Mar 2012 18:15:08 +0100 Subject: [PATCH 0198/1149] Core/Movement: Do not process server side relocation if reading movementinfo from client resulted in violations (= hacking). --- src/server/game/Entities/Object/Object.h | 4 +++ src/server/game/Handlers/MiscHandler.cpp | 6 ++++ src/server/game/Handlers/MovementHandler.cpp | 25 ++++++++++++++++- src/server/game/Handlers/VehicleHandler.cpp | 17 +++++++++++- src/server/game/Server/WorldSession.cpp | 29 ++++++++++++-------- 5 files changed, 68 insertions(+), 13 deletions(-) diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index fd8deb1b841..24ddd7973ab 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -482,6 +482,9 @@ struct MovementInfo // spline float splineElevation; + //! Server side only: + bool Violated; + MovementInfo() { pos.Relocate(0, 0, 0, 0); @@ -494,6 +497,7 @@ struct MovementInfo t_guid = 0; t_pos.Relocate(0, 0, 0, 0); t_seat = -1; + Violated = false; } uint32 GetMovementFlags() { return flags; } diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index aaa41ec3519..319cd96c332 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1621,6 +1621,12 @@ void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket & recv_data) recv_data.read_skip(); // unk2 + if (movementInfo.Violated) + { + recv_data.rfinish(); + return; + } + _player->m_mover->m_movementInfo.flags = movementInfo.GetMovementFlags(); } diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 7d1233c8f70..55c55ffb246 100755 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -278,6 +278,14 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) return; } + //! If some anti-cheat checks in WorldSession::ReadMovementInfo failed, do not process + //! the change of movement server-sided. + if (movementInfo.Violated) + { + recv_data.rfinish(); + return; + } + /* handle special cases */ if (movementInfo.flags & MOVEMENTFLAG_ONTRANSPORT) { @@ -485,9 +493,16 @@ void WorldSession::HandleMoveNotActiveMover(WorldPacket &recv_data) recv_data.readPackGUID(old_mover_guid); MovementInfo mi; - mi.guid = old_mover_guid; ReadMovementInfo(recv_data, &mi); + if (mi.Violated) + { + recv_data.rfinish(); + return; + } + + mi.guid = old_mover_guid; + _player->m_movementInfo = mi; } @@ -513,6 +528,13 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket & recv_data) MovementInfo movementInfo; ReadMovementInfo(recv_data, &movementInfo); + + if (movementInfo.Violated) + { + recv_data.rfinish(); + return; + } + _player->m_movementInfo = movementInfo; WorldPacket data(MSG_MOVE_KNOCK_BACK, 66); @@ -571,3 +593,4 @@ void WorldSession::HandleSummonResponseOpcode(WorldPacket& recv_data) _player->SummonIfPossible(agree); } +#undef IF_VIOLATED_RETURN \ No newline at end of file diff --git a/src/server/game/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp index ce4f6ccb8fe..161571998a1 100644 --- a/src/server/game/Handlers/VehicleHandler.cpp +++ b/src/server/game/Handlers/VehicleHandler.cpp @@ -43,6 +43,12 @@ void WorldSession::HandleDismissControlledVehicle(WorldPacket &recv_data) mi.guid = guid; ReadMovementInfo(recv_data, &mi); + if (mi.Violated) + { + recv_data.rfinish(); + return; + } + _player->m_movementInfo = mi; _player->ExitVehicle(); @@ -81,7 +87,16 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data) uint64 guid; // current vehicle guid recv_data.readPackGUID(guid); - ReadMovementInfo(recv_data, &vehicle_base->m_movementInfo); + MovementInfo movementInfo; + ReadMovementInfo(recv_data, &movementInfo); + + if (movementInfo.Violated) + { + recv_data.rfinish(); + return; + } + + vehicle_base->m_movementInfo = movementInfo; uint64 accessory; // accessory guid recv_data.readPackGUID(accessory); diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 66d79884e95..6ae9f4f6781 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -807,48 +807,53 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) if (mi->HasMovementFlag(MOVEMENTFLAG_SPLINE_ELEVATION)) data >> mi->splineElevation; + //! Anti-cheat checks. Please keep them in seperate if() blocks to maintain a clear overview. + #define VIOLATE_AND_RETURN \ + mi->Violated = true; \ + return; \ + /*! This must be a packet spoofing attempt. MOVEMENTFLAG_ROOT sent from the client is not valid, and when used in conjunction with any of the moving movement flags such as MOVEMENTFLAG_FORWARD it will freeze clients that receive this player's movement info. */ if (mi->HasMovementFlag(MOVEMENTFLAG_ROOT)) - mi->flags &= ~MOVEMENTFLAG_ROOT; + VIOLATE_AND_RETURN; //! Cannot hover and jump at the same time if (mi->HasMovementFlag(MOVEMENTFLAG_HOVER) && mi->HasMovementFlag(MOVEMENTFLAG_JUMPING)) - mi->flags &= ~MOVEMENTFLAG_JUMPING; + VIOLATE_AND_RETURN; //! Cannot ascend and descend at the same time if (mi->HasMovementFlag(MOVEMENTFLAG_ASCENDING) && mi->HasMovementFlag(MOVEMENTFLAG_DESCENDING)) - mi->flags &= ~(MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING); + VIOLATE_AND_RETURN; //! Cannot move left and right at the same time if (mi->HasMovementFlag(MOVEMENTFLAG_LEFT) && mi->HasMovementFlag(MOVEMENTFLAG_RIGHT)) - mi->flags &= ~(MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT); + VIOLATE_AND_RETURN; //! Cannot strafe left and right at the same time if (mi->HasMovementFlag(MOVEMENTFLAG_STRAFE_LEFT) && mi->HasMovementFlag(MOVEMENTFLAG_STRAFE_RIGHT)) - mi->flags &= ~(MOVEMENTFLAG_STRAFE_LEFT | MOVEMENTFLAG_STRAFE_RIGHT); + VIOLATE_AND_RETURN; //! Cannot pitch up and down at the same time if (mi->HasMovementFlag(MOVEMENTFLAG_PITCH_UP) && mi->HasMovementFlag(MOVEMENTFLAG_PITCH_DOWN)) - mi->flags &= ~(MOVEMENTFLAG_PITCH_UP | MOVEMENTFLAG_PITCH_DOWN); + VIOLATE_AND_RETURN; //! Cannot move forwards and backwards at the same time if (mi->HasMovementFlag(MOVEMENTFLAG_FORWARD) && mi->HasMovementFlag(MOVEMENTFLAG_BACKWARD)) - mi->flags &= ~(MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_BACKWARD); + VIOLATE_AND_RETURN; //! Cannot walk on water without SPELL_AURA_WATER_WALK if (mi->HasMovementFlag(MOVEMENTFLAG_WATERWALKING) && !GetPlayer()->HasAuraType(SPELL_AURA_WATER_WALK)) - mi->flags &= ~MOVEMENTFLAG_WATERWALKING; + VIOLATE_AND_RETURN; //! Cannot feather fall without SPELL_AURA_FEATHER_FALL if (mi->HasMovementFlag(MOVEMENTFLAG_FALLING_SLOW) && !GetPlayer()->HasAuraType(SPELL_AURA_FEATHER_FALL)) - mi->flags &= ~MOVEMENTFLAG_FALLING_SLOW; + VIOLATE_AND_RETURN; //! Cannot hover without SPELL_AURA_HOVER if (mi->HasMovementFlag(MOVEMENTFLAG_HOVER) && !GetPlayer()->HasAuraType(SPELL_AURA_HOVER)) - mi->flags &= ~MOVEMENTFLAG_HOVER; + VIOLATE_AND_RETURN; /*! Cannot fly if no fly auras present. Exception is being a GM. Note that we check for account level instead of Player::IsGameMaster() because in some @@ -859,7 +864,9 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) if (mi->HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY) && GetSecurity() == SEC_PLAYER && !GetPlayer()->m_mover->HasAuraType(SPELL_AURA_FLY) && !GetPlayer()->m_mover->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)) - mi->flags &= ~(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY); + VIOLATE_AND_RETURN; + + #undef VIOLATE_AND_RETURN } void WorldSession::WriteMovementInfo(WorldPacket* data, MovementInfo* mi) From a26e145ae755173af574d1f4c8a9b66e8e435b86 Mon Sep 17 00:00:00 2001 From: MrSmite Date: Fri, 16 Mar 2012 15:53:07 -0400 Subject: [PATCH 0199/1149] Fix for pets moving from stay during combat Closes #5612 --- src/server/game/AI/CoreAI/PetAI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index eedba4d8b7e..985eafaf703 100755 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -457,7 +457,7 @@ bool PetAI::CanAttack(Unit* target) // Stay - can attack if target is within range or commanded to if (me->GetCharmInfo()->HasCommandState(COMMAND_STAY)) - return (me->IsWithinMeleeRange(target, MIN_MELEE_REACH) || me->GetCharmInfo()->IsCommandAttack()); + return (me->IsWithinMeleeRange(target, MELEE_RANGE) || me->GetCharmInfo()->IsCommandAttack()); // Follow if (me->GetCharmInfo()->HasCommandState(COMMAND_FOLLOW)) From e0da136c3683c86c6899b1ded98c0bbc1a50d6ff Mon Sep 17 00:00:00 2001 From: MrSmite Date: Fri, 16 Mar 2012 16:02:18 -0400 Subject: [PATCH 0200/1149] Pet UI - Fix for "Attack" continues to flash after combat end Closes 5551 --- src/server/game/AI/CoreAI/PetAI.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index eedba4d8b7e..cb7087b5b1a 100755 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -278,6 +278,7 @@ void PetAI::KilledUnit(Unit* victim) // next target selection me->AttackStop(); me->GetCharmInfo()->SetIsCommandAttack(false); + me->SendMeleeAttackStop(); // Stops the pet's 'Attack' button from flashing Unit* nextTarget = SelectNextTarget(); From 887470ebdb3b2eb4007d5a1724091d5d289a1700 Mon Sep 17 00:00:00 2001 From: MrSmite Date: Fri, 16 Mar 2012 16:10:39 -0400 Subject: [PATCH 0201/1149] Guild bank - Allow deposit / withdraw money without tabs closes 5637 --- src/server/game/Guilds/Guild.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index f97b907828a..6c9cd428e4f 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1616,9 +1616,6 @@ void Guild::HandleRemoveLowestRank(WorldSession* session) void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount) { - if (!_GetPurchasedTabsSize()) - return; // No guild bank tabs - no money in bank - Player* player = session->GetPlayer(); // Call script after validation and before money transfer. @@ -1649,9 +1646,6 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount) bool Guild::HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool repair) { - if (!_GetPurchasedTabsSize()) - return false; // No guild bank tabs - no money - if (m_bankMoney < amount) // Not enough money in bank return false; From 23c5ce0e0a5d47f62005f38099dfa4812b84e70e Mon Sep 17 00:00:00 2001 From: kaelima Date: Fri, 16 Mar 2012 22:52:20 +0100 Subject: [PATCH 0202/1149] Core/Unit: Fix some movement issues when leaving vehicles introduced in dce0a7d18423ecb36ebc0d8c3426dbec26fa9fff Sorry about that. --- src/server/game/DataStores/DBCStructure.h | 2 +- src/server/game/Entities/Unit/Unit.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index d25578e304a..38e8c957681 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1396,7 +1396,7 @@ struct ScalingStatValuesEntry uint32 spellPower; // 16 spell power for level uint32 ssdMultiplier2; // 17 there's data from 3.1 dbc ssdMultiplier[3] uint32 ssdMultiplier3; // 18 3.3 - uint32 armorMod2[5]; // 20-23 Armor for level + uint32 armorMod2[5]; // 19-23 Armor for level uint32 getssdMultiplier(uint32 mask) const { diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 202c26bd645..1bf8334ae79 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17043,6 +17043,8 @@ void Unit::_ExitVehicle(Position const* exitPosition) else pos = *exitPosition; + AddUnitState(UNIT_STATE_MOVE); + if (GetTypeId() == TYPEID_PLAYER) ToPlayer()->SetFallInformation(0, GetPositionZ()); else if (HasUnitMovementFlag(MOVEMENTFLAG_ROOT)) From aad4e41ca5f9bd94fbb6aef37c569543f239a42b Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 16 Mar 2012 17:59:10 -0400 Subject: [PATCH 0203/1149] Core/Spells: finish fixing dispel functionality. closes #5745 --- src/server/game/Spells/Spell.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 3af200f7a56..21d49ccf151 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4956,6 +4956,7 @@ SpellCastResult Spell::CheckCast(bool strict) return castResult; bool hasDispellableAura = false; + bool hasNonDispelEffect = false; for (int i = 0; i < MAX_SPELL_EFFECTS; i++) if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_DISPEL) { @@ -4976,8 +4977,13 @@ SpellCastResult Spell::CheckCast(bool strict) } } } + else if (m_spellInfo->Effects[i].IsEffect()) + { + hasNonDispelEffect = true; + break; + } - if (!hasDispellableAura && m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL)) + if (!hasNonDispelEffect && !hasDispellableAura && m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL)) return SPELL_FAILED_NOTHING_TO_DISPEL; for (int i = 0; i < MAX_SPELL_EFFECTS; i++) From d810acdeeaf26c7430f63ee31c4d306c554bf072 Mon Sep 17 00:00:00 2001 From: kaelima Date: Fri, 16 Mar 2012 23:16:22 +0100 Subject: [PATCH 0204/1149] Core/InstanceScript: Encounterframe research - extended the EncounterFrameType enum --- src/server/game/Instances/InstanceScript.cpp | 16 ++++++++-------- src/server/game/Instances/InstanceScript.h | 10 ++++++++-- .../boss_blood_prince_council.cpp | 18 +++++++++--------- .../boss_valithria_dreamwalker.cpp | 10 +++++----- 4 files changed, 30 insertions(+), 24 deletions(-) diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index c6a93ff4272..6b0431aae83 100755 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -397,22 +397,22 @@ void InstanceScript::SendEncounterUnit(uint32 type, Unit* unit /*= NULL*/, uint8 switch (type) { - case ENCOUNTER_FRAME_ADD: - case ENCOUNTER_FRAME_REMOVE: - case 2: + case ENCOUNTER_FRAME_ENGAGE: + case ENCOUNTER_FRAME_DISENGAGE: + case ENCOUNTER_FRAME_UPDATE_PRIORITY: data.append(unit->GetPackGUID()); data << uint8(param1); break; - case 3: - case 4: - case 6: + case ENCOUNTER_FRAME_ADD_TIMER: + case ENCOUNTER_FRAME_ENABLE_OBJECTIVE: + case ENCOUNTER_FRAME_DISABLE_OBJECTIVE: data << uint8(param1); data << uint8(param2); break; - case 5: + case ENCOUNTER_FRAME_UPDATE_OBJECTIVE: data << uint8(param1); break; - case 7: + case ENCOUNTER_FRAME_UNK7: default: break; } diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h index 69f11c203c1..71f1572624b 100755 --- a/src/server/game/Instances/InstanceScript.h +++ b/src/server/game/Instances/InstanceScript.h @@ -42,8 +42,14 @@ typedef std::set MinionSet; enum EncounterFrameType { - ENCOUNTER_FRAME_ADD = 0, - ENCOUNTER_FRAME_REMOVE = 1, + ENCOUNTER_FRAME_ENGAGE = 0, + ENCOUNTER_FRAME_DISENGAGE = 1, + ENCOUNTER_FRAME_UPDATE_PRIORITY = 2, + ENCOUNTER_FRAME_ADD_TIMER = 3, + ENCOUNTER_FRAME_ENABLE_OBJECTIVE = 4, + ENCOUNTER_FRAME_UPDATE_OBJECTIVE = 5, + ENCOUNTER_FRAME_DISABLE_OBJECTIVE = 6, + ENCOUNTER_FRAME_UNK7 = 7, // Seems to have something to do with sorting the encounter units }; enum EncounterState diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index c557b6ad831..de104a78e43 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -210,19 +210,19 @@ class boss_blood_council_controller : public CreatureScript if (Creature* keleseth = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_PRINCE_KELESETH_GUID))) { - instance->SendEncounterUnit(ENCOUNTER_FRAME_ADD, keleseth); + instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, keleseth); DoZoneInCombat(keleseth); } if (Creature* taldaram = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_PRINCE_TALDARAM_GUID))) { - instance->SendEncounterUnit(ENCOUNTER_FRAME_ADD, taldaram); + instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, taldaram); DoZoneInCombat(taldaram); } if (Creature* valanar = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_PRINCE_VALANAR_GUID))) { - instance->SendEncounterUnit(ENCOUNTER_FRAME_ADD, valanar); + instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, valanar); DoZoneInCombat(valanar); } @@ -412,12 +412,12 @@ class boss_prince_keleseth_icc : public CreatureScript summons.DespawnAll(); Talk(SAY_KELESETH_DEATH); - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); } void JustReachedHome() { - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); me->SetHealth(_spawnHealth); _isEmpowered = false; if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BLOOD_PRINCES_CONTROL))) @@ -636,12 +636,12 @@ class boss_prince_taldaram_icc : public CreatureScript summons.DespawnAll(); Talk(EMOTE_TALDARAM_DEATH); - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); } void JustReachedHome() { - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); me->SetHealth(_spawnHealth); _isEmpowered = false; if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BLOOD_PRINCES_CONTROL))) @@ -859,12 +859,12 @@ class boss_prince_valanar_icc : public CreatureScript summons.DespawnAll(); Talk(SAY_VALANAR_DEATH); - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); } void JustReachedHome() { - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); me->SetHealth(me->GetMaxHealth()); _isEmpowered = false; if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BLOOD_PRINCES_CONTROL))) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index 36594d5a684..af2eb57b7c3 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -232,7 +232,7 @@ class ValithriaDespawner : public BasicEvent { case NPC_VALITHRIA_DREAMWALKER: if (InstanceScript* instance = creature->GetInstanceScript()) - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, creature); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, creature); break; case NPC_BLAZING_SKELETON: case NPC_SUPPRESSER: @@ -304,7 +304,7 @@ class boss_valithria_dreamwalker : public CreatureScript me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_HEAL_PCT, true); // Glyph of Dispel Magic - not a percent heal by effect, its cast with custom basepoints me->ApplySpellImmune(0, IMMUNITY_ID, 56131, true); - _instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); _missedPortals = 0; _under25PercentTalkDone = false; _over75PercentTalkDone = false; @@ -322,7 +322,7 @@ class boss_valithria_dreamwalker : public CreatureScript return; DoCast(me, SPELL_COPY_DAMAGE); - _instance->SendEncounterUnit(ENCOUNTER_FRAME_ADD, me); + _instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me); _events.ScheduleEvent(EVENT_INTRO_TALK, 15000); _events.ScheduleEvent(EVENT_DREAM_PORTAL, urand(45000, 48000)); if (IsHeroic()) @@ -341,7 +341,7 @@ class boss_valithria_dreamwalker : public CreatureScript { _done = true; Talk(SAY_VALITHRIA_SUCCESS); - _instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); me->RemoveAurasDueToSpell(SPELL_CORRUPTION_VALITHRIA); DoCast(me, SPELL_ACHIEVEMENT_CHECK); DoCastAOE(SPELL_DREAMWALKERS_RAGE); @@ -376,7 +376,7 @@ class boss_valithria_dreamwalker : public CreatureScript { _justDied = true; Talk(SAY_VALITHRIA_DEATH); - _instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); if (Creature* trigger = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_VALITHRIA_TRIGGER))) trigger->AI()->DoAction(ACTION_DEATH); } From 85da4636860d1a952bca1b8865c0db9e64798c43 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Fri, 16 Mar 2012 23:37:50 +0100 Subject: [PATCH 0205/1149] Core/Movement: Fix brackets in macro --- src/server/game/Server/WorldSession.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 6ae9f4f6781..c060a17f20f 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -809,9 +809,10 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) //! Anti-cheat checks. Please keep them in seperate if() blocks to maintain a clear overview. #define VIOLATE_AND_RETURN \ + { \ mi->Violated = true; \ return; \ - + } \ /*! This must be a packet spoofing attempt. MOVEMENTFLAG_ROOT sent from the client is not valid, and when used in conjunction with any of the moving movement flags such as MOVEMENTFLAG_FORWARD it will freeze clients that receive this player's movement info. From cf5ed0a7b6f5597f9103a4bc93ed91f814522a77 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Fri, 16 Mar 2012 23:41:43 +0100 Subject: [PATCH 0206/1149] Core/Movement: Remove MOVEMENTFLAG_FLYING on fly aura unapply as well as _CAN_FLY --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 1e0d1e3b08d..9400ec1e798 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2846,6 +2846,8 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode //! Not entirely sure if this should be sent for creatures as well, but I don't think so. target->SetCanFly(apply); + if (!apply) + target->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING); Player* player = target->ToPlayer(); if (!player) player = target->m_movedPlayer; @@ -3231,6 +3233,8 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp, if (mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK && (apply || (!target->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !target->HasAuraType(SPELL_AURA_FLY)))) { target->SetCanFly(apply); + if (!apply) + target->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING); Player* player = target->ToPlayer(); if (!player) player = target->m_movedPlayer; From 6d95e2408ab46c4e245c821fdd71f3ce94c96f49 Mon Sep 17 00:00:00 2001 From: kaelima Date: Fri, 16 Mar 2012 23:45:35 +0100 Subject: [PATCH 0207/1149] Core/Protocol: And correct the struct of SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT... --- src/server/game/Instances/InstanceScript.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index 6b0431aae83..d2c256e08f7 100755 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -407,10 +407,10 @@ void InstanceScript::SendEncounterUnit(uint32 type, Unit* unit /*= NULL*/, uint8 case ENCOUNTER_FRAME_ENABLE_OBJECTIVE: case ENCOUNTER_FRAME_DISABLE_OBJECTIVE: data << uint8(param1); - data << uint8(param2); break; case ENCOUNTER_FRAME_UPDATE_OBJECTIVE: data << uint8(param1); + data << uint8(param2); break; case ENCOUNTER_FRAME_UNK7: default: From b61759c9eac34665224fa77793eda9b2ffd87f5f Mon Sep 17 00:00:00 2001 From: MrSmite Date: Fri, 16 Mar 2012 19:34:04 -0400 Subject: [PATCH 0208/1149] Pet - Fix focus regen gets stuck due to lag/high diffs closes #5153 --- src/server/game/Entities/Pet/Pet.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index e7103e2cb70..e13c5334788 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -537,7 +537,13 @@ void Pet::Update(uint32 diff) Regenerate(POWER_FOCUS); m_regenTimer += PET_FOCUS_REGEN_INTERVAL - diff; if (!m_regenTimer) ++m_regenTimer; + + // Reset if large diff (lag) causes focus to get 'stuck' + if (m_regenTimer > PET_FOCUS_REGEN_INTERVAL) + m_regenTimer = PET_FOCUS_REGEN_INTERVAL; + break; + // in creature::update //case POWER_ENERGY: // Regenerate(POWER_ENERGY); From 7877eae6ba00d3072eb020a045028e0c825a3831 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Sat, 17 Mar 2012 12:17:15 +0800 Subject: [PATCH 0209/1149] Core/Script: Code style and remove unused core. Signed-off-by: Gyx <2359980687@qq.com> --- .../ScarletEnclave/chapter2.cpp | 74 +++++++--- .../EasternKingdoms/arathi_highlands.cpp | 22 ++- .../BattleForMountHyjal/hyjalAI.cpp | 14 +- .../BattleForMountHyjal/instance_hyjal.cpp | 27 +++- src/server/scripts/Kalimdor/azshara.cpp | 1 - .../scripts/Kalimdor/azuremyst_isle.cpp | 9 +- .../Ahnkahet/boss_prince_taldaram.cpp | 9 +- .../AzjolNerub/Ahnkahet/instance_ahnkahet.cpp | 60 ++++++-- .../UtgardePinnacle/boss_skadi.cpp | 14 +- .../scripts/Northrend/grizzly_hills.cpp | 9 +- .../Outland/BlackTemple/illidari_council.cpp | 9 +- .../BlackTemple/instance_black_temple.cpp | 139 ++++++++++++------ .../boss_hydross_the_unstable.cpp | 63 +++++--- .../scripts/Outland/GruulsLair/boss_gruul.cpp | 9 +- .../GruulsLair/instance_gruuls_lair.cpp | 16 +- .../arcatraz/instance_arcatraz.cpp | 44 ++++-- .../scripts/Outland/blades_edge_mountains.cpp | 38 ++++- .../scripts/World/areatrigger_scripts.cpp | 9 +- src/server/scripts/World/guards.cpp | 24 ++- 19 files changed, 434 insertions(+), 156 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index d8cbf0e8595..bd5cec9e3cb 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -111,12 +111,33 @@ public: switch (uiSpeech_counter) { - case 1: DoScriptText(SAY_PERSUADED1, me); uiSpeech_timer = 8000; break; - case 2: DoScriptText(SAY_PERSUADED2, me); uiSpeech_timer = 8000; break; - case 3: DoScriptText(SAY_PERSUADED3, me); uiSpeech_timer = 8000; break; - case 4: DoScriptText(SAY_PERSUADED4, me); uiSpeech_timer = 8000; break; - case 5: DoScriptText(SAY_PERSUADED5, player); uiSpeech_timer = 8000; break; - case 6: DoScriptText(SAY_PERSUADED6, me); + case 1: + DoScriptText(SAY_PERSUADED1, me); + uiSpeech_timer = 8000; + break; + + case 2: + DoScriptText(SAY_PERSUADED2, me); + uiSpeech_timer = 8000; + break; + + case 3: + DoScriptText(SAY_PERSUADED3, me); + uiSpeech_timer = 8000; + break; + + case 4: + DoScriptText(SAY_PERSUADED4, me); + uiSpeech_timer = 8000; + break; + + case 5: + DoScriptText(SAY_PERSUADED5, player); + uiSpeech_timer = 8000; + break; + + case 6: + DoScriptText(SAY_PERSUADED6, me); player->Kill(me); //me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -704,7 +725,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -732,7 +755,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -760,7 +785,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -788,7 +815,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -816,7 +845,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -844,7 +875,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -872,7 +905,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -900,7 +935,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -928,7 +965,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -956,7 +995,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -978,7 +1019,6 @@ public: } } }; - }; void AddSC_the_scarlet_enclave_c2() diff --git a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp index 4e0a942b7e8..6e8a354ef58 100644 --- a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp @@ -73,21 +73,29 @@ class npc_professor_phizzlethorpe : public CreatureScript switch (uiPointId) { - case 4:Talk(SAY_PROGRESS_2, player->GetGUID());break; - case 5:Talk(SAY_PROGRESS_3, player->GetGUID());break; - case 8:Talk(EMOTE_PROGRESS_4);break; + case 4: + Talk(SAY_PROGRESS_2, player->GetGUID()); + break; + case 5: + Talk(SAY_PROGRESS_3, player->GetGUID()); + break; + case 8: + Talk(EMOTE_PROGRESS_4); + break; case 9: - { me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); break; - } - case 10:Talk(SAY_PROGRESS_5, player->GetGUID());break; + case 10: + Talk(SAY_PROGRESS_5, player->GetGUID()); + break; case 11: Talk(SAY_PROGRESS_6, player->GetGUID()); SetRun(); break; - case 19:Talk(SAY_PROGRESS_7, player->GetGUID()); break; + case 19: + Talk(SAY_PROGRESS_7, player->GetGUID()); + break; case 20: Talk(EMOTE_PROGRESS_8); Talk(SAY_PROGRESS_9, player->GetGUID()); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index 0bcf33229f1..f36aa19a7be 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -896,9 +896,17 @@ void hyjalAI::UpdateAI(const uint32 diff) switch (Spells[i].TargetType) { - case TARGETTYPE_SELF: target = me; break; - case TARGETTYPE_RANDOM: target = SelectTarget(SELECT_TARGET_RANDOM, 0); break; - case TARGETTYPE_VICTIM: target = me->getVictim(); break; + case TARGETTYPE_SELF: + target = me; + break; + + case TARGETTYPE_RANDOM: + target = SelectTarget(SELECT_TARGET_RANDOM, 0); + break; + + case TARGETTYPE_VICTIM: + target = me->getVictim(); + break; } if (target && target->isAlive()) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp index 1eaaf418598..ad8ebdb370a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp @@ -176,17 +176,23 @@ public: { switch (type) { - case DATA_RAGEWINTERCHILLEVENT: m_auiEncounter[0] = data; break; + case DATA_RAGEWINTERCHILLEVENT: + m_auiEncounter[0] = data; + break; case DATA_ANETHERONEVENT: m_auiEncounter[1] = data; break; - case DATA_KAZROGALEVENT: m_auiEncounter[2] = data; break; + case DATA_KAZROGALEVENT: + m_auiEncounter[2] = data; + break; case DATA_AZGALOREVENT: { m_auiEncounter[3] = data; if (data == DONE) { - if (ArchiYell)break; + if (ArchiYell) + break; + ArchiYell = true; Creature* creature = instance->GetCreature(Azgalor); @@ -220,12 +226,17 @@ public: } } break; - case DATA_ARCHIMONDEEVENT: m_auiEncounter[4] = data; break; - case DATA_RESET_TRASH_COUNT: Trash = 0; break; - + case DATA_ARCHIMONDEEVENT: + m_auiEncounter[4] = data; + break; + case DATA_RESET_TRASH_COUNT: + Trash = 0; + break; case DATA_TRASH: - if (data) Trash = data; - else Trash--; + if (data) + Trash = data; + else + Trash--; DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, Trash); break; case TYPE_RETREAT: diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp index 2b74420ff3a..2e7b0a684c1 100644 --- a/src/server/scripts/Kalimdor/azshara.cpp +++ b/src/server/scripts/Kalimdor/azshara.cpp @@ -516,7 +516,6 @@ public: { } }; - }; void AddSC_azshara() diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp index 6c322a1dee1..fd86a08f06a 100644 --- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/azuremyst_isle.cpp @@ -309,8 +309,13 @@ public: me->SetHealth(me->CountPctFromMaxHealth(15)); switch (rand()%2) { - case 0: me->SetStandState(UNIT_STAND_STATE_SIT); break; - case 1: me->SetStandState(UNIT_STAND_STATE_SLEEP); break; + case 0: + me->SetStandState(UNIT_STAND_STATE_SIT); + break; + + case 1: + me->SetStandState(UNIT_STAND_STATE_SLEEP); + break; } } diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp index 65b55d8009c..12ef2075857 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp @@ -402,8 +402,13 @@ public: switch (go->GetEntry()) { - case GO_SPHERE1: instance->SetData(DATA_SPHERE1_EVENT, IN_PROGRESS); break; - case GO_SPHERE2: instance->SetData(DATA_SPHERE2_EVENT, IN_PROGRESS); break; + case GO_SPHERE1: + instance->SetData(DATA_SPHERE1_EVENT, IN_PROGRESS); + break; + + case GO_SPHERE2: + instance->SetData(DATA_SPHERE2_EVENT, IN_PROGRESS); + break; } CAST_AI(boss_taldaram::boss_taldaramAI, pPrinceTaldaram->AI())->CheckSpheres(); diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp index ef5214581ce..74643e58e30 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp @@ -110,26 +110,37 @@ public: { switch (go->GetEntry()) { - case 193564: Prince_TaldaramPlatform = go->GetGUID(); - if (m_auiEncounter[1] == DONE) HandleGameObject(0, true, go); break; - case 193093: Prince_TaldaramSpheres[0] = go->GetGUID(); + case 193564: + Prince_TaldaramPlatform = go->GetGUID(); + if (m_auiEncounter[1] == DONE) + HandleGameObject(0, true, go); + break; + + case 193093: + Prince_TaldaramSpheres[0] = go->GetGUID(); if (spheres[0] == IN_PROGRESS) { go->SetGoState(GO_STATE_ACTIVE); go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); } - else go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + else + go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); break; - case 193094: Prince_TaldaramSpheres[1] = go->GetGUID(); + case 193094: + Prince_TaldaramSpheres[1] = go->GetGUID(); if (spheres[1] == IN_PROGRESS) { go->SetGoState(GO_STATE_ACTIVE); go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); } - else go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + else + go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + break; + case 192236: + Prince_TaldaramGate = go->GetGUID(); // Web gate past Prince Taldaram + if (m_auiEncounter[1] == DONE) + HandleGameObject(0, true, go); break; - case 192236: Prince_TaldaramGate = go->GetGUID(); // Web gate past Prince Taldaram - if (m_auiEncounter[1] == DONE)HandleGameObject(0, true, go);break; } } @@ -137,8 +148,13 @@ public: { switch (idx) { - case DATA_ADD_JEDOGA_OPFER: JedogaSacrifices = guid; break; - case DATA_PL_JEDOGA_TARGET: JedogaTarget = guid; break; + case DATA_ADD_JEDOGA_OPFER: + JedogaSacrifices = guid; + break; + + case DATA_PL_JEDOGA_TARGET: + JedogaTarget = guid; + break; } } @@ -179,7 +195,9 @@ public: { switch (type) { - case DATA_ELDER_NADOX_EVENT: m_auiEncounter[0] = data; break; + case DATA_ELDER_NADOX_EVENT: + m_auiEncounter[0] = data; + break; case DATA_PRINCE_TALDARAM_EVENT: if (data == DONE) HandleGameObject(Prince_TaldaramGate, true); @@ -201,11 +219,21 @@ public: } } break; - case DATA_HERALD_VOLAZJ_EVENT: m_auiEncounter[3] = data; break; - case DATA_AMANITAR_EVENT: m_auiEncounter[4] = data; break; - case DATA_SPHERE1_EVENT: spheres[0] = data; break; - case DATA_SPHERE2_EVENT: spheres[1] = data; break; - case DATA_JEDOGA_TRIGGER_SWITCH: switchtrigger = data; break; + case DATA_HERALD_VOLAZJ_EVENT: + m_auiEncounter[3] = data; + break; + case DATA_AMANITAR_EVENT: + m_auiEncounter[4] = data; + break; + case DATA_SPHERE1_EVENT: + spheres[0] = data; + break; + case DATA_SPHERE2_EVENT: + spheres[1] = data; + break; + case DATA_JEDOGA_TRIGGER_SWITCH: + switchtrigger = data; + break; case DATA_JEDOGA_RESET_INITIANDS: for (std::set::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr) { diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index e98bb724f41..5132dd0f046 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -426,9 +426,17 @@ public: { switch (urand(0, 2)) { - case 0: me->SummonCreature(CREATURE_YMIRJAR_WARRIOR, SpawnLoc.GetPositionX()+rand()%5, SpawnLoc.GetPositionY()+rand()%5, SpawnLoc.GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break; - case 1: me->SummonCreature(CREATURE_YMIRJAR_WITCH_DOCTOR, SpawnLoc.GetPositionX()+rand()%5, SpawnLoc.GetPositionY()+rand()%5, SpawnLoc.GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break; - case 2: me->SummonCreature(CREATURE_YMIRJAR_HARPOONER, SpawnLoc.GetPositionX()+rand()%5, SpawnLoc.GetPositionY()+rand()%5, SpawnLoc.GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break; + case 0: + me->SummonCreature(CREATURE_YMIRJAR_WARRIOR, SpawnLoc.GetPositionX()+rand()%5, SpawnLoc.GetPositionY()+rand()%5, SpawnLoc.GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + + case 1: + me->SummonCreature(CREATURE_YMIRJAR_WITCH_DOCTOR, SpawnLoc.GetPositionX()+rand()%5, SpawnLoc.GetPositionY()+rand()%5, SpawnLoc.GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + + case 2: + me->SummonCreature(CREATURE_YMIRJAR_HARPOONER, SpawnLoc.GetPositionX()+rand()%5, SpawnLoc.GetPositionY()+rand()%5, SpawnLoc.GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; } } } diff --git a/src/server/scripts/Northrend/grizzly_hills.cpp b/src/server/scripts/Northrend/grizzly_hills.cpp index 86e925573ad..bf130bc0355 100644 --- a/src/server/scripts/Northrend/grizzly_hills.cpp +++ b/src/server/scripts/Northrend/grizzly_hills.cpp @@ -323,8 +323,13 @@ public: DoCast(me, SPELL_DUST_FIELD, true); switch (m_gender) { - case GENDER_FEMALE: DoPlaySoundToSet(me, SOUND_FEMALE); break; - case GENDER_MALE: DoPlaySoundToSet(me, SOUND_MALE); break; + case GENDER_FEMALE: + DoPlaySoundToSet(me, SOUND_FEMALE); + break; + + case GENDER_MALE: + DoPlaySoundToSet(me, SOUND_MALE); + break; } } } diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index 11d47ac29b1..89e0073c5cd 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -543,8 +543,13 @@ public: { switch (urand(0, 1)) { - case 0: DoCast(unit, SPELL_BLESS_SPELLWARD); break; - case 1: DoCast(unit, SPELL_BLESS_PROTECTION); break; + case 0: + DoCast(unit, SPELL_BLESS_SPELLWARD); + break; + + case 1: + DoCast(unit, SPELL_BLESS_PROTECTION); + break; } } BlessingTimer = 60000; diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp index 677a47c3a65..49bce6d82c0 100644 --- a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp @@ -164,28 +164,75 @@ public: { switch (go->GetEntry()) { - case 185483: NajentusGate = go->GetGUID();// Gate past Naj'entus (at the entrance to Supermoose's courtyards) - if (m_auiEncounter[0] == DONE)HandleGameObject(0, true, go);break; - case 185882: MainTempleDoors = go->GetGUID();// Main Temple Doors - right past Supermoose (Supremus) - if (m_auiEncounter[1] == DONE)HandleGameObject(0, true, go);break; - case 185478: ShadeOfAkamaDoor = go->GetGUID();break; - case 185480: CommonDoor = go->GetGUID(); - if (m_auiEncounter[3] == DONE)HandleGameObject(0, true, go);break; - case 186153: TeronDoor = go->GetGUID(); - if (m_auiEncounter[3] == DONE)HandleGameObject(0, true, go);break; - case 185892: GuurtogDoor = go->GetGUID(); - if (m_auiEncounter[4] == DONE)HandleGameObject(0, true, go);break; - case 185479: TempleDoor = go->GetGUID(); - if (m_auiEncounter[5] == DONE)HandleGameObject(0, true, go);break; - case 185482: MotherDoor = go->GetGUID(); - if (m_auiEncounter[6] == DONE)HandleGameObject(0, true, go);break; - case 185481: CouncilDoor = go->GetGUID(); - if (m_auiEncounter[7] == DONE)HandleGameObject(0, true, go);break; - case 186152: SimpleDoor = go->GetGUID(); - if (m_auiEncounter[7] == DONE)HandleGameObject(0, true, go);break; - case 185905: IllidanGate = go->GetGUID(); break; // Gate leading to Temple Summit - case 186261: IllidanDoor[0] = go->GetGUID(); break; // Right door at Temple Summit - case 186262: IllidanDoor[1] = go->GetGUID(); break; // Left door at Temple Summit + case 185483: + NajentusGate = go->GetGUID();// Gate past Naj'entus (at the entrance to Supermoose's courtyards) + if (m_auiEncounter[0] == DONE) + HandleGameObject(0, true, go); + break; + + case 185882: + MainTempleDoors = go->GetGUID();// Main Temple Doors - right past Supermoose (Supremus) + if (m_auiEncounter[1] == DONE) + HandleGameObject(0, true, go); + break; + + case 185478: + ShadeOfAkamaDoor = go->GetGUID(); + break; + + case 185480: + CommonDoor = go->GetGUID(); + if (m_auiEncounter[3] == DONE) + HandleGameObject(0, true, go); + break; + + case 186153: + TeronDoor = go->GetGUID(); + if (m_auiEncounter[3] == DONE) + HandleGameObject(0, true, go); + break; + + case 185892: + GuurtogDoor = go->GetGUID(); + if (m_auiEncounter[4] == DONE) + HandleGameObject(0, true, go); + break; + + case 185479: + TempleDoor = go->GetGUID(); + if (m_auiEncounter[5] == DONE) + HandleGameObject(0, true, go); + break; + + case 185482: + MotherDoor = go->GetGUID(); + if (m_auiEncounter[6] == DONE) + HandleGameObject(0, true, go); + break; + + case 185481: + CouncilDoor = go->GetGUID(); + if (m_auiEncounter[7] == DONE) + HandleGameObject(0, true, go); + break; + + case 186152: + SimpleDoor = go->GetGUID(); + if (m_auiEncounter[7] == DONE) + HandleGameObject(0, true, go); + break; + + case 185905: + IllidanGate = go->GetGUID(); // Gate leading to Temple Summit + break; + + case 186261: + IllidanDoor[0] = go->GetGUID(); // Right door at Temple Summit + break; + + case 186262: + IllidanDoor[1] = go->GetGUID(); // Left door at Temple Summit + break; } } @@ -221,63 +268,65 @@ public: { case DATA_HIGHWARLORDNAJENTUSEVENT: if (data == DONE) - { HandleGameObject(NajentusGate, true); - } - m_auiEncounter[0] = data;break; + m_auiEncounter[0] = data; + break; case DATA_SUPREMUSEVENT: if (data == DONE) - { HandleGameObject(NajentusGate, true); - } - m_auiEncounter[1] = data; break; + m_auiEncounter[1] = data; + break; case DATA_SHADEOFAKAMAEVENT: if (data == IN_PROGRESS) - { HandleGameObject(ShadeOfAkamaDoor, false); - } else HandleGameObject(ShadeOfAkamaDoor, true); - m_auiEncounter[2] = data; break; + else + HandleGameObject(ShadeOfAkamaDoor, true); + m_auiEncounter[2] = data; + break; case DATA_TERONGOREFIENDEVENT: if (data == IN_PROGRESS) { HandleGameObject(TeronDoor, false); HandleGameObject(CommonDoor, false); - }else + } + else { HandleGameObject(TeronDoor, true); HandleGameObject(CommonDoor, true); } - m_auiEncounter[3] = data; break; + m_auiEncounter[3] = data; + break; case DATA_GURTOGGBLOODBOILEVENT: if (data == DONE) - { HandleGameObject(GuurtogDoor, true); - } - m_auiEncounter[4] = data; break; + m_auiEncounter[4] = data; + break; case DATA_RELIQUARYOFSOULSEVENT: if (data == DONE) - { HandleGameObject(TempleDoor, true); - } - m_auiEncounter[5] = data; break; + m_auiEncounter[5] = data; + break; case DATA_MOTHERSHAHRAZEVENT: if (data == DONE) - { HandleGameObject(MotherDoor, true); - } - m_auiEncounter[6] = data; break; + m_auiEncounter[6] = data; + break; case DATA_ILLIDARICOUNCILEVENT: if (data == IN_PROGRESS) { HandleGameObject(CouncilDoor, false); HandleGameObject(SimpleDoor, false); - }else + } + else { HandleGameObject(CouncilDoor, true); HandleGameObject(SimpleDoor, true); } - m_auiEncounter[7] = data; break; - case DATA_ILLIDANSTORMRAGEEVENT: m_auiEncounter[8] = data; break; + m_auiEncounter[7] = data; + break; + case DATA_ILLIDANSTORMRAGEEVENT: + m_auiEncounter[8] = data; + break; } if (data == DONE) diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp index 11b3d147540..4f679da6d98 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp @@ -177,13 +177,9 @@ public: void KilledUnit(Unit* /*victim*/) { if (CorruptedForm) - { DoScriptText(RAND(SAY_CORRUPT_SLAY1, SAY_CORRUPT_SLAY2), me); - } else - { DoScriptText(RAND(SAY_CLEAN_SLAY1, SAY_CLEAN_SLAY2), me); - } } void JustSummoned(Creature* summoned) @@ -242,12 +238,29 @@ public: switch (MarkOfCorruption_Count) { - case 0: mark_spell = SPELL_MARK_OF_CORRUPTION1; break; - case 1: mark_spell = SPELL_MARK_OF_CORRUPTION2; break; - case 2: mark_spell = SPELL_MARK_OF_CORRUPTION3; break; - case 3: mark_spell = SPELL_MARK_OF_CORRUPTION4; break; - case 4: mark_spell = SPELL_MARK_OF_CORRUPTION5; break; - case 5: mark_spell = SPELL_MARK_OF_CORRUPTION6; break; + case 0: + mark_spell = SPELL_MARK_OF_CORRUPTION1; + break; + + case 1: + mark_spell = SPELL_MARK_OF_CORRUPTION2; + break; + + case 2: + mark_spell = SPELL_MARK_OF_CORRUPTION3; + break; + + case 3: + mark_spell = SPELL_MARK_OF_CORRUPTION4; + break; + + case 4: + mark_spell = SPELL_MARK_OF_CORRUPTION5; + break; + + case 5: + mark_spell = SPELL_MARK_OF_CORRUPTION6; + break; } DoCast(me->getVictim(), mark_spell); @@ -309,12 +322,29 @@ public: switch (MarkOfHydross_Count) { - case 0: mark_spell = SPELL_MARK_OF_HYDROSS1; break; - case 1: mark_spell = SPELL_MARK_OF_HYDROSS2; break; - case 2: mark_spell = SPELL_MARK_OF_HYDROSS3; break; - case 3: mark_spell = SPELL_MARK_OF_HYDROSS4; break; - case 4: mark_spell = SPELL_MARK_OF_HYDROSS5; break; - case 5: mark_spell = SPELL_MARK_OF_HYDROSS6; break; + case 0: + mark_spell = SPELL_MARK_OF_HYDROSS1; + break; + + case 1: + mark_spell = SPELL_MARK_OF_HYDROSS2; + break; + + case 2: + mark_spell = SPELL_MARK_OF_HYDROSS3; + break; + + case 3: + mark_spell = SPELL_MARK_OF_HYDROSS4; + break; + + case 4: + mark_spell = SPELL_MARK_OF_HYDROSS5; + break; + + case 5: + mark_spell = SPELL_MARK_OF_HYDROSS6; + break; } DoCast(me->getVictim(), mark_spell); @@ -375,7 +405,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_hydross_the_unstable() diff --git a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp index 895ea71f139..ff116d880be 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp @@ -130,8 +130,13 @@ public: { switch (urand(0, 1)) { - case 0: target->CastSpell(target, SPELL_MAGNETIC_PULL, true, NULL, NULL, me->GetGUID()); break; - case 1: target->CastSpell(target, SPELL_KNOCK_BACK, true, NULL, NULL, me->GetGUID()); break; + case 0: + target->CastSpell(target, SPELL_MAGNETIC_PULL, true, NULL, NULL, me->GetGUID()); + break; + + case 1: + target->CastSpell(target, SPELL_KNOCK_BACK, true, NULL, NULL, me->GetGUID()); + break; } } } diff --git a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp index 5ea64250689..3514732b53a 100644 --- a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp +++ b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp @@ -137,12 +137,18 @@ public: switch (type) { case DATA_MAULGAREVENT: - if (data == DONE) HandleGameObject(MaulgarDoor, true); - m_auiEncounter[0] = data; break; + if (data == DONE) + HandleGameObject(MaulgarDoor, true); + m_auiEncounter[0] = data; + break; + case DATA_GRUULEVENT: - if (data == IN_PROGRESS) HandleGameObject(GruulDoor, false); - else HandleGameObject(GruulDoor, true); - m_auiEncounter[1] = data; break; + if (data == IN_PROGRESS) + HandleGameObject(GruulDoor, false); + else + HandleGameObject(GruulDoor, true); + m_auiEncounter[1] = data; + break; } if (data == DONE) diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp index 3b907f1d000..ffe96fb7bd1 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp @@ -103,15 +103,41 @@ class instance_arcatraz : public InstanceMapScript { switch (go->GetEntry()) { - case CONTAINMENT_CORE_SECURITY_FIELD_ALPHA: Containment_Core_Security_Field_AlphaGUID = go->GetGUID(); break; - case CONTAINMENT_CORE_SECURITY_FIELD_BETA: Containment_Core_Security_Field_BetaGUID = go->GetGUID(); break; - case POD_ALPHA: Pod_AlphaGUID = go->GetGUID(); break; - case POD_GAMMA: Pod_GammaGUID = go->GetGUID(); break; - case POD_BETA: Pod_BetaGUID = go->GetGUID(); break; - case POD_DELTA: Pod_DeltaGUID = go->GetGUID(); break; - case POD_OMEGA: Pod_OmegaGUID = go->GetGUID(); break; - case SEAL_SPHERE: GoSphereGUID = go->GetGUID(); break; - //case WARDENS_SHIELD: Wardens_ShieldGUID = go->GetGUID(); break; + case CONTAINMENT_CORE_SECURITY_FIELD_ALPHA: + Containment_Core_Security_Field_AlphaGUID = go->GetGUID(); + break; + + case CONTAINMENT_CORE_SECURITY_FIELD_BETA: + Containment_Core_Security_Field_BetaGUID = go->GetGUID(); + break; + + case POD_ALPHA: + Pod_AlphaGUID = go->GetGUID(); + break; + + case POD_GAMMA: + Pod_GammaGUID = go->GetGUID(); + break; + + case POD_BETA: + Pod_BetaGUID = go->GetGUID(); + break; + + case POD_DELTA: + Pod_DeltaGUID = go->GetGUID(); + break; + + case POD_OMEGA: + Pod_OmegaGUID = go->GetGUID(); + break; + + case SEAL_SPHERE: + GoSphereGUID = go->GetGUID(); + break; + + /*case WARDENS_SHIELD: + Wardens_ShieldGUID = go->GetGUID(); + break;*/ } } diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index beab023b679..e9537546c92 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -790,20 +790,42 @@ class npc_simon_bunny : public CreatureScript { switch (go->GetGOInfo()->displayId) { - case GO_BLUE_CLUSTER_DISPLAY_LARGE: clusterIds[SIMON_BLUE] = go->GetEntry(); break; - case GO_RED_CLUSTER_DISPLAY_LARGE: clusterIds[SIMON_RED] = go->GetEntry(); break; - case GO_GREEN_CLUSTER_DISPLAY_LARGE: clusterIds[SIMON_GREEN] = go->GetEntry(); break; - case GO_YELLOW_CLUSTER_DISPLAY_LARGE: clusterIds[SIMON_YELLOW] = go->GetEntry(); break; + case GO_BLUE_CLUSTER_DISPLAY_LARGE: + clusterIds[SIMON_BLUE] = go->GetEntry(); + break; + + case GO_RED_CLUSTER_DISPLAY_LARGE: + clusterIds[SIMON_RED] = go->GetEntry(); + break; + + case GO_GREEN_CLUSTER_DISPLAY_LARGE: + clusterIds[SIMON_GREEN] = go->GetEntry(); + break; + + case GO_YELLOW_CLUSTER_DISPLAY_LARGE: + clusterIds[SIMON_YELLOW] = go->GetEntry(); + break; } } else { switch (go->GetGOInfo()->displayId) { - case GO_BLUE_CLUSTER_DISPLAY: clusterIds[SIMON_BLUE] = go->GetEntry(); break; - case GO_RED_CLUSTER_DISPLAY: clusterIds[SIMON_RED] = go->GetEntry(); break; - case GO_GREEN_CLUSTER_DISPLAY: clusterIds[SIMON_GREEN] = go->GetEntry(); break; - case GO_YELLOW_CLUSTER_DISPLAY: clusterIds[SIMON_YELLOW] = go->GetEntry(); break; + case GO_BLUE_CLUSTER_DISPLAY: + clusterIds[SIMON_BLUE] = go->GetEntry(); + break; + + case GO_RED_CLUSTER_DISPLAY: + clusterIds[SIMON_RED] = go->GetEntry(); + break; + + case GO_GREEN_CLUSTER_DISPLAY: + clusterIds[SIMON_GREEN] = go->GetEntry(); + break; + + case GO_YELLOW_CLUSTER_DISPLAY: + clusterIds[SIMON_YELLOW] = go->GetEntry(); + break; } } } diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp index 1220a4a24fb..daf0ef213d9 100644 --- a/src/server/scripts/World/areatrigger_scripts.cpp +++ b/src/server/scripts/World/areatrigger_scripts.cpp @@ -252,8 +252,13 @@ class AreaTrigger_at_sholazar_waygate : public AreaTriggerScript { switch (trigger->id) { - case AT_SHOLAZAR: player->CastSpell(player, SPELL_SHOLAZAR_TO_UNGORO_TELEPORT, false); break; - case AT_UNGORO: player->CastSpell(player, SPELL_UNGORO_TO_SHOLAZAR_TELEPORT, false); break; + case AT_SHOLAZAR: + player->CastSpell(player, SPELL_SHOLAZAR_TO_UNGORO_TELEPORT, false); + break; + + case AT_UNGORO: + player->CastSpell(player, SPELL_UNGORO_TO_SHOLAZAR_TELEPORT, false); + break; } } diff --git a/src/server/scripts/World/guards.cpp b/src/server/scripts/World/guards.cpp index 294f1cd291a..e3100522fbe 100644 --- a/src/server/scripts/World/guards.cpp +++ b/src/server/scripts/World/guards.cpp @@ -195,12 +195,26 @@ public: { switch (emote) { - case TEXT_EMOTE_KISS: me->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break; - case TEXT_EMOTE_WAVE: me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break; - case TEXT_EMOTE_SALUTE: me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); break; - case TEXT_EMOTE_SHY: me->HandleEmoteCommand(EMOTE_ONESHOT_FLEX); break; + case TEXT_EMOTE_KISS: + me->HandleEmoteCommand(EMOTE_ONESHOT_BOW); + break; + + case TEXT_EMOTE_WAVE: + me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); + break; + + case TEXT_EMOTE_SALUTE: + me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); + break; + + case TEXT_EMOTE_SHY: + me->HandleEmoteCommand(EMOTE_ONESHOT_FLEX); + break; + case TEXT_EMOTE_RUDE: - case TEXT_EMOTE_CHICKEN: me->HandleEmoteCommand(EMOTE_ONESHOT_POINT); break; + case TEXT_EMOTE_CHICKEN: + me->HandleEmoteCommand(EMOTE_ONESHOT_POINT); + break; } } From 5cb16b65fc90920513d9df969dc262e60dae1116 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Sat, 17 Mar 2012 17:54:48 +0800 Subject: [PATCH 0210/1149] Core/Script: Code style and remove unused core. Signed-off-by: Gyx <2359980687@qq.com> --- .../EasternKingdoms/Deadmines/deadmines.cpp | 4 +- .../ScarletEnclave/chapter5.cpp | 6 +- .../EasternKingdoms/ZulAman/boss_akilzon.cpp | 18 ++-- .../EasternKingdoms/ZulAman/boss_hexlord.cpp | 5 +- .../BattleForMountHyjal/boss_archimonde.cpp | 17 ++- .../CavernsOfTime/DarkPortal/dark_portal.cpp | 4 +- .../scripts/Northrend/borean_tundra.cpp | 76 +++++++------ .../Outland/BlackTemple/boss_illidan.cpp | 19 ++-- .../SerpentShrine/boss_lady_vashj.cpp | 7 +- src/server/scripts/World/item_scripts.cpp | 3 +- src/server/scripts/World/npc_professions.cpp | 100 ++++++++++++------ 11 files changed, 153 insertions(+), 106 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp index 0d473a5adf1..6c6b0647c5f 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp @@ -45,12 +45,12 @@ public: player->GetSession()->SendNotification("Instance script not initialized"); return true; } + if (instance->GetData(EVENT_STATE) != CANNON_NOT_USED) return false; + if (targets.GetGOTarget() && targets.GetGOTarget()->GetEntry() == GO_DEFIAS_CANNON) - { instance->SetData(EVENT_STATE, CANNON_GUNPOWDER_USED); - } player->DestroyItemCount(item->GetEntry(), 1, true); return true; diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 505bf2cbf5c..8918bca637e 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -578,7 +578,8 @@ public: temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[16].x, LightofDawnLoc[16].y, LightofDawnLoc[16].z); } JumpToNextStep(10000); - } break; + } + break; case 4: DoScriptText(SAY_LIGHT_OF_DAWN27, me); me->SetStandState(UNIT_STAND_STATE_KNEEL); @@ -938,7 +939,7 @@ public: case 33: // Darion supports to jump to lich king here if (Unit::GetCreature(*me, uiLichKingGUID)) DoCast(me, SPELL_MOGRAINE_CHARGE); // jumping charge - // doesn't make it looks well, so workarounds, Darion charges, looks better + // doesn't make it looks well, so workarounds, Darion charges, looks better me->SetSpeed(MOVE_RUN, 3.0f); me->SetWalk(false); SetHoldState(false); @@ -1309,7 +1310,6 @@ public: case 71: //if (GameObject* go = me->GetMap()->GetGameObject(uiDawnofLightGUID)) // Turn off dawn of light // go->SetPhaseMask(0, true); - { Map* map = me->GetMap(); // search players with in 50 yards for quest credit Map::PlayerList const &PlayerList = map->GetPlayers(); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index a5eb76545ee..7922d5fbc24 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -209,9 +209,7 @@ class boss_akilzon : public CreatureScript for (std::list::const_iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i) { if (!Cloud->IsWithinDist(*i, 6, false)) - { Cloud->CastCustomSpell(*i, 43137, &bp0, NULL, NULL, true, 0, 0, me->GetGUID()); - } } // visual float x, y, z; @@ -311,7 +309,8 @@ class boss_akilzon : public CreatureScript isRaining = true; } - if (ElectricalStorm_Timer <= diff) { + if (ElectricalStorm_Timer <= diff) + { Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true); if (!target) { @@ -390,15 +389,11 @@ class boss_akilzon : public CreatureScript class mob_akilzon_eagle : public CreatureScript { public: - - mob_akilzon_eagle() - : CreatureScript("mob_akilzon_eagle") - { - } + mob_akilzon_eagle() : CreatureScript("mob_akilzon_eagle") { } struct mob_akilzon_eagleAI : public ScriptedAI { - mob_akilzon_eagleAI(Creature* creature) : ScriptedAI(creature) {} + mob_akilzon_eagleAI(Creature* creature) : ScriptedAI(creature) { } uint32 EagleSwoop_Timer; bool arrived; @@ -412,7 +407,10 @@ class mob_akilzon_eagle : public CreatureScript me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); } - void EnterCombat(Unit* /*who*/) {DoZoneInCombat();} + void EnterCombat(Unit* /*who*/) + { + DoZoneInCombat(); + } void MoveInLineOfSight(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp index 683bed46bb0..fa0627df5f3 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp @@ -186,7 +186,10 @@ struct boss_hexlord_addAI : public ScriptedAI void Reset() {} - void EnterCombat(Unit* /*who*/) {DoZoneInCombat();} + void EnterCombat(Unit* /*who*/) + { + DoZoneInCombat(); + } void UpdateAI(const uint32 /*diff*/) { diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index 8419ce50fc7..a2625861f05 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -108,7 +108,10 @@ public: void EnterCombat(Unit* /*who*/) {} - void DamageTaken(Unit* /*done_by*/, uint32 &damage) { damage = 0; } + void DamageTaken(Unit* /*done_by*/, uint32 &damage) + { + damage = 0; + } void UpdateAI(const uint32 diff) { @@ -148,9 +151,12 @@ public: void MoveInLineOfSight(Unit* /*who*/) {} void EnterCombat(Unit* /*who*/) {} - void DamageTaken(Unit* /*done_by*/, uint32 &damage) { damage = 0; } - }; + void DamageTaken(Unit* /*done_by*/, uint32 &damage) + { + damage = 0; + } + }; }; /* This is the script for the Doomfire Spirit Mob. This mob simply follow players or @@ -188,7 +194,10 @@ public: void EnterCombat(Unit* /*who*/) {} - void DamageTaken(Unit* /*done_by*/, uint32 &damage) { damage = 0; } + void DamageTaken(Unit* /*done_by*/, uint32 &damage) + { + damage = 0; + } void UpdateAI(const uint32 diff) { diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp index 0e155be515a..6a18c0b493b 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp @@ -318,11 +318,11 @@ public: void DoSelectSummon() { - uint32 entry = 0; - if ((mRiftWaveCount > 2 && mWaveId < 1) || mRiftWaveCount > 3) mRiftWaveCount = 0; + uint32 entry = 0; + entry = PortalWaves[mWaveId].PortalMob[mRiftWaveCount]; sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_time_rift: summoning wave Creature (Wave %u, Entry %u).", mRiftWaveCount, entry); diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index 078f4321cae..6b6a58f7b38 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -309,7 +309,6 @@ public: bool OnGossipHello(Player* player, Creature* creature) { - if (player->GetQuestStatus(QUEST_SPIRITS_WATCH_OVER_US) == QUEST_STATUS_INCOMPLETE) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_I, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); @@ -588,6 +587,7 @@ public: Phase = 1; go_caribouGUID = 0; } + void EnterCombat(Unit* /*who*/) {} void MoveInLineOfSight(Unit* /*who*/) {} @@ -617,7 +617,6 @@ public: uiPhaseTimer = 2000; Phase = 2; break; - case 2: if (GameObject* go_fur = me->FindNearestGameObject(GO_HIGH_QUALITY_FUR, 11.0f)) me->GetMotionMaster()->MovePoint(0, go_fur->GetPositionX(), go_fur->GetPositionY(), go_fur->GetPositionZ()); @@ -645,7 +644,6 @@ public: uiPhaseTimer = 500; Phase = 7; break; - case 7: { GameObject* go_caribou = NULL; @@ -662,7 +660,7 @@ public: Phase = 8; uiPhaseTimer = 1000; } - break; + break; case 8: DoCast(me, SPELL_TRAPPED, true); Phase = 0; @@ -1017,7 +1015,6 @@ public: void WaypointReached(uint32 uiPointId) { Player* player = GetPlayerForEscort(); - if (!player) return; @@ -1965,8 +1962,7 @@ public: switch (i) { case 29: - if (player) - player->GroupEventHappens(QUEST_GET_ME_OUTA_HERE, me); + player->GroupEventHappens(QUEST_GET_ME_OUTA_HERE, me); break; } } @@ -2036,7 +2032,7 @@ public: uiTimer = 1500; bStarted = false; - GameObject* pTrap; + GameObject* pTrap = NULL; for (uint8 i = 0; i < MammothTrapsNum; ++i) { pTrap = me->FindNearestGameObject(MammothTraps[i], 11.0f); @@ -2071,11 +2067,12 @@ public: void MovementInform(uint32 uiType, uint32 /*uiId*/) { - if (uiType != POINT_MOTION_TYPE) return; + me->DisappearAndDie(); - GameObject* pTrap; + + GameObject* pTrap = NULL; for (uint8 i = 0; i < MammothTrapsNum; ++i) { pTrap = me->FindNearestGameObject(MammothTraps[i], 11.0f); @@ -2150,13 +2147,15 @@ public: struct npc_seaforium_depth_chargeAI : public ScriptedAI { - npc_seaforium_depth_chargeAI(Creature* creature) : ScriptedAI(creature) {} + npc_seaforium_depth_chargeAI(Creature* creature) : ScriptedAI(creature) { } uint32 uiExplosionTimer; + void Reset() { uiExplosionTimer = urand(5000, 10000); } + void UpdateAI(const uint32 diff) { if (uiExplosionTimer < diff) @@ -2229,7 +2228,6 @@ public: if (!UpdateVictim()) return; } - }; CreatureAI* GetAI(Creature* creature) const @@ -2561,31 +2559,31 @@ public: void AddSC_borean_tundra() { - new npc_sinkhole_kill_credit; - new npc_khunok_the_behemoth; - new npc_keristrasza; - new npc_corastrasza; - new npc_iruk; - new mob_nerubar_victim; - new npc_scourge_prisoner; - new npc_jenny; - new npc_fezzix_geartwist; - new npc_nesingwary_trapper; - new npc_lurgglbr; - new npc_nexus_drake_hatchling; - new npc_thassarian; - new npc_image_lich_king; - new npc_counselor_talbot; - new npc_leryssa; - new npc_general_arlos; - new npc_beryl_sorcerer; - new npc_imprisoned_beryl_sorcerer; - new npc_mootoo_the_younger; - new npc_bonker_togglevolt; - new npc_trapped_mammoth_calf; - new npc_magmoth_crusher; - new npc_seaforium_depth_charge; - new npc_valiance_keep_cannoneer; - new npc_warmage_coldarra; - new npc_hidden_cultist; + new npc_sinkhole_kill_credit(); + new npc_khunok_the_behemoth(); + new npc_keristrasza(); + new npc_corastrasza(); + new npc_iruk(); + new mob_nerubar_victim(); + new npc_scourge_prisoner(); + new npc_jenny(); + new npc_fezzix_geartwist(); + new npc_nesingwary_trapper(); + new npc_lurgglbr(); + new npc_nexus_drake_hatchling(); + new npc_thassarian(); + new npc_image_lich_king(); + new npc_counselor_talbot(); + new npc_leryssa(); + new npc_general_arlos(); + new npc_beryl_sorcerer(); + new npc_imprisoned_beryl_sorcerer(); + new npc_mootoo_the_younger(); + new npc_bonker_togglevolt(); + new npc_trapped_mammoth_calf(); + new npc_magmoth_crusher(); + new npc_seaforium_depth_charge(); + new npc_valiance_keep_cannoneer(); + new npc_warmage_coldarra(); + new npc_hidden_cultist(); } diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 6c14a54e42d..8925f2899f5 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -392,7 +392,10 @@ public: GlaiveGUID = 0; } - void EnterCombat(Unit* /*who*/) {DoZoneInCombat();} + void EnterCombat(Unit* /*who*/) + { + DoZoneInCombat(); + } void ChargeCheck() { @@ -2093,7 +2096,6 @@ public: // } } }; - }; class gameobject_cage_trap : public GameObjectScript @@ -2112,7 +2114,6 @@ public: go->SetGoState(GO_STATE_ACTIVE); return true; } - }; class mob_shadow_demon : public CreatureScript @@ -2131,7 +2132,10 @@ public: uint64 TargetGUID; - void EnterCombat(Unit* /*who*/) {DoZoneInCombat();} + void EnterCombat(Unit* /*who*/) + { + DoZoneInCombat(); + } void Reset() { @@ -2165,7 +2169,6 @@ public: DoCast(me->getVictim(), SPELL_CONSUME_SOUL); } }; - }; class mob_blade_of_azzinoth : public CreatureScript @@ -2224,7 +2227,10 @@ public: DoCast(me, SPELL_SHADOWFIEND_PASSIVE, true); } - void EnterCombat(Unit* /*who*/) { DoZoneInCombat(); } + void EnterCombat(Unit* /*who*/) + { + DoZoneInCombat(); + } void DoMeleeAttackIfReady() { @@ -2270,7 +2276,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_illidan() diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index 76c3f04846e..65d59efb9d6 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -865,7 +865,6 @@ public: bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const& targets) { InstanceScript* instance = player->GetInstanceScript(); - if (!instance) { player->GetSession()->SendNotification(TEXT_NOT_INITIALIZED); @@ -908,12 +907,8 @@ public: } // get and remove channel - if (Unit* channel = Unit::GetCreature(*vashj, CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->ShieldGeneratorChannel[channelIdentifier])) - { - // call Unsummon() - channel->setDeathState(JUST_DIED); - } + channel->setDeathState(JUST_DIED); // call Unsummon() instance->SetData(identifier, 1); diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index cb9b6162f0c..ae69744ea2b 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -94,6 +94,7 @@ public: { if (Creature* nether = player->SummonCreature(22408, player->GetPositionX(), player->GetPositionY()+20, player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000)) nether->AI()->AttackStart(player); + if (Creature* nether = player->SummonCreature(22408, player->GetPositionX(), player->GetPositionY()-20, player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000)) nether->AI()->AttackStart(player); } @@ -340,7 +341,7 @@ public: if (!pMammoth) return false; - GameObject* pTrap; + GameObject* pTrap = NULL; for (uint8 i = 0; i < MammothTrapsNum; ++i) { pTrap = player->FindNearestGameObject(MammothTraps[i], 11.0f); diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index 0a04d049eaa..2afa80dd42c 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -83,11 +83,8 @@ there is no difference here (except that default text is chosen with `gameobject #define BOX_UNLEARN_WEAPON_SPEC "Do you really want to unlearn your weaponsmith specialty and lose all associated recipes? \n Cost: " -#define GOSSIP_LEARN_DRAGON "I am absolutely certain that i want to learn dragonscale leatherworking" #define GOSSIP_UNLEARN_DRAGON "I wish to unlearn Dragonscale Leatherworking" -#define GOSSIP_LEARN_ELEMENTAL "I am absolutely certain that i want to learn elemental leatherworking" #define GOSSIP_UNLEARN_ELEMENTAL "I wish to unlearn Elemental Leatherworking" -#define GOSSIP_LEARN_TRIBAL "I am absolutely certain that i want to learn tribal leatherworking" #define GOSSIP_UNLEARN_TRIBAL "I wish to unlearn Tribal Leatherworking" #define BOX_UNLEARN_LEATHER_SPEC "Do you really want to unlearn your leatherworking specialty and lose all associated recipes? \n Cost: " @@ -101,9 +98,6 @@ there is no difference here (except that default text is chosen with `gameobject #define BOX_UNLEARN_TAILOR_SPEC "Do you really want to unlearn your tailoring specialty and lose all associated recipes? \n Cost: " -#define GOSSIP_LEARN_GOBLIN "I am absolutely certain that i want to learn Goblin engineering" -#define GOSSIP_LEARN_GNOMISH "I am absolutely certain that i want to learn Gnomish engineering" - /*### # spells defines ###*/ @@ -387,8 +381,10 @@ public: { if (creature->isQuestGiver()) player->PrepareQuestMenu(creature->GetGUID()); + if (creature->isVendor()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + if (creature->isTrainer()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); @@ -512,10 +508,21 @@ public: player->PlayerTalkClass->ClearMenus(); switch (sender) { - case GOSSIP_SENDER_MAIN: SendActionMenu(player, creature, action); break; - case GOSSIP_SENDER_LEARN: SendConfirmLearn(player, creature, action); break; - case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn(player, creature, action); break; - case GOSSIP_SENDER_CHECK: SendActionMenu(player, creature, action); break; + case GOSSIP_SENDER_MAIN: + SendActionMenu(player, creature, action); + break; + + case GOSSIP_SENDER_LEARN: + SendConfirmLearn(player, creature, action); + break; + + case GOSSIP_SENDER_UNLEARN: + SendConfirmUnlearn(player, creature, action); + break; + + case GOSSIP_SENDER_CHECK: + SendActionMenu(player, creature, action); + break; } return true; } @@ -539,8 +546,10 @@ public: { if (creature->isQuestGiver()) player->PrepareQuestMenu(creature->GetGUID()); + if (creature->isVendor()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + if (creature->isTrainer()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); @@ -729,10 +738,21 @@ public: player->PlayerTalkClass->ClearMenus(); switch (sender) { - case GOSSIP_SENDER_MAIN: SendActionMenu(player, creature, action); break; - case GOSSIP_SENDER_LEARN: SendConfirmLearn(player, creature, action); break; - case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn(player, creature, action); break; - case GOSSIP_SENDER_CHECK: SendActionMenu(player, creature, action); break; + case GOSSIP_SENDER_MAIN: + SendActionMenu(player, creature, action); + break; + + case GOSSIP_SENDER_LEARN: + SendConfirmLearn(player, creature, action); + break; + + case GOSSIP_SENDER_UNLEARN: + SendConfirmUnlearn(player, creature, action); + break; + + case GOSSIP_SENDER_CHECK: + SendActionMenu(player, creature, action); + break; } return true; } @@ -763,7 +783,6 @@ enum eEngineeringTrinkets #define GOSSIP_ITEM_ZAP "[PH] Unknown" #define GOSSIP_ITEM_JHORDY "I must build a beacon for this marvelous device!" #define GOSSIP_ITEM_KABLAM "[PH] Unknown" -#define GOSSIP_ITEM_SMILES "[PH] Unknown" class npc_engineering_tele_trinket : public CreatureScript { @@ -866,8 +885,10 @@ public: { if (creature->isQuestGiver()) player->PrepareQuestMenu(creature->GetGUID()); + if (creature->isVendor()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + if (creature->isTrainer()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); @@ -953,9 +974,17 @@ public: player->PlayerTalkClass->ClearMenus(); switch (sender) { - case GOSSIP_SENDER_MAIN: SendActionMenu(player, creature, action); break; - case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn(player, creature, action); break; - case GOSSIP_SENDER_CHECK: SendActionMenu(player, creature, action); break; + case GOSSIP_SENDER_MAIN: + SendActionMenu(player, creature, action); + break; + + case GOSSIP_SENDER_UNLEARN: + SendConfirmUnlearn(player, creature, action); + break; + + case GOSSIP_SENDER_CHECK: + SendActionMenu(player, creature, action); + break; } return true; } @@ -979,8 +1008,10 @@ public: { if (creature->isQuestGiver()) player->PrepareQuestMenu(creature->GetGUID()); + if (creature->isVendor()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + if (creature->isTrainer()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); @@ -1105,24 +1136,31 @@ public: player->PlayerTalkClass->ClearMenus(); switch (sender) { - case GOSSIP_SENDER_MAIN: SendActionMenu(player, creature, action); break; - case GOSSIP_SENDER_LEARN: SendConfirmLearn(player, creature, action); break; - case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn(player, creature, action); break; - case GOSSIP_SENDER_CHECK: SendActionMenu(player, creature, action); break; + case GOSSIP_SENDER_MAIN: + SendActionMenu(player, creature, action); + break; + + case GOSSIP_SENDER_LEARN: + SendConfirmLearn(player, creature, action); + break; + + case GOSSIP_SENDER_UNLEARN: + SendConfirmUnlearn(player, creature, action); + break; + + case GOSSIP_SENDER_CHECK: + SendActionMenu(player, creature, action); + break; } return true; } }; -/*### -# -###*/ - void AddSC_npc_professions() { - new npc_prof_alchemy; - new npc_prof_blacksmith; - new npc_engineering_tele_trinket; - new npc_prof_leather; - new npc_prof_tailor; + new npc_prof_alchemy(); + new npc_prof_blacksmith(); + new npc_engineering_tele_trinket(); + new npc_prof_leather(); + new npc_prof_tailor(); } From 80975faba2f11ee897b8ea78380b387595166ae2 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 17 Mar 2012 11:50:30 +0100 Subject: [PATCH 0211/1149] Core/Movement: Add debug output to Worldsession::ReadMovementInfo to find out which movementflag restriction was violated. Please use this to give feedback. --- src/server/game/Server/WorldSession.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index c060a17f20f..5565828f698 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -810,6 +810,9 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) //! Anti-cheat checks. Please keep them in seperate if() blocks to maintain a clear overview. #define VIOLATE_AND_RETURN \ { \ + sLog->outDebug(LOG_FILTER_UNITS, "WorldSession::ReadMovementInfo: Violation of MovementFlags found. " + "MovementFlags: %u, MovementFlags2: %u for player GUID: %u. Player will not be relocated.", + mi->GetMovementFlags(), mi->GetExtraMovementFlags(), GetPlayer()->GetGUIDLow()); mi->Violated = true; \ return; \ } \ From 5d2d2a5ac76e15b4bb313e85730df57443690443 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 17 Mar 2012 11:54:21 +0100 Subject: [PATCH 0212/1149] Update src/server/game/Server/WorldSession.cpp --- src/server/game/Server/WorldSession.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 5565828f698..3bc80eb1901 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -812,7 +812,7 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) { \ sLog->outDebug(LOG_FILTER_UNITS, "WorldSession::ReadMovementInfo: Violation of MovementFlags found. " "MovementFlags: %u, MovementFlags2: %u for player GUID: %u. Player will not be relocated.", - mi->GetMovementFlags(), mi->GetExtraMovementFlags(), GetPlayer()->GetGUIDLow()); + mi->GetMovementFlags(), mi->GetExtraMovementFlags(), GetPlayer()->GetGUIDLow()); \ mi->Violated = true; \ return; \ } \ From 87a121425caa4272ace6ea071a02bb263d0e8b56 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 17 Mar 2012 11:54:56 +0100 Subject: [PATCH 0213/1149] Update src/server/game/Server/WorldSession.cpp --- src/server/game/Server/WorldSession.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 3bc80eb1901..eca96f857b2 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -810,8 +810,8 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) //! Anti-cheat checks. Please keep them in seperate if() blocks to maintain a clear overview. #define VIOLATE_AND_RETURN \ { \ - sLog->outDebug(LOG_FILTER_UNITS, "WorldSession::ReadMovementInfo: Violation of MovementFlags found. " - "MovementFlags: %u, MovementFlags2: %u for player GUID: %u. Player will not be relocated.", + sLog->outDebug(LOG_FILTER_UNITS, "WorldSession::ReadMovementInfo: Violation of MovementFlags found. " \ + "MovementFlags: %u, MovementFlags2: %u for player GUID: %u. Player will not be relocated.", \ mi->GetMovementFlags(), mi->GetExtraMovementFlags(), GetPlayer()->GetGUIDLow()); \ mi->Violated = true; \ return; \ From e02cda54cd562cc209a0d67c44deda01ba404272 Mon Sep 17 00:00:00 2001 From: kaelima Date: Sat, 17 Mar 2012 13:05:21 +0100 Subject: [PATCH 0214/1149] Core/Protocol: Have client displaying some graphic/audio when player increased its reputation rank --- src/server/game/Reputation/ReputationMgr.cpp | 26 ++++++++++++-------- src/server/game/Reputation/ReputationMgr.h | 1 + 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index b1f38dfb86d..2a50f6e3c85 100755 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -166,15 +166,16 @@ void ReputationMgr::SendState(FactionState const* faction) { uint32 count = 1; - WorldPacket data(SMSG_SET_FACTION_STANDING, (16)); // last check 2.4.0 - data << (float) 0; // unk 2.4.0 - data << (uint8) 0; // wotlk 8634 + WorldPacket data(SMSG_SET_FACTION_STANDING, 17); + data << float(0); + data << uint8(_sendFactionIncreased); + _sendFactionIncreased = false; // Reset size_t p_count = data.wpos(); - data << (uint32) count; // placeholder + data << uint32(count); - data << (uint32) faction->ReputationListID; - data << (uint32) faction->Standing; + data << uint32(faction->ReputationListID); + data << uint32(faction->Standing); for (FactionStateList::iterator itr = _factions.begin(); itr != _factions.end(); ++itr) { @@ -183,8 +184,8 @@ void ReputationMgr::SendState(FactionState const* faction) itr->second.needSend = false; if (itr->second.ReputationListID != faction->ReputationListID) { - data << (uint32) itr->second.ReputationListID; - data << (uint32) itr->second.Standing; + data << uint32(itr->second.ReputationListID); + data << uint32(itr->second.Standing); ++count; } } @@ -253,6 +254,7 @@ void ReputationMgr::Initialize() _honoredFactionCount = 0; _reveredFactionCount = 0; _exaltedFactionCount = 0; + _sendFactionIncreased = false; for (unsigned int i = 1; i < sFactionStore.GetNumRows(); i++) { @@ -337,6 +339,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi } } } + // spillover done, update faction itself FactionStateList::iterator faction = _factions.find(factionEntry->reputationListID); if (faction != _factions.end()) @@ -379,11 +382,14 @@ bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, in if (new_rank <= REP_HOSTILE) SetAtWar(&itr->second, true); + if (new_rank > old_rank) + _sendFactionIncreased = true; + UpdateRankCounters(old_rank, new_rank); _player->ReputationChanged(factionEntry); - _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS, factionEntry->ID); - _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION, factionEntry->ID); + _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS, factionEntry->ID); + _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION, factionEntry->ID); _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION, factionEntry->ID); _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION, factionEntry->ID); _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION, factionEntry->ID); diff --git a/src/server/game/Reputation/ReputationMgr.h b/src/server/game/Reputation/ReputationMgr.h index 84013f7ec20..401503783b9 100755 --- a/src/server/game/Reputation/ReputationMgr.h +++ b/src/server/game/Reputation/ReputationMgr.h @@ -156,6 +156,7 @@ class ReputationMgr uint8 _honoredFactionCount :8; uint8 _reveredFactionCount :8; uint8 _exaltedFactionCount :8; + bool _sendFactionIncreased; //! Play visual effect on next SMSG_SET_FACTION_STANDING sent }; #endif From 1e94ab8d51eda1e139a0f6d06b5843dcf9f10ef7 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Sat, 17 Mar 2012 20:13:37 +0800 Subject: [PATCH 0215/1149] Core/Game: Code style and remove unused core. Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/Chat/Commands/Level0.cpp | 8 ++-- src/server/game/Chat/Commands/Level1.cpp | 19 ++++----- src/server/game/Chat/Commands/Level2.cpp | 9 ++--- src/server/game/Chat/Commands/Level3.cpp | 31 ++++++--------- src/server/game/DataStores/DBCStores.cpp | 4 +- .../game/Entities/Creature/Creature.cpp | 8 ++-- src/server/game/Entities/Pet/Pet.cpp | 3 +- src/server/game/Entities/Player/Player.cpp | 39 ++++++++++++------- .../game/Handlers/BattleGroundHandler.cpp | 3 +- src/server/game/Handlers/QuestHandler.cpp | 3 +- .../game/Spells/Auras/SpellAuraEffects.cpp | 16 ++++++-- src/server/game/Spells/SpellEffects.cpp | 4 +- src/server/game/Tools/PlayerDump.cpp | 3 +- 13 files changed, 83 insertions(+), 67 deletions(-) diff --git a/src/server/game/Chat/Commands/Level0.cpp b/src/server/game/Chat/Commands/Level0.cpp index 6d33a5761f4..bb744016257 100755 --- a/src/server/game/Chat/Commands/Level0.cpp +++ b/src/server/game/Chat/Commands/Level0.cpp @@ -70,11 +70,11 @@ bool ChatHandler::HandleStartCommand(const char* /*args*/) return false; } - if ((chr->isDead()) || (chr->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))) + if (chr->isDead() || chr->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) { - // if player is dead and stuck, send ghost to graveyard - chr->RepopAtGraveyard(); - return true; + // if player is dead and stuck, send ghost to graveyard + chr->RepopAtGraveyard(); + return true; } // cast spell Stuck diff --git a/src/server/game/Chat/Commands/Level1.cpp b/src/server/game/Chat/Commands/Level1.cpp index cb42863ca73..a5647d2a5c0 100755 --- a/src/server/game/Chat/Commands/Level1.cpp +++ b/src/server/game/Chat/Commands/Level1.cpp @@ -42,7 +42,6 @@ bool ChatHandler::HandleNameAnnounceCommand(const char* args) { - WorldPacket data; if (!*args) return false; @@ -56,7 +55,6 @@ bool ChatHandler::HandleNameAnnounceCommand(const char* args) bool ChatHandler::HandleGMNameAnnounceCommand(const char* args) { - WorldPacket data; if (!*args) return false; @@ -422,13 +420,10 @@ bool ChatHandler::HandleTaxiCheatCommand(const char* args) std::string argstr = (char*)args; Player* chr = getSelectedPlayer(); - if (!chr) - { - chr=m_session->GetPlayer(); - } - // check online security - else if (HasLowerSecurity(chr, 0)) + if (!chr) + chr = m_session->GetPlayer(); + else if (HasLowerSecurity(chr, 0)) // check online security return false; if (argstr == "on") @@ -474,12 +469,12 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args) wstrToLower (wnamepart); // Search in AreaTable.dbc - for (uint32 areaflag = 0; areaflag < sAreaStore.GetNumRows (); ++areaflag) + for (uint32 areaflag = 0; areaflag < sAreaStore.GetNumRows(); ++areaflag) { - AreaTableEntry const* areaEntry = sAreaStore.LookupEntry (areaflag); + AreaTableEntry const* areaEntry = sAreaStore.LookupEntry(areaflag); if (areaEntry) { - int loc = GetSessionDbcLocale (); + int loc = GetSessionDbcLocale(); std::string name = areaEntry->area_name[loc]; if (name.empty()) continue; @@ -489,7 +484,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args) loc = 0; for (; loc < TOTAL_LOCALES; ++loc) { - if (loc == GetSessionDbcLocale ()) + if (loc == GetSessionDbcLocale()) continue; name = areaEntry->area_name[loc]; diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index 68961b9de61..062cdb331ea 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -175,7 +175,6 @@ bool ChatHandler::HandleItemMoveCommand(const char* args) { if (!*args) return false; - uint8 srcslot, dstslot; char* pParam1 = strtok((char*)args, " "); if (!pParam1) @@ -185,8 +184,8 @@ bool ChatHandler::HandleItemMoveCommand(const char* args) if (!pParam2) return false; - srcslot = (uint8)atoi(pParam1); - dstslot = (uint8)atoi(pParam2); + uint8 srcslot = (uint8)atoi(pParam1); + uint8 dstslot = (uint8)atoi(pParam2); if (srcslot == dstslot) return true; @@ -279,7 +278,6 @@ bool ChatHandler::HandlePInfoCommand(const char* args) uint32 areaId; uint32 phase = 0; - // get additional information from Player object if (target) { @@ -756,7 +754,6 @@ bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args) bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args) { - if (!*args) return false; @@ -768,7 +765,7 @@ bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args) QueryResult result = LoginDatabase.PQuery ("SELECT id, username FROM account WHERE email = '%s'", email.c_str ()); - return LookupPlayerSearchCommand (result, limit); + return LookupPlayerSearchCommand(result, limit); } bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit) diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index cb3eb825354..0b7bbf9e7ba 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -87,11 +87,10 @@ bool ChatHandler::HandleSetSkillCommand(const char *args) return false; char *level_p = strtok (NULL, " "); - if (!level_p) return false; - char *max_p = strtok (NULL, " "); + char *max_p = strtok (NULL, " "); int32 skill = atoi(skill_p); if (skill <= 0) @@ -128,7 +127,7 @@ bool ChatHandler::HandleSetSkillCommand(const char *args) return false; } - int32 max = max_p ? atol (max_p) : target->GetPureMaxSkillValue(skill); + int32 max = max_p ? atol (max_p) : target->GetPureMaxSkillValue(skill); if (level <= 0 || level > max || max <= 0) return false; @@ -631,7 +630,7 @@ bool ChatHandler::HandleListObjectCommand(const char *args) QueryResult result; uint32 obj_count = 0; - result=WorldDatabase.PQuery("SELECT COUNT(guid) FROM gameobject WHERE id='%u'", go_id); + result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM gameobject WHERE id='%u'", go_id); if (result) obj_count = (*result)[0].GetUInt32(); @@ -703,7 +702,7 @@ bool ChatHandler::HandleListCreatureCommand(const char *args) QueryResult result; uint32 cr_count = 0; - result=WorldDatabase.PQuery("SELECT COUNT(guid) FROM creature WHERE id='%u'", cr_id); + result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM creature WHERE id='%u'", cr_id); if (result) cr_count = (*result)[0].GetUInt32(); @@ -2143,16 +2142,12 @@ bool ChatHandler::HandleExploreCheatCommand(const char *args) ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING, GetNameLink().c_str()); } - for (uint8 i=0; iGetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0xFFFFFFFF); - } else - { m_session->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0); - } } return true; @@ -2434,7 +2429,9 @@ bool ChatHandler::HandleListAurasCommand (const char * /*args*/) for (uint16 i = 0; i < TOTAL_AURAS; ++i) { Unit::AuraEffectList const& uAuraList = unit->GetAuraEffectsByType(AuraType(i)); - if (uAuraList.empty()) continue; + if (uAuraList.empty()) + continue; + PSendSysMessage(LANG_COMMAND_TARGET_LISTAURATYPE, uAuraList.size(), i); for (Unit::AuraEffectList::const_iterator itr = uAuraList.begin(); itr != uAuraList.end(); ++itr) { @@ -2739,7 +2736,7 @@ bool ChatHandler::HandleServerShutDownCommand(const char *args) if (exitcode < 0 || exitcode > 125) return false; - sWorld->ShutdownServ (time, 0, exitcode); + sWorld->ShutdownServ(time, 0, exitcode); } else sWorld->ShutdownServ(time, 0, SHUTDOWN_EXIT_CODE); @@ -2774,7 +2771,7 @@ bool ChatHandler::HandleServerRestartCommand(const char *args) if (exitcode < 0 || exitcode > 125) return false; - sWorld->ShutdownServ (time, SHUTDOWN_MASK_RESTART, exitcode); + sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, exitcode); } else sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE); @@ -2809,7 +2806,7 @@ bool ChatHandler::HandleServerIdleRestartCommand(const char *args) if (exitcode < 0 || exitcode > 125) return false; - sWorld->ShutdownServ (time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, exitcode); + sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, exitcode); } else sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE); @@ -2844,7 +2841,7 @@ bool ChatHandler::HandleServerIdleShutDownCommand(const char *args) if (exitcode < 0 || exitcode > 125) return false; - sWorld->ShutdownServ (time, SHUTDOWN_MASK_IDLE, exitcode); + sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, exitcode); } else sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE); @@ -4494,10 +4491,6 @@ bool ChatHandler::HandleChannelSetOwnership(const char *args) return true; } -/*------------------------------------------ - *-------------TRINITY---------------------- - *-------------------------------------*/ - bool ChatHandler::HandlePlayAllCommand(const char *args) { if (!*args) diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index cbff5c900f6..65a51da037f 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -474,7 +474,9 @@ void LoadDBCStores(const std::string& dataPath) for (unsigned int i = 0; i < sTalentStore.GetNumRows(); ++i) { TalentEntry const* talentInfo = sTalentStore.LookupEntry(i); - if (!talentInfo) continue; + if (!talentInfo) + continue; + for (int j = 0; j < MAX_TALENT_RANK; j++) if (talentInfo->RankID[j]) sTalentSpellPosMap[talentInfo->RankID[j]] = TalentSpellPos(i, j); diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 94dfa938cb8..ca893a7c482 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1695,13 +1695,14 @@ SpellInfo const* Creature::reachWithSpellAttack(Unit* victim) (spellInfo->Effects[j].Effect == SPELL_EFFECT_INSTAKILL) || (spellInfo->Effects[j].Effect == SPELL_EFFECT_ENVIRONMENTAL_DAMAGE) || (spellInfo->Effects[j].Effect == SPELL_EFFECT_HEALTH_LEECH) -) + ) { bcontinue = false; break; } } - if (bcontinue) continue; + if (bcontinue) + continue; if (spellInfo->ManaCost > GetPower(POWER_MANA)) continue; @@ -1744,7 +1745,8 @@ SpellInfo const* Creature::reachWithSpellCure(Unit* victim) break; } } - if (bcontinue) continue; + if (bcontinue) + continue; if (spellInfo->ManaCost > GetPower(POWER_MANA)) continue; diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index e7103e2cb70..3221017e108 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -1336,7 +1336,8 @@ bool Pet::addSpell(uint32 spellId, ActiveStates active /*= ACT_DECIDE*/, PetSpel { for (PetSpellMap::const_iterator itr2 = m_spells.begin(); itr2 != m_spells.end(); ++itr2) { - if (itr2->second.state == PETSPELL_REMOVED) continue; + if (itr2->second.state == PETSPELL_REMOVED) + continue; SpellInfo const* oldRankSpellInfo = sSpellMgr->GetSpellInfo(itr2->first); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index ffa216dd605..bd5b1010f45 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3692,9 +3692,12 @@ bool Player::addSpell(uint32 spellId, bool active, bool learning, bool dependent { for (PlayerSpellMap::iterator itr2 = m_spells.begin(); itr2 != m_spells.end(); ++itr2) { - if (itr2->second->state == PLAYERSPELL_REMOVED) continue; + if (itr2->second->state == PLAYERSPELL_REMOVED) + continue; + SpellInfo const* i_spellInfo = sSpellMgr->GetSpellInfo(itr2->first); - if (!i_spellInfo) continue; + if (!i_spellInfo) + continue; if (spellInfo->IsDifferentRankOf(i_spellInfo)) { @@ -8293,7 +8296,9 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 { uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(e_slot)); SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); - if (!pEnchant) continue; + if (!pEnchant) + continue; + for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s) { if (pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) @@ -11165,7 +11170,8 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const Item* pItem = pItems[k]; // no item - if (!pItem) continue; + if (!pItem) + continue; sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItems %i. item = %u, count = %u", k + 1, pItem->GetEntry(), pItem->GetCount()); ItemTemplate const* pProto = pItem->GetTemplate(); @@ -11204,7 +11210,8 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const break; } } - if (b_found) continue; + if (b_found) + continue; for (int t = CURRENCYTOKEN_SLOT_START; t < CURRENCYTOKEN_SLOT_END; ++t) { @@ -11216,7 +11223,8 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const break; } } - if (b_found) continue; + if (b_found) + continue; for (int t = INVENTORY_SLOT_ITEM_START; t < INVENTORY_SLOT_ITEM_END; ++t) { @@ -11228,7 +11236,8 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const break; } } - if (b_found) continue; + if (b_found) + continue; for (int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t) { @@ -11249,7 +11258,8 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const } } } - if (b_found) continue; + if (b_found) + continue; } // special bag case @@ -11270,7 +11280,8 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const } } - if (b_found) continue; + if (b_found) + continue; if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS) { @@ -11285,7 +11296,8 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const } } - if (b_found) continue; + if (b_found) + continue; for (int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t) { @@ -11309,7 +11321,8 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const } } } - if (b_found) continue; + if (b_found) + continue; } // search free slot @@ -11323,7 +11336,8 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const break; } } - if (b_found) continue; + if (b_found) + continue; // search free slot in bags for (int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t) @@ -23353,7 +23367,6 @@ void Player::SetTitle(CharTitlesEntry const* title, bool lost) GetSession()->SendPacket(&data); } -/*-----------------------TRINITY--------------------------*/ bool Player::isTotalImmunity() { AuraEffectList const& immune = GetAuraEffectsByType(SPELL_AURA_SCHOOL_IMMUNITY); diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index e11f6e5b4e2..a0c5268136b 100755 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -216,7 +216,8 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) { Player* member = itr->getSource(); - if (!member) continue; // this should never happen + if (!member) + continue; // this should never happen WorldPacket data; diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index 73bbc58c445..34fed5e9a97 100755 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -643,7 +643,8 @@ uint32 WorldSession::getDialogStatus(Player* player, Object* questgiver, uint32 uint32 result2 = 0; uint32 quest_id = i->second; Quest const* quest = sObjectMgr->GetQuestTemplate(quest_id); - if (!quest) continue; + if (!quest) + continue; ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, quest->GetQuestId()); if (!sConditionMgr->IsObjectMeetToConditions(player, conditions)) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 9400ec1e798..3c266c7139c 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1462,10 +1462,16 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const const PlayerSpellMap& sp_list = target->ToPlayer()->GetSpellMap(); for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr) { - if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled) continue; - if (itr->first == spellId || itr->first == spellId2) continue; + if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled) + continue; + + if (itr->first == spellId || itr->first == spellId2) + continue; + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); - if (!spellInfo || !(spellInfo->Attributes & (SPELL_ATTR0_PASSIVE | SPELL_ATTR0_HIDDEN_CLIENTSIDE))) continue; + if (!spellInfo || !(spellInfo->Attributes & (SPELL_ATTR0_PASSIVE | SPELL_ATTR0_HIDDEN_CLIENTSIDE))) + continue; + if (spellInfo->Stances & (1<<(GetMiscValue()-1))) target->CastSpell(target, itr->first, true, NULL, this); } @@ -2069,7 +2075,9 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo PlayerSpellMap const& sp_list = target->ToPlayer()->GetSpellMap(); for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr) { - if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled) continue; + if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled) + continue; + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); if (spellInfo && spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR && spellInfo->SpellIconID == 139) Rage_val += target->CalculateSpellDamage(target, spellInfo, 0) * 10; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 01782ba4312..56cc6b6f8ec 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -4038,7 +4038,9 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) while (bag) // 256 = 0 due to var type { item = m_caster->ToPlayer()->GetItemByPos(bag, slot); - if (item && item->GetEntry() == 38587) break; + if (item && item->GetEntry() == 38587) + break; + ++slot; if (slot == 39) { diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp index 4d9c5a93875..900fcf7392a 100644 --- a/src/server/game/Tools/PlayerDump.cpp +++ b/src/server/game/Tools/PlayerDump.cpp @@ -452,7 +452,8 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s { if (!fgets(buf, 32000, fin)) { - if (feof(fin)) break; + if (feof(fin)) + break; ROLLBACK(DUMP_FILE_BROKEN); } From b76c2c144d0a93150fa312f6e622871ce018c408 Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Sat, 17 Mar 2012 18:26:22 +0200 Subject: [PATCH 0216/1149] Core/Unit: Fix respawning after ForceDespawn is called. --- src/server/game/Entities/Unit/Unit.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 1bf8334ae79..478db7d1374 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12726,6 +12726,7 @@ void Unit::setDeathState(DeathState s) GetMotionMaster()->Clear(false); GetMotionMaster()->MoveIdle(); StopMoving(); + DisableSpline(); // without this when removing IncreaseMaxHealth aura player may stuck with 1 hp // do not why since in IncreaseMaxHealth currenthealth is checked SetHealth(0); From 5d25dc8926dcac65c9981cd865af15aa7d780516 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 17 Mar 2012 17:51:00 +0100 Subject: [PATCH 0217/1149] Tools/VmapExtractor: Don't check registry for game folder on windows, just use relative "Data" dir, similar to linux. --- src/tools/vmap4_extractor/vmapexport.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/tools/vmap4_extractor/vmapexport.cpp b/src/tools/vmap4_extractor/vmapexport.cpp index 68de8d653ba..e60a773c6de 100644 --- a/src/tools/vmap4_extractor/vmapexport.cpp +++ b/src/tools/vmap4_extractor/vmapexport.cpp @@ -261,20 +261,7 @@ void ParsMapFiles() void getGamePath() { #ifdef _WIN32 - HKEY key; - DWORD t,s; - LONG l; - s = sizeof(input_path); - memset(input_path,0,s); - l = RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Blizzard Entertainment\\World of Warcraft",0,KEY_QUERY_VALUE,&key); - //l = RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Blizzard Entertainment\\Burning Crusade Closed Beta",0,KEY_QUERY_VALUE,&key); - l = RegQueryValueEx(key,"InstallPath",0,&t,(LPBYTE)input_path,&s); - RegCloseKey(key); - if (strlen(input_path) > 0) - { - if (input_path[strlen(input_path) - 1] != '\\') strcat(input_path, "\\"); - } - strcat(input_path,"Data\\"); + strcpy(input_path,"Data\\"); #else strcpy(input_path,"Data/"); #endif From 01f3620d4534d2bdafadf9a04f09330d406bd019 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 17 Mar 2012 18:01:56 +0100 Subject: [PATCH 0218/1149] Core/Movement: Corrected movement info structure written in WriteMovementInfo --- src/server/game/Handlers/MovementHandler.cpp | 4 +--- src/server/game/Server/WorldSession.cpp | 7 +++++-- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 55c55ffb246..a93bec6a616 100755 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -528,7 +528,7 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket & recv_data) MovementInfo movementInfo; ReadMovementInfo(recv_data, &movementInfo); - + if (movementInfo.Violated) { recv_data.rfinish(); @@ -592,5 +592,3 @@ void WorldSession::HandleSummonResponseOpcode(WorldPacket& recv_data) _player->SummonIfPossible(agree); } - -#undef IF_VIOLATED_RETURN \ No newline at end of file diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index eca96f857b2..e6634019c09 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -864,9 +864,9 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) situations it may be feasable to use .gm fly on as a GM without having .gm on, e.g. aerial combat. */ - + if (mi->HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY) && GetSecurity() == SEC_PLAYER && - !GetPlayer()->m_mover->HasAuraType(SPELL_AURA_FLY) && + !GetPlayer()->m_mover->HasAuraType(SPELL_AURA_FLY) && !GetPlayer()->m_mover->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)) VIOLATE_AND_RETURN; @@ -889,6 +889,9 @@ void WorldSession::WriteMovementInfo(WorldPacket* data, MovementInfo* mi) *data << mi->t_pos.PositionXYZOStream(); *data << mi->t_time; *data << mi->t_seat; + + if (mi->HasExtraMovementFlag(MOVEMENTFLAG2_INTERPOLATED_MOVEMENT)) + *data << mi->t_time2; } if (mi->HasMovementFlag(MovementFlags(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || mi->HasExtraMovementFlag(MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING)) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 3c266c7139c..bfa51219d71 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2882,7 +2882,7 @@ void AuraEffect::HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, target->AddUnitMovementFlag(MOVEMENTFLAG_WATERWALKING); else target->RemoveUnitMovementFlag(MOVEMENTFLAG_WATERWALKING); - + target->SendMovementWaterWalking(); } @@ -3234,7 +3234,7 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp, Unit* target = aurApp->GetTarget(); - //! Update ability to fly + //! Update ability to fly if (GetAuraType() == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) { // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit From 41cc704bf86dc1832a18cdd7ecd387fbb9137775 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 17 Mar 2012 20:34:03 +0100 Subject: [PATCH 0219/1149] Core/Movement: - Don't abort relocation if movementflag restrictions were violated. There might be lag between client and server and even different parts of the core that made this approach improper. - MOVEMENTFLAG_ROOT cannot be used in conjunction with MOVEMENTFLAG_MASK_MOVING, but it's a valid flag to receive from client. - Fix falling to ground when unapplying fly/waterwalk aura. NOTE: This is a client-side initiated fall, in the future this should be initiated and updated by the server. (Working on it) - Rename MOVEMENTFLAG_FALLING to MOVEMENTFLAG_FALLING_FAR - Rename MOVEMENTFLAG_JUMPING to MOVEMENTFLAG_FALLING Closes #5751 --- src/server/game/Entities/Object/Object.cpp | 2 +- src/server/game/Entities/Object/Object.h | 6 +- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/game/Entities/Unit/Unit.h | 6 +- src/server/game/Handlers/MiscHandler.cpp | 8 +- src/server/game/Handlers/MovementHandler.cpp | 20 ---- src/server/game/Handlers/VehicleHandler.cpp | 13 -- src/server/game/Server/WorldSession.cpp | 111 ++++++++++-------- .../game/Spells/Auras/SpellAuraEffects.cpp | 22 +++- src/server/game/Spells/Spell.cpp | 4 +- .../PitOfSaron/boss_krickandick.cpp | 2 +- .../scripts/Northrend/sholazar_basin.cpp | 6 +- .../boss_omor_the_unscarred.cpp | 2 +- 13 files changed, 94 insertions(+), 110 deletions(-) diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index d8ee305230e..fe89a346911 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1186,7 +1186,7 @@ void MovementInfo::OutDebug() sLog->outString("pitch: %f", pitch); sLog->outString("fallTime: %u", fallTime); - if (flags & MOVEMENTFLAG_JUMPING) + if (flags & MOVEMENTFLAG_FALLING) sLog->outString("j_zspeed: %f j_sinAngle: %f j_cosAngle: %f j_xyspeed: %f", j_zspeed, j_sinAngle, j_cosAngle, j_xyspeed); if (flags & MOVEMENTFLAG_SPLINE_ELEVATION) diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 24ddd7973ab..972be794464 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -482,9 +482,6 @@ struct MovementInfo // spline float splineElevation; - //! Server side only: - bool Violated; - MovementInfo() { pos.Relocate(0, 0, 0, 0); @@ -497,7 +494,6 @@ struct MovementInfo t_guid = 0; t_pos.Relocate(0, 0, 0, 0); t_seat = -1; - Violated = false; } uint32 GetMovementFlags() { return flags; } @@ -510,6 +506,8 @@ struct MovementInfo void AddExtraMovementFlag(uint16 flag) { flags2 |= flag; } bool HasExtraMovementFlag(uint16 flag) const { return flags2 & flag; } + void SetFallTime(uint32 time) { fallTime = time; } + void OutDebug(); }; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 478db7d1374..151f7491567 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17117,7 +17117,7 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const *data << (uint32)m_movementInfo.fallTime; // 0x00001000 - if (GetUnitMovementFlags() & MOVEMENTFLAG_JUMPING) + if (GetUnitMovementFlags() & MOVEMENTFLAG_FALLING) { *data << (float)m_movementInfo.j_zspeed; *data << (float)m_movementInfo.j_sinAngle; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 0e24fdffa9d..cde2c67429c 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -678,8 +678,8 @@ enum MovementFlags MOVEMENTFLAG_ONTRANSPORT = 0x00000200, // Used for flying on some creatures MOVEMENTFLAG_DISABLE_GRAVITY = 0x00000400, // Former MOVEMENTFLAG_LEVITATING. This is used when walking is not possible. MOVEMENTFLAG_ROOT = 0x00000800, // Must not be set along with MOVEMENTFLAG_MASK_MOVING - MOVEMENTFLAG_JUMPING = 0x00001000, - MOVEMENTFLAG_FALLING = 0x00002000, // damage dealt on that type of falling + MOVEMENTFLAG_FALLING = 0x00001000, // damage dealt on that type of falling + MOVEMENTFLAG_FALLING_FAR = 0x00002000, MOVEMENTFLAG_PENDING_STOP = 0x00004000, MOVEMENTFLAG_PENDING_STRAFE_STOP = 0x00008000, MOVEMENTFLAG_PENDING_FORWARD = 0x00010000, @@ -701,7 +701,7 @@ enum MovementFlags // TODO: Check if PITCH_UP and PITCH_DOWN really belong here.. MOVEMENTFLAG_MASK_MOVING = MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_BACKWARD | MOVEMENTFLAG_STRAFE_LEFT | MOVEMENTFLAG_STRAFE_RIGHT | - MOVEMENTFLAG_PITCH_UP | MOVEMENTFLAG_PITCH_DOWN | MOVEMENTFLAG_JUMPING | MOVEMENTFLAG_FALLING | MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING | + MOVEMENTFLAG_PITCH_UP | MOVEMENTFLAG_PITCH_DOWN | MOVEMENTFLAG_FALLING | MOVEMENTFLAG_FALLING | MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING | MOVEMENTFLAG_SPLINE_ELEVATION, MOVEMENTFLAG_MASK_TURNING = diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 319cd96c332..17f96a0fcda 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -374,7 +374,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) if (GetPlayer()->isInCombat()) reason = 1; - else if (GetPlayer()->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_JUMPING | MOVEMENTFLAG_FALLING)) + else if (GetPlayer()->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FALLING | MOVEMENTFLAG_FALLING_FAR)) reason = 3; // is jumping or falling else if (GetPlayer()->duel || GetPlayer()->HasAura(9454)) // is dueling or frozen by GM via freeze command reason = 2; // FIXME - Need the correct value @@ -1621,12 +1621,6 @@ void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket & recv_data) recv_data.read_skip(); // unk2 - if (movementInfo.Violated) - { - recv_data.rfinish(); - return; - } - _player->m_mover->m_movementInfo.flags = movementInfo.GetMovementFlags(); } diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index a93bec6a616..f1217e58b3f 100755 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -278,14 +278,6 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) return; } - //! If some anti-cheat checks in WorldSession::ReadMovementInfo failed, do not process - //! the change of movement server-sided. - if (movementInfo.Violated) - { - recv_data.rfinish(); - return; - } - /* handle special cases */ if (movementInfo.flags & MOVEMENTFLAG_ONTRANSPORT) { @@ -495,12 +487,6 @@ void WorldSession::HandleMoveNotActiveMover(WorldPacket &recv_data) MovementInfo mi; ReadMovementInfo(recv_data, &mi); - if (mi.Violated) - { - recv_data.rfinish(); - return; - } - mi.guid = old_mover_guid; _player->m_movementInfo = mi; @@ -529,12 +515,6 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket & recv_data) MovementInfo movementInfo; ReadMovementInfo(recv_data, &movementInfo); - if (movementInfo.Violated) - { - recv_data.rfinish(); - return; - } - _player->m_movementInfo = movementInfo; WorldPacket data(MSG_MOVE_KNOCK_BACK, 66); diff --git a/src/server/game/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp index 161571998a1..cfd73c2c987 100644 --- a/src/server/game/Handlers/VehicleHandler.cpp +++ b/src/server/game/Handlers/VehicleHandler.cpp @@ -43,12 +43,6 @@ void WorldSession::HandleDismissControlledVehicle(WorldPacket &recv_data) mi.guid = guid; ReadMovementInfo(recv_data, &mi); - if (mi.Violated) - { - recv_data.rfinish(); - return; - } - _player->m_movementInfo = mi; _player->ExitVehicle(); @@ -89,13 +83,6 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data) MovementInfo movementInfo; ReadMovementInfo(recv_data, &movementInfo); - - if (movementInfo.Violated) - { - recv_data.rfinish(); - return; - } - vehicle_base->m_movementInfo = movementInfo; uint64 accessory; // accessory guid diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index e6634019c09..e4f8c2a39ac 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -796,7 +796,7 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) data >> mi->fallTime; - if (mi->HasMovementFlag(MOVEMENTFLAG_JUMPING)) + if (mi->HasMovementFlag(MOVEMENTFLAG_FALLING)) { data >> mi->j_zspeed; data >> mi->j_sinAngle; @@ -808,56 +808,63 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) data >> mi->splineElevation; //! Anti-cheat checks. Please keep them in seperate if() blocks to maintain a clear overview. - #define VIOLATE_AND_RETURN \ + //! Might be subject to latency, so just remove improper flags. + #ifdef TRINITY_DEBUG + #define REMOVE_VIOLATING_FLAGS(check, maskToRemove) \ { \ - sLog->outDebug(LOG_FILTER_UNITS, "WorldSession::ReadMovementInfo: Violation of MovementFlags found. " \ - "MovementFlags: %u, MovementFlags2: %u for player GUID: %u. Player will not be relocated.", \ - mi->GetMovementFlags(), mi->GetExtraMovementFlags(), GetPlayer()->GetGUIDLow()); \ - mi->Violated = true; \ - return; \ - } \ - /*! This must be a packet spoofing attempt. MOVEMENTFLAG_ROOT sent from the client is not valid, - and when used in conjunction with any of the moving movement flags such as MOVEMENTFLAG_FORWARD - it will freeze clients that receive this player's movement info. + if (check) \ + { \ + sLog->outDebug(LOG_FILTER_UNITS, "WorldSession::ReadMovementInfo: Violation of MovementFlags found (%s). " \ + "MovementFlags: %u, MovementFlags2: %u for player GUID: %u. Mask %u will be removed.", \ + STRINGIZE(check), mi->GetMovementFlags(), mi->GetExtraMovementFlags(), GetPlayer()->GetGUIDLow(), maskToRemove); \ + mi->RemoveMovementFlag((maskToRemove)); \ + } \ + } + #else + #define REMOVE_VIOLATING_FLAGS(check, maskToRemove) \ + if (check) \ + mi->RemoveMovementFlag((maskToRemove)); + #endif + + + /*! This must be a packet spoofing attempt. MOVEMENTFLAG_ROOT sent from the client is not valid + in conjunction with any of the moving movement flags such as MOVEMENTFLAG_FORWARD. + It will freeze clients that receive this player's movement info. */ - if (mi->HasMovementFlag(MOVEMENTFLAG_ROOT)) - VIOLATE_AND_RETURN; - - //! Cannot hover and jump at the same time - if (mi->HasMovementFlag(MOVEMENTFLAG_HOVER) && mi->HasMovementFlag(MOVEMENTFLAG_JUMPING)) - VIOLATE_AND_RETURN; - - //! Cannot ascend and descend at the same time - if (mi->HasMovementFlag(MOVEMENTFLAG_ASCENDING) && mi->HasMovementFlag(MOVEMENTFLAG_DESCENDING)) - VIOLATE_AND_RETURN; - - //! Cannot move left and right at the same time - if (mi->HasMovementFlag(MOVEMENTFLAG_LEFT) && mi->HasMovementFlag(MOVEMENTFLAG_RIGHT)) - VIOLATE_AND_RETURN; - - //! Cannot strafe left and right at the same time - if (mi->HasMovementFlag(MOVEMENTFLAG_STRAFE_LEFT) && mi->HasMovementFlag(MOVEMENTFLAG_STRAFE_RIGHT)) - VIOLATE_AND_RETURN; - - //! Cannot pitch up and down at the same time - if (mi->HasMovementFlag(MOVEMENTFLAG_PITCH_UP) && mi->HasMovementFlag(MOVEMENTFLAG_PITCH_DOWN)) - VIOLATE_AND_RETURN; - - //! Cannot move forwards and backwards at the same time - if (mi->HasMovementFlag(MOVEMENTFLAG_FORWARD) && mi->HasMovementFlag(MOVEMENTFLAG_BACKWARD)) - VIOLATE_AND_RETURN; - - //! Cannot walk on water without SPELL_AURA_WATER_WALK - if (mi->HasMovementFlag(MOVEMENTFLAG_WATERWALKING) && !GetPlayer()->HasAuraType(SPELL_AURA_WATER_WALK)) - VIOLATE_AND_RETURN; - - //! Cannot feather fall without SPELL_AURA_FEATHER_FALL - if (mi->HasMovementFlag(MOVEMENTFLAG_FALLING_SLOW) && !GetPlayer()->HasAuraType(SPELL_AURA_FEATHER_FALL)) - VIOLATE_AND_RETURN; + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ROOT) && mi->HasMovementFlag(MOVEMENTFLAG_MASK_MOVING), + MOVEMENTFLAG_MASK_MOVING); //! Cannot hover without SPELL_AURA_HOVER - if (mi->HasMovementFlag(MOVEMENTFLAG_HOVER) && !GetPlayer()->HasAuraType(SPELL_AURA_HOVER)) - VIOLATE_AND_RETURN; + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_HOVER) && !GetPlayer()->HasAuraType(SPELL_AURA_HOVER), + MOVEMENTFLAG_HOVER); + + //! Cannot ascend and descend at the same time + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ASCENDING) && mi->HasMovementFlag(MOVEMENTFLAG_DESCENDING), + MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING); + + //! Cannot move left and right at the same time + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_LEFT) && mi->HasMovementFlag(MOVEMENTFLAG_RIGHT), + MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT); + + //! Cannot strafe left and right at the same time + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_STRAFE_LEFT) && mi->HasMovementFlag(MOVEMENTFLAG_STRAFE_RIGHT), + MOVEMENTFLAG_STRAFE_LEFT | MOVEMENTFLAG_STRAFE_RIGHT); + + //! Cannot pitch up and down at the same time + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_PITCH_UP) && mi->HasMovementFlag(MOVEMENTFLAG_PITCH_DOWN), + MOVEMENTFLAG_PITCH_UP | MOVEMENTFLAG_PITCH_DOWN); + + //! Cannot move forwards and backwards at the same time + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FORWARD) && mi->HasMovementFlag(MOVEMENTFLAG_BACKWARD), + MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_BACKWARD); + + //! Cannot walk on water without SPELL_AURA_WATER_WALK + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_WATERWALKING) && !GetPlayer()->HasAuraType(SPELL_AURA_WATER_WALK), + MOVEMENTFLAG_WATERWALKING); + + //! Cannot feather fall without SPELL_AURA_FEATHER_FALL + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FALLING_SLOW) && !GetPlayer()->HasAuraType(SPELL_AURA_FEATHER_FALL), + MOVEMENTFLAG_FALLING_SLOW); /*! Cannot fly if no fly auras present. Exception is being a GM. Note that we check for account level instead of Player::IsGameMaster() because in some @@ -865,12 +872,12 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) e.g. aerial combat. */ - if (mi->HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY) && GetSecurity() == SEC_PLAYER && + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY) && GetSecurity() == SEC_PLAYER && !GetPlayer()->m_mover->HasAuraType(SPELL_AURA_FLY) && - !GetPlayer()->m_mover->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)) - VIOLATE_AND_RETURN; + !GetPlayer()->m_mover->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED), + MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY); - #undef VIOLATE_AND_RETURN + #undef REMOVE_VIOLATING_FLAGS } void WorldSession::WriteMovementInfo(WorldPacket* data, MovementInfo* mi) @@ -899,7 +906,7 @@ void WorldSession::WriteMovementInfo(WorldPacket* data, MovementInfo* mi) *data << mi->fallTime; - if (mi->HasMovementFlag(MOVEMENTFLAG_JUMPING)) + if (mi->HasMovementFlag(MOVEMENTFLAG_FALLING)) { *data << mi->j_zspeed; *data << mi->j_sinAngle; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index bfa51219d71..5e44c777cbd 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2855,13 +2855,21 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode //! Not entirely sure if this should be sent for creatures as well, but I don't think so. target->SetCanFly(apply); if (!apply) + { target->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING); + target->AddUnitMovementFlag(MOVEMENTFLAG_FALLING); + target->m_movementInfo.SetFallTime(0); + } + Player* player = target->ToPlayer(); if (!player) player = target->m_movedPlayer; if (player) player->SendMovementCanFlyChange(); + + //! We still need to initiate a server-side MoveFall here, + //! which requires MSG_MOVE_FALL_LAND on landing. } void AuraEffect::HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -2880,11 +2888,13 @@ void AuraEffect::HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, if (apply) target->AddUnitMovementFlag(MOVEMENTFLAG_WATERWALKING); - else + else + { target->RemoveUnitMovementFlag(MOVEMENTFLAG_WATERWALKING); + target->AddUnitMovementFlag(MOVEMENTFLAG_FALLING); + } target->SendMovementWaterWalking(); - } void AuraEffect::HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -3242,13 +3252,21 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp, { target->SetCanFly(apply); if (!apply) + { target->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING); + target->AddUnitMovementFlag(MOVEMENTFLAG_FALLING); + target->m_movementInfo.SetFallTime(0); + } + Player* player = target->ToPlayer(); if (!player) player = target->m_movedPlayer; if (player) player->SendMovementCanFlyChange(); + + //! We still need to initiate a server-side MoveFall here, + //! which requires MSG_MOVE_FALL_LAND on landing. } //! Someone should clean up these hacks and remove it from this function. It doesn't even belong here. diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 21d49ccf151..ecd20a03665 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3505,7 +3505,7 @@ void Spell::update(uint32 difftime) // check if the player caster has moved before the spell finished if ((m_caster->GetTypeId() == TYPEID_PLAYER && m_timer != 0) && m_caster->isMoving() && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT) && - (m_spellInfo->Effects[0].Effect != SPELL_EFFECT_STUCK || !m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING))) + (m_spellInfo->Effects[0].Effect != SPELL_EFFECT_STUCK || !m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR))) { // don't cancel for melee, autorepeat, triggered and instant spells if (!IsNextMeleeSwingSpell() && !IsAutoRepeat() && !IsTriggered()) @@ -4756,7 +4756,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->isMoving()) { // skip stuck spell to allow use it in falling case and apply spell limitations at movement - if ((!m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING) || m_spellInfo->Effects[0].Effect != SPELL_EFFECT_STUCK) && + if ((!m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR) || m_spellInfo->Effects[0].Effect != SPELL_EFFECT_STUCK) && (IsAutoRepeat() || (m_spellInfo->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED) != 0)) return SPELL_FAILED_MOVING; } diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp index 6520d58da20..fa260cb298d 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp @@ -456,7 +456,7 @@ class boss_krick : public CreatureScript case EVENT_OUTRO_10: //! HACK: Creature's can't have MOVEMENTFLAG_FLYING me->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING); - me->AddUnitMovementFlag(MOVEMENTFLAG_FALLING); + me->AddUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR); me->GetMotionMaster()->MovePoint(0, outroPos[6]); _events.ScheduleEvent(EVENT_OUTRO_11, 2000); break; diff --git a/src/server/scripts/Northrend/sholazar_basin.cpp b/src/server/scripts/Northrend/sholazar_basin.cpp index 5260ea33eb6..1f00ca51d0b 100644 --- a/src/server/scripts/Northrend/sholazar_basin.cpp +++ b/src/server/scripts/Northrend/sholazar_basin.cpp @@ -90,12 +90,12 @@ public: case 17: case 18: me->RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_JUMPING); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING); me->SetSpeed(MOVE_SWIM, 0.85f, true); me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_DISABLE_GRAVITY); break; case 19: - me->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING); + me->SetUnitMovementFlags(MOVEMENTFLAG_FALLING); break; case 28: player->GroupEventHappens(QUEST_FORTUNATE_MISUNDERSTANDINGS, me); @@ -139,7 +139,7 @@ public: { CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); CAST_AI(npc_escortAI, (creature->AI()))->SetMaxPlayerDistance(35.0f); - creature->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING); + creature->SetUnitMovementFlags(MOVEMENTFLAG_FALLING); DoScriptText(SAY_START_IRO, creature); switch (player->GetTeam()){ diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp index c3b8306cd8d..72123683d63 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp @@ -143,7 +143,7 @@ class boss_omor_the_unscarred : public CreatureScript if (Player* temp = Unit::GetPlayer(*me, PlayerGUID)) { //if unit dosen't have this flag, then no pulling back (script will attempt cast, even if orbital strike was resisted) - if (temp->HasUnitMovementFlag(MOVEMENTFLAG_FALLING)) + if (temp->HasUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR)) { me->InterruptNonMeleeSpells(false); DoCast(temp, SPELL_SHADOW_WHIP); From 21ccfb8e2e12945315dc3eba64c02d7ac5cd61e7 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 17 Mar 2012 14:34:01 -0500 Subject: [PATCH 0220/1149] Collision/GameObjects: Fixed LoS for all doors (open and closed). Looks like data0 for type 0 is in fact startClosed instead of startOpen closes #5660 Signed-off-by: Subv --- src/server/game/Entities/GameObject/GameObject.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 2e8e68cf8b2..1cd8fa17183 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -134,7 +134,8 @@ void GameObject::AddToWorld() sObjectAccessor->AddObject(this); bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false); - bool toggledState = (GetGOData() ? GetGOData()->go_state == GO_STATE_ACTIVE : false); + // The state can be changed after GameObject::Create but before GameObject::AddToWorld + bool toggledState = GetGoState() == GO_STATE_READY; if (m_model) GetMap()->Insert(*m_model); if ((startOpen && !toggledState) || (!startOpen && toggledState)) @@ -1904,7 +1905,8 @@ void GameObject::SetLootState(LootState state, Unit* unit) // startOpen determines whether we are going to add or remove the LoS on activation bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false); - if (GetGOData() && GetGOData()->go_state == GO_NOT_READY) + // Use the current go state + if (GetGoState() == GO_STATE_ACTIVE) startOpen = !startOpen; if (state == GO_ACTIVATED || state == GO_JUST_DEACTIVATED) @@ -1925,7 +1927,7 @@ void GameObject::SetGoState(GOState state) // startOpen determines whether we are going to add or remove the LoS on activation bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false); - if (GetGOData() && GetGOData()->go_state == GO_NOT_READY) + if (GetGOData() && GetGOData()->go_state == GO_STATE_READY) startOpen = !startOpen; if (state == GO_STATE_ACTIVE || state == GO_STATE_ACTIVE_ALTERNATIVE) From 48799f33768c70f77f15398376318373f705db65 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 18 Mar 2012 11:35:33 +0100 Subject: [PATCH 0221/1149] Core/Units: Fix movementflag apply for flying/hovering creatures on respawn --- src/server/game/Entities/Creature/Creature.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index ca893a7c482..47225c65396 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1540,9 +1540,11 @@ void Creature::setDeathState(DeathState s) ResetPlayerDamageReq(); CreatureTemplate const* cinfo = GetCreatureTemplate(); SetWalk(true); - if (GetCreatureTemplate()->InhabitType & INHABIT_AIR) + if (cinfo->InhabitType & INHABIT_AIR && cinfo->InhabitType & INHABIT_GROUND) + SetCanFly(true); + else if (cinfo->InhabitType & INHABIT_AIR) SetDisableGravity(true); - if (GetCreatureTemplate()->InhabitType & INHABIT_WATER) + if (cinfo->InhabitType & INHABIT_WATER) AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); ClearUnitState(uint32(UNIT_STATE_ALL_STATE)); From 2b1ba4cd781ba39c6cd74c0b459b1baa361bfec6 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 18 Mar 2012 13:18:43 +0100 Subject: [PATCH 0222/1149] Core/Movement: Compute current position in spline::Launch with Z offset. Fixes e.g. hovering creatures height increasing every time player interacts with it. --- src/server/game/Movement/Spline/MoveSplineInit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index fe1db906a26..e586cb4f4f9 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -58,7 +58,7 @@ namespace Movement { MoveSpline& move_spline = *unit.movespline; - Location real_position(unit.GetPositionX(),unit.GetPositionY(),unit.GetPositionZ(),unit.GetOrientation()); + Location real_position(unit.GetPositionX(),unit.GetPositionY(),unit.GetPositionZMinusOffset(),unit.GetOrientation()); // there is a big chane that current position is unknown if current state is not finalized, need compute it // this also allows calculate spline position and update map position in much greater intervals if (!move_spline.Finalized()) From 5acbd354119b53b6df292390acf95a582c574e5f Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 18 Mar 2012 13:22:36 +0100 Subject: [PATCH 0223/1149] Core/Movement: Update MOVEMENTFLAG_MASK_MOVING, thanks to idostyle --- src/server/game/Entities/Unit/Unit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index cde2c67429c..4919f0e6fe3 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -701,7 +701,7 @@ enum MovementFlags // TODO: Check if PITCH_UP and PITCH_DOWN really belong here.. MOVEMENTFLAG_MASK_MOVING = MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_BACKWARD | MOVEMENTFLAG_STRAFE_LEFT | MOVEMENTFLAG_STRAFE_RIGHT | - MOVEMENTFLAG_PITCH_UP | MOVEMENTFLAG_PITCH_DOWN | MOVEMENTFLAG_FALLING | MOVEMENTFLAG_FALLING | MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING | + MOVEMENTFLAG_PITCH_UP | MOVEMENTFLAG_PITCH_DOWN | MOVEMENTFLAG_FALLING | MOVEMENTFLAG_FALLING_FAR | MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING | MOVEMENTFLAG_SPLINE_ELEVATION, MOVEMENTFLAG_MASK_TURNING = From eff48a42d1af91bda4d534cfdf61e3fd1b0eb9a5 Mon Sep 17 00:00:00 2001 From: Kaelima Date: Sun, 18 Mar 2012 19:57:03 +0100 Subject: [PATCH 0224/1149] Core/Spell: Fix crash for Glyph of Divinity --- src/server/game/Entities/Unit/Unit.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 151f7491567..1246bbc0bcb 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7991,10 +7991,10 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp { *handled = true; // Check if we are the target and prevent mana gain - if (triggeredByAura->GetCasterGUID() == victim->GetGUID()) + if (victim && triggeredByAura->GetCasterGUID() == victim->GetGUID()) return false; // Lookup base amount mana restore - for (uint8 i = 0; iEffects[i].Effect == SPELL_EFFECT_ENERGIZE) { @@ -17018,7 +17018,7 @@ void Unit::ExitVehicle(Position const* /*exitPosition*/) //! to specify exit coordinates and either store those per passenger, or we need to //! init spline movement based on those coordinates in unapply handlers, and //! relocate exiting passengers based on Unit::moveSpline data. Either way, - //! Coming Soon™ + //! Coming Soon� } void Unit::_ExitVehicle(Position const* exitPosition) From 90cacb9ab943c19bc6bfa919928a9a480bcb1b48 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 19 Mar 2012 11:43:50 +0100 Subject: [PATCH 0225/1149] Core/SmartScript: Fixed possible crashes when attempting to use StoreTargetList with a the same list already stored on the same id --- src/server/game/AI/SmartScripts/SmartScript.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h index faba3c05394..5fb691c87f2 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.h +++ b/src/server/game/AI/SmartScripts/SmartScript.h @@ -98,7 +98,13 @@ class SmartScript return; if (mTargetStorage->find(id) != mTargetStorage->end()) + { + // check if already stored + if ((*mTargetStorage)[id] == targets) + return; + delete (*mTargetStorage)[id]; + } (*mTargetStorage)[id] = targets; } From 847b4366f338390fc907b8d8c455696cce33e8be Mon Sep 17 00:00:00 2001 From: leak Date: Mon, 19 Mar 2012 16:48:08 +0100 Subject: [PATCH 0226/1149] Core/DBLayer: Convert PExecute() queries to prepared statements --- .../game/Battlegrounds/ArenaTeamMgr.cpp | 2 +- src/server/game/Globals/ObjectMgr.cpp | 14 +++++----- src/server/game/Server/WorldSession.cpp | 10 +++---- src/server/game/World/World.cpp | 2 +- src/server/scripts/Commands/cs_npc.cpp | 27 ++++++++++++++++--- .../Database/Implementation/WorldDatabase.cpp | 2 ++ .../Database/Implementation/WorldDatabase.h | 2 ++ 7 files changed, 41 insertions(+), 18 deletions(-) diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp index 719206ac625..37aebab5225 100644 --- a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp +++ b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp @@ -92,7 +92,7 @@ void ArenaTeamMgr::LoadArenaTeams() uint32 oldMSTime = getMSTime(); // Clean out the trash before loading anything - CharacterDatabase.Execute("DELETE FROM arena_team_member WHERE arenaTeamId NOT IN (SELECT arenaTeamId FROM arena_team)"); + CharacterDatabase.Execute("DELETE FROM arena_team_member WHERE arenaTeamId NOT IN (SELECT arenaTeamId FROM arena_team)"); // One-time query // 0 1 2 3 4 5 6 7 8 QueryResult result = CharacterDatabase.Query("SELECT arena_team.arenaTeamId, name, captainGuid, type, backgroundColor, emblemStyle, emblemColor, borderStyle, borderColor, " diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index f2b867b91ff..e5dd2f1ee25 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -495,7 +495,7 @@ void ObjectMgr::LoadCreatureTemplateAddons() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 6 + // 0 1 2 3 4 5 6 QueryResult result = WorldDatabase.Query("SELECT entry, path_id, mount, bytes1, bytes2, emote, auras FROM creature_template_addon"); if (!result) @@ -872,7 +872,7 @@ void ObjectMgr::LoadCreatureAddons() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 6 + // 0 1 2 3 4 5 6 QueryResult result = WorldDatabase.Query("SELECT guid, path_id, mount, bytes1, bytes2, emote, auras FROM creature_addon"); if (!result) @@ -909,7 +909,7 @@ void ObjectMgr::LoadCreatureAddons() creatureAddon.bytes1 = fields[3].GetUInt32(); creatureAddon.bytes2 = fields[4].GetUInt32(); creatureAddon.emote = fields[5].GetUInt32(); - + Tokens tokens(fields[6].GetString(), ' '); uint8 i = 0; creatureAddon.auras.resize(tokens.size()); @@ -6140,10 +6140,10 @@ void ObjectMgr::SetHighestGuids() _hiItemGuid = (*result)[0].GetUInt32()+1; // Cleanup other tables from not existed guids ( >= _hiItemGuid) - CharacterDatabase.PExecute("DELETE FROM character_inventory WHERE item >= '%u'", _hiItemGuid); - CharacterDatabase.PExecute("DELETE FROM mail_items WHERE item_guid >= '%u'", _hiItemGuid); - CharacterDatabase.PExecute("DELETE FROM auctionhouse WHERE itemguid >= '%u'", _hiItemGuid); - CharacterDatabase.PExecute("DELETE FROM guild_bank_item WHERE item_guid >= '%u'", _hiItemGuid); + CharacterDatabase.PExecute("DELETE FROM character_inventory WHERE item >= '%u'", _hiItemGuid); // One-time query + CharacterDatabase.PExecute("DELETE FROM mail_items WHERE item_guid >= '%u'", _hiItemGuid); // One-time query + CharacterDatabase.PExecute("DELETE FROM auctionhouse WHERE itemguid >= '%u'", _hiItemGuid); // One-time query + CharacterDatabase.PExecute("DELETE FROM guild_bank_item WHERE item_guid >= '%u'", _hiItemGuid); // One-time query result = WorldDatabase.Query("SELECT MAX(guid) FROM gameobject"); if (result) diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index e4f8c2a39ac..af38a5f4cce 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -105,7 +105,7 @@ isRecruiter(isARecruiter), timeLastWhoCommand(0) m_Address = sock->GetRemoteAddress(); sock->AddReference(); ResetTimeOutTime(); - LoginDatabase.PExecute("UPDATE account SET online = 1 WHERE id = %u;", GetAccountId()); + LoginDatabase.PExecute("UPDATE account SET online = 1 WHERE id = %u;", GetAccountId()); // One-time query } InitializeQueryCallbackParameters(); @@ -134,7 +134,7 @@ WorldSession::~WorldSession() while (_recvQueue.next(packet)) delete packet; - LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId()); + LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId()); // One-time query } void WorldSession::SizeError(WorldPacket const& packet, uint32 size) const @@ -825,13 +825,13 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) if (check) \ mi->RemoveMovementFlag((maskToRemove)); #endif - - + + /*! This must be a packet spoofing attempt. MOVEMENTFLAG_ROOT sent from the client is not valid in conjunction with any of the moving movement flags such as MOVEMENTFLAG_FORWARD. It will freeze clients that receive this player's movement info. */ - REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ROOT) && mi->HasMovementFlag(MOVEMENTFLAG_MASK_MOVING), + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ROOT) && mi->HasMovementFlag(MOVEMENTFLAG_MASK_MOVING), MOVEMENTFLAG_MASK_MOVING); //! Cannot hover without SPELL_AURA_HOVER diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 3efa976e1d3..4c02d1058b2 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1750,7 +1750,7 @@ void World::SetInitialWorldSettings() sWardenCheckMgr->LoadWardenOverrides(); sLog->outString("Deleting expired bans..."); - LoginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate"); + LoginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate"); // One-time query sLog->outString("Calculate next daily quest reset time..."); InitDailyQuestResetTime(); diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index af6952cdf40..90615a3bd88 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -131,7 +131,19 @@ public: { uint32 tguid = chr->GetTransport()->AddNPCPassenger(0, id, chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO()); if (tguid > 0) - WorldDatabase.PExecute("INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (%u, %u, %f, %f, %f, %f, %u)", tguid, id, chr->GetTransport()->GetEntry(), chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO()); + { + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_CREATURE_TRANSPORT); + + stmt->setInt32(0, int32(tguid)); + stmt->setInt32(1, int32(id)); + stmt->setInt32(2, int32(chr->GetTransport()->GetEntry())); + stmt->setFloat(3, chr->GetTransOffsetX()); + stmt->setFloat(4, chr->GetTransOffsetY()); + stmt->setFloat(5, chr->GetTransOffsetZ()); + stmt->setFloat(6, chr->GetTransOffsetO()); + + WorldDatabase.Execute(stmt); + } return true; } @@ -678,9 +690,16 @@ public: return false; } - if (target->GetTransport()) - if (target->GetGUIDTransport()) - WorldDatabase.PExecute("UPDATE creature_transport SET emote=%u WHERE transport_entry=%u AND guid=%u", emote, target->GetTransport()->GetEntry(), target->GetGUIDTransport()); + if (target->GetTransport() && target->GetGUIDTransport()) + { + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_TRANSPORT_EMOTE); + + stmt->setInt16(0, int16(emote)); + stmt->setInt32(1, target->GetTransport()->GetEntry()); + stmt->setInt32(2, target->GetGUIDTransport()); + + WorldDatabase.Execute(stmt); + } target->SetUInt32Value(UNIT_NPC_EMOTESTATE, emote); diff --git a/src/server/shared/Database/Implementation/WorldDatabase.cpp b/src/server/shared/Database/Implementation/WorldDatabase.cpp index d7d8491008b..d9338bec401 100755 --- a/src/server/shared/Database/Implementation/WorldDatabase.cpp +++ b/src/server/shared/Database/Implementation/WorldDatabase.cpp @@ -60,4 +60,6 @@ void WorldDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_SCRIPT_Z, "UPDATE waypoint_scripts SET z = ? WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_SCRIPT_O, "UPDATE waypoint_scripts SET o = ? WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_DEL_CREATURE, "DELETE FROM creature WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_INS_CREATURE_TRANSPORT, "INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_UPD_CREATURE_TRANSPORT_EMOTE, "UPDATE creature_transport SET emote = ? WHERE transport_entry = ? AND guid = ?", CONNECTION_ASYNC); } diff --git a/src/server/shared/Database/Implementation/WorldDatabase.h b/src/server/shared/Database/Implementation/WorldDatabase.h index e708177503f..1d7cd1151e5 100755 --- a/src/server/shared/Database/Implementation/WorldDatabase.h +++ b/src/server/shared/Database/Implementation/WorldDatabase.h @@ -80,6 +80,8 @@ enum WorldDatabaseStatements WORLD_UPD_WAYPOINT_SCRIPT_Z, WORLD_UPD_WAYPOINT_SCRIPT_O, WORLD_DEL_CREATURE, + WORLD_INS_CREATURE_TRANSPORT, + WORLD_UPD_CREATURE_TRANSPORT_EMOTE, MAX_WORLDDATABASE_STATEMENTS, }; From f0ac821e0bb9d72b7fe7d54ee8769a5d29e8f469 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 19 Mar 2012 17:03:39 +0100 Subject: [PATCH 0227/1149] Scripts/Serpentshrine Cavern: Fixed crash in boss_leotheras_the_blind caused by uninitialized variable; also replaced unsafe AI typecasting with Get/SetGUID --- .../boss_leotheras_the_blind.cpp | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp index ecca909914c..ad718504465 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp @@ -53,6 +53,7 @@ EndScriptData */ #define MODEL_NIGHTELF 20514 #define DEMON_FORM 21875 #define MOB_SPELLBINDER 21806 +#define INNER_DEMON_VICTIM 1 #define SAY_AGGRO -1548009 #define SAY_SWITCH_TO_DEMON -1548010 @@ -94,6 +95,20 @@ public: ShadowBolt_Timer = 10000; Link_Timer = 1000; } + + void SetGUID(uint64 guid, int32 id/* = 0 */) + { + if (id == INNER_DEMON_VICTIM) + victimGUID = guid; + } + + uint64 GetGUID(int32 id/* = 0 */) + { + if (id == INNER_DEMON_VICTIM) + return victimGUID; + return 0; + } + void JustDied(Unit* /*victim*/) { Unit* unit = Unit::GetUnit((*me), victimGUID); @@ -219,6 +234,7 @@ public: IsFinalForm = false; NeedThreatReset = false; EnrageUsed = false; + memset(InnderDemon, 0, sizeof(InnderDemon)); InnerDemon_Count = 0; me->SetSpeed(MOVE_RUN, 2.0f, true); me->SetDisplayId(MODEL_NIGHTELF); @@ -357,7 +373,7 @@ public: Creature* unit = Unit::GetCreature((*me), InnderDemon[i]); if (unit && unit->isAlive()) { - Unit* unit_target = Unit::GetUnit(*unit, CAST_AI(mob_inner_demon::mob_inner_demonAI, unit->AI())->victimGUID); + Unit* unit_target = Unit::GetUnit(*unit, unit->AI()->GetGUID(INNER_DEMON_VICTIM)); if (unit_target && unit_target->isAlive()) { unit->CastSpell(unit_target, SPELL_CONSUMING_MADNESS, true); @@ -525,7 +541,7 @@ public: if (demon) { demon->AI()->AttackStart((*itr)); - CAST_AI(mob_inner_demon::mob_inner_demonAI, demon->AI())->victimGUID = (*itr)->GetGUID(); + demon->AI()->SetGUID((*itr)->GetGUID(), INNER_DEMON_VICTIM); (*itr)->AddAura(SPELL_INSIDIOUS_WHISPER, *itr); From 178c658363bb07084c409f044c87b3073a108068 Mon Sep 17 00:00:00 2001 From: leak Date: Mon, 19 Mar 2012 17:35:27 +0100 Subject: [PATCH 0228/1149] Core/DBLayer: Convert DirectExecute() queries that are not runtime relevant back to regular queries --- src/server/game/Globals/ObjectMgr.cpp | 2 +- src/server/game/Instances/InstanceSaveMgr.cpp | 6 +++--- .../shared/Database/Implementation/CharacterDatabase.cpp | 5 ----- .../shared/Database/Implementation/CharacterDatabase.h | 5 ----- src/server/worldserver/Master.cpp | 2 +- 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index e5dd2f1ee25..01f41866c5b 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1903,7 +1903,7 @@ void ObjectMgr::LoadGameobjectRespawnTimes() uint32 oldMSTime = getMSTime(); // Remove outdated data - CharacterDatabase.DirectExecute(CharacterDatabase.GetPreparedStatement(CHAR_DEL_EXPIRED_GO_RESPAWNS)); + CharacterDatabase.DirectExecute("DELETE FROM gameobject_respawn WHERE respawnTime <= UNIX_TIMESTAMP(NOW())"); uint32 count = 0; diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index 557977f9468..26bd053b891 100755 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -250,13 +250,13 @@ void InstanceSaveManager::LoadInstances() CharacterDatabase.DirectExecute("DELETE i.* FROM instance AS i LEFT JOIN character_instance AS ci ON i.id = ci.instance LEFT JOIN group_instance AS gi ON i.id = gi.instance WHERE ci.guid IS NULL AND gi.guid IS NULL"); // Delete invalid references to instance - CharacterDatabase.DirectExecute(CharacterDatabase.GetPreparedStatement(CHAR_DEL_NONEXISTENT_INSTANCE_CREATURE_RESPAWNS)); - CharacterDatabase.DirectExecute(CharacterDatabase.GetPreparedStatement(CHAR_DEL_NONEXISTENT_INSTANCE_GO_RESPAWNS)); + CharacterDatabase.DirectExecute("DELETE FROM creature_respawn WHERE instanceId > 0 AND instanceId NOT IN (SELECT id FROM instance)"); + CharacterDatabase.DirectExecute("DELETE FROM gameobject_respawn WHERE instanceId > 0 AND instanceId NOT IN (SELECT id FROM instance)"); CharacterDatabase.DirectExecute("DELETE tmp.* FROM character_instance AS tmp LEFT JOIN instance ON tmp.instance = instance.id WHERE tmp.instance > 0 AND instance.id IS NULL"); CharacterDatabase.DirectExecute("DELETE tmp.* FROM group_instance AS tmp LEFT JOIN instance ON tmp.instance = instance.id WHERE tmp.instance > 0 AND instance.id IS NULL"); // Clean invalid references to instance - CharacterDatabase.DirectExecute(CharacterDatabase.GetPreparedStatement(CHAR_UPD_NONEXISTENT_INSTANCE_FOR_CORPSES)); + CharacterDatabase.DirectExecute("UPDATE corpse SET instanceId = 0 WHERE instanceId > 0 AND instanceId NOT IN (SELECT id FROM instance)"); CharacterDatabase.DirectExecute("UPDATE characters AS tmp LEFT JOIN instance ON tmp.instance_id = instance.id SET tmp.instance_id = 0 WHERE tmp.instance_id > 0 AND instance.id IS NULL"); // Initialize instance id storage (Needs to be done after the trash has been clean out) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 125c4509b18..29026b9bef7 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -280,7 +280,6 @@ void CharacterDatabaseConnection::DoPrepareStatements() // Character battleground data PREPARE_STATEMENT(CHAR_INS_PLAYER_BGDATA, "INSERT INTO character_battleground_data (guid, instanceId, team, joinX, joinY, joinZ, joinO, joinMapId, taxiStart, taxiEnd, mountSpell) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_PLAYER_BGDATA, "DELETE FROM character_battleground_data WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_UPD_PLAYERS_BGDATA, "UPDATE character_battleground_data SET instanceId = 0", CONNECTION_SYNCH) // Character homebind PREPARE_STATEMENT(CHAR_INS_PLAYER_HOMEBIND, "INSERT INTO character_homebind (guid, mapId, zoneId, posX, posY, posZ) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) @@ -293,7 +292,6 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_CORPSE, "DELETE FROM corpse WHERE corpseGuid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_PLAYER_CORPSES, "DELETE FROM corpse WHERE guid = ? AND corpseType <> 0", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_OLD_CORPSES, "DELETE FROM corpse WHERE corpseType = 0 OR time < (UNIX_TIMESTAMP(NOW()) - ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_UPD_NONEXISTENT_INSTANCE_FOR_CORPSES, "UPDATE corpse SET instanceId = 0 WHERE instanceId > 0 AND instanceId NOT IN (SELECT id FROM instance)", CONNECTION_SYNCH) // Creature respawn PREPARE_STATEMENT(CHAR_SEL_CREATURE_RESPAWNS, "SELECT guid, respawnTime, instanceId FROM creature_respawn", CONNECTION_SYNCH) @@ -302,15 +300,12 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_CREATURE_RESPAWN_BY_GUID, "DELETE FROM creature_respawn WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE, "DELETE FROM creature_respawn WHERE instanceId = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_MAX_CREATURE_RESPAWNS, "SELECT MAX(respawnTime), instanceId FROM creature_respawn WHERE instanceId > 0 GROUP BY instanceId", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_INSTANCE_CREATURE_RESPAWNS, "DELETE FROM creature_respawn WHERE instanceId > 0 AND instanceId NOT IN (SELECT id FROM instance)", CONNECTION_SYNCH) // Gameobject respawn PREPARE_STATEMENT(CHAR_SEL_GO_RESPAWNS, "SELECT guid, respawnTime, instanceId FROM gameobject_respawn", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_REP_GO_RESPAWN, "REPLACE INTO gameobject_respawn (guid, respawnTime, instanceId) VALUES (?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_GO_RESPAWN, "DELETE FROM gameobject_respawn WHERE guid = ? AND instanceId = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_GO_RESPAWN_BY_INSTANCE, "DELETE FROM gameobject_respawn WHERE instanceId = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_EXPIRED_GO_RESPAWNS, "DELETE FROM gameobject_respawn WHERE respawnTime <= UNIX_TIMESTAMP(NOW())", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_INSTANCE_GO_RESPAWNS, "DELETE FROM gameobject_respawn WHERE instanceId > 0 AND instanceId NOT IN (SELECT id FROM instance)", CONNECTION_SYNCH) // GM Tickets PREPARE_STATEMENT(CHAR_SEL_GM_TICKETS, "SELECT ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, completed, escalated, viewed FROM gm_tickets", CONNECTION_SYNCH) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index ca53712fbaa..2f2aa2301d1 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -262,7 +262,6 @@ enum CharacterDatabaseStatements CHAR_INS_PLAYER_BGDATA, CHAR_DEL_PLAYER_BGDATA, - CHAR_UPD_PLAYERS_BGDATA, CHAR_INS_PLAYER_HOMEBIND, CHAR_UPD_PLAYER_HOMEBIND, @@ -273,7 +272,6 @@ enum CharacterDatabaseStatements CHAR_DEL_CORPSE, CHAR_DEL_PLAYER_CORPSES, CHAR_DEL_OLD_CORPSES, - CHAR_UPD_NONEXISTENT_INSTANCE_FOR_CORPSES, CHAR_SEL_CREATURE_RESPAWNS, CHAR_REP_CREATURE_RESPAWN, @@ -281,14 +279,11 @@ enum CharacterDatabaseStatements CHAR_DEL_CREATURE_RESPAWN_BY_GUID, CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE, CHAR_SEL_MAX_CREATURE_RESPAWNS, - CHAR_DEL_NONEXISTENT_INSTANCE_CREATURE_RESPAWNS, CHAR_SEL_GO_RESPAWNS, CHAR_REP_GO_RESPAWN, CHAR_DEL_GO_RESPAWN, CHAR_DEL_GO_RESPAWN_BY_INSTANCE, - CHAR_DEL_EXPIRED_GO_RESPAWNS, - CHAR_DEL_NONEXISTENT_INSTANCE_GO_RESPAWNS, CHAR_SEL_GM_TICKETS, CHAR_REP_GM_TICKET, diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index d84cfc1a4a4..b2b0b04b63b 100755 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -486,5 +486,5 @@ void Master::clearOnlineAccounts() CharacterDatabase.DirectExecute("UPDATE characters SET online = 0 WHERE online <> 0"); // Battleground instance ids reset at server restart - CharacterDatabase.DirectExecute(CharacterDatabase.GetPreparedStatement(CHAR_UPD_PLAYERS_BGDATA)); + CharacterDatabase.DirectExecute("UPDATE character_battleground_data SET instanceId = 0"); } From 4665d5bfc456a49b10b0817db5473c3ee5c86603 Mon Sep 17 00:00:00 2001 From: leak Date: Mon, 19 Mar 2012 18:08:32 +0100 Subject: [PATCH 0229/1149] Core/DBLayer: Remnant cleanups --- src/server/shared/Database/DatabaseWorkerPool.h | 6 +++++- src/server/worldserver/Master.cpp | 14 ++++++-------- src/server/worldserver/Master.h | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/server/shared/Database/DatabaseWorkerPool.h b/src/server/shared/Database/DatabaseWorkerPool.h index b91972e5b0c..01b79c9ac58 100755 --- a/src/server/shared/Database/DatabaseWorkerPool.h +++ b/src/server/shared/Database/DatabaseWorkerPool.h @@ -133,6 +133,7 @@ class DatabaseWorkerPool */ //! Enqueues a one-way SQL operation in string format that will be executed asynchronously. + //! This method should only be used for queries that are only executed once, e.g during startup. void Execute(const char* sql) { if (!sql) @@ -143,6 +144,7 @@ class DatabaseWorkerPool } //! Enqueues a one-way SQL operation in string format -with variable args- that will be executed asynchronously. + //! This method should only be used for queries that are only executed once, e.g during startup. void PExecute(const char* sql, ...) { if (!sql) @@ -166,10 +168,11 @@ class DatabaseWorkerPool } /** - Direct syncrhonous one-way statement methods. + Direct synchronous one-way statement methods. */ //! Directly executes a one-way SQL operation in string format, that will block the calling thread until finished. + //! This method should only be used for queries that are only executed once, e.g during startup. void DirectExecute(const char* sql) { if (!sql) @@ -181,6 +184,7 @@ class DatabaseWorkerPool } //! Directly executes a one-way SQL operation in string format -with variable args-, that will block the calling thread until finished. + //! This method should only be used for queries that are only executed once, e.g during startup. void DirectPExecute(const char* sql, ...) { if (!sql) diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index b2b0b04b63b..45827b10c2c 100755 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -294,7 +294,7 @@ int Master::Run() rar_thread.wait(); ///- Clean database before leaving - clearOnlineAccounts(); + ClearOnlineAccounts(); _StopDB(); @@ -454,7 +454,7 @@ bool Master::_StartDB() sLog->SetRealmID(realmID); ///- Clean the database before starting - clearOnlineAccounts(); + ClearOnlineAccounts(); ///- Insert version info into DB WorldDatabase.PExecute("UPDATE version SET core_version = '%s', core_revision = '%s'", _FULLVERSION, _HASH); // One-time query @@ -475,14 +475,12 @@ void Master::_StopDB() } /// Clear 'online' status for all accounts with characters in this realm -void Master::clearOnlineAccounts() +void Master::ClearOnlineAccounts() { - // Cleanup online status for characters hosted at current realm - /// \todo Only accounts with characters logged on *this* realm should have online status reset. Move the online column from 'account' to 'realmcharacters'? - LoginDatabase.DirectPExecute( - "UPDATE account SET online = 0 WHERE online > 0 " - "AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = '%d')", realmID); + // Reset online status for all accounts with characters on the current realm + LoginDatabase.DirectPExecute("UPDATE account SET online = 0 WHERE online > 0 AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = %d)", realmID); + // Reset online status for all characters CharacterDatabase.DirectExecute("UPDATE characters SET online = 0 WHERE online <> 0"); // Battleground instance ids reset at server restart diff --git a/src/server/worldserver/Master.h b/src/server/worldserver/Master.h index 17c230ef7c7..548cd02c64a 100755 --- a/src/server/worldserver/Master.h +++ b/src/server/worldserver/Master.h @@ -37,7 +37,7 @@ class Master bool _StartDB(); void _StopDB(); - void clearOnlineAccounts(); + void ClearOnlineAccounts(); }; #define sMaster ACE_Singleton::instance() From 568e524c456098c8adae806a26bdcb6913eccc22 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 19 Mar 2012 20:44:30 +0100 Subject: [PATCH 0230/1149] Core/Spells: Implemented CREATURE_TYPEFLAGS_PARTY_MEMBER, creature with this type_flag set can be targeted by spells that require target to be in caster's party/raid --- src/server/game/Entities/Unit/Unit.cpp | 93 +++---------------- src/server/game/Entities/Unit/Unit.h | 6 +- .../game/Grids/Notifiers/GridNotifiers.h | 24 +++++ src/server/game/Miscellaneous/SharedDefines.h | 2 +- src/server/game/Spells/Auras/SpellAuras.cpp | 9 +- 5 files changed, 46 insertions(+), 88 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 1246bbc0bcb..638e09a73bc 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12199,7 +12199,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) co } Creature const* creatureAttacker = ToCreature(); - if (creatureAttacker && creatureAttacker->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_UNK26) + if (creatureAttacker && creatureAttacker->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER) return false; Player const* playerAffectingAttacker = HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) ? GetAffectingPlayer() : NULL; @@ -12286,7 +12286,7 @@ bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) co // can't assist non-friendly targets if (GetReactionTo(target) <= REP_NEUTRAL && target->GetReactionTo(this) <= REP_NEUTRAL - && (!ToCreature() || !(ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_UNK26))) + && (!ToCreature() || !(ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER))) return false; // PvP case @@ -12320,7 +12320,7 @@ bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) co && !((target->GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_PVP))) { if (Creature const* creatureTarget = target->ToCreature()) - return creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_UNK26 || creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS; + return creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER || creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS; } return true; } @@ -16160,7 +16160,10 @@ bool Unit::IsInPartyWith(Unit const* unit) const return true; if (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_PLAYER) - return u1->ToPlayer()->IsInSameGroupWith(u2->ToPlayer()); + return u1->ToPlayer()->IsInSameGroupWith(u2->ToPlayer()); + else if ((u2->GetTypeId() == TYPEID_PLAYER && u1->GetTypeId() == TYPEID_UNIT && u1->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER) || + (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER)) + return true; else return false; } @@ -16176,82 +16179,14 @@ bool Unit::IsInRaidWith(Unit const* unit) const return true; if (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_PLAYER) - return u1->ToPlayer()->IsInSameRaidWith(u2->ToPlayer()); + return u1->ToPlayer()->IsInSameRaidWith(u2->ToPlayer()); + else if ((u2->GetTypeId() == TYPEID_PLAYER && u1->GetTypeId() == TYPEID_UNIT && u1->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER) || + (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER)) + return true; else return false; } -void Unit::GetRaidMember(std::list &nearMembers, float radius) -{ - Player* owner = GetCharmerOrOwnerPlayerOrPlayerItself(); - if (!owner) - return; - - Group* group = owner->GetGroup(); - if (group) - { - for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) - { - Player* Target = itr->getSource(); - - if (Target && !IsHostileTo(Target)) - { - if (Target->isAlive() && IsWithinDistInMap(Target, radius)) - nearMembers.push_back(Target); - - if (Guardian* pet = Target->GetGuardianPet()) - if (pet->isAlive() && IsWithinDistInMap(pet, radius)) - nearMembers.push_back(pet); - } - } - } - else - { - if (owner->isAlive() && (owner == this || IsWithinDistInMap(owner, radius))) - nearMembers.push_back(owner); - if (Guardian* pet = owner->GetGuardianPet()) - if (pet->isAlive() && (pet == this || IsWithinDistInMap(pet, radius))) - nearMembers.push_back(pet); - } -} - -void Unit::GetPartyMemberInDist(std::list &TagUnitMap, float radius) -{ - Unit* owner = GetCharmerOrOwnerOrSelf(); - Group* group = NULL; - if (owner->GetTypeId() == TYPEID_PLAYER) - group = owner->ToPlayer()->GetGroup(); - - if (group) - { - uint8 subgroup = owner->ToPlayer()->GetSubGroup(); - - for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) - { - Player* Target = itr->getSource(); - - // IsHostileTo check duel and controlled by enemy - if (Target && Target->GetSubGroup() == subgroup && !IsHostileTo(Target)) - { - if (Target->isAlive() && IsWithinDistInMap(Target, radius)) - TagUnitMap.push_back(Target); - - if (Guardian* pet = Target->GetGuardianPet()) - if (pet->isAlive() && IsWithinDistInMap(pet, radius)) - TagUnitMap.push_back(pet); - } - } - } - else - { - if (owner->isAlive() && (owner == this || IsWithinDistInMap(owner, radius))) - TagUnitMap.push_back(owner); - if (Guardian* pet = owner->GetGuardianPet()) - if (pet->isAlive() && (pet == this || IsWithinDistInMap(pet, radius))) - TagUnitMap.push_back(pet); - } -} - void Unit::GetPartyMembers(std::list &TagUnitMap) { Unit* owner = GetCharmerOrOwnerOrSelf(); @@ -17486,7 +17421,7 @@ bool Unit::SetDisableGravity(bool disable) { if (disable == IsLevitating()) return false; - + if (disable) AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); else @@ -17529,7 +17464,7 @@ void Unit::SendMovementHover() SendMessageToSet(&data, true); } -void Unit::SendMovementWaterWalking() +void Unit::SendMovementWaterWalking() { WorldPacket data(MSG_MOVE_WATER_WALK, 64); data.append(GetPackGUID()); @@ -17544,7 +17479,7 @@ void Unit::SendMovementFeatherFall() BuildMovementPacket(&data); SendMessageToSet(&data, true); } - + void Unit::SendMovementGravityChange() { WorldPacket data(MSG_MOVE_GRAVITY_CHNG, 64); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 4919f0e6fe3..e1717dc5858 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -708,7 +708,7 @@ enum MovementFlags MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT, //! TODO if needed: add more flags to this masks that are exclusive to players - MOVEMENTFLAG_MASK_PLAYER_ONLY = + MOVEMENTFLAG_MASK_PLAYER_ONLY = MOVEMENTFLAG_FLYING, }; enum MovementFlags2 @@ -1398,9 +1398,7 @@ class Unit : public WorldObject bool IsNeutralToAll() const; bool IsInPartyWith(Unit const* unit) const; bool IsInRaidWith(Unit const* unit) const; - void GetPartyMemberInDist(std::list &units, float dist); void GetPartyMembers(std::list &units); - void GetRaidMember(std::list &units, float dist); bool IsContestedGuard() const { if (FactionTemplateEntry const* entry = getFactionTemplateEntry()) @@ -1635,7 +1633,7 @@ class Unit : public WorldObject /*! These methods send the same packet to the client in apply and unapply case. The client-side interpretation of this packet depends on the presence of relevant movementflags which are sent with movementinfo. Furthermore, these packets are broadcast to nearby players as well - as the current unit. + as the current unit. */ void SendMovementHover(); void SendMovementFeatherFall(); diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index c639da15113..e623b98a13a 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -858,6 +858,30 @@ namespace Trinity float i_range; }; + class AnyGroupedUnitInObjectRangeCheck + { + public: + AnyGroupedUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range, bool raid) : _source(obj), _refUnit(funit), _range(range), _raid(raid) {} + bool operator()(Unit* u) + { + if (_raid) + { + if (!_refUnit->IsInRaidWith(u)) + return false; + } + else if (!_refUnit->IsInPartyWith(u)) + return false; + + return !_refUnit->IsHostileTo(u) && u->isAlive() && _source->IsWithinDistInMap(u, _range); + } + + private: + WorldObject const* _source; + Unit const* _refUnit; + float _range; + bool _raid; + }; + class AnyUnitInObjectRangeCheck { public: diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index c404277f61f..91a5f602327 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -2589,7 +2589,7 @@ enum CreatureTypeFlags CREATURE_TYPEFLAGS_UNK23 = 0x00800000, // ? First seen in 3.2.2. Related to banner/backpack of creature/companion? CREATURE_TYPEFLAGS_UNK24 = 0x01000000, CREATURE_TYPEFLAGS_UNK25 = 0x02000000, - CREATURE_TYPEFLAGS_UNK26 = 0x04000000, + CREATURE_TYPEFLAGS_PARTY_MEMBER = 0x04000000, //! Creature can be targeted by spells that require target to be in caster's party/raid CREATURE_TYPEFLAGS_UNK27 = 0x08000000, CREATURE_TYPEFLAGS_UNK28 = 0x10000000, CREATURE_TYPEFLAGS_UNK29 = 0x20000000, diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 32473a93a26..1fddd3a04ba 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -2357,13 +2357,14 @@ void UnitAura::FillTargetMap(std::map & targets, Unit* caster) switch (GetSpellInfo()->Effects[effIndex].Effect) { case SPELL_EFFECT_APPLY_AREA_AURA_PARTY: - targetList.push_back(GetUnitOwner()); - GetUnitOwner()->GetPartyMemberInDist(targetList, radius); - break; case SPELL_EFFECT_APPLY_AREA_AURA_RAID: + { targetList.push_back(GetUnitOwner()); - GetUnitOwner()->GetRaidMember(targetList, radius); + Trinity::AnyGroupedUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius, GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_APPLY_AREA_AURA_RAID); + Trinity::UnitListSearcher searcher(GetUnitOwner(), targetList, u_check); + GetUnitOwner()->VisitNearbyObject(radius, searcher); break; + } case SPELL_EFFECT_APPLY_AREA_AURA_FRIEND: { targetList.push_back(GetUnitOwner()); From 7bbd1f106b851d926eeb5a897a19ec73c3bb4eb3 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 19 Mar 2012 19:07:36 -0230 Subject: [PATCH 0231/1149] DB/SAI: SAI & Gossip for Unrestrained Dragonhawk --- .../2012_03_19_00_world_smart_scripts.sql | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 sql/updates/world/2012_03_19_00_world_smart_scripts.sql diff --git a/sql/updates/world/2012_03_19_00_world_smart_scripts.sql b/sql/updates/world/2012_03_19_00_world_smart_scripts.sql new file mode 100644 index 00000000000..20241efa9cc --- /dev/null +++ b/sql/updates/world/2012_03_19_00_world_smart_scripts.sql @@ -0,0 +1,21 @@ +-- SAI for Unrestrained Dragonhawk +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=25236; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=25236 AND `source_type`=0); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(25236,0,0,1,62,0,100,0,9143,0,0,0,11,45353,0,0,0,0,0,7,0,0,0,0,0,0,0,'Unrestrained Dragonhawk - On Gossip option select - cast "Quest - Sunwell Daily - Ship Bombing Run Return" on player'), +(25236,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Unrestrained Dragonhawk - On Gossip option select - Close Gossip'); +-- Unrestrained Dragonhawk Gossip +UPDATE `creature_template` SET `gossip_menu_id`=9143 WHERE `entry`=25236; +-- Gossip_menu from UDB +DELETE FROM `gossip_menu` WHERE `entry`=9143; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(9143,12371); +-- Gossip_menu_option Update from UDB +DELETE FROM `gossip_menu_option` WHERE `menu_id`=9143; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES +(9143,0,0, '',1,1,0,0,0,0, ''); +-- Gossip option Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9143; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,9143,0,0,9,11542,0,0,0,'','Show gossip option if player has quest 11542 but not complete'), +(15,9143,0,1,9,11543,0,0,0,'','Show gossip option if player has quest 11543 but not complete'); From ec3d3782ce87575e3d685085ba3f30d943f38fd9 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Tue, 20 Mar 2012 15:22:26 -0230 Subject: [PATCH 0232/1149] DB/Gossip: Quel'Danas gossips Closes #5803 --- .../world/2012_03_20_00_world_gossip.sql | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 sql/updates/world/2012_03_20_00_world_gossip.sql diff --git a/sql/updates/world/2012_03_20_00_world_gossip.sql b/sql/updates/world/2012_03_20_00_world_gossip.sql new file mode 100644 index 00000000000..00214d805e7 --- /dev/null +++ b/sql/updates/world/2012_03_20_00_world_gossip.sql @@ -0,0 +1,88 @@ +-- Creature Gossip_menu_id Update from sniff +UPDATE `creature_template` SET `gossip_menu_id`=9052 WHERE `entry`=24965; -- Vindicator Xayann +UPDATE `creature_template` SET `gossip_menu_id`=9050 WHERE `entry`=24975; -- Mar'nah +UPDATE `creature_template` SET `gossip_menu_id`=9126 WHERE `entry`=25032; -- Eldara Dawnrunner +UPDATE `creature_template` SET `gossip_menu_id`=9087 WHERE `entry`=25046; -- Smith Hauthaa +UPDATE `creature_template` SET `gossip_menu_id`=9064 WHERE `entry`=25057; -- Battlemage Arynna +UPDATE `creature_template` SET `gossip_menu_id`=9062, `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=25059; -- Ayren Cloudbreaker +UPDATE `creature_template` SET `gossip_menu_id`=9063 WHERE `entry`=25061; -- Harbinger Inuuro +UPDATE `creature_template` SET `gossip_menu_id`=9127 WHERE `entry`=25069; -- Magister Ilastar +UPDATE `creature_template` SET `gossip_menu_id`=9115 WHERE `entry`=25112; -- Anchorite Ayuri +UPDATE `creature_template` SET `gossip_menu_id`=9105 WHERE `entry`=25169; -- Archmage Ne'thul +UPDATE `creature_template` SET `gossip_menu_id`=9286 WHERE `entry`=25632; -- Vindicator Moorba +UPDATE `creature_template` SET `gossip_menu_id`=9285 WHERE `entry`=25638; -- Captain Selana +UPDATE `creature_template` SET `gossip_menu_id`=9198 WHERE `entry`=25950; -- Shaani + +-- Gossip Menu insert from sniff +DELETE FROM `gossip_menu` WHERE `entry`=9050 AND `text_id`=12237; +DELETE FROM `gossip_menu` WHERE `entry`=9052 AND `text_id`=12241; +DELETE FROM `gossip_menu` WHERE `entry`=9062 AND `text_id`=12252; +DELETE FROM `gossip_menu` WHERE `entry`=9063 AND `text_id`=12256; +DELETE FROM `gossip_menu` WHERE `entry`=9064 AND `text_id`=12258; +DELETE FROM `gossip_menu` WHERE `entry`=9087 AND `text_id`=12286; +DELETE FROM `gossip_menu` WHERE `entry`=9115 AND `text_id`=12323; +DELETE FROM `gossip_menu` WHERE `entry`=9126 AND `text_id`=12338; +DELETE FROM `gossip_menu` WHERE `entry`=9127 AND `text_id`=12340; +DELETE FROM `gossip_menu` WHERE `entry`=9198 AND `text_id`=12497; +DELETE FROM `gossip_menu` WHERE `entry`=9285 AND `text_id`=12596; +DELETE FROM `gossip_menu` WHERE `entry`=9286 AND `text_id`=12597; +DELETE FROM `gossip_menu` WHERE `entry`=9287 AND `text_id`=12598; +DELETE FROM `gossip_menu` WHERE `entry`=9288 AND `text_id`=12599; +DELETE FROM `gossip_menu` WHERE `entry`=9289 AND `text_id`=12600; +DELETE FROM `gossip_menu` WHERE `entry`=9290 AND `text_id`=12601; +DELETE FROM `gossip_menu` WHERE `entry`=9293 AND `text_id`=12604; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(9050,12237), +(9052,12241), +(9062,12252), +(9063,12256), +(9064,12258), +(9087,12286), +(9115,12323), +(9126,12338), +(9127,12340), +(9198,12497), +(9285,12596), +(9286,12597), +(9287,12598), +(9288,12599), +(9289,12600), +(9290,12601), +(9293,12604); + +-- Creature Gossip_menu_option insert from sniff +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (9050,9087,9126,9198,9285,9287,9288,9289) AND `id`=0; +DELETE FROM `gossip_menu_option` WHERE `menu_id`=9062 AND `id` IN (0,1); +DELETE FROM `gossip_menu_option` WHERE `menu_id`=9286 AND `id`=2; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(9050,0,1,'Let me browse your goods.',3,128,0,0,0,0,''), +(9062,0,0,'Speaking of action, I''ve been ordered to undertake an air strike.',1,1,0,0,0,0,''), +(9062,1,0,'I need to intercept the Dawnblade reinforcements.',1,1,0,0,0,0,''), +(9087,0,1,'Let me browse your goods.',3,128,0,0,0,0,''), +(9126,0,1,'Let me browse your goods.',3,128,0,0,0,0,''), +(9198,0,1,'Let me browse your goods.',3,128,0,0,0,0,''), +(9285,0,0,'Give me a situation report, Captain.',1,1,9287,0,0,0,''), +(9286,2,0,'What is the current state of the Sunwell''s Gates?',1,1,9293,0,0,0,''), +(9287,0,0,'What went wrong?',1,1,9288,0,0,0,''), +(9288,0,0,'Why did they stop?',1,1,9289,0,0,0,''), +(9289,0,0,'Your insight is appreciated.',1,1,9290,0,0,0,''); + +-- Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9062 AND `SourceEntry` IN (0,1); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,9062,0,0,0,9,11532,0,0,0,0,'','Show gossip option only if player has taken quest 11532'), +(15,9062,0,0,1,9,11533,0,0,0,0,'','Show gossip option only if player has taken quest 11533'), +(15,9062,1,0,0,9,11542,0,0,0,0,'','Show gossip option only if player has taken quest 11542'), +(15,9062,1,0,1,9,11543,0,0,0,0,'','Show gossip option only if player has taken quest 11543'); + +-- SmartAI +DELETE FROM `smart_scripts` WHERE `entryorguid`=25059 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(25059,0,0,2,62,0,100,0,9062,0,0,0,11,45071,0,0,0,0,0,7,0,0,0,0,0,0,0,'Ayren Cloudbreaker - On Gossip option select - Cast "Quest - Sunwell Daily - Dead Scar Bombing Run" on player'), +(25059,0,1,2,62,0,100,0,9062,1,0,0,11,45113,0,0,0,0,0,7,0,0,0,0,0,0,0,'Ayren Cloudbreaker - On Gossip option select - Cast "Quest - Sunwell Daily - Ship Bombing Run" on player'), +(25059,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Ayren Cloudbreaker - On Gossip option select - Close Gossip'); + +-- Spell scripts from sniff +DELETE FROM `spell_scripts` WHERE `id`=45071; +INSERT INTO `spell_scripts` (`id`,`effIndex`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES +(45071,2,0,16,12318,1,0,0,0,0,0); -- Play sound From 6d9dbefe943c98b0f0d0dcaf9cf1a77961d16132 Mon Sep 17 00:00:00 2001 From: Elron103 Date: Tue, 20 Mar 2012 18:27:25 +0100 Subject: [PATCH 0233/1149] Core/Units: Fix issues with threat management on phase changes --- src/server/game/Combat/ThreatManager.h | 2 +- src/server/game/Entities/Unit/Unit.cpp | 36 +++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/server/game/Combat/ThreatManager.h b/src/server/game/Combat/ThreatManager.h index ce1f6de2ab0..e5badcd24ce 100755 --- a/src/server/game/Combat/ThreatManager.h +++ b/src/server/game/Combat/ThreatManager.h @@ -242,7 +242,7 @@ class ThreatManager // methods to access the lists from the outside to do some dirty manipulation (scriping and such) // I hope they are used as little as possible. std::list& getThreatList() { return iThreatContainer.getThreatList(); } - std::list& getOfflieThreatList() { return iThreatOfflineContainer.getThreatList(); } + std::list& getOfflineThreatList() { return iThreatOfflineContainer.getThreatList(); } ThreatContainer& getOnlineContainer() { return iThreatContainer; } ThreatContainer& getOfflineContainer() { return iThreatOfflineContainer; } private: diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 1246bbc0bcb..bef8dc726c5 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16463,7 +16463,41 @@ void Unit::SetPhaseMask(uint32 newPhaseMask, bool update) return; if (IsInWorld()) - RemoveNotOwnSingleTargetAuras(newPhaseMask); // we can lost access to caster or target + { + RemoveNotOwnSingleTargetAuras(newPhaseMask); // we can lost access to caster or target + + // modify hostile references for new phasemask, some special cases deal with hostile references themselves + if (GetTypeId() == TYPEID_UNIT || (!ToPlayer()->isGameMaster() && !ToPlayer()->GetSession()->PlayerLogout())) + { + HostileRefManager& refManager = getHostileRefManager(); + HostileReference* ref = refManager.getFirst(); + + while (ref) + { + if (Unit* unit = ref->getSource()->getOwner()) + if (Creature* creature = unit->ToCreature()) + refManager.setOnlineOfflineState(creature, creature->InSamePhase(newPhaseMask)); + + ref = ref->next(); + } + + // modify threat lists for new phasemask + if (GetTypeId() != TYPEID_PLAYER) + { + std::list threatList = getThreatManager().getThreatList(); + std::list offlineThreatList = getThreatManager().getOfflineThreatList(); + + // merge expects sorted lists + threatList.sort(); + offlineThreatList.sort(); + threatList.merge(offlineThreatList); + + for (std::list::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr) + if (Unit* unit = (*itr)->getTarget()) + unit->getHostileRefManager().setOnlineOfflineState(ToCreature(), unit->InSamePhase(newPhaseMask)); + } + } + } WorldObject::SetPhaseMask(newPhaseMask, update); From e4ee3788e7cf6656655979717882358f1c4f8603 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Wed, 21 Mar 2012 12:42:45 +0100 Subject: [PATCH 0234/1149] Scripts/ToC/Anub'Arak: Prevent spells (Leeching Swarm in particular) being interrupted by other spells. --- .../TrialOfTheCrusader/boss_anubarak_trial.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index 940191f68cb..37516e5e0df 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -278,6 +278,9 @@ public: if (!UpdateVictim()) return; + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + switch (m_uiStage) { case 0: From e8c3cb1c10f8c7cb8edcddeb6b7b0705563c161c Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Wed, 21 Mar 2012 22:17:34 +0200 Subject: [PATCH 0235/1149] Scripts/ToCr/Val'kyr Twins: Fix orb targeting. Add missing triggers. --- .../world/2012_03_21_00_world_creature.sql | 71 +++++++++++++++++++ .../TrialOfTheCrusader/boss_twin_valkyr.cpp | 6 +- 2 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 sql/updates/world/2012_03_21_00_world_creature.sql diff --git a/sql/updates/world/2012_03_21_00_world_creature.sql b/sql/updates/world/2012_03_21_00_world_creature.sql new file mode 100644 index 00000000000..254e86b94dc --- /dev/null +++ b/sql/updates/world/2012_03_21_00_world_creature.sql @@ -0,0 +1,71 @@ +-- ToC missing trigger spawns + +SET @GUID := 88412; +SET @NPC_TRIGGER1 := 34704; -- Val'kyr Twins Bullet Stalker Dark +SET @NPC_TRIGGER2 := 34720; -- Val'kyr Twins Bullet Stalker Light + +UPDATE `creature_template` SET `flags_extra`=128 WHERE `entry` IN (@NPC_TRIGGER1,@NPC_TRIGGER2); +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID+0 AND @GUID+61; +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES +(@GUID+0,@NPC_TRIGGER1,649,15,1,0,0,619.771,143.71,395.244,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+1,@NPC_TRIGGER1,649,15,1,0,0,515.352,115.349,395.288,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+2,@NPC_TRIGGER1,649,15,1,0,0,605.514,103.863,395.29,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+3,@NPC_TRIGGER1,649,15,1,0,0,615.137,156.997,395.28,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+4,@NPC_TRIGGER1,649,15,1,0,0,539.179,184.132,395.282,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+5,@NPC_TRIGGER1,649,15,1,0,0,547.76,184.634,395.289,2.93215,7200,0,0,1,0,0,0,0,0), +(@GUID+6,@NPC_TRIGGER1,649,15,1,0,0,549.764,86.4444,395.266,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+7,@NPC_TRIGGER1,649,15,1,0,0,511.417,127.158,395.266,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+8,@NPC_TRIGGER1,649,15,1,0,0,597.38,183.672,395.28,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+9,@NPC_TRIGGER1,649,15,1,0,0,573.578,187.665,395.492,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+10,@NPC_TRIGGER1,649,15,1,0,0,620.465,134.66,395.233,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+11,@NPC_TRIGGER1,649,15,1,0,0,560.484,187.743,395.959,2.93215,7200,0,0,1,0,0,0,0,0), +(@GUID+12,@NPC_TRIGGER1,649,15,1,0,0,577.299,186.854,395.289,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+13,@NPC_TRIGGER1,649,15,1,0,0,563.467,81.9323,395.288,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+14,@NPC_TRIGGER1,649,15,1,0,0,534.748,92.6424,395.289,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+15,@NPC_TRIGGER1,649,15,1,0,0,518.503,170.649,395.289,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+16,@NPC_TRIGGER1,649,15,1,0,0,514.566,159.918,395.287,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+17,@NPC_TRIGGER1,649,15,1,0,0,568.049,187.67,395.563,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+18,@NPC_TRIGGER1,649,15,1,0,0,522.955,102.127,395.29,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+19,@NPC_TRIGGER1,649,15,1,0,0,611.656,114.281,395.288,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+20,@NPC_TRIGGER1,649,15,1,0,0,616.432,126.418,395.264,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+21,@NPC_TRIGGER1,649,15,1,0,0,526.833,181.783,395.285,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+22,@NPC_TRIGGER1,649,15,1,0,0,578.722,87.4444,395.272,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+23,@NPC_TRIGGER1,649,15,1,0,0,509.743,149.005,395.253,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+24,@NPC_TRIGGER1,649,15,1,0,0,592.736,93.6667,395.289,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+25,@NPC_TRIGGER1,649,15,1,0,0,506.038,139.517,395.288,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+26,@NPC_TRIGGER1,649,15,1,0,0,608.116,171.731,395.289,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+27,@NPC_TRIGGER1,649,15,1,0,0,586.344,184.078,395.283,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+28,@NPC_TRIGGER1,649,15,1,0,0,554.818,187.568,395.288,2.93215,7200,0,0,1,0,0,0,0,0), +(@GUID+29,@NPC_TRIGGER2,649,15,1,0,0,557.743,187.729,395.915,0,7200,0,0,1,0,0,0,0,0), +(@GUID+30,@NPC_TRIGGER2,649,15,1,0,0,544.094,184.648,395.286,0,7200,0,0,1,0,0,0,0,0), +(@GUID+31,@NPC_TRIGGER2,649,15,1,0,0,551.328,187.646,395.596,0,7200,0,0,1,0,0,0,0,0), +(@GUID+32,@NPC_TRIGGER2,649,15,1,0,0,615.137,150.818,395.269,0,7200,0,0,1,0,0,0,0,0), +(@GUID+33,@NPC_TRIGGER2,649,15,1,0,0,571.158,187.691,395.629,0,7200,0,0,1,0,0,0,0,0), +(@GUID+34,@NPC_TRIGGER2,649,15,1,0,0,606.686,106.731,395.289,0,7200,0,0,1,0,0,0,0,0), +(@GUID+35,@NPC_TRIGGER2,649,15,1,0,0,612.118,118.844,395.287,0,7200,0,0,1,0,0,0,0,0), +(@GUID+36,@NPC_TRIGGER2,649,15,1,0,0,546.057,88.7691,395.284,0,7200,0,0,1,0,0,0,0,0), +(@GUID+37,@NPC_TRIGGER2,649,15,1,0,0,517.722,169.069,395.289,0,7200,0,0,1,0,0,0,0,0), +(@GUID+38,@NPC_TRIGGER2,649,15,1,0,0,507.181,142.285,395.255,0,7200,0,0,1,0,0,0,0,0), +(@GUID+39,@NPC_TRIGGER2,649,15,1,0,0,515.399,159.75,395.287,0,7200,0,0,1,0,0,0,0,0), +(@GUID+40,@NPC_TRIGGER2,649,15,1,0,0,592.151,183.8,395.279,0,7200,0,0,1,0,0,0,0,0), +(@GUID+41,@NPC_TRIGGER2,649,15,1,0,0,510.759,127.333,395.263,0,7200,0,0,1,0,0,0,0,0), +(@GUID+42,@NPC_TRIGGER2,649,15,1,0,0,524.257,178.134,395.29,0,7200,0,0,1,0,0,0,0,0), +(@GUID+43,@NPC_TRIGGER2,649,15,1,0,0,570.779,86.2986,395.253,0,7200,0,0,1,0,0,0,0,0), +(@GUID+44,@NPC_TRIGGER2,649,15,1,0,0,588.675,93.0938,395.289,0,7200,0,0,1,0,0,0,0,0), +(@GUID+45,@NPC_TRIGGER2,649,15,1,0,0,603.528,175.476,395.289,0,7200,0,0,1,0,0,0,0,0), +(@GUID+46,@NPC_TRIGGER2,649,15,1,0,0,509.639,133.26,395.247,0,7200,0,0,1,0,0,0,0,0), +(@GUID+47,@NPC_TRIGGER2,649,15,1,0,0,618.965,139.174,395.288,0,7200,0,0,1,0,0,0,0,0), +(@GUID+48,@NPC_TRIGGER2,649,15,1,0,0,514.785,118.731,395.287,0,7200,0,0,1,0,0,0,0,0), +(@GUID+49,@NPC_TRIGGER2,649,15,1,0,0,581.243,184.062,395.287,0,7200,0,0,1,0,0,0,0,0), +(@GUID+50,@NPC_TRIGGER2,649,15,1,0,0,577.757,184.436,395.289,0,7200,0,0,1,0,0,0,0,0), +(@GUID+51,@NPC_TRIGGER2,649,15,1,0,0,580.486,89.691,395.287,0,7200,0,0,1,0,0,0,0,0), +(@GUID+52,@NPC_TRIGGER2,649,15,1,0,0,511.132,151.156,395.264,0,7200,0,0,1,0,0,0,0,0), +(@GUID+53,@NPC_TRIGGER2,649,15,1,0,0,615.401,130.816,395.263,0,7200,0,0,1,0,0,0,0,0), +(@GUID+54,@NPC_TRIGGER2,649,15,1,0,0,599.307,98.8003,395.29,0,7200,0,0,1,0,0,0,0,0), +(@GUID+55,@NPC_TRIGGER2,649,15,1,0,0,520.212,108.429,395.289,0,7200,0,0,1,0,0,0,0,0), +(@GUID+56,@NPC_TRIGGER2,649,15,1,0,0,610.983,164.696,395.288,0,7200,0,0,1,0,0,0,0,0), +(@GUID+57,@NPC_TRIGGER2,649,15,1,0,0,526.337,99.5556,395.29,0,7200,0,0,1,0,0,0,0,0), +(@GUID+58,@NPC_TRIGGER2,649,15,1,0,0,563.997,187.644,395.489,0,7200,0,0,1,0,0,0,0,0), +(@GUID+59,@NPC_TRIGGER2,649,15,1,0,0,555.695,86.0208,395.253,0,7200,0,0,1,0,0,0,0,0), +(@GUID+60,@NPC_TRIGGER2,649,15,1,0,0,535.924,184.207,395.279,0,7200,0,0,1,0,0,0,0,0), +(@GUID+61,@NPC_TRIGGER2,649,15,1,0,0,538.024,92.441,395.289,0,7200,0,0,1,0,0,0,0,0); \ No newline at end of file diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index c2901d16fa1..dfd1f5ba5e1 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -619,8 +619,7 @@ public: { if (m_uiRangeCheckTimer < uiDiff) { - if (Unit* target = me->SelectNearestTarget(2.0f)) - if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) + if (Player* target = me->SelectNearestPlayer(2.0f)) { DoCastAOE(SPELL_UNLEASHED_DARK); me->GetMotionMaster()->MoveIdle(); @@ -661,8 +660,7 @@ public: { if (m_uiRangeCheckTimer < uiDiff) { - if (Unit* target = me->SelectNearestTarget(2.0f)) - if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) + if (Player* target = me->SelectNearestPlayer(2.0f)) { DoCastAOE(SPELL_UNLEASHED_LIGHT); me->GetMotionMaster()->MoveIdle(); From ac4536327f67161a54a6ed8b35408dbe3a5c7328 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 21 Mar 2012 19:37:21 -0500 Subject: [PATCH 0236/1149] Core/SAI: Allow using SMART_TARGET_ACTION_INVOKER with SMART_ACTION_MOVE_TO_POS Signed-off-by: Subv --- src/server/game/AI/SmartScripts/SmartScript.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 0523f59da5d..05a2910e7a7 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1364,13 +1364,14 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u e.GetTargetType() == SMART_TARGET_CREATURE_DISTANCE || e.GetTargetType() == SMART_TARGET_GAMEOBJECT_RANGE || e.GetTargetType() == SMART_TARGET_GAMEOBJECT_GUID || e.GetTargetType() == SMART_TARGET_GAMEOBJECT_DISTANCE || e.GetTargetType() == SMART_TARGET_CLOSEST_CREATURE || e.GetTargetType() == SMART_TARGET_CLOSEST_GAMEOBJECT || - e.GetTargetType() == SMART_TARGET_OWNER_OR_SUMMONER) + e.GetTargetType() == SMART_TARGET_OWNER_OR_SUMMONER || e.GetTargetType() == SMART_TARGET_ACTION_INVOKER) { ObjectList* targets = GetTargets(e, unit); if (!targets) break; target = targets->front(); + delete targets; } if (!target) From ee305cbb26d173002f4b93d992e825b1d031d317 Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Thu, 22 Mar 2012 12:54:31 +0200 Subject: [PATCH 0237/1149] Scripts/Ahn'kahet/Prince Taldaram: Fix Conjure Flame Sphere visual casting. Flame Sphere should not be visible to players(only their visual). --- sql/updates/world/2012_03_22_00_world_creature_template.sql | 2 ++ .../Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_03_22_00_world_creature_template.sql diff --git a/sql/updates/world/2012_03_22_00_world_creature_template.sql b/sql/updates/world/2012_03_22_00_world_creature_template.sql new file mode 100644 index 00000000000..6cf07ff4103 --- /dev/null +++ b/sql/updates/world/2012_03_22_00_world_creature_template.sql @@ -0,0 +1,2 @@ +-- Flame Sphere should not be visible to players(only their visual) +UPDATE `creature_template` SET `flags_extra`=128 WHERE `entry` IN (30106,31686,31687); \ No newline at end of file diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp index 12ef2075857..38879364d83 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp @@ -201,7 +201,8 @@ public: if (uiFlamesphereTimer <= diff) { - DoCast(me, SPELL_CONJURE_FLAME_SPHERE); + // because TARGET_UNIT_TARGET_ENEMY we need a target selected to cast + DoCast(me->getVictim(), SPELL_CONJURE_FLAME_SPHERE); Phase = CASTING_FLAME_SPHERES; uiPhaseTimer = 3*IN_MILLISECONDS + diff; uiFlamesphereTimer = 15*IN_MILLISECONDS; From 011a73e3e5d1e18508b6a594b9dc26a26ce374d6 Mon Sep 17 00:00:00 2001 From: ShinDarth Date: Thu, 22 Mar 2012 21:50:13 +0000 Subject: [PATCH 0238/1149] DB/Conditions: 39152 should only be lootable if you have at least 390 skills in First Aid; Also add proper file ending to recent SQLs Closes #5840 --- sql/updates/world/2012_03_21_00_world_creature.sql | 2 +- sql/updates/world/2012_03_22_00_world_creature_template.sql | 2 +- sql/updates/world/2012_03_22_01_world_conditions.sql | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 sql/updates/world/2012_03_22_01_world_conditions.sql diff --git a/sql/updates/world/2012_03_21_00_world_creature.sql b/sql/updates/world/2012_03_21_00_world_creature.sql index 254e86b94dc..def72f74cd6 100644 --- a/sql/updates/world/2012_03_21_00_world_creature.sql +++ b/sql/updates/world/2012_03_21_00_world_creature.sql @@ -68,4 +68,4 @@ INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid` (@GUID+58,@NPC_TRIGGER2,649,15,1,0,0,563.997,187.644,395.489,0,7200,0,0,1,0,0,0,0,0), (@GUID+59,@NPC_TRIGGER2,649,15,1,0,0,555.695,86.0208,395.253,0,7200,0,0,1,0,0,0,0,0), (@GUID+60,@NPC_TRIGGER2,649,15,1,0,0,535.924,184.207,395.279,0,7200,0,0,1,0,0,0,0,0), -(@GUID+61,@NPC_TRIGGER2,649,15,1,0,0,538.024,92.441,395.289,0,7200,0,0,1,0,0,0,0,0); \ No newline at end of file +(@GUID+61,@NPC_TRIGGER2,649,15,1,0,0,538.024,92.441,395.289,0,7200,0,0,1,0,0,0,0,0); diff --git a/sql/updates/world/2012_03_22_00_world_creature_template.sql b/sql/updates/world/2012_03_22_00_world_creature_template.sql index 6cf07ff4103..e6c03ed589c 100644 --- a/sql/updates/world/2012_03_22_00_world_creature_template.sql +++ b/sql/updates/world/2012_03_22_00_world_creature_template.sql @@ -1,2 +1,2 @@ -- Flame Sphere should not be visible to players(only their visual) -UPDATE `creature_template` SET `flags_extra`=128 WHERE `entry` IN (30106,31686,31687); \ No newline at end of file +UPDATE `creature_template` SET `flags_extra`=128 WHERE `entry` IN (30106,31686,31687); diff --git a/sql/updates/world/2012_03_22_01_world_conditions.sql b/sql/updates/world/2012_03_22_01_world_conditions.sql new file mode 100644 index 00000000000..074328137a5 --- /dev/null +++ b/sql/updates/world/2012_03_22_01_world_conditions.sql @@ -0,0 +1,2 @@ +-- Manual: Heavy Frostweave Bandage should be lootable if you have at least 390 skills in First Aid +UPDATE `conditions` SET `ConditionValue2`=390 WHERE `SourceTypeOrReferenceId`=1 AND `SourceEntry`=39152 AND `ConditionTypeOrReference`=7 AND `ConditionValue1`=129; From 479c0976abaa24ac12ba4c47116ee282332e273f Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 23 Mar 2012 00:48:32 +0100 Subject: [PATCH 0239/1149] Core/Creatures: Properly initialize m_zoneScript when it depends on zone id (OutdoorPvP/Battlefield) and fixed z offset for hovering creatures at creation --- .../game/Entities/Creature/Creature.cpp | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 47225c65396..1706a56a5ee 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -433,8 +433,8 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data) in relation to DisableGravity also. else if (GetByteValue(UNIT_FIELD_BYTES_1, 3) & UNIT_BYTE_1_FLAG_HOVER) - SetHover(true); - + SetHover(true); + */ // TODO: Shouldn't we check whether or not the creature is in water first? @@ -758,16 +758,14 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, return false; } + //! Relocate before CreateFromProto, to initialize coords and allow + //! returning correct zone id for selecting OutdoorPvP/Battlefield script + Relocate(x, y, z, ang); + //oX = x; oY = y; dX = x; dY = y; m_moveTime = 0; m_startMove = 0; if (!CreateFromProto(guidlow, Entry, vehId, team, data)) return false; - //! Need to be called after CreateFromProto - if (HasUnitMovementFlag(MOVEMENTFLAG_HOVER)) - z += GetFloatValue(UNIT_FIELD_HOVERHEIGHT); - - Relocate(x, y, z, ang); - if (!IsPositionValid()) { sLog->outError("Creature::Create(): given coordinates for creature (guidlow %d, entry %d) are not valid (X: %f, Y: %f, Z: %f, O: %f)", guidlow, Entry, x, y, z, ang); @@ -794,6 +792,14 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, } LoadCreaturesAddon(); + + //! Need to be called after LoadCreaturesAddon - MOVEMENTFLAG_HOVER is set there + if (HasUnitMovementFlag(MOVEMENTFLAG_HOVER)) + z += GetFloatValue(UNIT_FIELD_HOVERHEIGHT); + + //! Relocate again with updated Z coord + Relocate(x, y, z, ang); + uint32 displayID = GetNativeDisplayId(); CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID); if (minfo && !isTotem()) // Cancel load if no model defined or if totem From 0fe4580fe0f526b864586a9cc3e7727be1980323 Mon Sep 17 00:00:00 2001 From: Spp Date: Fri, 23 Mar 2012 05:35:32 +0100 Subject: [PATCH 0240/1149] Core/Commands: Add support for ip2nation database lookups when using .pinfo command. This will (when a full database exists) allow for seeing (approximately) which country a player might be from when doing .pinfo Note: External data required for this patch to work correctly can be found at http://www.ip2nation.com/ip2nation/Download Signed-off-by: click --- .../world/2012_03_23_00_world_ip2nation.sql | 21 +++++++++++++++++++ src/server/game/Chat/Commands/Level2.cpp | 15 +++++++++++++ src/server/game/World/World.cpp | 20 ++++++++++++++++++ src/server/game/World/World.h | 2 ++ 4 files changed, 58 insertions(+) create mode 100644 sql/updates/world/2012_03_23_00_world_ip2nation.sql diff --git a/sql/updates/world/2012_03_23_00_world_ip2nation.sql b/sql/updates/world/2012_03_23_00_world_ip2nation.sql new file mode 100644 index 00000000000..dadeaddf85a --- /dev/null +++ b/sql/updates/world/2012_03_23_00_world_ip2nation.sql @@ -0,0 +1,21 @@ +DROP TABLE IF EXISTS ip2nation; + +CREATE TABLE ip2nation ( + ip int(11) unsigned NOT NULL default '0', + country char(2) NOT NULL default '', + KEY ip (ip) +); + +DROP TABLE IF EXISTS ip2nationCountries; + +CREATE TABLE ip2nationCountries ( + code varchar(4) NOT NULL default '', + iso_code_2 varchar(2) NOT NULL default '', + iso_code_3 varchar(3) default '', + iso_country varchar(255) NOT NULL default '', + country varchar(255) NOT NULL default '', + lat float NOT NULL default '0', + lon float NOT NULL default '0', + PRIMARY KEY (code), + KEY code (code) +); diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index 062cdb331ea..c973ebe272b 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -42,6 +42,7 @@ #include "Transport.h" #include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand #include "CreatureGroups.h" +#include "ace/INET_Addr.h" //mute player for some times bool ChatHandler::HandleMuteCommand(const char* args) @@ -347,6 +348,20 @@ bool ChatHandler::HandlePInfoCommand(const char* args) { last_ip = fields[3].GetString(); last_login = fields[4].GetString(); + + uint32 ip = inet_addr(last_ip.c_str()); +#if TRINITY_ENDIAN == BIGENDIAN + EndianConvertReverse(ip); +#endif + + if (QueryResult result2 = WorldDatabase.PQuery("SELECT c.country FROM ip2nationCountries c, ip2nation i WHERE " + "i.ip < %u AND c.code = i.country ORDER BY i.ip DESC LIMIT 0,1", ip)) + { + Field* fields2 = result2->Fetch(); + last_ip.append(" ("); + last_ip.append(fields2[0].GetString()); + last_ip.append(")"); + } } else { diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 4c02d1058b2..af0c83a7a1b 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1625,6 +1625,9 @@ void World::SetInitialWorldSettings() sLog->outString("Loading Autobroadcasts..."); LoadAutobroadcasts(); + sLog->outString("Loading Ip2nation..."); + LoadIp2nation(); + ///- Load and initialize scripts sObjectMgr->LoadQuestStartScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate sObjectMgr->LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate @@ -1881,6 +1884,23 @@ void World::LoadAutobroadcasts() sLog->outString(); } +void World::LoadIp2nation() +{ + uint32 oldMSTime = getMSTime(); + + QueryResult result = WorldDatabase.Query("SELECT count(c.code) FROM ip2nationCountries c, ip2nation i WHERE c.code = i.country"); + uint32 count = 0; + + if (result) + { + Field* fields = result->Fetch(); + count = fields[0].GetUInt32(); + } + + sLog->outString(">> Loaded %u ip2nation definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); +} + /// Update the World ! void World::Update(uint32 diff) { diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index be4c41214ec..cab9c19da8b 100755 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -740,6 +740,8 @@ class World void LoadAutobroadcasts(); + void LoadIp2nation(); + void UpdateAreaDependentAuras(); void ProcessStartEvent(); From 01c997c60feb75163c3c3b8ea99aa24b183609b2 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 23 Mar 2012 08:27:27 -0400 Subject: [PATCH 0241/1149] Core/Spells: Fix death coil damage bonus from sigil of the vengeful heart --- src/server/scripts/Spells/spell_dk.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index e6db50f3f5a..7880aa516b9 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -713,6 +713,7 @@ enum DeathCoil { SPELL_DEATH_COIL_DAMAGE = 47632, SPELL_DEATH_COIL_HEAL = 47633, + SPELL_SIGIL_VENGEFUL_HEART = 64962, }; class spell_dk_death_coil : public SpellScriptLoader @@ -743,7 +744,11 @@ class spell_dk_death_coil : public SpellScriptLoader caster->CastCustomSpell(target, SPELL_DEATH_COIL_HEAL, &bp, NULL, NULL, true); } else + { + if (AuraEffect const* auraEffect = caster->GetAuraEffect(SPELL_SIGIL_VENGEFUL_HEART,EFFECT_1)) + damage += auraEffect->GetBaseAmount(); caster->CastCustomSpell(target, SPELL_DEATH_COIL_DAMAGE, &damage, NULL, NULL, true); + } } } From af48083d86ddbcff47994cddbd87d4aac8249a93 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 23 Mar 2012 09:54:34 -0400 Subject: [PATCH 0242/1149] Core/Spells: Fix improved unholy presence removal. --- src/server/scripts/Spells/spell_dk.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 7880aa516b9..c64ee9156d4 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -642,9 +642,7 @@ public: void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - Unit* target = GetTarget(); - if (target->HasAura(DK_SPELL_UNHOLY_PRESENCE)) - target->RemoveAura(DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED); + GetTarget()->RemoveAura(DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED); } void Register() From 8e96b86715ac78e18d8fa5e14d9e7b9a3f2dc125 Mon Sep 17 00:00:00 2001 From: kandera Date: Fri, 23 Mar 2012 13:11:32 -0300 Subject: [PATCH 0243/1149] Correct codestyle from previous commit --- src/server/scripts/Spells/spell_dk.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index c64ee9156d4..ddbdf6db36e 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -743,7 +743,7 @@ class spell_dk_death_coil : public SpellScriptLoader } else { - if (AuraEffect const* auraEffect = caster->GetAuraEffect(SPELL_SIGIL_VENGEFUL_HEART,EFFECT_1)) + if (AuraEffect const* auraEffect = caster->GetAuraEffect(SPELL_SIGIL_VENGEFUL_HEART, EFFECT_1)) damage += auraEffect->GetBaseAmount(); caster->CastCustomSpell(target, SPELL_DEATH_COIL_DAMAGE, &damage, NULL, NULL, true); } From 12e55a04bb14f4a56576dcc0ead35e996d7dcc7d Mon Sep 17 00:00:00 2001 From: leak Date: Sat, 24 Mar 2012 01:25:08 +0100 Subject: [PATCH 0244/1149] Core/DBLayer: Convert PQuery() queries to prepared statements --- src/server/game/Accounts/AccountMgr.cpp | 74 ++++++--- src/server/game/Accounts/AccountMgr.h | 2 +- .../game/AuctionHouse/AuctionHouseMgr.cpp | 4 +- src/server/game/Chat/Chat.cpp | 5 +- src/server/game/Chat/Chat.h | 4 +- src/server/game/Chat/Commands/Level2.cpp | 149 +++++++++-------- src/server/game/Chat/Commands/Level3.cpp | 137 +++++++++------- src/server/game/Entities/Pet/Pet.cpp | 80 +++++---- src/server/game/Entities/Player/Player.cpp | 138 +++++++++++----- .../game/Entities/Transport/Transport.cpp | 4 +- src/server/game/Globals/ObjectMgr.cpp | 47 ++++-- src/server/game/Groups/GroupMgr.cpp | 2 +- src/server/game/Handlers/CharacterHandler.cpp | 48 ++++-- src/server/game/Handlers/MailHandler.cpp | 18 +- src/server/game/Handlers/MiscHandler.cpp | 7 +- src/server/game/Handlers/PetitionsHandler.cpp | 86 +++++++--- src/server/game/Handlers/SpellHandler.cpp | 9 +- src/server/game/Maps/Map.cpp | 6 +- .../Movement/Waypoints/WaypointManager.cpp | 7 +- src/server/game/Pools/PoolMgr.cpp | 7 +- src/server/game/Server/WorldSocket.cpp | 47 +++--- src/server/game/Tools/PlayerDump.cpp | 17 +- src/server/game/World/World.cpp | 7 +- src/server/scripts/Commands/cs_account.cpp | 28 ++-- src/server/scripts/Commands/cs_gm.cpp | 6 +- src/server/scripts/Commands/cs_gobject.cpp | 16 +- src/server/scripts/Commands/cs_reload.cpp | 154 +++++++++--------- src/server/scripts/Commands/cs_tele.cpp | 5 +- src/server/scripts/Commands/cs_wp.cpp | 101 ++++++++---- .../Implementation/CharacterDatabase.cpp | 64 +++++++- .../Implementation/CharacterDatabase.h | 62 +++++++ .../Database/Implementation/LoginDatabase.cpp | 27 ++- .../Database/Implementation/LoginDatabase.h | 24 +++ .../Database/Implementation/WorldDatabase.cpp | 24 ++- .../Database/Implementation/WorldDatabase.h | 25 ++- .../worldserver/CommandLine/CliRunnable.cpp | 29 +++- .../worldserver/RemoteAccess/RASocket.cpp | 24 +-- 37 files changed, 1037 insertions(+), 457 deletions(-) diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index a6ae300e25d..4886b20a0f2 100755 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -53,12 +53,21 @@ AccountOpResult CreateAccount(std::string username, std::string password) AccountOpResult DeleteAccount(uint32 accountId) { - QueryResult result = LoginDatabase.PQuery("SELECT 1 FROM account WHERE id='%d'", accountId); - if (!result) - return AOR_NAME_NOT_EXIST; // account doesn't exist + // Check if accounts exists + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_ID); + stmt->setUInt32(0, accountId); + PreparedQueryResult result = LoginDatabase.Query(stmt); + + if (!result) + return AOR_NAME_NOT_EXIST; + + // Obtain accounts characters + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARS_BY_ACCOUNT_ID); + + stmt->setUInt32(0, accountId); + + result = CharacterDatabase.Query(stmt); - // existed characters list - result = CharacterDatabase.PQuery("SELECT guid FROM characters WHERE account='%d'", accountId); if (result) { do @@ -66,7 +75,7 @@ AccountOpResult DeleteAccount(uint32 accountId) uint32 guidLow = (*result)[0].GetUInt32(); uint64 guid = MAKE_NEW_GUID(guidLow, 0, HIGHGUID_PLAYER); - // kick if player is online + // Kick if player is online if (Player* p = ObjectAccessor::FindPlayer(guid)) { WorldSession* s = p->GetSession(); @@ -79,7 +88,7 @@ AccountOpResult DeleteAccount(uint32 accountId) } // table realm specific but common for all characters of account for realm - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_TUTORIALS); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_TUTORIALS); stmt->setUInt32(0, accountId); CharacterDatabase.Execute(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ACCOUNT_DATA); @@ -99,9 +108,13 @@ AccountOpResult DeleteAccount(uint32 accountId) AccountOpResult ChangeUsername(uint32 accountId, std::string newUsername, std::string newPassword) { - QueryResult result = LoginDatabase.PQuery("SELECT 1 FROM account WHERE id='%d'", accountId); + // Check if accounts exists + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_ID); + stmt->setUInt32(0, accountId); + PreparedQueryResult result = LoginDatabase.Query(stmt); + if (!result) - return AOR_NAME_NOT_EXIST; // account doesn't exist + return AOR_NAME_NOT_EXIST; if (utf8length(newUsername) > MAX_ACCOUNT_STR) return AOR_NAME_TOO_LONG; @@ -112,7 +125,7 @@ AccountOpResult ChangeUsername(uint32 accountId, std::string newUsername, std::s normalizeString(newUsername); normalizeString(newPassword); - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_USERNAME); + stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_USERNAME); stmt->setString(0, newUsername); stmt->setString(1, CalculateShaPassHash(newUsername, newPassword)); @@ -148,28 +161,38 @@ AccountOpResult ChangePassword(uint32 accountId, std::string newPassword) uint32 GetId(std::string username) { - LoginDatabase.EscapeString(username); - QueryResult result = LoginDatabase.PQuery("SELECT id FROM account WHERE username = '%s'", username.c_str()); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_ACCOUNT_ID_BY_USERNAME); + stmt->setString(0, username); + PreparedQueryResult result = LoginDatabase.Query(stmt); + return (result) ? (*result)[0].GetUInt32() : 0; } uint32 GetSecurity(uint32 accountId) { - QueryResult result = LoginDatabase.PQuery("SELECT gmlevel FROM account_access WHERE id = '%u'", accountId); - return (result) ? (*result)[0].GetUInt32() : 0; + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_ACCOUNT_ACCESS_GMLEVEL); + stmt->setUInt32(0, accountId); + PreparedQueryResult result = LoginDatabase.Query(stmt); + + return (result) ? (*result)[0].GetUInt32() : SEC_PLAYER; } -uint32 GetSecurity(uint64 accountId, int32 realmId) +uint32 GetSecurity(uint32 accountId, int32 realmId) { - QueryResult result = (realmId == -1) - ? LoginDatabase.PQuery("SELECT gmlevel FROM account_access WHERE id = '%u' AND RealmID = '%d'", accountId, realmId) - : LoginDatabase.PQuery("SELECT gmlevel FROM account_access WHERE id = '%u' AND (RealmID = '%d' OR RealmID = '-1')", accountId, realmId); - return (result) ? (*result)[0].GetUInt32() : 0; + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_GMLEVEL_BY_REALMID); + stmt->setUInt32(0, accountId); + stmt->setInt32(1, realmId); + PreparedQueryResult result = LoginDatabase.Query(stmt); + + return (result) ? (*result)[0].GetUInt32() : SEC_PLAYER; } bool GetName(uint32 accountId, std::string& name) { - QueryResult result = LoginDatabase.PQuery("SELECT username FROM account WHERE id = '%u'", accountId); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_USERNAME_BY_ID); + stmt->setUInt32(0, accountId); + PreparedQueryResult result = LoginDatabase.Query(stmt); + if (result) { name = (*result)[0].GetString(); @@ -189,14 +212,21 @@ bool CheckPassword(uint32 accountId, std::string password) normalizeString(username); normalizeString(password); - QueryResult result = LoginDatabase.PQuery("SELECT 1 FROM account WHERE id='%d' AND sha_pass_hash='%s'", accountId, CalculateShaPassHash(username, password).c_str()); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_CHECK_PASSWORD); + stmt->setUInt32(0, accountId); + stmt->setString(1, CalculateShaPassHash(username, password)); + PreparedQueryResult result = LoginDatabase.Query(stmt); + return (result) ? true : false; } uint32 GetCharactersCount(uint32 accountId) { // check character count - QueryResult result = CharacterDatabase.PQuery("SELECT COUNT(guid) FROM characters WHERE account = '%d'", accountId); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_SUM_CHARS); + stmt->setUInt32(0, accountId); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + return (result) ? (*result)[0].GetUInt32() : 0; } diff --git a/src/server/game/Accounts/AccountMgr.h b/src/server/game/Accounts/AccountMgr.h index 467972cdf65..c69f3c0a6f3 100755 --- a/src/server/game/Accounts/AccountMgr.h +++ b/src/server/game/Accounts/AccountMgr.h @@ -44,7 +44,7 @@ namespace AccountMgr uint32 GetId(std::string username); uint32 GetSecurity(uint32 accountId); - uint32 GetSecurity(uint64 accountId, int32 realmId); + uint32 GetSecurity(uint32 accountId, int32 realmId); bool GetName(uint32 accountId, std::string& name); uint32 GetCharactersCount(uint32 accountId); std::string CalculateShaPassHash(std::string& name, std::string& password); diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index a2e958d680f..38a5a49f7a5 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -482,7 +482,9 @@ void AuctionHouseObject::Update() if (AuctionsMap.empty()) return; - QueryResult result = CharacterDatabase.PQuery("SELECT id FROM auctionhouse WHERE time <= %u ORDER BY TIME ASC", (uint32)curTime+60); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTION_BY_TIME); + stmt->setUInt32(0, (uint32)curTime+60); + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) return; diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index a6596de25d6..21abae2d91a 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -444,7 +444,10 @@ ChatCommand* ChatHandler::getCommandTable() added += appendCommandTable(commandTableCache + added, *it); } - QueryResult result = WorldDatabase.Query("SELECT name, security, help FROM command"); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_COMMANDS); + + PreparedQueryResult result = WorldDatabase.Query(stmt); + if (result) { do diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index 2311f4b8e5e..0a39eb43ddb 100755 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -350,8 +350,8 @@ class ChatHandler bool HandleSaveAllCommand(const char* args); // Utility methods for commands - bool LookupPlayerSearchCommand(QueryResult result, int32 limit); - bool HandleBanListHelper(QueryResult result); + bool LookupPlayerSearchCommand(PreparedQueryResult result, int32 limit); + bool HandleBanListHelper(PreparedQueryResult result); bool HandleBanHelper(BanMode mode, char const* args); bool HandleBanInfoHelper(uint32 accountid, char const* accountname); bool HandleUnBanHelper(BanMode mode, char const* args); diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index c973ebe272b..816049ebfbc 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -266,18 +266,18 @@ bool ChatHandler::HandlePInfoCommand(const char* args) else if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name)) return false; - uint32 accId = 0; - uint32 money = 0; + uint32 accId = 0; + uint32 money = 0; uint32 total_player_time = 0; - uint8 level = 0; - uint32 latency = 0; + uint8 level = 0; + uint32 latency = 0; uint8 race; uint8 Class; - int64 muteTime = 0; - int64 banTime = -1; + int64 muteTime = 0; + int64 banTime = -1; uint32 mapId; uint32 areaId; - uint32 phase = 0; + uint32 phase = 0; // get additional information from Player object if (target) @@ -286,17 +286,17 @@ bool ChatHandler::HandlePInfoCommand(const char* args) if (HasLowerSecurity(target, 0)) return false; - accId = target->GetSession()->GetAccountId(); - money = target->GetMoney(); + accId = target->GetSession()->GetAccountId(); + money = target->GetMoney(); total_player_time = target->GetTotalPlayedTime(); - level = target->getLevel(); - latency = target->GetSession()->GetLatency(); - race = target->getRace(); - Class = target->getClass(); - muteTime = target->GetSession()->m_muteTime; - mapId = target->GetMapId(); - areaId = target->GetAreaId(); - phase = target->GetPhaseMask(); + level = target->getLevel(); + latency = target->GetSession()->GetLatency(); + race = target->getRace(); + Class = target->getClass(); + muteTime = target->GetSession()->m_muteTime; + mapId = target->GetMapId(); + areaId = target->GetAreaId(); + phase = target->GetPhaseMask(); } // get additional information from DB else @@ -305,41 +305,42 @@ bool ChatHandler::HandlePInfoCommand(const char* args) if (HasLowerSecurity(NULL, target_guid)) return false; - // 0 1 2 3 4 5 6 7 - QueryResult result = CharacterDatabase.PQuery("SELECT totaltime, level, money, account, race, class, map, zone FROM characters " - "WHERE guid = '%u'", GUID_LOPART(target_guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PINFO); + stmt->setUInt32(0, GUID_LOPART(target_guid)); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) return false; - Field* fields = result->Fetch(); + Field* fields = result->Fetch(); total_player_time = fields[0].GetUInt32(); - level = fields[1].GetUInt32(); - money = fields[2].GetUInt32(); - accId = fields[3].GetUInt32(); - race = fields[4].GetUInt8(); - Class = fields[5].GetUInt8(); - mapId = fields[6].GetUInt16(); - areaId = fields[7].GetUInt16(); + level = fields[1].GetUInt32(); + money = fields[2].GetUInt32(); + accId = fields[3].GetUInt32(); + race = fields[4].GetUInt8(); + Class = fields[5].GetUInt8(); + mapId = fields[6].GetUInt16(); + areaId = fields[7].GetUInt16(); } - std::string username = GetTrinityString(LANG_ERROR); - std::string email = GetTrinityString(LANG_ERROR); - std::string last_ip = GetTrinityString(LANG_ERROR); - uint32 security = 0; + std::string username = GetTrinityString(LANG_ERROR); + std::string email = GetTrinityString(LANG_ERROR); + std::string last_ip = GetTrinityString(LANG_ERROR); + uint32 security = 0; std::string last_login = GetTrinityString(LANG_ERROR); - QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel, a.email, a.last_ip, a.last_login, a.mutetime " - "FROM account a " - "LEFT JOIN account_access aa " - "ON (a.id = aa.id AND (aa.RealmID = -1 OR aa.RealmID = %u)) " - "WHERE a.id = '%u'", realmID, accId); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO); + stmt->setInt32(0, int32(realmID)); + stmt->setUInt32(1, accId); + PreparedQueryResult result = LoginDatabase.Query(stmt); + if (result) { Field* fields = result->Fetch(); - username = fields[0].GetString(); - security = fields[1].GetUInt32(); - email = fields[2].GetString(); - muteTime = fields[5].GetUInt64(); + username = fields[0].GetString(); + security = fields[1].GetUInt32(); + email = fields[2].GetString(); + muteTime = fields[5].GetUInt64(); if (email.empty()) email = "-"; @@ -354,8 +355,13 @@ bool ChatHandler::HandlePInfoCommand(const char* args) EndianConvertReverse(ip); #endif - if (QueryResult result2 = WorldDatabase.PQuery("SELECT c.country FROM ip2nationCountries c, ip2nation i WHERE " - "i.ip < %u AND c.code = i.country ORDER BY i.ip DESC LIMIT 0,1", ip)) + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_IP2NATION_COUNTRY); + + stmt->setUInt32(0, ip); + + PreparedQueryResult result2 = WorldDatabase.Query(stmt); + + if (result2) { Field* fields2 = result2->Fetch(); last_ip.append(" ("); @@ -376,21 +382,23 @@ bool ChatHandler::HandlePInfoCommand(const char* args) std::string bannedby = "unknown"; std::string banreason = ""; - if (QueryResult result2 = LoginDatabase.PQuery("SELECT unbandate, bandate = unbandate, bannedby, banreason FROM account_banned " - "WHERE id = '%u' AND active ORDER BY bandate ASC LIMIT 1", accId)) + + stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO_BANS); + stmt->setUInt32(0, accId); + PreparedQueryResult result2 = LoginDatabase.Query(stmt); + if (!result2) { - Field* fields = result2->Fetch(); - banTime = fields[1].GetBool() ? 0 : fields[0].GetUInt64(); - bannedby = fields[2].GetString(); - banreason = fields[3].GetString(); + stmt = LoginDatabase.GetPreparedStatement(CHAR_SEL_PINFO_BANS); + stmt->setUInt32(0, GUID_LOPART(target_guid)); + result2 = LoginDatabase.Query(stmt); } - else if (QueryResult result3 = CharacterDatabase.PQuery("SELECT unbandate, bandate = unbandate, bannedby, banreason FROM character_banned " - "WHERE guid = '%u' AND active ORDER BY bandate ASC LIMIT 1", GUID_LOPART(target_guid))) + + if (result2) { - Field* fields = result3->Fetch(); - banTime = fields[1].GetBool() ? 0 : fields[0].GetUInt64(); - bannedby = fields[2].GetString(); - banreason = fields[3].GetString(); + Field* fields = result->Fetch(); + banTime = fields[1].GetBool() ? 0 : fields[0].GetUInt64(); + bannedby = fields[2].GetString(); + banreason = fields[3].GetString(); } if (muteTime > 0) @@ -741,9 +749,9 @@ bool ChatHandler::HandleLookupPlayerIpCommand(const char* args) limit = limit_str ? atoi (limit_str) : -1; } - LoginDatabase.EscapeString(ip); - - QueryResult result = LoginDatabase.PQuery("SELECT id, username FROM account WHERE last_ip = '%s'", ip.c_str()); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_IP); + stmt->setString(0, ip); + PreparedQueryResult result = LoginDatabase.Query(stmt); return LookupPlayerSearchCommand(result, limit); } @@ -760,9 +768,9 @@ bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args) if (!AccountMgr::normalizeString (account)) return false; - LoginDatabase.EscapeString (account); - - QueryResult result = LoginDatabase.PQuery ("SELECT id, username FROM account WHERE username = '%s'", account.c_str ()); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_NAME); + stmt->setString(0, account); + PreparedQueryResult result = LoginDatabase.Query(stmt); return LookupPlayerSearchCommand (result, limit); } @@ -776,14 +784,14 @@ bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args) char* limit_str = strtok (NULL, " "); int32 limit = limit_str ? atoi (limit_str) : -1; - LoginDatabase.EscapeString (email); - - QueryResult result = LoginDatabase.PQuery ("SELECT id, username FROM account WHERE email = '%s'", email.c_str ()); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL); + stmt->setString(0, email); + PreparedQueryResult result = LoginDatabase.Query(stmt); return LookupPlayerSearchCommand(result, limit); } -bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit) +bool ChatHandler::LookupPlayerSearchCommand(PreparedQueryResult result, int32 limit) { if (!result) { @@ -807,8 +815,11 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit) uint32 acc_id = fields[0].GetUInt32(); std::string acc_name = fields[1].GetString(); - QueryResult chars = CharacterDatabase.PQuery("SELECT guid, name FROM characters WHERE account = '%u'", acc_id); - if (chars) + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_GUID_NAME_BY_ACC); + stmt->setUInt32(0, acc_id); + PreparedQueryResult result2 = CharacterDatabase.Query(stmt); + + if (result2) { PSendSysMessage(LANG_LOOKUP_PLAYER_ACCOUNT, acc_name.c_str(), acc_id); @@ -817,14 +828,14 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit) do { - Field* charfields = chars->Fetch(); + Field* charfields = result2->Fetch(); guid = charfields[0].GetUInt64(); name = charfields[1].GetString(); PSendSysMessage(LANG_LOOKUP_PLAYER_CHARACTER, name.c_str(), guid); ++i; - } while (chars->NextRow() && (limit == -1 || i < limit)); + } while (result2->NextRow() && (limit == -1 || i < limit)); } } while (result->NextRow()); diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 0b7bbf9e7ba..561c5059bad 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -225,7 +225,11 @@ bool ChatHandler::HandleAddItemCommand(const char *args) { std::string itemName = citemName+1; WorldDatabase.EscapeString(itemName); - QueryResult result = WorldDatabase.PQuery("SELECT entry FROM item_template WHERE name = '%s'", itemName.c_str()); + + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_ITEM_TEMPLATE_BY_NAME); + stmt->setString(0, itemName); + PreparedQueryResult result = WorldDatabase.Query(stmt); + if (!result) { PSendSysMessage(LANG_COMMAND_COULDNOTFIND, citemName+1); @@ -413,22 +417,22 @@ bool ChatHandler::HandleListItemCommand(const char *args) return false; uint32 count = uint32(_count); - QueryResult result; + PreparedQueryResult result; // inventory case uint32 inv_count = 0; - result = CharacterDatabase.PQuery("SELECT COUNT(itemEntry) FROM character_inventory ci INNER JOIN item_instance ii ON ii.guid = ci.item WHERE itemEntry = '%u'", item_id); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM); + stmt->setUInt32(0, item_id); + result = CharacterDatabase.Query(stmt); + if (result) inv_count = (*result)[0].GetUInt32(); - result=CharacterDatabase.PQuery( - // 0 1 2 3 4 5 - "SELECT ci.item, cb.slot AS bag, ci.slot, ci.guid, c.account, c.name FROM characters c " - "INNER JOIN character_inventory ci ON ci.guid = c.guid " - "INNER JOIN item_instance ii ON ii.guid = ci.item " - "LEFT JOIN character_inventory cb ON cb.item = ci.bag " - "WHERE ii.itemEntry = '%u' LIMIT %u ", - item_id, count); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_INVENTORY_ITEM_BY_ENTRY); + stmt->setUInt32(0, item_id); + stmt->setUInt32(1, count); + result = CharacterDatabase.Query(stmt); if (result) { @@ -466,24 +470,23 @@ bool ChatHandler::HandleListItemCommand(const char *args) // mail case uint32 mail_count = 0; - result = CharacterDatabase.PQuery("SELECT COUNT(itemEntry) FROM mail_items mi INNER JOIN item_instance ii ON ii.guid = mi.item_guid WHERE itemEntry = '%u'", item_id); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_COUNT_ITEM); + stmt->setUInt32(0, item_id); + result = CharacterDatabase.Query(stmt); + if (result) mail_count = (*result)[0].GetUInt32(); if (count > 0) { - result = CharacterDatabase.PQuery( - // 0 1 2 3 4 5 6 - "SELECT mi.item_guid, m.sender, m.receiver, cs.account, cs.name, cr.account, cr.name FROM mail m " - "INNER JOIN mail_items mi ON mi.mail_id = m.id " - "INNER JOIN item_instance ii ON ii.guid = mi.item_guid " - "INNER JOIN characters cs ON cs.guid = m.sender " - "INNER JOIN characters cr ON cr.guid = m.receiver " - "WHERE ii.itemEntry = '%u' LIMIT %u", - item_id, count); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_ITEMS_BY_ENTRY); + stmt->setUInt32(0, item_id); + stmt->setUInt32(1, count); + result = CharacterDatabase.Query(stmt); } else - result = QueryResult(NULL); + result = PreparedQueryResult(NULL); if (result) { @@ -514,21 +517,23 @@ bool ChatHandler::HandleListItemCommand(const char *args) // auction case uint32 auc_count = 0; - result=CharacterDatabase.PQuery("SELECT COUNT(itemEntry) FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE itemEntry = '%u'", item_id); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONHOUSE_COUNT_ITEM); + stmt->setUInt32(0, item_id); + result = CharacterDatabase.Query(stmt); + if (result) auc_count = (*result)[0].GetUInt32(); if (count > 0) { - result = CharacterDatabase.PQuery( - // 0 1 2 3 - "SELECT ah.itemguid, ah.itemowner, c.account, c.name FROM auctionhouse ah " - "INNER JOIN characters c ON c.guid = ah.itemowner " - "INNER JOIN item_instance ii ON ii.guid = ah.itemguid " - "WHERE ii.itemEntry = '%u' LIMIT %u", item_id, count); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONHOUSE_ITEM_BY_ENTRY); + stmt->setUInt32(0, item_id); + stmt->setUInt32(1, count); + result = CharacterDatabase.Query(stmt); } else - result = QueryResult(NULL); + result = PreparedQueryResult(NULL); if (result) { @@ -549,17 +554,18 @@ bool ChatHandler::HandleListItemCommand(const char *args) // guild bank case uint32 guild_count = 0; - result = CharacterDatabase.PQuery("SELECT COUNT(itemEntry) FROM guild_bank_item gbi INNER JOIN item_instance ii ON ii.guid = gbi.item_guid WHERE itemEntry = '%u'", item_id); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_BANK_COUNT_ITEM); + stmt->setUInt32(0, item_id); + result = CharacterDatabase.Query(stmt); + if (result) guild_count = (*result)[0].GetUInt32(); - result = CharacterDatabase.PQuery( - // 0 1 2 - "SELECT gi.item_guid, gi.guildid, g.name FROM guild_bank_item gi " - "INNER JOIN guild g ON g.guildid = gi.guildid " - "INNER JOIN item_instance ii ON ii.guid = gi.item_guid " - "WHERE ii.itemEntry = '%u' LIMIT %u ", - item_id, count); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY); + stmt->setUInt32(0, item_id); + stmt->setUInt32(1, count); + result = CharacterDatabase.Query(stmt); if (result) { @@ -3220,7 +3226,7 @@ bool ChatHandler::HandleBanListCharacterCommand(const char *args) std::string filter(cFilter); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME_FILTER); - stmt->setString(0, filter.c_str()); + stmt->setString(0, filter); PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) { @@ -3302,20 +3308,22 @@ bool ChatHandler::HandleBanListAccountCommand(const char *args) char* cFilter = strtok((char*)args, " "); std::string filter = cFilter ? cFilter : ""; - LoginDatabase.EscapeString(filter); - QueryResult result; + PreparedQueryResult result; if (filter.empty()) { - result = LoginDatabase.Query("SELECT account.id, username FROM account, account_banned" - " WHERE account.id = account_banned.id AND active = 1 GROUP BY account.id"); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BANNED_ALL); + + result = LoginDatabase.Query(stmt); } else { - result = LoginDatabase.PQuery("SELECT account.id, username FROM account, account_banned" - " WHERE account.id = account_banned.id AND active = 1 AND username "_LIKE_" "_CONCAT3_("'%%'", "'%s'", "'%%'")" GROUP BY account.id", - filter.c_str()); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME); + + stmt->setString(0, filter); + + result = LoginDatabase.Query(stmt); } if (!result) @@ -3327,7 +3335,7 @@ bool ChatHandler::HandleBanListAccountCommand(const char *args) return HandleBanListHelper(result); } -bool ChatHandler::HandleBanListHelper(QueryResult result) +bool ChatHandler::HandleBanListHelper(PreparedQueryResult result) { PSendSysMessage(LANG_BANLIST_MATCHINGACCOUNT); @@ -3410,19 +3418,21 @@ bool ChatHandler::HandleBanListIPCommand(const char *args) std::string filter = cFilter ? cFilter : ""; LoginDatabase.EscapeString(filter); - QueryResult result; + PreparedQueryResult result; if (filter.empty()) { - result = LoginDatabase.Query ("SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned" - " WHERE (bandate=unbandate OR unbandate>UNIX_TIMESTAMP())" - " ORDER BY unbandate"); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_BANNED_ALL); + + result = LoginDatabase.Query(stmt); } else { - result = LoginDatabase.PQuery("SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned" - " WHERE (bandate=unbandate OR unbandate>UNIX_TIMESTAMP()) AND ip "_LIKE_" "_CONCAT3_("'%%'", "'%s'", "'%%'") - " ORDER BY unbandate", filter.c_str()); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_BANNED_BY_IP); + + stmt->setString(0, filter); + + result = LoginDatabase.Query(stmt); } if (!result) @@ -4619,8 +4629,11 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args) { if (TargetName) { - //check for offline players - QueryResult result = CharacterDatabase.PQuery("SELECT characters.guid FROM characters WHERE characters.name = '%s'", name.c_str()); + // Check for offline players + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_GUID_BY_NAME); + stmt->setString(0, name); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) { SendSysMessage(LANG_COMMAND_FREEZE_WRONG); @@ -4630,7 +4643,10 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args) Field* fields=result->Fetch(); uint64 pguid = fields[0].GetUInt64(); - CharacterDatabase.PQuery("DELETE FROM character_aura WHERE character_aura.spell = 9454 AND character_aura.guid = '%u'", pguid); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA_FROZEN); + stmt->setUInt32(0, pguid); + CharacterDatabase.Execute(stmt); + PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str()); return true; } @@ -4646,8 +4662,11 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args) bool ChatHandler::HandleListFreezeCommand(const char * /*args*/) { - //Get names from DB - QueryResult result = CharacterDatabase.Query("SELECT characters.name FROM characters LEFT JOIN character_aura ON (characters.guid = character_aura.guid) WHERE character_aura.spell = 9454"); + // Get names from DB + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AURA_FROZEN); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) { SendSysMessage(LANG_COMMAND_NO_FROZEN_PLAYERS); diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 1a3c1a3fbb3..cad38d5c23f 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -97,30 +97,42 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c uint32 ownerid = owner->GetGUIDLow(); - QueryResult result; + PreparedStatement* stmt; + PreparedQueryResult result; if (petnumber) - // known petnumber entry 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType " - "FROM character_pet WHERE owner = '%u' AND id = '%u'", - ownerid, petnumber); + { + // Known petnumber entry + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PET_BY_ENTRY); + stmt->setUInt32(0, ownerid); + stmt->setUInt8(1, uint8(petnumber)); + } else if (current) - // current pet (slot 0) 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType " - "FROM character_pet WHERE owner = '%u' AND slot = '%u'", - ownerid, PET_SAVE_AS_CURRENT); + { + // Current pet (slot 0) + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PET_BY_ENTRY); + stmt->setUInt32(0, ownerid); + stmt->setUInt8(1, uint8(PET_SAVE_AS_CURRENT)); + } else if (petentry) + { // known petentry entry (unique for summoned pet, but non unique for hunter pet (only from current or not stabled pets) - // 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType " - "FROM character_pet WHERE owner = '%u' AND entry = '%u' AND (slot = '%u' OR slot > '%u') ", - ownerid, petentry, PET_SAVE_AS_CURRENT, PET_SAVE_LAST_STABLE_SLOT); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT); + stmt->setUInt32(0, ownerid); + stmt->setUInt32(1, petentry); + stmt->setUInt8(2, uint8(PET_SAVE_AS_CURRENT)); + stmt->setUInt8(3, uint8(PET_SAVE_LAST_STABLE_SLOT)); + } else - // any current or other non-stabled pet (for hunter "call pet") - // 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType " - "FROM character_pet WHERE owner = '%u' AND (slot = '%u' OR slot > '%u') ", - ownerid, PET_SAVE_AS_CURRENT, PET_SAVE_LAST_STABLE_SLOT); + { + // Any current or other non-stabled pet (for hunter "call pet") + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PET_BY_SLOT); + stmt->setUInt32(0, ownerid); + stmt->setUInt8(1, uint8(PET_SAVE_AS_CURRENT)); + stmt->setUInt8(2, uint8(PET_SAVE_LAST_STABLE_SLOT)); + } + + result = CharacterDatabase.Query(stmt); if (!result) { @@ -310,7 +322,10 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c if (getPetType() == HUNTER_PET) { - result = CharacterDatabase.PQuery("SELECT genitive, dative, accusative, instrumental, prepositional FROM character_pet_declinedname WHERE owner = '%u' AND id = '%u'", owner->GetGUIDLow(), GetCharmInfo()->GetPetNumber()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_DECLINED_NAME); + stmt->setUInt32(0, owner->GetGUIDLow()); + stmt->setUInt32(1, GetCharmInfo()->GetPetNumber()); + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) { @@ -1037,7 +1052,9 @@ void Pet::_LoadSpellCooldowns() m_CreatureSpellCooldowns.clear(); m_CreatureCategoryCooldowns.clear(); - QueryResult result = CharacterDatabase.PQuery("SELECT spell, time FROM pet_spell_cooldown WHERE guid = '%u'", m_charmInfo->GetPetNumber()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SPELL_COOLDOWN); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) { @@ -1099,7 +1116,9 @@ void Pet::_SaveSpellCooldowns(SQLTransaction& trans) void Pet::_LoadSpells() { - QueryResult result = CharacterDatabase.PQuery("SELECT spell, active FROM pet_spell WHERE guid = '%u'", m_charmInfo->GetPetNumber()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SPELL); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) { @@ -1147,7 +1166,9 @@ void Pet::_LoadAuras(uint32 timediff) { sLog->outDebug(LOG_FILTER_PETS, "Loading auras for pet %u", GetGUIDLow()); - QueryResult result = CharacterDatabase.PQuery("SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges FROM pet_aura WHERE guid = '%u'", m_charmInfo->GetPetNumber()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_AURA); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) { @@ -1630,18 +1651,19 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/) // now need only reset for offline pets (all pets except online case) uint32 except_petnumber = online_pet ? online_pet->GetCharmInfo()->GetPetNumber() : 0; - QueryResult resultPets = CharacterDatabase.PQuery( - "SELECT id FROM character_pet WHERE owner = '%u' AND id <> '%u'", - owner->GetGUIDLow(), except_petnumber); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PET); + stmt->setUInt32(0, owner->GetGUIDLow()); + stmt->setUInt32(1, except_petnumber); + PreparedQueryResult resultPets = CharacterDatabase.Query(stmt); // no offline pets if (!resultPets) return; - QueryResult result = CharacterDatabase.PQuery( - "SELECT DISTINCT pet_spell.spell FROM pet_spell, character_pet " - "WHERE character_pet.owner = '%u' AND character_pet.id = pet_spell.guid AND character_pet.id <> %u", - owner->GetGUIDLow(), except_petnumber); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SPELL_LIST); + stmt->setUInt32(0, owner->GetGUIDLow()); + stmt->setUInt32(0, except_petnumber); + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) return; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index bd5b1010f45..4cb759cc7f0 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4787,7 +4787,10 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC LeaveAllArenaTeams(playerguid); // the player was uninvited already on logout so just remove from group - QueryResult resultGroup = CharacterDatabase.PQuery("SELECT guid FROM group_member WHERE memberGuid=%u", guid); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GROUP_MEMBER); + stmt->setUInt32(0, guid); + PreparedQueryResult resultGroup = CharacterDatabase.Query(stmt); + if (resultGroup) if (Group* group = sGroupMgr->GetGroupByDbStoreId((*resultGroup)[0].GetUInt32())) RemoveFromGroup(group, playerguid); @@ -4801,8 +4804,11 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC case CHAR_DELETE_REMOVE: { SQLTransaction trans = CharacterDatabase.BeginTransaction(); - // Return back all mails with COD and Item 0 1 2 3 4 5 6 7 - QueryResult resultMail = CharacterDatabase.PQuery("SELECT id, messageType, mailTemplateId, sender, subject, body, money, has_items FROM mail WHERE receiver='%u' AND has_items<>0 AND cod<>0", guid); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_COD_ITEM_MAIL); + stmt->setUInt32(0, guid); + PreparedQueryResult resultMail = CharacterDatabase.Query(stmt); + if (resultMail) { do @@ -4882,7 +4888,11 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC // Unsummon and delete for pets in world is not required: player deleted from CLI or character list with not loaded pet. // NOW we can finally clear other DB data related to character - if (QueryResult resultPets = CharacterDatabase.PQuery("SELECT id FROM character_pet WHERE owner = '%u'", guid)) + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PETS); + stmt->setUInt32(0, guid); + PreparedQueryResult resultPets = CharacterDatabase.Query(stmt); + + if (resultPets) { do { @@ -4892,7 +4902,11 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC } // Delete char from social list of online chars - if (QueryResult resultFriends = CharacterDatabase.PQuery("SELECT DISTINCT guid FROM character_social WHERE friend = '%u'", guid)) + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_SOCIAL); + stmt->setUInt32(0, guid); + PreparedQueryResult resultFriends = CharacterDatabase.Query(stmt); + + if (resultFriends) { do { @@ -4996,15 +5010,19 @@ void Player::DeleteOldCharacters(uint32 keepDays) { sLog->outString("Player::DeleteOldChars: Deleting all characters which have been deleted %u days before...", keepDays); - QueryResult resultChars = CharacterDatabase.PQuery("SELECT guid, deleteInfos_Account FROM characters WHERE deleteDate IS NOT NULL AND deleteDate < '%u'", uint32(time(NULL) - time_t(keepDays * DAY))); - if (resultChars) + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_OLD_CHARS); + stmt->setUInt32(0, uint32(time(NULL) - time_t(keepDays * DAY))); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + + if (result) { - sLog->outString("Player::DeleteOldChars: Found " UI64FMTD " character(s) to delete", resultChars->GetRowCount()); + sLog->outString("Player::DeleteOldChars: Found " UI64FMTD " character(s) to delete", result->GetRowCount()); do { - Field* charFields = resultChars->Fetch(); - Player::DeleteFromDB(charFields[0].GetUInt64(), charFields[1].GetUInt32(), true, true); - } while (resultChars->NextRow()); + Field* fields = result->Fetch(); + Player::DeleteFromDB(fields[0].GetUInt64(), fields[1].GetUInt32(), true, true); + } + while (result->NextRow()); } } @@ -7274,7 +7292,10 @@ void Player::ModifyArenaPoints(int32 value, SQLTransaction* trans /*=NULL*/) uint32 Player::GetGuildIdFromDB(uint64 guid) { - QueryResult result = CharacterDatabase.PQuery("SELECT guildid FROM guild_member WHERE guid='%u'", GUID_LOPART(guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER); + stmt->setUInt32(0, GUID_LOPART(guid)); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) return 0; @@ -7284,10 +7305,13 @@ uint32 Player::GetGuildIdFromDB(uint64 guid) uint8 Player::GetRankFromDB(uint64 guid) { - QueryResult result = CharacterDatabase.PQuery("SELECT rank FROM guild_member WHERE guid='%u'", GUID_LOPART(guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER); + stmt->setUInt32(0, GUID_LOPART(guid)); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) { - uint32 v = result->Fetch()[0].GetUInt8(); + uint32 v = result->Fetch()[1].GetUInt8(); return v; } else @@ -7296,7 +7320,11 @@ uint8 Player::GetRankFromDB(uint64 guid) uint32 Player::GetArenaTeamIdFromDB(uint64 guid, uint8 type) { - QueryResult result = CharacterDatabase.PQuery("SELECT arena_team_member.arenateamid FROM arena_team_member JOIN arena_team ON arena_team_member.arenateamid = arena_team.arenateamid WHERE guid='%u' AND type='%u' LIMIT 1", GUID_LOPART(guid), type); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ARENA_TEAM_ID_BY_PLAYER_GUID); + stmt->setUInt32(0, GUID_LOPART(guid)); + stmt->setUInt8(1, type); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) return 0; @@ -7307,7 +7335,10 @@ uint32 Player::GetArenaTeamIdFromDB(uint64 guid, uint8 type) uint32 Player::GetZoneIdFromDB(uint64 guid) { uint32 guidLow = GUID_LOPART(guid); - QueryResult result = CharacterDatabase.PQuery("SELECT zone FROM characters WHERE guid='%u'", guidLow); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_ZONE); + stmt->setUInt32(0, guidLow); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) return 0; Field* fields = result->Fetch(); @@ -7316,7 +7347,10 @@ uint32 Player::GetZoneIdFromDB(uint64 guid) if (!zone) { // stored zone is zero, use generic and slow zone detection - result = CharacterDatabase.PQuery("SELECT map, position_x, position_y, position_z FROM characters WHERE guid='%u'", guidLow); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_POSITION_XYZ); + stmt->setUInt32(0, guidLow); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) return 0; fields = result->Fetch(); @@ -7343,7 +7377,10 @@ uint32 Player::GetZoneIdFromDB(uint64 guid) uint32 Player::GetLevelFromDB(uint64 guid) { - QueryResult result = CharacterDatabase.PQuery("SELECT level FROM characters WHERE guid='%u'", GUID_LOPART(guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_LEVEL); + stmt->setUInt32(0, GUID_LOPART(guid)); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) return 0; @@ -16537,7 +16574,10 @@ void Player::_LoadBGData(PreparedQueryResult result) bool Player::LoadPositionFromDB(uint32& mapid, float& x, float& y, float& z, float& o, bool& in_flight, uint64 guid) { - QueryResult result = CharacterDatabase.PQuery("SELECT position_x, position_y, position_z, orientation, map, taxi_path FROM characters WHERE guid = '%u'", GUID_LOPART(guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_POSITION); + stmt->setUInt32(0, GUID_LOPART(guid)); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) return false; @@ -17723,27 +17763,31 @@ void Player::_LoadMailInit(PreparedQueryResult resultUnread, PreparedQueryResult void Player::_LoadMail() { m_mail.clear(); - //mails are in right order 0 1 2 3 4 5 6 7 8 9 10 11 12 13 - QueryResult result = CharacterDatabase.PQuery("SELECT id, messageType, sender, receiver, subject, body, has_items, expire_time, deliver_time, money, cod, checked, stationery, mailTemplateId FROM mail WHERE receiver = '%u' ORDER BY id DESC", GetGUIDLow()); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL); + stmt->setUInt32(0, GetGUIDLow()); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) { do { Field* fields = result->Fetch(); Mail* m = new Mail; - m->messageID = fields[0].GetUInt32(); - m->messageType = fields[1].GetUInt8(); - m->sender = fields[2].GetUInt32(); - m->receiver = fields[3].GetUInt32(); - m->subject = fields[4].GetString(); - m->body = fields[5].GetString(); - bool has_items = fields[6].GetBool(); - m->expire_time = time_t(fields[7].GetUInt32()); - m->deliver_time = time_t(fields[8].GetUInt32()); - m->money = fields[9].GetUInt32(); - m->COD = fields[10].GetUInt32(); - m->checked = fields[11].GetUInt32(); - m->stationery = fields[12].GetUInt8(); + + m->messageID = fields[0].GetUInt32(); + m->messageType = fields[1].GetUInt8(); + m->sender = fields[2].GetUInt32(); + m->receiver = fields[3].GetUInt32(); + m->subject = fields[4].GetString(); + m->body = fields[5].GetString(); + bool has_items = fields[6].GetBool(); + m->expire_time = time_t(fields[7].GetUInt32()); + m->deliver_time = time_t(fields[8].GetUInt32()); + m->money = fields[9].GetUInt32(); + m->COD = fields[10].GetUInt32(); + m->checked = fields[11].GetUInt32(); + m->stationery = fields[12].GetUInt8(); m->mailTemplateId = fields[13].GetInt16(); if (m->mailTemplateId && !sMailTemplateStore.LookupEntry(m->mailTemplateId)) @@ -19351,8 +19395,10 @@ void Player::SetUInt32ValueInArray(Tokens& tokens, uint16 index, uint32 value) void Player::Customize(uint64 guid, uint8 gender, uint8 skin, uint8 face, uint8 hairStyle, uint8 hairColor, uint8 facialHair) { - // 0 - QueryResult result = CharacterDatabase.PQuery("SELECT playerBytes2 FROM characters WHERE guid = '%u'", GUID_LOPART(guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PLAYERBYTES2); + stmt->setUInt32(0, GUID_LOPART(guid)); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) return; @@ -19362,7 +19408,7 @@ void Player::Customize(uint64 guid, uint8 gender, uint8 skin, uint8 face, uint8 playerBytes2 &= ~0xFF; playerBytes2 |= facialHair; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GENDER_PLAYERBYTES); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GENDER_PLAYERBYTES); stmt->setUInt8(0, gender); stmt->setUInt32(1, skin | (face << 8) | (hairStyle << 16) | (hairColor << 24)); @@ -20200,11 +20246,19 @@ void Player::SendProficiency(ItemClass itemClass, uint32 itemSubclassMask) void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type) { - QueryResult result = QueryResult(NULL); + PreparedStatement* stmt; + if (type == 10) - result = CharacterDatabase.PQuery("SELECT ownerguid, petitionguid FROM petition_sign WHERE playerguid = '%u'", GUID_LOPART(guid)); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIG_BY_GUID); else - result = CharacterDatabase.PQuery("SELECT ownerguid, petitionguid FROM petition_sign WHERE playerguid = '%u' AND type = '%u'", GUID_LOPART(guid), type); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIG_BY_GUID_TYPE); + stmt->setUInt8(0, uint8(type)); + } + + stmt->setUInt32(0, GUID_LOPART(guid)); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) { do // this part effectively does nothing, since the deletion / modification only takes place _after_ the PetitionQuery. Though I don't know if the result remains intact if I execute the delete query beforehand. @@ -25197,8 +25251,8 @@ void Player::SendMovementSetCanFly(bool apply) void Player::SendMovementSetCanTransitionBetweenSwimAndFly(bool apply) { - WorldPacket data(apply ? - SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY : + WorldPacket data(apply ? + SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY : SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, 12); data.append(GetPackGUID()); data << uint32(0); //! movement counter diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 24fe75605d2..ebb524d5f64 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -129,8 +129,8 @@ void MapManager::LoadTransportNPCs() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 6 7 - QueryResult result = WorldDatabase.PQuery("SELECT guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO, emote FROM creature_transport"); + // 0 1 2 3 4 5 6 7 + QueryResult result = WorldDatabase.Query("SELECT guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO, emote FROM creature_transport"); if (!result) { diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 01f41866c5b..b4d8d36afb0 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1943,10 +1943,12 @@ uint64 ObjectMgr::GetPlayerGUIDByName(std::string name) const { uint64 guid = 0; - CharacterDatabase.EscapeString(name); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME); + + stmt->setString(0, name); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); - // Player name safe to sending to DB (checked at login) and this function using - QueryResult result = CharacterDatabase.PQuery("SELECT guid FROM characters WHERE name = '%s'", name.c_str()); if (result) guid = MAKE_NEW_GUID((*result)[0].GetUInt32(), 0, HIGHGUID_PLAYER); @@ -1962,7 +1964,11 @@ bool ObjectMgr::GetPlayerNameByGUID(uint64 guid, std::string &name) const return true; } - QueryResult result = CharacterDatabase.PQuery("SELECT name FROM characters WHERE guid = '%u'", GUID_LOPART(guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME); + + stmt->setUInt32(0, GUID_LOPART(guid)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) { @@ -1981,7 +1987,11 @@ uint32 ObjectMgr::GetPlayerTeamByGUID(uint64 guid) const return Player::TeamForRace(player->getRace()); } - QueryResult result = CharacterDatabase.PQuery("SELECT race FROM characters WHERE guid = '%u'", GUID_LOPART(guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_RACE); + + stmt->setUInt32(0, GUID_LOPART(guid)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) { @@ -2000,7 +2010,12 @@ uint32 ObjectMgr::GetPlayerAccountIdByGUID(uint64 guid) const return player->GetSession()->GetAccountId(); } - QueryResult result = CharacterDatabase.PQuery("SELECT account FROM characters WHERE guid = '%u'", GUID_LOPART(guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_BY_GUID); + + stmt->setUInt32(0, GUID_LOPART(guid)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) { uint32 acc = (*result)[0].GetUInt32(); @@ -2012,7 +2027,12 @@ uint32 ObjectMgr::GetPlayerAccountIdByGUID(uint64 guid) const uint32 ObjectMgr::GetPlayerAccountIdByPlayerName(const std::string& name) const { - QueryResult result = CharacterDatabase.PQuery("SELECT account FROM characters WHERE name = '%s'", name.c_str()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_BY_NAME); + + stmt->setString(0, name); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) { uint32 acc = (*result)[0].GetUInt32(); @@ -4809,7 +4829,9 @@ void ObjectMgr::LoadWaypointScripts() for (ScriptMapMap::const_iterator itr = sWaypointScripts.begin(); itr != sWaypointScripts.end(); ++itr) actionSet.insert(itr->first); - QueryResult result = WorldDatabase.PQuery("SELECT DISTINCT(`action`) FROM waypoint_data"); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WOLRD_SEL_WAYPOINT_DATA_ACTION); + PreparedQueryResult result = WorldDatabase.Query(stmt); + if (result) { do @@ -7033,8 +7055,8 @@ void ObjectMgr::LoadQuestPOI() return; } - // 0 1 2 3 - QueryResult points = WorldDatabase.PQuery("SELECT questId, id, x, y FROM quest_poi_points ORDER BY questId DESC, idx"); + // 0 1 2 3 + QueryResult points = WorldDatabase.Query("SELECT questId, id, x, y FROM quest_poi_points ORDER BY questId DESC, idx"); std::vector > > POIs; @@ -8189,7 +8211,10 @@ void ObjectMgr::LoadTrainerSpell() int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set *skip_vendors) { // find all items from the reference vendor - QueryResult result = WorldDatabase.PQuery("SELECT item, maxcount, incrtime, ExtendedCost FROM npc_vendor WHERE entry='%d' ORDER BY slot ASC", item); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_NPC_VENDOR_REF); + stmt->setUInt32(0, uint32(item)); + PreparedQueryResult result = WorldDatabase.Query(stmt); + if (!result) return 0; diff --git a/src/server/game/Groups/GroupMgr.cpp b/src/server/game/Groups/GroupMgr.cpp index ae400852c73..3d901f42501 100644 --- a/src/server/game/Groups/GroupMgr.cpp +++ b/src/server/game/Groups/GroupMgr.cpp @@ -120,7 +120,7 @@ void GroupMgr::LoadGroups() CharacterDatabase.DirectExecute("DELETE FROM groups WHERE guid NOT IN (SELECT guid FROM group_member GROUP BY guid HAVING COUNT(guid) > 1)"); // 0 1 2 3 4 5 6 7 8 9 - QueryResult result = CharacterDatabase.PQuery("SELECT g.leaderGuid, g.lootMethod, g.looterGuid, g.lootThreshold, g.icon1, g.icon2, g.icon3, g.icon4, g.icon5, g.icon6" + QueryResult result = CharacterDatabase.Query("SELECT g.leaderGuid, g.lootMethod, g.looterGuid, g.lootThreshold, g.icon1, g.icon2, g.icon3, g.icon4, g.icon5, g.icon6" // 10 11 12 13 14 15 16 17 ", g.icon7, g.icon8, g.groupType, g.difficulty, g.raiddifficulty, g.guid, lfg.dungeon, lfg.state FROM groups g LEFT JOIN lfg_data lfg ON lfg.guid = g.guid ORDER BY g.guid ASC"); if (!result) diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 15e05ccfbf7..b7225e89235 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -702,12 +702,17 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data) return; } - QueryResult result = CharacterDatabase.PQuery("SELECT account, name FROM characters WHERE guid='%u'", GUID_LOPART(guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_NAME_BY_GUID); + + stmt->setUInt32(0, GUID_LOPART(guid)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) { Field* fields = result->Fetch(); - accountId = fields[0].GetUInt32(); - name = fields[1].GetString(); + accountId = fields[0].GetUInt32(); + name = fields[1].GetString(); } // prevent deleting other players' characters using cheating tools @@ -1363,7 +1368,12 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data) uint8 gender, skin, face, hairStyle, hairColor, facialHair; recv_data >> gender >> skin >> hairColor >> hairStyle >> facialHair >> face; - QueryResult result = CharacterDatabase.PQuery("SELECT at_login FROM characters WHERE guid ='%u'", GUID_LOPART(guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AT_LOGIN); + + stmt->setUInt32(0, GUID_LOPART(guid)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) { WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1); @@ -1422,15 +1432,18 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data) } } - if (QueryResult oldNameResult = CharacterDatabase.PQuery("SELECT name FROM characters WHERE guid ='%u'", GUID_LOPART(guid))) + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME); + stmt->setUInt32(0, GUID_LOPART(guid)); + result = CharacterDatabase.Query(stmt); + + if (result) { - std::string oldname = oldNameResult->Fetch()[0].GetString(); - std::string IP_str = GetRemoteAddress(); - sLog->outChar("Account: %d (IP: %s), Character[%s] (guid:%u) Customized to: %s", GetAccountId(), IP_str.c_str(), oldname.c_str(), GUID_LOPART(guid), newName.c_str()); + std::string oldname = result->Fetch()[0].GetString(); + sLog->outChar("Account: %d (IP: %s), Character[%s] (guid:%u) Customized to: %s", GetAccountId(), GetRemoteAddress().c_str(), oldname.c_str(), GUID_LOPART(guid), newName.c_str()); } Player::Customize(guid, gender, skin, face, hairStyle, hairColor, facialHair); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_NAME_AT_LOGIN); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_NAME_AT_LOGIN); stmt->setString(0, newName); stmt->setUInt16(1, uint16(AT_LOGIN_CUSTOMIZE)); @@ -1575,7 +1588,13 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) recv_data >> gender >> skin >> hairColor >> hairStyle >> facialHair >> face >> race; uint32 lowGuid = GUID_LOPART(guid); - QueryResult result = CharacterDatabase.PQuery("SELECT class, level, at_login FROM characters WHERE guid ='%u'", lowGuid); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_CLASS_LVL_AT_LOGIN); + + stmt->setUInt32(0, lowGuid); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) { WorldPacket data(SMSG_CHAR_FACTION_CHANGE, 1); @@ -1811,8 +1830,13 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD)) { // Reset guild - if (QueryResult result2 = CharacterDatabase.PQuery("SELECT guildid FROM `guild_member` WHERE guid ='%u'", lowGuid)) - if (Guild* guild = sGuildMgr->GetGuildById((result2->Fetch()[0]).GetUInt32())) + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER); + + stmt->setUInt32(0, lowGuid); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) + if (Guild* guild = sGuildMgr->GetGuildById((result->Fetch()[0]).GetUInt32())) guild->DeleteMember(MAKE_NEW_GUID(lowGuid, 0, HIGHGUID_PLAYER)); } diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index a8522bb2582..117824bfb62 100755 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -128,12 +128,26 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) else { rc_team = sObjectMgr->GetPlayerTeamByGUID(rc); - if (QueryResult result = CharacterDatabase.PQuery("SELECT COUNT(*) FROM mail WHERE receiver = '%u'", GUID_LOPART(rc))) + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_COUNT); + + stmt->setUInt32(0, GUID_LOPART(rc)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + + if (result) { Field* fields = result->Fetch(); mails_count = fields[0].GetUInt32(); } - if (QueryResult result = CharacterDatabase.PQuery("SELECT level FROM characters WHERE guid = '%u'", GUID_LOPART(rc))) + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_LEVEL); + + stmt->setUInt32(0, GUID_LOPART(rc)); + + result = CharacterDatabase.Query(stmt); + + if (result) { Field* fields = result->Fetch(); receiveLevel = fields[0].GetUInt8(); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 17f96a0fcda..35872f8c63f 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1303,7 +1303,12 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data) uint32 accid = player->GetSession()->GetAccountId(); - QueryResult result = LoginDatabase.PQuery("SELECT username, email, last_ip FROM account WHERE id=%u", accid); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_WHOIS); + + stmt->setUInt32(0, accid); + + PreparedQueryResult result = LoginDatabase.Query(stmt); + if (!result) { SendNotification(LANG_ACCOUNT_FOR_PLAYER_NOT_FOUND, charname.c_str()); diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index 38d17d8c3b6..e072004c48c 100755 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -215,7 +215,10 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) // a petition is invalid, if both the owner and the type matches // we checked above, if this player is in an arenateam, so this must be // datacorruption - QueryResult result = CharacterDatabase.PQuery("SELECT petitionguid FROM petition WHERE ownerguid = '%u' AND type = '%u'", _player->GetGUIDLow(), type); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_BY_OWNER); + stmt->setUInt32(0, _player->GetGUIDLow()); + stmt->setUInt8(1, type); + PreparedQueryResult result = CharacterDatabase.Query(stmt); std::ostringstream ssInvalidPetitionGUIDs; @@ -250,9 +253,14 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recv_data) recv_data >> petitionguid; // petition guid // solve (possible) some strange compile problems with explicit use GUID_LOPART(petitionguid) at some GCC versions (wrong code optimization in compiler?) - uint32 petitionguid_low = GUID_LOPART(petitionguid); + uint32 petitionGuidLow = GUID_LOPART(petitionguid); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_TYPE); + + stmt->setUInt32(0, petitionGuidLow); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); - QueryResult result = CharacterDatabase.PQuery("SELECT type FROM petition WHERE petitionguid = '%u'", petitionguid_low); if (!result) { sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Petition %u is not found for player %u %s", GUID_LOPART(petitionguid), GetPlayer()->GetGUIDLow(), GetPlayer()->GetName()); @@ -265,18 +273,22 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recv_data) if (type == GUILD_CHARTER_TYPE && _player->GetGuildId()) return; - result = CharacterDatabase.PQuery("SELECT playerguid FROM petition_sign WHERE petitionguid = '%u'", petitionguid_low); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURE); + + stmt->setUInt32(0, petitionGuidLow); + + result = CharacterDatabase.Query(stmt); // result == NULL also correct in case no sign yet if (result) signs = uint8(result->GetRowCount()); - sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_SHOW_SIGNATURES petition entry: '%u'", petitionguid_low); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_SHOW_SIGNATURES petition entry: '%u'", petitionGuidLow); WorldPacket data(SMSG_PETITION_SHOW_SIGNATURES, (8+8+4+1+signs*12)); data << uint64(petitionguid); // petition guid data << uint64(_player->GetGUID()); // owner guid - data << uint32(petitionguid_low); // guild guid + data << uint32(petitionGuidLow); // guild guid data << uint8(signs); // sign's count for (uint8 i = 1; i <= signs; ++i) @@ -311,9 +323,11 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid) uint32 type; std::string name = "NO_NAME_FOR_GUID"; - // TODO: Use CHAR_LOAD_PETITION PS - QueryResult result = CharacterDatabase.PQuery("SELECT ownerguid, name, type " - "FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION); + + stmt->setUInt32(0, GUID_LOPART(petitionguid)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) { @@ -382,7 +396,11 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data) if (!item) return; - QueryResult result = CharacterDatabase.PQuery("SELECT type FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionGuid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_TYPE); + + stmt->setUInt32(0, GUID_LOPART(petitionGuid)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) { @@ -422,7 +440,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data) } } - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PETITION_NAME); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PETITION_NAME); stmt->setString(0, newName); stmt->setUInt32(1, GUID_LOPART(petitionGuid)); @@ -446,11 +464,12 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) recv_data >> petitionGuid; // petition guid recv_data >> unk; - QueryResult result = CharacterDatabase.PQuery( - "SELECT ownerguid, " - " (SELECT COUNT(playerguid) FROM petition_sign WHERE petition_sign.petitionguid = '%u') AS signs, " - " type " - "FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionGuid), GUID_LOPART(petitionGuid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURES); + + stmt->setUInt32(0, GUID_LOPART(petitionGuid)); + stmt->setUInt32(1, GUID_LOPART(petitionGuid)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) { @@ -518,9 +537,14 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) if (++signs > type) // client signs maximum return; - //client doesn't allow to sign petition two times by one character, but not check sign by another character from same account - //not allow sign another player from already sign player account - result = CharacterDatabase.PQuery("SELECT playerguid FROM petition_sign WHERE player_account = '%u' AND petitionguid = '%u'", GetAccountId(), GUID_LOPART(petitionGuid)); + // Client doesn't allow to sign petition two times by one character, but not check sign by another character from same account + // not allow sign another player from already sign player account + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIG_BY_ACCOUNT); + + stmt->setUInt32(0, GetAccountId()); + stmt->setUInt32(1, GUID_LOPART(petitionGuid)); + + result = CharacterDatabase.Query(stmt); if (result) { @@ -538,7 +562,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) return; } - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PETITION_SIGNATURE); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PETITION_SIGNATURE); stmt->setUInt32(0, GUID_LOPART(ownerGuid)); stmt->setUInt32(1, GUID_LOPART(petitionGuid)); @@ -576,7 +600,12 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recv_data) recv_data >> petitionguid; // petition guid sLog->outDebug(LOG_FILTER_NETWORKIO, "Petition %u declined by %u", GUID_LOPART(petitionguid), _player->GetGUIDLow()); - QueryResult result = CharacterDatabase.PQuery("SELECT ownerguid FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_OWNER_BY_GUID); + + stmt->setUInt32(0, GUID_LOPART(petitionguid)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) return; @@ -608,7 +637,12 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) if (!player) return; - QueryResult result = CharacterDatabase.PQuery("SELECT type FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_TYPE); + + stmt->setUInt32(0, GUID_LOPART(petitionguid)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) return; @@ -667,7 +701,13 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) } } - result = CharacterDatabase.PQuery("SELECT playerguid FROM petition_sign WHERE petitionguid = '%u'", GUID_LOPART(petitionguid)); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURE); + + stmt->setUInt32(0, GUID_LOPART(petitionguid)); + + result = CharacterDatabase.Query(stmt); + // result == NULL also correct charter without signs if (result) signs = uint8(result->GetRowCount()); diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 9ea0e124112..36986075b4e 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -241,7 +241,12 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED))// wrapped? { - QueryResult result = CharacterDatabase.PQuery("SELECT entry, flags FROM character_gifts WHERE item_guid = '%u'", item->GetGUIDLow()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_GIFT_BY_ITEM); + + stmt->setUInt32(0, item->GetGUIDLow()); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) { Field* fields = result->Fetch(); @@ -260,7 +265,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) return; } - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT); stmt->setUInt32(0, item->GetGUIDLow()); diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 91ebea9f321..86d95857cce 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2527,7 +2527,11 @@ void InstanceMap::CreateInstanceData(bool load) if (load) { // TODO: make a global storage for this - QueryResult result = CharacterDatabase.PQuery("SELECT data, completedEncounters FROM instance WHERE map = '%u' AND id = '%u'", GetId(), i_InstanceId); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_INSTANCE); + stmt->setUInt16(0, uint16(GetId())); + stmt->setUInt32(1, i_InstanceId); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) { Field* fields = result->Fetch(); diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp index b957674151b..2c3a58f55a3 100755 --- a/src/server/game/Movement/Waypoints/WaypointManager.cpp +++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp @@ -100,7 +100,12 @@ void WaypointMgr::ReloadPath(uint32 id) _waypointStore.erase(itr); } - QueryResult result = WorldDatabase.PQuery("SELECT point, position_x, position_y, position_z, orientation, move_flag, delay, action, action_chance FROM waypoint_data WHERE id = %u ORDER BY point", id); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_BY_ID); + + stmt->setUInt32(0, id); + + PreparedQueryResult result = WorldDatabase.Query(stmt); + if (!result) return; diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp index 05ce7a0a50d..71204f92826 100755 --- a/src/server/game/Pools/PoolMgr.cpp +++ b/src/server/game/Pools/PoolMgr.cpp @@ -440,7 +440,12 @@ void PoolGroup::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32 // load state from db if (!triggerFrom) { - QueryResult result = CharacterDatabase.PQuery("SELECT quest_id FROM pool_quest_save WHERE pool_id = %u", poolId); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_POOL_QUEST_SAVE); + + stmt->setUInt32(0, poolId); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) { do diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 2c6098fb23f..40b4a0bad4f 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -812,13 +812,11 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) clientSeed); // Get the account information from the realmd database - std::string safe_account = account; // Duplicate, else will screw the SHA hash verification below - LoginDatabase.EscapeString (safe_account); - // No SQL injection, username escaped. + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_INFO_BY_NAME); - // 0 1 2 3 4 5 6 7 8 9 10 - QueryResult result = LoginDatabase.PQuery ("SELECT id, sessionkey, last_ip, locked, v, s, expansion, mutetime, locale, recruiter, os FROM account " - "WHERE username = '%s'", safe_account.c_str()); + stmt->setString(0, account); + + PreparedQueryResult result = LoginDatabase.Query(stmt); // Stop if the account is not found if (!result) @@ -899,29 +897,28 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) std::string os = fields[10].GetString(); // Checks gmlevel per Realm - result = - LoginDatabase.PQuery ("SELECT " - "RealmID, " //0 - "gmlevel " //1 - "FROM account_access " - "WHERE id = '%d'" - " AND (RealmID = '%d'" - " OR RealmID = '-1')", - id, realmID); + stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_GMLEVEL_BY_REALMID); + + stmt->setUInt32(0, id); + stmt->setInt32(1, int32(realmID)); + + result = LoginDatabase.Query(stmt); + if (!result) security = 0; else { fields = result->Fetch(); - security = fields[1].GetInt32(); + security = fields[0].GetInt32(); } // Re-check account ban (same check as in realmd) - QueryResult banresult = - LoginDatabase.PQuery ("SELECT 1 FROM account_banned WHERE id = %u AND active = 1 " - "UNION " - "SELECT 1 FROM ip_banned WHERE ip = '%s'", - id, GetRemoteAddress().c_str()); + stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BANS); + + stmt->setUInt32(0, id); + stmt->setString(1, GetRemoteAddress()); + + PreparedQueryResult banresult = LoginDatabase.Query(stmt); if (banresult) // if account banned { @@ -976,7 +973,11 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) address.c_str()); // Check if this user is by any chance a recruiter - result = LoginDatabase.PQuery ("SELECT 1 FROM account WHERE recruiter = %u", id); + stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_RECRUITER); + + stmt->setUInt32(0, id); + + result = LoginDatabase.Query(stmt); bool isRecruiter = false; if (result) @@ -984,7 +985,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) // Update the last_ip in the database - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LAST_IP); + stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LAST_IP); stmt->setString(0, address); stmt->setString(1, account); diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp index 900fcf7392a..8d5d16d22b9 100644 --- a/src/server/game/Tools/PlayerDump.cpp +++ b/src/server/game/Tools/PlayerDump.cpp @@ -406,7 +406,10 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s bool incHighest = true; if (guid != 0 && guid < sObjectMgr->_hiCharGuid) { - result = CharacterDatabase.PQuery("SELECT 1 FROM characters WHERE guid = '%d'", guid); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_GUID); + stmt->setUInt32(0, guid); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) guid = sObjectMgr->_hiCharGuid; // use first free if exists else incHighest = false; @@ -420,8 +423,10 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s if (ObjectMgr::CheckPlayerName(name, true) == CHAR_NAME_SUCCESS) { - CharacterDatabase.EscapeString(name); // for safe, we use name only for sql quearies anyway - result = CharacterDatabase.PQuery("SELECT 1 FROM characters WHERE name = '%s'", name.c_str()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME); + stmt->setString(0, name); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) name = ""; // use the one from the dump } @@ -524,9 +529,11 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s { // check if the original name already exists name = getnth(line, 3); - CharacterDatabase.EscapeString(name); - result = CharacterDatabase.PQuery("SELECT 1 FROM characters WHERE name = '%s'", name.c_str()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME); + stmt->setString(0, name); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) if (!changenth(line, 37, "1")) // characters.at_login set to "rename on login" ROLLBACK(DUMP_FILE_BROKEN); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index af0c83a7a1b..13f2f1b44b8 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -2334,7 +2334,7 @@ BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, std::string dura do { Field* fieldsAccount = resultAccounts->Fetch(); - uint32 account = fieldsAccount->GetUInt32(); + uint32 account = fieldsAccount[0].GetUInt32(); if (mode != BAN_IP) { @@ -2770,7 +2770,10 @@ void World::ResetDailyQuests() void World::LoadDBAllowedSecurityLevel() { - QueryResult result = LoginDatabase.PQuery("SELECT allowedSecurityLevel from realmlist WHERE id = '%d'", realmID); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST_SECURITY_LEVEL); + stmt->setInt32(0, int32(realmID)); + PreparedQueryResult result = LoginDatabase.Query(stmt); + if (result) SetPlayerSecurityLimit(AccountTypes(result->Fetch()->GetUInt16())); } diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 86818e2c931..09c5c6c6007 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -194,8 +194,11 @@ public: static bool HandleAccountOnlineListCommand(ChatHandler* handler, char const* /*args*/) { ///- Get the list of accounts ID logged to the realm - QueryResult resultDB = CharacterDatabase.Query("SELECT name, account, map, zone FROM characters WHERE online > 0"); - if (!resultDB) + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ONLINE); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + + if (!result) { handler->SendSysMessage(LANG_ACCOUNT_LIST_EMPTY); return true; @@ -209,18 +212,15 @@ public: ///- Cycle through accounts do { - Field* fieldsDB = resultDB->Fetch(); + Field* fieldsDB = result->Fetch(); std::string name = fieldsDB[0].GetString(); uint32 account = fieldsDB[1].GetUInt32(); ///- Get the username, last IP and GM level of each account // No SQL injection. account is uint32. - QueryResult resultLogin = - LoginDatabase.PQuery("SELECT a.username, a.last_ip, aa.gmlevel, a.expansion " - "FROM account a " - "LEFT JOIN account_access aa " - "ON (a.id = aa.id) " - "WHERE a.id = '%u'", account); + stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_INFO); + stmt->setUInt32(0, account); + PreparedQueryResult resultLogin = LoginDatabase.Query(stmt); if (resultLogin) { @@ -233,7 +233,7 @@ public: else handler->PSendSysMessage(LANG_ACCOUNT_LIST_ERROR, name.c_str()); - } while (resultDB->NextRow()); + } while (result->NextRow()); handler->SendSysMessage(LANG_ACCOUNT_LIST_BAR); return true; @@ -469,7 +469,13 @@ public: // Check and abort if the target gm has a higher rank on one of the realms and the new realm is -1 if (gmRealmID == -1 && !AccountMgr::IsConsoleAccount(playerSecurity)) { - QueryResult result = LoginDatabase.PQuery("SELECT * FROM account_access WHERE id = '%u' AND gmlevel > '%d'", targetAccountId, gm); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ACCESS_GMLEVEL_TEST); + + stmt->setUInt32(0, targetAccountId); + stmt->setUInt8(1, uint8(gm)); + + PreparedQueryResult result = LoginDatabase.Query(stmt); + if (result) { handler->SendSysMessage(LANG_YOURS_SECURITY_IS_LOW); diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp index 9b9d1cfd146..d449b3617f7 100644 --- a/src/server/scripts/Commands/cs_gm.cpp +++ b/src/server/scripts/Commands/cs_gm.cpp @@ -156,7 +156,11 @@ public: static bool HandleGMListFullCommand(ChatHandler* handler, char const* /*args*/) { ///- Get the accounts with GM Level >0 - QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel >= %u AND (aa.realmid = -1 OR aa.realmid = %u)", SEC_MODERATOR, realmID); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_GM_ACCOUNTS); + stmt->setUInt8(0, uint8(SEC_MODERATOR)); + stmt->setInt32(1, int32(realmID)); + PreparedQueryResult result = LoginDatabase.Query(stmt); + if (result) { handler->SendSysMessage(LANG_GMLIST); diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 74b8272201b..232aad9f21c 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -535,11 +535,17 @@ public: uint32 count = 0; Player* player = handler->GetSession()->GetPlayer(); - QueryResult result = WorldDatabase.PQuery("SELECT guid, id, position_x, position_y, position_z, map, " - "(POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ " - "FROM gameobject WHERE map='%u' AND (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) <= '%f' ORDER BY order_", - player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), - player->GetMapId(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), distance * distance); + + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_GAMEOBJECT_NEAREST); + stmt->setFloat(0, player->GetPositionX()); + stmt->setFloat(1, player->GetPositionY()); + stmt->setFloat(2, player->GetPositionZ()); + stmt->setUInt32(3, player->GetMapId()); + stmt->setFloat(4, player->GetPositionX()); + stmt->setFloat(5, player->GetPositionY()); + stmt->setFloat(6, player->GetPositionZ()); + stmt->setFloat(7, distance * distance); + PreparedQueryResult result = WorldDatabase.Query(stmt); if (result) { diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 1520a944f6e..5f192ffceee 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -413,7 +413,11 @@ public: for (Tokens::const_iterator itr = entries.begin(); itr != entries.end(); ++itr) { uint32 entry = uint32(atoi(*itr)); - QueryResult result = WorldDatabase.PQuery("SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = %u", entry); + + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_TEMPLATE); + stmt->setUInt32(0, entry); + PreparedQueryResult result = WorldDatabase.Query(stmt); + if (!result) { handler->PSendSysMessage(LANG_COMMAND_CREATURETEMPLATE_NOTFOUND, entry); @@ -434,87 +438,87 @@ public: const_cast(cInfo)->DifficultyEntry[0] = fields[0].GetUInt32(); const_cast(cInfo)->DifficultyEntry[1] = fields[1].GetUInt32(); const_cast(cInfo)->DifficultyEntry[2] = fields[2].GetUInt32(); - const_cast(cInfo)->KillCredit[0] = fields[3].GetUInt32(); - const_cast(cInfo)->KillCredit[1] = fields[4].GetUInt32(); - const_cast(cInfo)->Modelid1 = fields[5].GetUInt32(); - const_cast(cInfo)->Modelid2 = fields[6].GetUInt32(); - const_cast(cInfo)->Modelid3 = fields[7].GetUInt32(); - const_cast(cInfo)->Modelid4 = fields[8].GetUInt32(); - const_cast(cInfo)->Name = fields[9].GetString(); - const_cast(cInfo)->SubName = fields[10].GetString(); - const_cast(cInfo)->IconName = fields[11].GetString(); - const_cast(cInfo)->GossipMenuId = fields[12].GetUInt32(); - const_cast(cInfo)->minlevel = fields[13].GetUInt32(); - const_cast(cInfo)->maxlevel = fields[14].GetUInt32(); - const_cast(cInfo)->expansion = fields[15].GetUInt32(); - const_cast(cInfo)->faction_A = fields[16].GetUInt32(); - const_cast(cInfo)->faction_H = fields[17].GetUInt32(); - const_cast(cInfo)->npcflag = fields[18].GetUInt32(); - const_cast(cInfo)->speed_walk = fields[19].GetFloat(); - const_cast(cInfo)->speed_run = fields[20].GetFloat(); - const_cast(cInfo)->scale = fields[21].GetFloat(); - const_cast(cInfo)->rank = fields[22].GetUInt32(); - const_cast(cInfo)->mindmg = fields[23].GetFloat(); - const_cast(cInfo)->maxdmg = fields[24].GetFloat(); - const_cast(cInfo)->dmgschool = fields[25].GetUInt32(); - const_cast(cInfo)->attackpower = fields[26].GetUInt32(); - const_cast(cInfo)->dmg_multiplier = fields[27].GetFloat(); - const_cast(cInfo)->baseattacktime = fields[28].GetUInt32(); - const_cast(cInfo)->rangeattacktime = fields[29].GetUInt32(); - const_cast(cInfo)->unit_class = fields[30].GetUInt32(); - const_cast(cInfo)->unit_flags = fields[31].GetUInt32(); - const_cast(cInfo)->dynamicflags = fields[32].GetUInt32(); - const_cast(cInfo)->family = fields[33].GetUInt32(); - const_cast(cInfo)->trainer_type = fields[34].GetUInt32(); - const_cast(cInfo)->trainer_spell = fields[35].GetUInt32(); - const_cast(cInfo)->trainer_class = fields[36].GetUInt32(); - const_cast(cInfo)->trainer_race = fields[37].GetUInt32(); - const_cast(cInfo)->minrangedmg = fields[38].GetFloat(); - const_cast(cInfo)->maxrangedmg = fields[39].GetFloat(); - const_cast(cInfo)->rangedattackpower = fields[40].GetUInt32(); - const_cast(cInfo)->type = fields[41].GetUInt32(); - const_cast(cInfo)->type_flags = fields[42].GetUInt32(); - const_cast(cInfo)->lootid = fields[43].GetUInt32(); - const_cast(cInfo)->pickpocketLootId = fields[44].GetUInt32(); - const_cast(cInfo)->SkinLootId = fields[45].GetUInt32(); + const_cast(cInfo)->KillCredit[0] = fields[3].GetUInt32(); + const_cast(cInfo)->KillCredit[1] = fields[4].GetUInt32(); + const_cast(cInfo)->Modelid1 = fields[5].GetUInt32(); + const_cast(cInfo)->Modelid2 = fields[6].GetUInt32(); + const_cast(cInfo)->Modelid3 = fields[7].GetUInt32(); + const_cast(cInfo)->Modelid4 = fields[8].GetUInt32(); + const_cast(cInfo)->Name = fields[9].GetString(); + const_cast(cInfo)->SubName = fields[10].GetString(); + const_cast(cInfo)->IconName = fields[11].GetString(); + const_cast(cInfo)->GossipMenuId = fields[12].GetUInt32(); + const_cast(cInfo)->minlevel = fields[13].GetUInt32(); + const_cast(cInfo)->maxlevel = fields[14].GetUInt32(); + const_cast(cInfo)->expansion = fields[15].GetUInt32(); + const_cast(cInfo)->faction_A = fields[16].GetUInt32(); + const_cast(cInfo)->faction_H = fields[17].GetUInt32(); + const_cast(cInfo)->npcflag = fields[18].GetUInt32(); + const_cast(cInfo)->speed_walk = fields[19].GetFloat(); + const_cast(cInfo)->speed_run = fields[20].GetFloat(); + const_cast(cInfo)->scale = fields[21].GetFloat(); + const_cast(cInfo)->rank = fields[22].GetUInt32(); + const_cast(cInfo)->mindmg = fields[23].GetFloat(); + const_cast(cInfo)->maxdmg = fields[24].GetFloat(); + const_cast(cInfo)->dmgschool = fields[25].GetUInt32(); + const_cast(cInfo)->attackpower = fields[26].GetUInt32(); + const_cast(cInfo)->dmg_multiplier = fields[27].GetFloat(); + const_cast(cInfo)->baseattacktime = fields[28].GetUInt32(); + const_cast(cInfo)->rangeattacktime = fields[29].GetUInt32(); + const_cast(cInfo)->unit_class = fields[30].GetUInt32(); + const_cast(cInfo)->unit_flags = fields[31].GetUInt32(); + const_cast(cInfo)->dynamicflags = fields[32].GetUInt32(); + const_cast(cInfo)->family = fields[33].GetUInt32(); + const_cast(cInfo)->trainer_type = fields[34].GetUInt32(); + const_cast(cInfo)->trainer_spell = fields[35].GetUInt32(); + const_cast(cInfo)->trainer_class = fields[36].GetUInt32(); + const_cast(cInfo)->trainer_race = fields[37].GetUInt32(); + const_cast(cInfo)->minrangedmg = fields[38].GetFloat(); + const_cast(cInfo)->maxrangedmg = fields[39].GetFloat(); + const_cast(cInfo)->rangedattackpower = fields[40].GetUInt32(); + const_cast(cInfo)->type = fields[41].GetUInt32(); + const_cast(cInfo)->type_flags = fields[42].GetUInt32(); + const_cast(cInfo)->lootid = fields[43].GetUInt32(); + const_cast(cInfo)->pickpocketLootId = fields[44].GetUInt32(); + const_cast(cInfo)->SkinLootId = fields[45].GetUInt32(); for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) { const_cast(cInfo)->resistance[i] = fields[46 + i -1].GetUInt32(); } - const_cast(cInfo)->spells[0] = fields[52].GetUInt32(); - const_cast(cInfo)->spells[1] = fields[53].GetUInt32(); - const_cast(cInfo)->spells[2] = fields[54].GetUInt32(); - const_cast(cInfo)->spells[3] = fields[55].GetUInt32(); - const_cast(cInfo)->spells[4] = fields[56].GetUInt32(); - const_cast(cInfo)->spells[5] = fields[57].GetUInt32(); - const_cast(cInfo)->spells[6] = fields[58].GetUInt32(); - const_cast(cInfo)->spells[7] = fields[59].GetUInt32(); - const_cast(cInfo)->PetSpellDataId = fields[60].GetUInt32(); - const_cast(cInfo)->VehicleId = fields[61].GetUInt32(); - const_cast(cInfo)->mingold = fields[62].GetUInt32(); - const_cast(cInfo)->maxgold = fields[63].GetUInt32(); - const_cast(cInfo)->AIName = fields[64].GetString(); - const_cast(cInfo)->MovementType = fields[65].GetUInt32(); - const_cast(cInfo)->InhabitType = fields[66].GetUInt32(); - const_cast(cInfo)->HoverHeight = fields[67].GetFloat(); - const_cast(cInfo)->ModHealth = fields[68].GetFloat(); - const_cast(cInfo)->ModMana = fields[69].GetFloat(); - const_cast(cInfo)->ModArmor = fields[70].GetFloat(); - const_cast(cInfo)->RacialLeader = fields[71].GetBool(); - const_cast(cInfo)->questItems[0] = fields[72].GetUInt32(); - const_cast(cInfo)->questItems[1] = fields[73].GetUInt32(); - const_cast(cInfo)->questItems[2] = fields[74].GetUInt32(); - const_cast(cInfo)->questItems[3] = fields[75].GetUInt32(); - const_cast(cInfo)->questItems[4] = fields[76].GetUInt32(); - const_cast(cInfo)->questItems[5] = fields[77].GetUInt32(); - const_cast(cInfo)->movementId = fields[78].GetUInt32(); - const_cast(cInfo)->RegenHealth = fields[79].GetBool(); - const_cast(cInfo)->equipmentId = fields[80].GetUInt32(); + const_cast(cInfo)->spells[0] = fields[52].GetUInt32(); + const_cast(cInfo)->spells[1] = fields[53].GetUInt32(); + const_cast(cInfo)->spells[2] = fields[54].GetUInt32(); + const_cast(cInfo)->spells[3] = fields[55].GetUInt32(); + const_cast(cInfo)->spells[4] = fields[56].GetUInt32(); + const_cast(cInfo)->spells[5] = fields[57].GetUInt32(); + const_cast(cInfo)->spells[6] = fields[58].GetUInt32(); + const_cast(cInfo)->spells[7] = fields[59].GetUInt32(); + const_cast(cInfo)->PetSpellDataId = fields[60].GetUInt32(); + const_cast(cInfo)->VehicleId = fields[61].GetUInt32(); + const_cast(cInfo)->mingold = fields[62].GetUInt32(); + const_cast(cInfo)->maxgold = fields[63].GetUInt32(); + const_cast(cInfo)->AIName = fields[64].GetString(); + const_cast(cInfo)->MovementType = fields[65].GetUInt32(); + const_cast(cInfo)->InhabitType = fields[66].GetUInt32(); + const_cast(cInfo)->HoverHeight = fields[67].GetFloat(); + const_cast(cInfo)->ModHealth = fields[68].GetFloat(); + const_cast(cInfo)->ModMana = fields[69].GetFloat(); + const_cast(cInfo)->ModArmor = fields[70].GetFloat(); + const_cast(cInfo)->RacialLeader = fields[71].GetBool(); + const_cast(cInfo)->questItems[0] = fields[72].GetUInt32(); + const_cast(cInfo)->questItems[1] = fields[73].GetUInt32(); + const_cast(cInfo)->questItems[2] = fields[74].GetUInt32(); + const_cast(cInfo)->questItems[3] = fields[75].GetUInt32(); + const_cast(cInfo)->questItems[4] = fields[76].GetUInt32(); + const_cast(cInfo)->questItems[5] = fields[77].GetUInt32(); + const_cast(cInfo)->movementId = fields[78].GetUInt32(); + const_cast(cInfo)->RegenHealth = fields[79].GetBool(); + const_cast(cInfo)->equipmentId = fields[80].GetUInt32(); const_cast(cInfo)->MechanicImmuneMask = fields[81].GetUInt32(); - const_cast(cInfo)->flags_extra = fields[82].GetUInt32(); - const_cast(cInfo)->ScriptID = sObjectMgr->GetScriptId(fields[83].GetCString()); + const_cast(cInfo)->flags_extra = fields[82].GetUInt32(); + const_cast(cInfo)->ScriptID = sObjectMgr->GetScriptId(fields[83].GetCString()); sObjectMgr->CheckCreatureTemplate(cInfo); } diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp index 5054bd83f32..89646c23ea0 100644 --- a/src/server/scripts/Commands/cs_tele.cpp +++ b/src/server/scripts/Commands/cs_tele.cpp @@ -131,7 +131,10 @@ public: target->TeleportTo(target->m_homebindMapId, target->m_homebindX, target->m_homebindY, target->m_homebindZ, target->GetOrientation()); else { - QueryResult resultDB = CharacterDatabase.PQuery("SELECT mapId, zoneId, posX, posY, posZ FROM character_homebind WHERE guid = %u", target_guid); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_HOMEBIND); + stmt->setUInt32(0, target_guid); + PreparedQueryResult resultDB = CharacterDatabase.Query(stmt); + if (resultDB) { Field* fieldsDB = resultDB->Fetch(); diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index eb59007b40b..f29dd8a5069 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -91,7 +91,10 @@ public: pathid = target->GetWaypointPath(); else { - QueryResult result = WorldDatabase.Query("SELECT MAX(id) FROM waypoint_data"); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_MAX_ID); + + PreparedQueryResult result = WorldDatabase.Query(stmt); + uint32 maxpathid = result->Fetch()->GetInt32(); pathid = maxpathid+1; handler->PSendSysMessage("%s%s|r", "|cff00ff00", "New path started."); @@ -109,7 +112,9 @@ public: return true; } - QueryResult result = WorldDatabase.PQuery("SELECT MAX(point) FROM waypoint_data WHERE id = '%u'", pathid); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_MAX_POINT); + stmt->setUInt32(0, pathid); + PreparedQueryResult result = WorldDatabase.Query(stmt); if (result) point = (*result)[0].GetUInt32(); @@ -117,7 +122,7 @@ public: Player* player = handler->GetSession()->GetPlayer(); //Map* map = player->GetMap(); - PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_WAYPOINT_DATA); + stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_WAYPOINT_DATA); stmt->setUInt32(0, pathid); stmt->setUInt32(1, point + 1); @@ -173,9 +178,12 @@ public: } guidLow = target->GetDBTableGUIDLow(); - QueryResult result = WorldDatabase.PQuery("SELECT guid FROM creature_addon WHERE guid = '%u'", guidLow); - PreparedStatement* stmt; + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_ADDON_BY_GUID); + + stmt->setUInt32(0, guidLow); + + PreparedQueryResult result = WorldDatabase.Query(stmt); if (result) { @@ -290,7 +298,9 @@ public: if (id) { - QueryResult result = WorldDatabase.PQuery("SELECT id FROM waypoint_scripts WHERE guid = %u", id); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_SCRIPT_ID_BY_GUID); + stmt->setUInt32(0, id); + PreparedQueryResult result = WorldDatabase.Query(stmt); if (!result) { @@ -307,10 +317,13 @@ public: } else { - QueryResult result = WorldDatabase.Query("SELECT MAX(guid) FROM waypoint_scripts"); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_SCRIPTS_MAX_ID); + + PreparedQueryResult result = WorldDatabase.Query(stmt); + id = result->Fetch()->GetUInt32(); - PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_WAYPOINT_SCRIPT); + stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_WAYPOINT_SCRIPT); stmt->setUInt32(0, id + 1); @@ -336,7 +349,9 @@ public: float a8, a9, a10, a11; char const* a7; - QueryResult result = WorldDatabase.PQuery("SELECT guid, delay, command, datalong, datalong2, dataint, x, y, z, o FROM waypoint_scripts WHERE id = %u", id); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_SCRIPT_BY_ID); + stmt->setUInt32(0, id); + PreparedQueryResult result = WorldDatabase.Query(stmt); if (!result) { @@ -369,7 +384,11 @@ public: { id = atoi(arg_id); - QueryResult result = WorldDatabase.PQuery("SELECT guid FROM waypoint_scripts WHERE guid = %u", id); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_SCRIPT_ID_BY_GUID); + + stmt->setUInt32(0, id); + + PreparedQueryResult result = WorldDatabase.Query(stmt); if (result) { @@ -447,7 +466,9 @@ public: } else { - QueryResult result = WorldDatabase.PQuery("SELECT id FROM waypoint_scripts WHERE guid='%u'", id); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_SCRIPT_ID_BY_GUID); + stmt->setUInt32(0, id); + PreparedQueryResult result = WorldDatabase.Query(stmt); if (!result) { @@ -567,7 +588,9 @@ public: // User did select a visual waypoint? // Check the creature - QueryResult result = WorldDatabase.PQuery("SELECT id, point FROM waypoint_data WHERE wpguid = %u", wpGuid); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_BY_WPGUID); + stmt->setUInt32(0, wpGuid); + PreparedQueryResult result = WorldDatabase.Query(stmt); if (!result) { @@ -578,9 +601,17 @@ public: // Here we search for all waypoints that only differ in one from 1 thousand // (0.001) - There is no other way to compare C++ floats with mySQL floats // See also: http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html - const char* maxDIFF = "0.01"; - result = WorldDatabase.PQuery("SELECT id, point FROM waypoint_data WHERE (abs(position_x - %f) <= %s) and (abs(position_y - %f) <= %s) and (abs(position_z - %f) <= %s)", - target->GetPositionX(), maxDIFF, target->GetPositionY(), maxDIFF, target->GetPositionZ(), maxDIFF); + std::string maxDiff = "0.01"; + + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_BY_POS); + stmt->setFloat(0, target->GetPositionX()); + stmt->setString(1, maxDiff); + stmt->setFloat(2, target->GetPositionY()); + stmt->setString(3, maxDiff); + stmt->setFloat(4, target->GetPositionZ()); + stmt->setString(5, maxDiff); + PreparedQueryResult result = WorldDatabase.Query(stmt); + if (!result) { handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM, wpGuid); @@ -765,7 +796,6 @@ public: } std::string show = show_str; - uint32 Maxpoint; //handler->PSendSysMessage("wpshow - show: %s", show); @@ -780,7 +810,11 @@ public: return false; } - QueryResult result = WorldDatabase.PQuery("SELECT id, point, delay, move_flag, action, action_chance FROM waypoint_data WHERE wpguid = %u", target->GetGUIDLow()); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_ALL_BY_WPGUID); + + stmt->setUInt32(0, target->GetGUIDLow()); + + PreparedQueryResult result = WorldDatabase.Query(stmt); if (!result) { @@ -812,7 +846,11 @@ public: if (show == "on") { - QueryResult result = WorldDatabase.PQuery("SELECT point, position_x, position_y, position_z FROM waypoint_data WHERE id = '%u'", pathid); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_POS_BY_ID); + + stmt->setUInt32(0, pathid); + + PreparedQueryResult result = WorldDatabase.Query(stmt); if (!result) { @@ -824,7 +862,11 @@ public: handler->PSendSysMessage("|cff00ff00DEBUG: wp on, PathID: |cff00ffff%u|r", pathid); // Delete all visuals for this NPC - QueryResult result2 = WorldDatabase.PQuery("SELECT wpguid FROM waypoint_data WHERE id = '%u' and wpguid <> 0", pathid); + stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_WPGUID_BY_ID); + + stmt->setUInt32(0, pathid); + + PreparedQueryResult result2 = WorldDatabase.Query(stmt); if (result2) { @@ -921,7 +963,10 @@ public: { handler->PSendSysMessage("|cff00ff00DEBUG: wp first, GUID: %u|r", pathid); - QueryResult result = WorldDatabase.PQuery("SELECT position_x, position_y, position_z FROM waypoint_data WHERE point='1' AND id = '%u'", pathid); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_POS_FIRST_BY_ID); + stmt->setUInt32(0, pathid); + PreparedQueryResult result = WorldDatabase.Query(stmt); + if (!result) { handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUND, pathid); @@ -968,13 +1013,10 @@ public: { handler->PSendSysMessage("|cff00ff00DEBUG: wp last, PathID: |r|cff00ffff%u|r", pathid); - QueryResult result = WorldDatabase.PQuery("SELECT MAX(point) FROM waypoint_data WHERE id = '%u'", pathid); - if (result) - Maxpoint = (*result)[0].GetUInt32(); - else - Maxpoint = 0; + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_POS_LAST_BY_ID); + stmt->setUInt32(0, pathid); + PreparedQueryResult result = WorldDatabase.Query(stmt); - result = WorldDatabase.PQuery("SELECT position_x, position_y, position_z, orientation FROM waypoint_data WHERE point ='%u' AND id = '%u'", Maxpoint, pathid); if (!result) { handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDLAST, pathid); @@ -1018,7 +1060,10 @@ public: if (show == "off") { - QueryResult result = WorldDatabase.PQuery("SELECT guid FROM creature WHERE id = '%u'", 1); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_BY_ID); + stmt->setUInt32(0, 1); + PreparedQueryResult result = WorldDatabase.Query(stmt); + if (!result) { handler->SendSysMessage(LANG_WAYPOINT_VP_NOTFOUND); @@ -1051,7 +1096,7 @@ public: } while (result->NextRow()); // set "wpguid" column to "empty" - no visual waypoint spawned - PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_ALL_WAYPOINT_DATA_WPGUID); + stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_DATA_ALL_WPGUID); WorldDatabase.Execute(stmt); //WorldDatabase.PExecute("UPDATE creature_movement SET wpguid = '0' WHERE wpguid <> '0'"); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 29026b9bef7..9c0c91e8152 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -28,12 +28,13 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_EXPIRED_BANS, "UPDATE character_banned SET active = 0 WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate <> bandate", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_GUID_BY_NAME, "SELECT guid FROM characters WHERE name = ?", CONNECTION_BOTH); PREPARE_STATEMENT(CHAR_SEL_CHECK_NAME, "SELECT 1 FROM characters WHERE name = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_SEL_CHECK_GUID, "SELECT 1 FROM characters WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_SUM_CHARS, "SELECT COUNT(guid) FROM characters WHERE account = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_CHAR_CREATE_INFO, "SELECT level, race, class FROM characters WHERE account = ? LIMIT 0, ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_CHARACTER_BAN, "INSERT INTO character_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?, 1)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_CHARACTER_BAN, "UPDATE character_banned SET active = 0 WHERE guid = ? AND active != 0", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_BANINFO, "SELECT FROM_UNIXTIME(bandate), unbandate-bandate, active, unbandate, banreason, bannedby FROM character_banned WHERE guid = ? ORDER BY bandate ASC", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_SEL_GUID_BY_NAME_FILTER, "SELECT guid, name FROM characters WHERE name LIKE CONCAT('%', ?, '%')", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_SEL_GUID_BY_NAME_FILTER, "SELECT guid, name FROM characters WHERE name LIKE CONCAT('%%', ?, '%%')", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_SEL_BANINFO_LIST, "SELECT bandate, unbandate, bannedby, banreason FROM character_banned WHERE guid = ? ORDER BY unbandate", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_SEL_BANNED_NAME, "SELECT characters.name FROM characters, character_banned WHERE character_banned.guid = ? AND character_banned.guid = characters.guid", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_SEL_ENUM, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, cb.guid FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? LEFT JOIN guild_member AS gm ON c.guid = gm.guid LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? ORDER BY c.guid", CONNECTION_ASYNC); @@ -44,6 +45,11 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_PET_SLOT_BY_ID, "SELECT slot, entry FROM character_pet WHERE owner = ? AND id = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_FREE_NAME, "SELECT guid, name FROM characters WHERE guid = ? AND account = ? AND (at_login & ?) = ? AND NOT EXISTS (SELECT NULL FROM characters WHERE name = ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_GUID_RACE_ACC_BY_NAME, "SELECT guid, race, account FROM characters WHERE name = ?", CONNECTION_BOTH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_RACE, "SELECT race FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_LEVEL, "SELECT level FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_ZONE, "SELECT zone FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_POSITION_XYZ, "SELECT map, position_x, position_y, position_z FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_POSITION, "SELECT position_x, position_y, position_z, orientation, map, taxi_path FROM characters WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_DAILY, "DELETE FROM character_queststatus_daily", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_WEEKLY, "DELETE FROM character_queststatus_weekly", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_SEASONAL, "DELETE FROM character_queststatus_seasonal WHERE event = ?", CONNECTION_ASYNC); @@ -78,11 +84,12 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_CHARACTER_ACTIONS, "SELECT a.button, a.action, a.type FROM character_action as a, characters as c WHERE a.guid = c.guid AND a.spec = c.activespec AND a.guid = ? ORDER BY button", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_MAILCOUNT, "SELECT COUNT(id) FROM mail WHERE receiver = ? AND (checked & 1) = 0 AND deliver_time <= ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_MAILDATE, "SELECT MIN(deliver_time) FROM mail WHERE receiver = ? AND (checked & 1) = 0", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SEL_MAIL_COUNT, "SELECT COUNT(*) FROM mail WHERE receiver = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_CHARACTER_SOCIALLIST, "SELECT friend, flags, note FROM character_social JOIN characters ON characters.guid = character_social.friend WHERE character_social.guid = ? AND deleteinfos_name IS NULL LIMIT 255", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_HOMEBIND, "SELECT mapId, zoneId, posX, posY, posZ FROM character_homebind WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_SPELLCOOLDOWNS, "SELECT spell, item, time FROM character_spell_cooldown WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_DECLINEDNAMES, "SELECT genitive, dative, accusative, instrumental, prepositional FROM character_declinedname WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_GUILD_MEMBER, "SELECT guildid, rank FROM guild_member WHERE guid = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SEL_GUILD_MEMBER, "SELECT guildid, rank FROM guild_member WHERE guid = ?", CONNECTION_BOTH) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_ACHIEVEMENTS, "SELECT achievement, date FROM character_achievement WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_CRITERIAPROGRESS, "SELECT criteria, counter, date FROM character_achievement_progress WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_EQUIPMENTSETS, "SELECT setguid, setindex, name, iconname, item0, item1, item2, item3, item4, item5, item6, item7, item8, " @@ -103,6 +110,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_AUCTIONS, "SELECT id, auctioneerguid, itemguid, itemEntry, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_INS_AUCTION, "INSERT INTO auctionhouse (id, auctioneerguid, itemguid, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_AUCTION, "DELETE FROM auctionhouse WHERE id = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SEL_AUCTION_BY_TIME, "SELECT id FROM auctionhouse WHERE time <= ? ORDER BY TIME ASC", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_INS_MAIL, "INSERT INTO mail(id, messageType, stationery, mailTemplateId, sender, receiver, subject, body, has_items, expire_time, deliver_time, money, cod, checked) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_MAIL, "DELETE FROM mail WHERE id = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_INS_MAIL_ITEM, "INSERT INTO mail_items(mail_id, item_guid, receiver) VALUES (?, ?, ?)", CONNECTION_ASYNC) @@ -127,10 +135,14 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_ITEM_INSTANCE, "DELETE FROM item_instance WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_GIFT_OWNER, "UPDATE character_gifts SET guid = ? WHERE item_guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_GIFT, "DELETE FROM character_gifts WHERE item_guid = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SEL_CHARACTER_GIFT_BY_ITEM, "SELECT entry, flags FROM character_gifts WHERE item_guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_ACCOUNT_BY_NAME, "SELECT account FROM characters WHERE name = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_SEL_ACCOUNT_BY_GUID, "SELECT account FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_ACCOUNT_NAME_BY_GUID, "SELECT account, name FROM characters WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_DEL_ACCOUNT_INSTANCE_LOCK_TIMES, "DELETE FROM account_instance_times WHERE accountId = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_INS_ACCOUNT_INSTANCE_LOCK_TIMES, "INSERT INTO account_instance_times (accountId, instanceId, releaseTime) VALUES (?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_NAME_CLASS, "SELECT name, class FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHARACTER_NAME, "SELECT name FROM characters WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_MATCH_MAKER_RATING, "SELECT matchMakerRating FROM character_arena_stats WHERE guid = ? AND slot = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_CHARACTER_COUNT, "SELECT account, COUNT(guid) FROM characters WHERE account = ? GROUP BY account", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_NAME, "UPDATE characters set name = ?, at_login = at_login & ~ ? WHERE guid = ?", CONNECTION_ASYNC); @@ -263,6 +275,13 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_PETITION_SIGNATURE, "SELECT playerguid FROM petition_sign WHERE petitionguid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_DEL_ALL_PETITION_SIGNATURES, "DELETE FROM petition_sign WHERE playerguid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_PETITION_SIGNATURE, "DELETE FROM petition_sign WHERE playerguid = ? AND type = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_SEL_PETITION_BY_OWNER, "SELECT petitionguid FROM petition WHERE ownerguid = ? AND type = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PETITION_TYPE, "SELECT type FROM petition WHERE petitionguid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PETITION_SIGNATURES, "SELECT ownerguid, (SELECT COUNT(playerguid) FROM petition_sign WHERE petition_sign.petitionguid = ?) AS signs, type FROM petition WHERE petitionguid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PETITION_SIG_BY_ACCOUNT, "SELECT playerguid FROM petition_sign WHERE player_account = ? AND petitionguid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PETITION_OWNER_BY_GUID, "SELECT ownerguid FROM petition WHERE petitionguid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PETITION_SIG_BY_GUID, "SELECT ownerguid, petitionguid FROM petition_sign WHERE playerguid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PETITION_SIG_BY_GUID_TYPE, "SELECT ownerguid, petitionguid FROM petition_sign WHERE playerguid = ? AND type = ?", CONNECTION_SYNCH); // Arena teams PREPARE_STATEMENT(CHAR_SEL_CHARACTER_ARENAINFO, "SELECT arenaTeamId, weekGames, seasonGames, seasonWins, personalRating FROM arena_team_member WHERE guid = ?", CONNECTION_ASYNC) @@ -389,5 +408,44 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_CHARACTER_SOCIAL, "DELETE FROM character_social WHERE guid = ? AND friend = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_CHARACTER_SOCIAL_NOTE, "UPDATE character_social SET note = ? WHERE guid = ? AND friend = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_CHARACTER_POSITION, "UPDATE characters SET position_x = ?, position_y = ?, position_z = ?, orientation = ?, map = ?, zone = ?, trans_x = 0, trans_y = 0, trans_z = 0, transguid = 0, taxi_path = '' WHERE guid = ?", CONNECTION_ASYNC); - + PREPARE_STATEMENT(CHAR_SEL_CHARACTER_AURA_FROZEN, "SELECT characters.name FROM characters LEFT JOIN character_aura ON (characters.guid = character_aura.guid) WHERE character_aura.spell = 9454", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHARACTER_ONLINE, "SELECT name, account, map, zone FROM characters WHERE online > 0", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_DEL_INFO_BY_GUID, "SELECT guid, deleteInfos_Name, deleteInfos_Account, deleteDate FROM characters WHERE deleteDate IS NOT NULL AND guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_DEL_INFO_BY_NAME, "SELECT guid, deleteInfos_Name, deleteInfos_Account, deleteDate FROM characters WHERE deleteDate IS NOT NULL AND deleteInfos_Name LIKE CONCAT('%%', ?, '%%')", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_DEL_INFO, "SELECT guid, deleteInfos_Name, deleteInfos_Account, deleteDate FROM characters WHERE deleteDate IS NOT NULL", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHARS_BY_ACCOUNT_ID, "SELECT guid FROM characters WHERE account = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PINFO, "SELECT totaltime, level, money, account, race, class, map, zone FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PINFO_BANS, "SELECT unbandate, bandate = unbandate, bannedby, banreason FROM character_banned WHERE guid = ? AND active ORDER BY bandate ASC LIMIT 1", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_HOMEBIND, "SELECT mapId, zoneId, posX, posY, posZ FROM character_homebind WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_GUID_NAME_BY_ACC, "SELECT guid, name FROM characters WHERE account = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_POOL_QUEST_SAVE, "SELECT quest_id FROM pool_quest_save WHERE pool_id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHARACTER_AT_LOGIN, "SELECT at_login FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_CLASS_LVL_AT_LOGIN, "SELECT class, level, at_login FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_INSTANCE, "SELECT data, completedEncounters FROM instance WHERE map = ? AND id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PET_SPELL_LIST, "SELECT DISTINCT pet_spell.spell FROM pet_spell, character_pet WHERE character_pet.owner = ? AND character_pet.id = pet_spell.guid AND character_pet.id <> ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PET, "SELECT id FROM character_pet WHERE owner = ? AND id <> ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PETS, "SELECT id FROM character_pet WHERE owner = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_COD_ITEM_MAIL, "SELECT id, messageType, mailTemplateId, sender, subject, body, money, has_items FROM mail WHERE receiver = ? AND has_items <> 0 AND cod <> 0", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_SOCIAL, "SELECT DISTINCT guid FROM character_social WHERE friend = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PET_AURA, "SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges FROM pet_aura WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_OLD_CHARS, "SELECT guid, deleteInfos_Account FROM characters WHERE deleteDate IS NOT NULL AND deleteDate < ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_ARENA_TEAM_ID_BY_PLAYER_GUID, "SELECT arena_team_member.arenateamid FROM arena_team_member JOIN arena_team ON arena_team_member.arenateamid = arena_team.arenateamid WHERE guid = ? AND type = ? LIMIT 1", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_MAIL, "SELECT id, messageType, sender, receiver, subject, body, has_items, expire_time, deliver_time, money, cod, checked, stationery, mailTemplateId FROM mail WHERE receiver = ? ORDER BY id DESC", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PLAYERBYTES2, "SELECT playerBytes2 FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PET_SPELL, "SELECT spell, active FROM pet_spell WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PET_SPELL_COOLDOWN, "SELECT spell, time FROM pet_spell_cooldown WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PET_DECLINED_NAME, "SELECT genitive, dative, accusative, instrumental, prepositional FROM character_pet_declinedname WHERE owner = ? AND id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_GUID_BY_NAME, "SELECT characters.guid FROM characters WHERE characters.name = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_DEL_CHAR_AURA_FROZEN, "DELETE FROM character_aura WHERE character_aura.spell = 9454 AND character_aura.guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM, "SELECT COUNT(itemEntry) FROM character_inventory ci INNER JOIN item_instance ii ON ii.guid = ci.item WHERE itemEntry = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_MAIL_COUNT_ITEM, "SELECT COUNT(itemEntry) FROM mail_items mi INNER JOIN item_instance ii ON ii.guid = mi.item_guid WHERE itemEntry = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_AUCTIONHOUSE_COUNT_ITEM,"SELECT COUNT(itemEntry) FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE itemEntry = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_GUILD_BANK_COUNT_ITEM, "SELECT COUNT(itemEntry) FROM guild_bank_item gbi INNER JOIN item_instance ii ON ii.guid = gbi.item_guid WHERE itemEntry = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_INVENTORY_ITEM_BY_ENTRY, "SELECT ci.item, cb.slot AS bag, ci.slot, ci.guid, c.account, c.name FROM characters c INNER JOIN character_inventory ci ON ci.guid = c.guid INNER JOIN item_instance ii ON ii.guid = ci.item LEFT JOIN character_inventory cb ON cb.item = ci.bag WHERE ii.itemEntry = ? LIMIT ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_MAIL_ITEMS_BY_ENTRY, "SELECT mi.item_guid, m.sender, m.receiver, cs.account, cs.name, cr.account, cr.name FROM mail m INNER JOIN mail_items mi ON mi.mail_id = m.id INNER JOIN item_instance ii ON ii.guid = mi.item_guid INNER JOIN characters cs ON cs.guid = m.sender INNER JOIN characters cr ON cr.guid = m.receiver WHERE ii.itemEntry = ? LIMIT ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_AUCTIONHOUSE_ITEM_BY_ENTRY, "SELECT ah.itemguid, ah.itemowner, c.account, c.name FROM auctionhouse ah INNER JOIN characters c ON c.guid = ah.itemowner INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE ii.itemEntry = ? LIMIT ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY, "SELECT gi.item_guid, gi.guildid, g.name FROM guild_bank_item gi INNER JOIN guild g ON g.guildid = gi.guildid INNER JOIN item_instance ii ON ii.guid = gi.item_guid WHERE ii.itemEntry = ? LIMIT ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND entry = ? AND (slot = ? OR slot > ?)", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND (slot = ? OR slot > ?) ", CONNECTION_SYNCH); } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 2f2aa2301d1..3752051716f 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -48,6 +48,7 @@ enum CharacterDatabaseStatements CHAR_DEL_EXPIRED_BANS, CHAR_SEL_GUID_BY_NAME, CHAR_SEL_CHECK_NAME, + CHAR_SEL_CHECK_GUID, CHAR_SEL_SUM_CHARS, CHAR_SEL_CHAR_CREATE_INFO, CHAR_INS_CHARACTER_BAN, @@ -64,6 +65,11 @@ enum CharacterDatabaseStatements CHAR_SEL_PET_SLOT_BY_ID, CHAR_SEL_FREE_NAME, CHAR_SEL_GUID_RACE_ACC_BY_NAME, + CHAR_SEL_CHAR_RACE, + CHAR_SEL_CHAR_LEVEL, + CHAR_SEL_CHAR_ZONE, + CHAR_SEL_CHAR_POSITION_XYZ, + CHAR_SEL_CHAR_POSITION, CHAR_DEL_QUEST_STATUS_DAILY, CHAR_DEL_QUEST_STATUS_WEEKLY, CHAR_DEL_QUEST_STATUS_SEASONAL, @@ -91,6 +97,7 @@ enum CharacterDatabaseStatements CHAR_SEL_CHARACTER_ACTIONS_SPEC, CHAR_SEL_CHARACTER_MAILCOUNT, CHAR_SEL_CHARACTER_MAILDATE, + CHAR_SEL_MAIL_COUNT, CHAR_SEL_CHARACTER_SOCIALLIST, CHAR_SEL_CHARACTER_HOMEBIND, CHAR_SEL_CHARACTER_SPELLCOOLDOWNS, @@ -112,6 +119,7 @@ enum CharacterDatabaseStatements CHAR_SEL_AUCTION_ITEMS, CHAR_INS_AUCTION, CHAR_DEL_AUCTION, + CHAR_SEL_AUCTION_BY_TIME, CHAR_SEL_AUCTIONS, CHAR_INS_MAIL, CHAR_DEL_MAIL, @@ -136,14 +144,18 @@ enum CharacterDatabaseStatements CHAR_DEL_ITEM_INSTANCE, CHAR_UPD_GIFT_OWNER, CHAR_DEL_GIFT, + CHAR_SEL_CHARACTER_GIFT_BY_ITEM, CHAR_SEL_ACCOUNT_BY_NAME, + CHAR_SEL_ACCOUNT_BY_GUID, CHAR_DEL_ACCOUNT_INSTANCE_LOCK_TIMES, CHAR_INS_ACCOUNT_INSTANCE_LOCK_TIMES, CHAR_SEL_CHARACTER_NAME_CLASS, + CHAR_SEL_CHARACTER_NAME, CHAR_SEL_MATCH_MAKER_RATING, CHAR_SEL_CHARACTER_COUNT, CHAR_UPD_NAME, CHAR_DEL_DECLINED_NAME, + CHAR_SEL_ACCOUNT_NAME_BY_GUID, CHAR_INS_GUILD, CHAR_DEL_GUILD, @@ -259,6 +271,13 @@ enum CharacterDatabaseStatements CHAR_SEL_PETITION_SIGNATURE, CHAR_DEL_ALL_PETITION_SIGNATURES, CHAR_DEL_PETITION_SIGNATURE, + CHAR_SEL_PETITION_BY_OWNER, + CHAR_SEL_PETITION_TYPE, + CHAR_SEL_PETITION_SIGNATURES, + CHAR_SEL_PETITION_SIG_BY_ACCOUNT, + CHAR_SEL_PETITION_OWNER_BY_GUID, + CHAR_SEL_PETITION_SIG_BY_GUID, + CHAR_SEL_PETITION_SIG_BY_GUID_TYPE, CHAR_INS_PLAYER_BGDATA, CHAR_DEL_PLAYER_BGDATA, @@ -350,6 +369,49 @@ enum CharacterDatabaseStatements CHAR_INS_LFG_DATA, CHAR_DEL_LFG_DATA, + CHAR_SEL_CHARACTER_AURA_FROZEN, + CHAR_SEL_CHARACTER_ONLINE, + + CHAR_SEL_CHAR_DEL_INFO_BY_GUID, + CHAR_SEL_CHAR_DEL_INFO_BY_NAME, + CHAR_SEL_CHAR_DEL_INFO, + + CHAR_SEL_CHARS_BY_ACCOUNT_ID, + CHAR_SEL_CHAR_PINFO, + CHAR_SEL_PINFO_BANS, + CHAR_SEL_CHAR_HOMEBIND, + CHAR_SEL_CHAR_GUID_NAME_BY_ACC, + CHAR_SEL_POOL_QUEST_SAVE, + CHAR_SEL_CHARACTER_AT_LOGIN, + CHAR_SEL_CHAR_CLASS_LVL_AT_LOGIN, + CHAR_SEL_INSTANCE, + CHAR_SEL_PET_SPELL_LIST, + CHAR_SEL_CHAR_PET, + CHAR_SEL_CHAR_PETS, + CHAR_SEL_CHAR_COD_ITEM_MAIL, + CHAR_SEL_CHAR_SOCIAL, + CHAR_SEL_PET_AURA, + CHAR_SEL_CHAR_OLD_CHARS, + CHAR_SEL_ARENA_TEAM_ID_BY_PLAYER_GUID, + CHAR_SEL_MAIL, + CHAR_SEL_CHAR_PLAYERBYTES2, + CHAR_SEL_PET_SPELL, + CHAR_SEL_PET_SPELL_COOLDOWN, + CHAR_SEL_PET_DECLINED_NAME, + CHAR_SEL_CHAR_GUID_BY_NAME, + CHAR_DEL_CHAR_AURA_FROZEN, + CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM, + CHAR_SEL_MAIL_COUNT_ITEM, + CHAR_SEL_AUCTIONHOUSE_COUNT_ITEM, + CHAR_SEL_GUILD_BANK_COUNT_ITEM, + CHAR_SEL_CHAR_INVENTORY_ITEM_BY_ENTRY, + CHAR_SEL_MAIL_ITEMS_BY_ENTRY, + CHAR_SEL_AUCTIONHOUSE_ITEM_BY_ENTRY, + CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY, + CHAR_SEL_CHAR_PET_BY_ENTRY, + CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, + CHAR_SEL_CHAR_PET_BY_SLOT, + MAX_CHARACTERDATABASE_STATEMENTS, }; diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp index 8ef8d3b48cf..ca7d4f95cfb 100755 --- a/src/server/shared/Database/Implementation/LoginDatabase.cpp +++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp @@ -27,7 +27,11 @@ void LoginDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(LOGIN_UPD_EXPIRED_ACCOUNT_BANS, "UPDATE account_banned SET active = 0 WHERE active = 1 AND unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_SEL_IP_BANNED, "SELECT * FROM ip_banned WHERE ip = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(LOGIN_INS_IP_AUTO_BANNED, "INSERT INTO ip_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban')", CONNECTION_ASYNC) + PREPARE_STATEMENT(LOGIN_SEL_IP_BANNED_ALL, "SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned WHERE (bandate = unbandate OR unbandate > UNIX_TIMESTAMP()) ORDER BY unbandate", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_IP_BANNED_BY_IP, "SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned WHERE (bandate = unbandate OR unbandate > UNIX_TIMESTAMP()) AND ip LIKE CONCAT('%%', ?, '%%') ORDER BY unbandate", CONNECTION_SYNCH); PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_BANNED, "SELECT bandate, unbandate FROM account_banned WHERE id = ? AND active = 1", CONNECTION_SYNCH) + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_BANNED_ALL, "SELECT account.id, username FROM account, account_banned WHERE account.id = account_banned.id AND active = 1 GROUP BY account.id", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME, "SELECT account.id, username FROM account, account_banned WHERE account.id = account_banned.id AND active = 1 AND username LIKE CONCAT('%%', ?, '%%') GROUP BY account.id", CONNECTION_SYNCH); PREPARE_STATEMENT(LOGIN_INS_ACCOUNT_AUTO_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban', 1)", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_SEL_SESSIONKEY, "SELECT a.sessionkey, a.id, aa.gmlevel FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE username = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(LOGIN_UPD_VS, "UPDATE account SET v = ?, s = ? WHERE username = ?", CONNECTION_ASYNC) @@ -36,8 +40,12 @@ void LoginDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(LOGIN_UPD_FAILEDLOGINS, "UPDATE account SET failed_logins = failed_logins + 1 WHERE username = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_SEL_FAILEDLOGINS, "SELECT id, failed_logins FROM account WHERE username = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_ID_BY_NAME, "SELECT id FROM account WHERE username = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_LIST_BY_NAME, "SELECT id, username FROM account WHERE username = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_INFO_BY_NAME, "SELECT id, sessionkey, last_ip, locked, v, s, expansion, mutetime, locale, recruiter, os FROM account WHERE username = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL, "SELECT id, username FROM account WHERE email = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(LOGIN_SEL_NUM_CHARS_ON_REALM, "SELECT numchars FROM realmcharacters WHERE realmid = ? AND acctid= ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_BY_IP, "SELECT id FROM account WHERE last_ip = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_BY_IP, "SELECT id, username FROM account WHERE last_ip = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_BY_ID, "SELECT 1 FROM account WHERE id = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(LOGIN_INS_IP_BANNED, "INSERT INTO ip_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_DEL_IP_NOT_BANNED, "DELETE FROM ip_banned WHERE ip = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_INS_ACCOUNT_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?, 1)", CONNECTION_ASYNC) @@ -62,4 +70,21 @@ void LoginDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(LOGIN_DEL_ACCOUNT_ACCESS, "DELETE FROM account_access WHERE id = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM, "DELETE FROM account_access WHERE id = ? AND (RealmID = ? OR RealmID = -1)", CONNECTION_ASYNC); PREPARE_STATEMENT(LOGIN_INS_ACCOUNT_ACCESS, "INSERT INTO account_access (id,gmlevel,RealmID) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(LOGIN_GET_ACCOUNT_ID_BY_USERNAME, "SELECT id FROM account WHERE username = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_GET_ACCOUNT_ACCESS_GMLEVEL, "SELECT gmlevel FROM account_access WHERE id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_GET_GMLEVEL_BY_REALMID, "SELECT gmlevel FROM account_access WHERE id = ? AND (RealmID = ? OR RealmID = -1)", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_GET_USERNAME_BY_ID, "SELECT username FROM account WHERE id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_CHECK_PASSWORD, "SELECT 1 FROM account WHERE id = ? AND sha_pass_hash = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_CHECK_PASSWORD_BY_NAME, "SELECT 1 FROM account WHERE username = ? AND sha_pass_hash = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_PINFO, "SELECT a.username, aa.gmlevel, a.email, a.last_ip, a.last_login, a.mutetime FROM account a LEFT JOIN account_access aa ON (a.id = aa.id AND (aa.RealmID = ? OR aa.RealmID = -1)) WHERE a.id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_PINFO_BANS, "SELECT unbandate, bandate = unbandate, bannedby, banreason FROM account_banned WHERE id = ? AND active ORDER BY bandate ASC LIMIT 1", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_GM_ACCOUNTS, "SELECT a.username, aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel >= ? AND (aa.realmid = -1 OR aa.realmid = ?)", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_INFO, "SELECT a.username, a.last_ip, aa.gmlevel, a.expansion FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_ACCESS_GMLEVEL_TEST, "SELECT 1 FROM account_access WHERE id = ? AND gmlevel > ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_ACCESS, "SELECT a.id, aa.gmlevel, aa.RealmID FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.username = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_RECRUITER, "SELECT 1 FROM account WHERE recruiter = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_BANS, "SELECT 1 FROM account_banned WHERE id = ? AND active = 1 UNION SELECT 1 FROM ip_banned WHERE ip = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_WHOIS, "SELECT username, email, last_ip FROM account WHERE id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_REALMLIST_SECURITY_LEVEL, "SELECT allowedSecurityLevel from realmlist WHERE id = ?", CONNECTION_SYNCH); + } diff --git a/src/server/shared/Database/Implementation/LoginDatabase.h b/src/server/shared/Database/Implementation/LoginDatabase.h index afb188020c7..2994c6bb07c 100755 --- a/src/server/shared/Database/Implementation/LoginDatabase.h +++ b/src/server/shared/Database/Implementation/LoginDatabase.h @@ -48,6 +48,8 @@ enum LoginDatabaseStatements LOGIN_SEL_IP_BANNED, LOGIN_INS_IP_AUTO_BANNED, LOGIN_SEL_ACCOUNT_BANNED, + LOGIN_SEL_ACCOUNT_BANNED_ALL, + LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME, LOGIN_INS_ACCOUNT_AUTO_BANNED, LOGIN_SEL_SESSIONKEY, LOGIN_UPD_VS, @@ -56,10 +58,16 @@ enum LoginDatabaseStatements LOGIN_UPD_FAILEDLOGINS, LOGIN_SEL_FAILEDLOGINS, LOGIN_SEL_ACCOUNT_ID_BY_NAME, + LOGIN_SEL_ACCOUNT_LIST_BY_NAME, + LOGIN_SEL_ACCOUNT_INFO_BY_NAME, + LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL, LOGIN_SEL_NUM_CHARS_ON_REALM, LOGIN_SEL_ACCOUNT_BY_IP, LOGIN_INS_IP_BANNED, LOGIN_DEL_IP_NOT_BANNED, + LOGIN_SEL_IP_BANNED_ALL, + LOGIN_SEL_IP_BANNED_BY_IP, + LOGIN_SEL_ACCOUNT_BY_ID, LOGIN_INS_ACCOUNT_BANNED, LOGIN_UPD_ACCOUNT_NOT_BANNED, LOGIN_DEL_REALM_CHARACTERS, @@ -82,6 +90,22 @@ enum LoginDatabaseStatements LOGIN_DEL_ACCOUNT_ACCESS, LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM, LOGIN_INS_ACCOUNT_ACCESS, + LOGIN_GET_ACCOUNT_ID_BY_USERNAME, + LOGIN_GET_ACCOUNT_ACCESS_GMLEVEL, + LOGIN_GET_GMLEVEL_BY_REALMID, + LOGIN_GET_USERNAME_BY_ID, + LOGIN_SEL_CHECK_PASSWORD, + LOGIN_SEL_CHECK_PASSWORD_BY_NAME, + LOGIN_SEL_PINFO, + LOGIN_SEL_PINFO_BANS, + LOGIN_SEL_GM_ACCOUNTS, + LOGIN_SEL_ACCOUNT_INFO, + LOGIN_SEL_ACCOUNT_ACCESS_GMLEVEL_TEST, + LOGIN_SEL_ACCOUNT_ACCESS, + LOGIN_SEL_ACCOUNT_RECRUITER, + LOGIN_SEL_BANS, + LOGIN_SEL_ACCOUNT_WHOIS, + LOGIN_SEL_REALMLIST_SECURITY_LEVEL, MAX_LOGINDATABASE_STATEMENTS, }; diff --git a/src/server/shared/Database/Implementation/WorldDatabase.cpp b/src/server/shared/Database/Implementation/WorldDatabase.cpp index d9338bec401..92393acbc35 100755 --- a/src/server/shared/Database/Implementation/WorldDatabase.cpp +++ b/src/server/shared/Database/Implementation/WorldDatabase.cpp @@ -36,6 +36,7 @@ void WorldDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(WORLD_DEL_GAME_TELE, "DELETE FROM game_tele WHERE name = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_INS_NPC_VENODR, "INSERT INTO npc_vendor (entry, item, maxcount, incrtime, extendedcost) VALUES(?, ?, ?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_DEL_NPC_VENDOR, "DELETE FROM npc_vendor WHERE entry = ? AND item = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_SEL_NPC_VENDOR_REF, "SELECT item, maxcount, incrtime, ExtendedCost FROM npc_vendor WHERE entry = ? ORDER BY slot ASC", CONNECTION_SYNCH); PREPARE_STATEMENT(WORLD_UPD_CREATURE_MOVEMENT_TYPE, "UPDATE creature SET MovementType = ? WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_CREATURE_FACTION, "UPDATE creature_template SET faction_A = ?, faction_H = ? WHERE entry = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_CREATURE_NPCFLAG, "UPDATE creature_template SET npcflag = ? WHERE entry = ?", CONNECTION_ASYNC); @@ -48,10 +49,23 @@ void WorldDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_DATA_POINT, "UPDATE waypoint_data SET point = point - 1 WHERE id = ? AND point > ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_DATA_POSITION, "UPDATE waypoint_data SET position_x = ?, position_y = ?, position_z = ? where id = ? AND point = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_DATA_WPGUID, "UPDATE waypoint_data SET wpguid = ? WHERE id = ? and point = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_UPD_ALL_WAYPOINT_DATA_WPGUID, "UPDATE waypoint_data SET wpguid = 0", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_DATA_MAX_ID, "SELECT MAX(id) FROM waypoint_data", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_DATA_MAX_POINT, "SELECT MAX(point) FROM waypoint_data WHERE id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_DATA_BY_ID, "SELECT point, position_x, position_y, position_z, orientation, move_flag, delay, action, action_chance FROM waypoint_data WHERE id = ? ORDER BY point", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_DATA_POS_BY_ID, "SELECT point, position_x, position_y, position_z FROM waypoint_data WHERE id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_DATA_POS_FIRST_BY_ID, "SELECT position_x, position_y, position_z FROM waypoint_data WHERE point = 1 AND id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_DATA_POS_LAST_BY_ID, "SELECT position_x, position_y, position_z, orientation FROM waypoint_data WHERE id = ? ORDER BY point DESC LIMIT 1", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_DATA_BY_WPGUID, "SELECT id, point FROM waypoint_data WHERE wpguid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_DATA_ALL_BY_WPGUID, "SELECT id, point, delay, move_flag, action, action_chance FROM waypoint_data WHERE wpguid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_DATA_ALL_WPGUID, "UPDATE waypoint_data SET wpguid = 0", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_DATA_BY_POS, "SELECT id, point FROM waypoint_data WHERE (abs(position_x - ?) <= ?) and (abs(position_y - ?) <= ?) and (abs(position_z - ?) <= ?)", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_DATA_WPGUID_BY_ID, "SELECT wpguid FROM waypoint_data WHERE id = ? and wpguid <> 0", CONNECTION_SYNCH); + PREPARE_STATEMENT(WOLRD_SEL_WAYPOINT_DATA_ACTION, "SELECT DISTINCT action FROM waypoint_data", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_SCRIPTS_MAX_ID, "SELECT MAX(guid) FROM waypoint_scripts", CONNECTION_SYNCH); PREPARE_STATEMENT(WORLD_INS_CREATURE_ADDON, "INSERT INTO creature_addon(guid, path_id) VALUES (?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_CREATURE_ADDON_PATH, "UPDATE creature_addon SET path_id = ? WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_DEL_CREATURE_ADDON, "DELETE FROM creature_addon WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_SEL_CREATURE_ADDON_BY_GUID, "SELECT guid FROM creature_addon WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(WORLD_INS_WAYPOINT_SCRIPT, "INSERT INTO waypoint_scripts (guid) VALUES (?)", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_DEL_WAYPOINT_SCRIPT, "DELETE FROM waypoint_scripts WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_SCRIPT_ID, "UPDATE waypoint_scripts SET id = ? WHERE guid = ?", CONNECTION_ASYNC); @@ -59,7 +73,15 @@ void WorldDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_SCRIPT_Y, "UPDATE waypoint_scripts SET y = ? WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_SCRIPT_Z, "UPDATE waypoint_scripts SET z = ? WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_SCRIPT_O, "UPDATE waypoint_scripts SET o = ? WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_SCRIPT_ID_BY_GUID, "SELECT id FROM waypoint_scripts WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(WORLD_DEL_CREATURE, "DELETE FROM creature WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_INS_CREATURE_TRANSPORT, "INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_CREATURE_TRANSPORT_EMOTE, "UPDATE creature_transport SET emote = ? WHERE transport_entry = ? AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_SEL_COMMANDS, "SELECT name, security, help FROM command", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_CREATURE_TEMPLATE, "SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_SCRIPT_BY_ID, "SELECT guid, delay, command, datalong, datalong2, dataint, x, y, z, o FROM waypoint_scripts WHERE id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_IP2NATION_COUNTRY, "SELECT c.country FROM ip2nationCountries c, ip2nation i WHERE i.ip < ? AND c.code = i.country ORDER BY i.ip DESC LIMIT 0,1", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_ITEM_TEMPLATE_BY_NAME, "SELECT entry FROM item_template WHERE name = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_CREATURE_BY_ID, "SELECT guid FROM creature WHERE id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_GAMEOBJECT_NEAREST, "SELECT guid, id, position_x, position_y, position_z, map, (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) AS order_ FROM gameobject WHERE map = ? AND (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) <= ? ORDER BY order_", CONNECTION_SYNCH); } diff --git a/src/server/shared/Database/Implementation/WorldDatabase.h b/src/server/shared/Database/Implementation/WorldDatabase.h index 1d7cd1151e5..9b019306891 100755 --- a/src/server/shared/Database/Implementation/WorldDatabase.h +++ b/src/server/shared/Database/Implementation/WorldDatabase.h @@ -56,6 +56,7 @@ enum WorldDatabaseStatements WORLD_DEL_GAME_TELE, WORLD_INS_NPC_VENODR, WORLD_DEL_NPC_VENDOR, + WORLD_SEL_NPC_VENDOR_REF, WORLD_UPD_CREATURE_MOVEMENT_TYPE, WORLD_UPD_CREATURE_FACTION, WORLD_UPD_CREATURE_NPCFLAG, @@ -68,10 +69,23 @@ enum WorldDatabaseStatements WORLD_UPD_WAYPOINT_DATA_POINT, WORLD_UPD_WAYPOINT_DATA_POSITION, WORLD_UPD_WAYPOINT_DATA_WPGUID, - WORLD_UPD_ALL_WAYPOINT_DATA_WPGUID, + WORLD_UPD_WAYPOINT_DATA_ALL_WPGUID, + WORLD_SEL_WAYPOINT_DATA_MAX_ID, + WORLD_SEL_WAYPOINT_DATA_BY_ID, + WORLD_SEL_WAYPOINT_DATA_POS_BY_ID, + WORLD_SEL_WAYPOINT_DATA_POS_FIRST_BY_ID, + WORLD_SEL_WAYPOINT_DATA_POS_LAST_BY_ID, + WORLD_SEL_WAYPOINT_DATA_BY_WPGUID, + WORLD_SEL_WAYPOINT_DATA_ALL_BY_WPGUID, + WORLD_SEL_WAYPOINT_DATA_MAX_POINT, + WORLD_SEL_WAYPOINT_DATA_BY_POS, + WORLD_SEL_WAYPOINT_DATA_WPGUID_BY_ID, + WOLRD_SEL_WAYPOINT_DATA_ACTION, + WORLD_SEL_WAYPOINT_SCRIPTS_MAX_ID, WORLD_UPD_CREATURE_ADDON_PATH, WORLD_INS_CREATURE_ADDON, WORLD_DEL_CREATURE_ADDON, + WORLD_SEL_CREATURE_ADDON_BY_GUID, WORLD_INS_WAYPOINT_SCRIPT, WORLD_DEL_WAYPOINT_SCRIPT, WORLD_UPD_WAYPOINT_SCRIPT_ID, @@ -79,9 +93,18 @@ enum WorldDatabaseStatements WORLD_UPD_WAYPOINT_SCRIPT_Y, WORLD_UPD_WAYPOINT_SCRIPT_Z, WORLD_UPD_WAYPOINT_SCRIPT_O, + WORLD_SEL_WAYPOINT_SCRIPT_ID_BY_GUID, WORLD_DEL_CREATURE, WORLD_INS_CREATURE_TRANSPORT, WORLD_UPD_CREATURE_TRANSPORT_EMOTE, + WORLD_SEL_COMMANDS, + WORLD_SEL_CREATURE_TEMPLATE, + WORLD_SEL_WAYPOINT_SCRIPT_BY_ID, + WORLD_SEL_IP2NATION_COUNTRY, + WORLD_SEL_ITEM_TEMPLATE_BY_NAME, + WORLD_SEL_CREATURE_BY_ID, + WORLD_SEL_GAMEOBJECT_NEAREST, + WORLD_SEL_GAMEOBJECT_TARGET, MAX_WORLDDATABASE_STATEMENTS, }; diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp index 8e04a9c2f34..0721515ea73 100755 --- a/src/server/worldserver/CommandLine/CliRunnable.cpp +++ b/src/server/worldserver/CommandLine/CliRunnable.cpp @@ -125,29 +125,44 @@ void commandFinished(void*, bool /*success*/) */ bool ChatHandler::GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::string searchString) { - QueryResult resultChar; + PreparedQueryResult result; + PreparedStatement* stmt; if (!searchString.empty()) { // search by GUID if (isNumeric(searchString.c_str())) - resultChar = CharacterDatabase.PQuery("SELECT guid, deleteInfos_Name, deleteInfos_Account, deleteDate FROM characters WHERE deleteDate IS NOT NULL AND guid = %u", uint64(atoi(searchString.c_str()))); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_GUID); + + stmt->setUInt32(0, uint32(atoi(searchString.c_str()))); + + result = CharacterDatabase.Query(stmt); + } // search by name else { if (!normalizePlayerName(searchString)) return false; - resultChar = CharacterDatabase.PQuery("SELECT guid, deleteInfos_Name, deleteInfos_Account, deleteDate FROM characters WHERE deleteDate IS NOT NULL AND deleteInfos_Name " _LIKE_ " " _CONCAT3_("'%%'", "'%s'", "'%%'"), searchString.c_str()); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_NAME); + + stmt->setString(0, searchString); + + result = CharacterDatabase.Query(stmt); } } else - resultChar = CharacterDatabase.Query("SELECT guid, deleteInfos_Name, deleteInfos_Account, deleteDate FROM characters WHERE deleteDate IS NOT NULL"); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO); - if (resultChar) + result = CharacterDatabase.Query(stmt); + } + + if (result) { do { - Field* fields = resultChar->Fetch(); + Field* fields = result->Fetch(); DeletedInfo info; @@ -161,7 +176,7 @@ bool ChatHandler::GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::s info.deleteDate = time_t(fields[3].GetUInt32()); foundList.push_back(info); - } while (resultChar->NextRow()); + } while (result->NextRow()); } return true; diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp index e5637d282c6..d7b366a2e2a 100755 --- a/src/server/worldserver/RemoteAccess/RASocket.cpp +++ b/src/server/worldserver/RemoteAccess/RASocket.cpp @@ -174,12 +174,15 @@ int RASocket::process_command(const std::string& command) int RASocket::check_access_level(const std::string& user) { - std::string safe_user = user; + std::string safeUser = user; - AccountMgr::normalizeString(safe_user); - LoginDatabase.EscapeString(safe_user); + AccountMgr::normalizeString(safeUser); - QueryResult result = LoginDatabase.PQuery("SELECT a.id, aa.gmlevel, aa.RealmID FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.username = '%s'", safe_user.c_str()); + + + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ACCESS); + stmt->setString(0, safeUser); + PreparedQueryResult result = LoginDatabase.Query(stmt); if (!result) { @@ -207,19 +210,20 @@ int RASocket::check_password(const std::string& user, const std::string& pass) { std::string safe_user = user; AccountMgr::normalizeString(safe_user); - LoginDatabase.EscapeString(safe_user); std::string safe_pass = pass; AccountMgr::normalizeString(safe_pass); - LoginDatabase.EscapeString(safe_pass); std::string hash = AccountMgr::CalculateShaPassHash(safe_user, safe_pass); - QueryResult check = LoginDatabase.PQuery( - "SELECT 1 FROM account WHERE username = '%s' AND sha_pass_hash = '%s'", - safe_user.c_str(), hash.c_str()); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_CHECK_PASSWORD_BY_NAME); - if (!check) + stmt->setString(0, safe_user); + stmt->setString(1, hash); + + PreparedQueryResult result = LoginDatabase.Query(stmt); + + if (!result) { sLog->outRemote("Wrong password for user: %s", user.c_str()); return -1; From ecbe34cdd2d2c5958dda86fba5a36bef1871f6d3 Mon Sep 17 00:00:00 2001 From: leak Date: Sat, 24 Mar 2012 01:56:40 +0100 Subject: [PATCH 0245/1149] Core/Warden: Fix warning --- src/server/game/Warden/Warden.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Warden/Warden.cpp b/src/server/game/Warden/Warden.cpp index f2fe3c4ad67..fa30adde72a 100644 --- a/src/server/game/Warden/Warden.cpp +++ b/src/server/game/Warden/Warden.cpp @@ -193,9 +193,9 @@ std::string Warden::Penalty(WardenCheck* check /*= NULL*/) break; } default: - return "Undefined"; break; } + return "Undefined"; } void WorldSession::HandleWardenDataOpcode(WorldPacket& recvData) From 5a73149565ac1cf1ff6c545125e978fbde6440f9 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 24 Mar 2012 04:05:37 +0000 Subject: [PATCH 0246/1149] Core/DBLayer: Fix a typo in a field type/size - npc_vendor Closes #5863 --- src/server/game/Globals/ObjectMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index b4d8d36afb0..19f897fece3 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -8230,7 +8230,7 @@ int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set *s count += LoadReferenceVendor(vendor, -item_id, skip_vendors); else { - int32 maxcount = fields[1].GetInt32(); + int32 maxcount = fields[1].GetUInt8(); // tinyint(3) unsigned uint32 incrtime = fields[2].GetUInt32(); uint32 ExtendedCost = fields[3].GetUInt32(); From dae82111b7ff621445c96ab9d3775aae51b9fd26 Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Sat, 24 Mar 2012 13:24:24 +0200 Subject: [PATCH 0247/1149] Scripts/Ahn'kahet/Prince Taldaram: Fix movement after shield drops.(no more LoS issues) Update boss texts and move them to creature_text. Add proper sounds to text. Add condition for a visual spell. Add usage of different Embrace of the Vampyr spell based on difficulty. --- .../world/2012_03_24_00_world_misc.sql | 22 +++++++++ .../Ahnkahet/boss_prince_taldaram.cpp | 45 ++++++++++--------- 2 files changed, 46 insertions(+), 21 deletions(-) create mode 100644 sql/updates/world/2012_03_24_00_world_misc.sql diff --git a/sql/updates/world/2012_03_24_00_world_misc.sql b/sql/updates/world/2012_03_24_00_world_misc.sql new file mode 100644 index 00000000000..e6f6ce77307 --- /dev/null +++ b/sql/updates/world/2012_03_24_00_world_misc.sql @@ -0,0 +1,22 @@ +-- Beam Visual +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=60342; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,60342,0,0,31,0,3,29308,0,0,0,'','Beam Visual target Prince Taldaram'); + +-- script texts for Prince Taldaram +DELETE FROM `creature_text` WHERE `entry`=29308; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(29308,0,0,'The hum of magic energy in the air diminishes...',16,0,100,0,0,0,'prince taldaram SAY_1'), +(29308,1,0,'Intruders! Who trespasses in the Old Kingdom?',14,0,100,0,0,0,'prince taldaram SAY_WARNING'), +(29308,2,0,'I will feast on your remains.',14,0,100,0,0,14360,'prince taldaram SAY_AGGRO'), +(29308,3,0,'',14,10,100,0,0,14365,'prince taldaram SAY_SLAY_0'), +(29308,3,1,'I will drink no blood before it''s time.',14,0,100,0,0,14366,'prince taldaram SAY_SLAY_1'), +(29308,3,2,'One final embrace.',14,0,100,0,0,14367,'prince taldaram SAY_SLAY_2'), +(29308,4,0,'Still I hunger. Still... I... thirst.',14,0,100,0,0,14368,'prince taldaram SAY_DEATH'), +(29308,5,0,'So... appetizing.',14,0,100,0,0,14363,'prince taldaram SAY_FEED1'), +(29308,5,1,'Fresh, warm blood. It has been too long.',14,0,100,0,0,14364,'prince taldaram SAY_FEED2'), +(29308,6,0,'Your heartbeat is... music to my ears.',14,0,100,0,0,14361,'prince taldaram SAY_VANISH1'), +(29308,6,1,'I am nowhere... I am everywhere. I am the watcher, unseen.',14,0,100,0,0,14362,'prince taldaram SAY_VANISH2'); + +-- cleanup +DELETE FROM `script_texts` WHERE `npc_entry`=29308; diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp index 38879364d83..6a0ccc54773 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp @@ -36,7 +36,8 @@ enum Spells SPELL_VANISH = 55964, CREATURE_FLAME_SPHERE = 30106, H_CREATURE_FLAME_SPHERE_1 = 31686, - H_CREATURE_FLAME_SPHERE_2 = 31687 + H_CREATURE_FLAME_SPHERE_2 = 31687, + SPELL_HOVER_FALL = 60425 }; enum Misc { @@ -45,18 +46,17 @@ enum Misc DATA_SPHERE_DISTANCE = 15 }; #define DATA_SPHERE_ANGLE_OFFSET 0.7f -#define DATA_GROUND_POSITION_Z 11.4f +#define DATA_GROUND_POSITION_Z 11.30809f enum Yells { - SAY_AGGRO = -1619021, - SAY_SLAY_1 = -1619022, - SAY_SLAY_2 = -1619023, - SAY_DEATH = -1619024, - SAY_FEED_1 = -1619025, - SAY_FEED_2 = -1619026, - SAY_VANISH_1 = -1619027, - SAY_VANISH_2 = -1619028 + SAY_1 = 0, + SAY_WARNING = 1, + SAY_AGGRO = 2, + SAY_SLAY = 3, + SAY_DEATH = 4, + SAY_FEED = 5, + SAY_VANISH = 6, }; enum CombatPhase { @@ -82,8 +82,7 @@ public: boss_taldaramAI(Creature* creature) : ScriptedAI(creature) { instance = creature->GetInstanceScript(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetDisableGravity(true); } uint32 uiBloodthirstTimer; @@ -118,7 +117,7 @@ public: { if (instance) instance->SetData(DATA_PRINCE_TALDARAM_EVENT, IN_PROGRESS); - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); } void UpdateAI(const uint32 diff) @@ -180,7 +179,8 @@ public: break; case VANISHED: if (Unit* pEmbraceTarget = GetEmbraceTarget()) - DoCast(pEmbraceTarget, SPELL_EMBRACE_OF_THE_VAMPYR); + DoCast(pEmbraceTarget, DUNGEON_MODE(SPELL_EMBRACE_OF_THE_VAMPYR, H_SPELL_EMBRACE_OF_THE_VAMPYR)); + Talk(SAY_FEED); me->GetMotionMaster()->Clear(); me->SetSpeed(MOVE_WALK, 1.0f, true); me->GetMotionMaster()->MoveChase(me->getVictim()); @@ -202,7 +202,7 @@ public: if (uiFlamesphereTimer <= diff) { // because TARGET_UNIT_TARGET_ENEMY we need a target selected to cast - DoCast(me->getVictim(), SPELL_CONJURE_FLAME_SPHERE); + DoCastVictim(SPELL_CONJURE_FLAME_SPHERE); Phase = CASTING_FLAME_SPHERES; uiPhaseTimer = 3*IN_MILLISECONDS + diff; uiFlamesphereTimer = 15*IN_MILLISECONDS; @@ -225,7 +225,7 @@ public: //He only vanishes if there are 3 or more alive players if (target_list.size() > 2) { - DoScriptText(RAND(SAY_VANISH_1, SAY_VANISH_2), me); + Talk(SAY_VANISH); DoCast(me, SPELL_VANISH); Phase = JUST_VANISHED; uiPhaseTimer = 500; @@ -261,7 +261,7 @@ public: void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); if (instance) instance->SetData(DATA_PRINCE_TALDARAM_EVENT, DONE); @@ -279,7 +279,7 @@ public: uiPhaseTimer = 0; uiEmbraceTarget = 0; } - DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); + Talk(SAY_SLAY); } bool CheckSpheres() @@ -315,12 +315,13 @@ public: { if (!instance) return; - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveAurasDueToSpell(SPELL_BEAM_VISUAL); - me->SetUnitMovementFlags(MOVEMENTFLAG_WALKING); me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), DATA_GROUND_POSITION_Z, me->GetOrientation()); + DoCast(SPELL_HOVER_FALL); + me->SetDisableGravity(false); + me->GetMotionMaster()->MovePoint(0, me->GetHomePosition()); + Talk(SAY_WARNING); uint64 prison_GUID = instance->GetData64(DATA_PRINCE_TALDARAM_PLATFORM); instance->HandleGameObject(prison_GUID, true); } @@ -405,10 +406,12 @@ public: { case GO_SPHERE1: instance->SetData(DATA_SPHERE1_EVENT, IN_PROGRESS); + pPrinceTaldaram->AI()->Talk(SAY_1); break; case GO_SPHERE2: instance->SetData(DATA_SPHERE2_EVENT, IN_PROGRESS); + pPrinceTaldaram->AI()->Talk(SAY_1); break; } From 7c4b2f17bf75f685ace2490321f8df8f4ecc8682 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sat, 24 Mar 2012 12:55:44 +0100 Subject: [PATCH 0248/1149] DB/Loot: Update Loot for first 4 bosses in Ulduar --- ..._03_24_01_world_creature_loot_template.sql | 290 ++++++++++++++++++ 1 file changed, 290 insertions(+) create mode 100644 sql/updates/world/2012_03_24_01_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_03_24_01_world_creature_loot_template.sql b/sql/updates/world/2012_03_24_01_world_creature_loot_template.sql new file mode 100644 index 00000000000..078c48a47b7 --- /dev/null +++ b/sql/updates/world/2012_03_24_01_world_creature_loot_template.sql @@ -0,0 +1,290 @@ +-- ----------------------------------- +-- -- Loot for The Siege of Ulduar -- +-- ----------------------------------- + +-- Old Cleanups: +DELETE FROM `reference_loot_template` WHERE `entry` IN ( 34116,34117,34118,34119,34120,34121,34157,34158,34159,34160,34161,34162); +-- ------------------- +-- -- Set Variables -- +-- ------------------- +-- 10 man mode npcids +SET @FlameLevi10 :=33113; +SET @IgnisFM10 :=33118; +SET @Razorscale10 :=33186; +SET @XT002_10 :=33293; +-- 25 man mode npcids (via procedure) +call `sp_get_npc_diffentry`(@FlameLevi10,1,@FlameLevi25); +call `sp_get_npc_diffentry`(@IgnisFM10,1,@IgnisFM25); +call `sp_get_npc_diffentry`(@Razorscale10,1,@Razorscale25); +call `sp_get_npc_diffentry`(@XT002_10,1,@XT002_25); + +SET @Emblem := 47241; +SET @Orb := 45087; +-- ------------------------------------- +-- -- Set Reference Loot Template ids -- +-- ------------------------------------- + +SET @EmblemRef := 34349; -- First Free ID +SET @OrbRef := @EmblemRef+1; +SET @Flame10Ref := @EmblemRef+2; +SET @Flame25Ref := @EmblemRef+3; +SET @Ignis10Ref := @EmblemRef+4; +SET @Ignis25Ref := @EmblemRef+5; +SET @Razor10Ref := @EmblemRef+6; +SET @Razor25Ref := @EmblemRef+7; +SET @XT002_10Ref := @EmblemRef+8; +SET @XT002_25Ref := @EmblemRef+9; +-- Flame Levithian +DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN @EmblemRef AND @EmblemRef+9; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Emblem Ref +(@EmblemRef,47241,0,1,1,1,1), -- Emblem of Triumph 1x +-- OrbRef +(@OrbRef,45087,0,1,1,1,1), -- Runed Orb 1x +-- Flame Levithian 10man +(@Flame10Ref,45286,0,1,1,1,1), -- Pyrite Infuser +(@Flame10Ref,45287,0,1,1,1,1), -- Firesoul +(@Flame10Ref,45288,0,1,1,1,1), -- Firestrider Chestguard +(@Flame10Ref,45289,0,1,1,1,1), -- Lifespark Visage +(@Flame10Ref,45291,0,1,1,1,1), -- Combustion Bracers +(@Flame10Ref,45284,0,1,1,1,1), -- Kinetic Ripper +(@Flame10Ref,45282,0,1,1,1,1), -- Ironsoul +(@Flame10Ref,45285,0,1,1,1,1), -- Might of the Leviathan +(@Flame10Ref,45292,0,1,1,1,1), -- Energy Siphon +(@Flame10Ref,45283,0,1,1,1,1), -- Flamewatch Armguards +-- Flame Levithian 25man +(@Flame25Ref,45117,0,1,1,1,1), -- Constructors Handwraps +(@Flame25Ref,45119,0,1,1,1,1), -- Embrace of the Leviathan +(@Flame25Ref,45113,0,1,1,1,1), -- Glowing Ring of Reclamation +(@Flame25Ref,45115,0,1,1,1,1), -- Leviathan Fueling Manual +(@Flame25Ref,45108,0,1,1,1,1), -- Mechanists Bindings +(@Flame25Ref,45106,0,1,1,1,1), -- Strenght of the Automaton +(@Flame25Ref,45109,0,1,1,1,1), -- Gloves of the Fiery Behemoth +(@Flame25Ref,45114,0,1,1,1,1), -- Steamcallers Totem +(@Flame25Ref,45118,0,1,1,1,1), -- Steamworkers Goggles +(@Flame25Ref,45116,0,1,1,1,1), -- Freya's Choker of Warding +(@Flame25Ref,45111,0,1,1,1,1), -- Mimiron's Inferno Couplings +(@Flame25Ref,45112,0,1,1,1,1), -- The Leviathan's Coil +(@Flame25Ref,45107,0,1,1,1,1), -- Iron Riveted War Helm + +-- Ignis the Furnace Master 10man +(@Ignis10Ref,45309,0,1,1,1,1), -- Rifle of the Platinum Guard +(@Ignis10Ref,45310,0,1,1,1,1), -- Gauntlets of the Iron Furnace +(@Ignis10Ref,45311,0,1,1,1,1), -- Relentless Edge +(@Ignis10Ref,45312,0,1,1,1,1), -- Gloves of Smoldering Touch +(@Ignis10Ref,45313,0,1,1,1,1), -- Furnace Stone +(@Ignis10Ref,45314,0,1,1,1,1), -- Igniter Rod +(@Ignis10Ref,45316,0,1,1,1,1), -- Armbraces of the Vibrant Flame +(@Ignis10Ref,45317,0,1,1,1,1), -- Shawl of the Caretaker +(@Ignis10Ref,45318,0,1,1,1,1), -- Drape of Fuming Anger +(@Ignis10Ref,45321,0,1,1,1,1), -- Pauldrons of Tempered Will +-- Ignis the Furnace Master 25man +(@Ignis25Ref,45157,0,1,1,1,1), -- Cindershard Ring +(@Ignis25Ref,45158,0,1,1,1,1), -- Heart of Iron +(@Ignis25Ref,45161,0,1,1,1,1), -- Girdle of Embers +(@Ignis25Ref,45162,0,1,1,1,1), -- Flamestalker Boots +(@Ignis25Ref,45164,0,1,1,1,1), -- Helm of the Furnace Master +(@Ignis25Ref,45165,0,1,1,1,1), -- Worldcarver +(@Ignis25Ref,45166,0,1,1,1,1), -- Charred Saronite Greaves +(@Ignis25Ref,45167,0,1,1,1,1), -- Lifeforge Breastplate +(@Ignis25Ref,45168,0,1,1,1,1), -- Pyrelight Circle +(@Ignis25Ref,45169,0,1,1,1,1), -- Totem of the Dancing Flame +(@Ignis25Ref,45170,0,1,1,1,1), -- Scepter of Creation +(@Ignis25Ref,45171,0,1,1,1,1), -- Intensity +(@Ignis25Ref,45185,0,1,1,1,1), -- Flamewrought Cinch +(@Ignis25Ref,45186,0,1,1,1,1), -- Soot-Covered Mantle +(@Ignis25Ref,45187,0,1,1,1,1), -- Wristguards of the Firetender + +-- Razorscale 10man +(@Razor10Ref,45298,0,1,1,1,1), -- RazoRazorcale Talon +(@Razor10Ref,45299,0,1,1,1,1), -- Dragonsteel Faceplate +(@Razor10Ref,45301,0,1,1,1,1), -- BraceRazor of the Smothering Inferno +(@Razor10Ref,45302,0,1,1,1,1), -- Treads of the Invader +(@Razor10Ref,45303,0,1,1,1,1), -- Band of Draconic Guile +(@Razor10Ref,45304,0,1,1,1,1), -- Stormtempered Girdle +(@Razor10Ref,45305,0,1,1,1,1), -- Breastplate of the Afterlife +(@Razor10Ref,45306,0,1,1,1,1), -- Binding of the Dragon Matriarch +(@Razor10Ref,45307,0,1,1,1,1), -- Ironscale Leggings +(@Razor10Ref,45308,0,1,1,1,1), -- Eye of the Broodmother +-- Razorscale 25man +(@Razor25Ref,45137,0,1,1,1,1), -- Veranus' Bane +(@Razor25Ref,45138,0,1,1,1,1), -- Drape of the Drakerider +(@Razor25Ref,45139,0,1,1,1,1), -- Dragonslayer's Brace +(@Razor25Ref,45140,0,1,1,1,1), -- RazoRazorcale Shoulderguards +(@Razor25Ref,45141,0,1,1,1,1), -- Proto-hide Leggings +(@Razor25Ref,45142,0,1,1,1,1), -- RemoRazore +(@Razor25Ref,45143,0,1,1,1,1), -- Saronite Mesh Legguards +(@Razor25Ref,45144,0,1,1,1,1), -- Sigil of Deflection +(@Razor25Ref,45146,0,1,1,1,1), -- Shackles of the Odalisque +(@Razor25Ref,45147,0,1,1,1,1), -- Guiding Star +(@Razor25Ref,45148,0,1,1,1,1), -- Living Flame +(@Razor25Ref,45149,0,1,1,1,1), -- BraceRazor of the Broodmother +(@Razor25Ref,45150,0,1,1,1,1), -- Collar of the Wyrmhunter +(@Razor25Ref,45151,0,1,1,1,1), -- Belt of the Fallen Wyrm +(@Razor25Ref,45510,0,1,1,1,1), -- Libram of Discord + +-- XT-002 Deconstructor 10man +(@XT002_10Ref,45675,0,1,1,1,1), -- Power Enchancing Loop +(@XT002_10Ref,45676,0,1,1,1,1), -- Chestplate of Vicious Potency +(@XT002_10Ref,45677,0,1,1,1,1), -- Treacherous shoulderpads +(@XT002_10Ref,45679,0,1,1,1,1), -- Gloves of Taut grip +(@XT002_10Ref,45680,0,1,1,1,1), -- Armbands of the construct +(@XT002_10Ref,45682,0,1,1,1,1), -- Pulsing spellshield +(@XT002_10Ref,45685,0,1,1,1,1), -- Plasma Foil +(@XT002_10Ref,45686,0,1,1,1,1), -- Vest of the glowing Cresent +(@XT002_10Ref,45687,0,1,1,1,1), -- Helm of Veiled Energies +(@XT002_10Ref,45694,0,1,1,1,1), -- Conductive cord +(@XT002_10Ref,45867,0,2,2,1,1), -- Breasktplate of the Stoneshaper +(@XT002_10Ref,45868,0,2,2,1,1), -- Aesir's Edge +(@XT002_10Ref,45869,0,2,2,1,1), -- Fluxing Energy Coils +(@XT002_10Ref,45870,0,2,2,1,1), -- Magnetized Projectile Emitter +(@XT002_10Ref,45871,0,2,2,1,1), -- Seal of Ulduar +-- XT-002 Deconstructor 25man +(@XT002_25Ref,45254,0,1,1,1,1), -- Sigil of the Vengeful Heart +(@XT002_25Ref,45251,0,1,1,1,1), -- Shoulderplates of the Deconstructor +(@XT002_25Ref,45247,0,1,1,1,1), -- Signet of the Earthshaker +(@XT002_25Ref,45256,0,1,1,1,1), -- Twisted Visage +(@XT002_25Ref,45250,0,1,1,1,1), -- Crazed Construct Ring +(@XT002_25Ref,45257,0,1,1,1,1), -- Quartz Crystal Wand +(@XT002_25Ref,45260,0,1,1,1,1), -- Boots of Hasty Revival +(@XT002_25Ref,45252,0,1,1,1,1), -- Horologist's Wristguards +(@XT002_25Ref,45253,0,1,1,1,1), -- Mantle of Wavering Calm +(@XT002_25Ref,45258,0,1,1,1,1), -- Sandals of Rash Temperament +(@XT002_25Ref,45249,0,1,1,1,1), -- Brass-lined Boots +(@XT002_25Ref,45246,0,1,1,1,1), -- Golem-Shard Sticker +(@XT002_25Ref,45248,0,1,1,1,1), -- Clockwork Legplates +(@XT002_25Ref,45259,0,1,1,1,1), -- Quartz-studded Harness +(@XT002_25Ref,45255,0,1,1,1,1); -- Thunderfall Totem +-- ----------------------------------------------------------------------------------------------- +-- -- END OF REFERENCES -- -- END OF REFERENCES -- -- END OF REFERENCES -- -- END OF REFERENCES -- +-- -- END OF REFERENCES -- -- END OF REFERENCES -- -- END OF REFERENCES -- -- END OF REFERENCES -- +-- -- END OF REFERENCES -- -- END OF REFERENCES -- -- END OF REFERENCES -- -- END OF REFERENCES -- +-- ----------------------------------------------------------------------------------------------- + +-- Flame Levithian 10Man: +-- NORMAL MODE : 2x [Normal Loot Item] + 1x [Emblem of Valor] +-- ONE TOWER : 2x [Normal Loot Item] + 2x [Emblem of Conquest] + CHANCE TO [Recipe] +-- TWO TOWERS : 2x [Normal Loot Item] + 2x [Emblem of Conquest] + 1x [Runed Orb] + CHANCE TO [Recipe] +-- THREE TOWERS: 2x [Normal Loot Item] + 3x [Emblem of Conquest] + 1x [Runed Orb] + CHANCE TO [Recipe] + 1x [Recipe] +-- FOUR TOWERS : 2x [Normal Loot Item] + 3x [Emblem of Conquest] + 1x [Runed Orb] + CHANCE TO [Recipe] + 1x [Recipe] + 1x [Hard Loot Item] +-- Flame Levithian 25 man +-- NORMAL MODE : 3x [Normal Loot Item] + 1x [Emblem of Conquest] + CHANCE TO [Runed Orb] + CHANCE TO [Recipe] +-- ONE TOWER : 3x [Normal Loot Item] + 2x [Emblem of Conquest] + CHANCE TO [Runed Orb] + CHANCE TO [Recipe] +-- TWO TOWERS : 3x [Normal Loot Item] + 2x [Emblem of Conquest] + CHANCE TO [Runed Orb] + CHANCE TO [Recipe] + 2x [Runed Orb] +-- THREE TOWERS: 3x [Normal Loot Item] + 3x [Emblem of Conquest] + CHANCE TO [Runed Orb] + CHANCE TO [Recipe] + 2x [Runed Orb] + [Recipe] +-- FOUR TOWERS : 3x [Normal Loot Item] + 3x [Emblem of Conquest] + CHANCE TO [Runed Orb] + CHANCE TO [Recipe] + 2x [Runed Orb] + [Recipe] + 1x [Hard Loot Item] + +DELETE FROM `creature_loot_template` WHERE `entry` IN (@FlameLevi10,@FlameLevi25,@IgnisFM10,@IgnisFM25,@Razorscale10,@Razorscale25,@XT002_10,@XT002_25); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- --------------------------- +-- -- Flame Levithian 10man -- +-- --------------------------- +(@FlameLevi10,1,100,1,0,-@EmblemRef,1), -- 1x emblem +(@FlameLevi10,2,100,1,0,-@Flame10Ref,2), -- 2 from 10man reference +-- Hardmode: 1 tower left +(@FlameLevi10,3,100,2,0,-@EmblemRef,2), -- 2x emblem +(@FlameLevi10,4,100,2,0,-@Flame10Ref,2), -- 2 from 10man reference +-- Hardmode: 2 towers left +(@FlameLevi10,5,100,4,0,-@EmblemRef,2), -- 2x emblem +(@FlameLevi10,6,100,4,0,-@Flame10Ref,2), -- 2 from 10man reference +-- Hardmode: 3 towers left +(@FlameLevi10,7,100,8,0,-@EmblemRef,3), -- 3x emblem +(@FlameLevi10,8,100,8,0,-@Flame10Ref,2), -- 2 from 10man reference +-- Hardmode: 4 towers left +(@FlameLevi10,9,100,16,0,-@EmblemRef,3), -- 3x emblem +(@FlameLevi10,10,100,16,0,-@Flame10Ref,2), -- 2 from 10man reference +-- one from hardmodeloot: +(@FlameLevi10,45296,0,16,1,1,1), -- Twirling Blades +(@FlameLevi10,45293,0,16,1,1,1), -- Handguards of Potent Cures +(@FlameLevi10,45295,0,16,1,1,1), -- Gilded Steel Legplates +(@FlameLevi10,45300,0,16,1,1,1), -- Mantle of Fiery Vengeance +(@FlameLevi10,45297,0,16,1,1,1), -- Shimmering Seal +-- Shared Loot over the modes (masked) +-- Non-Normal (Modes 2|4|8|16) +(@FlameLevi10,11,5,30,0,-34154,1), -- 1 from recepies (chanced) +-- More then 1 tower up (Modes 4|8|16) +(@FlameLevi10,@Orb,100,28,0,1,3), -- Runed Orb (1-3) +-- More then 2 towers up (Modes 8|16) +(@FlameLevi10,12,100,24,0,-34154,1), -- 1 from recepies +-- --------------------------- +-- -- Flame Levithian 25man -- +-- --------------------------- +(@FlameLevi25,1,100,1,0,-@EmblemRef,1), -- 1x emblem +(@FlameLevi25,2,100,1,0,-@Flame25Ref,3), -- 3 from 25man reference +-- Hardmode: 1 tower left +(@FlameLevi25,3,100,2,0,-@EmblemRef,2), -- 2x emblem +(@FlameLevi25,4,100,2,0,-@Flame25Ref,3), -- 3 from 25man reference +-- Hardmode: 2 towers left +(@FlameLevi25,5,100,4,0,-@EmblemRef,2), -- 2x emblem +(@FlameLevi25,6,100,4,0,-@Flame25Ref,3), -- 3 from 25man reference +-- Hardmode: 3 towers left +(@FlameLevi25,7,100,8,0,-@EmblemRef,3), -- 3x emblem +(@FlameLevi25,8,100,8,0,-@Flame25Ref,3), -- 3 from 25man reference +-- Hardmode: 4 towers left +(@FlameLevi25,9,100,16,0,-@EmblemRef,3), -- 3x emblem +(@FlameLevi25,10,100,16,0,-@Flame25Ref,3), -- 3 from 25man reference +-- one from hardmodeloot: +(@FlameLevi25,45132,0,16,1,1,1), -- Golden Saronite Dragon +(@FlameLevi25,45133,0,16,1,1,1), -- Pendant of Fiery Havoc +(@FlameLevi25,45134,0,16,1,1,1), -- Plated Leggings of Ruination +(@FlameLevi25,45135,0,16,1,1,1), -- Boots of Fiery Resolution +(@FlameLevi25,45136,0,16,1,1,1), -- Shoulderpads of Dormant Energies +(@FlameLevi25,45086,0,16,1,1,1), -- Rising Sun +(@FlameLevi25,45110,0,16,1,1,1), -- Titanguard +-- Shared Loot over the modes (masked) +-- All Modes (1|2|4|8|16): +(@FlameLevi25,11,5,31,0,-@OrbRef,1), -- Runed Orb (1x Chanced) +(@FlameLevi25,45038,8,1,0,1,1), -- Fragment of Val'anyr (quest only!?) +(@FlameLevi25,12,5,31,0,-34154,1), -- 1 from recepies (chanced) +-- More then 1 tower up (Modes 4|8|16) +(@FlameLevi25,13,100,28,0,-@OrbRef,2), -- Runed Orb (2x garanteed) +-- More then 2 towers up (Modes 8|16) +(@FlameLevi25,14,100,24,0,-34154,1), -- 1 from recepies +-- ------------------------------ +-- -- IGNIS THE FURNACE MASTER -- +-- ------------------------------ +-- Ignis the Furnace Master 10man +(@IgnisFM10,1,100,1,0,-@Ignis10Ref,2), -- 2 items from Ref loot +(@IgnisFM10,@Emblem,100,1,0,1,1), -- 1 Emblem +-- Ignis the Furnace Master 25man +(@IgnisFM25,1,100,1,0,-@Ignis25Ref,3), -- 3 items from Ref loot +(@IgnisFM25,@Emblem,100,1,0,2,2), -- 2 Emblem +(@IgnisFM25,3,10,1,0,-34154,1), -- 1 from recepies +(@IgnisFM25,45038,8,1,0,1,1), -- Fragment of Val'anyr (quest only!?) +(@IgnisFM25,45087,75,1,0,1,1), -- Runed Orb +-- ---------------- +-- -- RAZORSCALE -- +-- ---------------- +-- Razorscale 10man +(@Razorscale10,1,100,1,0,-@Razor10Ref ,2), -- 2 items from ref loot +(@Razorscale10,@Emblem,100,1,0,1,1), -- Emblem of Triumph +-- Razorscale 25man +(@Razorscale25,1,100,1,0,-@Razor25Ref,3), -- 3 items from Ref loot +(@Razorscale25,@Emblem,100,1,0,1,2), -- 2 Emblems +(@Razorscale25,2,10,1,0,-34154,1), -- 1 from recepies +(@Razorscale25,45038,8,1,0,1,1), -- Fragment of Val'anyr (quest only!?) +(@Razorscale25,45087,75,1,0,1,1), -- Runed Orb +-- ------------------------- +-- -- XT002 DECONSTRUCTOR -- +-- ------------------------- +-- X002 Deconstructor 10man (and hardmode) +(@XT002_10,1,100,3,0,-@XT002_10Ref,2), -- 2items from Ref loot +(@XT002_10,@Emblem,100,3,0,1,1), -- 1x Emblem +-- Hard mode 10man only: +(@XT002_10,45442,0,2,1,1,1), -- Sorthalis,Hammer of the Watchers +(@XT002_10,45443,0,2,1,1,1), -- Charm of Meticulous Timing +(@XT002_10,45444,0,2,1,1,1), -- Gloves of the Steady Hand +(@XT002_10,45445,0,2,1,1,1), -- Breastplate of the Devoted +(@XT002_10,45446,0,2,1,1,1), -- Grasps of Reason +-- X002 Deconstructor 25man (and hardmode) +(@XT002_25,1,100,3,0,-@XT002_25Ref,3), -- 3 items from Ref loot +(@XT002_25,2,10,3,0,-34154,1), -- 1 from recepies +(@XT002_25,45038,8,3,0,1,1), -- Fragment of Val'anyr (quest only!?) +(@XT002_25,45087,75,3,0,1,1), -- Runed Orb +(@XT002_25,47241,100,3,0,1,2), -- 2 Emblem of Triumph +-- Hard Mode 25man only: +(@XT002_25,45442,0,2,1,1,1), -- Sorthalis,Hammer of the Watchers +(@XT002_25,45443,0,2,1,1,1), -- Charm of Meticulous Timing +(@XT002_25,45444,0,2,1,1,1), -- Gloves of the Steady Hand +(@XT002_25,45445,0,2,1,1,1), -- Breastplate of the Devoted +(@XT002_25,45446,0,2,1,1,1); -- Grasps of Reason From 7eb473d0b81c85f23c0e1c8895ed587876214017 Mon Sep 17 00:00:00 2001 From: Elron103 Date: Sat, 24 Mar 2012 13:34:19 +0100 Subject: [PATCH 0249/1149] Core/Spells: Fix loading order and apply custom spell flags correctly --- src/server/game/World/World.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 4c02d1058b2..4b3794e5989 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1283,6 +1283,9 @@ void World::SetInitialWorldSettings() sLog->outString("Loading SpellInfo store..."); sSpellMgr->LoadSpellInfoStore(); + sLog->outString("Loading SkillLineAbilityMultiMap Data..."); + sSpellMgr->LoadSkillLineAbilityMap(); + sLog->outString("Loading spell custom attributes..."); sSpellMgr->LoadSpellCustomAttr(); @@ -1295,9 +1298,6 @@ void World::SetInitialWorldSettings() sLog->outString("Loading Instance Template..."); sObjectMgr->LoadInstanceTemplate(); - sLog->outString("Loading SkillLineAbilityMultiMap Data..."); - sSpellMgr->LoadSkillLineAbilityMap(); - // Must be called before `creature_respawn`/`gameobject_respawn` tables sLog->outString("Loading instances..."); sInstanceSaveMgr->LoadInstances(); From 25c13de8b39184c9b1070d5dac1ac2525e8473eb Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 24 Mar 2012 13:43:28 +0100 Subject: [PATCH 0250/1149] Core/Auras: Corrected check relying on a not yet initialized variable --- src/server/game/Spells/Auras/SpellAuras.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 1fddd3a04ba..a22b9e73fc6 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -719,7 +719,8 @@ int32 Aura::CalcMaxDuration(Unit* caster) const if (IsPassive() && !m_spellInfo->DurationEntry) maxDuration = -1; - if (!IsPermanent() && modOwner) + // IsPermanent() checks max duration (which we are supposed to calculate here) + if (maxDuration != -1 && modOwner) modOwner->ApplySpellMod(GetId(), SPELLMOD_DURATION, maxDuration); return maxDuration; } From cddf1dcf03549716a2b86a6dc491b93fa83af5c3 Mon Sep 17 00:00:00 2001 From: leak Date: Sat, 24 Mar 2012 14:54:24 +0100 Subject: [PATCH 0251/1149] Core/DBLayer: Prepare statement on the right connection fixes #5862 --- src/server/shared/Database/Implementation/CharacterDatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 9c0c91e8152..f75fe592d2d 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -65,7 +65,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() "resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " "arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, " "health, power1, power2, power3, power4, power5, power6, power7, instance_id, speccount, activespec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars, grantableLevels FROM characters WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_GROUP_MEMBER, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SEL_GROUP_MEMBER, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_INSTANCE, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_AURAS, "SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, " "base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges FROM character_aura WHERE guid = ?", CONNECTION_ASYNC) From bdbc1312c3e595b0720407d32e6fc7cb92daf14a Mon Sep 17 00:00:00 2001 From: click Date: Sat, 24 Mar 2012 15:05:23 +0100 Subject: [PATCH 0252/1149] Core: Remove some silly pramga-section warnings --- src/server/game/Entities/Player/Player.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index a238247b3c1..ac50bbd9d35 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2481,9 +2481,6 @@ class Player : public Unit, public GridObject void AddWhisperWhiteList(uint64 guid) { WhisperList.push_back(guid); } bool IsInWhisperWhiteList(uint64 guid); - #pragma region Player Movement - - /*! These methods send different packets to the client in apply and unapply case. These methods are only sent to the current unit. */ @@ -2525,8 +2522,6 @@ class Player : public Unit, public GridObject return modelData->CollisionHeight; } } - #pragma endregion Player Movement - protected: // Gamemaster whisper whitelist From 3d0063abee02bca855f98cb9b45f92c5a9d86215 Mon Sep 17 00:00:00 2001 From: leak Date: Sat, 24 Mar 2012 15:37:54 +0100 Subject: [PATCH 0253/1149] Core: Fix warnings --- src/server/game/Accounts/AccountMgr.cpp | 4 ++-- src/server/game/Maps/Map.cpp | 4 ++++ .../CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp | 4 ++-- .../CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index 4886b20a0f2..cd3baca7923 100755 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -174,7 +174,7 @@ uint32 GetSecurity(uint32 accountId) stmt->setUInt32(0, accountId); PreparedQueryResult result = LoginDatabase.Query(stmt); - return (result) ? (*result)[0].GetUInt32() : SEC_PLAYER; + return (result) ? (*result)[0].GetUInt32() : uint32(SEC_PLAYER); } uint32 GetSecurity(uint32 accountId, int32 realmId) @@ -184,7 +184,7 @@ uint32 GetSecurity(uint32 accountId, int32 realmId) stmt->setInt32(1, realmId); PreparedQueryResult result = LoginDatabase.Query(stmt); - return (result) ? (*result)[0].GetUInt32() : SEC_PLAYER; + return (result) ? (*result)[0].GetUInt32() : uint32(SEC_PLAYER); } bool GetName(uint32 accountId, std::string& name) diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 86d95857cce..379aa4a9722 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -1526,8 +1526,10 @@ inline ZLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 R { uint32 overrideLiquid = area->LiquidTypeOverride[liquidEntry->Type]; if (!overrideLiquid && area->zone) + { if (area = GetAreaEntryByAreaID(area->zone)) overrideLiquid = area->LiquidTypeOverride[liquidEntry->Type]; + } if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(overrideLiquid)) { @@ -1799,8 +1801,10 @@ ZLiquidStatus Map::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidTyp { uint32 overrideLiquid = area->LiquidTypeOverride[liquidFlagType]; if (!overrideLiquid && area->zone) + { if (area = GetAreaEntryByAreaID(area->zone)) overrideLiquid = area->LiquidTypeOverride[liquidFlagType]; + } if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(overrideLiquid)) { diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index dfd1f5ba5e1..74b9c038482 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -619,7 +619,7 @@ public: { if (m_uiRangeCheckTimer < uiDiff) { - if (Player* target = me->SelectNearestPlayer(2.0f)) + if (me->SelectNearestPlayer(2.0f)) { DoCastAOE(SPELL_UNLEASHED_DARK); me->GetMotionMaster()->MoveIdle(); @@ -660,7 +660,7 @@ public: { if (m_uiRangeCheckTimer < uiDiff) { - if (Player* target = me->SelectNearestPlayer(2.0f)) + if (me->SelectNearestPlayer(2.0f)) { DoCastAOE(SPELL_UNLEASHED_LIGHT); me->GetMotionMaster()->MoveIdle(); diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index 65d59efb9d6..c498c41a068 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -491,7 +491,7 @@ public: Creature* coilfangElite = me->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); if (coilfangElite) { - if (Unit* target = target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) coilfangElite->AI()->AttackStart(target); else if (me->getVictim()) coilfangElite->AI()->AttackStart(me->getVictim()); From 09dcee986722d0dc14046a4ab2dafa795f4f1708 Mon Sep 17 00:00:00 2001 From: leak Date: Sat, 24 Mar 2012 15:50:18 +0100 Subject: [PATCH 0254/1149] Core: Fix warnings properly --- src/server/game/Maps/Map.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 379aa4a9722..127478f1484 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -1527,7 +1527,8 @@ inline ZLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 R uint32 overrideLiquid = area->LiquidTypeOverride[liquidEntry->Type]; if (!overrideLiquid && area->zone) { - if (area = GetAreaEntryByAreaID(area->zone)) + area = GetAreaEntryByAreaID(area->zone) + if (area) overrideLiquid = area->LiquidTypeOverride[liquidEntry->Type]; } @@ -1802,7 +1803,8 @@ ZLiquidStatus Map::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidTyp uint32 overrideLiquid = area->LiquidTypeOverride[liquidFlagType]; if (!overrideLiquid && area->zone) { - if (area = GetAreaEntryByAreaID(area->zone)) + area = GetAreaEntryByAreaID(area->zone) + if (area) overrideLiquid = area->LiquidTypeOverride[liquidFlagType]; } From cd52a9aacf312ee81f5519ca9986a2a6f3788b8d Mon Sep 17 00:00:00 2001 From: leak Date: Sat, 24 Mar 2012 15:54:45 +0100 Subject: [PATCH 0255/1149] Core: I herd you like semicolon.. --- src/server/game/Maps/Map.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 127478f1484..3be247947fe 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -1527,7 +1527,7 @@ inline ZLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 R uint32 overrideLiquid = area->LiquidTypeOverride[liquidEntry->Type]; if (!overrideLiquid && area->zone) { - area = GetAreaEntryByAreaID(area->zone) + area = GetAreaEntryByAreaID(area->zone); if (area) overrideLiquid = area->LiquidTypeOverride[liquidEntry->Type]; } @@ -1803,7 +1803,7 @@ ZLiquidStatus Map::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidTyp uint32 overrideLiquid = area->LiquidTypeOverride[liquidFlagType]; if (!overrideLiquid && area->zone) { - area = GetAreaEntryByAreaID(area->zone) + area = GetAreaEntryByAreaID(area->zone); if (area) overrideLiquid = area->LiquidTypeOverride[liquidFlagType]; } From c8bf09d504097ca7ca51ffad481a601b39334773 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 24 Mar 2012 16:44:01 +0100 Subject: [PATCH 0256/1149] Core/DBLayer: Match field type reads in core with data types in db for prepared statements --- src/server/game/Chat/Chat.cpp | 2 +- src/server/game/World/World.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 21abae2d91a..9992721a6dd 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -455,7 +455,7 @@ ChatCommand* ChatHandler::getCommandTable() Field* fields = result->Fetch(); std::string name = fields[0].GetString(); - SetDataForCommandInTable(commandTableCache, name.c_str(), fields[1].GetUInt16(), fields[2].GetString(), name); + SetDataForCommandInTable(commandTableCache, name.c_str(), fields[1].GetUInt8(), fields[2].GetString(), name); } while (result->NextRow()); } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 3c64f7de506..cef79a1c32a 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -2775,7 +2775,7 @@ void World::LoadDBAllowedSecurityLevel() PreparedQueryResult result = LoginDatabase.Query(stmt); if (result) - SetPlayerSecurityLimit(AccountTypes(result->Fetch()->GetUInt16())); + SetPlayerSecurityLimit(AccountTypes(result->Fetch()->GetUInt8())); } void World::SetPlayerSecurityLimit(AccountTypes _sec) From 5f9ca3b998f0545f5877103f62c6db30f6529dc3 Mon Sep 17 00:00:00 2001 From: leak Date: Sat, 24 Mar 2012 16:48:59 +0100 Subject: [PATCH 0257/1149] Core/DBLayer: C/P fix --- src/server/game/Chat/Commands/Level2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index 816049ebfbc..ef20b6a4d07 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -388,9 +388,9 @@ bool ChatHandler::HandlePInfoCommand(const char* args) PreparedQueryResult result2 = LoginDatabase.Query(stmt); if (!result2) { - stmt = LoginDatabase.GetPreparedStatement(CHAR_SEL_PINFO_BANS); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_BANS); stmt->setUInt32(0, GUID_LOPART(target_guid)); - result2 = LoginDatabase.Query(stmt); + result2 = CharacterDatabase.Query(stmt); } if (result2) From c058e6740b33d064e46f2f693e7ae3d9aaf52a01 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sat, 24 Mar 2012 16:58:07 +0100 Subject: [PATCH 0258/1149] DB/Loot: Add some Missing loot, thx Helias for spotting and initial work Closes #5842 --- ..._03_24_02_world_creature_loot_template.sql | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 sql/updates/world/2012_03_24_02_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_03_24_02_world_creature_loot_template.sql b/sql/updates/world/2012_03_24_02_world_creature_loot_template.sql new file mode 100644 index 00000000000..cdac3335aed --- /dev/null +++ b/sql/updates/world/2012_03_24_02_world_creature_loot_template.sql @@ -0,0 +1,136 @@ +-- (re) Add reference 26042 +SET @NEC := 26042; -- Northrend Emotion Cooking Recipe Reference +DELETE FROM `reference_loot_template` WHERE `entry`=@NEC; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@NEC,43507,0,1,1,1,1), -- Recipe: Tasty cupcake +(@NEC,43508,0,1,1,1,1), -- Recipe: Last Week's Mammoth +(@NEC,43509,0,1,1,1,1), -- Recipe: Bad Clams +(@NEC,43510,0,1,1,1,1); -- Recipe: Haunted Herring + +DELETE FROM `creature_loot_template` WHERE `entry` IN (2436,5928,5936,12239,12240,12241,12242,12243,14527,14529,14531,16506,16836,17307,21166,23809,23954,23963,23964,23983,24175,25234,28027,28113,28138,28494,29554,30177,30954,31779,40419); +UPDATE `creature_template`SET `lootid`=entry WHERE `entry` IN (2436,5928,5936,12239,12240,12241,12242,12243,14527,14529,14531,16506,16836,21166,23809,23963,23964,23983,25234,28027,28138,28494,29554,30954,31779,40419); +UPDATE `creature_template` SET `lootid`=0 WHERE `entry` IN (17307,23954,24175,28113,30177); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Farmer Kent (friendly?) +(2436,3692,-100,1,0,1,1), -- Hilsbrad Human Skull +-- Sorrow Wing +(5928,5808,-50,1,0,1,1), -- Pridewing Venom Sac +(5928,5137,80,1,0,1,1), -- Bright Eyeball +(5928,5136,10,1,0,1,1), -- Torn Furry Ear +(5928,1,100,1,0,-@NEC,1), -- Random world green drop ilvl 25-30 +-- Orca +(5936,26000,3,1,1,-26000,1), -- Northrend World Grey Reference #1 +(5936,26001,3,1,1,-26001,1), -- Northrend World Grey Reference #2 +(5936,26003,1,1,1,-26003,1), -- Northrend World Green Reference #1 +(5936,26004,1,1,1,-26004,1), -- Northrend World Green Reference #2 +(5936,26005,1,1,1,-26005,1), -- Northrend World Green Reference #3 +(5936,26006,1,1,1,-26006,1), -- Northrend World Green Reference #4 +(5936,26017,0.5,1,1,-26017,1), -- Northrend World Blue Reference #1 +(5936,26018,0.5,1,1,-26018,1), -- Northrend World Blue Reference #2 +(5936,26019,0.5,1,1,-26019,1), -- Northrend World Blue Reference #3 +(5936,26020,0.5,1,1,-26020,1), -- Northrend World Blue Reference #4 +-- Add Theradric Crystal Carving (17684) to the following creatures +(12239,17684,-25,1,0,1,1), -- Spirit of Gelk +(12240,17684,-25,1,0,1,1), -- Spirit of Kolk +(12241,17684,-25,1,0,1,1), -- Spirit of Magra +(12242,17684,-25,1,0,1,1), -- Spirit of Maraudos +(12243,17684,-25,1,0,1,1), -- Spirit of Veng +(14527,18952,-100,1,0,1,1), -- Simone the Inconspicuous - Simone's Head +(14529,18953,-100,1,0,1,1), -- Franklin the Friendly - Klinfran's Head +(14531,18955,-100,1,0,1,1), -- Artorius the Amiable - Artorius's Head +(16506,22708,-100,1,0,1,1), -- Naxxramas Worshipper - Fate of Ramaladni +(16836,23460,-100,1,0,1,1), -- Escaped Dreghood - Broken Blood Sample +(21166,30451,-15,1,0,1,1), -- Illidari Dreadlord - Lohn'goron, Bow of the Torn-heart +-- Vengeance Landing Cannoneer +(23809,26000,3,1,1,-26000,1), -- Northrend World Grey Reference #1 +(23809,26001,3,1,1,-26001,1), -- Northrend World Grey Reference #2 +(23809,26005,1,1,1,-26005,1), -- Northrend World Green Reference #3 +-- Sergeant Lorric +(23963,26000,3,1,1,-26000,1), -- Northrend World Grey Reference #1 +(23963,26001,3,1,1,-26001,1), -- Northrend World Grey Reference #2 +(23963,26003,1,1,1,-26003,1), -- Northrend World Green Reference #1 +(23963,26004,1,1,1,-26004,1), -- Northrend World Green Reference #2 +(23963,26017,0.5,1,1,-26017,1), -- Northrend World Blue Reference #1 +(23963,26018,0.5,1,1,-26018,1), -- Northrend World Blue Reference #2 +(23963,26044,2,1,0,-@NEC,1), -- Northrend Emotion Cooking Recipes +-- Lieutenant Celeyne +(23964,26000,3,1,1,-26000,1), -- Northrend World Grey Reference #1 +(23964,26001,3,1,1,-26001,1), -- Northrend World Grey Reference #2 +(23964,26003,1,1,1,-26003,1), -- Northrend World Green Reference #1 +(23964,26004,1,1,1,-26004,1), -- Northrend World Green Reference #2 +(23964,26017,0.5,1,1,-26017,1), -- Northrend World Blue Reference #1 +(23964,26018,0.5,1,1,-26018,1), -- Northrend World Blue Reference #2 +(23964,26044,2,1,0,-@NEC,1), -- Northrend Emotion Cooking Recipes +-- North Fleet Marine +(23983,26000,3,1,1,-26000,1), -- Northrend World Grey Reference #1 +(23983,26001,3,1,1,-26001,1), -- Northrend World Grey Reference #2 +(23983,26003,1,1,1,-26003,1), -- Northrend World Green Reference #1 +(23983,26004,1,1,1,-26004,1), -- Northrend World Green Reference #2 +(23983,26017,0.5,1,1,-26017,1), -- Northrend World Blue Reference #1 +(23983,26018,0.5,1,1,-26018,1), -- Northrend World Blue Reference #2 +(23983,26044,2,1,0,-@NEC,1), -- Northrend Emotion Cooking Recipes +-- Stormfleet Deckhand +(25234,26000,3,1,1,-26000,1), -- Northrend World Grey Reference #1 +(25234,26003,1,1,1,-26003,1), -- Northrend World Green Reference #1 +-- High-Oracle Soo-say +(28027,17058,50,1,0,1,1), -- Fish Oil +(28027,17057,30,1,0,1,1), -- Shiny Fish Scales +(28027,33470,15,1,0,2,4), -- Frostweave Cloth +(28027,35951,10,1,0,1,3), -- Poached Emperor Salmon +(28027,38642,-1,1,0,1,1), -- Golden Engagement Ring +-- Elder Harkek +(28138,33470,40,1,0,2,4), -- Frostweave Cloth +(28138,33447,4,1,0,1,1), -- Runic Healing Potion +(28138,38642,-1,1,0,1,1), -- Golden Engagement Ring +-- Kutube'sa +(28494,26001,3,1,1,-26001,1), -- Northrend World Grey Reference #2 +(28494,26002,3,1,1,-26002,1), -- Northrend World Grey Reference #3 +(28494,26010,1,1,1,-26010,1), -- Northrend World Green Reference #4 +(28494,26011,1,1,1,-26011,1), -- Northrend World Green Reference #5 +(28494,26012,1,1,1,-26012,1), -- Northrend World Green Reference #6 +(28494,26023,0.5,1,1,-26023,1), -- Northrend World Blue Reference #3 +(28494,26025,0.5,1,1,-26025,1), -- Northrend World Blue Reference #4 +(28494,26026,0.5,1,1,-26026,1), -- Northrend World Blue Reference #5 +(28494,26044,2,1,0,-@NEC,1), -- Northrend Emotion Cooking Recipes +(28494,39152,35,1,0,1,1), -- Manual: Heavy Frostweave Bandage +(28494,43297,1,1,0,1,1), -- Damaged Necklace +-- Snowblind Devotee +(29554,26001,3,1,1,-26001,1), -- Northrend World Grey Reference #2 +(29554,26002,3,1,1,-26002,1), -- Northrend World Grey Reference #3 +(29554,26009,1,1,1,-26009,1), -- Northrend World Green Reference #3 +(29554,26010,1,1,1,-26010,1), -- Northrend World Green Reference #4 +(29554,26011,1,1,1,-26011,1), -- Northrend World Green Reference #5 +(29554,26012,1,1,1,-26012,1), -- Northrend World Green Reference #6 +(29554,26013,1,1,1,-26013,1), -- Northrend World Green Reference #7 +(29554,26023,0.5,1,1,-26023,1), -- Northrend World Blue Reference #3 +(29554,26024,0.5,1,1,-26024,1), -- Northrend World Blue Reference #4 +(29554,26025,0.5,1,1,-26025,1), -- Northrend World Blue Reference #5 +(29554,26026,0.5,1,1,-26026,1), -- Northrend World Blue Reference #6 +(29554,26044,2,1,0,-@NEC,1), -- Northrend Emotion Cooking Recipes +(29554,39152,35,1,0,1,1), -- Manual: Heavy Frostweave Bandage +(29554,43297,1,1,0,1,1), -- Damaged Necklace +-- Rokir +(30954,26001,6,1,1,-26001,1), -- Northrend World Grey Reference #2 +(30954,26002,6,1,1,-26002,1), -- Northrend World Grey Reference #3 +(30954,26014,2,1,1,-26014,1), -- Northrend World Green Reference #8 +(30954,26015,2,1,1,-26015,1), -- Northrend World Green Reference #9 +-- Skeletal Archmage +(31779,26001,3,1,1,-26001,1), -- Northrend World Grey Reference #2 +(31779,26002,3,1,1,-26002,1), -- Northrend World Grey Reference #3 +(31779,26013,1,1,1,-26013,1), -- Northrend World Green Reference #7 +(31779,26014,1,1,1,-26014,1), -- Northrend World Green Reference #8 +(31779,26015,1,1,1,-26015,1), -- Northrend World Green Reference #9 +(31779,26028,0.5,1,1,-26028,1), -- Northrend World Blue Reference #8 +(31779,39152,50,1,0,1,1), -- Manual: Heavy Frostweave Bandage +(31779,43297,1,1,0,1,1), -- Damaged Necklace +-- Charscale Assaulter +(40419,26001,6,1,1,-26001,1), -- Northrend World Grey Reference #2 +(40419,26002,6,1,1,-26002,1), -- Northrend World Grey Reference #3 +(40419,26015,2,1,1,-26015,1), -- Northrend World Green Reference #9 +(40419,26016,2,1,1,-26016,1); -- Northrend World Green Reference #10 +-- conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 1 AND `SourceGroup` IN (28494,29554,31779); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`Comment`) VALUES +(1,28494,39152,7,129,390,'Manual: Heavy Frostweave Bandage will drop only if the player has first aid at 390'), +(1,29554,39152,7,129,390,'Manual: Heavy Frostweave Bandage will drop only if the player has first aid at 390'), +(1,31779,39152,7,129,390,'Manual: Heavy Frostweave Bandage will drop only if the player has first aid at 390'); From 78e8de5913ff4a72b8a9969e8d8a7884ebeeee79 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 24 Mar 2012 17:09:42 +0100 Subject: [PATCH 0259/1149] Core/Scripts: Fixed script unloading --- src/server/game/Scripting/ScriptMgr.cpp | 2 +- src/server/scripts/Outland/nagrand.cpp | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index fba6b460ec9..012910210a5 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -260,7 +260,7 @@ void ScriptMgr::Initialize() void ScriptMgr::Unload() { #define SCR_CLEAR(T) \ - FOR_SCRIPTS(T, itr, end) \ + for (SCR_REG_ITR(T) itr = SCR_REG_LST(T).begin(); itr != SCR_REG_LST(T).end(); ++itr) \ delete itr->second; \ SCR_REG_LST(T).clear(); diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp index d53bb4c24a4..a89d06072a7 100644 --- a/src/server/scripts/Outland/nagrand.cpp +++ b/src/server/scripts/Outland/nagrand.cpp @@ -444,18 +444,22 @@ public: void Reset() { + Say_Timer = 5000; ReleasedFromCage = false; } void UpdateAI(uint32 const diff) { - if (Say_Timer <= diff && ReleasedFromCage) + if (ReleasedFromCage) { - me->ForcedDespawn(); - ReleasedFromCage = false; + if (Say_Timer <= diff) + { + me->ForcedDespawn(); + ReleasedFromCage = false; + } + else + Say_Timer -= diff; } - else - Say_Timer -= diff; } void MovementInform(uint32 type, uint32 id) From 47a597d406e131c76f81b73c06ec30d19038c39b Mon Sep 17 00:00:00 2001 From: leak Date: Sat, 24 Mar 2012 17:31:31 +0100 Subject: [PATCH 0260/1149] Core/DBLayer: Query should actually be available on both sync and async mysql connections --- src/server/shared/Database/Implementation/CharacterDatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index f75fe592d2d..65c59cc48f7 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -65,7 +65,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() "resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " "arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, " "health, power1, power2, power3, power4, power5, power6, power7, instance_id, speccount, activespec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars, grantableLevels FROM characters WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_GROUP_MEMBER, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_SEL_GROUP_MEMBER, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_BOTH) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_INSTANCE, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_AURAS, "SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, " "base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges FROM character_aura WHERE guid = ?", CONNECTION_ASYNC) From 64701c51dc5232f538bbc2b4687b4ae2be9d904f Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 24 Mar 2012 17:53:33 +0100 Subject: [PATCH 0261/1149] Core/LFGScript: Split LFG script class to prevent crash caused by deallocating the same memory twice --- src/server/game/DungeonFinding/LFGScripts.cpp | 78 ++++++++++--------- src/server/game/DungeonFinding/LFGScripts.h | 24 +++--- 2 files changed, 57 insertions(+), 45 deletions(-) diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp index 2966e799c58..6175addfae2 100644 --- a/src/server/game/DungeonFinding/LFGScripts.cpp +++ b/src/server/game/DungeonFinding/LFGScripts.cpp @@ -27,9 +27,45 @@ #include "LFGScripts.h" #include "LFGMgr.h" -LFGScripts::LFGScripts(): GroupScript("LFGScripts"), PlayerScript("LFGScripts") {} +LFGPlayerScript::LFGPlayerScript() : PlayerScript("LFGPlayerScript") +{ +} -void LFGScripts::OnAddMember(Group* group, uint64 guid) +void LFGPlayerScript::OnLevelChanged(Player* player, uint8 /*oldLevel*/) +{ + sLFGMgr->InitializeLockedDungeons(player); +} + +void LFGPlayerScript::OnLogout(Player* player) +{ + sLFGMgr->Leave(player); + LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_REMOVED_FROM_QUEUE); + player->GetSession()->SendLfgUpdateParty(updateData); + player->GetSession()->SendLfgUpdatePlayer(updateData); + player->GetSession()->SendLfgUpdateSearch(false); + uint64 guid = player->GetGUID(); + // TODO - Do not remove, add timer before deleting + sLFGMgr->RemovePlayerData(guid); +} + +void LFGPlayerScript::OnLogin(Player* player) +{ + sLFGMgr->InitializeLockedDungeons(player); + // TODO - Restore LfgPlayerData and send proper status to player if it was in a group +} + +void LFGPlayerScript::OnBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool /*permanent*/) +{ + MapEntry const* mapEntry = sMapStore.LookupEntry(mapId); + if (mapEntry->IsDungeon() && difficulty > DUNGEON_DIFFICULTY_NORMAL) + sLFGMgr->InitializeLockedDungeons(player); +} + +LFGGroupScript::LFGGroupScript() : GroupScript("LFGGroupScript") +{ +} + +void LFGGroupScript::OnAddMember(Group* group, uint64 guid) { uint64 gguid = group->GetGUID(); if (!gguid) @@ -55,7 +91,7 @@ void LFGScripts::OnAddMember(Group* group, uint64 guid) sLFGMgr->Leave(player); } -void LFGScripts::OnRemoveMember(Group* group, uint64 guid, RemoveMethod method, uint64 kicker, const char* reason) +void LFGGroupScript::OnRemoveMember(Group* group, uint64 guid, RemoveMethod method, uint64 kicker, char const* reason) { uint64 gguid = group->GetGUID(); if (!gguid || method == GROUP_REMOVEMETHOD_DEFAULT) @@ -102,7 +138,7 @@ void LFGScripts::OnRemoveMember(Group* group, uint64 guid, RemoveMethod method, sLFGMgr->OfferContinue(group); } -void LFGScripts::OnDisband(Group* group) +void LFGGroupScript::OnDisband(Group* group) { uint64 gguid = group->GetGUID(); sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnDisband [" UI64FMTD "]", gguid); @@ -110,7 +146,7 @@ void LFGScripts::OnDisband(Group* group) sLFGMgr->RemoveGroupData(gguid); } -void LFGScripts::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLeaderGuid) +void LFGGroupScript::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLeaderGuid) { uint64 gguid = group->GetGUID(); if (!gguid) @@ -131,7 +167,7 @@ void LFGScripts::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLe } } -void LFGScripts::OnInviteMember(Group* group, uint64 guid) +void LFGGroupScript::OnInviteMember(Group* group, uint64 guid) { uint64 gguid = group->GetGUID(); if (!gguid) @@ -140,33 +176,3 @@ void LFGScripts::OnInviteMember(Group* group, uint64 guid) sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnInviteMember [" UI64FMTD "]: invite [" UI64FMTD "] leader [" UI64FMTD "]", gguid, guid, group->GetLeaderGUID()); sLFGMgr->Leave(NULL, group); } - -void LFGScripts::OnLevelChanged(Player* player, uint8 /*oldLevel*/) -{ - sLFGMgr->InitializeLockedDungeons(player); -} - -void LFGScripts::OnLogout(Player* player) -{ - sLFGMgr->Leave(player); - LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_REMOVED_FROM_QUEUE); - player->GetSession()->SendLfgUpdateParty(updateData); - player->GetSession()->SendLfgUpdatePlayer(updateData); - player->GetSession()->SendLfgUpdateSearch(false); - uint64 guid = player->GetGUID(); - // TODO - Do not remove, add timer before deleting - sLFGMgr->RemovePlayerData(guid); -} - -void LFGScripts::OnLogin(Player* player) -{ - sLFGMgr->InitializeLockedDungeons(player); - // TODO - Restore LfgPlayerData and send proper status to player if it was in a group -} - -void LFGScripts::OnBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool /*permanent*/) -{ - MapEntry const* mapEntry = sMapStore.LookupEntry(mapId); - if (mapEntry->IsDungeon() && difficulty > DUNGEON_DIFFICULTY_NORMAL) - sLFGMgr->InitializeLockedDungeons(player); -} diff --git a/src/server/game/DungeonFinding/LFGScripts.h b/src/server/game/DungeonFinding/LFGScripts.h index f17f7b16af1..4b332c7d731 100644 --- a/src/server/game/DungeonFinding/LFGScripts.h +++ b/src/server/game/DungeonFinding/LFGScripts.h @@ -26,17 +26,10 @@ class Player; class Group; -class LFGScripts: public GroupScript, public PlayerScript +class LFGPlayerScript : public PlayerScript { public: - LFGScripts(); - - // Group Hooks - void OnAddMember(Group* group, uint64 guid); - void OnRemoveMember(Group* group, uint64 guid, RemoveMethod method, uint64 kicker, const char* reason); - void OnDisband(Group* group); - void OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLeaderGuid); - void OnInviteMember(Group* group, uint64 guid); + LFGPlayerScript(); // Player Hooks void OnLevelChanged(Player* player, uint8 oldLevel); @@ -44,3 +37,16 @@ class LFGScripts: public GroupScript, public PlayerScript void OnLogin(Player* player); void OnBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool permanent); }; + +class LFGGroupScript : public GroupScript +{ + public: + LFGGroupScript(); + + // Group Hooks + void OnAddMember(Group* group, uint64 guid); + void OnRemoveMember(Group* group, uint64 guid, RemoveMethod method, uint64 kicker, char const* reason); + void OnDisband(Group* group); + void OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLeaderGuid); + void OnInviteMember(Group* group, uint64 guid); +}; From a306c00d43fd173fcd9448636a06782a324b7513 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 24 Mar 2012 18:01:39 +0100 Subject: [PATCH 0262/1149] Core/LFGMgr: Added missing changes from previous commit --- src/server/game/DungeonFinding/LFGMgr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index e6039880b63..815861ff96a 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -38,7 +38,8 @@ m_NumWaitTimeAvg(0), m_NumWaitTimeTank(0), m_NumWaitTimeHealer(0), m_NumWaitTime m_update = sWorld->getBoolConfig(CONFIG_DUNGEON_FINDER_ENABLE); if (m_update) { - new LFGScripts(); + new LFGPlayerScript(); + new LFGGroupScript(); // Initialize dungeon cache for (uint32 i = 0; i < sLFGDungeonStore.GetNumRows(); ++i) From 7daf69f20c2c7516a382a06aba78315fe6ce4204 Mon Sep 17 00:00:00 2001 From: Elron103 Date: Sat, 24 Mar 2012 18:25:24 +0100 Subject: [PATCH 0263/1149] Core: Fix warnings --- src/server/game/Entities/Pet/Pet.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 10 +++++----- src/server/game/Instances/InstanceSaveMgr.cpp | 2 +- src/server/scripts/Outland/blades_edge_mountains.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 1a3c1a3fbb3..e2365403eb9 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -912,7 +912,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) SetCreateHealth(40*petlevel); SetCreateMana(28 + 10*petlevel); } - SetBonusDamage(m_owner->SpellBaseDamageBonus(SPELL_SCHOOL_MASK_FIRE) * 0.5f); + SetBonusDamage(int32(m_owner->SpellBaseDamageBonus(SPELL_SCHOOL_MASK_FIRE) * 0.5f)); SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel * 4 - petlevel)); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel * 4 + petlevel)); break; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index bd5b1010f45..5ab15b757f8 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -18507,7 +18507,7 @@ void Player::SaveToDB(bool create /*=false*/) outDebugValues(); PreparedStatement* stmt = NULL; - uint16 index = 0; + uint8 index = 0; if (create) { @@ -18546,12 +18546,12 @@ void Player::SaveToDB(bool create /*=false*/) //save, far from tavern/city //save, but in tavern/city stmt->setUInt32(index++, m_resetTalentsCost); - stmt->setUInt32(index++, m_resetTalentsTime); + stmt->setUInt32(index++, uint32(m_resetTalentsTime)); stmt->setUInt16(index++, (uint16)m_ExtraFlags); stmt->setUInt8(index++, m_stableSlots); stmt->setUInt16(index++, (uint16)m_atLoginFlags); stmt->setUInt16(index++, GetZoneId()); - stmt->setUInt32(index++, m_deathExpireTime); + stmt->setUInt32(index++, uint32(m_deathExpireTime)); ss.str(""); ss << m_taxi.SaveTaxiDestinationsToString(); @@ -18657,12 +18657,12 @@ void Player::SaveToDB(bool create /*=false*/) //save, far from tavern/city //save, but in tavern/city stmt->setUInt32(index++, m_resetTalentsCost); - stmt->setUInt32(index++, m_resetTalentsTime); + stmt->setUInt32(index++, uint32(m_resetTalentsTime)); stmt->setUInt16(index++, (uint16)m_ExtraFlags); stmt->setUInt8(index++, m_stableSlots); stmt->setUInt16(index++, (uint16)m_atLoginFlags); stmt->setUInt16(index++, GetZoneId()); - stmt->setUInt32(index++, m_deathExpireTime); + stmt->setUInt32(index++, uint32(m_deathExpireTime)); ss.str(""); ss << m_taxi.SaveTaxiDestinationsToString(); diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index 26bd053b891..752cfde63d3 100755 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -580,7 +580,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b if (period < DAY) period = DAY; - uint32 next_reset = ((resetTime + MINUTE) / DAY * DAY) + period + diff; + uint32 next_reset = uint32(((resetTime + MINUTE) / DAY * DAY) + period + diff); SetResetTimeFor(mapid, difficulty, next_reset); ScheduleReset(true, time_t(next_reset-3600), InstResetEvent(1, mapid, difficulty, 0)); diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index e9537546c92..7a371170d7d 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -774,7 +774,7 @@ class npc_simon_bunny : public CreatureScript colorSequence.clear(); playableSequence.clear(); playerSequence.clear(); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, large ? 2 : 1); + me->SetFloatValue(OBJECT_FIELD_SCALE_X, large ? 2.0f : 1.0f); std::list ClusterList; Trinity::AllWorldObjectsInRange objects(me, searchDistance); From e64d1d43dd0475543d53aa4fa564bd139c7f87a3 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 24 Mar 2012 18:42:35 +0100 Subject: [PATCH 0264/1149] Core: Add proper cleanup at exit for smart script waypoints and instance encounters --- .../game/AI/SmartScripts/SmartScriptMgr.cpp | 21 +++++++++++++++++++ .../game/AI/SmartScripts/SmartScriptMgr.h | 4 ++-- src/server/game/Globals/ObjectMgr.cpp | 4 ++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index fe2a89de9aa..776ffd78a9a 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -35,6 +35,14 @@ void SmartWaypointMgr::LoadFromDB() { uint32 oldMSTime = getMSTime(); + for (UNORDERED_MAP::iterator itr = waypoint_map.begin(); itr != waypoint_map.end(); ++itr) + { + for (WPPath::iterator pathItr = itr->second->begin(); pathItr != itr->second->end(); ++pathItr) + delete pathItr->second; + + delete itr->second; + } + waypoint_map.clear(); PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_SMARTAI_WP); @@ -84,6 +92,19 @@ void SmartWaypointMgr::LoadFromDB() sLog->outString(); } +SmartWaypointMgr::~SmartWaypointMgr() +{ + for (UNORDERED_MAP::iterator itr = waypoint_map.begin(); itr != waypoint_map.end(); ++itr) + { + for (WPPath::iterator pathItr = itr->second->begin(); pathItr != itr->second->end(); ++pathItr) + delete pathItr->second; + + delete itr->second; + } + + waypoint_map.clear(); +} + void SmartAIMgr::LoadSmartAIFromDB() { uint32 oldMSTime = getMSTime(); diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 007b57b52d7..e2cd75ee62c 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -1230,9 +1230,9 @@ typedef UNORDERED_MAP ObjectListMap; class SmartWaypointMgr { friend class ACE_Singleton; - SmartWaypointMgr(){}; + SmartWaypointMgr() {} public: - ~SmartWaypointMgr(){}; + ~SmartWaypointMgr(); void LoadFromDB(); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 19f897fece3..51ed3b915fc 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -252,6 +252,10 @@ ObjectMgr::~ObjectMgr() itr->second.Clear(); _cacheTrainerSpellStore.clear(); + + for (DungeonEncounterContainer::iterator itr =_dungeonEncounterStore.begin(); itr != _dungeonEncounterStore.end(); ++itr) + for (DungeonEncounterList::iterator encounterItr = itr->second.begin(); encounterItr != itr->second.end(); ++encounterItr) + delete *encounterItr; } void ObjectMgr::AddLocaleString(std::string const& s, LocaleConstant locale, StringVector& data) From 4c16421cde3229f4522a3820a7124d6ef3a798c3 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 24 Mar 2012 20:21:17 +0200 Subject: [PATCH 0265/1149] Core/Spells: Fix periodic aura log for SPELL_AURA_PERIODIC_HEAL and SPELL_AURA_OBS_MOD_HEALTH when there is heal absorption --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 5e44c777cbd..3def3892c9a 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -6460,7 +6460,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const caster->CalcHealAbsorb(target, GetSpellInfo(), heal, absorb); int32 gain = caster->DealHeal(target, heal); - SpellPeriodicAuraLogInfo pInfo(this, damage, damage - gain, absorb, 0, 0.0f, crit); + SpellPeriodicAuraLogInfo pInfo(this, heal, heal - gain, absorb, 0, 0.0f, crit); target->SendPeriodicAuraLog(&pInfo); target->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo()); From 0eb3ffca4194c25dc8d1db571d1c57fe962ec34f Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 24 Mar 2012 19:24:36 +0100 Subject: [PATCH 0266/1149] Core/DB Layer: Fix a memory leak. Author: raczman (yes, you read correctly) --- src/server/shared/Database/PreparedStatement.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/shared/Database/PreparedStatement.cpp b/src/server/shared/Database/PreparedStatement.cpp index baeb591ffb1..9fc3514d084 100755 --- a/src/server/shared/Database/PreparedStatement.cpp +++ b/src/server/shared/Database/PreparedStatement.cpp @@ -201,6 +201,8 @@ m_bind(NULL) MySQLPreparedStatement::~MySQLPreparedStatement() { ClearParameters(); + delete[] m_Mstmt->bind->length; + delete[] m_Mstmt->bind->is_null; mysql_stmt_close(m_Mstmt); delete[] m_bind; } From eb3305932c520702918770cc924f13e11f3f6cb0 Mon Sep 17 00:00:00 2001 From: click Date: Sat, 24 Mar 2012 22:34:33 +0100 Subject: [PATCH 0267/1149] Core/DB layer: Change functionality in previous memoryleak-fix (Patch by raczman) --- src/server/shared/Database/PreparedStatement.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/server/shared/Database/PreparedStatement.cpp b/src/server/shared/Database/PreparedStatement.cpp index 9fc3514d084..38987317988 100755 --- a/src/server/shared/Database/PreparedStatement.cpp +++ b/src/server/shared/Database/PreparedStatement.cpp @@ -201,8 +201,11 @@ m_bind(NULL) MySQLPreparedStatement::~MySQLPreparedStatement() { ClearParameters(); - delete[] m_Mstmt->bind->length; - delete[] m_Mstmt->bind->is_null; + if(m_Mstmt->bind_result_done) + { + delete[] m_Mstmt->bind->length; + delete[] m_Mstmt->bind->is_null; + } mysql_stmt_close(m_Mstmt); delete[] m_bind; } From cbcd4e6afbdbb7bdf2682be29a1b744ad0bfc5ad Mon Sep 17 00:00:00 2001 From: click Date: Sat, 24 Mar 2012 22:59:23 +0100 Subject: [PATCH 0268/1149] Core: Fix .pinfo handling of player level and securitylevel after recent cleanups (and clean up my last commit) --- src/server/game/Chat/Commands/Level2.cpp | 4 ++-- src/server/shared/Database/PreparedStatement.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index ef20b6a4d07..ca6a43457f1 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -314,7 +314,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args) Field* fields = result->Fetch(); total_player_time = fields[0].GetUInt32(); - level = fields[1].GetUInt32(); + level = fields[1].GetUInt8(); money = fields[2].GetUInt32(); accId = fields[3].GetUInt32(); race = fields[4].GetUInt8(); @@ -338,7 +338,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args) { Field* fields = result->Fetch(); username = fields[0].GetString(); - security = fields[1].GetUInt32(); + security = fields[1].GetUInt8(); email = fields[2].GetString(); muteTime = fields[5].GetUInt64(); diff --git a/src/server/shared/Database/PreparedStatement.cpp b/src/server/shared/Database/PreparedStatement.cpp index 38987317988..dd1b85f70a6 100755 --- a/src/server/shared/Database/PreparedStatement.cpp +++ b/src/server/shared/Database/PreparedStatement.cpp @@ -202,10 +202,10 @@ MySQLPreparedStatement::~MySQLPreparedStatement() { ClearParameters(); if(m_Mstmt->bind_result_done) - { - delete[] m_Mstmt->bind->length; - delete[] m_Mstmt->bind->is_null; - } + { + delete[] m_Mstmt->bind->length; + delete[] m_Mstmt->bind->is_null; + } mysql_stmt_close(m_Mstmt); delete[] m_bind; } From 61691d76981ace16f08da10e37c501edcd727ccf Mon Sep 17 00:00:00 2001 From: leak Date: Sun, 25 Mar 2012 00:00:16 +0100 Subject: [PATCH 0269/1149] Core/DBLayer: Restore pinfo timestamp output (Prepared statment results don't deliver TIMESTAMP as string) --- src/server/shared/Database/Implementation/LoginDatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp index ca7d4f95cfb..05dd89f8ace 100755 --- a/src/server/shared/Database/Implementation/LoginDatabase.cpp +++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp @@ -76,7 +76,7 @@ void LoginDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(LOGIN_GET_USERNAME_BY_ID, "SELECT username FROM account WHERE id = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(LOGIN_SEL_CHECK_PASSWORD, "SELECT 1 FROM account WHERE id = ? AND sha_pass_hash = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(LOGIN_SEL_CHECK_PASSWORD_BY_NAME, "SELECT 1 FROM account WHERE username = ? AND sha_pass_hash = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_SEL_PINFO, "SELECT a.username, aa.gmlevel, a.email, a.last_ip, a.last_login, a.mutetime FROM account a LEFT JOIN account_access aa ON (a.id = aa.id AND (aa.RealmID = ? OR aa.RealmID = -1)) WHERE a.id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_PINFO, "SELECT a.username, aa.gmlevel, a.email, a.last_ip, DATE_FORMAT(a.last_login, '%Y-%m-%d %T'), a.mutetime FROM account a LEFT JOIN account_access aa ON (a.id = aa.id AND (aa.RealmID = ? OR aa.RealmID = -1)) WHERE a.id = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(LOGIN_SEL_PINFO_BANS, "SELECT unbandate, bandate = unbandate, bannedby, banreason FROM account_banned WHERE id = ? AND active ORDER BY bandate ASC LIMIT 1", CONNECTION_SYNCH); PREPARE_STATEMENT(LOGIN_SEL_GM_ACCOUNTS, "SELECT a.username, aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel >= ? AND (aa.realmid = -1 OR aa.realmid = ?)", CONNECTION_SYNCH); PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_INFO, "SELECT a.username, a.last_ip, aa.gmlevel, a.expansion FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.id = ?", CONNECTION_SYNCH); From 192d7d735d18814e6a17f3493da34c5f188e9445 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 24 Mar 2012 23:05:00 +0000 Subject: [PATCH 0270/1149] Core/DBLayer: Few more type corrections Closes #5871 --- src/server/game/Accounts/AccountMgr.cpp | 4 ++-- src/server/game/Server/WorldSocket.cpp | 2 +- src/server/scripts/Commands/cs_account.cpp | 4 ++-- src/server/worldserver/RemoteAccess/RASocket.cpp | 4 ++-- src/server/worldserver/RemoteAccess/RASocket.h | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index cd3baca7923..eb684ae5b46 100755 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -174,7 +174,7 @@ uint32 GetSecurity(uint32 accountId) stmt->setUInt32(0, accountId); PreparedQueryResult result = LoginDatabase.Query(stmt); - return (result) ? (*result)[0].GetUInt32() : uint32(SEC_PLAYER); + return (result) ? (*result)[0].GetUInt8() : uint32(SEC_PLAYER); } uint32 GetSecurity(uint32 accountId, int32 realmId) @@ -184,7 +184,7 @@ uint32 GetSecurity(uint32 accountId, int32 realmId) stmt->setInt32(1, realmId); PreparedQueryResult result = LoginDatabase.Query(stmt); - return (result) ? (*result)[0].GetUInt32() : uint32(SEC_PLAYER); + return (result) ? (*result)[0].GetUInt8() : uint32(SEC_PLAYER); } bool GetName(uint32 accountId, std::string& name) diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 40b4a0bad4f..cf9ec7dadc4 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -909,7 +909,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) else { fields = result->Fetch(); - security = fields[0].GetInt32(); + security = fields[0].GetUInt8(); } // Re-check account ban (same check as in realmd) diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 09c5c6c6007..b52102479b5 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -227,8 +227,8 @@ public: Field* fieldsLogin = resultLogin->Fetch(); handler->PSendSysMessage(LANG_ACCOUNT_LIST_LINE, fieldsLogin[0].GetCString(), name.c_str(), fieldsLogin[1].GetCString(), - fieldsDB[2].GetUInt16(), fieldsDB[3].GetUInt16(), fieldsLogin[3].GetUInt32(), - fieldsLogin[2].GetUInt32()); + fieldsDB[2].GetUInt16(), fieldsDB[3].GetUInt16(), fieldsLogin[3].GetUInt8(), + fieldsLogin[2].GetUInt8()); } else handler->PSendSysMessage(LANG_ACCOUNT_LIST_ERROR, name.c_str()); diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp index d7b366a2e2a..ebc7c7624d9 100755 --- a/src/server/worldserver/RemoteAccess/RASocket.cpp +++ b/src/server/worldserver/RemoteAccess/RASocket.cpp @@ -32,7 +32,7 @@ RASocket::RASocket() { - iMinLevel = ConfigMgr::GetIntDefault("RA.MinLevel", 3); + _minLevel = ConfigMgr::GetIntDefault("RA.MinLevel", 3); } RASocket::~RASocket() @@ -192,7 +192,7 @@ int RASocket::check_access_level(const std::string& user) Field* fields = result->Fetch(); - if (fields[1].GetUInt32() < iMinLevel) + if (fields[1].GetUInt8() < _minLevel) { sLog->outRemote("User %s has no privilege to login", user.c_str()); return -1; diff --git a/src/server/worldserver/RemoteAccess/RASocket.h b/src/server/worldserver/RemoteAccess/RASocket.h index 1c9b1ac24b5..450245a0ff4 100755 --- a/src/server/worldserver/RemoteAccess/RASocket.h +++ b/src/server/worldserver/RemoteAccess/RASocket.h @@ -56,7 +56,7 @@ class RASocket: public ACE_Svc_Handler private: /// Minimum security level required to connect - uint8 iMinLevel; + uint8 _minLevel; }; #endif /// @} From f5a9206b0e3a940a455f0e60c8efaf713664479d Mon Sep 17 00:00:00 2001 From: click Date: Sun, 25 Mar 2012 04:20:53 +0200 Subject: [PATCH 0271/1149] Core: Remove an annoying memoryleak in OutdoorPVPMgr (Patch by Raczman) --- src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp | 2 +- src/server/game/OutdoorPvP/OutdoorPvPMgr.h | 5 ++++- src/server/worldserver/WorldThread/WorldRunnable.cpp | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp index 88e6db971f0..608067935ea 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp @@ -27,7 +27,7 @@ OutdoorPvPMgr::OutdoorPvPMgr() //sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Instantiating OutdoorPvPMgr"); } -OutdoorPvPMgr::~OutdoorPvPMgr() +void OutdoorPvPMgr::Die() { //sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Deleting OutdoorPvPMgr"); for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr) diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.h b/src/server/game/OutdoorPvP/OutdoorPvPMgr.h index 3a66a87ecba..1313e29bfb4 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.h +++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.h @@ -42,12 +42,15 @@ class OutdoorPvPMgr private: OutdoorPvPMgr(); - ~OutdoorPvPMgr(); + ~OutdoorPvPMgr() {}; public: // create outdoor pvp events void InitOutdoorPvP(); + // cleanup + void Die(); + // called when a player enters an outdoor pvp area void HandlePlayerEnterZone(Player* player, uint32 areaflag); diff --git a/src/server/worldserver/WorldThread/WorldRunnable.cpp b/src/server/worldserver/WorldThread/WorldRunnable.cpp index 8ea54ca599e..42cfaae41ec 100755 --- a/src/server/worldserver/WorldThread/WorldRunnable.cpp +++ b/src/server/worldserver/WorldThread/WorldRunnable.cpp @@ -30,6 +30,7 @@ #include "MapManager.h" #include "Timer.h" #include "WorldRunnable.h" +#include "OutdoorPvPMgr.h" #define WORLD_SLEEP_CONST 50 @@ -93,4 +94,5 @@ void WorldRunnable::run() sMapMgr->UnloadAll(); // unload all grids (including locked in memory) sObjectAccessor->UnloadAll(); // unload 'i_player2corpse' storage and remove from world sScriptMgr->Unload(); + sOutdoorPvPMgr->Die(); } From 2ba4c5fa68a5faeffc05f75c95fb47f562237251 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 25 Mar 2012 13:09:43 +0300 Subject: [PATCH 0272/1149] Core/TicketMgr: Remove a memory leak in RemoveTicket. Spotted by Subv --- src/server/game/Tickets/TicketMgr.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index 96f4438544f..c4a08766ddc 100755 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -301,6 +301,7 @@ void TicketMgr::RemoveTicket(uint32 ticketId) { ticket->DeleteFromDB(); _ticketList.erase(ticketId); + delete ticket; } } From 87176c84d3604952d03e8818d4ae13765c143ee7 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 25 Mar 2012 14:10:06 +0300 Subject: [PATCH 0273/1149] Core/DBLayer: Refine field type checks in Field::GetXXX methods. Should give us logs of wrong GetXXX calls for a certain type without having to dig trough valgrind logs. --- src/server/shared/Database/Field.h | 55 +++++++++++++++++++----------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/src/server/shared/Database/Field.h b/src/server/shared/Database/Field.h index 355f6b47ff2..36303f45e81 100755 --- a/src/server/shared/Database/Field.h +++ b/src/server/shared/Database/Field.h @@ -41,11 +41,12 @@ class Field return 0; #ifdef TRINITY_DEBUG - if (!IsNumeric()) + if (!IsType(MYSQL_TYPE_TINY)) { - sLog->outSQLDriver("Error: GetUInt8() on non-numeric field."); + sLog->outSQLDriver("Warning: GetUInt8() on non-tinyint field."); return 0; } + #endif if (data.raw) return *reinterpret_cast(data.value); @@ -58,12 +59,13 @@ class Field return 0; #ifdef TRINITY_DEBUG - if (!IsNumeric()) + if (!IsType(MYSQL_TYPE_TINY)) { - sLog->outSQLDriver("Error: GeInt8() on non-numeric field."); + sLog->outSQLDriver("Warning: GetInt8() on non-tinyint field."); return 0; } #endif + if (data.raw) return *reinterpret_cast(data.value); return static_cast(atol((char*)data.value)); @@ -75,12 +77,13 @@ class Field return 0; #ifdef TRINITY_DEBUG - if (!IsNumeric()) + if (!IsType(MYSQL_TYPE_SHORT) && !IsType(MYSQL_TYPE_YEAR)) { - sLog->outSQLDriver("Error: GetUInt16() on non-numeric field."); + sLog->outSQLDriver("Warning: GetUInt16() on non-smallint field."); return 0; } #endif + if (data.raw) return *reinterpret_cast(data.value); return static_cast(atol((char*)data.value)); @@ -92,12 +95,13 @@ class Field return 0; #ifdef TRINITY_DEBUG - if (!IsNumeric()) + if (!IsType(MYSQL_TYPE_SHORT) && !IsType(MYSQL_TYPE_YEAR)) { - sLog->outSQLDriver("Error: GetInt16() on non-numeric field."); + sLog->outSQLDriver("Warning: GetInt16() on non-smallint field."); return 0; } #endif + if (data.raw) return *reinterpret_cast(data.value); return static_cast(atol((char*)data.value)); @@ -109,12 +113,13 @@ class Field return 0; #ifdef TRINITY_DEBUG - if (!IsNumeric()) + if (!IsType(MYSQL_TYPE_INT24) && !IsType(MYSQL_TYPE_LONG)) { - sLog->outSQLDriver("Error: GetUInt32() on non-numeric field."); + sLog->outSQLDriver("Warning: GetUInt32() on non-(medium)int field."); return 0; } #endif + if (data.raw) return *reinterpret_cast(data.value); return static_cast(atol((char*)data.value)); @@ -126,12 +131,13 @@ class Field return 0; #ifdef TRINITY_DEBUG - if (!IsNumeric()) + if (!IsType(MYSQL_TYPE_INT24) && !IsType(MYSQL_TYPE_LONG)) { - sLog->outSQLDriver("Error: GetInt32() on non-numeric field."); + sLog->outSQLDriver("Warning: GetInt32() on non-(medium)int field."); return 0; } #endif + if (data.raw) return *reinterpret_cast(data.value); return static_cast(atol((char*)data.value)); @@ -143,12 +149,13 @@ class Field return 0; #ifdef TRINITY_DEBUG - if (!IsNumeric()) + if (!IsType(MYSQL_TYPE_LONGLONG) && !IsType(MYSQL_TYPE_BIT)) { - sLog->outSQLDriver("Error: GetUInt64() on non-numeric field."); + sLog->outSQLDriver("Warning: GetUInt64() on non-bigint field."); return 0; } #endif + if (data.raw) return *reinterpret_cast(data.value); return static_cast(atol((char*)data.value)); @@ -160,12 +167,13 @@ class Field return 0; #ifdef TRINITY_DEBUG - if (!IsNumeric()) + if (!IsType(MYSQL_TYPE_LONGLONG) && !IsType(MYSQL_TYPE_BIT)) { - sLog->outSQLDriver("Error: GetInt64() on non-numeric field."); + sLog->outSQLDriver("Warning: GetInt64() on non-bigint field."); return 0; } #endif + if (data.raw) return *reinterpret_cast(data.value); return static_cast(strtol((char*)data.value, NULL, 10)); @@ -177,12 +185,13 @@ class Field return 0.0f; #ifdef TRINITY_DEBUG - if (!IsNumeric()) + if (!IsType(MYSQL_TYPE_FLOAT)) { - sLog->outSQLDriver("Error: GetFloat() on non-numeric field."); + sLog->outSQLDriver("Warning: GetFloat() on non-float field."); return 0.0f; } #endif + if (data.raw) return *reinterpret_cast(data.value); return static_cast(atof((char*)data.value)); @@ -194,12 +203,13 @@ class Field return 0.0f; #ifdef TRINITY_DEBUG - if (!IsNumeric()) + if (!IsType(MYSQL_TYPE_FLOAT)) { - sLog->outSQLDriver("Error: GetDouble() on non-numeric field."); + sLog->outSQLDriver("Warning: GetDouble() on non-double field."); return 0.0f; } #endif + if (data.raw) return *reinterpret_cast(data.value); return static_cast(atof((char*)data.value)); @@ -316,6 +326,11 @@ class Field } } + bool IsType(enum_field_types type) const + { + return data.type == type; + } + bool IsNumeric() const { return (data.type == MYSQL_TYPE_TINY || From eda06321b95a38adbb0cc67d39b7780123f4a635 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 25 Mar 2012 14:11:24 +0300 Subject: [PATCH 0274/1149] Update src/server/shared/Database/Field.h --- src/server/shared/Database/Field.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/shared/Database/Field.h b/src/server/shared/Database/Field.h index 36303f45e81..2c5e7d47ca4 100755 --- a/src/server/shared/Database/Field.h +++ b/src/server/shared/Database/Field.h @@ -203,7 +203,7 @@ class Field return 0.0f; #ifdef TRINITY_DEBUG - if (!IsType(MYSQL_TYPE_FLOAT)) + if (!IsType(MYSQL_TYPE_DOUBLE)) { sLog->outSQLDriver("Warning: GetDouble() on non-double field."); return 0.0f; From 56fac5e1afc0596c32dc349d5bc0218fd8a0b13d Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 25 Mar 2012 09:25:28 -0500 Subject: [PATCH 0275/1149] Memory: Get rid of some memory leaks, converted FormationMgr back to singleton --- .../game/Entities/Creature/Creature.cpp | 8 +++---- .../game/Entities/Creature/CreatureGroups.cpp | 21 +++++++++---------- .../game/Entities/Creature/CreatureGroups.h | 21 ++++++++++++------- src/server/game/Tickets/TicketMgr.cpp | 12 +++++++---- src/server/game/Tickets/TicketMgr.h | 1 + src/server/game/World/World.cpp | 2 +- src/server/scripts/Commands/cs_npc.cpp | 2 +- 7 files changed, 38 insertions(+), 29 deletions(-) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 1706a56a5ee..9c0b3e50db6 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -199,7 +199,7 @@ void Creature::RemoveFromWorld() if (m_zoneScript) m_zoneScript->OnCreatureRemove(this); if (m_formation) - FormationMgr::RemoveCreatureFromGroup(m_formation, this); + sFormationMgr->RemoveCreatureFromGroup(m_formation, this); Unit::RemoveFromWorld(); sObjectAccessor->RemoveObject(this); } @@ -224,9 +224,9 @@ void Creature::SearchFormation() if (!lowguid) return; - CreatureGroupInfoType::iterator frmdata = CreatureGroupMap.find(lowguid); - if (frmdata != CreatureGroupMap.end()) - FormationMgr::AddCreatureToGroup(frmdata->second->leaderGUID, this); + CreatureGroupInfoType::iterator frmdata = sFormationMgr->CreatureGroupMap.find(lowguid); + if (frmdata != sFormationMgr->CreatureGroupMap.end()) + sFormationMgr->AddCreatureToGroup(frmdata->second->leaderGUID, this); } void Creature::RemoveCorpse(bool setSpawnTime) diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp index c95d77db358..bcedfa40864 100755 --- a/src/server/game/Entities/Creature/CreatureGroups.cpp +++ b/src/server/game/Entities/Creature/CreatureGroups.cpp @@ -24,12 +24,13 @@ #define MAX_DESYNC 5.0f -CreatureGroupInfoType CreatureGroupMap; - -namespace FormationMgr +FormationMgr::~FormationMgr() { + for (CreatureGroupInfoType::iterator itr = CreatureGroupMap.begin(); itr != CreatureGroupMap.end(); ++itr) + delete itr->second; +} -void AddCreatureToGroup(uint32 groupId, Creature* member) +void FormationMgr::AddCreatureToGroup(uint32 groupId, Creature* member) { Map* map = member->FindMap(); if (!map) @@ -53,7 +54,7 @@ void AddCreatureToGroup(uint32 groupId, Creature* member) } } -void RemoveCreatureFromGroup(CreatureGroup* group, Creature* member) +void FormationMgr::RemoveCreatureFromGroup(CreatureGroup* group, Creature* member) { sLog->outDebug(LOG_FILTER_UNITS, "Deleting member pointer to GUID: %u from group %u", group->GetId(), member->GetDBTableGUIDLow()); group->RemoveMember(member); @@ -70,7 +71,7 @@ void RemoveCreatureFromGroup(CreatureGroup* group, Creature* member) } } -void LoadCreatureFormations() +void FormationMgr::LoadCreatureFormations() { uint32 oldMSTime = getMSTime(); @@ -97,7 +98,7 @@ void LoadCreatureFormations() fields = result->Fetch(); //Load group member data - group_member = new FormationInfo; + group_member = new FormationInfo(); group_member->leaderGUID = fields[0].GetUInt32(); uint32 memberGUID = fields[1].GetUInt32(); group_member->groupAI = fields[4].GetUInt8(); @@ -139,8 +140,6 @@ void LoadCreatureFormations() sLog->outString(); } -} // Namespace - void CreatureGroup::AddMember(Creature* member) { sLog->outDebug(LOG_FILTER_UNITS, "CreatureGroup::AddMember: Adding unit GUID: %u.", member->GetGUIDLow()); @@ -152,7 +151,7 @@ void CreatureGroup::AddMember(Creature* member) m_leader = member; } - m_members[member] = CreatureGroupMap.find(member->GetDBTableGUIDLow())->second; + m_members[member] = sFormationMgr->CreatureGroupMap.find(member->GetDBTableGUIDLow())->second; member->SetFormation(this); } @@ -167,7 +166,7 @@ void CreatureGroup::RemoveMember(Creature* member) void CreatureGroup::MemberAttackStart(Creature* member, Unit* target) { - uint8 groupAI = CreatureGroupMap[member->GetDBTableGUIDLow()]->groupAI; + uint8 groupAI = sFormationMgr->CreatureGroupMap[member->GetDBTableGUIDLow()]->groupAI; if (!groupAI) return; diff --git a/src/server/game/Entities/Creature/CreatureGroups.h b/src/server/game/Entities/Creature/CreatureGroups.h index 80e552f7e93..e5b8771ee40 100755 --- a/src/server/game/Entities/Creature/CreatureGroups.h +++ b/src/server/game/Entities/Creature/CreatureGroups.h @@ -34,16 +34,19 @@ struct FormationInfo uint8 groupAI; }; -namespace FormationMgr -{ - void AddCreatureToGroup(uint32 group_id, Creature* creature); - void RemoveCreatureFromGroup(CreatureGroup* group, Creature* creature); - void LoadCreatureFormations(); -}; - typedef UNORDERED_MAP CreatureGroupInfoType; -extern CreatureGroupInfoType CreatureGroupMap; +class FormationMgr +{ + friend class ACE_Singleton; + public: + FormationMgr() { } + ~FormationMgr(); + void AddCreatureToGroup(uint32 group_id, Creature* creature); + void RemoveCreatureFromGroup(CreatureGroup* group, Creature* creature); + void LoadCreatureFormations(); + CreatureGroupInfoType CreatureGroupMap; +}; class CreatureGroup { @@ -73,4 +76,6 @@ class CreatureGroup void MemberAttackStart(Creature* member, Unit* target); }; +#define sFormationMgr ACE_Singleton::instance() + #endif diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index c4a08766ddc..e4b8ea2e034 100755 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -198,6 +198,12 @@ void GmTicket::TeleportTo(Player* player) const // Ticket manager TicketMgr::TicketMgr() : _status(true), _lastTicketId(0), _lastSurveyId(0), _openTicketCount(0), _lastChange(time(NULL)) { } +TicketMgr::~TicketMgr() +{ + for (GmTicketList::const_iterator itr = _ticketList.begin(); itr != _ticketList.end(); ++itr) + delete itr->second; +} + void TicketMgr::Initialize() { SetStatus(sWorld->getBoolConfig(CONFIG_ALLOW_TICKETS)); } void TicketMgr::ResetTickets() @@ -217,10 +223,8 @@ void TicketMgr::LoadTickets() { uint32 oldMSTime = getMSTime(); - if (!_ticketList.empty()) - for (GmTicketList::const_iterator itr = _ticketList.begin(); itr != _ticketList.end(); ++itr) - if (itr->second) - delete itr->second; + for (GmTicketList::const_iterator itr = _ticketList.begin(); itr != _ticketList.end(); ++itr) + delete itr->second; _ticketList.clear(); _lastTicketId = 0; diff --git a/src/server/game/Tickets/TicketMgr.h b/src/server/game/Tickets/TicketMgr.h index cb0a1bab22b..5695880542c 100755 --- a/src/server/game/Tickets/TicketMgr.h +++ b/src/server/game/Tickets/TicketMgr.h @@ -166,6 +166,7 @@ class TicketMgr private: TicketMgr(); + ~TicketMgr(); public: void LoadTickets(); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index cef79a1c32a..95d6b8a93a9 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1589,7 +1589,7 @@ void World::SetInitialWorldSettings() sSmartWaypointMgr->LoadFromDB(); sLog->outString("Loading Creature Formations..."); - FormationMgr::LoadCreatureFormations(); + sFormationMgr->LoadCreatureFormations(); sLog->outString("Loading World States..."); // must be loaded before battleground, outdoor PvP and conditions LoadWorldStates(); diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 90615a3bd88..249506fb0f1 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -1249,7 +1249,7 @@ public: group_member->leaderGUID = leaderGUID; group_member->groupAI = 0; - CreatureGroupMap[lowguid] = group_member; + sFormationMgr->CreatureGroupMap[lowguid] = group_member; creature->SearchFormation(); PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_CREATURE_FORMATION); From c6cbe4c77c5fcd4d296f31d471b4806ebe3d099d Mon Sep 17 00:00:00 2001 From: leak Date: Sun, 25 Mar 2012 16:22:24 +0200 Subject: [PATCH 0276/1149] Core/DBLayer: Convert PAppend() queries to prepared statements No.1 --- src/server/game/Accounts/AccountMgr.cpp | 14 +++- .../game/Achievements/AchievementMgr.cpp | 11 ++- .../game/Battlegrounds/ArenaTeamMgr.cpp | 9 ++- .../game/Entities/Creature/Creature.cpp | 71 +++++++++++-------- .../game/Entities/GameObject/GameObject.cpp | 49 +++++++------ src/server/game/Entities/Item/Item.cpp | 22 ++++-- src/server/game/Groups/Group.cpp | 14 +++- .../game/Handlers/AuctionHouseHandler.cpp | 6 +- src/server/game/Handlers/CharacterHandler.cpp | 2 +- src/server/game/Handlers/ItemHandler.cpp | 9 ++- src/server/game/Handlers/MailHandler.cpp | 11 ++- src/server/game/Handlers/PetHandler.cpp | 25 +++++-- src/server/game/Handlers/PetitionsHandler.cpp | 21 ++++-- src/server/game/Instances/InstanceSaveMgr.cpp | 39 +++++++--- src/server/game/Reputation/ReputationMgr.cpp | 14 +++- src/server/game/World/World.cpp | 2 +- .../Implementation/CharacterDatabase.cpp | 23 ++++++ .../Implementation/CharacterDatabase.h | 23 ++++++ .../Database/Implementation/LoginDatabase.cpp | 4 +- .../Database/Implementation/LoginDatabase.h | 2 + .../Database/Implementation/WorldDatabase.cpp | 4 ++ .../Database/Implementation/WorldDatabase.h | 4 ++ 22 files changed, 288 insertions(+), 91 deletions(-) diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index eb684ae5b46..240609e3821 100755 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -97,9 +97,17 @@ AccountOpResult DeleteAccount(uint32 accountId) SQLTransaction trans = LoginDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM account WHERE id='%d'", accountId); - trans->PAppend("DELETE FROM account_access WHERE id ='%d'", accountId); - trans->PAppend("DELETE FROM realmcharacters WHERE acctid='%d'", accountId); + stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT); + stmt->setUInt32(0, accountId); + trans->Append(stmt); + + stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_ACCESS); + stmt->setUInt32(0, accountId); + trans->Append(stmt); + + stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS); + stmt->setUInt32(0, accountId); + trans->Append(stmt); LoginDatabase.CommitTransaction(trans); diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 271e78abf67..3de4f72affe 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -496,8 +496,15 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uin void AchievementMgr::DeleteFromDB(uint32 lowguid) { SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM character_achievement WHERE guid = %u", lowguid); - trans->PAppend("DELETE FROM character_achievement_progress WHERE guid = %u", lowguid); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT); + stmt->setUInt32(0, lowguid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS); + stmt->setUInt32(0, lowguid); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); } diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp index 37aebab5225..ab451a38fa8 100644 --- a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp +++ b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp @@ -153,6 +153,8 @@ void ArenaTeamMgr::DistributeArenaPoints() SQLTransaction trans = CharacterDatabase.BeginTransaction(); + PreparedStatement* stmt; + // Cycle that gives points to all players for (std::map::iterator playerItr = PlayerPoints.begin(); playerItr != PlayerPoints.end(); ++playerItr) { @@ -160,7 +162,12 @@ void ArenaTeamMgr::DistributeArenaPoints() if (Player* player = HashMapHolder::Find(playerItr->first)) player->ModifyArenaPoints(playerItr->second, &trans); else // Update database - trans->PAppend("UPDATE characters SET arenaPoints=arenaPoints+%u WHERE guid=%u", playerItr->second, playerItr->first); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_ARENA_POINTS); + stmt->setUInt32(0, playerItr->second); + stmt->setUInt32(1, playerItr->first); + trans->Append(stmt); + } } CharacterDatabase.CommitTransaction(trans); diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 9c0b3e50db6..6a8ae07291a 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1099,32 +1099,34 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) // update in DB SQLTransaction trans = WorldDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM creature WHERE guid = '%u'", m_DBTableGuid); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE); + stmt->setUInt32(0, m_DBTableGuid); + trans->Append(stmt); - std::ostringstream ss; - ss << "INSERT INTO creature VALUES (" - << m_DBTableGuid << ',' - << GetEntry() << ',' - << mapid << ',' - << uint32(spawnMask) << ',' // cast to prevent save as symbol - << uint16(GetPhaseMask()) << ',' // prevent out of range error - << displayId << ',' - << GetEquipmentId() << ',' - << GetPositionX() << ',' - << GetPositionY() << ',' - << GetPositionZ() << ',' - << GetOrientation() << ',' - << m_respawnDelay << ',' //respawn time - << (float) m_respawnradius << ',' //spawn distance (float) - << (uint32) (0) << ',' //currentwaypoint - << GetHealth() << ',' //curhealth - << GetPower(POWER_MANA) << ',' //curmana - << GetDefaultMovementType() << ',' //default movement generator type - << npcflag << ',' - << unit_flags << ',' - << dynamicflags << ')'; + uint8 index = 0; - trans->Append(ss.str().c_str()); + stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_CREATURE); + stmt->setUInt32(index++, m_DBTableGuid); + stmt->setUInt32(index++, GetEntry()); + stmt->setUInt16(index++, uint16(mapid)); + stmt->setUInt8(index++, spawnMask); + stmt->setUInt16(index++, uint16(GetPhaseMask())); + stmt->setUInt32(index++, displayId); + stmt->setInt32(index++, int32(GetEquipmentId())); + stmt->setFloat(index++, GetPositionX()); + stmt->setFloat(index++, GetPositionY()); + stmt->setFloat(index++, GetPositionZ()); + stmt->setFloat(index++, GetOrientation()); + stmt->setUInt32(index++, m_respawnDelay); + stmt->setFloat(index++, m_respawnradius); + stmt->setUInt32(index++, 0); + stmt->setUInt32(index++, GetHealth()); + stmt->setUInt32(index++, GetPower(POWER_MANA)); + stmt->setUInt8(index++, uint8(GetDefaultMovementType())); + stmt->setUInt32(index++, npcflag); + stmt->setUInt32(index++, unit_flags); + stmt->setUInt32(index, dynamicflags); + trans->Append(stmt); WorldDatabase.CommitTransaction(trans); } @@ -1397,10 +1399,23 @@ void Creature::DeleteFromDB() sObjectMgr->DeleteCreatureData(m_DBTableGuid); SQLTransaction trans = WorldDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM creature WHERE guid = '%u'", m_DBTableGuid); - trans->PAppend("DELETE FROM creature_addon WHERE guid = '%u'", m_DBTableGuid); - trans->PAppend("DELETE FROM game_event_creature WHERE guid = '%u'", m_DBTableGuid); - trans->PAppend("DELETE FROM game_event_model_equip WHERE guid = '%u'", m_DBTableGuid); + + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE); + stmt->setUInt32(0, m_DBTableGuid); + trans->Append(stmt); + + stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE_ADDON); + stmt->setUInt32(0, m_DBTableGuid); + trans->Append(stmt); + + stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAME_EVENT_CREATURE); + stmt->setUInt32(0, m_DBTableGuid); + trans->Append(stmt); + + stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAME_EVENT_MODEL_EQUIP); + stmt->setUInt32(0, m_DBTableGuid); + trans->Append(stmt); + WorldDatabase.CommitTransaction(trans); } diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 1cd8fa17183..910e9c86b42 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -686,29 +686,34 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) data.spawnMask = spawnMask; data.artKit = GetGoArtKit(); - // update in DB - std::ostringstream ss; - ss << "INSERT INTO gameobject VALUES (" - << m_DBTableGuid << ',' - << GetEntry() << ',' - << mapid << ',' - << uint32(spawnMask) << ',' // cast to prevent save as symbol - << uint16(GetPhaseMask()) << ',' // prevent out of range error - << GetPositionX() << ',' - << GetPositionY() << ',' - << GetPositionZ() << ',' - << GetOrientation() << ',' - << GetFloatValue(GAMEOBJECT_PARENTROTATION) << ',' - << GetFloatValue(GAMEOBJECT_PARENTROTATION+1) << ',' - << GetFloatValue(GAMEOBJECT_PARENTROTATION+2) << ',' - << GetFloatValue(GAMEOBJECT_PARENTROTATION+3) << ',' - << m_respawnDelayTime << ',' - << uint32(GetGoAnimProgress()) << ',' - << uint32(GetGoState()) << ')'; - + // Update in DB SQLTransaction trans = WorldDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM gameobject WHERE guid = '%u'", m_DBTableGuid); - trans->Append(ss.str().c_str()); + + uint8 index = 0; + + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAMEOBJECT); + stmt->setUInt32(0, m_DBTableGuid); + trans->Append(stmt); + + stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_GAMEOBJECT); + stmt->setUInt32(index++, m_DBTableGuid); + stmt->setUInt32(index++, GetEntry()); + stmt->setUInt16(index++, uint16(mapid)); + stmt->setUInt8(index++, spawnMask); + stmt->setUInt16(index++, uint16(GetPhaseMask())); + stmt->setFloat(index++, GetPositionX()); + stmt->setFloat(index++, GetPositionY()); + stmt->setFloat(index++, GetPositionZ()); + stmt->setFloat(index++, GetOrientation()); + stmt->setFloat(index++, GetFloatValue(GAMEOBJECT_PARENTROTATION)); + stmt->setFloat(index++, GetFloatValue(GAMEOBJECT_PARENTROTATION+1)); + stmt->setFloat(index++, GetFloatValue(GAMEOBJECT_PARENTROTATION+2)); + stmt->setFloat(index++, GetFloatValue(GAMEOBJECT_PARENTROTATION+3)); + stmt->setInt32(index++, int32(m_respawnDelayTime)); + stmt->setUInt8(index++, GetGoAnimProgress()); + stmt->setUInt8(index++, uint8(GetGoState())); + trans->Append(stmt); + WorldDatabase.CommitTransaction(trans); } diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 90f6f4a217c..4a1d5d5749a 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1082,16 +1082,30 @@ void Item::BuildUpdate(UpdateDataMapType& data_map) void Item::SaveRefundDataToDB() { SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM item_refund_instance WHERE item_guid = '%u'", GetGUIDLow()); - trans->PAppend("INSERT INTO item_refund_instance (`item_guid`, `player_guid`, `paidMoney`, `paidExtendedCost`)" - " VALUES('%u', '%u', '%u', '%u')", GetGUIDLow(), GetRefundRecipient(), GetPaidMoney(), GetPaidExtendedCost()); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_REFUND_INSTANCE); + stmt->setUInt32(0, GetGUIDLow()); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEM_REFUND_INSTANCE); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(0, GetRefundRecipient()); + stmt->setUInt32(0, GetPaidMoney()); + stmt->setUInt16(0, uint16(GetPaidExtendedCost())); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); } void Item::DeleteRefundDataFromDB(SQLTransaction* trans) { if (trans && !trans->null()) - (*trans)->PAppend("DELETE FROM item_refund_instance WHERE item_guid = '%u'", GetGUIDLow()); + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_REFUND_INSTANCE); + stmt->setUInt32(0, GetGUIDLow()); + (*trans)->Append(stmt); + + } } void Item::SetNotRefundable(Player* owner, bool changestate /*=true*/, SQLTransaction* trans /*=NULL*/) diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 9879ef7ff3b..a27ea9eb281 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -698,13 +698,21 @@ void Group::Disband(bool hideDestroy /* = false */) if (!isBGGroup()) { SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM groups WHERE guid = %u", m_dbStoreId); - trans->PAppend("DELETE FROM group_member WHERE guid = %u", m_dbStoreId); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP); + stmt->setUInt32(0, m_dbStoreId); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER_ALL); + stmt->setUInt32(0, m_dbStoreId); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); + ResetInstances(INSTANCE_RESET_GROUP_DISBAND, false, NULL); ResetInstances(INSTANCE_RESET_GROUP_DISBAND, true, NULL); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_LFG_DATA); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_LFG_DATA); stmt->setUInt32(0, m_dbStoreId); CharacterDatabase.Execute(stmt); diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index f82c52204fb..d26f275b864 100755 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -438,7 +438,11 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data) auction->bid = price; GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, price); - trans->PAppend("UPDATE auctionhouse SET buyguid = '%u', lastbid = '%u' WHERE id = '%u'", auction->bidder, auction->bid, auction->Id); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_AUCTION_BID); + stmt->setUInt32(0, auction->bidder); + stmt->setUInt32(1, auction->bid); + stmt->setUInt32(2, auction->Id); + trans->Append(stmt); SendAuctionCommandResult(auction->Id, AUCTION_PLACE_BID, AUCTION_OK, 0); } diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index b7225e89235..377b5254144 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -640,7 +640,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte SQLTransaction trans = LoginDatabase.BeginTransaction(); - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS_BY_REALM); stmt->setUInt32(0, GetAccountId()); stmt->setUInt32(1, realmID); trans->Append(stmt); diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 2434ba6eaa7..8a60f21dac9 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1124,7 +1124,14 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) } SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("INSERT INTO character_gifts VALUES ('%u', '%u', '%u', '%u')", GUID_LOPART(item->GetOwnerGUID()), item->GetGUIDLow(), item->GetEntry(), item->GetUInt32Value(ITEM_FIELD_FLAGS)); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_GIFT); + stmt->setUInt32(0, GUID_LOPART(item->GetOwnerGUID())); + stmt->setUInt32(0, item->GetGUIDLow()); + stmt->setUInt32(0, item->GetEntry()); + stmt->setUInt32(0, item->GetUInt32Value(ITEM_FIELD_FLAGS)); + trans->Append(stmt); + item->SetEntry(gift->GetEntry()); switch (item->GetEntry()) diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 117824bfb62..7a8d19ee038 100755 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -374,8 +374,15 @@ void WorldSession::HandleMailReturnToSender(WorldPacket & recv_data) //we can return mail now //so firstly delete the old one SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM mail WHERE id = '%u'", mailId); // needed? - trans->PAppend("DELETE FROM mail_items WHERE mail_id = '%u'", mailId); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL); + stmt->setUInt32(0, mailId); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEM_BY_ID); + stmt->setUInt32(0, mailId); + trans->Append(stmt); + player->RemoveMail(mailId); // only return mail if the player exists (and delete if not existing) diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 8da7683459e..8a7c264ef67 100755 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -647,15 +647,26 @@ void WorldSession::HandlePetRename(WorldPacket & recv_data) SQLTransaction trans = CharacterDatabase.BeginTransaction(); if (isdeclined) { - for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i) - CharacterDatabase.EscapeString(declinedname.name[i]); - trans->PAppend("DELETE FROM character_pet_declinedname WHERE owner = '%u' AND id = '%u'", _player->GetGUIDLow(), pet->GetCharmInfo()->GetPetNumber()); - trans->PAppend("INSERT INTO character_pet_declinedname (id, owner, genitive, dative, accusative, instrumental, prepositional) VALUES ('%u', '%u', '%s', '%s', '%s', '%s', '%s')", - pet->GetCharmInfo()->GetPetNumber(), _player->GetGUIDLow(), declinedname.name[0].c_str(), declinedname.name[1].c_str(), declinedname.name[2].c_str(), declinedname.name[3].c_str(), declinedname.name[4].c_str()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_DECLINEDNAME); + stmt->setUInt32(0, _player->GetGUIDLow()); + stmt->setUInt32(0, pet->GetCharmInfo()->GetPetNumber()); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_CHAR_PET_DECLINEDNAME); + stmt->setUInt32(0, _player->GetGUIDLow()); + + for (uint8 i = 0; i < 5; i++) + stmt->setString(i+1, declinedname.name[i]); + + trans->Append(stmt); } - CharacterDatabase.EscapeString(name); - trans->PAppend("UPDATE character_pet SET name = '%s', renamed = '1' WHERE owner = '%u' AND id = '%u'", name.c_str(), _player->GetGUIDLow(), pet->GetCharmInfo()->GetPetNumber()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_PET_NAME); + stmt->setString(0, name); + stmt->setUInt32(1, _player->GetGUIDLow()); + stmt->setUInt32(2, pet->GetCharmInfo()->GetPetNumber()); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index e072004c48c..a6a6637deaf 100755 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -239,8 +239,14 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) SQLTransaction trans = CharacterDatabase.BeginTransaction(); trans->PAppend("DELETE FROM petition WHERE petitionguid IN (%s)", ssInvalidPetitionGUIDs.str().c_str()); trans->PAppend("DELETE FROM petition_sign WHERE petitionguid IN (%s)", ssInvalidPetitionGUIDs.str().c_str()); - trans->PAppend("INSERT INTO petition (ownerguid, petitionguid, name, type) VALUES ('%u', '%u', '%s', '%u')", - _player->GetGUIDLow(), charter->GetGUIDLow(), name.c_str(), type); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PETITION); + stmt->setUInt32(0, _player->GetGUIDLow()); + stmt->setUInt32(1, charter->GetGUIDLow()); + stmt->setString(2, name); + stmt->setUInt8(3, uint8(type)); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); } @@ -901,8 +907,15 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) } SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionGuid)); - trans->PAppend("DELETE FROM petition_sign WHERE petitionguid = '%u'", GUID_LOPART(petitionGuid)); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PETITION_BY_GUID); + stmt->setUInt32(0, GUID_LOPART(petitionGuid)); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PETITION_SIGNATURE); + stmt->setUInt32(0, GUID_LOPART(petitionGuid)); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); // created diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index 752cfde63d3..ca39c137274 100755 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -124,11 +124,21 @@ InstanceSave* InstanceSaveManager::GetInstanceSave(uint32 InstanceId) void InstanceSaveManager::DeleteInstanceFromDB(uint32 instanceid) { SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM instance WHERE id = '%u'", instanceid); - trans->PAppend("DELETE FROM character_instance WHERE instance = '%u'", instanceid); - trans->PAppend("DELETE FROM group_instance WHERE instance = '%u'", instanceid); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INSTANCE_BY_INSTANCE); + stmt->setUInt32(0, instanceid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE); + stmt->setUInt32(0, instanceid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_INSTANCE_BY_INSTANCE); + stmt->setUInt32(0, instanceid); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); - // respawn times should be deleted only when the map gets unloaded + // Respawn times should be deleted only when the map gets unloaded } void InstanceSaveManager::RemoveInstanceSave(uint32 InstanceId) @@ -568,9 +578,22 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b // delete them from the DB, even if not loaded SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM character_instance USING character_instance LEFT JOIN instance ON character_instance.instance = id WHERE map = '%u' and difficulty='%u'", mapid, difficulty); - trans->PAppend("DELETE FROM group_instance USING group_instance LEFT JOIN instance ON group_instance.instance = id WHERE map = '%u' and difficulty='%u'", mapid, difficulty); - trans->PAppend("DELETE FROM instance WHERE map = '%u' and difficulty='%u'", mapid, difficulty); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE_BY_MAP_DIFF); + stmt->setUInt16(0, uint16(mapid)); + stmt->setUInt8(0, uint8(difficulty)); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_INSTANCE_BY_MAP_DIFF); + stmt->setUInt16(0, uint16(mapid)); + stmt->setUInt8(0, uint8(difficulty)); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INSTANCE_BY_MAP_DIFF); + stmt->setUInt16(0, uint16(mapid)); + stmt->setUInt8(0, uint8(difficulty)); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); // calculate the next reset time @@ -586,7 +609,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b ScheduleReset(true, time_t(next_reset-3600), InstResetEvent(1, mapid, difficulty, 0)); // Update it in the DB - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GLOBAL_INSTANCE_RESETTIME); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GLOBAL_INSTANCE_RESETTIME); stmt->setUInt32(0, next_reset); stmt->setUInt16(1, uint16(mapid)); diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index 2a50f6e3c85..a9a02170e5f 100755 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -568,8 +568,18 @@ void ReputationMgr::SaveToDB(SQLTransaction& trans) { if (itr->second.needSave) { - trans->PAppend("DELETE FROM character_reputation WHERE guid = '%u' AND faction='%u'", _player->GetGUIDLow(), itr->second.ID); - trans->PAppend("INSERT INTO character_reputation (guid, faction, standing, flags) VALUES ('%u', '%u', '%i', '%u')", _player->GetGUIDLow(), itr->second.ID, itr->second.Standing, itr->second.Flags); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_REPUTATION_BY_FACTION); + stmt->setUInt32(0, _player->GetGUIDLow()); + stmt->setUInt16(1, uint16(itr->second.ID)); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_REPUTATION_BY_FACTION); + stmt->setUInt32(0, _player->GetGUIDLow()); + stmt->setUInt16(1, uint16(itr->second.ID)); + stmt->setInt32(2, itr->second.Standing); + stmt->setUInt16(3, uint16(itr->second.Flags)); + trans->Append(stmt); + itr->second.needSave = false; } } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 95d6b8a93a9..99a04ddfd7e 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -2672,7 +2672,7 @@ void World::_UpdateRealmCharCount(PreparedQueryResult resultCharCount) uint32 accountId = fields[0].GetUInt32(); uint32 charCount = fields[1].GetUInt32(); - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS_BY_REALM); stmt->setUInt32(0, accountId); stmt->setUInt32(1, realmID); LoginDatabase.Execute(stmt); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 65c59cc48f7..cfd61e35c4d 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -111,6 +111,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_INS_AUCTION, "INSERT INTO auctionhouse (id, auctioneerguid, itemguid, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_AUCTION, "DELETE FROM auctionhouse WHERE id = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_AUCTION_BY_TIME, "SELECT id FROM auctionhouse WHERE time <= ? ORDER BY TIME ASC", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_UPD_AUCTION_BID, "UPDATE auctionhouse SET buyguid = ?, lastbid = ? WHERE id = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_MAIL, "INSERT INTO mail(id, messageType, stationery, mailTemplateId, sender, receiver, subject, body, has_items, expire_time, deliver_time, money, cod, checked) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_MAIL, "DELETE FROM mail WHERE id = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_INS_MAIL_ITEM, "INSERT INTO mail_items(mail_id, item_guid, receiver) VALUES (?, ?, ?)", CONNECTION_ASYNC) @@ -448,4 +449,26 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND id = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND entry = ? AND (slot = ? OR slot > ?)", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND (slot = ? OR slot > ?) ", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_DEL_CHAR_ACHIEVEMENT, "DELETE FROM character_achievement WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS, "DELETE FROM character_achievement_progress WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_REPUTATION_BY_FACTION, "DELETE FROM character_reputation WHERE guid = ? AND faction = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_REPUTATION_BY_FACTION, "INSERT INTO character_reputation (guid, faction, standing, flags) VALUES (?, ?, ? , ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_ARENA_POINTS, "UPDATE characters SET arenaPoints = (arenaPoints + ?) WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_ITEM_REFUND_INSTANCE, "DELETE FROM item_refund_instance WHERE item_guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_ITEM_REFUND_INSTANCE, "INSERT INTO item_refund_instance (item_guid, player_guid, paidMoney, paidExtendedCost) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_GROUP, "DELETE FROM groups WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_GROUP_MEMBER_ALL, "DELETE FROM group_member WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_GIFT, "INSERT INTO character_gifts (guid, item_guid, entry, flags) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_INSTANCE_BY_INSTANCE, "DELETE FROM instance WHERE id = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE, "DELETE FROM character_instance WHERE instance = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_INSTANCE_BY_MAP_DIFF, "DELETE FROM character_instance USING character_instance LEFT JOIN instance ON character_instance.instance = id WHERE map = ? and difficulty = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_GROUP_INSTANCE_BY_MAP_DIFF, "DELETE FROM group_instance USING group_instance LEFT JOIN instance ON group_instance.instance = id WHERE map = ? and difficulty = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_INSTANCE_BY_MAP_DIFF, "DELETE FROM instance WHERE map = ? and difficulty = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_MAIL_ITEM_BY_ID, "DELETE FROM mail_items WHERE mail_id = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_PET_DECLINEDNAME, "DELETE FROM character_pet_declinedname WHERE owner = ? AND id = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_ADD_CHAR_PET_DECLINEDNAME, "INSERT INTO character_pet_declinedname (id, owner, genitive, dative, accusative, instrumental, prepositional) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_PET_NAME, "UPDATE character_pet SET name = ?, renamed = 1 WHERE owner = ? AND id = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_PETITION, "INSERT INTO petition (ownerguid, petitionguid, name, type) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PETITION_BY_GUID, "DELETE FROM petition WHERE petitionguid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PETITION_SIGNATURE_BY_GUID, "DELETE FROM petition_sign WHERE petitionguid = '%u'", CONNECTION_ASYNC); } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 3752051716f..ac920f0f25c 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -120,6 +120,7 @@ enum CharacterDatabaseStatements CHAR_INS_AUCTION, CHAR_DEL_AUCTION, CHAR_SEL_AUCTION_BY_TIME, + CHAR_UPD_AUCTION_BID, CHAR_SEL_AUCTIONS, CHAR_INS_MAIL, CHAR_DEL_MAIL, @@ -411,6 +412,28 @@ enum CharacterDatabaseStatements CHAR_SEL_CHAR_PET_BY_ENTRY, CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, CHAR_SEL_CHAR_PET_BY_SLOT, + CHAR_DEL_CHAR_ACHIEVEMENT, + CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS, + CHAR_DEL_CHAR_REPUTATION_BY_FACTION, + CHAR_INS_CHAR_REPUTATION_BY_FACTION, + CHAR_UPD_CHAR_ARENA_POINTS, + CHAR_DEL_ITEM_REFUND_INSTANCE, + CHAR_INS_ITEM_REFUND_INSTANCE, + CHAR_DEL_GROUP, + CHAR_DEL_GROUP_MEMBER_ALL, + CHAR_INS_CHAR_GIFT, + CHAR_DEL_INSTANCE_BY_INSTANCE, + CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE, + CHAR_DEL_CHAR_INSTANCE_BY_MAP_DIFF, + CHAR_DEL_GROUP_INSTANCE_BY_MAP_DIFF, + CHAR_DEL_INSTANCE_BY_MAP_DIFF, + CHAR_DEL_MAIL_ITEM_BY_ID, + CHAR_DEL_CHAR_PET_DECLINEDNAME, + CHAR_ADD_CHAR_PET_DECLINEDNAME, + CHAR_UPD_CHAR_PET_NAME, + CHAR_INS_PETITION, + CHAR_DEL_PETITION_BY_GUID, + CHAR_DEL_PETITION_SIGNATURE_BY_GUID, MAX_CHARACTERDATABASE_STATEMENTS, }; diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp index 05dd89f8ace..bc8eb709788 100755 --- a/src/server/shared/Database/Implementation/LoginDatabase.cpp +++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp @@ -50,7 +50,8 @@ void LoginDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(LOGIN_DEL_IP_NOT_BANNED, "DELETE FROM ip_banned WHERE ip = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_INS_ACCOUNT_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?, 1)", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_UPD_ACCOUNT_NOT_BANNED, "UPDATE account_banned SET active = 0 WHERE id = ? AND active != 0", CONNECTION_ASYNC) - PREPARE_STATEMENT(LOGIN_DEL_REALM_CHARACTERS, "DELETE FROM realmcharacters WHERE acctid = ? AND realmid = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(LOGIN_DEL_REALM_CHARACTERS_BY_REALM, "DELETE FROM realmcharacters WHERE acctid = ? AND realmid = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(LOGIN_DEL_REALM_CHARACTERS, "DELETE FROM realmcharacters WHERE acctid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(LOGIN_INS_REALM_CHARACTERS, "INSERT INTO realmcharacters (numchars, acctid, realmid) VALUES (?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_SEL_SUM_REALM_CHARACTERS, "SELECT SUM(numchars) FROM realmcharacters WHERE acctid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(LOGIN_INS_ACCOUNT, "INSERT INTO account(username, sha_pass_hash, joindate) VALUES(?, ?, NOW())", CONNECTION_ASYNC); @@ -86,5 +87,6 @@ void LoginDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(LOGIN_SEL_BANS, "SELECT 1 FROM account_banned WHERE id = ? AND active = 1 UNION SELECT 1 FROM ip_banned WHERE ip = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_WHOIS, "SELECT username, email, last_ip FROM account WHERE id = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(LOGIN_SEL_REALMLIST_SECURITY_LEVEL, "SELECT allowedSecurityLevel from realmlist WHERE id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_DEL_ACCOUNT, "DELETE FROM account WHERE id = ?", CONNECTION_ASYNC); } diff --git a/src/server/shared/Database/Implementation/LoginDatabase.h b/src/server/shared/Database/Implementation/LoginDatabase.h index 2994c6bb07c..4ad9ac1a251 100755 --- a/src/server/shared/Database/Implementation/LoginDatabase.h +++ b/src/server/shared/Database/Implementation/LoginDatabase.h @@ -70,6 +70,7 @@ enum LoginDatabaseStatements LOGIN_SEL_ACCOUNT_BY_ID, LOGIN_INS_ACCOUNT_BANNED, LOGIN_UPD_ACCOUNT_NOT_BANNED, + LOGIN_DEL_REALM_CHARACTERS_BY_REALM, LOGIN_DEL_REALM_CHARACTERS, LOGIN_INS_REALM_CHARACTERS, LOGIN_SEL_SUM_REALM_CHARACTERS, @@ -106,6 +107,7 @@ enum LoginDatabaseStatements LOGIN_SEL_BANS, LOGIN_SEL_ACCOUNT_WHOIS, LOGIN_SEL_REALMLIST_SECURITY_LEVEL, + LOGIN_DEL_ACCOUNT, MAX_LOGINDATABASE_STATEMENTS, }; diff --git a/src/server/shared/Database/Implementation/WorldDatabase.cpp b/src/server/shared/Database/Implementation/WorldDatabase.cpp index 92393acbc35..e3455891909 100755 --- a/src/server/shared/Database/Implementation/WorldDatabase.cpp +++ b/src/server/shared/Database/Implementation/WorldDatabase.cpp @@ -84,4 +84,8 @@ void WorldDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(WORLD_SEL_ITEM_TEMPLATE_BY_NAME, "SELECT entry FROM item_template WHERE name = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(WORLD_SEL_CREATURE_BY_ID, "SELECT guid FROM creature WHERE id = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(WORLD_SEL_GAMEOBJECT_NEAREST, "SELECT guid, id, position_x, position_y, position_z, map, (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) AS order_ FROM gameobject WHERE map = ? AND (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) <= ? ORDER BY order_", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_INS_CREATURE, "INSERT INTO creature (guid, id , map, spawnMask, phaseMask, modelid, equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, spawndist, currentwaypoint, curhealth, curmana, MovementType, npcflag, unit_flags, dynamicflags) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_DEL_GAME_EVENT_CREATURE, "DELETE FROM game_event_creature WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_DEL_GAME_EVENT_MODEL_EQUIP, "DELETE FROM game_event_model_equip WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_INS_GAMEOBJECT, "INSERT INTO gameobject (guid, id, map, spawnMask, phaseMask, position_x, position_y, position_z, orientation, rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); } diff --git a/src/server/shared/Database/Implementation/WorldDatabase.h b/src/server/shared/Database/Implementation/WorldDatabase.h index 9b019306891..0580cecec7e 100755 --- a/src/server/shared/Database/Implementation/WorldDatabase.h +++ b/src/server/shared/Database/Implementation/WorldDatabase.h @@ -105,6 +105,10 @@ enum WorldDatabaseStatements WORLD_SEL_CREATURE_BY_ID, WORLD_SEL_GAMEOBJECT_NEAREST, WORLD_SEL_GAMEOBJECT_TARGET, + WORLD_INS_CREATURE, + WORLD_DEL_GAME_EVENT_CREATURE, + WORLD_DEL_GAME_EVENT_MODEL_EQUIP, + WORLD_INS_GAMEOBJECT, MAX_WORLDDATABASE_STATEMENTS, }; From 4e6fce11122487bba265e3f34124312d6ea9fdac Mon Sep 17 00:00:00 2001 From: leak Date: Sun, 25 Mar 2012 16:34:09 +0200 Subject: [PATCH 0277/1149] Core/DBLayer: Typo on query conversion --- src/server/shared/Database/Implementation/CharacterDatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index cfd61e35c4d..6bbbddad3cf 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -470,5 +470,5 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_UPD_CHAR_PET_NAME, "UPDATE character_pet SET name = ?, renamed = 1 WHERE owner = ? AND id = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_PETITION, "INSERT INTO petition (ownerguid, petitionguid, name, type) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_PETITION_BY_GUID, "DELETE FROM petition WHERE petitionguid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_PETITION_SIGNATURE_BY_GUID, "DELETE FROM petition_sign WHERE petitionguid = '%u'", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PETITION_SIGNATURE_BY_GUID, "DELETE FROM petition_sign WHERE petitionguid = ?", CONNECTION_ASYNC); } From e2a92d4bbc1fd0033d368b2fc76a5d99760999a6 Mon Sep 17 00:00:00 2001 From: click Date: Sun, 25 Mar 2012 17:14:08 +0200 Subject: [PATCH 0278/1149] Buildsystem/CMake: Add the ability to avoid linking the core with jemalloc on linux through using the -DNOJEM parameter. WARNING: This is a developer flag only, and as such NOT documented elsewhere - we need this for valgrind and related tools. Again : YOU HAVE BEEN WARNED! DO NOT USE THIS FLAG UNLESS YOU REALLY KNOW WHAT YOU ARE DOING! --- cmake/platform/unix/settings.cmake | 4 +++- cmake/showoptions.cmake | 8 +++++++- dep/CMakeLists.txt | 4 ++-- src/server/worldserver/CMakeLists.txt | 1 - 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/cmake/platform/unix/settings.cmake b/cmake/platform/unix/settings.cmake index 81f438befc9..dd8b7c081f3 100644 --- a/cmake/platform/unix/settings.cmake +++ b/cmake/platform/unix/settings.cmake @@ -1,6 +1,8 @@ # Package overloads - Linux if(CMAKE_SYSTEM_NAME MATCHES "Linux") - set(JEMALLOC_LIBRARY "jemalloc") + if (NOT NOJEM) + set(JEMALLOC_LIBRARY "jemalloc") + endif() endif() # set default configuration directory diff --git a/cmake/showoptions.cmake b/cmake/showoptions.cmake index 31e1b412b32..9cac1d82f4a 100644 --- a/cmake/showoptions.cmake +++ b/cmake/showoptions.cmake @@ -78,4 +78,10 @@ if( WIN32 ) endif() endif( WIN32 ) -message("") +if ( NOJEM ) + message("") + message("*** WARNING: jemalloc linking has been disabled!") + message("*** Please note that this is for DEBUGGING WITH VALGRIND only!") + message("*** DO NOT DISABLE IT UNLESS YOU KNOW WHAT YOU'RE DOING!") +endif() + message("") diff --git a/dep/CMakeLists.txt b/dep/CMakeLists.txt index 9c13ad59bc5..d658ba43ffe 100644 --- a/dep/CMakeLists.txt +++ b/dep/CMakeLists.txt @@ -15,8 +15,8 @@ elseif( MSVC ) endif() if(CMAKE_SYSTEM_NAME MATCHES "Linux") - if(SERVERS) - add_subdirectory(jemalloc) + if(SERVERS AND NOT NOJEM) + add_subdirectory(jemalloc) endif() endif() diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt index b75dfcfc064..28aab37d1dd 100644 --- a/src/server/worldserver/CMakeLists.txt +++ b/src/server/worldserver/CMakeLists.txt @@ -201,4 +201,3 @@ if( USE_COREPCH ) add_native_precompiled_header(worldserver ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/worldPCH) endif() endif() - From 71c02fb54d461716bc2273a2544122bfc5397808 Mon Sep 17 00:00:00 2001 From: leak Date: Sun, 25 Mar 2012 18:32:00 +0200 Subject: [PATCH 0279/1149] Core/DBLayer: Convert PAppend() queries to prepared statements No.2 --- src/server/game/Entities/Pet/Pet.cpp | 136 ++++++++++++++---- src/server/game/Handlers/PetHandler.cpp | 1 - .../Implementation/CharacterDatabase.cpp | 14 +- .../Implementation/CharacterDatabase.h | 12 ++ 4 files changed, 134 insertions(+), 29 deletions(-) diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 0a1479af41b..f3dbabe59d1 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -266,10 +266,20 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c if (fields[7].GetUInt8()) { SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("UPDATE character_pet SET slot = '%u' WHERE owner = '%u' AND slot = '%u' AND id <> '%u'", - PET_SAVE_NOT_IN_SLOT, ownerid, PET_SAVE_AS_CURRENT, m_charmInfo->GetPetNumber()); - trans->PAppend("UPDATE character_pet SET slot = '%u' WHERE owner = '%u' AND id = '%u'", - PET_SAVE_AS_CURRENT, ownerid, m_charmInfo->GetPetNumber()); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_PET_SLOT_BY_SLOT_EXCLUDE_ID); + stmt->setUInt8(0, uint8(PET_SAVE_NOT_IN_SLOT)); + stmt->setUInt32(1, ownerid); + stmt->setUInt8(2, uint8(PET_SAVE_AS_CURRENT)); + stmt->setUInt32(3, m_charmInfo->GetPetNumber()); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_PET_SLOT_BY_ID); + stmt->setUInt8(0, uint8(PET_SAVE_AS_CURRENT)); + stmt->setUInt32(1, ownerid); + stmt->setUInt32(2, m_charmInfo->GetPetNumber()); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); } @@ -400,17 +410,30 @@ void Pet::SavePetToDB(PetSaveMode mode) CharacterDatabase.EscapeString(name); trans = CharacterDatabase.BeginTransaction(); // remove current data - trans->PAppend("DELETE FROM character_pet WHERE owner = '%u' AND id = '%u'", ownerLowGUID, m_charmInfo->GetPetNumber()); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_BY_ID); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + trans->Append(stmt); // prevent duplicate using slot (except PET_SAVE_NOT_IN_SLOT) if (mode <= PET_SAVE_LAST_STABLE_SLOT) - trans->PAppend("UPDATE character_pet SET slot = '%u' WHERE owner = '%u' AND slot = '%u'", - PET_SAVE_NOT_IN_SLOT, ownerLowGUID, uint32(mode)); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_PET_SLOT_BY_SLOT); + stmt->setUInt32(0, ownerLowGUID); + stmt->setUInt8(1, uint8(mode)); + trans->Append(stmt); + } // prevent existence another hunter pet in PET_SAVE_AS_CURRENT and PET_SAVE_NOT_IN_SLOT if (getPetType() == HUNTER_PET && (mode == PET_SAVE_AS_CURRENT || mode > PET_SAVE_LAST_STABLE_SLOT)) - trans->PAppend("DELETE FROM character_pet WHERE owner = '%u' AND (slot = '%u' OR slot > '%u')", - ownerLowGUID, PET_SAVE_AS_CURRENT, PET_SAVE_LAST_STABLE_SLOT); + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_BY_SLOT); + stmt->setUInt32(0, ownerLowGUID); + stmt->setUInt8(1, uint8(PET_SAVE_AS_CURRENT)); + stmt->setUInt8(2, uint8(PET_SAVE_LAST_STABLE_SLOT)); + trans->Append(stmt); + } + // save pet std::ostringstream ss; ss << "INSERT INTO character_pet (id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType) " @@ -432,7 +455,7 @@ void Pet::SavePetToDB(PetSaveMode mode) for (uint32 i = ACTION_BAR_INDEX_START; i < ACTION_BAR_INDEX_END; ++i) { ss << uint32(m_charmInfo->GetActionBarEntry(i)->GetType()) << ' ' - << uint32(m_charmInfo->GetActionBarEntry(i)->GetAction()) << ' '; + << uint32(m_charmInfo->GetActionBarEntry(i)->GetAction()) << ' '; }; ss << "', " @@ -454,11 +477,27 @@ void Pet::SavePetToDB(PetSaveMode mode) void Pet::DeleteFromDB(uint32 guidlow) { SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM character_pet WHERE id = '%u'", guidlow); - trans->PAppend("DELETE FROM character_pet_declinedname WHERE id = '%u'", guidlow); - trans->PAppend("DELETE FROM pet_aura WHERE guid = '%u'", guidlow); - trans->PAppend("DELETE FROM pet_spell WHERE guid = '%u'", guidlow); - trans->PAppend("DELETE FROM pet_spell_cooldown WHERE guid = '%u'", guidlow); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_BY_ID); + stmt->setUInt32(0, guidlow); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_DECLINEDNAME); + stmt->setUInt32(0, guidlow); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PET_AURAS); + stmt->setUInt32(0, guidlow); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PET_SPELLS); + stmt->setUInt32(0, guidlow); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PET_SPELL_COOLDOWNS); + stmt->setUInt32(0, guidlow); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); } @@ -1097,7 +1136,9 @@ void Pet::_LoadSpellCooldowns() void Pet::_SaveSpellCooldowns(SQLTransaction& trans) { - trans->PAppend("DELETE FROM pet_spell_cooldown WHERE guid = '%u'", m_charmInfo->GetPetNumber()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PET_SPELL_COOLDOWNS); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + trans->Append(stmt); time_t curTime = time(NULL); @@ -1108,7 +1149,12 @@ void Pet::_SaveSpellCooldowns(SQLTransaction& trans) m_CreatureSpellCooldowns.erase(itr++); else { - trans->PAppend("INSERT INTO pet_spell_cooldown (guid, spell, time) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, uint32(itr->second)); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PET_SPELL_COOLDOWN); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + stmt->setUInt32(1, itr->first); + stmt->setUInt32(2, uint32(itr->second)); + trans->Append(stmt); + ++itr; } } @@ -1142,18 +1188,37 @@ void Pet::_SaveSpells(SQLTransaction& trans) if (itr->second.type == PETSPELL_FAMILY) continue; + PreparedStatement* stmt; + switch (itr->second.state) { case PETSPELL_REMOVED: - trans->PAppend("DELETE FROM pet_spell WHERE guid = '%u' and spell = '%u'", m_charmInfo->GetPetNumber(), itr->first); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PET_SPELL_BY_SPELL); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + stmt->setUInt32(1, itr->first); + trans->Append(stmt); + m_spells.erase(itr); continue; case PETSPELL_CHANGED: - trans->PAppend("DELETE FROM pet_spell WHERE guid = '%u' and spell = '%u'", m_charmInfo->GetPetNumber(), itr->first); - trans->PAppend("INSERT INTO pet_spell (guid, spell, active) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, itr->second.active); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PET_SPELL_BY_SPELL); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + stmt->setUInt32(1, itr->first); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PET_SPELL); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + stmt->setUInt32(1, itr->first); + stmt->setUInt8(2, itr->second.active); + trans->Append(stmt); + break; case PETSPELL_NEW: - trans->PAppend("INSERT INTO pet_spell (guid, spell, active) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, itr->second.active); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PET_SPELL); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + stmt->setUInt32(1, itr->first); + stmt->setUInt8(2, itr->second.active); + trans->Append(stmt); break; case PETSPELL_UNCHANGED: continue; @@ -1238,7 +1303,9 @@ void Pet::_LoadAuras(uint32 timediff) void Pet::_SaveAuras(SQLTransaction& trans) { - trans->PAppend("DELETE FROM pet_aura WHERE guid = '%u'", m_charmInfo->GetPetNumber()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PET_AURAS); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + trans->Append(stmt); for (AuraMap::const_iterator itr = m_ownedAuras.begin(); itr != m_ownedAuras.end() ; ++itr) { @@ -1272,11 +1339,26 @@ void Pet::_SaveAuras(SQLTransaction& trans) // don't save guid of caster in case we are caster of the spell - guid for pet is generated every pet load, so it won't match saved guid anyways uint64 casterGUID = (itr->second->GetCasterGUID() == GetGUID()) ? 0 : itr->second->GetCasterGUID(); - trans->PAppend("INSERT INTO pet_aura (guid, caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges) " - "VALUES ('%u', '" UI64FMTD "', '%u', '%u', '%u', '%u', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%u')", - m_charmInfo->GetPetNumber(), casterGUID, itr->second->GetId(), effMask, recalculateMask, - itr->second->GetStackAmount(), damage[0], damage[1], damage[2], baseDamage[0], baseDamage[1], baseDamage[2], - itr->second->GetMaxDuration(), itr->second->GetDuration(), itr->second->GetCharges()); + uint8 index = 0; + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PET_AURA); + stmt->setUInt32(index++, m_charmInfo->GetPetNumber()); + stmt->setUInt64(index++, casterGUID); + stmt->setUInt32(index++, itr->second->GetId()); + stmt->setUInt8(index++, effMask); + stmt->setUInt8(index++, recalculateMask); + stmt->setUInt8(index++, itr->second->GetStackAmount()); + stmt->setInt32(index++, damage[0]); + stmt->setInt32(index++, damage[1]); + stmt->setInt32(index++, damage[2]); + stmt->setInt32(index++, baseDamage[0]); + stmt->setInt32(index++, baseDamage[1]); + stmt->setInt32(index++, baseDamage[2]); + stmt->setInt32(index++, itr->second->GetMaxDuration()); + stmt->setInt32(index++, itr->second->GetDuration()); + stmt->setUInt8(index++, itr->second->GetCharges()); + + trans->Append(stmt); } } diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 8a7c264ef67..1fa6d9fc0ed 100755 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -648,7 +648,6 @@ void WorldSession::HandlePetRename(WorldPacket & recv_data) if (isdeclined) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_DECLINEDNAME); - stmt->setUInt32(0, _player->GetGUIDLow()); stmt->setUInt32(0, pet->GetCharmInfo()->GetPetNumber()); trans->Append(stmt); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 6bbbddad3cf..cf3b7fdd5e6 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -465,10 +465,22 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_GROUP_INSTANCE_BY_MAP_DIFF, "DELETE FROM group_instance USING group_instance LEFT JOIN instance ON group_instance.instance = id WHERE map = ? and difficulty = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_INSTANCE_BY_MAP_DIFF, "DELETE FROM instance WHERE map = ? and difficulty = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_MAIL_ITEM_BY_ID, "DELETE FROM mail_items WHERE mail_id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_PET_DECLINEDNAME, "DELETE FROM character_pet_declinedname WHERE owner = ? AND id = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_PET_DECLINEDNAME, "DELETE FROM character_pet_declinedname WHERE id = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_ADD_CHAR_PET_DECLINEDNAME, "INSERT INTO character_pet_declinedname (id, owner, genitive, dative, accusative, instrumental, prepositional) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_CHAR_PET_NAME, "UPDATE character_pet SET name = ?, renamed = 1 WHERE owner = ? AND id = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_PETITION, "INSERT INTO petition (ownerguid, petitionguid, name, type) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_PETITION_BY_GUID, "DELETE FROM petition WHERE petitionguid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_PETITION_SIGNATURE_BY_GUID, "DELETE FROM petition_sign WHERE petitionguid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UDP_CHAR_PET_SLOT_BY_SLOT_EXCLUDE_ID, "UPDATE character_pet SET slot = ? WHERE owner = ? AND slot = ? AND id <> ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UDP_CHAR_PET_SLOT_BY_SLOT, "UPDATE character_pet SET slot = ? WHERE owner = ? AND slot = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_PET_SLOT_BY_ID, "UPDATE character_pet SET slot = ? WHERE owner = ? AND id = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_PET_BY_ID, "DELETE FROM character_pet WHERE id = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_PET_BY_SLOT, "DELETE FROM character_pet WHERE owner = ? AND (slot = ? OR slot > ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PET_AURAS, "DELETE FROM pet_aura WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PET_SPELLS, "DELETE FROM pet_spell WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PET_SPELL_COOLDOWNS, "DELETE FROM pet_spell_cooldown WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_PET_SPELL_COOLDOWN, "INSERT INTO pet_spell_cooldown (guid, spell, time) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PET_SPELL_BY_SPELL, "DELETE FROM pet_spell WHERE guid = ? and spell = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_PET_SPELL, "INSERT INTO pet_spell (guid, spell, active) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_PET_AURA, "INSERT INTO pet_aura (guid, caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index ac920f0f25c..0fce8d51c2f 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -434,6 +434,18 @@ enum CharacterDatabaseStatements CHAR_INS_PETITION, CHAR_DEL_PETITION_BY_GUID, CHAR_DEL_PETITION_SIGNATURE_BY_GUID, + CHAR_UDP_CHAR_PET_SLOT_BY_SLOT_EXCLUDE_ID, + CHAR_UDP_CHAR_PET_SLOT_BY_SLOT, + CHAR_UPD_CHAR_PET_SLOT_BY_ID, + CHAR_DEL_CHAR_PET_BY_ID, + CHAR_DEL_CHAR_PET_BY_SLOT, + CHAR_DEL_PET_AURAS, + CHAR_DEL_PET_SPELLS, + CHAR_DEL_PET_SPELL_COOLDOWNS, + CHAR_INS_PET_SPELL_COOLDOWN, + CHAR_DEL_PET_SPELL_BY_SPELL, + CHAR_INS_PET_SPELL, + CHAR_INS_PET_AURA, MAX_CHARACTERDATABASE_STATEMENTS, }; From 19747fb95e83b4b47062e02dbce6f3e31d9b14c4 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 25 Mar 2012 12:59:18 -0500 Subject: [PATCH 0280/1149] Core/DBLayer: Use correct Get method in some DB fields --- src/server/game/Entities/Player/Player.cpp | 10 +++++----- src/server/game/Entities/Player/SocialMgr.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a7427704648..d94790ce4a0 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1911,7 +1911,7 @@ bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data) uint32 charFlags = 0; uint32 playerFlags = fields[14].GetUInt32(); - uint32 atLoginFlags = fields[15].GetUInt32(); + uint32 atLoginFlags = fields[15].GetUInt16(); if (playerFlags & PLAYER_FLAGS_HIDE_HELM) charFlags |= CHARACTER_FLAG_HIDE_HELM; if (playerFlags & PLAYER_FLAGS_HIDE_CLOAK) @@ -16759,12 +16759,12 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) InitPrimaryProfessions(); // to max set before any spell loaded // init saved position, and fix it later if problematic - uint32 transGUID = uint32(fields[30].GetUInt64()); // field type is uint64 but lowguid is saved + uint32 transGUID = fields[30].GetUInt32(); Relocate(fields[12].GetFloat(), fields[13].GetFloat(), fields[14].GetFloat(), fields[16].GetFloat()); uint32 mapId = fields[15].GetUInt16(); uint32 instanceId = fields[58].GetUInt8(); - uint32 dungeonDiff = fields[38].GetUInt32() & 0x0F; + uint32 dungeonDiff = fields[38].GetUInt8() & 0x0F; if (dungeonDiff >= MAX_DUNGEON_DIFFICULTY) dungeonDiff = DUNGEON_DIFFICULTY_NORMAL; uint32 raidDiff = (fields[38].GetUInt8() >> 4) & 0x0F; @@ -17257,7 +17257,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) } // RaF stuff. - m_grantableLevels = fields[66].GetUInt32(); + m_grantableLevels = fields[66].GetUInt8(); if (GetSession()->IsARecruiter() || (GetSession()->GetRecruiterId() != 0)) SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_REFER_A_FRIEND); @@ -24712,7 +24712,7 @@ void Player::_LoadTalents(PreparedQueryResult result) if (result) { do - AddTalent((*result)[0].GetUInt32(), (*result)[1].GetUInt32(), false); + AddTalent((*result)[0].GetUInt32(), (*result)[1].GetUInt8(), false); while (result->NextRow()); } } diff --git a/src/server/game/Entities/Player/SocialMgr.cpp b/src/server/game/Entities/Player/SocialMgr.cpp index cb327b83d17..08c987db15d 100755 --- a/src/server/game/Entities/Player/SocialMgr.cpp +++ b/src/server/game/Entities/Player/SocialMgr.cpp @@ -321,7 +321,7 @@ void SocialMgr::BroadcastToFriendListers(Player* player, WorldPacket* packet) } } -PlayerSocial *SocialMgr::LoadFromDB(PreparedQueryResult result, uint32 guid) +PlayerSocial* SocialMgr::LoadFromDB(PreparedQueryResult result, uint32 guid) { PlayerSocial *social = &m_socialMap[guid]; social->SetPlayerGUID(guid); @@ -338,7 +338,7 @@ PlayerSocial *SocialMgr::LoadFromDB(PreparedQueryResult result, uint32 guid) Field* fields = result->Fetch(); friend_guid = fields[0].GetUInt32(); - flags = fields[1].GetUInt32(); + flags = fields[1].GetUInt8(); note = fields[2].GetString(); social->m_playerSocialMap[friend_guid] = FriendInfo(flags, note); From 04099402cd0401b14a8727e6674e2bb382e95ef5 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 25 Mar 2012 13:05:13 -0500 Subject: [PATCH 0281/1149] Core/Players: Use correct size in variables --- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Entities/Player/SocialMgr.cpp | 12 ++++++------ src/server/game/Entities/Player/SocialMgr.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index d94790ce4a0..fc49ec94614 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1911,7 +1911,7 @@ bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data) uint32 charFlags = 0; uint32 playerFlags = fields[14].GetUInt32(); - uint32 atLoginFlags = fields[15].GetUInt16(); + uint16 atLoginFlags = fields[15].GetUInt16(); if (playerFlags & PLAYER_FLAGS_HIDE_HELM) charFlags |= CHARACTER_FLAG_HIDE_HELM; if (playerFlags & PLAYER_FLAGS_HIDE_CLOAK) diff --git a/src/server/game/Entities/Player/SocialMgr.cpp b/src/server/game/Entities/Player/SocialMgr.cpp index 08c987db15d..1ded8cda81b 100755 --- a/src/server/game/Entities/Player/SocialMgr.cpp +++ b/src/server/game/Entities/Player/SocialMgr.cpp @@ -61,7 +61,7 @@ bool PlayerSocial::AddToSocialList(uint32 friendGuid, bool ignore) return false; } - uint32 flag = SOCIAL_FLAG_FRIEND; + uint8 flag = SOCIAL_FLAG_FRIEND; if (ignore) flag = SOCIAL_FLAG_IGNORED; @@ -70,7 +70,7 @@ bool PlayerSocial::AddToSocialList(uint32 friendGuid, bool ignore) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_CHARACTER_SOCIAL_FLAGS); - stmt->setUInt8(0, uint8(flag)); + stmt->setUInt8(0, flag); stmt->setUInt32(1, GetPlayerGUID()); stmt->setUInt32(2, friendGuid); @@ -84,7 +84,7 @@ bool PlayerSocial::AddToSocialList(uint32 friendGuid, bool ignore) stmt->setUInt32(0, GetPlayerGUID()); stmt->setUInt32(1, friendGuid); - stmt->setUInt8(2, uint8(flag)); + stmt->setUInt8(2, flag); CharacterDatabase.Execute(stmt); @@ -101,7 +101,7 @@ void PlayerSocial::RemoveFromSocialList(uint32 friendGuid, bool ignore) if (itr == m_playerSocialMap.end()) // not exist return; - uint32 flag = SOCIAL_FLAG_FRIEND; + uint8 flag = SOCIAL_FLAG_FRIEND; if (ignore) flag = SOCIAL_FLAG_IGNORED; @@ -121,7 +121,7 @@ void PlayerSocial::RemoveFromSocialList(uint32 friendGuid, bool ignore) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_REM_CHARACTER_SOCIAL_FLAGS); - stmt->setUInt8(0, uint8(flag)); + stmt->setUInt8(0, flag); stmt->setUInt32(1, GetPlayerGUID()); stmt->setUInt32(2, friendGuid); @@ -330,7 +330,7 @@ PlayerSocial* SocialMgr::LoadFromDB(PreparedQueryResult result, uint32 guid) return social; uint32 friend_guid = 0; - uint32 flags = 0; + uint8 flags = 0; std::string note = ""; do diff --git a/src/server/game/Entities/Player/SocialMgr.h b/src/server/game/Entities/Player/SocialMgr.h index 540b425588e..3c7d13070fa 100755 --- a/src/server/game/Entities/Player/SocialMgr.h +++ b/src/server/game/Entities/Player/SocialMgr.h @@ -48,7 +48,7 @@ enum SocialFlag struct FriendInfo { FriendStatus Status; - uint32 Flags; + uint8 Flags; uint32 Area; uint8 Level; uint8 Class; @@ -64,7 +64,7 @@ struct FriendInfo Note = ""; } - FriendInfo(uint32 flags, const std::string& note) + FriendInfo(uint8 flags, const std::string& note) { Status = FRIEND_STATUS_OFFLINE; Flags = flags; From eb1af303992d055a963b5c93681fdff9956f1eb4 Mon Sep 17 00:00:00 2001 From: leak Date: Sun, 25 Mar 2012 20:19:48 +0200 Subject: [PATCH 0282/1149] Core/DBLayer: Convert PAppend() queries to prepared statements No.3 --- src/server/game/Handlers/CharacterHandler.cpp | 191 ++++++++++++------ .../Implementation/CharacterDatabase.cpp | 17 ++ .../Implementation/CharacterDatabase.h | 17 ++ 3 files changed, 166 insertions(+), 59 deletions(-) diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 377b5254144..f6051cd4c6e 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1269,9 +1269,19 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data) CharacterDatabase.EscapeString(declinedname.name[i]); SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM character_declinedname WHERE guid = '%u'", GUID_LOPART(guid)); - trans->PAppend("INSERT INTO character_declinedname (guid, genitive, dative, accusative, instrumental, prepositional) VALUES ('%u', '%s', '%s', '%s', '%s', '%s')", - GUID_LOPART(guid), declinedname.name[0].c_str(), declinedname.name[1].c_str(), declinedname.name[2].c_str(), declinedname.name[3].c_str(), declinedname.name[4].c_str()); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_DECLINED_NAME); + stmt->setUInt32(0, GUID_LOPART(guid)); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_DECLINED_NAME); + stmt->setUInt32(0, GUID_LOPART(guid)); + + for (uint8 i = 0; i < 5; i++) + stmt->setString(i+1, declinedname.name[i]); + + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4+8); @@ -1679,8 +1689,18 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) CharacterDatabase.EscapeString(newname); Player::Customize(guid, gender, skin, face, hairStyle, hairColor, facialHair); SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("UPDATE `characters` SET name='%s', race='%u', at_login=at_login & ~ %u WHERE guid='%u'", newname.c_str(), race, used_loginFlag, lowGuid); - trans->PAppend("DELETE FROM character_declinedname WHERE guid ='%u'", lowGuid); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_FACTION_OR_RACE); + stmt->setString(0, newname); + stmt->setUInt8(1, race); + stmt->setUInt16(2, used_loginFlag); + stmt->setUInt32(3, lowGuid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_DECLINED_NAME); + stmt->setUInt32(0, lowGuid); + trans->Append(stmt); + sWorld->UpdateCharacterNameData(GUID_LOPART(guid), newname, gender, race); BattlegroundTeamId team = BG_TEAM_ALLIANCE; @@ -1701,52 +1721,68 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) // Switch Languages // delete all languages first - trans->PAppend("DELETE FROM `character_skills` WHERE `skill` IN (98, 113, 759, 111, 313, 109, 115, 315, 673, 137) AND `guid`='%u'", lowGuid); - // now add them back + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SKILL_LANGUAGES); + stmt->setUInt32(0, lowGuid); + trans->Append(stmt); + + // Now add them back + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_SKILL_LANGUAGE); + stmt->setUInt32(0, lowGuid); + + + // Faction specific languages if (team == BG_TEAM_ALLIANCE) { - trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 98, 300, 300)", lowGuid); - switch (race) - { - case RACE_DWARF: - trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 111, 300, 300)", lowGuid); - break; - case RACE_DRAENEI: - trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 759, 300, 300)", lowGuid); - break; - case RACE_GNOME: - trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 313, 300, 300)", lowGuid); - break; - case RACE_NIGHTELF: - trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 113, 300, 300)", lowGuid); - break; - } + stmt->setUInt16(1, 98); } else if (team == BG_TEAM_HORDE) { - trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 109, 300, 300)", lowGuid); - switch (race) - { - case RACE_UNDEAD_PLAYER: - trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 673, 300, 300)", lowGuid); - break; - case RACE_TAUREN: - trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 115, 300, 300)", lowGuid); - break; - case RACE_TROLL: - trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 315, 300, 300)", lowGuid); - break; - case RACE_BLOODELF: - trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 137, 300, 300)", lowGuid); - break; - } + stmt->setUInt16(1, 109); } + trans->Append(stmt); + + // Race specific languages + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_SKILL_LANGUAGE); + stmt->setUInt32(0, lowGuid); + + switch (race) + { + case RACE_DWARF: + stmt->setUInt16(1, 111); + break; + case RACE_DRAENEI: + stmt->setUInt16(1, 759); + break; + case RACE_GNOME: + stmt->setUInt16(1, 313); + break; + case RACE_NIGHTELF: + stmt->setUInt16(1, 113); + break; + case RACE_UNDEAD_PLAYER: + stmt->setUInt16(1, 673); + break; + case RACE_TAUREN: + stmt->setUInt16(1, 115); + break; + case RACE_TROLL: + stmt->setUInt16(1, 315); + break; + case RACE_BLOODELF: + stmt->setUInt16(1, 137); + break; + } + + trans->Append(stmt); + if (recv_data.GetOpcode() == CMSG_CHAR_FACTION_CHANGE) { // Delete all Flypaths - trans->PAppend("UPDATE `characters` SET taxi_path = '' WHERE guid ='%u'", lowGuid); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_TAXI_PATH); + stmt->setUInt32(0, lowGuid); + trans->Append(stmt); if (level > 7) { @@ -1788,11 +1824,17 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) taximaskstream << "0 "; taximaskstream << '0'; std::string taximask = taximaskstream.str(); - trans->PAppend("UPDATE `characters` SET `taximask`= '%s' WHERE `guid` = '%u'", taximask.c_str(), lowGuid); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_TAXIMASK); + stmt->setString(0, taximask); + stmt->setUInt32(1, lowGuid); + trans->Append(stmt); } // Delete all current quests - trans->PAppend("DELETE FROM `character_queststatus` WHERE guid ='%u'", GUID_LOPART(guid)); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS); + stmt->setUInt32(0, GUID_LOPART(guid)); + trans->Append(stmt); // Delete record of the faction old completed quests { @@ -1843,15 +1885,21 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND)) { // Delete Friend List - trans->PAppend("DELETE FROM `character_social` WHERE `guid`= '%u'", lowGuid); - trans->PAppend("DELETE FROM `character_social` WHERE `friend`= '%u'", lowGuid); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SOCIAL_BY_GUID); + stmt->setUInt32(0, lowGuid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SOCIAL_BY_FRIEND); + stmt->setUInt32(0, lowGuid); + trans->Append(stmt); + } // Leave Arena Teams Player::LeaveAllArenaTeams(guid); // Reset homebind and position - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_HOMEBIND); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_HOMEBIND); stmt->setUInt32(0, lowGuid); trans->Append(stmt); @@ -1882,10 +1930,17 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) { uint32 achiev_alliance = it->first; uint32 achiev_horde = it->second; - trans->PAppend("DELETE FROM `character_achievement` WHERE `achievement`=%u AND `guid`=%u", - team == BG_TEAM_ALLIANCE ? achiev_alliance : achiev_horde, lowGuid); - trans->PAppend("UPDATE `character_achievement` SET achievement = '%u' where achievement = '%u' AND guid = '%u'", - team == BG_TEAM_ALLIANCE ? achiev_alliance : achiev_horde, team == BG_TEAM_ALLIANCE ? achiev_horde : achiev_alliance, lowGuid); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT); + stmt->setUInt16(0, uint16(team == BG_TEAM_ALLIANCE ? achiev_alliance : achiev_horde)); + stmt->setUInt32(1, lowGuid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_ACHIEVEMENT); + stmt->setUInt16(0, uint16(team == BG_TEAM_ALLIANCE ? achiev_alliance : achiev_horde)); + stmt->setUInt16(1, uint16(team == BG_TEAM_ALLIANCE ? achiev_horde : achiev_alliance)); + stmt->setUInt32(2, lowGuid); + trans->Append(stmt); } // Item conversion @@ -1893,8 +1948,12 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) { uint32 item_alliance = it->first; uint32 item_horde = it->second; - trans->PAppend("UPDATE `item_instance` ii, `character_inventory` ci SET ii.itemEntry = '%u' WHERE ii.itemEntry = '%u' AND ci.guid = '%u' AND ci.item = ii.guid", - team == BG_TEAM_ALLIANCE ? item_alliance : item_horde, team == BG_TEAM_ALLIANCE ? item_horde : item_alliance, guid); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_INVENTORY_FACTION_CHANGE); + stmt->setUInt32(0, (team == BG_TEAM_ALLIANCE ? item_alliance : item_horde)); + stmt->setUInt32(1, (team == BG_TEAM_ALLIANCE ? item_horde : item_alliance)); + stmt->setUInt32(2, guid); + trans->Append(stmt); } // Spell conversion @@ -1902,10 +1961,17 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) { uint32 spell_alliance = it->first; uint32 spell_horde = it->second; - trans->PAppend("DELETE FROM `character_spell` WHERE `spell`=%u AND `guid`=%u", - team == BG_TEAM_ALLIANCE ? spell_alliance : spell_horde, lowGuid); - trans->PAppend("UPDATE `character_spell` SET spell = '%u' where spell = '%u' AND guid = '%u'", - team == BG_TEAM_ALLIANCE ? spell_alliance : spell_horde, team == BG_TEAM_ALLIANCE ? spell_horde : spell_alliance, lowGuid); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL_BY_SPELL); + stmt->setUInt32(0, (team == BG_TEAM_ALLIANCE ? spell_alliance : spell_horde)); + stmt->setUInt32(1, lowGuid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_SPELL_FACTION_CHANGE); + stmt->setUInt32(0, (team == BG_TEAM_ALLIANCE ? spell_alliance : spell_horde)); + stmt->setUInt32(1, (team == BG_TEAM_ALLIANCE ? spell_horde : spell_alliance)); + stmt->setUInt32(2, lowGuid); + trans->Append(stmt); } // Reputation conversion @@ -1913,10 +1979,17 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) { uint32 reputation_alliance = it->first; uint32 reputation_horde = it->second; - trans->PAppend("DELETE FROM character_reputation WHERE faction = '%u' AND guid = '%u'", - team == BG_TEAM_ALLIANCE ? reputation_alliance : reputation_horde, lowGuid); - trans->PAppend("UPDATE `character_reputation` SET faction = '%u' where faction = '%u' AND guid = '%u'", - team == BG_TEAM_ALLIANCE ? reputation_alliance : reputation_horde, team == BG_TEAM_ALLIANCE ? reputation_horde : reputation_alliance, lowGuid); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_REP_BY_FACTION); + stmt->setUInt32(0, uint16(team == BG_TEAM_ALLIANCE ? reputation_alliance : reputation_horde)); + stmt->setUInt32(1, lowGuid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_REP_FACTION_CHANGE); + stmt->setUInt16(0, uint16(team == BG_TEAM_ALLIANCE ? reputation_alliance : reputation_horde)); + stmt->setUInt16(1, uint16(team == BG_TEAM_ALLIANCE ? reputation_horde : reputation_alliance)); + stmt->setUInt32(2, lowGuid); + trans->Append(stmt); } } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index cf3b7fdd5e6..d6019d0b6da 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -483,4 +483,21 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_PET_SPELL_BY_SPELL, "DELETE FROM pet_spell WHERE guid = ? and spell = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_PET_SPELL, "INSERT INTO pet_spell (guid, spell, active) VALUES (?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_PET_AURA, "INSERT INTO pet_aura (guid, caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_DECLINED_NAME, "DELETE FROM character_declinedname WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_DECLINED_NAME, "INSERT INTO character_declinedname (guid, genitive, dative, accusative, instrumental, prepositional) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_FACTION_OR_RACE, "UPDATE characters SET name = ?, race = ?, at_login = at_login & ~ ? WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_SKILL_LANGUAGES, "DELETE FROM character_skills WHERE skill IN (98, 113, 759, 111, 313, 109, 115, 315, 673, 137) AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_SKILL_LANGUAGE, "INSERT INTO `character_skills` (guid, skill, value, max) VALUES (?, ?, 300, 300)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_TAXI_PATH, "UPDATE characters SET taxi_path = '' WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_TAXIMASK, "UPDATE characters SET taximask = ? WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_QUESTSTATUS, "DELETE FROM character_queststatus WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_SOCIAL_BY_GUID, "DELETE FROM character_social WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_SOCIAL_BY_FRIEND, "DELETE FROM character_social WHERE friend = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT, "DELETE FROM character_achievement WHERE achievement = ? AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_ACHIEVEMENT, "UPDATE character_achievement SET achievement = ? where achievement = ? AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_INVENTORY_FACTION_CHANGE, "UPDATE item_instance ii, character_inventory ci SET ii.itemEntry = ? WHERE ii.itemEntry = ? AND ci.guid = ? AND ci.item = ii.guid", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_SPELL_BY_SPELL, "DELETE FROM character_spell WHERE spell = ? AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_SPELL_FACTION_CHANGE, "UPDATE character_spell SET spell = ? where spell = ? AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_REP_BY_FACTION, "DELETE FROM character_reputation WHERE faction = ? AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_REP_FACTION_CHANGE, "UPDATE character_reputation SET faction = ? where faction = ? AND guid = ?", CONNECTION_ASYNC); } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 0fce8d51c2f..05d0d0e6d36 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -446,6 +446,23 @@ enum CharacterDatabaseStatements CHAR_DEL_PET_SPELL_BY_SPELL, CHAR_INS_PET_SPELL, CHAR_INS_PET_AURA, + CHAR_DEL_CHAR_DECLINED_NAME, + CHAR_INS_CHAR_DECLINED_NAME, + CHAR_UPD_FACTION_OR_RACE, + CHAR_DEL_CHAR_SKILL_LANGUAGES, + CHAR_INS_CHAR_SKILL_LANGUAGE, + CHAR_UPD_CHAR_TAXI_PATH, + CHAR_UPD_CHAR_TAXIMASK, + CHAR_DEL_CHAR_QUESTSTATUS, + CHAR_DEL_CHAR_SOCIAL_BY_GUID, + CHAR_DEL_CHAR_SOCIAL_BY_FRIEND, + CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT, + CHAR_UPD_CHAR_ACHIEVEMENT, + CHAR_UPD_CHAR_INVENTORY_FACTION_CHANGE, + CHAR_DEL_CHAR_SPELL_BY_SPELL, + CHAR_UPD_CHAR_SPELL_FACTION_CHANGE, + CHAR_DEL_CHAR_REP_BY_FACTION, + CHAR_UPD_CHAR_REP_FACTION_CHANGE, MAX_CHARACTERDATABASE_STATEMENTS, }; From 44a474f1e383152e205b031614d05d982f870e59 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 25 Mar 2012 20:55:06 +0200 Subject: [PATCH 0283/1149] Core/AchievementMgr: We heard you like uninitialized variables so... we initialized them for you so you can hate us --- src/server/game/Achievements/AchievementMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 3de4f72affe..5a97f6fa18f 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -632,7 +632,7 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, PreparedQ // title achievement rewards are retroactive if (AchievementReward const* reward = sAchievementMgr->GetAchievementReward(achievement)) - if (uint32 titleId = reward->titleId[GetPlayer()->GetTeam() == ALLIANCE ? 0 : 1]) + if (uint32 titleId = reward->titleId[Player::TeamForRace(GetPlayer()->getRace()) == ALLIANCE ? 0 : 1]) if (CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(titleId)) if (!GetPlayer()->HasTitle(titleEntry)) GetPlayer()->SetTitle(titleEntry); From fa1d3f305b6a31c11b068a3d10924d2adc9d8279 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 25 Mar 2012 21:21:23 +0200 Subject: [PATCH 0284/1149] Core/Misc: Implement Trinity::Auto_Ptr. Ditches ACE_Refcounted_AutoPtr (we strongly suspect it does NOT clean up the underlying pointer properly). Underlying type is now ACE_Strong_Bound_Ptr --- src/server/game/Weather/WeatherMgr.cpp | 4 +- src/server/shared/AutoPtr.h | 53 ++++++++++++++++++++++++ src/server/shared/Database/QueryResult.h | 6 +-- src/server/shared/Database/Transaction.h | 2 +- 4 files changed, 59 insertions(+), 6 deletions(-) create mode 100644 src/server/shared/AutoPtr.h diff --git a/src/server/game/Weather/WeatherMgr.cpp b/src/server/game/Weather/WeatherMgr.cpp index 731aba8d197..41241583ea1 100755 --- a/src/server/game/Weather/WeatherMgr.cpp +++ b/src/server/game/Weather/WeatherMgr.cpp @@ -24,14 +24,14 @@ #include "Weather.h" #include "Log.h" #include "ObjectMgr.h" -#include +#include "AutoPtr.h" namespace WeatherMgr { namespace { - typedef UNORDERED_MAP > WeatherMap; + typedef UNORDERED_MAP > WeatherMap; typedef UNORDERED_MAP WeatherZoneMap; WeatherMap m_weathers; diff --git a/src/server/shared/AutoPtr.h b/src/server/shared/AutoPtr.h new file mode 100644 index 00000000000..988c46cc5a2 --- /dev/null +++ b/src/server/shared/AutoPtr.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#ifndef _TRINITY_AUTO_PTR_H +#define _TRINITY_AUTO_PTR_H + +#include + +namespace Trinity +{ + template + class AutoPtr : public ACE_Strong_Bound_Ptr + { + public: + AutoPtr() : ACE_Strong_Bound_Ptr() {} + + AutoPtr(Pointer* x) + { + ACE_Strong_Bound_Ptr::reset(x); + } + + operator bool() const + { + return ACE_Strong_Bound_Ptr::get() != NULL; + } + + bool operator !() const + { + return ACE_Strong_Bound_Ptr::get() == NULL; + } + + bool operator !=(Pointer* x) const + { + return ACE_Strong_Bound_Ptr::get() != x; + } + }; +}; + +#endif \ No newline at end of file diff --git a/src/server/shared/Database/QueryResult.h b/src/server/shared/Database/QueryResult.h index 524532f30ec..2c09cb19c81 100755 --- a/src/server/shared/Database/QueryResult.h +++ b/src/server/shared/Database/QueryResult.h @@ -19,7 +19,7 @@ #ifndef QUERYRESULT_H #define QUERYRESULT_H -#include +#include "AutoPtr.h" #include #include "Field.h" @@ -58,7 +58,7 @@ class ResultSet MYSQL_FIELD* _fields; }; -typedef ACE_Refcounted_Auto_Ptr QueryResult; +typedef Trinity::AutoPtr QueryResult; class PreparedResultSet { @@ -103,7 +103,7 @@ class PreparedResultSet }; -typedef ACE_Refcounted_Auto_Ptr PreparedQueryResult; +typedef Trinity::AutoPtr PreparedQueryResult; #endif diff --git a/src/server/shared/Database/Transaction.h b/src/server/shared/Database/Transaction.h index 92002819951..a12f66ceced 100755 --- a/src/server/shared/Database/Transaction.h +++ b/src/server/shared/Database/Transaction.h @@ -47,7 +47,7 @@ class Transaction bool _cleanedUp; }; -typedef ACE_Refcounted_Auto_Ptr SQLTransaction; +typedef Trinity::AutoPtr SQLTransaction; /*! Low level class*/ class TransactionTask : public SQLOperation From ffbee169f49d2eba408d76a1e181a3e4589dd8ab Mon Sep 17 00:00:00 2001 From: leak Date: Sun, 25 Mar 2012 21:22:53 +0200 Subject: [PATCH 0285/1149] Core/DBLayer: Restore pinfo ban info output --- sql/updates/auth/2012_03_25_00_auth_misc.sql | 8 ++++++++ src/server/game/Chat/Commands/Level2.cpp | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 sql/updates/auth/2012_03_25_00_auth_misc.sql diff --git a/sql/updates/auth/2012_03_25_00_auth_misc.sql b/sql/updates/auth/2012_03_25_00_auth_misc.sql new file mode 100644 index 00000000000..f34882af8f6 --- /dev/null +++ b/sql/updates/auth/2012_03_25_00_auth_misc.sql @@ -0,0 +1,8 @@ +ALTER TABLE `account_banned` + CHANGE `bandate` `bandate` INT(10) UNSIGNED DEFAULT 0 NOT NULL, + CHANGE `unbandate` `unbandate` INT(10) UNSIGNED DEFAULT 0 NOT NULL; + +ALTER TABLE `ip_banned` + CHANGE `ip` `ip` VARCHAR(15) CHARSET utf8 COLLATE utf8_general_ci DEFAULT '127.0.0.1' NOT NULL, + CHANGE `bandate` `bandate` INT(10) UNSIGNED NOT NULL, + CHANGE `unbandate` `unbandate` INT(10) UNSIGNED NOT NULL; diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index ca6a43457f1..cc7c9020d38 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -395,8 +395,8 @@ bool ChatHandler::HandlePInfoCommand(const char* args) if (result2) { - Field* fields = result->Fetch(); - banTime = fields[1].GetBool() ? 0 : fields[0].GetUInt64(); + Field* fields = result2->Fetch(); + banTime = int64(fields[1].GetBool() ? 0 : fields[0].GetUInt32()); bannedby = fields[2].GetString(); banreason = fields[3].GetString(); } From 107a6f2c4b904bff557ec489419db6aa85a17fcb Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 25 Mar 2012 21:15:22 +0100 Subject: [PATCH 0286/1149] DB/Auth: Update auth_database.sql with recent changes DB/GameEvent: Resync Darkmoon, again - by Aokromes --- sql/base/auth_database.sql | 16 ++++++++-------- sql/base/characters_database.sql | 6 ++++-- .../world/2012_03_25_00_world_game_event.sql | 4 ++++ 3 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 sql/updates/world/2012_03_25_00_world_game_event.sql diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 3a9bd6fb08b..c80bebdac39 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 5.5.19, for Win64 (x86) +-- MySQL dump 10.13 Distrib 5.5.21, for Win64 (x86) -- -- Host: localhost Database: auth -- ------------------------------------------------------ --- Server version 5.5.19 +-- Server version 5.5.21 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -88,8 +88,8 @@ DROP TABLE IF EXISTS `account_banned`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `account_banned` ( `id` int(11) NOT NULL DEFAULT '0' COMMENT 'Account id', - `bandate` bigint(40) NOT NULL DEFAULT '0', - `unbandate` bigint(40) NOT NULL DEFAULT '0', + `bandate` int(10) unsigned NOT NULL DEFAULT '0', + `unbandate` int(10) unsigned NOT NULL DEFAULT '0', `bannedby` varchar(50) NOT NULL, `banreason` varchar(255) NOT NULL, `active` tinyint(4) NOT NULL DEFAULT '1', @@ -114,9 +114,9 @@ DROP TABLE IF EXISTS `ip_banned`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ip_banned` ( - `ip` varchar(32) NOT NULL DEFAULT '127.0.0.1', - `bandate` bigint(40) NOT NULL, - `unbandate` bigint(40) NOT NULL, + `ip` varchar(15) NOT NULL DEFAULT '127.0.0.1', + `bandate` int(10) unsigned NOT NULL, + `unbandate` int(10) unsigned NOT NULL, `bannedby` varchar(50) NOT NULL DEFAULT '[Console]', `banreason` varchar(255) NOT NULL DEFAULT 'no reason', PRIMARY KEY (`ip`,`bandate`) @@ -250,4 +250,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2012-02-19 13:18:35 +-- Dump completed on 2012-03-25 21:05:26 diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index c38dced90dd..f0e919a5bcd 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 5.5.9, for Win64 (x86) +-- MySQL dump 10.13 Distrib 5.5.21, for Win64 (x86) -- -- Host: localhost Database: characters -- ------------------------------------------------------ --- Server version 5.5.9 +-- Server version 5.5.21 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -2270,3 +2270,5 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2012-03-25 21:14:19 diff --git a/sql/updates/world/2012_03_25_00_world_game_event.sql b/sql/updates/world/2012_03_25_00_world_game_event.sql new file mode 100644 index 00000000000..82dfaa3f494 --- /dev/null +++ b/sql/updates/world/2012_03_25_00_world_game_event.sql @@ -0,0 +1,4 @@ +-- darkmoon faerie resync, again +UPDATE `game_event` SET `start_time`='2012-04-01 00:01:00' WHERE `eventEntry`=5; +UPDATE `game_event` SET `start_time`='2012-05-06 00:01:00' WHERE `eventEntry`=3; +UPDATE `game_event` SET `start_time`='2012-06-03 00:01:00' WHERE `eventEntry`=4; From 9ec61089beb70d8ea7bc14b1b656d50279af4fb6 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 25 Mar 2012 22:24:11 +0200 Subject: [PATCH 0287/1149] Core/Player: Fixed accessing possibly deallocated memory --- src/server/game/Entities/Player/Player.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index fc49ec94614..38296c8ee2a 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -14340,15 +14340,15 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men { case GOSSIP_OPTION_GOSSIP: { + if (menuItemData->GossipActionPoi) + PlayerTalkClass->SendPointOfInterest(menuItemData->GossipActionPoi); + if (menuItemData->GossipActionMenuId) { PrepareGossipMenu(source, menuItemData->GossipActionMenuId); SendPreparedGossip(source); } - if (menuItemData->GossipActionPoi) - PlayerTalkClass->SendPointOfInterest(menuItemData->GossipActionPoi); - break; } case GOSSIP_OPTION_OUTDOORPVP: From 48dc9313b9c49199548c6e30229b69b3b204c630 Mon Sep 17 00:00:00 2001 From: Shocker Date: Mon, 26 Mar 2012 02:50:08 +0300 Subject: [PATCH 0288/1149] Core/Misc: Fix logic for owner check in Unit::RemoveGameObject --- src/server/game/Entities/Unit/Unit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 638e09a73bc..f17b564e57f 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -4624,7 +4624,8 @@ void Unit::AddGameObject(GameObject* gameObj) void Unit::RemoveGameObject(GameObject* gameObj, bool del) { - if (!gameObj || !gameObj->GetOwnerGUID() == GetGUID()) return; + if (!gameObj || gameObj->GetOwnerGUID() != GetGUID()) + return; gameObj->SetOwnerGUID(0); From 3f61bd0a26a0de061e68ccc062d654b06e23476f Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Mon, 26 Mar 2012 02:56:43 +0300 Subject: [PATCH 0289/1149] Core/DB Layer: Make SQLTransaction AutoPtr thread safe (valgrind caught a race condition) --- src/server/shared/Database/Transaction.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/shared/Database/Transaction.h b/src/server/shared/Database/Transaction.h index a12f66ceced..805d48f76cf 100755 --- a/src/server/shared/Database/Transaction.h +++ b/src/server/shared/Database/Transaction.h @@ -47,7 +47,7 @@ class Transaction bool _cleanedUp; }; -typedef Trinity::AutoPtr SQLTransaction; +typedef Trinity::AutoPtr SQLTransaction; /*! Low level class*/ class TransactionTask : public SQLOperation From fab1944ae4f2f5be6db92a160a3f66deab7fc3b9 Mon Sep 17 00:00:00 2001 From: Shocker Date: Mon, 26 Mar 2012 03:02:05 +0300 Subject: [PATCH 0290/1149] Core/Spells: Don't remove summoned gameobjects for non-channeled spells when spell cast was canceled Fixes issues like Demonic Circle: Summon removing the last summoned circle when the new cast was canceled --- src/server/game/Spells/Spell.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index ecd20a03665..bf2be9afd9b 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3080,7 +3080,8 @@ void Spell::cancel() *m_selfContainer = NULL; m_caster->RemoveDynObject(m_spellInfo->Id); - m_caster->RemoveGameObject(m_spellInfo->Id, true); + if (IsChanneledSpell(m_spellInfo)) // if not channeled then the object for the current cast wasn't summoned yet + m_caster->RemoveGameObject(m_spellInfo->Id, true); //set state back so finish will be processed m_spellState = oldState; From 786c226b7442ae81479c0124409585293fdf6a76 Mon Sep 17 00:00:00 2001 From: kaelima Date: Mon, 26 Mar 2012 02:15:40 +0200 Subject: [PATCH 0291/1149] Core/CombatLog: - Send more proper hitinfo values in SMSG_ATTACKERSTATEUPDATE (still lot of research todo) - Some renaming and commenting - Minor cleanup in Player::UpdateZone --- src/server/game/Chat/Commands/Level3.cpp | 4 +- src/server/game/Entities/Player/Player.cpp | 31 +++++---- src/server/game/Entities/Unit/Unit.cpp | 74 +++++++++++++--------- src/server/game/Entities/Unit/Unit.h | 22 +++---- 4 files changed, 71 insertions(+), 60 deletions(-) diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 561c5059bad..d5dd233b43e 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -1890,7 +1890,7 @@ bool ChatHandler::HandleDamageCommand(const char * args) { m_session->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); if (target != m_session->GetPlayer()) - m_session->GetPlayer()->SendAttackStateUpdate (HITINFO_NORMALSWING2, target, 1, SPELL_SCHOOL_MASK_NORMAL, damage, 0, 0, VICTIMSTATE_HIT, 0); + m_session->GetPlayer()->SendAttackStateUpdate (HITINFO_AFFECTS_VICTIM, target, 1, SPELL_SCHOOL_MASK_NORMAL, damage, 0, 0, VICTIMSTATE_HIT, 0); return true; } @@ -1920,7 +1920,7 @@ bool ChatHandler::HandleDamageCommand(const char * args) m_session->GetPlayer()->DealDamageMods(target, damage, &absorb); m_session->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, schoolmask, NULL, false); - m_session->GetPlayer()->SendAttackStateUpdate (HITINFO_NORMALSWING2, target, 1, schoolmask, damage, absorb, resist, VICTIMSTATE_HIT, 0); + m_session->GetPlayer()->SendAttackStateUpdate (HITINFO_AFFECTS_VICTIM, target, 1, schoolmask, damage, absorb, resist, VICTIMSTATE_HIT, 0); return true; } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 38296c8ee2a..44547873754 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7424,17 +7424,15 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) } // group update - if (GetGroup()) + if (Group* group = GetGroup()) { SetGroupUpdateFlag(GROUP_UPDATE_FULL); - Group* grp = GetGroup(); - if (GetSession() && grp->isLFGGroup() && sLFGMgr->IsTeleported(GetGUID())) + if (GetSession() && group->isLFGGroup() && sLFGMgr->IsTeleported(GetGUID())) { - for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) + for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { - Player* tempplr = itr->getSource(); - if (tempplr) - GetSession()->SendNameQueryOpcode(tempplr->GetGUID()); + if (Player* member = itr->getSource()) + GetSession()->SendNameQueryOpcode(member->GetGUID()); } } } @@ -7451,9 +7449,8 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) if (sWorld->getBoolConfig(CONFIG_WEATHER)) { - Weather* wth = WeatherMgr::FindWeather(zone->ID); - if (wth) - wth->SendWeatherUpdateToPlayer(this); + if (Weather* weather = WeatherMgr::FindWeather(zone->ID)) + weather->SendWeatherUpdateToPlayer(this); else { if (!WeatherMgr::AddWeather(zone->ID)) @@ -7485,7 +7482,7 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) break; } - if (zone->flags & AREA_FLAG_CAPITAL) // in capital city + if (zone->flags & AREA_FLAG_CAPITAL) // Is in a capital city { if (!pvpInfo.inHostileArea || zone->IsSanctuary()) { @@ -7495,19 +7492,21 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) } pvpInfo.inNoPvPArea = true; } - else // anywhere else + else { - if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING)) // but resting (walk from city or maybe in tavern or leave tavern recently) + if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING)) { - if (GetRestType() == REST_TYPE_IN_TAVERN) // has been in tavern. Is still in? + if (GetRestType() == REST_TYPE_IN_TAVERN) // Still inside a tavern or has recently left { - if (GetMapId() != GetInnPosMapId() || sqrt((GetPositionX()-GetInnPosX())*(GetPositionX()-GetInnPosX())+(GetPositionY()-GetInnPosY())*(GetPositionY()-GetInnPosY())+(GetPositionZ()-GetInnPosZ())*(GetPositionZ()-GetInnPosZ()))>40) + // Remove rest state if we have recently left a tavern. + // Why is 40 yd hardcoded? + if (GetMapId() != GetInnPosMapId() || GetExactDist(GetInnPosX(), GetInnPosY(), GetInnPosZ()) > 40.0f) { RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING); SetRestType(REST_TYPE_NO); } } - else // not in tavern (leave city then) + else // Recently left a capital city { RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING); SetRestType(REST_TYPE_NO); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f17b564e57f..e4967e8633d 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -110,23 +110,27 @@ m_damageType(DIRECT_DAMAGE), m_attackType(dmgInfo.attackType) m_resist = 0; m_block = 0; } + void DamageInfo::ModifyDamage(int32 amount) { amount = std::min(amount, int32(GetDamage())); m_damage += amount; } + void DamageInfo::AbsorbDamage(uint32 amount) { amount = std::min(amount, GetDamage()); m_absorb += amount; m_damage -= amount; } + void DamageInfo::ResistDamage(uint32 amount) { amount = std::min(amount, GetDamage()); m_resist += amount; m_damage -= amount; } + void DamageInfo::BlockDamage(uint32 amount) { amount = std::min(amount, GetDamage()); @@ -1096,6 +1100,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam if (!victim) return; + if (!isAlive() || !victim->isAlive()) return; @@ -1105,12 +1110,11 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam case BASE_ATTACK: damageInfo->procAttacker = PROC_FLAG_DONE_MELEE_AUTO_ATTACK | PROC_FLAG_DONE_MAINHAND_ATTACK; damageInfo->procVictim = PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK; - damageInfo->HitInfo = HITINFO_NORMALSWING2; break; case OFF_ATTACK: damageInfo->procAttacker = PROC_FLAG_DONE_MELEE_AUTO_ATTACK | PROC_FLAG_DONE_OFFHAND_ATTACK; damageInfo->procVictim = PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK; - damageInfo->HitInfo = HITINFO_LEFTSWING; + damageInfo->HitInfo = HITINFO_OFFHAND; break; default: return; @@ -1146,29 +1150,29 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam switch (damageInfo->hitOutCome) { case MELEE_HIT_EVADE: - damageInfo->HitInfo |= HITINFO_MISS|HITINFO_SWINGNOHITSOUND; - damageInfo->TargetState = VICTIMSTATE_EVADES; - damageInfo->procEx|=PROC_EX_EVADE; + damageInfo->HitInfo |= HITINFO_MISS | HITINFO_SWINGNOHITSOUND; + damageInfo->TargetState = VICTIMSTATE_EVADES; + damageInfo->procEx |= PROC_EX_EVADE; damageInfo->damage = 0; damageInfo->cleanDamage = 0; return; case MELEE_HIT_MISS: - damageInfo->HitInfo |= HITINFO_MISS; - damageInfo->TargetState = VICTIMSTATE_INTACT; - damageInfo->procEx |= PROC_EX_MISS; - damageInfo->damage = 0; - damageInfo->cleanDamage = 0; + damageInfo->HitInfo |= HITINFO_MISS; + damageInfo->TargetState = VICTIMSTATE_INTACT; + damageInfo->procEx |= PROC_EX_MISS; + damageInfo->damage = 0; + damageInfo->cleanDamage = 0; break; case MELEE_HIT_NORMAL: - damageInfo->TargetState = VICTIMSTATE_HIT; - damageInfo->procEx|=PROC_EX_NORMAL_HIT; + damageInfo->TargetState = VICTIMSTATE_HIT; + damageInfo->procEx |= PROC_EX_NORMAL_HIT; break; case MELEE_HIT_CRIT: { - damageInfo->HitInfo |= HITINFO_CRITICALHIT; - damageInfo->TargetState = VICTIMSTATE_HIT; + damageInfo->HitInfo |= HITINFO_CRITICALHIT; + damageInfo->TargetState = VICTIMSTATE_HIT; - damageInfo->procEx |= PROC_EX_CRITICAL_HIT; + damageInfo->procEx |= PROC_EX_CRITICAL_HIT; // Crit bonus calc damageInfo->damage += damageInfo->damage; float mod = 0.0f; @@ -1229,8 +1233,8 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam if (leveldif > 3) leveldif = 3; float reducePercent = 1 - leveldif * 0.1f; - damageInfo->cleanDamage += damageInfo->damage-uint32(reducePercent * damageInfo->damage); - damageInfo->damage = uint32(reducePercent * damageInfo->damage); + damageInfo->cleanDamage += damageInfo->damage - uint32(reducePercent * damageInfo->damage); + damageInfo->damage = uint32(reducePercent * damageInfo->damage); break; } case MELEE_HIT_CRUSHING: @@ -1244,6 +1248,10 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam break; } + // Always apply HITINFO_AFFECTS_VICTIM in case its not a miss + if (!(damageInfo->HitInfo & HITINFO_MISS)) + damageInfo->HitInfo |= HITINFO_AFFECTS_VICTIM; + int32 resilienceReduction = damageInfo->damage; if (attackType != RANGED_ATTACK) ApplyResilience(victim, NULL, &resilienceReduction, (damageInfo->hitOutCome == MELEE_HIT_CRIT), CR_CRIT_TAKEN_MELEE); @@ -1259,14 +1267,17 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam damageInfo->procVictim |= PROC_FLAG_TAKEN_DAMAGE; // Calculate absorb & resists CalcAbsorbResist(damageInfo->target, SpellSchoolMask(damageInfo->damageSchoolMask), DIRECT_DAMAGE, damageInfo->damage, &damageInfo->absorb, &damageInfo->resist); - damageInfo->damage -= damageInfo->absorb + damageInfo->resist; + if (damageInfo->absorb) { - damageInfo->HitInfo |= HITINFO_ABSORB; + damageInfo->HitInfo |= (damageInfo->damage - damageInfo->absorb == 0 ? HITINFO_FULL_ABSORB : HITINFO_PARTIAL_ABSORB); damageInfo->procEx |= PROC_EX_ABSORB; } + if (damageInfo->resist) - damageInfo->HitInfo |= HITINFO_RESIST; + damageInfo->HitInfo |= (damageInfo->damage - damageInfo->resist == 0 ? HITINFO_FULL_RESIST : HITINFO_PARTIAL_RESIST); + + damageInfo->damage -= damageInfo->absorb + damageInfo->resist; } else // Impossible get negative result but.... damageInfo->damage = 0; @@ -2157,8 +2168,8 @@ void Unit::SendMeleeAttackStop(Unit* victim) { WorldPacket data(SMSG_ATTACKSTOP, (8+8+4)); data.append(GetPackGUID()); - data.append(victim ? victim->GetPackGUID() : 0); // can be 0x00... - data << uint32(0); // can be 0x1 + data.append(victim ? victim->GetPackGUID() : 0); + data << uint32(0); //! Can also take the value 0x01, which seems related to updating rotation SendMessageToSet(&data, true); sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTOP"); @@ -2988,20 +2999,20 @@ bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skip (withDelayed || m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_DELAYED)) { if (!isAutoshoot || !(m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS)) - return(true); + return true; } // channeled spells may be delayed, but they are still considered casted else if (!skipChanneled && m_currentSpells[CURRENT_CHANNELED_SPELL] && (m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() != SPELL_STATE_FINISHED)) { if (!isAutoshoot || !(m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS)) - return(true); + return true; } // autorepeat spells may be finished or delayed, but they are still considered casted else if (!skipAutorepeat && m_currentSpells[CURRENT_AUTOREPEAT_SPELL]) - return(true); + return true; - return(false); + return false; } void Unit::InterruptNonMeleeSpells(bool withDelayed, uint32 spell_id, bool withInstant) @@ -4846,28 +4857,29 @@ void Unit::SendAttackStateUpdate(CalcDamageInfo* damageInfo) data << uint32(damageInfo->damage); // Sub Damage } - if (damageInfo->HitInfo & (HITINFO_ABSORB | HITINFO_ABSORB2)) + if (damageInfo->HitInfo & (HITINFO_FULL_ABSORB | HITINFO_PARTIAL_ABSORB)) { for (uint32 i = 0; i < count; ++i) data << uint32(damageInfo->absorb); // Absorb } - if (damageInfo->HitInfo & (HITINFO_RESIST | HITINFO_RESIST2)) + if (damageInfo->HitInfo & (HITINFO_FULL_RESIST | HITINFO_PARTIAL_RESIST)) { for (uint32 i = 0; i < count; ++i) data << uint32(damageInfo->resist); // Resist } data << uint8(damageInfo->TargetState); - data << uint32(0); - data << uint32(0); + data << uint32(0); // Unknown attackerstate + data << uint32(0); // Melee spellid if (damageInfo->HitInfo & HITINFO_BLOCK) data << uint32(damageInfo->blocked_amount); - if (damageInfo->HitInfo & HITINFO_UNK3) + if (damageInfo->HitInfo & HITINFO_RAGE_GAIN) data << uint32(0); + //! Probably used for debugging purposes, as it is not known to appear on retail servers if (damageInfo->HitInfo & HITINFO_UNK1) { data << uint32(0); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index e1717dc5858..d85b7dd15bf 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -286,29 +286,29 @@ enum HitInfo { HITINFO_NORMALSWING = 0x00000000, HITINFO_UNK1 = 0x00000001, // req correct packet structure - HITINFO_NORMALSWING2 = 0x00000002, - HITINFO_LEFTSWING = 0x00000004, + HITINFO_AFFECTS_VICTIM = 0x00000002, + HITINFO_OFFHAND = 0x00000004, HITINFO_UNK2 = 0x00000008, HITINFO_MISS = 0x00000010, - HITINFO_ABSORB = 0x00000020, // absorbed damage - HITINFO_ABSORB2 = 0x00000040, // absorbed damage - HITINFO_RESIST = 0x00000080, // resisted atleast some damage - HITINFO_RESIST2 = 0x00000100, // resisted atleast some damage + HITINFO_FULL_ABSORB = 0x00000020, + HITINFO_PARTIAL_ABSORB = 0x00000040, + HITINFO_FULL_RESIST = 0x00000080, + HITINFO_PARTIAL_RESIST = 0x00000100, HITINFO_CRITICALHIT = 0x00000200, // critical hit // 0x00000400 // 0x00000800 // 0x00001000 HITINFO_BLOCK = 0x00002000, // blocked damage - // 0x00004000 - // 0x00008000 + // 0x00004000 // Hides worldtext for 0 damage + // 0x00008000 // Related to blood visual HITINFO_GLANCING = 0x00010000, HITINFO_CRUSHING = 0x00020000, - HITINFO_NOACTION = 0x00040000, // guessed + HITINFO_NO_ANIMATION = 0x00040000, // 0x00080000 // 0x00100000 - HITINFO_SWINGNOHITSOUND = 0x00200000, // guessed + HITINFO_SWINGNOHITSOUND = 0x00200000, // unused? // 0x00400000 - HITINFO_UNK3 = 0x00800000 + HITINFO_RAGE_GAIN = 0x00800000 }; //i would like to remove this: (it is defined in item.h From c38bf4498ac72528caec60c4750fe2cd7f492233 Mon Sep 17 00:00:00 2001 From: kaelima Date: Mon, 26 Mar 2012 03:12:56 +0200 Subject: [PATCH 0292/1149] Fix compile and fix a possible crash for mob_kiljaeden_controller --- src/server/game/Spells/Spell.cpp | 4 ++-- .../EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index bf2be9afd9b..2032c883256 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3080,7 +3080,7 @@ void Spell::cancel() *m_selfContainer = NULL; m_caster->RemoveDynObject(m_spellInfo->Id); - if (IsChanneledSpell(m_spellInfo)) // if not channeled then the object for the current cast wasn't summoned yet + if (m_spellInfo->IsChanneled()) // if not channeled then the object for the current cast wasn't summoned yet m_caster->RemoveGameObject(m_spellInfo->Id, true); //set state back so finish will be processed @@ -6666,7 +6666,7 @@ bool SpellEvent::Execute(uint64 e_time, uint32 p_time) // no, we aren't, do the typical update // check, if we have channeled spell on our hands /* - if (IsChanneledSpell(m_Spell->m_spellInfo)) + if (m_Spell->m_spellInfo->IsChanneled()) { // evented channeled spell is processed separately, casted once after delay, and not destroyed till finish // check, if we have casting anything else except this channeled spell and autorepeat diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index 30a2da32ef3..8a64d45abcb 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -434,8 +434,9 @@ public: { phase = PHASE_DECEIVERS; - if (Creature* pKalecKJ = Unit::GetCreature((*me), instance->GetData64(DATA_KALECGOS_KJ))) - CAST_AI(boss_kalecgos_kj::boss_kalecgos_kjAI, pKalecKJ->AI())->ResetOrbs(); + if (instance) + if (Creature* pKalecKJ = Unit::GetCreature((*me), instance->GetData64(DATA_KALECGOS_KJ))) + CAST_AI(boss_kalecgos_kj::boss_kalecgos_kjAI, pKalecKJ->AI())->ResetOrbs(); deceiverDeathCount = 0; bSummonedDeceivers = false; bKiljaedenDeath = false; From 19f821d00a2ce2e2b6bc5b972a6cc9759ff3e4ee Mon Sep 17 00:00:00 2001 From: kaelima Date: Mon, 26 Mar 2012 05:14:10 +0200 Subject: [PATCH 0293/1149] Auth/Realmlist: Make use of RealmFlags and rename color to flag (core- and dbwise) Also fix connecting with realmflag & 4 --- .../auth/2012_03_26_00_auth_realmlist.sql | 2 ++ src/server/authserver/Realms/RealmList.cpp | 8 ++++---- src/server/authserver/Realms/RealmList.h | 17 +++++++++++++++-- src/server/authserver/Server/AuthSocket.cpp | 11 ++++++++++- src/server/authserver/Server/AuthSocket.h | 13 ------------- .../Database/Implementation/LoginDatabase.cpp | 2 +- src/server/worldserver/CMakeLists.txt | 1 + src/server/worldserver/Master.cpp | 7 ++++--- 8 files changed, 37 insertions(+), 24 deletions(-) create mode 100644 sql/updates/auth/2012_03_26_00_auth_realmlist.sql diff --git a/sql/updates/auth/2012_03_26_00_auth_realmlist.sql b/sql/updates/auth/2012_03_26_00_auth_realmlist.sql new file mode 100644 index 00000000000..0a570a31773 --- /dev/null +++ b/sql/updates/auth/2012_03_26_00_auth_realmlist.sql @@ -0,0 +1,2 @@ +ALTER TABLE `realmlist` + CHANGE `color` `flag` tinyint(3) unsigned NOT NULL DEFAULT '2'; diff --git a/src/server/authserver/Realms/RealmList.cpp b/src/server/authserver/Realms/RealmList.cpp index 245b9c7cc8c..efcced51089 100755 --- a/src/server/authserver/Realms/RealmList.cpp +++ b/src/server/authserver/Realms/RealmList.cpp @@ -31,7 +31,7 @@ void RealmList::Initialize(uint32 updateInterval) UpdateRealms(true); } -void RealmList::UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint32 port, uint8 icon, uint8 color, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build) +void RealmList::UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint32 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build) { // Create new if not exist or update existed Realm& realm = m_realms[name]; @@ -39,7 +39,7 @@ void RealmList::UpdateRealm(uint32 ID, const std::string& name, const std::strin realm.m_ID = ID; realm.name = name; realm.icon = icon; - realm.color = color; + realm.flag = flag; realm.timezone = timezone; realm.allowedSecurityLevel = allowedSecurityLevel; realm.populationLevel = popu; @@ -84,13 +84,13 @@ void RealmList::UpdateRealms(bool init) const std::string& address = fields[2].GetString(); uint32 port = fields[3].GetUInt32(); uint8 icon = fields[4].GetUInt8(); - uint8 color = fields[5].GetUInt8(); + RealmFlags flag = RealmFlags(fields[5].GetUInt8()); uint8 timezone = fields[6].GetUInt8(); uint8 allowedSecurityLevel = fields[7].GetUInt8(); float pop = fields[8].GetFloat(); uint32 build = fields[9].GetUInt32(); - UpdateRealm(realmId, name, address, port, icon, color, timezone, (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop, build); + UpdateRealm(realmId, name, address, port, icon, flag, timezone, (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop, build); if (init) sLog->outString("Added realm \"%s\".", fields[1].GetCString()); diff --git a/src/server/authserver/Realms/RealmList.h b/src/server/authserver/Realms/RealmList.h index 698026876fb..4d258953ae0 100755 --- a/src/server/authserver/Realms/RealmList.h +++ b/src/server/authserver/Realms/RealmList.h @@ -23,13 +23,26 @@ #include #include "Common.h" +enum RealmFlags +{ + REALM_FLAG_NONE = 0x00, + REALM_FLAG_INVALID = 0x01, + REALM_FLAG_OFFLINE = 0x02, + REALM_FLAG_SPECIFYBUILD = 0x04, + REALM_FLAG_UNK1 = 0x08, + REALM_FLAG_UNK2 = 0x10, + REALM_FLAG_RECOMMENDED = 0x20, + REALM_FLAG_NEW = 0x40, + REALM_FLAG_FULL = 0x80 +}; + // Storage object for a realm struct Realm { std::string address; std::string name; uint8 icon; - uint8 color; + RealmFlags flag; uint8 timezone; uint32 m_ID; AccountTypes allowedSecurityLevel; @@ -58,7 +71,7 @@ public: private: void UpdateRealms(bool init=false); - void UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint32 port, uint8 icon, uint8 color, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build); + void UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint32 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build); RealmMap m_realms; uint32 m_UpdateInterval; diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index e1d77c60286..15555e4d607 100755 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -871,7 +871,7 @@ bool AuthSocket::_HandleRealmList() pkt << i->second.icon; // realm type if ( _expversion & POST_BC_EXP_FLAG ) // only 2.x and 3.x clients pkt << lock; // if 1, then realm locked - pkt << i->second.color; // if 2, then realm is offline + pkt << uint8(i->second.flag); // RealmFlags pkt << i->first; pkt << i->second.address; pkt << i->second.populationLevel; @@ -882,6 +882,15 @@ bool AuthSocket::_HandleRealmList() else pkt << (uint8)0x0; // 1.12.1 and 1.12.2 clients + if (i->second.flag & REALM_FLAG_SPECIFYBUILD) + { + // TODO: Make this customizable + pkt << uint8(3); + pkt << uint8(3); + pkt << uint8(5); + pkt << uint16(12340); + } + ++RealmListSize; } diff --git a/src/server/authserver/Server/AuthSocket.h b/src/server/authserver/Server/AuthSocket.h index 9d59a9f7602..9be2136b55c 100755 --- a/src/server/authserver/Server/AuthSocket.h +++ b/src/server/authserver/Server/AuthSocket.h @@ -23,19 +23,6 @@ #include "BigNumber.h" #include "RealmSocket.h" -enum RealmFlags -{ - REALM_FLAG_NONE = 0x00, - REALM_FLAG_INVALID = 0x01, - REALM_FLAG_OFFLINE = 0x02, - REALM_FLAG_SPECIFYBUILD = 0x04, - REALM_FLAG_UNK1 = 0x08, - REALM_FLAG_UNK2 = 0x10, - REALM_FLAG_RECOMMENDED = 0x20, - REALM_FLAG_NEW = 0x40, - REALM_FLAG_FULL = 0x80 -}; - // Handle login commands class AuthSocket: public RealmSocket::Session { diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp index bc8eb709788..df92c6fa77c 100755 --- a/src/server/shared/Database/Implementation/LoginDatabase.cpp +++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp @@ -22,7 +22,7 @@ void LoginDatabaseConnection::DoPrepareStatements() if (!m_reconnecting) m_stmts.resize(MAX_LOGINDATABASE_STATEMENTS); - PREPARE_STATEMENT(LOGIN_SEL_REALMLIST, "SELECT id, name, address, port, icon, color, timezone, allowedSecurityLevel, population, gamebuild FROM realmlist WHERE color <> 3 ORDER BY name", CONNECTION_SYNCH) + PREPARE_STATEMENT(LOGIN_SEL_REALMLIST, "SELECT id, name, address, port, icon, flag, timezone, allowedSecurityLevel, population, gamebuild FROM realmlist WHERE flag <> 3 ORDER BY name", CONNECTION_SYNCH) PREPARE_STATEMENT(LOGIN_DEL_EXPIRED_IP_BANS, "DELETE FROM ip_banned WHERE unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_UPD_EXPIRED_ACCOUNT_BANS, "UPDATE account_banned SET active = 0 WHERE active = 1 AND unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_SEL_IP_BANNED, "SELECT * FROM ip_banned WHERE ip = ?", CONNECTION_SYNCH) diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt index 28aab37d1dd..d1419cb0fcb 100644 --- a/src/server/worldserver/CMakeLists.txt +++ b/src/server/worldserver/CMakeLists.txt @@ -134,6 +134,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/server/game/Weather ${CMAKE_SOURCE_DIR}/src/server/game/World ${CMAKE_SOURCE_DIR}/src/server/authserver/Server + ${CMAKE_SOURCE_DIR}/src/server/authserver/Realms ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/CommandLine ${CMAKE_CURRENT_SOURCE_DIR}/RemoteAccess diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index 45827b10c2c..f1be4a6889b 100755 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -41,6 +41,7 @@ #include "Timer.h" #include "Util.h" #include "AuthSocket.h" +#include "RealmList.h" #include "BigNumber.h" @@ -162,7 +163,7 @@ int Master::Run() return 1; // set server offline (not connectable) - LoginDatabase.DirectPExecute("UPDATE realmlist SET color = (color & ~%u) | %u WHERE id = '%d'", REALM_FLAG_OFFLINE, REALM_FLAG_INVALID, realmID); + LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = (flag & ~%u) | %u WHERE id = '%d'", REALM_FLAG_OFFLINE, REALM_FLAG_INVALID, realmID); ///- Initialize the World sWorld->SetInitialWorldSettings(); @@ -273,7 +274,7 @@ int Master::Run() } // set server online (allow connecting now) - LoginDatabase.DirectPExecute("UPDATE realmlist SET color = color & ~%u, population = 0 WHERE id = '%u'", REALM_FLAG_INVALID, realmID); + LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag & ~%u, population = 0 WHERE id = '%u'", REALM_FLAG_INVALID, realmID); sLog->outString("%s (worldserver-daemon) ready...", _FULLVERSION); sWorldSocketMgr->Wait(); @@ -286,7 +287,7 @@ int Master::Run() } // set server offline - LoginDatabase.DirectPExecute("UPDATE realmlist SET color = color | %u WHERE id = '%d'", REALM_FLAG_OFFLINE, realmID); + LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag | %u WHERE id = '%d'", REALM_FLAG_OFFLINE, realmID); // when the main thread closes the singletons get unloaded // since worldrunnable uses them, it will crash if unloaded after master From 43048afc7e95e895e8d98ebb242692b456e4e7ca Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Mon, 26 Mar 2012 01:49:41 +0200 Subject: [PATCH 0294/1149] Core/DB Layer: Fix a memory leak. --- src/server/authserver/Main.cpp | 2 -- src/server/shared/Database/DatabaseWorker.cpp | 7 +++++++ src/server/shared/Database/DatabaseWorkerPool.h | 5 ++--- src/server/shared/Database/MySQLConnection.cpp | 4 ++++ src/server/worldserver/Master.cpp | 2 -- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp index 01a33d836d6..bd155725465 100755 --- a/src/server/authserver/Main.cpp +++ b/src/server/authserver/Main.cpp @@ -246,8 +246,6 @@ extern int main(int argc, char **argv) // Initialize connection to the database bool StartDB() { - MySQL::Library_Init(); - std::string dbstring = ConfigMgr::GetStringDefault("LoginDatabaseInfo", ""); if (dbstring.empty()) { diff --git a/src/server/shared/Database/DatabaseWorker.cpp b/src/server/shared/Database/DatabaseWorker.cpp index 662c879ad5e..8dc9ab4669d 100644 --- a/src/server/shared/Database/DatabaseWorker.cpp +++ b/src/server/shared/Database/DatabaseWorker.cpp @@ -34,6 +34,11 @@ int DatabaseWorker::svc() if (!m_queue) return -1; + //! Since this is called from the worker thread itself, we can ensure + //! that thread-specific variables remain in this thread. + if (!m_conn->Open()) + return -1; + SQLOperation *request = NULL; while (1) { @@ -47,5 +52,7 @@ int DatabaseWorker::svc() delete request; } + //! Clean up thread-specific variables + m_conn->Close(); return 0; } diff --git a/src/server/shared/Database/DatabaseWorkerPool.h b/src/server/shared/Database/DatabaseWorkerPool.h index 01b79c9ac58..811db775004 100755 --- a/src/server/shared/Database/DatabaseWorkerPool.h +++ b/src/server/shared/Database/DatabaseWorkerPool.h @@ -53,7 +53,7 @@ class DatabaseWorkerPool public: /* Activity state */ DatabaseWorkerPool() : - m_queue(new ACE_Activation_Queue(new ACE_Message_Queue)) + m_queue(new ACE_Activation_Queue()) { memset(m_connectionCount, 0, sizeof(m_connectionCount)); m_connections.resize(IDX_SIZE); @@ -77,7 +77,6 @@ class DatabaseWorkerPool for (uint8 i = 0; i < async_threads; ++i) { T* t = new T(m_queue, m_connectionInfo); - res &= t->Open(); m_connections[IDX_ASYNC][i] = t; ++m_connectionCount[IDX_ASYNC]; } @@ -111,7 +110,6 @@ class DatabaseWorkerPool DatabaseWorker* worker = t->m_worker; worker->wait(); delete worker; - t->Close(); } sLog->outSQLDriver("Asynchronous connections on databasepool '%s' terminated. Proceeding with synchronous connections.", m_connectionInfo.database.c_str()); @@ -125,6 +123,7 @@ class DatabaseWorkerPool t->Close(); } + delete m_queue; sLog->outSQLDriver("All connections on databasepool %s closed.", m_connectionInfo.database.c_str()); } diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp index f686db4c199..273d2842505 100755 --- a/src/server/shared/Database/MySQLConnection.cpp +++ b/src/server/shared/Database/MySQLConnection.cpp @@ -68,9 +68,13 @@ MySQLConnection::~MySQLConnection() } mysql_close(m_Mysql); + MySQL::Thread_End(); Unlock(); /// Unlock while we die, how ironic } +//! Can be called synchronously in DatabaseWorkerPool, in which thread-specific variables initialized in the main thread +//! are deallocated. +//! Can also be called by worker threads, in which their respective thread-specific variables are deallocated. void MySQLConnection::Close() { /// Only close us if we're not operating diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index f1be4a6889b..258481350d2 100755 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -362,8 +362,6 @@ int Master::Run() /// Initialize connection to the databases bool Master::_StartDB() { - MySQL::Library_Init(); - sLog->SetLogDB(false); std::string dbstring; uint8 async_threads, synch_threads; From 70ee37f3b4fef7e2e2859714f25d7a96887c0c23 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Mon, 26 Mar 2012 08:58:21 +0200 Subject: [PATCH 0295/1149] Core/DB Layer: Fix a memory leak for synchronously executed prepared statements. --- src/server/shared/Database/DatabaseWorkerPool.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/shared/Database/DatabaseWorkerPool.h b/src/server/shared/Database/DatabaseWorkerPool.h index 811db775004..cd855852867 100755 --- a/src/server/shared/Database/DatabaseWorkerPool.h +++ b/src/server/shared/Database/DatabaseWorkerPool.h @@ -268,6 +268,9 @@ class DatabaseWorkerPool PreparedResultSet* ret = t->Query(stmt); t->Unlock(); + //! Delete proxy-class. Not needed anymore + delete stmt; + if (!ret || !ret->GetRowCount()) return PreparedQueryResult(NULL); From e960016dc40014a8cc84b5854fa21a5651ae4f2b Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Mon, 26 Mar 2012 13:33:47 +0200 Subject: [PATCH 0296/1149] Partial revert of "Core/DB Layer: Fix a memory leak.", mysql library related stuff. Original memory leak fix is still in place. --- src/server/authserver/Main.cpp | 2 ++ src/server/shared/Database/DatabaseWorker.cpp | 7 ------- src/server/shared/Database/DatabaseWorkerPool.h | 3 +++ src/server/shared/Database/MySQLConnection.cpp | 4 ---- src/server/worldserver/Master.cpp | 2 ++ 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp index bd155725465..01a33d836d6 100755 --- a/src/server/authserver/Main.cpp +++ b/src/server/authserver/Main.cpp @@ -246,6 +246,8 @@ extern int main(int argc, char **argv) // Initialize connection to the database bool StartDB() { + MySQL::Library_Init(); + std::string dbstring = ConfigMgr::GetStringDefault("LoginDatabaseInfo", ""); if (dbstring.empty()) { diff --git a/src/server/shared/Database/DatabaseWorker.cpp b/src/server/shared/Database/DatabaseWorker.cpp index 8dc9ab4669d..662c879ad5e 100644 --- a/src/server/shared/Database/DatabaseWorker.cpp +++ b/src/server/shared/Database/DatabaseWorker.cpp @@ -34,11 +34,6 @@ int DatabaseWorker::svc() if (!m_queue) return -1; - //! Since this is called from the worker thread itself, we can ensure - //! that thread-specific variables remain in this thread. - if (!m_conn->Open()) - return -1; - SQLOperation *request = NULL; while (1) { @@ -52,7 +47,5 @@ int DatabaseWorker::svc() delete request; } - //! Clean up thread-specific variables - m_conn->Close(); return 0; } diff --git a/src/server/shared/Database/DatabaseWorkerPool.h b/src/server/shared/Database/DatabaseWorkerPool.h index cd855852867..aef952fab55 100755 --- a/src/server/shared/Database/DatabaseWorkerPool.h +++ b/src/server/shared/Database/DatabaseWorkerPool.h @@ -77,6 +77,7 @@ class DatabaseWorkerPool for (uint8 i = 0; i < async_threads; ++i) { T* t = new T(m_queue, m_connectionInfo); + res &= t->Open(); m_connections[IDX_ASYNC][i] = t; ++m_connectionCount[IDX_ASYNC]; } @@ -110,6 +111,7 @@ class DatabaseWorkerPool DatabaseWorker* worker = t->m_worker; worker->wait(); delete worker; + t->Close(); } sLog->outSQLDriver("Asynchronous connections on databasepool '%s' terminated. Proceeding with synchronous connections.", m_connectionInfo.database.c_str()); @@ -124,6 +126,7 @@ class DatabaseWorkerPool } delete m_queue; + sLog->outSQLDriver("All connections on databasepool %s closed.", m_connectionInfo.database.c_str()); } diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp index 273d2842505..f686db4c199 100755 --- a/src/server/shared/Database/MySQLConnection.cpp +++ b/src/server/shared/Database/MySQLConnection.cpp @@ -68,13 +68,9 @@ MySQLConnection::~MySQLConnection() } mysql_close(m_Mysql); - MySQL::Thread_End(); Unlock(); /// Unlock while we die, how ironic } -//! Can be called synchronously in DatabaseWorkerPool, in which thread-specific variables initialized in the main thread -//! are deallocated. -//! Can also be called by worker threads, in which their respective thread-specific variables are deallocated. void MySQLConnection::Close() { /// Only close us if we're not operating diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index 258481350d2..f1be4a6889b 100755 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -362,6 +362,8 @@ int Master::Run() /// Initialize connection to the databases bool Master::_StartDB() { + MySQL::Library_Init(); + sLog->SetLogDB(false); std::string dbstring; uint8 async_threads, synch_threads; From f18946a72e5f4d8075dcf631f63502f235e5c8b4 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Mon, 26 Mar 2012 15:38:52 +0200 Subject: [PATCH 0297/1149] DB/Creature Template: Some updates, mostly HoverHeight and InhabitType. Thanks to KingPin for re-parsing ~5GB of sniffs. --- .../2012_03_26_00_world_creature_template.sql | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sql/updates/world/2012_03_26_00_world_creature_template.sql diff --git a/sql/updates/world/2012_03_26_00_world_creature_template.sql b/sql/updates/world/2012_03_26_00_world_creature_template.sql new file mode 100644 index 00000000000..f60849476bd --- /dev/null +++ b/sql/updates/world/2012_03_26_00_world_creature_template.sql @@ -0,0 +1,73 @@ +UPDATE `creature_template` SET `HoverHeight`=10.8, `VehicleId`=232 WHERE `entry`=30393; +UPDATE `creature_template` SET `HoverHeight`=10.8, `VehicleId`=237 WHERE `entry`=30461; +UPDATE `creature_template` SET `HoverHeight`=10 WHERE `entry`=27530; +UPDATE `creature_template` SET `HoverHeight`=10 WHERE `entry`=26277; +UPDATE `creature_template` SET `HoverHeight`=10 WHERE `entry`=26276; +UPDATE `creature_template` SET `HoverHeight`=1.2 WHERE `entry`=31070; +UPDATE `creature_template` SET `HoverHeight`=12 WHERE `entry`=37126; +UPDATE `creature_template` SET `HoverHeight`=15 WHERE `entry`=27608; +UPDATE `creature_template` SET `HoverHeight`=15 WHERE `entry`=27608; +UPDATE `creature_template` SET `HoverHeight`=1.6 WHERE `entry`=38392; +UPDATE `creature_template` SET `HoverHeight`=2.25 WHERE `entry`=30272; +UPDATE `creature_template` SET `HoverHeight`=2.58, `Scale`=1.72 WHERE `entry`=26607; +UPDATE `creature_template` SET `HoverHeight`=25 WHERE `entry`=37755; +UPDATE `creature_template` SET `HoverHeight`=26 WHERE `entry`=29790; +UPDATE `creature_template` SET `HoverHeight`=2.7 WHERE `entry`=25451; +UPDATE `creature_template` SET `HoverHeight`=2 WHERE `entry`=29048; +UPDATE `creature_template` SET `HoverHeight`=2, `VehicleId`=234 WHERE `entry`=30228; +UPDATE `creature_template` SET `HoverHeight`=2 WHERE `entry`=25445; +UPDATE `creature_template` SET `HoverHeight`=2 WHERE `entry`=26761; +UPDATE `creature_template` SET `HoverHeight`=2 WHERE `entry`=26761; +UPDATE `creature_template` SET `HoverHeight`=2 WHERE `entry`=25721; +UPDATE `creature_template` SET `HoverHeight`=35 WHERE `entry`=27789; +UPDATE `creature_template` SET `HoverHeight`=3 WHERE `entry`=34567; +UPDATE `creature_template` SET `HoverHeight`=3 WHERE `entry`=26668; +UPDATE `creature_template` SET `HoverHeight`=3, `VehicleId`=390 WHERE `entry`=34120; +UPDATE `creature_template` SET `HoverHeight`=3, `VehicleId`=108 WHERE `entry`=24083; +UPDATE `creature_template` SET `HoverHeight`=3, `VehicleId`=270 WHERE `entry`=31137; +UPDATE `creature_template` SET `HoverHeight`=4 WHERE `entry`=24272; +UPDATE `creature_template` SET `HoverHeight`=4 WHERE `entry`=37098; +UPDATE `creature_template` SET `HoverHeight`=4 WHERE `entry`=28534; +UPDATE `creature_template` SET `HoverHeight`=4 WHERE `entry`=28511; +UPDATE `creature_template` SET `HoverHeight`=5.85 WHERE `entry`=26736; +UPDATE `creature_template` SET `HoverHeight`=5.85 WHERE `entry`=26736; +UPDATE `creature_template` SET `HoverHeight`=5.85 WHERE `entry`=32534; +UPDATE `creature_template` SET `HoverHeight`=5, `VehicleId`=348 WHERE `entry`=33214; +UPDATE `creature_template` SET `HoverHeight`=5 WHERE `entry`=27693; +UPDATE `creature_template` SET `HoverHeight`=5 WHERE `entry`=34203; +UPDATE `creature_template` SET `HoverHeight`=6.25 WHERE `entry`=40083; +UPDATE `creature_template` SET `HoverHeight`=6.25 WHERE `entry`=40100; +UPDATE `creature_template` SET `HoverHeight`=6 WHERE `entry`=34496; +UPDATE `creature_template` SET `HoverHeight`=6 WHERE `entry`=34496; +UPDATE `creature_template` SET `HoverHeight`=6 WHERE `entry`=34497; +UPDATE `creature_template` SET `HoverHeight`=7.5 WHERE `entry`=26933; +UPDATE `creature_template` SET `HoverHeight`=8.4, `VehicleId`=232 WHERE `entry`=30420; +UPDATE `creature_template` SET `HoverHeight`=8 WHERE `entry`=33186; +UPDATE `creature_template` SET `HoverHeight`=9 WHERE `entry`=26933; +UPDATE `creature_template` SET `HoverHeight`=9 WHERE `entry`=37528; +UPDATE `creature_template` SET `HoverHeight`=9 WHERE `entry`=37230; +UPDATE `creature_template` SET `HoverHeight`=9, `VehicleId`=375 WHERE `entry`=33687; +UPDATE `creature_template` SET `HoverHeight`=9, `VehicleId`=535 WHERE `entry`=36661; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=10.8, `VehicleId`=232 WHERE `entry`=30393; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=10 WHERE `entry`=27608; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=10 WHERE `entry`=27608; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=15 WHERE `entry`=32630; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=1.6 WHERE `entry`=38391; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=2.25, `VehicleId`=247 WHERE `entry`=30564; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=2.25 WHERE `entry`=30272; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=2 WHERE `entry`=25721; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=2 WHERE `entry`=29570; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=2 WHERE `entry`=26761; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=3.12, `Scale`=2.08 WHERE `entry`=26607; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=3 WHERE `entry`=26668; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=3, `VehicleId`=108 WHERE `entry`=24083; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=4 WHERE `entry`=37098; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=4 WHERE `entry`=30945; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=5.85 WHERE `entry`=26736; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=5.85 WHERE `entry`=26736; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=5, `VehicleId`=276 WHERE `entry`=31432; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=6 WHERE `entry`=30501; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=7.5 WHERE `entry`=26933; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=8.4, `VehicleId`=232 WHERE `entry`=30420; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=9 WHERE `entry`=26933; + From b1ca1ee5ec90715fcb2682e6d47ac5f7d425146b Mon Sep 17 00:00:00 2001 From: leak Date: Mon, 26 Mar 2012 15:46:54 +0200 Subject: [PATCH 0298/1149] Core/DBLayer: Convert PAppend() queries to prepared statements No.4 NOTE: Most of the cores queries have been converted to prepared statements now. If your code contains queries, please either use the exiting or implement new statements. The only exclusions are one-time queries (e.g. for core startup) and queries that can't be prepared due to limitations. --- src/server/game/Entities/Player/Player.cpp | 493 ++++++++++++++---- src/server/game/Globals/ObjectMgr.cpp | 2 +- src/server/game/Handlers/MailHandler.cpp | 2 +- .../Implementation/CharacterDatabase.cpp | 53 +- .../Implementation/CharacterDatabase.h | 53 +- 5 files changed, 496 insertions(+), 107 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 44547873754..de66362aa27 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4305,7 +4305,9 @@ void Player::_LoadSpellCooldowns(PreparedQueryResult result) void Player::_SaveSpellCooldowns(SQLTransaction& trans) { - trans->PAppend("DELETE FROM character_spell_cooldown WHERE guid = '%u'", GetGUIDLow()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL_COOLDOWN); + stmt->setUInt32(0, GetGUIDLow()); + trans->Append(stmt); time_t curTime = time(NULL); time_t infTime = curTime + infinityCooldownDelayCheck; @@ -4826,13 +4828,19 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC // We can return mail now // So firstly delete the old one - trans->PAppend("DELETE FROM mail WHERE id = '%u'", mail_id); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_BY_ID); + stmt->setUInt32(0, mail_id); + trans->Append(stmt); // Mail is not from player if (mailType != MAIL_NORMAL) { if (has_items) - trans->PAppend("DELETE FROM mail_items WHERE mail_id = '%u'", mail_id); + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEM_BY_ID); + stmt->setUInt32(0, mail_id); + trans->Append(stmt); + } continue; } @@ -4877,7 +4885,9 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC } } - trans->PAppend("DELETE FROM mail_items WHERE mail_id = '%u'", mail_id); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEM_BY_ID); + stmt->setUInt32(0, mail_id); + trans->Append(stmt); uint32 pl_account = sObjectMgr->GetPlayerAccountIdByGUID(MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER)); @@ -4921,48 +4931,134 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC } while (resultFriends->NextRow()); } - trans->PAppend("DELETE FROM characters WHERE guid = '%u'", guid); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_ACCOUNT_DATA); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER); stmt->setUInt32(0, guid); trans->Append(stmt); - trans->PAppend("DELETE FROM character_declinedname WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_action WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_aura WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_gifts WHERE guid = '%u'", guid); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_ACCOUNT_DATA); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_DECLINED_NAME); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACTION); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_GIFT); + stmt->setUInt32(0, guid); + trans->Append(stmt); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_HOMEBIND); stmt->setUInt32(0, guid); trans->Append(stmt); - trans->PAppend("DELETE FROM character_instance WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_inventory WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_queststatus WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_queststatus_rewarded WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_reputation WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_spell WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_spell_cooldown WHERE guid = '%u'", guid); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS_REWARDED); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_REPUTATION); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL_COOLDOWN); + stmt->setUInt32(0, guid); + trans->Append(stmt); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_GM_TICKETS); stmt->setUInt32(0, guid); trans->Append(stmt); - trans->PAppend("DELETE FROM item_instance WHERE owner_guid = '%u'", guid); - trans->PAppend("DELETE FROM character_social WHERE guid = '%u' OR friend='%u'", guid, guid); - trans->PAppend("DELETE FROM mail WHERE receiver = '%u'", guid); - trans->PAppend("DELETE FROM mail_items WHERE receiver = '%u'", guid); - trans->PAppend("DELETE FROM character_pet WHERE owner = '%u'", guid); - trans->PAppend("DELETE FROM character_pet_declinedname WHERE owner = '%u'", guid); - trans->PAppend("DELETE FROM character_achievement WHERE guid = '%u' " // NOTE: These achievements have flags & 256 in DBC. - "AND achievement NOT BETWEEN '456' AND '467' " // Realm First Level 80 - "AND achievement NOT BETWEEN '1400' AND '1427' " // Realm First Raid Achievements - "AND achievement NOT IN(1463, 3117, 3259) ", guid); // Realm First Northen Vanguard + Raid Achievements - trans->PAppend("DELETE FROM character_achievement_progress WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_equipmentsets WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM guild_eventlog WHERE PlayerGuid1 = '%u' OR PlayerGuid2 = '%u'", guid, guid); - trans->PAppend("DELETE FROM guild_bank_eventlog WHERE PlayerGuid = '%u'", guid); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SOCIAL_BY_FRIEND); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SOCIAL_BY_GUID); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEMS); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_BY_OWNER); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_DECLINEDNAME_BY_OWNER); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENTS); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_EQUIPMENTSETS); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_EVENTLOG_BY_PLAYER); + stmt->setUInt32(0, guid); + stmt->setUInt32(1, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_BANK_EVENTLOG_BY_PLAYER); + stmt->setUInt32(0, guid); + trans->Append(stmt); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_BGDATA); stmt->setUInt32(0, guid); trans->Append(stmt); - trans->PAppend("DELETE FROM character_glyphs WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_queststatus_daily WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_talent WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_skills WHERE guid = '%u'", guid); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_GLYPHS); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS_DAILY); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_TALENT); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SKILLS); + stmt->setUInt32(0, guid); + trans->Append(stmt); CharacterDatabase.CommitTransaction(trans); break; @@ -7270,24 +7366,38 @@ void Player::SetArenaPoints(uint32 value) void Player::ModifyHonorPoints(int32 value, SQLTransaction* trans /*=NULL*/) { + PreparedStatement* stmt = NULL; + int32 newValue = int32(GetHonorPoints()) + value; if (newValue < 0) newValue = 0; SetHonorPoints(uint32(newValue)); if (trans && !trans->null()) - (*trans)->PAppend("UPDATE characters SET totalHonorPoints=%u WHERE guid=%u", newValue, GetGUIDLow()); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_HONOR_POINTS); + stmt->setUInt32(0, newValue); + stmt->setUInt32(1, GetGUIDLow()); + (*trans)->Append(stmt); + } } void Player::ModifyArenaPoints(int32 value, SQLTransaction* trans /*=NULL*/) { + PreparedStatement* stmt = NULL; + int32 newValue = int32(GetArenaPoints()) + value; if (newValue < 0) newValue = 0; SetArenaPoints(uint32(newValue)); if (trans && !trans->null()) - (*trans)->PAppend("UPDATE characters SET arenaPoints=%u WHERE guid=%u", newValue, GetGUIDLow()); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_ARENA_POINTS); + stmt->setUInt32(0, newValue); + stmt->setUInt32(1, GetGUIDLow()); + (*trans)->Append(stmt); + } } uint32 Player::GetGuildIdFromDB(uint64 guid) @@ -17576,6 +17686,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, Field* fields) { + PreparedStatement* stmt = NULL; Item* item = NULL; uint32 itemGuid = fields[13].GetUInt32(); uint32 itemEntry = fields[14].GetUInt32(); @@ -17605,7 +17716,11 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F { sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with expired refund time (%u). Deleting refund data and removing refundable flag.", GetGUIDLow(), GetName(), item->GetGUIDLow(), item->GetEntry(), item->GetPlayedTime()); - trans->PAppend("DELETE FROM item_refund_instance WHERE item_guid = '%u'", item->GetGUIDLow()); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_REFUND_INSTANCE); + stmt->setUInt32(0, item->GetGUIDLow()); + trans->Append(stmt); + item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE); } else @@ -18134,7 +18249,7 @@ void Player::_LoadBoundInstances(PreparedQueryResult result) if (deleteInstance) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE_GUID); stmt->setUInt32(0, GetGUIDLow()); stmt->setUInt32(1, instanceId); @@ -18190,7 +18305,7 @@ void Player::UnbindInstance(BoundInstancesMap::iterator &itr, Difficulty difficu { if (!unload) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE); stmt->setUInt32(0, GetGUIDLow()); stmt->setUInt32(1, itr->second.save->GetInstanceId()); @@ -18815,29 +18930,51 @@ void Player::SaveInventoryAndGoldToDB(SQLTransaction& trans) void Player::SaveGoldToDB(SQLTransaction& trans) { - trans->PAppend("UPDATE characters SET money = '%u' WHERE guid = '%u'", GetMoney(), GetGUIDLow()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_MONEY); + stmt->setUInt32(0, GetMoney()); + stmt->setUInt32(1, GetGUIDLow()); + trans->Append(stmt); } void Player::_SaveActions(SQLTransaction& trans) { + PreparedStatement* stmt = NULL; + for (ActionButtonList::iterator itr = m_actionButtons.begin(); itr != m_actionButtons.end();) { switch (itr->second.uState) { case ACTIONBUTTON_NEW: - trans->PAppend("INSERT INTO character_action (guid, spec, button, action, type) VALUES ('%u', '%u', '%u', '%u', '%u')", - GetGUIDLow(), m_activeSpec, (uint32)itr->first, (uint32)itr->second.GetAction(), (uint32)itr->second.GetType()); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_ACTION); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt8(1, m_activeSpec); + stmt->setUInt8(2, itr->first); + stmt->setUInt32(3, itr->second.GetAction()); + stmt->setUInt8(4, uint8(itr->second.GetType())); + trans->Append(stmt); + itr->second.uState = ACTIONBUTTON_UNCHANGED; ++itr; break; case ACTIONBUTTON_CHANGED: - trans->PAppend("UPDATE character_action SET action = '%u', type = '%u' WHERE guid = '%u' AND button = '%u' AND spec = '%u'", - (uint32)itr->second.GetAction(), (uint32)itr->second.GetType(), GetGUIDLow(), (uint32)itr->first, m_activeSpec); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_ACTION); + stmt->setUInt32(0, itr->second.GetAction()); + stmt->setUInt8(1, uint8(itr->second.GetType())); + stmt->setUInt32(2, GetGUIDLow()); + stmt->setUInt8(3, itr->first); + stmt->setUInt8(4, m_activeSpec); + trans->Append(stmt); + itr->second.uState = ACTIONBUTTON_UNCHANGED; ++itr; break; case ACTIONBUTTON_DELETED: - trans->PAppend("DELETE FROM character_action WHERE guid = '%u' and button = '%u' and spec = '%u'", GetGUIDLow(), (uint32)itr->first, m_activeSpec); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACTION_BY_BUTTON_SPEC); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt8(1, itr->first); + stmt->setUInt8(2, m_activeSpec); + trans->Append(stmt); + m_actionButtons.erase(itr++); break; default: @@ -18905,6 +19042,7 @@ void Player::_SaveAuras(SQLTransaction& trans) void Player::_SaveInventory(SQLTransaction& trans) { + PreparedStatement* stmt = NULL; // force items in buyback slots to new state // and remove those that aren't already for (uint8 i = BUYBACK_SLOT_START; i < BUYBACK_SLOT_END; ++i) @@ -18912,8 +19050,12 @@ void Player::_SaveInventory(SQLTransaction& trans) Item* item = m_items[i]; if (!item || item->GetState() == ITEM_NEW) continue; - trans->PAppend("DELETE FROM character_inventory WHERE item = '%u'", item->GetGUIDLow()); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_ITEM); + stmt->setUInt32(0, item->GetGUIDLow()); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE); stmt->setUInt32(0, item->GetGUIDLow()); trans->Append(stmt); m_items[i]->FSetState(ITEM_NEW); @@ -18971,7 +19113,12 @@ void Player::_SaveInventory(SQLTransaction& trans) bagTestGUID = test2->GetGUIDLow(); sLog->outError("Player(GUID: %u Name: %s)::_SaveInventory - the bag(%u) and slot(%u) values for the item with guid %u (state %d) are incorrect, the player doesn't have an item at that position!", lowGuid, GetName(), item->GetBagSlot(), item->GetSlot(), item->GetGUIDLow(), (int32)item->GetState()); // according to the test that was just performed nothing should be in this slot, delete - trans->PAppend("DELETE FROM character_inventory WHERE bag=%u AND slot=%u AND guid=%u", bagTestGUID, item->GetSlot(), lowGuid); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_BAG_SLOT); + stmt->setUInt32(0, bagTestGUID); + stmt->setUInt8(1, item->GetSlot()); + stmt->setUInt32(2, lowGuid); + trans->Append(stmt); + // also THIS item should be somewhere else, cheat attempt item->FSetState(ITEM_REMOVED); // we are IN updateQueue right now, can't use SetState which modifies the queue DeleteRefundReference(item->GetGUIDLow()); @@ -19019,17 +19166,32 @@ void Player::_SaveMail(SQLTransaction& trans) if (!m_mailsLoaded) return; + PreparedStatement* stmt = NULL; + for (PlayerMails::iterator itr = m_mail.begin(); itr != m_mail.end(); ++itr) { Mail* m = (*itr); if (m->state == MAIL_STATE_CHANGED) { - trans->PAppend("UPDATE mail SET has_items = '%u', expire_time = '" UI64FMTD "', deliver_time = '" UI64FMTD "', money = '%u', cod = '%u', checked = '%u' WHERE id = '%u'", - m->HasItems() ? 1 : 0, (uint64)m->expire_time, (uint64)m->deliver_time, m->money, m->COD, m->checked, m->messageID); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_MAIL); + stmt->setUInt8(0, uint8(m->HasItems() ? 1 : 0)); + stmt->setUInt32(1, uint32(m->expire_time)); + stmt->setUInt32(2, uint32(m->deliver_time)); + stmt->setUInt32(3, m->money); + stmt->setUInt32(4, m->COD); + stmt->setUInt8(5, uint8(m->checked)); + stmt->setUInt32(6, m->messageID); + + trans->Append(stmt); + if (!m->removedItems.empty()) { for (std::vector::iterator itr2 = m->removedItems.begin(); itr2 != m->removedItems.end(); ++itr2) - trans->PAppend("DELETE FROM mail_items WHERE item_guid = '%u'", *itr2); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEM); + stmt->setUInt32(0, *itr2); + trans->Append(stmt); + } m->removedItems.clear(); } m->state = MAIL_STATE_UNCHANGED; @@ -19046,8 +19208,13 @@ void Player::_SaveMail(SQLTransaction& trans) trans->Append(stmt); } } - trans->PAppend("DELETE FROM mail WHERE id = '%u'", m->messageID); - trans->PAppend("DELETE FROM mail_items WHERE mail_id = '%u'", m->messageID); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_BY_ID); + stmt->setUInt32(0, m->messageID); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEM_BY_ID); + stmt->setUInt32(0, m->messageID); + trans->Append(stmt); } } @@ -19076,6 +19243,7 @@ void Player::_SaveQuestStatus(SQLTransaction& trans) QuestStatusSaveMap::iterator saveItr; QuestStatusMap::iterator statusItr; + PreparedStatement* stmt = NULL; bool keepAbandoned = !(sWorld->GetCleaningFlags() & CharacterDatabaseCleaner::CLEANING_FLAG_QUESTSTATUS); @@ -19085,12 +19253,33 @@ void Player::_SaveQuestStatus(SQLTransaction& trans) { statusItr = m_QuestStatus.find(saveItr->first); if (statusItr != m_QuestStatus.end() && (keepAbandoned || statusItr->second.Status != QUEST_STATUS_NONE)) - trans->PAppend("REPLACE INTO character_queststatus (guid, quest, status, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, itemcount1, itemcount2, itemcount3, itemcount4, playercount) " - "VALUES ('%u', '%u', '%u', '%u', '" UI64FMTD "', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')", - GetGUIDLow(), statusItr->first, statusItr->second.Status, statusItr->second.Explored, uint64(statusItr->second.Timer / IN_MILLISECONDS+ sWorld->GetGameTime()), statusItr->second.CreatureOrGOCount[0], statusItr->second.CreatureOrGOCount[1], statusItr->second.CreatureOrGOCount[2], statusItr->second.CreatureOrGOCount[3], statusItr->second.ItemCount[0], statusItr->second.ItemCount[1], statusItr->second.ItemCount[2], statusItr->second.ItemCount[3], statusItr->second.PlayerCount); + { + uint8 index = 0; + stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CHAR_QUESTSTATUS); + + stmt->setUInt32(index++, GetGUIDLow()); + stmt->setUInt32(index++, statusItr->first); + stmt->setUInt8(index++, uint8(statusItr->second.Status)); + stmt->setBool(index++, statusItr->second.Explored); + stmt->setUInt32(index++, uint32(statusItr->second.Timer / IN_MILLISECONDS+ sWorld->GetGameTime())); + + for (uint8 i = 0; i < 4; i++) + stmt->setUInt16(index++, statusItr->second.CreatureOrGOCount[i]); + + for (uint8 i = 0; i < 4; i++) + stmt->setUInt16(index++, statusItr->second.ItemCount[i]); + + stmt->setUInt16(index, statusItr->second.PlayerCount); + trans->Append(stmt); + } } else - trans->PAppend("DELETE FROM character_queststatus WHERE guid = %u AND quest = %u", GetGUIDLow(), saveItr->first); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS_BY_QUEST); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(1, saveItr->first); + trans->Append(stmt); + } } m_QuestStatusSave.clear(); @@ -19098,9 +19287,20 @@ void Player::_SaveQuestStatus(SQLTransaction& trans) for (saveItr = m_RewardedQuestsSave.begin(); saveItr != m_RewardedQuestsSave.end(); ++saveItr) { if (saveItr->second) - trans->PAppend("INSERT IGNORE INTO character_queststatus_rewarded (guid, quest) VALUES (%u, %u)", GetGUIDLow(), saveItr->first); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_QUESTSTATUS); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(1, saveItr->first); + trans->Append(stmt); + + } else if (!keepAbandoned) - trans->PAppend("DELETE FROM character_queststatus_rewarded WHERE guid = %u AND quest = %u", GetGUIDLow(), saveItr->first); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS_REWARDED_BY_QUEST); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(1, saveItr->first); + trans->Append(stmt); + } } m_RewardedQuestsSave.clear(); @@ -19200,6 +19400,7 @@ void Player::_SaveSeasonalQuestStatus(SQLTransaction& trans) void Player::_SaveSkills(SQLTransaction& trans) { + PreparedStatement* stmt = NULL; // we don't need transactions here. for (SkillStatusMap::iterator itr = mSkillStatus.begin(); itr != mSkillStatus.end();) { @@ -19211,7 +19412,11 @@ void Player::_SaveSkills(SQLTransaction& trans) if (itr->second.uState == SKILL_DELETED) { - trans->PAppend("DELETE FROM character_skills WHERE guid = '%u' AND skill = '%u' ", GetGUIDLow(), itr->first); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SKILL_BY_SKILL); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(1, itr->first); + trans->Append(stmt); + mSkillStatus.erase(itr++); continue; } @@ -19223,12 +19428,22 @@ void Player::_SaveSkills(SQLTransaction& trans) switch (itr->second.uState) { case SKILL_NEW: - trans->PAppend("INSERT INTO character_skills (guid, skill, value, max) VALUES ('%u', '%u', '%u', '%u')", - GetGUIDLow(), itr->first, value, max); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_SKILLS); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt16(1, uint16(itr->first)); + stmt->setUInt16(2, value); + stmt->setUInt16(3, max); + trans->Append(stmt); + break; case SKILL_CHANGED: - trans->PAppend("UPDATE character_skills SET value = '%u', max = '%u'WHERE guid = '%u' AND skill = '%u' ", - value, max, GetGUIDLow(), itr->first); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_SKILLS); + stmt->setUInt16(0, value); + stmt->setUInt16(1, max); + stmt->setUInt32(2, GetGUIDLow()); + stmt->setUInt16(3, uint16(itr->first)); + trans->Append(stmt); + break; default: break; @@ -19241,14 +19456,28 @@ void Player::_SaveSkills(SQLTransaction& trans) void Player::_SaveSpells(SQLTransaction& trans) { + PreparedStatement* stmt = NULL; + for (PlayerSpellMap::iterator itr = m_spells.begin(); itr != m_spells.end();) { if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->state == PLAYERSPELL_CHANGED) - trans->PAppend("DELETE FROM character_spell WHERE guid = '%u' and spell = '%u'", GetGUIDLow(), itr->first); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL_BY_SPELL); + stmt->setUInt32(0, itr->first); + stmt->setUInt32(1, GetGUIDLow()); + trans->Append(stmt); + } // add only changed/new not dependent spells if (!itr->second->dependent && (itr->second->state == PLAYERSPELL_NEW || itr->second->state == PLAYERSPELL_CHANGED)) - trans->PAppend("INSERT INTO character_spell (guid, spell, active, disabled) VALUES ('%u', '%u', '%u', '%u')", GetGUIDLow(), itr->first, itr->second->active ? 1 : 0, itr->second->disabled ? 1 : 0); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_SPELL); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(1, itr->first); + stmt->setBool(2, itr->second->active); + stmt->setBool(3, itr->second->disabled); + trans->Append(stmt); + } if (itr->second->state == PLAYERSPELL_REMOVED) { @@ -19271,31 +19500,40 @@ void Player::_SaveStats(SQLTransaction& trans) if (!sWorld->getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE) || getLevel() < sWorld->getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE)) return; - trans->PAppend("DELETE FROM character_stats WHERE guid = '%u'", GetGUIDLow()); - std::ostringstream ss; - ss << "INSERT INTO character_stats (guid, maxhealth, maxpower1, maxpower2, maxpower3, maxpower4, maxpower5, maxpower6, maxpower7, " - "strength, agility, stamina, intellect, spirit, armor, resHoly, resFire, resNature, resFrost, resShadow, resArcane, " - "blockPct, dodgePct, parryPct, critPct, rangedCritPct, spellCritPct, attackPower, rangedAttackPower, spellPower, resilience) VALUES (" - << GetGUIDLow() << ',' - << GetMaxHealth() << ','; + PreparedStatement* stmt = NULL; + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_STATS); + stmt->setUInt32(0, GetGUIDLow()); + trans->Append(stmt); + + uint8 index = 0; + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_STATS); + stmt->setUInt32(index++, GetGUIDLow()); + stmt->setUInt32(index++, GetMaxHealth()); + for (uint8 i = 0; i < MAX_POWERS; ++i) - ss << GetMaxPower(Powers(i)) << ','; + stmt->setUInt32(index++, GetMaxPower(Powers(i))); + for (uint8 i = 0; i < MAX_STATS; ++i) - ss << GetStat(Stats(i)) << ','; - // armor + school resistances + stmt->setUInt32(index++, GetStat(Stats(i))); + for (int i = 0; i < MAX_SPELL_SCHOOL; ++i) - ss << GetResistance(SpellSchools(i)) << ','; - ss << GetFloatValue(PLAYER_BLOCK_PERCENTAGE) << ',' - << GetFloatValue(PLAYER_DODGE_PERCENTAGE) << ',' - << GetFloatValue(PLAYER_PARRY_PERCENTAGE) << ',' - << GetFloatValue(PLAYER_CRIT_PERCENTAGE) << ',' - << GetFloatValue(PLAYER_RANGED_CRIT_PERCENTAGE) << ',' - << GetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1) << ',' - << GetUInt32Value(UNIT_FIELD_ATTACK_POWER) << ',' - << GetUInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER) << ',' - << GetBaseSpellPowerBonus() << ',' - << GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_CRIT_TAKEN_SPELL) << ')'; - trans->Append(ss.str().c_str()); + stmt->setUInt32(index++, GetResistance(SpellSchools(i))); + + stmt->setFloat(index++, GetFloatValue(PLAYER_BLOCK_PERCENTAGE)); + stmt->setFloat(index++, GetFloatValue(PLAYER_DODGE_PERCENTAGE)); + stmt->setFloat(index++, GetFloatValue(PLAYER_PARRY_PERCENTAGE)); + stmt->setFloat(index++, GetFloatValue(PLAYER_CRIT_PERCENTAGE)); + stmt->setFloat(index++, GetFloatValue(PLAYER_RANGED_CRIT_PERCENTAGE)); + stmt->setFloat(index++, GetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1)); + stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_ATTACK_POWER)); + stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER)); + stmt->setUInt32(index++, GetBaseSpellPowerBonus()); + stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_CRIT_TAKEN_SPELL)); + stmt->setUInt32(index++, GetMaxHealth()); + + trans->Append(stmt); } void Player::outDebugValues() const @@ -20294,13 +20532,25 @@ void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type) SQLTransaction trans = CharacterDatabase.BeginTransaction(); if (type == 10) { - trans->PAppend("DELETE FROM petition WHERE ownerguid = '%u'", GUID_LOPART(guid)); - trans->PAppend("DELETE FROM petition_sign WHERE ownerguid = '%u'", GUID_LOPART(guid)); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PETITION_BY_OWNER); + stmt->setUInt32(0, GUID_LOPART(guid)); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PETITION_SIGNATURE_BY_OWNER); + stmt->setUInt32(0, GUID_LOPART(guid)); + trans->Append(stmt); } else { - trans->PAppend("DELETE FROM petition WHERE ownerguid = '%u' AND type = '%u'", GUID_LOPART(guid), type); - trans->PAppend("DELETE FROM petition_sign WHERE ownerguid = '%u' AND type = '%u'", GUID_LOPART(guid), type); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PETITION_BY_OWNER_AND_TYPE); + stmt->setUInt32(0, GUID_LOPART(guid)); + stmt->setUInt8(1, uint8(type)); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PETITION_SIGNATURE_BY_OWNER_AND_TYPE); + stmt->setUInt32(0, GUID_LOPART(guid)); + stmt->setUInt8(1, uint8(type)); + trans->Append(stmt); } CharacterDatabase.CommitTransaction(trans); } @@ -24697,12 +24947,26 @@ void Player::_LoadGlyphs(PreparedQueryResult result) void Player::_SaveGlyphs(SQLTransaction& trans) { - trans->PAppend("DELETE FROM character_glyphs WHERE guid='%u'", GetGUIDLow()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_GLYPHS); + stmt->setUInt32(0, GetGUIDLow()); + trans->Append(stmt); + + uint8 index = 0; + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_GLYPHS); + stmt->setUInt32(index++, GetGUIDLow()); + + for (uint8 spec = 0; spec < m_specsCount; ++spec) { - trans->PAppend("INSERT INTO character_glyphs VALUES('%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')", - GetGUIDLow(), spec, m_Glyphs[spec][0], m_Glyphs[spec][1], m_Glyphs[spec][2], m_Glyphs[spec][3], m_Glyphs[spec][4], m_Glyphs[spec][5]); + stmt->setUInt8(index++, spec); + + for (uint8 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i) + stmt->setUInt16(index++, uint16(m_Glyphs[spec][i])); + } + + trans->Append(stmt); } void Player::_LoadTalents(PreparedQueryResult result) @@ -24718,15 +24982,29 @@ void Player::_LoadTalents(PreparedQueryResult result) void Player::_SaveTalents(SQLTransaction& trans) { + PreparedStatement* stmt = NULL; + for (uint8 i = 0; i < MAX_TALENT_SPECS; ++i) { for (PlayerTalentMap::iterator itr = m_talents[i]->begin(); itr != m_talents[i]->end();) { if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->state == PLAYERSPELL_CHANGED) - trans->PAppend("DELETE FROM character_talent WHERE guid = '%u' and spell = '%u' and spec = '%u'", GetGUIDLow(), itr->first, itr->second->spec); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_TALENT_BY_SPELL_SPEC); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(1, itr->first); + stmt->setUInt8(2, itr->second->spec); + trans->Append(stmt); + } if (itr->second->state == PLAYERSPELL_NEW || itr->second->state == PLAYERSPELL_CHANGED) - trans->PAppend("INSERT INTO character_talent (guid, spell, spec) VALUES ('%u', '%u', '%u')", GetGUIDLow(), itr->first, itr->second->spec); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_TALENT); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(1, itr->first); + stmt->setUInt8(2, itr->second->spec); + trans->Append(stmt); + } if (itr->second->state == PLAYERSPELL_REMOVED) { @@ -24752,20 +25030,33 @@ void Player::UpdateSpecCount(uint8 count) ActivateSpec(0); SQLTransaction trans = CharacterDatabase.BeginTransaction(); + PreparedStatement* stmt = NULL; // Copy spec data if (count > curCount) { _SaveActions(trans); // make sure the button list is cleaned up for (ActionButtonList::iterator itr = m_actionButtons.begin(); itr != m_actionButtons.end(); ++itr) - trans->PAppend("INSERT INTO character_action (guid, button, action, type, spec) VALUES ('%u', '%u', '%u', '%u', '%u')", - GetGUIDLow(), uint32(itr->first), uint32(itr->second.GetAction()), uint32(itr->second.GetType()), 1); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_ACTION); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt8(1, 1); + stmt->setUInt8(2, itr->first); + stmt->setUInt32(3, itr->second.GetAction()); + stmt->setUInt8(4, uint8(itr->second.GetType())); + trans->Append(stmt); + } } // Delete spec data for removed spec. else if (count < curCount) { _SaveActions(trans); - trans->PAppend("DELETE FROM character_action WHERE spec<>'%u' AND guid='%u'", m_activeSpec, GetGUIDLow()); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC); + stmt->setUInt8(0, m_activeSpec); + stmt->setUInt32(1, GetGUIDLow()); + trans->Append(stmt); + m_activeSpec = 0; } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 51ed3b915fc..f5c2e83106a 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -5403,7 +5403,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) } } - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_BY_ID); stmt->setUInt32(0, m->messageID); CharacterDatabase.Execute(stmt); delete m; diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 7a8d19ee038..72488966416 100755 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -375,7 +375,7 @@ void WorldSession::HandleMailReturnToSender(WorldPacket & recv_data) //so firstly delete the old one SQLTransaction trans = CharacterDatabase.BeginTransaction(); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_BY_ID); stmt->setUInt32(0, mailId); trans->Append(stmt); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index d6019d0b6da..4deeb92fc12 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -113,7 +113,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_AUCTION_BY_TIME, "SELECT id FROM auctionhouse WHERE time <= ? ORDER BY TIME ASC", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_UPD_AUCTION_BID, "UPDATE auctionhouse SET buyguid = ?, lastbid = ? WHERE id = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_MAIL, "INSERT INTO mail(id, messageType, stationery, mailTemplateId, sender, receiver, subject, body, has_items, expire_time, deliver_time, money, cod, checked) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_MAIL, "DELETE FROM mail WHERE id = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_MAIL_BY_ID, "DELETE FROM mail WHERE id = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_INS_MAIL_ITEM, "INSERT INTO mail_items(mail_id, item_guid, receiver) VALUES (?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_MAIL_ITEM, "DELETE FROM mail_items WHERE item_guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_INVALID_MAIL_ITEM, "DELETE FROM mail_items WHERE item_guid = ?", CONNECTION_ASYNC); @@ -398,7 +398,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_UPD_CHAR_NAME_AT_LOGIN, "UPDATE characters set name = ?, at_login = at_login & ~ ? WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_WORLDSTATE, "UPDATE worldstates SET value = ? WHERE entry = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_WORLDSTATE, "INSERT INTO worldstates (entry, value) VALUES (?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_INSTANCE, "DELETE FROM character_instance WHERE guid = ? AND instance = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE_GUID, "DELETE FROM character_instance WHERE guid = ? AND instance = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_CHAR_INSTANCE, "UPDATE character_instance SET instance = ?, permanent = ? WHERE guid = ? AND instance = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_CHAR_INSTANCE, "INSERT INTO character_instance (guid, instance, permanent) VALUES (?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_GENDER_PLAYERBYTES, "UPDATE characters SET gender = ?, playerBytes = ?, playerBytes2 = ? WHERE guid = ?", CONNECTION_ASYNC); @@ -500,4 +500,53 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_UPD_CHAR_SPELL_FACTION_CHANGE, "UPDATE character_spell SET spell = ? where spell = ? AND guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_REP_BY_FACTION, "DELETE FROM character_reputation WHERE faction = ? AND guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_CHAR_REP_FACTION_CHANGE, "UPDATE character_reputation SET faction = ? where faction = ? AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_SPELL_COOLDOWN, "DELETE FROM character_spell_cooldown WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHARACTER, "DELETE FROM characters WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_ACTION, "DELETE FROM character_action WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_AURA, "DELETE FROM character_aura WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_GIFT, "DELETE FROM character_gifts WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_INSTANCE, "DELETE FROM character_instance WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_INVENTORY, "DELETE FROM character_instance WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_QUESTSTATUS_REWARDED, "DELETE FROM character_queststatus_rewarded WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_REPUTATION, "DELETE FROM character_reputation WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_SPELL, "DELETE FROM character_spell WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_MAIL, "DELETE FROM mail WHERE receiver = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_MAIL_ITEMS, "DELETE FROM mail_items WHERE receiver = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_PET_BY_OWNER, "DELETE FROM character_pet WHERE owner = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_PET_DECLINEDNAME_BY_OWNER, "DELETE FROM character_pet_declinedname WHERE owner = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_ACHIEVEMENTS, "DELETE FROM character_achievement WHERE guid = ? AND achievement NOT BETWEEN '456' AND '467' AND achievement NOT BETWEEN '1400' AND '1427' AND achievement NOT IN(1463, 3117, 3259)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_EQUIPMENTSETS, "DELETE FROM character_equipmentsets WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_GUILD_EVENTLOG_BY_PLAYER, "DELETE FROM guild_eventlog WHERE PlayerGuid1 = ? OR PlayerGuid2 = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_EVENTLOG_BY_PLAYER, "DELETE FROM guild_bank_eventlog WHERE PlayerGuid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_GLYPHS, "DELETE FROM character_glyphs WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_QUESTSTATUS_DAILY, "DELETE FROM character_queststatus_daily WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_TALENT, "DELETE FROM character_talent WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_SKILLS, "DELETE FROM character_skills WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UDP_CHAR_HONOR_POINTS, "UPDATE characters SET totalHonorPoints = ? WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UDP_CHAR_ARENA_POINTS, "UPDATE characters SET arenaPoints = ? WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UDP_CHAR_MONEY, "UPDATE characters SET money = ? WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_ACTION, "INSERT INTO character_action (guid, spec, button, action, type) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_ACTION, "UPDATE character_action SET action = ?, type = ? WHERE guid = ? AND button = ? AND spec = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_ACTION_BY_BUTTON_SPEC, "DELETE FROM character_action WHERE guid = ? and button = ? and spec = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_INVENTORY_BY_ITEM, "DELETE FROM character_inventory WHERE item = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_INVENTORY_BY_BAG_SLOT, "DELETE FROM character_inventory WHERE bag = ? AND slot = ? AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_MAIL, "UPDATE mail SET has_items = ?, expire_time = ?, deliver_time = ?, money = ?, cod = ?, checked = ? WHERE id = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_REP_CHAR_QUESTSTATUS, "REPLACE INTO character_queststatus (guid, quest, status, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, itemcount1, itemcount2, itemcount3, itemcount4, playercount) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_QUESTSTATUS_BY_QUEST, "DELETE FROM character_queststatus WHERE guid = ? AND quest = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_QUESTSTATUS, "INSERT IGNORE INTO character_queststatus_rewarded (guid, quest) VALUES (?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_QUESTSTATUS_REWARDED_BY_QUEST, "DELETE FROM character_queststatus_rewarded WHERE guid = ? AND quest = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_SKILL_BY_SKILL, "DELETE FROM character_skills WHERE guid = ? AND skill = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_SKILLS, "INSERT INTO character_skills (guid, skill, value, max) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UDP_CHAR_SKILLS, "UPDATE character_skills SET value = ?, max = ? WHERE guid = ? AND skill = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_SPELL, "INSERT INTO character_spell (guid, spell, active, disabled) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_STATS, "DELETE FROM character_stats WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_STATS, "INSERT INTO character_stats (guid, maxhealth, maxpower1, maxpower2, maxpower3, maxpower4, maxpower5, maxpower6, maxpower7, strength, agility, stamina, intellect, spirit, armor, resHoly, resFire, resNature, resFrost, resShadow, resArcane, blockPct, dodgePct, parryPct, critPct, rangedCritPct, spellCritPct, attackPower, rangedAttackPower, spellPower, resilience) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PETITION_BY_OWNER, "DELETE FROM petition WHERE ownerguid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PETITION_SIGNATURE_BY_OWNER, "DELETE FROM petition_sign WHERE ownerguid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PETITION_BY_OWNER_AND_TYPE, "DELETE FROM petition WHERE ownerguid = ? AND type = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PETITION_SIGNATURE_BY_OWNER_AND_TYPE, "DELETE FROM petition_sign WHERE ownerguid = ? AND type = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_GLYPHS, "INSERT INTO character_glyphs VALUES(?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_TALENT_BY_SPELL_SPEC, "DELETE FROM character_talent WHERE guid = ? and spell = ? and spec = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_TALENT, "INSERT INTO character_talent (guid, spell, spec) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC, "DELETE FROM character_action WHERE spec<>? AND guid = ?", CONNECTION_ASYNC); } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 05d0d0e6d36..d832d18f59a 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -123,7 +123,7 @@ enum CharacterDatabaseStatements CHAR_UPD_AUCTION_BID, CHAR_SEL_AUCTIONS, CHAR_INS_MAIL, - CHAR_DEL_MAIL, + CHAR_DEL_MAIL_BY_ID, CHAR_INS_MAIL_ITEM, CHAR_DEL_MAIL_ITEM, CHAR_DEL_INVALID_MAIL_ITEM, @@ -355,7 +355,7 @@ enum CharacterDatabaseStatements CHAR_UPD_CHAR_NAME_AT_LOGIN, CHAR_UPD_WORLDSTATE, CHAR_INS_WORLDSTATE, - CHAR_DEL_CHAR_INSTANCE, + CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE_GUID, CHAR_UPD_CHAR_INSTANCE, CHAR_INS_CHAR_INSTANCE, CHAR_UPD_GENDER_PLAYERBYTES, @@ -463,6 +463,55 @@ enum CharacterDatabaseStatements CHAR_UPD_CHAR_SPELL_FACTION_CHANGE, CHAR_DEL_CHAR_REP_BY_FACTION, CHAR_UPD_CHAR_REP_FACTION_CHANGE, + CHAR_DEL_CHAR_SPELL_COOLDOWN, + CHAR_DEL_CHARACTER, + CHAR_DEL_CHAR_ACTION, + CHAR_DEL_CHAR_AURA, + CHAR_DEL_CHAR_GIFT, + CHAR_DEL_CHAR_INSTANCE, + CHAR_DEL_CHAR_INVENTORY, + CHAR_DEL_CHAR_QUESTSTATUS_REWARDED, + CHAR_DEL_CHAR_REPUTATION, + CHAR_DEL_CHAR_SPELL, + CHAR_DEL_MAIL, + CHAR_DEL_MAIL_ITEMS, + CHAR_DEL_CHAR_PET_BY_OWNER, + CHAR_DEL_CHAR_PET_DECLINEDNAME_BY_OWNER, + CHAR_DEL_CHAR_ACHIEVEMENTS, + CHAR_DEL_CHAR_EQUIPMENTSETS, + CHAR_DEL_GUILD_EVENTLOG_BY_PLAYER, + CHAR_DEL_GUILD_BANK_EVENTLOG_BY_PLAYER, + CHAR_DEL_CHAR_GLYPHS, + CHAR_DEL_CHAR_QUESTSTATUS_DAILY, + CHAR_DEL_CHAR_TALENT, + CHAR_DEL_CHAR_SKILLS, + CHAR_UDP_CHAR_HONOR_POINTS, + CHAR_UDP_CHAR_ARENA_POINTS, + CHAR_UDP_CHAR_MONEY, + CHAR_INS_CHAR_ACTION, + CHAR_UPD_CHAR_ACTION, + CHAR_DEL_CHAR_ACTION_BY_BUTTON_SPEC, + CHAR_DEL_CHAR_INVENTORY_BY_ITEM, + CHAR_DEL_CHAR_INVENTORY_BY_BAG_SLOT, + CHAR_UPD_MAIL, + CHAR_REP_CHAR_QUESTSTATUS, + CHAR_DEL_CHAR_QUESTSTATUS_BY_QUEST, + CHAR_INS_CHAR_QUESTSTATUS, + CHAR_DEL_CHAR_QUESTSTATUS_REWARDED_BY_QUEST, + CHAR_DEL_CHAR_SKILL_BY_SKILL, + CHAR_INS_CHAR_SKILLS, + CHAR_UDP_CHAR_SKILLS, + CHAR_INS_CHAR_SPELL, + CHAR_DEL_CHAR_STATS, + CHAR_INS_CHAR_STATS, + CHAR_DEL_PETITION_BY_OWNER, + CHAR_DEL_PETITION_SIGNATURE_BY_OWNER, + CHAR_DEL_PETITION_BY_OWNER_AND_TYPE, + CHAR_DEL_PETITION_SIGNATURE_BY_OWNER_AND_TYPE, + CHAR_INS_CHAR_GLYPHS, + CHAR_DEL_CHAR_TALENT_BY_SPELL_SPEC, + CHAR_INS_CHAR_TALENT, + CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC, MAX_CHARACTERDATABASE_STATEMENTS, }; From 7b357a502859825cfb9fd47adc6b461859e3dcc1 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 26 Mar 2012 11:37:03 -0400 Subject: [PATCH 0299/1149] Core/Spells: Fix Misdirection (thx to elron) closes #5869, #4343 --- src/server/game/Entities/Unit/Unit.cpp | 4 +- .../game/Spells/Auras/SpellAuraEffects.cpp | 12 ---- src/server/scripts/Spells/spell_hunter.cpp | 58 +++++++++++++++++++ 3 files changed, 61 insertions(+), 13 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index e4967e8633d..974d862d07e 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6608,9 +6608,11 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere { case 34477: // Misdirection { + if (!GetMisdirectionTarget()) + return false; triggered_spell_id = 35079; // 4 sec buff on self target = this; - return true; + break; } case 57870: // Glyph of Mend Pet { diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 3def3892c9a..f7635f3fab5 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4948,18 +4948,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool } } break; - case SPELLFAMILY_HUNTER: - switch (GetId()) - { - case 34477: // Misdirection - if (aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) - target->SetReducedThreatPercent(0, 0); - break; - case 35079: // Misdirection proc - target->SetReducedThreatPercent(0, 0); - break; - } - break; case SPELLFAMILY_DEATHKNIGHT: // Summon Gargoyle (Dismiss Gargoyle at remove) if (GetId() == 61777) diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 855af75cd83..1d1e43d5c6d 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -560,6 +560,64 @@ class spell_hun_pet_carrion_feeder : public SpellScriptLoader } }; +// 34477 Misdirection +class spell_hun_misdirection : public SpellScriptLoader +{ + public: + spell_hun_misdirection() : SpellScriptLoader("spell_hun_misdirection") { } + + class spell_hun_misdirection_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_misdirection_AuraScript); + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + if (GetDuration()) + caster->SetReducedThreatPercent(0, 0); + } + + void Register() + { + AfterEffectRemove += AuraEffectRemoveFn(spell_hun_misdirection_AuraScript::OnRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_hun_misdirection_AuraScript(); + } +}; + +// 35079 Misdirection proc +class spell_hun_misdirection_proc : public SpellScriptLoader +{ + public: + spell_hun_misdirection_proc() : SpellScriptLoader("spell_hun_misdirection_proc") { } + + class spell_hun_misdirection_proc_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_misdirection_proc_AuraScript); + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (GetCaster()) + GetCaster()->SetReducedThreatPercent(0, 0); + } + + void Register() + { + AfterEffectRemove += AuraEffectRemoveFn(spell_hun_misdirection_proc_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_hun_misdirection_proc_AuraScript(); + } +}; + + void AddSC_hunter_spell_scripts() { new spell_hun_aspect_of_the_beast(); From da540d5584cc97609cb1bb0e56ece0443cda72ee Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 26 Mar 2012 12:05:27 -0400 Subject: [PATCH 0300/1149] Core/Spells: Fix Necrotic Touch proc closes #538 --- src/server/game/Entities/Unit/Unit.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 974d862d07e..ce9cec417a2 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5524,6 +5524,13 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } break; } + case 71875: // Item - Black Bruise: Necrotic Touch Proc + case 71877: + { + basepoints0 = CalculatePctN(int32(damage), triggerAmount); + triggered_spell_id = 71879; + break; + } // Item - Shadowmourne Legendary case 71903: { From 02a8388b8e623345aebc44eaff5c9511d075a416 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 26 Mar 2012 12:22:55 -0400 Subject: [PATCH 0301/1149] Core/Spells: Added sql for misdirection fix (thx dasio) --- sql/updates/world/2012_03_26_01_world_spell_script_names.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2012_03_26_01_world_spell_script_names.sql diff --git a/sql/updates/world/2012_03_26_01_world_spell_script_names.sql b/sql/updates/world/2012_03_26_01_world_spell_script_names.sql new file mode 100644 index 00000000000..0a5c90f798f --- /dev/null +++ b/sql/updates/world/2012_03_26_01_world_spell_script_names.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (34477, 35079); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(34477,'spell_hun_misdirection'), +(35079,'spell_hun_misdirection_proc'); From 522dfa8e0cbd6eabc9917c7de169c99c5afdf803 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 26 Mar 2012 12:24:11 -0400 Subject: [PATCH 0302/1149] Core/Spells: one more miss from misdirection fix --- src/server/scripts/Spells/spell_hunter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 1d1e43d5c6d..7987c7a7358 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -630,4 +630,6 @@ void AddSC_hunter_spell_scripts() new spell_hun_sniper_training(); new spell_hun_pet_heart_of_the_phoenix(); new spell_hun_pet_carrion_feeder(); + new spell_hun_misdirection(); + new spell_hun_misdirection_proc(); } From 830a7fb08bba13ae7f6cd387a7a469942a2f4c4a Mon Sep 17 00:00:00 2001 From: leak Date: Mon, 26 Mar 2012 18:57:55 +0200 Subject: [PATCH 0303/1149] Core/DBLayer: Restore pet loading closes #5878 --- src/server/game/Entities/Pet/Pet.cpp | 11 ++++++----- .../Database/Implementation/CharacterDatabase.cpp | 3 ++- .../Database/Implementation/CharacterDatabase.h | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index f3dbabe59d1..1ed3e70f342 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -105,19 +105,19 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c // Known petnumber entry stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PET_BY_ENTRY); stmt->setUInt32(0, ownerid); - stmt->setUInt8(1, uint8(petnumber)); + stmt->setUInt8(1, petnumber); } else if (current) { // Current pet (slot 0) - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PET_BY_ENTRY); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT); stmt->setUInt32(0, ownerid); stmt->setUInt8(1, uint8(PET_SAVE_AS_CURRENT)); } else if (petentry) { // known petentry entry (unique for summoned pet, but non unique for hunter pet (only from current or not stabled pets) - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT_2); stmt->setUInt32(0, ownerid); stmt->setUInt32(1, petentry); stmt->setUInt8(2, uint8(PET_SAVE_AS_CURRENT)); @@ -419,8 +419,9 @@ void Pet::SavePetToDB(PetSaveMode mode) if (mode <= PET_SAVE_LAST_STABLE_SLOT) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_PET_SLOT_BY_SLOT); - stmt->setUInt32(0, ownerLowGUID); - stmt->setUInt8(1, uint8(mode)); + stmt->setUInt8(0, uint8(PET_SAVE_NOT_IN_SLOT)); + stmt->setUInt32(1, ownerLowGUID); + stmt->setUInt8(2, uint8(mode)); trans->Append(stmt); } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 4deeb92fc12..3d30e97544a 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -447,7 +447,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_AUCTIONHOUSE_ITEM_BY_ENTRY, "SELECT ah.itemguid, ah.itemowner, c.account, c.name FROM auctionhouse ah INNER JOIN characters c ON c.guid = ah.itemowner INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE ii.itemEntry = ? LIMIT ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY, "SELECT gi.item_guid, gi.guildid, g.name FROM guild_bank_item gi INNER JOIN guild g ON g.guildid = gi.guildid INNER JOIN item_instance ii ON ii.guid = gi.item_guid WHERE ii.itemEntry = ? LIMIT ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND id = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND entry = ? AND (slot = ? OR slot > ?)", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT_2, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND entry = ? AND (slot = ? OR slot > ?)", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND (slot = ? OR slot > ?) ", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_DEL_CHAR_ACHIEVEMENT, "DELETE FROM character_achievement WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS, "DELETE FROM character_achievement_progress WHERE guid = ?", CONNECTION_ASYNC); @@ -549,4 +549,5 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_CHAR_TALENT_BY_SPELL_SPEC, "DELETE FROM character_talent WHERE guid = ? and spell = ? and spec = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_CHAR_TALENT, "INSERT INTO character_talent (guid, spell, spec) VALUES (?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC, "DELETE FROM character_action WHERE spec<>? AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND slot = ?", CONNECTION_SYNCH); } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index d832d18f59a..4d8433c74b2 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -410,7 +410,7 @@ enum CharacterDatabaseStatements CHAR_SEL_AUCTIONHOUSE_ITEM_BY_ENTRY, CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY, CHAR_SEL_CHAR_PET_BY_ENTRY, - CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, + CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT_2, CHAR_SEL_CHAR_PET_BY_SLOT, CHAR_DEL_CHAR_ACHIEVEMENT, CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS, @@ -512,6 +512,7 @@ enum CharacterDatabaseStatements CHAR_DEL_CHAR_TALENT_BY_SPELL_SPEC, CHAR_INS_CHAR_TALENT, CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC, + CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, MAX_CHARACTERDATABASE_STATEMENTS, }; From 89f31f3cba1d4ca0034e56ca771c6d755cc1d714 Mon Sep 17 00:00:00 2001 From: leak Date: Mon, 26 Mar 2012 19:05:51 +0200 Subject: [PATCH 0304/1149] Core/DBLayer: Typo from prev. commit --- src/server/game/Entities/Pet/Pet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 1ed3e70f342..d51af9e1ba9 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -105,7 +105,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c // Known petnumber entry stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PET_BY_ENTRY); stmt->setUInt32(0, ownerid); - stmt->setUInt8(1, petnumber); + stmt->setUInt32(1, petnumber); } else if (current) { From 8d7f184ee6a62c1f976abfaa5a570412be98a29d Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 26 Mar 2012 18:23:05 +0100 Subject: [PATCH 0305/1149] DB/Auth: Update auth_database.sql with recent changes --- sql/base/auth_database.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index c80bebdac39..305ba679bf2 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -194,7 +194,7 @@ CREATE TABLE `realmlist` ( `address` varchar(32) NOT NULL DEFAULT '127.0.0.1', `port` int(11) NOT NULL DEFAULT '8085', `icon` tinyint(3) unsigned NOT NULL DEFAULT '0', - `color` tinyint(3) unsigned NOT NULL DEFAULT '2', + `flag` tinyint(3) unsigned NOT NULL DEFAULT '2', `timezone` tinyint(3) unsigned NOT NULL DEFAULT '0', `allowedSecurityLevel` tinyint(3) unsigned NOT NULL DEFAULT '0', `population` float unsigned NOT NULL DEFAULT '0', @@ -250,4 +250,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2012-03-25 21:05:26 +-- Dump completed on 2012-03-26 18:21:51 From 613d5368a56e0a1c4a1e1ace16339f4af62c391d Mon Sep 17 00:00:00 2001 From: kandera Date: Mon, 26 Mar 2012 15:15:06 -0300 Subject: [PATCH 0306/1149] Core/Spells: and another mistake from the misdirection fix >.> --- src/server/scripts/Spells/spell_hunter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 7987c7a7358..5d8e8f84e6a 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -573,7 +573,7 @@ class spell_hun_misdirection : public SpellScriptLoader void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (Unit* caster = GetCaster()) - if (GetDuration()) + if (!GetDuration()) caster->SetReducedThreatPercent(0, 0); } From 8f365de4b297c5eef7abaf1ad7eca9e661c581c6 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 26 Mar 2012 21:06:11 +0100 Subject: [PATCH 0307/1149] Core/DBLayer: Fix `creature` and `spell_rank` loading --- src/server/game/Globals/ObjectMgr.cpp | 48 +++++++++++++-------------- src/server/game/Spells/SpellMgr.cpp | 2 +- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index f5c2e83106a..91ce5c44537 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1426,8 +1426,8 @@ void ObjectMgr::LoadCreatures() { Field* fields = result->Fetch(); - uint32 guid = fields[ 0].GetUInt32(); - uint32 entry = fields[ 1].GetUInt32(); + uint32 guid = fields[0].GetUInt32(); + uint32 entry = fields[1].GetUInt32(); CreatureTemplate const* cInfo = GetCreatureTemplate(entry); if (!cInfo) @@ -1438,14 +1438,14 @@ void ObjectMgr::LoadCreatures() CreatureData& data = _creatureDataStore[guid]; data.id = entry; - data.mapid = fields[ 2].GetUInt32(); - data.displayid = fields[ 3].GetUInt32(); - data.equipmentId = fields[ 4].GetUInt32(); - data.posX = fields[ 5].GetFloat(); - data.posY = fields[ 6].GetFloat(); - data.posZ = fields[ 7].GetFloat(); - data.orientation = fields[ 8].GetFloat(); - data.spawntimesecs = fields[ 9].GetUInt32(); + data.mapid = fields[2].GetUInt16(); + data.displayid = fields[3].GetUInt32(); + data.equipmentId = fields[4].GetInt32(); + data.posX = fields[5].GetFloat(); + data.posY = fields[6].GetFloat(); + data.posZ = fields[7].GetFloat(); + data.orientation = fields[8].GetFloat(); + data.spawntimesecs = fields[9].GetUInt32(); data.spawndist = fields[10].GetFloat(); data.currentwaypoint= fields[11].GetUInt32(); data.curhealth = fields[12].GetUInt32(); @@ -1453,7 +1453,7 @@ void ObjectMgr::LoadCreatures() data.movementType = fields[14].GetUInt8(); data.spawnMask = fields[15].GetUInt8(); data.phaseMask = fields[16].GetUInt16(); - int16 gameEvent = fields[17].GetInt16(); + int16 gameEvent = fields[17].GetInt8(); uint32 PoolId = fields[18].GetUInt32(); data.npcflag = fields[19].GetUInt32(); data.unit_flags = fields[20].GetUInt32(); @@ -1735,8 +1735,8 @@ void ObjectMgr::LoadGameobjects() { Field* fields = result->Fetch(); - uint32 guid = fields[ 0].GetUInt32(); - uint32 entry = fields[ 1].GetUInt32(); + uint32 guid = fields[0].GetUInt32(); + uint32 entry = fields[1].GetUInt32(); GameObjectTemplate const* gInfo = GetGameObjectTemplate(entry); if (!gInfo) @@ -1767,14 +1767,14 @@ void ObjectMgr::LoadGameobjects() GameObjectData& data = _gameObjectDataStore[guid]; data.id = entry; - data.mapid = fields[ 2].GetUInt32(); - data.posX = fields[ 3].GetFloat(); - data.posY = fields[ 4].GetFloat(); - data.posZ = fields[ 5].GetFloat(); - data.orientation = fields[ 6].GetFloat(); - data.rotation0 = fields[ 7].GetFloat(); - data.rotation1 = fields[ 8].GetFloat(); - data.rotation2 = fields[ 9].GetFloat(); + data.mapid = fields[2].GetUInt32(); + data.posX = fields[3].GetFloat(); + data.posY = fields[4].GetFloat(); + data.posZ = fields[5].GetFloat(); + data.orientation = fields[6].GetFloat(); + data.rotation0 = fields[7].GetFloat(); + data.rotation1 = fields[8].GetFloat(); + data.rotation2 = fields[9].GetFloat(); data.rotation3 = fields[10].GetFloat(); data.spawntimesecs = fields[11].GetInt32(); @@ -8698,10 +8698,10 @@ void ObjectMgr::LoadCreatureClassLevelStats() CreatureBaseStats stats; for (uint8 i = 0; i < MAX_CREATURE_BASE_HP; ++i) - stats.BaseHealth[i] = fields[i + 2].GetUInt32(); + stats.BaseHealth[i] = fields[i + 2].GetUInt16(); - stats.BaseMana = fields[5].GetUInt32(); - stats.BaseArmor = fields[6].GetUInt32(); + stats.BaseMana = fields[5].GetUInt16(); + stats.BaseArmor = fields[6].GetUInt16(); if (!Class || ((1 << (Class - 1)) & CLASSMASK_ALL_CREATURES) == 0) sLog->outErrorDb("Creature base stats for level %u has invalid class %u", Level, Class); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index c1b267d9fac..7bfb71d83d4 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1193,7 +1193,7 @@ void SpellMgr::LoadSpellRanks() if (lastSpell == -1) lastSpell = currentSpell; uint32 spell_id = fields[1].GetUInt32(); - uint32 rank = fields[2].GetUInt32(); + uint32 rank = fields[2].GetUInt8(); // don't drop the row if we're moving to the next rank if (currentSpell == lastSpell) From a92820b51c791595676805396a599fa345d58db2 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 27 Mar 2012 00:43:56 +0100 Subject: [PATCH 0308/1149] Core/DBLayer: Correct few more wrong read types (No. 1) DB/World: Some consistency in the ints "length" field (not really a length) From A to D world tables verified; missing all the others int(11) -> int32 unsigned int(10) -> uint32 mediumint(8) -> int32 unsigned mediumint(8) -> uint32 smallint(6) -> int16 unsigned smallint(5) -> uint16 tinyint(4) -> int8 unsigned tinyint(3) -> uint8 --- .../world/2012_03_27_00_world_misc.sql | 49 +++++++++++++++++++ .../game/AI/EventAI/CreatureEventAIMgr.cpp | 32 ++++++------ .../game/Achievements/AchievementMgr.cpp | 2 +- .../game/Battlegrounds/BattlegroundMgr.cpp | 8 +-- src/server/game/Conditions/ConditionMgr.cpp | 4 +- .../game/Entities/Creature/CreatureGroups.cpp | 2 +- .../game/Entities/Transport/Transport.cpp | 8 +-- src/server/game/Globals/ObjectMgr.cpp | 24 ++++----- src/server/game/Loot/LootMgr.cpp | 2 +- src/server/game/Scripting/ScriptSystem.cpp | 8 +-- src/server/scripts/Commands/cs_npc.cpp | 2 +- 11 files changed, 95 insertions(+), 46 deletions(-) create mode 100644 sql/updates/world/2012_03_27_00_world_misc.sql diff --git a/sql/updates/world/2012_03_27_00_world_misc.sql b/sql/updates/world/2012_03_27_00_world_misc.sql new file mode 100644 index 00000000000..132c91b81d7 --- /dev/null +++ b/sql/updates/world/2012_03_27_00_world_misc.sql @@ -0,0 +1,49 @@ +ALTER TABLE `battleground_template` CHANGE `Weight` `Weight` tinyint(3) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `conditions` CHANGE `SourceId` `SourceId` int(11) NOT NULL DEFAULT '0'; +ALTER TABLE `creature` CHANGE `equipment_id` `equipment_id` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `creature_addon` CHANGE `path_id` `path_id` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_ai_scripts` CHANGE `id` `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifier'; +ALTER TABLE `creature_ai_scripts` CHANGE `creature_id` `creature_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Creature Template Identifier'; +ALTER TABLE `creature_ai_scripts` CHANGE `event_type` `event_type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Event Type'; +ALTER TABLE `creature_ai_scripts` CHANGE `event_chance` `event_chance` int(10) unsigned NOT NULL DEFAULT '100'; +ALTER TABLE `creature_ai_scripts` CHANGE `event_flags` `event_flags` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_ai_scripts` CHANGE `action1_type` `action1_type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Action Type'; +ALTER TABLE `creature_ai_scripts` CHANGE `action2_type` `action2_type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Action Type'; +ALTER TABLE `creature_ai_scripts` CHANGE `action3_type` `action3_type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Action Type'; +ALTER TABLE `creature_ai_summons` CHANGE `id` `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Location Identifier'; +ALTER TABLE `creature_ai_summons` CHANGE `spawntimesecs` `spawntimesecs` int(10) unsigned NOT NULL DEFAULT '120'; +ALTER TABLE `creature_classlevelstats` CHANGE `level` `level` tinyint(4) NOT NULL; +ALTER TABLE `creature_classlevelstats` CHANGE `class` `class` tinyint(4) NOT NULL; +ALTER TABLE `creature_classlevelstats` CHANGE `basehp0` `basehp0` smallint(6) NOT NULL; +ALTER TABLE `creature_classlevelstats` CHANGE `basehp1` `basehp1` smallint(6) NOT NULL; +ALTER TABLE `creature_classlevelstats` CHANGE `basehp2` `basehp2` smallint(6) NOT NULL; +ALTER TABLE `creature_classlevelstats` CHANGE `basemana` `basemana` smallint(6) NOT NULL; +ALTER TABLE `creature_classlevelstats` CHANGE `basearmor` `basearmor` smallint(6) NOT NULL; +ALTER TABLE `creature_formations` CHANGE `leaderGUID` `leaderGUID` int(10) unsigned NOT NULL; +ALTER TABLE `creature_formations` CHANGE `memberGUID` `memberGUID` int(10) unsigned NOT NULL; +ALTER TABLE `creature_formations` CHANGE `groupAI` `groupAI` int(10) unsigned NOT NULL; +ALTER TABLE `creature_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `creature_onkill_reputation` CHANGE `RewOnKillRepValue1` `RewOnKillRepValue1` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `KillCredit1` `KillCredit1` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `KillCredit2` `KillCredit2` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `exp` `exp` smallint(6) NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `resistance1` `resistance1` smallint(6) NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `resistance2` `resistance2` smallint(6) NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `resistance3` `resistance3` smallint(6) NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `resistance4` `resistance4` smallint(6) NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `resistance5` `resistance5` smallint(6) NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `resistance6` `resistance6` smallint(6) NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `questItem1` `questItem1` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `questItem2` `questItem2` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `questItem3` `questItem3` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `questItem4` `questItem4` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `questItem5` `questItem5` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `questItem6` `questItem6` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `WDBVerified` `WDBVerified` smallint(6) NULL DEFAULT '1'; +ALTER TABLE `creature_template_addon` CHANGE `path_id` `path_id` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_transport` CHANGE `guid` `guid` int(11) NOT NULL AUTO_INCREMENT COMMENT 'GUID of NPC on transport - not the same as creature.guid'; +ALTER TABLE `creature_transport` CHANGE `transport_entry` `transport_entry` int(11) NOT NULL COMMENT 'Transport entry'; +ALTER TABLE `creature_transport` CHANGE `npc_entry` `npc_entry` int(11) NOT NULL COMMENT 'NPC entry'; +ALTER TABLE `creature_transport` CHANGE `emote` `emote` int(11) NOT NULL; +ALTER TABLE `db_script_string` CHANGE `entry` `entry` int(10) unsigned NOT NULL DEFAULT '0'; + \ No newline at end of file diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp index add7b4db174..facfbd7581c 100755 --- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp @@ -56,10 +56,10 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts() StringTextData temp; int32 i = fields[0].GetInt32(); - temp.SoundId = fields[1].GetInt32(); - temp.Type = fields[2].GetInt32(); - temp.Language = fields[3].GetInt32(); - temp.Emote = fields[4].GetInt32(); + temp.SoundId = fields[1].GetUInt32(); + temp.Type = fields[2].GetUInt8(); + temp.Language = fields[3].GetUInt8(); + temp.Emote = fields[4].GetUInt16(); // range negative if (i > MIN_CREATURE_AI_TEXT_STRING_ID || i <= MAX_CREATURE_AI_TEXT_STRING_ID) @@ -187,7 +187,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() temp.creature_id = fields[1].GetUInt32(); uint32 creature_id = temp.creature_id; - uint32 e_type = fields[2].GetUInt32(); + uint32 e_type = fields[2].GetUInt8(); //Report any errors in event if (e_type >= EVENT_T_END) { @@ -196,13 +196,13 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() } temp.event_type = EventAI_Type(e_type); - temp.event_inverse_phase_mask = fields[3].GetUInt32(); - temp.event_chance = fields[4].GetUInt8(); - temp.event_flags = fields[5].GetUInt8(); - temp.raw.param1 = fields[6].GetUInt32(); - temp.raw.param2 = fields[7].GetUInt32(); - temp.raw.param3 = fields[8].GetUInt32(); - temp.raw.param4 = fields[9].GetUInt32(); + temp.event_inverse_phase_mask = fields[3].GetInt32(); + temp.event_chance = fields[4].GetUInt32(); + temp.event_flags = fields[5].GetUInt32(); + temp.raw.param1 = fields[6].GetInt32(); + temp.raw.param2 = fields[7].GetInt32(); + temp.raw.param3 = fields[8].GetInt32(); + temp.raw.param4 = fields[9].GetInt32(); //Creature does not exist in database if (!sObjectMgr->GetCreatureTemplate(temp.creature_id)) @@ -399,7 +399,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() for (uint32 j = 0; j < MAX_ACTIONS; j++) { - uint16 action_type = fields[10+(j*4)].GetUInt16(); + uint16 action_type = fields[10+(j*4)].GetUInt8(); if (action_type >= ACTION_T_END) { sLog->outErrorDb("CreatureEventAI: Event %u Action %u has incorrect action type (%u), replace by ACTION_T_NONE.", i, j+1, action_type); @@ -410,9 +410,9 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() CreatureEventAI_Action& action = temp.action[j]; action.type = EventAI_ActionType(action_type); - action.raw.param1 = fields[11+(j*4)].GetUInt32(); - action.raw.param2 = fields[12+(j*4)].GetUInt32(); - action.raw.param3 = fields[13+(j*4)].GetUInt32(); + action.raw.param1 = fields[11+(j*4)].GetInt32(); + action.raw.param2 = fields[12+(j*4)].GetInt32(); + action.raw.param3 = fields[13+(j*4)].GetInt32(); //Report any errors in actions switch (action.type) diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 5a97f6fa18f..7b2e157eac8 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2282,7 +2282,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() continue; } - uint32 dataType = fields[1].GetUInt32(); + uint32 dataType = fields[1].GetUInt8(); const char* scriptName = fields[4].GetCString(); uint32 scriptId = 0; if (strcmp(scriptName, "")) // not empty diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 77b985b205f..e1b99cbdcb9 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -708,10 +708,10 @@ void BattlegroundMgr::CreateInitialBattlegrounds() CreateBattlegroundData data; data.bgTypeId = BattlegroundTypeId(bgTypeID_); data.IsArena = (bl->type == TYPE_ARENA); - data.MinPlayersPerTeam = fields[1].GetUInt32(); - data.MaxPlayersPerTeam = fields[2].GetUInt32(); - data.LevelMin = fields[3].GetUInt32(); - data.LevelMax = fields[4].GetUInt32(); + data.MinPlayersPerTeam = fields[1].GetUInt16(); + data.MaxPlayersPerTeam = fields[2].GetUInt16(); + data.LevelMin = fields[3].GetUInt8(); + data.LevelMax = fields[4].GetUInt8(); //check values from DB if (data.MaxPlayersPerTeam == 0 || data.MinPlayersPerTeam == 0 || data.MinPlayersPerTeam > data.MaxPlayersPerTeam) { diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 7fe6df14679..3fcabea4c74 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -719,8 +719,8 @@ void ConditionMgr::LoadConditions(bool isReload) Condition* cond = new Condition(); int32 iSourceTypeOrReferenceId = fields[0].GetInt32(); cond->SourceGroup = fields[1].GetUInt32(); - cond->SourceEntry = fields[2].GetInt32(); - cond->SourceId = fields[3].GetUInt32(); + cond->SourceEntry = fields[2].GetUInt32(); + cond->SourceId = fields[3].GetInt32(); cond->ElseGroup = fields[4].GetUInt32(); int32 iConditionTypeOrReference = fields[5].GetInt32(); cond->ConditionTarget = fields[6].GetUInt8(); diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp index bcedfa40864..2104f474072 100755 --- a/src/server/game/Entities/Creature/CreatureGroups.cpp +++ b/src/server/game/Entities/Creature/CreatureGroups.cpp @@ -101,7 +101,7 @@ void FormationMgr::LoadCreatureFormations() group_member = new FormationInfo(); group_member->leaderGUID = fields[0].GetUInt32(); uint32 memberGUID = fields[1].GetUInt32(); - group_member->groupAI = fields[4].GetUInt8(); + group_member->groupAI = fields[4].GetUInt32(); //If creature is group leader we may skip loading of dist/angle if (group_member->leaderGUID != memberGUID) { diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index ebb524d5f64..81a505b7acc 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -144,14 +144,14 @@ void MapManager::LoadTransportNPCs() do { Field* fields = result->Fetch(); - uint32 guid = fields[0].GetUInt32(); - uint32 entry = fields[1].GetUInt32(); - uint32 transportEntry = fields[2].GetUInt32(); + uint32 guid = fields[0].GetInt32(); + uint32 entry = fields[1].GetInt32(); + uint32 transportEntry = fields[2].GetInt32(); float tX = fields[3].GetFloat(); float tY = fields[4].GetFloat(); float tZ = fields[5].GetFloat(); float tO = fields[6].GetFloat(); - uint32 anim = fields[7].GetUInt32(); + uint32 anim = fields[7].GetInt32(); for (MapManager::TransportSet::iterator itr = m_Transports.begin(); itr != m_Transports.end(); ++itr) { diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 91ce5c44537..f66ca460c0a 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -422,7 +422,7 @@ void ObjectMgr::LoadCreatureTemplates() creatureTemplate.GossipMenuId = fields[13].GetUInt32(); creatureTemplate.minlevel = fields[14].GetUInt8(); creatureTemplate.maxlevel = fields[15].GetUInt8(); - creatureTemplate.expansion = uint32(fields[16].GetUInt16()); + creatureTemplate.expansion = uint32(fields[16].GetInt16()); creatureTemplate.faction_A = uint32(fields[17].GetUInt16()); creatureTemplate.faction_H = uint32(fields[18].GetUInt16()); creatureTemplate.npcflag = fields[19].GetUInt32(); @@ -455,7 +455,7 @@ void ObjectMgr::LoadCreatureTemplates() creatureTemplate.SkinLootId = fields[46].GetUInt32(); for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) - creatureTemplate.resistance[i] = fields[47 + i -1].GetInt32(); + creatureTemplate.resistance[i] = fields[47 + i -1].GetInt16(); for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i) creatureTemplate.spells[i] = fields[53 + i].GetUInt32(); @@ -5975,7 +5975,7 @@ void ObjectMgr::LoadAreaTriggerTeleports() AreaTrigger at; - at.target_mapId = fields[1].GetUInt32(); + at.target_mapId = fields[1].GetUInt16(); at.target_X = fields[2].GetFloat(); at.target_Y = fields[3].GetFloat(); at.target_Z = fields[4].GetFloat(); @@ -6837,13 +6837,13 @@ void ObjectMgr::LoadReputationOnKill() uint32 creature_id = fields[0].GetUInt32(); ReputationOnKillEntry repOnKill; - repOnKill.RepFaction1 = fields[1].GetUInt32(); - repOnKill.RepFaction2 = fields[2].GetUInt32(); + repOnKill.RepFaction1 = fields[1].GetInt16(); + repOnKill.RepFaction2 = fields[2].GetInt16(); repOnKill.IsTeamAward1 = fields[3].GetBool(); - repOnKill.ReputationMaxCap1 = fields[4].GetUInt32(); + repOnKill.ReputationMaxCap1 = fields[4].GetUInt8(); repOnKill.RepValue1 = fields[5].GetInt32(); repOnKill.IsTeamAward2 = fields[6].GetBool(); - repOnKill.ReputationMaxCap2 = fields[7].GetUInt32(); + repOnKill.ReputationMaxCap2 = fields[7].GetUInt8(); repOnKill.RepValue2 = fields[8].GetInt32(); repOnKill.TeamDependent = fields[9].GetUInt8(); @@ -8692,16 +8692,16 @@ void ObjectMgr::LoadCreatureClassLevelStats() { Field* fields = result->Fetch(); - uint8 Level = fields[0].GetUInt8(); - uint8 Class = fields[1].GetUInt8(); + uint8 Level = fields[0].GetInt8(); + uint8 Class = fields[1].GetInt8(); CreatureBaseStats stats; for (uint8 i = 0; i < MAX_CREATURE_BASE_HP; ++i) - stats.BaseHealth[i] = fields[i + 2].GetUInt16(); + stats.BaseHealth[i] = fields[i + 2].GetInt16(); - stats.BaseMana = fields[5].GetUInt16(); - stats.BaseArmor = fields[6].GetUInt16(); + stats.BaseMana = fields[5].GetInt16(); + stats.BaseArmor = fields[6].GetInt16(); if (!Class || ((1 << (Class - 1)) & CLASSMASK_ALL_CREATURES) == 0) sLog->outErrorDb("Creature base stats for level %u has invalid class %u", Level, Class); diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 3522571775c..7c7cc06201c 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -116,7 +116,7 @@ uint32 LootStore::LoadLootTable() uint16 lootmode = fields[3].GetUInt16(); uint8 group = fields[4].GetUInt8(); int32 mincountOrRef = fields[5].GetInt32(); - int32 maxcount = fields[6].GetInt32(); + int32 maxcount = fields[6].GetUInt8(); if (maxcount > std::numeric_limits::max()) { diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp index ecb82a80a8d..66f5a4089dc 100755 --- a/src/server/game/Scripting/ScriptSystem.cpp +++ b/src/server/game/Scripting/ScriptSystem.cpp @@ -109,11 +109,11 @@ void SystemMgr::LoadScriptTextsCustom() Field* pFields = result->Fetch(); StringTextData temp; - int32 iId = pFields[0].GetInt32(); + int32 iId = pFields[0].GetInt32(); temp.uiSoundId = pFields[1].GetUInt32(); - temp.uiType = pFields[2].GetUInt32(); - temp.uiLanguage = pFields[3].GetUInt32(); - temp.uiEmote = pFields[4].GetUInt32(); + temp.uiType = pFields[2].GetUInt8(); + temp.uiLanguage = pFields[3].GetUInt8(); + temp.uiEmote = pFields[4].GetUInt16(); if (iId >= 0) { diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 249506fb0f1..a9959c60201 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -694,7 +694,7 @@ public: { PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_TRANSPORT_EMOTE); - stmt->setInt16(0, int16(emote)); + stmt->setInt32(0, int32(emote)); stmt->setInt32(1, target->GetTransport()->GetEntry()); stmt->setInt32(2, target->GetGUIDTransport()); From 6afaed4a02ff5e29510a9e1afffea803e02f3d69 Mon Sep 17 00:00:00 2001 From: click Date: Tue, 27 Mar 2012 02:27:12 +0200 Subject: [PATCH 0309/1149] Core: Remove the MersenneTwiser-library (SFMT is now considered stable enough for full deployment) --- cmake/compiler/gcc/settings.cmake | 12 +- cmake/compiler/icc/settings.cmake | 11 +- cmake/compiler/msvc/settings.cmake | 7 +- cmake/options.cmake | 1 - cmake/showoptions.cmake | 9 +- dep/PackageList.txt | 4 - dep/mersennetwister/MersenneTwister.h | 405 -------------------------- src/server/shared/Utilities/Util.cpp | 40 --- src/server/worldserver/Master.cpp | 7 - 9 files changed, 12 insertions(+), 484 deletions(-) delete mode 100644 dep/mersennetwister/MersenneTwister.h diff --git a/cmake/compiler/gcc/settings.cmake b/cmake/compiler/gcc/settings.cmake index 3a2745702c8..8247831fdd8 100644 --- a/cmake/compiler/gcc/settings.cmake +++ b/cmake/compiler/gcc/settings.cmake @@ -3,14 +3,12 @@ add_definitions(-D_BUILD_DIRECTIVE='"${CMAKE_BUILD_TYPE}"') add_definitions(-fno-delete-null-pointer-checks) -if( USE_SFMT) - if(PLATFORM EQUAL 32) - # Required on 32-bit systems to enable SSE2 (standard on x64) - add_definitions(-msse2 -mfpmath=sse) - endif() - add_definitions(-DHAVE_SSE2 -D__SSE2__) - message(STATUS "GCC: SFMT enabled, SSE2 flags forced") +if(PLATFORM EQUAL 32) + # Required on 32-bit systems to enable SSE2 (standard on x64) + add_definitions(-msse2 -mfpmath=sse) endif() +add_definitions(-DHAVE_SSE2 -D__SSE2__) +message(STATUS "GCC: SSE2 flags forced") if( WITH_WARNINGS ) add_definitions(-Wall -Wfatal-errors -Wextra) diff --git a/cmake/compiler/icc/settings.cmake b/cmake/compiler/icc/settings.cmake index 0e614ef97f8..b7e4cb742b3 100644 --- a/cmake/compiler/icc/settings.cmake +++ b/cmake/compiler/icc/settings.cmake @@ -1,13 +1,10 @@ # Set build-directive (used in core to tell which buildtype we used) add_definitions(-D_BUILD_DIRECTIVE="${CMAKE_BUILD_TYPE}") -if( USE_SFMT) - if(PLATFORM EQUAL 32) - add_definitions(-axSSE2) - else() - add_definitions(-xSSE2) - endif() - message(STATUS "ICC: SFMT enabled, SSE2 flags forced") +if(PLATFORM EQUAL 32) + add_definitions(-axSSE2) +else() + add_definitions(-xSSE2) endif() if( WITH_WARNINGS ) diff --git a/cmake/compiler/msvc/settings.cmake b/cmake/compiler/msvc/settings.cmake index eb55dc66c50..3d8fe43b6aa 100644 --- a/cmake/compiler/msvc/settings.cmake +++ b/cmake/compiler/msvc/settings.cmake @@ -20,11 +20,8 @@ else() set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") message(STATUS "MSVC: Enabled large address awareness") - # Test if we need SSE2-support - if(USE_SFMT) - add_definitions(/arch:SSE2) - message(STATUS "MSVC: Enabled SSE2 support") - endif() + add_definitions(/arch:SSE2) + message(STATUS "MSVC: Enabled SSE2 support") endif() # Set build-directive (used in core to tell which buildtype we used) diff --git a/cmake/options.cmake b/cmake/options.cmake index 71424cc3776..11ebe6ddd12 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -13,6 +13,5 @@ option(SCRIPTS "Build core with scripts included" option(TOOLS "Build map/vmap extraction/assembler tools" 0) option(USE_SCRIPTPCH "Use precompiled headers when compiling scripts" 1) option(USE_COREPCH "Use precompiled headers when compiling servers" 1) -option(USE_SFMT "Use SFMT as random numbergenerator" 1) option(WITH_WARNINGS "Show all warnings during compile" 0) option(WITH_COREDEBUG "Include additional debug-code in core" 0) diff --git a/cmake/showoptions.cmake b/cmake/showoptions.cmake index 9cac1d82f4a..47ad7b0889b 100644 --- a/cmake/showoptions.cmake +++ b/cmake/showoptions.cmake @@ -50,13 +50,6 @@ else() message("* Build scripts w/PCH : No") endif() -if( USE_SFMT ) - message("* Use SFMT for RNG : Yes") - add_definitions(-DUSE_SFMT_FOR_RNG) -else() - message("* Use SFMT for RNG : No (default)") -endif() - if( WITH_WARNINGS ) message("* Show all warnings : Yes") else() @@ -84,4 +77,4 @@ if ( NOJEM ) message("*** Please note that this is for DEBUGGING WITH VALGRIND only!") message("*** DO NOT DISABLE IT UNLESS YOU KNOW WHAT YOU'RE DOING!") endif() - message("") +message("") diff --git a/dep/PackageList.txt b/dep/PackageList.txt index 7ab307ecfc5..ef1b9b58fca 100644 --- a/dep/PackageList.txt +++ b/dep/PackageList.txt @@ -20,10 +20,6 @@ libMPQ (a library for reading MPQ files) https://libmpq.org/ Version: 1.0.4 -MersenneTwister (a very fast random number generator) - http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html - Version: 0.4.2 - MySQL (the world's most popular open source database software) http://www.mysql.com/ Version: 5.5.9 (GA) diff --git a/dep/mersennetwister/MersenneTwister.h b/dep/mersennetwister/MersenneTwister.h deleted file mode 100644 index 1cff879643f..00000000000 --- a/dep/mersennetwister/MersenneTwister.h +++ /dev/null @@ -1,405 +0,0 @@ -// MersenneTwister.h -// Mersenne Twister random number generator -- a C++ class MTRand -// Based on code by Makoto Matsumoto, Takuji Nishimura, and Shawn Cokus -// Richard J. Wagner v1.0 15 May 2003 rjwagner@writeme.com - -// The Mersenne Twister is an algorithm for generating random numbers. It -// was designed with consideration of the flaws in various other generators. -// The period, 2^19937-1, and the order of equidistribution, 623 dimensions, -// are far greater. The generator is also fast; it avoids multiplication and -// division, and it benefits from caches and pipelines. For more information -// see the inventors' web page at http://www.math.keio.ac.jp/~matumoto/emt.html - -// Reference -// M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-Dimensionally -// Equidistributed Uniform Pseudo-Random Number Generator", ACM Transactions on -// Modeling and Computer Simulation, Vol. 8, No. 1, January 1998, pp 3-30. - -// Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, -// Copyright (C) 2000 - 2003, Richard J. Wagner -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. The names of its contributors may not be used to endorse or promote -// products derived from this software without specific prior written -// permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// The original code included the following notice: -// -// When you use this, send an email to: matumoto@math.keio.ac.jp -// with an appropriate reference to your work. -// -// It would be nice to CC: rjwagner@writeme.com and Cokus@math.washington.edu -// when you write. - -#ifndef MERSENNETWISTER_H -#define MERSENNETWISTER_H - -// Not thread safe (unless auto-initialization is avoided and each thread has -// its own MTRand object) - -#include"Define.h" - -#include -#include -#include - -class MTRand { -// Data -public: - typedef ::uint32 uint32; - enum { N = 624 }; // length of state vector - enum { SAVE = N + 1 }; // length of array for save() - -protected: - enum { M = 397 }; // period parameter - - uint32 state[N]; // internal state - uint32 *pNext; // next value to get from state - int left; // number of values left before reload needed - -//Methods -public: - MTRand( const uint32& oneSeed ); // initialize with a simple uint32 - MTRand( uint32 *const bigSeed, uint32 const seedLength = N ); // or an array - MTRand(); // auto-initialize with /dev/urandom or time() and clock() - MTRand(const MTRand&); // prevent copy constructor - MTRand& operator=(const MTRand&); // no-op operator= - - // Do NOT use for CRYPTOGRAPHY without securely hashing several returned - // values together, otherwise the generator state can be learned after - // reading 624 consecutive values. - - // Access to 32-bit random numbers - double rand(); // real number in [0,1] - double rand( const double& n ); // real number in [0,n] - double randExc(); // real number in [0,1) - double randExc( const double& n ); // real number in [0,n) - double randDblExc(); // real number in (0,1) - double randDblExc( const double& n ); // real number in (0,n) - uint32 randInt(); // integer in [0,2^32-1] - uint32 randInt( const uint32& n ); // integer in [0,n] for n < 2^32 - double operator()() { return rand(); } // same as rand() - - // Access to 53-bit random numbers (capacity of IEEE double precision) - double rand53(); // real number in [0,1) - - // Access to nonuniform random number distributions - double randNorm( const double& mean = 0.0, const double& variance = 0.0 ); - - // Re-seeding functions with same behavior as initializers - void seed( const uint32 oneSeed ); - void seed( uint32 *const bigSeed, const uint32 seedLength = N ); - void seed(); - - // Saving and loading generator state - void save( uint32* saveArray ) const; // to array of size SAVE - void load( uint32 *const loadArray ); // from such array - /* Trinity not use streams for random values output - friend std::ostream& operator<<( std::ostream& os, const MTRand& mtrand ); - friend std::istream& operator>>( std::istream& is, MTRand& mtrand ); - */ -protected: - void initialize( const uint32 oneSeed ); - void reload(); - uint32 hiBit( const uint32& u ) const { return u & 0x80000000UL; } - uint32 loBit( const uint32& u ) const { return u & 0x00000001UL; } - uint32 loBits( const uint32& u ) const { return u & 0x7fffffffUL; } - uint32 mixBits( const uint32& u, const uint32& v ) const - { return hiBit(u) | loBits(v); } - uint32 twist( const uint32& m, const uint32& s0, const uint32& s1 ) const - { return m ^ (mixBits(s0,s1)>>1) ^ uint32(-(int32)(loBit(s1) & 0x9908b0dfUL)); } - static uint32 hash( time_t t, clock_t c ); -}; - -inline MTRand::MTRand(const MTRand&) - { seed(); } - -inline MTRand& MTRand::operator=(const MTRand&) - { return *this; } - -inline MTRand::MTRand( const uint32& oneSeed ) - { seed(oneSeed); } - -inline MTRand::MTRand( uint32 *const bigSeed, const uint32 seedLength ) - { seed(bigSeed,seedLength); } - -inline MTRand::MTRand() - { seed(); } - -inline double MTRand::rand() - { return double(randInt()) * (1.0/4294967295.0); } - -inline double MTRand::rand( const double& n ) - { return rand() * n; } - -inline double MTRand::randExc() - { return double(randInt()) * (1.0/4294967296.0); } - -inline double MTRand::randExc( const double& n ) - { return randExc() * n; } - -inline double MTRand::randDblExc() - { return ( double(randInt()) + 0.5 ) * (1.0/4294967296.0); } - -inline double MTRand::randDblExc( const double& n ) - { return randDblExc() * n; } - -inline double MTRand::rand53() -{ - uint32 a = randInt() >> 5, b = randInt() >> 6; - return ( a * 67108864.0 + b ) * (1.0/9007199254740992.0); // by Isaku Wada -} - -inline double MTRand::randNorm( const double& mean, const double& variance ) -{ - // Return a real number from a normal (Gaussian) distribution with given - // mean and variance by Box-Muller method - double r = sqrt( -2.0 * log( 1.0-randDblExc()) ) * variance; - double phi = 2.0 * 3.14159265358979323846264338328 * randExc(); - return mean + r * cos(phi); -} - -inline MTRand::uint32 MTRand::randInt() -{ - // Pull a 32-bit integer from the generator state - // Every other access function simply transforms the numbers extracted here - - if( left == 0 ) reload(); - --left; - - register uint32 s1; - s1 = *pNext++; - s1 ^= (s1 >> 11); - s1 ^= (s1 << 7) & 0x9d2c5680UL; - s1 ^= (s1 << 15) & 0xefc60000UL; - return ( s1 ^ (s1 >> 18) ); -} - -inline MTRand::uint32 MTRand::randInt( const uint32& n ) -{ - // Find which bits are used in n - // Optimized by Magnus Jonsson (magnus@smartelectronix.com) - uint32 used = n; - used |= used >> 1; - used |= used >> 2; - used |= used >> 4; - used |= used >> 8; - used |= used >> 16; - - // Draw numbers until one is found in [0,n] - uint32 i; - do - i = randInt() & used; // toss unused bits to shorten search - while( i > n ); - return i; -} - -inline void MTRand::seed( const uint32 oneSeed ) -{ - // Seed the generator with a simple uint32 - initialize(oneSeed); - reload(); -} - -inline void MTRand::seed( uint32 *const bigSeed, const uint32 seedLength ) -{ - // Seed the generator with an array of uint32's - // There are 2^19937-1 possible initial states. This function allows - // all of those to be accessed by providing at least 19937 bits (with a - // default seed length of N = 624 uint32's). Any bits above the lower 32 - // in each element are discarded. - // Just call seed() if you want to get array from /dev/urandom - initialize(19650218UL); - register int i = 1; - register uint32 j = 0; - register int k = ( N > int(seedLength) ? N : int(seedLength) ); - for (; k; --k ) - { - state[i] = - state[i] ^ ( (state[i-1] ^ (state[i-1] >> 30)) * 1664525UL ); - state[i] += ( bigSeed[j] & 0xffffffffUL ) + j; - state[i] &= 0xffffffffUL; - ++i; ++j; - if( i >= N ) { state[0] = state[N-1]; i = 1; } - if( j >= seedLength ) j = 0; - } - for (k = N - 1; k; --k ) - { - state[i] = - state[i] ^ ( (state[i-1] ^ (state[i-1] >> 30)) * 1566083941UL ); - state[i] -= i; - state[i] &= 0xffffffffUL; - ++i; - if( i >= N ) { state[0] = state[N-1]; i = 1; } - } - state[0] = 0x80000000UL; // MSB is 1, assuring non-zero initial array - reload(); -} - -inline void MTRand::seed() -{ - // Seed the generator with hash of time() and clock() values - seed( hash( time(NULL), clock() ) ); -} - -inline void MTRand::initialize( const uint32 seed ) -{ - // Initialize generator state with seed - // See Knuth TAOCP Vol 2, 3rd Ed, p.106 for multiplier. - // In previous versions, most significant bits (MSBs) of the seed affect - // only MSBs of the state array. Modified 9 Jan 2002 by Makoto Matsumoto. - register uint32 *s = state; - register uint32 *r = state; - register int i = 1; - *s++ = seed & 0xffffffffUL; - for (; i < N; ++i ) - { - *s++ = ( 1812433253UL * ( *r ^ (*r >> 30) ) + i ) & 0xffffffffUL; - r++; - } -} - -inline void MTRand::reload() -{ - // Generate N new values in state - // Made clearer and faster by Matthew Bellew (matthew.bellew@home.com) - register uint32 *p = state; - register int i; - for (i = N - M; i--; ++p ) - *p = twist( p[M], p[0], p[1] ); - for (i = M; --i; ++p ) - *p = twist( p[M-N], p[0], p[1] ); - *p = twist( p[M-N], p[0], state[0] ); - - left = N, pNext = state; -} - -inline MTRand::uint32 MTRand::hash( time_t t, clock_t c ) -{ - // Get a uint32 from t and c - // Better than uint32(x) in case x is floating point in [0,1] - // Based on code by Lawrence Kirby (fred@genesis.demon.co.uk) - - static uint32 differ = 0; // guarantee time-based seeds will change - - uint32 h1 = 0; - unsigned char *p = (unsigned char *) &t; - for (size_t i = 0; i < sizeof(t); ++i ) - { - h1 *= UCHAR_MAX + 2U; - h1 += p[i]; - } - uint32 h2 = 0; - p = (unsigned char *) &c; - for (size_t j = 0; j < sizeof(c); ++j ) - { - h2 *= UCHAR_MAX + 2U; - h2 += p[j]; - } - return ( h1 + differ++ ) ^ h2; -} - -inline void MTRand::save( uint32* saveArray ) const -{ - register uint32 *sa = saveArray; - register const uint32 *s = state; - register int i = N; - for (; i--; *sa++ = *s++ ) {} - *sa = left; -} - -inline void MTRand::load( uint32 *const loadArray ) -{ - register uint32 *s = state; - register uint32 *la = loadArray; - register int i = N; - for (; i--; *s++ = *la++ ) {} - left = *la; - pNext = &state[N-left]; -} - -/* Trinity not use streams for random values output -inline std::ostream& operator<<( std::ostream& os, const MTRand& mtrand ) -{ - register const MTRand::uint32 *s = mtrand.state; - register int i = mtrand.N; - for (; i--; os << *s++ << "\t" ) {} - return os << mtrand.left; -} - -inline std::istream& operator>>( std::istream& is, MTRand& mtrand ) -{ - register MTRand::uint32 *s = mtrand.state; - register int i = mtrand.N; - for (; i--; is >> *s++ ) {} - is >> mtrand.left; - mtrand.pNext = &mtrand.state[mtrand.N-mtrand.left]; - return is; -} -*/ - -#endif // MERSENNETWISTER_H - -// Change log: -// -// v0.1 - First release on 15 May 2000 -// - Based on code by Makoto Matsumoto, Takuji Nishimura, and Shawn Cokus -// - Translated from C to C++ -// - Made completely ANSI compliant -// - Designed convenient interface for initialization, seeding, and -// obtaining numbers in default or user-defined ranges -// - Added automatic seeding from /dev/urandom or time() and clock() -// - Provided functions for saving and loading generator state -// -// v0.2 - Fixed bug which reloaded generator one step too late -// -// v0.3 - Switched to clearer, faster reload() code from Matthew Bellew -// -// v0.4 - Removed trailing newline in saved generator format to be consistent -// with output format of built-in types -// -// v0.5 - Improved portability by replacing static const int's with enum's and -// clarifying return values in seed(); suggested by Eric Heimburg -// - Removed MAXINT constant; use 0xffffffffUL instead -// -// v0.6 - Eliminated seed overflow when uint32 is larger than 32 bits -// - Changed integer [0,n] generator to give better uniformity -// -// v0.7 - Fixed operator precedence ambiguity in reload() -// - Added access for real numbers in (0,1) and (0,n) -// -// v0.8 - Included time.h header to properly support time_t and clock_t -// -// v1.0 - Revised seeding to match 26 Jan 2002 update of Nishimura and Matsumoto -// - Allowed for seeding with arrays of any length -// - Added access for real numbers in [0,1) with 53-bit resolution -// - Added access for real numbers from normal (Gaussian) distributions -// - Increased overall speed by optimizing twist() -// - Doubled speed of integer [0,n] generation -// - Fixed out-of-range number generation on 64-bit machines -// - Improved portability by substituting literal constants for long enum's -// - Changed license from GNU LGPL to BSD - diff --git a/src/server/shared/Utilities/Util.cpp b/src/server/shared/Utilities/Util.cpp index 52ce74be8f8..7bedf9690ca 100755 --- a/src/server/shared/Utilities/Util.cpp +++ b/src/server/shared/Utilities/Util.cpp @@ -19,15 +19,10 @@ #include #include "Util.h" #include "utf8.h" -#ifdef USE_SFMT_FOR_RNG #include "SFMT.h" -#else -#include "MersenneTwister.h" -#endif #include #include -#ifdef USE_SFMT_FOR_RNG typedef ACE_TSS SFMTRandTSS; static SFMTRandTSS sfmtRand; @@ -61,41 +56,6 @@ double rand_chance(void) return sfmtRand->Random() * 100.0; } -#else -typedef ACE_TSS MTRandTSS; -static MTRandTSS mtRand; - -int32 irand(int32 min, int32 max) -{ - return int32(mtRand->randInt(max - min)) + min; -} - -uint32 urand(uint32 min, uint32 max) -{ - return mtRand->randInt(max - min) + min; -} - -float frand(float min, float max) -{ - return float(mtRand->randExc(max - min) + min); -} - -int32 rand32() -{ - return mtRand->randInt(); -} - -double rand_norm(void) -{ - return mtRand->randExc(); -} - -double rand_chance(void) -{ - return mtRand->randExc(100.0); -} -#endif - Tokens::Tokens(const std::string &src, const char sep, uint32 vectorReserve) { m_str = new char[src.length() + 1]; diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index f1be4a6889b..f4945e025b0 100755 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -137,13 +137,6 @@ int Master::Run() sLog->outString(" C O R E /\\___/"); sLog->outString("http://TrinityCore.org \\/__/\n"); -#ifdef USE_SFMT_FOR_RNG - sLog->outString("\n"); - sLog->outString("SFMT has been enabled as the random number generator, if worldserver"); - sLog->outString("freezes or crashes randomly, first, try disabling SFMT in CMAKE configuration"); - sLog->outString("\n"); -#endif //USE_SFMT_FOR_RNG - /// worldserver PID file creation std::string pidfile = ConfigMgr::GetStringDefault("PidFile", ""); if (!pidfile.empty()) From 13e071195de690d7e7639c95e39222e20928fe9c Mon Sep 17 00:00:00 2001 From: Shocker Date: Tue, 27 Mar 2012 02:52:47 +0300 Subject: [PATCH 0310/1149] Core/Groups: Remove redundant check in WorldSession::HandleLootRoll --- src/server/game/Handlers/GroupHandler.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 9343a5356b6..637025c7d9e 100755 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -430,7 +430,8 @@ void WorldSession::HandleLootMethodOpcode(WorldPacket & recv_data) void WorldSession::HandleLootRoll(WorldPacket &recv_data) { - if (!GetPlayer()->GetGroup()) + Group* group = GetPlayer()->GetGroup(); + if (!group) { recv_data.rfinish(); return; @@ -443,12 +444,6 @@ void WorldSession::HandleLootRoll(WorldPacket &recv_data) recv_data >> NumberOfPlayers; recv_data >> rollType; //0: pass, 1: need, 2: greed - //sLog->outDebug("WORLD RECIEVE CMSG_LOOT_ROLL, From:%u, Numberofplayers:%u, Choise:%u", (uint32)Guid, NumberOfPlayers, Choise); - - Group* group = GetPlayer()->GetGroup(); - if (!group) - return; - // everything's fine, do it group->CountRollVote(GetPlayer()->GetGUID(), Guid, NumberOfPlayers, rollType); From 88d81d27cfc863823cc2cd6c5a511bc78baa4414 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Tue, 27 Mar 2012 11:49:16 +0200 Subject: [PATCH 0311/1149] Core/DB Layer: - Fix "Thread #1 unlocked a not-locked lock at 0x6D56E90" helgrind error (thanks to Aokromes for logs). Cause was unlocking MySQL connection on shutdown, but concurrent access at this point is not required. - Remove redundant locking in PingOperation. Since these are delayed to async threads with their own MySQL connection, no concurrent access here either. - Codestyle cleanup - Documentation refining --- .../shared/Database/DatabaseWorkerPool.h | 170 ++++++++++-------- .../shared/Database/MySQLConnection.cpp | 4 - 2 files changed, 92 insertions(+), 82 deletions(-) diff --git a/src/server/shared/Database/DatabaseWorkerPool.h b/src/server/shared/Database/DatabaseWorkerPool.h index aef952fab55..5fe31006bb2 100755 --- a/src/server/shared/Database/DatabaseWorkerPool.h +++ b/src/server/shared/Database/DatabaseWorkerPool.h @@ -33,17 +33,11 @@ class PingOperation : public SQLOperation { - /// Operation for idle delaythreads + //! Operation for idle delaythreads bool Execute() { - if (m_conn->LockIfReady()) - { - m_conn->Ping(); - m_conn->Unlock(); - return true; - } - - return false; + m_conn->Ping(); + return true; } }; @@ -53,10 +47,10 @@ class DatabaseWorkerPool public: /* Activity state */ DatabaseWorkerPool() : - m_queue(new ACE_Activation_Queue()) + _queue(new ACE_Activation_Queue()) { - memset(m_connectionCount, 0, sizeof(m_connectionCount)); - m_connections.resize(IDX_SIZE); + memset(_connectionCount, 0, sizeof(_connectionCount)); + _connections.resize(IDX_SIZE); WPFatal (mysql_thread_safe(), "Used MySQL library isn't thread-safe."); } @@ -68,66 +62,72 @@ class DatabaseWorkerPool bool Open(const std::string& infoString, uint8 async_threads, uint8 synch_threads) { bool res = true; - m_connectionInfo = MySQLConnectionInfo(infoString); + _connectionInfo = MySQLConnectionInfo(infoString); - sLog->outSQLDriver("Opening databasepool '%s'. Async threads: %u, synch threads: %u", m_connectionInfo.database.c_str(), async_threads, synch_threads); + sLog->outSQLDriver("Opening DatabasePool '%s'. Asynchronous connections: %u, synchronous connections: %u.", + GetDatabaseName(), async_threads, synch_threads); - /// Open asynchronous connections (delayed operations) - m_connections[IDX_ASYNC].resize(async_threads); + //! Open asynchronous connections (delayed operations) + _connections[IDX_ASYNC].resize(async_threads); for (uint8 i = 0; i < async_threads; ++i) { - T* t = new T(m_queue, m_connectionInfo); + T* t = new T(_queue, _connectionInfo); res &= t->Open(); - m_connections[IDX_ASYNC][i] = t; - ++m_connectionCount[IDX_ASYNC]; + _connections[IDX_ASYNC][i] = t; + ++_connectionCount[IDX_ASYNC]; } - /// Open synchronous connections (direct, blocking operations) - m_connections[IDX_SYNCH].resize(synch_threads); + //! Open synchronous connections (direct, blocking operations) + _connections[IDX_SYNCH].resize(synch_threads); for (uint8 i = 0; i < synch_threads; ++i) { - T* t = new T(m_connectionInfo); + T* t = new T(_connectionInfo); res &= t->Open(); - m_connections[IDX_SYNCH][i] = t; - ++m_connectionCount[IDX_SYNCH]; + _connections[IDX_SYNCH][i] = t; + ++_connectionCount[IDX_SYNCH]; } - sLog->outSQLDriver("Databasepool opened successfully. %u total connections running.", (m_connectionCount[IDX_SYNCH] + m_connectionCount[IDX_ASYNC])); + if (res) + sLog->outSQLDriver("DatabasePool '%s' opened successfully. %u total connections running.", GetDatabaseName(), + (_connectionCount[IDX_SYNCH] + _connectionCount[IDX_ASYNC])); + else + sLog->outError("DatabasePool %s NOT opened. There were errors opening the MySQL connections. Check your SQLDriverLogFile " + "for specific errors.", GetDatabaseName()); return res; } void Close() { - sLog->outSQLDriver("Closing down databasepool '%s'.", m_connectionInfo.database.c_str()); + sLog->outSQLDriver("Closing down DatabasePool '%s'.", GetDatabaseName()); - /// Shuts down delaythreads for this connection pool by underlying deactivate() - m_queue->queue()->close(); + //! Shuts down delaythreads for this connection pool by underlying deactivate(). + //! The next dequeue attempt in the worker thread tasks will result in an error, + //! ultimately ending the worker thread task. + _queue->queue()->close(); - for (uint8 i = 0; i < m_connectionCount[IDX_ASYNC]; ++i) + for (uint8 i = 0; i < _connectionCount[IDX_ASYNC]; ++i) { - /// TODO: Better way. probably should flip a boolean and check it on low level code before doing anything on the mysql ctx - /// Now we just wait until m_queue gives the signal to the worker threads to stop - T* t = m_connections[IDX_ASYNC][i]; + T* t = _connections[IDX_ASYNC][i]; DatabaseWorker* worker = t->m_worker; - worker->wait(); + worker->wait(); //! Block until no more threads are running this task. delete worker; - t->Close(); + t->Close(); //! Closes the actualy MySQL connection. } - sLog->outSQLDriver("Asynchronous connections on databasepool '%s' terminated. Proceeding with synchronous connections.", m_connectionInfo.database.c_str()); + sLog->outSQLDriver("Asynchronous connections on DatabasePool '%s' terminated. Proceeding with synchronous connections.", + GetDatabaseName()); - /// Shut down the synchronous connections - for (uint8 i = 0; i < m_connectionCount[IDX_SYNCH]; ++i) - { - T* t = m_connections[IDX_SYNCH][i]; - //while (1) - // if (t->LockIfReady()) -- For some reason deadlocks us - t->Close(); - } + //! Shut down the synchronous connections + //! There's no need for locking the connection, because DatabaseWorkerPool<>::Close + //! should only be called after any other thread tasks in the core have exited, + //! meaning there can be no concurrent access at this point. + for (uint8 i = 0; i < _connectionCount[IDX_SYNCH]; ++i) + _connections[IDX_SYNCH][i]->Close(); - delete m_queue; + //! Deletes the ACE_Activation_Queue object and its underlying ACE_Message_Queue + delete _queue; - sLog->outSQLDriver("All connections on databasepool %s closed.", m_connectionInfo.database.c_str()); + sLog->outSQLDriver("All connections on DatabasePool '%s' closed.", GetDatabaseName()); } /** @@ -344,20 +344,22 @@ class DatabaseWorkerPool //! were appended to the transaction will be respected during execution. void CommitTransaction(SQLTransaction transaction) { - if (sLog->GetSQLDriverQueryLogging()) + #ifdef TRINITY_DEBUG + //! Only analyze transaction weaknesses in Debug mode. + //! Ideally we catch the faults in Debug mode and then correct them, + //! so there's no need to waste these CPU cycles in Release mode. + switch (transaction->GetSize()) { - switch (transaction->GetSize()) - { - case 0: - sLog->outSQLDriver("Transaction contains 0 queries. Not executing."); - return; - case 1: - sLog->outSQLDriver("Warning: Transaction only holds 1 query, consider removing Transaction context in code."); - break; - default: - break; - } + case 0: + sLog->outSQLDriver("Transaction contains 0 queries. Not executing."); + return; + case 1: + sLog->outSQLDriver("Warning: Transaction only holds 1 query, consider removing Transaction context in code."); + break; + default: + break; } + #endif // TRINITY_DEBUG Enqueue(new TransactionTask(transaction)); } @@ -373,9 +375,11 @@ class DatabaseWorkerPool return; } + //! Handle MySQL Errno 1213 without extending deadlock to the core itself + //! TODO: More elegant way if (con->GetLastError() == 1213) { - uint8 loopBreaker = 5; // Handle MySQL Errno 1213 without extending deadlock to the core itself + uint8 loopBreaker = 5; for (uint8 i = 0; i < loopBreaker; ++i) { if (con->ExecuteTransaction(transaction)) @@ -383,7 +387,7 @@ class DatabaseWorkerPool } } - // Clean up now. + //! Clean up now. transaction->Cleanup(); con->Unlock(); @@ -414,6 +418,7 @@ class DatabaseWorkerPool */ //! Automanaged (internally) pointer to a prepared statement object for usage in upper level code. + //! Pointer is deleted in this->Query(PreparedStatement*) or PreparedStatementTask::~PreparedStatementTask. //! This object is not tied to the prepared statement on the MySQL context yet until execution. PreparedStatement* GetPreparedStatement(uint32 index) { @@ -435,10 +440,10 @@ class DatabaseWorkerPool //! Keeps all our MySQL connections alive, prevent the server from disconnecting us. void KeepAlive() { - /// Ping synchronous connections - for (uint8 i = 0; i < m_connectionCount[IDX_SYNCH]; ++i) + //! Ping synchronous connections + for (uint8 i = 0; i < _connectionCount[IDX_SYNCH]; ++i) { - T* t = m_connections[IDX_SYNCH][i]; + T* t = _connections[IDX_SYNCH][i]; if (t->LockIfReady()) { t->Ping(); @@ -446,10 +451,10 @@ class DatabaseWorkerPool } } - /// Assuming all worker threads are free, every worker thread will receive 1 ping operation request - /// If one or more worker threads are busy, the ping operations will not be split evenly, but this doesn't matter - /// as the sole purpose is to prevent connections from idling. - for (size_t i = 0; i < m_connections[IDX_ASYNC].size(); ++i) + //! Assuming all worker threads are free, every worker thread will receive 1 ping operation request + //! If one or more worker threads are busy, the ping operations will not be split evenly, but this doesn't matter + //! as the sole purpose is to prevent connections from idling. + for (size_t i = 0; i < _connections[IDX_ASYNC].size(); ++i) Enqueue(new PingOperation); } @@ -459,41 +464,50 @@ class DatabaseWorkerPool if (!to || !from || !length) return 0; - return mysql_real_escape_string(m_connections[IDX_SYNCH][0]->GetHandle(), to, from, length); + return mysql_real_escape_string(_connections[IDX_SYNCH][0]->GetHandle(), to, from, length); } void Enqueue(SQLOperation* op) { - m_queue->enqueue(op); + _queue->enqueue(op); } + //! Gets a free connection in the synchronous connection pool. + //! Caller MUST call t->Unlock() after touching the MySQL context to prevent deadlocks. T* GetFreeConnection() { uint8 i = 0; - size_t num_cons = m_connectionCount[IDX_SYNCH]; - for (;;) /// Block forever until a connection is free + size_t num_cons = _connectionCount[IDX_SYNCH]; + //! Block forever until a connection is free + for (;;) { - T* t = m_connections[IDX_SYNCH][++i % num_cons ]; - if (t->LockIfReady()) /// Must be matched with t->Unlock() or you will get deadlocks + T* t = _connections[IDX_SYNCH][++i % num_cons]; + //! Must be matched with t->Unlock() or you will get deadlocks + if (t->LockIfReady()) return t; } - // This will be called when Celine Dion learns to sing + //! This will be called when Celine Dion learns to sing return NULL; } + char const* GetDatabaseName() const + { + return _connectionInfo.database.c_str(); + } + private: - enum + enum _internalIndex { IDX_ASYNC, IDX_SYNCH, IDX_SIZE, }; - ACE_Activation_Queue* m_queue; //! Queue shared by async worker threads. - std::vector< std::vector > m_connections; - uint32 m_connectionCount[2]; //! Counter of MySQL connections; - MySQLConnectionInfo m_connectionInfo; + ACE_Activation_Queue* _queue; //! Queue shared by async worker threads. + std::vector< std::vector > _connections; + uint32 _connectionCount[2]; //! Counter of MySQL connections; + MySQLConnectionInfo _connectionInfo; }; #endif diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp index f686db4c199..7fb4a4f7025 100755 --- a/src/server/shared/Database/MySQLConnection.cpp +++ b/src/server/shared/Database/MySQLConnection.cpp @@ -58,17 +58,13 @@ MySQLConnection::~MySQLConnection() { ASSERT (m_Mysql); /// MySQL context must be present at this point - sLog->outSQLDriver("MySQLConnection::~MySQLConnection()"); for (size_t i = 0; i < m_stmts.size(); ++i) delete m_stmts[i]; for (PreparedStatementMap::const_iterator itr = m_queries.begin(); itr != m_queries.end(); ++itr) - { free((void *)m_queries[itr->first].first); - } mysql_close(m_Mysql); - Unlock(); /// Unlock while we die, how ironic } void MySQLConnection::Close() From 1ee7196ec0bb5bbd81ca260146405b17fac32e30 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Tue, 27 Mar 2012 13:33:02 +0300 Subject: [PATCH 0312/1149] Core/DB Layer: Fix helgrind errors on some concurrent access to resultset auto pointers. Example: ==8753== Possible data race during read of size 8 at 0x2e803e60 by thread #8 ==8753== at 0xDD0FFC: PreparedResultSet::operator[](unsigned int) const (QueryResult.h:83) ==8753== by 0x131D82D: WorldSession::HandleCharEnum(Trinity::AutoPtr) (CharacterHandler.cpp:217) ==8753== by 0x118F8C3: WorldSession::ProcessQueryCallbacks() (WorldSession.cpp:1087) {..} ==8753== Address 0x2e803e60 is 0 bytes inside a block of size 16 alloc'd ==8753== at 0x4C28B75: operator new(unsigned long) (vg_replace_malloc.c:261) ==8753== by 0x137D515: __gnu_cxx::new_allocator::allocate(unsigned long, void const*) (new_allocator.h:92) ==8753== by 0x137D378: std::_Vector_base >::_M_allocate(unsigned long) (in /home/aokromes/bin/bin/worldserver) ==8753== by 0x137CEC6: std::vector >::_M_fill_insert(__gnu_cxx::__normal_iterator > >, unsigned long, Field* const&) (vector.tcc:416) ==8753== by 0x137CB27: std::vector >::insert(__gnu_cxx::__normal_iterator > >, unsigned long, Field* const&) (stl_vector.h:944) ==8753== by 0x137C964: std::vector >::resize(unsigned long, Field*) (stl_vector.h:632) ==8753== by 0x137BFCA: PreparedResultSet::PreparedResultSet(st_mysql_stmt*, st_mysql_res*, unsigned long, unsigned int) (QueryResult.cpp:98) ==8753== by 0x137A12B: MySQLConnection::Query(PreparedStatement*) (MySQLConnection.cpp:493) ==8753== by 0x137F663: PreparedStatementTask::Execute() (PreparedStatement.cpp:412) Have a feeling this is a false positive, though. Nevertheless good to get rid of. --- src/server/shared/Database/QueryResult.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/shared/Database/QueryResult.h b/src/server/shared/Database/QueryResult.h index 2c09cb19c81..e32b16555bc 100755 --- a/src/server/shared/Database/QueryResult.h +++ b/src/server/shared/Database/QueryResult.h @@ -58,7 +58,7 @@ class ResultSet MYSQL_FIELD* _fields; }; -typedef Trinity::AutoPtr QueryResult; +typedef Trinity::AutoPtr QueryResult; class PreparedResultSet { @@ -103,7 +103,7 @@ class PreparedResultSet }; -typedef Trinity::AutoPtr PreparedQueryResult; +typedef Trinity::AutoPtr PreparedQueryResult; #endif From 79a782f1439c662f566454276687819f3d0e0711 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Tue, 27 Mar 2012 12:27:22 +0200 Subject: [PATCH 0313/1149] Core/Misc: Make World::m_stopEvent thread-safe. Note that the 'virtual' keyword in C/C++ is pretty useless for multithreading --- src/server/game/World/World.cpp | 8 ++++---- src/server/game/World/World.h | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 99a04ddfd7e..cb365eefbd6 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -78,7 +78,7 @@ #include "Warden.h" #include "CalendarMgr.h" -volatile bool World::m_stopEvent = false; +ACE_Atomic_Op World::m_stopEvent = false; uint8 World::m_ExitCode = SHUTDOWN_EXIT_CODE; volatile uint32 World::m_worldLoopCounter = 0; @@ -2470,7 +2470,7 @@ void World::_UpdateGameTime() m_gameTime = thisTime; ///- if there is a shutdown timer - if (!m_stopEvent && m_ShutdownTimer > 0 && elapsed > 0) + if (!IsStopped() && m_ShutdownTimer > 0 && elapsed > 0) { ///- ... and it is overdue, stop the world (set m_stopEvent) if (m_ShutdownTimer <= elapsed) @@ -2494,7 +2494,7 @@ void World::_UpdateGameTime() void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode) { // ignore if server shutdown at next tick - if (m_stopEvent) + if (IsStopped()) return; m_ShutdownMask = options; @@ -2546,7 +2546,7 @@ void World::ShutdownMsg(bool show, Player* player) void World::ShutdownCancel() { // nothing cancel or too later - if (!m_ShutdownTimer || m_stopEvent) + if (!m_ShutdownTimer || m_stopEvent.value()) return; ServerMessageType msgid = (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_CANCELLED : SERVER_MSG_SHUTDOWN_CANCELLED; diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index cab9c19da8b..1247504678a 100755 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -26,6 +26,7 @@ #include "Common.h" #include "Timer.h" #include +#include #include "SharedDefines.h" #include "QueryResult.h" #include "Callback.h" @@ -650,7 +651,7 @@ class World void ShutdownMsg(bool show = false, Player* player = NULL); static uint8 GetExitCode() { return m_ExitCode; } static void StopNow(uint8 exitcode) { m_stopEvent = true; m_ExitCode = exitcode; } - static bool IsStopped() { return m_stopEvent; } + static bool IsStopped() { return m_stopEvent.value(); } void Update(uint32 diff); @@ -770,7 +771,7 @@ class World void ResetWeeklyQuests(); void ResetRandomBG(); private: - static volatile bool m_stopEvent; + static ACE_Atomic_Op m_stopEvent; static uint8 m_ExitCode; uint32 m_ShutdownTimer; uint32 m_ShutdownMask; From 0550f1dc05ab7b00b74e9b7730f60a64bcf17174 Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 27 Mar 2012 08:42:54 -0400 Subject: [PATCH 0314/1149] Core/Spells: fix the issue with dispel auras. (thx warpten) closes #5902 --- src/server/game/Spells/Spell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 2032c883256..a9e1b964b1c 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4984,7 +4984,7 @@ SpellCastResult Spell::CheckCast(bool strict) break; } - if (!hasNonDispelEffect && !hasDispellableAura && m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL)) + if (!hasNonDispelEffect && !hasDispellableAura && m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL) && m_spellInfo->CalcPowerCost(m_caster, SPELL_SCHOOL_MASK_NONE)) return SPELL_FAILED_NOTHING_TO_DISPEL; for (int i = 0; i < MAX_SPELL_EFFECTS; i++) From e40eb4bfbcbbd62aca97a9aaa9c203500582dca7 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 27 Mar 2012 15:47:40 +0100 Subject: [PATCH 0315/1149] Core/DBLayer: Correct few more wrong read types (No. 2) DB/World: Some consistency in the ints "length" field (not really a length) From A to G world tables verified; missing all the others --- .../world/2012_03_27_01_world_misc.sql | 15 ++++++ src/server/game/Events/GameEventMgr.cpp | 49 ++++++++++--------- src/server/game/Globals/ObjectMgr.cpp | 30 +++++++----- src/server/game/Weather/WeatherMgr.cpp | 6 +-- 4 files changed, 60 insertions(+), 40 deletions(-) create mode 100644 sql/updates/world/2012_03_27_01_world_misc.sql diff --git a/sql/updates/world/2012_03_27_01_world_misc.sql b/sql/updates/world/2012_03_27_01_world_misc.sql new file mode 100644 index 00000000000..38c11c8ae65 --- /dev/null +++ b/sql/updates/world/2012_03_27_01_world_misc.sql @@ -0,0 +1,15 @@ +ALTER TABLE `exploration_basexp` CHANGE `level` `level` tinyint(3) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `exploration_basexp` CHANGE `basexp` `basexp` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `fishing_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `game_event_creature` CHANGE `eventEntry` `eventEntry` tinyint(4) NOT NULL COMMENT 'Entry of the game event. Put negative entry to remove during event.'; +ALTER TABLE `game_event_gameobject` CHANGE `eventEntry` `eventEntry` tinyint(4) NOT NULL COMMENT 'Entry of the game event. Put negative entry to remove during event.'; +ALTER TABLE `game_event_model_equip` CHANGE `eventEntry` `eventEntry` tinyint(4) NOT NULL COMMENT 'Entry of the game event.'; +ALTER TABLE `game_event_npc_vendor` CHANGE `eventEntry` `eventEntry` tinyint(4) NOT NULL COMMENT 'Entry of the game event.'; +ALTER TABLE `game_event_pool` CHANGE `eventEntry` `eventEntry` tinyint(4) NOT NULL COMMENT 'Entry of the game event. Put negative entry to remove during event.'; +ALTER TABLE `gameobject_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `gameobject_template` CHANGE `WDBVerified` `WDBVerified` smallint(6) NULL DEFAULT '1'; +ALTER TABLE `gossip_menu` CHANGE `entry` `entry` smallint(5) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `gossip_menu_option` CHANGE `menu_id` `menu_id` smallint(5) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `gossip_menu_option` CHANGE `id` `id` smallint(5) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `gossip_menu_option` CHANGE `box_money` `box_money` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `gossip_menu_option` CHANGE `action_menu_id` `action_menu_id` int(10) unsigned NOT NULL DEFAULT '0'; diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 808da1ac791..7224007fb2c 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -220,7 +220,7 @@ void GameEventMgr::LoadFromDB() { Field* fields = result->Fetch(); - uint16 event_id = fields[0].GetUInt16(); + uint16 event_id = fields[0].GetUInt8(); if (event_id == 0) { sLog->outErrorDb("`game_event` game event entry 0 is reserved and can't be used."); @@ -232,8 +232,8 @@ void GameEventMgr::LoadFromDB() pGameEvent.start = time_t(starttime); uint64 endtime = fields[2].GetUInt64(); pGameEvent.end = time_t(endtime); - pGameEvent.occurence = fields[3].GetUInt32(); - pGameEvent.length = fields[4].GetUInt32(); + pGameEvent.occurence = fields[3].GetUInt64(); + pGameEvent.length = fields[4].GetUInt64(); pGameEvent.holiday_id = HolidayIds(fields[5].GetUInt32()); pGameEvent.state = (GameEventState)(fields[7].GetUInt8()); @@ -315,6 +315,7 @@ void GameEventMgr::LoadFromDB() { uint32 oldMSTime = getMSTime(); + // 0 1 QueryResult result = WorldDatabase.Query("SELECT eventEntry, prerequisite_event FROM game_event_prerequisite"); if (!result) { @@ -328,7 +329,7 @@ void GameEventMgr::LoadFromDB() { Field* fields = result->Fetch(); - uint16 event_id = fields[0].GetUInt16(); + uint16 event_id = fields[0].GetUInt8(); if (event_id >= mGameEvent.size()) { @@ -338,7 +339,7 @@ void GameEventMgr::LoadFromDB() if (mGameEvent[event_id].state != GAMEEVENT_NORMAL && mGameEvent[event_id].state != GAMEEVENT_INTERNAL) { - uint16 prerequisite_event = fields[1].GetUInt16(); + uint16 prerequisite_event = fields[1].GetUInt32(); if (prerequisite_event >= mGameEvent.size()) { sLog->outErrorDb("`game_event_prerequisite` game event prerequisite id (%i) is out of range compared to max event id in `game_event`", prerequisite_event); @@ -382,7 +383,7 @@ void GameEventMgr::LoadFromDB() Field* fields = result->Fetch(); uint32 guid = fields[0].GetUInt32(); - int16 event_id = fields[1].GetInt16(); + int16 event_id = fields[1].GetInt8(); int32 internal_event_id = mGameEvent.size() + event_id - 1; @@ -408,7 +409,7 @@ void GameEventMgr::LoadFromDB() { uint32 oldMSTime = getMSTime(); - // 1 2 + // 0 1 QueryResult result = WorldDatabase.Query("SELECT gameobject.guid, game_event_gameobject.eventEntry FROM gameobject" " JOIN game_event_gameobject ON gameobject.guid=game_event_gameobject.guid"); @@ -425,7 +426,7 @@ void GameEventMgr::LoadFromDB() Field* fields = result->Fetch(); uint32 guid = fields[0].GetUInt32(); - int16 event_id = fields[1].GetInt16(); + int16 event_id = fields[1].GetInt8(); int32 internal_event_id = mGameEvent.size() + event_id - 1; @@ -525,7 +526,7 @@ void GameEventMgr::LoadFromDB() uint32 id = fields[0].GetUInt32(); uint32 quest = fields[1].GetUInt32(); - uint16 event_id = fields[2].GetUInt16(); + uint16 event_id = fields[2].GetUInt8(); if (event_id >= mGameEventCreatureQuests.size()) { @@ -566,7 +567,7 @@ void GameEventMgr::LoadFromDB() uint32 id = fields[0].GetUInt32(); uint32 quest = fields[1].GetUInt32(); - uint16 event_id = fields[2].GetUInt16(); + uint16 event_id = fields[2].GetUInt8(); if (event_id >= mGameEventGameObjectQuests.size()) { @@ -590,7 +591,7 @@ void GameEventMgr::LoadFromDB() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 + // 0 1 2 3 QueryResult result = WorldDatabase.Query("SELECT quest, eventEntry, condition_id, num FROM game_event_quest_condition"); if (!result) @@ -606,7 +607,7 @@ void GameEventMgr::LoadFromDB() Field* fields = result->Fetch(); uint32 quest = fields[0].GetUInt32(); - uint16 event_id = fields[1].GetUInt16(); + uint16 event_id = fields[1].GetUInt8(); uint32 condition = fields[2].GetUInt32(); float num = fields[3].GetFloat(); @@ -648,7 +649,7 @@ void GameEventMgr::LoadFromDB() { Field* fields = result->Fetch(); - uint16 event_id = fields[0].GetUInt16(); + uint16 event_id = fields[0].GetUInt8(); uint32 condition = fields[1].GetUInt32(); if (event_id >= mGameEvent.size()) @@ -659,8 +660,8 @@ void GameEventMgr::LoadFromDB() mGameEvent[event_id].conditions[condition].reqNum = fields[2].GetFloat(); mGameEvent[event_id].conditions[condition].done = 0; - mGameEvent[event_id].conditions[condition].max_world_state = fields[3].GetUInt32(); - mGameEvent[event_id].conditions[condition].done_world_state = fields[4].GetUInt32(); + mGameEvent[event_id].conditions[condition].max_world_state = fields[3].GetUInt16(); + mGameEvent[event_id].conditions[condition].done_world_state = fields[4].GetUInt16(); ++count; } @@ -739,7 +740,7 @@ void GameEventMgr::LoadFromDB() Field* fields = result->Fetch(); uint32 guid = fields[0].GetUInt32(); - uint16 event_id = fields[1].GetUInt16(); + uint16 event_id = fields[1].GetUInt8(); uint32 npcflag = fields[2].GetUInt32(); if (event_id >= mGameEvent.size()) @@ -763,7 +764,7 @@ void GameEventMgr::LoadFromDB() { uint32 oldMSTime = getMSTime(); - // 0 1 + // 0 1 QueryResult result = WorldDatabase.Query("SELECT questId, eventEntry FROM game_event_seasonal_questrelation"); if (!result) @@ -779,7 +780,7 @@ void GameEventMgr::LoadFromDB() Field* fields = result->Fetch(); uint32 questId = fields[0].GetUInt32(); - uint16 eventEntry = fields[1].GetUInt16(); + uint32 eventEntry = fields[1].GetUInt32(); // TODO: Change to uint8 if (!sObjectMgr->GetQuestTemplate(questId)) { @@ -822,7 +823,7 @@ void GameEventMgr::LoadFromDB() { Field* fields = result->Fetch(); - uint16 event_id = fields[0].GetUInt16(); + int8 event_id = fields[0].GetInt8(); if (event_id >= mGameEventVendors.size()) { @@ -834,7 +835,7 @@ void GameEventMgr::LoadFromDB() NPCVendorEntry newEntry; uint32 guid = fields[1].GetUInt32(); newEntry.item = fields[2].GetUInt32(); - newEntry.maxcount = fields[3].GetInt32(); + newEntry.maxcount = fields[3].GetUInt32(); newEntry.incrtime = fields[4].GetUInt32(); newEntry.ExtendedCost = fields[5].GetUInt32(); // get the event npc flag for checking if the npc will be vendor during the event or not @@ -888,7 +889,7 @@ void GameEventMgr::LoadFromDB() { Field* fields = result->Fetch(); - uint16 event_id = fields[0].GetUInt16(); + uint16 event_id = fields[0].GetUInt8(); if (event_id >= mGameEvent.size()) { @@ -911,7 +912,7 @@ void GameEventMgr::LoadFromDB() { uint32 oldMSTime = getMSTime(); - // 1 2 + // 0 1 QueryResult result = WorldDatabase.Query("SELECT pool_template.entry, game_event_pool.eventEntry FROM pool_template" " JOIN game_event_pool ON pool_template.entry = game_event_pool.pool_entry"); @@ -928,7 +929,7 @@ void GameEventMgr::LoadFromDB() Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); - int16 event_id = fields[1].GetInt16(); + int16 event_id = fields[1].GetInt8(); int32 internal_event_id = mGameEvent.size() + event_id - 1; @@ -1019,7 +1020,7 @@ void GameEventMgr::StartArenaSeason() } Field* fields = result->Fetch(); - uint16 eventId = fields[0].GetUInt16(); + uint16 eventId = fields[0].GetUInt8(); if (eventId >= mGameEvent.size()) { diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index f66ca460c0a..61c47779c85 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1767,7 +1767,7 @@ void ObjectMgr::LoadGameobjects() GameObjectData& data = _gameObjectDataStore[guid]; data.id = entry; - data.mapid = fields[2].GetUInt32(); + data.mapid = fields[2].GetUInt16(); data.posX = fields[3].GetFloat(); data.posY = fields[4].GetFloat(); data.posZ = fields[5].GetFloat(); @@ -1790,10 +1790,10 @@ void ObjectMgr::LoadGameobjects() sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with `spawntimesecs` (0) value, but the gameobejct is marked as despawnable at action.", guid, data.id); } - data.animprogress = fields[12].GetUInt32(); + data.animprogress = fields[12].GetUInt8(); data.artKit = 0; - uint32 go_state = fields[13].GetUInt32(); + uint32 go_state = fields[13].GetUInt8(); if (go_state >= MAX_GO_STATE) { sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid `state` (%u) value, skip", guid, data.id, go_state); @@ -1807,7 +1807,7 @@ void ObjectMgr::LoadGameobjects() sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) that has wrong spawn mask %u including not supported difficulty modes for map (Id: %u), skip", guid, data.id, data.spawnMask, data.mapid); data.phaseMask = fields[15].GetUInt16(); - int16 gameEvent = fields[16].GetInt16(); + int16 gameEvent = fields[16].GetInt8(); uint32 PoolId = fields[17].GetUInt32(); if (data.rotation2 < -1.0f || data.rotation2 > 1.0f) @@ -5661,6 +5661,7 @@ void ObjectMgr::LoadGraveyardZones() GraveYardStore.clear(); // need for reload case + // 0 1 2 QueryResult result = WorldDatabase.Query("SELECT id, ghost_zone, faction FROM game_graveyard_zone"); if (!result) @@ -5680,7 +5681,7 @@ void ObjectMgr::LoadGraveyardZones() uint32 safeLocId = fields[0].GetUInt32(); uint32 zoneId = fields[1].GetUInt32(); - uint32 team = fields[2].GetUInt32(); + uint32 team = fields[2].GetUInt16(); WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(safeLocId); if (!entry) @@ -6449,7 +6450,7 @@ void ObjectMgr::LoadGameObjectTemplate() got.questItems[i] = fields[10 + i].GetUInt32(); for (uint8 i = 0; i < MAX_GAMEOBJECT_DATA; ++i) - got.raw.data[i] = fields[16 + i].GetUInt32(); + got.raw.data[i] = fields[16 + i].GetInt32(); // data1 and data6 can be -1 got.AIName = fields[40].GetString(); got.ScriptId = GetScriptId(fields[41].GetCString()); @@ -6612,7 +6613,7 @@ void ObjectMgr::LoadExplorationBaseXP() { Field* fields = result->Fetch(); uint8 level = fields[0].GetUInt8(); - uint32 basexp = fields[1].GetUInt32(); + uint32 basexp = fields[1].GetInt32(); _baseXPTable[level] = basexp; ++count; } @@ -7897,6 +7898,7 @@ void ObjectMgr::LoadGameTele() _gameTeleStore.clear(); // for reload case + // 0 1 2 3 4 5 6 QueryResult result = WorldDatabase.Query("SELECT id, position_x, position_y, position_z, orientation, map, name FROM game_tele"); if (!result) @@ -7920,7 +7922,7 @@ void ObjectMgr::LoadGameTele() gt.position_y = fields[2].GetFloat(); gt.position_z = fields[3].GetFloat(); gt.orientation = fields[4].GetFloat(); - gt.mapId = fields[5].GetUInt32(); + gt.mapId = fields[5].GetUInt16(); gt.name = fields[6].GetString(); if (!MapManager::IsValidMapCoord(gt.mapId, gt.position_x, gt.position_y, gt.position_z, gt.orientation)) @@ -8326,7 +8328,7 @@ void ObjectMgr::LoadGossipMenu() GossipMenus gMenu; - gMenu.entry = fields[0].GetUInt32(); + gMenu.entry = fields[0].GetUInt16(); gMenu.text_id = fields[1].GetUInt32(); if (!GetGossipText(gMenu.text_id)) @@ -8352,7 +8354,9 @@ void ObjectMgr::LoadGossipMenuItems() _gossipMenuItemsStore.clear(); QueryResult result = WorldDatabase.Query( + // 0 1 2 3 4 "SELECT menu_id, id, option_icon, option_text, option_id, npc_option_npcflag, " + // 5 6 7 8 9 "action_menu_id, action_poi_id, box_coded, box_money, box_text " "FROM gossip_menu_option ORDER BY menu_id, id"); @@ -8371,11 +8375,11 @@ void ObjectMgr::LoadGossipMenuItems() GossipMenuItems gMenuItem; - gMenuItem.MenuId = fields[0].GetUInt32(); - gMenuItem.OptionIndex = fields[1].GetUInt32(); - gMenuItem.OptionIcon = fields[2].GetUInt8(); + gMenuItem.MenuId = fields[0].GetUInt16(); + gMenuItem.OptionIndex = fields[1].GetUInt16(); + gMenuItem.OptionIcon = fields[2].GetUInt32(); gMenuItem.OptionText = fields[3].GetString(); - gMenuItem.OptionType = fields[4].GetUInt32(); + gMenuItem.OptionType = fields[4].GetUInt8(); gMenuItem.OptionNpcflag = fields[5].GetUInt32(); gMenuItem.ActionMenuId = fields[6].GetUInt32(); gMenuItem.ActionPoiId = fields[7].GetUInt32(); diff --git a/src/server/game/Weather/WeatherMgr.cpp b/src/server/game/Weather/WeatherMgr.cpp index 41241583ea1..bb8fadf08bc 100755 --- a/src/server/game/Weather/WeatherMgr.cpp +++ b/src/server/game/Weather/WeatherMgr.cpp @@ -108,9 +108,9 @@ void LoadWeatherData() for (uint8 season = 0; season < WEATHER_SEASONS; ++season) { - wzc.data[season].rainChance = fields[season * (MAX_WEATHER_TYPE-1) + 1].GetUInt32(); - wzc.data[season].snowChance = fields[season * (MAX_WEATHER_TYPE-1) + 2].GetUInt32(); - wzc.data[season].stormChance = fields[season * (MAX_WEATHER_TYPE-1) + 3].GetUInt32(); + wzc.data[season].rainChance = fields[season * (MAX_WEATHER_TYPE-1) + 1].GetUInt8(); + wzc.data[season].snowChance = fields[season * (MAX_WEATHER_TYPE-1) + 2].GetUInt8(); + wzc.data[season].stormChance = fields[season * (MAX_WEATHER_TYPE-1) + 3].GetUInt8(); if (wzc.data[season].rainChance > 100) { From c1ba5c8587dec1205df4ef9aa308f62532dde6af Mon Sep 17 00:00:00 2001 From: Warpten Date: Mon, 26 Mar 2012 22:07:22 +0200 Subject: [PATCH 0316/1149] Arenas/Ring of Valor: fire lines should only be lit when the arena battle begins. --- .../Battlegrounds/Zones/BattlegroundRV.cpp | 46 +++++++++---------- .../game/Battlegrounds/Zones/BattlegroundRV.h | 15 +++--- 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp index 98bb704661e..6869a899305 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp @@ -32,7 +32,7 @@ BattlegroundRV::BattlegroundRV() StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S; StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S; StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE; - //we must set messageIds + // we must set messageIds StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE; StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS; StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS; @@ -46,40 +46,32 @@ BattlegroundRV::~BattlegroundRV() void BattlegroundRV::PostUpdateImpl(uint32 diff) { + if (GetStatus() != STATUS_IN_PROGRESS) + return; + if (getTimer() < diff) { switch (getState()) { case BG_RV_STATE_OPEN_FENCES: - setTimer(BG_RV_PILAR_TO_FIRE_TIMER); + // Open fire (only at game start) + for (uint8 i = BG_RV_OBJECT_FIRE_1; i <= BG_RV_OBJECT_FIREDOOR_2; ++i) + DoorOpen(i); + setTimer(BG_RV_CLOSE_FIRE_TIMER); setState(BG_RV_STATE_CLOSE_FIRE); break; case BG_RV_STATE_CLOSE_FIRE: for (uint8 i = BG_RV_OBJECT_FIRE_1; i <= BG_RV_OBJECT_FIREDOOR_2; ++i) DoorClose(i); - setTimer(BG_RV_FIRE_TO_PILAR_TIMER); - setState(BG_RV_STATE_OPEN_PILARS); + // Fire got closed after five seconds, leaves twenty seconds before toggling pillars + setTimer(BG_RV_FIRE_TO_PILLAR_TIMER); + setState(BG_RV_STATE_SWITCH_PILLARS); break; - case BG_RV_STATE_OPEN_PILARS: + case BG_RV_STATE_SWITCH_PILLARS: for (uint8 i = BG_RV_OBJECT_PILAR_1; i <= BG_RV_OBJECT_PULLEY_2; ++i) DoorOpen(i); - TogglePillarCollision(false); - setTimer(BG_RV_PILAR_TO_FIRE_TIMER); - setState(BG_RV_STATE_OPEN_FIRE); - break; - case BG_RV_STATE_OPEN_FIRE: - // FIXME: after 3.2.0 it's only decorative and should be opened only one time at battle start - for (uint8 i = BG_RV_OBJECT_FIRE_1; i <= BG_RV_OBJECT_FIREDOOR_2; ++i) - DoorOpen(i); - setTimer(BG_RV_FIRE_TO_PILAR_TIMER); - setState(BG_RV_STATE_CLOSE_PILARS); - break; - case BG_RV_STATE_CLOSE_PILARS: - for (uint8 i = BG_RV_OBJECT_PILAR_1; i <= BG_RV_OBJECT_PULLEY_2; ++i) - DoorOpen(i); - TogglePillarCollision(true); - setTimer(BG_RV_PILAR_TO_FIRE_TIMER); - setState(BG_RV_STATE_CLOSE_FIRE); + TogglePillarCollision(); + setTimer(BG_RV_PILLAR_SWITCH_TIMER); break; } } @@ -103,7 +95,9 @@ void BattlegroundRV::StartingEventOpenDoors() setState(BG_RV_STATE_OPEN_FENCES); setTimer(BG_RV_FIRST_TIMER); - TogglePillarCollision(true); + // Should be false at first, TogglePillarCollision will do it. + SetPillarCollision(true); + TogglePillarCollision(); } void BattlegroundRV::AddPlayer(Player* player) @@ -227,8 +221,10 @@ bool BattlegroundRV::SetupBattleground() } -void BattlegroundRV::TogglePillarCollision(bool apply) +void BattlegroundRV::TogglePillarCollision() { + bool apply = GetPillarCollision(); + for (uint8 i = BG_RV_OBJECT_PILAR_1; i <= BG_RV_OBJECT_PILAR_COLLISION_4; ++i) { if (GameObject* gob = GetBgMap()->GetGameObject(BgObjects[i])) @@ -249,4 +245,6 @@ void BattlegroundRV::TogglePillarCollision(bool apply) gob->SendUpdateToPlayer(player); } } + + SetPillarCollision(!apply); } \ No newline at end of file diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.h b/src/server/game/Battlegrounds/Zones/BattlegroundRV.h index 1dfd4825c8f..8c5746931e3 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.h @@ -79,12 +79,12 @@ enum BattlegroundRVObjects enum BattlegroundRVData { BG_RV_STATE_OPEN_FENCES, - BG_RV_STATE_OPEN_PILARS, - BG_RV_STATE_CLOSE_PILARS, - BG_RV_STATE_OPEN_FIRE, + BG_RV_STATE_SWITCH_PILLARS, BG_RV_STATE_CLOSE_FIRE, - BG_RV_FIRE_TO_PILAR_TIMER = 20000, - BG_RV_PILAR_TO_FIRE_TIMER = 5000, + + BG_RV_PILLAR_SWITCH_TIMER = 25000, + BG_RV_FIRE_TO_PILLAR_TIMER = 20000, + BG_RV_CLOSE_FIRE_TIMER = 5000, BG_RV_FIRST_TIMER = 20133, BG_RV_WORLD_STATE_A = 0xe10, BG_RV_WORLD_STATE_H = 0xe11, @@ -120,6 +120,7 @@ class BattlegroundRV : public Battleground private: uint32 Timer; uint32 State; + bool PillarCollision; virtual void PostUpdateImpl(uint32 diff); @@ -129,6 +130,8 @@ class BattlegroundRV : public Battleground uint32 getState() { return State; }; void setState(uint32 state) { State = state; }; - void TogglePillarCollision(bool apply); + void TogglePillarCollision(); + bool GetPillarCollision() { return PillarCollision; } + void SetPillarCollision(bool apply) { PillarCollision = apply; } }; #endif From 38deaa5dba84b98cc0d131efd1c509286f9e2902 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 27 Mar 2012 19:00:41 +0200 Subject: [PATCH 0317/1149] Core/Players: Fixed saving glyphs to database Closes #5909 --- src/server/game/Entities/Player/Player.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index de66362aa27..a7f5c0937a8 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -24951,22 +24951,21 @@ void Player::_SaveGlyphs(SQLTransaction& trans) stmt->setUInt32(0, GetGUIDLow()); trans->Append(stmt); - uint8 index = 0; - - stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_GLYPHS); - stmt->setUInt32(index++, GetGUIDLow()); - for (uint8 spec = 0; spec < m_specsCount; ++spec) { + uint8 index = 0; + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_GLYPHS); + stmt->setUInt32(index++, GetGUIDLow()); + stmt->setUInt8(index++, spec); for (uint8 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i) stmt->setUInt16(index++, uint16(m_Glyphs[spec][i])); + trans->Append(stmt); } - - trans->Append(stmt); } void Player::_LoadTalents(PreparedQueryResult result) From def4643896c06af3b7ea89afe7cac72518166856 Mon Sep 17 00:00:00 2001 From: kandera Date: Tue, 27 Mar 2012 14:46:19 -0300 Subject: [PATCH 0318/1149] Core/Spells: correctly fix the issue with dispel over time auras. thx shauren --- src/server/game/Spells/Spell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index a9e1b964b1c..ee5e4bc0efa 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4984,7 +4984,7 @@ SpellCastResult Spell::CheckCast(bool strict) break; } - if (!hasNonDispelEffect && !hasDispellableAura && m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL) && m_spellInfo->CalcPowerCost(m_caster, SPELL_SCHOOL_MASK_NONE)) + if (!hasNonDispelEffect && !hasDispellableAura && m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL) && !IsTriggered()) return SPELL_FAILED_NOTHING_TO_DISPEL; for (int i = 0; i < MAX_SPELL_EFFECTS; i++) From ead019b0611bd930eaa6bc7078b430bdc4fe8279 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 27 Mar 2012 19:26:58 +0100 Subject: [PATCH 0319/1149] Core/DBLayer: Correct few more wrong read types (No. 3) DB/World: Some consistency in the ints "length" field (not really a length) From A to G world tables verified; missing all the others --- .../world/2012_03_27_02_world_misc.sql | 78 +++++++++++++++++ .../game/Entities/Item/ItemEnchantmentMgr.cpp | 1 + src/server/game/Globals/ObjectMgr.cpp | 86 ++++++++++--------- src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp | 4 +- src/server/game/Pools/PoolMgr.cpp | 2 +- src/server/game/Quests/QuestDef.cpp | 68 +++++++-------- 6 files changed, 160 insertions(+), 79 deletions(-) create mode 100644 sql/updates/world/2012_03_27_02_world_misc.sql diff --git a/sql/updates/world/2012_03_27_02_world_misc.sql b/sql/updates/world/2012_03_27_02_world_misc.sql new file mode 100644 index 00000000000..f83a98b8100 --- /dev/null +++ b/sql/updates/world/2012_03_27_02_world_misc.sql @@ -0,0 +1,78 @@ +ALTER TABLE `instance_template` CHANGE `allowMount` `allowMount` tinyint(3) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `ip2nation` CHANGE `ip` `ip` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `item_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `item_set_names` CHANGE `WDBVerified` `WDBVerified` smallint(6) NOT NULL DEFAULT '1'; +ALTER TABLE `item_template` CHANGE `spellcharges_1` `spellcharges_1` smallint(6) NULL DEFAULT NULL; +ALTER TABLE `item_template` CHANGE `spellcharges_2` `spellcharges_2` smallint(6) NULL DEFAULT NULL; +ALTER TABLE `item_template` CHANGE `spellcharges_3` `spellcharges_3` smallint(6) NULL DEFAULT NULL; +ALTER TABLE `item_template` CHANGE `spellcharges_4` `spellcharges_4` smallint(6) NULL DEFAULT NULL; +ALTER TABLE `item_template` CHANGE `spellcharges_5` `spellcharges_5` smallint(6) NULL DEFAULT NULL; +ALTER TABLE `item_template` CHANGE `BagFamily` `BagFamily` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `item_template` CHANGE `TotemCategory` `TotemCategory` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `item_template` CHANGE `socketContent_1` `socketContent_1` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `item_template` CHANGE `socketContent_2` `socketContent_2` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `item_template` CHANGE `socketContent_3` `socketContent_3` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `item_template` CHANGE `socketBonus` `socketBonus` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `item_template` CHANGE `GemProperties` `GemProperties` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `item_template` CHANGE `WDBVerified` `WDBVerified` smallint(6) NULL DEFAULT '1'; +ALTER TABLE `item_template` CHANGE `ScalingStatValue` `ScalingStatValue` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `mail_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `milling_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `npc_spellclick_spells` CHANGE `user_type` `user_type` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'relation with summoner: 0-no 1-friendly 2-raid 3-party player can click'; +ALTER TABLE `outdoorpvp_template` CHANGE `TypeId` `TypeId` tinyint(3) unsigned NOT NULL; +ALTER TABLE `page_text` CHANGE `WDBVerified` `WDBVerified` smallint(6) NULL DEFAULT '1'; +ALTER TABLE `pet_name_generation` CHANGE `half` `half` tinyint(3) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `pickpocketing_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `player_factionchange_achievement` CHANGE `alliance_id` `alliance_id` int(10) unsigned NOT NULL; -- also changed to unsigned +ALTER TABLE `player_factionchange_achievement` CHANGE `horde_id` `horde_id` int(10) unsigned NOT NULL; -- also changed to unsigned +ALTER TABLE `player_factionchange_items` CHANGE `race_A` `race_A` int(10) unsigned NOT NULL; -- also changed to unsigned +ALTER TABLE `player_factionchange_items` CHANGE `alliance_id` `alliance_id` int(10) unsigned NOT NULL; -- also changed to unsigned +ALTER TABLE `player_factionchange_items` CHANGE `race_H` `race_H` int(10) unsigned NOT NULL; -- also changed to unsigned +ALTER TABLE `player_factionchange_items` CHANGE `horde_id` `horde_id` int(10) unsigned NOT NULL; -- also changed to unsigned +ALTER TABLE `player_factionchange_reputations` CHANGE `alliance_id` `alliance_id` int(10) unsigned NOT NULL; -- also changed to unsigned +ALTER TABLE `player_factionchange_reputations` CHANGE `horde_id` `horde_id` int(10) unsigned NOT NULL; -- also changed to unsigned +ALTER TABLE `player_factionchange_spells` CHANGE `alliance_id` `alliance_id` int(10) unsigned NOT NULL; -- also changed to unsigned +ALTER TABLE `player_factionchange_spells` CHANGE `horde_id` `horde_id` int(10) unsigned NOT NULL; -- also changed to unsigned +ALTER TABLE `player_xp_for_level` CHANGE `lvl` `lvl` tinyint(3) unsigned NOT NULL; -- also changed from int to tinyint +ALTER TABLE `playercreateinfo_action` CHANGE `action` `action` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `playercreateinfo_item` CHANGE `amount` `amount` tinyint(4) NOT NULL DEFAULT '1'; +ALTER TABLE `playercreateinfo_spell_custom` DROP `Active`; -- delete field, it's not used anywhere +ALTER TABLE `prospecting_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `quest_poi` CHANGE `objIndex` `objIndex` int(11) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_poi_points` CHANGE `x` `x` int(11) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_poi_points` CHANGE `y` `y` int(11) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RequiredFactionValue1` `RequiredFactionValue1` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RequiredFactionValue2` `RequiredFactionValue2` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RequiredMinRepValue` `RequiredMinRepValue` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RequiredMinRepValue` `RequiredMinRepValue` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RequiredMaxRepValue` `RequiredMaxRepValue` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `PrevQuestId` `PrevQuestId` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `NextQuestId` `NextQuestId` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `ExclusiveGroup` `ExclusiveGroup` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardSpellCast` `RewardSpellCast` int(11) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardHonor` `RewardHonor` int(11) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardXPId` `RewardXPId` tinyint(3) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardFactionValueId1` `RewardFactionValueId1` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardFactionValueId2` `RewardFactionValueId2` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardFactionValueId3` `RewardFactionValueId3` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardFactionValueId4` `RewardFactionValueId4` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardFactionValueId5` `RewardFactionValueId5` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardFactionValueIdOverride1` `RewardFactionValueIdOverride1` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardFactionValueIdOverride2` `RewardFactionValueIdOverride2` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardFactionValueIdOverride3` `RewardFactionValueIdOverride3` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardFactionValueIdOverride4` `RewardFactionValueIdOverride4` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardFactionValueIdOverride5` `RewardFactionValueIdOverride5` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RequiredNpcOrGo1` `RequiredNpcOrGo1` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RequiredNpcOrGo2` `RequiredNpcOrGo2` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RequiredNpcOrGo3` `RequiredNpcOrGo3` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RequiredNpcOrGo4` `RequiredNpcOrGo4` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `Unknown0` `Unknown0` tinyint(3) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `DetailsEmoteDelay1` `DetailsEmoteDelay1` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `DetailsEmoteDelay2` `DetailsEmoteDelay2` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `DetailsEmoteDelay3` `DetailsEmoteDelay3` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `DetailsEmoteDelay4` `DetailsEmoteDelay4` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `OfferRewardEmoteDelay1` `OfferRewardEmoteDelay1` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `OfferRewardEmoteDelay2` `OfferRewardEmoteDelay2` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `OfferRewardEmoteDelay3` `OfferRewardEmoteDelay3` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `OfferRewardEmoteDelay4` `OfferRewardEmoteDelay4` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `WDBVerified` `WDBVerified` smallint(6) NOT NULL DEFAULT '1'; diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp index b8eaf043b1f..0236e9450f5 100755 --- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp +++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp @@ -49,6 +49,7 @@ void LoadRandomEnchantmentsTable() RandomItemEnch.clear(); // for reload case + // 0 1 2 QueryResult result = WorldDatabase.Query("SELECT entry, ench, chance FROM item_enchantment_template"); if (result) diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 61c47779c85..63a02378787 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1171,6 +1171,7 @@ void ObjectMgr::LoadLinkedRespawn() uint32 oldMSTime = getMSTime(); _linkedRespawnStore.clear(); + // 0 1 2 QueryResult result = WorldDatabase.Query("SELECT guid, linkedGuid, linkType FROM linked_respawn ORDER BY guid ASC"); if (!result) @@ -2730,7 +2731,8 @@ void ObjectMgr::LoadItemSetNames() if (setEntry->itemId[i]) itemSetItems.insert(setEntry->itemId[i]); } - + + // 0 1 2 QueryResult result = WorldDatabase.Query("SELECT `entry`, `name`, `InventoryType` FROM `item_set_names`"); if (!result) @@ -2757,7 +2759,7 @@ void ObjectMgr::LoadItemSetNames() ItemSetNameEntry &data = _itemSetNameStore[entry]; data.name = fields[1].GetString(); - uint32 invType = fields[2].GetUInt32(); + uint32 invType = fields[2].GetUInt8(); if (invType >= MAX_INVTYPE) { sLog->outErrorDb("Item set name (Entry: %u) has wrong InventoryType value (%u)", entry, invType); @@ -2899,7 +2901,7 @@ void ObjectMgr::LoadPetLevelInfo() uint32 oldMSTime = getMSTime(); // 0 1 2 3 4 5 6 7 8 9 - QueryResult result = WorldDatabase.Query("SELECT creature_entry, level, hp, mana, str, agi, sta, inte, spi, armor FROM pet_levelstats"); + QueryResult result = WorldDatabase.Query("SELECT creature_entry, level, hp, mana, str, agi, sta, inte, spi, armor FROM pet_levelstats"); if (!result) { @@ -2921,7 +2923,7 @@ void ObjectMgr::LoadPetLevelInfo() continue; } - uint32 current_level = fields[1].GetUInt32(); + uint32 current_level = fields[1].GetUInt8(); if (current_level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum @@ -2949,7 +2951,7 @@ void ObjectMgr::LoadPetLevelInfo() pLevelInfo->health = fields[2].GetUInt16(); pLevelInfo->mana = fields[3].GetUInt16(); - pLevelInfo->armor = fields[9].GetUInt16(); + pLevelInfo->armor = fields[9].GetUInt32(); for (int i = 0; i < MAX_STATS; i++) { @@ -3045,7 +3047,7 @@ void ObjectMgr::LoadPlayerInfo() // Load playercreate { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 6 + // 0 1 2 3 4 5 6 QueryResult result = WorldDatabase.Query("SELECT race, class, map, zone, position_x, position_y, position_z, orientation FROM playercreateinfo"); if (!result) @@ -3062,10 +3064,10 @@ void ObjectMgr::LoadPlayerInfo() { Field* fields = result->Fetch(); - uint32 current_race = fields[0].GetUInt32(); - uint32 current_class = fields[1].GetUInt32(); - uint32 mapId = fields[2].GetUInt32(); - uint32 areaId = fields[3].GetUInt32(); + uint32 current_race = fields[0].GetUInt8(); + uint32 current_class = fields[1].GetUInt8(); + uint32 mapId = fields[2].GetUInt16(); + uint32 areaId = fields[3].GetUInt32(); // zone float positionX = fields[4].GetFloat(); float positionY = fields[5].GetFloat(); float positionZ = fields[6].GetFloat(); @@ -3150,14 +3152,14 @@ void ObjectMgr::LoadPlayerInfo() { Field* fields = result->Fetch(); - uint32 current_race = fields[0].GetUInt32(); + uint32 current_race = fields[0].GetUInt8(); if (current_race >= MAX_RACES) { sLog->outErrorDb("Wrong race %u in `playercreateinfo_item` table, ignoring.", current_race); continue; } - uint32 current_class = fields[1].GetUInt32(); + uint32 current_class = fields[1].GetUInt8(); if (current_class >= MAX_CLASSES) { sLog->outErrorDb("Wrong class %u in `playercreateinfo_item` table, ignoring.", current_class); @@ -3172,7 +3174,7 @@ void ObjectMgr::LoadPlayerInfo() continue; } - int32 amount = fields[3].GetInt32(); + int32 amount = fields[3].GetInt8(); if (!amount) { @@ -3207,11 +3209,8 @@ void ObjectMgr::LoadPlayerInfo() { uint32 oldMSTime = getMSTime(); - QueryResult result = QueryResult(NULL); - if (sWorld->getBoolConfig(CONFIG_START_ALL_SPELLS)) - result = WorldDatabase.Query("SELECT race, class, Spell, Active FROM playercreateinfo_spell_custom"); - else - result = WorldDatabase.Query("SELECT race, class, Spell FROM playercreateinfo_spell"); + std::string tableName = sWorld->getBoolConfig(CONFIG_START_ALL_SPELLS) ? "playercreateinfo_spell_custom" : "playercreateinfo_spell"; + QueryResult result = WorldDatabase.PQuery("SELECT race, class, Spell FROM %s", tableName); if (!result) { @@ -3226,14 +3225,14 @@ void ObjectMgr::LoadPlayerInfo() { Field* fields = result->Fetch(); - uint32 current_race = fields[0].GetUInt32(); + uint32 current_race = fields[0].GetUInt8(); if (current_race >= MAX_RACES) { sLog->outErrorDb("Wrong race %u in `playercreateinfo_spell` table, ignoring.", current_race); continue; } - uint32 current_class = fields[1].GetUInt32(); + uint32 current_class = fields[1].GetUInt8(); if (current_class >= MAX_CLASSES) { sLog->outErrorDb("Wrong class %u in `playercreateinfo_spell` table, ignoring.", current_class); @@ -3283,14 +3282,14 @@ void ObjectMgr::LoadPlayerInfo() { Field* fields = result->Fetch(); - uint32 current_race = fields[0].GetUInt32(); + uint32 current_race = fields[0].GetUInt8(); if (current_race >= MAX_RACES) { sLog->outErrorDb("Wrong race %u in `playercreateinfo_action` table, ignoring.", current_race); continue; } - uint32 current_class = fields[1].GetUInt32(); + uint32 current_class = fields[1].GetUInt8(); if (current_class >= MAX_CLASSES) { sLog->outErrorDb("Wrong class %u in `playercreateinfo_action` table, ignoring.", current_class); @@ -3298,7 +3297,7 @@ void ObjectMgr::LoadPlayerInfo() } PlayerInfo* pInfo = &_playerInfo[current_race][current_class]; - pInfo->action.push_back(PlayerCreateInfoAction(fields[2].GetUInt8(), fields[3].GetUInt32(), fields[4].GetUInt8())); + pInfo->action.push_back(PlayerCreateInfoAction(fields[2].GetUInt16(), fields[3].GetUInt32(), fields[4].GetUInt16())); ++count; } @@ -3330,7 +3329,7 @@ void ObjectMgr::LoadPlayerInfo() { Field* fields = result->Fetch(); - uint32 current_class = fields[0].GetUInt32(); + uint32 current_class = fields[0].GetUInt8(); if (current_class >= MAX_CLASSES) { sLog->outErrorDb("Wrong class %u in `player_classlevelstats` table, ignoring.", current_class); @@ -3411,21 +3410,21 @@ void ObjectMgr::LoadPlayerInfo() { Field* fields = result->Fetch(); - uint32 current_race = fields[0].GetUInt32(); + uint32 current_race = fields[0].GetUInt8(); if (current_race >= MAX_RACES) { sLog->outErrorDb("Wrong race %u in `player_levelstats` table, ignoring.", current_race); continue; } - uint32 current_class = fields[1].GetUInt32(); + uint32 current_class = fields[1].GetUInt8(); if (current_class >= MAX_CLASSES) { sLog->outErrorDb("Wrong class %u in `player_levelstats` table, ignoring.", current_class); continue; } - uint32 current_level = fields[2].GetUInt32(); + uint32 current_level = fields[2].GetUInt8(); if (current_level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum @@ -3529,7 +3528,7 @@ void ObjectMgr::LoadPlayerInfo() { Field* fields = result->Fetch(); - uint32 current_level = fields[0].GetUInt32(); + uint32 current_level = fields[0].GetUInt8(); uint32 current_xp = fields[1].GetUInt32(); if (current_level >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) @@ -4419,9 +4418,8 @@ void ObjectMgr::LoadScripts(ScriptsType type) scripts->clear(); // need for reload support bool isSpellScriptTable = (type == SCRIPTS_SPELL); - char buff[125]; - sprintf(buff, "SELECT id, delay, command, datalong, datalong2, dataint, x, y, z, o%s FROM %s", isSpellScriptTable ? ", effIndex" : "", tableName.c_str()); - QueryResult result = WorldDatabase.Query(buff); + // 0 1 2 3 4 5 6 7 8 9 + QueryResult result = WorldDatabase.PQuery("SELECT id, delay, command, datalong, datalong2, dataint, x, y, z, o%s FROM %s", isSpellScriptTable ? ", effIndex" : "", tableName.c_str()); if (!result) { @@ -4976,6 +4974,7 @@ void ObjectMgr::LoadPageTexts() { uint32 oldMSTime = getMSTime(); + // 0 1 2 QueryResult result = WorldDatabase.Query("SELECT entry, text, next_page FROM page_text"); if (!result) @@ -4993,7 +4992,7 @@ void ObjectMgr::LoadPageTexts() PageText& pageText = _pageTextStore[fields[0].GetUInt32()]; pageText.Text = fields[1].GetString(); - pageText.NextPage = fields[2].GetInt16(); + pageText.NextPage = fields[2].GetUInt32(); ++count; } @@ -5054,6 +5053,7 @@ void ObjectMgr::LoadInstanceTemplate() { uint32 oldMSTime = getMSTime(); + // 0 1 2 4 QueryResult result = WorldDatabase.Query("SELECT map, parent, script, allowMount FROM instance_template"); if (!result) @@ -5105,6 +5105,7 @@ void ObjectMgr::LoadInstanceEncounters() { uint32 oldMSTime = getMSTime(); + // 0 1 2 3 QueryResult result = WorldDatabase.Query("SELECT entry, creditType, creditEntry, lastEncounterDungeon FROM instance_encounters"); if (!result) { @@ -5121,7 +5122,7 @@ void ObjectMgr::LoadInstanceEncounters() uint32 entry = fields[0].GetUInt32(); uint8 creditType = fields[1].GetUInt8(); uint32 creditEntry = fields[2].GetUInt32(); - uint32 lastEncounterDungeon = fields[3].GetUInt32(); + uint32 lastEncounterDungeon = fields[3].GetUInt16(); DungeonEncounterEntry const* dungeonEncounter = sDungeonEncounterStore.LookupEntry(entry); if (!dungeonEncounter) { @@ -5227,13 +5228,13 @@ void ObjectMgr::LoadGossipText() gText.Options[i].Text_0 = fields[cic++].GetString(); gText.Options[i].Text_1 = fields[cic++].GetString(); - gText.Options[i].Language = fields[cic++].GetUInt32(); + gText.Options[i].Language = fields[cic++].GetUInt8(); gText.Options[i].Probability = fields[cic++].GetFloat(); for (uint8 j=0; j < MAX_GOSSIP_TEXT_EMOTES; ++j) { - gText.Options[i].Emotes[j]._Delay = fields[cic++].GetUInt32(); - gText.Options[i].Emotes[j]._Emote = fields[cic++].GetUInt32(); + gText.Options[i].Emotes[j]._Delay = fields[cic++].GetUInt16(); + gText.Options[i].Emotes[j]._Emote = fields[cic++].GetUInt16(); } } } while (result->NextRow()); @@ -6638,7 +6639,7 @@ uint32 ObjectMgr::GetXPForLevel(uint8 level) void ObjectMgr::LoadPetNames() { uint32 oldMSTime = getMSTime(); - + // 0 1 2 QueryResult result = WorldDatabase.Query("SELECT word, entry, half FROM pet_name_generation"); if (!result) @@ -7003,7 +7004,7 @@ void ObjectMgr::LoadPointsOfInterest() uint32 count = 0; - // 0 1 2 3 4 5 6 + // 0 1 2 3 4 5 6 QueryResult result = WorldDatabase.Query("SELECT entry, x, y, icon, flags, data, icon_name FROM points_of_interest"); if (!result) @@ -7155,7 +7156,7 @@ void ObjectMgr::LoadNPCSpellClickSpells() if (userType >= SPELL_CLICK_USER_MAX) sLog->outErrorDb("Table npc_spellclick_spells references unknown user type %u. Skipping entry.", uint32(userType)); - uint8 castFlags = fields[2].GetUInt8(); + uint8 castFlags = fields[2].GetUInt16(); SpellClickInfo info; info.spellId = spellid; info.castFlags = castFlags; @@ -8039,6 +8040,7 @@ void ObjectMgr::LoadMailLevelRewards() _mailLevelRewardStore.clear(); // for reload case + // 0 1 2 3 QueryResult result = WorldDatabase.Query("SELECT level, raceMask, mailTemplateId, senderEntry FROM mail_level_reward"); if (!result) @@ -8200,9 +8202,9 @@ void ObjectMgr::LoadTrainerSpell() uint32 entry = fields[0].GetUInt32(); uint32 spell = fields[1].GetUInt32(); uint32 spellCost = fields[2].GetUInt32(); - uint32 reqSkill = fields[3].GetUInt32(); - uint32 reqSkillValue = fields[4].GetUInt32(); - uint32 reqLevel = fields[5].GetUInt32(); + uint32 reqSkill = fields[3].GetUInt16(); + uint32 reqSkillValue = fields[4].GetUInt16(); + uint32 reqLevel = fields[5].GetUInt8(); AddSpellToTrainer(entry, spell, spellCost, reqSkill, reqSkillValue, reqLevel); diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp index 608067935ea..a079d2f643b 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp @@ -41,7 +41,7 @@ void OutdoorPvPMgr::InitOutdoorPvP() { uint32 oldMSTime = getMSTime(); - // 0 1 + // 0 1 QueryResult result = WorldDatabase.Query("SELECT TypeId, ScriptName FROM outdoorpvp_template"); if (!result) @@ -58,7 +58,7 @@ void OutdoorPvPMgr::InitOutdoorPvP() { Field* fields = result->Fetch(); - typeId = fields[0].GetUInt32(); + typeId = fields[0].GetUInt8(); if (DisableMgr::IsDisabledFor(DISABLE_TYPE_OUTDOORPVP, typeId, NULL)) continue; diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp index 71204f92826..5ebf78e484c 100755 --- a/src/server/game/Pools/PoolMgr.cpp +++ b/src/server/game/Pools/PoolMgr.cpp @@ -600,7 +600,7 @@ void PoolMgr::LoadFromDB() { uint32 oldMSTime = getMSTime(); - // 1 2 3 + // 1 2 3 QueryResult result = WorldDatabase.Query("SELECT guid, pool_entry, chance FROM pool_creature"); if (!result) diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 173df8dc809..debc8760ea9 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -23,31 +23,31 @@ Quest::Quest(Field* questRecord) { Id = questRecord[0].GetUInt32(); - Method = questRecord[1].GetUInt32(); - Level = questRecord[2].GetInt32(); - MinLevel = questRecord[3].GetUInt32(); - MaxLevel = questRecord[4].GetUInt32(); - ZoneOrSort = questRecord[5].GetInt32(); - Type = questRecord[6].GetUInt32(); - SuggestedPlayers = questRecord[7].GetUInt32(); + Method = questRecord[1].GetUInt8(); + Level = questRecord[2].GetInt16(); + MinLevel = questRecord[3].GetUInt8(); + MaxLevel = questRecord[4].GetUInt8(); + ZoneOrSort = questRecord[5].GetInt16(); + Type = questRecord[6].GetUInt16(); + SuggestedPlayers = questRecord[7].GetUInt8(); LimitTime = questRecord[8].GetUInt32(); - RequiredClasses = questRecord[9].GetUInt32(); - RequiredRaces = questRecord[10].GetUInt32(); - RequiredSkillId = questRecord[11].GetUInt32(); - RequiredSkillPoints = questRecord[12].GetUInt32(); - RequiredFactionId1 = questRecord[13].GetUInt32(); - RequiredFactionId2 = questRecord[14].GetUInt32(); + RequiredClasses = questRecord[9].GetUInt16(); + RequiredRaces = questRecord[10].GetUInt16(); + RequiredSkillId = questRecord[11].GetUInt16(); + RequiredSkillPoints = questRecord[12].GetUInt16(); + RequiredFactionId1 = questRecord[13].GetUInt16(); + RequiredFactionId2 = questRecord[14].GetUInt16(); RequiredFactionValue1 = questRecord[15].GetInt32(); RequiredFactionValue2 = questRecord[16].GetInt32(); - RequiredMinRepFaction = questRecord[17].GetUInt32(); - RequiredMaxRepFaction = questRecord[18].GetUInt32(); + RequiredMinRepFaction = questRecord[17].GetUInt16(); + RequiredMaxRepFaction = questRecord[18].GetUInt16(); RequiredMinRepValue = questRecord[19].GetInt32(); RequiredMaxRepValue = questRecord[20].GetInt32(); PrevQuestId = questRecord[21].GetInt32(); NextQuestId = questRecord[22].GetInt32(); ExclusiveGroup = questRecord[23].GetInt32(); NextQuestIdChain = questRecord[24].GetUInt32(); - RewardXPId = questRecord[25].GetUInt32(); + RewardXPId = questRecord[25].GetUInt8(); RewardOrRequiredMoney = questRecord[26].GetInt32(); RewardMoneyMaxLevel = questRecord[27].GetUInt32(); RewardSpell = questRecord[28].GetUInt32(); @@ -57,29 +57,29 @@ Quest::Quest(Field* questRecord) RewardMailTemplateId = questRecord[32].GetUInt32(); RewardMailDelay = questRecord[33].GetUInt32(); SourceItemId = questRecord[34].GetUInt32(); - SourceItemIdCount = questRecord[35].GetUInt32(); + SourceItemIdCount = questRecord[35].GetUInt8(); SourceSpellid = questRecord[36].GetUInt32(); Flags = questRecord[37].GetUInt32(); - uint32 SpecialFlags = questRecord[38].GetUInt16(); - RewardTitleId = questRecord[39].GetUInt32(); - RequiredPlayerKills = questRecord[40].GetUInt32(); - RewardTalents = questRecord[41].GetUInt32(); - RewardArenaPoints = questRecord[42].GetInt32(); + uint32 SpecialFlags = questRecord[38].GetUInt8(); + RewardTitleId = questRecord[39].GetUInt8(); + RequiredPlayerKills = questRecord[40].GetUInt8(); + RewardTalents = questRecord[41].GetUInt8(); + RewardArenaPoints = questRecord[42].GetUInt16(); for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) RewardItemId[i] = questRecord[43+i].GetUInt32(); for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) - RewardItemIdCount[i] = questRecord[47+i].GetUInt32(); + RewardItemIdCount[i] = questRecord[47+i].GetUInt16(); for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) RewardChoiceItemId[i] = questRecord[51+i].GetUInt32(); for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - RewardChoiceItemCount[i] = questRecord[57+i].GetUInt32(); + RewardChoiceItemCount[i] = questRecord[57+i].GetUInt16(); for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewardFactionId[i] = questRecord[63+i].GetUInt32(); + RewardFactionId[i] = questRecord[63+i].GetUInt168(); for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) RewardFactionValueId[i] = questRecord[68+i].GetInt32(); @@ -87,7 +87,7 @@ Quest::Quest(Field* questRecord) for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) RewardFactionValueIdOverride[i] = questRecord[73+i].GetInt32(); - PointMapId = questRecord[78].GetUInt32(); + PointMapId = questRecord[78].GetUInt16(); PointX = questRecord[79].GetFloat(); PointY = questRecord[80].GetFloat(); PointOption = questRecord[81].GetUInt32(); @@ -103,39 +103,39 @@ Quest::Quest(Field* questRecord) RequiredNpcOrGo[i] = questRecord[89+i].GetInt32(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - RequiredNpcOrGoCount[i] = questRecord[93+i].GetUInt32(); + RequiredNpcOrGoCount[i] = questRecord[93+i].GetUInt16(); for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) RequiredSourceItemId[i] = questRecord[97+i].GetUInt32(); for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) - RequiredSourceItemCount[i] = questRecord[101+i].GetUInt32(); + RequiredSourceItemCount[i] = questRecord[101+i].GetUInt16(); for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) RequiredItemId[i] = questRecord[105+i].GetUInt32(); for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) - RequiredItemCount[i] = questRecord[111+i].GetUInt32(); + RequiredItemCount[i] = questRecord[111+i].GetUInt16(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) RequiredSpellCast[i] = questRecord[117+i].GetUInt32(); - // int8 Unknown0 = questRecord[121].GetUInt32(); + // int8 Unknown0 = questRecord[121].GetUInt8(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) ObjectiveText[i] = questRecord[122+i].GetString(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - DetailsEmote[i] = questRecord[126+i].GetUInt32(); + DetailsEmote[i] = questRecord[126+i].GetUInt16(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) DetailsEmoteDelay[i] = questRecord[130+i].GetUInt32(); - EmoteOnIncomplete = questRecord[134].GetUInt32(); - EmoteOnComplete = questRecord[135].GetUInt32(); + EmoteOnIncomplete = questRecord[134].GetUInt16(); + EmoteOnComplete = questRecord[135].GetUInt16(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - OfferRewardEmote[i] = questRecord[136+i].GetInt32(); + OfferRewardEmote[i] = questRecord[136+i].GetInt16(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) OfferRewardEmoteDelay[i] = questRecord[140+i].GetInt32(); From 8e87fe27443213ca3c312cf8078a44403542aa75 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 27 Mar 2012 19:29:54 +0100 Subject: [PATCH 0320/1149] Typo --- src/server/game/Quests/QuestDef.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index debc8760ea9..9221da53003 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -79,7 +79,7 @@ Quest::Quest(Field* questRecord) RewardChoiceItemCount[i] = questRecord[57+i].GetUInt16(); for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewardFactionId[i] = questRecord[63+i].GetUInt168(); + RewardFactionId[i] = questRecord[63+i].GetUInt16(); for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) RewardFactionValueId[i] = questRecord[68+i].GetInt32(); From 729f419af10f3fbac0d77319f7244bfbe2a443c0 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 27 Mar 2012 21:36:16 +0100 Subject: [PATCH 0321/1149] Core/DBLayer: Correct few more wrong read types (No. 4) DB/World: Some consistency in the ints "length" field (not really a length) All world dbs checked --- .../world/2012_03_27_03_world_misc.sql | 59 +++++++++++++++++++ .../game/AI/SmartScripts/SmartScriptMgr.cpp | 1 - src/server/game/Globals/ObjectMgr.cpp | 26 ++++---- .../Movement/Waypoints/WaypointManager.cpp | 1 + src/server/game/Scripting/ScriptSystem.cpp | 10 ++-- src/server/game/Skills/SkillDiscovery.cpp | 2 +- src/server/game/Skills/SkillExtraItems.cpp | 2 +- src/server/game/Spells/SpellMgr.cpp | 29 ++++----- 8 files changed, 97 insertions(+), 33 deletions(-) create mode 100644 sql/updates/world/2012_03_27_03_world_misc.sql diff --git a/sql/updates/world/2012_03_27_03_world_misc.sql b/sql/updates/world/2012_03_27_03_world_misc.sql new file mode 100644 index 00000000000..aba847dbc3f --- /dev/null +++ b/sql/updates/world/2012_03_27_03_world_misc.sql @@ -0,0 +1,59 @@ +ALTER TABLE `reference_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `reputation_spillover_template` CHANGE `faction` `faction` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'faction entry'; +ALTER TABLE `reputation_spillover_template` CHANGE `faction1` `faction1` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'faction to give spillover for'; +ALTER TABLE `reputation_spillover_template` CHANGE `faction2` `faction2` smallint(5) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `reputation_spillover_template` CHANGE `faction3` `faction3` smallint(5) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `reputation_spillover_template` CHANGE `faction4` `faction4` smallint(5) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `skinning_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `spell_area` CHANGE `quest_start_active` `quest_start_active` tinyint(3) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_area` CHANGE `gender` `gender` tinyint(3) unsigned NOT NULL DEFAULT '2'; +ALTER TABLE `spell_area` CHANGE `autocast` `autocast` tinyint(3) unsigned NOT NULL DEFAULT '0'; +-- All the fields in spell_dbc where changed to full int32 since the DBC structure is used +ALTER TABLE `spell_dbc` CHANGE `Dispel` `Dispel` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `Mechanic` `Mechanic` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `CastingTimeIndex` `CastingTimeIndex` int(10) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `spell_dbc` CHANGE `DurationIndex` `DurationIndex` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `ProcChance` `ProcChance` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `ProcCharges` `ProcCharges` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `BaseLevel` `BaseLevel` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `MaxLevel` `MaxLevel` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `SpellLevel` `SpellLevel` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `RangeIndex` `RangeIndex` int(10) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `spell_dbc` CHANGE `Effect1` `Effect1` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `Effect2` `Effect2` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `Effect3` `Effect3` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectMechanic1` `EffectMechanic1` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectMechanic2` `EffectMechanic2` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectMechanic3` `EffectMechanic3` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectImplicitTargetA1` `EffectImplicitTargetA1` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectImplicitTargetA2` `EffectImplicitTargetA2` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectImplicitTargetA3` `EffectImplicitTargetA3` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectImplicitTargetB1` `EffectImplicitTargetB1` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectImplicitTargetB2` `EffectImplicitTargetB2` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectImplicitTargetB3` `EffectImplicitTargetB3` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectRadiusIndex1` `EffectRadiusIndex1` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectRadiusIndex2` `EffectRadiusIndex2` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectRadiusIndex3` `EffectRadiusIndex3` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectApplyAuraName1` `EffectApplyAuraName1` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectApplyAuraName2` `EffectApplyAuraName2` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectApplyAuraName3` `EffectApplyAuraName3` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `MaxTargetLevel` `MaxTargetLevel` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `SpellFamilyName` `SpellFamilyName` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `MaxAffectedTargets` `MaxAffectedTargets` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `DmgClass` `DmgClass` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `PreventionType` `PreventionType` int(10) unsigned NOT NULL DEFAULT '0'; +-- +ALTER TABLE `spell_group` CHANGE `id` `id` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `spell_proc` CHANGE `spellPhaseMask` `spellPhaseMask` int(11) NOT NULL DEFAULT '0'; +ALTER TABLE `spell_proc` CHANGE `hitMask` `hitMask` int(11) NOT NULL DEFAULT '0'; +ALTER TABLE `spell_enchant_proc_data` CHANGE `procEx` `procEx` int(10) unsigned NOT NULL DEFAULT '0'; -- changed from float to int +ALTER TABLE `spell_required` CHANGE `spell_id` `spell_id` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `spell_required` CHANGE `req_spell` `req_spell` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `spell_threat` CHANGE `flatMod` `flatMod` int(11) NULL DEFAULT NULL; +ALTER TABLE `vehicle_accessory` CHANGE `seat_id` `seat_id` tinyint(4) NOT NULL DEFAULT '0'; +ALTER TABLE `vehicle_accessory` CHANGE `minion` `minion` tinyint(3) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `vehicle_template_accessory` CHANGE `seat_id` `seat_id` tinyint(4) NOT NULL DEFAULT '0'; +ALTER TABLE `vehicle_template_accessory` CHANGE `minion` `minion` tinyint(3) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `version` CHANGE `cache_id` `cache_id` int(11) NULL DEFAULT '0'; +ALTER TABLE `waypoint_data` CHANGE `move_flag` `move_flag` tinyint(4) NOT NULL DEFAULT '0'; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 776ffd78a9a..e3264adc310 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -198,7 +198,6 @@ void SmartAIMgr::LoadSmartAIFromDB() temp.event.raw.param4 = fields[11].GetUInt32(); temp.action.type = (SMART_ACTION)fields[12].GetUInt8(); - temp.action.raw.param1 = fields[13].GetUInt32(); temp.action.raw.param2 = fields[14].GetUInt32(); temp.action.raw.param3 = fields[15].GetUInt32(); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 63a02378787..2a92a437d72 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2804,6 +2804,7 @@ void ObjectMgr::LoadVehicleTemplateAccessories() uint32 count = 0; + // 0 1 2 3 4 5 QueryResult result = WorldDatabase.Query("SELECT `entry`, `accessory_entry`, `seat_id`, `minion`, `summontype`, `summontimer` FROM `vehicle_template_accessory`"); if (!result) @@ -2860,6 +2861,7 @@ void ObjectMgr::LoadVehicleAccessories() uint32 count = 0; + // 0 1 2 3 4 5 QueryResult result = WorldDatabase.Query("SELECT `guid`, `accessory_entry`, `seat_id`, `minion`, `summontype`, `summontimer` FROM `vehicle_accessory`"); if (!result) @@ -6753,7 +6755,7 @@ void ObjectMgr::LoadReputationRewardRate() _repRewardRateStore.clear(); // for reload case - uint32 count = 0; + uint32 count = 0; // 0 1 2 3 QueryResult result = WorldDatabase.Query("SELECT faction, quest_rate, creature_rate, spell_rate FROM reputation_reward_rate"); if (!result) @@ -6890,7 +6892,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate() _repSpilloverTemplateStore.clear(); // for reload case - uint32 count = 0; + uint32 count = 0; // 0 1 2 3 4 5 6 7 8 9 10 11 12 QueryResult result = WorldDatabase.Query("SELECT faction, faction1, rate_1, rank_1, faction2, rate_2, rank_2, faction3, rate_3, rank_3, faction4, rate_4, rank_4 FROM reputation_spillover_template"); if (!result) @@ -6904,22 +6906,22 @@ void ObjectMgr::LoadReputationSpilloverTemplate() { Field* fields = result->Fetch(); - uint32 factionId = fields[0].GetUInt32(); + uint32 factionId = fields[0].GetUInt16(); RepSpilloverTemplate repTemplate; - repTemplate.faction[0] = fields[1].GetUInt32(); + repTemplate.faction[0] = fields[1].GetUInt16(); repTemplate.faction_rate[0] = fields[2].GetFloat(); - repTemplate.faction_rank[0] = fields[3].GetUInt32(); - repTemplate.faction[1] = fields[4].GetUInt32(); + repTemplate.faction_rank[0] = fields[3].GetUInt8(); + repTemplate.faction[1] = fields[4].GetUInt16(); repTemplate.faction_rate[1] = fields[5].GetFloat(); - repTemplate.faction_rank[1] = fields[6].GetUInt32(); - repTemplate.faction[2] = fields[7].GetUInt32(); + repTemplate.faction_rank[1] = fields[6].GetUInt8(); + repTemplate.faction[2] = fields[7].GetUInt16(); repTemplate.faction_rate[2] = fields[8].GetFloat(); - repTemplate.faction_rank[2] = fields[9].GetUInt32(); - repTemplate.faction[3] = fields[10].GetUInt32(); + repTemplate.faction_rank[2] = fields[9].GetUInt8(); + repTemplate.faction[3] = fields[10].GetUInt16(); repTemplate.faction_rate[3] = fields[11].GetFloat(); - repTemplate.faction_rank[3] = fields[12].GetUInt32(); + repTemplate.faction_rank[3] = fields[12].GetUInt8(); FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId); @@ -7806,7 +7808,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel() { Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); - int32 skill = fields[1].GetInt32(); + int32 skill = fields[1].GetInt16(); AreaTableEntry const* fArea = GetAreaEntryByAreaID(entry); if (!fArea) diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp index 2c3a58f55a3..93d9e2290c1 100755 --- a/src/server/game/Movement/Waypoints/WaypointManager.cpp +++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp @@ -43,6 +43,7 @@ void WaypointMgr::Load() { uint32 oldMSTime = getMSTime(); + // 0 1 2 3 4 5 6 7 8 9 QueryResult result = WorldDatabase.Query("SELECT id, point, position_x, position_y, position_z, orientation, move_flag, delay, action, action_chance FROM waypoint_data ORDER BY id, point"); if (!result) diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp index 66f5a4089dc..c38d559372f 100755 --- a/src/server/game/Scripting/ScriptSystem.cpp +++ b/src/server/game/Scripting/ScriptSystem.cpp @@ -30,7 +30,8 @@ void SystemMgr::LoadScriptTexts() sLog->outString("TSCR: Loading Script Texts additional data..."); uint32 oldMSTime = getMSTime(); - + + // 0 1 2 3 QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM script_texts"); if (!result) @@ -49,9 +50,9 @@ void SystemMgr::LoadScriptTexts() int32 iId = pFields[0].GetInt32(); temp.uiSoundId = pFields[1].GetUInt32(); - temp.uiType = pFields[2].GetUInt32(); - temp.uiLanguage = pFields[3].GetUInt32(); - temp.uiEmote = pFields[4].GetUInt32(); + temp.uiType = pFields[2].GetUInt8(); + temp.uiLanguage = pFields[3].GetUInt8(); + temp.uiEmote = pFields[4].GetUInt16(); if (iId >= 0) { @@ -164,6 +165,7 @@ void SystemMgr::LoadScriptWaypoints() sLog->outString("TSCR: Loading Script Waypoints for " UI64FMTD " creature(s)...", uiCreatureCount); + // 0 1 2 3 4 5 result = WorldDatabase.Query("SELECT entry, pointid, location_x, location_y, location_z, waittime FROM script_waypoint ORDER BY pointid"); if (!result) diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp index 3ece4b57741..e314fab07be 100755 --- a/src/server/game/Skills/SkillDiscovery.cpp +++ b/src/server/game/Skills/SkillDiscovery.cpp @@ -71,7 +71,7 @@ void LoadSkillDiscoveryTable() uint32 spellId = fields[0].GetUInt32(); int32 reqSkillOrSpell = fields[1].GetInt32(); - uint32 reqSkillValue = fields[2].GetUInt32(); + uint32 reqSkillValue = fields[2].GetUInt16(); float chance = fields[3].GetFloat(); if (chance <= 0) // chance diff --git a/src/server/game/Skills/SkillExtraItems.cpp b/src/server/game/Skills/SkillExtraItems.cpp index c68e3cdcfe0..3bb435145f1 100755 --- a/src/server/game/Skills/SkillExtraItems.cpp +++ b/src/server/game/Skills/SkillExtraItems.cpp @@ -55,7 +55,7 @@ void LoadSkillExtraItemTable() SkillExtraItemStore.clear(); // need for reload - // 0 1 2 3 + // 0 1 2 3 QueryResult result = WorldDatabase.Query("SELECT spellId, requiredSpecialization, additionalCreateChance, additionalMaxNum FROM skill_extra_item_template"); if (!result) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 7bfb71d83d4..965f27a6456 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1163,7 +1163,7 @@ void SpellMgr::LoadSpellRanks() mSpellInfoMap[itr->first]->ChainEntry = NULL; } mSpellChains.clear(); - + // 0 1 2 QueryResult result = WorldDatabase.Query("SELECT first_spell_id, spell_id, rank from spell_ranks ORDER BY first_spell_id, rank"); if (!result) @@ -1276,6 +1276,7 @@ void SpellMgr::LoadSpellRequired() mSpellsReqSpell.clear(); // need for reload case mSpellReq.clear(); // need for reload case + // 0 1 QueryResult result = WorldDatabase.Query("SELECT spell_id, req_spell from spell_required"); if (!result) @@ -1386,10 +1387,10 @@ void SpellMgr::LoadSpellLearnSpells() { Field* fields = result->Fetch(); - uint32 spell_id = fields[0].GetUInt32(); + uint32 spell_id = fields[0].GetUInt16(); SpellLearnSpellNode node; - node.spell = fields[1].GetUInt32(); + node.spell = fields[1].GetUInt16(); node.active = fields[2].GetBool(); node.autoLearned= false; @@ -1475,7 +1476,7 @@ void SpellMgr::LoadSpellTargetPositions() mSpellTargetPositions.clear(); // need for reload case - // 0 1 2 3 4 5 + // 0 1 2 3 4 5 QueryResult result = WorldDatabase.Query("SELECT id, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM spell_target_position"); if (!result) { @@ -1494,7 +1495,7 @@ void SpellMgr::LoadSpellTargetPositions() SpellTargetPosition st; - st.target_mapId = fields[1].GetUInt32(); + st.target_mapId = fields[1].GetUInt16(); st.target_X = fields[2].GetFloat(); st.target_Y = fields[3].GetFloat(); st.target_Z = fields[4].GetFloat(); @@ -1599,7 +1600,7 @@ void SpellMgr::LoadSpellGroups() uint32 count = 0; - // 0 1 + // 0 1 QueryResult result = WorldDatabase.Query("SELECT id, spell_id FROM spell_group"); if (!result) { @@ -1696,7 +1697,7 @@ void SpellMgr::LoadSpellGroupStackRules() Field* fields = result->Fetch(); uint32 group_id = fields[0].GetUInt32(); - uint8 stack_rule = fields[1].GetUInt32(); + uint8 stack_rule = fields[1].GetInt8(); if (stack_rule >= SPELL_GROUP_STACK_RULE_MAX) { sLog->outErrorDb("SpellGroupStackRule %u listed in `spell_group_stack_rules` does not exist", stack_rule); @@ -1753,8 +1754,8 @@ void SpellMgr::LoadSpellProcEvents() SpellProcEventEntry spe; - spe.schoolMask = fields[1].GetUInt32(); - spe.spellFamilyName = fields[2].GetUInt32(); + spe.schoolMask = fields[1].GetInt8(); + spe.spellFamilyName = fields[2].GetUInt16(); spe.spellFamilyMask[0] = fields[3].GetUInt32(); spe.spellFamilyMask[1] = fields[4].GetUInt32(); spe.spellFamilyMask[2] = fields[5].GetUInt32(); @@ -1793,7 +1794,7 @@ void SpellMgr::LoadSpellProcs() uint32 count = 0; - // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 QueryResult result = WorldDatabase.Query("SELECT spellId, schoolMask, spellFamilyName, spellFamilyMask0, spellFamilyMask1, spellFamilyMask2, typeMask, spellTypeMask, spellPhaseMask, hitMask, attributesMask, ratePerMinute, chance, cooldown, charges FROM spell_proc"); if (!result) { @@ -1833,8 +1834,8 @@ void SpellMgr::LoadSpellProcs() SpellProcEntry baseProcEntry; - baseProcEntry.schoolMask = fields[1].GetUInt32(); - baseProcEntry.spellFamilyName = fields[2].GetUInt32(); + baseProcEntry.schoolMask = fields[1].GetInt8(); + baseProcEntry.spellFamilyName = fields[2].GetUInt16(); baseProcEntry.spellFamilyMask[0] = fields[3].GetUInt32(); baseProcEntry.spellFamilyMask[1] = fields[4].GetUInt32(); baseProcEntry.spellFamilyMask[2] = fields[5].GetUInt32(); @@ -1997,7 +1998,7 @@ void SpellMgr::LoadSpellThreats() } SpellThreatEntry ste; - ste.flatMod = fields[1].GetInt16(); + ste.flatMod = fields[1].GetInt32(); ste.pctMod = fields[2].GetFloat(); ste.apPctMod = fields[3].GetFloat(); @@ -2204,7 +2205,7 @@ void SpellMgr::LoadSpellLinked() int32 trigger = fields[0].GetInt32(); int32 effect = fields[1].GetInt32(); - int32 type = fields[2].GetInt32(); + int32 type = fields[2].GetUInt8(); SpellInfo const* spellInfo = GetSpellInfo(abs(trigger)); if (!spellInfo) From ef3835655cd410fda6947beb2e145422249307e0 Mon Sep 17 00:00:00 2001 From: click Date: Tue, 27 Mar 2012 23:12:01 +0200 Subject: [PATCH 0322/1149] Core. Fix a mishap in the ObjectMgr after the recent changes --- src/server/game/Globals/ObjectMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 2a92a437d72..6e0a5928c02 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -3212,7 +3212,7 @@ void ObjectMgr::LoadPlayerInfo() uint32 oldMSTime = getMSTime(); std::string tableName = sWorld->getBoolConfig(CONFIG_START_ALL_SPELLS) ? "playercreateinfo_spell_custom" : "playercreateinfo_spell"; - QueryResult result = WorldDatabase.PQuery("SELECT race, class, Spell FROM %s", tableName); + QueryResult result = WorldDatabase.PQuery("SELECT race, class, Spell FROM %s", tableName.c_str()); if (!result) { From 697fda7d2754b351a171f5d38881094114f8140b Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 28 Mar 2012 00:03:11 +0200 Subject: [PATCH 0323/1149] Core/Players: Fixed copy paste mistake --- src/server/game/Entities/Player/Player.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a7f5c0937a8..26f248aa961 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -19531,7 +19531,6 @@ void Player::_SaveStats(SQLTransaction& trans) stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER)); stmt->setUInt32(index++, GetBaseSpellPowerBonus()); stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_CRIT_TAKEN_SPELL)); - stmt->setUInt32(index++, GetMaxHealth()); trans->Append(stmt); } From b4f9cb6aa84ce78077a14b5976f0e5b2322428d6 Mon Sep 17 00:00:00 2001 From: Shocker Date: Wed, 28 Mar 2012 01:30:12 +0300 Subject: [PATCH 0324/1149] Core/Spells: Correct diminishing returns for Horror category --- src/server/game/Spells/SpellMgr.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 965f27a6456..2b9e17c1284 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -111,24 +111,14 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellInfo const* spellproto, } case SPELLFAMILY_WARLOCK: { - // Death Coil - if (spellproto->SpellFamilyFlags[0] & 0x80000) - return DIMINISHING_HORROR; // Curses/etc - else if ((spellproto->SpellFamilyFlags[0] & 0x80000000) || (spellproto->SpellFamilyFlags[1] & 0x200)) + if ((spellproto->SpellFamilyFlags[0] & 0x80000000) || (spellproto->SpellFamilyFlags[1] & 0x200)) return DIMINISHING_LIMITONLY; // Seduction else if (spellproto->SpellFamilyFlags[1] & 0x10000000) return DIMINISHING_FEAR; break; } - case SPELLFAMILY_PRIEST: - { - // Psychic Horror - if (spellproto->SpellFamilyFlags[2] & 0x2000) - return DIMINISHING_HORROR; - break; - } case SPELLFAMILY_DRUID: { // Pounce @@ -228,6 +218,8 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellInfo const* spellproto, return DIMINISHING_BANISH; if (mechanic & (1 << MECHANIC_ROOT)) return triggered ? DIMINISHING_ROOT : DIMINISHING_CONTROLLED_ROOT; + if (mechanic & (1 << MECHANIC_HORROR)) + return DIMINISHING_HORROR; return DIMINISHING_NONE; } From ae0511a2a445dc189ed1c822a43e23adb3d644b0 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 28 Mar 2012 01:13:58 +0200 Subject: [PATCH 0325/1149] Core/Spells: Fix DynamicObject AoE effects for invisible targets e.g Flare. Original patch by Elron Closes #5898 --- src/server/game/Grids/Notifiers/GridNotifiers.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index e623b98a13a..bb2a9c5130b 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -927,13 +927,15 @@ namespace Trinity { public: AnyAoETargetUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range) - : i_obj(obj), i_funit(funit), i_range(range) + : i_obj(obj), i_funit(funit), _spellInfo(NULL), i_range(range) { Unit const* check = i_funit; Unit const* owner = i_funit->GetOwner(); if (owner) check = owner; i_targetForPlayer = (check->GetTypeId() == TYPEID_PLAYER); + if (i_obj->GetTypeId() == TYPEID_DYNAMICOBJECT) + _spellInfo = sSpellMgr->GetSpellInfo(((DynamicObject*)i_obj)->GetSpellId()); } bool operator()(Unit* u) { @@ -941,7 +943,7 @@ namespace Trinity if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->isTotem()) return false; - if (i_funit->IsValidAttackTarget(u) && i_obj->IsWithinDistInMap(u, i_range)) + if (i_funit->_IsValidAttackTarget(u, _spellInfo) && i_obj->IsWithinDistInMap(u, i_range)) return true; return false; @@ -950,6 +952,7 @@ namespace Trinity bool i_targetForPlayer; WorldObject const* i_obj; Unit const* i_funit; + SpellInfo const* _spellInfo; float i_range; }; From 76397cf9311eb89a75d7a71b973c7d480a40b9a7 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 28 Mar 2012 01:26:45 +0200 Subject: [PATCH 0326/1149] Core/Grids: Removed unsafe substraction, fixes possible freezes --- src/server/game/Grids/Cells/CellImpl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Grids/Cells/CellImpl.h b/src/server/game/Grids/Cells/CellImpl.h index 77830bc59d5..b224b3865e0 100644 --- a/src/server/game/Grids/Cells/CellImpl.h +++ b/src/server/game/Grids/Cells/CellImpl.h @@ -91,7 +91,7 @@ inline void Cell::Visit(CellCoord const& standing_cell, TypeContainerVisitor 4) && ((area.high_bound.y_coord - area.low_bound.y_coord) > 4)) + if ((area.high_bound.x_coord > (area.low_bound.x_coord + 4)) && (area.high_bound.y_coord > (area.low_bound.y_coord + 4))) { VisitCircle(visitor, map, area.low_bound, area.high_bound); return; From f44e6834df4278fece0ca9c419b644512de812a6 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 28 Mar 2012 00:38:04 +0100 Subject: [PATCH 0327/1149] Core/DBLayer: Fix remaining errors in loading world tables and a couple of them in characters database Also removed World::LoadIp2nation(), it was not doing anything. Closes #5897 --- .../world/2012_03_27_04_world_misc.sql | 3 +++ src/server/game/Events/GameEventMgr.cpp | 6 +++--- src/server/game/Globals/ObjectMgr.cpp | 10 +++++----- src/server/game/Instances/InstanceSaveMgr.cpp | 2 +- .../Movement/Waypoints/WaypointManager.cpp | 2 +- src/server/game/World/World.cpp | 20 ------------------- src/server/game/World/World.h | 2 -- 7 files changed, 13 insertions(+), 32 deletions(-) create mode 100644 sql/updates/world/2012_03_27_04_world_misc.sql diff --git a/sql/updates/world/2012_03_27_04_world_misc.sql b/sql/updates/world/2012_03_27_04_world_misc.sql new file mode 100644 index 00000000000..e85350476c9 --- /dev/null +++ b/sql/updates/world/2012_03_27_04_world_misc.sql @@ -0,0 +1,3 @@ +ALTER TABLE `spell_dbc` CHANGE `StackAmount` `StackAmount` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `waypoint_data` CHANGE `action_chance` `action_chance` smallint(6) NOT NULL DEFAULT '100'; +ALTER TABLE `item_loot_template` CHANGE `maxcount` `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1'; diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 7224007fb2c..182aaa35c49 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -283,7 +283,7 @@ void GameEventMgr::LoadFromDB() { Field* fields = result->Fetch(); - uint16 event_id = fields[0].GetUInt16(); + uint16 event_id = fields[0].GetUInt8(); if (event_id >= mGameEvent.size()) { @@ -469,7 +469,7 @@ void GameEventMgr::LoadFromDB() Field* fields = result->Fetch(); uint32 guid = fields[0].GetUInt32(); - uint16 event_id = fields[1].GetUInt16(); + uint16 event_id = fields[1].GetUInt8(); if (event_id >= mGameEventModelEquip.size()) { @@ -982,7 +982,7 @@ void GameEventMgr::Initialize() { Field* fields = result->Fetch(); - uint32 maxEventId = fields[0].GetUInt16(); + uint32 maxEventId = fields[0].GetUInt8(); // Id starts with 1 and vector with 0, thus increment maxEventId++; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 6e0a5928c02..d8107576ee4 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2820,7 +2820,7 @@ void ObjectMgr::LoadVehicleTemplateAccessories() uint32 uiEntry = fields[0].GetUInt32(); uint32 uiAccessory = fields[1].GetUInt32(); - int8 uiSeat = int8(fields[2].GetInt16()); + int8 uiSeat = int8(fields[2].GetInt8()); bool bMinion = fields[3].GetBool(); uint8 uiSummonType = fields[4].GetUInt8(); uint32 uiSummonTimer= fields[5].GetUInt32(); @@ -7154,11 +7154,11 @@ void ObjectMgr::LoadNPCSpellClickSpells() continue; } - uint8 userType = fields[3].GetUInt8(); + uint8 userType = fields[3].GetUInt16(); if (userType >= SPELL_CLICK_USER_MAX) sLog->outErrorDb("Table npc_spellclick_spells references unknown user type %u. Skipping entry.", uint32(userType)); - uint8 castFlags = fields[2].GetUInt16(); + uint8 castFlags = fields[2].GetUInt8(); SpellClickInfo info; info.spellId = spellid; info.castFlags = castFlags; @@ -8240,7 +8240,7 @@ int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set *s count += LoadReferenceVendor(vendor, -item_id, skip_vendors); else { - int32 maxcount = fields[1].GetUInt8(); // tinyint(3) unsigned + int32 maxcount = fields[1].GetUInt8(); uint32 incrtime = fields[2].GetUInt32(); uint32 ExtendedCost = fields[3].GetUInt32(); @@ -8290,7 +8290,7 @@ void ObjectMgr::LoadVendors() count += LoadReferenceVendor(entry, -item_id, &skip_vendors); else { - int32 maxcount = fields[2].GetInt32(); + uint32 maxcount = fields[2].GetUInt8(); uint32 incrtime = fields[3].GetUInt32(); uint32 ExtendedCost = fields[4].GetUInt32(); diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index ca39c137274..c17c7edbf0d 100755 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -358,7 +358,7 @@ void InstanceSaveManager::LoadResetTimes() { Field* fields = result->Fetch(); uint32 mapid = fields[0].GetUInt16(); - Difficulty difficulty = Difficulty(fields[1].GetUInt32()); + Difficulty difficulty = Difficulty(fields[1].GetUInt8()); uint64 oldresettime = fields[2].GetUInt32(); MapDifficulty const* mapDiff = GetMapDifficultyData(mapid, difficulty); diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp index 93d9e2290c1..296c9eee50f 100755 --- a/src/server/game/Movement/Waypoints/WaypointManager.cpp +++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp @@ -79,7 +79,7 @@ void WaypointMgr::Load() wp->run = fields[6].GetBool(); wp->delay = fields[7].GetUInt32(); wp->event_id = fields[8].GetUInt32(); - wp->event_chance = fields[9].GetUInt8(); + wp->event_chance = fields[9].GetInt16(); path.push_back(wp); ++count; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index cb365eefbd6..489278f63e6 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1625,9 +1625,6 @@ void World::SetInitialWorldSettings() sLog->outString("Loading Autobroadcasts..."); LoadAutobroadcasts(); - sLog->outString("Loading Ip2nation..."); - LoadIp2nation(); - ///- Load and initialize scripts sObjectMgr->LoadQuestStartScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate sObjectMgr->LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate @@ -1884,23 +1881,6 @@ void World::LoadAutobroadcasts() sLog->outString(); } -void World::LoadIp2nation() -{ - uint32 oldMSTime = getMSTime(); - - QueryResult result = WorldDatabase.Query("SELECT count(c.code) FROM ip2nationCountries c, ip2nation i WHERE c.code = i.country"); - uint32 count = 0; - - if (result) - { - Field* fields = result->Fetch(); - count = fields[0].GetUInt32(); - } - - sLog->outString(">> Loaded %u ip2nation definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); -} - /// Update the World ! void World::Update(uint32 diff) { diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 1247504678a..95e9fbda8ca 100755 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -741,8 +741,6 @@ class World void LoadAutobroadcasts(); - void LoadIp2nation(); - void UpdateAreaDependentAuras(); void ProcessStartEvent(); From ff070bd17ee8f1728ebe9663895af4fca7d3aad6 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 28 Mar 2012 00:43:59 +0100 Subject: [PATCH 0328/1149] Core/LFG: (Config) Enable DungeonFinder by default, it was proven to be stable and working. It is still not perfect and that's why we are waiting for feedback (a.k.a guinea pigs) --- src/server/worldserver/worldserver.conf.dist | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index ab4a8a832b8..5d837100b0e 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -1408,10 +1408,10 @@ AllowTickets = 1 # # DungeonFinder.Enable # Description: Dungeon and raid finder system. -# Default: 0 - (Disabled) -# 1 - (Enabled, Experimental as of still being in development) +# Default: 1 - (Enabled) +# 0 - (Disabled) -DungeonFinder.Enable = 0 +DungeonFinder.Enable = 1 # # DBC.EnforceItemAttributes From f9caf79b16e9de5d87dd48cdc450415b6ad33867 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 28 Mar 2012 02:37:39 +0200 Subject: [PATCH 0329/1149] Core/Grid: Fix crashes when closing up to the edge of a map. Closes #5085 --- src/server/game/Grids/GridDefines.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game/Grids/GridDefines.h b/src/server/game/Grids/GridDefines.h index 7bd0da34a46..99bb20fe9f6 100644 --- a/src/server/game/Grids/GridDefines.h +++ b/src/server/game/Grids/GridDefines.h @@ -215,7 +215,8 @@ namespace Trinity inline bool IsValidMapCoord(float c) { - return finite(c) && (std::fabs(c) <= MAP_HALFSIZE - 0.5f); + //! Since we visit grids in circles, we cannot allow players to relocate to grids on the edge of a map - thus the use of CENTER_GRID_OFFSET + return finite(c) && (std::fabs(c) <= MAP_HALFSIZE - CENTER_GRID_OFFSET - 0.5f); } inline bool IsValidMapCoord(float x, float y) From 820f45c4249a9f57e31a8a97b233de0e3ffdab58 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 28 Mar 2012 03:59:03 +0200 Subject: [PATCH 0330/1149] Core/Protocol: - Correct and rename response message from creating/updating a ticket - Prevent some trailing data in CMSG_GMTICKET_CREATE and add comment on stuff missing from its structure. - Random cleanup --- src/server/game/DungeonFinding/LFGMgr.cpp | 2 +- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/game/Groups/Group.cpp | 26 +++++++------- src/server/game/Handlers/GuildHandler.cpp | 8 ++--- src/server/game/Handlers/TicketHandler.cpp | 10 +++--- src/server/game/Spells/Spell.h | 2 +- src/server/game/Tickets/TicketMgr.cpp | 41 +++++++++++++--------- src/server/game/Tickets/TicketMgr.h | 8 +++-- 8 files changed, 56 insertions(+), 43 deletions(-) diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 815861ff96a..b936d32e13f 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1167,7 +1167,7 @@ void LFGMgr::UpdateRoleCheck(uint64 gguid, uint64 guid /* = 0 */, uint8 roles /* } m_QueueInfoMap[gguid] = pqInfo; - if(GetState(gguid) != LFG_STATE_NONE) + if (GetState(gguid) != LFG_STATE_NONE) { LfgGuidList& currentQueue = m_currentQueue[team]; currentQueue.push_front(gguid); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index aea5de36bb7..70b367b8ce0 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17009,7 +17009,7 @@ void Unit::ExitVehicle(Position const* /*exitPosition*/) //! to specify exit coordinates and either store those per passenger, or we need to //! init spline movement based on those coordinates in unapply handlers, and //! relocate exiting passengers based on Unit::moveSpline data. Either way, - //! Coming Soon� + //! Coming Soon(TM) } void Unit::_ExitVehicle(Position const* exitPosition) diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index a27ea9eb281..e7349f9ec10 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -820,28 +820,28 @@ void Group::SendLootRollWon(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumb } } -void Group::SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r) +void Group::SendLootAllPassed(uint32 numberOfPlayers, Roll const& roll) { WorldPacket data(SMSG_LOOT_ALL_PASSED, (8+4+4+4+4)); - data << uint64(r.itemGUID); // Guid of the item rolled - data << uint32(NumberOfPlayers); // The number of players rolling for it??? - data << uint32(r.itemid); // The itemEntryId for the item that shall be rolled for - data << uint32(r.itemRandomPropId); // Item random property ID - data << uint32(r.itemRandomSuffix); // Item random suffix ID + data << uint64(roll.itemGUID); // Guid of the item rolled + data << uint32(numberOfPlayers); // The number of players rolling for it + data << uint32(roll.itemid); // The itemEntryId for the item that shall be rolled for + data << uint32(roll.itemRandomPropId); // Item random property ID + data << uint32(roll.itemRandomSuffix); // Item random suffix ID - for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr) + for (Roll::PlayerVote::const_iterator itr = roll.playerVote.begin(); itr != roll.playerVote.end(); ++itr) { - Player* p = ObjectAccessor::FindPlayer(itr->first); - if (!p || !p->GetSession()) + Player* player = ObjectAccessor::FindPlayer(itr->first); + if (!player || !player->GetSession()) continue; if (itr->second != NOT_VALID) - p->GetSession()->SendPacket(&data); + player->GetSession()->SendPacket(&data); } } // notify group members which player is the allowed looter for the given creature -void Group::SendLooter(Creature* creature, Player* pLooter) +void Group::SendLooter(Creature* creature, Player* groupLooter) { ASSERT(creature); @@ -849,8 +849,8 @@ void Group::SendLooter(Creature* creature, Player* pLooter) data << uint64(creature->GetGUID()); data << uint8(0); // unk1 - if (pLooter) - data.append(pLooter->GetPackGUID()); + if (groupLooter) + data.append(groupLooter->GetPackGUID()); else data << uint8(0); diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 9115f8f0f1e..ccd1c931f51 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -352,8 +352,8 @@ void WorldSession::HandleGuildBankerActivate(WorldPacket & recv_data) uint64 GoGuid; recv_data >> GoGuid; - uint8 unk; - recv_data >> unk; + uint8 fullSlotList; + recv_data >> fullSlotList; // 0 = only slots updated in last operation are shown. 1 = all slots updated if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK)) { @@ -375,8 +375,8 @@ void WorldSession::HandleGuildBankQueryTab(WorldPacket & recv_data) uint8 tabId; recv_data >> tabId; - uint8 unk1; - recv_data >> unk1; + uint8 fullSlotList; + recv_data >> fullSlotList; // 0 = only slots updated in last operation are shown. 1 = all slots updated if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK)) if (Guild* guild = _GetPlayerGuild(this)) diff --git a/src/server/game/Handlers/TicketHandler.cpp b/src/server/game/Handlers/TicketHandler.cpp index a270d42b000..9c4eba67426 100755 --- a/src/server/game/Handlers/TicketHandler.cpp +++ b/src/server/game/Handlers/TicketHandler.cpp @@ -38,7 +38,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data) return; } - GMTicketResponse response = GMTICKET_RESPONSE_FAILURE; + GMTicketResponse response = GMTICKET_RESPONSE_CREATE_ERROR; // Player must not have ticket if (!sTicketMgr->GetTicketByPlayer(GetPlayer()->GetGUID())) { @@ -48,7 +48,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data) sWorld->SendGMText(LANG_COMMAND_TICKETNEW, GetPlayer()->GetName(), ticket->GetId()); - response = GMTICKET_RESPONSE_SUCCESS; + response = GMTICKET_RESPONSE_CREATE_SUCCESS; } WorldPacket data(SMSG_GMTICKET_CREATE, 4); @@ -61,8 +61,8 @@ void WorldSession::HandleGMTicketUpdateOpcode(WorldPacket & recv_data) std::string message; recv_data >> message; - GMTicketResponse response = GMTICKET_RESPONSE_FAILURE; - if (GmTicket *ticket = sTicketMgr->GetTicketByPlayer(GetPlayer()->GetGUID())) + GMTicketResponse response = GMTICKET_RESPONSE_UPDATE_ERROR; + if (GmTicket* ticket = sTicketMgr->GetTicketByPlayer(GetPlayer()->GetGUID())) { SQLTransaction trans = SQLTransaction(NULL); ticket->SetMessage(message); @@ -70,7 +70,7 @@ void WorldSession::HandleGMTicketUpdateOpcode(WorldPacket & recv_data) sWorld->SendGMText(LANG_COMMAND_TICKETUPDATED, GetPlayer()->GetName(), ticket->GetId()); - response = GMTICKET_RESPONSE_SUCCESS; + response = GMTICKET_RESPONSE_UPDATE_SUCCESS; } WorldPacket data(SMSG_GMTICKET_UPDATETEXT, 4); diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 716c6bec54d..37842433eb3 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -455,7 +455,7 @@ class Spell void SetAutoRepeat(bool rep) { m_autoRepeat = rep; } void ReSetTimer() { m_timer = m_casttime > 0 ? m_casttime : 0; } bool IsNextMeleeSwingSpell() const; - bool IsTriggered() const {return _triggeredCastFlags & TRIGGERED_FULL_MASK;}; + bool IsTriggered() const { return _triggeredCastFlags & TRIGGERED_FULL_MASK; }; bool IsChannelActive() const { return m_caster->GetUInt32Value(UNIT_CHANNEL_SPELL) != 0; } bool IsAutoActionResetSpell() const; diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index e4b8ea2e034..930bf0d3372 100755 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -37,19 +37,28 @@ GmTicket::GmTicket(Player* player, WorldPacket& recv_data) : _createTime(time(NU _playerName = player->GetName(); _playerGuid = player->GetGUID(); - uint32 mapId; - recv_data >> mapId; - _mapId = mapId; - + recv_data >> _mapId; recv_data >> _posX; recv_data >> _posY; recv_data >> _posZ; recv_data >> _message; + uint32 needResponse; + recv_data >> needResponse; + _needResponse = (needResponse == 17); // Requires GM response. 17 = true, 1 = false (17 is default) + uint8 unk1; + recv_data >> unk1; // Requests further GM interaction on a ticket to which a GM has already responded - uint32 unk1; - recv_data >> unk1; // not sure what this is... replyTo? - uint8 needResponse; - recv_data >> needResponse; // always 1/0 -- not sure what retail does with this + recv_data.rfinish(); + /* + recv_data >> uint32(count); // text lines + for (int i = 0; i < count; i++) + recv_data >> uint32(); + + if (something) + recv_data >> uint32(); + else + compressed uint32 + string; + */ } GmTicket::~GmTicket() { } @@ -125,11 +134,11 @@ void GmTicket::WritePacket(WorldPacket& data) const void GmTicket::SendResponse(WorldSession* session) const { WorldPacket data(SMSG_GMRESPONSE_RECEIVED); - data << uint32(1); // unk? Zor says "hasActiveTicket" - data << uint32(0); // can-edit - always 1 or 0, not flags + data << uint32(1); // responseID + data << uint32(_id); // ticketID data << _message.c_str(); data << _response.c_str(); - // 3 null strings + // 3 null strings (unused) data << uint8(0); data << uint8(0); data << uint8(0); @@ -191,7 +200,7 @@ void GmTicket::SetUnassigned() void GmTicket::TeleportTo(Player* player) const { - player->TeleportTo(_mapId, _posX, _posY, _posZ, 1, 0); + player->TeleportTo(_mapId, _posX, _posY, _posZ, 0.0f, 0); } /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -345,13 +354,13 @@ void TicketMgr::SendTicket(WorldSession* session, GmTicket* ticket) const } WorldPacket data(SMSG_GMTICKET_GETTICKET, (4 + 4 + (ticket ? message.length() + 1 + 4 + 4 + 4 + 1 + 1 : 0))); - data << uint32(status); // standard 0x0A, 0x06 if text present - data << uint32(1); // g_HasActiveGMTicket -- not a flag + data << uint32(status); // standard 0x0A, 0x06 if text present + data << uint32(ticket ? ticket->GetId() : 0); // ticketID if (ticket) { - data << message.c_str(); // ticket text - data << uint8(0x7); // ticket category; why is this hardcoded? does it make a diff re: client? + data << message.c_str(); // ticket text + data << uint8(0x7); // ticket category; why is this hardcoded? does it make a diff re: client? // we've got the easy stuff done by now. // Now we need to go through the client logic for displaying various levels of ticket load diff --git a/src/server/game/Tickets/TicketMgr.h b/src/server/game/Tickets/TicketMgr.h index 5695880542c..be8b4063d84 100755 --- a/src/server/game/Tickets/TicketMgr.h +++ b/src/server/game/Tickets/TicketMgr.h @@ -40,8 +40,11 @@ enum GMTicketStatus enum GMTicketResponse { - GMTICKET_RESPONSE_FAILURE = 1, - GMTICKET_RESPONSE_SUCCESS = 2, + GMTICKET_RESPONSE_ALREADY_EXIST = 1, + GMTICKET_RESPONSE_CREATE_SUCCESS = 2, + GMTICKET_RESPONSE_CREATE_ERROR = 3, + GMTICKET_RESPONSE_UPDATE_SUCCESS = 4, + GMTICKET_RESPONSE_UPDATE_ERROR = 5, GMTICKET_RESPONSE_TICKET_DELETED = 9, }; @@ -156,6 +159,7 @@ private: bool _completed; GMTicketEscalationStatus _escalatedStatus; bool _viewed; + bool _needResponse; // TODO: find out the use of this, and then store it in DB std::string _response; }; typedef std::map GmTicketList; From 6613cbafa6c72702d3b68c20fd79b6dbe7b96f07 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 28 Mar 2012 04:02:02 +0200 Subject: [PATCH 0331/1149] Core/Protocol: - Correct the use of first byte in SMSG_NAME_QUERY_RESPONSE - Send guid and name in SMSG_CHAR_RENAME for failing results too --- src/server/game/Handlers/CharacterHandler.cpp | 5 +- src/server/game/Handlers/QueryHandler.cpp | 50 +++++++++---------- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index f6051cd4c6e..36f61665a8a 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1119,8 +1119,10 @@ void WorldSession::HandleCharRenameOpcode(WorldPacket& recv_data) uint8 res = ObjectMgr::CheckPlayerName(newName, true); if (res != CHAR_NAME_SUCCESS) { - WorldPacket data(SMSG_CHAR_RENAME, 1); + WorldPacket data(SMSG_CHAR_RENAME, 1+8+(newName.size()+1)); data << uint8(res); + data << uint64(guid); + data << newName; SendPacket(&data); return; } @@ -1451,6 +1453,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data) std::string oldname = result->Fetch()[0].GetString(); sLog->outChar("Account: %d (IP: %s), Character[%s] (guid:%u) Customized to: %s", GetAccountId(), GetRemoteAddress().c_str(), oldname.c_str(), GUID_LOPART(guid), newName.c_str()); } + Player::Customize(guid, gender, skin, face, hairStyle, hairColor, facialHair); stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_NAME_AT_LOGIN); diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp index c907620193a..5061331b8de 100755 --- a/src/server/game/Handlers/QueryHandler.cpp +++ b/src/server/game/Handlers/QueryHandler.cpp @@ -33,42 +33,39 @@ void WorldSession::SendNameQueryOpcode(uint64 guid) { - Player* player = NULL; - const CharacterNameData* nameData = sWorld->GetCharacterNameData(GUID_LOPART(guid)); - if (nameData) - player = ObjectAccessor::FindPlayer(guid); + Player* player = ObjectAccessor::FindPlayer(guid); + CharacterNameData const* nameData = sWorld->GetCharacterNameData(GUID_LOPART(guid)); - // guess size WorldPacket data(SMSG_NAME_QUERY_RESPONSE, (8+1+1+1+1+1+10)); data.appendPackGUID(guid); - data << uint8(0); // added in 3.1 - if (nameData) + if (!player) { - data << nameData->m_name; // played name - data << uint8(0); // realm name for cross realm BG usage - data << uint8(nameData->m_race); - data << uint8(nameData->m_gender); - data << uint8(nameData->m_class); + data << uint8(1); // player unknown + SendPacket(&data); + return; } - else + if (!nameData) { - data << std::string(GetTrinityString(LANG_NON_EXIST_CHARACTER)); - data << uint32(0); + data << uint8(2); // name unknown + SendPacket(&data); + return; } - if (player) + data << uint8(0); // name known + data << nameData->m_name; // played name + data << uint8(0); // realm name - only set for cross realm interaction (such as Battlegrounds) + data << uint8(nameData->m_race); + data << uint8(nameData->m_gender); + data << uint8(nameData->m_class); + + if (DeclinedName const* names = player->GetDeclinedNames()) { - if (DeclinedName const* names = player->GetDeclinedNames()) - { - data << uint8(1); // is declined - for (int i = 0; i < MAX_DECLINED_NAME_CASES; ++i) - data << names->name[i]; - } - else - data << uint8(0); // is not declined + data << uint8(1); // Name is declined + for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i) + data << names->name[i]; } - else //TODO: decline names may also need to be stored in char name data - data << uint8(0); + else + data << uint8(0); // Name is not declined SendPacket(&data); } @@ -76,7 +73,6 @@ void WorldSession::SendNameQueryOpcode(uint64 guid) void WorldSession::HandleNameQueryOpcode(WorldPacket& recv_data) { uint64 guid; - recv_data >> guid; // This is disable by default to prevent lots of console spam From 63c4d2b96eda0f7f3e7fba2a6a009b52be01cbbd Mon Sep 17 00:00:00 2001 From: click Date: Wed, 28 Mar 2012 04:33:51 +0200 Subject: [PATCH 0332/1149] Core/DB: Adjust AP-bonuses for Hunter Volley (thanks to Jildor) --- sql/updates/world/2012_03_28_01_world_spell_bonus_data.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_03_28_01_world_spell_bonus_data.sql diff --git a/sql/updates/world/2012_03_28_01_world_spell_bonus_data.sql b/sql/updates/world/2012_03_28_01_world_spell_bonus_data.sql new file mode 100644 index 00000000000..e150cad1c2e --- /dev/null +++ b/sql/updates/world/2012_03_28_01_world_spell_bonus_data.sql @@ -0,0 +1,2 @@ +-- Hunter Volley +UPDATE `spell_bonus_data` SET `ap_bonus`=0.0837 WHERE `entry`=42243; From e050945c91f6ff5764b336df790198b59323e65e Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Wed, 28 Mar 2012 11:13:37 +0800 Subject: [PATCH 0333/1149] Core/Script: Code style and remove unused core. Signed-off-by: Gyx <2359980687@qq.com> --- .../Karazhan/boss_midnight.cpp | 8 +- .../EasternKingdoms/Karazhan/boss_moroes.cpp | 2 +- .../ScarletEnclave/chapter5.cpp | 3 +- .../EasternKingdoms/ZulAman/boss_hexlord.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_venoxis.cpp | 2 +- .../EasternKingdoms/western_plaguelands.cpp | 4 +- .../Kalimdor/RazorfenDowns/razorfen_downs.cpp | 5 +- .../scripts/Kalimdor/ZulFarrak/zulfarrak.cpp | 9 +- .../scripts/Kalimdor/azuremyst_isle.cpp | 2 +- .../scripts/Kalimdor/thousand_needles.cpp | 5 +- src/server/scripts/Kalimdor/winterspring.cpp | 4 +- .../instance_trial_of_the_crusader.cpp | 2 +- .../Northrend/Naxxramas/boss_kelthuzad.cpp | 2 +- .../Naxxramas/instance_naxxramas.cpp | 1 - .../Northrend/Nexus/Oculus/boss_urom.cpp | 2 +- .../Northrend/Nexus/Oculus/boss_varos.cpp | 4 +- .../UtgardeKeep/UtgardeKeep/utgarde_keep.cpp | 96 ++++++++++--------- src/server/scripts/Northrend/zuldrak.cpp | 2 +- .../boss_warchief_kargath_bladefist.cpp | 4 +- src/server/scripts/Outland/nagrand.cpp | 20 ++-- src/server/scripts/Outland/zangarmarsh.cpp | 1 + src/server/scripts/Spells/spell_dk.cpp | 2 +- src/server/scripts/Spells/spell_item.cpp | 8 +- .../scripts/World/boss_emerald_dragons.cpp | 2 +- 24 files changed, 95 insertions(+), 97 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp index 4e04284354e..9d863544c24 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp @@ -203,16 +203,16 @@ public: pAttumen->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); float angle = me->GetAngle(pAttumen); float distance = me->GetDistance2d(pAttumen); - float newX = me->GetPositionX() + cos(angle)*(distance/2) ; - float newY = me->GetPositionY() + sin(angle)*(distance/2) ; + float newX = me->GetPositionX() + cos(angle)*(distance/2); + float newY = me->GetPositionY() + sin(angle)*(distance/2); float newZ = 50; //me->Relocate(newX, newY, newZ, angle); //me->SendMonsterMove(newX, newY, newZ, 0, true, 1000); me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MovePoint(0, newX, newY, newZ); distance += 10; - newX = me->GetPositionX() + cos(angle)*(distance/2) ; - newY = me->GetPositionY() + sin(angle)*(distance/2) ; + newX = me->GetPositionX() + cos(angle)*(distance/2); + newY = me->GetPositionY() + sin(angle)*(distance/2); pAttumen->GetMotionMaster()->Clear(); pAttumen->GetMotionMaster()->MovePoint(0, newX, newY, newZ); //pAttumen->Relocate(newX, newY, newZ, -angle); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp index 447703aa5a7..65fb6759722 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -201,7 +201,7 @@ public: void DeSpawnAdds() { - for (uint8 i = 0; i < 4 ; ++i) + for (uint8 i = 0; i < 4; ++i) { Creature* Temp = NULL; if (AddGUID[i]) diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 8918bca637e..6f71b100bb7 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -1011,8 +1011,7 @@ public: if (fLichPositionX && fLichPositionY) { - Unit* temp; - temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); + Unit* temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); temp->SetWalk(false); temp->SetSpeed(MOVE_RUN, 2.0f); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp index fa0627df5f3..269c6fa0923 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp @@ -301,7 +301,7 @@ class boss_hexlord_malacrass : public CreatureScript me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, 0); DoPlaySoundToSet(me, SOUND_YELL_DEATH); - for (uint8 i = 0; i < 4 ; ++i) + for (uint8 i = 0; i < 4; ++i) { Unit* Temp = Unit::GetUnit((*me), AddGUID[i]); if (Temp && Temp->isAlive()) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp index f9fdd3a9587..06448032dff 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp @@ -198,7 +198,7 @@ class boss_venoxis : public CreatureScript case EVENT_HOLY_NOVA: _inMeleeRange = 0; - for (uint8 i = 0; i < 10 ; ++i) + for (uint8 i = 0; i < 10; ++i) { if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, i)) // check if target is within melee-distance diff --git a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp index f36f5b5950e..921e19039da 100644 --- a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp @@ -85,6 +85,7 @@ public: { if (creature->isQuestGiver()) player->PrepareQuestMenu(creature->GetGUID()); + if (creature->isVendor()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); @@ -95,7 +96,8 @@ public: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); player->SEND_GOSSIP_MENU(3985, creature->GetGUID()); - }else + } + else player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp index 8cef144f4c5..b84ecea4de3 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp @@ -52,7 +52,7 @@ class npc_henry_stern : public CreatureScript public: npc_henry_stern() : CreatureScript("npc_henry_stern") { } - bool OnGossipSelect (Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); if (action == GOSSIP_ACTION_INFO_DEF + 1) @@ -70,7 +70,7 @@ public: return true; } - bool OnGossipHello (Player* player, Creature* creature) + bool OnGossipHello(Player* player, Creature* creature) { if (player->GetBaseSkillValue(SKILL_COOKING) >= 175 && !player->HasSpell(SPELL_GOLDTHORN_TEA)) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); @@ -81,7 +81,6 @@ public: player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; } - }; /*###### diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp index 91d90ffe202..538a38f4a3b 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp @@ -399,9 +399,9 @@ public: enum { - ZOMBIE = 7286, - DEAD_HERO = 7276, - ZOMBIE_CHANCE = 65, + ZOMBIE = 7286, + DEAD_HERO = 7276, + ZOMBIE_CHANCE = 65, DEAD_HERO_CHANCE = 10 }; @@ -419,13 +419,12 @@ public: if (randomchance < ZOMBIE_CHANCE) go->SummonCreature(ZOMBIE, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); else - if ((randomchance-ZOMBIE_CHANCE) < DEAD_HERO_CHANCE) + if ((randomchance - ZOMBIE_CHANCE) < DEAD_HERO_CHANCE) go->SummonCreature(DEAD_HERO, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); } go->AddUse(); return false; } - }; /*###### diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp index fd86a08f06a..258e4d259fc 100644 --- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/azuremyst_isle.cpp @@ -602,7 +602,7 @@ public: ravager->AI()->AttackStart(player); } } - return true ; + return true; } }; diff --git a/src/server/scripts/Kalimdor/thousand_needles.cpp b/src/server/scripts/Kalimdor/thousand_needles.cpp index c6824447e1b..4c7c717c7e2 100644 --- a/src/server/scripts/Kalimdor/thousand_needles.cpp +++ b/src/server/scripts/Kalimdor/thousand_needles.cpp @@ -277,7 +277,6 @@ public: TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); } }; - }; /*##### @@ -316,6 +315,7 @@ public: { if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_P, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->SEND_GOSSIP_MENU(738, creature->GetGUID()); return true; @@ -410,7 +410,6 @@ public: bool OnGossipHello(Player* player, GameObject* go) { - if (player->GetQuestStatus(5151) == QUEST_STATUS_INCOMPLETE) { if (Creature* panther = go->FindNearestCreature(ENRAGED_PANTHER, 5, true)) @@ -421,7 +420,7 @@ public: } } - return true ; + return true; } }; diff --git a/src/server/scripts/Kalimdor/winterspring.cpp b/src/server/scripts/Kalimdor/winterspring.cpp index 3547b09a34b..ab5e4c4023a 100644 --- a/src/server/scripts/Kalimdor/winterspring.cpp +++ b/src/server/scripts/Kalimdor/winterspring.cpp @@ -161,12 +161,12 @@ public: { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HWDM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(3377, creature->GetGUID()); - }else + } + else player->SEND_GOSSIP_MENU(3375, creature->GetGUID()); return true; } - }; void AddSC_winterspring() diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp index 03de3d374ef..1966e26b128 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp @@ -105,7 +105,7 @@ class instance_trial_of_the_crusader : public InstanceMapScript bool IsEncounterInProgress() const { - for (uint8 i = 0; i < MAX_ENCOUNTERS ; ++i) + for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i) if (EncounterStatus[i] == IN_PROGRESS) return true; return false; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index 1a51f424dc8..93f4b58120f 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -457,7 +457,7 @@ public: { if (HealthBelowPct(45)) { - Phase = 3 ; + Phase = 3; DoScriptText(SAY_REQUEST_AID, me); //here Lich King should respond to KelThuzad but I don't know which Creature to make talk //so for now just make Kelthuzad says it. diff --git a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp index c05d9a21850..50eb52cc4c2 100644 --- a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp +++ b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp @@ -465,7 +465,6 @@ public: playerDied = buff2; } }; - }; void AddSC_instance_naxxramas() diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp index 357b0bad13c..b96d7c4aa84 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp @@ -203,7 +203,7 @@ public: if (!instance || instance->GetData(DATA_UROM_PLATAFORM) > 2) return; - for (uint8 i = 0; i < 4 ; i++) + for (uint8 i = 0; i < 4; i++) { SetPosition(i); me->SummonCreature(Group[group[instance->GetData(DATA_UROM_PLATAFORM)]].entry[i], x, y, me->GetPositionZ(), me->GetOrientation()); diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp index 7ebaac1e938..19a84fdae84 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp @@ -308,7 +308,7 @@ class spell_varos_energize_core_area_enemy : public SpellScriptLoader float orientation = CAST_AI(boss_varos::boss_varosAI, varos->AI())->GetCoreEnergizeOrientation(); - for (std::list::iterator itr = targetList.begin() ; itr != targetList.end();) + for (std::list::iterator itr = targetList.begin(); itr != targetList.end();) { Position pos; (*itr)->GetPosition(&pos); @@ -355,7 +355,7 @@ class spell_varos_energize_core_area_entry : public SpellScriptLoader float orientation = CAST_AI(boss_varos::boss_varosAI, varos->AI())->GetCoreEnergizeOrientation(); - for (std::list::iterator itr = targetList.begin() ; itr != targetList.end();) + for (std::list::iterator itr = targetList.begin(); itr != targetList.end();) { Position pos; (*itr)->GetPosition(&pos); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp index 50417b0ac07..95d2cb1709e 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp @@ -48,65 +48,77 @@ public: void Reset() { - if (fm_Type == 0) fm_Type = GetForgeMasterType(); + if (fm_Type == 0) + fm_Type = GetForgeMasterType(); + CheckForge(); } void CheckForge() { - if (instance) + if (instance) { switch (fm_Type) { - case 1: - instance->SetData(EVENT_FORGE_1, me->isAlive() ? NOT_STARTED : DONE); - break; - case 2: - instance->SetData(EVENT_FORGE_2, me->isAlive() ? NOT_STARTED : DONE); - break; - case 3: - instance->SetData(EVENT_FORGE_3, me->isAlive() ? NOT_STARTED : DONE); - break; + case 1: + instance->SetData(EVENT_FORGE_1, me->isAlive() ? NOT_STARTED : DONE); + break; + + case 2: + instance->SetData(EVENT_FORGE_2, me->isAlive() ? NOT_STARTED : DONE); + break; + + case 3: + instance->SetData(EVENT_FORGE_3, me->isAlive() ? NOT_STARTED : DONE); + break; } } } void JustDied(Unit* /*killer*/) { - if (fm_Type == 0) fm_Type = GetForgeMasterType(); + if (fm_Type == 0) + fm_Type = GetForgeMasterType(); + if (instance) { switch (fm_Type) { - case 1: - instance->SetData(EVENT_FORGE_1, DONE); - break; - case 2: - instance->SetData(EVENT_FORGE_2, DONE); - break; - case 3: - instance->SetData(EVENT_FORGE_3, DONE); - break; + case 1: + instance->SetData(EVENT_FORGE_1, DONE); + break; + + case 2: + instance->SetData(EVENT_FORGE_2, DONE); + break; + + case 3: + instance->SetData(EVENT_FORGE_3, DONE); + break; } } } void EnterCombat(Unit* /*who*/) { - if (fm_Type == 0) fm_Type = GetForgeMasterType(); + if (fm_Type == 0) + fm_Type = GetForgeMasterType(); + if (instance) { switch (fm_Type) { - case 1: - instance->SetData(EVENT_FORGE_1, IN_PROGRESS); - break; - case 2: - instance->SetData(EVENT_FORGE_2, IN_PROGRESS); - break; - case 3: - instance->SetData(EVENT_FORGE_3, IN_PROGRESS); - break; + case 1: + instance->SetData(EVENT_FORGE_1, IN_PROGRESS); + break; + + case 2: + instance->SetData(EVENT_FORGE_2, IN_PROGRESS); + break; + + case 3: + instance->SetData(EVENT_FORGE_3, IN_PROGRESS); + break; } } me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); @@ -115,29 +127,26 @@ public: uint8 GetForgeMasterType() { float diff = 30.0f; - int near_f = 0; + uint8 near_f = 0; - for (uint8 i = 0; i < 3 ; ++i) + for (uint8 i = 0; i < 3; ++i) { - GameObject* temp; - temp = me->FindNearestGameObject(entry_search[i], 30); - if (temp) + if (GameObject* go = me->FindNearestGameObject(entry_search[i], 30)) { - if (me->IsWithinDist(temp, diff, false)) + if (me->IsWithinDist(go, diff, false)) { near_f = i + 1; - diff = me->GetDistance2d(temp); - + diff = me->GetDistance2d(go); } } } switch (near_f) { - case 1: return 1; - case 2: return 2; - case 3: return 3; - default: return 0; + case 1: return 1; + case 2: return 2; + case 3: return 3; + default: return 0; } } @@ -152,7 +161,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_utgarde_keep() diff --git a/src/server/scripts/Northrend/zuldrak.cpp b/src/server/scripts/Northrend/zuldrak.cpp index 33d295e5970..f0e8ce9b2c1 100644 --- a/src/server/scripts/Northrend/zuldrak.cpp +++ b/src/server/scripts/Northrend/zuldrak.cpp @@ -1071,7 +1071,7 @@ public: SummonList.clear(); - for (uint8 uiI = 0; uiI < 16 ; uiI++) + for (uint8 uiI = 0; uiI < 16; uiI++) { if (Creature* summon = me->SummonCreature(Boss[uiBossRandom].uiAdd, AddSpawnPosition[uiI])) { diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp index 1e80a1b7c99..a6b1d4772b9 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp @@ -236,8 +236,8 @@ class boss_warchief_kargath_bladefist : public CreatureScript float x, y, randx, randy; randx = 0.0f + rand()%40; randy = 0.0f + rand()%40; - x = 210+ randx ; - y = -60- randy ; + x = 210+ randx; + y = -60- randy; me->GetMotionMaster()->MovePoint(1, x, y, me->GetPositionZ()); Wait_Timer = 0; } diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp index a89d06072a7..50cc1a00e47 100644 --- a/src/server/scripts/Outland/nagrand.cpp +++ b/src/server/scripts/Outland/nagrand.cpp @@ -90,7 +90,6 @@ public: player->AreaExploredOrEventHappens(10044); player->CLOSE_GOSSIP_MENU(); break; - case GOSSIP_ACTION_INFO_DEF + 10: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); @@ -135,12 +134,10 @@ public: player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); } else - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; } - }; /*##### @@ -235,7 +232,6 @@ public: DoScriptText(SAY_MAG_MORE_REPLY, temp); me->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushB[0]-2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - me->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]+2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); break; @@ -311,7 +307,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -356,7 +351,6 @@ public: } } }; - }; /*###### @@ -401,6 +395,7 @@ public: player->KilledMonsterCredit(NPC_CORKI_CREDIT_1, 0); } } + if (go->GetEntry() == GO_CORKIS_PRISON_2) { if (Creature* corki = go->FindNearestCreature(NPC_CORKI_2, 25, true)) @@ -411,6 +406,7 @@ public: player->KilledMonsterCredit(NPC_CORKI_2, 0); } } + if (go->GetEntry() == GO_CORKIS_PRISON_3) { if (Creature* corki = go->FindNearestCreature(NPC_CORKI_3, 25, true)) @@ -689,15 +685,11 @@ class go_warmaul_prison : public GameObjectScript if (Creature* prisoner = go->FindNearestCreature(NPC_MAGHAR_PRISONER, 5.0f)) { - if (prisoner) - { - go->UseDoorOrButton(); - if (player) - player->KilledMonsterCredit(NPC_MAGHAR_PRISONER, 0); + go->UseDoorOrButton(); + player->KilledMonsterCredit(NPC_MAGHAR_PRISONER, 0); - prisoner->AI()->Talk(SAY_FREE, player->GetGUID()); - prisoner->ForcedDespawn(6000); - } + prisoner->AI()->Talk(SAY_FREE, player->GetGUID()); + prisoner->ForcedDespawn(6000); } return true; } diff --git a/src/server/scripts/Outland/zangarmarsh.cpp b/src/server/scripts/Outland/zangarmarsh.cpp index 296c95dcbd7..7557de9ca36 100644 --- a/src/server/scripts/Outland/zangarmarsh.cpp +++ b/src/server/scripts/Outland/zangarmarsh.cpp @@ -56,6 +56,7 @@ public: { if (creature->GetEntry() == 17900) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BLESS_ASH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + if (creature->GetEntry() == 17901) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BLESS_KEL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); } diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index ddbdf6db36e..5d874faf411 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -337,7 +337,7 @@ class spell_dk_death_pact : public SpellScriptLoader void FilterTargets(std::list& unitList) { Unit* unit_to_add = NULL; - for (std::list::iterator itr = unitList.begin() ; itr != unitList.end(); ++itr) + for (std::list::iterator itr = unitList.begin(); itr != unitList.end(); ++itr) { if ((*itr)->GetTypeId() == TYPEID_UNIT && (*itr)->GetOwnerGUID() == GetCaster()->GetGUID() diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index f2f2f9e3cdd..666477e68e7 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1589,15 +1589,15 @@ class spell_item_brewfest_mount_transformation : public SpellScriptLoader { case SPELL_BREWFEST_MOUNT_TRANSFORM: if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f) - spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100 ; + spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100; else - spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60 ; + spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60; break; case SPELL_BREWFEST_MOUNT_TRANSFORM_REVERSE: if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f) - spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100 ; + spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100; else - spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60 ; + spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60; break; default: return; diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp index a844e500ce5..045dea9c9a9 100644 --- a/src/server/scripts/World/boss_emerald_dragons.cpp +++ b/src/server/scripts/World/boss_emerald_dragons.cpp @@ -371,7 +371,7 @@ class boss_ysondre : public CreatureScript { Talk(SAY_YSONDRE_SUMMON_DRUIDS); - for (uint8 i = 0 ; i < 10 ; ++i) + for (uint8 i = 0; i < 10; ++i) DoCast(me, SPELL_SUMMON_DRUID_SPIRITS, true); ++_stage; } From a20fa23ea6e151220678e51a790fbab599db32d9 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Wed, 28 Mar 2012 15:15:48 +0800 Subject: [PATCH 0334/1149] Core/Script: Code style and remove unused core. Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/World/World.cpp | 7 +- .../ScarletEnclave/chapter2.cpp | 2 - .../EasternKingdoms/arathi_highlands.cpp | 3 +- .../scripts/EasternKingdoms/ghostlands.cpp | 101 ++++++++++-------- .../scripts/EasternKingdoms/hinterlands.cpp | 2 +- .../EasternKingdoms/silverpine_forest.cpp | 53 ++++++--- .../EasternKingdoms/western_plaguelands.cpp | 3 +- .../scripts/EasternKingdoms/westfall.cpp | 6 +- .../scripts/Examples/example_escort.cpp | 2 - .../Kalimdor/RazorfenKraul/razorfen_kraul.cpp | 2 +- src/server/scripts/Kalimdor/ashenvale.cpp | 50 +++------ src/server/scripts/Kalimdor/desolace.cpp | 5 +- .../scripts/Kalimdor/dustwallow_marsh.cpp | 7 +- src/server/scripts/Kalimdor/feralas.cpp | 4 +- .../scripts/Kalimdor/stonetalon_mountains.cpp | 21 ++-- src/server/scripts/Kalimdor/tanaris.cpp | 11 +- src/server/scripts/Kalimdor/the_barrens.cpp | 5 - src/server/scripts/Kalimdor/ungoro_crater.cpp | 3 +- .../scripts/Northrend/borean_tundra.cpp | 3 +- .../scripts/Northrend/grizzly_hills.cpp | 1 + .../scripts/Northrend/howling_fjord.cpp | 4 +- .../scripts/Northrend/sholazar_basin.cpp | 8 +- src/server/scripts/Northrend/storm_peaks.cpp | 15 +-- src/server/scripts/Outland/netherstorm.cpp | 9 +- .../scripts/Outland/shadowmoon_valley.cpp | 1 - src/server/scripts/Outland/shattrath_city.cpp | 6 +- .../scripts/Outland/terokkar_forest.cpp | 51 +++++---- 27 files changed, 193 insertions(+), 192 deletions(-) diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 489278f63e6..3e730bd27af 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -207,6 +207,7 @@ bool World::RemoveSession(uint32 id) { if (itr->second->PlayerLoading()) return false; + itr->second->KickPlayer(); } @@ -218,8 +219,7 @@ void World::AddSession(WorldSession* s) addSessQueue.add(s); } -void -World::AddSession_(WorldSession* s) +void World::AddSession_(WorldSession* s) { ASSERT (s); @@ -272,11 +272,8 @@ World::AddSession_(WorldSession* s) } s->SendAuthResponse(AUTH_OK, true); - s->SendAddonsInfo(); - s->SendClientCacheVersion(sWorld->getIntConfig(CONFIG_CLIENTCACHE_VERSION)); - s->SendTutorialsData(); UpdateMaxSessionCounters(); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index bd5cec9e3cb..bf208baf873 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -277,9 +277,7 @@ public: void JustSummoned(Creature* summoned) { if (Player* player = GetPlayerForEscort()) - { summoned->AI()->AttackStart(player); - } if (summoned->GetEntry() == NPC_HIGH_INQUISITOR_VALROTH) m_uiValrothGUID = summoned->GetGUID(); diff --git a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp index 6e8a354ef58..b53770badab 100644 --- a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp @@ -99,8 +99,7 @@ class npc_professor_phizzlethorpe : public CreatureScript case 20: Talk(EMOTE_PROGRESS_8); Talk(SAY_PROGRESS_9, player->GetGUID()); - if (player) - CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me); + CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me); break; } } diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/ghostlands.cpp index 841e577e333..8859dff1c77 100644 --- a/src/server/scripts/EasternKingdoms/ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/ghostlands.cpp @@ -139,52 +139,61 @@ public: switch (i) { - case 0: - { - me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) - Cage->SetGoState(GO_STATE_ACTIVE); - DoScriptText(SAY_START, me, player); - break; - } - case 5: - DoScriptText(SAY_PROGRESS1, me, player); - case 11: - DoScriptText(SAY_PROGRESS2, me, player); - me->SetOrientation(4.762841f); - break; - case 18: - { - DoScriptText(SAY_PROGRESS3, me, player); - Creature* Summ1 = me->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0); - Creature* Summ2 = me->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0); - if (Summ1 && Summ2) - { - Summ1->Attack(me, true); - Summ2->Attack(player, true); - } - me->AI()->AttackStart(Summ1); - break; - } - case 19: me->SetWalk(false); - break; - case 25: me->SetWalk(true); - break; - case 30: - if (player && player->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me); - break; - case 32: - me->SetOrientation(2.978281f); - DoScriptText(SAY_END1, me, player); - break; - case 33: - me->SetOrientation(5.858011f); - DoScriptText(SAY_END2, me, player); - Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50); - if (CaptainHelios) - DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player); - break; + case 0: + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) + Cage->SetGoState(GO_STATE_ACTIVE); + DoScriptText(SAY_START, me, player); + break; + + case 5: + DoScriptText(SAY_PROGRESS1, me, player); + break; + + case 11: + DoScriptText(SAY_PROGRESS2, me, player); + me->SetOrientation(4.762841f); + break; + + case 18: + { + DoScriptText(SAY_PROGRESS3, me, player); + Creature* Summ1 = me->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0); + Creature* Summ2 = me->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0); + if (Summ1 && Summ2) + { + Summ1->Attack(me, true); + Summ2->Attack(player, true); + } + me->AI()->AttackStart(Summ1); + } + break; + + case 19: + me->SetWalk(false); + break; + + case 25: + me->SetWalk(true); + break; + + case 30: + if (player->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me); + break; + + case 32: + me->SetOrientation(2.978281f); + DoScriptText(SAY_END1, me, player); + break; + + case 33: + me->SetOrientation(5.858011f); + DoScriptText(SAY_END2, me, player); + Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50); + if (CaptainHelios) + DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player); + break; } } diff --git a/src/server/scripts/EasternKingdoms/hinterlands.cpp b/src/server/scripts/EasternKingdoms/hinterlands.cpp index 08abdc26725..f217cb2a0dd 100644 --- a/src/server/scripts/EasternKingdoms/hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/hinterlands.cpp @@ -314,7 +314,7 @@ public: { m_uiPostEventTimer = 3000; - if (Unit* player = GetPlayerForEscort()) + if (Player* player = GetPlayerForEscort()) { switch (m_uiPostEventCount) { diff --git a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp index ad76f29a634..88df13ffc26 100644 --- a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp @@ -75,25 +75,44 @@ public: switch (i) { - case 1: DoScriptText(SAY_START, me, player);break; - case 13: - DoScriptText(SAY_LAST, me, player); - player->GroupEventHappens(QUEST_ESCORTING, me); break; - case 14: DoScriptText(SAY_THANKS, me, player); break; - case 15: { - Unit* Rane = me->FindNearestCreature(NPC_RANE, 20); - if (Rane) + case 1: + DoScriptText(SAY_START, me, player); + break; + + case 13: + DoScriptText(SAY_LAST, me, player); + player->GroupEventHappens(QUEST_ESCORTING, me); + break; + + case 14: + DoScriptText(SAY_THANKS, me, player); + break; + + case 15: + if (Unit* Rane = me->FindNearestCreature(NPC_RANE, 20)) DoScriptText(SAY_RANE, Rane); - break;} - case 16: DoScriptText(SAY_ANSWER, me); break; - case 17: DoScriptText(SAY_MOVE_QUINN, me); break; - case 24: DoScriptText(SAY_GREETINGS, me); break; - case 25: { - Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20); - if (Quinn) + break; + + case 16: + DoScriptText(SAY_ANSWER, me); + break; + + case 17: + DoScriptText(SAY_MOVE_QUINN, me); + break; + + case 24: + DoScriptText(SAY_GREETINGS, me); + break; + + case 25: + if (Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20)) DoScriptText(SAY_QUINN, Quinn); - break;} - case 26: DoScriptText(SAY_ON_BYE, me, NULL); break; + break; + + case 26: + DoScriptText(SAY_ON_BYE, me, NULL); + break; } } diff --git a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp index 921e19039da..94b5b070992 100644 --- a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp @@ -380,8 +380,7 @@ public: void JustDied(Unit* /*killer*/) { - Player* player = GetPlayerForEscort(); - if (player) + if (Player* player = GetPlayerForEscort()) player->FailQuest(QUEST_TOMB_LIGHTBRINGER); } diff --git a/src/server/scripts/EasternKingdoms/westfall.cpp b/src/server/scripts/EasternKingdoms/westfall.cpp index 2285d3877e4..c8d2afc3375 100644 --- a/src/server/scripts/EasternKingdoms/westfall.cpp +++ b/src/server/scripts/EasternKingdoms/westfall.cpp @@ -243,13 +243,11 @@ public: break; case 44: DoScriptText(SAY_END, me, player); - { - if (player) - player->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD, me); - } + player->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD, me); break; } } + void EnterCombat(Unit* who) { DoScriptText(RAND(SAY_AGGRO_1, SAY_AGGRO_2), me, who); diff --git a/src/server/scripts/Examples/example_escort.cpp b/src/server/scripts/Examples/example_escort.cpp index e22c2f85506..76c4f793a42 100644 --- a/src/server/scripts/Examples/example_escort.cpp +++ b/src/server/scripts/Examples/example_escort.cpp @@ -123,9 +123,7 @@ class example_escort : public CreatureScript { // not a likely case, code here for the sake of example if (killer == me) - { DoScriptText(SAY_DEATH_1, me, player); - } else DoScriptText(SAY_DEATH_2, me, player); } diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp index 747a2f2880f..789e7096433 100644 --- a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp +++ b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp @@ -115,7 +115,7 @@ public: case 45: DoScriptText(SAY_WIN, me, player); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - if (player && player->GetTypeId() == TYPEID_PLAYER) + if (player->GetTypeId() == TYPEID_PLAYER) CAST_PLR(player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER, me); break; case 46: diff --git a/src/server/scripts/Kalimdor/ashenvale.cpp b/src/server/scripts/Kalimdor/ashenvale.cpp index 9d0423181de..08b9778cf49 100644 --- a/src/server/scripts/Kalimdor/ashenvale.cpp +++ b/src/server/scripts/Kalimdor/ashenvale.cpp @@ -100,8 +100,7 @@ class npc_torek : public CreatureScript case 20: DoScriptText(SAY_WIN, me, player); Completed = true; - if (player) - player->GroupEventHappens(QUEST_TOREK_ASSULT, me); + player->GroupEventHappens(QUEST_TOREK_ASSULT, me); break; case 21: Talk(SAY_END, player->GetGUID()); @@ -177,47 +176,41 @@ class npc_torek : public CreatureScript class npc_ruul_snowhoof : public CreatureScript { public: - - npc_ruul_snowhoof() - : CreatureScript("npc_ruul_snowhoof") - { - } + npc_ruul_snowhoof() : CreatureScript("npc_ruul_snowhoof") { } struct npc_ruul_snowhoofAI : public npc_escortAI { - npc_ruul_snowhoofAI(Creature* creature) : npc_escortAI(creature) {} + npc_ruul_snowhoofAI(Creature* creature) : npc_escortAI(creature) { } void WaypointReached(uint32 i) { Player* player = GetPlayerForEscort(); - if (!player) return; switch (i) { - case 0: { + case 0: me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20); - if (Cage) + if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) Cage->SetGoState(GO_STATE_ACTIVE); - break;} - case 13: + break; + + case 13: me->SummonCreature(3922, 3449.218018f, -587.825073f, 174.978867f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); me->SummonCreature(3921, 3446.384521f, -587.830872f, 175.186279f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); me->SummonCreature(3926, 3444.218994f, -587.835327f, 175.380600f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); break; - case 19: + + case 19: me->SummonCreature(3922, 3508.344482f, -492.024261f, 186.929031f, 4.145029f, TEMPSUMMON_DEAD_DESPAWN, 60000); me->SummonCreature(3921, 3506.265625f, -490.531006f, 186.740128f, 4.239277f, TEMPSUMMON_DEAD_DESPAWN, 60000); me->SummonCreature(3926, 3503.682373f, -489.393799f, 186.629684f, 4.349232f, TEMPSUMMON_DEAD_DESPAWN, 60000); break; - case 21:{ - if (player) - player->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, me); - - break; } + case 21: + player->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, me); + break; } } @@ -330,12 +323,10 @@ class npc_muglash : public CreatureScript switch (i) { case 0: - if (player) - DoScriptText(SAY_MUG_START2, me, player); + DoScriptText(SAY_MUG_START2, me, player); break; case 24: - if (player) - DoScriptText(SAY_MUG_BRAZIER, me, player); + DoScriptText(SAY_MUG_BRAZIER, me, player); if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_NAGA_BRAZIER, INTERACTION_DISTANCE*2)) { @@ -345,9 +336,7 @@ class npc_muglash : public CreatureScript break; case 25: DoScriptText(SAY_MUG_GRATITUDE, me); - - if (player) - player->GroupEventHappens(QUEST_VORSHA, me); + player->GroupEventHappens(QUEST_VORSHA, me); break; case 26: DoScriptText(SAY_MUG_PATROL, me); @@ -378,14 +367,9 @@ class npc_muglash : public CreatureScript void JustDied(Unit* /*killer*/) { - Player* player = GetPlayerForEscort(); if (HasEscortState(STATE_ESCORT_ESCORTING)) - { - if (player) - { + if (Player* player = GetPlayerForEscort()) player->FailQuest(QUEST_VORSHA); - } - } } void DoWaveSummon() diff --git a/src/server/scripts/Kalimdor/desolace.cpp b/src/server/scripts/Kalimdor/desolace.cpp index 49a9be21a98..fa337a9cf3c 100644 --- a/src/server/scripts/Kalimdor/desolace.cpp +++ b/src/server/scripts/Kalimdor/desolace.cpp @@ -238,7 +238,7 @@ public: break; case 15: if (player) - player->GroupEventHappens(QUEST_RETURN_TO_VAHLARRIEL, me); + player->GroupEventHappens(QUEST_RETURN_TO_VAHLARRIEL, me); break; } } @@ -249,8 +249,7 @@ public: void JustDied(Unit* /*killer*/) { - Player* player = GetPlayerForEscort(); - if (player) + if (Player* player = GetPlayerForEscort()) player->FailQuest(QUEST_RETURN_TO_VAHLARRIEL); return; } diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp index 94702a85d64..04c4d2922f1 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp @@ -641,9 +641,9 @@ public: DoScriptText(SAY_QUEST_COMPLETE, me, player); me->SetSpeed(MOVE_RUN, 1.2f, true); me->SetWalk(false); - if (player && player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H)) + if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H)) player->GroupEventHappens(QUEST_STINKYS_ESCAPE_H, me); - if (player && player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A)) + if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A)) player->GroupEventHappens(QUEST_STINKYS_ESCAPE_A, me); break; case 39: @@ -663,10 +663,11 @@ public: void JustDied(Unit* /*killer*/) { Player* player = GetPlayerForEscort(); - if (HasEscortState(STATE_ESCORT_ESCORTING) && player) + if (player && HasEscortState(STATE_ESCORT_ESCORTING)) { if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H)) player->FailQuest(QUEST_STINKYS_ESCAPE_H); + if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A)) player->FailQuest(QUEST_STINKYS_ESCAPE_A); } diff --git a/src/server/scripts/Kalimdor/feralas.cpp b/src/server/scripts/Kalimdor/feralas.cpp index 82e85c16564..01193b66e30 100644 --- a/src/server/scripts/Kalimdor/feralas.cpp +++ b/src/server/scripts/Kalimdor/feralas.cpp @@ -154,9 +154,7 @@ public: DoScriptText(SAY_OOX_END, me); // Award quest credit if (Player* player = GetPlayerForEscort()) - { - player->GroupEventHappens(QUEST_RESCUE_OOX22FE, me); - } + player->GroupEventHappens(QUEST_RESCUE_OOX22FE, me); break; } } diff --git a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp index 0141564a140..e887f076e29 100644 --- a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp +++ b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp @@ -123,17 +123,18 @@ public: switch (i) { - case 16: - DoScriptText(SAY_AMBUSH, me); - me->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53f, -503.34f, -46.31f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85f, -503.77f, -45.90f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37f, -496.23f, -45.71f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 18: me->SetInFront(player); - DoScriptText(SAY_END, me, player); - if (player) + case 16: + DoScriptText(SAY_AMBUSH, me); + me->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53f, -503.34f, -46.31f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85f, -503.77f, -45.90f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37f, -496.23f, -45.71f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + + case 18: + me->SetInFront(player); + DoScriptText(SAY_END, me, player); player->GroupEventHappens(QUEST_PROTECT_KAYA, me); - break; + break; } } diff --git a/src/server/scripts/Kalimdor/tanaris.cpp b/src/server/scripts/Kalimdor/tanaris.cpp index c1a5d9de10e..204668b086d 100644 --- a/src/server/scripts/Kalimdor/tanaris.cpp +++ b/src/server/scripts/Kalimdor/tanaris.cpp @@ -435,7 +435,8 @@ public: if (!player) return; - switch (i) { + switch (i) + { case 23: me->SummonCreature(SPAWN_FIRST, -8350.96f, -4445.79f, 10.10f, 6.20f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(SPAWN_FIRST, -8355.96f, -4447.79f, 10.10f, 6.27f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); @@ -453,11 +454,8 @@ public: break; case 86: - if (player) - { - DoScriptText(SAY_OOX_END, me); - player->GroupEventHappens(Q_OOX17, me); - } + DoScriptText(SAY_OOX_END, me); + player->GroupEventHappens(Q_OOX17, me); break; } } @@ -474,7 +472,6 @@ public: summoned->AI()->AttackStart(me); } }; - }; /*#### diff --git a/src/server/scripts/Kalimdor/the_barrens.cpp b/src/server/scripts/Kalimdor/the_barrens.cpp index 89f1ac3e7a5..27f3f1fd52b 100644 --- a/src/server/scripts/Kalimdor/the_barrens.cpp +++ b/src/server/scripts/Kalimdor/the_barrens.cpp @@ -595,11 +595,6 @@ public: void WaypointReached(uint32 uiPointId) { - Player* player = GetPlayerForEscort(); - - if (!player) - return; - switch (uiPointId) { case 0: diff --git a/src/server/scripts/Kalimdor/ungoro_crater.cpp b/src/server/scripts/Kalimdor/ungoro_crater.cpp index fc720f04ad1..2ca932de169 100644 --- a/src/server/scripts/Kalimdor/ungoro_crater.cpp +++ b/src/server/scripts/Kalimdor/ungoro_crater.cpp @@ -104,8 +104,7 @@ public: break; case 55: DoScriptText(SAY_FINISH, me, player); - if (player) - player->GroupEventHappens(QUEST_CHASING_AME, me); + player->GroupEventHappens(QUEST_CHASING_AME, me); break; } } diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index 6b6a58f7b38..6c1b5ca36d2 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -1876,8 +1876,7 @@ public: me->SetPhaseMask(1, true); DoScriptText(SAY_5, me); me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); - if (player) - player->GroupEventHappens(QUEST_ESCAPING_THE_MIST, me); + player->GroupEventHappens(QUEST_ESCAPING_THE_MIST, me); SetRun(true); break; } diff --git a/src/server/scripts/Northrend/grizzly_hills.cpp b/src/server/scripts/Northrend/grizzly_hills.cpp index bf130bc0355..07fb398ff8a 100644 --- a/src/server/scripts/Northrend/grizzly_hills.cpp +++ b/src/server/scripts/Northrend/grizzly_hills.cpp @@ -79,6 +79,7 @@ public: Player* player = GetPlayerForEscort(); if (!player) return; + switch (i) { case 9: diff --git a/src/server/scripts/Northrend/howling_fjord.cpp b/src/server/scripts/Northrend/howling_fjord.cpp index 49bf06f55c4..86fc4a50b6c 100644 --- a/src/server/scripts/Northrend/howling_fjord.cpp +++ b/src/server/scripts/Northrend/howling_fjord.cpp @@ -102,6 +102,7 @@ public: Player* player = GetPlayerForEscort(); if (!player) return; + switch (i) { case 1: @@ -109,8 +110,7 @@ public: SetRun(true); break; case 23: - if (player) - player->GroupEventHappens(QUEST_TRAIL_OF_FIRE, me); + player->GroupEventHappens(QUEST_TRAIL_OF_FIRE, me); me->DespawnOrUnsummon(); break; case 5: diff --git a/src/server/scripts/Northrend/sholazar_basin.cpp b/src/server/scripts/Northrend/sholazar_basin.cpp index 1f00ca51d0b..afc742c9f7e 100644 --- a/src/server/scripts/Northrend/sholazar_basin.cpp +++ b/src/server/scripts/Northrend/sholazar_basin.cpp @@ -113,8 +113,8 @@ public: if (Player* player = GetPlayerForEscort()) { - if (player->GetQuestStatus(QUEST_FORTUNATE_MISUNDERSTANDINGS) != QUEST_STATUS_COMPLETE) - player->FailQuest(QUEST_FORTUNATE_MISUNDERSTANDINGS); + if (player->GetQuestStatus(QUEST_FORTUNATE_MISUNDERSTANDINGS) != QUEST_STATUS_COMPLETE) + player->FailQuest(QUEST_FORTUNATE_MISUNDERSTANDINGS); } } }; @@ -401,12 +401,12 @@ public: { m_uiChatTimer = 4000; } + void JustDied(Unit* /*killer*/) { - Player* player = GetPlayerForEscort(); if (HasEscortState(STATE_ESCORT_ESCORTING)) { - if (player) + if (Player* player = GetPlayerForEscort()) player->FailQuest(QUEST_DISASTER); } } diff --git a/src/server/scripts/Northrend/storm_peaks.cpp b/src/server/scripts/Northrend/storm_peaks.cpp index 8e7d66a33c1..8253e2615cf 100644 --- a/src/server/scripts/Northrend/storm_peaks.cpp +++ b/src/server/scripts/Northrend/storm_peaks.cpp @@ -377,15 +377,18 @@ public: void WaypointReached(uint32 i) { Player* player = GetPlayerForEscort(); + if (!player) + return; + switch (i) { - case 26: - DoScriptText(SAY_END_WP_REACHED, me, player); - break; - case 27: - if (player) + case 26: + DoScriptText(SAY_END_WP_REACHED, me, player); + break; + + case 27: player->GroupEventHappens(QUEST_BITTER_DEPARTURE, me); - break; + break; } } diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp index 5bd6ff795eb..dc401ac3c7a 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/netherstorm.cpp @@ -910,8 +910,7 @@ public: break; case 12: - if (player) - player->GroupEventHappens(Q_ALMABTRIEB, me); + player->GroupEventHappens(Q_ALMABTRIEB, me); if (me->FindNearestCreature(N_THADELL, 30)) DoScriptText(SAY_THADELL_1, me); break; case 13: @@ -986,16 +985,14 @@ public: } break; case 36: //return and quest_complete - if (player) - player->CompleteQuest(QUEST_MARK_V_IS_ALIVE); + player->CompleteQuest(QUEST_MARK_V_IS_ALIVE); break; } } void JustDied(Unit* /*killer*/) { - Player* player = GetPlayerForEscort(); - if (player) + if (Player* player = GetPlayerForEscort()) player->FailQuest(QUEST_MARK_V_IS_ALIVE); } diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index 96b1247c152..059373c6589 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -1108,7 +1108,6 @@ public: break; case 50: DoScriptText(SAY_WIL_END, me, player); - player->GroupEventHappens(QUEST_ESCAPE_COILSCAR, me); break; } diff --git a/src/server/scripts/Outland/shattrath_city.cpp b/src/server/scripts/Outland/shattrath_city.cpp index f5d725364c0..639c0c25cf4 100644 --- a/src/server/scripts/Outland/shattrath_city.cpp +++ b/src/server/scripts/Outland/shattrath_city.cpp @@ -349,9 +349,9 @@ public: case 53: DoScriptText(WHISP18, me, player); break; case 54: DoScriptText(WHISP19, me, player); break; case 55: DoScriptText(WHISP20, me, player); break; - case 56: DoScriptText(WHISP21, me, player); - if (player) - player->GroupEventHappens(10211, me); + case 56: + DoScriptText(WHISP21, me, player); + player->GroupEventHappens(10211, me); break; } } diff --git a/src/server/scripts/Outland/terokkar_forest.cpp b/src/server/scripts/Outland/terokkar_forest.cpp index 67852e9be84..87cbf095848 100644 --- a/src/server/scripts/Outland/terokkar_forest.cpp +++ b/src/server/scripts/Outland/terokkar_forest.cpp @@ -470,29 +470,40 @@ public: switch (i) { - case 0: - { - GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10); - if (Cage) - Cage->SetGoState(GO_STATE_ACTIVE); - } - break; - case 2: DoScriptText(SAY_PROGRESS_1, me, player); break; - case 5: DoScriptText(SAY_PROGRESS_2, me, player); break; - case 6: DoScriptText(SAY_PROGRESS_3, me, player); break; - case 29:DoScriptText(SAY_PROGRESS_4, me, player); - if (player) - { + case 0: + if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10)) + Cage->SetGoState(GO_STATE_ACTIVE); + break; + + case 2: + DoScriptText(SAY_PROGRESS_1, me, player); + break; + + case 5: + DoScriptText(SAY_PROGRESS_2, me, player); + break; + + case 6: + DoScriptText(SAY_PROGRESS_3, me, player); + break; + + case 29: + DoScriptText(SAY_PROGRESS_4, me, player); if (player->GetTeam() == ALLIANCE) player->GroupEventHappens(QUEST_EFTW_A, me); else if (player->GetTeam() == HORDE) player->GroupEventHappens(QUEST_EFTW_H, me); - } - me->SetInFront(player); break; - case 30: me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break; - case 31: DoCast(me, SPELL_CAT); - me->SetWalk(false); - break; + me->SetInFront(player); + break; + + case 30: + me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); + break; + + case 31: + DoCast(me, SPELL_CAT); + me->SetWalk(false); + break; } } @@ -676,7 +687,7 @@ public: me->SummonCreature(NPC_CABAL_SKRIMISHER, -2793.55f, 5412.79f, -34.53f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); break; case 11: - if (player && player->GetTypeId() == TYPEID_PLAYER) + if (player->GetTypeId() == TYPEID_PLAYER) player->GroupEventHappens(QUEST_ESCAPING_THE_TOMB, me); break; } From c3db19b80b0a61ea2d7c5c2102ec35cfd75a0d52 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Wed, 28 Mar 2012 13:06:02 +0300 Subject: [PATCH 0335/1149] Core/Player: Initialize m_WeeklyQuestChanged Fixes: ==8111== Conditional jump or move depends on uninitialised value(s) ==8111== at 0xFB7AD2: Player::_SaveWeeklyQuestStatus(Trinity::AutoPtr&) (Player.cpp:19352) --- src/server/game/Entities/Player/Player.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 26f248aa961..7d513c36c99 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -858,6 +858,8 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep isDebugAreaTriggers = false; + m_WeeklyQuestChanged = false; + SetPendingBind(0, 0); } From 91228d27110514abbae77dd52278381fa3b2059a Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Wed, 28 Mar 2012 13:07:37 +0300 Subject: [PATCH 0336/1149] Core/Player: Similarly initialize m_SeasonalQuestChanged Fixes: ==8111== Conditional jump or move depends on uninitialised value(s) ==8111== at 0xFB7C42: Player::_SaveSeasonalQuestStatus(Trinity::AutoPtr&) (Player.cpp:19375) ==8111== by 0xFB56BA: Player::SaveToDB(bool) (Player.cpp:18898) --- src/server/game/Entities/Player/Player.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 7d513c36c99..4b57e8e8fc0 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -860,6 +860,8 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep m_WeeklyQuestChanged = false; + m_SeasonalQuestChanged = false; + SetPendingBind(0, 0); } From cc0448a017a418446c4c28cdcc2d64940c7e9ecf Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Wed, 28 Mar 2012 13:17:45 +0300 Subject: [PATCH 0337/1149] Core/Battleground/SOTA: Initialize uninitialized variables. Fixes: ==8111== Conditional jump or move depends on uninitialised value(s) ==8111== at 0x12B542C: BattlegroundSA::FillInitialWorldStates(WorldPacket&) (BattlegroundSA.cpp:421) ==8111== by 0xF93CD9: Player::SendInitWorldStates(unsigned int, unsigned int) (Player.cpp:9664)' And similar. --- src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index b236bd41210..6d784488aad 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -37,6 +37,11 @@ BattlegroundSA::BattlegroundSA() SignaledRoundTwo = false; SignaledRoundTwoHalfMin = false; InitSecondRound = false; + + //! This is here to prevent an uninitialised variable warning + //! The warning only occurs when SetUpBattleGround fails though. + //! In the future this function should be called BEFORE sending initial worldstates. + memset(&GraveyardStatus, 0, sizeof(GraveyardStatus)); } BattlegroundSA::~BattlegroundSA() From e95d614f5240a01c38cbd3cff390c654cec56a97 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Wed, 28 Mar 2012 12:50:02 +0200 Subject: [PATCH 0338/1149] Core/Misc: Prevent calling ACE_Task_Base::wait() on an invalid handle. WorldSocketMgr::Wait is already called in WorldRunnable post-service hook --- src/server/worldserver/Master.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index f4945e025b0..03b2859c514 100755 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -270,7 +270,11 @@ int Master::Run() LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag & ~%u, population = 0 WHERE id = '%u'", REALM_FLAG_INVALID, realmID); sLog->outString("%s (worldserver-daemon) ready...", _FULLVERSION); - sWorldSocketMgr->Wait(); + + // when the main thread closes the singletons get unloaded + // since worldrunnable uses them, it will crash if unloaded after master + world_thread.wait(); + rar_thread.wait(); if (soap_thread) { @@ -282,11 +286,6 @@ int Master::Run() // set server offline LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag | %u WHERE id = '%d'", REALM_FLAG_OFFLINE, realmID); - // when the main thread closes the singletons get unloaded - // since worldrunnable uses them, it will crash if unloaded after master - world_thread.wait(); - rar_thread.wait(); - ///- Clean database before leaving ClearOnlineAccounts(); From 72cdcbfcedafe223837c5011431373ef852a9c8b Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Wed, 28 Mar 2012 19:11:50 +0800 Subject: [PATCH 0339/1149] Core/Game: Code style. Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/AI/SmartScripts/SmartAI.h | 2 +- .../Battlegrounds/Zones/BattlegroundAB.cpp | 2 +- .../Battlegrounds/Zones/BattlegroundAV.cpp | 19 +++-- .../Battlegrounds/Zones/BattlegroundIC.cpp | 2 +- src/server/game/Chat/Commands/Level0.cpp | 26 +++---- src/server/game/Chat/Commands/Level3.cpp | 6 +- src/server/game/Entities/Creature/Creature.h | 2 +- .../game/Entities/Creature/CreatureGroups.cpp | 2 +- src/server/game/Entities/Pet/Pet.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 8 +-- src/server/game/Entities/Player/Player.h | 2 +- src/server/game/Entities/Unit/Unit.cpp | 6 +- src/server/game/Entities/Unit/Unit.h | 4 +- src/server/game/Events/GameEventMgr.cpp | 2 +- src/server/game/Guilds/Guild.cpp | 2 +- src/server/game/Handlers/ItemHandler.cpp | 2 +- src/server/game/Handlers/LFGHandler.cpp | 2 +- src/server/game/Handlers/NPCHandler.cpp | 4 +- src/server/game/Loot/LootMgr.cpp | 16 ++--- src/server/game/Spells/Auras/SpellAuras.cpp | 72 +++++++++---------- src/server/game/Spells/Spell.cpp | 48 ++++++------- src/server/game/Spells/SpellEffects.cpp | 2 +- src/server/game/Spells/SpellMgr.cpp | 20 +++--- 23 files changed, 132 insertions(+), 121 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h index c2501199f77..0b925f852f4 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.h +++ b/src/server/game/AI/SmartScripts/SmartAI.h @@ -245,7 +245,7 @@ public: SmartScript* GetScript() { return &mScript; } static int Permissible(const GameObject* g); - bool GossipHello(Player* player) ; + bool GossipHello(Player* player); bool GossipSelect(Player* player, uint32 sender, uint32 action); bool GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/); bool QuestAccept(Player* player, Quest const* quest); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index 71f0ce29aec..52d2cdefd65 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -549,7 +549,7 @@ void BattlegroundAB::EventPlayerClickedOnFlag(Player* source, GameObject* /*targ bool BattlegroundAB::SetupBattleground() { - for (int i = 0 ; i < BG_AB_DYNAMIC_NODES_COUNT; ++i) + for (int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i) { if (!AddObject(BG_AB_OBJECT_BANNER_NEUTRAL + 8*i, BG_AB_OBJECTID_NODE_BANNER_0 + i, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY) || !AddObject(BG_AB_OBJECT_BANNER_CONT_A + 8*i, BG_AB_OBJECTID_BANNER_CONT_A, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index 5ea9fc67fed..b864376e3a6 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -1208,7 +1208,7 @@ bool BattlegroundAV::SetupBattleground() } //spawn node-objects - for (uint8 i = BG_AV_NODES_FIRSTAID_STATION ; i < BG_AV_NODES_MAX; ++i) + for (uint8 i = BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i) { if (i <= BG_AV_NODES_FROSTWOLF_HUT) { @@ -1293,7 +1293,7 @@ bool BattlegroundAV::SetupBattleground() return false; } } - for (uint16 i= 0 ; i <= (BG_AV_OBJECT_MINE_SUPPLY_S_MAX-BG_AV_OBJECT_MINE_SUPPLY_S_MIN); i++) + for (uint16 i= 0; i <= (BG_AV_OBJECT_MINE_SUPPLY_S_MAX-BG_AV_OBJECT_MINE_SUPPLY_S_MIN); i++) { if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_S_MIN+i, BG_AV_OBJECTID_MINE_S, BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][0], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][1], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][2], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2), RESPAWN_ONE_DAY)) { @@ -1324,30 +1324,39 @@ bool BattlegroundAV::SetupBattleground() // Initial Nodes for (i = 0; i < BG_AV_OBJECT_MAX; i++) SpawnBGObject(i, RESPAWN_ONE_DAY); - for (i = BG_AV_OBJECT_FLAG_A_FIRSTAID_STATION; i <= BG_AV_OBJECT_FLAG_A_STONEHEART_GRAVE ; i++){ + + for (i = BG_AV_OBJECT_FLAG_A_FIRSTAID_STATION; i <= BG_AV_OBJECT_FLAG_A_STONEHEART_GRAVE; i++) + { SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+3*i, RESPAWN_IMMEDIATELY); SpawnBGObject(i, RESPAWN_IMMEDIATELY); } - for (i = BG_AV_OBJECT_FLAG_A_DUNBALDAR_SOUTH; i <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER ; i++) + + for (i = BG_AV_OBJECT_FLAG_A_DUNBALDAR_SOUTH; i <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER; i++) SpawnBGObject(i, RESPAWN_IMMEDIATELY); - for (i = BG_AV_OBJECT_FLAG_H_ICEBLOOD_GRAVE; i <= BG_AV_OBJECT_FLAG_H_FROSTWOLF_WTOWER ; i++){ + + for (i = BG_AV_OBJECT_FLAG_H_ICEBLOOD_GRAVE; i <= BG_AV_OBJECT_FLAG_H_FROSTWOLF_WTOWER; i++) + { SpawnBGObject(i, RESPAWN_IMMEDIATELY); if (i <= BG_AV_OBJECT_FLAG_H_FROSTWOLF_HUT) SpawnBGObject(BG_AV_OBJECT_AURA_H_FIRSTAID_STATION+3*GetNodeThroughObject(i), RESPAWN_IMMEDIATELY); } + for (i = BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH; i <= BG_AV_OBJECT_TFLAG_A_STONEHEART_BUNKER; i+=2) { SpawnBGObject(i, RESPAWN_IMMEDIATELY); //flag SpawnBGObject(i+16, RESPAWN_IMMEDIATELY); //aura } + for (i = BG_AV_OBJECT_TFLAG_H_ICEBLOOD_TOWER; i <= BG_AV_OBJECT_TFLAG_H_FROSTWOLF_WTOWER; i+=2) { SpawnBGObject(i, RESPAWN_IMMEDIATELY); //flag SpawnBGObject(i+16, RESPAWN_IMMEDIATELY); //aura } + //snowfall and the doors for (i = BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE; i <= BG_AV_OBJECT_DOOR_A; i++) SpawnBGObject(i, RESPAWN_IMMEDIATELY); + SpawnBGObject(BG_AV_OBJECT_AURA_N_SNOWFALL_GRAVE, RESPAWN_IMMEDIATELY); //creatures diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index e5ec15bf60d..fada4230507 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -359,7 +359,7 @@ void BattlegroundIC::FillInitialWorldStates(WorldPacket& data) data << uint32(uws) << uint32(1); } - for (uint8 i = 0 ; i < MAX_NODE_TYPES ; i++) + for (uint8 i = 0; i < MAX_NODE_TYPES; i++) data << uint32(nodePoint[i].worldStates[nodePoint[i].nodeState]) << uint32(1); } diff --git a/src/server/game/Chat/Commands/Level0.cpp b/src/server/game/Chat/Commands/Level0.cpp index bb744016257..b2ac090c313 100755 --- a/src/server/game/Chat/Commands/Level0.cpp +++ b/src/server/game/Chat/Commands/Level0.cpp @@ -17,10 +17,8 @@ */ #include "Common.h" -#include "DatabaseEnv.h" #include "World.h" #include "Player.h" -#include "Opcodes.h" #include "Chat.h" #include "ObjectAccessor.h" #include "Language.h" @@ -54,31 +52,31 @@ bool ChatHandler::HandleCommandsCommand(const char* /*args*/) bool ChatHandler::HandleStartCommand(const char* /*args*/) { - Player* chr = m_session->GetPlayer(); + Player* player = m_session->GetPlayer(); - if (chr->isInFlight()) + if (player->isInFlight()) { SendSysMessage(LANG_YOU_IN_FLIGHT); SetSentErrorMessage(true); return false; } - if (chr->isInCombat()) + if (player->isInCombat()) { SendSysMessage(LANG_YOU_IN_COMBAT); SetSentErrorMessage(true); return false; } - if (chr->isDead() || chr->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) + if (player->isDead() || player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) { // if player is dead and stuck, send ghost to graveyard - chr->RepopAtGraveyard(); + player->RepopAtGraveyard(); return true; } // cast spell Stuck - chr->CastSpell(chr, 7355, false); + player->CastSpell(player, 7355, false); return true; } @@ -107,23 +105,25 @@ bool ChatHandler::HandleServerInfoCommand(const char* /*args*/) bool ChatHandler::HandleDismountCommand(const char* /*args*/) { + Player* player = m_session->GetPlayer(); + //If player is not mounted, so go out :) - if (!m_session->GetPlayer()->IsMounted()) + if (!player->IsMounted()) { SendSysMessage(LANG_CHAR_NON_MOUNTED); SetSentErrorMessage(true); return false; } - if (m_session->GetPlayer()->isInFlight()) + if (player->isInFlight()) { SendSysMessage(LANG_YOU_IN_FLIGHT); SetSentErrorMessage(true); return false; } - m_session->GetPlayer()->Dismount(); - m_session->GetPlayer()->RemoveAurasByType(SPELL_AURA_MOUNTED); + player->Dismount(); + player->RemoveAurasByType(SPELL_AURA_MOUNTED); return true; } @@ -144,7 +144,7 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/) // save if the player has last been saved over 20 seconds ago uint32 save_interval = sWorld->getIntConfig(CONFIG_INTERVAL_SAVE); - if (save_interval == 0 || (save_interval > 20*IN_MILLISECONDS && player->GetSaveTimer() <= save_interval - 20*IN_MILLISECONDS)) + if (save_interval == 0 || (save_interval > 20 * IN_MILLISECONDS && player->GetSaveTimer() <= save_interval - 20 * IN_MILLISECONDS)) player->SaveToDB(); return true; diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index d5dd233b43e..eca5a862ecd 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -4764,9 +4764,11 @@ bool ChatHandler::HandleBindSightCommand(const char * /*args*/) bool ChatHandler::HandleUnbindSightCommand(const char * /*args*/) { - if (m_session->GetPlayer()->isPossessing()) + Player* player = m_session->GetPlayer(); + + if (player->isPossessing()) return false; - m_session->GetPlayer()->StopCastingBindSight(); + player->StopCastingBindSight(); return true; } diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index a8664047b89..dff0efd5197 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -373,7 +373,7 @@ struct TrainerSpell { TrainerSpell() : spell(0), spellCost(0), reqSkill(0), reqSkillValue(0), reqLevel(0) { - for (uint8 i = 0; i < MAX_SPELL_EFFECTS ; ++i) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) learnedSpell[i] = 0; } diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp index 2104f474072..54953ef5420 100755 --- a/src/server/game/Entities/Creature/CreatureGroups.cpp +++ b/src/server/game/Entities/Creature/CreatureGroups.cpp @@ -134,7 +134,7 @@ void FormationMgr::LoadCreatureFormations() CreatureGroupMap[memberGUID] = group_member; ++count; } - while (result->NextRow()) ; + while (result->NextRow()); sLog->outString(">> Loaded %u creatures in formations in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index d51af9e1ba9..0ee8381d54f 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -1308,7 +1308,7 @@ void Pet::_SaveAuras(SQLTransaction& trans) stmt->setUInt32(0, m_charmInfo->GetPetNumber()); trans->Append(stmt); - for (AuraMap::const_iterator itr = m_ownedAuras.begin(); itr != m_ownedAuras.end() ; ++itr) + for (AuraMap::const_iterator itr = m_ownedAuras.begin(); itr != m_ownedAuras.end(); ++itr) { // check if the aura has to be saved if (!itr->second->CanBeSaved() || IsPetAura(itr->second)) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 26f248aa961..a0aad893893 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4687,7 +4687,7 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell return TRAINER_SPELL_RED; bool hasSpell = true; - for (uint8 i = 0; i < MAX_SPELL_EFFECTS ; ++i) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { if (!trainer_spell->learnedSpell[i]) continue; @@ -4710,7 +4710,7 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell if (getLevel() < trainer_spell->reqLevel) return TRAINER_SPELL_RED; - for (uint8 i = 0; i < MAX_SPELL_EFFECTS ; ++i) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { if (!trainer_spell->learnedSpell[i]) continue; @@ -4737,7 +4737,7 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell // check primary prof. limit // first rank of primary profession spell when there are no proffesions avalible is disabled - for (uint8 i = 0; i < MAX_SPELL_EFFECTS ; ++i) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { if (!trainer_spell->learnedSpell[i]) continue; @@ -18990,7 +18990,7 @@ void Player::_SaveAuras(SQLTransaction& trans) stmt->setUInt32(0, GetGUIDLow()); trans->Append(stmt); - for (AuraMap::const_iterator itr = m_ownedAuras.begin(); itr != m_ownedAuras.end() ; ++itr) + for (AuraMap::const_iterator itr = m_ownedAuras.begin(); itr != m_ownedAuras.end(); ++itr) { if (!itr->second->CanBeSaved()) continue; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index ac50bbd9d35..b39e2b87750 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1511,7 +1511,7 @@ class Player : public Unit, public GridObject static uint32 GetLevelFromDB(uint64 guid); static bool LoadPositionFromDB(uint32& mapid, float& x, float& y, float& z, float& o, bool& in_flight, uint64 guid); - static bool IsValidGender(uint8 Gender) { return Gender <= GENDER_FEMALE ; } + static bool IsValidGender(uint8 Gender) { return Gender <= GENDER_FEMALE; } /*********************************************************/ /*** SAVE SYSTEM ***/ diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 70b367b8ce0..80b6ddbbf56 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3245,7 +3245,7 @@ void Unit::_ApplyAura(AuraApplication * aurApp, uint8 effMask) aura->HandleAuraSpecificMods(aurApp, caster, true, false); // apply effects of the aura - for (uint8 i = 0 ; i < MAX_SPELL_EFFECTS; ++i) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { if (effMask & 1<GetRemoveMode())) aurApp->_HandleEffect(i, true); @@ -3304,7 +3304,7 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo aura->_UnapplyForTarget(this, caster, aurApp); // remove effects of the spell - needs to be done after removing aura from lists - for (uint8 itr = 0 ; itr < MAX_SPELL_EFFECTS; ++itr) + for (uint8 itr = 0; itr < MAX_SPELL_EFFECTS; ++itr) { if (aurApp->HasEffect(itr)) aurApp->_HandleEffect(itr, false); @@ -3481,7 +3481,7 @@ void Unit::RemoveAura(AuraApplication * aurApp, AuraRemoveMode mode) if (aurApp->GetRemoveMode()) { // remove remaining effects of an aura - for (uint8 itr = 0 ; itr < MAX_SPELL_EFFECTS; ++itr) + for (uint8 itr = 0; itr < MAX_SPELL_EFFECTS; ++itr) { if (aurApp->HasEffect(itr)) aurApp->_HandleEffect(itr, false); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index d85b7dd15bf..e37e4d4fedd 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1336,7 +1336,7 @@ class Unit : public WorldObject float GetStat(Stats stat) const { return float(GetUInt32Value(UNIT_FIELD_STAT0+stat)); } void SetStat(Stats stat, int32 val) { SetStatInt32Value(UNIT_FIELD_STAT0+stat, val); } - uint32 GetArmor() const { return GetResistance(SPELL_SCHOOL_NORMAL) ; } + uint32 GetArmor() const { return GetResistance(SPELL_SCHOOL_NORMAL); } void SetArmor(int32 val) { SetResistance(SPELL_SCHOOL_NORMAL, val); } uint32 GetResistance(SpellSchools school) const { return GetUInt32Value(UNIT_FIELD_RESISTANCES+school); } @@ -2026,7 +2026,7 @@ class Unit : public WorldObject float GetAPMultiplier(WeaponAttackType attType, bool normalized); void ModifyAuraState(AuraStateType flag, bool apply); uint32 BuildAuraStateUpdateForTarget(Unit* target) const; - bool HasAuraState(AuraStateType flag, SpellInfo const* spellProto = NULL, Unit const* Caster = NULL) const ; + bool HasAuraState(AuraStateType flag, SpellInfo const* spellProto = NULL, Unit const* Caster = NULL) const; void UnsummonAllTotems(); Unit* GetMagicHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo); Unit* GetMeleeHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo = NULL); diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 182aaa35c49..b15ffc361d7 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -80,7 +80,7 @@ uint32 GameEventMgr::NextCheck(uint16 entry) const if (mGameEvent[entry].state == GAMEEVENT_WORLD_CONDITIONS) { if (mGameEvent[entry].length) - return mGameEvent[entry].length * 60 ; + return mGameEvent[entry].length * 60; else return max_ge_check_delay; } diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 6c9cd428e4f..98707a0b42f 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1230,7 +1230,7 @@ void Guild::HandleQuery(WorldSession* session) data << uint32(m_id); data << m_name; - for (uint8 i = 0 ; i < GUILD_RANKS_MAX_COUNT; ++i) // Alwayse show 10 ranks + for (uint8 i = 0; i < GUILD_RANKS_MAX_COUNT; ++i) // Alwayse show 10 ranks { if (i < _GetRanksSize()) data << m_ranks[i].GetName(); diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 8a60f21dac9..85694dba630 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -115,7 +115,7 @@ void WorldSession::HandleSwapItem(WorldPacket & recv_data) //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_SWAP_ITEM"); uint8 dstbag, dstslot, srcbag, srcslot; - recv_data >> dstbag >> dstslot >> srcbag >> srcslot ; + recv_data >> dstbag >> dstslot >> srcbag >> srcslot; //sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u", srcbag, srcslot, dstbag, dstslot); uint16 src = ((srcbag << 8) | srcslot); diff --git a/src/server/game/Handlers/LFGHandler.cpp b/src/server/game/Handlers/LFGHandler.cpp index 3c6bd28b5cb..aea7499aaa9 100755 --- a/src/server/game/Handlers/LFGHandler.cpp +++ b/src/server/game/Handlers/LFGHandler.cpp @@ -70,7 +70,7 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recv_data) } LfgDungeonSet newDungeons; - for (int8 i = 0 ; i < numDungeons; ++i) + for (int8 i = 0; i < numDungeons; ++i) { recv_data >> dungeon; newDungeons.insert((dungeon & 0x00FFFFFF)); // remove the type from the dungeon entry diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index 5479791d341..f0c3093aa25 100755 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -169,7 +169,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) bool valid = true; bool primary_prof_first_rank = false; - for (uint8 i = 0; i < MAX_SPELL_EFFECTS ; ++i) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { if (!tSpell->learnedSpell[i]) continue; @@ -199,7 +199,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) data << uint32(tSpell->reqSkillValue); //prev + req or req + 0 uint8 maxReq = 0; - for (uint8 i = 0; i < MAX_SPELL_EFFECTS ; ++i) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { if (!tSpell->learnedSpell[i]) continue; diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 7c7cc06201c..c977a967162 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -734,7 +734,7 @@ bool Loot::hasItemFor(Player* player) const if (q_itr != lootPlayerQuestItems.end()) { QuestItemList* q_list = q_itr->second; - for (QuestItemList::const_iterator qi = q_list->begin() ; qi != q_list->end(); ++qi) + for (QuestItemList::const_iterator qi = q_list->begin(); qi != q_list->end(); ++qi) { const LootItem &item = quest_items[qi->index]; if (!qi->is_looted && !item.is_looted) @@ -747,7 +747,7 @@ bool Loot::hasItemFor(Player* player) const if (ffa_itr != lootPlayerFFAItems.end()) { QuestItemList* ffa_list = ffa_itr->second; - for (QuestItemList::const_iterator fi = ffa_list->begin() ; fi != ffa_list->end(); ++fi) + for (QuestItemList::const_iterator fi = ffa_list->begin(); fi != ffa_list->end(); ++fi) { const LootItem &item = items[fi->index]; if (!fi->is_looted && !item.is_looted) @@ -760,7 +760,7 @@ bool Loot::hasItemFor(Player* player) const if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end()) { QuestItemList* conditional_list = nn_itr->second; - for (QuestItemList::const_iterator ci = conditional_list->begin() ; ci != conditional_list->end(); ++ci) + for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci) { const LootItem &item = items[ci->index]; if (!ci->is_looted && !item.is_looted) @@ -900,7 +900,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) if (q_itr != lootPlayerQuestItems.end()) { QuestItemList* q_list = q_itr->second; - for (QuestItemList::const_iterator qi = q_list->begin() ; qi != q_list->end(); ++qi) + for (QuestItemList::const_iterator qi = q_list->begin(); qi != q_list->end(); ++qi) { LootItem &item = l.quest_items[qi->index]; if (!qi->is_looted && !item.is_looted) @@ -918,7 +918,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) if (ffa_itr != lootPlayerFFAItems.end()) { QuestItemList* ffa_list = ffa_itr->second; - for (QuestItemList::const_iterator fi = ffa_list->begin() ; fi != ffa_list->end(); ++fi) + for (QuestItemList::const_iterator fi = ffa_list->begin(); fi != ffa_list->end(); ++fi) { LootItem &item = l.items[fi->index]; if (!fi->is_looted && !item.is_looted) @@ -936,7 +936,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end()) { QuestItemList* conditional_list = nn_itr->second; - for (QuestItemList::const_iterator ci = conditional_list->begin() ; ci != conditional_list->end(); ++ci) + for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci) { LootItem &item = l.items[ci->index]; if (!ci->is_looted && !item.is_looted) @@ -1285,7 +1285,7 @@ bool LootTemplate::HasQuestDrop(LootTemplateMap const& store, uint8 groupId) con } // Now processing groups - for (LootGroups::const_iterator i = Groups.begin() ; i != Groups.end(); ++i) + for (LootGroups::const_iterator i = Groups.begin(); i != Groups.end(); ++i) if (i->HasQuestDrop()) return true; @@ -1303,7 +1303,7 @@ bool LootTemplate::HasQuestDropForPlayer(LootTemplateMap const& store, Player co } // Checking non-grouped entries - for (LootStoreItemList::const_iterator i = Entries.begin() ; i != Entries.end(); ++i) + for (LootStoreItemList::const_iterator i = Entries.begin(); i != Entries.end(); ++i) { if (i->mincountOrRef < 0) // References processing { diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index a22b9e73fc6..d721b5e0646 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -350,7 +350,7 @@ m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false) void Aura::_InitEffects(uint8 effMask, Unit* caster, int32 *baseAmount) { // shouldn't be in constructor - functions in AuraEffect::AuraEffect use polymorphism - for (uint8 i=0 ; iCreateAuraScripts(m_spellInfo->Id, m_loadedScripts); - for (std::list::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end() ;) + for (std::list::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end();) { if (!(*itr)->_Load(this)) { @@ -2060,11 +2060,11 @@ void Aura::LoadScripts() bool Aura::CallScriptCheckAreaTargetHandlers(Unit* target) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_CHECK_AREA_TARGET); std::list::iterator hookItrEnd = (*scritr)->DoCheckAreaTarget.end(), hookItr = (*scritr)->DoCheckAreaTarget.begin(); - for (; hookItr != hookItrEnd ; ++hookItr) + for (; hookItr != hookItrEnd; ++hookItr) if (!(*hookItr).Call(*scritr, target)) return false; (*scritr)->_FinishScriptCall(); @@ -2074,11 +2074,11 @@ bool Aura::CallScriptCheckAreaTargetHandlers(Unit* target) void Aura::CallScriptDispel(DispelInfo* dispelInfo) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_DISPEL); std::list::iterator hookItrEnd = (*scritr)->OnDispel.end(), hookItr = (*scritr)->OnDispel.begin(); - for (; hookItr != hookItrEnd ; ++hookItr) + for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr, dispelInfo); (*scritr)->_FinishScriptCall(); } @@ -2086,11 +2086,11 @@ void Aura::CallScriptDispel(DispelInfo* dispelInfo) void Aura::CallScriptAfterDispel(DispelInfo* dispelInfo) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_AFTER_DISPEL); std::list::iterator hookItrEnd = (*scritr)->AfterDispel.end(), hookItr = (*scritr)->AfterDispel.begin(); - for (; hookItr != hookItrEnd ; ++hookItr) + for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr, dispelInfo); (*scritr)->_FinishScriptCall(); } @@ -2099,11 +2099,11 @@ void Aura::CallScriptAfterDispel(DispelInfo* dispelInfo) bool Aura::CallScriptEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode) { bool preventDefault = false; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_APPLY, aurApp); std::list::iterator effEndItr = (*scritr)->OnEffectApply.end(), effItr = (*scritr)->OnEffectApply.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, mode); @@ -2118,11 +2118,11 @@ bool Aura::CallScriptEffectApplyHandlers(AuraEffect const* aurEff, AuraApplicati bool Aura::CallScriptEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode) { bool preventDefault = false; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_REMOVE, aurApp); std::list::iterator effEndItr = (*scritr)->OnEffectRemove.end(), effItr = (*scritr)->OnEffectRemove.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, mode); @@ -2136,11 +2136,11 @@ bool Aura::CallScriptEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplicat void Aura::CallScriptAfterEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_APPLY, aurApp); std::list::iterator effEndItr = (*scritr)->AfterEffectApply.end(), effItr = (*scritr)->AfterEffectApply.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, mode); @@ -2151,11 +2151,11 @@ void Aura::CallScriptAfterEffectApplyHandlers(AuraEffect const* aurEff, AuraAppl void Aura::CallScriptAfterEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_REMOVE, aurApp); std::list::iterator effEndItr = (*scritr)->AfterEffectRemove.end(), effItr = (*scritr)->AfterEffectRemove.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, mode); @@ -2167,11 +2167,11 @@ void Aura::CallScriptAfterEffectRemoveHandlers(AuraEffect const* aurEff, AuraApp bool Aura::CallScriptEffectPeriodicHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp) { bool preventDefault = false; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_PERIODIC, aurApp); std::list::iterator effEndItr = (*scritr)->OnEffectPeriodic.end(), effItr = (*scritr)->OnEffectPeriodic.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff); @@ -2185,11 +2185,11 @@ bool Aura::CallScriptEffectPeriodicHandlers(AuraEffect const* aurEff, AuraApplic void Aura::CallScriptEffectUpdatePeriodicHandlers(AuraEffect* aurEff) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_UPDATE_PERIODIC); std::list::iterator effEndItr = (*scritr)->OnEffectUpdatePeriodic.end(), effItr = (*scritr)->OnEffectUpdatePeriodic.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff); @@ -2200,11 +2200,11 @@ void Aura::CallScriptEffectUpdatePeriodicHandlers(AuraEffect* aurEff) void Aura::CallScriptEffectCalcAmountHandlers(AuraEffect const* aurEff, int32 & amount, bool & canBeRecalculated) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_AMOUNT); std::list::iterator effEndItr = (*scritr)->DoEffectCalcAmount.end(), effItr = (*scritr)->DoEffectCalcAmount.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, amount, canBeRecalculated); @@ -2215,11 +2215,11 @@ void Aura::CallScriptEffectCalcAmountHandlers(AuraEffect const* aurEff, int32 & void Aura::CallScriptEffectCalcPeriodicHandlers(AuraEffect const* aurEff, bool & isPeriodic, int32 & amplitude) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_PERIODIC); std::list::iterator effEndItr = (*scritr)->DoEffectCalcPeriodic.end(), effItr = (*scritr)->DoEffectCalcPeriodic.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, isPeriodic, amplitude); @@ -2230,11 +2230,11 @@ void Aura::CallScriptEffectCalcPeriodicHandlers(AuraEffect const* aurEff, bool & void Aura::CallScriptEffectCalcSpellModHandlers(AuraEffect const* aurEff, SpellModifier* & spellMod) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_SPELLMOD); std::list::iterator effEndItr = (*scritr)->DoEffectCalcSpellMod.end(), effItr = (*scritr)->DoEffectCalcSpellMod.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, spellMod); @@ -2245,11 +2245,11 @@ void Aura::CallScriptEffectCalcSpellModHandlers(AuraEffect const* aurEff, SpellM void Aura::CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool & /*defaultPrevented*/) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_ABSORB, aurApp); std::list::iterator effEndItr = (*scritr)->OnEffectAbsorb.end(), effItr = (*scritr)->OnEffectAbsorb.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, dmgInfo, absorbAmount); @@ -2260,11 +2260,11 @@ void Aura::CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication co void Aura::CallScriptEffectAfterAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_ABSORB, aurApp); std::list::iterator effEndItr = (*scritr)->AfterEffectAbsorb.end(), effItr = (*scritr)->AfterEffectAbsorb.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, dmgInfo, absorbAmount); @@ -2275,11 +2275,11 @@ void Aura::CallScriptEffectAfterAbsorbHandlers(AuraEffect* aurEff, AuraApplicati void Aura::CallScriptEffectManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool & /*defaultPrevented*/) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_MANASHIELD, aurApp); std::list::iterator effEndItr = (*scritr)->OnEffectManaShield.end(), effItr = (*scritr)->OnEffectManaShield.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, dmgInfo, absorbAmount); @@ -2290,11 +2290,11 @@ void Aura::CallScriptEffectManaShieldHandlers(AuraEffect* aurEff, AuraApplicatio void Aura::CallScriptEffectAfterManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_MANASHIELD, aurApp); std::list::iterator effEndItr = (*scritr)->AfterEffectManaShield.end(), effItr = (*scritr)->AfterEffectManaShield.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, dmgInfo, absorbAmount); @@ -2339,7 +2339,7 @@ void UnitAura::Remove(AuraRemoveMode removeMode) void UnitAura::FillTargetMap(std::map & targets, Unit* caster) { - for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS ; ++effIndex) + for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex) { if (!HasEffect(effIndex)) continue; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index ee5e4bc0efa..312b79e3e7a 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1274,7 +1274,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge break; // Remove targets outside caster's raid - for (std::list::iterator itr = unitTargets.begin() ; itr != unitTargets.end();) + for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end();) { if (!(*itr)->IsInRaidWith(m_caster)) itr = unitTargets.erase(itr); @@ -1291,7 +1291,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge else if (m_spellInfo->SpellFamilyFlags[2] == 0x0100) // Starfall { // Remove targets not in LoS or in stealth - for (std::list::iterator itr = unitTargets.begin() ; itr != unitTargets.end();) + for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end();) { if ((*itr)->HasStealthAura() || (*itr)->HasInvisibilityAura() || !(*itr)->IsWithinLOSInMap(m_caster)) itr = unitTargets.erase(itr); @@ -1304,7 +1304,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge break; // Remove targets outside caster's raid - for (std::list::iterator itr = unitTargets.begin() ; itr != unitTargets.end();) + for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end();) if (!(*itr)->IsInRaidWith(m_caster)) itr = unitTargets.erase(itr); else @@ -1326,7 +1326,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge } else { - for (std::list::iterator itr = unitTargets.begin() ; itr != unitTargets.end();) + for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end();) if ((*itr)->getPowerType() != (Powers)power) itr = unitTargets.erase(itr); else @@ -6039,7 +6039,7 @@ SpellCastResult Spell::CheckItems() // check totem-item requirements (items presence in inventory) uint32 totems = 2; - for (int i = 0; i < 2 ; ++i) + for (int i = 0; i < 2; ++i) { if (m_spellInfo->Totem[i] != 0) { @@ -6987,7 +6987,7 @@ void Spell::CheckEffectExecuteData() void Spell::LoadScripts() { sScriptMgr->CreateSpellScripts(m_spellInfo->Id, m_loadedScripts); - for (std::list::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end() ;) + for (std::list::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end();) { if (!(*itr)->_Load(this)) { @@ -7004,11 +7004,11 @@ void Spell::LoadScripts() void Spell::CallScriptBeforeCastHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_BEFORE_CAST); std::list::iterator hookItrEnd = (*scritr)->BeforeCast.end(), hookItr = (*scritr)->BeforeCast.begin(); - for (; hookItr != hookItrEnd ; ++hookItr) + for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr); (*scritr)->_FinishScriptCall(); @@ -7017,11 +7017,11 @@ void Spell::CallScriptBeforeCastHandlers() void Spell::CallScriptOnCastHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_ON_CAST); std::list::iterator hookItrEnd = (*scritr)->OnCast.end(), hookItr = (*scritr)->OnCast.begin(); - for (; hookItr != hookItrEnd ; ++hookItr) + for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr); (*scritr)->_FinishScriptCall(); @@ -7030,11 +7030,11 @@ void Spell::CallScriptOnCastHandlers() void Spell::CallScriptAfterCastHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_AFTER_CAST); std::list::iterator hookItrEnd = (*scritr)->AfterCast.end(), hookItr = (*scritr)->AfterCast.begin(); - for (; hookItr != hookItrEnd ; ++hookItr) + for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr); (*scritr)->_FinishScriptCall(); @@ -7044,7 +7044,7 @@ void Spell::CallScriptAfterCastHandlers() SpellCastResult Spell::CallScriptCheckCastHandlers() { SpellCastResult retVal = SPELL_CAST_OK; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_CHECK_CAST); std::list::iterator hookItrEnd = (*scritr)->OnCheckCast.end(), hookItr = (*scritr)->OnCheckCast.begin(); @@ -7062,7 +7062,7 @@ SpellCastResult Spell::CallScriptCheckCastHandlers() void Spell::PrepareScriptHitHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) (*scritr)->_InitHit(); } @@ -7070,7 +7070,7 @@ bool Spell::CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMo { // execute script effect handler hooks and check if effects was prevented bool preventDefault = false; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { std::list::iterator effItr, effEndItr; SpellScriptHookType hookType; @@ -7101,7 +7101,7 @@ bool Spell::CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMo return false; } (*scritr)->_PrepareScriptCall(hookType); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) // effect execution can be prevented if (!(*scritr)->_IsEffectPrevented(effIndex) && (*effItr).IsEffectAffected(m_spellInfo, effIndex)) (*effItr).Call(*scritr, effIndex); @@ -7116,11 +7116,11 @@ bool Spell::CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMo void Spell::CallScriptBeforeHitHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_BEFORE_HIT); std::list::iterator hookItrEnd = (*scritr)->BeforeHit.end(), hookItr = (*scritr)->BeforeHit.begin(); - for (; hookItr != hookItrEnd ; ++hookItr) + for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr); (*scritr)->_FinishScriptCall(); @@ -7129,11 +7129,11 @@ void Spell::CallScriptBeforeHitHandlers() void Spell::CallScriptOnHitHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_HIT); std::list::iterator hookItrEnd = (*scritr)->OnHit.end(), hookItr = (*scritr)->OnHit.begin(); - for (; hookItr != hookItrEnd ; ++hookItr) + for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr); (*scritr)->_FinishScriptCall(); @@ -7142,11 +7142,11 @@ void Spell::CallScriptOnHitHandlers() void Spell::CallScriptAfterHitHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_AFTER_HIT); std::list::iterator hookItrEnd = (*scritr)->AfterHit.end(), hookItr = (*scritr)->AfterHit.begin(); - for (; hookItr != hookItrEnd ; ++hookItr) + for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr); (*scritr)->_FinishScriptCall(); @@ -7155,11 +7155,11 @@ void Spell::CallScriptAfterHitHandlers() void Spell::CallScriptAfterUnitTargetSelectHandlers(std::list& unitTargets, SpellEffIndex effIndex) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_UNIT_TARGET_SELECT); std::list::iterator hookItrEnd = (*scritr)->OnUnitTargetSelect.end(), hookItr = (*scritr)->OnUnitTargetSelect.begin(); - for (; hookItr != hookItrEnd ; ++hookItr) + for (; hookItr != hookItrEnd; ++hookItr) if ((*hookItr).IsEffectAffected(m_spellInfo, effIndex)) (*hookItr).Call(*scritr, unitTargets); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 56cc6b6f8ec..64aeb8c0e41 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1992,7 +1992,7 @@ void Spell::EffectEnergize(SpellEffIndex effIndex) sSpellMgr->GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_GUARDIAN, avalibleElixirs); if (!battleFound) sSpellMgr->GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_BATTLE, avalibleElixirs); - for (std::set::iterator itr = avalibleElixirs.begin(); itr != avalibleElixirs.end() ;) + for (std::set::iterator itr = avalibleElixirs.begin(); itr != avalibleElixirs.end();) { SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(*itr); if (spellInfo->SpellLevel < m_spellInfo->SpellLevel || spellInfo->SpellLevel > unitTarget->getLevel()) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 2b9e17c1284..2330461256b 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -643,7 +643,7 @@ SpellSpellGroupMapBounds SpellMgr::GetSpellSpellGroupMapBounds(uint32 spell_id) uint32 SpellMgr::IsSpellMemberOfSpellGroup(uint32 spellid, SpellGroup groupid) const { SpellSpellGroupMapBounds spellGroup = GetSpellSpellGroupMapBounds(spellid); - for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second ; ++itr) + for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second; ++itr) { if (itr->second == groupid) return true; @@ -669,7 +669,7 @@ void SpellMgr::GetSetOfSpellsInSpellGroup(SpellGroup group_id, std::set& usedGroups.insert(group_id); SpellGroupSpellMapBounds groupSpell = GetSpellGroupSpellMapBounds(group_id); - for (SpellGroupSpellMap::const_iterator itr = groupSpell.first; itr != groupSpell.second ; ++itr) + for (SpellGroupSpellMap::const_iterator itr = groupSpell.first; itr != groupSpell.second; ++itr) { if (itr->second < 0) { @@ -688,7 +688,7 @@ bool SpellMgr::AddSameEffectStackRuleSpellGroups(SpellInfo const* spellInfo, int uint32 spellId = spellInfo->GetFirstRankSpell()->Id; SpellSpellGroupMapBounds spellGroup = GetSpellSpellGroupMapBounds(spellId); // Find group with SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT if it belongs to one - for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second ; ++itr) + for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second; ++itr) { SpellGroup group = itr->second; SpellGroupStackMap::const_iterator found = mSpellGroupStack.find(group); @@ -724,13 +724,13 @@ SpellGroupStackRule SpellMgr::CheckSpellGroupStackRules(SpellInfo const* spellIn // find SpellGroups which are common for both spells SpellSpellGroupMapBounds spellGroup1 = GetSpellSpellGroupMapBounds(spellid_1); std::set groups; - for (SpellSpellGroupMap::const_iterator itr = spellGroup1.first; itr != spellGroup1.second ; ++itr) + for (SpellSpellGroupMap::const_iterator itr = spellGroup1.first; itr != spellGroup1.second; ++itr) { if (IsSpellMemberOfSpellGroup(spellid_2, itr->second)) { bool add = true; SpellGroupSpellMapBounds groupSpell = GetSpellGroupSpellMapBounds(itr->second); - for (SpellGroupSpellMap::const_iterator itr2 = groupSpell.first; itr2 != groupSpell.second ; ++itr2) + for (SpellGroupSpellMap::const_iterator itr2 = groupSpell.first; itr2 != groupSpell.second; ++itr2) { if (itr2->second < 0) { @@ -749,7 +749,7 @@ SpellGroupStackRule SpellMgr::CheckSpellGroupStackRules(SpellInfo const* spellIn SpellGroupStackRule rule = SPELL_GROUP_STACK_RULE_DEFAULT; - for (std::set::iterator itr = groups.begin() ; itr!= groups.end() ; ++itr) + for (std::set::iterator itr = groups.begin(); itr!= groups.end(); ++itr) { SpellGroupStackMap::const_iterator found = mSpellGroupStack.find(*itr); if (found != mSpellGroupStack.end()) @@ -1213,7 +1213,7 @@ void SpellMgr::LoadSpellRanks() int32 curRank = 0; bool valid = true; // check spells in chain - for (std::list >::iterator itr = rankChain.begin() ; itr!= rankChain.end(); ++itr) + for (std::list >::iterator itr = rankChain.begin(); itr!= rankChain.end(); ++itr) { SpellInfo const* spell = GetSpellInfo(itr->first); if (!spell) @@ -1620,7 +1620,7 @@ void SpellMgr::LoadSpellGroups() } while (result->NextRow()); - for (SpellGroupSpellMap::iterator itr = mSpellGroupSpell.begin(); itr!= mSpellGroupSpell.end() ;) + for (SpellGroupSpellMap::iterator itr = mSpellGroupSpell.begin(); itr!= mSpellGroupSpell.end();) { if (itr->second < 0) { @@ -1651,12 +1651,12 @@ void SpellMgr::LoadSpellGroups() } } - for (std::set::iterator groupItr = groups.begin() ; groupItr != groups.end() ; ++groupItr) + for (std::set::iterator groupItr = groups.begin(); groupItr != groups.end(); ++groupItr) { std::set spells; GetSetOfSpellsInSpellGroup(SpellGroup(*groupItr), spells); - for (std::set::iterator spellItr = spells.begin() ; spellItr != spells.end() ; ++spellItr) + for (std::set::iterator spellItr = spells.begin(); spellItr != spells.end(); ++spellItr) { ++count; mSpellSpellGroup.insert(SpellSpellGroupMap::value_type(*spellItr, SpellGroup(*groupItr))); From 1544b208da2c2c8522e711db38a598f08105fe51 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Wed, 28 Mar 2012 20:00:29 +0800 Subject: [PATCH 0340/1149] Core/Game: Code style again. Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/AI/SmartScripts/SmartAI.cpp | 4 +- .../game/AI/SmartScripts/SmartScript.cpp | 18 +- .../game/AI/SmartScripts/SmartScriptMgr.cpp | 172 ++++++++++++------ .../game/Battlegrounds/Battleground.cpp | 3 - .../Battlegrounds/Zones/BattlegroundAV.cpp | 5 +- src/server/game/Entities/Creature/Creature.h | 4 +- .../game/Entities/GameObject/GameObject.cpp | 8 +- .../game/Entities/GameObject/GameObject.h | 4 +- .../game/Entities/Item/ItemEnchantmentMgr.cpp | 6 +- src/server/game/Entities/Object/Object.cpp | 4 +- src/server/game/Entities/Object/Object.h | 4 +- src/server/game/Entities/Player/Player.cpp | 3 +- src/server/game/Entities/Unit/Unit.cpp | 17 +- src/server/game/Globals/ObjectMgr.cpp | 12 +- src/server/game/Handlers/GroupHandler.cpp | 5 +- src/server/game/Loot/LootMgr.cpp | 4 +- src/server/game/Maps/Map.h | 8 +- src/server/game/Spells/Spell.cpp | 8 +- src/server/game/Spells/SpellMgr.cpp | 80 ++++---- src/server/game/Spells/SpellMgr.h | 1 - 20 files changed, 233 insertions(+), 137 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 4cf438da5a4..2ff25544b2c 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -73,7 +73,9 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c) void SmartAI::UpdateDespawn(const uint32 diff) { - if (mDespawnState <= 1 || mDespawnState > 3) return; + if (mDespawnState <= 1 || mDespawnState > 3) + return; + if (mDespawnTime < diff) { if (mDespawnState == 2) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 05a2910e7a7..5eaa1577642 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1954,7 +1954,8 @@ void SmartScript::InstallTemplate(SmartScriptHolder const& e) } case SMARTAI_TEMPLATE_CAGED_NPC_PART: { - if (!me) return; + if (!me) + return; //store cage as id1 AddEvent(SMART_EVENT_DATA_SET, 0, 0, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 1, 0, 0, 0, 0, 0, SMART_TARGET_CLOSEST_GAMEOBJECT, e.action.installTtemplate.param1, 10, 0, 0); @@ -1976,7 +1977,8 @@ void SmartScript::InstallTemplate(SmartScriptHolder const& e) } case SMARTAI_TEMPLATE_CAGED_GO_PART: { - if (!go) return; + if (!go) + return; //store hostage as id1 AddEvent(SMART_EVENT_GOSSIP_HELLO, 0, 0, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 1, 0, 0, 0, 0, 0, SMART_TARGET_CLOSEST_CREATURE, e.action.installTtemplate.param1, 10, 0, 0); //store invoker as id2 @@ -2839,8 +2841,12 @@ void SmartScript::InstallEvents() bool SmartScript::ConditionValid(Unit* u, int32 c, int32 v1, int32 v2, int32 v3) { - if (c == 0) return true; - if (!u || !u->ToPlayer()) return false; + if (c == 0) + return true; + + if (!u || !u->ToPlayer()) + return false; + Condition cond; cond.ConditionType = ConditionTypes(uint32(c)); cond.ConditionValue1 = uint32(v1); @@ -3007,7 +3013,9 @@ void SmartScript::OnMoveInLineOfSight(Unit* who) { ProcessEventsFor(SMART_EVENT_OOC_LOS, who); - if (!me) return; + if (!me) + return; + if (me->getVictim()) return; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index e3264adc310..b0f1fcb8ede 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -337,8 +337,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) if (e.GetScriptType() == SMART_SCRIPT_TYPE_TIMED_ACTIONLIST) { e.event.type = SMART_EVENT_UPDATE_OOC;//force default OOC, can change when calling the script! - if (!IsMinMaxValid(e, e.event.minMaxRepeat.min, e.event.minMaxRepeat.max)) return false; - if (!IsMinMaxValid(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax)) return false; + if (!IsMinMaxValid(e, e.event.minMaxRepeat.min, e.event.minMaxRepeat.max)) + return false; + + if (!IsMinMaxValid(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax)) + return false; } else { @@ -356,8 +359,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) case SMART_EVENT_DAMAGED: case SMART_EVENT_DAMAGED_TARGET: case SMART_EVENT_RECEIVE_HEAL: - if (!IsMinMaxValid(e, e.event.minMaxRepeat.min, e.event.minMaxRepeat.max)) return false; - if (!IsMinMaxValid(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax)) return false; + if (!IsMinMaxValid(e, e.event.minMaxRepeat.min, e.event.minMaxRepeat.max)) + return false; + + if (!IsMinMaxValid(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax)) + return false; break; case SMART_EVENT_SPELLHIT: case SMART_EVENT_SPELLHIT_TARGET: @@ -375,11 +381,13 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) return false; } } - if (!IsMinMaxValid(e, e.event.spellHit.cooldownMin, e.event.spellHit.cooldownMax)) return false; + if (!IsMinMaxValid(e, e.event.spellHit.cooldownMin, e.event.spellHit.cooldownMax)) + return false; break; case SMART_EVENT_OOC_LOS: case SMART_EVENT_IC_LOS: - if (!IsMinMaxValid(e, e.event.los.cooldownMin, e.event.los.cooldownMax)) return false; + if (!IsMinMaxValid(e, e.event.los.cooldownMin, e.event.los.cooldownMax)) + return false; break; case SMART_EVENT_RESPAWN: if (e.event.respawn.type == SMART_SCRIPT_RESPAWN_CONDITION_MAP && !sMapStore.LookupEntry(e.event.respawn.map)) @@ -394,32 +402,48 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) } break; case SMART_EVENT_FRIENDLY_HEALTH: - if (!NotNULL(e, e.event.friendlyHealt.radius)) return false; - if (!IsMinMaxValid(e, e.event.friendlyHealt.repeatMin, e.event.friendlyHealt.repeatMax)) return false; + if (!NotNULL(e, e.event.friendlyHealt.radius)) + return false; + + if (!IsMinMaxValid(e, e.event.friendlyHealt.repeatMin, e.event.friendlyHealt.repeatMax)) + return false; break; case SMART_EVENT_FRIENDLY_IS_CC: - if (!IsMinMaxValid(e, e.event.friendlyCC.repeatMin, e.event.friendlyCC.repeatMax)) return false; + if (!IsMinMaxValid(e, e.event.friendlyCC.repeatMin, e.event.friendlyCC.repeatMax)) + return false; break; case SMART_EVENT_FRIENDLY_MISSING_BUFF: { - if (!IsSpellValid(e, e.event.missingBuff.spell)) return false; - if (!NotNULL(e, e.event.missingBuff.radius)) return false; - if (!IsMinMaxValid(e, e.event.missingBuff.repeatMin, e.event.missingBuff.repeatMax)) return false; + if (!IsSpellValid(e, e.event.missingBuff.spell)) + return false; + + if (!NotNULL(e, e.event.missingBuff.radius)) + return false; + + if (!IsMinMaxValid(e, e.event.missingBuff.repeatMin, e.event.missingBuff.repeatMax)) + return false; break; } case SMART_EVENT_KILL: - if (!IsMinMaxValid(e, e.event.kill.cooldownMin, e.event.kill.cooldownMax)) return false; - if (e.event.kill.creature && !IsCreatureValid(e, e.event.kill.creature)) return false; + if (!IsMinMaxValid(e, e.event.kill.cooldownMin, e.event.kill.cooldownMax)) + return false; + + if (e.event.kill.creature && !IsCreatureValid(e, e.event.kill.creature)) + return false; break; case SMART_EVENT_TARGET_CASTING: case SMART_EVENT_PASSENGER_BOARDED: case SMART_EVENT_PASSENGER_REMOVED: - if (!IsMinMaxValid(e, e.event.minMax.repeatMin, e.event.minMax.repeatMax)) return false; + if (!IsMinMaxValid(e, e.event.minMax.repeatMin, e.event.minMax.repeatMax)) + return false; break; case SMART_EVENT_SUMMON_DESPAWNED: case SMART_EVENT_SUMMONED_UNIT: - if (e.event.summoned.creature && !IsCreatureValid(e, e.event.summoned.creature)) return false; - if (!IsMinMaxValid(e, e.event.summoned.cooldownMin, e.event.summoned.cooldownMax)) return false; + if (e.event.summoned.creature && !IsCreatureValid(e, e.event.summoned.creature)) + return false; + + if (!IsMinMaxValid(e, e.event.summoned.cooldownMin, e.event.summoned.cooldownMax)) + return false; break; case SMART_EVENT_ACCEPTED_QUEST: case SMART_EVENT_REWARD_QUEST: @@ -428,20 +452,27 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) break; case SMART_EVENT_RECEIVE_EMOTE: { - if (e.event.emote.emote && !IsTextEmoteValid(e, e.event.emote.emote)) return false; - if (!IsMinMaxValid(e, e.event.emote.cooldownMin, e.event.emote.cooldownMax)) return false; + if (e.event.emote.emote && !IsTextEmoteValid(e, e.event.emote.emote)) + return false; + + if (!IsMinMaxValid(e, e.event.emote.cooldownMin, e.event.emote.cooldownMax)) + return false; break; } case SMART_EVENT_HAS_AURA: case SMART_EVENT_TARGET_BUFFED: { - if (!IsSpellValid(e, e.event.aura.spell)) return false; - if (!IsMinMaxValid(e, e.event.aura.repeatMin, e.event.aura.repeatMax)) return false; + if (!IsSpellValid(e, e.event.aura.spell)) + return false; + + if (!IsMinMaxValid(e, e.event.aura.repeatMin, e.event.aura.repeatMax)) + return false; break; } case SMART_EVENT_TRANSPORT_ADDCREATURE: { - if (e.event.transportAddCreature.creature && !IsCreatureValid(e, e.event.transportAddCreature.creature)) return false; + if (e.event.transportAddCreature.creature && !IsCreatureValid(e, e.event.transportAddCreature.creature)) + return false; break; } case SMART_EVENT_MOVEMENTINFORM: @@ -455,12 +486,14 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) } case SMART_EVENT_DATA_SET: { - if (!IsMinMaxValid(e, e.event.dataSet.cooldownMin, e.event.dataSet.cooldownMax)) return false; + if (!IsMinMaxValid(e, e.event.dataSet.cooldownMin, e.event.dataSet.cooldownMax)) + return false; break; } case SMART_EVENT_AREATRIGGER_ONTRIGGER: { - if (e.event.areatrigger.id && !IsAreaTriggerValid(e, e.event.areatrigger.id)) return false; + if (e.event.areatrigger.id && !IsAreaTriggerValid(e, e.event.areatrigger.id)) + return false; break; } case SMART_EVENT_TEXT_OVER: @@ -476,8 +509,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) break; } case SMART_EVENT_DUMMY_EFFECT: - if (!IsSpellValid(e, e.event.dummy.spell)) return false; - if (e.event.dummy.effIndex > EFFECT_2) return false; + if (!IsSpellValid(e, e.event.dummy.spell)) + return false; + + if (e.event.dummy.effIndex > EFFECT_2) + return false; break; case SMART_EVENT_IS_BEHIND_TARGET: if (!IsMinMaxValid(e, e.event.behindTarget.cooldownMin, e.event.behindTarget.cooldownMax)) @@ -574,11 +610,13 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) break; case SMART_ACTION_SET_EMOTE_STATE: case SMART_ACTION_PLAY_EMOTE: - if (!IsEmoteValid(e, e.action.emote.emote)) return false; + if (!IsEmoteValid(e, e.action.emote.emote)) + return false; break; case SMART_ACTION_FAIL_QUEST: case SMART_ACTION_ADD_QUEST: - if (!e.action.quest.quest || !IsQuestValid(e, e.action.quest.quest)) return false; + if (!e.action.quest.quest || !IsQuestValid(e, e.action.quest.quest)) + return false; break; case SMART_ACTION_ACTIVATE_TAXI: { @@ -590,17 +628,29 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) break; } case SMART_ACTION_RANDOM_EMOTE: - if (e.action.randomEmote.emote1 && !IsEmoteValid(e, e.action.randomEmote.emote1)) return false; - if (e.action.randomEmote.emote2 && !IsEmoteValid(e, e.action.randomEmote.emote2)) return false; - if (e.action.randomEmote.emote3 && !IsEmoteValid(e, e.action.randomEmote.emote3)) return false; - if (e.action.randomEmote.emote4 && !IsEmoteValid(e, e.action.randomEmote.emote4)) return false; - if (e.action.randomEmote.emote5 && !IsEmoteValid(e, e.action.randomEmote.emote5)) return false; - if (e.action.randomEmote.emote6 && !IsEmoteValid(e, e.action.randomEmote.emote6)) return false; + if (e.action.randomEmote.emote1 && !IsEmoteValid(e, e.action.randomEmote.emote1)) + return false; + + if (e.action.randomEmote.emote2 && !IsEmoteValid(e, e.action.randomEmote.emote2)) + return false; + + if (e.action.randomEmote.emote3 && !IsEmoteValid(e, e.action.randomEmote.emote3)) + return false; + + if (e.action.randomEmote.emote4 && !IsEmoteValid(e, e.action.randomEmote.emote4)) + return false; + + if (e.action.randomEmote.emote5 && !IsEmoteValid(e, e.action.randomEmote.emote5)) + return false; + + if (e.action.randomEmote.emote6 && !IsEmoteValid(e, e.action.randomEmote.emote6)) + return false; break; case SMART_ACTION_ADD_AURA: case SMART_ACTION_CAST: case SMART_ACTION_INVOKER_CAST: - if (!IsSpellValid(e, e.action.cast.spell)) return false; + if (!IsSpellValid(e, e.action.cast.spell)) + return false; break; case SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS: case SMART_ACTION_CALL_GROUPEVENTHAPPENS: @@ -619,8 +669,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) } break; case SMART_ACTION_SEND_CASTCREATUREORGO: - if (!IsQuestValid(e, e.action.castCreatureOrGO.quest)) return false; - if (!IsSpellValid(e, e.action.castCreatureOrGO.spell)) return false; + if (!IsQuestValid(e, e.action.castCreatureOrGO.quest)) + return false; + + if (!IsSpellValid(e, e.action.castCreatureOrGO.spell)) + return false; break; @@ -644,11 +697,15 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) } break; case SMART_ACTION_CALL_CASTEDCREATUREORGO: - if (!IsCreatureValid(e, e.action.castedCreatureOrGO.creature)) return false; - if (!IsSpellValid(e, e.action.castedCreatureOrGO.spell)) return false; + if (!IsCreatureValid(e, e.action.castedCreatureOrGO.creature)) + return false; + + if (!IsSpellValid(e, e.action.castedCreatureOrGO.spell)) + return false; break; case SMART_ACTION_REMOVEAURASFROMSPELL: - if (!IsSpellValid(e, e.action.removeAura.spell)) return false; + if (!IsSpellValid(e, e.action.removeAura.spell)) + return false; break; case SMART_ACTION_RANDOM_PHASE: { @@ -672,11 +729,13 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to set invalid phase, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); return false; } - if (!IsMinMaxValid(e, e.action.randomPhaseRange.phaseMin, e.action.randomPhaseRange.phaseMax)) return false; + if (!IsMinMaxValid(e, e.action.randomPhaseRange.phaseMin, e.action.randomPhaseRange.phaseMax)) + return false; break; } case SMART_ACTION_SUMMON_CREATURE: - if (!IsCreatureValid(e, e.action.summonCreature.creature)) return false; + if (!IsCreatureValid(e, e.action.summonCreature.creature)) + return false; if (e.action.summonCreature.type < TEMPSUMMON_TIMED_OR_DEAD_DESPAWN || e.action.summonCreature.type > TEMPSUMMON_MANUAL_DESPAWN) { sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses incorrect TempSummonType %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.summonCreature.type); @@ -684,10 +743,12 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) } break; case SMART_ACTION_CALL_KILLEDMONSTER: - if (!IsCreatureValid(e, e.action.killedMonster.creature)) return false; + if (!IsCreatureValid(e, e.action.killedMonster.creature)) + return false; break; case SMART_ACTION_UPDATE_TEMPLATE: - if (e.action.updateTemplate.creature && !IsCreatureValid(e, e.action.updateTemplate.creature)) return false; + if (e.action.updateTemplate.creature && !IsCreatureValid(e, e.action.updateTemplate.creature)) + return false; break; case SMART_ACTION_SET_SHEATH: if (e.action.setSheath.sheath && e.action.setSheath.sheath >= MAX_SHEATH_STATE) @@ -706,12 +767,16 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) break; } case SMART_ACTION_SUMMON_GO: - if (!IsGameObjectValid(e, e.action.summonGO.entry)) return false; + if (!IsGameObjectValid(e, e.action.summonGO.entry)) + return false; break; case SMART_ACTION_ADD_ITEM: case SMART_ACTION_REMOVE_ITEM: - if (!IsItemValid(e, e.action.item.entry)) return false; - if (!NotNULL(e, e.action.item.count)) return false; + if (!IsItemValid(e, e.action.item.entry)) + return false; + + if (!NotNULL(e, e.action.item.count)) + return false; break; case SMART_ACTION_TELEPORT: if (!sMapStore.LookupEntry(e.action.teleport.mapID)) @@ -728,7 +793,8 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) } break; case SMART_ACTION_WP_STOP: - if (e.action.wpStop.quest && !IsQuestValid(e, e.action.wpStop.quest)) return false; + if (e.action.wpStop.quest && !IsQuestValid(e, e.action.wpStop.quest)) + return false; break; case SMART_ACTION_WP_START: { @@ -737,7 +803,8 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) sLog->outErrorDb("SmartAIMgr: Creature %d Event %u Action %u uses non-existent WaypointPath id %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.pathID); return false; } - if (e.action.wpStart.quest && !IsQuestValid(e, e.action.wpStart.quest)) return false; + if (e.action.wpStart.quest && !IsQuestValid(e, e.action.wpStart.quest)) + return false; if (e.action.wpStart.reactState > REACT_AGGRESSIVE) { sLog->outErrorDb("SmartAIMgr: Creature %d Event %u Action %u uses invalid React State %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.reactState); @@ -747,8 +814,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) } case SMART_ACTION_CREATE_TIMED_EVENT: { - if (!IsMinMaxValid(e, e.action.timeEvent.min, e.action.timeEvent.max)) return false; - if (!IsMinMaxValid(e, e.action.timeEvent.repeatMin, e.action.timeEvent.repeatMax)) return false; + if (!IsMinMaxValid(e, e.action.timeEvent.min, e.action.timeEvent.max)) + return false; + + if (!IsMinMaxValid(e, e.action.timeEvent.repeatMin, e.action.timeEvent.repeatMax)) + return false; break; } case SMART_ACTION_FOLLOW: diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 36da0e9a97e..1a5f3412459 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -21,7 +21,6 @@ #include "ArenaTeamMgr.h" #include "World.h" #include "WorldPacket.h" - #include "ArenaTeam.h" #include "Battleground.h" #include "BattlegroundMgr.h" @@ -259,9 +258,7 @@ void Battleground::Update(uint32 diff) { case STATUS_WAIT_JOIN: if (GetPlayersSize()) - { _ProcessJoin(diff); - } break; case STATUS_IN_PROGRESS: _ProcessOfflineQueue(); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index b864376e3a6..d2cbab2be54 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -1481,7 +1481,7 @@ void BattlegroundAV::ResetBGSubclass() { for (uint8 j=0; j<9; j++) m_Team_QuestStatus[i][j]=0; - m_Team_Scores[i]=BG_AV_SCORE_INITIAL_POINTS; + m_Team_Scores[i]=BG_AV_SCORE_INITIAL_POINTS; m_IsInformedNearVictory[i]=false; m_CaptainAlive[i] = true; m_CaptainBuffTimer[i] = 120000 + urand(0, 4)* 60; //as far as i could see, the buff is randomly so i make 2minutes (thats the duration of the buff itself) + 0-4minutes TODO get the right times @@ -1502,7 +1502,6 @@ void BattlegroundAV::ResetBGSubclass() for (uint16 i = 0; i < AV_CPLACE_MAX+AV_STATICCPLACE_MAX; i++) if (BgCreatures[i]) DelCreature(i); - } bool BattlegroundAV::IsBothMinesControlledByTeam(uint32 team) const @@ -1562,4 +1561,4 @@ bool BattlegroundAV::IsAllTowersControlledAndCaptainAlive(uint32 team) const } return false; -} \ No newline at end of file +} diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index dff0efd5197..f100d391698 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -338,7 +338,9 @@ struct VendorItemData VendorItem* GetItem(uint32 slot) const { - if (slot >= m_items.size()) return NULL; + if (slot >= m_items.size()) + return NULL; + return m_items[slot]; } bool Empty() const { return m_items.empty(); } diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 910e9c86b42..1fe83023976 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -840,7 +840,9 @@ bool GameObject::IsTransport() const { // If something is marked as a transport, don't transmit an out of range packet for it. GameObjectTemplate const* gInfo = GetGOInfo(); - if (!gInfo) return false; + if (!gInfo) + return false; + return gInfo->type == GAMEOBJECT_TYPE_TRANSPORT || gInfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT; } @@ -849,7 +851,9 @@ bool GameObject::IsDynTransport() const { // If something is marked as a transport, don't transmit an out of range packet for it. GameObjectTemplate const* gInfo = GetGOInfo(); - if (!gInfo) return false; + if (!gInfo) + return false; + return gInfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT || (gInfo->type == GAMEOBJECT_TYPE_TRANSPORT && !gInfo->transport.pause); } diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index bde8780e78f..a8035043543 100755 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -730,7 +730,9 @@ class GameObject : public WorldObject, public GridObject bool IsInSkillupList(uint32 PlayerGuidLow) const { for (std::list::const_iterator i = m_SkillupList.begin(); i != m_SkillupList.end(); ++i) - if (*i == PlayerGuidLow) return true; + if (*i == PlayerGuidLow) + return true; + return false; } void ClearSkillupList() { m_SkillupList.clear(); } diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp index 0236e9450f5..ee809243107 100755 --- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp +++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp @@ -102,7 +102,8 @@ uint32 GetItemEnchantMod(int32 entry) { fCount += ench_iter->chance; - if (fCount > dRoll) return ench_iter->ench; + if (fCount > dRoll) + return ench_iter->ench; } //we could get here only if sum of all enchantment chances is lower than 100% @@ -113,7 +114,8 @@ uint32 GetItemEnchantMod(int32 entry) { fCount += ench_iter->chance; - if (fCount > dRoll) return ench_iter->ench; + if (fCount > dRoll) + return ench_iter->ench; } return 0; diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index fe89a346911..2291675c36d 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1457,7 +1457,9 @@ void Position::GetPositionOffsetTo(const Position & endPos, Position & retOffset float Position::GetAngle(const Position* obj) const { - if (!obj) return 0; + if (!obj) + return 0; + return GetAngle(obj->GetPositionX(), obj->GetPositionY()); } diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 972be794464..f6bd31f7dc6 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -227,7 +227,9 @@ class Object bool HasFlag(uint16 index, uint32 flag) const { - if (index >= m_valuesCount && !PrintIndexError(index, false)) return false; + if (index >= m_valuesCount && !PrintIndexError(index, false)) + return false; + return (m_uint32Values[index] & flag) != 0; } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a0aad893893..f25d90855d4 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -23259,7 +23259,8 @@ void Player::SendCorpseReclaimDelay(bool load) else delay = GetCorpseReclaimDelay(pvp); - if (!delay) return; + if (!delay) + return; //! corpse reclaim delay 30 * 1000ms or longer at often deaths WorldPacket data(SMSG_CORPSE_RECLAIM_DELAY, 4); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 80b6ddbbf56..30be1a854d0 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -457,7 +457,8 @@ void Unit::resetAttackTimer(WeaponAttackType type) bool Unit::IsWithinCombatRange(const Unit* obj, float dist2compare) const { - if (!obj || !IsInMap(obj)) return false; + if (!obj || !IsInMap(obj)) + return false; float dx = GetPositionX() - obj->GetPositionX(); float dy = GetPositionY() - obj->GetPositionY(); @@ -472,7 +473,8 @@ bool Unit::IsWithinCombatRange(const Unit* obj, float dist2compare) const bool Unit::IsWithinMeleeRange(const Unit* obj, float dist) const { - if (!obj || !IsInMap(obj)) return false; + if (!obj || !IsInMap(obj)) + return false; float dx = GetPositionX() - obj->GetPositionX(); float dy = GetPositionY() - obj->GetPositionY(); @@ -2878,7 +2880,8 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) CurrentSpellTypes CSpellType = pSpell->GetCurrentContainer(); - if (pSpell == m_currentSpells[CSpellType]) return; // avoid breaking self + if (pSpell == m_currentSpells[CSpellType]) // avoid breaking self + return; // break same type spell if it is not delayed InterruptSpell(CSpellType, false); @@ -4619,7 +4622,9 @@ GameObject* Unit::GetGameObject(uint32 spellId) const void Unit::AddGameObject(GameObject* gameObj) { - if (!gameObj || !gameObj->GetOwnerGUID() == 0) return; + if (!gameObj || !gameObj->GetOwnerGUID() == 0) + return; + m_gameObj.push_back(gameObj); gameObj->SetOwnerGUID(GetGUID()); @@ -11879,7 +11884,9 @@ float Unit::GetWeaponProcChance() const float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellInfo* spellProto) const { // proc per minute chance calculation - if (PPM <= 0) return 0.0f; + if (PPM <= 0) + return 0.0f; + // Apply chance modifer aura if (spellProto) if (Player* modOwner = GetSpellModOwner()) diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index d8107576ee4..aab1fc96521 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -8598,10 +8598,13 @@ uint32 ObjectMgr::GetScriptId(const char *name) { // use binary search to find the script name in the sorted vector // assume "" is the first element - if (!name) return 0; - ScriptNameContainer::const_iterator itr = - std::lower_bound(_scriptNamesStore.begin(), _scriptNamesStore.end(), name); - if (itr == _scriptNamesStore.end() || *itr != name) return 0; + if (!name) + return 0; + + ScriptNameContainer::const_iterator itr = std::lower_bound(_scriptNamesStore.begin(), _scriptNamesStore.end(), name); + if (itr == _scriptNamesStore.end() || *itr != name) + return 0; + return uint32(itr - _scriptNamesStore.begin()); } @@ -8610,6 +8613,7 @@ void ObjectMgr::CheckScripts(ScriptsType type, std::set& ids) ScriptMapMap* scripts = GetScriptsMapByType(type); if (!scripts) return; + for (ScriptMapMap::const_iterator itrMM = scripts->begin(); itrMM != scripts->end(); ++itrMM) { for (ScriptMap::const_iterator itrM = itrMM->second.begin(); itrM != itrMM->second.end(); ++itrM) diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 637025c7d9e..de8dc2b90f6 100755 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -248,8 +248,9 @@ void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recv_data*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DECLINE"); - Group *group = GetPlayer()->GetGroupInvite(); - if (!group) return; + Group* group = GetPlayer()->GetGroupInvite(); + if (!group) + return; // Remember leader if online (group pointer will be invalid if group gets disbanded) Player* leader = ObjectAccessor::FindPlayer(group->GetLeaderGUID()); diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index c977a967162..7efd600baa8 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -512,7 +512,9 @@ QuestItemList* Loot::FillFFALoot(Player* player) QuestItemList* Loot::FillQuestLoot(Player* player) { - if (items.size() == MAX_NR_LOOT_ITEMS) return NULL; + if (items.size() == MAX_NR_LOOT_ITEMS) + return NULL; + QuestItemList* ql = new QuestItemList(); for (uint8 i = 0; i < quest_items.size(); ++i) diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index d0f99610262..766e3d23f93 100755 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -245,8 +245,12 @@ class Map : public GridRefManager // currently unused for normal maps bool CanUnload(uint32 diff) { - if (!m_unloadTimer) return false; - if (m_unloadTimer <= diff) return true; + if (!m_unloadTimer) + return false; + + if (m_unloadTimer <= diff) + return true; + m_unloadTimer -= diff; return false; } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 312b79e3e7a..52a2f1f9da8 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -6262,9 +6262,12 @@ SpellCastResult Spell::CheckItems() case SPELL_EFFECT_WEAPON_DAMAGE: case SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL: { - if (m_caster->GetTypeId() != TYPEID_PLAYER) return SPELL_FAILED_TARGET_NOT_PLAYER; + if (m_caster->GetTypeId() != TYPEID_PLAYER) + return SPELL_FAILED_TARGET_NOT_PLAYER; + if (m_attackType != RANGED_ATTACK) break; + Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(m_attackType); if (!pItem || pItem->IsBroken()) return SPELL_FAILED_EQUIPPED_ITEM; @@ -6276,7 +6279,8 @@ SpellCastResult Spell::CheckItems() uint32 ammo = pItem->GetEntry(); if (!m_caster->ToPlayer()->HasItemCount(ammo, 1)) return SPELL_FAILED_NO_AMMO; - }; break; + }; + break; case ITEM_SUBCLASS_WEAPON_GUN: case ITEM_SUBCLASS_WEAPON_BOW: case ITEM_SUBCLASS_WEAPON_CROSSBOW: diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 2330461256b..37d79225169 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1140,11 +1140,6 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 return true; } -void SpellMgr::LoadSpellInfos() -{ - -} - void SpellMgr::LoadSpellRanks() { uint32 oldMSTime = getMSTime(); @@ -1160,13 +1155,12 @@ void SpellMgr::LoadSpellRanks() if (!result) { - sLog->outString(">> Loaded 0 spell rank records"); + sLog->outString(">> Loaded 0 spell rank records. DB table `spell_ranks` is empty."); sLog->outString(); - sLog->outErrorDb("`spell_ranks` table is empty!"); return; } - uint32 rows = 0; + uint32 count = 0; bool finished = false; do @@ -1237,7 +1231,7 @@ void SpellMgr::LoadSpellRanks() std::list >::iterator itr = rankChain.begin(); do { - ++rows; + ++count; int32 addedSpell = itr->first; mSpellChains[addedSpell].first = GetSpellInfo(lastSpell); mSpellChains[addedSpell].last = GetSpellInfo(rankChain.back().first); @@ -1257,7 +1251,7 @@ void SpellMgr::LoadSpellRanks() while (true); } while (!finished); - sLog->outString(">> Loaded %u spell rank records in %u ms", rows, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> Loaded %u spell rank records in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } @@ -1273,19 +1267,19 @@ void SpellMgr::LoadSpellRequired() if (!result) { - sLog->outString(">> Loaded 0 spell required records"); + sLog->outString(">> Loaded 0 spell required records. DB table `spell_required` is empty."); sLog->outString(); - sLog->outErrorDb("`spell_required` table is empty!"); return; } - uint32 rows = 0; + uint32 count = 0; do { Field* fields = result->Fetch(); uint32 spell_id = fields[0].GetUInt32(); uint32 spell_req = fields[1].GetUInt32(); + // check if chain is made with valid first spell SpellInfo const* spell = GetSpellInfo(spell_id); if (!spell) @@ -1293,17 +1287,20 @@ void SpellMgr::LoadSpellRequired() sLog->outErrorDb("spell_id %u in `spell_required` table is not found in dbcs, skipped", spell_id); continue; } + SpellInfo const* req_spell = GetSpellInfo(spell_req); if (!req_spell) { sLog->outErrorDb("req_spell %u in `spell_required` table is not found in dbcs, skipped", spell_req); continue; } + if (GetFirstSpellInChain(spell_id) == GetFirstSpellInChain(spell_req)) { sLog->outErrorDb("req_spell %u and spell_id %u in `spell_required` table are ranks of the same spell, entry not needed, skipped", spell_req, spell_id); continue; } + if (IsSpellRequiringSpell(spell_id, spell_req)) { sLog->outErrorDb("duplicated entry of req_spell %u and spell_id %u in `spell_required`, skipped", spell_req, spell_id); @@ -1312,10 +1309,10 @@ void SpellMgr::LoadSpellRequired() mSpellReq.insert (std::pair(spell_id, spell_req)); mSpellsReqSpell.insert (std::pair(spell_req, spell_id)); - ++rows; + ++count; } while (result->NextRow()); - sLog->outString(">> Loaded %u spell required records in %u ms", rows, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> Loaded %u spell required records in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } @@ -1367,14 +1364,12 @@ void SpellMgr::LoadSpellLearnSpells() QueryResult result = WorldDatabase.Query("SELECT entry, SpellID, Active FROM spell_learn_spell"); if (!result) { - sLog->outString(">> Loaded 0 spell learn spells"); + sLog->outString(">> Loaded 0 spell learn spells. DB table `spell_learn_spell` is empty."); sLog->outString(); - sLog->outErrorDb("`spell_learn_spell` table is empty!"); return; } uint32 count = 0; - do { Field* fields = result->Fetch(); @@ -1382,9 +1377,9 @@ void SpellMgr::LoadSpellLearnSpells() uint32 spell_id = fields[0].GetUInt16(); SpellLearnSpellNode node; - node.spell = fields[1].GetUInt16(); - node.active = fields[2].GetBool(); - node.autoLearned= false; + node.spell = fields[1].GetUInt16(); + node.active = fields[2].GetBool(); + node.autoLearned = false; if (!GetSpellInfo(spell_id)) { @@ -1478,7 +1473,6 @@ void SpellMgr::LoadSpellTargetPositions() } uint32 count = 0; - do { Field* fields = result->Fetch(); @@ -1590,19 +1584,17 @@ void SpellMgr::LoadSpellGroups() mSpellSpellGroup.clear(); // need for reload case mSpellGroupSpell.clear(); - uint32 count = 0; - // 0 1 QueryResult result = WorldDatabase.Query("SELECT id, spell_id FROM spell_group"); if (!result) { + sLog->outString(">> Loaded 0 spell group definitions. DB table `spell_group` is empty."); sLog->outString(); - sLog->outString(">> Loaded %u spell group definitions", count); return; } std::set groups; - + uint32 count = 0; do { Field* fields = result->Fetch(); @@ -1673,17 +1665,16 @@ void SpellMgr::LoadSpellGroupStackRules() mSpellGroupStack.clear(); // need for reload case - uint32 count = 0; - // 0 1 QueryResult result = WorldDatabase.Query("SELECT group_id, stack_rule FROM spell_group_stack_rules"); if (!result) { - sLog->outString(">> Loaded 0 spell group stack rules"); + sLog->outString(">> Loaded 0 spell group stack rules. DB table `spell_group_stack_rules` is empty."); sLog->outString(); return; } + uint32 count = 0; do { Field* fields = result->Fetch(); @@ -1719,17 +1710,16 @@ void SpellMgr::LoadSpellProcEvents() mSpellProcEventMap.clear(); // need for reload case - uint32 count = 0; - // 0 1 2 3 4 5 6 7 8 9 10 QueryResult result = WorldDatabase.Query("SELECT entry, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, procFlags, procEx, ppmRate, CustomChance, Cooldown FROM spell_proc_event"); if (!result) { - sLog->outString(">> Loaded %u spell proc event conditions", count); + sLog->outString(">> Loaded 0 spell proc event conditions. DB table `spell_proc_event` is empty."); sLog->outString(); return; } + uint32 count = 0; uint32 customProc = 0; do { @@ -1784,17 +1774,16 @@ void SpellMgr::LoadSpellProcs() mSpellProcMap.clear(); // need for reload case - uint32 count = 0; - // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 QueryResult result = WorldDatabase.Query("SELECT spellId, schoolMask, spellFamilyName, spellFamilyMask0, spellFamilyMask1, spellFamilyMask2, typeMask, spellTypeMask, spellPhaseMask, hitMask, attributesMask, ratePerMinute, chance, cooldown, charges FROM spell_proc"); if (!result) { - sLog->outString(">> Loaded %u spell proc conditions and data", count); + sLog->outString(">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty."); sLog->outString(); return; } + uint32 count = 0; do { Field* fields = result->Fetch(); @@ -1925,16 +1914,17 @@ void SpellMgr::LoadSpellBonusess() uint32 oldMSTime = getMSTime(); mSpellBonusMap.clear(); // need for reload case - uint32 count = 0; + // 0 1 2 3 4 QueryResult result = WorldDatabase.Query("SELECT entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus FROM spell_bonus_data"); if (!result) { - sLog->outString(">> Loaded %u spell bonus data", count); + sLog->outString(">> Loaded 0 spell bonus data. DB table `spell_bonus_data` is empty."); sLog->outString(); return; } + uint32 count = 0; do { Field* fields = result->Fetch(); @@ -1966,17 +1956,16 @@ void SpellMgr::LoadSpellThreats() mSpellThreatMap.clear(); // need for reload case - uint32 count = 0; - // 0 1 2 3 QueryResult result = WorldDatabase.Query("SELECT entry, flatMod, pctMod, apPctMod FROM spell_threat"); if (!result) { - sLog->outString(">> Loaded 0 aggro generating spells"); + sLog->outString(">> Loaded 0 aggro generating spells. DB table `spell_threat` is empty."); sLog->outString(); return; } + uint32 count = 0; do { Field* fields = result->Fetch(); @@ -2040,7 +2029,6 @@ void SpellMgr::LoadSpellPetAuras() } uint32 count = 0; - do { Field* fields = result->Fetch(); @@ -2095,11 +2083,10 @@ void SpellMgr::LoadEnchantCustomAttr() uint32 size = sSpellItemEnchantmentStore.GetNumRows(); mEnchantCustomAttr.resize(size); - uint32 count = 0; - for (uint32 i = 0; i < size; ++i) mEnchantCustomAttr[i] = 0; + uint32 count = 0; for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { SpellInfo const* spellInfo = GetSpellInfo(i); @@ -2135,17 +2122,16 @@ void SpellMgr::LoadSpellEnchantProcData() mSpellEnchantProcEventMap.clear(); // need for reload case - uint32 count = 0; - // 0 1 2 3 QueryResult result = WorldDatabase.Query("SELECT entry, customChance, PPMChance, procEx FROM spell_enchant_proc_data"); if (!result) { - sLog->outString(">> Loaded %u spell enchant proc event conditions", count); + sLog->outString(">> Loaded 0 spell enchant proc event conditions. DB table `spell_enchant_proc_data` is empty."); sLog->outString(); return; } + uint32 count = 0; do { Field* fields = result->Fetch(); @@ -2190,7 +2176,6 @@ void SpellMgr::LoadSpellLinked() } uint32 count = 0; - do { Field* fields = result->Fetch(); @@ -2435,7 +2420,6 @@ void SpellMgr::LoadSpellAreas() } uint32 count = 0; - do { Field* fields = result->Fetch(); diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 9fffd474651..521070f7879 100755 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -693,7 +693,6 @@ class SpellMgr public: // Loading data at server startup - void LoadSpellInfos(); void LoadSpellRanks(); void LoadSpellRequired(); void LoadSpellLearnSkills(); From 6763c237778a6fda4380ea1351ff3d79414acab9 Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 28 Mar 2012 08:29:42 -0400 Subject: [PATCH 0341/1149] Core/Spells: attempt to fix penance doing nothing on "friendly" non faction targets. should return invalid targets --- src/server/scripts/Spells/spell_priest.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index b012fe5f183..a327a200c98 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -185,6 +185,11 @@ class spell_pri_penance : public SpellScriptLoader { PrepareSpellScript(spell_pri_penance_SpellScript); + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + bool Validate(SpellInfo const* spellEntry) { if (!sSpellMgr->GetSpellInfo(PRIEST_SPELL_PENANCE_R1)) @@ -219,10 +224,21 @@ class spell_pri_penance : public SpellScriptLoader } } + SpellCastResult CheckCast() + { + Player* caster = GetCaster()->ToPlayer(); + if (GetTargetUnit()) + if (Player* target = GetTargetUnit()->ToPlayer()) + if (caster->GetTeam() != target->GetTeam() && !caster->IsValidAttackTarget(target)) + return SPELL_FAILED_BAD_TARGETS; + return SPELL_CAST_OK; + } + void Register() { // add dummy effect spell handler to Penance OnEffectHitTarget += SpellEffectFn(spell_pri_penance_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnCheckCast += SpellCheckCastFn(spell_pri_penance_SpellScript::CheckCast); } }; From b21725ecac647b0a5af79f1ef730a9cbaf5e4070 Mon Sep 17 00:00:00 2001 From: leak Date: Wed, 28 Mar 2012 16:39:59 +0200 Subject: [PATCH 0342/1149] SQL: Auth db data type cleanup `account` / Storage engine switched to InnoDB --- sql/base/auth_database.sql | 30 +++++++++---------- .../auth/2012_03_28_00_auth_account.sql | 13 ++++++++ 2 files changed, 28 insertions(+), 15 deletions(-) create mode 100644 sql/updates/auth/2012_03_28_00_auth_account.sql diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 305ba679bf2..3c851d4dac7 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 5.5.21, for Win64 (x86) +-- MySQL dump 10.13 Distrib 5.5.22, for Win64 (x86) -- -- Host: localhost Database: auth -- ------------------------------------------------------ --- Server version 5.5.21 +-- Server version 5.5.22 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -23,27 +23,27 @@ DROP TABLE IF EXISTS `account`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `account` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifier', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifier', `username` varchar(32) NOT NULL DEFAULT '', `sha_pass_hash` varchar(40) NOT NULL DEFAULT '', - `sessionkey` longtext, - `v` longtext, - `s` longtext, - `email` text, + `sessionkey` varchar(80) NOT NULL DEFAULT '', + `v` varchar(64) NOT NULL DEFAULT '', + `s` varchar(64) NOT NULL DEFAULT '', + `email` varchar(254) NOT NULL DEFAULT '', `joindate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `last_ip` varchar(30) NOT NULL DEFAULT '127.0.0.1', - `failed_logins` int(11) unsigned NOT NULL DEFAULT '0', + `last_ip` varchar(15) NOT NULL DEFAULT '127.0.0.1', + `failed_logins` int(10) unsigned NOT NULL DEFAULT '0', `locked` tinyint(3) unsigned NOT NULL DEFAULT '0', `last_login` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `online` tinyint(4) NOT NULL DEFAULT '0', + `online` tinyint(3) unsigned NOT NULL DEFAULT '0', `expansion` tinyint(3) unsigned NOT NULL DEFAULT '2', - `mutetime` bigint(40) NOT NULL DEFAULT '0', + `mutetime` bigint(20) NOT NULL DEFAULT '0', `locale` tinyint(3) unsigned NOT NULL DEFAULT '0', - `os` varchar(4) NOT NULL DEFAULT '', - `recruiter` int(11) NOT NULL DEFAULT '0', + `os` varchar(3) NOT NULL DEFAULT '', + `recruiter` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `idx_username` (`username`) -) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Account System'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Account System'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -250,4 +250,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2012-03-26 18:21:51 +-- Dump completed on 2012-03-27 14:28:21 diff --git a/sql/updates/auth/2012_03_28_00_auth_account.sql b/sql/updates/auth/2012_03_28_00_auth_account.sql new file mode 100644 index 00000000000..199baac5178 --- /dev/null +++ b/sql/updates/auth/2012_03_28_00_auth_account.sql @@ -0,0 +1,13 @@ +ALTER TABLE `account` + CHANGE `id` `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identifier', + CHANGE `sessionkey` `sessionkey` VARCHAR(80) NOT NULL DEFAULT '', + CHANGE `v` `v` VARCHAR(64) NOT NULL DEFAULT '', + CHANGE `s` `s` VARCHAR(64) NOT NULL DEFAULT '', + CHANGE `email` `email` VARCHAR(254) NOT NULL DEFAULT '', + CHANGE `last_ip` `last_ip` VARCHAR(15) NOT NULL DEFAULT '127.0.0.1', + CHANGE `failed_logins` `failed_logins` INT(10) UNSIGNED NOT NULL DEFAULT '0', + CHANGE `online` `online` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0', + CHANGE `mutetime` `mutetime` BIGINT(20) NOT NULL DEFAULT '0', + CHANGE `os` `os` VARCHAR(3) NOT NULL DEFAULT '', + CHANGE `recruiter` `recruiter` INT(10) UNSIGNED NOT NULL DEFAULT '0', + ROW_FORMAT=DEFAULT ENGINE=INNODB; From a01e2a59cd2904db7c39e2b8fc40901b0926f883 Mon Sep 17 00:00:00 2001 From: leak Date: Wed, 28 Mar 2012 16:48:49 +0200 Subject: [PATCH 0343/1149] SQL: Auth db data type cleanup `account_access`, `account_banned`, `ip_banned` / Storage engine switched to InnoDB --- sql/base/auth_database.sql | 14 +++++++------- .../auth/2012_03_28_01_auth_account_access.sql | 4 ++++ .../auth/2012_03_28_02_auth_account_banned.sql | 4 ++++ sql/updates/auth/2012_03_28_03_ip_banned.sql | 2 ++ 4 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 sql/updates/auth/2012_03_28_01_auth_account_access.sql create mode 100644 sql/updates/auth/2012_03_28_02_auth_account_banned.sql create mode 100644 sql/updates/auth/2012_03_28_03_ip_banned.sql diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 3c851d4dac7..20bb870ff56 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -63,11 +63,11 @@ DROP TABLE IF EXISTS `account_access`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `account_access` ( - `id` int(11) unsigned NOT NULL, + `id` int(10) unsigned NOT NULL, `gmlevel` tinyint(3) unsigned NOT NULL, `RealmID` int(11) NOT NULL DEFAULT '-1', PRIMARY KEY (`id`,`RealmID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -87,14 +87,14 @@ DROP TABLE IF EXISTS `account_banned`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `account_banned` ( - `id` int(11) NOT NULL DEFAULT '0' COMMENT 'Account id', + `id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Account id', `bandate` int(10) unsigned NOT NULL DEFAULT '0', `unbandate` int(10) unsigned NOT NULL DEFAULT '0', `bannedby` varchar(50) NOT NULL, `banreason` varchar(255) NOT NULL, - `active` tinyint(4) NOT NULL DEFAULT '1', + `active` tinyint(3) unsigned NOT NULL DEFAULT '1', PRIMARY KEY (`id`,`bandate`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Ban List'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Ban List'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -120,7 +120,7 @@ CREATE TABLE `ip_banned` ( `bannedby` varchar(50) NOT NULL DEFAULT '[Console]', `banreason` varchar(255) NOT NULL DEFAULT 'no reason', PRIMARY KEY (`ip`,`bandate`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Banned IPs'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Banned IPs'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -250,4 +250,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2012-03-27 14:28:21 +-- Dump completed on 2012-03-28 16:44:39 diff --git a/sql/updates/auth/2012_03_28_01_auth_account_access.sql b/sql/updates/auth/2012_03_28_01_auth_account_access.sql new file mode 100644 index 00000000000..7f79634d765 --- /dev/null +++ b/sql/updates/auth/2012_03_28_01_auth_account_access.sql @@ -0,0 +1,4 @@ +ALTER TABLE `account_access` + CHANGE `id` `id` INT(10) UNSIGNED NOT NULL, + ROW_FORMAT=DEFAULT ENGINE=INNODB; + \ No newline at end of file diff --git a/sql/updates/auth/2012_03_28_02_auth_account_banned.sql b/sql/updates/auth/2012_03_28_02_auth_account_banned.sql new file mode 100644 index 00000000000..917cea1a684 --- /dev/null +++ b/sql/updates/auth/2012_03_28_02_auth_account_banned.sql @@ -0,0 +1,4 @@ +ALTER TABLE `account_banned` + CHANGE `id` `id` INT(10) UNSIGNED DEFAULT '0' NOT NULL COMMENT 'Account id', + CHANGE `active` `active` TINYINT(3) UNSIGNED DEFAULT '1' NOT NULL, + ROW_FORMAT=DEFAULT ENGINE=INNODB; diff --git a/sql/updates/auth/2012_03_28_03_ip_banned.sql b/sql/updates/auth/2012_03_28_03_ip_banned.sql new file mode 100644 index 00000000000..2e754effc60 --- /dev/null +++ b/sql/updates/auth/2012_03_28_03_ip_banned.sql @@ -0,0 +1,2 @@ +ALTER TABLE `ip_banned` + ROW_FORMAT=DEFAULT ENGINE=INNODB; From 007e9269fe91807de6974092eee4f9e87e33e1e6 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 28 Mar 2012 18:56:22 +0200 Subject: [PATCH 0344/1149] Core/GameEventMgr: Fix a compile warning --- src/server/game/Events/GameEventMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 182aaa35c49..bdd2ab0377d 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -823,7 +823,7 @@ void GameEventMgr::LoadFromDB() { Field* fields = result->Fetch(); - int8 event_id = fields[0].GetInt8(); + uint8 event_id = fields[0].GetUInt8(); if (event_id >= mGameEventVendors.size()) { From 6237ddac34fe40e851dbf052d5911aa8ef076be1 Mon Sep 17 00:00:00 2001 From: click Date: Wed, 28 Mar 2012 19:31:06 +0200 Subject: [PATCH 0345/1149] Partially revert a36a0a77ef75e66933ac5b8802a9ec7906acfd0b. Cleaning databases for old/deprecated and expired quests should never be a developers choice specifically. This should be done by admins, not developers, through the use of the already existing paramters found in the worldserver config : CleanCharacterDB / PersistentCharacterCleanFlags An adjustment to the respective questloader prepared statement has been done to accomodate for the earlier change (by not loading such quests into memory at all). Documentation for how this cleanup-procedures work already exists in the core : doc/CharacterDBCleanup.txt. --- .../2012_03_01_00_characters_character_queststatus.sql | 1 - src/server/game/Entities/Player/Player.cpp | 8 +------- .../shared/Database/Implementation/CharacterDatabase.cpp | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 sql/updates/characters/2012_03_01_00_characters_character_queststatus.sql diff --git a/sql/updates/characters/2012_03_01_00_characters_character_queststatus.sql b/sql/updates/characters/2012_03_01_00_characters_character_queststatus.sql deleted file mode 100644 index da3a0f786b8..00000000000 --- a/sql/updates/characters/2012_03_01_00_characters_character_queststatus.sql +++ /dev/null @@ -1 +0,0 @@ -DELETE FROM `character_queststatus` WHERE `status`=0; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 4b57e8e8fc0..1961d5dc452 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -17962,14 +17962,8 @@ void Player::_LoadQuestStatus(PreparedQueryResult result) QuestStatusData& questStatusData = m_QuestStatus[quest_id]; uint8 qstatus = fields[1].GetUInt8(); - if (qstatus < MAX_QUEST_STATUS && qstatus > QUEST_STATUS_NONE) + if (qstatus < MAX_QUEST_STATUS) questStatusData.Status = QuestStatus(qstatus); - else if (qstatus == QUEST_STATUS_NONE) - { - sLog->outError("Player %s (GUID: %u) has QUEST_STATUS_NONE for quest %u and should be removed from character_queststatus.", - GetName(), GetGUIDLow(), quest_id); - continue; - } else { questStatusData.Status = QUEST_STATUS_INCOMPLETE; diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 3d30e97544a..a9754cfc73d 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -71,7 +71,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() "base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges FROM character_aura WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_SPELL, "SELECT spell, active, disabled FROM character_spell WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_QUESTSTATUS, "SELECT quest, status, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, " - "itemcount1, itemcount2, itemcount3, itemcount4, playercount FROM character_queststatus WHERE guid = ?", CONNECTION_ASYNC) + "itemcount1, itemcount2, itemcount3, itemcount4, playercount FROM character_queststatus WHERE guid = ? AND status <> 0", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_DAILYQUESTSTATUS, "SELECT quest, time FROM character_queststatus_daily WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_WEEKLYQUESTSTATUS, "SELECT quest FROM character_queststatus_weekly WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_SEASONALQUESTSTATUS, "SELECT quest, event FROM character_queststatus_seasonal WHERE guid = ?", CONNECTION_ASYNC) From 7309ee562195146220b5f048a50af15096759fd3 Mon Sep 17 00:00:00 2001 From: leak Date: Wed, 28 Mar 2012 18:37:06 +0200 Subject: [PATCH 0346/1149] SQL: Auth db data type cleanup `logs`, `realmcharacters`, `realmlist`, `uptime` / Storage engine switched to InnoDB Note: As for the redundant `uptime`.`startstring` being removed, this page might be of interest how to generate time strings from unix timestamps http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_from-unixtime --- sql/base/auth_database.sql | 37 +++++++++---------- sql/updates/auth/2012_03_28_04_logs.sql | 5 +++ .../auth/2012_03_28_05_realmcharacters.sql | 4 ++ sql/updates/auth/2012_03_28_06_realmlist.sql | 6 +++ sql/updates/auth/2012_03_28_07_uptime.sql | 6 +++ src/server/authserver/Realms/RealmList.cpp | 4 +- src/server/authserver/Realms/RealmList.h | 2 +- src/server/game/World/World.cpp | 18 +++------ src/server/shared/Logging/Log.cpp | 2 +- 9 files changed, 48 insertions(+), 36 deletions(-) create mode 100644 sql/updates/auth/2012_03_28_04_logs.sql create mode 100644 sql/updates/auth/2012_03_28_05_realmcharacters.sql create mode 100644 sql/updates/auth/2012_03_28_06_realmlist.sql create mode 100644 sql/updates/auth/2012_03_28_07_uptime.sql diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 20bb870ff56..5803529da1e 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -140,11 +140,11 @@ DROP TABLE IF EXISTS `logs`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `logs` ( - `time` int(14) NOT NULL, - `realm` int(4) NOT NULL, - `type` int(4) NOT NULL, - `string` text -) ENGINE=MyISAM DEFAULT CHARSET=latin1; + `time` int(10) unsigned NOT NULL, + `realm` int(10) unsigned NOT NULL, + `type` tinyint(3) unsigned NOT NULL, + `string` text CHARACTER SET latin1 +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -164,12 +164,12 @@ DROP TABLE IF EXISTS `realmcharacters`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `realmcharacters` ( - `realmid` int(11) unsigned NOT NULL DEFAULT '0', - `acctid` bigint(20) unsigned NOT NULL, + `realmid` int(10) unsigned NOT NULL DEFAULT '0', + `acctid` int(10) unsigned NOT NULL, `numchars` tinyint(3) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`realmid`,`acctid`), KEY `acctid` (`acctid`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Realm Character Tracker'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Realm Character Tracker'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -189,19 +189,19 @@ DROP TABLE IF EXISTS `realmlist`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `realmlist` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(32) NOT NULL DEFAULT '', - `address` varchar(32) NOT NULL DEFAULT '127.0.0.1', - `port` int(11) NOT NULL DEFAULT '8085', + `address` varchar(15) NOT NULL DEFAULT '127.0.0.1', + `port` smallint(5) unsigned NOT NULL DEFAULT '8085', `icon` tinyint(3) unsigned NOT NULL DEFAULT '0', `flag` tinyint(3) unsigned NOT NULL DEFAULT '2', `timezone` tinyint(3) unsigned NOT NULL DEFAULT '0', `allowedSecurityLevel` tinyint(3) unsigned NOT NULL DEFAULT '0', `population` float unsigned NOT NULL DEFAULT '0', - `gamebuild` int(11) unsigned NOT NULL DEFAULT '12340', + `gamebuild` int(10) unsigned NOT NULL DEFAULT '12340', PRIMARY KEY (`id`), UNIQUE KEY `idx_name` (`name`) -) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Realm System'; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='Realm System'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -222,14 +222,13 @@ DROP TABLE IF EXISTS `uptime`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `uptime` ( - `realmid` int(11) unsigned NOT NULL, - `starttime` bigint(20) unsigned NOT NULL DEFAULT '0', - `startstring` varchar(64) NOT NULL DEFAULT '', - `uptime` bigint(20) unsigned NOT NULL DEFAULT '0', + `realmid` int(10) unsigned NOT NULL, + `starttime` int(10) unsigned NOT NULL DEFAULT '0', + `uptime` int(10) unsigned NOT NULL DEFAULT '0', `maxplayers` smallint(5) unsigned NOT NULL DEFAULT '0', `revision` varchar(255) NOT NULL DEFAULT 'Trinitycore', PRIMARY KEY (`realmid`,`starttime`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Uptime system'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Uptime system'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -250,4 +249,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2012-03-28 16:44:39 +-- Dump completed on 2012-03-28 18:26:06 diff --git a/sql/updates/auth/2012_03_28_04_logs.sql b/sql/updates/auth/2012_03_28_04_logs.sql new file mode 100644 index 00000000000..4c837a47ed1 --- /dev/null +++ b/sql/updates/auth/2012_03_28_04_logs.sql @@ -0,0 +1,5 @@ +ALTER TABLE `logs` + CHANGE `time` `time` INT(10) UNSIGNED NOT NULL, + CHANGE `realm` `realm` INT(10) UNSIGNED NOT NULL, + CHANGE `type` `type` TINYINT(3) UNSIGNED NOT NULL, + ROW_FORMAT=DEFAULT ENGINE=INNODB; diff --git a/sql/updates/auth/2012_03_28_05_realmcharacters.sql b/sql/updates/auth/2012_03_28_05_realmcharacters.sql new file mode 100644 index 00000000000..e50b3c3f331 --- /dev/null +++ b/sql/updates/auth/2012_03_28_05_realmcharacters.sql @@ -0,0 +1,4 @@ +ALTER TABLE `realmcharacters` + CHANGE `realmid` `realmid` INT(10) UNSIGNED DEFAULT 0 NOT NULL, + CHANGE `acctid` `acctid` INT(10) UNSIGNED NOT NULL, + ROW_FORMAT=DEFAULT ENGINE=INNODB; diff --git a/sql/updates/auth/2012_03_28_06_realmlist.sql b/sql/updates/auth/2012_03_28_06_realmlist.sql new file mode 100644 index 00000000000..e5e7b2e00d4 --- /dev/null +++ b/sql/updates/auth/2012_03_28_06_realmlist.sql @@ -0,0 +1,6 @@ +ALTER TABLE `realmlist` + CHANGE `id` `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + CHANGE `address` `address` VARCHAR(15) DEFAULT '127.0.0.1' NOT NULL, + CHANGE `port` `port` SMALLINT(5) UNSIGNED DEFAULT '8085' NOT NULL, + CHANGE `gamebuild` `gamebuild` INT(10) UNSIGNED DEFAULT '12340' NOT NULL, + ROW_FORMAT=DEFAULT ENGINE=INNODB; \ No newline at end of file diff --git a/sql/updates/auth/2012_03_28_07_uptime.sql b/sql/updates/auth/2012_03_28_07_uptime.sql new file mode 100644 index 00000000000..0ea4e3321df --- /dev/null +++ b/sql/updates/auth/2012_03_28_07_uptime.sql @@ -0,0 +1,6 @@ +ALTER TABLE `uptime` + DROP COLUMN `startstring`, + CHANGE `realmid` `realmid` INT(10) UNSIGNED NOT NULL, + CHANGE `starttime` `starttime` INT(10) UNSIGNED DEFAULT 0 NOT NULL, + CHANGE `uptime` `uptime` INT(10) UNSIGNED DEFAULT 0 NOT NULL, + ROW_FORMAT=DEFAULT ENGINE=INNODB; diff --git a/src/server/authserver/Realms/RealmList.cpp b/src/server/authserver/Realms/RealmList.cpp index efcced51089..f856156825d 100755 --- a/src/server/authserver/Realms/RealmList.cpp +++ b/src/server/authserver/Realms/RealmList.cpp @@ -31,7 +31,7 @@ void RealmList::Initialize(uint32 updateInterval) UpdateRealms(true); } -void RealmList::UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint32 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build) +void RealmList::UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build) { // Create new if not exist or update existed Realm& realm = m_realms[name]; @@ -82,7 +82,7 @@ void RealmList::UpdateRealms(bool init) uint32 realmId = fields[0].GetUInt32(); const std::string& name = fields[1].GetString(); const std::string& address = fields[2].GetString(); - uint32 port = fields[3].GetUInt32(); + uint16 port = fields[3].GetUInt16(); uint8 icon = fields[4].GetUInt8(); RealmFlags flag = RealmFlags(fields[5].GetUInt8()); uint8 timezone = fields[6].GetUInt8(); diff --git a/src/server/authserver/Realms/RealmList.h b/src/server/authserver/Realms/RealmList.h index 4d258953ae0..c8407b0fea1 100755 --- a/src/server/authserver/Realms/RealmList.h +++ b/src/server/authserver/Realms/RealmList.h @@ -71,7 +71,7 @@ public: private: void UpdateRealms(bool init=false); - void UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint32 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build); + void UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build); RealmMap m_realms; uint32 m_UpdateInterval; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 489278f63e6..9683d847f86 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1669,18 +1669,10 @@ void World::SetInitialWorldSettings() ///- Initialize game time and timers sLog->outString("Initialize game time and timers"); m_gameTime = time(NULL); - m_startTime=m_gameTime; + m_startTime = m_gameTime; - tm local; - time_t curr; - time(&curr); - local=*(localtime(&curr)); // dereference and assign - char isoDate[128]; - sprintf(isoDate, "%04d-%02d-%02d %02d:%02d:%02d", - local.tm_year+1900, local.tm_mon+1, local.tm_mday, local.tm_hour, local.tm_min, local.tm_sec); - - LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, startstring, uptime, revision) VALUES('%u', " UI64FMTD ", '%s', 0, '%s')", - realmID, uint64(m_startTime), isoDate, _FULLVERSION); // One-time query + LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, uptime, revision) VALUES(%u, %u, '%s', 0, '%s')", + realmID, uint32(m_startTime), _FULLVERSION); // One-time query m_timers[WUPDATE_WEATHERS].SetInterval(1*IN_MILLISECONDS); m_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE*IN_MILLISECONDS); @@ -1965,10 +1957,10 @@ void World::Update(uint32 diff) PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_UPTIME_PLAYERS); - stmt->setUInt64(0, uint64(tmpDiff)); + stmt->setUInt32(0, tmpDiff); stmt->setUInt16(1, uint16(maxOnlinePlayers)); stmt->setUInt32(2, realmID); - stmt->setUInt64(3, uint64(m_startTime)); + stmt->setUInt32(3, uint32(m_startTime)); LoginDatabase.Execute(stmt); } diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp index a9bb282cf86..0a53706fea2 100755 --- a/src/server/shared/Logging/Log.cpp +++ b/src/server/shared/Logging/Log.cpp @@ -382,7 +382,7 @@ void Log::outDB(LogTypes type, const char * str) PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_LOG); stmt->setInt32(0, realm); - stmt->setInt32(1, type); + stmt->setUInt8(1, uint8(type)); stmt->setString(2, logStr); LoginDatabase.Execute(stmt); From 4bead55dcd50f13bf065841ed3eb3c46cb7b4c37 Mon Sep 17 00:00:00 2001 From: leak Date: Wed, 28 Mar 2012 19:51:13 +0200 Subject: [PATCH 0347/1149] SQL: Proper prefixing --- ...12_03_28_03_ip_banned.sql => 2012_03_28_03_auth_ip_banned.sql} | 0 .../auth/{2012_03_28_04_logs.sql => 2012_03_28_04_auth_logs.sql} | 0 ...realmcharacters.sql => 2012_03_28_05_auth_realmcharacters.sql} | 0 ...12_03_28_06_realmlist.sql => 2012_03_28_06_auth_realmlist.sql} | 0 .../{2012_03_28_07_uptime.sql => 2012_03_28_07_auth_uptime.sql} | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename sql/updates/auth/{2012_03_28_03_ip_banned.sql => 2012_03_28_03_auth_ip_banned.sql} (100%) rename sql/updates/auth/{2012_03_28_04_logs.sql => 2012_03_28_04_auth_logs.sql} (100%) rename sql/updates/auth/{2012_03_28_05_realmcharacters.sql => 2012_03_28_05_auth_realmcharacters.sql} (100%) rename sql/updates/auth/{2012_03_28_06_realmlist.sql => 2012_03_28_06_auth_realmlist.sql} (100%) rename sql/updates/auth/{2012_03_28_07_uptime.sql => 2012_03_28_07_auth_uptime.sql} (100%) diff --git a/sql/updates/auth/2012_03_28_03_ip_banned.sql b/sql/updates/auth/2012_03_28_03_auth_ip_banned.sql similarity index 100% rename from sql/updates/auth/2012_03_28_03_ip_banned.sql rename to sql/updates/auth/2012_03_28_03_auth_ip_banned.sql diff --git a/sql/updates/auth/2012_03_28_04_logs.sql b/sql/updates/auth/2012_03_28_04_auth_logs.sql similarity index 100% rename from sql/updates/auth/2012_03_28_04_logs.sql rename to sql/updates/auth/2012_03_28_04_auth_logs.sql diff --git a/sql/updates/auth/2012_03_28_05_realmcharacters.sql b/sql/updates/auth/2012_03_28_05_auth_realmcharacters.sql similarity index 100% rename from sql/updates/auth/2012_03_28_05_realmcharacters.sql rename to sql/updates/auth/2012_03_28_05_auth_realmcharacters.sql diff --git a/sql/updates/auth/2012_03_28_06_realmlist.sql b/sql/updates/auth/2012_03_28_06_auth_realmlist.sql similarity index 100% rename from sql/updates/auth/2012_03_28_06_realmlist.sql rename to sql/updates/auth/2012_03_28_06_auth_realmlist.sql diff --git a/sql/updates/auth/2012_03_28_07_uptime.sql b/sql/updates/auth/2012_03_28_07_auth_uptime.sql similarity index 100% rename from sql/updates/auth/2012_03_28_07_uptime.sql rename to sql/updates/auth/2012_03_28_07_auth_uptime.sql From a14aa3758593c903d024199f70df4d7a4cd72c0f Mon Sep 17 00:00:00 2001 From: leak Date: Wed, 28 Mar 2012 21:34:26 +0200 Subject: [PATCH 0348/1149] Core/DBLayer: Fix value list from recent changes --- sql/updates/auth/2012_03_28_01_auth_account_access.sql | 1 - sql/updates/auth/2012_03_28_06_auth_realmlist.sql | 2 +- src/server/game/World/World.cpp | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sql/updates/auth/2012_03_28_01_auth_account_access.sql b/sql/updates/auth/2012_03_28_01_auth_account_access.sql index 7f79634d765..456dbf6c104 100644 --- a/sql/updates/auth/2012_03_28_01_auth_account_access.sql +++ b/sql/updates/auth/2012_03_28_01_auth_account_access.sql @@ -1,4 +1,3 @@ ALTER TABLE `account_access` CHANGE `id` `id` INT(10) UNSIGNED NOT NULL, ROW_FORMAT=DEFAULT ENGINE=INNODB; - \ No newline at end of file diff --git a/sql/updates/auth/2012_03_28_06_auth_realmlist.sql b/sql/updates/auth/2012_03_28_06_auth_realmlist.sql index e5e7b2e00d4..725702a9803 100644 --- a/sql/updates/auth/2012_03_28_06_auth_realmlist.sql +++ b/sql/updates/auth/2012_03_28_06_auth_realmlist.sql @@ -3,4 +3,4 @@ ALTER TABLE `realmlist` CHANGE `address` `address` VARCHAR(15) DEFAULT '127.0.0.1' NOT NULL, CHANGE `port` `port` SMALLINT(5) UNSIGNED DEFAULT '8085' NOT NULL, CHANGE `gamebuild` `gamebuild` INT(10) UNSIGNED DEFAULT '12340' NOT NULL, - ROW_FORMAT=DEFAULT ENGINE=INNODB; \ No newline at end of file + ROW_FORMAT=DEFAULT ENGINE=INNODB; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 9683d847f86..f4eff49f439 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1671,7 +1671,7 @@ void World::SetInitialWorldSettings() m_gameTime = time(NULL); m_startTime = m_gameTime; - LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, uptime, revision) VALUES(%u, %u, '%s', 0, '%s')", + LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, uptime, revision) VALUES(%u, %u, 0, '%s')", realmID, uint32(m_startTime), _FULLVERSION); // One-time query m_timers[WUPDATE_WEATHERS].SetInterval(1*IN_MILLISECONDS); From d94608777c9af4cc826978931138f5b5b87de349 Mon Sep 17 00:00:00 2001 From: kandera Date: Wed, 28 Mar 2012 19:21:40 -0300 Subject: [PATCH 0349/1149] Core/Scripts: Fix invincibility hp level for smart scripts. --- src/server/game/AI/SmartScripts/SmartAI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 4cf438da5a4..c2c864802df 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -639,7 +639,7 @@ void SmartAI::DamageTaken(Unit* doneBy, uint32& damage) { GetScript()->ProcessEventsFor(SMART_EVENT_DAMAGED, doneBy, damage); if ((me->GetHealth() - damage) <= mInvinceabilityHpLevel) - damage -= mInvinceabilityHpLevel; + damage = me->GetHealth() - mInvinceabilityHpLevel; } void SmartAI::HealReceived(Unit* doneBy, uint32& addhealth) From cf29214364d6eacd9599fe809af81a5a683ea328 Mon Sep 17 00:00:00 2001 From: click Date: Thu, 29 Mar 2012 00:47:56 +0200 Subject: [PATCH 0350/1149] Core/AI: Fix some wannabe-invinceable typos here and there... --- src/server/game/AI/EventAI/CreatureEventAI.cpp | 12 ++++++------ src/server/game/AI/EventAI/CreatureEventAI.h | 2 +- src/server/game/AI/SmartScripts/SmartAI.cpp | 6 +++--- src/server/game/AI/SmartScripts/SmartAI.h | 4 ++-- src/server/game/AI/SmartScripts/SmartScript.cpp | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp index 11887611ae8..7a2b83273c9 100755 --- a/src/server/game/AI/EventAI/CreatureEventAI.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp @@ -95,7 +95,7 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c) m_AttackDistance = 0.0f; m_AttackAngle = 0.0f; - m_InvinceabilityHpLevel = 0; + m_InvincibilityHpLevel = 0; //Handle Spawned Events if (!m_bEmptyList) @@ -816,9 +816,9 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 case ACTION_T_SET_INVINCIBILITY_HP_LEVEL: { if (action.invincibility_hp_level.is_percent) - m_InvinceabilityHpLevel = me->CountPctFromMaxHealth(action.invincibility_hp_level.hp_level); + m_InvincibilityHpLevel = me->CountPctFromMaxHealth(action.invincibility_hp_level.hp_level); else - m_InvinceabilityHpLevel = action.invincibility_hp_level.hp_level; + m_InvincibilityHpLevel = action.invincibility_hp_level.hp_level; break; } case ACTION_T_MOUNT_TO_ENTRY_OR_MODEL: @@ -1350,12 +1350,12 @@ void CreatureEventAI::ReceiveEmote(Player* player, uint32 textEmote) void CreatureEventAI::DamageTaken(Unit* /*done_by*/, uint32& damage) { - if (m_InvinceabilityHpLevel > 0 && me->GetHealth() < m_InvinceabilityHpLevel+damage) + if (m_InvincibilityHpLevel > 0 && me->GetHealth() < m_InvincibilityHpLevel+damage) { - if (me->GetHealth() <= m_InvinceabilityHpLevel) + if (me->GetHealth() <= m_InvincibilityHpLevel) damage = 0; else - damage = me->GetHealth() - m_InvinceabilityHpLevel; + damage = me->GetHealth() - m_InvincibilityHpLevel; } } diff --git a/src/server/game/AI/EventAI/CreatureEventAI.h b/src/server/game/AI/EventAI/CreatureEventAI.h index c4daf2563e0..3d2bcf888c8 100755 --- a/src/server/game/AI/EventAI/CreatureEventAI.h +++ b/src/server/game/AI/EventAI/CreatureEventAI.h @@ -641,6 +641,6 @@ class CreatureEventAI : public CreatureAI bool m_MeleeEnabled; // If we allow melee auto attack float m_AttackDistance; // Distance to attack from float m_AttackAngle; // Angle of attack - uint32 m_InvinceabilityHpLevel; // Minimal health level allowed at damage apply + uint32 m_InvincibilityHpLevel; // Minimal health level allowed at damage apply }; #endif diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index c2c864802df..d1ea30609dd 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -68,7 +68,7 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c) mFollowCredit = 0; mFollowArrivedEntry = 0; mFollowCreditType = 0; - mInvinceabilityHpLevel = 0; + mInvincibilityHpLevel = 0; } void SmartAI::UpdateDespawn(const uint32 diff) @@ -638,8 +638,8 @@ void SmartAI::SpellHitTarget(Unit* target, const SpellInfo* spellInfo) void SmartAI::DamageTaken(Unit* doneBy, uint32& damage) { GetScript()->ProcessEventsFor(SMART_EVENT_DAMAGED, doneBy, damage); - if ((me->GetHealth() - damage) <= mInvinceabilityHpLevel) - damage = me->GetHealth() - mInvinceabilityHpLevel; + if ((me->GetHealth() - damage) <= mInvincibilityHpLevel) + damage = me->GetHealth() - mInvincibilityHpLevel; } void SmartAI::HealReceived(Unit* doneBy, uint32& addhealth) diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h index c2501199f77..e71b82bdab2 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.h +++ b/src/server/game/AI/SmartScripts/SmartAI.h @@ -174,7 +174,7 @@ class SmartAI : public CreatureAI void SetSwim(bool swim = true); - void SetInvinceabilityHpLevel(uint32 level) { mInvinceabilityHpLevel = level; } + void SetInvincibilityHpLevel(uint32 level) { mInvincibilityHpLevel = level; } void sGossipHello(Player* player); void sGossipSelect(Player* player, uint32 sender, uint32 action); @@ -223,7 +223,7 @@ class SmartAI : public CreatureAI bool mCanAutoAttack; bool mCanCombatMove; bool mForcedPaused; - uint32 mInvinceabilityHpLevel; + uint32 mInvincibilityHpLevel; bool AssistPlayerInCombat(Unit* who); diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 05a2910e7a7..8eee214e420 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1043,9 +1043,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; if (e.action.invincHP.percent) - ai->SetInvinceabilityHpLevel(me->CountPctFromMaxHealth(e.action.invincHP.percent)); + ai->SetInvincibilityHpLevel(me->CountPctFromMaxHealth(e.action.invincHP.percent)); else - ai->SetInvinceabilityHpLevel(e.action.invincHP.minHP); + ai->SetInvincibilityHpLevel(e.action.invincHP.minHP); break; } case SMART_ACTION_SET_DATA: From 72d3e856dedaffcddffa6cd36cf56ec5a5809d58 Mon Sep 17 00:00:00 2001 From: kaelima Date: Thu, 29 Mar 2012 02:56:18 +0200 Subject: [PATCH 0351/1149] Core/Grid: revert f9caf79b16e9de5d87dd48cdc450415b6ad33867 - led to some unexpected behavior. --- src/server/game/Grids/GridDefines.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/server/game/Grids/GridDefines.h b/src/server/game/Grids/GridDefines.h index 99bb20fe9f6..7bd0da34a46 100644 --- a/src/server/game/Grids/GridDefines.h +++ b/src/server/game/Grids/GridDefines.h @@ -215,8 +215,7 @@ namespace Trinity inline bool IsValidMapCoord(float c) { - //! Since we visit grids in circles, we cannot allow players to relocate to grids on the edge of a map - thus the use of CENTER_GRID_OFFSET - return finite(c) && (std::fabs(c) <= MAP_HALFSIZE - CENTER_GRID_OFFSET - 0.5f); + return finite(c) && (std::fabs(c) <= MAP_HALFSIZE - 0.5f); } inline bool IsValidMapCoord(float x, float y) From 5e795a61e86d2a77b2b2ec67a0a3f7eb9a69ac76 Mon Sep 17 00:00:00 2001 From: click Date: Thu, 29 Mar 2012 03:43:46 +0200 Subject: [PATCH 0352/1149] Core/Warden: Fix a startupcrash with warden enabled (another fieldtype-error) --- src/server/game/Warden/WardenCheckMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Warden/WardenCheckMgr.cpp b/src/server/game/Warden/WardenCheckMgr.cpp index 7567b3976db..90d1cfc0140 100644 --- a/src/server/game/Warden/WardenCheckMgr.cpp +++ b/src/server/game/Warden/WardenCheckMgr.cpp @@ -59,7 +59,7 @@ void WardenCheckMgr::LoadWardenChecks() Field* fields = result->Fetch(); - uint32 maxCheckId = fields[0].GetUInt32(); + uint16 maxCheckId = fields[0].GetUInt16(); CheckStore.resize(maxCheckId + 1); From 40c35b095c2d8d2a3dcd4451e94623f602a09332 Mon Sep 17 00:00:00 2001 From: click Date: Thu, 29 Mar 2012 04:09:02 +0200 Subject: [PATCH 0353/1149] Core: Adjust fieldtype size for loading completed achievements --- src/server/game/Achievements/AchievementMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 7b2e157eac8..36748dd4fc9 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2415,7 +2415,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements() { Field* fields = result->Fetch(); - uint32 achievementId = fields[0].GetUInt32(); + uint16 achievementId = fields[0].GetUInt16(); const AchievementEntry* achievement = sAchievementStore.LookupEntry(achievementId); if (!achievement) { From be947eed767da7471667daab92a129b7b067596b Mon Sep 17 00:00:00 2001 From: click Date: Thu, 29 Mar 2012 04:45:10 +0200 Subject: [PATCH 0354/1149] Core: Fix fieldtype-errors in Guild-code - should now allow loading guildtabs etc correctly --- src/server/game/Guilds/Guild.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 98707a0b42f..2dc0f3e865d 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -588,11 +588,11 @@ bool Guild::Member::LoadFromDB(Field* fields) } SetStats(fields[19].GetString(), - fields[20].GetUInt8(), - fields[21].GetUInt8(), - fields[22].GetUInt32(), - fields[23].GetUInt32()); - m_logoutTime = fields[24].GetUInt32(); + fields[20].GetUInt8(), // characters.level + fields[21].GetUInt8(), // characters.class + fields[22].GetUInt16(), // characters.zone + fields[23].GetUInt32()); // characters.account + m_logoutTime = fields[24].GetUInt32(); // characters.logout_time if (!CheckStats()) return false; From c65cabb33c16ce37e380c70ba4496afe5517be2d Mon Sep 17 00:00:00 2001 From: click Date: Thu, 29 Mar 2012 05:08:32 +0200 Subject: [PATCH 0355/1149] Core: Fix some type-errors in the Petitionshandler. Fixes #5916. Also fixes charterhandling for arenateams, mentioned in #5907. --- src/server/game/Handlers/PetitionsHandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index a6a6637deaf..139fa04cd9c 100755 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -340,7 +340,7 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid) Field* fields = result->Fetch(); ownerguid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER); name = fields[1].GetString(); - type = fields[2].GetUInt32(); + type = fields[2].GetUInt8(); } else { @@ -486,7 +486,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) fields = result->Fetch(); uint64 ownerGuid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER); uint8 signs = fields[1].GetUInt8(); - uint32 type = fields[2].GetUInt32(); + uint8 type = fields[2].GetUInt8(); uint32 playerGuid = _player->GetGUIDLow(); if (GUID_LOPART(ownerGuid) == playerGuid) From 0ce62a159d5c40c2e75bd77331a1539116a50b44 Mon Sep 17 00:00:00 2001 From: click Date: Thu, 29 Mar 2012 05:23:01 +0200 Subject: [PATCH 0356/1149] Core: Fix type-mismatch in GameEventMgr --- src/server/game/Events/GameEventMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index bf7bc13345a..fb047bc9e0c 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -691,7 +691,7 @@ void GameEventMgr::LoadFromDB() { Field* fields = result->Fetch(); - uint16 event_id = fields[0].GetUInt16(); + uint16 event_id = fields[0].GetUInt8(); uint32 condition = fields[1].GetUInt32(); if (event_id >= mGameEvent.size()) From b5fb1b5b6414f825f7314ca0ec3017a419858f38 Mon Sep 17 00:00:00 2001 From: click Date: Thu, 29 Mar 2012 07:10:21 +0200 Subject: [PATCH 0357/1149] Core: Fix a minor mistake from previous mistake and adjust some more field-types --- src/server/game/Events/GameEventMgr.cpp | 4 ++-- src/server/game/Guilds/Guild.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index fb047bc9e0c..58ced12e487 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -220,7 +220,7 @@ void GameEventMgr::LoadFromDB() { Field* fields = result->Fetch(); - uint16 event_id = fields[0].GetUInt8(); + uint8 event_id = fields[0].GetUInt8(); if (event_id == 0) { sLog->outErrorDb("`game_event` game event entry 0 is reserved and can't be used."); @@ -283,7 +283,7 @@ void GameEventMgr::LoadFromDB() { Field* fields = result->Fetch(); - uint16 event_id = fields[0].GetUInt8(); + uint8 event_id = fields[0].GetUInt8(); if (event_id >= mGameEvent.size()) { diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 2dc0f3e865d..1c7c0872a70 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1940,7 +1940,7 @@ bool Guild::LoadBankEventLogFromDB(Field* fields) bool Guild::LoadBankTabFromDB(Field* fields) { - uint32 tabId = fields[1].GetUInt8(); + uint8 tabId = fields[1].GetUInt8(); if (tabId >= _GetPurchasedTabsSize()) { sLog->outError("Invalid tab (tabId: %u) in guild bank, skipped.", tabId); From 360014856defa505883e5395e28b48767fd2b651 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Thu, 29 Mar 2012 13:42:04 +0800 Subject: [PATCH 0358/1149] Core/Game: Code style. Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/AI/CoreAI/GuardAI.cpp | 6 +-- .../game/Achievements/AchievementMgr.cpp | 6 +-- src/server/game/Battlegrounds/ArenaTeam.cpp | 12 ++--- .../game/Battlegrounds/Battleground.cpp | 2 +- .../game/Battlegrounds/BattlegroundQueue.cpp | 2 +- .../game/Battlegrounds/Zones/BattlegroundAB.h | 12 +++-- .../game/Battlegrounds/Zones/BattlegroundAV.h | 47 +++++++++++------- .../Battlegrounds/Zones/BattlegroundEY.cpp | 3 +- .../game/Battlegrounds/Zones/BattlegroundEY.h | 5 +- .../Battlegrounds/Zones/BattlegroundIC.cpp | 4 +- .../Battlegrounds/Zones/BattlegroundWS.cpp | 3 +- src/server/game/Chat/Commands/Level1.cpp | 8 +-- src/server/game/Chat/Commands/Level3.cpp | 49 +++++++++---------- src/server/game/DataStores/DBCStores.cpp | 2 +- src/server/game/Entities/Item/Item.cpp | 18 +++---- src/server/game/Entities/Item/Item.h | 2 +- .../game/Entities/Item/ItemEnchantmentMgr.cpp | 2 +- src/server/game/Entities/Object/Object.cpp | 2 +- src/server/game/Entities/Object/Object.h | 4 +- .../Entities/Object/ObjectPosSelector.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 27 +++++----- src/server/game/Entities/Player/Player.h | 2 +- src/server/game/Entities/Unit/StatSystem.cpp | 2 +- src/server/game/Entities/Unit/Unit.cpp | 6 ++- src/server/game/Entities/Unit/Unit.h | 2 +- src/server/game/Globals/ObjectMgr.cpp | 6 +-- src/server/game/Handlers/MailHandler.cpp | 2 +- src/server/game/Handlers/TradeHandler.cpp | 2 +- src/server/game/Loot/LootMgr.cpp | 7 +-- src/server/game/Maps/MapUpdater.cpp | 2 +- src/server/game/Miscellaneous/SharedDefines.h | 3 +- .../ConfusedMovementGenerator.cpp | 2 +- src/server/game/Scripting/MapScripts.cpp | 2 +- src/server/game/Server/WorldSession.cpp | 8 +-- .../game/Spells/Auras/SpellAuraEffects.cpp | 10 ++-- src/server/game/Spells/Auras/SpellAuras.cpp | 2 +- src/server/game/Spells/Spell.cpp | 2 +- src/server/game/Spells/SpellEffects.cpp | 7 +-- src/server/game/Spells/SpellMgr.cpp | 6 +-- src/server/game/Weather/Weather.cpp | 2 +- .../AzjolNerub/AzjolNerub/boss_anubarak.cpp | 2 +- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 2 +- .../Northrend/VioletHold/boss_cyanigosa.cpp | 2 +- src/server/scripts/Spells/spell_priest.cpp | 2 +- 44 files changed, 162 insertions(+), 139 deletions(-) diff --git a/src/server/game/AI/CoreAI/GuardAI.cpp b/src/server/game/AI/CoreAI/GuardAI.cpp index df29d485cba..252bcbabca5 100755 --- a/src/server/game/AI/CoreAI/GuardAI.cpp +++ b/src/server/game/AI/CoreAI/GuardAI.cpp @@ -92,15 +92,15 @@ void GuardAI::EnterEvadeMode() { sLog->outStaticDebug("Creature stopped attacking because victim does not exist [guid=%u]", me->GetGUIDLow()); } - else if (!victim ->isAlive()) + else if (!victim->isAlive()) { sLog->outStaticDebug("Creature stopped attacking because victim is dead [guid=%u]", me->GetGUIDLow()); } - else if (victim ->HasStealthAura()) + else if (victim->HasStealthAura()) { sLog->outStaticDebug("Creature stopped attacking because victim is using stealth [guid=%u]", me->GetGUIDLow()); } - else if (victim ->isInFlight()) + else if (victim->isInFlight()) { sLog->outStaticDebug("Creature stopped attacking because victim is flying away [guid=%u]", me->GetGUIDLow()); } diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 36748dd4fc9..2a9f4212f46 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1492,7 +1492,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscValue1) { uint32 points = 0; - for (CompletedAchievementMap::iterator itr = m_completedAchievements.begin(); itr != m_completedAchievements.end(); ++itr) + for (CompletedAchievementMap::iterator itr = m_completedAchievements.begin(); itr != m_completedAchievements.end(); ++itr) if (AchievementEntry const* pAchievement = sAchievementStore.LookupEntry(itr->first)) points += pAchievement->points; SetCriteriaProgress(achievementCriteria, points, PROGRESS_SET); @@ -2039,7 +2039,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement) return; SendAchievementEarned(achievement); - CompletedAchievementData& ca = m_completedAchievements[achievement->ID]; + CompletedAchievementData& ca = m_completedAchievements[achievement->ID]; ca.date = time(NULL); ca.changed = true; @@ -2070,7 +2070,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement) // mail if (reward->sender) { - Item* item = reward->itemId ? Item::CreateItem(reward->itemId, 1, GetPlayer ()) : NULL; + Item* item = reward->itemId ? Item::CreateItem(reward->itemId, 1, GetPlayer()) : NULL; int loc_idx = GetPlayer()->GetSession()->GetSessionDbLocaleIndex(); diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index 05fef44f676..8cf504fd685 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -721,7 +721,7 @@ int32 ArenaTeam::LostAgainst(uint32 Own_MMRating, uint32 Opponent_MMRating, int3 void ArenaTeam::MemberLost(Player* player, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange) { // Called for each participant of a match after losing - for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr) + for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr) { if (itr->Guid == player->GetGUID()) { @@ -747,7 +747,7 @@ void ArenaTeam::MemberLost(Player* player, uint32 againstMatchmakerRating, int32 void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange) { // Called for offline player after ending rated arena match! - for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr) + for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr) { if (itr->Guid == guid) { @@ -769,7 +769,7 @@ void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating, i void ArenaTeam::MemberWon(Player* player, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange) { // called for each participant after winning a match - for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr) + for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr) { if (itr->Guid == player->GetGUID()) { @@ -804,7 +804,7 @@ void ArenaTeam::UpdateArenaPointsHelper(std::map& playerPoints) // To get points, a player has to participate in at least 30% of the matches uint32 requiredGames = (uint32)ceil(Stats.WeekGames * 0.3f); - for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr) + for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr) { // The player participated in enough games, update his points uint32 pointsToAdd = 0; @@ -840,7 +840,7 @@ void ArenaTeam::SaveToDB() stmt->setUInt32(6, GetId()); trans->Append(stmt); - for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr) + for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ARENA_TEAM_MEMBER); stmt->setUInt16(0, itr->PersonalRating); @@ -869,7 +869,7 @@ void ArenaTeam::FinishWeek() Stats.WeekWins = 0; // Reset member stats - for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr) + for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr) { itr->WeekGames = 0; itr->WeekWins = 0; diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 1a5f3412459..f3c393eaa36 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -65,7 +65,7 @@ namespace Trinity private: void do_helper(WorldPacket& data, char const* text) { - uint64 target_guid = _source ? _source ->GetGUID() : 0; + uint64 target_guid = _source ? _source->GetGUID() : 0; data << uint8 (_msgtype); data << uint32(LANG_UNIVERSAL); diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index a5b00ed9db1..6f4264c0faf 100755 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -129,7 +129,7 @@ bool BattlegroundQueue::SelectionPool::AddGroup(GroupQueueInfo* ginfo, uint32 de // add group or player (grp == NULL) to bg queue with the given leader and bg specifications GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, BattlegroundTypeId BgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 ArenaType, bool isRated, bool isPremade, uint32 ArenaRating, uint32 MatchmakerRating, uint32 arenateamid) { - BattlegroundBracketId bracketId = bracketEntry->GetBracketId(); + BattlegroundBracketId bracketId = bracketEntry->GetBracketId(); // create new ginfo GroupQueueInfo* ginfo = new GroupQueueInfo; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h index 50020a580b1..2cac5df73a9 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h @@ -184,7 +184,8 @@ enum BG_AB_Objectives #define AB_EVENT_START_BATTLE 9158 // Achievement: Let's Get This Done // x, y, z, o -const float BG_AB_NodePositions[BG_AB_DYNAMIC_NODES_COUNT][4] = { +const float BG_AB_NodePositions[BG_AB_DYNAMIC_NODES_COUNT][4] = +{ {1166.785f, 1200.132f, -56.70859f, 0.9075713f}, // stables {977.0156f, 1046.616f, -44.80923f, -2.600541f}, // blacksmith {806.1821f, 874.2723f, -55.99371f, -2.303835f}, // farm @@ -193,7 +194,8 @@ const float BG_AB_NodePositions[BG_AB_DYNAMIC_NODES_COUNT][4] = { }; // x, y, z, o, rot0, rot1, rot2, rot3 -const float BG_AB_DoorPositions[2][8] = { +const float BG_AB_DoorPositions[2][8] = +{ {1284.597f, 1281.167f, -15.97792f, 0.7068594f, 0.012957f, -0.060288f, 0.344959f, 0.93659f}, {708.0903f, 708.4479f, -17.8342f, -2.391099f, 0.050291f, 0.015127f, 0.929217f, -0.365784f} }; @@ -206,7 +208,8 @@ const uint32 BG_AB_TickPoints[6] = {0, 10, 10, 10, 10, 30}; const uint32 BG_AB_GraveyardIds[BG_AB_ALL_NODES_COUNT] = {895, 894, 893, 897, 896, 898, 899}; // x, y, z, o -const float BG_AB_BuffPositions[BG_AB_DYNAMIC_NODES_COUNT][4] = { +const float BG_AB_BuffPositions[BG_AB_DYNAMIC_NODES_COUNT][4] = +{ {1185.71f, 1185.24f, -56.36f, 2.56f}, // stables {990.75f, 1008.18f, -42.60f, 2.43f}, // blacksmith {817.66f, 843.34f, -56.54f, 3.01f}, // farm @@ -215,7 +218,8 @@ const float BG_AB_BuffPositions[BG_AB_DYNAMIC_NODES_COUNT][4] = { }; // x, y, z, o -const float BG_AB_SpiritGuidePos[BG_AB_ALL_NODES_COUNT][4] = { +const float BG_AB_SpiritGuidePos[BG_AB_ALL_NODES_COUNT][4] = +{ {1200.03f, 1171.09f, -56.47f, 5.15f}, // stables {1017.43f, 960.61f, -42.95f, 4.88f}, // blacksmith {833.00f, 793.00f, -57.25f, 5.27f}, // farm diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h index 82e231c63fa..f073b69a779 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h @@ -356,7 +356,9 @@ enum BG_AV_OBJECTS AV_OPLACE_MAX = 149 }; -const float BG_AV_ObjectPos[AV_OPLACE_MAX][4] = { + +const float BG_AV_ObjectPos[AV_OPLACE_MAX][4] = +{ {638.592f, -32.422f, 46.0608f, -1.62316f }, //firstaid station {669.007f, -294.078f, 30.2909f, 2.77507f }, //stormpike {77.8013f, -404.7f, 46.7549f, -0.872665f }, //stone grave @@ -527,7 +529,8 @@ const float BG_AV_ObjectPos[AV_OPLACE_MAX][4] = { {-951.394f, -193.695f, 67.634f, 0.802851f} }; -const float BG_AV_DoorPositons[2][4] = { +const float BG_AV_DoorPositons[2][4] = +{ {780.487f, -493.024f, 99.9553f, 3.0976f}, //alliance {-1375.193f, -538.981f, 55.2824f, 0.72178f} //horde }; @@ -623,7 +626,8 @@ enum BG_AV_CreaturePlace }; //x, y, z, o -const float BG_AV_CreaturePos[AV_CPLACE_MAX][4] = { +const float BG_AV_CreaturePos[AV_CPLACE_MAX][4] = +{ //spiritguides {643.000000f, 44.000000f, 69.740196f, -0.001854f}, {676.000000f, -374.000000f, 30.000000f, -0.001854f}, @@ -1039,7 +1043,8 @@ enum BG_AV_CreatureIds //entry, team, minlevel, maxlevel //TODO this array should be removed, the only needed things are the entrys (for spawning(?) and handlekillunit) -const uint32 BG_AV_CreatureInfo[AV_NPC_INFO_MAX][4] = { +const uint32 BG_AV_CreatureInfo[AV_NPC_INFO_MAX][4] = +{ { 12050, 1216, 58, 58 }, //Stormpike Defender { 13326, 1216, 59, 59 }, //Seasoned Defender { 13331, 1216, 60, 60 }, //Veteran Defender @@ -1099,7 +1104,9 @@ const uint32 BG_AV_CreatureInfo[AV_NPC_INFO_MAX][4] = { }; //x, y, z, o, static_creature_info-id -const float BG_AV_StaticCreaturePos[AV_STATICCPLACE_MAX][5] = { //static creatures +const float BG_AV_StaticCreaturePos[AV_STATICCPLACE_MAX][5] = +{ + //static creatures {-1235.31f, -340.777f, 60.5088f, 3.31613f, 0 }, //2225 - Zora Guthrek {-1244.02f, -323.795f, 61.0485f, 5.21853f, 1 }, //3343 - Grelkor {-1235.16f, -332.302f, 60.2985f, 2.96706f, 2 }, //3625 - Rarck @@ -1226,7 +1233,8 @@ const float BG_AV_StaticCreaturePos[AV_STATICCPLACE_MAX][5] = { //static creatur }; -const uint32 BG_AV_StaticCreatureInfo[51][4] = { +const uint32 BG_AV_StaticCreatureInfo[51][4] = +{ { 2225, 1215, 55, 55 }, //Zora Guthrek { 3343, 1215, 55, 55 }, //Grelkor { 3625, 1215, 55, 55 }, //Rarck @@ -1293,16 +1301,17 @@ enum BG_AV_Graveyards AV_GRAVE_MAIN_HORDE = 610 }; -const uint32 BG_AV_GraveyardIds[9]= { - AV_GRAVE_STORM_AID, - AV_GRAVE_STORM_GRAVE, - AV_GRAVE_STONE_GRAVE, - AV_GRAVE_SNOWFALL, - AV_GRAVE_ICE_GRAVE, - AV_GRAVE_FROSTWOLF, - AV_GRAVE_FROST_HUT, - AV_GRAVE_MAIN_ALLIANCE, - AV_GRAVE_MAIN_HORDE +const uint32 BG_AV_GraveyardIds[9]= +{ + AV_GRAVE_STORM_AID, + AV_GRAVE_STORM_GRAVE, + AV_GRAVE_STONE_GRAVE, + AV_GRAVE_SNOWFALL, + AV_GRAVE_ICE_GRAVE, + AV_GRAVE_FROSTWOLF, + AV_GRAVE_FROST_HUT, + AV_GRAVE_MAIN_ALLIANCE, + AV_GRAVE_MAIN_HORDE }; enum BG_AV_BUFF @@ -1434,13 +1443,15 @@ enum BG_AV_WorldStates }; //alliance_control neutral_control horde_control -const uint32 BG_AV_MineWorldStates[2][3] = { +const uint32 BG_AV_MineWorldStates[2][3] = +{ {1358, 1360, 1359}, {1355, 1357, 1356} }; //alliance_control alliance_assault h_control h_assault -const uint32 BG_AV_NodeWorldStates[16][4] = { +const uint32 BG_AV_NodeWorldStates[16][4] = +{ //Stormpike first aid station {1325, 1326, 1327, 1328}, //Stormpike Graveyard diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp index 344dc79fe79..8269a04a383 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -29,7 +29,8 @@ #include "Util.h" // these variables aren't used outside of this file, so declare them only here -uint32 BG_EY_HonorScoreTicks[BG_HONOR_MODE_NUM] = { +uint32 BG_EY_HonorScoreTicks[BG_HONOR_MODE_NUM] = +{ 260, // normal honor 160 // holiday }; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h index 026fbccc320..534a40484ce 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h @@ -258,7 +258,8 @@ struct BattlegroundEYPointIconsStruct }; // x, y, z, o -const float BG_EY_TriggerPositions[EY_POINTS_MAX][4] = { +const float BG_EY_TriggerPositions[EY_POINTS_MAX][4] = +{ {2044.28f, 1729.68f, 1189.96f, 0.017453f}, // FEL_REAVER center {2048.83f, 1393.65f, 1194.49f, 0.20944f}, // BLOOD_ELF center {2286.56f, 1402.36f, 1197.11f, 3.72381f}, // DRAENEI_RUINS center @@ -326,7 +327,7 @@ const BattlegroundEYCapturingPointStruct m_CapturingPointTypes[EY_POINTS_MAX] = class BattlegroundEYScore : public BattlegroundScore { public: - BattlegroundEYScore () : FlagCaptures(0) {}; + BattlegroundEYScore() : FlagCaptures(0) {}; virtual ~BattlegroundEYScore() {}; uint32 FlagCaptures; }; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index fada4230507..f3d0f5520f0 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -47,7 +47,7 @@ BattlegroundIC::BattlegroundIC() resourceTimer = IC_RESOURCE_TIME; for (uint8 i = NODE_TYPE_REFINERY; i < MAX_NODE_TYPES; i++) - nodePoint[i] = nodePointInitial[i]; + nodePoint[i] = nodePointInitial[i]; siegeEngineWorkshopTimer = WORKSHOP_UPDATE_TIME; @@ -926,7 +926,7 @@ Transport* BattlegroundIC::CreateTransport(uint32 goEntry, uint32 period) float x = t->m_WayPoints[0].x; float y = t->m_WayPoints[0].y; - float z = t->m_WayPoints[0].z; + float z = t->m_WayPoints[0].z; float o = 1; // creates the Gameobject diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index 034de38fd9c..86ad749b8b7 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -37,7 +37,8 @@ enum BG_WSG_Rewards BG_WSG_REWARD_NUM }; -uint32 BG_WSG_Honor[BG_HONOR_MODE_NUM][BG_WSG_REWARD_NUM] = { +uint32 BG_WSG_Honor[BG_HONOR_MODE_NUM][BG_WSG_REWARD_NUM] = +{ {20, 40, 40}, // normal honor {60, 40, 80} // holiday }; diff --git a/src/server/game/Chat/Commands/Level1.cpp b/src/server/game/Chat/Commands/Level1.cpp index a5647d2a5c0..a10a78a35ff 100755 --- a/src/server/game/Chat/Commands/Level1.cpp +++ b/src/server/game/Chat/Commands/Level1.cpp @@ -488,7 +488,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args) continue; name = areaEntry->area_name[loc]; - if (name.empty ()) + if (name.empty()) continue; if (Utf8FitTo (name, wnamepart)) @@ -511,7 +511,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args) else ss << areaEntry->ID << " - " << name << ' ' << localeNames[loc]; - SendSysMessage (ss.str ().c_str()); + SendSysMessage(ss.str().c_str()); if (!found) found = true; @@ -520,7 +520,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args) } if (!found) - SendSysMessage (LANG_COMMAND_NOAREAFOUND); + SendSysMessage(LANG_COMMAND_NOAREAFOUND); return true; } @@ -693,7 +693,7 @@ bool ChatHandler::HandleGroupSummonCommand(const char* args) } Map* gmMap = m_session->GetPlayer()->GetMap(); - bool to_instance = gmMap->Instanceable(); + bool to_instance = gmMap->Instanceable(); // we are in instance, and can summon only player in our group with us as lead if (to_instance && ( diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index eca5a862ecd..a88bf06898c 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -100,7 +100,7 @@ bool ChatHandler::HandleSetSkillCommand(const char *args) return false; } - int32 level = atol (level_p); + int32 level = atol(level_p); Player* target = getSelectedPlayer(); if (!target) @@ -1239,7 +1239,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args) uint8 localeIndex = GetSessionDbLocaleIndex(); if (CreatureLocale const* cl = sObjectMgr->GetCreatureLocale(id)) { - if (cl->Name.size() > localeIndex && !cl->Name[localeIndex].empty ()) + if (cl->Name.size() > localeIndex && !cl->Name[localeIndex].empty()) { std::string name = cl->Name[localeIndex]; @@ -1252,9 +1252,9 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args) } if (m_session) - PSendSysMessage (LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str ()); + PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str()); else - PSendSysMessage (LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str ()); + PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str()); if (!found) found = true; @@ -1265,7 +1265,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args) } std::string name = itr->second.Name; - if (name.empty ()) + if (name.empty()) continue; if (Utf8FitTo(name, wnamepart)) @@ -1277,9 +1277,9 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args) } if (m_session) - PSendSysMessage (LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str ()); + PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str()); else - PSendSysMessage (LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str ()); + PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str()); if (!found) found = true; @@ -1287,7 +1287,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args) } if (!found) - SendSysMessage (LANG_COMMAND_NOCREATUREFOUND); + SendSysMessage(LANG_COMMAND_NOCREATUREFOUND); return true; } @@ -1375,7 +1375,7 @@ bool ChatHandler::HandleLookupFactionCommand(const char *args) return false; // Can be NULL at console call - Player* target = getSelectedPlayer (); + Player* target = getSelectedPlayer(); std::string namepart = args; std::wstring wnamepart; @@ -1527,10 +1527,10 @@ bool ChatHandler::HandleLookupTaxiNodeCommand(const char * args) // send taxinode in "id - [name] (Map:m X:x Y:y Z:z)" format if (m_session) - PSendSysMessage (LANG_TAXINODE_ENTRY_LIST_CHAT, id, id, name.c_str(), localeNames[loc], + PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CHAT, id, id, name.c_str(), localeNames[loc], nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z); else - PSendSysMessage (LANG_TAXINODE_ENTRY_LIST_CONSOLE, id, name.c_str(), localeNames[loc], + PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CONSOLE, id, name.c_str(), localeNames[loc], nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z); if (!found) @@ -1679,16 +1679,16 @@ bool ChatHandler::HandleGuildCreateCommand(const char *args) if (target->GetGuildId()) { - SendSysMessage (LANG_PLAYER_IN_GUILD); + SendSysMessage(LANG_PLAYER_IN_GUILD); return true; } Guild* guild = new Guild; - if (!guild->Create (target, guildname)) + if (!guild->Create(target, guildname)) { delete guild; - SendSysMessage (LANG_GUILD_NOT_CREATED); - SetSentErrorMessage (true); + SendSysMessage(LANG_GUILD_NOT_CREATED); + SetSentErrorMessage(true); return false; } @@ -1715,7 +1715,7 @@ bool ChatHandler::HandleGuildInviteCommand(const char *args) return false; std::string glName = guildStr; - Guild* targetGuild = sGuildMgr->GetGuildByName (glName); + Guild* targetGuild = sGuildMgr->GetGuildByName(glName); if (!targetGuild) return false; @@ -1730,12 +1730,11 @@ bool ChatHandler::HandleGuildUninviteCommand(const char *args) if (!extractPlayerTarget((char*)args, &target, &target_guid)) return false; - uint32 glId = target ? target->GetGuildId () : Player::GetGuildIdFromDB (target_guid); - + uint32 glId = target ? target->GetGuildId() : Player::GetGuildIdFromDB(target_guid); if (!glId) return false; - Guild* targetGuild = sGuildMgr->GetGuildById (glId); + Guild* targetGuild = sGuildMgr->GetGuildById(glId); if (!targetGuild) return false; @@ -1757,7 +1756,7 @@ bool ChatHandler::HandleGuildRankCommand(const char *args) if (!extractPlayerTarget(nameStr, &target, &target_guid, &target_name)) return false; - uint32 glId = target ? target->GetGuildId () : Player::GetGuildIdFromDB (target_guid); + uint32 glId = target ? target->GetGuildId() : Player::GetGuildIdFromDB(target_guid); if (!glId) return false; @@ -1780,11 +1779,11 @@ bool ChatHandler::HandleGuildDeleteCommand(const char *args) std::string gld = guildStr; - Guild* targetGuild = sGuildMgr->GetGuildByName (gld); + Guild* targetGuild = sGuildMgr->GetGuildByName(gld); if (!targetGuild) return false; - targetGuild->Disband (); + targetGuild->Disband(); return true; } @@ -2025,7 +2024,7 @@ bool ChatHandler::HandleLinkGraveCommand(const char *args) else return false; - WorldSafeLocsEntry const* graveyard = sWorldSafeLocsStore.LookupEntry(g_id); + WorldSafeLocsEntry const* graveyard = sWorldSafeLocsStore.LookupEntry(g_id); if (!graveyard) { @@ -3365,7 +3364,7 @@ bool ChatHandler::HandleBanListHelper(PreparedQueryResult result) { SendSysMessage("-------------------------------------------------------------------------------"); Field* fields = result->Fetch(); - uint32 account_id = fields[0].GetUInt32 (); + uint32 account_id = fields[0].GetUInt32(); std::string account_name; @@ -4464,7 +4463,7 @@ bool ChatHandler::HandleChannelSetOwnership(const char *args) if (!*args) return false; char *channel = strtok((char*)args, " "); - char *argstr = strtok(NULL, ""); + char *argstr = strtok(NULL, ""); if (!channel || !argstr) return false; diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 65a51da037f..4be6c33db79 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -536,7 +536,7 @@ void LoadDBCStores(const std::string& dataPath) // include existed nodes that have at least single not spell base (scripted) path { std::set spellPaths; - for (uint32 i = 1; i < sSpellStore.GetNumRows (); ++i) + for (uint32 i = 1; i < sSpellStore.GetNumRows(); ++i) if (SpellEntry const* sInfo = sSpellStore.LookupEntry (i)) for (int j = 0; j < MAX_SPELL_EFFECTS; ++j) if (sInfo->Effect[j] == SPELL_EFFECT_SEND_TAXI) diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 4a1d5d5749a..fe2e8f38e62 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -765,7 +765,7 @@ bool Item::CanBeTraded(bool mail, bool trade) const if (Player* owner = GetOwner()) { - if (owner->CanUnequipItem(GetPos(), false) != EQUIP_ERR_OK) + if (owner->CanUnequipItem(GetPos(), false) != EQUIP_ERR_OK) return false; if (owner->GetLootGUID() == GetGUID()) return false; @@ -791,16 +791,16 @@ bool Item::HasEnchantRequiredSkill(const Player* player) const uint32 Item::GetEnchantRequiredLevel() const { - uint32 level = 0; + uint32 level = 0; - // Check all enchants for required level - for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot) - if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot))) - if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id)) - if (enchantEntry->requiredLevel > level) - level = enchantEntry->requiredLevel; + // Check all enchants for required level + for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot) + if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot))) + if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id)) + if (enchantEntry->requiredLevel > level) + level = enchantEntry->requiredLevel; - return level; + return level; } bool Item::IsBoundByEnchant() const diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index 3a197a8347f..1d5fcae7d28 100755 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -211,7 +211,7 @@ class Item : public Object static Item* CreateItem(uint32 item, uint32 count, Player const* player = NULL); Item* CloneItem(uint32 count, Player const* player = NULL) const; - Item (); + Item(); virtual bool Create(uint32 guidlow, uint32 itemid, Player const* owner); diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp index ee809243107..f3d7d7fd56c 100755 --- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp +++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp @@ -107,7 +107,7 @@ uint32 GetItemEnchantMod(int32 entry) } //we could get here only if sum of all enchantment chances is lower than 100% - dRoll = (irand(0, (int)floor(fCount * 100) + 1)) / 100; + dRoll = (irand(0, (int)floor(fCount * 100) + 1)) / 100; fCount = 0; for (EnchStoreList::const_iterator ench_iter = tab->second.begin(); ench_iter != tab->second.end(); ++ench_iter) diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 2291675c36d..eef0e51392c 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1510,7 +1510,7 @@ bool Position::HasInArc(float arc, const Position* obj) const if (angle > M_PI) angle -= 2.0f*M_PI; - float lborder = -1 * (arc/2.0f); // in range -pi..0 + float lborder = -1 * (arc/2.0f); // in range -pi..0 float rborder = (arc/2.0f); // in range 0..pi return ((angle >= lborder) && (angle <= rborder)); } diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index f6bd31f7dc6..6c77bf69a68 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -122,7 +122,7 @@ typedef UNORDERED_MAP UpdateDataMapType; class Object { public: - virtual ~Object (); + virtual ~Object(); bool IsInWorld() const { return m_inWorld; } @@ -315,7 +315,7 @@ class Object Corpse const* ToCorpse() const { if (GetTypeId() == TYPEID_CORPSE) return (const Corpse*)((Corpse*)this); else return NULL; } protected: - Object (); + Object(); void _InitValues(); void _Create (uint32 guidlow, uint32 entry, HighGuid guidhigh); diff --git a/src/server/game/Entities/Object/ObjectPosSelector.cpp b/src/server/game/Entities/Object/ObjectPosSelector.cpp index ec654954b80..6f27c1cb948 100755 --- a/src/server/game/Entities/Object/ObjectPosSelector.cpp +++ b/src/server/game/Entities/Object/ObjectPosSelector.cpp @@ -133,7 +133,7 @@ bool ObjectPosSelector::NextPosibleAngle(float& angle) if (m_smallStepOk[USED_POS_MINUS]) ok = NextSmallStepAngle(-1.0f, USED_POS_MINUS, angle); else - ok = NextAngleFor(*m_nextUsedPos[USED_POS_MINUS], -1.0f, USED_POS_MINUS, angle); + ok = NextAngleFor(*m_nextUsedPos[USED_POS_MINUS], -1.0f, USED_POS_MINUS, angle); if (!ok) ++m_nextUsedPos[USED_POS_MINUS]; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 7d2c62feb73..10c35a88503 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -865,7 +865,7 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep SetPendingBind(0, 0); } -Player::~Player () +Player::~Player() { // it must be unloaded already in PlayerLogout and accessed only for loggined player //m_social = NULL; @@ -885,7 +885,7 @@ Player::~Player () } //all mailed items should be deleted, also all mail should be deallocated - for (PlayerMails::iterator itr = m_mail.begin(); itr != m_mail.end(); ++itr) + for (PlayerMails::iterator itr = m_mail.begin(); itr != m_mail.end(); ++itr) delete *itr; for (ItemMap::iterator iter = mMitems.begin(); iter != mMitems.end(); ++iter) @@ -3145,7 +3145,7 @@ void Player::InitStatsForLevel(bool reapplyMods) // reset before any aura state sources (health set/aura apply) SetUInt32Value(UNIT_FIELD_AURASTATE, 0); - UpdateSkillsForLevel (); + UpdateSkillsForLevel(); // set default cast time multiplier SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); @@ -3424,7 +3424,7 @@ void Player::AddNewMailDeliverTime(time_t deliver_time) else // not ready and no have ready mails { if (!m_nextMailDelivereTime || m_nextMailDelivereTime > deliver_time) - m_nextMailDelivereTime = deliver_time; + m_nextMailDelivereTime = deliver_time; } } @@ -3799,7 +3799,7 @@ bool Player::addSpell(uint32 spellId, bool active, bool learning, bool dependent uint32 new_skill_max_value = spellLearnSkill->maxvalue == 0 ? maxskill : spellLearnSkill->maxvalue; if (skill_max_value < new_skill_max_value) - skill_max_value = new_skill_max_value; + skill_max_value = new_skill_max_value; SetSkill(spellLearnSkill->skill, spellLearnSkill->step, skill_value, skill_max_value); } @@ -5363,7 +5363,7 @@ void Player::CreateCorpse() iDisplayID = m_items[i]->GetTemplate()->DisplayInfoID; iIventoryType = m_items[i]->GetTemplate()->InventoryType; - _cfi = iDisplayID | (iIventoryType << 24); + _cfi = iDisplayID | (iIventoryType << 24); corpse->SetUInt32Value(CORPSE_FIELD_ITEM + i, _cfi); } } @@ -5419,7 +5419,7 @@ void Player::DurabilityLoss(Item* item, double percent) if (!item) return; - uint32 pMaxDurability = item ->GetUInt32Value(ITEM_FIELD_MAXDURABILITY); + uint32 pMaxDurability = item ->GetUInt32Value(ITEM_FIELD_MAXDURABILITY); if (!pMaxDurability) return; @@ -6663,7 +6663,7 @@ uint16 Player::GetBaseSkillValue(uint32 skill) const return 0; int32 result = int32(SKILL_VALUE(GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos)))); - result += SKILL_PERM_BONUS(GetUInt32Value(PLAYER_SKILL_BONUS_INDEX(itr->second.pos))); + result += SKILL_PERM_BONUS(GetUInt32Value(PLAYER_SKILL_BONUS_INDEX(itr->second.pos))); return result < 0 ? 0 : result; } @@ -8454,7 +8454,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 if (pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) continue; - SpellEnchantProcEntry const* entry = sSpellMgr->GetSpellEnchantProcEvent(enchant_id); + SpellEnchantProcEntry const* entry = sSpellMgr->GetSpellEnchantProcEvent(enchant_id); if (entry && entry->procEx) { @@ -8829,7 +8829,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type) if (go->getLootState() == GO_READY) { - uint32 lootid = go->GetGOInfo()->GetLootId(); + uint32 lootid = go->GetGOInfo()->GetLootId(); //TODO: fix this big hack if ((go->GetEntry() == BG_AV_OBJECTID_MINE_N || go->GetEntry() == BG_AV_OBJECTID_MINE_S)) @@ -11652,8 +11652,8 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool Item* offItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND); ItemPosCountVec off_dest; if (offItem && (!not_loading || - CanUnequipItem(uint16(INVENTORY_SLOT_BAG_0) << 8 | EQUIPMENT_SLOT_OFFHAND, false) != EQUIP_ERR_OK || - CanStoreItem(NULL_BAG, NULL_SLOT, off_dest, offItem, false) != EQUIP_ERR_OK)) + CanUnequipItem(uint16(INVENTORY_SLOT_BAG_0) << 8 | EQUIPMENT_SLOT_OFFHAND, false) != EQUIP_ERR_OK || + CanStoreItem(NULL_BAG, NULL_SLOT, off_dest, offItem, false) != EQUIP_ERR_OK)) return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_INVENTORY_FULL; } } @@ -23799,7 +23799,8 @@ void Player::AddRunePower(uint8 index) GetSession()->SendPacket(&data); } -static RuneType runeSlotTypes[MAX_RUNES] = { +static RuneType runeSlotTypes[MAX_RUNES] = +{ /*0*/ RUNE_BLOOD, /*1*/ RUNE_BLOOD, /*2*/ RUNE_UNHOLY, diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index b39e2b87750..53b848a89b0 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1064,7 +1064,7 @@ class Player : public Unit, public GridObject friend void Item::RemoveFromUpdateQueueOf(Player* player); public: explicit Player (WorldSession* session); - ~Player (); + ~Player(); void CleanupsBeforeDelete(bool finalCleanup = true); diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 283ab2c9cf6..69771129ac9 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -398,7 +398,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) break; } case CLASS_MAGE: - val2 = GetStat(STAT_STRENGTH) - 10.0f; + val2 = GetStat(STAT_STRENGTH) - 10.0f; break; case CLASS_PRIEST: val2 = GetStat(STAT_STRENGTH) - 10.0f; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 30be1a854d0..9adbb7f6cd7 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -71,7 +71,9 @@ float baseMoveSpeed[MAX_MOVE_TYPE] = 4.5f, // MOVE_FLIGHT_BACK 3.14f // MOVE_PITCH_RATE }; -float playerBaseMoveSpeed[MAX_MOVE_TYPE] = { + +float playerBaseMoveSpeed[MAX_MOVE_TYPE] = +{ 2.5f, // MOVE_WALK 7.0f, // MOVE_RUN 4.5f, // MOVE_RUN_BACK @@ -667,7 +669,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam duel_hasEnded = true; } - else if (victim->IsVehicle() && damage >= (health-1) && victim->GetCharmer() && victim->GetCharmer()->GetTypeId() == TYPEID_PLAYER) + else if (victim->IsVehicle() && damage >= (health-1) && victim->GetCharmer() && victim->GetCharmer()->GetTypeId() == TYPEID_PLAYER) { Player* victimRider = victim->GetCharmer()->ToPlayer(); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index e37e4d4fedd..fcbe1afa389 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1236,7 +1236,7 @@ class Unit : public WorldObject typedef std::map VisibleAuraMap; - virtual ~Unit (); + virtual ~Unit(); UnitAI* GetAI() { return i_AI; } void SetAI(UnitAI* newAI) { i_AI = newAI; } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index aab1fc96521..acc30dcc2d4 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1131,7 +1131,7 @@ void ObjectMgr::LoadCreatureModelInfo() uint32 modelId = fields[0].GetUInt32(); - CreatureModelInfo& modelInfo = _creatureModelStore[modelId]; + CreatureModelInfo& modelInfo = _creatureModelStore[modelId]; modelInfo.bounding_radius = fields[1].GetFloat(); modelInfo.combat_reach = fields[2].GetFloat(); @@ -2946,7 +2946,7 @@ void ObjectMgr::LoadPetLevelInfo() PetLevelInfo*& pInfoMapEntry = _petInfoStore[creature_id]; if (pInfoMapEntry == NULL) - pInfoMapEntry = new PetLevelInfo[sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)]; + pInfoMapEntry = new PetLevelInfo[sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)]; // data for level 1 stored in [0] array element, ... PetLevelInfo* pLevelInfo = &pInfoMapEntry[current_level-1]; @@ -4991,7 +4991,7 @@ void ObjectMgr::LoadPageTexts() { Field* fields = result->Fetch(); - PageText& pageText = _pageTextStore[fields[0].GetUInt32()]; + PageText& pageText = _pageTextStore[fields[0].GetUInt32()]; pageText.Text = fields[1].GetString(); pageText.NextPage = fields[2].GetUInt32(); diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 72488966416..187b12d5d2e 100755 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -558,7 +558,7 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data) //load players mails, and mailed items if (!player->m_mailsLoaded) - player ->_LoadMail(); + player->_LoadMail(); // client can't work with packets > max int16 value const uint32 maxPacketSize = 32767; diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index 17617c399e4..dc26aaa42ca 100755 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -412,7 +412,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) trader->GetSession()->SendTradeStatus(TRADE_STATUS_TRADE_ACCEPT); // test if item will fit in each inventory - hisCanCompleteTrade = (trader->CanStoreItems(myItems, TRADE_SLOT_TRADED_COUNT) == EQUIP_ERR_OK); + hisCanCompleteTrade = (trader->CanStoreItems(myItems, TRADE_SLOT_TRADED_COUNT) == EQUIP_ERR_OK); myCanCompleteTrade = (_player->CanStoreItems(hisItems, TRADE_SLOT_TRADED_COUNT) == EQUIP_ERR_OK); clearAcceptTradeMode(myItems, hisItems); diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 7efd600baa8..1b349b11156 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -26,7 +26,8 @@ #include "SpellInfo.h" #include "Group.h" -static Rates const qualityToRate[MAX_ITEM_QUALITY] = { +static Rates const qualityToRate[MAX_ITEM_QUALITY] = +{ RATE_DROP_ITEM_POOR, // ITEM_QUALITY_POOR RATE_DROP_ITEM_NORMAL, // ITEM_QUALITY_NORMAL RATE_DROP_ITEM_UNCOMMON, // ITEM_QUALITY_UNCOMMON @@ -761,7 +762,7 @@ bool Loot::hasItemFor(Player* player) const QuestItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(player->GetGUIDLow()); if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end()) { - QuestItemList* conditional_list = nn_itr->second; + QuestItemList* conditional_list = nn_itr->second; for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci) { const LootItem &item = items[ci->index]; @@ -937,7 +938,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) QuestItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(lv.viewer->GetGUIDLow()); if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end()) { - QuestItemList* conditional_list = nn_itr->second; + QuestItemList* conditional_list = nn_itr->second; for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci) { LootItem &item = l.items[ci->index]; diff --git a/src/server/game/Maps/MapUpdater.cpp b/src/server/game/Maps/MapUpdater.cpp index 80025680753..b747d065a14 100644 --- a/src/server/game/Maps/MapUpdater.cpp +++ b/src/server/game/Maps/MapUpdater.cpp @@ -52,7 +52,7 @@ class MapUpdateRequest : public ACE_Method_Request virtual int call() { m_map.Update (m_diff); - m_updater.update_finished (); + m_updater.update_finished(); return 0; } }; diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 91a5f602327..bca896df38f 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -248,7 +248,8 @@ enum SpellCategory SPELL_CATEGORY_DRINK = 59, }; -const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = { +const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = +{ 0xff9d9d9d, //GREY 0xffffffff, //WHITE 0xff1eff00, //GREEN diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index 32b960028c2..f7534ec800e 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -66,7 +66,7 @@ void ConfusedMovementGenerator::Initialize(T &unit) } unit.UpdateAllowedPositionZ(i_waypoints[idx][0], i_waypoints[idx][1], z); - i_waypoints[idx][2] = z; + i_waypoints[idx][2] = z; } unit.StopMoving(); diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index e73839c8071..5387a3132c6 100755 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -566,7 +566,7 @@ void Map::ScriptsProcess() step.script->GetDebugInfo().c_str(), target->GetTypeId(), target->GetEntry(), target->GetGUIDLow()); break; } - worldObject = dynamic_cast(target); + worldObject = dynamic_cast(target); } else { diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index af38a5f4cce..9dcacb71824 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -121,8 +121,8 @@ WorldSession::~WorldSession() /// - If have unclosed socket, close it if (m_Socket) { - m_Socket->CloseSocket (); - m_Socket->RemoveReference (); + m_Socket->CloseSocket(); + m_Socket->RemoveReference(); m_Socket = NULL; } @@ -196,7 +196,7 @@ void WorldSession::SendPacket(WorldPacket const* packet) #endif // !TRINITY_DEBUG if (m_Socket->SendPacket (*packet) == -1) - m_Socket->CloseSocket (); + m_Socket->CloseSocket(); } /// Add an incoming packet to the queue @@ -527,7 +527,7 @@ void WorldSession::LogoutPlayer(bool Save) ///- Broadcast a logout message to the player's friends sSocialMgr->SendFriendStatus(_player, FRIEND_OFFLINE, _player->GetGUIDLow(), true); - sSocialMgr->RemovePlayerSocial (_player->GetGUIDLow ()); + sSocialMgr->RemovePlayerSocial(_player->GetGUIDLow()); // Call script hook before deletion sScriptMgr->OnPlayerLogout(GetPlayer()); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index f7635f3fab5..6383c7ff3ef 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -3481,7 +3481,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint { bool banishFound = false; Unit::AuraEffectList const& banishAuras = target->GetAuraEffectsByType(GetAuraType()); - for (Unit::AuraEffectList::const_iterator i = banishAuras.begin(); i != banishAuras.end(); ++i) + for (Unit::AuraEffectList::const_iterator i = banishAuras.begin(); i != banishAuras.end(); ++i) if ((*i)->GetSpellInfo()->Mechanic == MECHANIC_BANISH) { banishFound = true; @@ -4594,7 +4594,7 @@ void AuraEffect::HandleNoReagentUseAura(AuraApplication const* aurApp, uint8 mod flag96 mask; Unit::AuraEffectList const& noReagent = target->GetAuraEffectsByType(SPELL_AURA_NO_REAGENT_USE); - for (Unit::AuraEffectList::const_iterator i = noReagent.begin(); i != noReagent.end(); ++i) + for (Unit::AuraEffectList::const_iterator i = noReagent.begin(); i != noReagent.end(); ++i) mask |= (*i)->m_spellInfo->Effects[(*i)->m_effIndex].SpellClassMask; target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1 , mask[0]); @@ -5189,7 +5189,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool target->CastCustomSpell(target, 50322, &bp0, NULL, NULL, true); } else - target-> RemoveAurasDueToSpell(50322); + target->RemoveAurasDueToSpell(50322); break; } } @@ -6173,7 +6173,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const uint32 absorb = 0; uint32 resist = 0; - CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL); + CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL); // ignore non positive values (can be result apply spellmods to aura damage uint32 damage = std::max(GetAmount(), 0); @@ -6466,7 +6466,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const caster->DealDamageMods(caster, funnelDamage, &funnelAbsorb); caster->SendSpellNonMeleeDamageLog(caster, GetId(), funnelDamage, GetSpellInfo()->GetSchoolMask(), funnelAbsorb, 0, false, 0, false); - CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL); + CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL); caster->DealDamage(caster, funnelDamage, &cleanDamage, NODAMAGE, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true); } diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index d721b5e0646..b6cdc006d2d 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -453,7 +453,7 @@ void Aura::_Remove(AuraRemoveMode removeMode) ApplicationMap::iterator appItr = m_applications.begin(); for (appItr = m_applications.begin(); appItr != m_applications.end();) { - AuraApplication * aurApp = appItr->second; + AuraApplication * aurApp = appItr->second; Unit* target = aurApp->GetTarget(); target->_UnapplyAura(aurApp, removeMode); appItr = m_applications.begin(); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 52a2f1f9da8..942f9dc7e86 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2166,7 +2166,7 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*= if (targetInfo.missCondition == SPELL_MISS_REFLECT) { // Calculate reflected spell result on caster - targetInfo.reflectResult = m_caster->SpellHitResult(m_caster, m_spellInfo, m_canReflect); + targetInfo.reflectResult = m_caster->SpellHitResult(m_caster, m_spellInfo, m_canReflect); if (targetInfo.reflectResult == SPELL_MISS_REFLECT) // Impossible reflect again, so simply deflect spell targetInfo.reflectResult = SPELL_MISS_PARRY; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 64aeb8c0e41..ce64c2e9560 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2761,7 +2761,7 @@ void Spell::EffectLearnSkill(SpellEffIndex effIndex) if (damage < 0) return; - uint32 skillid = m_spellInfo->Effects[effIndex].MiscValue; + uint32 skillid = m_spellInfo->Effects[effIndex].MiscValue; uint16 skillval = unitTarget->ToPlayer()->GetPureSkillValue(skillid); unitTarget->ToPlayer()->SetSkill(skillid, m_spellInfo->Effects[effIndex].CalcValue(), skillval?skillval:1, damage*75); } @@ -4630,7 +4630,8 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) 45684 // Polymorph }; - static uint32 const spellTarget[5] = { + static uint32 const spellTarget[5] = + { 45673, // Bigger! 45672, // Shrunk 45677, // Yellow @@ -5079,7 +5080,7 @@ void Spell::EffectEnchantHeldItem(SpellEffIndex effIndex) return; // must be equipped - if (!item ->IsEquipped()) + if (!item->IsEquipped()) return; if (m_spellInfo->Effects[effIndex].MiscValue) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 37d79225169..895dc9ab4b7 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1277,7 +1277,7 @@ void SpellMgr::LoadSpellRequired() { Field* fields = result->Fetch(); - uint32 spell_id = fields[0].GetUInt32(); + uint32 spell_id = fields[0].GetUInt32(); uint32 spell_req = fields[1].GetUInt32(); // check if chain is made with valid first spell @@ -2181,8 +2181,8 @@ void SpellMgr::LoadSpellLinked() Field* fields = result->Fetch(); int32 trigger = fields[0].GetInt32(); - int32 effect = fields[1].GetInt32(); - int32 type = fields[2].GetUInt8(); + int32 effect = fields[1].GetInt32(); + int32 type = fields[2].GetUInt8(); SpellInfo const* spellInfo = GetSpellInfo(abs(trigger)); if (!spellInfo) diff --git a/src/server/game/Weather/Weather.cpp b/src/server/game/Weather/Weather.cpp index 2a48ede4c81..965e6bf3805 100755 --- a/src/server/game/Weather/Weather.cpp +++ b/src/server/game/Weather/Weather.cpp @@ -147,7 +147,7 @@ bool Weather::ReGenerate() } // At this point, only weather that isn't doing anything remains but that have weather data - uint32 chance1 = m_weatherChances->data[season].rainChance; + uint32 chance1 = m_weatherChances->data[season].rainChance; uint32 chance2 = chance1+ m_weatherChances->data[season].snowChance; uint32 chance3 = chance2+ m_weatherChances->data[season].stormChance; diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp index 79a102c803f..ca71d8c313e 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp @@ -267,7 +267,7 @@ public: } } else DatterTimer -= diff; - if(me->HasAura(SPELL_LEECHING_SWARM)) + if (me->HasAura(SPELL_LEECHING_SWARM)) me->RemoveAurasDueToSpell(SPELL_LEECHING_SWARM); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 1bc5563acfa..5f4f8dfde9d 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -1685,7 +1685,7 @@ class spell_pursue : public SpellScriptLoader void FilterTargetsSubsequently(std::list& targets) { targets.clear(); - if(_target) + if (_target) targets.push_back(_target); } diff --git a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp index df33ffff01a..37ef8bf2788 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp @@ -168,7 +168,7 @@ class achievement_defenseless : public AchievementCriteriaScript bool OnCheck(Player* /*player*/, Unit* target) { - if(!target) + if (!target) return false; InstanceScript* instance = target->GetInstanceScript(); diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index a327a200c98..d2bba2b8bc3 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -212,7 +212,7 @@ class spell_pri_penance : public SpellScriptLoader Unit* caster = GetCaster(); if (Unit* unitTarget = GetHitUnit()) { - if(!unitTarget->isAlive()) + if (!unitTarget->isAlive()) return; uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); From 5b7493fc6676aa1f5ae762b9b0d5d12a01a30e14 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Thu, 29 Mar 2012 14:43:34 +0800 Subject: [PATCH 0359/1149] Core/Misc: Code style and remove unused define. Signed-off-by: Gyx <2359980687@qq.com> --- .../game/AuctionHouse/AuctionHouseMgr.cpp | 2 +- src/server/game/Battlegrounds/ArenaTeam.cpp | 2 + .../Entities/Object/ObjectPosSelector.cpp | 8 ++-- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Entities/Unit/Unit.cpp | 4 +- src/server/game/Groups/Group.cpp | 2 +- src/server/game/Handlers/CharacterHandler.cpp | 2 +- src/server/game/Handlers/SpellHandler.cpp | 6 --- src/server/game/Maps/Map.cpp | 2 +- src/server/game/Movement/MotionMaster.cpp | 4 +- .../ConfusedMovementGenerator.cpp | 2 +- .../FleeingMovementGenerator.cpp | 6 +-- .../WaypointMovementGenerator.cpp | 2 +- src/server/game/Server/Protocol/WorldLog.cpp | 1 + src/server/game/Server/WorldSession.cpp | 3 +- src/server/game/Server/WorldSocket.cpp | 44 +++++++++---------- src/server/game/Server/WorldSocket.h | 2 +- src/server/game/Server/WorldSocketMgr.cpp | 10 ++--- src/server/game/World/World.cpp | 6 +-- src/server/shared/Logging/Log.cpp | 22 +++++----- src/server/shared/Logging/Log.h | 42 +++++++++--------- 21 files changed, 86 insertions(+), 88 deletions(-) diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 38a5a49f7a5..683a269f508 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -795,7 +795,7 @@ void AuctionHouseMgr::DeleteExpiredAuctionsAtStartup() AuctionEntry* auction = new AuctionEntry(); - // Can't use LoadFromDB() because it assumes the auction map is loaded + // Can't use LoadFromDB() because it assumes the auction map is loaded if (!auction->LoadFromFieldList(fields)) { // For some reason the record in the DB is broken (possibly corrupt diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index 8cf504fd685..b4c86f7ef5f 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -306,11 +306,13 @@ void ArenaTeam::DelMember(uint64 guid, bool cleanDb) { // Remove member from team for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr) + { if (itr->Guid == guid) { Members.erase(itr); break; } + } // Inform player and remove arena team info from player data if (Player* player = ObjectAccessor::FindPlayer(guid)) diff --git a/src/server/game/Entities/Object/ObjectPosSelector.cpp b/src/server/game/Entities/Object/ObjectPosSelector.cpp index 6f27c1cb948..f5c36f5a3c9 100755 --- a/src/server/game/Entities/Object/ObjectPosSelector.cpp +++ b/src/server/game/Entities/Object/ObjectPosSelector.cpp @@ -75,9 +75,9 @@ void ObjectPosSelector::InitializeAngle() bool ObjectPosSelector::FirstAngle(float& angle) { - if (m_UsedPosLists[USED_POS_PLUS].empty() && !m_UsedPosLists[USED_POS_MINUS].empty() ) + if (m_UsedPosLists[USED_POS_PLUS].empty() && !m_UsedPosLists[USED_POS_MINUS].empty()) return NextAngleFor(*m_UsedPosLists[USED_POS_MINUS].begin(), 1.0f, USED_POS_PLUS, angle); - else if (m_UsedPosLists[USED_POS_MINUS].empty() && !m_UsedPosLists[USED_POS_PLUS].empty() ) + else if (m_UsedPosLists[USED_POS_MINUS].empty() && !m_UsedPosLists[USED_POS_PLUS].empty()) return NextAngleFor(*m_UsedPosLists[USED_POS_PLUS].begin(), -1.0f, USED_POS_MINUS, angle); return false; @@ -100,7 +100,7 @@ bool ObjectPosSelector::NextAngle(float& angle) bool ObjectPosSelector::NextUsedAngle(float& angle) { while (m_nextUsedPos[USED_POS_PLUS]!=m_UsedPosLists[USED_POS_PLUS].end() || - m_nextUsedPos[USED_POS_MINUS]!=m_UsedPosLists[USED_POS_MINUS].end() ) + m_nextUsedPos[USED_POS_MINUS]!=m_UsedPosLists[USED_POS_MINUS].end()) { // calculate next possible angle if (!NextPosibleAngle(angle)) @@ -114,7 +114,7 @@ bool ObjectPosSelector::NextPosibleAngle(float& angle) { // ++ direction less updated if (m_nextUsedPos[USED_POS_PLUS]!=m_UsedPosLists[USED_POS_PLUS].end() && - (m_nextUsedPos[USED_POS_MINUS]==m_UsedPosLists[USED_POS_MINUS].end() || m_nextUsedPos[USED_POS_PLUS]->first <= m_nextUsedPos[USED_POS_MINUS]->first) ) + (m_nextUsedPos[USED_POS_MINUS]==m_UsedPosLists[USED_POS_MINUS].end() || m_nextUsedPos[USED_POS_PLUS]->first <= m_nextUsedPos[USED_POS_MINUS]->first)) { bool ok; if (m_smallStepOk[USED_POS_PLUS]) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 10c35a88503..fac73304506 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -20475,7 +20475,7 @@ void Player::SendProficiency(ItemClass itemClass, uint32 itemSubclassMask) { WorldPacket data(SMSG_SET_PROFICIENCY, 1 + 4); data << uint8(itemClass) << uint32(itemSubclassMask); - GetSession()->SendPacket (&data); + GetSession()->SendPacket(&data); } void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 9adbb7f6cd7..8d02db9d515 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -9020,10 +9020,10 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg case 70893: { // check if we're doing a critical hit - if (!(procSpell->SpellFamilyFlags[1] & 0x10000000) && (procEx != PROC_EX_CRITICAL_HIT) ) + if (!(procSpell->SpellFamilyFlags[1] & 0x10000000) && (procEx != PROC_EX_CRITICAL_HIT)) return false; // check if we're procced by Claw, Bite or Smack (need to use the spell icon ID to detect it) - if (!(procSpell->SpellIconID == 262 || procSpell->SpellIconID == 1680 || procSpell->SpellIconID == 473 )) + if (!(procSpell->SpellIconID == 262 || procSpell->SpellIconID == 1680 || procSpell->SpellIconID == 473)) return false; break; } diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index e7349f9ec10..47b086553c5 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -756,7 +756,7 @@ void Group::SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p, if (!p || !p->GetSession()) return; - WorldPacket data(SMSG_LOOT_START_ROLL, (8 + 4 + 4 + 4 + 4 + 4 + 4 + 1 )); + WorldPacket data(SMSG_LOOT_START_ROLL, (8 + 4 + 4 + 4 + 4 + 4 + 4 + 1)); data << uint64(r.itemGUID); // guid of rolled item data << uint32(mapId); // 3.3.3 mapid data << uint32(r.totalPlayersRolling); // maybe the number of players rolling for it??? diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 36f61665a8a..0923281588c 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1673,7 +1673,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) { WorldPacket data(SMSG_CHAR_FACTION_CHANGE, 1); data << uint8(CHAR_NAME_RESERVED); - SendPacket (&data); + SendPacket(&data); return; } diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 36986075b4e..b2d52c85467 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -173,12 +173,6 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) } } -#define OPEN_CHEST 11437 -#define OPEN_SAFE 11535 -#define OPEN_CAGE 11792 -#define OPEN_BOOTY_CHEST 5107 -#define OPEN_STRONGBOX 8517 - void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) { sLog->outDetail("WORLD: CMSG_OPEN_ITEM packet, data length = %i", (uint32)recvPacket.size()); diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 3be247947fe..f60a8f20c1c 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2355,7 +2355,7 @@ bool InstanceMap::CanEnter(Player* player) return false; } // player inside instance has no group or his groups is different to entering player's one, deny entry - if (!iPlayer->GetGroup() || iPlayer->GetGroup() != player->GetGroup() ) + if (!iPlayer->GetGroup() || iPlayer->GetGroup() != player->GetGroup()) { player->SendTransferAborted(GetId(), TRANSFER_ABORT_MAX_PLAYERS); return false; diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 27816753ca7..b8a7ee848ed 100755 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -202,11 +202,11 @@ void MotionMaster::MoveTargetedHome() } else if (_owner->GetTypeId()==TYPEID_UNIT && ((Creature*)_owner)->GetCharmerOrOwnerGUID()) { - sLog->outStaticDebug("Pet or controlled creature (Entry: %u GUID: %u) targeting home", _owner->GetEntry(), _owner->GetGUIDLow() ); + sLog->outStaticDebug("Pet or controlled creature (Entry: %u GUID: %u) targeting home", _owner->GetEntry(), _owner->GetGUIDLow()); Unit *target = ((Creature*)_owner)->GetCharmerOrOwner(); if (target) { - sLog->outStaticDebug("Following %s (GUID: %u)", target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow() ); + sLog->outStaticDebug("Following %s (GUID: %u)", target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow()); Mutate(new FollowMovementGenerator(*target,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE), MOTION_SLOT_ACTIVE); } } diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index f7534ec800e..da830a9a49b 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -118,7 +118,7 @@ bool ConfusedMovementGenerator::Update(T &unit, const uint32 &diff) { // waiting for next move i_nextMoveTime.Update(diff); - if(i_nextMoveTime.Passed() ) + if (i_nextMoveTime.Passed()) { // start moving unit.AddUnitState(UNIT_STATE_CONFUSED_MOVE); diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp index ecf314c8bbc..7de5f1095c4 100755 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp @@ -182,7 +182,7 @@ FleeingMovementGenerator::_getPoint(T &owner, float &x, float &y, float &z) } } i_to_distance_from_caster = 0.0f; - i_nextCheckTime.Reset( urand(500,1000) ); + i_nextCheckTime.Reset(urand(500,1000)); return false; } @@ -201,12 +201,12 @@ FleeingMovementGenerator::_setMoveData(T &owner) (i_last_distance_from_caster < i_to_distance_from_caster && cur_dist_xyz > i_to_distance_from_caster) || // if we reach bigger distance (cur_dist_xyz > MAX_QUIET_DISTANCE) || // if we are too far - (i_last_distance_from_caster > MIN_QUIET_DISTANCE && cur_dist_xyz < MIN_QUIET_DISTANCE) ) + (i_last_distance_from_caster > MIN_QUIET_DISTANCE && cur_dist_xyz < MIN_QUIET_DISTANCE)) // if we leave 'quiet zone' { // we are very far or too close, stopping i_to_distance_from_caster = 0.0f; - i_nextCheckTime.Reset( urand(500,1000) ); + i_nextCheckTime.Reset(urand(500,1000)); return false; } else diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index 8458232c336..81fe1606ede 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -231,7 +231,7 @@ void FlightPathMovementGenerator::Reset(Player & player) uint32 end = GetPathAtMapEnd(); for (uint32 i = GetCurrentNode(); i != end; ++i) { - G3D::Vector3 vertice((*i_path)[i].x,(*i_path)[i].y,(*i_path)[i].z); + G3D::Vector3 vertice((*i_path)[i].x, (*i_path)[i].y, (*i_path)[i].z); init.Path().push_back(vertice); } init.SetFirstPointId(GetCurrentNode()); diff --git a/src/server/game/Server/Protocol/WorldLog.cpp b/src/server/game/Server/Protocol/WorldLog.cpp index 5b1a3af996f..38b13dff095 100755 --- a/src/server/game/Server/Protocol/WorldLog.cpp +++ b/src/server/game/Server/Protocol/WorldLog.cpp @@ -34,6 +34,7 @@ WorldLog::~WorldLog() { if (i_file != NULL) fclose(i_file); + i_file = NULL; } diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 9dcacb71824..be6561c2633 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -195,7 +195,7 @@ void WorldSession::SendPacket(WorldPacket const* packet) } #endif // !TRINITY_DEBUG - if (m_Socket->SendPacket (*packet) == -1) + if (m_Socket->SendPacket(*packet) == -1) m_Socket->CloseSocket(); } @@ -922,6 +922,7 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data) { if (data.rpos() + 4 > data.size()) return; + uint32 size; data >> size; diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index cf9ec7dadc4..64137dfe7c7 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -152,7 +152,7 @@ const std::string& WorldSocket::GetRemoteAddress (void) const return m_Address; } -int WorldSocket::SendPacket (const WorldPacket& pct) +int WorldSocket::SendPacket(const WorldPacket& pct) { ACE_GUARD_RETURN (LockType, Guard, m_OutBufferLock, -1); @@ -252,7 +252,7 @@ int WorldSocket::open (void *a) if (peer().get_remote_addr(remote_addr) == -1) { - sLog->outError ("WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno)); + sLog->outError("WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno)); return -1; } @@ -277,7 +277,7 @@ int WorldSocket::open (void *a) // Register with ACE Reactor if (reactor()->register_handler(this, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::WRITE_MASK) == -1) { - sLog->outError ("WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno)); + sLog->outError("WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno)); return -1; } @@ -496,7 +496,7 @@ int WorldSocket::handle_input_header (void) if ((header.size < 4) || (header.size > 10240) || (header.cmd > 10240)) { Player* _player = m_Session ? m_Session->GetPlayer() : NULL; - sLog->outError ("WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d, cmd: %d)", + sLog->outError("WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d, cmd: %d)", m_Session ? m_Session->GetAccountId() : 0, _player ? _player->GetGUIDLow() : 0, _player ? _player->GetName() : "", @@ -602,7 +602,7 @@ int WorldSocket::handle_input_missing_data (void) // hope this is not hack, as proper m_RecvWPct is asserted around if (!m_RecvWPct) { - sLog->outError ("Forcing close on input m_RecvWPct = NULL"); + sLog->outError("Forcing close on input m_RecvWPct = NULL"); errno = EINVAL; return -1; } @@ -648,7 +648,7 @@ int WorldSocket::cancel_wakeup_output (GuardType& g) (this, ACE_Event_Handler::WRITE_MASK) == -1) { // would be good to store errno from reactor with errno guard - sLog->outError ("WorldSocket::cancel_wakeup_output"); + sLog->outError("WorldSocket::cancel_wakeup_output"); return -1; } @@ -667,7 +667,7 @@ int WorldSocket::schedule_wakeup_output (GuardType& g) if (reactor()->schedule_wakeup (this, ACE_Event_Handler::WRITE_MASK) == -1) { - sLog->outError ("WorldSocket::schedule_wakeup_output"); + sLog->outError("WorldSocket::schedule_wakeup_output"); return -1; } @@ -715,7 +715,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) case CMSG_AUTH_SESSION: if (m_Session) { - sLog->outError ("WorldSocket::ProcessIncoming: Player send CMSG_AUTH_SESSION again"); + sLog->outError("WorldSocket::ProcessIncoming: Player send CMSG_AUTH_SESSION again"); return -1; } @@ -744,7 +744,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) } else { - sLog->outError ("WorldSocket::ProcessIncoming: Client not authed opcode = %u", uint32(opcode)); + sLog->outError("WorldSocket::ProcessIncoming: Client not authed opcode = %u", uint32(opcode)); return -1; } } @@ -788,9 +788,9 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) { packet.Initialize(SMSG_AUTH_RESPONSE, 1); packet << uint8(AUTH_REJECT); - SendPacket (packet); + SendPacket(packet); - sLog->outError ("WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str()); + sLog->outError("WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str()); return -1; } @@ -824,9 +824,9 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) packet.Initialize (SMSG_AUTH_RESPONSE, 1); packet << uint8 (AUTH_UNKNOWN_ACCOUNT); - SendPacket (packet); + SendPacket(packet); - sLog->outError ("WorldSocket::HandleAuthSession: Sent Auth Response (unknown account)."); + sLog->outError("WorldSocket::HandleAuthSession: Sent Auth Response (unknown account)."); return -1; } @@ -860,7 +860,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) { packet.Initialize (SMSG_AUTH_RESPONSE, 1); packet << uint8 (AUTH_FAILED); - SendPacket (packet); + SendPacket(packet); sLog->outBasic ("WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs)."); return -1; @@ -924,9 +924,9 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) { packet.Initialize (SMSG_AUTH_RESPONSE, 1); packet << uint8 (AUTH_BANNED); - SendPacket (packet); + SendPacket(packet); - sLog->outError ("WorldSocket::HandleAuthSession: Sent Auth Response (Account banned)."); + sLog->outError("WorldSocket::HandleAuthSession: Sent Auth Response (Account banned)."); return -1; } @@ -938,9 +938,9 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) WorldPacket Packet (SMSG_AUTH_RESPONSE, 1); Packet << uint8 (AUTH_UNAVAILABLE); - SendPacket (packet); + SendPacket(packet); - sLog->outDetail ("WorldSocket::HandleAuthSession: User tries to login but his security level is not enough"); + sLog->outDetail("WorldSocket::HandleAuthSession: User tries to login but his security level is not enough"); return -1; } @@ -960,9 +960,9 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) packet.Initialize (SMSG_AUTH_RESPONSE, 1); packet << uint8 (AUTH_FAILED); - SendPacket (packet); + SendPacket(packet); - sLog->outError ("WorldSocket::HandleAuthSession: Sent Auth Response (authentification failed)."); + sLog->outError("WorldSocket::HandleAuthSession: Sent Auth Response (authentification failed)."); return -1; } @@ -1067,7 +1067,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket) m_Session->SetLatency (latency); else { - sLog->outError ("WorldSocket::HandlePing: peer sent CMSG_PING, " + sLog->outError("WorldSocket::HandlePing: peer sent CMSG_PING, " "but is not authenticated or got recently kicked, " " address = %s", GetRemoteAddress().c_str()); @@ -1077,5 +1077,5 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket) WorldPacket packet (SMSG_PONG, 4); packet << ping; - return SendPacket (packet); + return SendPacket(packet); } diff --git a/src/server/game/Server/WorldSocket.h b/src/server/game/Server/WorldSocket.h index 3396803ff62..b8080b128f2 100755 --- a/src/server/game/Server/WorldSocket.h +++ b/src/server/game/Server/WorldSocket.h @@ -108,7 +108,7 @@ class WorldSocket : public WorldHandler /// Send A packet on the socket, this function is reentrant. /// @param pct packet to send /// @return -1 of failure - int SendPacket (const WorldPacket& pct); + int SendPacket(const WorldPacket& pct); /// Add reference to this object. long AddReference (void); diff --git a/src/server/game/Server/WorldSocketMgr.cpp b/src/server/game/Server/WorldSocketMgr.cpp index 00a8b263847..d357651a5bf 100755 --- a/src/server/game/Server/WorldSocketMgr.cpp +++ b/src/server/game/Server/WorldSocketMgr.cpp @@ -236,7 +236,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address) if (num_threads <= 0) { - sLog->outError ("Network.Threads is wrong in your config file"); + sLog->outError("Network.Threads is wrong in your config file"); return -1; } @@ -253,7 +253,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address) if (m_SockOutUBuff <= 0) { - sLog->outError ("Network.OutUBuff is wrong in your config file"); + sLog->outError("Network.OutUBuff is wrong in your config file"); return -1; } @@ -263,7 +263,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address) if (m_Acceptor->open(listen_addr, m_NetThreads[0].GetReactor(), ACE_NONBLOCK) == -1) { - sLog->outError ("Failed to open acceptor, check if the port is free"); + sLog->outError("Failed to open acceptor, check if the port is free"); return -1; } @@ -327,7 +327,7 @@ WorldSocketMgr::OnSocketOpen (WorldSocket* sock) (void*) & m_SockOutKBuff, sizeof (int)) == -1 && errno != ENOTSUP) { - sLog->outError ("WorldSocketMgr::OnSocketOpen set_option SO_SNDBUF"); + sLog->outError("WorldSocketMgr::OnSocketOpen set_option SO_SNDBUF"); return -1; } } @@ -342,7 +342,7 @@ WorldSocketMgr::OnSocketOpen (WorldSocket* sock) (void*)&ndoption, sizeof (int)) == -1) { - sLog->outError ("WorldSocketMgr::OnSocketOpen: peer().set_option TCP_NODELAY errno = %s", ACE_OS::strerror (errno)); + sLog->outError("WorldSocketMgr::OnSocketOpen: peer().set_option TCP_NODELAY errno = %s", ACE_OS::strerror (errno)); return -1; } } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index a842c288c89..fd39beb49ff 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -267,7 +267,7 @@ void World::AddSession_(WorldSession* s) { AddQueuedPlayer (s); UpdateMaxSessionCounters(); - sLog->outDetail ("PlayerQueue: Account id %u is in Queue Position (%u).", s->GetAccountId(), ++QueueSize); + sLog->outDetail("PlayerQueue: Account id %u is in Queue Position (%u).", s->GetAccountId(), ++QueueSize); return; } @@ -284,7 +284,7 @@ void World::AddSession_(WorldSession* s) float popu = (float)GetActiveSessionCount(); // updated number of users on the server popu /= pLimit; popu *= 2; - sLog->outDetail ("Server Population (%f).", popu); + sLog->outDetail("Server Population (%f).", popu); } } @@ -1764,7 +1764,7 @@ void World::SetInitialWorldSettings() uint32 startupDuration = GetMSTimeDiffToNow(startupBegin); sLog->outString(); - sLog->outString("WORLD: World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000) ); + sLog->outString("WORLD: World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000)); sLog->outString(); } diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp index 0a53706fea2..79eab053d08 100755 --- a/src/server/shared/Logging/Log.cpp +++ b/src/server/shared/Logging/Log.cpp @@ -38,11 +38,11 @@ Log::Log() : Log::~Log() { - if ( logfile != NULL ) + if (logfile != NULL) fclose(logfile); logfile = NULL; - if ( gmLogfile != NULL ) + if (gmLogfile != NULL) fclose(gmLogfile); gmLogfile = NULL; @@ -50,7 +50,7 @@ Log::~Log() fclose(charLogfile); charLogfile = NULL; - if ( dberLogfile != NULL ) + if (dberLogfile != NULL) fclose(dberLogfile); dberLogfile = NULL; @@ -81,32 +81,32 @@ Log::~Log() void Log::SetLogLevel(char *Level) { - int32 NewLevel =atoi((char*)Level); - if ( NewLevel <0 ) + int32 NewLevel = atoi((char*)Level); + if (NewLevel < 0) NewLevel = 0; m_logLevel = NewLevel; - outString( "LogLevel is %u", m_logLevel ); + outString("LogLevel is %u", m_logLevel); } void Log::SetLogFileLevel(char *Level) { - int32 NewLevel =atoi((char*)Level); - if ( NewLevel <0 ) + int32 NewLevel = atoi((char*)Level); + if (NewLevel < 0) NewLevel = 0; m_logFileLevel = NewLevel; - outString( "LogFileLevel is %u", m_logFileLevel ); + outString("LogFileLevel is %u", m_logFileLevel); } void Log::SetDBLogLevel(char *Level) { int32 NewLevel = atoi((char*)Level); - if ( NewLevel < 0 ) + if (NewLevel < 0) NewLevel = 0; m_dbLogLevel = NewLevel; - outString( "DBLogLevel is %u", m_dbLogLevel ); + outString("DBLogLevel is %u", m_dbLogLevel); } void Log::Initialize() diff --git a/src/server/shared/Logging/Log.h b/src/server/shared/Logging/Log.h index 4baa1695a55..9ee9d83ad3f 100755 --- a/src/server/shared/Logging/Log.h +++ b/src/server/shared/Logging/Log.h @@ -117,28 +117,28 @@ class Log void SetColor(bool stdout_stream, ColorTypes color); void ResetColor(bool stdout_stream); - void outErrorST( const char * err, ... ) ATTR_PRINTF(2, 3); - void outDB( LogTypes type, const char * str ); - void outString( const char * str, ... ) ATTR_PRINTF(2, 3); - void outString( ); - void outStringInLine( const char * str, ... ) ATTR_PRINTF(2, 3); - void outError( const char * err, ... ) ATTR_PRINTF(2, 3); - void outCrash( const char * err, ... ) ATTR_PRINTF(2, 3); - void outBasic( const char * str, ... ) ATTR_PRINTF(2, 3); - void outDetail( const char * str, ... ) ATTR_PRINTF(2, 3); - void outSQLDev( const char * str, ... ) ATTR_PRINTF(2, 3); + void outErrorST(const char * err, ...) ATTR_PRINTF(2, 3); + void outDB(LogTypes type, const char * str); + void outString(const char * str, ...) ATTR_PRINTF(2, 3); + void outString(); + void outStringInLine(const char * str, ...) ATTR_PRINTF(2, 3); + void outError(const char * err, ...) ATTR_PRINTF(2, 3); + void outCrash(const char * err, ...) ATTR_PRINTF(2, 3); + void outBasic(const char * str, ...) ATTR_PRINTF(2, 3); + void outDetail(const char * str, ...) ATTR_PRINTF(2, 3); + void outSQLDev(const char * str, ...) ATTR_PRINTF(2, 3); void outDebug(DebugLogFilters f, const char* str, ...) ATTR_PRINTF(3, 4); - void outStaticDebug( const char * str, ... ) ATTR_PRINTF(2, 3); - void outDebugInLine( const char * str, ... ) ATTR_PRINTF(2, 3); - void outErrorDb( const char * str, ... ) ATTR_PRINTF(2, 3); - void outChar( const char * str, ... ) ATTR_PRINTF(2, 3); - void outCommand( uint32 account, const char * str, ...) ATTR_PRINTF(3, 4); - void outRemote( const char * str, ... ) ATTR_PRINTF(2, 3); - void outChat( const char * str, ... ) ATTR_PRINTF(2, 3); - void outArena( const char * str, ... ) ATTR_PRINTF(2, 3); - void outSQLDriver( const char* str, ... ) ATTR_PRINTF(2, 3); - void outWarden( const char * str, ... ) ATTR_PRINTF(2, 3); - void outCharDump( const char * str, uint32 account_id, uint32 guid, const char * name ); + void outStaticDebug(const char * str, ...) ATTR_PRINTF(2, 3); + void outDebugInLine(const char * str, ...) ATTR_PRINTF(2, 3); + void outErrorDb(const char * str, ...) ATTR_PRINTF(2, 3); + void outChar(const char * str, ...) ATTR_PRINTF(2, 3); + void outCommand(uint32 account, const char * str, ...) ATTR_PRINTF(3, 4); + void outRemote(const char * str, ...) ATTR_PRINTF(2, 3); + void outChat(const char * str, ...) ATTR_PRINTF(2, 3); + void outArena(const char * str, ...) ATTR_PRINTF(2, 3); + void outSQLDriver(const char* str, ...) ATTR_PRINTF(2, 3); + void outWarden(const char * str, ...) ATTR_PRINTF(2, 3); + void outCharDump(const char * str, uint32 account_id, uint32 guid, const char * name); static void outTimestamp(FILE* file); static std::string GetTimestampStr(); From 391d68be20d883a976c75a0b0833d616b178e025 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Thu, 29 Mar 2012 15:44:24 +0800 Subject: [PATCH 0360/1149] Core/Script: Code style. WaypointReached(uint32 i) -> WaypointReached(uint32 waypointId) WaypointReached(uint32 uiPointId) -> WaypointReached(uint32 waypointId) WaypointReached(uint32 /*point*/) -> WaypointReached(uint32 /*waypointId*/) WaypointReached(uint32 uiI) -> WaypointReached(uint32 waypointId) WaypointReached(uint32 /*i*/) -> WaypointReached(uint32 waypointId) WaypointReached(uint32 uiWPointId) -> WaypointReached(uint32 waypointId) WaypointReached(uint32 /*wp*/) -> WaypointReached(uint32 waypointId) WaypointReached(uint32 /*point*/) -> WaypointReached(uint32 waypointId) Signed-off-by: Gyx <2359980687@qq.com> --- .../BlackrockDepths/blackrock_depths.cpp | 106 +++++++++--------- .../EasternKingdoms/Gnomeregan/gnomeregan.cpp | 4 +- .../EasternKingdoms/Karazhan/karazhan.cpp | 4 +- .../ScarletEnclave/chapter1.cpp | 4 +- .../ScarletEnclave/chapter2.cpp | 4 +- .../ScarletEnclave/chapter5.cpp | 5 +- .../ScarletMonastery/boss_herod.cpp | 7 +- .../ShadowfangKeep/shadowfang_keep.cpp | 4 +- .../EasternKingdoms/arathi_highlands.cpp | 61 +++++----- .../scripts/EasternKingdoms/ghostlands.cpp | 13 +-- .../scripts/EasternKingdoms/hinterlands.cpp | 9 +- .../EasternKingdoms/redridge_mountains.cpp | 7 +- .../EasternKingdoms/silverpine_forest.cpp | 13 +-- .../EasternKingdoms/stormwind_city.cpp | 8 +- .../EasternKingdoms/swamp_of_sorrows.cpp | 32 +++--- .../EasternKingdoms/western_plaguelands.cpp | 5 +- .../scripts/EasternKingdoms/westfall.cpp | 24 ++-- .../scripts/EasternKingdoms/wetlands.cpp | 5 +- .../scripts/Examples/example_escort.cpp | 4 +- .../BlackfathomDeeps/blackfathom_deeps.cpp | 4 +- .../BattleForMountHyjal/boss_anetheron.cpp | 4 +- .../BattleForMountHyjal/boss_archimonde.cpp | 6 +- .../BattleForMountHyjal/boss_azgalor.cpp | 6 +- .../BattleForMountHyjal/boss_kazrogal.cpp | 4 +- .../boss_rage_winterchill.cpp | 4 +- .../BattleForMountHyjal/hyjalAI.cpp | 4 +- .../BattleForMountHyjal/hyjalAI.h | 2 +- .../BattleForMountHyjal/hyjal_trash.cpp | 65 ++++++----- .../culling_of_stratholme.cpp | 4 +- .../EscapeFromDurnholdeKeep/old_hillsbrad.cpp | 10 +- .../Kalimdor/RazorfenKraul/razorfen_kraul.cpp | 85 +++++++------- .../WailingCaverns/wailing_caverns.cpp | 14 +-- src/server/scripts/Kalimdor/ashenvale.cpp | 62 +++++----- .../scripts/Kalimdor/azuremyst_isle.cpp | 33 +++--- src/server/scripts/Kalimdor/darkshore.cpp | 4 +- src/server/scripts/Kalimdor/desolace.cpp | 5 +- .../scripts/Kalimdor/dustwallow_marsh.cpp | 73 ++++++------ src/server/scripts/Kalimdor/feralas.cpp | 4 +- src/server/scripts/Kalimdor/moonglade.cpp | 4 +- .../scripts/Kalimdor/stonetalon_mountains.cpp | 6 +- src/server/scripts/Kalimdor/tanaris.cpp | 79 +++++++++---- src/server/scripts/Kalimdor/the_barrens.cpp | 41 ++++--- .../scripts/Kalimdor/thousand_needles.cpp | 12 +- src/server/scripts/Kalimdor/ungoro_crater.cpp | 5 +- .../RubySanctum/boss_general_zarithrian.cpp | 4 +- .../boss_argent_challenge.cpp | 4 +- .../TrialOfTheChampion/boss_black_knight.cpp | 2 +- .../boss_grand_champions.cpp | 12 +- .../Nexus/EyeOfEternity/boss_malygos.cpp | 3 +- .../Ulduar/HallsOfStone/halls_of_stone.cpp | 4 +- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 3 +- .../Northrend/VioletHold/violet_hold.cpp | 28 ++--- .../scripts/Northrend/borean_tundra.cpp | 57 +++++----- .../scripts/Northrend/grizzly_hills.cpp | 4 +- .../scripts/Northrend/howling_fjord.cpp | 4 +- .../scripts/Northrend/sholazar_basin.cpp | 60 +++++----- src/server/scripts/Northrend/storm_peaks.cpp | 7 +- src/server/scripts/Northrend/zuldrak.cpp | 8 +- .../boss_ambassador_hellmaw.cpp | 2 +- .../scripts/Outland/hellfire_peninsula.cpp | 55 +++++---- src/server/scripts/Outland/nagrand.cpp | 8 +- src/server/scripts/Outland/netherstorm.cpp | 17 ++- .../scripts/Outland/shadowmoon_valley.cpp | 5 +- src/server/scripts/Outland/shattrath_city.cpp | 89 +++++++++++---- .../scripts/Outland/terokkar_forest.cpp | 20 +--- src/server/scripts/Outland/zangarmarsh.cpp | 5 +- src/server/scripts/World/npcs_special.cpp | 3 +- 67 files changed, 660 insertions(+), 603 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp index 566e8c977dc..760a671b24a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp @@ -177,39 +177,39 @@ public: MobDeath_Timer = 2500; } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { - case 0: - DoScriptText(SCRIPT_TEXT1, me);//2 - CanWalk = false; - Event_Timer = 5000; - break; - case 1: - DoScriptText(SCRIPT_TEXT2, me);//4 - CanWalk = false; - Event_Timer = 5000; - break; - case 2: - CanWalk = false; - break; - case 3: - DoScriptText(SCRIPT_TEXT3, me);//5 - break; - case 4: - DoScriptText(SCRIPT_TEXT4, me);//6 - CanWalk = false; - Event_Timer = 5000; - break; - case 5: - if (instance) - { - instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, NPC_GRIMSTONE, me); - instance->SetData(TYPE_RING_OF_LAW, DONE); - sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_grimstone: event reached end and set complete."); - } - break; + case 0: + DoScriptText(SCRIPT_TEXT1, me);//2 + CanWalk = false; + Event_Timer = 5000; + break; + case 1: + DoScriptText(SCRIPT_TEXT2, me);//4 + CanWalk = false; + Event_Timer = 5000; + break; + case 2: + CanWalk = false; + break; + case 3: + DoScriptText(SCRIPT_TEXT3, me);//5 + break; + case 4: + DoScriptText(SCRIPT_TEXT4, me);//6 + CanWalk = false; + Event_Timer = 5000; + break; + case 5: + if (instance) + { + instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, NPC_GRIMSTONE, me); + instance->SetData(TYPE_RING_OF_LAW, DONE); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_grimstone: event reached end and set complete."); + } + break; } } @@ -611,7 +611,7 @@ public: { npc_dughal_stormwingAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { switch (i) { @@ -730,7 +730,7 @@ public: instance = creature->GetInstanceScript(); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { switch (i) { @@ -900,7 +900,7 @@ public: { } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { wp=i; switch (i) @@ -1105,7 +1105,7 @@ public: } } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { switch (i) { @@ -1226,29 +1226,29 @@ public: go->SetGoState((GOState)state); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { if (!instance) return; - switch (i) + switch (waypointId) { - case 1: - me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); - break; - case 2: - me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED); - break; - case 3: - me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED); - break; - case 4: - me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); - break; - case 5: - me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); - BreakKeg_Timer = 2000; - break; + case 1: + me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + break; + case 2: + me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED); + break; + case 3: + me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED); + break; + case 4: + me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + break; + case 5: + me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + BreakKeg_Timer = 2000; + break; } } diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp index 12f2cef2d0b..6aa4c9d1a7a 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp @@ -266,14 +266,14 @@ public: } } - void WaypointReached(uint32 uiPoint) + void WaypointReached(uint32 waypointId) { //just in case if (GetPlayerForEscort()) if (me->getFaction() != GetPlayerForEscort()->getFaction()) me->setFaction(GetPlayerForEscort()->getFaction()); - switch (uiPoint) + switch (waypointId) { case 3: SetEscortPaused(true); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index a61fd235753..89c3e371de7 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -158,12 +158,12 @@ public: void EnterCombat(Unit* /*who*/) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { if (!instance) return; - switch (i) + switch (waypointId) { case 0: DoCast(me, SPELL_TUXEDO, false); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index aab18cd57be..4319fef0b05 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -994,9 +994,9 @@ public: SetDespawnAtFar(false); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { case 1: if (Unit* car = Unit::GetCreature(*me, carGUID)) diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index bf208baf873..2b9dbdd248d 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -239,9 +239,9 @@ public: } } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 0: DoScriptText(SAY_BREAKOUT1, me); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 6f71b100bb7..8cee23fab1c 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -497,9 +497,9 @@ public: SetEscortPaused(bOnHold); } - void WaypointReached(uint32 wpId) + void WaypointReached(uint32 waypointId) { - switch (wpId) + switch (waypointId) { case 0: me->SetWalk(false); @@ -507,7 +507,6 @@ public: break; case 1: SetHoldState(true); - SpawnNPC(); if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) DoScriptText(SAY_LIGHT_OF_DAWN07, temp); diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp index 16b90f89bb5..58c21d86a2f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp @@ -152,7 +152,12 @@ public: uint32 Start_Timer; void Reset() {} - void WaypointReached(uint32 /*point*/) {} + + void WaypointReached(uint32 /*waypointId*/) + { + + } + void EnterCombat(Unit* /*who*/) {} void UpdateAI(const uint32 diff) diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp index 0ea55d170b3..63e753a18ba 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp @@ -99,9 +99,9 @@ public: InstanceScript* instance; uint32 uiNpcEntry; - void WaypointReached(uint32 uiPoint) + void WaypointReached(uint32 waypointId) { - switch (uiPoint) + switch (waypointId) { case 0: if (uiNpcEntry == NPC_ASH) diff --git a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp index b53770badab..f6a62fbf092 100644 --- a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp @@ -64,43 +64,42 @@ class npc_professor_phizzlethorpe : public CreatureScript { npc_professor_phizzlethorpeAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (uiPointId) + switch (waypointId) { - case 4: - Talk(SAY_PROGRESS_2, player->GetGUID()); - break; - case 5: - Talk(SAY_PROGRESS_3, player->GetGUID()); - break; - case 8: - Talk(EMOTE_PROGRESS_4); - break; - case 9: - me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - break; - case 10: - Talk(SAY_PROGRESS_5, player->GetGUID()); - break; - case 11: - Talk(SAY_PROGRESS_6, player->GetGUID()); - SetRun(); - break; - case 19: - Talk(SAY_PROGRESS_7, player->GetGUID()); - break; - case 20: - Talk(EMOTE_PROGRESS_8); - Talk(SAY_PROGRESS_9, player->GetGUID()); - CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me); - break; + case 4: + Talk(SAY_PROGRESS_2, player->GetGUID()); + break; + case 5: + Talk(SAY_PROGRESS_3, player->GetGUID()); + break; + case 8: + Talk(EMOTE_PROGRESS_4); + break; + case 9: + me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + break; + case 10: + Talk(SAY_PROGRESS_5, player->GetGUID()); + break; + case 11: + Talk(SAY_PROGRESS_6, player->GetGUID()); + SetRun(); + break; + case 19: + Talk(SAY_PROGRESS_7, player->GetGUID()); + break; + case 20: + Talk(EMOTE_PROGRESS_8); + Talk(SAY_PROGRESS_9, player->GetGUID()); + CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me); + break; } } diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/ghostlands.cpp index 8859dff1c77..e40a2f785e6 100644 --- a/src/server/scripts/EasternKingdoms/ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/ghostlands.cpp @@ -130,14 +130,13 @@ public: { npc_ranger_lilathaAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { case 0: me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); @@ -145,16 +144,13 @@ public: Cage->SetGoState(GO_STATE_ACTIVE); DoScriptText(SAY_START, me, player); break; - case 5: DoScriptText(SAY_PROGRESS1, me, player); break; - case 11: DoScriptText(SAY_PROGRESS2, me, player); me->SetOrientation(4.762841f); break; - case 18: { DoScriptText(SAY_PROGRESS3, me, player); @@ -168,25 +164,20 @@ public: me->AI()->AttackStart(Summ1); } break; - case 19: me->SetWalk(false); break; - case 25: me->SetWalk(true); break; - case 30: if (player->GetTypeId() == TYPEID_PLAYER) CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me); break; - case 32: me->SetOrientation(2.978281f); DoScriptText(SAY_END1, me, player); break; - case 33: me->SetOrientation(5.858011f); DoScriptText(SAY_END2, me, player); diff --git a/src/server/scripts/EasternKingdoms/hinterlands.cpp b/src/server/scripts/EasternKingdoms/hinterlands.cpp index f217cb2a0dd..8de895cb51f 100644 --- a/src/server/scripts/EasternKingdoms/hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/hinterlands.cpp @@ -87,9 +87,9 @@ public: void Reset() { } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 26: DoScriptText(SAY_OOX_AMBUSH, me); @@ -276,14 +276,13 @@ public: summoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ); } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (uiPointId) + switch (waypointId) { case 1: DoScriptText(SAY_RIN_FREE, me, player); diff --git a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp index f6aaa4e4712..3ade1da4a19 100644 --- a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp @@ -76,17 +76,16 @@ public: uiShieldBashTimer = 8000; } - void WaypointReached(uint32 uiI) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - if (uiI >= 65 && me->GetUnitMovementFlags() == MOVEMENTFLAG_WALKING) + if (waypointId >= 65 && me->GetUnitMovementFlags() == MOVEMENTFLAG_WALKING) me->SetWalk(false); - switch (uiI) + switch (waypointId) { case 39: SetEscortPaused(true); diff --git a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp index 88df13ffc26..bc3110878de 100644 --- a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp @@ -66,50 +66,41 @@ public: { npc_deathstalker_erlandAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { case 1: DoScriptText(SAY_START, me, player); break; - case 13: DoScriptText(SAY_LAST, me, player); player->GroupEventHappens(QUEST_ESCORTING, me); break; - case 14: DoScriptText(SAY_THANKS, me, player); break; - case 15: if (Unit* Rane = me->FindNearestCreature(NPC_RANE, 20)) DoScriptText(SAY_RANE, Rane); break; - case 16: DoScriptText(SAY_ANSWER, me); break; - case 17: DoScriptText(SAY_MOVE_QUINN, me); break; - case 24: DoScriptText(SAY_GREETINGS, me); break; - case 25: if (Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20)) DoScriptText(SAY_QUINN, Quinn); break; - case 26: DoScriptText(SAY_ON_BYE, me, NULL); break; diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/stormwind_city.cpp index 3852a1de3b0..7e5e9e3cf89 100644 --- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/stormwind_city.cpp @@ -268,9 +268,9 @@ public: } } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 14: SetEscortPaused(true); @@ -497,9 +497,9 @@ public: uiPhase = 0; } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 1: SetEscortPaused(true); diff --git a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp index ef6fccd8bde..6507ec911c0 100644 --- a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp +++ b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp @@ -106,24 +106,24 @@ public: } } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { - case 0: - if (GameObject* pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID)) - pCage->ResetDoorOrButton(); - break; - case 20: - if (Player* player = GetPlayerForEscort()) - { - me->SetFacingToObject(player); - DoScriptText(SAY_QUEST_COMPLETE, me, player); - DoScriptText(EMOTE_WHISPER, me, player); - player->GroupEventHappens(QUEST_GALENS_ESCAPE, me); - } - SetRun(true); - break; + case 0: + if (GameObject* pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID)) + pCage->ResetDoorOrButton(); + break; + case 20: + if (Player* player = GetPlayerForEscort()) + { + me->SetFacingToObject(player); + DoScriptText(SAY_QUEST_COMPLETE, me, player); + DoScriptText(EMOTE_WHISPER, me, player); + player->GroupEventHappens(QUEST_GALENS_ESCAPE, me); + } + SetRun(true); + break; } } diff --git a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp index 94b5b070992..0057c01b882 100644 --- a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp @@ -328,10 +328,11 @@ public: summoned->AI()->AttackStart(me); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - switch (i) + + switch (waypointId) { case 8: DoScriptText(SAY_WP_0, me); diff --git a/src/server/scripts/EasternKingdoms/westfall.cpp b/src/server/scripts/EasternKingdoms/westfall.cpp index c8d2afc3375..46f1526c5bf 100644 --- a/src/server/scripts/EasternKingdoms/westfall.cpp +++ b/src/server/scripts/EasternKingdoms/westfall.cpp @@ -85,9 +85,15 @@ public: { switch (uiWPHolder) { - case 7: DoScriptText(SAY_DS_DOWN_1, me); break; - case 8: DoScriptText(SAY_DS_DOWN_2, me); break; - case 9: DoScriptText(SAY_DS_DOWN_3, me); break; + case 7: + DoScriptText(SAY_DS_DOWN_1, me); + break; + case 8: + DoScriptText(SAY_DS_DOWN_2, me); + break; + case 9: + DoScriptText(SAY_DS_DOWN_3, me); + break; } } else @@ -96,16 +102,15 @@ public: uiShootTimer = 0; } - void WaypointReached(uint32 uiPoint) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - uiWPHolder = uiPoint; + uiWPHolder = waypointId; - switch (uiPoint) + switch (waypointId) { case 4: SetEquipmentSlots(false, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE, EQUIP_ID_RIFLE); @@ -226,14 +231,13 @@ public: { npc_defias_traitorAI(Creature* creature) : npc_escortAI(creature) { Reset(); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { case 35: SetRun(false); diff --git a/src/server/scripts/EasternKingdoms/wetlands.cpp b/src/server/scripts/EasternKingdoms/wetlands.cpp index e89b8fd7fba..bf28d9838a4 100644 --- a/src/server/scripts/EasternKingdoms/wetlands.cpp +++ b/src/server/scripts/EasternKingdoms/wetlands.cpp @@ -67,14 +67,13 @@ public: m_bFriendSummoned = false; } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 2: if (me->HasStealthAura()) me->RemoveAurasByType(SPELL_AURA_MOD_STEALTH); - SetRun(); me->setFaction(FACTION_ENEMY); break; diff --git a/src/server/scripts/Examples/example_escort.cpp b/src/server/scripts/Examples/example_escort.cpp index 76c4f793a42..851a32538e9 100644 --- a/src/server/scripts/Examples/example_escort.cpp +++ b/src/server/scripts/Examples/example_escort.cpp @@ -75,9 +75,9 @@ class example_escort : public CreatureScript } // Pure Virtual Functions (Have to be implemented) - void WaypointReached(uint32 uiWP) + void WaypointReached(uint32 waypointId) { - switch (uiWP) + switch (waypointId) { case 1: DoScriptText(SAY_WP_1, me); diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp index 20f738c95ed..a86b2b8b17a 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp @@ -236,9 +236,9 @@ public: Start(false, false, 0); } - void WaypointReached(uint32 uiPoint) + void WaypointReached(uint32 waypointId) { - switch (uiPoint) + switch (waypointId) { case 4: SetEscortPaused(true); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index ae1b0ba0c67..68a81b65d4c 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -115,9 +115,9 @@ public: } } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - if (i == 7 && instance) + if (waypointId == 7 && instance) { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index a2625861f05..2a7a3a4c8bc 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -644,7 +644,11 @@ public: DoMeleeAttackIfReady(); } - void WaypointReached(uint32 /*i*/){} + + void WaypointReached(uint32 /*waypointId*/) + { + + } }; }; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index dbcfbc8ed58..77326b5cbc7 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -111,9 +111,9 @@ public: } } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - if (i == 7 && instance) + if (waypointId == 7 && instance) { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) @@ -241,7 +241,7 @@ public: { } - void WaypointReached(uint32 /*i*/) + void WaypointReached(uint32 /*waypointId*/) { } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index e58f9c3bf45..a30eb440e74 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -103,9 +103,9 @@ public: } } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - if (i == 7 && instance) + if (waypointId == 7 && instance) { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp index 7e628c0efa5..40ff7741857 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp @@ -105,9 +105,9 @@ public: } } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - if (i == 7 && instance) + if (waypointId == 7 && instance) { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index f36aa19a7be..115aa3b6445 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -980,9 +980,9 @@ void hyjalAI::RespawnNearPos(float x, float y) cell.Visit(p, obj_worker, *me->GetMap(), *me, me->GetGridActivationRange()); } -void hyjalAI::WaypointReached(uint32 i) +void hyjalAI::WaypointReached(uint32 waypointId) { - if (i == 1 || (i == 0 && me->GetEntry() == THRALL)) + if (waypointId == 1 || (waypointId == 0 && me->GetEntry() == THRALL)) { me->MonsterYell(YELL_HURRY, 0, 0); WaitForTeleport = true; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h index 6abd5dd7e03..b32288ca43a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h @@ -196,7 +196,7 @@ struct hyjalAI : public npc_escortAI void SummonedCreatureDespawn(Creature* summoned); void HideNearPos(float x, float y); void RespawnNearPos(float x, float y); - void WaypointReached(uint32 i); + void WaypointReached(uint32 waypointId); void DoOverrun(uint32 faction, const uint32 diff); void MoveInLineOfSight(Unit* who); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index 23a04bece09..011dbd32af3 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -425,9 +425,9 @@ public: void EnterCombat(Unit* /*who*/) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - if (i == 0 && instance && !IsOverrun) + if (waypointId == 0 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { @@ -550,22 +550,24 @@ public: KnockDownTimer = 10000; } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - if (i == 7 && instance && !IsOverrun) + if (waypointId == 7 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); - }else{ + } + else + { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } } - if (i == LastOverronPos && IsOverrun) + if (waypointId == LastOverronPos && IsOverrun) { if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21)) { @@ -652,22 +654,24 @@ public: RandomMove = false; } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - if (i == 7 && instance && !IsOverrun) + if (waypointId == 7 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); - }else{ + } + else + { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } } - if (i == LastOverronPos && IsOverrun) + if (waypointId == LastOverronPos && IsOverrun) { me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACK_UNARMED); if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21)) @@ -675,7 +679,6 @@ public: me->setDeathState(DEAD); me->RemoveCorpse(); } - } } @@ -770,16 +773,18 @@ public: summons.Despawn(summon); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - if (i == 7 && instance && !IsOverrun) + if (waypointId == 7 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); - }else{ + } + else + { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); @@ -888,16 +893,18 @@ public: ShellTimer = 50000+rand()%10000; } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - if (i == 7 && instance && !IsOverrun) + if (waypointId == 7 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); - }else{ + } + else + { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); @@ -987,16 +994,18 @@ public: WebTimer = 20000+rand()%5000; } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - if (i == 7 && instance && !IsOverrun) + if (waypointId == 7 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); - }else{ + } + else + { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); @@ -1077,16 +1086,18 @@ public: ManaBurnTimer = 9000+rand()%5000; } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - if (i == 7 && instance && !IsOverrun) + if (waypointId == 7 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); - }else{ + } + else + { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); @@ -1170,9 +1181,9 @@ public: me->SetDisableGravity(true); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - if (i == 2 && instance && !IsOverrun) + if (waypointId == 2 && instance && !IsOverrun) { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) @@ -1289,9 +1300,9 @@ public: me->SetDisableGravity(true); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - if (i == 2 && instance && !IsOverrun) + if (waypointId == 2 && instance && !IsOverrun) { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp index e891f00ea36..6454083e424 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp @@ -446,9 +446,9 @@ public: ++uiStep; } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 0: case 1: diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp index 195e402e7a0..d9cdccf2291 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp @@ -296,12 +296,12 @@ public: bool LowHp; bool HadMount; - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { if (!instance) return; - switch (i) + switch (waypointId) { case 8: SetRun(false); @@ -433,7 +433,6 @@ public: //trigger epoch Yell("Thrall! Come outside and face your fate! ....") //from here, thrall should not never be allowed to move to point 106 which he currently does. break; - case 106: { //trigger taretha to run down outside @@ -631,9 +630,9 @@ public: InstanceScript* instance; - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { case 6: DoScriptText(SAY_TA_FREE, me); @@ -643,6 +642,7 @@ public: break; } } + void Reset() {} void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp index 789e7096433..43e3fe6efdd 100644 --- a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp +++ b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp @@ -72,55 +72,54 @@ public: { npc_willixAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { - case 3: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - DoScriptText(SAY_POINT, me, player); - break; - case 4: - me->SummonCreature(ENTRY_BOAR, 2137.66f, 1843.98f, 48.08f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 8: - DoScriptText(SAY_BLUELEAF, me, player); - break; - case 9: - DoScriptText(SAY_DANGER, me, player); - break; - case 13: - DoScriptText(SAY_BAD, me, player); - break; - case 14: - me->SummonCreature(ENTRY_BOAR, 2078.91f, 1704.54f, 56.77f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 25: - DoScriptText(SAY_THINK, me, player); - break; - case 31: - DoScriptText(SAY_SOON, me, player); - break; - case 42: - DoScriptText(SAY_FINALY, me, player); - break; - case 43: - me->SummonCreature(ENTRY_BOAR, 1956.43f, 1596.97f, 81.75f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 45: - DoScriptText(SAY_WIN, me, player); - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - if (player->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER, me); - break; - case 46: - DoScriptText(SAY_END, me, player); - break; + case 3: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + DoScriptText(SAY_POINT, me, player); + break; + case 4: + me->SummonCreature(ENTRY_BOAR, 2137.66f, 1843.98f, 48.08f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 8: + DoScriptText(SAY_BLUELEAF, me, player); + break; + case 9: + DoScriptText(SAY_DANGER, me, player); + break; + case 13: + DoScriptText(SAY_BAD, me, player); + break; + case 14: + me->SummonCreature(ENTRY_BOAR, 2078.91f, 1704.54f, 56.77f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 25: + DoScriptText(SAY_THINK, me, player); + break; + case 31: + DoScriptText(SAY_SOON, me, player); + break; + case 42: + DoScriptText(SAY_FINALY, me, player); + break; + case 43: + me->SummonCreature(ENTRY_BOAR, 1956.43f, 1596.97f, 81.75f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 45: + DoScriptText(SAY_WIN, me, player); + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + if (player->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER, me); + break; + case 46: + DoScriptText(SAY_END, me, player); + break; } } diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp index cabddc3b6d9..7e93cc7e4c7 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp +++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp @@ -151,35 +151,35 @@ public: uint32 eventProgress; InstanceScript* instance; - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { if (!instance) return; - switch (i) + switch (waypointId) { case 4: eventProgress = 1; currentEvent = TYPE_NARALEX_PART1; instance->SetData(TYPE_NARALEX_PART1, IN_PROGRESS); - break; + break; case 5: DoScriptText(SAY_MUST_CONTINUE, me); instance->SetData(TYPE_NARALEX_PART1, DONE); - break; + break; case 11: eventProgress = 1; currentEvent = TYPE_NARALEX_PART2; instance->SetData(TYPE_NARALEX_PART2, IN_PROGRESS); - break; + break; case 19: DoScriptText(SAY_BEYOND_THIS_CORRIDOR, me); - break; + break; case 24: eventProgress = 1; currentEvent = TYPE_NARALEX_PART3; instance->SetData(TYPE_NARALEX_PART3, IN_PROGRESS); - break; + break; } } diff --git a/src/server/scripts/Kalimdor/ashenvale.cpp b/src/server/scripts/Kalimdor/ashenvale.cpp index 08b9778cf49..ff4f90672fc 100644 --- a/src/server/scripts/Kalimdor/ashenvale.cpp +++ b/src/server/scripts/Kalimdor/ashenvale.cpp @@ -76,35 +76,34 @@ class npc_torek : public CreatureScript uint32 Thunderclap_Timer; bool Completed; - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { - case 1: - Talk(SAY_MOVE, player->GetGUID()); - break; - case 8: - Talk(SAY_PREPARE, player->GetGUID()); - break; - case 19: - //TODO: verify location and creatures amount. - me->SummonCreature(ENTRY_DURIEL, 1776.73f, -2049.06f, 109.83f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - me->SummonCreature(ENTRY_SILVERWING_SENTINEL, 1774.64f, -2049.41f, 109.83f, 1.40f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - me->SummonCreature(ENTRY_SILVERWING_WARRIOR, 1778.73f, -2049.50f, 109.83f, 1.67f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 20: - DoScriptText(SAY_WIN, me, player); - Completed = true; - player->GroupEventHappens(QUEST_TOREK_ASSULT, me); - break; - case 21: - Talk(SAY_END, player->GetGUID()); - break; + case 1: + Talk(SAY_MOVE, player->GetGUID()); + break; + case 8: + Talk(SAY_PREPARE, player->GetGUID()); + break; + case 19: + //TODO: verify location and creatures amount. + me->SummonCreature(ENTRY_DURIEL, 1776.73f, -2049.06f, 109.83f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(ENTRY_SILVERWING_SENTINEL, 1774.64f, -2049.41f, 109.83f, 1.40f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(ENTRY_SILVERWING_WARRIOR, 1778.73f, -2049.50f, 109.83f, 1.67f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 20: + DoScriptText(SAY_WIN, me, player); + Completed = true; + player->GroupEventHappens(QUEST_TOREK_ASSULT, me); + break; + case 21: + Talk(SAY_END, player->GetGUID()); + break; } } @@ -182,32 +181,29 @@ class npc_ruul_snowhoof : public CreatureScript { npc_ruul_snowhoofAI(Creature* creature) : npc_escortAI(creature) { } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); if (!player) return; - switch (i) + switch (waypointId) { case 0: me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) Cage->SetGoState(GO_STATE_ACTIVE); break; - case 13: me->SummonCreature(3922, 3449.218018f, -587.825073f, 174.978867f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); me->SummonCreature(3921, 3446.384521f, -587.830872f, 175.186279f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); me->SummonCreature(3926, 3444.218994f, -587.835327f, 175.380600f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); break; - case 19: me->SummonCreature(3922, 3508.344482f, -492.024261f, 186.929031f, 4.145029f, TEMPSUMMON_DEAD_DESPAWN, 60000); me->SummonCreature(3921, 3506.265625f, -490.531006f, 186.740128f, 4.239277f, TEMPSUMMON_DEAD_DESPAWN, 60000); me->SummonCreature(3926, 3503.682373f, -489.393799f, 186.629684f, 4.349232f, TEMPSUMMON_DEAD_DESPAWN, 60000); break; - case 21: player->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, me); break; @@ -316,17 +312,19 @@ class npc_muglash : public CreatureScript summoned->AI()->AttackStart(me); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - switch (i) + switch (waypointId) { case 0: - DoScriptText(SAY_MUG_START2, me, player); + if (player) + DoScriptText(SAY_MUG_START2, me, player); break; case 24: - DoScriptText(SAY_MUG_BRAZIER, me, player); + if (player) + DoScriptText(SAY_MUG_BRAZIER, me, player); if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_NAGA_BRAZIER, INTERACTION_DISTANCE*2)) { diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp index 258e4d259fc..dfb1f3b0bdf 100644 --- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/azuremyst_isle.cpp @@ -374,29 +374,28 @@ public: { npc_magwinAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { - case 0: - DoScriptText(SAY_START, me, player); - break; - case 17: - DoScriptText(SAY_PROGRESS, me, player); - break; - case 28: - DoScriptText(SAY_END1, me, player); - break; - case 29: - DoScriptText(EMOTE_HUG, me, player); - DoScriptText(SAY_END2, me, player); - player->GroupEventHappens(QUEST_A_CRY_FOR_SAY_HELP, me); - break; + case 0: + DoScriptText(SAY_START, me, player); + break; + case 17: + DoScriptText(SAY_PROGRESS, me, player); + break; + case 28: + DoScriptText(SAY_END1, me, player); + break; + case 29: + DoScriptText(EMOTE_HUG, me, player); + DoScriptText(SAY_END2, me, player); + player->GroupEventHappens(QUEST_A_CRY_FOR_SAY_HELP, me); + break; } } diff --git a/src/server/scripts/Kalimdor/darkshore.cpp b/src/server/scripts/Kalimdor/darkshore.cpp index a4c8ce3b004..1de04db61c4 100644 --- a/src/server/scripts/Kalimdor/darkshore.cpp +++ b/src/server/scripts/Kalimdor/darkshore.cpp @@ -231,13 +231,13 @@ public: { npc_prospector_remtravelAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); if (!player) return; - switch (i) + switch (waypointId) { case 0: DoScriptText(SAY_REM_START, me, player); diff --git a/src/server/scripts/Kalimdor/desolace.cpp b/src/server/scripts/Kalimdor/desolace.cpp index fa337a9cf3c..f295d7626ac 100644 --- a/src/server/scripts/Kalimdor/desolace.cpp +++ b/src/server/scripts/Kalimdor/desolace.cpp @@ -228,10 +228,11 @@ public: { npc_dalindaAI(Creature* creature) : npc_escortAI(creature) { } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - switch (i) + + switch (waypointId) { case 1: me->IsStandState(); diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp index 04c4d2922f1..4a1b67ba477 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp @@ -607,49 +607,48 @@ public: { npc_stinkyAI(Creature* creature) : npc_escortAI(creature) { } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); if (!player) return; - switch (i) + switch (waypointId) { - case 7: - DoScriptText(SAY_STAY_1, me, player); - break; - case 11: - DoScriptText(SAY_STAY_2, me, player); - break; - case 25: - DoScriptText(SAY_STAY_3, me, player); - break; - case 26: - DoScriptText(SAY_STAY_4, me, player); - break; - case 27: - DoScriptText(SAY_STAY_5, me, player); - break; - case 28: - DoScriptText(SAY_STAY_6, me, player); - me->SetStandState(UNIT_STAND_STATE_KNEEL); - break; - case 29: - me->SetStandState(UNIT_STAND_STATE_STAND); - break; - case 37: - DoScriptText(SAY_QUEST_COMPLETE, me, player); - me->SetSpeed(MOVE_RUN, 1.2f, true); - me->SetWalk(false); - if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H)) - player->GroupEventHappens(QUEST_STINKYS_ESCAPE_H, me); - if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A)) - player->GroupEventHappens(QUEST_STINKYS_ESCAPE_A, me); - break; - case 39: - DoScriptText(EMOTE_DISAPPEAR, me); - break; - + case 7: + DoScriptText(SAY_STAY_1, me, player); + break; + case 11: + DoScriptText(SAY_STAY_2, me, player); + break; + case 25: + DoScriptText(SAY_STAY_3, me, player); + break; + case 26: + DoScriptText(SAY_STAY_4, me, player); + break; + case 27: + DoScriptText(SAY_STAY_5, me, player); + break; + case 28: + DoScriptText(SAY_STAY_6, me, player); + me->SetStandState(UNIT_STAND_STATE_KNEEL); + break; + case 29: + me->SetStandState(UNIT_STAND_STATE_STAND); + break; + case 37: + DoScriptText(SAY_QUEST_COMPLETE, me, player); + me->SetSpeed(MOVE_RUN, 1.2f, true); + me->SetWalk(false); + if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H)) + player->GroupEventHappens(QUEST_STINKYS_ESCAPE_H, me); + if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A)) + player->GroupEventHappens(QUEST_STINKYS_ESCAPE_A, me); + break; + case 39: + DoScriptText(EMOTE_DISAPPEAR, me); + break; } } diff --git a/src/server/scripts/Kalimdor/feralas.cpp b/src/server/scripts/Kalimdor/feralas.cpp index 01193b66e30..480b94d6767 100644 --- a/src/server/scripts/Kalimdor/feralas.cpp +++ b/src/server/scripts/Kalimdor/feralas.cpp @@ -124,9 +124,9 @@ public: { npc_oox22feAI(Creature* creature) : npc_escortAI(creature) { } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { // First Ambush(3 Yetis) case 11: diff --git a/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/moonglade.cpp index 6e5ead0a870..08f5b2aa592 100644 --- a/src/server/scripts/Kalimdor/moonglade.cpp +++ b/src/server/scripts/Kalimdor/moonglade.cpp @@ -537,9 +537,9 @@ public: } else if (Event_onWait) Event_Timer -= diff; } - void WaypointReached(uint32 id) + void WaypointReached(uint32 waypointId) { - CurrWP = id; + CurrWP = waypointId; Event_Timer = 0; Step = 0; Event_onWait = true; diff --git a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp index e887f076e29..635bb50509e 100644 --- a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp +++ b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp @@ -114,14 +114,13 @@ public: { npc_kaya_flathoofAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { case 16: DoScriptText(SAY_AMBUSH, me); @@ -129,7 +128,6 @@ public: me->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85f, -503.77f, -45.90f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); me->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37f, -496.23f, -45.71f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break; - case 18: me->SetInFront(player); DoScriptText(SAY_END, me, player); diff --git a/src/server/scripts/Kalimdor/tanaris.cpp b/src/server/scripts/Kalimdor/tanaris.cpp index 204668b086d..da0e0e738cf 100644 --- a/src/server/scripts/Kalimdor/tanaris.cpp +++ b/src/server/scripts/Kalimdor/tanaris.cpp @@ -172,31 +172,65 @@ public: { npc_custodian_of_timeAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); if (!player) return; - switch (i) + switch (waypointId) { - case 0: DoScriptText(WHISPER_CUSTODIAN_1, me, player); break; - case 1: DoScriptText(WHISPER_CUSTODIAN_2, me, player); break; - case 2: DoScriptText(WHISPER_CUSTODIAN_3, me, player); break; - case 3: DoScriptText(WHISPER_CUSTODIAN_4, me, player); break; - case 5: DoScriptText(WHISPER_CUSTODIAN_5, me, player); break; - case 6: DoScriptText(WHISPER_CUSTODIAN_6, me, player); break; - case 7: DoScriptText(WHISPER_CUSTODIAN_7, me, player); break; - case 8: DoScriptText(WHISPER_CUSTODIAN_8, me, player); break; - case 9: DoScriptText(WHISPER_CUSTODIAN_9, me, player); break; - case 10: DoScriptText(WHISPER_CUSTODIAN_4, me, player); break; - case 13: DoScriptText(WHISPER_CUSTODIAN_10, me, player); break; - case 14: DoScriptText(WHISPER_CUSTODIAN_4, me, player); break; - case 16: DoScriptText(WHISPER_CUSTODIAN_11, me, player); break; - case 17: DoScriptText(WHISPER_CUSTODIAN_12, me, player); break; - case 18: DoScriptText(WHISPER_CUSTODIAN_4, me, player); break; - case 22: DoScriptText(WHISPER_CUSTODIAN_13, me, player); break; - case 23: DoScriptText(WHISPER_CUSTODIAN_4, me, player); break; + case 0: + DoScriptText(WHISPER_CUSTODIAN_1, me, player); + break; + case 1: + DoScriptText(WHISPER_CUSTODIAN_2, me, player); + break; + case 2: + DoScriptText(WHISPER_CUSTODIAN_3, me, player); + break; + case 3: + DoScriptText(WHISPER_CUSTODIAN_4, me, player); + break; + case 5: + DoScriptText(WHISPER_CUSTODIAN_5, me, player); + break; + case 6: + DoScriptText(WHISPER_CUSTODIAN_6, me, player); + break; + case 7: + DoScriptText(WHISPER_CUSTODIAN_7, me, player); + break; + case 8: + DoScriptText(WHISPER_CUSTODIAN_8, me, player); + break; + case 9: + DoScriptText(WHISPER_CUSTODIAN_9, me, player); + break; + case 10: + DoScriptText(WHISPER_CUSTODIAN_4, me, player); + break; + case 13: + DoScriptText(WHISPER_CUSTODIAN_10, me, player); + break; + case 14: + DoScriptText(WHISPER_CUSTODIAN_4, me, player); + break; + case 16: + DoScriptText(WHISPER_CUSTODIAN_11, me, player); + break; + case 17: + DoScriptText(WHISPER_CUSTODIAN_12, me, player); + break; + case 18: + DoScriptText(WHISPER_CUSTODIAN_4, me, player); + break; + case 22: + DoScriptText(WHISPER_CUSTODIAN_13, me, player); + break; + case 23: + DoScriptText(WHISPER_CUSTODIAN_4, me, player); + break; case 24: DoScriptText(WHISPER_CUSTODIAN_14, me, player); DoCast(player, 34883); @@ -428,14 +462,13 @@ public: { npc_OOX17AI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { case 23: me->SummonCreature(SPAWN_FIRST, -8350.96f, -4445.79f, 10.10f, 6.20f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); @@ -443,7 +476,6 @@ public: me->SummonCreature(SPAWN_FIRST, -8353.96f, -4442.79f, 10.10f, 6.08f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); DoScriptText(SAY_OOX_AMBUSH, me); break; - case 56: me->SummonCreature(SPAWN_SECOND_1, -7510.07f, -4795.50f, 9.35f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(SPAWN_SECOND_2, -7515.07f, -4797.50f, 9.35f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); @@ -452,7 +484,6 @@ public: if (Unit* scoff = me->FindNearestCreature(SPAWN_SECOND_2, 30)) DoScriptText(SAY_OOX17_AMBUSH_REPLY, scoff); break; - case 86: DoScriptText(SAY_OOX_END, me); player->GroupEventHappens(Q_OOX17, me); diff --git a/src/server/scripts/Kalimdor/the_barrens.cpp b/src/server/scripts/Kalimdor/the_barrens.cpp index 27f3f1fd52b..c56991e2553 100644 --- a/src/server/scripts/Kalimdor/the_barrens.cpp +++ b/src/server/scripts/Kalimdor/the_barrens.cpp @@ -127,14 +127,13 @@ public: void Reset() { } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (uiPointId) + switch (waypointId) { case 16: DoScriptText(SAY_GIL_AT_LAST, me, player); @@ -593,26 +592,26 @@ public: } } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { - case 0: - DoScriptText(SAY_STARTUP1, me); - break; - case 9: - SetRun(false); - break; - case 17: - if (Creature* temp = me->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) - { - DoScriptText(SAY_MERCENARY, temp); - me->SummonCreature(NPC_MERCENARY, 1160.172f, -2980.168f, 97.313f, 3.690f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - } - break; - case 24: - m_bIsPostEvent = true; - break; + case 0: + DoScriptText(SAY_STARTUP1, me); + break; + case 9: + SetRun(false); + break; + case 17: + if (Creature* temp = me->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + { + DoScriptText(SAY_MERCENARY, temp); + me->SummonCreature(NPC_MERCENARY, 1160.172f, -2980.168f, 97.313f, 3.690f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + } + break; + case 24: + m_bIsPostEvent = true; + break; } } diff --git a/src/server/scripts/Kalimdor/thousand_needles.cpp b/src/server/scripts/Kalimdor/thousand_needles.cpp index 4c7c717c7e2..5b77b8dc2c0 100644 --- a/src/server/scripts/Kalimdor/thousand_needles.cpp +++ b/src/server/scripts/Kalimdor/thousand_needles.cpp @@ -75,9 +75,9 @@ public: void Reset() { } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 0: DoScriptText(SAY_KAN_START, me); @@ -166,9 +166,9 @@ public: void Reset() { } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 8: DoScriptText(SAY_LAKO_LOOK_OUT, me); @@ -251,9 +251,9 @@ public: void Reset() { } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 15: DoScriptText(SAY_WYVERN, me); diff --git a/src/server/scripts/Kalimdor/ungoro_crater.cpp b/src/server/scripts/Kalimdor/ungoro_crater.cpp index 2ca932de169..232dba404e0 100644 --- a/src/server/scripts/Kalimdor/ungoro_crater.cpp +++ b/src/server/scripts/Kalimdor/ungoro_crater.cpp @@ -78,14 +78,13 @@ public: uint32 DEMORALIZINGSHOUT_Timer; - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { case 19: me->SummonCreature(ENTRY_STOMPER, -6391.69f, -1730.49f, -272.83f, 4.96f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp index f41522f844d..b2cf755c7af 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp @@ -227,9 +227,9 @@ class npc_onyx_flamecaller : public CreatureScript zarithrian->AI()->JustSummoned(me); } - void WaypointReached(uint32 pointId) + void WaypointReached(uint32 waypointId) { - if (pointId == MAX_PATH_FLAMECALLER_WAYPOINTS || pointId == MAX_PATH_FLAMECALLER_WAYPOINTS*2) + if (waypointId == MAX_PATH_FLAMECALLER_WAYPOINTS || waypointId == MAX_PATH_FLAMECALLER_WAYPOINTS*2) { DoZoneInCombat(); SetEscortPaused(true); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp index 19ed96e8885..d4d1d8c8b4b 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp @@ -447,9 +447,9 @@ public: uint8 uiWaypoint; - void WaypointReached(uint32 uiPoint) + void WaypointReached(uint32 waypointId) { - if (uiPoint == 0) + if (waypointId == 0) { switch (uiWaypoint) { diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp index 0848d1e9524..9768b50b214 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp @@ -356,7 +356,7 @@ public: Start(false, true, 0, NULL); } - void WaypointReached(uint32 /*i*/) + void WaypointReached(uint32 /*waypointId*/) { } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp index 7c82454ba87..18c972b966c 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -203,17 +203,19 @@ public: Start(false, true, 0, NULL); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - switch (i) + if (!instance) + return; + + switch (waypointId) { case 2: - if (instance && (uiWaypointPath == 3 || uiWaypointPath == 2)) + if (uiWaypointPath == 3 || uiWaypointPath == 2) instance->SetData(DATA_MOVEMENT_DONE, instance->GetData(DATA_MOVEMENT_DONE)+1); break; case 3: - if (instance) - instance->SetData(DATA_MOVEMENT_DONE, instance->GetData(DATA_MOVEMENT_DONE)+1); + instance->SetData(DATA_MOVEMENT_DONE, instance->GetData(DATA_MOVEMENT_DONE)+1); break; } } diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 9e889bb9941..ac5520b025a 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -963,8 +963,9 @@ public: // we dont do melee damage! } - void WaypointReached(uint32 /*i*/) + void WaypointReached(uint32 /*waypointId*/) { + } private: diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp index cba123e6efc..a608de5fcf3 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp @@ -346,9 +346,9 @@ public: lDwarfGUIDList.clear(); } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 7: if (Creature* creature = GetClosestCreatureWithEntry(me, CREATURE_TRIBUNAL_OF_THE_AGES, 100.0f)) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 5f4f8dfde9d..fe221465ca0 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -964,8 +964,9 @@ public: me->SetReactState(REACT_PASSIVE); } - void WaypointReached(uint32 /*i*/) + void WaypointReached(uint32 /*waypointId*/) { + } void Reset() diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp index 0ca9ca84b57..1736861fdc6 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp @@ -447,32 +447,32 @@ public: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } - void WaypointReached(uint32 uiWPointId) + void WaypointReached(uint32 waypointId) { switch (uiBoss) { case 1: - if (uiWPointId == 2) + if (waypointId == 2) FinishPointReached(); break; case 2: - if (uiWPointId == 2) + if (waypointId == 2) FinishPointReached(); break; case 3: - if (uiWPointId == 1) + if (waypointId == 1) FinishPointReached(); break; case 4: - if (uiWPointId == 0) + if (waypointId == 0) FinishPointReached(); break; case 5: - if (uiWPointId == 0) + if (waypointId == 0) FinishPointReached(); break; case 6: - if (uiWPointId == 4) + if (waypointId == 4) FinishPointReached(); break; } @@ -690,32 +690,32 @@ struct violet_hold_trashAI : public npc_escortAI uint32 portalLocationID; uint32 secondPortalRouteID; - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { switch (portalLocationID) { case 0: - if (uiPointId == 5) + if (waypointId == 5) CreatureStartAttackDoor(); break; case 1: - if ((uiPointId == 8 && secondPortalRouteID == 0) || (uiPointId == 7 && secondPortalRouteID == 1)) + if ((waypointId == 8 && secondPortalRouteID == 0) || (waypointId == 7 && secondPortalRouteID == 1)) CreatureStartAttackDoor(); break; case 2: - if (uiPointId == 7) + if (waypointId == 7) CreatureStartAttackDoor(); break; case 3: - if (uiPointId == 8) + if (waypointId == 8) CreatureStartAttackDoor(); break; case 4: - if (uiPointId == 5) + if (waypointId == 5) CreatureStartAttackDoor(); break; case 5: - if (uiPointId == 3) + if (waypointId == 3) CreatureStartAttackDoor(); break; } diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index 6c1b5ca36d2..17cd3ac0c09 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -716,9 +716,9 @@ public: } } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { case 0: IntroPhase = 1; @@ -1012,13 +1012,13 @@ public: uiPhaseTimer = 0; } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); if (!player) return; - switch (uiPointId) + switch (waypointId) { case 3: SetEscortPaused(true); @@ -1038,7 +1038,6 @@ public: } me->SetWalk(false); break; - case 4: SetEscortPaused(true); uiPhase = 7; @@ -1851,34 +1850,33 @@ public: player->FailQuest(QUEST_ESCAPING_THE_MIST); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { - case 10: - me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); - DoScriptText(SAY_2, me); - break; - case 12: - DoScriptText(SAY_3, me); - me->HandleEmoteCommand(EMOTE_ONESHOT_LOOT); - break; - case 16: - DoScriptText(SAY_4, me); - me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); - break; - case 20: - me->SetPhaseMask(1, true); - DoScriptText(SAY_5, me); - me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); - player->GroupEventHappens(QUEST_ESCAPING_THE_MIST, me); - SetRun(true); - break; + case 10: + me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); + DoScriptText(SAY_2, me); + break; + case 12: + DoScriptText(SAY_3, me); + me->HandleEmoteCommand(EMOTE_ONESHOT_LOOT); + break; + case 16: + DoScriptText(SAY_4, me); + me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); + break; + case 20: + me->SetPhaseMask(1, true); + DoScriptText(SAY_5, me); + me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); + player->GroupEventHappens(QUEST_ESCAPING_THE_MIST, me); + SetRun(true); + break; } } }; @@ -1951,14 +1949,13 @@ public: else Bonker_agro=0; } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { case 29: player->GroupEventHappens(QUEST_GET_ME_OUTA_HERE, me); diff --git a/src/server/scripts/Northrend/grizzly_hills.cpp b/src/server/scripts/Northrend/grizzly_hills.cpp index 07fb398ff8a..2da84dd3fdb 100644 --- a/src/server/scripts/Northrend/grizzly_hills.cpp +++ b/src/server/scripts/Northrend/grizzly_hills.cpp @@ -74,13 +74,13 @@ public: summoned->AI()->AttackStart(me->getVictim()); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); if (!player) return; - switch (i) + switch (waypointId) { case 9: if (Creature* Mrfloppy = GetClosestCreatureWithEntry(me, NPC_MRFLOPPY, 100.0f)) diff --git a/src/server/scripts/Northrend/howling_fjord.cpp b/src/server/scripts/Northrend/howling_fjord.cpp index 86fc4a50b6c..88cc297868b 100644 --- a/src/server/scripts/Northrend/howling_fjord.cpp +++ b/src/server/scripts/Northrend/howling_fjord.cpp @@ -97,13 +97,13 @@ public: DoMeleeAttackIfReady(); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); if (!player) return; - switch (i) + switch (waypointId) { case 1: me->SetReactState(REACT_AGGRESSIVE); diff --git a/src/server/scripts/Northrend/sholazar_basin.cpp b/src/server/scripts/Northrend/sholazar_basin.cpp index afc742c9f7e..37c0e9fc976 100644 --- a/src/server/scripts/Northrend/sholazar_basin.cpp +++ b/src/server/scripts/Northrend/sholazar_basin.cpp @@ -70,39 +70,40 @@ public: } } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { - case 1: SetRun(); break; - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING); - me->SetSpeed(MOVE_SWIM, 0.85f, true); - me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_DISABLE_GRAVITY); - break; - case 19: - me->SetUnitMovementFlags(MOVEMENTFLAG_FALLING); - break; - case 28: - player->GroupEventHappens(QUEST_FORTUNATE_MISUNDERSTANDINGS, me); - // me->RestoreFaction(); - DoScriptText(SAY_END_IRO, me); - SetRun(false); - break; + case 1: + SetRun(); + break; + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + me->RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING); + me->SetSpeed(MOVE_SWIM, 0.85f, true); + me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_DISABLE_GRAVITY); + break; + case 19: + me->SetUnitMovementFlags(MOVEMENTFLAG_FALLING); + break; + case 28: + player->GroupEventHappens(QUEST_FORTUNATE_MISUNDERSTANDINGS, me); + // me->RestoreFaction(); + DoScriptText(SAY_END_IRO, me); + SetRun(false); + break; } } @@ -359,10 +360,11 @@ public: uint32 m_uiChatTimer; - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - switch (i) + + switch (waypointId) { case 0: DoScriptText(SAY_WP_2, me); diff --git a/src/server/scripts/Northrend/storm_peaks.cpp b/src/server/scripts/Northrend/storm_peaks.cpp index 8253e2615cf..3560774ce0d 100644 --- a/src/server/scripts/Northrend/storm_peaks.cpp +++ b/src/server/scripts/Northrend/storm_peaks.cpp @@ -374,18 +374,17 @@ public: { npc_injured_goblinAI(Creature* creature) : npc_escortAI(creature) { } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); if (!player) return; - switch (i) + switch (waypointId) { case 26: DoScriptText(SAY_END_WP_REACHED, me, player); break; - case 27: player->GroupEventHappens(QUEST_BITTER_DEPARTURE, me); break; @@ -672,7 +671,7 @@ public: } } - void WaypointReached(uint32 /*wp*/) + void WaypointReached(uint32 /*waypointId*/) { } diff --git a/src/server/scripts/Northrend/zuldrak.cpp b/src/server/scripts/Northrend/zuldrak.cpp index f0e8ce9b2c1..369f47cfb1c 100644 --- a/src/server/scripts/Northrend/zuldrak.cpp +++ b/src/server/scripts/Northrend/zuldrak.cpp @@ -740,9 +740,9 @@ public: bEnrage = false; } - void WaypointReached(uint32 uiI) + void WaypointReached(uint32 waypointId) { - switch (uiI) + switch (waypointId) { case 6: me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0); @@ -934,9 +934,9 @@ public: bThunderClap = false; } - void WaypointReached(uint32 uiI) + void WaypointReached(uint32 waypointId) { - switch (uiI) + switch (waypointId) { case 7: me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp index 8fd1b163ce3..784adad166c 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp @@ -102,7 +102,7 @@ public: npc_escortAI::MoveInLineOfSight(who); } - void WaypointReached(uint32 /*i*/) + void WaypointReached(uint32 /*waypointId*/) { } diff --git a/src/server/scripts/Outland/hellfire_peninsula.cpp b/src/server/scripts/Outland/hellfire_peninsula.cpp index 75a402a5338..b0e19f0e322 100644 --- a/src/server/scripts/Outland/hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/hellfire_peninsula.cpp @@ -180,9 +180,9 @@ public: npc_escortAI::MoveInLineOfSight(who); } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 0: DoScriptText(EMOTE_WOLF_LIFT_HEAD, me); @@ -402,38 +402,37 @@ public: { npc_wounded_blood_elfAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { - case 0: - DoScriptText(SAY_ELF_START, me, player); - break; - case 9: - DoScriptText(SAY_ELF_SUMMON1, me, player); - // Spawn two Haal'eshi Talonguard - DoSpawnCreature(16967, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - DoSpawnCreature(16967, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - break; - case 13: - DoScriptText(SAY_ELF_RESTING, me, player); - break; - case 14: - DoScriptText(SAY_ELF_SUMMON2, me, player); - // Spawn two Haal'eshi Windwalker - DoSpawnCreature(16966, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - DoSpawnCreature(16966, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - break; - case 27: - DoScriptText(SAY_ELF_COMPLETE, me, player); - // Award quest credit - player->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH, me); - break; + case 0: + DoScriptText(SAY_ELF_START, me, player); + break; + case 9: + DoScriptText(SAY_ELF_SUMMON1, me, player); + // Spawn two Haal'eshi Talonguard + DoSpawnCreature(16967, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + DoSpawnCreature(16967, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 13: + DoScriptText(SAY_ELF_RESTING, me, player); + break; + case 14: + DoScriptText(SAY_ELF_SUMMON2, me, player); + // Spawn two Haal'eshi Windwalker + DoSpawnCreature(16966, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + DoSpawnCreature(16966, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 27: + DoScriptText(SAY_ELF_COMPLETE, me, player); + // Award quest credit + player->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH, me); + break; } } diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp index 50cc1a00e47..8080a1402af 100644 --- a/src/server/scripts/Outland/nagrand.cpp +++ b/src/server/scripts/Outland/nagrand.cpp @@ -221,9 +221,9 @@ public: DoCast(me, SPELL_EARTHBIND_TOTEM, false); } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 7: DoScriptText(SAY_MAG_MORE, me); @@ -565,9 +565,9 @@ public: } } - void WaypointReached(uint32 PointId) + void WaypointReached(uint32 waypointId) { - switch(PointId) + switch (waypointId) { case 3: { diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp index dc401ac3c7a..17b9ec23f3d 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/netherstorm.cpp @@ -889,33 +889,32 @@ public: player->FailQuest(Q_ALMABTRIEB); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { case 3: //first spawn me->SummonCreature(SPAWN_FIRST, 2449.67f, 2183.11f, 96.85f, 6.20f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(SPAWN_FIRST, 2449.53f, 2184.43f, 96.36f, 6.27f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(SPAWN_FIRST, 2449.85f, 2186.34f, 97.57f, 6.08f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); break; - case 7: me->SummonCreature(SPAWN_SECOND, 2309.64f, 2186.24f, 92.25f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(SPAWN_SECOND, 2309.25f, 2183.46f, 91.75f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); break; - case 12: player->GroupEventHappens(Q_ALMABTRIEB, me); if (me->FindNearestCreature(N_THADELL, 30)) - DoScriptText(SAY_THADELL_1, me); break; + DoScriptText(SAY_THADELL_1, me); + break; case 13: if (me->FindNearestCreature(N_THADELL, 30)) - DoScriptText(SAY_THADELL_2, me, player); break; + DoScriptText(SAY_THADELL_2, me, player); + break; } } @@ -964,13 +963,13 @@ public: uiTakeTimer=3000; } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); if (!player) return; - switch (i) + switch (waypointId) { case 7: case 17: diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index 059373c6589..f9aaf87fa8a 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -1054,14 +1054,13 @@ public: m_uiHealingTimer = 0; } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (uiPointId) + switch (waypointId) { case 13: DoScriptText(SAY_WIL_PROGRESS1, me, player); diff --git a/src/server/scripts/Outland/shattrath_city.cpp b/src/server/scripts/Outland/shattrath_city.cpp index 639c0c25cf4..79cce47e16c 100644 --- a/src/server/scripts/Outland/shattrath_city.cpp +++ b/src/server/scripts/Outland/shattrath_city.cpp @@ -319,36 +319,77 @@ public: public: npc_kservantAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { - case 0: DoScriptText(SAY1, me, player); break; - case 4: DoScriptText(WHISP1, me, player); break; - case 6: DoScriptText(WHISP2, me, player); break; - case 7: DoScriptText(WHISP3, me, player); break; - case 8: DoScriptText(WHISP4, me, player); break; - case 17: DoScriptText(WHISP5, me, player); break; - case 18: DoScriptText(WHISP6, me, player); break; - case 19: DoScriptText(WHISP7, me, player); break; - case 33: DoScriptText(WHISP8, me, player); break; - case 34: DoScriptText(WHISP9, me, player); break; - case 35: DoScriptText(WHISP10, me, player); break; - case 36: DoScriptText(WHISP11, me, player); break; - case 43: DoScriptText(WHISP12, me, player); break; - case 44: DoScriptText(WHISP13, me, player); break; - case 49: DoScriptText(WHISP14, me, player); break; - case 50: DoScriptText(WHISP15, me, player); break; - case 51: DoScriptText(WHISP16, me, player); break; - case 52: DoScriptText(WHISP17, me, player); break; - case 53: DoScriptText(WHISP18, me, player); break; - case 54: DoScriptText(WHISP19, me, player); break; - case 55: DoScriptText(WHISP20, me, player); break; + case 0: + DoScriptText(SAY1, me, player); + break; + case 4: + DoScriptText(WHISP1, me, player); + break; + case 6: + DoScriptText(WHISP2, me, player); + break; + case 7: + DoScriptText(WHISP3, me, player); + break; + case 8: + DoScriptText(WHISP4, me, player); + break; + case 17: + DoScriptText(WHISP5, me, player); + break; + case 18: + DoScriptText(WHISP6, me, player); + break; + case 19: + DoScriptText(WHISP7, me, player); + break; + case 33: + DoScriptText(WHISP8, me, player); + break; + case 34: + DoScriptText(WHISP9, me, player); + break; + case 35: + DoScriptText(WHISP10, me, player); + break; + case 36: + DoScriptText(WHISP11, me, player); + break; + case 43: + DoScriptText(WHISP12, me, player); + break; + case 44: + DoScriptText(WHISP13, me, player); + break; + case 49: + DoScriptText(WHISP14, me, player); + break; + case 50: + DoScriptText(WHISP15, me, player); + break; + case 51: + DoScriptText(WHISP16, me, player); + break; + case 52: + DoScriptText(WHISP17, me, player); + break; + case 53: + DoScriptText(WHISP18, me, player); + break; + case 54: + DoScriptText(WHISP19, me, player); + break; + case 55: + DoScriptText(WHISP20, me, player); + break; case 56: DoScriptText(WHISP21, me, player); player->GroupEventHappens(10211, me); diff --git a/src/server/scripts/Outland/terokkar_forest.cpp b/src/server/scripts/Outland/terokkar_forest.cpp index 87cbf095848..b8f4be9e599 100644 --- a/src/server/scripts/Outland/terokkar_forest.cpp +++ b/src/server/scripts/Outland/terokkar_forest.cpp @@ -202,13 +202,13 @@ public: public: npc_skywingAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); if (!player) return; - switch (i) + switch (waypointId) { case 8: player->AreaExploredOrEventHappens(10898); @@ -461,32 +461,27 @@ public: { npc_isla_starmaneAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { case 0: if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10)) Cage->SetGoState(GO_STATE_ACTIVE); break; - case 2: DoScriptText(SAY_PROGRESS_1, me, player); break; - case 5: DoScriptText(SAY_PROGRESS_2, me, player); break; - case 6: DoScriptText(SAY_PROGRESS_3, me, player); break; - case 29: DoScriptText(SAY_PROGRESS_4, me, player); if (player->GetTeam() == ALLIANCE) @@ -495,11 +490,9 @@ public: player->GroupEventHappens(QUEST_EFTW_H, me); me->SetInFront(player); break; - case 30: me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break; - case 31: DoCast(me, SPELL_CAT); me->SetWalk(false); @@ -673,14 +666,13 @@ public: { npc_akunoAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { case 3: me->SummonCreature(NPC_CABAL_SKRIMISHER, -2795.99f, 5420.33f, -34.53f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); diff --git a/src/server/scripts/Outland/zangarmarsh.cpp b/src/server/scripts/Outland/zangarmarsh.cpp index 7557de9ca36..90ce070ecc7 100644 --- a/src/server/scripts/Outland/zangarmarsh.cpp +++ b/src/server/scripts/Outland/zangarmarsh.cpp @@ -322,14 +322,13 @@ public: void Reset() { } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { case 4: DoScriptText(SAY_AMBUSH1, me, player); diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index a6f68b8fb32..d3dc577175d 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1040,8 +1040,9 @@ public: } } - void WaypointReached(uint32 /*point*/) + void WaypointReached(uint32 /*waypointId*/) { + } void UpdateAI(uint32 const diff) From 022143460a3fdd734914696aac76a2b7e6ff216e Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 29 Mar 2012 11:30:37 +0200 Subject: [PATCH 0361/1149] Core/DBLayer: Fixed some crashes caused by incorrect prepared statements usage Closes #5934 --- src/server/game/Handlers/CharacterHandler.cpp | 75 +++++++++---------- src/server/game/Handlers/PetitionsHandler.cpp | 2 +- 2 files changed, 37 insertions(+), 40 deletions(-) diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 36f61665a8a..a5d5263c161 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1724,7 +1724,6 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) // Switch Languages // delete all languages first - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SKILL_LANGUAGES); stmt->setUInt32(0, lowGuid); trans->Append(stmt); @@ -1733,52 +1732,50 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_SKILL_LANGUAGE); stmt->setUInt32(0, lowGuid); - // Faction specific languages - if (team == BG_TEAM_ALLIANCE) - { - stmt->setUInt16(1, 98); - } - else if (team == BG_TEAM_HORDE) - { + if (team == BG_TEAM_HORDE) stmt->setUInt16(1, 109); - } + else + stmt->setUInt16(1, 98); trans->Append(stmt); // Race specific languages - stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_SKILL_LANGUAGE); - stmt->setUInt32(0, lowGuid); - - switch (race) + if (race != RACE_ORC && race != RACE_HUMAN) { - case RACE_DWARF: - stmt->setUInt16(1, 111); - break; - case RACE_DRAENEI: - stmt->setUInt16(1, 759); - break; - case RACE_GNOME: - stmt->setUInt16(1, 313); - break; - case RACE_NIGHTELF: - stmt->setUInt16(1, 113); - break; - case RACE_UNDEAD_PLAYER: - stmt->setUInt16(1, 673); - break; - case RACE_TAUREN: - stmt->setUInt16(1, 115); - break; - case RACE_TROLL: - stmt->setUInt16(1, 315); - break; - case RACE_BLOODELF: - stmt->setUInt16(1, 137); - break; - } + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_SKILL_LANGUAGE); + stmt->setUInt32(0, lowGuid); - trans->Append(stmt); + switch (race) + { + case RACE_DWARF: + stmt->setUInt16(1, 111); + break; + case RACE_DRAENEI: + stmt->setUInt16(1, 759); + break; + case RACE_GNOME: + stmt->setUInt16(1, 313); + break; + case RACE_NIGHTELF: + stmt->setUInt16(1, 113); + break; + case RACE_UNDEAD_PLAYER: + stmt->setUInt16(1, 673); + break; + case RACE_TAUREN: + stmt->setUInt16(1, 115); + break; + case RACE_TROLL: + stmt->setUInt16(1, 315); + break; + case RACE_BLOODELF: + stmt->setUInt16(1, 137); + break; + } + + trans->Append(stmt); + } if (recv_data.GetOpcode() == CMSG_CHAR_FACTION_CHANGE) { diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index 139fa04cd9c..7a3964b9469 100755 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -912,7 +912,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) stmt->setUInt32(0, GUID_LOPART(petitionGuid)); trans->Append(stmt); - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PETITION_SIGNATURE); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PETITION_SIGNATURE_BY_GUID); stmt->setUInt32(0, GUID_LOPART(petitionGuid)); trans->Append(stmt); From 766475ea4f0817780540a5ef89c4701aac92e461 Mon Sep 17 00:00:00 2001 From: click Date: Thu, 29 Mar 2012 14:41:55 +0200 Subject: [PATCH 0362/1149] Core/Guild: Fix guildbank tab loading after recent changes (returned value of a COUNT() is always BIGINT) --- src/server/game/Guilds/Guild.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 1c7c0872a70..889174420c6 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1838,7 +1838,7 @@ bool Guild::LoadFromDB(Field* fields) m_createdDate = time_t(fields[10].GetUInt32()); m_bankMoney = fields[11].GetUInt64(); - uint8 purchasedTabs = uint8(fields[12].GetUInt32()); + uint8 purchasedTabs = uint8(fields[12].GetUInt64()); if (purchasedTabs > GUILD_BANK_MAX_TABS) purchasedTabs = GUILD_BANK_MAX_TABS; From f80f94809c4d45cc7c4661c688984a0b724a38b3 Mon Sep 17 00:00:00 2001 From: click Date: Thu, 29 Mar 2012 15:13:19 +0200 Subject: [PATCH 0363/1149] Core/Group: Fix LoadGroupFromDB type-error --- src/server/game/Groups/Group.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index e7349f9ec10..5c459b45b5f 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -171,7 +171,7 @@ void Group::LoadGroupFromDB(Field* fields) m_lootMethod = LootMethod(fields[1].GetUInt8()); m_looterGuid = MAKE_NEW_GUID(fields[2].GetUInt32(), 0, HIGHGUID_PLAYER); - m_lootThreshold = ItemQualities(fields[3].GetUInt16()); + m_lootThreshold = ItemQualities(fields[3].GetUInt8()); for (uint8 i = 0; i < TARGETICONCOUNT; ++i) m_targetIcons[i] = fields[4+i].GetUInt32(); From 92d3548f0b292cbed964fda2357b187a6fdd80cc Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 29 Mar 2012 15:07:22 +0100 Subject: [PATCH 0364/1149] Core/DBLayer: Even more types fixes... --- src/server/game/AI/EventAI/CreatureEventAIMgr.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 4 ++-- src/server/game/Globals/ObjectMgr.cpp | 2 +- src/server/game/Groups/GroupMgr.cpp | 6 +++--- src/server/game/Reputation/ReputationMgr.cpp | 2 +- src/server/game/World/World.cpp | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp index facfbd7581c..517e55af457 100755 --- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp @@ -38,7 +38,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts() // Load EventAI Text sObjectMgr->LoadTrinityStrings("creature_ai_texts", MIN_CREATURE_AI_TEXT_STRING_ID, MAX_CREATURE_AI_TEXT_STRING_ID); - // Gather Additional data from EventAI Texts + // Gather Additional data from EventAI Texts 0 1 2 3 4 QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM creature_ai_texts"); if (!result) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 10c35a88503..135d640a2df 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5120,7 +5120,7 @@ void Player::DeleteOldCharacters(uint32 keepDays) do { Field* fields = result->Fetch(); - Player::DeleteFromDB(fields[0].GetUInt64(), fields[1].GetUInt32(), true, true); + Player::DeleteFromDB(fields[0].GetUInt32(), fields[1].GetUInt32(), true, true); } while (result->NextRow()); } @@ -17904,7 +17904,7 @@ void Player::_LoadMail() m->deliver_time = time_t(fields[8].GetUInt32()); m->money = fields[9].GetUInt32(); m->COD = fields[10].GetUInt32(); - m->checked = fields[11].GetUInt32(); + m->checked = fields[11].GetUInt8(); m->stationery = fields[12].GetUInt8(); m->mailTemplateId = fields[13].GetInt16(); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index acc30dcc2d4..bf647fa5c31 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -5317,7 +5317,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) std::map itemsCache; stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_EXPIRED_MAIL_ITEMS); - stmt->setUInt64(0, basetime); + stmt->setUInt32(0, (uint32)basetime); if (PreparedQueryResult items = CharacterDatabase.Query(stmt)) { MailItemInfo item; diff --git a/src/server/game/Groups/GroupMgr.cpp b/src/server/game/Groups/GroupMgr.cpp index 3d901f42501..a6f2f7a5f33 100644 --- a/src/server/game/Groups/GroupMgr.cpp +++ b/src/server/game/Groups/GroupMgr.cpp @@ -215,10 +215,10 @@ void GroupMgr::LoadGroups() Group* group = GetGroupByDbStoreId(fields[0].GetUInt32()); // group will never be NULL (we have run consistency sql's before loading) - MapEntry const* mapEntry = sMapStore.LookupEntry(fields[1].GetUInt32()); + MapEntry const* mapEntry = sMapStore.LookupEntry(fields[1].GetUInt16()); if (!mapEntry || !mapEntry->IsDungeon()) { - sLog->outErrorDb("Incorrect entry in group_instance table : no dungeon map %d", fields[1].GetUInt32()); + sLog->outErrorDb("Incorrect entry in group_instance table : no dungeon map %d", fields[1].GetUInt16()); continue; } @@ -229,7 +229,7 @@ void GroupMgr::LoadGroups() diff = 0; // default for both difficaly types } - InstanceSave* save = sInstanceSaveMgr->AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt64()), fields[6].GetBool(), true); + InstanceSave* save = sInstanceSaveMgr->AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt64()), (bool)fields[6].GetUInt64(), true); group->BindToInstance(save, fields[3].GetBool(), true); ++count; } diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index a9a02170e5f..94a6590cc4a 100755 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -521,7 +521,7 @@ void ReputationMgr::LoadFromDB(PreparedQueryResult result) FactionState* faction = &_factions[factionEntry->reputationListID]; // update standing to current - faction->Standing = int32(fields[1].GetUInt32()); + faction->Standing = fields[1].GetInt32(); // update counters int32 BaseRep = GetBaseReputation(factionEntry); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index a842c288c89..8a9c07a7187 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -2934,7 +2934,7 @@ void World::LoadCharacterNameData() do { - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); AddCharacterNameData(fields[0].GetUInt32(), fields[1].GetString(), fields[3].GetUInt8() /*gender*/, fields[2].GetUInt8() /*race*/, fields[4].GetUInt8() /*class*/); ++count; From af6c70cf99daa0b55e498a18712e262282111976 Mon Sep 17 00:00:00 2001 From: click Date: Thu, 29 Mar 2012 16:33:54 +0200 Subject: [PATCH 0365/1149] Core/DBlayer: ... and some more COUNT()-based type-fixing ... --- src/server/game/Accounts/AccountMgr.cpp | 4 ++-- src/server/game/Handlers/CharacterHandler.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index 240609e3821..f5ec5e1029a 100755 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -232,10 +232,10 @@ uint32 GetCharactersCount(uint32 accountId) { // check character count PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_SUM_CHARS); - stmt->setUInt32(0, accountId); + stmt->setUInt64(0, accountId); PreparedQueryResult result = CharacterDatabase.Query(stmt); - return (result) ? (*result)[0].GetUInt32() : 0; + return (result) ? (*result)[0].GetUInt64() : 0; } bool normalizeString(std::string& utf8String) diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index a5d5263c161..e5c28e406ab 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -449,7 +449,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte ASSERT(_charCreateCallback.GetParam() == createInfo); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_SUM_CHARS); - stmt->setUInt32(0, GetAccountId()); + stmt->setUInt64(0, GetAccountId()); _charCreateCallback.FreeResult(); _charCreateCallback.SetFutureResult(CharacterDatabase.AsyncQuery(stmt)); From 411699b94d3baffe6a1872910d6e0056c7272564 Mon Sep 17 00:00:00 2001 From: click Date: Thu, 29 Mar 2012 16:41:42 +0200 Subject: [PATCH 0366/1149] Core/DBLayer: Fix stupid mishap from last commit (i need glasses) - thanks nayd for poking me about it --- src/server/game/Accounts/AccountMgr.cpp | 2 +- src/server/game/Handlers/CharacterHandler.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index f5ec5e1029a..9963ade54f9 100755 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -232,7 +232,7 @@ uint32 GetCharactersCount(uint32 accountId) { // check character count PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_SUM_CHARS); - stmt->setUInt64(0, accountId); + stmt->setUInt32(0, accountId); PreparedQueryResult result = CharacterDatabase.Query(stmt); return (result) ? (*result)[0].GetUInt64() : 0; diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index e5c28e406ab..a5d5263c161 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -449,7 +449,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte ASSERT(_charCreateCallback.GetParam() == createInfo); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_SUM_CHARS); - stmt->setUInt64(0, GetAccountId()); + stmt->setUInt32(0, GetAccountId()); _charCreateCallback.FreeResult(); _charCreateCallback.SetFutureResult(CharacterDatabase.AsyncQuery(stmt)); From 5e58905aa027af2b4c085f655f471476a0c1e4d2 Mon Sep 17 00:00:00 2001 From: leak Date: Thu, 29 Mar 2012 17:43:23 +0200 Subject: [PATCH 0367/1149] Core/DBLayer: More types fixes --- src/server/game/Entities/Player/Player.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 135d640a2df..69282e92f12 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -16645,7 +16645,7 @@ void Player::_LoadEquipmentSets(PreparedQueryResult result) EquipmentSet eqSet; eqSet.Guid = fields[0].GetUInt64(); - uint32 index = fields[1].GetUInt32(); + uint8 index = fields[1].GetUInt8(); eqSet.Name = fields[2].GetString(); eqSet.IconName = fields[3].GetString(); eqSet.state = EQUIPMENT_SET_UNCHANGED; @@ -16875,7 +16875,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) uint32 transGUID = fields[30].GetUInt32(); Relocate(fields[12].GetFloat(), fields[13].GetFloat(), fields[14].GetFloat(), fields[16].GetFloat()); uint32 mapId = fields[15].GetUInt16(); - uint32 instanceId = fields[58].GetUInt8(); + uint32 instanceId = fields[58].GetUInt32(); uint32 dungeonDiff = fields[38].GetUInt8() & 0x0F; if (dungeonDiff >= MAX_DUNGEON_DIFFICULTY) @@ -17222,7 +17222,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) float bubble0 = 0.031f; //speed collect rest bonus in offline, in logout, in tavern, city (section/in hour) float bubble1 = 0.125f; - float bubble = fields[23].GetUInt32() > 0 + float bubble = fields[23].GetUInt8() > 0 ? bubble1*sWorld->getRate(RATE_REST_OFFLINE_IN_TAVERN_OR_CITY) : bubble0*sWorld->getRate(RATE_REST_OFFLINE_IN_WILDERNESS); @@ -17870,7 +17870,7 @@ void Player::_LoadMailInit(PreparedQueryResult resultUnread, PreparedQueryResult //set a count of unread mails //QueryResult* resultMails = CharacterDatabase.PQuery("SELECT COUNT(id) FROM mail WHERE receiver = '%u' AND (checked & 1)=0 AND deliver_time <= '" UI64FMTD "'", GUID_LOPART(playerGuid), (uint64)cTime); if (resultUnread) - unReadMails = (*resultUnread)[0].GetUInt8(); + unReadMails = uint8((*resultUnread)[0].GetUInt64()); // store nearest delivery time (it > 0 and if it < current then at next player update SendNewMaill will be called) //resultMails = CharacterDatabase.PQuery("SELECT MIN(deliver_time) FROM mail WHERE receiver = '%u' AND (checked & 1)=0", GUID_LOPART(playerGuid)); From 4a0085ad2ce9b3f635c8c7f879f1e4c97fa0fa86 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 29 Mar 2012 12:11:22 -0400 Subject: [PATCH 0368/1149] Core/DBLayer: more type fixes --- src/server/game/Entities/Player/Player.cpp | 4 ++-- src/server/game/Events/GameEventMgr.cpp | 2 +- src/server/game/Groups/GroupMgr.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 69282e92f12..823f19cdf9a 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -17875,7 +17875,7 @@ void Player::_LoadMailInit(PreparedQueryResult resultUnread, PreparedQueryResult // store nearest delivery time (it > 0 and if it < current then at next player update SendNewMaill will be called) //resultMails = CharacterDatabase.PQuery("SELECT MIN(deliver_time) FROM mail WHERE receiver = '%u' AND (checked & 1)=0", GUID_LOPART(playerGuid)); if (resultDelivery) - m_nextMailDelivereTime = (time_t)(*resultDelivery)[0].GetUInt64(); + m_nextMailDelivereTime = time_t((*resultDelivery)[0].GetUInt32()); } void Player::_LoadMail() @@ -18098,7 +18098,7 @@ void Player::_LoadDailyQuestStatus(PreparedQueryResult result) uint32 quest_id = fields[0].GetUInt32(); // save _any_ from daily quest times (it must be after last reset anyway) - m_lastDailyQuestTime = (time_t)fields[1].GetUInt64(); + m_lastDailyQuestTime = time_t(fields[1].GetUInt32()); Quest const* quest = sObjectMgr->GetQuestTemplate(quest_id); if (!quest) diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 58ced12e487..a8492726e75 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -205,7 +205,7 @@ void GameEventMgr::LoadFromDB() { { uint32 oldMSTime = getMSTime(); - + // 1 2 3 4 5 6 7 8 QueryResult result = WorldDatabase.Query("SELECT eventEntry, UNIX_TIMESTAMP(start_time), UNIX_TIMESTAMP(end_time), occurence, length, holiday, description, world_event FROM game_event"); if (!result) { diff --git a/src/server/game/Groups/GroupMgr.cpp b/src/server/game/Groups/GroupMgr.cpp index a6f2f7a5f33..f372f08c941 100644 --- a/src/server/game/Groups/GroupMgr.cpp +++ b/src/server/game/Groups/GroupMgr.cpp @@ -229,7 +229,7 @@ void GroupMgr::LoadGroups() diff = 0; // default for both difficaly types } - InstanceSave* save = sInstanceSaveMgr->AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt64()), (bool)fields[6].GetUInt64(), true); + InstanceSave* save = sInstanceSaveMgr->AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt32()), (bool)fields[6].GetUInt64(), true); group->BindToInstance(save, fields[3].GetBool(), true); ++count; } From 3ba43cc08ac3ce3dc3519992638cd5cda717c0f5 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 29 Mar 2012 18:30:25 +0200 Subject: [PATCH 0369/1149] Core/DBLayer: More type fixes Closes #5936 --- src/server/game/Handlers/CharacterHandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index a5d5263c161..6e98c2e248a 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1617,8 +1617,8 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) } Field* fields = result->Fetch(); - uint32 playerClass = fields[0].GetUInt32(); - uint32 level = fields[1].GetUInt32(); + uint32 playerClass = uint32(fields[0].GetUInt8()); + uint32 level = uint32(fields[1].GetUInt8()); uint32 at_loginFlags = fields[2].GetUInt16(); uint32 used_loginFlag = ((recv_data.GetOpcode() == CMSG_CHAR_RACE_CHANGE) ? AT_LOGIN_CHANGE_RACE : AT_LOGIN_CHANGE_FACTION); From 58438515595c9a032a9ddac2ddb091ecdd67e912 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 29 Mar 2012 23:22:10 +0200 Subject: [PATCH 0370/1149] Core/DBLayer: More prepared statement corrections --- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/shared/Database/Implementation/CharacterDatabase.cpp | 2 +- src/server/shared/Packets/ByteBuffer.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 823f19cdf9a..a7788da524f 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -18303,7 +18303,7 @@ void Player::UnbindInstance(BoundInstancesMap::iterator &itr, Difficulty difficu { if (!unload) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE_GUID); stmt->setUInt32(0, GetGUIDLow()); stmt->setUInt32(1, itr->second.save->GetInstanceId()); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index a9754cfc73d..9d29aa6f9a9 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -506,7 +506,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_CHAR_AURA, "DELETE FROM character_aura WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_GIFT, "DELETE FROM character_gifts WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_INSTANCE, "DELETE FROM character_instance WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_INVENTORY, "DELETE FROM character_instance WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_INVENTORY, "DELETE FROM character_inventory WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_QUESTSTATUS_REWARDED, "DELETE FROM character_queststatus_rewarded WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_REPUTATION, "DELETE FROM character_reputation WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_SPELL, "DELETE FROM character_spell WHERE guid = ?", CONNECTION_ASYNC); diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 35cb62240d8..fb2fdf09583 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -363,7 +363,7 @@ class ByteBuffer void resize(size_t newsize) { - _storage.resize(newsize); + _storage.resize(newsize, 0); _rpos = 0; _wpos = size(); } From ba2ee48fc6ddd7e9c965690c97c669cb69ccf30e Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Fri, 30 Mar 2012 10:39:33 +0800 Subject: [PATCH 0371/1149] Core/Script: Code style(Missing?). Signed-off-by: Gyx <2359980687@qq.com> --- .../BlackrockDepths/blackrock_depths.cpp | 356 ++++++++++-------- 1 file changed, 192 insertions(+), 164 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp index 760a671b24a..9375cc33f27 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp @@ -613,16 +613,20 @@ public: void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { - case 0:me->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID); break; - case 1:instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; - case 2: - me->SetVisible(false); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED); - break; + case 0: + me->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID); + break; + case 1: + instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_OBJECTIVE_COMPLETED); + break; + case 2: + me->SetVisible(false); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED); + break; } } @@ -712,14 +716,15 @@ public: bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) { if (quest->GetQuestId() == 4322) - {PlayerStart = player; + { + PlayerStart = player; if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) { - CAST_AI(npc_escort::npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); - instance->SetData(DATA_QUEST_JAIL_BREAK, ENCOUNTER_STATE_IN_PROGRESS); - creature->setFaction(11); - } + CAST_AI(npc_escort::npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); + instance->SetData(DATA_QUEST_JAIL_BREAK, ENCOUNTER_STATE_IN_PROGRESS); + creature->setFaction(11); } + } return false; } @@ -732,58 +737,64 @@ public: void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { - case 1: - me->Say(SAY_WINDSOR_1, LANG_UNIVERSAL, PlayerGUID); - break; - case 7: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - me->Say(SAY_WINDSOR_4_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 10: - me->setFaction(534); - break; - case 12: - me->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, PlayerGUID); - instance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_IN_PROGRESS); - break; - case 13: - me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK - break; - case 14: - instance->SetData(DATA_GATE_SR, 0); - me->setFaction(11); - break; - case 16: - me->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID); - break; - case 17: - me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK - break; - case 18: - instance->SetData(DATA_GATE_SC, 0); - break; - case 19: - me->SetVisible(false); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR, 403.61f, -51.71f, -63.92f, 3.600434f, TEMPSUMMON_DEAD_DESPAWN, 0); - instance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_ENDED); - break; + case 1: + me->Say(SAY_WINDSOR_1, LANG_UNIVERSAL, PlayerGUID); + break; + case 7: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + me->Say(SAY_WINDSOR_4_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold = true; + break; + case 10: + me->setFaction(534); + break; + case 12: + me->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, PlayerGUID); + instance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_IN_PROGRESS); + break; + case 13: + me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK + break; + case 14: + instance->SetData(DATA_GATE_SR, 0); + me->setFaction(11); + break; + case 16: + me->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID); + break; + case 17: + me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK + break; + case 18: + instance->SetData(DATA_GATE_SC, 0); + break; + case 19: + me->SetVisible(false); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR, 403.61f, -51.71f, -63.92f, 3.600434f, TEMPSUMMON_DEAD_DESPAWN, 0); + instance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_ENDED); + break; } } void EnterCombat(Unit* who) - { + { switch (urand(0, 2)) { - case 0: me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break; - case 1: me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break; - case 2: me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break; - } + case 0: + me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); + break; + case 1: + me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); + break; + case 2: + me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); + break; } + } void Reset() {} @@ -794,19 +805,22 @@ public: void UpdateAI(const uint32 diff) { - if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; + if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) + return; + if (instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) SetEscortPaused(false); + if (!instance->GetData(DATA_GATE_D) && instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_NOT_STARTED) - { + { me->Say(SAY_WINDSOR_4_2, LANG_UNIVERSAL, PlayerGUID); instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_BEFORE_START); - } + } if (instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) - { + { me->Say(SAY_WINDSOR_4_3, LANG_UNIVERSAL, PlayerGUID); instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED); - } + } if ((instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& instance->GetData(DATA_SUPPLY_ROOM) == ENCOUNTER_STATE_ENDED) { me->SetVisible(false); @@ -902,59 +916,59 @@ public: void WaypointReached(uint32 waypointId) { - wp=i; - switch (i) + wp = waypointId; + switch (waypointId) { - case 0: - me->setFaction(11); - me->Say(SAY_REGINALD_WINDSOR_0_1, LANG_UNIVERSAL, PlayerGUID); - break; - case 1: - me->Say(SAY_REGINALD_WINDSOR_0_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 7: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - me->Say(SAY_REGINALD_WINDSOR_5_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 8: - me->Say(SAY_REGINALD_WINDSOR_5_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 11: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - me->Say(SAY_REGINALD_WINDSOR_7_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 12: - me->Say(SAY_REGINALD_WINDSOR_7_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 13: - me->Say(SAY_REGINALD_WINDSOR_7_3, LANG_UNIVERSAL, PlayerGUID); - break; - case 20: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - me->Say(SAY_REGINALD_WINDSOR_13_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 21: - me->Say(SAY_REGINALD_WINDSOR_13_3, LANG_UNIVERSAL, PlayerGUID); - break; - case 23: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - me->Say(SAY_REGINALD_WINDSOR_14_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 24: - me->Say(SAY_REGINALD_WINDSOR_14_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 31: - me->Say(SAY_REGINALD_WINDSOR_20_1, LANG_UNIVERSAL, PlayerGUID); - break; - case 32: - me->Say(SAY_REGINALD_WINDSOR_20_2, LANG_UNIVERSAL, PlayerGUID); - PlayerStart->GroupEventHappens(QUEST_JAIL_BREAK, me); - instance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED); - break; + case 0: + me->setFaction(11); + me->Say(SAY_REGINALD_WINDSOR_0_1, LANG_UNIVERSAL, PlayerGUID); + break; + case 1: + me->Say(SAY_REGINALD_WINDSOR_0_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 7: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + me->Say(SAY_REGINALD_WINDSOR_5_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 8: + me->Say(SAY_REGINALD_WINDSOR_5_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 11: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + me->Say(SAY_REGINALD_WINDSOR_7_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 12: + me->Say(SAY_REGINALD_WINDSOR_7_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 13: + me->Say(SAY_REGINALD_WINDSOR_7_3, LANG_UNIVERSAL, PlayerGUID); + break; + case 20: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + me->Say(SAY_REGINALD_WINDSOR_13_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 21: + me->Say(SAY_REGINALD_WINDSOR_13_3, LANG_UNIVERSAL, PlayerGUID); + break; + case 23: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + me->Say(SAY_REGINALD_WINDSOR_14_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 24: + me->Say(SAY_REGINALD_WINDSOR_14_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 31: + me->Say(SAY_REGINALD_WINDSOR_20_1, LANG_UNIVERSAL, PlayerGUID); + break; + case 32: + me->Say(SAY_REGINALD_WINDSOR_20_2, LANG_UNIVERSAL, PlayerGUID); + PlayerStart->GroupEventHappens(QUEST_JAIL_BREAK, me); + instance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED); + break; } } @@ -978,14 +992,20 @@ public: } void EnterCombat(Unit* who) - { + { switch (urand(0, 2)) { - case 0: me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break; - case 1: me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break; - case 2: me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break; - } + case 0: + me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); + break; + case 1: + me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); + break; + case 2: + me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); + break; } + } void Reset() {} void JustDied(Unit* slayer) @@ -995,47 +1015,49 @@ public: void UpdateAI(const uint32 diff) { - if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; + if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) + return; + if (wp == 7) - { + { if (!instance->GetData(DATA_GATE_J) && instance->GetData(DATA_JAZ) == ENCOUNTER_STATE_NOT_STARTED) - { - instance->SetData(DATA_CREATURE_JAZ, 1); - instance->SetData(DATA_JAZ, ENCOUNTER_STATE_IN_PROGRESS); - } + { + instance->SetData(DATA_CREATURE_JAZ, 1); + instance->SetData(DATA_JAZ, ENCOUNTER_STATE_IN_PROGRESS); + } if (instance->GetData(DATA_CREATURE_JAZ) && instance->GetData(DATA_CREATURE_OGRABISI) && instance->GetData(DATA_JAZ) == ENCOUNTER_STATE_IN_PROGRESS) - { - SetEscortPaused(false); - instance->SetData(DATA_JAZ, ENCOUNTER_STATE_ENDED); - } + { + SetEscortPaused(false); + instance->SetData(DATA_JAZ, ENCOUNTER_STATE_ENDED); } + } else if (wp == 11) - { + { if (!instance->GetData(DATA_GATE_S) && instance->GetData(DATA_SHILL) == ENCOUNTER_STATE_NOT_STARTED) - { - instance->SetData(DATA_CREATURE_SHILL, 1); - instance->SetData(DATA_SHILL, ENCOUNTER_STATE_IN_PROGRESS); - } - if (instance->GetData(DATA_CREATURE_SHILL) && instance->GetData(DATA_SHILL) == ENCOUNTER_STATE_IN_PROGRESS) - { - instance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED); - SetEscortPaused(false); - } - } - else if (wp == 20) { - if (!instance->GetData(DATA_GATE_C) && instance->GetData(DATA_CREST) == ENCOUNTER_STATE_NOT_STARTED) - { - instance->SetData(DATA_CREATURE_CREST, 1); - me->Say(SAY_REGINALD_WINDSOR_13_2, LANG_UNIVERSAL, PlayerGUID); - instance->SetData(DATA_CREST, ENCOUNTER_STATE_IN_PROGRESS); - } - if (instance->GetData(DATA_CREATURE_CREST) && instance->GetData(DATA_CREST) == ENCOUNTER_STATE_IN_PROGRESS) - { - SetEscortPaused(false); - instance->SetData(DATA_CREST, ENCOUNTER_STATE_ENDED); - } + instance->SetData(DATA_CREATURE_SHILL, 1); + instance->SetData(DATA_SHILL, ENCOUNTER_STATE_IN_PROGRESS); } + if (instance->GetData(DATA_CREATURE_SHILL) && instance->GetData(DATA_SHILL) == ENCOUNTER_STATE_IN_PROGRESS) + { + instance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED); + SetEscortPaused(false); + } + } + else if (wp == 20) + { + if (!instance->GetData(DATA_GATE_C) && instance->GetData(DATA_CREST) == ENCOUNTER_STATE_NOT_STARTED) + { + instance->SetData(DATA_CREATURE_CREST, 1); + me->Say(SAY_REGINALD_WINDSOR_13_2, LANG_UNIVERSAL, PlayerGUID); + instance->SetData(DATA_CREST, ENCOUNTER_STATE_IN_PROGRESS); + } + if (instance->GetData(DATA_CREATURE_CREST) && instance->GetData(DATA_CREST) == ENCOUNTER_STATE_IN_PROGRESS) + { + SetEscortPaused(false); + instance->SetData(DATA_CREST, ENCOUNTER_STATE_ENDED); + } + } if (instance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) SetEscortPaused(false); npc_escortAI::UpdateAI(diff); } @@ -1045,6 +1067,7 @@ public: // npc_tobias_seecher #define SAY_TOBIAS_FREE "Thank you! I will run for safety immediately!" + /* class npc_tobias_seecher : public CreatureScript { @@ -1107,23 +1130,28 @@ public: void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { - case 0:me->Say(SAY_TOBIAS_FREE, LANG_UNIVERSAL, PlayerGUID); break; - case 2: - instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; - case 4: - me->SetVisible(false); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_ENDED); - break; + case 0: + me->Say(SAY_TOBIAS_FREE, LANG_UNIVERSAL, PlayerGUID); + break; + case 2: + instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_OBJECTIVE_COMPLETED); + break; + case 4: + me->SetVisible(false); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_ENDED); + break; } } void UpdateAI(const uint32 diff) { - if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; + if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) + return; + if ((instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& instance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_ENDED) { me->SetVisible(false); From 7efb63725853b7c2221a800bf6204dcf5635c63c Mon Sep 17 00:00:00 2001 From: click Date: Sat, 31 Mar 2012 04:59:58 +0200 Subject: [PATCH 0372/1149] DB/Quest: Add SAI-script for quests - thanks to Unholy and Redsonja for recreating the SQL. Closes #1448, #3812, #4312, #385. --- .../2012_03_30_00_world_smart_scripts.sql | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 sql/updates/world/2012_03_30_00_world_smart_scripts.sql diff --git a/sql/updates/world/2012_03_30_00_world_smart_scripts.sql b/sql/updates/world/2012_03_30_00_world_smart_scripts.sql new file mode 100644 index 00000000000..08d4ee90168 --- /dev/null +++ b/sql/updates/world/2012_03_30_00_world_smart_scripts.sql @@ -0,0 +1,95 @@ +-- revised from Unholys original works +-- quest 12702 chicken party! +-- quest 12532 flown the coop! +-- +SET @ENTRY := 28161; -- the chicken +SET @PARTY := 12702; -- chicken party quest +SET @COOP := 12532; -- flown the coop quest +SET @LIFE := 900000; -- minutes + +-- set up required spells for the spells to work as they should +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=@ENTRY; +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`,`user_type`) VALUES +(@ENTRY,39996,1,0), -- cover spell (dummy) +(@ENTRY,51037,2,0); -- creates item in players back pack + +-- set npc up to use event script +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; + +-- convert over to smart script +DELETE FROM `creature_ai_scripts` WHERE `id`=@ENTRY; -- delete old eai scripts +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,0,1000,1000,2000,3000,89,35,0,0,0,0,0,1,0,0,0,0,0,0,0, 'create random movement every 2-3 secs'), +(@ENTRY,0,1,0,8,0,100,0,51951,0,0,0,11,50839,0,0,0,0,0,1,0,0,0,0,0,0,0, 'when hit with net cast self stun'), +(@ENTRY,0,2,0,8,0,100,0,39996,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'force despawn @1 sec when hit with dummy spell'); + +-- Remove previous scripts that may interfere with this work +DELETE FROM `quest_start_scripts` WHERE `id` IN (@PARTY,@COOP); + +-- start script for quest chicken party (they do not all spawn at same time) +UPDATE `quest_template` SET `StartScript`=@PARTY WHERE `id`=@PARTY; -- 12072 +INSERT INTO `quest_start_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES +(@PARTY,1,10,@ENTRY,@LIFE, 0,5251.09,4413.76,-96.086,4.8714), +(@PARTY,2,10,@ENTRY,@LIFE, 0,5251.22,4419.74,-95.8995,3.58335), +(@PARTY,23,10,@ENTRY,@LIFE, 0,5257.58,4421.77,-95.9072,2.62124), +(@PARTY,4,10,@ENTRY,@LIFE,0, 5255.97,4420.37,-95.9999,0.0451326), +(@PARTY,5,10,@ENTRY,@LIFE,0, 5256.78,4420.63,-95.9957,0.320021), +(@PARTY,6,10,@ENTRY,@LIFE,0, 5257.58,4421.77,-95.9072,0.956194), +(@PARTY,27,10,@ENTRY,@LIFE,0, 5258.54,4420.49,-96.0195,0.551714), +(@PARTY,8,10,@ENTRY,@LIFE,0, 5250.67,4417.98,-95.9787,4.39231), +(@PARTY,9,10,@ENTRY,@LIFE,0, 5273.53,4430.32,-96.0241,1.0897), +(@PARTY,40,10,@ENTRY,@LIFE,0, 5158.3,4605.25,-130.988,3.7522), +(@PARTY,21,10,@ENTRY,@LIFE,0, 5164.6,4609.43,-130.427,3.70115), +(@PARTY,22,10,@ENTRY,@LIFE,0, 5169.53,4612.44,-130.817,4.05065), +(@PARTY,23,10,@ENTRY,@LIFE,0, 5188.49,4627.85,-132.485,3.60691), +(@PARTY,44,10,@ENTRY,@LIFE,0, 5203.19,4631.63,-132.611,2.849), +(@PARTY,25,10,@ENTRY,@LIFE,0, 5219.62,4632.46,-134.232,0.378917), +(@PARTY,26,10,@ENTRY,@LIFE,0, 5219.62,4632.46,-134.232,0.66166), +(@PARTY,27,10,@ENTRY,@LIFE,0, 5203.5,4595.02,-111.327,5.51542), +(@PARTY,48,10,@ENTRY,@LIFE,0, 5179.35,4558,-100.344,0.579192), +(@PARTY,29,10,@ENTRY,@LIFE,0, 5179.35,4558,-100.344,1.09756), +(@PARTY,30,10,@ENTRY,@LIFE,0, 5172.43,4533.25,-97.3836,1.15253), +(@PARTY,41,10,@ENTRY,@LIFE,0, 5186.29,4522.69,-91.0957,3.02571), +(@PARTY,32,10,@ENTRY,@LIFE,0, 5214.67,4485.22,-91.3113,2.40524), +(@PARTY,33,10,@ENTRY,@LIFE,0, 5221.85,4475.99,-96.8801,4.89495), +(@PARTY,34,10,@ENTRY,@LIFE,0, 5222.95,4438.1,-96.8062,1.6277), +(@PARTY,35,10,@ENTRY,@LIFE,0, 5224.36,4427.83,-96.9221,2.63301), +(@PARTY,36,10,@ENTRY,@LIFE,0, 5234.72,4406.44,-95.2917,0.0647549), +(@PARTY,47,10,@ENTRY,@LIFE,0, 5227.28,4407.01,-95.3888,3.79933), +(@PARTY,38,10,@ENTRY,@LIFE,0, 5227.28,4407.01,-95.3888,4.29414), +(@PARTY,39,10,@ENTRY,@LIFE,0, 5251.09,4413.76,-96.086,3.90536), +(@PARTY,40,10,@ENTRY,@LIFE,0, 5251.09,4413.76,-96.086,4.36089); + +-- start script for quest flown the coop (they do not all spawn at same time) +UPDATE `quest_template` SET `StartScript`=@COOP WHERE `id`=@COOP; -- 12532 +INSERT INTO `quest_start_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES +(@COOP,23,10,@ENTRY,@LIFE,0, 5257.58,4421.77,-95.9072,2.62124), +(@COOP,4,10,@ENTRY,@LIFE,0, 5255.97,4420.37,-95.9999,0.0451326), +(@COOP,5,10,@ENTRY,@LIFE,0, 5256.78,4420.63,-95.9957,0.320021), +(@COOP,6,10,@ENTRY,@LIFE,0, 5257.58,4421.77,-95.9072,0.956194), +(@COOP,27,10,@ENTRY,@LIFE,0, 5258.54,4420.49,-96.0195,0.551714), +(@COOP,8,10,@ENTRY,@LIFE,0, 5250.67,4417.98,-95.9787,4.39231), +(@COOP,9,10,@ENTRY,@LIFE,0, 5273.53,4430.32,-96.0241,1.0897), +(@COOP,40,10,@ENTRY,@LIFE,0, 5158.3,4605.25,-130.988,3.7522), +(@COOP,21,10,@ENTRY,@LIFE,0, 5164.6,4609.43,-130.427,3.70115), +(@COOP,22,10,@ENTRY,@LIFE,0, 5169.53,4612.44,-130.817,4.05065), +(@COOP,23,10,@ENTRY,@LIFE,0, 5188.49,4627.85,-132.485,3.60691), +(@COOP,44,10,@ENTRY,@LIFE,0, 5203.19,4631.63,-132.611,2.849), +(@COOP,25,10,@ENTRY,@LIFE,0, 5219.62,4632.46,-134.232,0.378917), +(@COOP,26,10,@ENTRY,@LIFE,0, 5219.62,4632.46,-134.232,0.66166), +(@COOP,27,10,@ENTRY,@LIFE,0, 5203.5,4595.02,-111.327,5.51542), +(@COOP,48,10,@ENTRY,@LIFE,0, 5179.35,4558,-100.344,0.579192), +(@COOP,29,10,@ENTRY,@LIFE,0, 5179.35,4558,-100.344,1.09756), +(@COOP,30,10,@ENTRY,@LIFE,0, 5172.43,4533.25,-97.3836,1.15253), +(@COOP,41,10,@ENTRY,@LIFE,0, 5186.29,4522.69,-91.0957,3.02571), +(@COOP,32,10,@ENTRY,@LIFE,0, 5214.67,4485.22,-91.3113,2.40524), +(@COOP,33,10,@ENTRY,@LIFE,0, 5221.85,4475.99,-96.8801,4.89495), +(@COOP,34,10,@ENTRY,@LIFE,0, 5222.95,4438.1,-96.8062,1.6277), +(@COOP,35,10,@ENTRY,@LIFE,0, 5224.36,4427.83,-96.9221,2.63301), +(@COOP,36,10,@ENTRY,@LIFE,0, 5234.72,4406.44,-95.2917,0.0647549), +(@COOP,47,10,@ENTRY,@LIFE,0, 5227.28,4407.01,-95.3888,3.79933), +(@COOP,38,10,@ENTRY,@LIFE,0, 5227.28,4407.01,-95.3888,4.29414), +(@COOP,39,10,@ENTRY,@LIFE,0, 5251.09,4413.76,-96.086,3.90536), +(@COOP,40,10,@ENTRY,@LIFE,0, 5251.09,4413.76,-96.086,4.36089); + From d9088c083cdf42124ac956d704c5fa7b5d98e185 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Sat, 31 Mar 2012 18:56:37 +0800 Subject: [PATCH 0373/1149] Core/Script: Code style and some rewriting. JustDied(Unit* Killer) -> JustDied(Unit* killer) JustDied(Unit* /*Killer*/) -> JustDied(Unit* /*killer*/) JustDied(Unit* /*unit*/) -> JustDied(Unit* /*killer*/) JustDied(Unit* /*slayer*/)) -> JustDied(Unit* /*killer*/) JustDied(Unit* /*victim*/) -> JustDied(Unit* /*killer*/) JustDied(Unit* victim) -> JustDied(Unit* killer) JustDied(Unit* /*who*/) -> JustDied(Unit* /*killer*/) JustDied(Unit* who) -> JustDied(Unit* killer) JustDied(Unit*) -> JustDied(Unit* /*killer*/) Signed-off-by: Gyx <2359980687@qq.com> --- .../AlteracValley/boss_balinda.cpp | 2 +- .../boss_emperor_dagran_thaurissan.cpp | 2 +- .../BlackrockDepths/boss_magmus.cpp | 4 +- .../BlackrockDepths/boss_tomb_of_seven.cpp | 2 +- .../BlackrockSpire/boss_drakkisath.cpp | 2 +- .../BlackrockSpire/boss_gyth.cpp | 2 +- .../BlackrockSpire/boss_halycon.cpp | 2 +- .../BlackrockSpire/boss_highlord_omokk.cpp | 2 +- .../BlackrockSpire/boss_mother_smolderweb.cpp | 2 +- .../boss_overlord_wyrmthalak.cpp | 2 +- .../boss_pyroguard_emberseer.cpp | 2 +- .../boss_quartermaster_zigris.cpp | 2 +- .../BlackrockSpire/boss_rend_blackhand.cpp | 2 +- .../boss_shadow_hunter_voshgajin.cpp | 2 +- .../BlackrockSpire/boss_the_beast.cpp | 2 +- .../BlackrockSpire/boss_warmaster_voone.cpp | 2 +- .../BlackwingLair/boss_nefarian.cpp | 2 +- .../BlackwingLair/boss_razorgore.cpp | 2 +- .../EasternKingdoms/Karazhan/boss_curator.cpp | 2 +- .../Karazhan/boss_maiden_of_virtue.cpp | 2 +- .../Karazhan/boss_midnight.cpp | 2 +- .../EasternKingdoms/Karazhan/boss_moroes.cpp | 2 +- .../Karazhan/boss_prince_malchezaar.cpp | 2 +- .../Karazhan/boss_shade_of_aran.cpp | 2 +- .../Karazhan/boss_terestian_illhoof.cpp | 2 +- .../boss_felblood_kaelthas.cpp | 2 +- .../MagistersTerrace/boss_vexallus.cpp | 2 +- .../MoltenCore/boss_ragnaros.cpp | 2 +- .../ScarletEnclave/chapter1.cpp | 4 -- .../boss_interrogator_vishas.cpp | 2 +- .../Stratholme/boss_baron_rivendare.cpp | 2 +- .../Stratholme/boss_baroness_anastari.cpp | 2 +- .../Stratholme/boss_cannon_master_willey.cpp | 2 +- .../Stratholme/boss_dathrohan_balnazzar.cpp | 2 +- .../Stratholme/boss_magistrate_barthilas.cpp | 2 +- .../Stratholme/boss_maleki_the_pallid.cpp | 2 +- .../Stratholme/boss_nerubenkan.cpp | 2 +- .../Stratholme/boss_order_of_silver_hand.cpp | 48 ++++++++++--------- .../Stratholme/boss_ramstein_the_gorger.cpp | 2 +- .../EasternKingdoms/Stratholme/stratholme.cpp | 4 +- .../SunwellPlateau/boss_brutallus.cpp | 2 +- .../SunwellPlateau/boss_eredar_twins.cpp | 4 +- .../SunwellPlateau/boss_felmyst.cpp | 2 +- .../EasternKingdoms/ZulAman/boss_akilzon.cpp | 2 +- .../EasternKingdoms/ZulAman/boss_halazzi.cpp | 2 +- .../EasternKingdoms/ZulAman/boss_hexlord.cpp | 2 +- .../EasternKingdoms/ZulAman/boss_janalai.cpp | 2 +- .../EasternKingdoms/ZulAman/boss_nalorakk.cpp | 2 +- .../EasternKingdoms/ZulAman/boss_zuljin.cpp | 2 +- .../EasternKingdoms/ZulAman/zulaman.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_jeklik.cpp | 2 +- .../ZulGurub/boss_mandokir.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_marli.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_thekal.cpp | 2 +- .../EasternKingdoms/arathi_highlands.cpp | 2 +- .../EasternKingdoms/eastern_plaguelands.cpp | 4 +- .../EasternKingdoms/eversong_woods.cpp | 2 +- .../BattleForMountHyjal/boss_anetheron.cpp | 6 +-- .../BattleForMountHyjal/boss_archimonde.cpp | 4 +- .../BattleForMountHyjal/boss_azgalor.cpp | 6 +-- .../BattleForMountHyjal/boss_kazrogal.cpp | 4 +- .../boss_rage_winterchill.cpp | 4 +- .../BattleForMountHyjal/hyjal_trash.cpp | 11 +++-- .../CavernsOfTime/DarkPortal/boss_aeonus.cpp | 2 +- .../DarkPortal/boss_chrono_lord_deja.cpp | 2 +- .../DarkPortal/boss_temporus.cpp | 2 +- .../CavernsOfTime/DarkPortal/dark_portal.cpp | 4 +- .../boss_captain_skarloc.cpp | 2 +- .../boss_epoch_hunter.cpp | 2 +- .../boss_leutenant_drake.cpp | 2 +- .../Maraudon/boss_celebras_the_cursed.cpp | 2 +- .../TempleOfAhnQiraj/boss_bug_trio.cpp | 4 +- .../Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp | 8 ++-- .../TempleOfAhnQiraj/boss_sartura.cpp | 2 +- .../Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp | 2 +- .../TempleOfAhnQiraj/boss_twinemperors.cpp | 2 +- .../mob_anubisath_sentinel.cpp | 2 +- .../scripts/Kalimdor/ZulFarrak/zulfarrak.cpp | 2 +- .../scripts/Kalimdor/bloodmyst_isle.cpp | 6 +-- .../AzjolNerub/Ahnkahet/boss_amanitar.cpp | 2 +- .../AzjolNerub/Ahnkahet/boss_elder_nadox.cpp | 4 +- .../Ahnkahet/boss_jedoga_shadowseeker.cpp | 12 ++--- .../Ahnkahet/boss_prince_taldaram.cpp | 2 +- .../AzjolNerub/AzjolNerub/boss_hadronox.cpp | 2 +- .../Northrend/DraktharonKeep/boss_dred.cpp | 6 +-- .../HallsOfReflection/halls_of_reflection.cpp | 2 +- .../scripts/Northrend/Gundrak/boss_eck.cpp | 2 +- .../IcecrownCitadel/boss_festergut.cpp | 2 +- .../Northrend/Naxxramas/boss_anubrekhan.cpp | 2 +- .../Northrend/Naxxramas/boss_gothik.cpp | 2 +- .../Northrend/Naxxramas/boss_heigan.cpp | 2 +- .../Northrend/Naxxramas/boss_kelthuzad.cpp | 4 +- .../scripts/Northrend/Naxxramas/boss_noth.cpp | 2 +- .../Northrend/Naxxramas/boss_patchwerk.cpp | 2 +- .../Northrend/Naxxramas/boss_sapphiron.cpp | 2 +- .../Northrend/Naxxramas/boss_thaddius.cpp | 2 +- .../Northrend/Nexus/Nexus/boss_anomalus.cpp | 2 +- .../Ulduar/Ulduar/boss_assembly_of_iron.cpp | 6 +-- .../Northrend/Ulduar/Ulduar/boss_auriaya.cpp | 6 +-- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 4 +- .../Northrend/Ulduar/Ulduar/boss_freya.cpp | 22 ++++----- .../Ulduar/Ulduar/boss_general_vezax.cpp | 4 +- .../Northrend/Ulduar/Ulduar/boss_hodir.cpp | 8 ++-- .../Northrend/Ulduar/Ulduar/boss_ignis.cpp | 2 +- .../Northrend/Ulduar/Ulduar/boss_kologarn.cpp | 2 +- .../Ulduar/Ulduar/boss_razorscale.cpp | 4 +- .../Northrend/Ulduar/Ulduar/boss_thorim.cpp | 2 +- .../Northrend/Ulduar/Ulduar/boss_xt002.cpp | 2 +- .../UtgardeKeep/boss_skarvald_dalronn.cpp | 8 ++-- .../Northrend/VaultOfArchavon/boss_emalon.cpp | 2 +- .../Northrend/VioletHold/violet_hold.cpp | 2 +- .../scripts/Northrend/borean_tundra.cpp | 43 ++++++++++------- .../AuchenaiCrypts/boss_exarch_maladaar.cpp | 2 +- .../ManaTombs/boss_nexusprince_shaffar.cpp | 2 +- .../Auchindoun/ManaTombs/boss_pandemonius.cpp | 2 +- .../SethekkHalls/boss_darkweaver_syth.cpp | 2 +- .../SethekkHalls/boss_tailonking_ikiss.cpp | 2 +- .../boss_ambassador_hellmaw.cpp | 2 +- .../boss_blackheart_the_inciter.cpp | 2 +- .../boss_grandmaster_vorpil.cpp | 2 +- .../Outland/BlackTemple/boss_bloodboil.cpp | 2 +- .../BlackTemple/boss_mother_shahraz.cpp | 2 +- .../BlackTemple/boss_reliquary_of_souls.cpp | 2 +- .../BlackTemple/boss_teron_gorefiend.cpp | 2 +- .../BlackTemple/boss_warlord_najentus.cpp | 2 +- .../Outland/BlackTemple/illidari_council.cpp | 8 ++-- .../boss_fathomlord_karathress.cpp | 6 +-- .../boss_hydross_the_unstable.cpp | 2 +- .../SerpentShrine/boss_lady_vashj.cpp | 2 +- .../boss_leotheras_the_blind.cpp | 6 +-- .../boss_morogrim_tidewalker.cpp | 2 +- .../SteamVault/boss_hydromancer_thespia.cpp | 2 +- .../SteamVault/boss_mekgineer_steamrigger.cpp | 2 +- .../SteamVault/boss_warlord_kalithresh.cpp | 2 +- .../underbog/boss_the_black_stalker.cpp | 2 +- .../scripts/Outland/GruulsLair/boss_gruul.cpp | 2 +- .../GruulsLair/boss_high_king_maulgar.cpp | 10 ++-- .../BloodFurnace/boss_broggok.cpp | 2 +- .../BloodFurnace/boss_kelidan_the_breaker.cpp | 6 +-- .../BloodFurnace/boss_the_maker.cpp | 2 +- .../boss_omor_the_unscarred.cpp | 2 +- .../boss_vazruden_the_herald.cpp | 8 ++-- .../boss_watchkeeper_gargolmar.cpp | 2 +- .../MagtheridonsLair/boss_magtheridon.cpp | 4 +- .../ShatteredHalls/boss_nethekurse.cpp | 4 +- .../ShatteredHalls/boss_warbringer_omrogg.cpp | 2 +- .../boss_warchief_kargath_bladefist.cpp | 2 +- .../Outland/TempestKeep/Eye/boss_alar.cpp | 2 +- .../TempestKeep/Eye/boss_astromancer.cpp | 2 +- .../Outland/TempestKeep/Eye/boss_kaelthas.cpp | 4 +- .../TempestKeep/Eye/boss_void_reaver.cpp | 2 +- .../Mechanar/boss_gatewatcher_ironhand.cpp | 2 +- .../Mechanar/boss_nethermancer_sepethrea.cpp | 2 +- .../boss_pathaleon_the_calculator.cpp | 2 +- .../Outland/TempestKeep/arcatraz/arcatraz.cpp | 2 +- .../arcatraz/boss_harbinger_skyriss.cpp | 2 +- .../botanica/boss_high_botanist_freywinn.cpp | 2 +- .../botanica/boss_warp_splinter.cpp | 2 +- .../scripts/Outland/boss_doomlord_kazzak.cpp | 2 +- .../scripts/Outland/boss_doomwalker.cpp | 2 +- .../scripts/Outland/shadowmoon_valley.cpp | 35 +++++++------- .../scripts/Outland/terokkar_forest.cpp | 32 +++++++------ 162 files changed, 316 insertions(+), 307 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp index 1292cdaee17..93de16fc80b 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp @@ -139,7 +139,7 @@ public: summons.Summon(summoned); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { summons.DespawnAll(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp index fea8657496b..073c4fde82a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp @@ -71,7 +71,7 @@ public: DoScriptText(SAY_SLAY, me); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Moira = ObjectAccessor::GetCreature(*me, instance ? instance->GetData64(DATA_MOIRA) : 0)) { diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp index 52d78487776..3d2cc627145 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp @@ -80,9 +80,9 @@ public: DoMeleeAttackIfReady(); } // When he die open door to last chamber - void JustDied(Unit* who) + void JustDied(Unit* killer) { - if (InstanceScript* instance = who->GetInstanceScript()) + if (InstanceScript* instance = killer->GetInstanceScript()) instance->HandleGameObject(instance->GetData64(DATA_THRONE_DOOR), true); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp index de520fa8a58..211930e4f1a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp @@ -193,7 +193,7 @@ public: instance->SetData64(DATA_EVENSTARTER, 0); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_GHOSTKILL, 1); diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp index ff17e989cd9..ff40094debd 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp @@ -64,7 +64,7 @@ public: events.ScheduleEvent(EVENT_THUNDERCLAP, 17 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp index 22f3513b157..214ce4e02f3 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp @@ -79,7 +79,7 @@ public: events.ScheduleEvent(EVENT_AGGRO, 60 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp index a944ee6daf8..c5d566c51cb 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp @@ -63,7 +63,7 @@ public: events.ScheduleEvent(EVENT_MIGHTY_BLOW, 14 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp index bc9de52d91d..027952dc74a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp @@ -73,7 +73,7 @@ public: events.ScheduleEvent(EVENT_SLOW, 24 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp index 973ffe7e53b..c455b1d404d 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp @@ -59,7 +59,7 @@ public: events.ScheduleEvent(EVENT_MOTHERS_MILK, 10 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp index b7492998d56..0c23f55bd39 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp @@ -77,7 +77,7 @@ public: events.ScheduleEvent(EVENT_KNOCK_AWAY, 12 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp index d76d0d7f47c..411b800cd03 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp @@ -62,7 +62,7 @@ public: events.ScheduleEvent(EVENT_PYROBLAST, 14 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp index 4fb7e513f5d..d1eb60fbb71 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp @@ -60,7 +60,7 @@ public: events.ScheduleEvent(EVENT_STUN_BOMB, 16 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp index ce19a03571a..1f7e3697a6d 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp @@ -61,7 +61,7 @@ public: events.ScheduleEvent(EVENT_THUNDERCLAP, 9 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp index f93466cbece..99e87dc617b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp @@ -62,7 +62,7 @@ public: events.ScheduleEvent(EVENT_CLEAVE, 14 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp index 88a09d57138..843679b460d 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp @@ -61,7 +61,7 @@ public: events.ScheduleEvent(EVENT_TERRIFYING_ROAR, 23 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp index 2dc05799e51..a3891ef8590 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp @@ -70,7 +70,7 @@ public: events.ScheduleEvent(EVENT_THROW_AXE, 1 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp index 1e539449fe3..5d4cc442a49 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp @@ -111,7 +111,7 @@ public: DoScriptText(SAY_SLAY, me, Victim); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp index a4fb4ad22a3..24fc74cc7cb 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp @@ -75,7 +75,7 @@ public: DoZoneInCombat(); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp index 6de67e9371f..96bda019f6a 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp @@ -80,7 +80,7 @@ public: DoScriptText(RAND(SAY_KILL1, SAY_KILL2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp index 5446f4c0158..e19efc7c4e5 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp @@ -78,7 +78,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp index 9d863544c24..bbf87ac3e73 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp @@ -89,7 +89,7 @@ public: DoScriptText(RAND(SAY_KILL1, SAY_KILL2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); if (Unit* pMidnight = Unit::GetUnit(*me, Midnight)) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp index 65fb6759722..90fdb165384 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -135,7 +135,7 @@ public: DoScriptText(RAND(SAY_KILL_1, SAY_KILL_2, SAY_KILL_3), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index 596f07fec64..4700ad71fab 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -243,7 +243,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp index 120bd03b719..d95b4aa3ae1 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp @@ -161,7 +161,7 @@ public: DoScriptText(RAND(SAY_KILL1, SAY_KILL2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp index a192a1de267..f2def74011d 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp @@ -94,7 +94,7 @@ public: } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) { diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index a2c32e2c3eb..6bcec6c6db5 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -548,7 +548,7 @@ public: } - void JustDied(Unit* /*slayer*/) + void JustDied(Unit* /*killer*/) { me->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); } diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp index bae2dd71b6d..327c611b2d6 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp @@ -101,7 +101,7 @@ public: DoScriptText(SAY_KILL, me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_VEXALLUS_EVENT, DONE); diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp index f3797f0feb3..0160f35f143 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp @@ -321,7 +321,7 @@ class mob_son_of_flame : public CreatureScript instance = me->GetInstanceScript(); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_RAGNAROS_ADDS, 1); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 4319fef0b05..ceab845f0a2 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -829,13 +829,9 @@ public: if (owner->GetTypeId() == TYPEID_PLAYER && CAST_PLR(owner)->isInCombat()) { if (CAST_PLR(owner)->getAttackerForHelper() && CAST_PLR(owner)->getAttackerForHelper()->GetEntry() == GHOSTS) - { AttackStart(CAST_PLR(owner)->getAttackerForHelper()); - } else - { FindMinions(owner); - } } } } diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp index 4517b1741d4..fd978136339 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp @@ -78,7 +78,7 @@ public: DoScriptText(SAY_KILL, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (!instance) return; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp index 32da9334adf..85faa14900b 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp @@ -126,7 +126,7 @@ public: summoned->AI()->AttackStart(target); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(TYPE_BARON, DONE); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp index 46aa3c96176..106719d654f 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp @@ -67,7 +67,7 @@ public: { } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(TYPE_BARONESS, IN_PROGRESS); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp index 2e97281b98f..01299ae06b6 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp @@ -103,7 +103,7 @@ public: SummonRifleman_Timer = 15000; } - void JustDied(Unit* /*Victim*/) + void JustDied(Unit* /*killer*/) { me->SummonCreature(11054, ADD_1X, ADD_1Y, ADD_1Z, ADD_1O, TEMPSUMMON_TIMED_DESPAWN, 240000); me->SummonCreature(11054, ADD_2X, ADD_2Y, ADD_2Z, ADD_2O, TEMPSUMMON_TIMED_DESPAWN, 240000); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp index b2637c496b2..21e3e19d890 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp @@ -105,7 +105,7 @@ public: me->UpdateEntry(NPC_DATHROHAN); } - void JustDied(Unit* /*Victim*/) + void JustDied(Unit* /*killer*/) { static uint32 uiCount = sizeof(m_aSummonPoint)/sizeof(SummonDef); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp index b9b1ea6458f..37e0bd5757f 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp @@ -75,7 +75,7 @@ public: ScriptedAI::MoveInLineOfSight(who); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { me->SetDisplayId(MODEL_HUMAN); } diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp index 61f1a100cfe..f8a10f06155 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp @@ -65,7 +65,7 @@ public: { } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(TYPE_PALLID, IN_PROGRESS); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp index e8030248f43..c9a43edb66d 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp @@ -67,7 +67,7 @@ public: { } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(TYPE_NERUB, IN_PROGRESS); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp index 99806e6cfdf..ebeda248331 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp @@ -96,30 +96,34 @@ public: { } - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { - if (instance) + if (!instance) + return; + + switch (me->GetEntry()) { - switch (me->GetEntry()) - { - case SH_AELMAR: - instance->SetData(TYPE_SH_AELMAR, 2); - break; - case SH_CATHELA: - instance->SetData(TYPE_SH_CATHELA, 2); - break; - case SH_GREGOR: - instance->SetData(TYPE_SH_GREGOR, 2); - break; - case SH_NEMAS: - instance->SetData(TYPE_SH_NEMAS, 2); - break; - case SH_VICAR: - instance->SetData(TYPE_SH_VICAR, 2); - break; - } - if (instance->GetData(TYPE_SH_QUEST) && Killer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(Killer)->KilledMonsterCredit(SH_QUEST_CREDIT, 0); + case SH_AELMAR: + instance->SetData(TYPE_SH_AELMAR, 2); + break; + case SH_CATHELA: + instance->SetData(TYPE_SH_CATHELA, 2); + break; + case SH_GREGOR: + instance->SetData(TYPE_SH_GREGOR, 2); + break; + case SH_NEMAS: + instance->SetData(TYPE_SH_NEMAS, 2); + break; + case SH_VICAR: + instance->SetData(TYPE_SH_VICAR, 2); + break; + } + + if (instance->GetData(TYPE_SH_QUEST)) + { + if (Player* player = killer->ToPlayer()) + player->KilledMonsterCredit(SH_QUEST_CREDIT, 0); } } diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp index a2fe87beb04..3bb1ce7959d 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp @@ -63,7 +63,7 @@ public: { } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { for (uint8 i = 0; i < 30; ++i) { diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp index 48bf4ae2305..7e167093e07 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp @@ -165,7 +165,7 @@ public: summoned->CastSpell(summoned, SPELL_SOUL_FREED, false); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (Tagged) me->SummonCreature(ENTRY_FREED, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 300000); @@ -230,7 +230,7 @@ public: Tagged = true; } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (Tagged) { diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp index 3352c4c06d2..43c94f8a57d 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp @@ -132,7 +132,7 @@ public: DoScriptText(RAND(YELL_KILL1, YELL_KILL2, YELL_KILL3), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(YELL_DEATH, me); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp index 086a927d07d..c3398799f17 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp @@ -167,7 +167,7 @@ public: DoScriptText(RAND(YELL_SAC_KILL_1, YELL_SAC_KILL_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { // only if ALY death if (SisterDeath) @@ -462,7 +462,7 @@ public: } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (SisterDeath) { diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp index 2fb50fec89e..72ad1100752 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp @@ -184,7 +184,7 @@ public: DoScriptText(YELL_BIRTH, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(YELL_DEATH, me); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index 7922d5fbc24..9a9f37d165f 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -131,7 +131,7 @@ class boss_akilzon : public CreatureScript instance->SetData(DATA_AKILZONEVENT, IN_PROGRESS); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { me->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0); DoPlaySoundToSet(me, SOUND_ONDEATH); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp index 3d53274a0db..3baa6ebdf62 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp @@ -324,7 +324,7 @@ class boss_halazzi : public CreatureScript } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_HALAZZIEVENT, DONE); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp index 269c6fa0923..f63ebe77a1b 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp @@ -293,7 +293,7 @@ class boss_hexlord_malacrass : public CreatureScript } } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_HEXLORDEVENT, DONE); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index f2e6647dc59..f9161fb4223 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -159,7 +159,7 @@ class boss_janalai : public CreatureScript HatchAllEggs(1); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp index 2a2fdf1346e..48a406f22a4 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp @@ -276,7 +276,7 @@ class boss_nalorakk : public CreatureScript DoZoneInCombat(); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_NALORAKKEVENT, DONE); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp index f7d5ae25e7a..2df202af088 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -252,7 +252,7 @@ class boss_zuljin : public CreatureScript } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_ZULJINEVENT, DONE); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index 35b9781ea45..bfb22483b09 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -136,7 +136,7 @@ class npc_zulaman_hostage : public CreatureScript void EnterCombat(Unit* /*who*/) {} - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { Player* player = Unit::GetPlayer(*me, PlayerGUID); if (player) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp index 638e2675496..7d2215f8311 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp @@ -94,7 +94,7 @@ class boss_jeklik : public CreatureScript DoCast(me, SPELL_BAT_FORM); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 0ef5c7ac74d..cbe1178e6c4 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -309,7 +309,7 @@ class mob_ohgan : public CreatureScript void EnterCombat(Unit* /*who*/) {} - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_OHGAN, DONE); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp index b5149701d1e..44ab5d851f5 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp @@ -88,7 +88,7 @@ class boss_marli : public CreatureScript DoScriptText(SAY_AGGRO, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); if (instance) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index 0504d791a26..d85f99b0295 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -108,7 +108,7 @@ class boss_thekal : public CreatureScript DoScriptText(SAY_AGGRO, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); if (instance) diff --git a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp index f6a62fbf092..d4d35b107b2 100644 --- a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp @@ -98,7 +98,7 @@ class npc_professor_phizzlethorpe : public CreatureScript case 20: Talk(EMOTE_PROGRESS_8); Talk(SAY_PROGRESS_9, player->GetGUID()); - CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me); + player->GroupEventHappens(QUEST_SUNKEN_TREASURE, me); break; } } diff --git a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp index 9fa8dad116e..731067a774f 100644 --- a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp @@ -54,9 +54,9 @@ public: void EnterCombat(Unit* /*who*/) {} - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { - if (Killer->GetTypeId() == TYPEID_PLAYER) + if (Player* player = killer->ToPlayer()) me->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000); } }; diff --git a/src/server/scripts/EasternKingdoms/eversong_woods.cpp b/src/server/scripts/EasternKingdoms/eversong_woods.cpp index 2655165e59f..016dd60b39c 100644 --- a/src/server/scripts/EasternKingdoms/eversong_woods.cpp +++ b/src/server/scripts/EasternKingdoms/eversong_woods.cpp @@ -247,7 +247,7 @@ public: CAST_PLR(Killed)->FailQuest(QUEST_SECOND_TRIAL); } - void JustDied(Unit* Killer); + void JustDied(Unit* killer); }; }; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index 68a81b65d4c..e0a0ff1dc59 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -125,9 +125,9 @@ public: } } - void JustDied(Unit* victim) + void JustDied(Unit* killer) { - hyjal_trashAI::JustDied(victim); + hyjal_trashAI::JustDied(killer); if (instance && IsEvent) instance->SetData(DATA_ANETHERONEVENT, DONE); DoPlaySoundToSet(me, SOUND_ONDEATH); @@ -272,7 +272,7 @@ public: { } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index 2a7a3a4c8bc..e22dbd972e5 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -343,9 +343,9 @@ public: ++SoulChargeCount; } - void JustDied(Unit* victim) + void JustDied(Unit* killer) { - hyjal_trashAI::JustDied(victim); + hyjal_trashAI::JustDied(killer); DoScriptText(SAY_DEATH, me); if (instance) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index 77326b5cbc7..24fe1b5957b 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -121,9 +121,9 @@ public: } } - void JustDied(Unit* victim) + void JustDied(Unit* killer) { - hyjal_trashAI::JustDied(victim); + hyjal_trashAI::JustDied(killer); if (instance && IsEvent) instance->SetData(DATA_AZGALOREVENT, DONE); DoPlaySoundToSet(me, SOUND_ONDEATH); @@ -251,7 +251,7 @@ public: AttackStart(who); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index a30eb440e74..de8759b3968 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -113,9 +113,9 @@ public: } } - void JustDied(Unit* victim) + void JustDied(Unit* killer) { - hyjal_trashAI::JustDied(victim); + hyjal_trashAI::JustDied(killer); if (instance && IsEvent) instance->SetData(DATA_KAZROGALEVENT, DONE); DoPlaySoundToSet(me, SOUND_ONDEATH); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp index 40ff7741857..f328b55f766 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp @@ -115,9 +115,9 @@ public: } } - void JustDied(Unit* victim) + void JustDied(Unit* killer) { - hyjal_trashAI::JustDied(victim); + hyjal_trashAI::JustDied(killer); if (instance && IsEvent) instance->SetData(DATA_RAGEWINTERCHILLEVENT, DONE); DoPlaySoundToSet(me, SOUND_ONDEATH); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index 011dbd32af3..e63b33faf70 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -377,10 +377,11 @@ void hyjal_trashAI::UpdateAI(const uint32 /*diff*/) } } -void hyjal_trashAI::JustDied(Unit* /*victim*/) +void hyjal_trashAI::JustDied(Unit* /*killer*/) { if (!instance) return; + if (IsEvent && !me->isWorldBoss()) instance->SetData(DATA_TRASH, 0);//signal trash is dead @@ -1194,7 +1195,7 @@ public: } } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance && IsEvent) instance->SetData(DATA_TRASH, 0);//signal trash is dead @@ -1313,14 +1314,14 @@ public: } } - void JustDied(Unit* victim) + void JustDied(Unit* killer) { float x, y, z; me->GetPosition(x, y, z); z = me->GetMap()->GetHeight(me->GetPhaseMask(), x, y, z); me->GetMotionMaster()->MovePoint(0, x, y, z); me->SetPosition(x, y, z, 0); - hyjal_trashAI::JustDied(victim); + hyjal_trashAI::JustDied(killer); } void UpdateAI(const uint32 diff) @@ -1422,7 +1423,7 @@ public: uint32 ExplodeTimer; - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp index 5d1c65c63ea..5b47c2ee07d 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp @@ -93,7 +93,7 @@ public: ScriptedAI::MoveInLineOfSight(who); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp index caf2a225e79..a4e805b3b75 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp @@ -100,7 +100,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp index 93fb6153b76..f59c9f0ef4c 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp @@ -84,7 +84,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp index 6a18c0b493b..c2a41cb29d1 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp @@ -153,9 +153,9 @@ public: SpellCorrupt_Timer = 3000; } - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { - if (Killer->GetEntry() == me->GetEntry()) + if (killer->GetEntry() == me->GetEntry()) return; DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp index ab03d8895f8..c27507cdcec 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp @@ -88,7 +88,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp index cd49a2470e3..82bd0a9e9be 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp @@ -84,7 +84,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp index 934b876d7c3..45825a81eb2 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp @@ -142,7 +142,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp index 38d9ce31563..d7043965271 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp @@ -59,7 +59,7 @@ public: void EnterCombat(Unit* /*who*/) { } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { me->SummonCreature(13716, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 600000); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp index 41e0e0f2a06..ce73c7ceb69 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp @@ -168,7 +168,7 @@ public: Enraged = false; } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) { @@ -261,7 +261,7 @@ public: VemDead = false; } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) { diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index 5dd603a7f92..11efccd14b7 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -949,7 +949,7 @@ public: uint32 KillSelfTimer; uint64 Portal; - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Unit* p = Unit::GetUnit(*me, Portal)) p->Kill(p); @@ -1025,7 +1025,7 @@ public: uint32 EvadeTimer; uint64 Portal; - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Unit* p = Unit::GetUnit(*me, Portal)) p->Kill(p); @@ -1136,7 +1136,7 @@ public: uint32 EvadeTimer; uint64 Portal; - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Unit* p = Unit::GetUnit(*me, Portal)) p->Kill(p); @@ -1252,7 +1252,7 @@ public: uint32 BeamTimer; uint64 Portal; - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Unit* p = Unit::GetUnit(*me, Portal)) p->Kill(p); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp index 0d934305ba7..8c6c0fa0ad0 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp @@ -84,7 +84,7 @@ public: DoScriptText(SAY_AGGRO, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp index 3f91ba62f0c..4df4bf73330 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp @@ -105,7 +105,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (!IsImage) DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index 74d2317734d..abaab9d830e 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -120,7 +120,7 @@ struct boss_twinemperorsAI : public ScriptedAI } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { Creature* pOtherBoss = GetOtherBoss(); if (pOtherBoss) diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp index 558b634b8de..556247d85af 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp @@ -242,7 +242,7 @@ public: DoZoneInCombat(); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { for (int ni=0; ni<3; ++ni) { diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp index 538a38f4a3b..9e3d9240321 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp @@ -322,7 +322,7 @@ public: AttackStartCaster(victim, 10);//keep back & toss bombs/shoot } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { /*if (instance) instance->SetData(0, DONE);*/ diff --git a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp index f60777c431d..ffc2fb3fb61 100644 --- a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp +++ b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp @@ -59,7 +59,7 @@ public: { } - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { uint32 spawnCreatureID = 0; @@ -67,8 +67,8 @@ public: { case 0: spawnCreatureID = 17681; - if (Killer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(Killer)->KilledMonsterCredit(spawnCreatureID, 0); + if (Player* player = killer->ToPlayer()) + player->KilledMonsterCredit(spawnCreatureID, 0); break; case 1: case 2: diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp index 516d3b21622..8f34fa56525 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp @@ -83,7 +83,7 @@ public: } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) { diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp index 7b8157486e8..ea757e86f4d 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp @@ -105,7 +105,7 @@ class boss_elder_nadox : public CreatureScript DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_SLAY_3, me); //SAY_SLAY_3 on death? @@ -229,7 +229,7 @@ class mob_ahnkahar_nerubian : public CreatureScript uiSprintTimer = 10000; } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (me->GetEntry() == MOB_AHNKAHAR_GUARDIAN_ENTRY) if (Creature* Nadox = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ELDER_NADOX))) diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp index ceefcece71e..d6e50097765 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp @@ -149,7 +149,7 @@ public: DoScriptText(RAND(TEXT_SLAY_1, TEXT_SLAY_2, TEXT_SLAY_3), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(TEXT_DEATH, me); if (instance) @@ -390,9 +390,9 @@ public: } } - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { - if (!Killer || !instance) + if (!killer || !instance) return; if (bWalking) @@ -402,7 +402,7 @@ public: if (!CAST_AI(boss_jedoga_shadowseeker::boss_jedoga_shadowseekerAI, boss->AI())->bOpFerok) CAST_AI(boss_jedoga_shadowseeker::boss_jedoga_shadowseekerAI, boss->AI())->bOpFerokFail = true; - if (Killer->GetTypeId() == TYPEID_PLAYER) + if (killer->GetTypeId() == TYPEID_PLAYER) boss->AI()->DoAction(ACTION_INITIAND_KILLED); } @@ -410,8 +410,8 @@ public: bWalking = false; } - if (Killer->GetTypeId() == TYPEID_PLAYER) - instance->SetData64(DATA_PL_JEDOGA_TARGET, Killer->GetGUID()); + if (killer->GetTypeId() == TYPEID_PLAYER) + instance->SetData64(DATA_PL_JEDOGA_TARGET, killer->GetGUID()); } void EnterCombat(Unit* who) diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp index 6a0ccc54773..328d1ab1cd4 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp @@ -364,7 +364,7 @@ public: void EnterCombat(Unit* /*who*/) {} void MoveInLineOfSight(Unit* /*who*/) {} - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { DoCast(me, SPELL_FLAME_SPHERE_DEATH_EFFECT); } diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp index 1e5567bda82..6587631f249 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp @@ -99,7 +99,7 @@ public: me->ModifyHealth(int32(me->CountPctFromMaxHealth(10))); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_HADRONOX_EVENT, DONE); diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp index e96ef4ff366..95acc79231d 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp @@ -161,7 +161,7 @@ class boss_dred : public CreatureScript return 0; } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_DRED_EVENT, DONE); @@ -211,7 +211,7 @@ class npc_drakkari_gutripper : public CreatureScript DoMeleeAttackIfReady(); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Dred = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_DRED))) Dred->AI()->DoAction(ACTION_RAPTOR_KILLED); @@ -261,7 +261,7 @@ class npc_drakkari_scytheclaw : public CreatureScript DoMeleeAttackIfReady(); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Dred = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_DRED))) Dred->AI()->DoAction(ACTION_RAPTOR_KILLED); diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index 89ab4205e87..2abb60d5de2 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -796,7 +796,7 @@ public: { } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { DoCast(SPELL_HALLUCINATION_2); } diff --git a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp index b79e4d1edfd..3e803c24d61 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp @@ -152,7 +152,7 @@ public: InstanceScript* instance; - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (instance) { diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp index a97c6f7d138..58856f9fb44 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp @@ -328,7 +328,7 @@ class npc_stinky_icc : public CreatureScript DoMeleeAttackIfReady(); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* festergut = me->GetCreature(*me, _instance->GetData64(DATA_FESTERGUT))) if (festergut->isAlive()) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp index d473643d900..1671eab0b32 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp @@ -99,7 +99,7 @@ public: DoScriptText(SAY_SLAY, me); } - void JustDied(Unit*) + void JustDied(Unit* /*killer*/) { _JustDied(); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index 8c6afba18fd..132ecdafa5a 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -234,7 +234,7 @@ class boss_gothik : public CreatureScript DoScriptText(SAY_KILL, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { LiveTriggerGUID.clear(); DeadTriggerGUID.clear(); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp index 9ab102e2e2b..d84cfb8949e 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp @@ -86,7 +86,7 @@ public: return 0; } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { _JustDied(); DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index 93f4b58120f..98cbb95f10d 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -338,7 +338,7 @@ public: DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { _JustDied(); DoScriptText(SAY_DEATH, me); @@ -760,7 +760,7 @@ class npc_kelthuzad_abomination : public CreatureScript } } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_ABOMINATION_KILLED, instance->GetData(DATA_ABOMINATION_KILLED) + 1); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp index e593adfbc66..75be596fd77 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp @@ -124,7 +124,7 @@ public: summon->AI()->DoZoneInCombat(); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { _JustDied(); DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp index 37c32edf0db..b826a530719 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp @@ -80,7 +80,7 @@ public: DoScriptText(SAY_SLAY, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { _JustDied(); DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp index 9e05178a8b9..37fb5f3f4a9 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp @@ -145,7 +145,7 @@ public: } } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); me->CastSpell(me, SPELL_DIES, true); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp index 86b77139661..ccc8e9a5663 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp @@ -158,7 +158,7 @@ public: DoScriptText(SAY_SLAY, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { _JustDied(); DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp index 5e87ffb8973..7552ba4f389 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp @@ -101,7 +101,7 @@ class boss_anomalus : public CreatureScript instance->SetData(DATA_ANOMALUS_EVENT, IN_PROGRESS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp index f7c523d1521..0967c38c2e7 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp @@ -251,7 +251,7 @@ class boss_steelbreaker : public CreatureScript } } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { DoScriptText(RAND(SAY_STEELBREAKER_DEATH_1, SAY_STEELBREAKER_DEATH_2), me); if (IsEncounterComplete(instance, me)) @@ -375,7 +375,7 @@ class boss_runemaster_molgeim : public CreatureScript } } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { DoScriptText(RAND(SAY_MOLGEIM_DEATH_1, SAY_MOLGEIM_DEATH_2), me); if (IsEncounterComplete(instance, me)) @@ -616,7 +616,7 @@ class boss_stormcaller_brundir : public CreatureScript } } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { DoScriptText(RAND(SAY_BRUNDIR_DEATH_1, SAY_BRUNDIR_DEATH_2), me); if (IsEncounterComplete(instance, me)) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp index 1c478cd83e9..6c2c08f07a0 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp @@ -204,7 +204,7 @@ class boss_auriaya : public CreatureScript } } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); _JustDied(); @@ -376,7 +376,7 @@ class npc_sanctum_sentry : public CreatureScript DoMeleeAttackIfReady(); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Auriaya = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_AURIAYA))) Auriaya->AI()->DoAction(ACTION_CRAZY_CAT_LADY); @@ -451,7 +451,7 @@ class npc_feral_defender : public CreatureScript DoMeleeAttackIfReady(); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { DoCast(me, SPELL_SUMMON_ESSENCE); if (Creature* Auriaya = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_AURIAYA))) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index fe221465ca0..5d68da4e75a 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -328,7 +328,7 @@ class boss_flame_leviathan : public CreatureScript DoScriptText(SAY_AGGRO, me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { _JustDied(); // Set Field Flags 67108928 = 64 | 67108864 = UNIT_FLAG_UNK_6 | UNIT_FLAG_SKINNABLE @@ -887,7 +887,7 @@ class npc_colossus : public CreatureScript InstanceScript* instance; - void JustDied(Unit* /*Who*/) + void JustDied(Unit* /*killer*/) { if (me->GetHomePosition().IsInDist(Center, 50.f)) instance->SetData(DATA_COLOSSUS, instance->GetData(DATA_COLOSSUS)+1); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index 159e2a9702b..4ea38a7642d 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -245,7 +245,7 @@ class npc_iron_roots : public CreatureScript me->SetInCombatWith(summoner); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Player* target = ObjectAccessor::GetPlayer(*me, summonerGUID)) { @@ -590,7 +590,7 @@ class boss_freya : public CreatureScript waveCount++; } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { //! Freya's chest is dynamically spawned on death by different spells. const uint32 summonSpell[2][4] = @@ -710,12 +710,12 @@ class boss_elder_brightleaf : public CreatureScript DoScriptText(RAND(SAY_BRIGHTLEAF_SLAY_1, SAY_BRIGHTLEAF_SLAY_2), me); } - void JustDied(Unit* who) + void JustDied(Unit* killer) { _JustDied(); DoScriptText(SAY_BRIGHTLEAF_DEATH, me); - if (who && who->GetTypeId() == TYPEID_PLAYER) + if (killer && killer->GetTypeId() == TYPEID_PLAYER) { if (Creature* Ironbranch = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_IRONBRANCH))) Ironbranch->AI()->DoAction(ACTION_ELDER_DEATH); @@ -830,12 +830,12 @@ class boss_elder_stonebark : public CreatureScript DoScriptText(RAND(SAY_STONEBARK_SLAY_1, SAY_STONEBARK_SLAY_2), me); } - void JustDied(Unit* who) + void JustDied(Unit* killer) { _JustDied(); DoScriptText(SAY_STONEBARK_DEATH, me); - if (who && who->GetTypeId() == TYPEID_PLAYER) + if (killer && killer->GetTypeId() == TYPEID_PLAYER) { if (Creature* Ironbranch = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_IRONBRANCH))) Ironbranch->AI()->DoAction(ACTION_ELDER_DEATH); @@ -956,12 +956,12 @@ class boss_elder_ironbranch : public CreatureScript DoScriptText(RAND(SAY_IRONBRANCH_SLAY_1, SAY_IRONBRANCH_SLAY_2), me); } - void JustDied(Unit* who) + void JustDied(Unit* killer) { _JustDied(); DoScriptText(SAY_IRONBRANCH_DEATH, me); - if (who && who->GetTypeId() == TYPEID_PLAYER) + if (killer && killer->GetTypeId() == TYPEID_PLAYER) { if (Creature* Brightleaf = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_BRIGHTLEAF))) Brightleaf->AI()->DoAction(ACTION_ELDER_DEATH); @@ -1138,7 +1138,7 @@ class npc_ancient_water_spirit : public CreatureScript DoMeleeAttackIfReady(); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Freya = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_FREYA))) { @@ -1204,7 +1204,7 @@ class npc_storm_lasher : public CreatureScript DoMeleeAttackIfReady(); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Freya = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_FREYA))) { @@ -1251,7 +1251,7 @@ class npc_snaplasher : public CreatureScript DoMeleeAttackIfReady(); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Freya = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_FREYA))) { diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp index c7918f85245..61f82d898b9 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp @@ -211,7 +211,7 @@ class boss_general_vezax : public CreatureScript DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); DoScriptText(SAY_DEATH, me); @@ -323,7 +323,7 @@ class boss_saronite_animus : public CreatureScript events.ScheduleEvent(EVENT_PROFOUND_OF_DARKNESS, 3000); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Vezax = me->GetCreature(*me, instance->GetData64(BOSS_VEZAX))) Vezax->AI()->DoAction(ACTION_ANIMUS_DIE); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index 60c4ec68e82..c9fe1c5b707 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp @@ -651,7 +651,7 @@ class npc_hodir_priest : public CreatureScript DoSpellAttackIfReady(SPELL_SMITE); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Hodir = ObjectAccessor::GetCreature(*me, instance ? instance->GetData64(BOSS_HODIR) : 0)) Hodir->AI()->DoAction(ACTION_I_HAVE_THE_COOLEST_FRIENDS); @@ -713,7 +713,7 @@ class npc_hodir_shaman : public CreatureScript DoSpellAttackIfReady(SPELL_LAVA_BURST); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Hodir = ObjectAccessor::GetCreature(*me, instance ? instance->GetData64(BOSS_HODIR) : 0)) Hodir->AI()->DoAction(ACTION_I_HAVE_THE_COOLEST_FRIENDS); @@ -774,7 +774,7 @@ class npc_hodir_druid : public CreatureScript DoSpellAttackIfReady(SPELL_WRATH); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Hodir = ObjectAccessor::GetCreature(*me, instance ? instance->GetData64(BOSS_HODIR) : 0)) Hodir->AI()->DoAction(ACTION_I_HAVE_THE_COOLEST_FRIENDS); @@ -854,7 +854,7 @@ class npc_hodir_mage : public CreatureScript DoSpellAttackIfReady(SPELL_FIREBALL); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Hodir = ObjectAccessor::GetCreature(*me, instance ? instance->GetData64(BOSS_HODIR) : 0)) Hodir->AI()->DoAction(ACTION_I_HAVE_THE_COOLEST_FRIENDS); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp index d8a3ef0b8df..5a7afc34f13 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp @@ -148,7 +148,7 @@ class boss_ignis : public CreatureScript instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEVEMENT_IGNIS_START_EVENT); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { _JustDied(); DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp index dd4a1c23d39..d89d640b083 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp @@ -135,7 +135,7 @@ class boss_kologarn : public CreatureScript eyebeamTarget = 0; } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); DoCast(SPELL_KOLOGARN_PACIFY); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index 85b5c13c6ee..a1323b07899 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp @@ -211,7 +211,7 @@ class boss_razorscale_controller : public CreatureScript } } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } @@ -354,7 +354,7 @@ class boss_razorscale : public CreatureScript events.ScheduleEvent(EVENT_FLIGHT, 0, 0, PHASE_GROUND); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); if (Creature* controller = ObjectAccessor::GetCreature(*me, instance ? instance->GetData64(DATA_RAZORSCALE_CONTROL) : 0)) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp index 72741ee0679..084cd3e0f86 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp @@ -73,7 +73,7 @@ public: DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); _JustDied(); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index 724eb45d586..727f40aef81 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -244,7 +244,7 @@ class boss_xt002 : public CreatureScript DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); _JustDied(); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp index 17ad7b36439..3db9a785f74 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp @@ -115,7 +115,7 @@ public: } } - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { if (!ghost && instance) { @@ -138,7 +138,7 @@ public: if (temp) { temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - temp->AI()->AttackStart(Killer); + temp->AI()->AttackStart(killer); } } } @@ -273,7 +273,7 @@ public: } } - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { if (!ghost && instance) { @@ -297,7 +297,7 @@ public: if (temp) { temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - temp->AI()->AttackStart(Killer); + temp->AI()->AttackStart(killer); } } } diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp index 2f4079d4e3c..dc58e51a5a1 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp @@ -189,7 +189,7 @@ class mob_tempest_minion : public CreatureScript OverchargedTimer = 0; } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (Creature* emalon = Unit::GetCreature(*me, instance ? instance->GetData64(DATA_EMALON) : 0)) { diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp index 1736861fdc6..e9d2c85e13e 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp @@ -778,7 +778,7 @@ struct violet_hold_trashAI : public npc_escortAI } } - void JustDied(Unit* /*unit*/) + void JustDied(Unit* /*killer*/) { if (Creature* portal = Unit::GetCreature((*me), instance->GetData64(DATA_TELEPORTATION_PORTAL))) CAST_AI(npc_teleportation_portal_vh::npc_teleportation_portalAI, portal->AI())->SummonedMobDied(me); diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index 17cd3ac0c09..f83538b344c 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -355,21 +355,22 @@ public: void EnterCombat(Unit* /*who*/) {} void MoveInLineOfSight(Unit* /*who*/) {} - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { - if (Killer->GetTypeId() == TYPEID_PLAYER) + Player* player = killer->ToPlayer(); + if (!player) + return; + + if (player->GetQuestStatus(11611) == QUEST_STATUS_INCOMPLETE) { - if (CAST_PLR(Killer)->GetQuestStatus(11611) == QUEST_STATUS_INCOMPLETE) + uint8 uiRand = urand(0, 99); + if (uiRand < 25) { - uint8 uiRand = urand(0, 99); - if (uiRand < 25) - { - Killer->CastSpell(me, 45532, true); - CAST_PLR(Killer)->KilledMonsterCredit(WARSONG_PEON, 0); - } - else if (uiRand < 75) - Killer->CastSpell(me, nerubarVictims[urand(0, 2)], true); + player->CastSpell(me, 45532, true); + player->KilledMonsterCredit(WARSONG_PEON, 0); } + else if (uiRand < 75) + player->CastSpell(me, nerubarVictims[urand(0, 2)], true); } } }; @@ -591,7 +592,7 @@ public: void EnterCombat(Unit* /*who*/) {} void MoveInLineOfSight(Unit* /*who*/) {} - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (GameObject* go_caribou = me->GetMap()->GetGameObject(go_caribouGUID)) go_caribou->SetLootState(GO_JUST_DEACTIVATED); @@ -1445,8 +1446,8 @@ public: pLeryssa->SetWalk(false); pLeryssa->GetMotionMaster()->MovePoint(0, 3722.114502f, 3564.201660f, 477.441437f); - if (killer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(killer)->RewardPlayerAndGroupAtEvent(NPC_PRINCE_VALANAR, 0); + if (Player* player = killer->ToPlayer()) + player->RewardPlayerAndGroupAtEvent(NPC_PRINCE_VALANAR, 0); } }; @@ -1627,7 +1628,10 @@ public: StartFollow(pCaster->ToPlayer(), 0, NULL); me->UpdateEntry(NPC_CAPTURED_BERLY_SORCERER, TEAM_NEUTRAL); DoCast(me, SPELL_COSMETIC_ENSLAVE_CHAINS_SELF, true); - CAST_PLR(pCaster)->KilledMonsterCredit(NPC_CAPTURED_BERLY_SORCERER, 0); + + if (Player* player = pCaster->ToPlayer()) + player->KilledMonsterCredit(NPC_CAPTURED_BERLY_SORCERER, 0); + bEnslaved = true; } } @@ -2111,14 +2115,17 @@ public: void JustDied(Unit* killer) { - if (killer->GetTypeId() == TYPEID_PLAYER && - CAST_PLR(killer)->GetQuestStatus(QUEST_YOU_RE_NOT_SO_BIG_NOW) == QUEST_STATUS_INCOMPLETE && + Player* player = killer->ToPlayer(); + if (!player) + return; + + if (player->GetQuestStatus(QUEST_YOU_RE_NOT_SO_BIG_NOW) == QUEST_STATUS_INCOMPLETE && (me->HasAura(SPELL_AURA_NOTSOBIG_1) || me->HasAura(SPELL_AURA_NOTSOBIG_2) || me->HasAura(SPELL_AURA_NOTSOBIG_3) || me->HasAura(SPELL_AURA_NOTSOBIG_4))) { Quest const* qInfo = sObjectMgr->GetQuestTemplate(QUEST_YOU_RE_NOT_SO_BIG_NOW); if (qInfo) - CAST_PLR(killer)->KilledMonsterCredit(qInfo->RequiredNpcOrGo[0], 0); + player->KilledMonsterCredit(qInfo->RequiredNpcOrGo[0], 0); } } }; diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp index 11725965d6d..ae1a7296de6 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp @@ -233,7 +233,7 @@ public: DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); //When Exarch Maladar is defeated D'ore appear. diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp index 9fa0bedde68..a4bba5f28fb 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp @@ -145,7 +145,7 @@ public: DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEAD, me); summons.DespawnAll(); diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp index 2b4574ef6ac..487a1dd41ea 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp @@ -68,7 +68,7 @@ public: VoidBlast_Counter = 0; } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp index 89bf5c6c342..37544f9377b 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp @@ -97,7 +97,7 @@ public: DoScriptText(RAND(SAY_AGGRO_1, SAY_AGGRO_2, SAY_AGGRO_3), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp index bfb9ee4e8cb..768c4bf12d3 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp @@ -118,7 +118,7 @@ public: DoScriptText(RAND(SAY_AGGRO_1, SAY_AGGRO_2, SAY_AGGRO_3), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp index 784adad166c..d92e76685d1 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp @@ -136,7 +136,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp index 0e1fe24f3d7..6eac36f71c8 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp @@ -96,7 +96,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp index 7e99b968b2d..e47810c74f7 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp @@ -232,7 +232,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); destroyPortals(); diff --git a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp index 956b28f4c9b..7ae09e925a5 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp @@ -130,7 +130,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_GURTOGGBLOODBOILEVENT, DONE); diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp index e9dd3e516b6..f5b2e3efa92 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -149,7 +149,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_MOTHERSHAHRAZEVENT, DONE); diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp index c83fa4ac62c..70f27d6caf9 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -643,7 +643,7 @@ public: DoCast(me, AURA_OF_ANGER, true); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(ANGER_SAY_DEATH, me); } diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp index 00113181a39..4edd8b23a47 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp @@ -293,7 +293,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_TERONGOREFIENDEVENT, DONE); diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp index 7d88a3b0ad4..5b2bb8e7bf5 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp @@ -98,7 +98,7 @@ public: events.DelayEvents(5000, GCD_YELL); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, DONE); diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index 89e0073c5cd..a0e85e1b334 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -498,7 +498,7 @@ public: DoScriptText(SAY_GATH_SLAY, me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_GATH_DEATH, me); } @@ -632,7 +632,7 @@ public: DoScriptText(SAY_ZERE_SLAY, me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_ZERE_DEATH, me); } @@ -732,7 +732,7 @@ public: DoScriptText(SAY_MALA_SLAY, me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_MALA_DEATH, me); } @@ -818,7 +818,7 @@ public: DoScriptText(SAY_VERA_SLAY, me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_VERA_DEATH, me); } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp index 287b5ff8a43..9af79de7426 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -354,7 +354,7 @@ public: instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) { @@ -494,7 +494,7 @@ public: instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) { @@ -621,7 +621,7 @@ public: instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) { diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp index 4f679da6d98..7abd2bbc8a8 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp @@ -203,7 +203,7 @@ public: Summons.Despawn(summon); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (CorruptedForm) DoScriptText(SAY_CORRUPT_DEATH, me); diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index c498c41a068..b614a5afa3a 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -226,7 +226,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp index ad718504465..35d5ab7793b 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp @@ -109,7 +109,7 @@ public: return 0; } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { Unit* unit = Unit::GetUnit((*me), victimGUID); if (unit && unit->HasAura(SPELL_INSIDIOUS_WHISPER)) @@ -399,7 +399,7 @@ public: } } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); @@ -641,7 +641,7 @@ public: DoScriptText(RAND(SAY_DEMON_SLAY1, SAY_DEMON_SLAY2, SAY_DEMON_SLAY3), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { //invisibility (blizzlike, at the end of the fight he doesn't die, he disappears) DoCast(me, 8149, true); diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp index e1147f9c18f..865fb143800 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp @@ -140,7 +140,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp index 383f1467566..48c5a360619 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp @@ -79,7 +79,7 @@ public: instance->SetData(TYPE_HYDROMANCER_THESPIA, NOT_STARTED); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEAD, me); diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp index b27bbe36dc5..77f521e5094 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp @@ -88,7 +88,7 @@ public: instance->SetData(TYPE_MEKGINEER_STEAMRIGGER, NOT_STARTED); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp index 8c700313ca5..cae1117805a 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp @@ -157,7 +157,7 @@ public: me->RemoveAurasDueToSpell(SPELL_WARLORDS_RAGE_PROC); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp index c76be6bbb5f..f7079e5c664 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp @@ -88,7 +88,7 @@ public: } } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { for (std::list::const_iterator i = Striders.begin(); i != Striders.end(); ++i) if (Creature* strider = Unit::GetCreature(*me, *i)) diff --git a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp index ff116d880be..0e654ade995 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp @@ -109,7 +109,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp index ee8e64029f9..de4b23d5f6d 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp @@ -173,7 +173,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); @@ -363,7 +363,7 @@ public: } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) { @@ -478,7 +478,7 @@ public: } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) { @@ -598,7 +598,7 @@ public: } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) { @@ -708,7 +708,7 @@ public: } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) { diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp index 42398b9557b..f6b7518661e 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp @@ -121,7 +121,7 @@ class boss_broggok : public CreatureScript DoMeleeAttackIfReady(); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (instance) { diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp index 082d7df10d6..01873afeaa9 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp @@ -185,7 +185,7 @@ class boss_kelidan_the_breaker : public CreatureScript } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DIE, me); @@ -326,10 +326,10 @@ class mob_shadowmoon_channeler : public CreatureScript DoStartMovement(who); } - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { if (Creature* Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) - CAST_AI(boss_kelidan_the_breaker::boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerDied(Killer); + CAST_AI(boss_kelidan_the_breaker::boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerDied(killer); } void UpdateAI(const uint32 diff) diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp index 186b26b2b60..dc9f83b073d 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp @@ -94,7 +94,7 @@ class boss_the_maker : public CreatureScript DoScriptText(RAND(SAY_KILL_1, SAY_KILL_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DIE, me); diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp index 72123683d63..2ab2b2b5b2e 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp @@ -113,7 +113,7 @@ class boss_omor_the_unscarred : public CreatureScript ++SummonedCount; } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DIE, me); } diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp index 1867f90bb8a..a5cdebea754 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp @@ -236,9 +236,9 @@ class boss_vazruden : public CreatureScript DoScriptText(RAND(SAY_KILL_1, SAY_KILL_2), me); } - void JustDied(Unit* who) + void JustDied(Unit* killer) { - if (who && who != me) + if (killer && killer != me) DoScriptText(SAY_DIE, me); } @@ -480,10 +480,10 @@ class mob_hellfire_sentry : public CreatureScript void EnterCombat(Unit* /*who*/) {} - void JustDied(Unit* who) + void JustDied(Unit* killer) { if (Creature* herald = me->FindNearestCreature(ENTRY_VAZRUDEN_HERALD, 150)) - CAST_AI(boss_vazruden_the_herald::boss_vazruden_the_heraldAI, herald->AI())->SentryDownBy(who); + CAST_AI(boss_vazruden_the_herald::boss_vazruden_the_heraldAI, herald->AI())->SentryDownBy(killer); } void UpdateAI(const uint32 diff) diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp index 55ad59e39ce..2c00a68321a 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp @@ -109,7 +109,7 @@ class boss_watchkeeper_gargolmar : public CreatureScript DoScriptText(RAND(SAY_KILL_1, SAY_KILL_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DIE, me); } diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp index bdfc3dd3bf3..1b29abf1afc 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp @@ -322,7 +322,7 @@ class boss_magtheridon : public CreatureScript DoScriptText(SAY_PLAYER_KILLED, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_MAGTHERIDON_EVENT, DONE); @@ -533,7 +533,7 @@ class mob_hellfire_channeler : public CreatureScript DoCast(me, SPELL_SOUL_TRANSFER, true); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_CHANNELER_EVENT, DONE); diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp index 59c56114bf8..7dfdc40a787 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp @@ -224,7 +224,7 @@ class boss_grand_warlock_nethekurse : public CreatureScript DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DIE, me); @@ -356,7 +356,7 @@ class mob_fel_orc_convert : public CreatureScript } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) { diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp index 1d5218ae34d..5371473e21e 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp @@ -295,7 +295,7 @@ class boss_warbringer_omrogg : public CreatureScript } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { Unit* pLeftHead = Unit::GetUnit(*me, LeftHeadGUID); Unit* pRightHead = Unit::GetUnit(*me, RightHeadGUID); diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp index a6b1d4772b9..f92a163f553 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp @@ -137,7 +137,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); removeAdds(); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index 63fb4f17169..074ce08ca33 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -145,7 +145,7 @@ class boss_alar : public CreatureScript me->setActive(true); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_ALAREVENT, DONE); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp index f6a5d429182..010b741caef 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp @@ -151,7 +151,7 @@ class boss_high_astromancer_solarian : public CreatureScript DoScriptText(RAND(SAY_KILL1, SAY_KILL2, SAY_KILL3), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize); me->SetDisplayId(MODEL_HUMAN); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index a70aabe3d85..318d9c629b9 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -450,7 +450,7 @@ class boss_kaelthas : public CreatureScript summons.Despawn(summon); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); @@ -1137,7 +1137,7 @@ class boss_lord_sanguinar : public CreatureScript DoScriptText(SAY_SANGUINAR_AGGRO, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3) DoScriptText(SAY_SANGUINAR_DEATH, me); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp index bad35d0a685..275a72e75ac 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp @@ -85,7 +85,7 @@ class boss_void_reaver : public CreatureScript DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); DoZoneInCombat(); diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp index b8b0ffd4d2e..a1287a57402 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp @@ -86,7 +86,7 @@ class boss_gatewatcher_iron_hand : public CreatureScript DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH_1, me); //TODO: Add door check/open code diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp index 7e435187be9..59837fdbed1 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp @@ -101,7 +101,7 @@ class boss_nethermancer_sepethrea : public CreatureScript DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); if (instance) diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp index cdc3b799b2c..3a4d449707d 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp @@ -103,7 +103,7 @@ class boss_pathaleon_the_calculator : public CreatureScript DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp index 24ea29702f5..d675b438968 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp @@ -128,7 +128,7 @@ class npc_millhouse_manastorm : public CreatureScript Talk(SAY_KILL); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { Talk(SAY_DEATH); diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp index de86ec8672c..c2eeaf9fe7a 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp @@ -112,7 +112,7 @@ class boss_harbinger_skyriss : public CreatureScript void EnterCombat(Unit* /*who*/) {} - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); if (instance) diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp index 178495ff25a..ba61a1bfb12 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp @@ -107,7 +107,7 @@ class boss_high_botanist_freywinn : public CreatureScript DoScriptText(RAND(SAY_KILL_1, SAY_KILL_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp index 09674fa98d0..3acde2455db 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp @@ -169,7 +169,7 @@ class boss_warp_splinter : public CreatureScript DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp index dbdd369dc82..147d2d60359 100644 --- a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp +++ b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp @@ -97,7 +97,7 @@ class boss_doomlord_kazzak : public CreatureScript Talk(SAY_KILL); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { Talk(SAY_DEATH); } diff --git a/src/server/scripts/Outland/boss_doomwalker.cpp b/src/server/scripts/Outland/boss_doomwalker.cpp index 664ad215c72..67834601d6f 100644 --- a/src/server/scripts/Outland/boss_doomwalker.cpp +++ b/src/server/scripts/Outland/boss_doomwalker.cpp @@ -79,7 +79,7 @@ class boss_doomwalker : public CreatureScript Talk(SAY_SLAY); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { Talk(SAY_DEATH); } diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index f9aaf87fa8a..46257f32ee2 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -1398,27 +1398,25 @@ public: DoMeleeAttackIfReady(); } - void JustDied(Unit* slayer) + void JustDied(Unit* killer) { - if (slayer) - switch (slayer->GetTypeId()) - { - case TYPEID_UNIT: - if (Unit* owner = slayer->GetOwner()) - if (owner->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(owner)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me); - break; - - case TYPEID_PLAYER: - CAST_PLR(slayer)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me); - break; - default: - break; - } + switch (killer->GetTypeId()) + { + case TYPEID_UNIT: + if (Unit* owner = killer->GetOwner()) + if (owner->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(owner)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me); + break; + case TYPEID_PLAYER: + CAST_PLR(killer)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me); + break; + default: + break; + } if (Creature* LordIllidan = (Unit::GetCreature(*me, LordIllidanGUID))) { - DoScriptText(END_TEXT, LordIllidan, slayer); + DoScriptText(END_TEXT, LordIllidan, killer); LordIllidan->AI()->EnterEvadeMode(); } } @@ -1599,7 +1597,8 @@ public: } void EnterCombat(Unit* /*who*/) {} - void JustDied(Unit* /*slayer*/) + + void JustDied(Unit* /*killer*/) { me->RemoveCorpse(); if (Creature* LordIllidan = (Unit::GetCreature(*me, LordIllidanGUID))) diff --git a/src/server/scripts/Outland/terokkar_forest.cpp b/src/server/scripts/Outland/terokkar_forest.cpp index b8f4be9e599..6c2214cde37 100644 --- a/src/server/scripts/Outland/terokkar_forest.cpp +++ b/src/server/scripts/Outland/terokkar_forest.cpp @@ -306,24 +306,26 @@ public: void EnterCombat(Unit* /*who*/) { } void MoveInLineOfSight(Unit* /*who*/) { } - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { - if (Killer->GetTypeId() == TYPEID_PLAYER) - { - if (CAST_PLR(Killer)->GetQuestStatus(10873) == QUEST_STATUS_INCOMPLETE) - { - if (rand()%100 < 25) - { - me->SummonCreature(QUEST_TARGET, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - CAST_PLR(Killer)->KilledMonsterCredit(QUEST_TARGET, 0); - } - else - me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + Player* player = killer->ToPlayer(); + if (!player) + return; - if (rand()%100 < 75) - me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + if (player->GetQuestStatus(10873) == QUEST_STATUS_INCOMPLETE) + { + if (rand()%100 < 25) + { + me->SummonCreature(QUEST_TARGET, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + player->KilledMonsterCredit(QUEST_TARGET, 0); } + else + me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + + if (rand()%100 < 75) + me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + + me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); } } }; From 68fdf2a12f9baf2a31cb98435106397f9b32c4cb Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 31 Mar 2012 14:16:48 +0200 Subject: [PATCH 0374/1149] Core/DBLayer: Added missing prepared statement implementation for uint8/16 --- .../shared/Database/PreparedStatement.cpp | 46 +++++++++++++++---- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/src/server/shared/Database/PreparedStatement.cpp b/src/server/shared/Database/PreparedStatement.cpp index dd1b85f70a6..db26dabaee7 100755 --- a/src/server/shared/Database/PreparedStatement.cpp +++ b/src/server/shared/Database/PreparedStatement.cpp @@ -42,12 +42,20 @@ void PreparedStatement::BindParameters() m_stmt->setBool(i, statement_data[i].data.boolean); break; case TYPE_UI8: + m_stmt->setUInt8(i, statement_data[i].data.ui8); + break; case TYPE_UI16: + m_stmt->setUInt16(i, statement_data[i].data.ui16); + break; case TYPE_UI32: m_stmt->setUInt32(i, statement_data[i].data.ui32); break; case TYPE_I8: + m_stmt->setInt8(i, statement_data[i].data.i8); + break; case TYPE_I16: + m_stmt->setInt16(i, statement_data[i].data.i16); + break; case TYPE_I32: m_stmt->setInt32(i, statement_data[i].data.i32); break; @@ -89,7 +97,7 @@ void PreparedStatement::setUInt8(const uint8 index, const uint8 value) if (index >= statement_data.size()) statement_data.resize(index+1); - statement_data[index].data.ui32 = value; + statement_data[index].data.ui8 = value; statement_data[index].type = TYPE_UI8; } @@ -98,7 +106,7 @@ void PreparedStatement::setUInt16(const uint8 index, const uint16 value) if (index >= statement_data.size()) statement_data.resize(index+1); - statement_data[index].data.ui32 = value; + statement_data[index].data.ui16 = value; statement_data[index].type = TYPE_UI16; } @@ -125,7 +133,7 @@ void PreparedStatement::setInt8(const uint8 index, const int8 value) if (index >= statement_data.size()) statement_data.resize(index+1); - statement_data[index].data.i32 = value; + statement_data[index].data.i8 = value; statement_data[index].type = TYPE_I8; } @@ -134,7 +142,7 @@ void PreparedStatement::setInt16(const uint8 index, const int16 value) if (index >= statement_data.size()) statement_data.resize(index+1); - statement_data[index].data.i32 = value; + statement_data[index].data.i16 = value; statement_data[index].type = TYPE_I16; } @@ -235,17 +243,23 @@ bool MySQLPreparedStatement::CheckValidIndex(uint8 index) void MySQLPreparedStatement::setBool(const uint8 index, const bool value) { - setUInt32(index, value); + setUInt8(index, value ? 1 : 0); } void MySQLPreparedStatement::setUInt8(const uint8 index, const uint8 value) { - setUInt32(index, value); + CheckValidIndex(index); + m_paramsSet[index] = true; + MYSQL_BIND* param = &m_bind[index]; + setValue(param, MYSQL_TYPE_TINY, &value, sizeof(uint8), true); } void MySQLPreparedStatement::setUInt16(const uint8 index, const uint16 value) { - setUInt32(index, value); + CheckValidIndex(index); + m_paramsSet[index] = true; + MYSQL_BIND* param = &m_bind[index]; + setValue(param, MYSQL_TYPE_SHORT, &value, sizeof(uint16), true); } void MySQLPreparedStatement::setUInt32(const uint8 index, const uint32 value) @@ -266,12 +280,18 @@ void MySQLPreparedStatement::setUInt64(const uint8 index, const uint64 value) void MySQLPreparedStatement::setInt8(const uint8 index, const int8 value) { - setInt32(index, value); + CheckValidIndex(index); + m_paramsSet[index] = true; + MYSQL_BIND* param = &m_bind[index]; + setValue(param, MYSQL_TYPE_TINY, &value, sizeof(int8), false); } void MySQLPreparedStatement::setInt16(const uint8 index, const int16 value) { - setInt32(index, value); + CheckValidIndex(index); + m_paramsSet[index] = true; + MYSQL_BIND* param = &m_bind[index]; + setValue(param, MYSQL_TYPE_SHORT, &value, sizeof(int16), false); } void MySQLPreparedStatement::setInt32(const uint8 index, const int32 value) @@ -353,12 +373,20 @@ std::string MySQLPreparedStatement::getQueryString(const char *query) replace << (m_stmt->statement_data[i].data.boolean ? '1' : '0'); break; case TYPE_UI8: + replace << uint16(m_stmt->statement_data[i].data.ui8); // stringstream will append a character with that code instead of numeric representation + break; case TYPE_UI16: + replace << m_stmt->statement_data[i].data.ui16; + break; case TYPE_UI32: replace << m_stmt->statement_data[i].data.ui32; break; case TYPE_I8: + replace << int16(m_stmt->statement_data[i].data.i8); // stringstream will append a character with that code instead of numeric representation + break; case TYPE_I16: + replace << m_stmt->statement_data[i].data.i16; + break; case TYPE_I32: replace << m_stmt->statement_data[i].data.i32; break; From c71f75e9ca0a06e93c41865e26ec124e650ea134 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 31 Mar 2012 15:13:56 +0100 Subject: [PATCH 0375/1149] Core/Logging: Fix a typo in DebugLogFilters - Database & AI Thanks to Garthog for finding it --- src/server/shared/Database/Implementation/CharacterDatabase.cpp | 2 +- src/server/shared/Logging/Log.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 9d29aa6f9a9..22de70b993b 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -245,7 +245,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() // Account data PREPARE_STATEMENT(CHAR_SEL_ACCOUNT_DATA, "SELECT type, time, data FROM account_data WHERE accountId = ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_REP_ACCOUNT_DATA, "REPLACE INTO account_data(accountId, type, time, data) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_REP_ACCOUNT_DATA, "REPLACE INTO account_data (accountId, type, time, data) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_ACCOUNT_DATA, "DELETE FROM account_data WHERE accountId = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_PLAYER_ACCOUNT_DATA, "SELECT type, time, data FROM character_account_data WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_REP_PLAYER_ACCOUNT_DATA, "REPLACE INTO character_account_data(guid, type, time, data) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) diff --git a/src/server/shared/Logging/Log.h b/src/server/shared/Logging/Log.h index 9ee9d83ad3f..296c13d86c9 100755 --- a/src/server/shared/Logging/Log.h +++ b/src/server/shared/Logging/Log.h @@ -31,7 +31,7 @@ enum DebugLogFilters LOG_FILTER_PETS = 0x00000002, LOG_FILTER_VEHICLES = 0x00000004, LOG_FILTER_TSCR = 0x00000008, // C++ AI, instance scripts, etc. - LOG_FILTER_DATABASE_AI = 0x08000010, // SmartAI, EventAI, CreatureAI + LOG_FILTER_DATABASE_AI = 0x00000010, // SmartAI, EventAI, CreatureAI LOG_FILTER_MAPSCRIPTS = 0x00000020, LOG_FILTER_NETWORKIO = 0x00000040, // Anything packet/netcode related LOG_FILTER_SPELLS_AURAS = 0x00000080, From 91c7b5d2ca6cc1a51eabdc0ee9bcbe3d22c8a76a Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 31 Mar 2012 15:48:40 +0100 Subject: [PATCH 0376/1149] Core/DBLayer: Delete a triplicated prepared statement (LoginDatabase) Thanks to Anubiss for spotting it --- src/server/game/Battlegrounds/ArenaTeamMgr.cpp | 8 ++++---- src/server/game/Chat/Commands/Level3.cpp | 4 ++-- .../shared/Database/Implementation/LoginDatabase.cpp | 2 -- src/server/shared/Database/Implementation/LoginDatabase.h | 2 -- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp index ab451a38fa8..1c24dfc061d 100644 --- a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp +++ b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp @@ -94,10 +94,10 @@ void ArenaTeamMgr::LoadArenaTeams() // Clean out the trash before loading anything CharacterDatabase.Execute("DELETE FROM arena_team_member WHERE arenaTeamId NOT IN (SELECT arenaTeamId FROM arena_team)"); // One-time query - // 0 1 2 3 4 5 6 7 8 - QueryResult result = CharacterDatabase.Query("SELECT arena_team.arenaTeamId, name, captainGuid, type, backgroundColor, emblemStyle, emblemColor, borderStyle, borderColor, " - // 9 10 11 12 13 14 - "rating, weekGames, weekWins, seasonGames, seasonWins, rank FROM arena_team ORDER BY arena_team.arenaTeamId ASC"); + // 0 1 2 3 4 5 6 7 8 + QueryResult result = CharacterDatabase.Query("SELECT arenaTeamId, name, captainGuid, type, backgroundColor, emblemStyle, emblemColor, borderStyle, borderColor, " + // 9 10 11 12 13 14 + "rating, weekGames, weekWins, seasonGames, seasonWins, rank FROM arena_team ORDER BY arenaTeamId ASC"); if (!result) { diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index a88bf06898c..062f04bf4dd 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -3302,7 +3302,7 @@ bool ChatHandler::HandleBanListCharacterCommand(const char *args) bool ChatHandler::HandleBanListAccountCommand(const char *args) { - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_OLD_BANS); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS); LoginDatabase.Execute(stmt); char* cFilter = strtok((char*)args, " "); @@ -3410,7 +3410,7 @@ bool ChatHandler::HandleBanListHelper(PreparedQueryResult result) bool ChatHandler::HandleBanListIPCommand(const char *args) { - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_OLD_IP_BANS); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS); LoginDatabase.Execute(stmt); char* cFilter = strtok((char*)args, " "); diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp index df92c6fa77c..70d874be31d 100755 --- a/src/server/shared/Database/Implementation/LoginDatabase.cpp +++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp @@ -56,8 +56,6 @@ void LoginDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(LOGIN_SEL_SUM_REALM_CHARACTERS, "SELECT SUM(numchars) FROM realmcharacters WHERE acctid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(LOGIN_INS_ACCOUNT, "INSERT INTO account(username, sha_pass_hash, joindate) VALUES(?, ?, NOW())", CONNECTION_ASYNC); PREPARE_STATEMENT(LOGIN_INS_REALM_CHARACTERS_INIT, "INSERT INTO realmcharacters (realmid, acctid, numchars) SELECT realmlist.id, account.id, 0 FROM realmlist, account LEFT JOIN realmcharacters ON acctid=account.id WHERE acctid IS NULL", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_DEL_OLD_BANS, "DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_DEL_OLD_IP_BANS, "DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate", CONNECTION_ASYNC); PREPARE_STATEMENT(LOGIN_UPD_EXPANSION, "UPDATE account SET expansion = ? WHERE id = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(LOGIN_UPD_ACCOUNT_LOCK, "UPDATE account SET locked = ? WHERE id = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(LOGIN_INS_LOG, "INSERT INTO logs (time, realm, type, string) VALUES (UNIX_TIMESTAMP(), ? , ?, ?)", CONNECTION_ASYNC); diff --git a/src/server/shared/Database/Implementation/LoginDatabase.h b/src/server/shared/Database/Implementation/LoginDatabase.h index 4ad9ac1a251..2b9d94cbceb 100755 --- a/src/server/shared/Database/Implementation/LoginDatabase.h +++ b/src/server/shared/Database/Implementation/LoginDatabase.h @@ -76,8 +76,6 @@ enum LoginDatabaseStatements LOGIN_SEL_SUM_REALM_CHARACTERS, LOGIN_INS_ACCOUNT, LOGIN_INS_REALM_CHARACTERS_INIT, - LOGIN_DEL_OLD_BANS, - LOGIN_DEL_OLD_IP_BANS, LOGIN_UPD_EXPANSION, LOGIN_UPD_ACCOUNT_LOCK, LOGIN_INS_LOG, From e3ae7ba498d3c9690f1a3ba4e4847f415debcccf Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 31 Mar 2012 16:31:42 +0100 Subject: [PATCH 0377/1149] Core/Config: Add SQLDriverQueryLogging to authserver.conf (disabled by default, just like worldserver) --- src/server/authserver/authserver.conf.dist | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/server/authserver/authserver.conf.dist b/src/server/authserver/authserver.conf.dist index 86423d53e18..e9ed4bd752d 100644 --- a/src/server/authserver/authserver.conf.dist +++ b/src/server/authserver/authserver.conf.dist @@ -110,6 +110,14 @@ DebugLogMask = 64 SQLDriverLogFile = "" +# +# SQLDriverQueryLogging +# Description: Log SQL queries to the SQLDriverLogFile and console. +# Default: 0 - (Disabled, Query errors only) +# 1 - (Enabled, Full query logging - may have performance impact) + +SQLDriverQueryLogging = 0 + # # LogTimestamp # Description: Append timestamp to the server log file name. From 0b645a825d73f4e38d5c131c8ff8ee52aa796d2b Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 31 Mar 2012 17:47:18 +0100 Subject: [PATCH 0378/1149] Core/DBLayer: More type fixes --- src/server/authserver/Realms/RealmList.cpp | 18 +++++++++--------- src/server/game/Chat/Commands/Level3.cpp | 8 ++++---- src/server/game/Handlers/MailHandler.cpp | 2 +- src/server/game/Tickets/TicketMgr.cpp | 4 ++++ 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/server/authserver/Realms/RealmList.cpp b/src/server/authserver/Realms/RealmList.cpp index f856156825d..d988b940809 100755 --- a/src/server/authserver/Realms/RealmList.cpp +++ b/src/server/authserver/Realms/RealmList.cpp @@ -70,7 +70,7 @@ void RealmList::UpdateRealms(bool init) { sLog->outDetail("Updating Realm List..."); - PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST); PreparedQueryResult result = LoginDatabase.Query(stmt); // Circle through results and add them to the realm map @@ -79,16 +79,16 @@ void RealmList::UpdateRealms(bool init) do { Field* fields = result->Fetch(); - uint32 realmId = fields[0].GetUInt32(); - const std::string& name = fields[1].GetString(); + uint32 realmId = fields[0].GetUInt32(); + const std::string& name = fields[1].GetString(); const std::string& address = fields[2].GetString(); - uint16 port = fields[3].GetUInt16(); - uint8 icon = fields[4].GetUInt8(); - RealmFlags flag = RealmFlags(fields[5].GetUInt8()); - uint8 timezone = fields[6].GetUInt8(); + uint16 port = fields[3].GetUInt16(); + uint8 icon = fields[4].GetUInt8(); + RealmFlags flag = RealmFlags(fields[5].GetUInt8()); + uint8 timezone = fields[6].GetUInt8(); uint8 allowedSecurityLevel = fields[7].GetUInt8(); - float pop = fields[8].GetFloat(); - uint32 build = fields[9].GetUInt32(); + float pop = fields[8].GetFloat(); + uint32 build = fields[9].GetUInt32(); UpdateRealm(realmId, name, address, port, icon, flag, timezone, (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop, build); diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 062f04bf4dd..d3417705867 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -427,7 +427,7 @@ bool ChatHandler::HandleListItemCommand(const char *args) result = CharacterDatabase.Query(stmt); if (result) - inv_count = (*result)[0].GetUInt32(); + inv_count = (*result)[0].GetUInt64(); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_INVENTORY_ITEM_BY_ENTRY); stmt->setUInt32(0, item_id); @@ -476,7 +476,7 @@ bool ChatHandler::HandleListItemCommand(const char *args) result = CharacterDatabase.Query(stmt); if (result) - mail_count = (*result)[0].GetUInt32(); + mail_count = (*result)[0].GetUInt64(); if (count > 0) { @@ -523,7 +523,7 @@ bool ChatHandler::HandleListItemCommand(const char *args) result = CharacterDatabase.Query(stmt); if (result) - auc_count = (*result)[0].GetUInt32(); + auc_count = (*result)[0].GetUInt64(); if (count > 0) { @@ -560,7 +560,7 @@ bool ChatHandler::HandleListItemCommand(const char *args) result = CharacterDatabase.Query(stmt); if (result) - guild_count = (*result)[0].GetUInt32(); + guild_count = (*result)[0].GetUInt64(); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY); stmt->setUInt32(0, item_id); diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 187b12d5d2e..c30cbaa622e 100755 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -138,7 +138,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) if (result) { Field* fields = result->Fetch(); - mails_count = fields[0].GetUInt32(); + mails_count = fields[0].GetUInt64(); } stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_LEVEL); diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index 930bf0d3372..68e28014319 100755 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -65,6 +65,8 @@ GmTicket::~GmTicket() { } bool GmTicket::LoadFromDB(Field* fields) { + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + // ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, completed, escalated, viewed uint8 index = 0; _id = fields[ index].GetUInt32(); _playerGuid = MAKE_NEW_GUID(fields[++index].GetUInt32(), 0, HIGHGUID_PLAYER); @@ -87,6 +89,8 @@ bool GmTicket::LoadFromDB(Field* fields) void GmTicket::SaveToDB(SQLTransaction& trans) const { + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + // ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, completed, escalated, viewed uint8 index = 0; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GM_TICKET); stmt->setUInt32( index, _id); From 343a93a56f48ba760c0a38cd45cc597955883bff Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sat, 31 Mar 2012 19:20:38 +0200 Subject: [PATCH 0379/1149] DB/Loot: Antechamber of Ulduar reworked --- ..._03_31_00_world_creature_loot_template.sql | 191 ++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 sql/updates/world/2012_03_31_00_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_03_31_00_world_creature_loot_template.sql b/sql/updates/world/2012_03_31_00_world_creature_loot_template.sql new file mode 100644 index 00000000000..a817cdccf50 --- /dev/null +++ b/sql/updates/world/2012_03_31_00_world_creature_loot_template.sql @@ -0,0 +1,191 @@ +-- ------------------------------- +-- -- The Antechamber of Ulduar -- +-- ------------------------------- +-- Creatures +SET @Brundir10 :=32857; +call `sp_get_npc_diffentry`(@Brundir10,1,@Brundir25); -- Get 25man id using procedure +SET @Molgeim10 :=32927; +call `sp_get_npc_diffentry`(@Molgeim10,1,@Molgeim25); -- Get 25man id using procedure +SET @Steelbreaker10 :=32867; +call `sp_get_npc_diffentry`(@Steelbreaker10,1,@Steelbreaker25); -- Get 25man id using procedure +SET @Auriaya10 :=33515; +call `sp_get_npc_diffentry`(@Auriaya10,1,@Auriaya25); -- Get 25man id using procedure +-- Gameobjects +SET @Kologarn10 := 195046; -- Cache of the Living Stone 10man +CALL `sp_get_go_lootid`(@Kologarn10,@CacheLivingStone10); -- Get Lootid from data1 field using procedure +SET @Kologarn25 := 195047; -- Cache of the Living Stone 25man +CALL `sp_get_go_lootid`(@Kologarn25,@CacheLivingStone25); -- Get Lootid from data1 field using procedure +-- bosses +SET @Assembly10Ref := 34359; +SET @Assembly25Ref := @Assembly10Ref+1; +SET @Kologarn10Ref := @Assembly10Ref+2; +SET @Kologarn25Ref := @Assembly10Ref+3; +SET @Auriaya10Ref := @Assembly10Ref+4; +SET @Auriaya25Ref := @Assembly10Ref+5; + +-- ------------------------------ +-- -- Reference Loot Templates -- +-- ------------------------------ +-- Delete previous templates if existing +DELETE FROM `reference_loot_template` WHERE `entry` IN (12019,34122,34123,34124,34163,34216); +-- Delete the current if existing & add +DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN @Assembly10Ref AND @Assembly10Ref+5; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Assembly Of Iron 10man +(@Assembly10Ref,45322,0,1,1,1,1), -- Cloak of the Iron Council +(@Assembly10Ref,45324,0,1,1,1,1), -- Leggings of Swift Reflexes +(@Assembly10Ref,45329,0,1,1,1,1), -- Circlet of True Sight +(@Assembly10Ref,45330,0,1,1,1,1), -- Greaves of Iron Intensity +(@Assembly10Ref,45331,0,1,1,1,1), -- Rune-Etched Nightblade +(@Assembly10Ref,45332,0,1,1,1,1), -- Stormtip +(@Assembly10Ref,45333,0,1,1,1,1), -- Belt of the Iron Servant +(@Assembly10Ref,45378,0,1,1,1,1), -- Boots of the Petrified Forest +(@Assembly10Ref,45418,0,1,1,1,1), -- Lady Maye's Sapphire Ring +(@Assembly10Ref,45423,0,1,1,1,1), -- Runetouch Wristwraps +-- Assembly Of Iron 25man +(@Assembly25Ref,45233,0,1,1,1,1), -- Stormrune Edge +(@Assembly25Ref,45234,0,1,1,1,1), -- Rapture +(@Assembly25Ref,45237,0,1,1,1,1), -- Phaelia's Vestments of the Sprouting Seed +(@Assembly25Ref,45193,0,1,1,1,1), -- Insurmountable Fervor +(@Assembly25Ref,45236,0,1,1,1,1), -- Unblinking Eye +(@Assembly25Ref,45225,0,1,1,1,1), -- Steelbreaker's Embrace +(@Assembly25Ref,45240,0,1,1,1,1), -- Raiments of the Iron Council +(@Assembly25Ref,45226,0,1,1,1,1), -- Ancient Iron Heaume +(@Assembly25Ref,45235,0,1,1,1,1), -- Radiant Seal +(@Assembly25Ref,45227,0,1,1,1,1), -- Iron-studded Mantle +(@Assembly25Ref,45239,0,1,1,1,1), -- Runeshaper's Gloves +(@Assembly25Ref,45224,0,1,1,1,1), -- Drape of the Lithe +(@Assembly25Ref,45232,0,1,1,1,1), -- Runed Ironhide Boots +(@Assembly25Ref,45228,0,1,1,1,1), -- Handguards of the Enclave +(@Assembly25Ref,45238,0,1,1,1,1), -- Overload Legwraps +-- Cache of Living Stone 10man +(@Kologarn10Ref,45701,0,1,1,1,1), -- Greaves of the Earthbinder +(@Kologarn10Ref,45965,0,1,1,1,1), -- Spire of Withering Dreams +(@Kologarn10Ref,45702,0,1,1,1,1), -- Emerald Signet Ring +(@Kologarn10Ref,45696,0,1,1,1,1), -- Mark of the Unyielding +(@Kologarn10Ref,45698,0,1,1,1,1), -- Sabatons of the Iron Watcher +(@Kologarn10Ref,45697,0,1,1,1,1), -- Shoulderguards of the Solemn Watch +(@Kologarn10Ref,45703,0,2,2,1,1), -- Spark of Hope +(@Kologarn10Ref,45700,0,2,2,1,1), -- Stoneguard +(@Kologarn10Ref,45699,0,2,2,1,1), -- Pendant of the Piercing Glare +(@Kologarn10Ref,45704,0,2,2,1,1), -- Shawl of the Shattered Giant +-- Cache of Living Stone 25man +(@Kologarn25Ref,45261,0,1,1,1,1), -- Giant's Bane +(@Kologarn25Ref,45266,0,1,1,1,1), -- Malice +(@Kologarn25Ref,45274,0,1,1,1,1), -- Leggings of the Stoneweaver +(@Kologarn25Ref,45269,0,1,1,1,1), -- Unfaltering Armguards +(@Kologarn25Ref,45268,0,1,1,1,1), -- Gloves of the Pythonic Guardian +(@Kologarn25Ref,45262,0,1,1,1,1), -- Necklace of Unerring Mettle +(@Kologarn25Ref,45275,0,1,1,1,1), -- Bracers of Unleashed Magic +(@Kologarn25Ref,45272,0,1,1,1,1), -- Robes of the Umbral Brute +(@Kologarn25Ref,45267,0,1,1,1,1), -- Saronite Plated Legguards +(@Kologarn25Ref,45263,0,1,1,1,1), -- Wrathstone +(@Kologarn25Ref,45271,0,1,1,1,1), -- Ironmender +(@Kologarn25Ref,45264,0,1,1,1,1), -- Decimator's Armguards +(@Kologarn25Ref,45265,0,1,1,1,1), -- Shoulderpads of the Monolith +(@Kologarn25Ref,45273,0,1,1,1,1), -- Handwraps of Plentiful Recovery +(@Kologarn25Ref,45270,0,1,1,1,1), -- Idol of the Crying Wind +-- Auriaya 10man +(@Auriaya10Ref,45707,0,1,1,1,1), -- Shieldwall of the Breaker +(@Auriaya10Ref,45708,0,1,1,1,1), -- Archaedas' Lost Legplates +(@Auriaya10Ref,45709,0,1,1,1,1), -- Nimble Climber's Belt +(@Auriaya10Ref,45711,0,1,1,1,1), -- Ironaya's Discarded Mantle +(@Auriaya10Ref,45712,0,1,1,1,1), -- Chestplate of Titanic Fury +(@Auriaya10Ref,45713,0,1,1,1,1), -- Nurturing Touch +(@Auriaya10Ref,45832,0,1,1,1,1), -- Mantle of the Preserver +(@Auriaya10Ref,45864,0,1,1,1,1), -- Cover of the Keepers +(@Auriaya10Ref,45865,0,1,1,1,1), -- Raiments of the Corrupted +(@Auriaya10Ref,45866,0,1,1,1,1), -- Elemental Focus Stone +-- Auriaya 25man +(@Auriaya25Ref,45327,0,1,1,1,1), -- Siren's Cry +(@Auriaya25Ref,45437,0,1,1,1,1), -- Runescribed Blade +(@Auriaya25Ref,45315,0,1,1,1,1), -- Stonerender +(@Auriaya25Ref,45439,0,1,1,1,1), -- Unwavering Stare +(@Auriaya25Ref,45326,0,1,1,1,1), -- Platinum Band of the Aesir +(@Auriaya25Ref,45441,0,1,1,1,1), -- Sandals of the Ancient Keeper +(@Auriaya25Ref,45435,0,1,1,1,1), -- Cowl of the Absolute +(@Auriaya25Ref,45438,0,1,1,1,1), -- Ring of the Faithful Servant +(@Auriaya25Ref,45434,0,1,1,1,1), -- Greaves of the Rockmender +(@Auriaya25Ref,45320,0,1,1,1,1), -- Shoulderplates of the Eternal +(@Auriaya25Ref,45325,0,1,1,1,1), -- Gloves of the Stonereaper +(@Auriaya25Ref,45440,0,1,1,1,1), -- Amice of the Stoic Watch +(@Auriaya25Ref,45334,0,1,1,1,1), -- Unbreakable Chestguard +(@Auriaya25Ref,45319,0,1,1,1,1), -- Cloak of the Makers +(@Auriaya25Ref,45436,0,1,1,1,1); -- Libram of the Resolute + +-- --------------------------- +-- -- ASSIGN CREATURE LOOTS -- +-- --------------------------- +UPDATE `creature_template` SET `lootid`=`entry` WHERE `entry` IN (@Brundir10,@Molgeim10,@Steelbreaker10,@Brundir25,@Molgeim25,@Steelbreaker25,@Auriaya10,@Auriaya25); +DELETE FROM `creature_loot_template` WHERE `entry` IN (@Brundir10,@Molgeim10,@Steelbreaker10,@Brundir25,@Molgeim25,@Steelbreaker25); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- ASSEMBLY OF IRON 10-man +-- Stormcaller Brundir killed last +(@Brundir10,1,100,1,0,-@Assembly10Ref,2), -- 2 items from reference loot +(@Brundir10,47241,100,1,0,1,1), -- 1 Emblem of Triumph +-- Runemaster Molgeim killed last +(@Molgeim10,1,100,1,0,-@Assembly10Ref,2), -- 2 items from reference loot +(@Molgeim10,47241,100,1,0,2,2), -- 2 Emblem of Triumph +(@Molgeim10,45506,100,2,0,1,1), -- Archivum Data Disc +(@Molgeim10,45087,75,1,0,1,1), -- Runed Orb +-- Steelbreaker killed last +(@Steelbreaker10,1,100,1,0,-@Assembly10Ref,2), -- 2 items from reference loot +(@Steelbreaker10,47241,100,1,0,2,2), -- 2 Emblem of Triumph +(@Steelbreaker10,45087,75,1,0,1,1), -- Runed Orb +(@Steelbreaker10,45506,100,1,0,1,1), -- Archivum Data Disc for Quest +(@Steelbreaker10,25455,0,1,1,1,1), -- Belt fo the Crystal Tree +(@Steelbreaker10,45447,0,1,1,1,1), -- Watchful Eye of Fate +(@Steelbreaker10,45456,0,1,1,1,1), -- Loop of the Agile +(@Steelbreaker10,45449,0,1,1,1,1), -- The Masticator +(@Steelbreaker10,45448,0,1,1,1,1), -- Perilous Bite +-- ASSEMBLY OF IRON 25-man +-- Stormcaller Brundir killed last +(@Brundir25,1,100,1,0,-@Assembly25Ref,3), -- 3 items from reference loot +(@Brundir25,2,10,1,0,-34154,1), -- Chance on Recipe +(@Brundir25,45038,8,1,0,1,1), -- Fragment of Val'anyr +(@Brundir25,45087,75,1,0,1,1), -- Runed Orb +(@Brundir25,47241,100,1,0,1,2), -- 2 Emblems of Triumph +-- Runemaster Molgeim killed last +(@Molgeim25,1,100,1,0,-@Assembly25Ref,3), -- 3 items from reference loot +(@Molgeim25,2,10,1,0,-34154,1), -- Chance on Recipe +(@Molgeim25,45038,8,1,0,1,1), -- Fragment of Val'anyr +(@Molgeim25,45087,75,1,0,1,1), -- Runed Orb +(@Molgeim25,47241,100,1,0,2,2), -- 2 Emblems of Triumph +(@Molgeim25,45506,100,1,0,1,1), -- Archivum Data Disc +-- Steelbreaker killed last +(@Steelbreaker25,1,100,1,0,-@Assembly25Ref,3), -- 3 items from reference loot +(@Steelbreaker25,2,10,1,0,-34154,1), -- Chance on Recipe +(@Steelbreaker25,45038,18,1,0,1,1), -- Fragment of Val'anyr +(@Steelbreaker25,45087,75,1,0,2,2), -- 2x Runed Orb +(@Steelbreaker25,47241,100,1,0,2,2), -- 2 Emblems of Triumph +(@Steelbreaker25,45506,100,1,0,1,1), -- Archivum Data Disc +(@Steelbreaker25,45241,0,1,1,1,1), -- Belt of Colossal Rage +(@Steelbreaker25,45242,0,1,1,1,1), -- Drape of Mortal Downfall +(@Steelbreaker25,45607,0,1,1,1,1), -- Fang of Oblivion +(@Steelbreaker25,45244,0,1,1,1,1), -- Greaves of Swift Vengeance +(@Steelbreaker25,45243,0,1,1,1,1), -- Sapphire Amulet of Renewal +(@Steelbreaker25,45245,0,1,1,1,1); -- Shoulderpads of the Intruder + +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (@CacheLivingStone10,@CacheLivingStone25); +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- KOLOGARN 10-man +(@CacheLivingStone10,1,100,1,0,-@Kologarn10Ref,2), -- 2 items from reference loot +(@CacheLivingStone10,47241,100,1,0,1,1), -- 1 Emblem of Triumph +-- KOLOGARN 25-Man +(@CacheLivingStone25,1,100,1,0,-@Kologarn25Ref,3), -- 3 items from reference loot +(@CacheLivingStone25,2,10,1,0,-34154,1), -- Chance on Recipe +(@CacheLivingStone25,45038,8,1,0,1,1), -- Fragment of Val'anyr +(@CacheLivingStone25,45087,50,1,0,1,1), -- Runed Orb +(@CacheLivingStone25,47241,100,1,0,1,2); -- 2 Emblems of Triumph + +DELETE FROM `creature_loot_template` WHERE `entry` IN (@Auriaya10,@Auriaya25); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- AURIAYA 10-man +(@Auriaya10,1,100,1,0,-@Auriaya10Ref,2), -- 2 items from reference loot +(@Auriaya10,47241,100,1,0,1,1), -- 1 Emblem of Triumph +-- AURIAYA 25-man +(@Auriaya25,1,100,1,0,-@Auriaya25Ref,3), -- 3 items from reference loot +(@Auriaya25,2,10,1,0,-34154,1), -- Chance on Recipe +(@Auriaya25,45038,8,1,0,1,1), -- Fragment of Val'anyr +(@Auriaya25,45087,75,1,0,1,1), -- Runed Orb +(@Auriaya25,47241,100,1,0,1,2); -- 2 Emblems of Triumph From 409ebcca974009beb9807963aebfec4e861ccf33 Mon Sep 17 00:00:00 2001 From: click Date: Sat, 31 Mar 2012 23:50:32 +0200 Subject: [PATCH 0380/1149] Core: Send SSL and ACE version in all logging detailmodes, not just when set in the config --- src/server/worldserver/Main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index 23f925dedef..04820f59355 100755 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -137,8 +137,8 @@ extern int main(int argc, char **argv) } sLog->outString("Using configuration file %s.", cfg_file); - sLog->outDetail("%s (Library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); - sLog->outDetail("Using ACE: %s", ACE_VERSION); + sLog->outString("Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); + sLog->outString("Using ACE version: %s", ACE_VERSION); ///- and run the 'Master' /// \todo Why do we need this 'Master'? Can't all of this be in the Main as for Realmd? From 377c5ce36ea6c606dca7f3d6e865d38add8f81a0 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 1 Apr 2012 02:46:32 +0100 Subject: [PATCH 0381/1149] Core/DBLayer: Fix another wrong type in mail related code --- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Globals/ObjectMgr.cpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f4a5cbb5572..1126262bafa 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4822,7 +4822,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC Field* fields = resultMail->Fetch(); uint32 mail_id = fields[0].GetUInt32(); - uint16 mailType = fields[1].GetUInt16(); + uint16 mailType = fields[1].GetUInt8(); uint16 mailTemplateId= fields[2].GetUInt16(); uint32 sender = fields[3].GetUInt32(); std::string subject = fields[4].GetString(); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index bf647fa5c31..8753d2834a1 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -5337,15 +5337,15 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) { Field* fields = result->Fetch(); Mail* m = new Mail; - m->messageID = fields[0].GetUInt32(); - m->messageType = fields[1].GetUInt8(); - m->sender = fields[2].GetUInt32(); - m->receiver = fields[3].GetUInt32(); - bool has_items = fields[4].GetBool(); - m->expire_time = time_t(fields[5].GetUInt32()); - m->deliver_time = 0; - m->COD = fields[6].GetUInt32(); - m->checked = fields[7].GetUInt32(); + m->messageID = fields[0].GetUInt32(); + m->messageType = fields[1].GetUInt8(); + m->sender = fields[2].GetUInt32(); + m->receiver = fields[3].GetUInt32(); + bool has_items = fields[4].GetBool(); + m->expire_time = time_t(fields[5].GetUInt32()); + m->deliver_time = 0; + m->COD = fields[6].GetUInt32(); + m->checked = fields[7].GetUInt32(); m->mailTemplateId = fields[8].GetInt16(); Player* player = NULL; From 00264e45cf7b815061ac6503988506ec454b8360 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 1 Apr 2012 03:08:33 +0100 Subject: [PATCH 0382/1149] DB/Auth: Increase realmlist.address size to 64 (varchar) You might want to verify if the previous size did not truncate your address (it was 15) --- sql/base/auth_database.sql | 2 +- sql/updates/auth/2012_04_01_auth_realmlist.sql | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 sql/updates/auth/2012_04_01_auth_realmlist.sql diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 5803529da1e..1075644db3d 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -191,7 +191,7 @@ DROP TABLE IF EXISTS `realmlist`; CREATE TABLE `realmlist` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(32) NOT NULL DEFAULT '', - `address` varchar(15) NOT NULL DEFAULT '127.0.0.1', + `address` varchar(64) NOT NULL DEFAULT '127.0.0.1', `port` smallint(5) unsigned NOT NULL DEFAULT '8085', `icon` tinyint(3) unsigned NOT NULL DEFAULT '0', `flag` tinyint(3) unsigned NOT NULL DEFAULT '2', diff --git a/sql/updates/auth/2012_04_01_auth_realmlist.sql b/sql/updates/auth/2012_04_01_auth_realmlist.sql new file mode 100644 index 00000000000..e2e1efaf993 --- /dev/null +++ b/sql/updates/auth/2012_04_01_auth_realmlist.sql @@ -0,0 +1 @@ +ALTER TABLE `realmlist` CHANGE `address` `address` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '127.0.0.1'; From a1c4786ba00948a1cac9d9b754d77218b9c0bc40 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Sun, 1 Apr 2012 19:56:41 +0800 Subject: [PATCH 0383/1149] Core/Script: Code style and some rewriting. MoveInLineOfSight(Unit* unit) -> MoveInLineOfSight(Unit* who) Signed-off-by: Gyx <2359980687@qq.com> --- .../game/AI/ScriptedAI/ScriptedCreature.cpp | 2 +- .../BlackwingLair/boss_chromaggus.cpp | 2 +- .../BlackwingLair/boss_vaelastrasz.cpp | 4 +- .../Deadmines/boss_mr_smite.cpp | 2 +- .../EasternKingdoms/Gnomeregan/gnomeregan.cpp | 16 +- .../EasternKingdoms/Karazhan/boss_moroes.cpp | 2 +- .../Karazhan/boss_terestian_illhoof.cpp | 4 +- .../EasternKingdoms/Karazhan/bosses_opera.cpp | 2 +- .../EasternKingdoms/Karazhan/karazhan.cpp | 4 +- .../boss_felblood_kaelthas.cpp | 10 +- .../ScarletEnclave/chapter2.cpp | 24 +- .../boss_headless_horseman.cpp | 10 +- .../boss_mograine_and_whitemane.cpp | 6 +- .../SunwellPlateau/boss_eredar_twins.cpp | 12 +- .../EasternKingdoms/ZulAman/boss_hexlord.cpp | 4 +- .../EasternKingdoms/ZulAman/boss_janalai.cpp | 2 +- .../ZulGurub/boss_gahzranka.cpp | 8 +- .../EasternKingdoms/ZulGurub/boss_grilek.cpp | 8 +- .../EasternKingdoms/ZulGurub/boss_jindo.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_thekal.cpp | 16 +- .../EasternKingdoms/eastern_plaguelands.cpp | 18 +- .../EasternKingdoms/isle_of_queldanas.cpp | 2 +- .../EasternKingdoms/stormwind_city.cpp | 4 +- .../BattleForMountHyjal/boss_anetheron.cpp | 2 +- .../BattleForMountHyjal/boss_archimonde.cpp | 4 +- .../BattleForMountHyjal/boss_azgalor.cpp | 2 +- .../BattleForMountHyjal/boss_kazrogal.cpp | 2 +- .../boss_rage_winterchill.cpp | 2 +- .../BattleForMountHyjal/hyjalAI.cpp | 4 +- .../BattleForMountHyjal/hyjal_trash.cpp | 32 +- .../EscapeFromDurnholdeKeep/old_hillsbrad.cpp | 2 +- .../TempleOfAhnQiraj/boss_bug_trio.cpp | 4 +- src/server/scripts/Kalimdor/ashenvale.cpp | 6 +- src/server/scripts/Kalimdor/boss_azuregos.cpp | 2 +- .../ObsidianSanctum/boss_sartharion.cpp | 2 +- .../boss_argent_challenge.cpp | 4 +- .../boss_faction_champions.cpp | 6 +- .../Naxxramas/boss_four_horsemen.cpp | 8 +- .../Northrend/Naxxramas/boss_kelthuzad.cpp | 30 +- .../Northrend/Nexus/Nexus/boss_ormorok.cpp | 2 +- .../Northrend/Ulduar/Ulduar/boss_ignis.cpp | 8 +- .../UtgardeKeep/boss_ingvar_the_plunderer.cpp | 2 +- .../UtgardeKeep/boss_skarvald_dalronn.cpp | 12 +- .../scripts/Northrend/sholazar_basin.cpp | 7 +- src/server/scripts/Northrend/storm_peaks.cpp | 36 +- .../boss_grandmaster_vorpil.cpp | 2 +- .../ShadowLabyrinth/boss_murmur.cpp | 4 +- .../Outland/BlackTemple/boss_bloodboil.cpp | 2 +- .../Outland/BlackTemple/boss_illidan.cpp | 12 +- .../BlackTemple/boss_mother_shahraz.cpp | 2 +- .../BlackTemple/boss_reliquary_of_souls.cpp | 4 +- .../Outland/BlackTemple/boss_supremus.cpp | 2 +- .../BlackTemple/boss_teron_gorefiend.cpp | 8 +- .../Outland/BlackTemple/illidari_council.cpp | 6 +- .../boss_fathomlord_karathress.cpp | 14 +- .../SerpentShrine/boss_lady_vashj.cpp | 4 +- .../boss_leotheras_the_blind.cpp | 4 +- .../SteamVault/boss_mekgineer_steamrigger.cpp | 2 +- .../GruulsLair/boss_high_king_maulgar.cpp | 10 +- .../boss_warchief_kargath_bladefist.cpp | 4 +- .../Outland/TempestKeep/Eye/boss_alar.cpp | 2 +- .../TempestKeep/Eye/boss_astromancer.cpp | 2 +- .../Outland/TempestKeep/Eye/boss_kaelthas.cpp | 12 +- src/server/scripts/Outland/netherstorm.cpp | 10 +- .../scripts/Outland/shadowmoon_valley.cpp | 379 ++++++++---------- src/server/scripts/World/npcs_special.cpp | 60 +-- 66 files changed, 417 insertions(+), 471 deletions(-) diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 5c1bbf0ad06..d80c71bfb35 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -274,7 +274,7 @@ void ScriptedAI::DoResetThreat() for (std::list::iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr) { - Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); if (unit && DoGetThreat(unit)) DoModifyThreatPercent(unit, -100); diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp index 818dcace078..a3eb0cea5ad 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp @@ -245,7 +245,7 @@ public: Unit* unit; if ((*i) && (*i)->getSource()) { - unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit) { //Cast affliction diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp index 5bcb6d051bb..eaa8c118f19 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp @@ -176,9 +176,9 @@ public: break; case 2: me->setFaction(103); - if (PlayerGUID && Unit::GetUnit((*me), PlayerGUID)) + if (PlayerGUID && Unit::GetUnit(*me, PlayerGUID)) { - AttackStart(Unit::GetUnit((*me), PlayerGUID)); + AttackStart(Unit::GetUnit(*me, PlayerGUID)); DoCast(me, SPELL_ESSENCEOFTHERED); } SpeechTimer = 0; diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp index aa62e1277f8..4885d8620b0 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp @@ -127,7 +127,7 @@ public: DoCastAOE(SPELL_SMITE_STOMP, false); SetCombatMovement(false); if (instance) - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_SMITE_CHEST))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_SMITE_CHEST))) { me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MovePoint(1, go->GetPositionX() - 3.0f, go->GetPositionY(), go->GetPositionZ()); diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp index 6aa4c9d1a7a..b5a7984d945 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp @@ -189,11 +189,11 @@ public: if (bBool) { if (instance) - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) instance->HandleGameObject(0, false, go); }else if (instance) - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_LEFT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT))) instance->HandleGameObject(0, false, go); } @@ -204,10 +204,10 @@ public: if (bBool) { - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) me->SetFacingToObject(go); }else - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_LEFT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT))) me->SetFacingToObject(go); } @@ -216,10 +216,10 @@ public: if (!instance) return; - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) instance->HandleGameObject(0, false, go); - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_LEFT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT))) instance->HandleGameObject(0, false, go); if (!GoSummonList.empty()) @@ -445,7 +445,7 @@ public: DoScriptText(SAY_BLASTMASTER_5, me); Summon(1); if (instance) - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) instance->HandleGameObject(0, true, go); NextStep(3000, true); break; @@ -491,7 +491,7 @@ public: DoScriptText(SAY_BLASTMASTER_23, me); SetInFace(false); if (instance) - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_LEFT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT))) instance->HandleGameObject(0, true, go); NextStep(2000, true); break; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp index 90fdb165384..f69cecdb4c3 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -358,7 +358,7 @@ struct boss_moroes_guestAI : public ScriptedAI uint64 TempGUID = GuestGUID[rand()%4]; if (TempGUID) { - Unit* unit = Unit::GetUnit((*me), TempGUID); + Unit* unit = Unit::GetUnit(*me, TempGUID); if (unit && unit->isAlive()) return unit; } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp index f2def74011d..2f19d2c7fc1 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp @@ -101,7 +101,7 @@ public: uint64 TerestianGUID = instance->GetData64(DATA_TERESTIAN); if (TerestianGUID) { - Unit* Terestian = Unit::GetUnit((*me), TerestianGUID); + Unit* Terestian = Unit::GetUnit(*me, TerestianGUID); if (Terestian && Terestian->isAlive()) DoCast(Terestian, SPELL_BROKEN_PACT, true); } @@ -157,7 +157,7 @@ public: { if (SacrificeGUID) { - Unit* Sacrifice = Unit::GetUnit((*me), SacrificeGUID); + Unit* Sacrifice = Unit::GetUnit(*me, SacrificeGUID); if (Sacrifice) Sacrifice->RemoveAurasDueToSpell(SPELL_SACRIFICE); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index c2aeedbd1d3..6f8121ef5b6 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -886,7 +886,7 @@ public: { IsChasing = false; - if (Unit* target = Unit::GetUnit((*me), HoodGUID)) + if (Unit* target = Unit::GetUnit(*me, HoodGUID)) { HoodGUID = 0; if (DoGetThreat(target)) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index 89c3e371de7..b37f6913b8d 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -536,7 +536,7 @@ public: uint32 NextStep(uint32 Step) { - Unit* arca = Unit::GetUnit((*me), ArcanagosGUID); + Unit* arca = Unit::GetUnit(*me, ArcanagosGUID); Map* map = me->GetMap(); switch (Step) { @@ -625,7 +625,7 @@ public: if (Step >= 7 && Step <= 12) { - Unit* arca = Unit::GetUnit((*me), ArcanagosGUID); + Unit* arca = Unit::GetUnit(*me, ArcanagosGUID); if (FireArcanagosTimer <= diff) { diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index 6bcec6c6db5..4a75370f0e8 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -197,7 +197,7 @@ public: std::list::const_iterator i = m_threatlist.begin(); for (i = m_threatlist.begin(); i != m_threatlist.end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && unit->isAlive()) { float threat = me->getThreatManager().getThreat(unit); @@ -215,7 +215,7 @@ public: std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) unit->CastSpell(unit, SPELL_TELEPORT_CENTER, true); } @@ -227,7 +227,7 @@ public: std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) // Knockback into the air unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, me->GetGUID()); @@ -239,7 +239,7 @@ public: std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) { // Also needs an exception in spell system. @@ -259,7 +259,7 @@ public: std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) { unit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 2b9dbdd248d..1c17e6afa9b 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -627,48 +627,48 @@ public: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } - bool MeetQuestCondition(Unit* player) + bool MeetQuestCondition(Player* player) { switch (me->GetEntry()) { case 29061: // Ellen Stanbridge - if (CAST_PLR(player)->GetQuestStatus(12742) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12742) == QUEST_STATUS_INCOMPLETE) return true; break; case 29072: // Kug Ironjaw - if (CAST_PLR(player)->GetQuestStatus(12748) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12748) == QUEST_STATUS_INCOMPLETE) return true; break; case 29067: // Donovan Pulfrost - if (CAST_PLR(player)->GetQuestStatus(12744) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12744) == QUEST_STATUS_INCOMPLETE) return true; break; case 29065: // Yazmina Oakenthorn - if (CAST_PLR(player)->GetQuestStatus(12743) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12743) == QUEST_STATUS_INCOMPLETE) return true; break; case 29071: // Antoine Brack - if (CAST_PLR(player)->GetQuestStatus(12750) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12750) == QUEST_STATUS_INCOMPLETE) return true; break; case 29032: // Malar Bravehorn - if (CAST_PLR(player)->GetQuestStatus(12739) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12739) == QUEST_STATUS_INCOMPLETE) return true; break; case 29068: // Goby Blastenheimer - if (CAST_PLR(player)->GetQuestStatus(12745) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12745) == QUEST_STATUS_INCOMPLETE) return true; break; case 29073: // Iggy Darktusk - if (CAST_PLR(player)->GetQuestStatus(12749) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12749) == QUEST_STATUS_INCOMPLETE) return true; break; case 29074: // Lady Eonys - if (CAST_PLR(player)->GetQuestStatus(12747) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12747) == QUEST_STATUS_INCOMPLETE) return true; break; case 29070: // Valok the Righteous - if (CAST_PLR(player)->GetQuestStatus(12746) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12746) == QUEST_STATUS_INCOMPLETE) return true; break; } @@ -681,7 +681,7 @@ public: if (PlayerGUID || who->GetTypeId() != TYPEID_PLAYER || !who->IsWithinDist(me, INTERACTION_DISTANCE)) return; - if (MeetQuestCondition(who)) + if (MeetQuestCondition(who->ToPlayer())) PlayerGUID = who->GetGUID(); } diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 31dc23d24af..813c43288d0 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -348,7 +348,7 @@ public: if (wait <= diff) { die = false; - if (Unit* body = Unit::GetUnit((*me), bodyGUID)) + if (Unit* body = Unit::GetUnit(*me, bodyGUID)) body->Kill(body); me->Kill(me); } @@ -475,7 +475,7 @@ public: wp_reached = false; me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); SaySound(SAY_ENTRANCE); - if (Unit* player = Unit::GetUnit((*me), PlayerGUID)) + if (Unit* player = Unit::GetUnit(*me, PlayerGUID)) DoStartMovement(player); break; } @@ -586,7 +586,7 @@ public: std::list::const_iterator itr; for (itr = caster->getThreatManager().getThreatList().begin(); itr != caster->getThreatManager().getThreatList().end(); ++itr) { - Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); if (unit && unit->isAlive() && unit != caster) me->AddThreat(unit, caster->getThreatManager().getThreat(unit)); } @@ -606,7 +606,7 @@ public: if (!headGUID) headGUID = DoSpawnCreature(HEAD, float(rand()%6), float(rand()%6), 0, 0, TEMPSUMMON_DEAD_DESPAWN, 0)->GetGUID(); - Unit* Head = Unit::GetUnit((*me), headGUID); + Unit* Head = Unit::GetUnit(*me, headGUID); if (Head && Head->isAlive()) { Head->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); @@ -817,7 +817,7 @@ public: if (!debuffGUID) return; - Unit* debuff = Unit::GetUnit((*me), debuffGUID); + Unit* debuff = Unit::GetUnit(*me, debuffGUID); if (debuff) { debuff->SetVisible(false); diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp index ec6ac34b0bb..8d813bfe502 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp @@ -132,7 +132,7 @@ public: return; //On first death, fake death and open door, as well as initiate whitemane if exist - if (Unit* Whitemane = Unit::GetUnit((*me), instance->GetData64(DATA_WHITEMANE))) + if (Unit* Whitemane = Unit::GetUnit(*me, instance->GetData64(DATA_WHITEMANE))) { instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS); @@ -181,7 +181,7 @@ public: if (_bHasDied && !_bHeal && instance && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL) { //On ressurection, stop fake death and heal whitemane and resume fight - if (Unit* Whitemane = Unit::GetUnit((*me), instance->GetData64(DATA_WHITEMANE))) + if (Unit* Whitemane = Unit::GetUnit(*me, instance->GetData64(DATA_WHITEMANE))) { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetStandState(UNIT_STAND_STATE_STAND); @@ -292,7 +292,7 @@ public: //When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out if (instance && Wait_Timer <= diff) { - if (Unit* Mograine = Unit::GetUnit((*me), instance->GetData64(DATA_MOGRAINE))) + if (Unit* Mograine = Unit::GetUnit(*me, instance->GetData64(DATA_MOGRAINE))) { DoCast(Mograine, SPELL_SCARLETRESURRECTION); DoScriptText(SAY_WH_RESSURECT, me); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp index c3398799f17..03486a644a2 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp @@ -120,7 +120,7 @@ public: if (instance) { - Unit* Temp = Unit::GetUnit((*me), instance->GetData64(DATA_ALYTHESS)); + Unit* Temp = Unit::GetUnit(*me, instance->GetData64(DATA_ALYTHESS)); if (Temp) { if (Temp->isDead()) @@ -152,7 +152,7 @@ public: if (instance) { - Unit* Temp = Unit::GetUnit((*me), instance->GetData64(DATA_ALYTHESS)); + Unit* Temp = Unit::GetUnit(*me, instance->GetData64(DATA_ALYTHESS)); if (Temp && Temp->isAlive() && !(Temp->getVictim())) CAST_CRE(Temp)->AI()->AttackStart(who); } @@ -231,7 +231,7 @@ public: if (instance) { Unit* Temp = NULL; - Temp = Unit::GetUnit((*me), instance->GetData64(DATA_ALYTHESS)); + Temp = Unit::GetUnit(*me, instance->GetData64(DATA_ALYTHESS)); if (Temp && Temp->isDead()) { DoScriptText(YELL_SISTER_ALYTHESS_DEAD, me); @@ -382,7 +382,7 @@ public: if (instance) { - Unit* Temp = Unit::GetUnit((*me), instance->GetData64(DATA_SACROLASH)); + Unit* Temp = Unit::GetUnit(*me, instance->GetData64(DATA_SACROLASH)); if (Temp) { if (Temp->isDead()) @@ -415,7 +415,7 @@ public: if (instance) { - Unit* Temp = Unit::GetUnit((*me), instance->GetData64(DATA_SACROLASH)); + Unit* Temp = Unit::GetUnit(*me, instance->GetData64(DATA_SACROLASH)); if (Temp && Temp->isAlive() && !(Temp->getVictim())) CAST_CRE(Temp)->AI()->AttackStart(who); } @@ -567,7 +567,7 @@ public: if (instance) { Unit* Temp = NULL; - Temp = Unit::GetUnit((*me), instance->GetData64(DATA_SACROLASH)); + Temp = Unit::GetUnit(*me, instance->GetData64(DATA_SACROLASH)); if (Temp && Temp->isDead()) { DoScriptText(YELL_SISTER_SACROLASH_DEAD, me); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp index f63ebe77a1b..b5698d851f8 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp @@ -267,7 +267,7 @@ class boss_hexlord_malacrass : public CreatureScript for (uint8 i = 0; i < 4; ++i) { - Unit* Temp = Unit::GetUnit((*me), AddGUID[i]); + Unit* Temp = Unit::GetUnit(*me, AddGUID[i]); if (Temp && Temp->isAlive()) CAST_CRE(Temp)->AI()->AttackStart(me->getVictim()); else @@ -303,7 +303,7 @@ class boss_hexlord_malacrass : public CreatureScript for (uint8 i = 0; i < 4; ++i) { - Unit* Temp = Unit::GetUnit((*me), AddGUID[i]); + Unit* Temp = Unit::GetUnit(*me, AddGUID[i]); if (Temp && Temp->isAlive()) Temp->DealDamage(Temp, Temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index f9161fb4223..a2125c45689 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -289,7 +289,7 @@ class boss_janalai : public CreatureScript { if (BombCount < 40) { - if (Unit* FireBomb = Unit::GetUnit((*me), FireBombGUIDs[BombCount])) + if (Unit* FireBomb = Unit::GetUnit(*me, FireBombGUIDs[BombCount])) { FireBomb->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); DoCast(FireBomb, SPELL_FIRE_BOMB_THROW, true); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp index 84e3de71b1d..ce2fd0848f9 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp @@ -32,15 +32,11 @@ EndScriptData */ class boss_gahzranka : public CreatureScript { public: - - boss_gahzranka() - : CreatureScript("boss_gahzranka") - { - } + boss_gahzranka() : CreatureScript("boss_gahzranka") { } struct boss_gahzrankaAI : public ScriptedAI { - boss_gahzrankaAI(Creature* creature) : ScriptedAI(creature) {} + boss_gahzrankaAI(Creature* creature) : ScriptedAI(creature) { } uint32 Frostbreath_Timer; uint32 MassiveGeyser_Timer; uint32 Slam_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp index 19d0a04b9a6..cdd45a3fa0d 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp @@ -32,15 +32,11 @@ EndScriptData */ class boss_grilek : public CreatureScript { public: - - boss_grilek() - : CreatureScript("boss_grilek") - { - } + boss_grilek() : CreatureScript("boss_grilek") { } struct boss_grilekAI : public ScriptedAI { - boss_grilekAI(Creature* creature) : ScriptedAI(creature) {} + boss_grilekAI(Creature* creature) : ScriptedAI(creature) { } uint32 Avartar_Timer; uint32 GroundTremor_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp index d7901d663f3..f4a17da56fb 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp @@ -212,7 +212,7 @@ class mob_healing_ward : public CreatureScript { if (instance) { - Unit* pJindo = Unit::GetUnit((*me), instance->GetData64(DATA_JINDO)); + Unit* pJindo = Unit::GetUnit(*me, instance->GetData64(DATA_JINDO)); if (pJindo) DoCast(pJindo, SPELL_HEAL); } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index d85f99b0295..ce6b3b37ef8 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -134,7 +134,7 @@ class boss_thekal : public CreatureScript if (instance->GetData(DATA_LORKHAN) == SPECIAL) { //Resurrect LorKhan - if (Unit* pLorKhan = Unit::GetUnit((*me), instance->GetData64(DATA_LORKHAN))) + if (Unit* pLorKhan = Unit::GetUnit(*me, instance->GetData64(DATA_LORKHAN))) { pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pLorKhan->setFaction(14); @@ -148,7 +148,7 @@ class boss_thekal : public CreatureScript if (instance->GetData(DATA_ZATH) == SPECIAL) { //Resurrect Zath - Unit* pZath = Unit::GetUnit((*me), instance->GetData64(DATA_ZATH)); + Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH)); if (pZath) { pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); @@ -337,8 +337,8 @@ class mob_zealot_lorkhan : public CreatureScript { if (instance) { - Unit* pThekal = Unit::GetUnit((*me), instance->GetData64(DATA_THEKAL)); - Unit* pZath = Unit::GetUnit((*me), instance->GetData64(DATA_ZATH)); + Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL)); + Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH)); if (!pThekal || !pZath) return; @@ -374,7 +374,7 @@ class mob_zealot_lorkhan : public CreatureScript if (instance->GetData(DATA_THEKAL) == SPECIAL) { //Resurrect Thekal - if (Unit* pThekal = Unit::GetUnit((*me), instance->GetData64(DATA_THEKAL))) + if (Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL))) { pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -386,7 +386,7 @@ class mob_zealot_lorkhan : public CreatureScript if (instance->GetData(DATA_ZATH) == SPECIAL) { //Resurrect Zath - if (Unit* pZath = Unit::GetUnit((*me), instance->GetData64(DATA_ZATH))) + if (Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH))) { pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -527,7 +527,7 @@ class mob_zealot_zath : public CreatureScript if (instance->GetData(DATA_LORKHAN) == SPECIAL) { //Resurrect LorKhan - if (Unit* pLorKhan = Unit::GetUnit((*me), instance->GetData64(DATA_LORKHAN))) + if (Unit* pLorKhan = Unit::GetUnit(*me, instance->GetData64(DATA_LORKHAN))) { pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -539,7 +539,7 @@ class mob_zealot_zath : public CreatureScript if (instance->GetData(DATA_THEKAL) == SPECIAL) { //Resurrect Thekal - if (Unit* pThekal = Unit::GetUnit((*me), instance->GetData64(DATA_THEKAL))) + if (Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL))) { pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); diff --git a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp index 731067a774f..0519ce94b32 100644 --- a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp @@ -32,23 +32,14 @@ EndContentData */ #include "ScriptPCH.h" -//id8530 - cannibal ghoul -//id8531 - gibbering ghoul -//id8532 - diseased flayer - class mobs_ghoul_flayer : public CreatureScript { public: mobs_ghoul_flayer() : CreatureScript("mobs_ghoul_flayer") { } - CreatureAI* GetAI(Creature* creature) const - { - return new mobs_ghoul_flayerAI (creature); - } - struct mobs_ghoul_flayerAI : public ScriptedAI { - mobs_ghoul_flayerAI(Creature* creature) : ScriptedAI(creature) {} + mobs_ghoul_flayerAI(Creature* creature) : ScriptedAI(creature) { } void Reset() {} @@ -56,10 +47,15 @@ public: void JustDied(Unit* killer) { - if (Player* player = killer->ToPlayer()) + if (killer->GetTypeId() == TYPEID_PLAYER) me->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000); } }; + + CreatureAI* GetAI(Creature* creature) const + { + return new mobs_ghoul_flayerAI (creature); + } }; /*###### diff --git a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp index 98ac2ff4cc1..b0b09c0ec76 100644 --- a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp +++ b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp @@ -129,7 +129,7 @@ public: PlayerGUID = caster->GetGUID(); if (PlayerGUID) { - Unit* player = Unit::GetUnit((*me), PlayerGUID); + Unit* player = Unit::GetUnit(*me, PlayerGUID); if (player && CAST_PLR(player)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE) DoCast(player, 45110, true); } diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/stormwind_city.cpp index 7e5e9e3cf89..96ad1da725d 100644 --- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/stormwind_city.cpp @@ -403,7 +403,7 @@ public: { if (Unit* summoner = me->ToTempSummon()->GetSummoner()) { - if (summoner && summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive() && !summoner->isInCombat()) + if (summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive() && !summoner->isInCombat()) summoner->ToCreature()->AI()->AttackStart(who); } } @@ -417,7 +417,7 @@ public: { if (Unit* summoner = me->ToTempSummon()->GetSummoner()) { - if (summoner && summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive()) + if (summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive()) summoner->ToCreature()->DisappearAndDie(); } } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index e0a0ff1dc59..85f82c62079 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -119,7 +119,7 @@ public: { if (waypointId == 7 && instance) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index e22dbd972e5..f07aaaa1f2a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -117,7 +117,7 @@ public: { if (CheckTimer <= diff) { - if (Unit* Archimonde = Unit::GetUnit((*me), ArchimondeGUID)) + if (Unit* Archimonde = Unit::GetUnit(*me, ArchimondeGUID)) { if (Archimonde->HealthBelowPct(2) || !Archimonde->isAlive()) DoCast(me, SPELL_DENOUEMENT_WISP); @@ -367,7 +367,7 @@ public: std::list::const_iterator itr = m_threatlist.begin(); for (; itr != m_threatlist.end(); ++itr) { - Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); if (unit && unit->isAlive()) targets.push_back(unit); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index 24fe1b5957b..a9e0c866ab9 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -115,7 +115,7 @@ public: { if (waypointId == 7 && instance) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index de8759b3968..407faa19eaa 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -107,7 +107,7 @@ public: { if (waypointId == 7 && instance) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp index f328b55f766..5d7ee1fe194 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp @@ -109,7 +109,7 @@ public: { if (waypointId == 7 && instance) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index 115aa3b6445..2f6bbb7edb5 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -855,7 +855,7 @@ void hyjalAI::UpdateAI(const uint32 diff) { if (BossGUID[i]) { - Unit* unit = Unit::GetUnit((*me), BossGUID[i]); + Unit* unit = Unit::GetUnit(*me, BossGUID[i]); if (unit && (!unit->isAlive())) { if (BossGUID[i] == BossGUID[0]) @@ -991,7 +991,7 @@ void hyjalAI::WaypointReached(uint32 waypointId) DoCast(me, SPELL_MASS_TELEPORT, false); if (me->GetEntry() == THRALL && DummyGuid) { - Unit* Dummy = Unit::GetUnit((*me), DummyGuid); + Unit* Dummy = Unit::GetUnit(*me, DummyGuid); if (Dummy) { CAST_AI(hyjalAI, CAST_CRE(Dummy)->AI())->DoMassTeleport = true; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index e63b33faf70..840aa5de081 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -432,7 +432,7 @@ public: { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } @@ -473,7 +473,7 @@ public: { if (instance->GetData(DATA_ALLIANCE_RETREAT) && !instance->GetData(DATA_HORDE_RETREAT)) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } else if (instance->GetData(DATA_ALLIANCE_RETREAT) && instance->GetData(DATA_HORDE_RETREAT)){ @@ -557,13 +557,13 @@ public: { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } else { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } @@ -661,13 +661,13 @@ public: { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } else { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } @@ -780,13 +780,13 @@ public: { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } else { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } @@ -900,13 +900,13 @@ public: { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } else { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } @@ -1001,13 +1001,13 @@ public: { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } else { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } @@ -1093,13 +1093,13 @@ public: { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } else { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } @@ -1186,7 +1186,7 @@ public: { if (waypointId == 2 && instance && !IsOverrun) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) { me->AddThreat(target, 0.0f); @@ -1305,7 +1305,7 @@ public: { if (waypointId == 2 && instance && !IsOverrun) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) { me->AddThreat(target, 0.0f); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp index d9cdccf2291..7d9da6771dc 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp @@ -413,7 +413,7 @@ public: case 94: if (uint64 TarethaGUID = instance->GetData64(DATA_TARETHA)) { - if (Unit* Taretha = Unit::GetUnit((*me), TarethaGUID)) + if (Unit* Taretha = Unit::GetUnit(*me, TarethaGUID)) DoScriptText(SAY_TA_ESCAPED, Taretha, me); } break; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp index ce73c7ceb69..36b1871c96e 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp @@ -303,8 +303,8 @@ public: { if (instance) { - Unit* pKri = Unit::GetUnit((*me), instance->GetData64(DATA_KRI)); - Unit* pVem = Unit::GetUnit((*me), instance->GetData64(DATA_VEM)); + Unit* pKri = Unit::GetUnit(*me, instance->GetData64(DATA_KRI)); + Unit* pVem = Unit::GetUnit(*me, instance->GetData64(DATA_VEM)); switch (urand(0, 2)) { diff --git a/src/server/scripts/Kalimdor/ashenvale.cpp b/src/server/scripts/Kalimdor/ashenvale.cpp index ff4f90672fc..cec5e42aee5 100644 --- a/src/server/scripts/Kalimdor/ashenvale.cpp +++ b/src/server/scripts/Kalimdor/ashenvale.cpp @@ -441,11 +441,7 @@ class npc_muglash : public CreatureScript class go_naga_brazier : public GameObjectScript { public: - - go_naga_brazier() - : GameObjectScript("go_naga_brazier") - { - } + go_naga_brazier() : GameObjectScript("go_naga_brazier") { } bool OnGossipHello(Player* /*player*/, GameObject* go) { diff --git a/src/server/scripts/Kalimdor/boss_azuregos.cpp b/src/server/scripts/Kalimdor/boss_azuregos.cpp index 37d3753377b..c344de8cb51 100644 --- a/src/server/scripts/Kalimdor/boss_azuregos.cpp +++ b/src/server/scripts/Kalimdor/boss_azuregos.cpp @@ -87,7 +87,7 @@ public: std::list::const_iterator i = m_threatlist.begin(); for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) { DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+3, unit->GetOrientation()); diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp index eeba4a8717d..b115a4ee827 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp @@ -951,7 +951,7 @@ struct dummy_dragonAI : public ScriptedAI return; // Twilight Revenge to main boss - if (Unit* pSartharion = Unit::GetUnit((*me), instance->GetData64(DATA_SARTHARION))) + if (Unit* pSartharion = Unit::GetUnit(*me, instance->GetData64(DATA_SARTHARION))) if (pSartharion->isAlive()) { pSartharion->RemoveAurasDueToSpell(uiSpellId); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp index d4d1d8c8b4b..305266ee628 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp @@ -414,8 +414,8 @@ public: void JustDied(Unit* /*killer*/) { - if (me->isSummon()) - if (Unit* summoner = me->ToTempSummon()->GetSummoner()) + if (TempSummon* summ = me->ToTempSummon()) + if (Unit* summoner = summ->GetSummoner()) if (summoner->isAlive()) summoner->GetAI()->SetData(1, 0); } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp index d232be4577a..79bbb470edf 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp @@ -292,7 +292,7 @@ struct boss_faction_championsAI : public ScriptedAI std::list const& tList = me->getThreatManager().getThreatList(); for (std::list::const_iterator itr = tList.begin(); itr != tList.end(); ++itr) { - Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); if (unit && me->getThreatManager().getThreat(unit)) { if (unit->GetTypeId()==TYPEID_PLAYER) @@ -384,7 +384,7 @@ struct boss_faction_championsAI : public ScriptedAI Unit* target; for (iter = tList.begin(); iter!=tList.end(); ++iter) { - target = Unit::GetUnit((*me), (*iter)->getUnitGuid()); + target = Unit::GetUnit(*me, (*iter)->getUnitGuid()); if (target && target->getPowerType() == POWER_MANA) return target; } @@ -399,7 +399,7 @@ struct boss_faction_championsAI : public ScriptedAI Unit* target; for (iter = tList.begin(); iter!=tList.end(); ++iter) { - target = Unit::GetUnit((*me), (*iter)->getUnitGuid()); + target = Unit::GetUnit(*me, (*iter)->getUnitGuid()); if (target && me->GetDistance2d(target) < distance) ++count; } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp index d2f36efc06a..17ed6a79c76 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp @@ -136,10 +136,10 @@ public: if (!instance) return false; - Creature* Thane = CAST_CRE(Unit::GetUnit(*me, instance->GetData64(DATA_THANE))); - Creature* Lady = CAST_CRE(Unit::GetUnit(*me, instance->GetData64(DATA_LADY))); - Creature* Baron = CAST_CRE(Unit::GetUnit(*me, instance->GetData64(DATA_BARON))); - Creature* Sir = CAST_CRE(Unit::GetUnit(*me, instance->GetData64(DATA_SIR))); + Creature* Thane = Unit::GetCreature(*me, instance->GetData64(DATA_THANE)); + Creature* Lady = Unit::GetCreature(*me, instance->GetData64(DATA_LADY)); + Creature* Baron = Unit::GetCreature(*me, instance->GetData64(DATA_BARON)); + Creature* Sir = Unit::GetCreature(*me, instance->GetData64(DATA_SIR)); if (Thane && Lady && Baron && Sir) { diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index 98cbb95f10d..4d6bfc578ff 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -667,7 +667,7 @@ public: if (!instance || instance->IsEncounterInProgress() || instance->GetBossState(BOSS_KELTHUZAD) == DONE) return false; - Creature* pKelthuzad = CAST_CRE(Unit::GetUnit(*player, instance->GetData64(DATA_KELTHUZAD))); + Creature* pKelthuzad = Unit::GetCreature(*player, instance->GetData64(DATA_KELTHUZAD)); if (!pKelthuzad) return false; @@ -714,7 +714,6 @@ public: return true; } - }; class npc_kelthuzad_abomination : public CreatureScript @@ -726,16 +725,13 @@ class npc_kelthuzad_abomination : public CreatureScript { npc_kelthuzad_abominationAI(Creature* creature) : ScriptedAI(creature) { - instance = me->GetInstanceScript(); + _instance = creature->GetInstanceScript(); } - InstanceScript* instance; - EventMap events; - void Reset() { - events.Reset(); - events.ScheduleEvent(EVENT_MORTAL_WOUND, urand(2000, 5000)); + _events.Reset(); + _events.ScheduleEvent(EVENT_MORTAL_WOUND, urand(2000, 5000)); DoCast(me, SPELL_FRENZY, true); } @@ -744,15 +740,15 @@ class npc_kelthuzad_abomination : public CreatureScript if (!UpdateVictim()) return; - events.Update(diff); + _events.Update(diff); - while (uint32 eventId = events.ExecuteEvent()) + while (uint32 eventId = _events.ExecuteEvent()) { switch (eventId) { case EVENT_MORTAL_WOUND: DoCastVictim(SPELL_MORTAL_WOUND, true); - events.ScheduleEvent(EVENT_MORTAL_WOUND, urand(10000, 15000)); + _events.ScheduleEvent(EVENT_MORTAL_WOUND, urand(10000, 15000)); break; default: break; @@ -762,9 +758,13 @@ class npc_kelthuzad_abomination : public CreatureScript void JustDied(Unit* /*killer*/) { - if (instance) - instance->SetData(DATA_ABOMINATION_KILLED, instance->GetData(DATA_ABOMINATION_KILLED) + 1); + if (_instance) + _instance->SetData(DATA_ABOMINATION_KILLED, _instance->GetData(DATA_ABOMINATION_KILLED) + 1); } + + private: + InstanceScript* _instance; + EventMap _events; }; CreatureAI* GetAI(Creature* creature) const @@ -776,9 +776,7 @@ class npc_kelthuzad_abomination : public CreatureScript class achievement_just_cant_get_enough : public AchievementCriteriaScript { public: - achievement_just_cant_get_enough() : AchievementCriteriaScript("achievement_just_cant_get_enough") - { - } + achievement_just_cant_get_enough() : AchievementCriteriaScript("achievement_just_cant_get_enough") { } bool OnCheck(Player* /*player*/, Unit* target) { diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp index 577bc3cc822..c70db7d4ebc 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp @@ -195,7 +195,7 @@ public: std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); for (; i != me->getThreatManager().getThreatList().end(); ++i) { - Unit* temp = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* temp = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (temp && temp->GetTypeId() == TYPEID_PLAYER && temp->getClass() == Healer) { target = temp; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp index 5a7afc34f13..540876f421b 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp @@ -371,15 +371,15 @@ class npc_scorch_ground : public CreatureScript creature->SetDisplayId(16925); //model 2 in db cannot overwrite wdb fields } - void MoveInLineOfSight(Unit* unit) + void MoveInLineOfSight(Unit* who) { if (!_heat) { - if (unit->GetEntry() == NPC_IRON_CONSTRUCT) + if (who->GetEntry() == NPC_IRON_CONSTRUCT) { - if (!unit->HasAura(SPELL_HEAT) || !unit->HasAura(SPELL_MOLTEN)) + if (!who->HasAura(SPELL_HEAT) || !who->HasAura(SPELL_MOLTEN)) { - _constructGUID = unit->GetGUID(); + _constructGUID = who->GetGUID(); _heat = true; } } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp index 26ac516f209..a7853a07e22 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp @@ -344,7 +344,7 @@ public: { if (type != POINT_MOTION_TYPE) return; - Unit* ingvar = Unit::GetUnit((*me), instance ? instance->GetData64(DATA_INGVAR) : 0); + Unit* ingvar = Unit::GetUnit(*me, instance ? instance->GetData64(DATA_INGVAR) : 0); if (ingvar) { switch (id) diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp index 3db9a785f74..915d1c71bb2 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp @@ -93,7 +93,7 @@ public: ghost = (me->GetEntry() == MOB_SKARVALD_GHOST); if (!ghost && instance) { - Unit* dalronn = Unit::GetUnit((*me), instance->GetData64(DATA_DALRONN)); + Unit* dalronn = Unit::GetUnit(*me, instance->GetData64(DATA_DALRONN)); if (dalronn && dalronn->isDead()) CAST_CRE(dalronn)->Respawn(); @@ -107,7 +107,7 @@ public: { DoScriptText(YELL_SKARVALD_AGGRO, me); - Unit* dalronn = Unit::GetUnit((*me), instance->GetData64(DATA_DALRONN)); + Unit* dalronn = Unit::GetUnit(*me, instance->GetData64(DATA_DALRONN)); if (dalronn && dalronn->isAlive() && !dalronn->getVictim()) dalronn->getThreatManager().addThreat(who, 0.0f); @@ -119,7 +119,7 @@ public: { if (!ghost && instance) { - Unit* dalronn = Unit::GetUnit((*me), instance->GetData64(DATA_DALRONN)); + Unit* dalronn = Unit::GetUnit(*me, instance->GetData64(DATA_DALRONN)); if (dalronn) { if (dalronn->isDead()) @@ -250,7 +250,7 @@ public: ghost = me->GetEntry() == MOB_DALRONN_GHOST; if (!ghost && instance) { - Unit* skarvald = Unit::GetUnit((*me), instance->GetData64(DATA_SKARVALD)); + Unit* skarvald = Unit::GetUnit(*me, instance->GetData64(DATA_SKARVALD)); if (skarvald && skarvald->isDead()) CAST_CRE(skarvald)->Respawn(); @@ -262,7 +262,7 @@ public: { if (!ghost && instance) { - Unit* skarvald = Unit::GetUnit((*me), instance->GetData64(DATA_SKARVALD)); + Unit* skarvald = Unit::GetUnit(*me, instance->GetData64(DATA_SKARVALD)); if (skarvald && skarvald->isAlive() && !skarvald->getVictim()) skarvald->getThreatManager().addThreat(who, 0.0f); @@ -277,7 +277,7 @@ public: { if (!ghost && instance) { - Unit* skarvald = Unit::GetUnit((*me), instance->GetData64(DATA_SKARVALD)); + Unit* skarvald = Unit::GetUnit(*me, instance->GetData64(DATA_SKARVALD)); if (skarvald) { if (skarvald->isDead()) diff --git a/src/server/scripts/Northrend/sholazar_basin.cpp b/src/server/scripts/Northrend/sholazar_basin.cpp index 37c0e9fc976..93d0182ea08 100644 --- a/src/server/scripts/Northrend/sholazar_basin.cpp +++ b/src/server/scripts/Northrend/sholazar_basin.cpp @@ -306,10 +306,9 @@ public: if (me->isDead()) return; - if (me->isSummon()) - if (Unit* summoner = me->ToTempSummon()->GetSummoner()) - if (summoner) - me->GetMotionMaster()->MovePoint(0, summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ()); + if (TempSummon* summ = me->ToTempSummon()) + if (Unit* summoner = summ->GetSummoner()) + me->GetMotionMaster()->MovePoint(0, summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ()); Reset(); } diff --git a/src/server/scripts/Northrend/storm_peaks.cpp b/src/server/scripts/Northrend/storm_peaks.cpp index 3560774ce0d..251bdb8278a 100644 --- a/src/server/scripts/Northrend/storm_peaks.cpp +++ b/src/server/scripts/Northrend/storm_peaks.cpp @@ -567,9 +567,9 @@ public: enter_timer -= diff; } - void MoveInLineOfSight(Unit* unit) + void MoveInLineOfSight(Unit* who) { - if (!unit || !drakeGUID) + if (!who || !drakeGUID) return; Creature* drake = Unit::GetCreature(*me, drakeGUID); @@ -581,21 +581,21 @@ public: if (!me->IsOnVehicle(drake) && !me->HasAura(SPELL_ICE_PRISON)) { - if (unit->IsVehicle() && me->IsWithinDist(unit, 25.0f, true) && unit->ToCreature() && unit->ToCreature()->GetEntry() == 29709) + if (who->IsVehicle() && me->IsWithinDist(who, 25.0f, true) && who->ToCreature() && who->ToCreature()->GetEntry() == 29709) { - uint8 seat = unit->GetVehicleKit()->GetNextEmptySeat(0, true); + uint8 seat = who->GetVehicleKit()->GetNextEmptySeat(0, true); if (seat <= 0) return; - me->EnterVehicle(unit, seat); + me->EnterVehicle(who, seat); me->SendMovementFlagUpdate(); hasEmptySeats = false; } } - if (unit->ToCreature() && me->IsOnVehicle(drake)) + if (who->ToCreature() && me->IsOnVehicle(drake)) { - if (unit->ToCreature()->GetEntry() == NPC_QUEST_GIVER && me->IsWithinDist(unit, 15.0f, false)) + if (who->ToCreature()->GetEntry() == NPC_QUEST_GIVER && me->IsWithinDist(who, 15.0f, false)) { Unit* rider = drake->GetVehicleKit()->GetPassenger(0); if (!rider) @@ -616,7 +616,7 @@ public: if (rider->ToPlayer()) rider->ToPlayer()->KilledMonsterCredit(29709, 0); - drake->ToCreature()->ForcedDespawn(0); + drake->ForcedDespawn(0); } } } @@ -748,14 +748,14 @@ class npc_hyldsmeet_protodrake : public CreatureScript void AddSC_storm_peaks() { - new npc_agnetta_tyrsdottar; - new npc_frostborn_scout; - new npc_thorim; - new npc_victorious_challenger; - new npc_loklira_crone; - new npc_injured_goblin; - new npc_roxi_ramrocket; - new npc_brunnhildar_prisoner; - new npc_icefang; - new npc_hyldsmeet_protodrake; + new npc_agnetta_tyrsdottar(); + new npc_frostborn_scout(); + new npc_thorim(); + new npc_victorious_challenger(); + new npc_loklira_crone(); + new npc_injured_goblin(); + new npc_roxi_ramrocket(); + new npc_brunnhildar_prisoner(); + new npc_icefang(); + new npc_hyldsmeet_protodrake(); } diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp index e47810c74f7..8d971c37559 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp @@ -201,7 +201,7 @@ public: { for (uint8 i = 0; i < 5; ++i) { - Unit* Portal = Unit::GetUnit((*me), PortalsGuid[i]); + Unit* Portal = Unit::GetUnit(*me, PortalsGuid[i]); if (Portal && Portal->isAlive()) Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); PortalsGuid[i] = 0; diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp index be4f3107d05..99661d8818c 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp @@ -166,7 +166,7 @@ public: { std::list& m_threatlist = me->getThreatManager().getThreatList(); for (std::list::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - if (Unit* target = Unit::GetUnit((*me), (*i)->getUnitGuid())) + if (Unit* target = Unit::GetUnit(*me, (*i)->getUnitGuid())) if (target->isAlive() && !me->IsWithinDist(target, 35, false)) DoCast(target, SPELL_THUNDERING_STORM, true); ThunderingStorm_Timer = 15000; @@ -189,7 +189,7 @@ public: { std::list& m_threatlist = me->getThreatManager().getThreatList(); for (std::list::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - if (Unit* target = Unit::GetUnit((*me), (*i)->getUnitGuid())) + if (Unit* target = Unit::GetUnit(*me, (*i)->getUnitGuid())) if (target->isAlive() && me->IsWithinMeleeRange(target)) { me->TauntApply(target); diff --git a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp index 7ae09e925a5..caac89da765 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp @@ -186,7 +186,7 @@ public: void RevertThreatOnTarget(uint64 guid) { Unit* unit = NULL; - unit = Unit::GetUnit((*me), guid); + unit = Unit::GetUnit(*me, guid); if (unit) { if (DoGetThreat(unit)) diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 8925f2899f5..1926929c97c 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -865,7 +865,7 @@ public: { if (GlaiveGUID[i]) { - Unit* Glaive = Unit::GetUnit((*me), GlaiveGUID[i]); + Unit* Glaive = Unit::GetUnit(*me, GlaiveGUID[i]); if (Glaive) { Glaive->CastSpell(me, SPELL_GLAIVE_RETURNS, false); // Make it look like the Glaive flies back up to us @@ -1492,7 +1492,7 @@ public: std::vector eliteList; for (std::list::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr) { - Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); if (unit && unit->GetEntry() == ILLIDARI_ELITE) eliteList.push_back(unit); } @@ -1649,9 +1649,9 @@ public: Unit* Channel = NULL, *Spirit[2] = { NULL, NULL }; if (ChannelCount <= 5) { - Channel = Unit::GetUnit((*me), ChannelGUID); - Spirit[0] = Unit::GetUnit((*me), SpiritGUID[0]); - Spirit[1] = Unit::GetUnit((*me), SpiritGUID[1]); + Channel = Unit::GetUnit(*me, ChannelGUID); + Spirit[0] = Unit::GetUnit(*me, SpiritGUID[0]); + Spirit[1] = Unit::GetUnit(*me, SpiritGUID[1]); if (!Channel || !Spirit[0] || !Spirit[1]) return; } @@ -2145,7 +2145,7 @@ public: void JustDied(Unit* /*killer*/) { - if (Unit* target = Unit::GetUnit((*me), TargetGUID)) + if (Unit* target = Unit::GetUnit(*me, TargetGUID)) target->RemoveAurasDueToSpell(SPELL_PARALYZE); } diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp index f5b2e3efa92..4e4607a7d44 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -250,7 +250,7 @@ public: Unit* unit = NULL; if (TargetGUID[i]) { - unit = Unit::GetUnit((*me), TargetGUID[i]); + unit = Unit::GetUnit(*me, TargetGUID[i]); if (unit) unit->CastSpell(unit, SPELL_ATTRACTION, true); TargetGUID[i] = 0; diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp index 70f27d6caf9..c5e78f2fa7b 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -219,7 +219,7 @@ public: std::list::const_iterator itr = m_threatlist.begin(); for (; itr != m_threatlist.end(); ++itr) { - Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); if (unit) { DoModifyThreatPercent(unit, -100); @@ -441,7 +441,7 @@ public: std::list::const_iterator itr = m_threatlist.begin(); for (; itr != m_threatlist.end(); ++itr) { - Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); if (unit && unit->isAlive() && (unit->GetTypeId() == TYPEID_PLAYER)) // Only alive players targets.push_back(unit); } diff --git a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp index cd804ad0d03..0dd1d37116c 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp @@ -184,7 +184,7 @@ public: std::list::const_iterator i = m_threatlist.begin(); for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && me->IsWithinMeleeRange(unit)) { if (unit->GetHealth() > health) diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp index 4edd8b23a47..bc12a6c1c6c 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp @@ -175,7 +175,7 @@ public: std::list targets; for (; itr != m_threatlist.end(); ++itr) { - Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); if (unit && unit->isAlive()) targets.push_back(unit); } @@ -325,7 +325,7 @@ public: std::list::const_iterator i = m_threatlist.begin(); for (i = m_threatlist.begin(); i != m_threatlist.end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && unit->isAlive()) { float threat = DoGetThreat(unit); @@ -345,7 +345,7 @@ public: Unit* Ghost = NULL; if (GhostGUID) - Ghost = Unit::GetUnit((*me), GhostGUID); + Ghost = Unit::GetUnit(*me, GhostGUID); if (Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH)) { /*float x, y, z; @@ -392,7 +392,7 @@ public: Done = true; if (AggroTargetGUID) { - Unit* unit = Unit::GetUnit((*me), AggroTargetGUID); + Unit* unit = Unit::GetUnit(*me, AggroTargetGUID); if (unit) AttackStart(unit); diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index a0e85e1b334..0742f174ccf 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -299,7 +299,7 @@ public: Unit* Member = NULL; if (Council[i]) { - Member = Unit::GetUnit((*me), Council[i]); + Member = Unit::GetUnit(*me, Council[i]); if (Member && Member->isAlive()) CAST_CRE(Member)->AI()->AttackStart(target); } @@ -512,7 +512,7 @@ public: member = urand(1, 3); if (member != 2) // No need to create another pointer to us using Unit::GetUnit - unit = Unit::GetUnit((*me), Council[member]); + unit = Unit::GetUnit(*me, Council[member]); return unit; } @@ -526,7 +526,7 @@ public: } for (uint8 i = 0; i < 4; ++i) { - Unit* unit = Unit::GetUnit((*me), Council[i]); + Unit* unit = Unit::GetUnit(*me, Council[i]); if (unit) unit->CastSpell(unit, spellid, true, 0, 0, me->GetGUID()); } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp index 9af79de7426..206ba3d9455 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -225,7 +225,7 @@ public: //Only if not incombat check if the event is started if (!me->isInCombat() && instance && instance->GetData(DATA_KARATHRESSEVENT)) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_KARATHRESSEVENT_STARTER)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESSEVENT_STARTER)); if (target) { @@ -381,7 +381,7 @@ public: //Only if not incombat check if the event is started if (!me->isInCombat() && instance && instance->GetData(DATA_KARATHRESSEVENT)) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_KARATHRESSEVENT_STARTER)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESSEVENT_STARTER)); if (target) { @@ -522,7 +522,7 @@ public: //Only if not incombat check if the event is started if (!me->isInCombat() && instance && instance->GetData(DATA_KARATHRESSEVENT)) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_KARATHRESSEVENT_STARTER)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESSEVENT_STARTER)); if (target) { @@ -648,7 +648,7 @@ public: //Only if not incombat check if the event is started if (!me->isInCombat() && instance && instance->GetData(DATA_KARATHRESSEVENT)) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_KARATHRESSEVENT_STARTER)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESSEVENT_STARTER)); if (target) { @@ -730,13 +730,13 @@ public: switch (rand()%4) { case 0: - unit = Unit::GetUnit((*me), instance->GetData64(DATA_KARATHRESS)); + unit = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESS)); break; case 1: - unit = Unit::GetUnit((*me), instance->GetData64(DATA_SHARKKIS)); + unit = Unit::GetUnit(*me, instance->GetData64(DATA_SHARKKIS)); break; case 2: - unit = Unit::GetUnit((*me), instance->GetData64(DATA_TIDALVESS)); + unit = Unit::GetUnit(*me, instance->GetData64(DATA_TIDALVESS)); break; case 3: unit = me; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index b614a5afa3a..18d8b2b5a1e 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -783,7 +783,7 @@ public: if (instance) { // check if vashj is death - Unit* Vashj = Unit::GetUnit((*me), instance->GetData64(DATA_LADYVASHJ)); + Unit* Vashj = Unit::GetUnit(*me, instance->GetData64(DATA_LADYVASHJ)); if (!Vashj || (Vashj && !Vashj->isAlive()) || (Vashj && CAST_AI(boss_lady_vashj::boss_lady_vashjAI, CAST_CRE(Vashj)->AI())->Phase != 3)) { // remove @@ -839,7 +839,7 @@ public: if (CheckTimer <= diff) { - Unit* vashj = Unit::GetUnit((*me), instance->GetData64(DATA_LADYVASHJ)); + Unit* vashj = Unit::GetUnit(*me, instance->GetData64(DATA_LADYVASHJ)); if (vashj && vashj->isAlive()) { diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp index 35d5ab7793b..4876410890c 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp @@ -111,7 +111,7 @@ public: void JustDied(Unit* /*killer*/) { - Unit* unit = Unit::GetUnit((*me), victimGUID); + Unit* unit = Unit::GetUnit(*me, victimGUID); if (unit && unit->HasAura(SPELL_INSIDIOUS_WHISPER)) unit->RemoveAurasDueToSpell(SPELL_INSIDIOUS_WHISPER); } @@ -140,7 +140,7 @@ public: if (me->getVictim()->GetGUID() != victimGUID) { DoModifyThreatPercent(me->getVictim(), -100); - Unit* owner = Unit::GetUnit((*me), victimGUID); + Unit* owner = Unit::GetUnit(*me, victimGUID); if (owner && owner->isAlive()) { me->AddThreat(owner, 999999); diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp index 77f521e5094..739168863f4 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp @@ -231,7 +231,7 @@ public: { if (instance && instance->GetData64(DATA_MEKGINEERSTEAMRIGGER) && instance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == IN_PROGRESS) { - if (Unit* pMekgineer = Unit::GetUnit((*me), instance->GetData64(DATA_MEKGINEERSTEAMRIGGER))) + if (Unit* pMekgineer = Unit::GetUnit(*me, instance->GetData64(DATA_MEKGINEERSTEAMRIGGER))) { if (me->IsWithinDistInMap(pMekgineer, MAX_REPAIR_RANGE)) { diff --git a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp index de4b23d5f6d..0f42b1b7e53 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp @@ -223,7 +223,7 @@ public: //Only if not incombat check if the event is started if (!me->isInCombat() && instance && instance->GetData(DATA_MAULGAREVENT)) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_MAULGAREVENT_TANK)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_MAULGAREVENT_TANK)); if (target) { @@ -383,7 +383,7 @@ public: //Only if not incombat check if the event is started if (!me->isInCombat() && instance && instance->GetData(DATA_MAULGAREVENT)) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_MAULGAREVENT_TANK)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_MAULGAREVENT_TANK)); if (target) { @@ -498,7 +498,7 @@ public: //Only if not incombat check if the event is started if (!me->isInCombat() && instance && instance->GetData(DATA_MAULGAREVENT)) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_MAULGAREVENT_TANK)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_MAULGAREVENT_TANK)); if (target) { @@ -618,7 +618,7 @@ public: //Only if not incombat check if the event is started if (!me->isInCombat() && instance && instance->GetData(DATA_MAULGAREVENT)) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_MAULGAREVENT_TANK)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_MAULGAREVENT_TANK)); if (target) { @@ -728,7 +728,7 @@ public: //Only if not incombat check if the event is started if (!me->isInCombat() && instance && instance->GetData(DATA_MAULGAREVENT)) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_MAULGAREVENT_TANK)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_MAULGAREVENT_TANK)); if (target) { diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp index f92a163f553..c1489671292 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp @@ -166,7 +166,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript { for (std::vector::const_iterator itr = adds.begin(); itr!= adds.end(); ++itr) { - Unit* temp = Unit::GetUnit((*me), *itr); + Unit* temp = Unit::GetUnit(*me, *itr); if (temp && temp->isAlive()) { (*temp).GetMotionMaster()->Clear(true); @@ -178,7 +178,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript for (std::vector::const_iterator itr = assassins.begin(); itr!= assassins.end(); ++itr) { - Unit* temp = Unit::GetUnit((*me), *itr); + Unit* temp = Unit::GetUnit(*me, *itr); if (temp && temp->isAlive()) { (*temp).GetMotionMaster()->Clear(true); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index 074ce08ca33..77c07f5fe4d 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -500,7 +500,7 @@ class mob_ember_of_alar : public CreatureScript me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); if (instance && instance->GetData(DATA_ALAREVENT) == 2) { - if (Unit* Alar = Unit::GetUnit((*me), instance->GetData64(DATA_ALAR))) + if (Unit* Alar = Unit::GetUnit(*me, instance->GetData64(DATA_ALAR))) { int32 AlarHealth = int32(Alar->GetHealth()) - int32(Alar->CountPctFromMaxHealth(3)); if (AlarHealth > 0) diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp index 010b741caef..c0203150789 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp @@ -454,7 +454,7 @@ class mob_solarium_priest : public CreatureScript { case 0: if (instance) - target = Unit::GetUnit((*me), instance->GetData64(DATA_ASTROMANCER)); + target = Unit::GetUnit(*me, instance->GetData64(DATA_ASTROMANCER)); break; case 1: target = me; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index 318d9c629b9..1d8c7e71bef 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -253,7 +253,7 @@ struct advisorbase_ai : public ScriptedAI DelayRes_Timer = 0; FakeDeath = false; - Unit* Target = Unit::GetUnit((*me), DelayRes_Target); + Unit* Target = Unit::GetUnit(*me, DelayRes_Target); if (!Target) Target = me->getVictim(); @@ -464,7 +464,7 @@ class boss_kaelthas : public CreatureScript for (uint8 i = 0; i < MAX_ADVISORS; ++i) { - if (Unit* pAdvisor = Unit::GetUnit((*me), m_auiAdvisorGuid[i])) + if (Unit* pAdvisor = Unit::GetUnit(*me, m_auiAdvisorGuid[i])) pAdvisor->Kill(pAdvisor); } } @@ -895,7 +895,7 @@ class boss_kaelthas : public CreatureScript // 1) Kael'thas will portal the whole raid right into his body for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) { //Use work around packet to prevent player from being dropped from combat @@ -916,7 +916,7 @@ class boss_kaelthas : public CreatureScript // 2) At that point he will put a Gravity Lapse debuff on everyone for (i = me->getThreatManager().getThreatList().begin(); i != me->getThreatManager().getThreatList().end(); ++i) { - if (Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid())) + if (Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid())) { DoCast(unit, SPELL_KNOCKBACK, true); //Gravity lapse - needs an exception in Spell system to work @@ -949,7 +949,7 @@ class boss_kaelthas : public CreatureScript //Remove flight for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - if (Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid())) + if (Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid())) { //Using packet workaround WorldPacket data(12); @@ -1289,7 +1289,7 @@ class boss_grand_astromancer_capernian : public CreatureScript std::list& m_threatlist = me->getThreatManager().getThreatList(); for (std::list::const_iterator i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); //if in melee range if (unit && unit->IsWithinDistInMap(me, 5)) { diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp index 17b9ec23f3d..4fdaebeacae 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/netherstorm.cpp @@ -115,7 +115,7 @@ public: if (someplayer) { - Unit* p = Unit::GetUnit((*me), someplayer); + Unit* p = Unit::GetUnit(*me, someplayer); if (p && p->GetTypeId() == TYPEID_PLAYER) { switch (me->GetEntry()) @@ -142,7 +142,7 @@ public: if (goConsole) { - if (GameObject* go = GameObject::GetGameObject((*me), goConsole)) + if (GameObject* go = GameObject::GetGameObject(*me, goConsole)) go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); } } @@ -243,7 +243,7 @@ public: case 1: if (someplayer) { - Unit* u = Unit::GetUnit((*me), someplayer); + Unit* u = Unit::GetUnit(*me, someplayer); if (u && u->GetTypeId() == TYPEID_PLAYER) DoScriptText(EMOTE_START, me, u); } Event_Timer = 60000; @@ -271,14 +271,14 @@ public: DoScriptText(EMOTE_COMPLETE, me); if (someplayer) { - Unit* u = Unit::GetUnit((*me), someplayer); + Unit* u = Unit::GetUnit(*me, someplayer); if (u && u->GetTypeId() == TYPEID_PLAYER) CAST_PLR(u)->KilledMonsterCredit(me->GetEntry(), me->GetGUID()); DoCast(me, SPELL_DISABLE_VISUAL); } if (goConsole) { - if (GameObject* go = GameObject::GetGameObject((*me), goConsole)) + if (GameObject* go = GameObject::GetGameObject(*me, goConsole)) go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); } ++Phase; diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index 46257f32ee2..340049ba4fa 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -262,7 +262,7 @@ public: { if (PlayerGUID) { - Unit* player = Unit::GetUnit((*me), PlayerGUID); + Unit* player = Unit::GetUnit(*me, PlayerGUID); if (player) DoCast(player, SPELL_FORCE_OF_NELTHARAKU, true); @@ -758,8 +758,8 @@ public: uint32 NextStep(uint32 Step) { - Unit* player = Unit::GetUnit((*me), PlayerGUID); - Unit* Illi = Unit::GetUnit((*me), IllidanGUID); + Player* player = Unit::GetPlayer(*me, PlayerGUID); + Unit* Illi = Unit::GetUnit(*me, IllidanGUID); if (!player || !Illi) { @@ -769,213 +769,178 @@ public: switch (Step) { - case 0: - return 0; - break; - - case 1: - me->GetMotionMaster()->MovePoint(0, -5104.41f, 595.297f, 85.6838f); - return 9000; - break; - - case 2: - DoScriptText(OVERLORD_YELL_1, me, player); - return 4500; - break; - - case 3: - me->SetInFront(player); - return 3200; - break; - - case 4: - DoScriptText(OVERLORD_SAY_2, me, player); - return 2000; - break; - - case 5: - Illi->SetVisible(true); - Illi->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - return 350; - break; - - case 6: - Illi->CastSpell(Illi, SPELL_ONE, true); - Illi->SetTarget(me->GetGUID()); - me->SetTarget(IllidanGUID); - return 2000; - break; - - case 7: - DoScriptText(OVERLORD_YELL_2, me); - return 4500; - break; - - case 8: - me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); - return 2500; - break; - - case 9: - DoScriptText(OVERLORD_SAY_3, me); - return 6500; - break; - - case 10: - DoScriptText(LORD_ILLIDAN_SAY_1, Illi); - return 5000; - break; - - case 11: - DoScriptText(OVERLORD_SAY_4, me, player); - return 6000; - break; - - case 12: - DoScriptText(LORD_ILLIDAN_SAY_2, Illi); - return 5500; - break; - - case 13: - DoScriptText(LORD_ILLIDAN_SAY_3, Illi); - return 4000; - break; - - case 14: - Illi->SetTarget(PlayerGUID); - return 1500; - break; - - case 15: - DoScriptText(LORD_ILLIDAN_SAY_4, Illi); - return 1500; - break; - - case 16: - if (player) - { - Illi->CastSpell(player, SPELL_TWO, true); - player->RemoveAurasDueToSpell(SPELL_THREE); - player->RemoveAurasDueToSpell(SPELL_FOUR); + case 0: + return 0; + break; + case 1: + me->GetMotionMaster()->MovePoint(0, -5104.41f, 595.297f, 85.6838f); + return 9000; + break; + case 2: + DoScriptText(OVERLORD_YELL_1, me, player); + return 4500; + break; + case 3: + me->SetInFront(player); + return 3200; + break; + case 4: + DoScriptText(OVERLORD_SAY_2, me, player); + return 2000; + break; + case 5: + Illi->SetVisible(true); + Illi->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + return 350; + break; + case 6: + Illi->CastSpell(Illi, SPELL_ONE, true); + Illi->SetTarget(me->GetGUID()); + me->SetTarget(IllidanGUID); + return 2000; + break; + case 7: + DoScriptText(OVERLORD_YELL_2, me); + return 4500; + break; + case 8: + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); + return 2500; + break; + case 9: + DoScriptText(OVERLORD_SAY_3, me); + return 6500; + break; + case 10: + DoScriptText(LORD_ILLIDAN_SAY_1, Illi); return 5000; - } - else - { - CAST_PLR(player)->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE); - Step = 30; - return 100; - } - break; - - case 17: - DoScriptText(LORD_ILLIDAN_SAY_5, Illi); - return 5000; - break; - - case 18: - DoScriptText(LORD_ILLIDAN_SAY_6, Illi); - return 5000; - break; - - case 19: - DoScriptText(LORD_ILLIDAN_SAY_7, Illi); - return 5000; - break; - - case 20: - Illi->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - Illi->SetDisableGravity(true); - return 500; - break; - - case 21: - DoScriptText(OVERLORD_SAY_5, me); - return 500; - break; - - case 22: - Illi->SetVisible(false); - Illi->setDeathState(JUST_DIED); - return 1000; - break; - - case 23: - me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - return 2000; - break; - - case 24: - me->SetTarget(PlayerGUID); - return 5000; - break; - - case 25: - DoScriptText(OVERLORD_SAY_6, me); - return 2000; - break; - - case 26: - if (player) - CAST_PLR(player)->GroupEventHappens(QUEST_LORD_ILLIDAN_STORMRAGE, me); - return 6000; - break; - - case 27: - { - Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); - if (Yarzill) - Yarzill->SetTarget(PlayerGUID); + break; + case 11: + DoScriptText(OVERLORD_SAY_4, me, player); + return 6000; + break; + case 12: + DoScriptText(LORD_ILLIDAN_SAY_2, Illi); + return 5500; + break; + case 13: + DoScriptText(LORD_ILLIDAN_SAY_3, Illi); + return 4000; + break; + case 14: + Illi->SetTarget(PlayerGUID); + return 1500; + break; + case 15: + DoScriptText(LORD_ILLIDAN_SAY_4, Illi); + return 1500; + break; + case 16: + if (player) + { + Illi->CastSpell(player, SPELL_TWO, true); + player->RemoveAurasDueToSpell(SPELL_THREE); + player->RemoveAurasDueToSpell(SPELL_FOUR); + return 5000; + } + else + { + player->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE); + Step = 30; + return 100; + } + break; + case 17: + DoScriptText(LORD_ILLIDAN_SAY_5, Illi); + return 5000; + break; + case 18: + DoScriptText(LORD_ILLIDAN_SAY_6, Illi); + return 5000; + break; + case 19: + DoScriptText(LORD_ILLIDAN_SAY_7, Illi); + return 5000; + break; + case 20: + Illi->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + Illi->SetDisableGravity(true); return 500; - } - break; - - case 28: - player->RemoveAurasDueToSpell(SPELL_TWO); - player->RemoveAurasDueToSpell(41519); - player->CastSpell(player, SPELL_THREE, true); - player->CastSpell(player, SPELL_FOUR, true); - return 1000; - break; - - case 29: - { - Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); - if (Yarzill) - DoScriptText(YARZILL_THE_MERC_SAY, Yarzill, player); - return 5000; - } - break; - - case 30: - { - Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); - if (Yarzill) - Yarzill->SetTarget(0); - return 5000; - } - break; - - case 31: - { - Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); - if (Yarzill) - Yarzill->CastSpell(player, 41540, true); + break; + case 21: + DoScriptText(OVERLORD_SAY_5, me); + return 500; + break; + case 22: + Illi->SetVisible(false); + Illi->setDeathState(JUST_DIED); return 1000; - } - break; - - case 32: - me->GetMotionMaster()->MovePoint(0, -5085.77f, 577.231f, 86.6719f); return 5000; - break; - - case 33: - Reset(); - return 100; - break; - - default : - return 0; - break; + break; + case 23: + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + return 2000; + break; + case 24: + me->SetTarget(PlayerGUID); + return 5000; + break; + case 25: + DoScriptText(OVERLORD_SAY_6, me); + return 2000; + break; + case 26: + player->GroupEventHappens(QUEST_LORD_ILLIDAN_STORMRAGE, me); + return 6000; + break; + case 27: + { + Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); + if (Yarzill) + Yarzill->SetTarget(PlayerGUID); + return 500; + } + break; + case 28: + player->RemoveAurasDueToSpell(SPELL_TWO); + player->RemoveAurasDueToSpell(41519); + player->CastSpell(player, SPELL_THREE, true); + player->CastSpell(player, SPELL_FOUR, true); + return 1000; + break; + case 29: + { + Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); + if (Yarzill) + DoScriptText(YARZILL_THE_MERC_SAY, Yarzill, player); + return 5000; + } + break; + case 30: + { + Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); + if (Yarzill) + Yarzill->SetTarget(0); + return 5000; + } + break; + case 31: + { + Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); + if (Yarzill) + Yarzill->CastSpell(player, 41540, true); + return 1000; + } + break; + case 32: + me->GetMotionMaster()->MovePoint(0, -5085.77f, 577.231f, 86.6719f); return 5000; + break; + case 33: + Reset(); + return 100; + break; + default : + return 0; + break; } } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index d3dc577175d..6858827ed8e 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -3099,35 +3099,35 @@ public: void AddSC_npcs_special() { - new npc_air_force_bots; - new npc_lunaclaw_spirit; - new npc_chicken_cluck; - new npc_dancing_flames; - new npc_doctor; - new npc_injured_patient; - new npc_garments_of_quests; - new npc_guardian; - new npc_mount_vendor; - new npc_rogue_trainer; - new npc_sayge; - new npc_steam_tonk; - new npc_tonk_mine; - new npc_winter_reveler; - new npc_brewfest_reveler; - new npc_snake_trap; - new npc_mirror_image; - new npc_ebon_gargoyle; - new npc_lightwell; - new mob_mojo; - new npc_training_dummy; - new npc_shadowfiend; - new npc_wormhole; - new npc_pet_trainer; - new npc_locksmith; - new npc_tabard_vendor; - new npc_experience; - new npc_fire_elemental; - new npc_earth_elemental; - new npc_firework; + new npc_air_force_bots(); + new npc_lunaclaw_spirit(); + new npc_chicken_cluck(); + new npc_dancing_flames(); + new npc_doctor(); + new npc_injured_patient(); + new npc_garments_of_quests(); + new npc_guardian(); + new npc_mount_vendor(); + new npc_rogue_trainer(); + new npc_sayge(); + new npc_steam_tonk(); + new npc_tonk_mine(); + new npc_winter_reveler(); + new npc_brewfest_reveler(); + new npc_snake_trap(); + new npc_mirror_image(); + new npc_ebon_gargoyle(); + new npc_lightwell(); + new mob_mojo(); + new npc_training_dummy(); + new npc_shadowfiend(); + new npc_wormhole(); + new npc_pet_trainer(); + new npc_locksmith(); + new npc_tabard_vendor(); + new npc_experience(); + new npc_fire_elemental(); + new npc_earth_elemental(); + new npc_firework(); new npc_spring_rabbit(); } From 512aa8897bf30bbb8379f4c4efc59cc0779ec061 Mon Sep 17 00:00:00 2001 From: Discover- Date: Sun, 1 Apr 2012 14:54:15 +0200 Subject: [PATCH 0384/1149] Database/Spawns: Spawn some missing creatures. Closes #5974 --- .../world/2012_04_01_00_world_creature.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 sql/updates/world/2012_04_01_00_world_creature.sql diff --git a/sql/updates/world/2012_04_01_00_world_creature.sql b/sql/updates/world/2012_04_01_00_world_creature.sql new file mode 100644 index 00000000000..f6a42a6ef08 --- /dev/null +++ b/sql/updates/world/2012_04_01_00_world_creature.sql @@ -0,0 +1,17 @@ +-- Add missing spawns to db +DELETE FROM `creature` WHERE `guid` IN (4764,28648,40266,40267,40470,40471,40510,40516,40517,40518,40601,40602,40603,41320); +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `curhealth`) VALUES +(4764,33608,530,1,1,-2263.63,5559.49,67.0918,5.91667,180,0,9156), -- Alchemy +(28648,33609,530,1,1,-2262.64,5561.96,67.0948,5.89921,180,0,9156), -- Blacksmithing +(40266,33610,530,1,1,-2261.59,5564.54,67.095,5.93412,180,0,9156), -- Enchanting +(40267,33611,530,1,1,-2260.64,5567.08,67.092,5.93412,180,0,9156), -- Engineering +(40470,33612,530,1,1,-2264.54,5562.77,67.0939,2.79253,180,0,9156), -- Leatherworking +(40471,33613,530,1,1,-2265.57,5560.32,67.0911,2.80998,180,0,9156), -- Tailoring +(40510,33614,530,1,1,-2263.47,5565.35,67.0937,2.80998,180,0,9156), -- Jewelcrafting +(40516,33615,530,1,1,-2262.36,5567.8,67.0909,2.79253,180,0,9156), -- Inscription +(40517,33616,530,1,1,-2268.1,5563.18,67.0919,5.89921,180,0,9156), -- Herbalism +(40518,33617,530,1,1,-2266.98,5565.78,67.0927,5.89921,180,0,9156), -- Mining +(40601,33618,530,1,1,-2265.86,5568.36,67.0911,5.84685,180,0,9156), -- Skinning +(40602,33619,530,1,1,-2267.52,5569.19,67.0896,2.74017,180,0,9156), -- Cooking +(40603,33621,530,1,1,-2269.93,5564.2,67.09,2.75762,180,0,9156), -- First Aid +(41320,33623,530,1,1,-2268.81,5566.68,67.0905,2.74017,180,0,9156); -- Fishing From 1bc99cd5af348c578a8cfe7e3641c1e8f59bb7a0 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 1 Apr 2012 14:55:19 +0100 Subject: [PATCH 0385/1149] DB/Spawns: Fix previous commit (512aa8897bf30bbb8) --- .../world/2012_04_01_world_creature.sql | 26 +++++++++++++++++++ src/server/game/Entities/Player/Player.cpp | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_04_01_world_creature.sql diff --git a/sql/updates/world/2012_04_01_world_creature.sql b/sql/updates/world/2012_04_01_world_creature.sql new file mode 100644 index 00000000000..f6dff34cfa9 --- /dev/null +++ b/sql/updates/world/2012_04_01_world_creature.sql @@ -0,0 +1,26 @@ +-- Re-add deleted data +DELETE FROM `creature` WHERE `guid` IN (4764,28648,40266,40267,40470,40471,40510,40516,40517,40518,40601,40602,40603,41320); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(4764,26796,576,2,1,0,0,424.547,185.962,-34.9367,4.72984,3600,0,0,1,0,0,0,0,0), +(28648,17148,530,1,1,0,0,-2910.22,6473.03,82.4898,2.49669,300,0,0,5914,0,0,0,0,0), +(40267,37671,1,1,1,0,0,1391.2,-4486.23,31.4544,3.3355,300,0,0,42,0,0,0,0,0), +(40470,37671,1,1,1,0,0,1392.66,-4481.87,31.3782,1.97284,300,0,0,42,0,0,0,0,0), +(40471,37671,1,1,1,0,0,1393.92,-4489.57,31.4737,4.93701,300,0,0,42,0,0,0,0,0); + +-- Add missing spawns to db (trainers) +DELETE FROM `creature` WHERE `guid` IN (40266,40510,40516,40517,40518,40601,40602,40603,41320,41674,41723,41775,41779,41780); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`curhealth`) VALUES +(40266,33608,530,1,1,-2263.63,5559.49,67.0918,5.91667,180,0,1), -- Alchemy +(40510,33609,530,1,1,-2262.64,5561.96,67.0948,5.89921,180,0,1), -- Blacksmithing +(40516,33610,530,1,1,-2261.59,5564.54,67.095,5.93412,180,0,1), -- Enchanting +(40517,33611,530,1,1,-2260.64,5567.08,67.092,5.93412,180,0,1), -- Engineering +(40518,33612,530,1,1,-2264.54,5562.77,67.0939,2.79253,180,0,1), -- Leatherworking +(40601,33613,530,1,1,-2265.57,5560.32,67.0911,2.80998,180,0,1), -- Tailoring +(40602,33614,530,1,1,-2263.47,5565.35,67.0937,2.80998,180,0,1), -- Jewelcrafting +(40603,33615,530,1,1,-2262.36,5567.8,67.0909,2.79253,180,0,1), -- Inscription +(41320,33616,530,1,1,-2268.1,5563.18,67.0919,5.89921,180,0,1), -- Herbalism +(41674,33617,530,1,1,-2266.98,5565.78,67.0927,5.89921,180,0,1), -- Mining +(41723,33618,530,1,1,-2265.86,5568.36,67.0911,5.84685,180,0,1), -- Skinning +(41775,33619,530,1,1,-2267.52,5569.19,67.0896,2.74017,180,0,1), -- Cooking +(41779,33621,530,1,1,-2269.93,5564.2,67.09,2.75762,180,0,1), -- First Aid +(41780,33623,530,1,1,-2268.81,5566.68,67.0905,2.74017,180,0,1); -- Fishing diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 1126262bafa..2afa3c7bc58 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4822,7 +4822,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC Field* fields = resultMail->Fetch(); uint32 mail_id = fields[0].GetUInt32(); - uint16 mailType = fields[1].GetUInt8(); + uint8 mailType = fields[1].GetUInt8(); uint16 mailTemplateId= fields[2].GetUInt16(); uint32 sender = fields[3].GetUInt32(); std::string subject = fields[4].GetString(); From b8558a699016276393954f228c26c3ddf3e49aed Mon Sep 17 00:00:00 2001 From: Jildor Date: Sun, 1 Apr 2012 18:00:37 +0200 Subject: [PATCH 0386/1149] Core/Spells: Fix Spinning Pain Spike damage Close: #5652 --- ...2012_04_01_00_world_spell_script_names.sql | 6 ++++ .../TrialOfTheCrusader/boss_lord_jaraxxus.cpp | 31 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 sql/updates/world/2012_04_01_00_world_spell_script_names.sql diff --git a/sql/updates/world/2012_04_01_00_world_spell_script_names.sql b/sql/updates/world/2012_04_01_00_world_spell_script_names.sql new file mode 100644 index 00000000000..9d37f6ad4cb --- /dev/null +++ b/sql/updates/world/2012_04_01_00_world_spell_script_names.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_spinning_pain_spike'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(66316,'spell_spinning_pain_spike'), +(67100,'spell_spinning_pain_spike'), +(67101,'spell_spinning_pain_spike'), +(67102,'spell_spinning_pain_spike'); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index a7328b43826..a7f584b8206 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -515,6 +515,36 @@ public: }; +class spell_spinning_pain_spike : public SpellScriptLoader +{ + public: + spell_spinning_pain_spike() : SpellScriptLoader("spell_spinning_pain_spike") {} + + class spell_spinning_pain_spike_SpellScript : public SpellScript + { + PrepareSpellScript(spell_spinning_pain_spike_SpellScript); + + void HandleBeforeHit() + { + Unit* target = GetHitUnit(); + if (!target) + return; + + if (target->isAlive()) + SetHitDamage(target->GetMaxHealth()*0.5f); + } + void Register() + { + BeforeHit += SpellHitFn(spell_spinning_pain_spike_SpellScript::HandleBeforeHit); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_spinning_pain_spike_SpellScript(); + } +}; + void AddSC_boss_jaraxxus() { new boss_jaraxxus(); @@ -523,4 +553,5 @@ void AddSC_boss_jaraxxus() new mob_fel_infernal(); new mob_nether_portal(); new mob_mistress_of_pain(); + new spell_spinning_pain_spike(); } From 8bd228179d22b3e557151bc9c1ee2145f8249621 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 1 Apr 2012 11:02:44 -0500 Subject: [PATCH 0387/1149] Core/Spells: Fixed SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT on several types of spell effects closes #5961 Signed-off-by: Subv --- src/server/game/Entities/Unit/Unit.cpp | 34 +++++++++++++++++++++----- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 8d02db9d515..348335e1455 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -4424,9 +4424,7 @@ float Unit::GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask } // Add the highest of the Same Effect Stack Rule SpellGroups to the multiplier for (std::map::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) - { AddPctN(multiplier, itr->second); - } return multiplier; } @@ -4461,27 +4459,39 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscMask(AuraType auratype, uint32 misc_ int32 Unit::GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const { + std::map SameEffectSpellGroup; int32 modifier = 0; AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) { if ((*i)->GetMiscValue() == misc_value) - modifier += (*i)->GetAmount(); + if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) + modifier += (*i)->GetAmount(); } + + for (std::map::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) + modifier += itr->second; + return modifier; } float Unit::GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 misc_value) const { + std::map SameEffectSpellGroup; float multiplier = 1.0f; AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) { if ((*i)->GetMiscValue() == misc_value) - AddPctN(multiplier, (*i)->GetAmount()); + if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) + AddPctN(multiplier, (*i)->GetAmount()); } + + for (std::map::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) + AddPctN(multiplier, itr->second); + return multiplier; } @@ -4515,27 +4525,39 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_ int32 Unit::GetTotalAuraModifierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const { + std::map SameEffectSpellGroup; int32 modifier = 0; AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) { if ((*i)->IsAffectedOnSpell(affectedSpell)) - modifier += (*i)->GetAmount(); + if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) + modifier += (*i)->GetAmount(); } + + for (std::map::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) + modifier += itr->second; + return modifier; } float Unit::GetTotalAuraMultiplierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const { + std::map SameEffectSpellGroup; float multiplier = 1.0f; AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) { if ((*i)->IsAffectedOnSpell(affectedSpell)) - AddPctN(multiplier, (*i)->GetAmount()); + if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) + AddPctN(multiplier, (*i)->GetAmount()); } + + for (std::map::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) + AddPctN(multiplier, itr->second); + return multiplier; } From 2987d4f40d72bf03073f79ce8292e99d364133df Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 1 Apr 2012 11:03:47 -0500 Subject: [PATCH 0388/1149] Core/Commands: Allow combatstop command to be used from console with the player name as parameter Signed-off-by: Subv --- src/server/game/Chat/Chat.cpp | 2 +- src/server/game/Chat/Commands/Level2.cpp | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 9992721a6dd..7a4c17d1c5e 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -401,7 +401,7 @@ ChatCommand* ChatHandler::getCommandTable() { "movegens", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleMovegensCommand>, "", NULL }, { "cometome", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleComeToMeCommand>, "", NULL }, { "damage", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleDamageCommand>, "", NULL }, - { "combatstop", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleCombatStopCommand>, "", NULL }, + { "combatstop", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCombatStopCommand>, "", NULL }, { "flusharenapoints", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleFlushArenaPointsCommand>, "", NULL }, { "repairitems", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleRepairitemsCommand>, "", NULL }, { "waterwalk", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleWaterwalkCommand>, "", NULL }, diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index cc7c9020d38..cc638193b5a 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -713,9 +713,22 @@ bool ChatHandler::HandleLookupEventCommand(const char* args) bool ChatHandler::HandleCombatStopCommand(const char* args) { - Player* target; - if (!extractPlayerTarget((char*)args, &target)) - return false; + Player* target = NULL; + + if (args && strlen(args) > 0) + { + target = sObjectAccessor->FindPlayerByName(args); + if (!target) + { + SendSysMessage(LANG_PLAYER_NOT_FOUND); + SetSentErrorMessage(true); + return false; + } + } + + if (!target) + if (!extractPlayerTarget((char*)args, &target)) + return false; // check online security if (HasLowerSecurity(target, 0)) From 8b81c1a570812b441ea573254e9e2e3c0cbbf7d6 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 1 Apr 2012 17:04:19 +0100 Subject: [PATCH 0389/1149] DB/NPC: Fix trainers added in 1bc99cd5af348c578a8c --- ...e.sql => 2012_04_01_01_world_creature.sql} | 0 .../world/2012_04_02_world_trainers.sql | 83 +++++++++++++++++++ 2 files changed, 83 insertions(+) rename sql/updates/world/{2012_04_01_world_creature.sql => 2012_04_01_01_world_creature.sql} (100%) create mode 100644 sql/updates/world/2012_04_02_world_trainers.sql diff --git a/sql/updates/world/2012_04_01_world_creature.sql b/sql/updates/world/2012_04_01_01_world_creature.sql similarity index 100% rename from sql/updates/world/2012_04_01_world_creature.sql rename to sql/updates/world/2012_04_01_01_world_creature.sql diff --git a/sql/updates/world/2012_04_02_world_trainers.sql b/sql/updates/world/2012_04_02_world_trainers.sql new file mode 100644 index 00000000000..1edc9ae09af --- /dev/null +++ b/sql/updates/world/2012_04_02_world_trainers.sql @@ -0,0 +1,83 @@ +-- Template updates +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33608; -- Alchemy +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16/*80*/,`trainer_type`=2 WHERE `entry`=33609; -- Blacksmithing +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33610; -- Enchanting +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33611; -- Engineering +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33612; -- Leatherworking +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16 WHERE `entry`=33613; -- Tailoring +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33614; -- Jewelcrafting +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33616; -- Herbalism +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33618; -- Skinning (guessed) +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33617; -- Mining (guessed) +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16 WHERE `entry`=33619; -- Cooking (guessed) +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16 WHERE `entry`=33621; -- First Aid (guessed) +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33615; -- Inscription (guessed) +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33623; -- Fishing (guessed) + +-- Model data +UPDATE `creature_model_info` SET `bounding_radius`=0.11,`combat_reach`=0,`gender`=2 WHERE `modelid`=28738; -- shared by many +UPDATE `creature_model_info` SET `bounding_radius`=0.14,`combat_reach`=0,`gender`=2 WHERE `modelid`=28758; -- shared by many + +-- Addon data +DELETE FROM `creature_template_addon` WHERE `entry` IN (33608,33609,33610,33611,33612,33613,33614,33616,33618,33617,33619,33621,33615,33623); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(33608,0,0,1,0, NULL), -- Alchemy +(33609,0,0,1,0, NULL), -- Blacksmithing +(33610,0,0,1,0, NULL), -- Enchanting +(33611,0,0,1,0, NULL), -- Engineering +(33612,0,0,1,0, NULL), -- Leatherworking +(33613,0,0,1,0, NULL), -- Tailoring +(33614,0,0,1,0, NULL), -- Jewelcrafting +(33616,0,0,1,0, NULL), -- Herbalism +(33618,0,0,1,0, NULL), -- Skinning (guessed) +(33617,0,0,1,0, NULL), -- Mining (guessed) +(33619,0,0,1,0, NULL), -- Cooking (guessed) +(33621,0,0,1,0, NULL), -- First Aid (guessed) +(33615,0,0,1,0, NULL), -- Inscription (guessed) +(33623,0,0,1,0, NULL); -- Fishing (guessed) + +-- Trainer spells +DELETE FROM `npc_trainer` WHERE `entry` IN (33608,33609,33610,33611,33612,33613,33614,33616,33618,33617,33619,33621,33615,33623); +INSERT INTO `npc_trainer` (`entry`, `spell`, `spellcost`, `reqskill`, `reqskillvalue`, `reqlevel`) VALUES +(33608, -201001, 0, 0, 0, 0), -- Alchemy +(33608, -201002, 0, 0, 0, 0), -- Alchemy +(33608, -201003, 0, 0, 0, 0), -- Alchemy +(33609, -201004, 0, 0, 0, 0), -- Blacksmithing +(33609, -201005, 0, 0, 0, 0), -- Blacksmithing +(33609, -201006, 0, 0, 0, 0), -- Blacksmithing +(33610, -201009, 0, 0, 0, 0), -- Enchanting +(33610, -201010, 0, 0, 0, 0), -- Enchanting +(33610, -201011, 0, 0, 0, 0), -- Enchanting +(33611, -201012, 0, 0, 0, 0), -- Engineering +(33611, -201013, 0, 0, 0, 0), -- Engineering +(33611, -201014, 0, 0, 0, 0), -- Engineering +(33612, -201027, 0, 0, 0, 0), -- Leatherworking +(33612, -201028, 0, 0, 0, 0), -- Leatherworking +(33612, -201029, 0, 0, 0, 0), -- Leatherworking +(33613, -201039, 0, 0, 0, 0), -- Tailoring +(33613, -201040, 0, 0, 0, 0), -- Tailoring +(33613, -201041, 0, 0, 0, 0), -- Tailoring +(33614, -201024, 0, 0, 0, 0), -- Jewelcrafting +(33614, -201025, 0, 0, 0, 0), -- Jewelcrafting +(33614, -201026, 0, 0, 0, 0), -- Jewelcrafting +(33616, -201018, 0, 0, 0, 0), -- Herbalism +(33616, -201019, 0, 0, 0, 0), -- Herbalism +(33616, -201020, 0, 0, 0, 0), -- Herbalism +(33618, -201036, 0, 0, 0, 0), -- Skinning +(33618, -201037, 0, 0, 0, 0), -- Skinning +(33618, -201038, 0, 0, 0, 0), -- Skinning +(33617, -201033, 0, 0, 0, 0), -- Mining +(33617, -201034, 0, 0, 0, 0), -- Mining +(33617, -201035, 0, 0, 0, 0), -- Mining +(33619, -202004, 0, 0, 0, 0), -- Cooking +(33619, -202005, 0, 0, 0, 0), -- Cooking +(33619, -202006, 0, 0, 0, 0), -- Cooking +(33621, -202007, 0, 0, 0, 0), -- First Aid +(33621, -202008, 0, 0, 0, 0), -- First Aid +(33621, -202009, 0, 0, 0, 0), -- First Aid +(33615, -201021, 0, 0, 0, 0), -- Inscription +(33615, -201022, 0, 0, 0, 0), -- Inscription +(33615, -201023, 0, 0, 0, 0), -- Inscription +(33623, -202001, 0, 0, 0, 0), -- Fishing +(33623, -202002, 0, 0, 0, 0), -- Fishing +(33623, -202003, 0, 0, 0, 0); -- Fishing From 65ba081b6c6106021343c964fdc75b6c2b49100d Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 1 Apr 2012 11:06:08 -0500 Subject: [PATCH 0390/1149] SQL/Spells: Missing SQL from previous commit --- .../2012_04_01_02_world_spell_group_stack_rules.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sql/updates/world/2012_04_01_02_world_spell_group_stack_rules.sql diff --git a/sql/updates/world/2012_04_01_02_world_spell_group_stack_rules.sql b/sql/updates/world/2012_04_01_02_world_spell_group_stack_rules.sql new file mode 100644 index 00000000000..d42afd1d955 --- /dev/null +++ b/sql/updates/world/2012_04_01_02_world_spell_group_stack_rules.sql @@ -0,0 +1,9 @@ +-- Greater Blessing of Wisdom and Mana Spring Totem should not stack (hotfix) +SET @GROUP := 1117; +DELETE FROM `spell_group` WHERE id=@GROUP; +INSERT INTO `spell_group`(`id`,`spell_id`) VALUES +(@GROUP,25894), -- Greater Blessing of Wisdom +(@GROUP,5677); -- Mana Spring (cast by Mana Spring Totem) +DELETE FROM `spell_group_stack_rules` WHERE `group_id`=@GROUP; +INSERT INTO `spell_group_stack_rules`(`group_id`,`stack_rule`) VALUES +(@GROUP,3); -- Make them SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT From 860c0cb43a3aba8cfb343d7e5f6c31aa8c75b9fe Mon Sep 17 00:00:00 2001 From: Svannon Date: Sun, 1 Apr 2012 17:42:39 +0100 Subject: [PATCH 0391/1149] DB/Conditions: Imbued Scourge Shroud should only be used in City area (conditions) Closes #1527 --- ...2_world_trainers.sql => 2012_04_01_03_world_trainers.sql} | 0 sql/updates/world/2012_04_01_04_world_conditions.sql | 5 +++++ 2 files changed, 5 insertions(+) rename sql/updates/world/{2012_04_02_world_trainers.sql => 2012_04_01_03_world_trainers.sql} (100%) create mode 100644 sql/updates/world/2012_04_01_04_world_conditions.sql diff --git a/sql/updates/world/2012_04_02_world_trainers.sql b/sql/updates/world/2012_04_01_03_world_trainers.sql similarity index 100% rename from sql/updates/world/2012_04_02_world_trainers.sql rename to sql/updates/world/2012_04_01_03_world_trainers.sql diff --git a/sql/updates/world/2012_04_01_04_world_conditions.sql b/sql/updates/world/2012_04_01_04_world_conditions.sql new file mode 100644 index 00000000000..e84307e0b05 --- /dev/null +++ b/sql/updates/world/2012_04_01_04_world_conditions.sql @@ -0,0 +1,5 @@ +-- Quest: Blending In (11633) +-- Spell from Cape only Appliable in City Area +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=45614; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(17,0,45614,11633,23,4125,0,0,0, '', 'Shroud of the Scourge - Temple City of En''kilah'); From f7b1edf60df72de58a3a743d2776f0327632f7c4 Mon Sep 17 00:00:00 2001 From: Discover- Date: Sun, 1 Apr 2012 17:45:43 +0100 Subject: [PATCH 0392/1149] DB/NPC: Mana Beast shouldn't reward XP Closes #1887 --- sql/updates/world/2012_04_01_05_world_creature_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_04_01_05_world_creature_template.sql diff --git a/sql/updates/world/2012_04_01_05_world_creature_template.sql b/sql/updates/world/2012_04_01_05_world_creature_template.sql new file mode 100644 index 00000000000..a4d13f1513a --- /dev/null +++ b/sql/updates/world/2012_04_01_05_world_creature_template.sql @@ -0,0 +1,2 @@ +-- CREATURE_FLAG_EXTRA_NO_XP_AT_KILL +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|64 WHERE `entry`=21267; -- Mana Beast From b07e2367839b0c94799717f422c4b461bc6782d1 Mon Sep 17 00:00:00 2001 From: Odyssey Date: Sun, 1 Apr 2012 17:53:02 +0100 Subject: [PATCH 0393/1149] DB/SAI: Fix quest Falcon Versus Hawk Closes #2127 --- sql/updates/world/2012_04_01_06_world_sai.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/2012_04_01_06_world_sai.sql diff --git a/sql/updates/world/2012_04_01_06_world_sai.sql b/sql/updates/world/2012_04_01_06_world_sai.sql new file mode 100644 index 00000000000..9b8857da1e4 --- /dev/null +++ b/sql/updates/world/2012_04_01_06_world_sai.sql @@ -0,0 +1,7 @@ +-- Fix quest 11468 - Falcon versus hawk +SET @entry := 24747; -- Fjord Hawk +UPDATE creature_template SET AIName='SmartAI' WHERE entry=@entry; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@entry AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@entry,0,0,1,8,0,100,0,44407,0,0,0,11,44408,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Fjord Hawk - On Spellhit - Cast spell on invoker'), +(@entry,0,1,0,61,0,100,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fjord Hawk - On Spellhit - Despawn'); From 55b53f44dc0ac682e0421a62e559e0dc9fd1c4e4 Mon Sep 17 00:00:00 2001 From: click Date: Sun, 1 Apr 2012 19:38:15 +0200 Subject: [PATCH 0394/1149] Core: Tell ScriptMgr to reload properly on .reload - thanks to codels for the patch --- src/server/game/World/World.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 1a9905edd12..953eafcd3da 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1200,7 +1200,9 @@ void World::LoadConfigSettings(bool reload) m_bool_configs[CONFIG_PDUMP_NO_PATHS] = ConfigMgr::GetBoolDefault("PlayerDump.DisallowPaths", true); m_bool_configs[CONFIG_PDUMP_NO_OVERWRITE] = ConfigMgr::GetBoolDefault("PlayerDump.DisallowOverwrite", true); - sScriptMgr->OnConfigLoad(reload); + // call ScriptMgr if we're reloading the configuration + if (reload) + sScriptMgr->OnConfigLoad(reload); } extern void LoadGameObjectModelList(); @@ -1653,6 +1655,7 @@ void World::SetInitialWorldSettings() sLog->outString("Initializing Scripts..."); sScriptMgr->Initialize(); + sScriptMgr->OnConfigLoad(false); // must be done after the ScriptMgr has been properly initialized sLog->outString("Validating spell scripts..."); sObjectMgr->ValidateSpellScripts(); From 4e58efcfec2e6e5d75d8be4b3319acf00b64cd65 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 1 Apr 2012 18:44:09 +0100 Subject: [PATCH 0395/1149] DB/Conditions: Capture Jormungar Spawn can only be used in Ice Heart Cavern Fix by Discover and Havenard Closes #2452 Also fix a typo in a previous commit --- sql/updates/world/2012_04_01_07_world_misc.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2012_04_01_07_world_misc.sql diff --git a/sql/updates/world/2012_04_01_07_world_misc.sql b/sql/updates/world/2012_04_01_07_world_misc.sql new file mode 100644 index 00000000000..346627fd88b --- /dev/null +++ b/sql/updates/world/2012_04_01_07_world_misc.sql @@ -0,0 +1,4 @@ +UPDATE `conditions` SET `ElseGroup`=0 WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=45614; -- typo fix for previous commit +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=47431; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(17,0,47431,0,23,4195,0,0,64,'','Capture Jormungar Spawn can only be used in Ice Heart Cavern'); From ad569ce649b500ee74d7616acedefc74b6d0cd6b Mon Sep 17 00:00:00 2001 From: click Date: Sun, 1 Apr 2012 19:54:33 +0200 Subject: [PATCH 0396/1149] Core: Only clear motionmaster flags if the respective entity exists in world. Original patch by kewarr and Mrsmite, additional commenting by Machiavelli removing the pet-specific checks applied. Fixes #5400. --- src/server/game/Entities/Unit/Unit.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 348335e1455..d71f8e8dfc3 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12776,8 +12776,16 @@ void Unit::setDeathState(DeathState s) // remove aurastates allowing special moves ClearAllReactives(); ClearDiminishings(); - GetMotionMaster()->Clear(false); - GetMotionMaster()->MoveIdle(); + if (IsInWorld()) + { + // Only clear MotionMaster for entities that exists in world + // Avoids crashes in the following conditions : + // * Using 'call pet' on dead pets + // * Using 'call stabled pet' + // * Logging in with dead pets + GetMotionMaster()->Clear(false); + GetMotionMaster()->MoveIdle(); + } StopMoving(); DisableSpline(); // without this when removing IncreaseMaxHealth aura player may stuck with 1 hp From e64d75f2c7b83f692dad690bf57361a45a353d37 Mon Sep 17 00:00:00 2001 From: Jildor Date: Sun, 1 Apr 2012 22:01:17 +0200 Subject: [PATCH 0397/1149] change GetMaxHealth and BeforeHit... --- .../TrialOfTheCrusader/boss_lord_jaraxxus.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index a7f584b8206..6f817a6d0eb 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -524,18 +524,18 @@ class spell_spinning_pain_spike : public SpellScriptLoader { PrepareSpellScript(spell_spinning_pain_spike_SpellScript); - void HandleBeforeHit() + void HandleScript(SpellEffIndex /*eff*/) { Unit* target = GetHitUnit(); if (!target) return; if (target->isAlive()) - SetHitDamage(target->GetMaxHealth()*0.5f); + SetHitDamage(target->CountPctFromMaxHealth(50)); } void Register() { - BeforeHit += SpellHitFn(spell_spinning_pain_spike_SpellScript::HandleBeforeHit); + OnEffectHitTarget += SpellEffectFn(spell_spinning_pain_spike_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); } }; From b7f7e3118c13857be9e301f8dbadb2af9f10f99a Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 1 Apr 2012 22:41:47 +0100 Subject: [PATCH 0398/1149] Core/DBLayer: More type fixes Thanks to Vasago for the help in spotting the errors Thanks to Subv as well (so he doesn't feel lonely) --- src/server/game/Battlegrounds/ArenaTeam.cpp | 2 +- src/server/game/Entities/Item/Item.cpp | 6 +++--- src/server/game/Entities/Player/Player.cpp | 4 ++-- src/server/game/Globals/ObjectMgr.cpp | 4 ++-- src/server/game/Handlers/CharacterHandler.cpp | 2 +- src/server/game/Handlers/PetitionsHandler.cpp | 6 +++--- .../shared/Database/Implementation/CharacterDatabase.cpp | 2 -- .../shared/Database/Implementation/CharacterDatabase.h | 2 -- 8 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index b4c86f7ef5f..73e24e5a3c3 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -145,7 +145,7 @@ bool ArenaTeam::AddMember(uint64 playerGuid) uint32 matchMakerRating; if (result) - matchMakerRating = (*result)[0].GetUInt32(); + matchMakerRating = (*result)[0].GetUInt16(); else matchMakerRating = sWorld->getIntConfig(CONFIG_ARENA_START_MATCHMAKER_RATING); diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index fe2e8f38e62..bc90e6f4484 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -343,8 +343,8 @@ void Item::SaveToDB(SQLTransaction& trans) } stmt->setString(++index, ssEnchants.str()); - stmt->setInt32 (++index, GetItemRandomPropertyId()); - stmt->setUInt32(++index, GetUInt32Value(ITEM_FIELD_DURABILITY)); + stmt->setInt16 (++index, GetItemRandomPropertyId()); + stmt->setUInt16(++index, GetUInt32Value(ITEM_FIELD_DURABILITY)); stmt->setUInt32(++index, GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME)); stmt->setString(++index, m_text); stmt->setUInt32(++index, guid); @@ -486,7 +486,7 @@ void Item::DeleteFromDB(SQLTransaction& trans) /*static*/ void Item::DeleteFromInventoryDB(SQLTransaction& trans, uint32 itemGuid) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVENTORY_ITEM); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_ITEM); stmt->setUInt32(0, itemGuid); trans->Append(stmt); } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 2afa3c7bc58..0a4363df323 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -18984,7 +18984,7 @@ void Player::_SaveActions(SQLTransaction& trans) void Player::_SaveAuras(SQLTransaction& trans) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_AURA); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA); stmt->setUInt32(0, GetGUIDLow()); trans->Append(stmt); @@ -19147,7 +19147,7 @@ void Player::_SaveInventory(SQLTransaction& trans) trans->Append(stmt); break; case ITEM_REMOVED: - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVENTORY_ITEM); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_ITEM); stmt->setUInt32(0, item->GetGUIDLow()); trans->Append(stmt); case ITEM_UNCHANGED: diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 8753d2834a1..24435abc4ca 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -7203,7 +7203,7 @@ void ObjectMgr::SaveCreatureRespawnTime(uint32 loguid, uint32 instance, time_t t PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN); stmt->setUInt32(0, loguid); - stmt->setUInt64(1, uint64(t)); + stmt->setUInt32(1, uint32(t)); stmt->setUInt32(2, instance); CharacterDatabase.Execute(stmt); } @@ -7217,7 +7217,7 @@ void ObjectMgr::RemoveCreatureRespawnTime(uint32 loguid, uint32 instance) _creatureRespawnTimesMutex.release(); } - PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN); stmt->setUInt32(0, loguid); stmt->setUInt32(1, instance); CharacterDatabase.Execute(stmt); diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 1e54bbe6995..b0a4da3e42b 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -461,7 +461,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte if (result) { Field* fields = result->Fetch(); - createInfo->CharCount = fields[0].GetUInt8(); + createInfo->CharCount = fields[0].GetUInt64(); if (createInfo->CharCount >= sWorld->getIntConfig(CONFIG_CHARACTERS_PER_REALM)) { diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index 7a3964b9469..e3f6e92132e 100755 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -300,9 +300,9 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recv_data) for (uint8 i = 1; i <= signs; ++i) { Field* fields2 = result->Fetch(); - uint64 plguid = fields2[0].GetUInt64(); + uint32 lowGuid = fields2[0].GetUInt32(); - data << uint64(plguid); // Player GUID + data << uint64(MAKE_NEW_GUID(lowGuid, 0, HIGHGUID_PLAYER)); // Player GUID data << uint32(0); // there 0 ... result->NextRow(); @@ -485,7 +485,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) fields = result->Fetch(); uint64 ownerGuid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER); - uint8 signs = fields[1].GetUInt8(); + uint64 signs = fields[1].GetUInt64(); uint8 type = fields[2].GetUInt8(); uint32 playerGuid = _player->GetGUIDLow(); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 22de70b993b..63be227547a 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -129,7 +129,6 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_ITEM_BOP_TRADE, "DELETE FROM item_soulbound_trade_data WHERE itemGuid = ? LIMIT 1", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_INS_ITEM_BOP_TRADE, "INSERT INTO item_soulbound_trade_data VALUES (?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_REP_INVENTORY_ITEM, "REPLACE INTO character_inventory (guid, bag, slot, item) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_INVENTORY_ITEM, "DELETE FROM character_inventory WHERE item = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_REP_ITEM_INSTANCE, "REPLACE INTO item_instance (itemEntry, owner_guid, creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, guid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_ITEM_INSTANCE, "UPDATE item_instance SET itemEntry = ?, owner_guid = ?, creatorGuid = ?, giftCreatorGuid = ?, count = ?, duration = ?, charges = ?, flags = ?, enchantments = ?, randomPropertyId = ?, durability = ?, playedTime = ?, text = ? WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_ITEM_INSTANCE_ON_LOAD, "UPDATE item_instance SET duration = ?, flags = ?, durability = ? WHERE guid = ?", CONNECTION_ASYNC) @@ -239,7 +238,6 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_EQUIP_SET, "DELETE FROM character_equipmentsets WHERE setguid=?", CONNECTION_ASYNC) // Auras - PREPARE_STATEMENT(CHAR_DEL_AURA, "DELETE FROM character_aura WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_INS_AURA, "INSERT INTO character_aura (guid, caster_guid, item_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges) " "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 4d8433c74b2..0b915eba0e3 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -138,7 +138,6 @@ enum CharacterDatabaseStatements CHAR_DEL_ITEM_BOP_TRADE, CHAR_INS_ITEM_BOP_TRADE, CHAR_REP_INVENTORY_ITEM, - CHAR_DEL_INVENTORY_ITEM, CHAR_REP_ITEM_INSTANCE, CHAR_UPD_ITEM_INSTANCE, CHAR_UPD_ITEM_INSTANCE_ON_LOAD, @@ -231,7 +230,6 @@ enum CharacterDatabaseStatements CHAR_INS_EQUIP_SET, CHAR_DEL_EQUIP_SET, - CHAR_DEL_AURA, CHAR_INS_AURA, CHAR_SEL_ACCOUNT_DATA, From b03f895cf5eca568134726ec9e46e2ba7f3101bb Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 2 Apr 2012 00:22:02 +0100 Subject: [PATCH 0399/1149] Core/DBLayer: Yet more type fixes --- src/server/game/Globals/ObjectMgr.cpp | 4 ++-- src/server/game/Handlers/CharacterHandler.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 24435abc4ca..55c1e25b3ae 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -5382,8 +5382,8 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_MAIL_RETURNED); stmt->setUInt32(0, m->receiver); stmt->setUInt32(1, m->sender); - stmt->setUInt64(2, basetime + 30 * DAY); - stmt->setUInt64(3, basetime); + stmt->setUInt32(2, basetime + 30 * DAY); + stmt->setUInt32(3, basetime); stmt->setUInt8 (4, uint8(MAIL_CHECK_MASK_RETURNED)); stmt->setUInt32(5, m->messageID); CharacterDatabase.Execute(stmt); diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index b0a4da3e42b..33f849ecc98 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -461,7 +461,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte if (result) { Field* fields = result->Fetch(); - createInfo->CharCount = fields[0].GetUInt64(); + createInfo->CharCount = uint8(fields[0].GetUInt64()); // SQL's COUNT() returns uint64 but it will always be less than uint8.Max if (createInfo->CharCount >= sWorld->getIntConfig(CONFIG_CHARACTERS_PER_REALM)) { From 6e4a4795adfa4aa20e45ff19060367815e4965de Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 2 Apr 2012 01:25:07 +0100 Subject: [PATCH 0400/1149] Core/DBLayer: Yet more type fixes --- src/server/game/World/World.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 953eafcd3da..9b40c8f5654 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -2642,7 +2642,7 @@ void World::_UpdateRealmCharCount(PreparedQueryResult resultCharCount) { Field* fields = resultCharCount->Fetch(); uint32 accountId = fields[0].GetUInt32(); - uint32 charCount = fields[1].GetUInt32(); + uint8 charCount = uint8(fields[1].GetUInt64()); PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS_BY_REALM); stmt->setUInt32(0, accountId); @@ -2650,7 +2650,7 @@ void World::_UpdateRealmCharCount(PreparedQueryResult resultCharCount) LoginDatabase.Execute(stmt); stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_REALM_CHARACTERS); - stmt->setUInt32(0, charCount); + stmt->setUInt8(0, charCount); stmt->setUInt32(1, accountId); stmt->setUInt32(2, realmID); LoginDatabase.Execute(stmt); From ede839dd97c21216b4da6ef24a9c2dbc7198f503 Mon Sep 17 00:00:00 2001 From: kaelima Date: Mon, 2 Apr 2012 03:30:19 +0200 Subject: [PATCH 0401/1149] Core/Database: Some extended debug output for Field::GetXXX logs. --- src/server/shared/Database/Field.h | 70 +++++++++++++++++++++++------- 1 file changed, 54 insertions(+), 16 deletions(-) diff --git a/src/server/shared/Database/Field.h b/src/server/shared/Database/Field.h index 2c5e7d47ca4..bfa42dbe574 100755 --- a/src/server/shared/Database/Field.h +++ b/src/server/shared/Database/Field.h @@ -43,11 +43,11 @@ class Field #ifdef TRINITY_DEBUG if (!IsType(MYSQL_TYPE_TINY)) { - sLog->outSQLDriver("Warning: GetUInt8() on non-tinyint field."); + sLog->outSQLDriver("Warning: GetUInt8() on non-tinyint field. Using type: %s.", FieldTypeToString(data.type)); return 0; } - #endif + if (data.raw) return *reinterpret_cast(data.value); return static_cast(atol((char*)data.value)); @@ -61,7 +61,7 @@ class Field #ifdef TRINITY_DEBUG if (!IsType(MYSQL_TYPE_TINY)) { - sLog->outSQLDriver("Warning: GetInt8() on non-tinyint field."); + sLog->outSQLDriver("Warning: GetInt8() on non-tinyint field. Using type: %s.", FieldTypeToString(data.type)); return 0; } #endif @@ -79,7 +79,7 @@ class Field #ifdef TRINITY_DEBUG if (!IsType(MYSQL_TYPE_SHORT) && !IsType(MYSQL_TYPE_YEAR)) { - sLog->outSQLDriver("Warning: GetUInt16() on non-smallint field."); + sLog->outSQLDriver("Warning: GetUInt16() on non-smallint field. Using type: %s.", FieldTypeToString(data.type)); return 0; } #endif @@ -97,7 +97,7 @@ class Field #ifdef TRINITY_DEBUG if (!IsType(MYSQL_TYPE_SHORT) && !IsType(MYSQL_TYPE_YEAR)) { - sLog->outSQLDriver("Warning: GetInt16() on non-smallint field."); + sLog->outSQLDriver("Warning: GetInt16() on non-smallint field. Using type: %s.", FieldTypeToString(data.type)); return 0; } #endif @@ -115,7 +115,7 @@ class Field #ifdef TRINITY_DEBUG if (!IsType(MYSQL_TYPE_INT24) && !IsType(MYSQL_TYPE_LONG)) { - sLog->outSQLDriver("Warning: GetUInt32() on non-(medium)int field."); + sLog->outSQLDriver("Warning: GetUInt32() on non-(medium)int field. Using type: %s.", FieldTypeToString(data.type)); return 0; } #endif @@ -133,7 +133,7 @@ class Field #ifdef TRINITY_DEBUG if (!IsType(MYSQL_TYPE_INT24) && !IsType(MYSQL_TYPE_LONG)) { - sLog->outSQLDriver("Warning: GetInt32() on non-(medium)int field."); + sLog->outSQLDriver("Warning: GetInt32() on non-(medium)int field. Using type: %s.", FieldTypeToString(data.type)); return 0; } #endif @@ -151,7 +151,7 @@ class Field #ifdef TRINITY_DEBUG if (!IsType(MYSQL_TYPE_LONGLONG) && !IsType(MYSQL_TYPE_BIT)) { - sLog->outSQLDriver("Warning: GetUInt64() on non-bigint field."); + sLog->outSQLDriver("Warning: GetUInt64() on non-bigint field. Using type: %s.", FieldTypeToString(data.type)); return 0; } #endif @@ -169,7 +169,7 @@ class Field #ifdef TRINITY_DEBUG if (!IsType(MYSQL_TYPE_LONGLONG) && !IsType(MYSQL_TYPE_BIT)) { - sLog->outSQLDriver("Warning: GetInt64() on non-bigint field."); + sLog->outSQLDriver("Warning: GetInt64() on non-bigint field. Using type: %s.", FieldTypeToString(data.type)); return 0; } #endif @@ -187,7 +187,7 @@ class Field #ifdef TRINITY_DEBUG if (!IsType(MYSQL_TYPE_FLOAT)) { - sLog->outSQLDriver("Warning: GetFloat() on non-float field."); + sLog->outSQLDriver("Warning: GetFloat() on non-float field. Using type: %s.", FieldTypeToString(data.type)); return 0.0f; } #endif @@ -205,7 +205,7 @@ class Field #ifdef TRINITY_DEBUG if (!IsType(MYSQL_TYPE_DOUBLE)) { - sLog->outSQLDriver("Warning: GetDouble() on non-double field."); + sLog->outSQLDriver("Warning: GetDouble() on non-double field. Using type: %s.", FieldTypeToString(data.type)); return 0.0f; } #endif @@ -215,7 +215,7 @@ class Field return static_cast(atof((char*)data.value)); } - const char* GetCString() const + char const* GetCString() const { if (!data.value) return NULL; @@ -223,11 +223,12 @@ class Field #ifdef TRINITY_DEBUG if (IsNumeric()) { - sLog->outSQLDriver("Error: GetCString() on numeric field."); + sLog->outSQLDriver("Error: GetCString() on numeric field. Using type: %s.", FieldTypeToString(data.type)); return NULL; } #endif - return static_cast(data.value); + return static_cast(data.value); + } std::string GetString() const @@ -237,7 +238,7 @@ class Field if (data.raw) { - const char* string = GetCString(); + char const* string = GetCString(); if (!string) string = ""; return std::string(string, data.length); @@ -267,7 +268,7 @@ class Field #pragma pack(pop) #endif - void SetByteValue(const void* newValue, const size_t newSize, enum_field_types newType, uint32 length); + void SetByteValue(void const* newValue, size_t const newSize, enum_field_types newType, uint32 length); void SetStructuredValue(char* newValue, enum_field_types newType); void CleanUp() @@ -341,6 +342,43 @@ class Field data.type == MYSQL_TYPE_DOUBLE || data.type == MYSQL_TYPE_LONGLONG ); } + + private: + #ifdef TRINITY_DEBUG + static char const* FieldTypeToString(enum_field_types type) + { + switch (type) + { + case MYSQL_TYPE_BIT: return "BIT"; + case MYSQL_TYPE_BLOB: return "BLOB"; + case MYSQL_TYPE_DATE: return "DATE"; + case MYSQL_TYPE_DATETIME: return "DATETIME"; + case MYSQL_TYPE_NEWDECIMAL: return "NEWDECIMAL"; + case MYSQL_TYPE_DECIMAL: return "DECIMAL"; + case MYSQL_TYPE_DOUBLE: return "DOUBLE"; + case MYSQL_TYPE_ENUM: return "ENUM"; + case MYSQL_TYPE_FLOAT: return "FLOAT"; + case MYSQL_TYPE_GEOMETRY: return "GEOMETRY"; + case MYSQL_TYPE_INT24: return "INT24"; + case MYSQL_TYPE_LONG: return "LONG"; + case MYSQL_TYPE_LONGLONG: return "LONGLONG"; + case MYSQL_TYPE_LONG_BLOB: return "LONG_BLOB"; + case MYSQL_TYPE_MEDIUM_BLOB: return "MEDIUM_BLOB"; + case MYSQL_TYPE_NEWDATE: return "NEWDATE"; + case MYSQL_TYPE_NULL: return "NULL"; + case MYSQL_TYPE_SET: return "SET"; + case MYSQL_TYPE_SHORT: return "SHORT"; + case MYSQL_TYPE_STRING: return "STRING"; + case MYSQL_TYPE_TIME: return "TIME"; + case MYSQL_TYPE_TIMESTAMP: return "TIMESTAMP"; + case MYSQL_TYPE_TINY: return "TINY"; + case MYSQL_TYPE_TINY_BLOB: return "TINY_BLOB"; + case MYSQL_TYPE_VAR_STRING: return "VAR_STRING"; + case MYSQL_TYPE_YEAR: return "YEAR"; + default: return "-Unknown-"; + } + } + #endif }; #endif From d4cc9078e11a79de99496a147d4a3e517bb5237f Mon Sep 17 00:00:00 2001 From: click Date: Mon, 2 Apr 2012 04:39:01 +0200 Subject: [PATCH 0402/1149] Core: Fix another type-error in the mail expiration handling (using data pulled from CHAR_SEL_EXPIRED_MAIL_ITEMS prepped statement) --- src/server/game/Globals/ObjectMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 55c1e25b3ae..9dea557f650 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -5345,7 +5345,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) m->expire_time = time_t(fields[5].GetUInt32()); m->deliver_time = 0; m->COD = fields[6].GetUInt32(); - m->checked = fields[7].GetUInt32(); + m->checked = fields[7].GetUInt8(); m->mailTemplateId = fields[8].GetInt16(); Player* player = NULL; From f03af56d5daa225d0e42ce9c1a8d5309d91ff190 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 2 Apr 2012 14:04:44 +0100 Subject: [PATCH 0403/1149] Core/DBLayer: Fix another wrong type, hopefully the last one TODO: Hunt down the reason for friends list (characters_social) and instance reseting not working --- src/server/game/Handlers/PetitionsHandler.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index e3f6e92132e..cb3bac0e443 100755 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -727,9 +727,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) for (uint8 i = 1; i <= signs; ++i) { Field* fields2 = result->Fetch(); - plguid = fields2[0].GetUInt64(); - - data << uint64(plguid); // Player GUID + data << uint64(MAKE_NEW_GUID(fields2[0].GetUInt32(), 0, HIGHGUID_PLAYER)); // Player GUID data << uint32(0); // there 0 ... result->NextRow(); From 3831e76b9ad3964a02df8f9086aa574859f06cdd Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 2 Apr 2012 18:37:25 +0200 Subject: [PATCH 0404/1149] Core/Protocol: Fixed SMSG_NAME_QUERY_RESPONSE for offline players (fixes friend lists) --- src/server/game/Handlers/QueryHandler.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp index 5061331b8de..628cdbbdd5e 100755 --- a/src/server/game/Handlers/QueryHandler.cpp +++ b/src/server/game/Handlers/QueryHandler.cpp @@ -38,15 +38,9 @@ void WorldSession::SendNameQueryOpcode(uint64 guid) WorldPacket data(SMSG_NAME_QUERY_RESPONSE, (8+1+1+1+1+1+10)); data.appendPackGUID(guid); - if (!player) - { - data << uint8(1); // player unknown - SendPacket(&data); - return; - } if (!nameData) { - data << uint8(2); // name unknown + data << uint8(1); // name unknown SendPacket(&data); return; } @@ -58,7 +52,7 @@ void WorldSession::SendNameQueryOpcode(uint64 guid) data << uint8(nameData->m_gender); data << uint8(nameData->m_class); - if (DeclinedName const* names = player->GetDeclinedNames()) + if (DeclinedName const* names = (player ? player->GetDeclinedNames() : NULL)) { data << uint8(1); // Name is declined for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i) From d9451cedd8e3cc9a09b12a96075b91ba8a6ad496 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 3 Apr 2012 00:02:58 +0200 Subject: [PATCH 0405/1149] Core/World: Add character name data after loading PlayerDump Closes #3653 Note: Manual changes in database while the server is running are not advised thus not supported --- src/server/game/Handlers/CharacterHandler.cpp | 3 +-- src/server/game/World/World.cpp | 2 +- .../shared/Database/Implementation/CharacterDatabase.cpp | 1 + .../shared/Database/Implementation/CharacterDatabase.h | 1 + src/server/worldserver/CommandLine/CliRunnable.cpp | 5 +++++ 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 33f849ecc98..2d70efd3305 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -653,8 +653,6 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte LoginDatabase.CommitTransaction(trans); - newChar.CleanupsBeforeDelete(); - WorldPacket data(SMSG_CHAR_CREATE, 1); data << uint8(CHAR_CREATE_SUCCESS); SendPacket(&data); @@ -665,6 +663,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte sScriptMgr->OnPlayerCreate(&newChar); sWorld->AddCharacterNameData(newChar.GetGUIDLow(), std::string(newChar.GetName()), newChar.getGender(), newChar.getRace(), newChar.getClass()); + newChar.CleanupsBeforeDelete(); delete createInfo; _charCreateCallback.Reset(); } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 9b40c8f5654..ccc8bb2c3e7 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -2926,7 +2926,7 @@ void World::LoadCharacterNameData() { sLog->outString("Loading character name data"); - QueryResult result = CharacterDatabase.Query("SELECT guid, name, race, gender, class FROM characters"); + QueryResult result = CharacterDatabase.Query("SELECT guid, name, race, gender, class FROM characters WHERE deleteDate IS NULL"); if (!result) { sLog->outError("No character name data loaded, empty query"); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 63be227547a..97207410159 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -48,6 +48,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_CHAR_RACE, "SELECT race FROM characters WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_CHAR_LEVEL, "SELECT level FROM characters WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_CHAR_ZONE, "SELECT zone FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHARACTER_NAME_DATA, "SELECT race, class, gender FROM characters WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_CHAR_POSITION_XYZ, "SELECT map, position_x, position_y, position_z FROM characters WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_CHAR_POSITION, "SELECT position_x, position_y, position_z, orientation, map, taxi_path FROM characters WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_DAILY, "DELETE FROM character_queststatus_daily", CONNECTION_ASYNC); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 0b915eba0e3..d2c9f3b3ac4 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -68,6 +68,7 @@ enum CharacterDatabaseStatements CHAR_SEL_CHAR_RACE, CHAR_SEL_CHAR_LEVEL, CHAR_SEL_CHAR_ZONE, + CHAR_SEL_CHARACTER_NAME_DATA, CHAR_SEL_CHAR_POSITION_XYZ, CHAR_SEL_CHAR_POSITION, CHAR_DEL_QUEST_STATUS_DAILY, diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp index 0721515ea73..e85a3e1870d 100755 --- a/src/server/worldserver/CommandLine/CliRunnable.cpp +++ b/src/server/worldserver/CommandLine/CliRunnable.cpp @@ -314,6 +314,11 @@ void ChatHandler::HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo stmt->setUInt32(2, delInfo.lowguid); CharacterDatabase.Execute(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME_DATA); + stmt->setUInt32(0, delInfo.lowguid); + if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) + sWorld->AddCharacterNameData(delInfo.lowguid, delInfo.name, (*result)[2].GetUInt8(), (*result)[0].GetUInt8(), (*result)[1].GetUInt8()); } /** From d4a28eefb08abc5b13d2f13bdde57d53d37e4d34 Mon Sep 17 00:00:00 2001 From: 4m1g0 Date: Tue, 3 Apr 2012 02:21:27 +0200 Subject: [PATCH 0406/1149] Core/Arenas/Dalaran Sewers: Fixed waterFallKnockbackTimer and set more blizzlike values --- src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp | 3 --- src/server/game/Battlegrounds/Zones/BattlegroundDS.h | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp index 8a11edf85e6..dcb6e668de8 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp @@ -88,9 +88,6 @@ void BattlegroundDS::PostUpdateImpl(uint32 diff) } else if (getWaterFallStatus() == BG_DS_WATERFALL_STATUS_WARNING) // Active collision and perform knockback { - if (Creature* waterSpout = GetBgMap()->GetCreature(BgCreatures[BG_DS_NPC_WATERFALL_KNOCKBACK])) - waterSpout->CastSpell(waterSpout, BG_DS_SPELL_WATER_SPOUT, true); - if (GameObject* gob = GetBgMap()->GetGameObject(BgObjects[BG_DS_OBJECT_WATER_1])) gob->SetGoState(GO_STATE_READY); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h index 12ed91fc922..8df01e6415c 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h @@ -66,9 +66,9 @@ enum BattlegroundDSData { // These values are NOT blizzlike... need the correct data! BG_DS_WATERFALL_TIMER_MIN = 30000, BG_DS_WATERFALL_TIMER_MAX = 60000, - BG_DS_WATERFALL_WARNING_DURATION = 7000, - BG_DS_WATERFALL_DURATION = 10000, - BG_DS_WATERFALL_KNOCKBACK_TIMER = 500, + BG_DS_WATERFALL_WARNING_DURATION = 2000, + BG_DS_WATERFALL_DURATION = 30000, + BG_DS_WATERFALL_KNOCKBACK_TIMER = 1500, BG_DS_PIPE_KNOCKBACK_FIRST_DELAY = 5000, BG_DS_PIPE_KNOCKBACK_DELAY = 3000, @@ -118,7 +118,7 @@ class BattlegroundDS : public Battleground void setWaterFallStatus(uint8 status) { _waterfallStatus = status; }; uint32 getWaterFallTimer() { return _waterfallTimer; }; void setWaterFallTimer(uint32 timer) { _waterfallTimer = timer; }; - uint32 getWaterFallKnockbackTimer() { return _waterfallTimer; }; + uint32 getWaterFallKnockbackTimer() { return _waterfallKnockbackTimer; }; void setWaterFallKnockbackTimer(uint32 timer) { _waterfallKnockbackTimer = timer; }; uint8 getPipeKnockBackCount() { return _pipeKnockBackCount; }; void setPipeKnockBackCount(uint8 count) { _pipeKnockBackCount = count; }; From cce8b56a2671b8c5655f45f58d5d877a6fdd60e9 Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 3 Apr 2012 10:19:17 -0400 Subject: [PATCH 0407/1149] Core/Spells: fix wintergrasp water being applied to players. small codestyle fix --- ...2012_04_03_00_world_spell_script_names.sql | 3 + src/server/scripts/Spells/spell_generic.cpp | 67 +++++++++++++------ 2 files changed, 51 insertions(+), 19 deletions(-) create mode 100644 sql/updates/world/2012_04_03_00_world_spell_script_names.sql diff --git a/sql/updates/world/2012_04_03_00_world_spell_script_names.sql b/sql/updates/world/2012_04_03_00_world_spell_script_names.sql new file mode 100644 index 00000000000..e296ed55d53 --- /dev/null +++ b/sql/updates/world/2012_04_03_00_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` = 36444; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(36444, 'spell_gen_wg_water'); \ No newline at end of file diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 929206dec05..41d1c24c517 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1234,30 +1234,30 @@ class spell_gen_magic_rooster : public SpellScriptLoader class spell_gen_allow_cast_from_item_only : public SpellScriptLoader { -public: - spell_gen_allow_cast_from_item_only() : SpellScriptLoader("spell_gen_allow_cast_from_item_only") { } + public: + spell_gen_allow_cast_from_item_only() : SpellScriptLoader("spell_gen_allow_cast_from_item_only") { } - class spell_gen_allow_cast_from_item_only_SpellScript : public SpellScript - { - PrepareSpellScript(spell_gen_allow_cast_from_item_only_SpellScript); - - SpellCastResult CheckRequirement() + class spell_gen_allow_cast_from_item_only_SpellScript : public SpellScript { - if (!GetCastItem()) - return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; - return SPELL_CAST_OK; - } + PrepareSpellScript(spell_gen_allow_cast_from_item_only_SpellScript); - void Register() + SpellCastResult CheckRequirement() + { + if (!GetCastItem()) + return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_gen_allow_cast_from_item_only_SpellScript::CheckRequirement); + } + }; + + SpellScript* GetSpellScript() const { - OnCheckCast += SpellCheckCastFn(spell_gen_allow_cast_from_item_only_SpellScript::CheckRequirement); + return new spell_gen_allow_cast_from_item_only_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_gen_allow_cast_from_item_only_SpellScript(); - } }; enum Launch @@ -2590,6 +2590,34 @@ class spell_gen_ds_flush_knockback : public SpellScriptLoader } }; +class spell_gen_wg_water : public SpellScriptLoader +{ + public: + spell_gen_wg_water() : SpellScriptLoader("spell_gen_wg_water") {} + + class spell_gen_wg_water_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_wg_water_SpellScript); + + SpellCastResult CheckCast() + { + if (!GetSpellInfo()->CheckTargetCreatureType(GetTargetUnit())) + return SPELL_FAILED_DONT_REPORT; + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_gen_wg_water_SpellScript::CheckCast); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_wg_water_SpellScript(); + } +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -2640,4 +2668,5 @@ void AddSC_generic_spell_scripts() new spell_gen_tournament_pennant(); new spell_gen_chaos_blast(); new spell_gen_ds_flush_knockback(); + new spell_gen_wg_water(); } From 0814bfb35e765027d2fca4d8ea9db4b220a1a054 Mon Sep 17 00:00:00 2001 From: kandera Date: Tue, 3 Apr 2012 11:21:53 -0300 Subject: [PATCH 0408/1149] Update sql/updates/world/2012_04_03_00_world_spell_script_names.sql --- sql/updates/world/2012_04_03_00_world_spell_script_names.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/updates/world/2012_04_03_00_world_spell_script_names.sql b/sql/updates/world/2012_04_03_00_world_spell_script_names.sql index e296ed55d53..70f675daa20 100644 --- a/sql/updates/world/2012_04_03_00_world_spell_script_names.sql +++ b/sql/updates/world/2012_04_03_00_world_spell_script_names.sql @@ -1,3 +1,3 @@ DELETE FROM `spell_script_names` WHERE `spell_id` = 36444; INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES -(36444, 'spell_gen_wg_water'); \ No newline at end of file +(36444, 'spell_gen_wg_water'); From 11c183fd1f481c1d02f5567237ba6ef5122a0f30 Mon Sep 17 00:00:00 2001 From: 4m1g0 Date: Tue, 3 Apr 2012 20:44:22 +0200 Subject: [PATCH 0409/1149] Core/Arenas/Dalaran Sewers: Set more blizzlike waterfall warning timer value. Thanks Souler --- src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp | 2 +- src/server/game/Battlegrounds/Zones/BattlegroundDS.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp index dcb6e668de8..ccc6a2305b4 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp @@ -86,7 +86,7 @@ void BattlegroundDS::PostUpdateImpl(uint32 diff) setWaterFallTimer(BG_DS_WATERFALL_WARNING_DURATION); setWaterFallStatus(BG_DS_WATERFALL_STATUS_WARNING); } - else if (getWaterFallStatus() == BG_DS_WATERFALL_STATUS_WARNING) // Active collision and perform knockback + else if (getWaterFallStatus() == BG_DS_WATERFALL_STATUS_WARNING) // Active collision and start knockback timer { if (GameObject* gob = GetBgMap()->GetGameObject(BgObjects[BG_DS_OBJECT_WATER_1])) gob->SetGoState(GO_STATE_READY); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h index 8df01e6415c..aaf08ba1313 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h @@ -66,7 +66,7 @@ enum BattlegroundDSData { // These values are NOT blizzlike... need the correct data! BG_DS_WATERFALL_TIMER_MIN = 30000, BG_DS_WATERFALL_TIMER_MAX = 60000, - BG_DS_WATERFALL_WARNING_DURATION = 2000, + BG_DS_WATERFALL_WARNING_DURATION = 5000, BG_DS_WATERFALL_DURATION = 30000, BG_DS_WATERFALL_KNOCKBACK_TIMER = 1500, From 5ebace6c7fb1c2f42bd69339d2d413d96bead099 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 3 Apr 2012 23:10:48 +0100 Subject: [PATCH 0410/1149] Core/DBLayer: Fix issues in instance saving; spotted by Saring, thank you --- src/server/game/Instances/InstanceSaveMgr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index c17c7edbf0d..8078a91d082 100755 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -581,17 +581,17 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE_BY_MAP_DIFF); stmt->setUInt16(0, uint16(mapid)); - stmt->setUInt8(0, uint8(difficulty)); + stmt->setUInt8(1, uint8(difficulty)); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_INSTANCE_BY_MAP_DIFF); stmt->setUInt16(0, uint16(mapid)); - stmt->setUInt8(0, uint8(difficulty)); + stmt->setUInt8(1, uint8(difficulty)); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INSTANCE_BY_MAP_DIFF); stmt->setUInt16(0, uint16(mapid)); - stmt->setUInt8(0, uint8(difficulty)); + stmt->setUInt8(1, uint8(difficulty)); trans->Append(stmt); CharacterDatabase.CommitTransaction(trans); From 907410270229a6dd7749c408140d497a91638637 Mon Sep 17 00:00:00 2001 From: click Date: Wed, 4 Apr 2012 00:29:22 +0200 Subject: [PATCH 0411/1149] Core: Fix Item::SaveRefundDataToDB prepared statement parameters --- src/server/game/Entities/Item/Item.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index bc90e6f4484..f2b893896dc 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1089,9 +1089,9 @@ void Item::SaveRefundDataToDB() stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEM_REFUND_INSTANCE); stmt->setUInt32(0, GetGUIDLow()); - stmt->setUInt32(0, GetRefundRecipient()); - stmt->setUInt32(0, GetPaidMoney()); - stmt->setUInt16(0, uint16(GetPaidExtendedCost())); + stmt->setUInt32(1, GetRefundRecipient()); + stmt->setUInt32(2, GetPaidMoney()); + stmt->setUInt16(3, uint16(GetPaidExtendedCost())); trans->Append(stmt); CharacterDatabase.CommitTransaction(trans); From e231cf9462dc3f8568ac5f0a4112b8aefc4041c4 Mon Sep 17 00:00:00 2001 From: click Date: Wed, 4 Apr 2012 00:42:00 +0200 Subject: [PATCH 0412/1149] Core: Fix WorldSession::HandleWrapItemOpcode prepared statement parameters --- src/server/game/Handlers/ItemHandler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 85694dba630..d537fc5b4aa 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1127,9 +1127,9 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_GIFT); stmt->setUInt32(0, GUID_LOPART(item->GetOwnerGUID())); - stmt->setUInt32(0, item->GetGUIDLow()); - stmt->setUInt32(0, item->GetEntry()); - stmt->setUInt32(0, item->GetUInt32Value(ITEM_FIELD_FLAGS)); + stmt->setUInt32(1, item->GetGUIDLow()); + stmt->setUInt32(2, item->GetEntry()); + stmt->setUInt32(3, item->GetUInt32Value(ITEM_FIELD_FLAGS)); trans->Append(stmt); item->SetEntry(gift->GetEntry()); From ef6b99cd377780d599d77dbcf5c847dd64a47d66 Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 3 Apr 2012 18:56:34 -0400 Subject: [PATCH 0413/1149] Core/Spells: fix crash with wintergrasp water spell script. --- src/server/scripts/Spells/spell_generic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 41d1c24c517..035f9ec98b2 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2601,7 +2601,7 @@ class spell_gen_wg_water : public SpellScriptLoader SpellCastResult CheckCast() { - if (!GetSpellInfo()->CheckTargetCreatureType(GetTargetUnit())) + if (!GetSpellInfo()->CheckTargetCreatureType(GetCaster())) return SPELL_FAILED_DONT_REPORT; return SPELL_CAST_OK; } From 98fcadae46ec27516612f00ecb5a59c3c30fc1f8 Mon Sep 17 00:00:00 2001 From: click Date: Wed, 4 Apr 2012 01:23:09 +0200 Subject: [PATCH 0414/1149] Core: Fix Group::SetGroupMemberFlag and Pet::resetTalentsForAllPetsOf prepared statement parameters (thanks Saring) --- src/server/game/Entities/Pet/Pet.cpp | 2 +- src/server/game/Groups/Group.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 0ee8381d54f..fcb89e33dc1 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -1745,7 +1745,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/) stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SPELL_LIST); stmt->setUInt32(0, owner->GetGUIDLow()); - stmt->setUInt32(0, except_petnumber); + stmt->setUInt32(1, except_petnumber); PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 768531b0aea..c7648bf1ccc 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -2136,7 +2136,7 @@ void Group::SetGroupMemberFlag(uint64 guid, bool apply, GroupMemberFlags flag) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_FLAG); stmt->setUInt8(0, slot->flags); - stmt->setUInt32(0, GUID_LOPART(guid)); + stmt->setUInt32(1, GUID_LOPART(guid)); CharacterDatabase.Execute(stmt); From 0447ddacefc73fa540666b5cd22db3ca84b94c8b Mon Sep 17 00:00:00 2001 From: click Date: Wed, 4 Apr 2012 17:42:45 +0200 Subject: [PATCH 0415/1149] Core: Fix a crash in Player::DeleteFromDB due to loading wrong fields --- src/server/game/Entities/Player/Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 0a4363df323..f3917d735e8 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4876,7 +4876,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC } Item* pItem = NewItemOrBag(itemProto); - if (!pItem->LoadFromDB(item_guidlow, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER), fields, item_template)) + if (!pItem->LoadFromDB(item_guidlow, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER), fields2, item_template)) { pItem->FSetState(ITEM_REMOVED); pItem->SaveToDB(trans); // it also deletes item object! From e359bfef1b868cbbbc3a802b00710982dbf4c89e Mon Sep 17 00:00:00 2001 From: leak Date: Wed, 4 Apr 2012 17:58:17 +0200 Subject: [PATCH 0416/1149] SQL: Adjust rollup filename and change address length to 255 according to RFC 1035 --- ...04_01_auth_realmlist.sql => 2012_04_01_00_auth_realmlist.sql} | 0 sql/updates/auth/2012_04_04_00_auth_realmlist.sql | 1 + 2 files changed, 1 insertion(+) rename sql/updates/auth/{2012_04_01_auth_realmlist.sql => 2012_04_01_00_auth_realmlist.sql} (100%) create mode 100644 sql/updates/auth/2012_04_04_00_auth_realmlist.sql diff --git a/sql/updates/auth/2012_04_01_auth_realmlist.sql b/sql/updates/auth/2012_04_01_00_auth_realmlist.sql similarity index 100% rename from sql/updates/auth/2012_04_01_auth_realmlist.sql rename to sql/updates/auth/2012_04_01_00_auth_realmlist.sql diff --git a/sql/updates/auth/2012_04_04_00_auth_realmlist.sql b/sql/updates/auth/2012_04_04_00_auth_realmlist.sql new file mode 100644 index 00000000000..18f2d7b3d4c --- /dev/null +++ b/sql/updates/auth/2012_04_04_00_auth_realmlist.sql @@ -0,0 +1 @@ +ALTER TABLE `realmlist` CHANGE `address` `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '127.0.0.1'; From cea393061097e59d1bcf0b7a4c757029770c92f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vojt=C4=9Bch=20Bo=C4=8Dek?= Date: Wed, 4 Apr 2012 19:07:22 +0300 Subject: [PATCH 0417/1149] Core: Give field pointers in Player::DeleteFromDB() more appropriate name --- src/server/game/Entities/Player/Player.cpp | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f3917d735e8..ca1795bb04a 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4819,16 +4819,16 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC { do { - Field* fields = resultMail->Fetch(); + Field* mailFields = resultMail->Fetch(); - uint32 mail_id = fields[0].GetUInt32(); - uint8 mailType = fields[1].GetUInt8(); - uint16 mailTemplateId= fields[2].GetUInt16(); - uint32 sender = fields[3].GetUInt32(); - std::string subject = fields[4].GetString(); - std::string body = fields[5].GetString(); - uint32 money = fields[6].GetUInt32(); - bool has_items = fields[7].GetBool(); + uint32 mail_id = mailFields[0].GetUInt32(); + uint8 mailType = mailFields[1].GetUInt8(); + uint16 mailTemplateId= mailFields[2].GetUInt16(); + uint32 sender = mailFields[3].GetUInt32(); + std::string subject = mailFields[4].GetString(); + std::string body = mailFields[5].GetString(); + uint32 money = mailFields[6].GetUInt32(); + bool has_items = mailFields[7].GetBool(); // We can return mail now // So firstly delete the old one @@ -4862,9 +4862,9 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC { do { - Field* fields2 = resultItems->Fetch(); - uint32 item_guidlow = fields2[11].GetUInt32(); - uint32 item_template = fields2[12].GetUInt32(); + Field* itemFields = resultItems->Fetch(); + uint32 item_guidlow = itemFields[11].GetUInt32(); + uint32 item_template = itemFields[12].GetUInt32(); ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(item_template); if (!itemProto) @@ -4876,7 +4876,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC } Item* pItem = NewItemOrBag(itemProto); - if (!pItem->LoadFromDB(item_guidlow, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER), fields2, item_template)) + if (!pItem->LoadFromDB(item_guidlow, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER), itemFields, item_template)) { pItem->FSetState(ITEM_REMOVED); pItem->SaveToDB(trans); // it also deletes item object! From 98687770ffb3edd98e839eb8b532220852870ed5 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 4 Apr 2012 14:13:19 -0500 Subject: [PATCH 0418/1149] SQL/Spells: Will of Sartharion should only affect the drakes and Sartharion, patch by Vincent-Michael Closes #5641 --- sql/updates/world/2012_04_04_00_world_conditions.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/2012_04_04_00_world_conditions.sql diff --git a/sql/updates/world/2012_04_04_00_world_conditions.sql b/sql/updates/world/2012_04_04_00_world_conditions.sql new file mode 100644 index 00000000000..f4d0a6c41b4 --- /dev/null +++ b/sql/updates/world/2012_04_04_00_world_conditions.sql @@ -0,0 +1,7 @@ +-- Will of Sartharion should only target the drakes and Sartharion +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=61254; +INSERT INTO `conditions`(`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13, 1, 61254, 0, 0, 31, 0, 3, 30449, 0, 0, 0, '', 'Will of Sartharion'), +(13, 1, 61254, 0, 1, 31, 0, 3, 30451, 0, 0, 0, '', 'Will of Sartharion'), +(13, 1, 61254, 0, 2, 31, 0, 3, 30452, 0, 0, 0, '', 'Will of Sartharion'), +(13, 1, 61254, 0, 3, 31, 0, 3, 28860, 0, 0, 0, '', 'Will of Sartharion'); \ No newline at end of file From 5468e8eeb5efb80da6e3d590c112511bdac540b5 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 4 Apr 2012 17:06:50 -0500 Subject: [PATCH 0419/1149] Core/Spells: The first target of a chained spell should be explicit. Closes #5643 --- src/server/game/Spells/Spell.cpp | 8 ++++---- src/server/game/Spells/Spell.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 942f9dc7e86..de86c2516cb 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1008,7 +1008,7 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar { case TARGET_OBJECT_TYPE_UNIT: if (Unit* unitTarget = target->ToUnit()) - AddUnitTarget(unitTarget, effMask, false); + AddUnitTarget(unitTarget, effMask, true, false); break; case TARGET_OBJECT_TYPE_GOBJ: if (GameObject* gobjTarget = target->ToGameObject()) @@ -1544,7 +1544,7 @@ void Spell::SelectImplicitTargetObjectTargets(SpellEffIndex effIndex, SpellImpli { ASSERT((m_targets.GetObjectTarget() || m_targets.GetItemTarget()) && "Spell::SelectImplicitTargetObjectTargets - no explicit object or item target available!"); if (Unit* unit = m_targets.GetUnitTarget()) - AddUnitTarget(unit, 1 << effIndex); + AddUnitTarget(unit, 1 << effIndex, true, false); else if (GameObject* gobj = m_targets.GetGOTarget()) AddGOTarget(gobj, 1 << effIndex); else @@ -2077,7 +2077,7 @@ void Spell::CleanupTargetList() m_delayMoment = 0; } -void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*= true*/) +void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*= true*/, bool implicit /*= true*/) { for (uint32 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex) if (!m_spellInfo->Effects[effIndex].IsEffect() || !CheckEffectTarget(target, effIndex)) @@ -2088,7 +2088,7 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*= return; if (checkIfValid) - if (m_spellInfo->CheckTarget(m_caster, target, true) != SPELL_CAST_OK) + if (m_spellInfo->CheckTarget(m_caster, target, implicit) != SPELL_CAST_OK) return; // Check for effect immune skip if immuned diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 37842433eb3..d8e9c4a4ad4 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -596,7 +596,7 @@ class Spell SpellDestination m_destTargets[MAX_SPELL_EFFECTS]; - void AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid = true); + void AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid = true, bool implicit = true); void AddGOTarget(GameObject* target, uint32 effectMask); void AddItemTarget(Item* item, uint32 effectMask); void AddDestTarget(SpellDestination const& dest, uint32 effIndex); From 3d6da262dc4ba618a3ec052ef648c06b46882401 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 4 Apr 2012 20:51:49 -0500 Subject: [PATCH 0420/1149] Core/Spells: Blade Barrier should not proc from autoattacks Closes #6028 Signed-off-by: Subv --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index d71f8e8dfc3..b49ce1bf075 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -8827,7 +8827,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg } // Blade Barrier - if (auraSpellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && auraSpellInfo->SpellIconID == 85) + if (auraSpellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && auraSpellInfo->SpellIconID == 85 && procSpell) { Player* player = ToPlayer(); if (!player || player->getClass() != CLASS_DEATH_KNIGHT) From a7de92a7a1bae464b94d3ea15f2a203abd3d8d02 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 4 Apr 2012 21:41:54 -0500 Subject: [PATCH 0421/1149] Core/Spells: Rune Strike should only be available for use once after a block/parry Closes #6007 Signed-off-by: Subv --- sql/updates/world/2012_04_04_01_world_spell_dbc.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_04_04_01_world_spell_dbc.sql diff --git a/sql/updates/world/2012_04_04_01_world_spell_dbc.sql b/sql/updates/world/2012_04_04_01_world_spell_dbc.sql new file mode 100644 index 00000000000..1b8b0868648 --- /dev/null +++ b/sql/updates/world/2012_04_04_01_world_spell_dbc.sql @@ -0,0 +1,2 @@ +UPDATE `spell_dbc` SET `EffectApplyAuraName1`=4 WHERE `Id`=56817; + From 24b699d904aa90bccb25991254fd83ccf4df8066 Mon Sep 17 00:00:00 2001 From: Subv Date: Thu, 5 Apr 2012 08:32:58 -0500 Subject: [PATCH 0422/1149] Core/Spells: Fixed Dancing Rune Weapon double-applying the duration bonus of the glyph Closes #6032 Signed-off-by: Subv --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 6383c7ff3ef..c5a2705c003 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4768,11 +4768,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool if (target->GetTypeId() == TYPEID_PLAYER) target->ToPlayer()->RemoveAmmo(); // not use ammo and not allow use break; - case 49028: - if (caster) - if (AuraEffect* aurEff = caster->GetAuraEffect(63330, 0)) // glyph of Dancing Rune Weapon - GetBase()->SetDuration(GetBase()->GetDuration() + aurEff->GetAmount()); - break; case 52916: // Honor Among Thieves if (target->GetTypeId() == TYPEID_PLAYER) if (Unit* spellTarget = ObjectAccessor::GetUnit(*target, target->ToPlayer()->GetComboTarget())) From d155304f8409a55254d57f646e612098d20bf886 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 5 Apr 2012 17:38:13 +0100 Subject: [PATCH 0423/1149] DB/GOs: Correct some templates and add a missing one (WDB) DB/Auth: Add missed change to auth_base.sql Also fix file endings in some of hte sqls --- sql/base/auth_database.sql | 2 +- .../2012_03_30_00_world_smart_scripts.sql | 1 - .../world/2012_04_04_00_world_conditions.sql | 2 +- .../world/2012_04_04_01_world_spell_dbc.sql | 1 - ...012_04_05_00_world_gameobject_template.sql | 32 +++++++++++++++++++ 5 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 sql/updates/world/2012_04_05_00_world_gameobject_template.sql diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 1075644db3d..14aaa4658e9 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -191,7 +191,7 @@ DROP TABLE IF EXISTS `realmlist`; CREATE TABLE `realmlist` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(32) NOT NULL DEFAULT '', - `address` varchar(64) NOT NULL DEFAULT '127.0.0.1', + `address` varchar(255) NOT NULL DEFAULT '127.0.0.1', `port` smallint(5) unsigned NOT NULL DEFAULT '8085', `icon` tinyint(3) unsigned NOT NULL DEFAULT '0', `flag` tinyint(3) unsigned NOT NULL DEFAULT '2', diff --git a/sql/updates/world/2012_03_30_00_world_smart_scripts.sql b/sql/updates/world/2012_03_30_00_world_smart_scripts.sql index 08d4ee90168..3ec709d76c1 100644 --- a/sql/updates/world/2012_03_30_00_world_smart_scripts.sql +++ b/sql/updates/world/2012_03_30_00_world_smart_scripts.sql @@ -92,4 +92,3 @@ INSERT INTO `quest_start_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2` (@COOP,38,10,@ENTRY,@LIFE,0, 5227.28,4407.01,-95.3888,4.29414), (@COOP,39,10,@ENTRY,@LIFE,0, 5251.09,4413.76,-96.086,3.90536), (@COOP,40,10,@ENTRY,@LIFE,0, 5251.09,4413.76,-96.086,4.36089); - diff --git a/sql/updates/world/2012_04_04_00_world_conditions.sql b/sql/updates/world/2012_04_04_00_world_conditions.sql index f4d0a6c41b4..55cab4ca730 100644 --- a/sql/updates/world/2012_04_04_00_world_conditions.sql +++ b/sql/updates/world/2012_04_04_00_world_conditions.sql @@ -4,4 +4,4 @@ INSERT INTO `conditions`(`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,` (13, 1, 61254, 0, 0, 31, 0, 3, 30449, 0, 0, 0, '', 'Will of Sartharion'), (13, 1, 61254, 0, 1, 31, 0, 3, 30451, 0, 0, 0, '', 'Will of Sartharion'), (13, 1, 61254, 0, 2, 31, 0, 3, 30452, 0, 0, 0, '', 'Will of Sartharion'), -(13, 1, 61254, 0, 3, 31, 0, 3, 28860, 0, 0, 0, '', 'Will of Sartharion'); \ No newline at end of file +(13, 1, 61254, 0, 3, 31, 0, 3, 28860, 0, 0, 0, '', 'Will of Sartharion'); diff --git a/sql/updates/world/2012_04_04_01_world_spell_dbc.sql b/sql/updates/world/2012_04_04_01_world_spell_dbc.sql index 1b8b0868648..7eccdf811e4 100644 --- a/sql/updates/world/2012_04_04_01_world_spell_dbc.sql +++ b/sql/updates/world/2012_04_04_01_world_spell_dbc.sql @@ -1,2 +1 @@ UPDATE `spell_dbc` SET `EffectApplyAuraName1`=4 WHERE `Id`=56817; - diff --git a/sql/updates/world/2012_04_05_00_world_gameobject_template.sql b/sql/updates/world/2012_04_05_00_world_gameobject_template.sql new file mode 100644 index 00000000000..ab05bf43b86 --- /dev/null +++ b/sql/updates/world/2012_04_05_00_world_gameobject_template.sql @@ -0,0 +1,32 @@ +DELETE FROM `gameobject_template` WHERE `entry`=202931; +INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `data0`, `data1`, `data2`, `data3`, `data4`, `data5`, `data6`, `data7`, `data8`, `data9`, `data10`, `data11`, `data12`, `data13`, `data14`, `data15`, `data16`, `data17`, `data18`, `data19`, `data20`, `data21`, `data22`, `data23`, `size`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `WDBVerified`) VALUES +(202931, 5, 9463, 'Serpent Offering', '', '', '', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.17, 0, 0, 0, 0, 0, 0, 12340); -- -Unknown- + +UPDATE `gameobject_template` SET `questItem1`=30527, `questItem2`=30524, `questItem3`=30525, `questItem4`=30526 WHERE `entry`=184815; -- Sealed Coffin +-- UPDATE `gameobject_template` SET `data0`=2061, `WDBVerified`=12340 WHERE `entry`=151951; -- Idol Oven Fire +-- UPDATE `gameobject_template` SET `type`=5, `data3`=0, `data5`=0 WHERE `entry`=188187; -- Snow Pile +UPDATE `gameobject_template` SET `size`=0.45 WHERE `entry`=190169; -- Tiger Lily +UPDATE `gameobject_template` SET `unk1`='' WHERE `entry`=190549; -- The Zephyr +UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=191300; -- Fire +UPDATE `gameobject_template` SET `displayId`=7836 WHERE `entry`=196485; -- Saronite Rock +-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126337; -- 126337 +-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126338; -- 126338 +-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126339; -- 126339 +-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126340; -- 126340 +-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126341; -- 126341 +-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126345; -- 126345 +UPDATE `gameobject_template` SET `data2`=23787, `data7`=3605, `data19`=0 WHERE `entry`=202443; -- Dedication of Honor +UPDATE `gameobject_template` SET `type`=10 WHERE `entry`=166872; -- Supply Crate +UPDATE `gameobject_template` SET `data6`=-1000 WHERE `entry`=178559; -- Larva Spewer + +/* +GameObject (Entry: 126337 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 126338 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 126339 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 126340 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 126341 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 126345 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 151951 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 191300 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +Gameobject (Entry: 188192 GoType: 3) have data7=188187 but GO (Entry 188187) have not GAMEOBJECT_TYPE_TRAP (6) type. +*/ From e3fd50b7f5af048501cc952499a87c277b9d22d3 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 5 Apr 2012 17:42:19 +0100 Subject: [PATCH 0424/1149] This should have been commented out (@ previous commit) --- sql/updates/world/2012_04_05_00_world_gameobject_template.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/updates/world/2012_04_05_00_world_gameobject_template.sql b/sql/updates/world/2012_04_05_00_world_gameobject_template.sql index ab05bf43b86..d50c4ad8d1c 100644 --- a/sql/updates/world/2012_04_05_00_world_gameobject_template.sql +++ b/sql/updates/world/2012_04_05_00_world_gameobject_template.sql @@ -7,7 +7,7 @@ UPDATE `gameobject_template` SET `questItem1`=30527, `questItem2`=30524, `questI -- UPDATE `gameobject_template` SET `type`=5, `data3`=0, `data5`=0 WHERE `entry`=188187; -- Snow Pile UPDATE `gameobject_template` SET `size`=0.45 WHERE `entry`=190169; -- Tiger Lily UPDATE `gameobject_template` SET `unk1`='' WHERE `entry`=190549; -- The Zephyr -UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=191300; -- Fire +-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=191300; -- Fire UPDATE `gameobject_template` SET `displayId`=7836 WHERE `entry`=196485; -- Saronite Rock -- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126337; -- 126337 -- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126338; -- 126338 From 9ae22e06f658f91b3064a2ac3f5dec9d2bde662a Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 5 Apr 2012 12:46:51 -0400 Subject: [PATCH 0425/1149] Core/Spells: Fix unrelenting assault not proccing aura when overpower is used while target is casting. Closes #5965 --- ...2012_04_05_00_world_spell_script_names.sql | 6 +++ src/server/scripts/Spells/spell_warrior.cpp | 46 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 sql/updates/world/2012_04_05_00_world_spell_script_names.sql diff --git a/sql/updates/world/2012_04_05_00_world_spell_script_names.sql b/sql/updates/world/2012_04_05_00_world_spell_script_names.sql new file mode 100644 index 00000000000..43f6760e8d6 --- /dev/null +++ b/sql/updates/world/2012_04_05_00_world_spell_script_names.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` in (7384,7887,11584,11585); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(7384, 'spell_warr_overpower'), +(7887, 'spell_warr_overpower'), +(11584, 'spell_warr_overpower'), +(11585, 'spell_warr_overpower'); diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 1084398c37d..c87c2e05289 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -413,6 +413,51 @@ class spell_warr_bloodthirst : public SpellScriptLoader } }; +enum Overpower +{ + SPELL_UNRELENTING_ASSAULT_RANK_1 = 46859, + SPELL_UNRELENTING_ASSAULT_RANK_2 = 46860, + SPELL_UNRELENTING_ASSAULT_TRIGGER_1 = 64849, + SPELL_UNRELENTING_ASSAULT_TRIGGER_2 = 64850, +}; + +class spell_warr_overpower : public SpellScriptLoader +{ +public: + spell_warr_overpower() : SpellScriptLoader("spell_warr_overpower") { } + + class spell_warr_overpower_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warr_overpower_SpellScript); + + void HandleEffect(SpellEffIndex /* effIndex */) + { + uint32 spellId = 0; + if (GetCaster()->HasAura(SPELL_UNRELENTING_ASSAULT_RANK_1)) + spellId = SPELL_UNRELENTING_ASSAULT_TRIGGER_1; + else if (GetCaster()->HasAura(SPELL_UNRELENTING_ASSAULT_RANK_2)) + spellId = SPELL_UNRELENTING_ASSAULT_TRIGGER_2; + + if (!spellId) + return; + + Unit* target = GetHitUnit(); + if (target->HasUnitState(UNIT_STATE_CASTING)) + GetCaster()->CastSpell(target, spellId, true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warr_overpower_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_ANY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warr_overpower_SpellScript(); + } +}; + void AddSC_warrior_spell_scripts() { new spell_warr_last_stand(); @@ -424,4 +469,5 @@ void AddSC_warrior_spell_scripts() new spell_warr_execute(); new spell_warr_concussion_blow(); new spell_warr_bloodthirst(); + new spell_warr_overpower(); } From 4126e76862b3bfa2a1ac790af09d7e0e74318fc0 Mon Sep 17 00:00:00 2001 From: Subv Date: Thu, 5 Apr 2012 12:07:44 -0500 Subject: [PATCH 0426/1149] SQL/Spells: Fixed Libram of Veracity proc Closes #6022 Signed-off-by: Subv --- sql/updates/world/2012_04_05_01_world_spell_proc_event.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_04_05_01_world_spell_proc_event.sql diff --git a/sql/updates/world/2012_04_05_01_world_spell_proc_event.sql b/sql/updates/world/2012_04_05_01_world_spell_proc_event.sql new file mode 100644 index 00000000000..076f97b8736 --- /dev/null +++ b/sql/updates/world/2012_04_05_01_world_spell_proc_event.sql @@ -0,0 +1,2 @@ +UPDATE `spell_proc_event` SET `SpellFamilyMask0`=0x80000000, `SpellFamilyMask1`=0 WHERE `entry`=67363; -- Fixes Libram of Veracity proc + From 6759bcab162cefad379a8441655448fe411c870a Mon Sep 17 00:00:00 2001 From: Subv Date: Thu, 5 Apr 2012 12:09:37 -0500 Subject: [PATCH 0427/1149] Core/SAI: Added a new event flag to allow events to NOT reset when the creature evades (SMART_EVENT_FLAG_DONT_RESET) Closes #5568 Signed-off-by: Subv --- src/server/game/AI/SmartScripts/SmartScript.cpp | 7 +++++-- .../game/AI/SmartScripts/SmartScriptMgr.h | 17 +++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index b2c4fd29868..83b37023211 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -108,8 +108,11 @@ void SmartScript::OnReset() ResetBaseObject(); for (SmartAIEventList::iterator i = mEvents.begin(); i != mEvents.end(); ++i) { - InitTimer((*i)); - (*i).runOnce = false; + if (!((*i).event.event_flags & SMART_EVENT_FLAG_DONT_RESET)) + { + InitTimer((*i)); + (*i).runOnce = false; + } } ProcessEventsFor(SMART_EVENT_RESET); mLastInvoker = 0; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index e2cd75ee62c..8d3686a265d 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -1165,14 +1165,15 @@ const uint32 SmartAIEventMask[SMART_EVENT_END][2] = enum SmartEventFlags { - SMART_EVENT_FLAG_NOT_REPEATABLE = 0x01, //Event can not repeat - SMART_EVENT_FLAG_DIFFICULTY_0 = 0x02, //Event only occurs in instance difficulty 0 - SMART_EVENT_FLAG_DIFFICULTY_1 = 0x04, //Event only occurs in instance difficulty 1 - SMART_EVENT_FLAG_DIFFICULTY_2 = 0x08, //Event only occurs in instance difficulty 2 - SMART_EVENT_FLAG_DIFFICULTY_3 = 0x10, //Event only occurs in instance difficulty 3 - SMART_EVENT_FLAG_RESERVED_5 = 0x20, - SMART_EVENT_FLAG_RESERVED_6 = 0x40, - SMART_EVENT_FLAG_DEBUG_ONLY = 0x80, //Event only occurs in debug build + SMART_EVENT_FLAG_NOT_REPEATABLE = 0x001, //Event can not repeat + SMART_EVENT_FLAG_DIFFICULTY_0 = 0x002, //Event only occurs in instance difficulty 0 + SMART_EVENT_FLAG_DIFFICULTY_1 = 0x004, //Event only occurs in instance difficulty 1 + SMART_EVENT_FLAG_DIFFICULTY_2 = 0x008, //Event only occurs in instance difficulty 2 + SMART_EVENT_FLAG_DIFFICULTY_3 = 0x010, //Event only occurs in instance difficulty 3 + SMART_EVENT_FLAG_RESERVED_5 = 0x020, + SMART_EVENT_FLAG_RESERVED_6 = 0x040, + SMART_EVENT_FLAG_DEBUG_ONLY = 0x080, //Event only occurs in debug build + SMART_EVENT_FLAG_DONT_RESET = 0x100, //Event will not reset in SmartScript::OnReset() SMART_EVENT_FLAG_DIFFICULTY_ALL = (SMART_EVENT_FLAG_DIFFICULTY_0|SMART_EVENT_FLAG_DIFFICULTY_1|SMART_EVENT_FLAG_DIFFICULTY_2|SMART_EVENT_FLAG_DIFFICULTY_3) }; From 926f02f7928c1444a4f248f9eb6543f6efead17c Mon Sep 17 00:00:00 2001 From: Liberate Date: Thu, 5 Apr 2012 20:09:20 +0200 Subject: [PATCH 0428/1149] Core/Spells: Implement SPELL_ATTR4_PROC_ONLY_ON_CASTER properly. Closes #5204 --- src/server/game/Miscellaneous/SharedDefines.h | 2 +- src/server/game/Spells/Spell.cpp | 30 +++++++++++-------- src/server/game/Spells/Spell.h | 14 +++++++-- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index bca896df38f..df524b1409e 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -411,7 +411,7 @@ enum SpellAttr3 enum SpellAttr4 { SPELL_ATTR4_UNK0 = 0x00000001, // 0 - SPELL_ATTR4_PROC_ONLY_ON_DUMMY = 0x00000002, // 1 proc only on SPELL_EFFECT_DUMMY? + SPELL_ATTR4_PROC_ONLY_ON_CASTER = 0x00000002, // 1 proc only on effects with TARGET_UNIT_CASTER? SPELL_ATTR4_UNK2 = 0x00000004, // 2 SPELL_ATTR4_UNK3 = 0x00000008, // 3 SPELL_ATTR4_UNK4 = 0x00000010, // 4 This will no longer cause guards to attack on use?? diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index de86c2516cb..82a89e97e4b 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2745,18 +2745,18 @@ void Spell::DoTriggersOnSpellHit(Unit* unit, uint8 effMask) if (!m_hitTriggerSpells.empty()) { int _duration = 0; - for (HitTriggerSpells::const_iterator i = m_hitTriggerSpells.begin(); i != m_hitTriggerSpells.end(); ++i) + for (HitTriggerSpellList::const_iterator i = m_hitTriggerSpells.begin(); i != m_hitTriggerSpells.end(); ++i) { - if (CanExecuteTriggersOnHit(effMask, i->first) && roll_chance_i(i->second)) + if (CanExecuteTriggersOnHit(effMask, i->triggeredByAura) && roll_chance_i(i->chance)) { - m_caster->CastSpell(unit, i->first, true); - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell %d triggered spell %d by SPELL_AURA_ADD_TARGET_TRIGGER aura", m_spellInfo->Id, i->first->Id); + m_caster->CastSpell(unit, i->triggeredSpell, true); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell %d triggered spell %d by SPELL_AURA_ADD_TARGET_TRIGGER aura", m_spellInfo->Id, i->triggeredSpell->Id); // SPELL_AURA_ADD_TARGET_TRIGGER auras shouldn't trigger auras without duration // set duration of current aura to the triggered spell - if (i->first->GetDuration() == -1) + if (i->triggeredSpell->GetDuration() == -1) { - if (Aura* triggeredAur = unit->GetAura(i->first->Id, m_caster->GetGUID())) + if (Aura* triggeredAur = unit->GetAura(i->triggeredSpell->Id, m_caster->GetGUID())) { // get duration from aura-only once if (!_duration) @@ -7171,14 +7171,13 @@ void Spell::CallScriptAfterUnitTargetSelectHandlers(std::list& unitTarget } } -bool Spell::CanExecuteTriggersOnHit(uint8 effMask, SpellInfo const* spellInfo) const +bool Spell::CanExecuteTriggersOnHit(uint8 effMask, SpellInfo const* triggeredByAura) const { - bool only_on_dummy = (spellInfo && (spellInfo->AttributesEx4 & SPELL_ATTR4_PROC_ONLY_ON_DUMMY)); - // If triggered spell has SPELL_ATTR4_PROC_ONLY_ON_DUMMY then it can only proc on a casted spell with SPELL_EFFECT_DUMMY - // If triggered spell doesn't have SPELL_ATTR4_PROC_ONLY_ON_DUMMY then it can NOT proc on SPELL_EFFECT_DUMMY (needs confirmation) + bool only_on_caster = (triggeredByAura && (triggeredByAura->AttributesEx4 & SPELL_ATTR4_PROC_ONLY_ON_CASTER)); + // If triggeredByAura has SPELL_ATTR4_PROC_ONLY_ON_CASTER then it can only proc on a casted spell with TARGET_UNIT_CASTER for (uint8 i = 0;i < MAX_SPELL_EFFECTS; ++i) { - if ((effMask & (1 << i)) && (only_on_dummy == (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_DUMMY))) + if ((effMask & (1 << i)) && (!only_on_caster || (m_spellInfo->Effects[i].TargetA.GetTarget() == TARGET_UNIT_CASTER))) return true; } return false; @@ -7230,9 +7229,14 @@ void Spell::PrepareTriggersExecutedOnHit() // calculate the chance using spell base amount, because aura amount is not updated on combo-points change // this possibly needs fixing int32 auraBaseAmount = (*i)->GetBaseAmount(); - int32 chance = m_caster->CalculateSpellDamage(NULL, auraSpellInfo, auraSpellIdx, &auraBaseAmount); // proc chance is stored in effect amount - m_hitTriggerSpells.push_back(std::make_pair(spellInfo, chance * (*i)->GetBase()->GetStackAmount())); + int32 chance = m_caster->CalculateSpellDamage(NULL, auraSpellInfo, auraSpellIdx, &auraBaseAmount); + // build trigger and add to the list + HitTriggerSpell spellTriggerInfo; + spellTriggerInfo.triggeredSpell = spellInfo; + spellTriggerInfo.triggeredByAura = auraSpellInfo; + spellTriggerInfo.chance = chance * (*i)->GetBase()->GetStackAmount(); + m_hitTriggerSpells.push_back(spellTriggerInfo); } } } diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index d8e9c4a4ad4..8f43b9b2290 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -633,10 +633,18 @@ class Spell void CallScriptAfterUnitTargetSelectHandlers(std::list& unitTargets, SpellEffIndex effIndex); std::list m_loadedScripts; - bool CanExecuteTriggersOnHit(uint8 effMask, SpellInfo const* spellInfo = NULL) const; + struct HitTriggerSpell + { + SpellInfo const* triggeredSpell; + SpellInfo const* triggeredByAura; + // uint8 triggeredByEffIdx This might be needed at a later stage - No need known for now + int32 chance; + }; + + bool CanExecuteTriggersOnHit(uint8 effMask, SpellInfo const* triggeredByAura = NULL) const; void PrepareTriggersExecutedOnHit(); - typedef std::list< std::pair > HitTriggerSpells; - HitTriggerSpells m_hitTriggerSpells; + typedef std::list HitTriggerSpellList; + HitTriggerSpellList m_hitTriggerSpells; // effect helpers void SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* properties, uint32 numSummons); From b5dc7bc45b658bc0f5627628337992c944224345 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 5 Apr 2012 22:13:20 +0200 Subject: [PATCH 0429/1149] Core/SmartScript: Fixed crashes with stored target lists Closes #5786 --- src/server/game/AI/SmartScripts/SmartScript.cpp | 11 +++++++++-- src/server/game/Entities/Creature/Creature.h | 1 - 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 83b37023211..209eb38e13a 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1865,19 +1865,26 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (!targets) break; + ObjectList* storedTargets = GetTargetList(e.action.sendTargetToTarget.id); + if (!storedTargets) + { + delete targets; + return; + } + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { if (IsCreature(*itr)) { if (SmartAI* ai = CAST_AI(SmartAI, (*itr)->ToCreature()->AI())) - ai->GetScript()->StoreTargetList(GetTargetList(e.action.sendTargetToTarget.id), e.action.sendTargetToTarget.id); + ai->GetScript()->StoreTargetList(new ObjectList(*storedTargets), e.action.sendTargetToTarget.id); // store a copy of target list else sLog->outErrorDb("SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartAI, skipping"); } else if (IsGameObject(*itr)) { if (SmartGameObjectAI* ai = CAST_AI(SmartGameObjectAI, (*itr)->ToGameObject()->AI())) - ai->GetScript()->StoreTargetList(GetTargetList(e.action.sendTargetToTarget.id), e.action.sendTargetToTarget.id); + ai->GetScript()->StoreTargetList(new ObjectList(*storedTargets), e.action.sendTargetToTarget.id); // store a copy of target list else sLog->outErrorDb("SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartGameObjectAI, skipping"); } diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index f100d391698..4b5b07fd8a5 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -266,7 +266,6 @@ struct CreatureData // `creature_addon` table struct CreatureAddon { - uint32 guidOrEntry; uint32 path_id; uint32 mount; uint32 bytes1; From 7e793575be1748e244382225b23731de8b771e00 Mon Sep 17 00:00:00 2001 From: cookta2012 Date: Thu, 5 Apr 2012 17:43:06 -0500 Subject: [PATCH 0430/1149] Moving a commands around eliminating a unnecessary file, and porting the "demorph" command * moved the "wpgps" command into the cs_debug.cpp because it seems more fitting * organized the "modify speed" commands into a table of their own * moved the "gps" command into the cs_misc.cpp --- .../world/2012_04_04_00_world_command.sql | 10 ++ src/server/game/Chat/Chat.cpp | 1 - src/server/game/Chat/Commands/Level2.cpp | 16 -- src/server/game/Scripting/ScriptLoader.cpp | 2 - src/server/scripts/Commands/CMakeLists.txt | 1 - src/server/scripts/Commands/cs_debug.cpp | 11 ++ src/server/scripts/Commands/cs_gps.cpp | 144 ------------------ src/server/scripts/Commands/cs_misc.cpp | 90 ++++++++++- src/server/scripts/Commands/cs_modify.cpp | 40 +++-- 9 files changed, 141 insertions(+), 174 deletions(-) create mode 100644 sql/updates/world/2012_04_04_00_world_command.sql delete mode 100644 src/server/scripts/Commands/cs_gps.cpp diff --git a/sql/updates/world/2012_04_04_00_world_command.sql b/sql/updates/world/2012_04_04_00_world_command.sql new file mode 100644 index 00000000000..9adb3cff1d9 --- /dev/null +++ b/sql/updates/world/2012_04_04_00_world_command.sql @@ -0,0 +1,10 @@ +DELETE FROM `command` WHERE `name` IN ('modify tp','modify bwalk','modify swim','modify fly','modify arena','modify aspeed','modify morph'); +INSERT INTO `command` (`name`, `security`, `help`) VALUES ('modify speed all', 1, 'Syntax: .modify aspeed #rate\r\n\r\nModify all speeds -run,swim,run back,swim back- of the selected player to "normalbase speed for this move type"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 50.'), +('modify speed backwalk', 1, 'Syntax: .modify speed backwalk #rate\r\n\r\nModify the speed of the selected player while running backwards to "normal walk back speed"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 50.'), +('modify speed fly', 1, '.modify speed fly #rate\nModify the flying speed of the selected player to "normal flying speed"*rate. If no player is selected, modify your speed.\n #rate may range from 0.1 to 50.'), +('modify speed swim', 1, 'Syntax: .modify speed swim #rate\r\n\r\nModify the swim speed of the selected player to "normal swim speed"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 50.'), +('modify speed walk', 1, 'Syntax: .modify speed bwalk #rate\r\n\r\nModify the speed of the selected player while running to "normal walk speed"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 50.'), +('modify talentpoints', 1, 'Syntax: .modify talentpoints #amount\r\n\r\nSet free talent points for selected character or character\'s pet. It will be reset to default expected at next levelup/login/quest reward.'), +('morph', 2, 'Syntax: .morph #displayid\r\n\r\nChange your current model id to #displayid.'), +('modify arenapoints', 1, 'Syntax: .modify arenapoints #value\r\nAdd $amount arena points to the selected player.'); +UPDATE `command` SET `help`='Syntax: .modify speed $speedtype #rate\r\n\r\nModify the running speed of the selected player to "normal base run speed"= 1. If no player is selected, modify your speed.\r\n\r\n$speedtypes may be fly, all, walk, backwalk, or swim.\r\n\r\n #rate may range from 0.1 to 50.' WHERE `name`='modify speed' LIMIT 1; \ No newline at end of file diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 7a4c17d1c5e..48bb4c27ef8 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -359,7 +359,6 @@ ChatCommand* ChatHandler::getCommandTable() { "summon", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleSummonCommand>, "", NULL }, { "groupsummon", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleGroupSummonCommand>, "", NULL }, { "commands", SEC_PLAYER, true, OldHandler<&ChatHandler::HandleCommandsCommand>, "", NULL }, - { "demorph", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleDeMorphCommand>, "", NULL }, { "die", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleDieCommand>, "", NULL }, { "revive", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleReviveCommand>, "", NULL }, { "dismount", SEC_PLAYER, false, OldHandler<&ChatHandler::HandleDismountCommand>, "", NULL }, diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index cc638193b5a..52bdcd15163 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -205,22 +205,6 @@ bool ChatHandler::HandleItemMoveCommand(const char* args) return true; } -//demorph player or unit -bool ChatHandler::HandleDeMorphCommand(const char* /*args*/) -{ - Unit* target = getSelectedUnit(); - if (!target) - target = m_session->GetPlayer(); - - // check online security - else if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0)) - return false; - - target->DeMorph(); - - return true; -} - //kick player bool ChatHandler::HandleKickPlayerCommand(const char *args) { diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 76c3f1c073c..8e95f1a05cd 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -61,7 +61,6 @@ void AddSC_reload_commandscript(); void AddSC_tele_commandscript(); void AddSC_titles_commandscript(); void AddSC_wp_commandscript(); -void AddSC_gps_commandscript(); #ifdef SCRIPTS //world @@ -663,7 +662,6 @@ void AddCommandScripts() AddSC_tele_commandscript(); AddSC_titles_commandscript(); AddSC_wp_commandscript(); - AddSC_gps_commandscript(); } void AddWorldScripts() diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index d14e71aac4a..86fe984e197 100644 --- a/src/server/scripts/Commands/CMakeLists.txt +++ b/src/server/scripts/Commands/CMakeLists.txt @@ -17,7 +17,6 @@ set(scripts_STAT_SRCS Commands/cs_gm.cpp Commands/cs_go.cpp Commands/cs_gobject.cpp - Commands/cs_gps.cpp Commands/cs_honor.cpp Commands/cs_learn.cpp Commands/cs_misc.cpp diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 679bb450800..c7bcde01e9b 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -95,6 +95,7 @@ public: static ChatCommand commandTable[] = { { "debug", SEC_MODERATOR, true, NULL, "", debugCommandTable }, + { "wpgps", SEC_ADMINISTRATOR, false, &HandleWPGPSCommand, "", NULL }, { NULL, SEC_PLAYER, false, NULL, "", NULL } }; return commandTable; @@ -1319,6 +1320,16 @@ public: return true; } + + static bool HandleWPGPSCommand(ChatHandler* handler, char const* /*args*/) + { + Player* player = handler->GetSession()->GetPlayer(); + + sLog->outSQLDev("(@PATH, XX, %.3f, %.3f, %.5f, 0,0, 0,100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()); + + handler->PSendSysMessage("Waypoint SQL written to SQL Developer log"); + return true; + } }; void AddSC_debug_commandscript() diff --git a/src/server/scripts/Commands/cs_gps.cpp b/src/server/scripts/Commands/cs_gps.cpp deleted file mode 100644 index 59e2ec90905..00000000000 --- a/src/server/scripts/Commands/cs_gps.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -Name: gps_commandscript -%Complete: 100 -Comment: GPS/WPGPS commands -Category: commandscripts -EndScriptData */ - -#include "ObjectAccessor.h" -#include "ScriptMgr.h" -#include "Chat.h" -#include "CellImpl.h" - -class gps_commandscript : public CommandScript -{ -public: - gps_commandscript() : CommandScript("gps_commandscript") { } - - ChatCommand* GetCommands() const - { - static ChatCommand commandTable[] = - { - { "gps", SEC_ADMINISTRATOR, false, &HandleGPSCommand, "", NULL }, - { "wpgps", SEC_ADMINISTRATOR, false, &HandleWPGPSCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - return commandTable; - } - - static bool HandleGPSCommand(ChatHandler* handler, char const* args) - { - WorldObject* object = NULL; - if (*args) - { - uint64 guid = handler->extractGuidFromLink((char*)args); - if (guid) - object = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT); - - if (!object) - { - handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); - handler->SetSentErrorMessage(true); - return false; - } - } - else - { - object = handler->getSelectedUnit(); - - if (!object) - { - handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - handler->SetSentErrorMessage(true); - return false; - } - } - - CellCoord cellCoord = Trinity::ComputeCellCoord(object->GetPositionX(), object->GetPositionY()); - Cell cell(cellCoord); - - uint32 zoneId, areaId; - object->GetZoneAndAreaId(zoneId, areaId); - - MapEntry const* mapEntry = sMapStore.LookupEntry(object->GetMapId()); - AreaTableEntry const* zoneEntry = GetAreaEntryByAreaID(zoneId); - AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(areaId); - - float zoneX = object->GetPositionX(); - float zoneY = object->GetPositionY(); - - Map2ZoneCoordinates(zoneX, zoneY, zoneId); - - Map const* map = object->GetMap(); - float groundZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT); - float floorZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), object->GetPositionZ()); - - GridCoord gridCoord = Trinity::ComputeGridCoord(object->GetPositionX(), object->GetPositionY()); - - // 63? WHY? - int gridX = 63 - gridCoord.x_coord; - int gridY = 63 - gridCoord.y_coord; - - uint32 haveMap = Map::ExistMap(object->GetMapId(), gridX, gridY) ? 1 : 0; - uint32 haveVMap = Map::ExistVMap(object->GetMapId(), gridX, gridY) ? 1 : 0; - - if (haveVMap) - { - if (map->IsOutdoors(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ())) - handler->PSendSysMessage("You are outdoors"); - else - handler->PSendSysMessage("You are indoors"); - } - else - handler->PSendSysMessage("no VMAP available for area info"); - - handler->PSendSysMessage(LANG_MAP_POSITION, - object->GetMapId(), (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : ""), - zoneId, (zoneEntry ? zoneEntry->area_name[handler->GetSessionDbcLocale()] : ""), - areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : ""), - object->GetPhaseMask(), - object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(), - cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(), - zoneX, zoneY, groundZ, floorZ, haveMap, haveVMap); - - LiquidData liquidStatus; - ZLiquidStatus status = map->getLiquidStatus(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), MAP_ALL_LIQUIDS, &liquidStatus); - - if (status) - handler->PSendSysMessage(LANG_LIQUID_STATUS, liquidStatus.level, liquidStatus.depth_level, liquidStatus.entry, liquidStatus.type_flags, status); - - return true; - } - - static bool HandleWPGPSCommand(ChatHandler* handler, char const* /*args*/) - { - Player* player = handler->GetSession()->GetPlayer(); - - sLog->outSQLDev("(@PATH, XX, %.3f, %.3f, %.5f, 0,0, 0,100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()); - - handler->PSendSysMessage("Waypoint SQL written to SQL Developer log"); - return true; - } -}; - -void AddSC_gps_commandscript() -{ - new gps_commandscript(); -} diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 5f0434e5c55..7c431566f52 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -17,6 +17,9 @@ #include "ScriptPCH.h" #include "Chat.h" +#include "ObjectAccessor.h" +#include "ScriptMgr.h" +#include "CellImpl.h" class misc_commandscript : public CommandScript { @@ -27,7 +30,8 @@ public: { static ChatCommand commandTable[] = { - { "dev", SEC_ADMINISTRATOR, false, &HandleDevCommand, "", NULL }, + { "dev", SEC_ADMINISTRATOR, false, &HandleDevCommand, "", NULL }, + { "gps", SEC_ADMINISTRATOR, false, &HandleGPSCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; return commandTable; @@ -64,6 +68,90 @@ public: handler->SetSentErrorMessage(true); return false; } + + static bool HandleGPSCommand(ChatHandler* handler, char const* args) + { + WorldObject* object = NULL; + if (*args) + { + uint64 guid = handler->extractGuidFromLink((char*)args); + if (guid) + object = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT); + + if (!object) + { + handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); + handler->SetSentErrorMessage(true); + return false; + } + } + else + { + object = handler->getSelectedUnit(); + + if (!object) + { + handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + } + + CellCoord cellCoord = Trinity::ComputeCellCoord(object->GetPositionX(), object->GetPositionY()); + Cell cell(cellCoord); + + uint32 zoneId, areaId; + object->GetZoneAndAreaId(zoneId, areaId); + + MapEntry const* mapEntry = sMapStore.LookupEntry(object->GetMapId()); + AreaTableEntry const* zoneEntry = GetAreaEntryByAreaID(zoneId); + AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(areaId); + + float zoneX = object->GetPositionX(); + float zoneY = object->GetPositionY(); + + Map2ZoneCoordinates(zoneX, zoneY, zoneId); + + Map const* map = object->GetMap(); + float groundZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT); + float floorZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), object->GetPositionZ()); + + GridCoord gridCoord = Trinity::ComputeGridCoord(object->GetPositionX(), object->GetPositionY()); + + // 63? WHY? + int gridX = 63 - gridCoord.x_coord; + int gridY = 63 - gridCoord.y_coord; + + uint32 haveMap = Map::ExistMap(object->GetMapId(), gridX, gridY) ? 1 : 0; + uint32 haveVMap = Map::ExistVMap(object->GetMapId(), gridX, gridY) ? 1 : 0; + + if (haveVMap) + { + if (map->IsOutdoors(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ())) + handler->PSendSysMessage("You are outdoors"); + else + handler->PSendSysMessage("You are indoors"); + } + else + handler->PSendSysMessage("no VMAP available for area info"); + + handler->PSendSysMessage(LANG_MAP_POSITION, + object->GetMapId(), (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : ""), + zoneId, (zoneEntry ? zoneEntry->area_name[handler->GetSessionDbcLocale()] : ""), + areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : ""), + object->GetPhaseMask(), + object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(), + cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(), + zoneX, zoneY, groundZ, floorZ, haveMap, haveVMap); + + LiquidData liquidStatus; + ZLiquidStatus status = map->getLiquidStatus(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), MAP_ALL_LIQUIDS, &liquidStatus); + + if (status) + handler->PSendSysMessage(LANG_LIQUID_STATUS, liquidStatus.level, liquidStatus.depth_level, liquidStatus.entry, liquidStatus.type_flags, status); + + return true; + } }; void AddSC_misc_commandscript() diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 32ee96dacfe..f62c434e2e5 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -33,6 +33,16 @@ public: ChatCommand* GetCommands() const { + static ChatCommand modifyspeedCommandTable[] = + { + { "fly", SEC_MODERATOR, false, &HandleModifyFlyCommand, "", NULL }, + { "all", SEC_MODERATOR, false, &HandleModifyASpeedCommand, "", NULL }, + { "walk", SEC_MODERATOR, false, &HandleModifySpeedCommand, "", NULL }, + { "backwalk", SEC_MODERATOR, false, &HandleModifyBWalkCommand, "", NULL }, + { "swim", SEC_MODERATOR, false, &HandleModifySwimCommand, "", NULL }, + { "", SEC_MODERATOR, false, &HandleModifyASpeedCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; static ChatCommand modifyCommandTable[] = { { "hp", SEC_MODERATOR, false, &HandleModifyHPCommand, "", NULL }, @@ -41,29 +51,26 @@ public: { "runicpower", SEC_MODERATOR, false, &HandleModifyRunicPowerCommand, "", NULL }, { "energy", SEC_MODERATOR, false, &HandleModifyEnergyCommand, "", NULL }, { "money", SEC_MODERATOR, false, &HandleModifyMoneyCommand, "", NULL }, - { "speed", SEC_MODERATOR, false, &HandleModifySpeedCommand, "", NULL }, - { "swim", SEC_MODERATOR, false, &HandleModifySwimCommand, "", NULL }, { "scale", SEC_MODERATOR, false, &HandleModifyScaleCommand, "", NULL }, { "bit", SEC_MODERATOR, false, &HandleModifyBitCommand, "", NULL }, - { "bwalk", SEC_MODERATOR, false, &HandleModifyBWalkCommand, "", NULL }, - { "fly", SEC_MODERATOR, false, &HandleModifyFlyCommand, "", NULL }, - { "aspeed", SEC_MODERATOR, false, &HandleModifyASpeedCommand, "", NULL }, { "faction", SEC_MODERATOR, false, &HandleModifyFactionCommand, "", NULL }, { "spell", SEC_MODERATOR, false, &HandleModifySpellCommand, "", NULL }, - { "tp", SEC_MODERATOR, false, &HandleModifyTalentCommand, "", NULL }, + { "talentpoints", SEC_MODERATOR, false, &HandleModifyTalentCommand, "", NULL }, { "mount", SEC_MODERATOR, false, &HandleModifyMountCommand, "", NULL }, { "honor", SEC_MODERATOR, false, &HandleModifyHonorCommand, "", NULL }, - { "rep", SEC_GAMEMASTER, false, &HandleModifyRepCommand, "", NULL }, - { "arena", SEC_MODERATOR, false, &HandleModifyArenaCommand, "", NULL }, + { "reputation", SEC_GAMEMASTER, false, &HandleModifyRepCommand, "", NULL }, + { "arenapoints", SEC_MODERATOR, false, &HandleModifyArenaCommand, "", NULL }, { "drunk", SEC_MODERATOR, false, &HandleModifyDrunkCommand, "", NULL }, { "standstate", SEC_GAMEMASTER, false, &HandleModifyStandStateCommand, "", NULL }, - { "morph", SEC_GAMEMASTER, false, &HandleModifyMorphCommand, "", NULL }, { "phase", SEC_ADMINISTRATOR, false, &HandleModifyPhaseCommand, "", NULL }, { "gender", SEC_GAMEMASTER, false, &HandleModifyGenderCommand, "", NULL }, + { "speed", SEC_MODERATOR, false, NULL, "", modifyspeedCommandTable }, { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { + { "morph", SEC_GAMEMASTER, false, &HandleModifyMorphCommand, "", NULL }, + { "demorph", SEC_GAMEMASTER, false, &HandleDeMorphCommand, "", NULL }, { "modify", SEC_MODERATOR, false, NULL, "", modifyCommandTable }, { NULL, 0, false, NULL, "", NULL } }; @@ -1374,6 +1381,21 @@ public: if (handler->needReportToTarget(target)) (ChatHandler(target)).PSendSysMessage(LANG_YOUR_GENDER_CHANGED, gender_full, handler->GetNameLink().c_str()); + return true; + } +//demorph player or unit + static bool HandleDeMorphCommand(ChatHandler* handler, const char* /*args*/) + { + Unit* target = handler->getSelectedUnit(); + if (!target) + target = handler->GetSession()->GetPlayer(); + + // check online security + else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), 0)) + return false; + + target->DeMorph(); + return true; } }; From 74565045f20a5b23291f3bc87ab889e9d53a7b44 Mon Sep 17 00:00:00 2001 From: Jildor Date: Fri, 6 Apr 2012 11:48:29 +0200 Subject: [PATCH 0431/1149] Core/Spells: Fix Rabbit Costume and Noblegarden Bunny --- src/server/game/Spells/SpellInfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index b95ee766f38..07ab71207f1 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -2177,12 +2177,12 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const switch (Id) { case 34700: // Allergic Reaction - case 61716: // Rabbit Costume - case 61734: // Noblegarden Bunny case 61987: // Avenging Wrath Marker case 61988: // Divine Shield exclude aura case 62532: // Conservator's Grip return false; + case 61716: // Rabbit Costume + case 61734: // Noblegarden Bunny case 30877: // Tag Murloc case 62344: // Fists of Stone return true; From e2cfef4a1abe9cdfee889cb75ed0685870980249 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 6 Apr 2012 16:00:05 +0100 Subject: [PATCH 0432/1149] DB/Spells: Fix DK T7 4p bonus for Death Strike Closes #6059 --- sql/updates/world/2012_04_06_00_world_spell_proc_event.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2012_04_06_00_world_spell_proc_event.sql diff --git a/sql/updates/world/2012_04_06_00_world_spell_proc_event.sql b/sql/updates/world/2012_04_06_00_world_spell_proc_event.sql new file mode 100644 index 00000000000..0fba3bb46d6 --- /dev/null +++ b/sql/updates/world/2012_04_06_00_world_spell_proc_event.sql @@ -0,0 +1 @@ +UPDATE `spell_proc_event` SET `SpellFamilyMask0`=0x10 WHERE `entry`=60132; -- Oblit/Scourge Strike Runic Power Up (T7 4s) From b843688fa8326579427381b9ee15f2b42d49f42e Mon Sep 17 00:00:00 2001 From: MrSmite Date: Thu, 5 Apr 2012 20:32:02 -0400 Subject: [PATCH 0433/1149] PeAI update * Better handle target selection for defensive pets. Adds triggers for when owner is damaged or begins attacking something. * Defensive pets no longer run off as soon as a mob aggros the owner but rather at first damage to owner or owner first attack * Pets on stay will continue to attack unless target unreachable --- src/server/game/AI/CoreAI/PetAI.cpp | 61 ++++++++++++++++++++++--- src/server/game/AI/CoreAI/PetAI.h | 2 + src/server/game/AI/CreatureAI.h | 6 +++ src/server/game/Entities/Unit/Unit.cpp | 19 ++++++++ src/server/game/Handlers/PetHandler.cpp | 2 - src/server/game/Spells/Spell.cpp | 15 +++++- 6 files changed, 95 insertions(+), 10 deletions(-) diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 295768f9d3e..bcec8d273b9 100755 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -109,17 +109,25 @@ void PetAI::UpdateAI(const uint32 diff) } else if (owner && me->GetCharmInfo()) //no victim { - Unit* nextTarget = SelectNextTarget(); + // Only aggressive pets do target search every update. + // Defensive pets do target search only in these cases: + // * Owner attacks something - handled by OwnerAttacked() + // * Owner receives damage - handled by OwnerDamagedBy() + // * Pet is in combat and current target dies - handled by KilledUnit() + if (me->HasReactState(REACT_AGGRESSIVE)) + { + Unit* nextTarget = SelectNextTarget(); - if (me->HasReactState(REACT_PASSIVE)) - _stopAttack(); - else if (nextTarget) - AttackStart(nextTarget); + if (nextTarget) + AttackStart(nextTarget); + else + HandleReturnMovement(); + } else HandleReturnMovement(); } else if (owner && !me->HasUnitState(UNIT_STATE_FOLLOW)) // no charm info and no victim - me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle()); + HandleReturnMovement(); if (!me->GetCharmInfo()) return; @@ -302,6 +310,47 @@ void PetAI::AttackStart(Unit* target) DoAttack(target, true); } +void PetAI::OwnerDamagedBy(Unit* attacker) +{ + // Called when owner takes damage. Allows defensive pets to know + // that their owner might need help + + if (!attacker) + return; + + // Passive pets don't do anything + if (me->HasReactState(REACT_PASSIVE)) + return; + + // Prevent pet from disengaging from current target + if (me->getVictim() && me->getVictim()->isAlive()) + return; + + // Continue to evaluate and attack if necessary + AttackStart(attacker); +} + +void PetAI::OwnerAttacked(Unit* target) +{ + // Called when owner attacks something. Allows defensive pets to know + // that they need to assist + + // Target might be NULL if called from spell with invalid cast targets + if (!target) + return; + + // Passive pets don't do anything + if (me->HasReactState(REACT_PASSIVE)) + return; + + // Prevent pet from disengaging from current target + if (me->getVictim() && me->getVictim()->isAlive()) + return; + + // Continue to evaluate and attack if necessary + AttackStart(target); +} + Unit* PetAI::SelectNextTarget() { // Provides next target selection after current target death diff --git a/src/server/game/AI/CoreAI/PetAI.h b/src/server/game/AI/CoreAI/PetAI.h index 730ab12a3ca..ed3e2305556 100755 --- a/src/server/game/AI/CoreAI/PetAI.h +++ b/src/server/game/AI/CoreAI/PetAI.h @@ -40,6 +40,8 @@ class PetAI : public CreatureAI void KilledUnit(Unit* /*victim*/); void AttackStart(Unit* target); void MovementInform(uint32 moveType, uint32 data); + void OwnerDamagedBy(Unit* attacker); + void OwnerAttacked(Unit* target); private: bool _isVisible(Unit*) const; diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h index 423b00291e7..94ac452b9f3 100755 --- a/src/server/game/AI/CreatureAI.h +++ b/src/server/game/AI/CreatureAI.h @@ -138,6 +138,12 @@ class CreatureAI : public UnitAI // Called at text emote receive from player virtual void ReceiveEmote(Player* /*player*/, uint32 /*emoteId*/) {} + // Called when owner takes damage + virtual void OwnerDamagedBy(Unit* /*attacker*/) {} + + // Called when owner attacks something + virtual void OwnerAttacked(Unit* /*target*/) {} + /// == Triggered Actions Requested ================== // Called when creature attack expected (if creature can and no have current victim) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index b49ce1bf075..94ef6edbeca 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -572,6 +572,15 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam if (IsAIEnabled) GetAI()->DamageDealt(victim, damage, damagetype); + // Signal to pets that their owner was attacked + if (victim->GetTypeId() == TYPEID_PLAYER) + { + Pet* pet = victim->ToPlayer()->GetPet(); + + if (pet && pet->isAlive()) + pet->AI()->OwnerDamagedBy(this); + } + if (damagetype != NODAMAGE) { // interrupting auras with AURA_INTERRUPT_FLAG_DAMAGE before checking !damage (absorbed damage breaks that type of auras) @@ -9515,6 +9524,16 @@ bool Unit::Attack(Unit* victim, bool meleeAttack) if (meleeAttack) SendMeleeAttackStart(victim); + // Let the pet know we've started attacking someting. Handles melee attacks only + // Spells such as auto-shot and others handled in WorldSession::HandleCastSpellOpcode + if (this->GetTypeId() == TYPEID_PLAYER) + { + Pet* playerPet = this->ToPlayer()->GetPet(); + + if (playerPet && playerPet->isAlive()) + playerPet->AI()->OwnerAttacked(victim); + } + return true; } diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 1fa6d9fc0ed..e54bee96b8b 100755 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -153,8 +153,6 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid switch (spellid) { case COMMAND_STAY: //flat=1792 //STAY - pet->AttackStop(); - pet->InterruptNonMeleeSpells(false); pet->StopMoving(); pet->GetMotionMaster()->Clear(false); pet->GetMotionMaster()->MoveIdle(); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 82a89e97e4b..ea4b79cf99a 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3101,11 +3101,22 @@ void Spell::cast(bool skipCheck) return; } - // now that we've done the basic check, now run the scripts - // should be done before the spell is actually executed if (Player* playerCaster = m_caster->ToPlayer()) + { + // now that we've done the basic check, now run the scripts + // should be done before the spell is actually executed sScriptMgr->OnPlayerSpellCast(playerCaster, this, skipCheck); + // Let any pets know we've attacked something. As of 3.0.2 pets begin + // attacking their owner's target immediately + if (Pet* playerPet = playerCaster->GetPet()) + { + if (playerPet->isAlive() && playerPet->isControlled() && (m_targets.GetTargetMask() & TARGET_FLAG_UNIT)) + { + playerPet->AI()->OwnerAttacked(m_targets.GetObjectTarget()->ToUnit()); + } + } + } SetExecutedCurrently(true); if (m_caster->GetTypeId() != TYPEID_PLAYER && m_targets.GetUnitTarget() && m_targets.GetUnitTarget() != m_caster) From cc03f2db361be852302a35389a58ce6888ce6bd5 Mon Sep 17 00:00:00 2001 From: MrSmite Date: Fri, 6 Apr 2012 12:33:34 -0400 Subject: [PATCH 0434/1149] Fix coding style --- src/server/game/Spells/Spell.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index ea4b79cf99a..8759cfd9acc 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3112,9 +3112,7 @@ void Spell::cast(bool skipCheck) if (Pet* playerPet = playerCaster->GetPet()) { if (playerPet->isAlive() && playerPet->isControlled() && (m_targets.GetTargetMask() & TARGET_FLAG_UNIT)) - { playerPet->AI()->OwnerAttacked(m_targets.GetObjectTarget()->ToUnit()); - } } } SetExecutedCurrently(true); From d546a531c310312bd8b5406624f9facdb2ed6b88 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 6 Apr 2012 18:49:40 +0100 Subject: [PATCH 0435/1149] Core&DB/Spells: Fix DK T8 4p bonus - Added missing spell to DB - Corrected DBC data that is, very likely, wrong Closes #6062 --- sql/updates/world/2012_04_06_01_world_spell_dbc.sql | 3 +++ src/server/game/Spells/SpellMgr.cpp | 3 +++ src/server/shared/Utilities/Util.h | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_04_06_01_world_spell_dbc.sql diff --git a/sql/updates/world/2012_04_06_01_world_spell_dbc.sql b/sql/updates/world/2012_04_06_01_world_spell_dbc.sql new file mode 100644 index 00000000000..c0dc38ebf83 --- /dev/null +++ b/sql/updates/world/2012_04_06_01_world_spell_dbc.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_dbc` WHERE `Id`=64748; -- Item - Death Knight T8 Tank 4P Bonus +INSERT INTO `spell_dbc` (`Id`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`AttributesEx6`,`AttributesEx7`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectMiscValueB1`,`EffectMiscValueB2`,`EffectMiscValueB3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`EffectSpellClassMaskA1`,`EffectSpellClassMaskA2`,`EffectSpellClassMaskA3`,`EffectSpellClassMaskB1`,`EffectSpellClassMaskB2`,`EffectSpellClassMaskB3`,`EffectSpellClassMaskC1`,`EffectSpellClassMaskC2`,`EffectSpellClassMaskC3`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`SpellFamilyFlags3`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`DmgMultiplier3`,`AreaGroupId`,`SchoolMask`,`Comment`) VALUES +(64748,1,0,384,0,0,0,0,131080,0,0,0,0,0,1,0,0,101,0,0,80,80,28,1,0,-1,0,0,6,0,0,1,0,1,'0','0','0',-11,0,-11,0,0,0,1,0,0,0,0,0,0,0,0,87,0,0,0,0,0,'0','0','0',1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16777829,0,0,0,15,0,0,0,0,0,0,'1','1','1',0,32,'Item - Death Knight T8 Tank 4P Bonus'); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 895dc9ab4b7..a7fdb04e7b7 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3238,6 +3238,9 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->EffectDieSides[0] = 0; // was 1, that should probably mean seat 0, but instead it's treated as spell 1 spellInfo->EffectBasePoints[0] = 52391; // Ride Vehicle (forces seat 0) break; + case 64745: + spellInfo->EffectBasePoints[0] = 100; // 100% chance of procc'ing, not -10% (chance calculated in PrepareTriggersExecutedOnHit) + break; case 19970: // Entangling Roots (Rank 6) -- Nature's Grasp Proc case 19971: // Entangling Roots (Rank 5) -- Nature's Grasp Proc case 19972: // Entangling Roots (Rank 4) -- Nature's Grasp Proc diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h index 4c2c1936993..4434ed36645 100755 --- a/src/server/shared/Utilities/Util.h +++ b/src/server/shared/Utilities/Util.h @@ -73,7 +73,7 @@ inline uint32 secsToTimeBitFields(time_t secs) double rand_norm(void); /* Return a random double from 0.0 to 99.9999999999999. Floats support only 7 valid decimal digits. - * A double supports up to 15 valid decimal digits and is used internaly (RAND32_MAX has 10 digits). + * A double supports up to 15 valid decimal digits and is used internally (RAND32_MAX has 10 digits). * With an FPU, there is usually no difference in performance between float and double. */ double rand_chance(void); From bc3ea0d1f6a7f9f402cbec33d203d1cdd7ca9600 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 6 Apr 2012 19:17:36 +0100 Subject: [PATCH 0436/1149] DB/GOs: Add (custom) template for spell focus GO required by spell 70477 Thanks Altair, I guess.. --- sql/updates/world/2012_04_06_02_world_gameobject_template.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2012_04_06_02_world_gameobject_template.sql diff --git a/sql/updates/world/2012_04_06_02_world_gameobject_template.sql b/sql/updates/world/2012_04_06_02_world_gameobject_template.sql new file mode 100644 index 00000000000..5089579998d --- /dev/null +++ b/sql/updates/world/2012_04_06_02_world_gameobject_template.sql @@ -0,0 +1,4 @@ +-- GO required by spell 70477 - Cleanse Quel'Delar +DELETE FROM `gameobject_template` WHERE `entry`=300246; +INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `faction`, `flags`, `size`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `data0`, `data1`, `data2`, `data3`, `data4`, `data5`, `data6`, `data7`, `data8`, `data9`, `data10`, `data11`, `data12`, `data13`, `data14`, `data15`, `data16`, `data17`, `data18`, `data19`, `data20`, `data21`, `data22`, `data23`, `AIName`, `ScriptName`, `WDBVerified`) VALUES +(300246, 8, 0, 'TEMP Sunwell', '', '', '', 0, 0, 1, 0, 0, 0, 0, 0, 0, 1641, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', '', 1); From d1f8dff47a74fce8f07e612a41c8e5b23ca74990 Mon Sep 17 00:00:00 2001 From: Vincent-Core Date: Fri, 6 Apr 2012 20:25:36 +0200 Subject: [PATCH 0437/1149] Core/Spell: Fix Elixir of Minor Fortitude --- src/server/game/Spells/SpellMgr.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index a7fdb04e7b7..55a0dcb0845 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3508,6 +3508,11 @@ void SpellMgr::LoadDbcDataCorrections() case 40166: // Introspection case 40167: // Introspection spellInfo->Attributes |= SPELL_ATTR0_NEGATIVE_1; + break; + case 2378: // Minor Fortitude + spellInfo->manaCost = 0; + spellInfo->manaPerSecond = 0; + break; default: break; } From a0744978804f7e77b61c683712bacb1cd632ed2c Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 6 Apr 2012 19:33:32 +0100 Subject: [PATCH 0438/1149] Core&DB/Spells: Fix Warr T8 4p bonus - Added missing spell to DB - Corrected DBC data that is, very likely, wrong Closes #2386 --- sql/updates/world/2012_04_06_03_world_spell_dbc.sql | 3 +++ src/server/game/Spells/SpellMgr.cpp | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_04_06_03_world_spell_dbc.sql diff --git a/sql/updates/world/2012_04_06_03_world_spell_dbc.sql b/sql/updates/world/2012_04_06_03_world_spell_dbc.sql new file mode 100644 index 00000000000..90ac4ac0f51 --- /dev/null +++ b/sql/updates/world/2012_04_06_03_world_spell_dbc.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_dbc` WHERE `Id`=64934; -- Item - Warrior T8 Protection 4P Bonus +INSERT INTO `spell_dbc`(`Id`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`AttributesEx6`,`AttributesEx7`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectMiscValueB1`,`EffectMiscValueB2`,`EffectMiscValueB3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`EffectSpellClassMaskA1`,`EffectSpellClassMaskA2`,`EffectSpellClassMaskA3`,`EffectSpellClassMaskB1`,`EffectSpellClassMaskB2`,`EffectSpellClassMaskB3`,`EffectSpellClassMaskC1`,`EffectSpellClassMaskC2`,`EffectSpellClassMaskC3`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`SpellFamilyFlags3`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`DmgMultiplier3`,`AreaGroupId`,`SchoolMask`,`Comment`) VALUES +(64934,1,0,384,0,0,0,0,131080,0,0,0,0,0,1,0,0,101,0,0,80,80,28,1,0,-1,0,0,6,0,0,1,0,1,'0','0','0',-21,0,-11,0,0,0,1,0,0,0,0,0,0,0,0,87,0,0,0,0,0,'0','0','0',126,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16777829,0,0,0,4,0,0,0,0,0,0,'1','1','1',0,32, 'Item - Warrior T8 Protection 4P Bonus'); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index a7fdb04e7b7..cd51b8f2919 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3238,7 +3238,8 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->EffectDieSides[0] = 0; // was 1, that should probably mean seat 0, but instead it's treated as spell 1 spellInfo->EffectBasePoints[0] = 52391; // Ride Vehicle (forces seat 0) break; - case 64745: + case 64745: // Item - Death Knight T8 Tank 4P Bonus + case 64936: // Item - Warrior T8 Protection 4P Bonus spellInfo->EffectBasePoints[0] = 100; // 100% chance of procc'ing, not -10% (chance calculated in PrepareTriggersExecutedOnHit) break; case 19970: // Entangling Roots (Rank 6) -- Nature's Grasp Proc From 478427e0d2766abad07b1a23693780aea445297b Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Fri, 6 Apr 2012 21:05:21 +0100 Subject: [PATCH 0439/1149] Scripts/Silithus: Few summons were being spawned at wrong locations (out of bounds array) Fixes a crash and/or console errors --- src/server/scripts/Kalimdor/silithus.cpp | 28 +++++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp index 66986ebd5ae..79c6f7172b5 100644 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ b/src/server/scripts/Kalimdor/silithus.cpp @@ -373,8 +373,13 @@ static QuestCinematic EventAnim[]= {0, 0, 0} }; +struct Location +{ + float x, y, z, o; +}; + //Cordinates for Spawns -static const Position SpawnLocation[]= +static Location SpawnLocation[]= { {-8085.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry {-8080.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry @@ -485,9 +490,9 @@ class npc_anachronos_the_ancient : public CreatureScript public: npc_anachronos_the_ancient() : CreatureScript("npc_anachronos_the_ancient") { } - CreatureAI* GetAI(Creature* c) const + CreatureAI* GetAI(Creature* creature) const { - return new npc_anachronos_the_ancientAI(c); + return new npc_anachronos_the_ancientAI(creature); } struct npc_anachronos_the_ancientAI : public ScriptedAI @@ -813,9 +818,9 @@ class mob_qiraj_war_spawn : public CreatureScript public: mob_qiraj_war_spawn() : CreatureScript("mob_qiraj_war_spawn") { } - CreatureAI* GetAI(Creature* c) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_qiraj_war_spawnAI(c); + return new mob_qiraj_war_spawnAI(creature); } struct mob_qiraj_war_spawnAI : public ScriptedAI @@ -928,9 +933,9 @@ class npc_anachronos_quest_trigger : public CreatureScript public: npc_anachronos_quest_trigger() : CreatureScript("npc_anachronos_quest_trigger") { } - CreatureAI* GetAI(Creature* c) const + CreatureAI* GetAI(Creature* creature) const { - return new npc_anachronos_quest_triggerAI(c); + return new npc_anachronos_quest_triggerAI(creature); } struct npc_anachronos_quest_triggerAI : public ScriptedAI @@ -974,7 +979,14 @@ public: //uint8 QirajiWaspCount = 0; for (uint8 i = 0; i < 67; ++i) { - if (Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, SpawnLocation[locIndex + i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, WavesInfo[WaveCount].DespTimer)) + float X = SpawnLocation[locIndex + i].x; + float Y = SpawnLocation[locIndex + i].y; + float Z = SpawnLocation[locIndex + i].z; + float O = SpawnLocation[locIndex + i].o; + uint32 desptimer = WavesInfo[WaveCount].DespTimer; + Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, X, Y, Z, O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer); + + if (spawn) { spawn->LoadCreaturesAddon(); if (spawn->GetEntry() == 15423) From 33d5e7c753f484c33f7bbc017bbfc52549a12e30 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 7 Apr 2012 01:06:56 +0200 Subject: [PATCH 0440/1149] Scripts/Icecrown Citadel: Fixed Ice Bomb visual synchronization Closes #5179 --- src/server/game/Spells/SpellMgr.cpp | 5 +- .../IcecrownCitadel/boss_sindragosa.cpp | 59 ++++++++++++------- 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 68966331b19..cf200f19010 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3410,10 +3410,7 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_CASTER; break; case 69846: // Frost Bomb - spellInfo->speed = 10; - spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_TARGET_ANY; - spellInfo->EffectImplicitTargetB[0] = TARGET_UNIT_TARGET_ANY; - spellInfo->Effect[1] = 0; + spellInfo->speed = 0.0f; // This spell's summon happens instantly break; case 71614: // Ice Lock spellInfo->Mechanic = MECHANIC_STUN; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index c88b3aa8b37..6bf94eeaed2 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -61,6 +61,7 @@ enum Spells SPELL_ASPHYXIATION = 71665, SPELL_FROST_BOMB_TRIGGER = 69846, SPELL_FROST_BOMB_VISUAL = 70022, + SPELL_BIRTH_NO_VISUAL = 40031, SPELL_FROST_BOMB = 69845, SPELL_MYSTIC_BUFFET = 70128, @@ -169,6 +170,23 @@ class FrostwyrmLandEvent : public BasicEvent Position const& _dest; }; +class FrostBombExplosion : public BasicEvent +{ + public: + FrostBombExplosion(Creature* owner, uint64 sindragosaGUID) : _owner(owner), _sindragosaGUID(sindragosaGUID) { } + + bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) + { + _owner->CastSpell((Unit*)NULL, SPELL_FROST_BOMB, true, NULL, NULL, _sindragosaGUID); + _owner->RemoveAurasDueToSpell(SPELL_FROST_BOMB_VISUAL); + return true; + } + + private: + Creature* _owner; + uint64 _sindragosaGUID; +}; + class boss_sindragosa : public CreatureScript { public: @@ -325,6 +343,12 @@ class boss_sindragosa : public CreatureScript void JustSummoned(Creature* summon) { summons.Summon(summon); + if (summon->GetEntry() == NPC_FROST_BOMB) + { + summon->CastSpell(summon, SPELL_FROST_BOMB_VISUAL, true); + summon->CastSpell(summon, SPELL_BIRTH_NO_VISUAL, true); + summon->m_Events.AddEvent(new FrostBombExplosion(summon, me->GetGUID()), summon->m_Events.CalculateTime(5500)); + } } void SummonedCreatureDespawn(Creature* summon) @@ -337,18 +361,25 @@ class boss_sindragosa : public CreatureScript void SpellHitTarget(Unit* target, SpellInfo const* spell) { if (uint32 spellId = sSpellMgr->GetSpellIdForDifficulty(70127, me)) + { if (spellId == spell->Id) + { if (Aura const* mysticBuffet = target->GetAura(spell->Id)) _mysticBuffetStack = std::max(_mysticBuffetStack, mysticBuffet->GetStackAmount()); + return; + } + } + // Frost Infusion if (Player* player = target->ToPlayer()) { if (uint32 spellId = sSpellMgr->GetSpellIdForDifficulty(_isThirdPhase ? SPELL_FROST_BREATH_P2 : SPELL_FROST_BREATH_P1, me)) { - if (player->GetQuestStatus(QUEST_FROST_INFUSION) == QUEST_STATUS_INCOMPLETE && spellId == spell->Id) + if (spellId == spell->Id) { - if (Item* shadowsEdge = player->GetWeaponForAttack(BASE_ATTACK, true)) + Item* shadowsEdge = player->GetWeaponForAttack(BASE_ATTACK, true); + if (player->GetQuestStatus(QUEST_FROST_INFUSION) == QUEST_STATUS_INCOMPLETE && shadowsEdge) { if (!player->HasAura(SPELL_FROST_IMBUED_BLADE) && shadowsEdge->GetEntry() == ITEM_SHADOW_S_EDGE) { @@ -366,15 +397,11 @@ class boss_sindragosa : public CreatureScript player->CastSpell(player, SPELL_FROST_INFUSION, true); } } + + return; } } } - - if (spell->Id == SPELL_FROST_BOMB_TRIGGER) - { - target->CastSpell(target, SPELL_FROST_BOMB, true); - target->RemoveAurasDueToSpell(SPELL_FROST_BOMB_VISUAL); - } } void UpdateAI(uint32 const diff) @@ -458,21 +485,11 @@ class boss_sindragosa : public CreatureScript case EVENT_FROST_BOMB: { float destX, destY, destZ; - destX = float(rand_norm()) * 117.25f + 4339.25f; - if (destX > 4371.5f && destX < 4432.0f) - destY = float(rand_norm()) * 111.0f + 2429.0f; - else - destY = float(rand_norm()) * 31.23f + 2454.64f; + destX = float(rand_norm()) * 75.0f + 4350.0f; + destY = float(rand_norm()) * 75.0f + 2450.0f; destZ = 205.0f; // random number close to ground, get exact in next call me->UpdateGroundPositionZ(destX, destY, destZ); - Position pos; - pos.Relocate(destX, destY, destZ, 0.0f); - if (TempSummon* summ = me->SummonCreature(NPC_FROST_BOMB, pos, TEMPSUMMON_TIMED_DESPAWN, 40000)) - { - summ->CastSpell(summ, SPELL_FROST_BOMB_VISUAL, true); - DoCast(summ, SPELL_FROST_BOMB_TRIGGER); - //me->CastSpell(destX, destY, destZ, SPELL_FROST_BOMB_TRIGGER, false); - } + me->CastSpell(destX, destY, destZ, SPELL_FROST_BOMB_TRIGGER, false); events.ScheduleEvent(EVENT_FROST_BOMB, urand(5000, 10000)); break; } From aa9c76f50ac6ba5f150e99be90d4e17f8c8c3850 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 7 Apr 2012 14:34:55 +0100 Subject: [PATCH 0441/1149] Core/PacketIO: Fix ticket creation (it was saving wrong data to DB) TODO: It might be wise to validate map and coordinates sent by the client Closes #6054 --- src/server/game/Tickets/TicketMgr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index 68e28014319..af23a3003ad 100755 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -37,7 +37,10 @@ GmTicket::GmTicket(Player* player, WorldPacket& recv_data) : _createTime(time(NU _playerName = player->GetName(); _playerGuid = player->GetGUID(); - recv_data >> _mapId; + uint32 mapId; + recv_data >> mapId; // Map is sent as UInt32! + _mapId = mapId; + recv_data >> _posX; recv_data >> _posY; recv_data >> _posZ; From 7dfebf57fc21fb41d0e70a8853d8359a42d90add Mon Sep 17 00:00:00 2001 From: Helias Date: Sat, 7 Apr 2012 15:10:04 +0100 Subject: [PATCH 0442/1149] DB/GOs: Add missing page_text data Data from UDB Closes #6074 --- .../world/2012_04_06_04_world_page_text.sql | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sql/updates/world/2012_04_06_04_world_page_text.sql diff --git a/sql/updates/world/2012_04_06_04_world_page_text.sql b/sql/updates/world/2012_04_06_04_world_page_text.sql new file mode 100644 index 00000000000..97c0d9afe2d --- /dev/null +++ b/sql/updates/world/2012_04_06_04_world_page_text.sql @@ -0,0 +1,25 @@ +DELETE FROM `page_text` WHERE entry IN (2177,2295,2296,2297,2301,2302,2303,2308,2309,3036,3045,3046,3047,3049,3050,3051,3052,3053,3378,3544,3563,3564,3565); +INSERT INTO `page_text` (`entry`, `text`, `next_page`) VALUES +(2177, 'Valea Twinblades \nWarrior of the Scarlet Crusade\nCitizen of Alterac \nLast seen deep in the Eastern Plaguelands', 0), +(2295, 'Before the Age of Memory, the gentle Earthmother breathed upon the golden mists of dawn. Where the amber clouds came to rest, there were endless fields of flowing wheat and barley. This was the basin of her works - the great basket of life and hope.', 2296), +(2296, 'The Earthmother\'s eyes shone down upon the lands she had breathed into creation. Her right eye, An\'she (the sun), gave warmth and light to the land. Her left eye, Mu\'sha (the moon), gave peace and sleep to the stirring creatures of the dawning. Such was the power of her gaze that the Earthmother closed one dreaming eye for every turning of the sky. Thus, her loving gaze turned day into night for the first dawning of the world. $B', 2297), +(2297, 'While the right eye shone down upon the golden dawn, the Earthmother\'s gentle hands spread out across the golden plains. Wherever the shadow of her arms passed, a noble people arose from the rich soil. The Shu\'halo (the tauren) arose to give thanks and prayer to their loving mother. There, in the endless fields of dawn, the children of the earth swore themselves to her grace and vowed to bless her name until the final darkening of the world.', 0), +(2301, 'Into the brave hearts of her pure children, the Earthmother placed the love of the hunt. For the creatures of the first dawn were savage and fierce. They hid from the Earthmother, finding solace in the shadows and the wild places of the land. The Shu\'halo hunted these beasts wherever they could be found and tamed them with the Earthmother\'s blessing. ', 2302), +(2302, 'One great spirit eluded them, however. Apa\'ro (known as Malorne to the night elves), was a proud stag of snow white fur. His antlers scraped the roof of the heavens and his mighty hooves stamped out the deep places of the world. The Shu\'halo hunted Apa\'ro to the corners of the dawning world - and closed in to snare the proud stag.', 2303), +(2303, 'Seeking to escape, the great stag leapt into the sky. Yet, as his escape seemed assured, his mighty antlers tangled in the stars which held him fast. Though he kicked and struggled, Apa\'ro could not loose himself from the heavens. It was then that Mu\'sha found him as she chased her brother, An\'she, towards the dawn. Mu\'sha saw the mighty stag as he struggled and fell in love with him immediately. ', 2304), +(2308, 'As the mists of dawn faded and the Age of Memory advanced, the demigod, Cenarius, went his own way through the fields of the world. The Shu\'halo (tauren) were sorrowful at his passing and forgot much of the druidism he had taught them. As the generations passed, they forgot how to speak with the trees and the wild things of the land. The dark whispers from the deeps of the world drifted up to their ears once again.', 2309), +(2309, 'Though the children of the earth closed out the evil whisperings, a terrible curse befell their roaming tribes. Out of the black lands of the west came a horde of murderous creatures - the centaur. Cannibals and ravagers, the centaur fell upon the Shu\'halo like a plague. Though the braves and hunters fought with the Earthmother\'s blessing in their hearts, the centaur could not be defeated.', 2310), +(3544, 'You have found the wreckage of a mysterious object. Beyond the flames, you are able to make out an insignia marked "M:1815212085". You wonder what world this object must be from...', 0), +(3378, 'INVINCIBLE$B$BBeloved steed of Prince Arthas Menethil$B$BLoyal and great of heart in life, may you find peace in death.$B$BPure streams and green pastures, devoted friend.', 0), +(3565, 'Gritting his teeth, Marcus gestured as light flashed over him, restoring his strength.$B$BTavi stared anxiously as he rose to his full height, engulfing her in his shadow. He thrust his hand forward, sending a wave of righteous force through her. Eyes rolled back as she wavered for several seconds before regaining consciousness.$B$B"I\'ve recently taken the path of... retribution."$B$BThe mischievous smirk returned to her face, "Well then, this is going to be fun."$B$B', 0), +(3564, 'Marcus took both her hands in one of his as he reassured her, "It\'s fine. What is your specialization?"$B$BHer head snapped up, eyes burning with renewed life as shadowy energy channeled through her hands into Marcus, dropping him to his knees in agony.$B$B"Affliction, actually."$B', 3565), +(3563, '"Interested in some more company?" she purred as her hands weaved through a complex summoning ritual, stopping only when she felt the warmth of a new presence behind her.$B$BAll color drained from Marcus\'s face as he struggled to protest. "I... I don\'t think that\'s appropriate."$B$BConfused, Tavi turned to see what was wrong. A hideous fel hound stood ready, drooling onto the floor as it stared intently at the half-armored paladin.$B$B"No! No that\'s not what I meant." she stammered as she dispelled the hungry demon. "I\'m sorry, that\'s not really my specialization...."', 3564), +(3045, 'First Watch, Eight Bells$BWatches changed. All is well.', 3046), +(3046, 'Middle Watch, One Bell$BCedric found attempting to break into Captain\'s wine cabinet. Disciplined.', 3047), +(3047, 'Middle Watch, Two Bells$BCedric climbed rigging, became tangled and fell. Attended by ship\'s surgeon. Sent below to sober up.', 3049), +(3049, 'Middle Watch, Four Bells$BBottle of rum found in Cedric\'s pants. Disciplined.', 3050), +(3050, 'Middle Watch, Five Bells$BCedric\'s clothes found. Cedric found separately. Cedric disciplined.', 3051), +(3051, 'Middle Watch, Six Bells$BCedric singing loudly. Woke Captain. Cedric disciplined by Captain.', 3052), +(3052, 'Middle Watch, Eight Bells$BWatches changed. All quiet. Two men sent to locate Cedric.$B', 3053), +(3053, 'Morning Watch, One Bell$BFire in Captain\'s quarters. All hands roused. Throwing powder overboard. ', 0), +(3036, 'The mighty creature\'s maw opened wide, tossing bolts of icy water toward our vessel. Those terrible jaws clamped down upon the bow of our ship, tearing it from the hull. Sailors and cargo were thrown violently into the sea as the remnants of the ship disappeared beneath the waves.$B$BThe last thing I remember was flying from the broken hull, hitting the inky waters, and plunging beneath the waves. The world went dark and I thought for certain I\'d drawn my last breath. When I awoke in Theramore\'s infirmary, I knew someone had to tell our story.', 0); From c2c8b62282efda6f1732ed1aff4e75e273fba635 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 7 Apr 2012 17:00:05 +0200 Subject: [PATCH 0443/1149] DB/Spawns: Added missing gameobject at Majordomo Executus area (damage on pile of coal) --- sql/updates/world/2012_04_07_00_world_gameobject.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/2012_04_07_00_world_gameobject.sql diff --git a/sql/updates/world/2012_04_07_00_world_gameobject.sql b/sql/updates/world/2012_04_07_00_world_gameobject.sql new file mode 100644 index 00000000000..c63fc753d32 --- /dev/null +++ b/sql/updates/world/2012_04_07_00_world_gameobject.sql @@ -0,0 +1,5 @@ +UPDATE `gameobject_template` SET `faction`=54 WHERE `entry`=178164; +SET @GUID := 247; +DELETE FROM `gameobject` WHERE `guid`=@GUID; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(@GUID,178164,409,1,1,736.6528,-1176.32,-118.0967,-0.6806787,0,0,0,1,120,255,1); -- Hot Coal, damage From ae0a6cde2107ed9f01db1f3e6f198c57c7595d02 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 7 Apr 2012 17:27:40 +0200 Subject: [PATCH 0444/1149] Core/DBLayer: More type fixes. --- src/server/game/Chat/Commands/Level3.cpp | 6 +++--- src/server/scripts/Commands/cs_tele.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index d3417705867..54a9edefc03 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -441,7 +441,7 @@ bool ChatHandler::HandleListItemCommand(const char *args) Field* fields = result->Fetch(); uint32 item_guid = fields[0].GetUInt32(); uint32 item_bag = fields[1].GetUInt32(); - uint32 item_slot = fields[2].GetUInt32(); + uint8 item_slot = fields[2].GetUInt8(); uint32 owner_guid = fields[3].GetUInt32(); uint32 owner_acc = fields[4].GetUInt32(); std::string owner_name = fields[5].GetString(); @@ -638,7 +638,7 @@ bool ChatHandler::HandleListObjectCommand(const char *args) uint32 obj_count = 0; result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM gameobject WHERE id='%u'", go_id); if (result) - obj_count = (*result)[0].GetUInt32(); + obj_count = (*result)[0].GetUInt64(); if (m_session) { @@ -710,7 +710,7 @@ bool ChatHandler::HandleListCreatureCommand(const char *args) uint32 cr_count = 0; result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM creature WHERE id='%u'", cr_id); if (result) - cr_count = (*result)[0].GetUInt32(); + cr_count = (*result)[0].GetUInt64(); if (m_session) { diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp index 89646c23ea0..ca7c3af7fde 100644 --- a/src/server/scripts/Commands/cs_tele.cpp +++ b/src/server/scripts/Commands/cs_tele.cpp @@ -138,8 +138,8 @@ public: if (resultDB) { Field* fieldsDB = resultDB->Fetch(); - uint32 mapId = fieldsDB[0].GetUInt32(); - uint32 zoneId = fieldsDB[1].GetUInt32(); + uint32 mapId = fieldsDB[0].GetUInt16(); + uint32 zoneId = fieldsDB[1].GetUInt16(); float posX = fieldsDB[2].GetFloat(); float posY = fieldsDB[3].GetFloat(); float posZ = fieldsDB[4].GetFloat(); From ba3f25c1435eb763a7eca37d17dcfe9c4d8447e7 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 7 Apr 2012 11:59:01 -0500 Subject: [PATCH 0445/1149] Core/Scripting: Allow the use of WorldMapScript for maps that are not continents (aka, all maps) Closes #171 Signed-off-by: Subv --- src/server/game/DataStores/DBCStructure.h | 1 + src/server/game/Scripting/ScriptMgr.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 38e8c957681..15792fd57da 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1292,6 +1292,7 @@ struct MapEntry bool IsBattleground() const { return map_type == MAP_BATTLEGROUND; } bool IsBattleArena() const { return map_type == MAP_ARENA; } bool IsBattlegroundOrArena() const { return map_type == MAP_BATTLEGROUND || map_type == MAP_ARENA; } + bool IsWorldMap() const { return map_type == MAP_COMMON; } bool GetEntrancePos(int32 &mapid, float &x, float &y) const { diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 012910210a5..aac615180c8 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -582,7 +582,7 @@ void ScriptMgr::OnCreateMap(Map* map) { ASSERT(map); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnCreate(map); SCR_MAP_END; @@ -599,7 +599,7 @@ void ScriptMgr::OnDestroyMap(Map* map) { ASSERT(map); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnDestroy(map); SCR_MAP_END; @@ -617,7 +617,7 @@ void ScriptMgr::OnLoadGridMap(Map* map, GridMap* gmap, uint32 gx, uint32 gy) ASSERT(map); ASSERT(gmap); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnLoadGridMap(map, gmap, gx, gy); SCR_MAP_END; @@ -635,7 +635,7 @@ void ScriptMgr::OnUnloadGridMap(Map* map, GridMap* gmap, uint32 gx, uint32 gy) ASSERT(map); ASSERT(gmap); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnUnloadGridMap(map, gmap, gx, gy); SCR_MAP_END; @@ -653,7 +653,7 @@ void ScriptMgr::OnPlayerEnterMap(Map* map, Player* player) ASSERT(map); ASSERT(player); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnPlayerEnter(map, player); SCR_MAP_END; @@ -671,7 +671,7 @@ void ScriptMgr::OnPlayerLeaveMap(Map* map, Player* player) ASSERT(map); ASSERT(player); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnPlayerLeave(map, player); SCR_MAP_END; @@ -688,7 +688,7 @@ void ScriptMgr::OnMapUpdate(Map* map, uint32 diff) { ASSERT(map); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnUpdate(map, diff); SCR_MAP_END; @@ -1415,7 +1415,7 @@ FormulaScript::FormulaScript(const char* name) WorldMapScript::WorldMapScript(const char* name, uint32 mapId) : ScriptObject(name), MapScript(mapId) { - if (GetEntry() && !GetEntry()->IsContinent()) + if (GetEntry() && !GetEntry()->IsWorldMap()) sLog->outError("WorldMapScript for map %u is invalid.", mapId); ScriptRegistry::AddScript(this); From 3d83f663f659ddf1d6894391dcfe50d4803a987f Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 7 Apr 2012 19:12:14 +0100 Subject: [PATCH 0446/1149] Core/Tickets: Add report time and current latency to lag_reports table It's a tiny bit more useful now. --- sql/updates/characters/2012_04_07_00_characters_lag_reports.sql | 2 ++ src/server/game/Handlers/TicketHandler.cpp | 2 ++ src/server/shared/Database/Implementation/CharacterDatabase.cpp | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 sql/updates/characters/2012_04_07_00_characters_lag_reports.sql diff --git a/sql/updates/characters/2012_04_07_00_characters_lag_reports.sql b/sql/updates/characters/2012_04_07_00_characters_lag_reports.sql new file mode 100644 index 00000000000..151ace1c976 --- /dev/null +++ b/sql/updates/characters/2012_04_07_00_characters_lag_reports.sql @@ -0,0 +1,2 @@ +ALTER TABLE `lag_reports` ADD `latency` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `lag_reports` ADD `createTime` int(10) unsigned NOT NULL DEFAULT '0'; diff --git a/src/server/game/Handlers/TicketHandler.cpp b/src/server/game/Handlers/TicketHandler.cpp index 9c4eba67426..d6675188f6e 100755 --- a/src/server/game/Handlers/TicketHandler.cpp +++ b/src/server/game/Handlers/TicketHandler.cpp @@ -176,6 +176,8 @@ void WorldSession::HandleReportLag(WorldPacket& recv_data) stmt->setFloat (3, x); stmt->setFloat (4, y); stmt->setFloat (5, z); + stmt->setUInt32(6, GetLatency()); + stmt->setUInt32(7, time(NULL)); CharacterDatabase.Execute(stmt); } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 97207410159..a267a8b9d6d 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -335,7 +335,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() // GM Survey/subsurvey/lag report PREPARE_STATEMENT(CHAR_INS_GM_SURVEY, "INSERT INTO gm_surveys (guid, surveyId, mainSurvey, overallComment, createTime) VALUES (?, ?, ?, ?, UNIX_TIMESTAMP(NOW()))", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_INS_GM_SUBSURVEY, "INSERT INTO gm_subsurveys (surveyId, subsurveyId, rank, comment) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_INS_LAG_REPORT, "INSERT INTO lag_reports (guid, lagType, mapId, posX, posY, posZ) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_INS_LAG_REPORT, "INSERT INTO lag_reports (guid, lagType, mapId, posX, posY, posZ, latency, createTime) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) // For loading and deleting expired auctions at startup PREPARE_STATEMENT(CHAR_SEL_EXPIRED_AUCTIONS, "SELECT id, auctioneerguid, itemguid, itemEntry, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE ah.time <= ?", CONNECTION_SYNCH) From e94a5dd16fe36cb4e55cac63bd8b901d23ae920e Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 7 Apr 2012 13:30:33 -0500 Subject: [PATCH 0447/1149] Core/Visibility: Pets should be always visible for group mates. Patch by zarocks Closes #55 --- src/server/game/Entities/Unit/Unit.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 94ef6edbeca..431fc39d55b 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12506,6 +12506,12 @@ bool Unit::IsAlwaysVisibleFor(WorldObject const* seer) const if (seer->GetGUID() == guid) return true; + if (Player const* seerPlayer = seer->ToPlayer()) + if (Unit* owner = GetOwner()) + if (Player* ownerPlayer = owner->ToPlayer()) + if (ownerPlayer->IsGroupVisibleFor(seerPlayer)) + return true; + return false; } From 59493a7f713cbe5b40aee3766a34e1a786470941 Mon Sep 17 00:00:00 2001 From: Vincent-Core Date: Sat, 7 Apr 2012 21:08:17 +0200 Subject: [PATCH 0448/1149] Db/GameEvent: Fix start_time for Noblegarden and Children's Week --- sql/updates/world/2012_04_07_01_world_game_event.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_04_07_01_world_game_event.sql diff --git a/sql/updates/world/2012_04_07_01_world_game_event.sql b/sql/updates/world/2012_04_07_01_world_game_event.sql new file mode 100644 index 00000000000..7b74a90b49d --- /dev/null +++ b/sql/updates/world/2012_04_07_01_world_game_event.sql @@ -0,0 +1,2 @@ +UPDATE `game_event` SET `start_time` = '2012-04-08 00:01:00' WHERE `eventEntry` =9; -- Noblegarden +UPDATE `game_event` SET `start_time` = '2012-04-29 00:01:00' WHERE `eventEntry` =10; -- Children's Week From cb30a067569053cff9b7b665629a487333f0be44 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 7 Apr 2012 21:38:33 +0200 Subject: [PATCH 0449/1149] Scripts/Pit of Saron: Geist Ambusher should only jump once, on entering combat --- .../Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp index a91951ca25e..70d72e52e67 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp @@ -240,12 +240,13 @@ class mob_geist_ambusher : public CreatureScript _leapingFaceMaulCooldown = 9000; } - void MoveInLineOfSight(Unit* who) + void EnterCombat(Unit* who) { if (who->GetTypeId() != TYPEID_PLAYER) return; - if (me->IsWithinDistInMap(who, 30.0f)) + // the max range is determined by aggro range + if (me->GetDistance(who) > 5.0f) DoCast(who, SPELL_LEAPING_FACE_MAUL); } From 5fb2ffa6252b7551bc114ffd72f6cc40b13ca930 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 7 Apr 2012 21:09:31 +0100 Subject: [PATCH 0450/1149] Script/UC: Add some combat spells to Lady Sylvannas Original patch by pxlcreations (11/04/2010) --- src/server/game/Tickets/TicketMgr.cpp | 2 +- .../scripts/EasternKingdoms/undercity.cpp | 95 ++++++++++++++++--- 2 files changed, 82 insertions(+), 15 deletions(-) diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index af23a3003ad..f82c01adf31 100755 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -38,7 +38,7 @@ GmTicket::GmTicket(Player* player, WorldPacket& recv_data) : _createTime(time(NU _playerGuid = player->GetGUID(); uint32 mapId; - recv_data >> mapId; // Map is sent as UInt32! + recv_data >> mapId; // Map is sent as UInt32! _mapId = mapId; recv_data >> _posX; diff --git a/src/server/scripts/EasternKingdoms/undercity.cpp b/src/server/scripts/EasternKingdoms/undercity.cpp index 0522e214012..d5896812007 100644 --- a/src/server/scripts/EasternKingdoms/undercity.cpp +++ b/src/server/scripts/EasternKingdoms/undercity.cpp @@ -47,7 +47,15 @@ enum Sylvanas SPELL_HIGHBORNE_AURA = 37090, SPELL_SYLVANAS_CAST = 36568, - SPELL_RIBBON_OF_SOULS = 34432, //the real one to use might be 37099 + SPELL_RIBBON_OF_SOULS = 34432, // the real one to use might be 37099 + + // Combat spells + SPELL_BLACK_ARROW = 59712, + SPELL_FADE = 20672, + SPELL_FADE_BLINK = 29211, + SPELL_MULTI_SHOT = 59713, + SPELL_SHOT = 59710, + SPELL_SUMMON_SKELETON = 59711 }; float HighborneLoc[4][3]= @@ -90,15 +98,27 @@ public: { npc_lady_sylvanas_windrunnerAI(Creature* creature) : ScriptedAI(creature) {} - uint32 LamentEvent_Timer; + uint32 LamentEventTimer; bool LamentEvent; uint64 targetGUID; + uint32 FadeTimer; + uint32 SummonSkeletonTimer; + uint32 BlackArrowTimer; + uint32 ShotTimer; + uint32 MultiShotTimer; + void Reset() { - LamentEvent_Timer = 5000; + LamentEventTimer = 5000; LamentEvent = false; targetGUID = 0; + + FadeTimer = 30000; + SummonSkeletonTimer = 20000; + BlackArrowTimer = 15000; + ShotTimer = 8000; + MultiShotTimer = 10000; } void EnterCombat(Unit* /*who*/) {} @@ -123,23 +143,70 @@ public: { if (LamentEvent) { - if (LamentEvent_Timer <= diff) + if (LamentEventTimer <= diff) { DoSummon(ENTRY_HIGHBORNE_BUNNY, me, 10.0f, 3000, TEMPSUMMON_TIMED_DESPAWN); - LamentEvent_Timer = 2000; + LamentEventTimer = 2000; if (!me->HasAura(SPELL_SYLVANAS_CAST)) { DoScriptText(SAY_LAMENT_END, me); DoScriptText(EMOTE_LAMENT_END, me); LamentEvent = false; } - } else LamentEvent_Timer -= diff; + } else LamentEventTimer -= diff; } if (!UpdateVictim()) return; + // Combat spells + + if (FadeTimer <= diff) + { + DoCast(me, SPELL_FADE); + // add a blink to simulate a stealthed movement and reappearing elsewhere + DoCast(me, SPELL_FADE_BLINK); + FadeTimer = 30000 + rand()%5000; + // if the victim is out of melee range she cast multi shot + if (Unit* victim = me->getVictim()) + if (me->GetDistance(victim) > 10.0f) + DoCast(victim, SPELL_MULTI_SHOT); + } else FadeTimer -= diff; + + if (SummonSkeletonTimer <= diff) + { + DoCast(me, SPELL_SUMMON_SKELETON); + SummonSkeletonTimer = 20000 + rand()%10000; + } else SummonSkeletonTimer -= diff; + + if (BlackArrowTimer <= diff) + { + if (Unit* victim = me->getVictim()) + { + DoCast(me->getVictim(), SPELL_BLACK_ARROW); + BlackArrowTimer = 15000 + rand()%5000; + } + } else BlackArrowTimer -= diff; + + if (ShotTimer <= diff) + { + if (Unit* victim = me->getVictim()) + { + DoCast(me->getVictim(), SPELL_SHOT); + ShotTimer = 8000 + rand()%2000; + } + } else ShotTimer -= diff; + + if (MultiShotTimer <= diff) + { + if (Unit* victim = me->getVictim()) + { + DoCast(me->getVictim(), SPELL_MULTI_SHOT); + MultiShotTimer = 10000 + rand()%3000; + } + } else MultiShotTimer -= diff; + DoMeleeAttackIfReady(); } }; @@ -163,15 +230,15 @@ public: { npc_highborne_lamenterAI(Creature* creature) : ScriptedAI(creature) {} - uint32 EventMove_Timer; - uint32 EventCast_Timer; + uint32 EventMoveTimer; + uint32 EventCastTimer; bool EventMove; bool EventCast; void Reset() { - EventMove_Timer = 10000; - EventCast_Timer = 17500; + EventMoveTimer = 10000; + EventCastTimer = 17500; EventMove = true; EventCast = true; } @@ -182,21 +249,21 @@ public: { if (EventMove) { - if (EventMove_Timer <= diff) + if (EventMoveTimer <= diff) { me->SetDisableGravity(true); me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetDistance(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW) / (5000 * 0.001f)); me->SetPosition(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetOrientation()); EventMove = false; - } else EventMove_Timer -= diff; + } else EventMoveTimer -= diff; } if (EventCast) { - if (EventCast_Timer <= diff) + if (EventCastTimer <= diff) { DoCast(me, SPELL_HIGHBORNE_AURA); EventCast = false; - } else EventCast_Timer -= diff; + } else EventCastTimer -= diff; } } }; From cadf311ac631a76ba7828f3762ce6c82e375a135 Mon Sep 17 00:00:00 2001 From: kaelima Date: Sat, 7 Apr 2012 21:39:25 +0100 Subject: [PATCH 0451/1149] Core/Players: Reward XP to dead players inside battlegrounds (29/05/2010) --- src/server/game/Entities/Player/Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f3917d735e8..8b0f4c8a54d 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2936,7 +2936,7 @@ void Player::GiveXP(uint32 xp, Unit* victim, float group_rate) if (xp < 1) return; - if (!isAlive()) + if (!isAlive() && !GetBattleGroundId()) return; if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN)) From 945566e84ed5b1fcae115d6804511ff42f695a22 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 7 Apr 2012 22:29:19 +0100 Subject: [PATCH 0452/1149] Scripts/SM: Fix dead anymation of Fairbanks Patch by DennisRassmann (25/10/2010) Closes #4998 --- src/server/game/Entities/Player/Player.cpp | 2 +- .../ScarletMonastery/boss_high_inquisitor_fairbanks.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 8b0f4c8a54d..b8db2fd0052 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2936,7 +2936,7 @@ void Player::GiveXP(uint32 xp, Unit* victim, float group_rate) if (xp < 1) return; - if (!isAlive() && !GetBattleGroundId()) + if (!isAlive() && !GetBattlegroundId()) return; if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN)) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp index a64636a4223..1989c318c84 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp @@ -66,9 +66,15 @@ public: Sleep_Timer = 30000; Dispel_Timer = 20000; PowerWordShield = false; + me->SetStandState(UNIT_STAND_STATE_DEAD); + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 7); } - void EnterCombat(Unit* /*who*/) {} + void EnterCombat(Unit* /*who*/) + { + me->SetStandState(UNIT_STAND_STATE_STAND); + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + } void UpdateAI(const uint32 diff) { From 7ce33ca0a604f3cc71c0e951029a76e0cbcc7e0a Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 7 Apr 2012 16:20:01 -0500 Subject: [PATCH 0453/1149] Core/Spells: Fixes the rune cooldown when a hit mises the target Closes #412 Signed-off-by: Subv --- src/server/game/Spells/Spell.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 8759cfd9acc..c6d0784fcc1 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4340,10 +4340,9 @@ void Spell::TakePower() for (std::list::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) if (ihit->targetGUID == targetGUID) { - if (ihit->missCondition != SPELL_MISS_NONE && ihit->missCondition != SPELL_MISS_MISS/* && ihit->targetGUID != m_caster->GetGUID()*/) - hit = false; if (ihit->missCondition != SPELL_MISS_NONE) { + hit = false; //lower spell cost on fail (by talent aura) if (Player* modOwner = m_caster->ToPlayer()->GetSpellModOwner()) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_SPELL_COST_REFUND_ON_FAIL, m_powerCost); From f17b990f6851279f1ed0b4d1afbd2b307c9c7d89 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 7 Apr 2012 16:58:56 -0500 Subject: [PATCH 0454/1149] Core/Spells: Fixed rogue T10 2P and 4P bonuses Closes #422 Signed-off-by: Subv --- .../2012_04_07_02_world_spell_proc_event.sql | 1 + src/server/game/Entities/Unit/Unit.cpp | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 sql/updates/world/2012_04_07_02_world_spell_proc_event.sql diff --git a/sql/updates/world/2012_04_07_02_world_spell_proc_event.sql b/sql/updates/world/2012_04_07_02_world_spell_proc_event.sql new file mode 100644 index 00000000000..62ef49bc657 --- /dev/null +++ b/sql/updates/world/2012_04_07_02_world_spell_proc_event.sql @@ -0,0 +1 @@ +UPDATE `spell_proc_event` SET `procFlags`=0 WHERE `entry`=70805; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 431fc39d55b..cf14bb02ed9 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -8672,6 +8672,26 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg } break; } + case SPELLFAMILY_ROGUE: + { + switch (auraSpellInfo->Id) + { + // Rogue T10 2P bonus, should only proc on caster + case 70805: + { + if (victim != this) + return false; + break; + } + // Rogue T10 4P bonus, should proc on victim + case 70803: + { + target = victim; + break; + } + } + break; + } default: break; } From 7a5f6dd198fb6e66d8142b31be78b48e4b6931e7 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 7 Apr 2012 23:15:16 +0100 Subject: [PATCH 0455/1149] Core/Conditions: Add CONDITION_TITLE Original patch by svetilo12 --- src/server/game/Conditions/ConditionMgr.cpp | 16 +++++++++++++--- src/server/game/Conditions/ConditionMgr.h | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 3fcabea4c74..1fb0a78605b 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -422,6 +422,9 @@ uint32 Condition::GetSearcherTypeMaskForCondition() case CONDITION_PHASEMASK: mask |= GRID_MAP_TYPE_MASK_ALL; break; + case CONDITION_TITLE: + mask |= GRID_MAP_TYPE_MASK_PLAYER; + break; default: ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!"); break; @@ -1826,9 +1829,16 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) sLog->outErrorDb("Phasemask condition has useless data in value3 (%u)!", cond->ConditionValue3); break; } - case CONDITION_UNUSED_18: - sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_18 in `conditions` table - ignoring"); - return false; + case CONDITION_TITLE: + { + CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(cond->ConditionValue1); + if (!titleEntry) + { + sLog->outErrorDb("Title condition has non existing title in value1 (%u), skipped", cond->ConditionValue1); + return false; + } + break; + } case CONDITION_UNUSED_19: sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_19 in `conditions` table - ignoring"); return false; diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 2df79eab088..130a23a0cb0 100755 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -48,7 +48,7 @@ enum ConditionTypes CONDITION_CLASS = 15, // class 0 0 true if player's class is equal to class CONDITION_RACE = 16, // race 0 0 true if player's race is equal to race CONDITION_ACHIEVEMENT = 17, // achievement_id 0 0 true if achievement is complete - CONDITION_UNUSED_18 = 18, // + CONDITION_TITLE = 18, // title id 0 0 true if player has title CONDITION_UNUSED_19 = 19, // CONDITION_UNUSED_20 = 20, // CONDITION_UNUSED_21 = 21, // From 443adaff07523e7638e19119f3bde4fb5d1aa381 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 7 Apr 2012 18:25:34 -0500 Subject: [PATCH 0456/1149] Scripts/Spells: When Frost Warding negates the damage taken, the Frost Ward should remain intact Closes #313 Signed-off-by: Subv --- src/server/scripts/Spells/spell_mage.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index b746c37a090..050741ffaba 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -250,9 +250,11 @@ class spell_mage_frost_warding_trigger : public SpellScriptLoader if (roll_chance_i(chance)) { - absorbAmount = dmgInfo.GetDamage(); - int32 bp = absorbAmount; + int32 bp = dmgInfo.GetDamage(); + dmgInfo.AbsorbDamage(bp); target->CastCustomSpell(target, SPELL_MAGE_FROST_WARDING_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); + absorbAmount = 0; + PreventDefaultAction(); } } } From a5a123197baca33de9f0bc17c124575ed496ccdb Mon Sep 17 00:00:00 2001 From: kaelima Date: Sun, 8 Apr 2012 03:12:40 +0200 Subject: [PATCH 0457/1149] Core/Item: Fix possible exploit stacking critical strike when switching weapons during disarm. Closes #3532 --- src/server/game/Entities/Player/Player.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b8db2fd0052..9bfdfa18f93 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -8196,6 +8196,10 @@ void Player::_ApplyWeaponDependentAuraMods(Item* item, WeaponAttackType attackTy void Player::_ApplyWeaponDependentAuraCritMod(Item* item, WeaponAttackType attackType, AuraEffect const* aura, bool apply) { + // don't apply mod if item is broken or cannot be used + if (item->IsBroken() || !CanUseAttackType(attackType)) + return; + // generic not weapon specific case processes in aura code if (aura->GetSpellInfo()->EquippedItemClass == -1) return; @@ -8209,13 +8213,13 @@ void Player::_ApplyWeaponDependentAuraCritMod(Item* item, WeaponAttackType attac default: return; } - if (!item->IsBroken()&&item->IsFitToSpellRequirements(aura->GetSpellInfo())) + if (item->IsFitToSpellRequirements(aura->GetSpellInfo())) HandleBaseModValue(mod, FLAT_MOD, float (aura->GetAmount()), apply); } void Player::_ApplyWeaponDependentAuraDamageMod(Item* item, WeaponAttackType attackType, AuraEffect const* aura, bool apply) { - //don't apply mod if item is broken + // don't apply mod if item is broken or cannot be used if (item->IsBroken() || !CanUseAttackType(attackType)) return; From afb202869db776e746412543dc68168cccc84853 Mon Sep 17 00:00:00 2001 From: kaelima Date: Sun, 8 Apr 2012 03:13:50 +0200 Subject: [PATCH 0458/1149] Core/Protocol: Rename opcode SMSG_LFG_BOOT_PLAYER to SMSG_LFG_BOOT_PROPOSAL_UPDATE. (same opcode had two different names in core) --- src/server/game/Handlers/LFGHandler.cpp | 4 ++-- src/server/game/Server/Protocol/Opcodes.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/Handlers/LFGHandler.cpp b/src/server/game/Handlers/LFGHandler.cpp index aea7499aaa9..aa6d208ad3a 100755 --- a/src/server/game/Handlers/LFGHandler.cpp +++ b/src/server/game/Handlers/LFGHandler.cpp @@ -525,9 +525,9 @@ void WorldSession::SendLfgBootPlayer(const LfgPlayerBoot* pBoot) ++agreeNum; } } - sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_BOOT_PLAYER [" UI64FMTD "] inProgress: %u - didVote: %u - agree: %u - victim: [" UI64FMTD "] votes: %u - agrees: %u - left: %u - needed: %u - reason %s", + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_BOOT_PROPOSAL_UPDATE [" UI64FMTD "] inProgress: %u - didVote: %u - agree: %u - victim: [" UI64FMTD "] votes: %u - agrees: %u - left: %u - needed: %u - reason %s", guid, uint8(pBoot->inProgress), uint8(playerVote != LFG_ANSWER_PENDING), uint8(playerVote == LFG_ANSWER_AGREE), pBoot->victim, votesNum, agreeNum, secsleft, pBoot->votedNeeded, pBoot->reason.c_str()); - WorldPacket data(SMSG_LFG_BOOT_PLAYER, 1 + 1 + 1 + 8 + 4 + 4 + 4 + 4 + pBoot->reason.length()); + WorldPacket data(SMSG_LFG_BOOT_PROPOSAL_UPDATE, 1 + 1 + 1 + 8 + 4 + 4 + 4 + 4 + pBoot->reason.length()); data << uint8(pBoot->inProgress); // Vote in progress data << uint8(playerVote != LFG_ANSWER_PENDING); // Did Vote data << uint8(playerVote == LFG_ANSWER_AGREE); // Agree diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index ab6ba7e7796..3c77ced6741 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -911,7 +911,7 @@ enum Opcodes CMSG_LFG_SET_ROLES = 0x36A, CMSG_LFG_SET_NEEDS = 0x36B, CMSG_LFG_SET_BOOT_VOTE = 0x36C, - SMSG_LFG_BOOT_PLAYER = 0x36D, // uint8, uint8, uint8, uint64, uint32, uint32, uint32, uint32 + SMSG_LFG_BOOT_PROPOSAL_UPDATE = 0x36D, // uint8, uint8, uint8, uint64, uint32, uint32, uint32, uint32 CMSG_LFD_PLAYER_LOCK_INFO_REQUEST = 0x36E, SMSG_LFG_PLAYER_INFO = 0x36F, // uint8, for (uint8) { uint32, uint8, uint32, uint32, uint32, uint32, uint8, for (uint8) {uint32, uint32, uint32}}, uint32, for (uint32) {uint32, uint32} CMSG_LFG_TELEPORT = 0x370, From fd9c4d9c43331bc66df6b7da4e2520e4aea27f43 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 7 Apr 2012 20:33:09 -0500 Subject: [PATCH 0459/1149] Core/Spells: Health leech spells should still do damage even if the caster is dead (Devouring Plague) Closes #470 Signed-off-by: Subv --- .../game/Spells/Auras/SpellAuraEffects.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index c5a2705c003..f64dae962da 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -6267,7 +6267,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) const { - if (!caster || !caster->isAlive() || !target->isAlive()) + if (!caster || !target->isAlive()) return; if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo())) @@ -6320,15 +6320,19 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c damage = (damage <= absorb+resist) ? 0 : (damage-absorb-resist); if (damage) procVictim |= PROC_FLAG_TAKEN_DAMAGE; - caster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo()); + if (caster->isAlive()) + caster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo()); int32 new_damage = caster->DealDamage(target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), false); - float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster); + if (caster->isAlive()) + { + float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster); - uint32 heal = uint32(caster->SpellHealingBonus(caster, GetSpellInfo(), uint32(new_damage * gainMultiplier), DOT, GetBase()->GetStackAmount())); + uint32 heal = uint32(caster->SpellHealingBonus(caster, GetSpellInfo(), uint32(new_damage * gainMultiplier), DOT, GetBase()->GetStackAmount())); - int32 gain = caster->HealBySpell(caster, GetSpellInfo(), heal); - caster->getHostileRefManager().threatAssist(caster, gain * 0.5f, GetSpellInfo()); + int32 gain = caster->HealBySpell(caster, GetSpellInfo(), heal); + caster->getHostileRefManager().threatAssist(caster, gain * 0.5f, GetSpellInfo()); + } } void AuraEffect::HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster) const From f8e9dedbe5e4e0d31106683276ff2f0e91120cc3 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 7 Apr 2012 21:09:04 -0500 Subject: [PATCH 0460/1149] Scripts/Spells: Removed redundant code for spell 54798. Closes #519 Signed-off-by: Subv --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 15 --------------- src/server/scripts/Spells/spell_quest.cpp | 4 ++++ 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index f64dae962da..6fa6270c444 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5618,21 +5618,6 @@ void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const caster->CastCustomSpell(66153, SPELLVALUE_MAX_TARGETS, urand(1, 6), target, true); break; } - case 54798: // FLAMING Arrow Triggered Effect - { - if (!caster || !target || !target->ToCreature() || !caster->GetVehicle() || target->HasAura(54683)) - break; - - target->CastSpell(target, 54683, true); - - // Credit Frostworgs - if (target->GetEntry() == 29358) - caster->CastSpell(caster, 54896, true); - // Credit Frost Giants - else if (target->GetEntry() == 29351) - caster->CastSpell(caster, 54893, true); - break; - } case 62292: // Blaze (Pool of Tar) // should we use custom damage? target->CastSpell((Unit*)NULL, m_spellInfo->Effects[m_effIndex].TriggerSpell, true); diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 278abcc0c0b..48faf83cd2f 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -636,6 +636,10 @@ class spell_q12851_going_bearback : public SpellScriptLoader if (Unit* caster = GetCaster()) { Unit* target = GetTarget(); + // Already in fire + if (target->HasAura(SPELL_ABLAZE)) + return; + if (Player* player = caster->GetCharmerOrOwnerPlayerOrPlayerItself()) { switch (target->GetEntry()) From 56766949fa4dcfec793351a011381e5708145c8f Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 8 Apr 2012 12:14:04 +0200 Subject: [PATCH 0461/1149] Scripts/Icecrown Citaldel * Timer improvements after air phase for Sindragosa * Added landing animation after air phase * Unchained Magic affects 6 targets on 25 man mode * --- ...2012_04_08_00_world_spell_script_names.sql | 3 ++ .../IcecrownCitadel/boss_sindragosa.cpp | 43 ++++++++++++++----- 2 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 sql/updates/world/2012_04_08_00_world_spell_script_names.sql diff --git a/sql/updates/world/2012_04_08_00_world_spell_script_names.sql b/sql/updates/world/2012_04_08_00_world_spell_script_names.sql new file mode 100644 index 00000000000..ca97f419e11 --- /dev/null +++ b/sql/updates/world/2012_04_08_00_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_sindragosa_ice_tomb_dummy'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(69712,'spell_sindragosa_ice_tomb_dummy'); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 6bf94eeaed2..843966e5b1f 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -99,6 +99,8 @@ enum Events EVENT_LAND = 12, EVENT_AIR_MOVEMENT = 21, EVENT_THIRD_PHASE_CHECK = 22, + EVENT_AIR_MOVEMENT_FAR = 23, + EVENT_LAND_GROUND = 24, // Spinestalker EVENT_BELLOWING_ROAR = 13, @@ -134,6 +136,8 @@ enum MovementPoints POINT_AIR_PHASE = 3, POINT_TAKEOFF = 4, POINT_LAND = 5, + POINT_AIR_PHASE_FAR = 6, + POINT_LAND_GROUND = 7, }; enum Shadowmourne @@ -153,6 +157,8 @@ Position const SindragosaSpawnPos = {4818.700f, 2483.710f, 287.0650f, 3.089233f Position const SindragosaFlyPos = {4475.190f, 2484.570f, 234.8510f, 3.141593f}; Position const SindragosaLandPos = {4419.190f, 2484.570f, 203.3848f, 3.141593f}; Position const SindragosaAirPos = {4475.990f, 2484.430f, 247.9340f, 3.141593f}; +Position const SindragosaAirPosFar = {4525.600f, 2485.150f, 245.0820f, 3.141593f}; +Position const SindragosaFlyInPos = {4419.190f, 2484.360f, 232.5150f, 3.141593f}; class FrostwyrmLandEvent : public BasicEvent { @@ -311,16 +317,24 @@ class boss_sindragosa : public CreatureScript break; case POINT_AIR_PHASE: me->CastCustomSpell(SPELL_ICE_TOMB_TARGET, SPELLVALUE_MAX_TARGETS, RAID_MODE(2, 5, 2, 6), NULL); - events.ScheduleEvent(EVENT_FROST_BOMB, 8000); + me->SetFacingTo(float(M_PI)); + events.ScheduleEvent(EVENT_AIR_MOVEMENT_FAR, 1); + events.ScheduleEvent(EVENT_FROST_BOMB, 9000); + break; + case POINT_AIR_PHASE_FAR: + me->SetFacingTo(float(M_PI)); + events.ScheduleEvent(EVENT_LAND, 30000); break; case POINT_LAND: + events.ScheduleEvent(EVENT_LAND_GROUND, 1); + break; + case POINT_LAND_GROUND: me->SetCanFly(false); me->SetDisableGravity(false); me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->SetReactState(REACT_DEFENSIVE); if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); - DoStartMovement(me->getVictim()); _isInAirPhase = false; // trigger Asphyxiation summons.DoAction(NPC_ICE_TOMB, ACTION_TRIGGER_ASPHYXIATION); @@ -442,7 +456,6 @@ class boss_sindragosa : public CreatureScript break; case EVENT_ICY_GRIP: DoCast(me, SPELL_ICY_GRIP); - events.ScheduleEvent(EVENT_ICY_GRIP, urand(70000, 75000), EVENT_GROUP_LAND_PHASE); events.ScheduleEvent(EVENT_BLISTERING_COLD, 1000, EVENT_GROUP_LAND_PHASE); break; case EVENT_BLISTERING_COLD: @@ -461,19 +474,21 @@ class boss_sindragosa : public CreatureScript me->SetDisableGravity(true); me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->SetReactState(REACT_PASSIVE); + me->AttackStop(); Position pos; pos.Relocate(me); pos.m_positionZ += 17.0f; me->GetMotionMaster()->MoveTakeoff(POINT_TAKEOFF, pos, 8.30078125f); - events.DelayEvents(45000, EVENT_GROUP_LAND_PHASE); + events.CancelEventGroup(EVENT_GROUP_LAND_PHASE); events.ScheduleEvent(EVENT_AIR_PHASE, 110000); - events.RescheduleEvent(EVENT_UNCHAINED_MAGIC, urand(55000, 60000), EVENT_GROUP_LAND_PHASE); - events.ScheduleEvent(EVENT_LAND, 45000); break; } case EVENT_AIR_MOVEMENT: me->GetMotionMaster()->MovePoint(POINT_AIR_PHASE, SindragosaAirPos); break; + case EVENT_AIR_MOVEMENT_FAR: + me->GetMotionMaster()->MovePoint(POINT_AIR_PHASE_FAR, SindragosaAirPosFar); + break; case EVENT_ICE_TOMB: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_ICE_TOMB_UNTARGETABLE)) { @@ -490,15 +505,23 @@ class boss_sindragosa : public CreatureScript destZ = 205.0f; // random number close to ground, get exact in next call me->UpdateGroundPositionZ(destX, destY, destZ); me->CastSpell(destX, destY, destZ, SPELL_FROST_BOMB_TRIGGER, false); - events.ScheduleEvent(EVENT_FROST_BOMB, urand(5000, 10000)); + events.ScheduleEvent(EVENT_FROST_BOMB, urand(6000, 8000)); break; } case EVENT_LAND: { events.CancelEvent(EVENT_FROST_BOMB); - me->GetMotionMaster()->MovePoint(POINT_LAND, SindragosaLandPos); + me->GetMotionMaster()->MovePoint(POINT_LAND, SindragosaFlyInPos); break; } + case EVENT_LAND_GROUND: + events.ScheduleEvent(EVENT_CLEAVE, urand(13000, 15000), EVENT_GROUP_LAND_PHASE); + events.ScheduleEvent(EVENT_TAIL_SMASH, urand(19000, 23000), EVENT_GROUP_LAND_PHASE); + events.ScheduleEvent(EVENT_FROST_BREATH, urand(10000, 15000), EVENT_GROUP_LAND_PHASE); + events.ScheduleEvent(EVENT_UNCHAINED_MAGIC, urand(12000, 17000), EVENT_GROUP_LAND_PHASE); + events.ScheduleEvent(EVENT_ICY_GRIP, urand(35000, 40000), EVENT_GROUP_LAND_PHASE); + me->GetMotionMaster()->MoveLand(POINT_LAND_GROUND, SindragosaLandPos, 0.0f); + break; case EVENT_THIRD_PHASE_CHECK: { if (!_isInAirPhase) @@ -1071,8 +1094,8 @@ class spell_sindragosa_unchained_magic : public SpellScriptLoader void FilterTargets(std::list& unitList) { - unitList.remove_if (UnchainedMagicTargetSelector()); - uint32 maxSize = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 5 : 2); + unitList.remove_if(UnchainedMagicTargetSelector()); + uint32 maxSize = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 6 : 2); if (unitList.size() > maxSize) Trinity::RandomResizeList(unitList, maxSize); } From 01fc695bad2ce0da12feb04e7df5b07c09144869 Mon Sep 17 00:00:00 2001 From: Discover- Date: Sun, 8 Apr 2012 13:18:58 +0200 Subject: [PATCH 0462/1149] Database/Misc: Template updates for Gymer. Author: Faq Closes #6089 --- sql/updates/world/2012_04_08_00_world_creature_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_04_08_00_world_creature_template.sql diff --git a/sql/updates/world/2012_04_08_00_world_creature_template.sql b/sql/updates/world/2012_04_08_00_world_creature_template.sql new file mode 100644 index 00000000000..c6665729b75 --- /dev/null +++ b/sql/updates/world/2012_04_08_00_world_creature_template.sql @@ -0,0 +1,2 @@ +-- Gymer +UPDATE `creature_template` SET `unit_class`=4,`spell1`=55426,`spell2`=55429,`spell3`=55516,`spell4`=55421,`VehicleId`=205 WHERE `entry`=29884; From 2d0e5e2e0c16ce1a7683ecf9cdc83cdc644d1eb0 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 8 Apr 2012 12:56:18 +0100 Subject: [PATCH 0463/1149] Core/Conditions: Add missing code for CONDITION_TITLE DB/Char: Add changes to character base Thanks to manuel and QAston for noticing --- sql/base/characters_database.sql | 2 ++ src/server/game/Conditions/ConditionMgr.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index f0e919a5bcd..9908254ff0e 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1932,6 +1932,8 @@ CREATE TABLE `lag_reports` ( `posX` float NOT NULL DEFAULT '0', `posY` float NOT NULL DEFAULT '0', `posZ` float NOT NULL DEFAULT '0', + `latency` int(10) unsigned NOT NULL DEFAULT '0', + `createTime` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`reportId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Player System'; /*!40101 SET character_set_client = @saved_cs_client */; diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 1fb0a78605b..96f454fd3e2 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -274,6 +274,12 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) condMeets = object->GetPhaseMask() & ConditionValue1; break; } + case CONDITION_TITLE: + { + if (Player* player = object->ToPlayer()) + condMeets = player->HasTitle(ConditionValue1); + break; + } default: condMeets = false; break; From 5e485cba769d3b640d56a00ea179a8ee0090febc Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 8 Apr 2012 15:15:16 +0200 Subject: [PATCH 0464/1149] Scripts/Icecrown Citadel: Fixed Mystic Buffet applying on targets hidden behind Ice Tombs --- ...2012_04_08_01_world_creature_template.sql} | 0 ...2012_04_08_02_world_spell_script_names.sql | 6 +++ .../IcecrownCitadel/boss_sindragosa.cpp | 41 +++++++++++++++++++ 3 files changed, 47 insertions(+) rename sql/updates/world/{2012_04_08_00_world_creature_template.sql => 2012_04_08_01_world_creature_template.sql} (100%) create mode 100644 sql/updates/world/2012_04_08_02_world_spell_script_names.sql diff --git a/sql/updates/world/2012_04_08_00_world_creature_template.sql b/sql/updates/world/2012_04_08_01_world_creature_template.sql similarity index 100% rename from sql/updates/world/2012_04_08_00_world_creature_template.sql rename to sql/updates/world/2012_04_08_01_world_creature_template.sql diff --git a/sql/updates/world/2012_04_08_02_world_spell_script_names.sql b/sql/updates/world/2012_04_08_02_world_spell_script_names.sql new file mode 100644 index 00000000000..dd23c9ef560 --- /dev/null +++ b/sql/updates/world/2012_04_08_02_world_spell_script_names.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_sindragosa_mystic_buffet'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(70127,'spell_sindragosa_mystic_buffet'), +(72528,'spell_sindragosa_mystic_buffet'), +(72529,'spell_sindragosa_mystic_buffet'), +(72530,'spell_sindragosa_mystic_buffet'); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 843966e5b1f..514bd112894 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -1280,6 +1280,46 @@ class spell_sindragosa_icy_grip : public SpellScriptLoader } }; +class MysticBuffetTargetFilter +{ + public: + explicit MysticBuffetTargetFilter(Unit* caster) : _caster(caster) { } + + bool operator()(Unit* unit) + { + return !unit->IsWithinLOSInMap(_caster); + } + + private: + Unit* _caster; +}; + +class spell_sindragosa_mystic_buffet : public SpellScriptLoader +{ + public: + spell_sindragosa_mystic_buffet() : SpellScriptLoader("spell_sindragosa_mystic_buffet") { } + + class spell_sindragosa_mystic_buffet_SpellScript : public SpellScript + { + PrepareSpellScript(spell_sindragosa_mystic_buffet_SpellScript); + + void FilterTargets(std::list& unitList) + { + unitList.remove_if(MysticBuffetTargetFilter(GetCaster())); + } + + void Register() + { + OnUnitTargetSelect += SpellUnitTargetFn(spell_sindragosa_mystic_buffet_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_sindragosa_mystic_buffet_SpellScript(); + } +}; + class spell_rimefang_icy_blast : public SpellScriptLoader { public: @@ -1505,6 +1545,7 @@ void AddSC_boss_sindragosa() new spell_sindragosa_frost_beacon(); new spell_sindragosa_ice_tomb(); new spell_sindragosa_icy_grip(); + new spell_sindragosa_mystic_buffet(); new spell_rimefang_icy_blast(); new spell_frostwarden_handler_order_whelp(); new spell_frostwarden_handler_focus_fire(); From 1922314858dee5be395a3eb2307e37cda8e094f2 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 8 Apr 2012 15:24:13 +0100 Subject: [PATCH 0465/1149] DB/Spells: Add a missing spell (Blessed Life) to spell_dbc Made with love, for Subv. --- sql/updates/world/2012_04_08_02_world_spell_dbc.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2012_04_08_02_world_spell_dbc.sql diff --git a/sql/updates/world/2012_04_08_02_world_spell_dbc.sql b/sql/updates/world/2012_04_08_02_world_spell_dbc.sql new file mode 100644 index 00000000000..5775428668d --- /dev/null +++ b/sql/updates/world/2012_04_08_02_world_spell_dbc.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_dbc` WHERE `Id`=31934; -- Blessed Life +INSERT INTO `spell_dbc` (`Id`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`AttributesEx6`,`AttributesEx7`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectMiscValueB1`,`EffectMiscValueB2`,`EffectMiscValueB3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`EffectSpellClassMaskA1`,`EffectSpellClassMaskA2`,`EffectSpellClassMaskA3`,`EffectSpellClassMaskB1`,`EffectSpellClassMaskB2`,`EffectSpellClassMaskB3`,`EffectSpellClassMaskC1`,`EffectSpellClassMaskC2`,`EffectSpellClassMaskC3`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`SpellFamilyFlags3`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`DmgMultiplier3`,`AreaGroupId`,`SchoolMask`,`Comment`) VALUES +(31934,0,0,384,0,0,0,0,0,0,0,131072,0,0,1,0,1048576,100,1,0,0,0,21,1,0,-1,0,0,6,0,0,1,0,0,'0','0','0',-51,0,0,0,0,0,1,0,0,0,0,0,0,0,0,87,0,0,0,0,0,'0','0','0',127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'1','0','0',0,0,'Blessed Life'); From e636531da3603c10a9ebcb8a55d52d6cdb3a400a Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 8 Apr 2012 12:17:43 +0200 Subject: [PATCH 0466/1149] Core/Movement: Fix pushback issues and client freeze. --- src/server/game/Entities/Player/Player.cpp | 24 +++++++++++++++++++ src/server/game/Entities/Player/Player.h | 3 +++ src/server/game/Entities/Unit/Unit.cpp | 19 +++++++++++---- src/server/game/Entities/Unit/Unit.h | 3 +++ src/server/game/Movement/MotionMaster.cpp | 6 +++++ src/server/game/Server/WorldSession.cpp | 4 ++-- .../game/Spells/Auras/SpellAuraEffects.cpp | 8 ++----- 7 files changed, 54 insertions(+), 13 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 100afd73b27..72a10f43533 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -25550,3 +25550,27 @@ void Player::SendMovementSetCanTransitionBetweenSwimAndFly(bool apply) data << uint32(0); //! movement counter SendDirectMessage(&data); } + +void Player::SendMovementSetHover(bool apply) +{ + WorldPacket data(apply ? SMSG_MOVE_SET_HOVER : SMSG_MOVE_UNSET_HOVER, 12); + data.append(GetPackGUID()); + data << uint32(0); //! movement counter + SendDirectMessage(&data); +} + +void Player::SendMovementSetWaterWalking(bool apply) +{ + WorldPacket data(apply ? SMSG_MOVE_WATER_WALK : SMSG_MOVE_LAND_WALK, 12); + data.append(GetPackGUID()); + data << uint32(0); //! movement counter + SendDirectMessage(&data); +} + +void Player::SendMovementSetFeatherFall(bool apply) +{ + WorldPacket data(apply ? SMSG_MOVE_FEATHER_FALL : SMSG_MOVE_NORMAL_FALL, 12); + data.append(GetPackGUID()); + data << uint32(0); //! movement counter + SendDirectMessage(&data); +} diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 53b848a89b0..1b80b68113f 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2486,6 +2486,9 @@ class Player : public Unit, public GridObject */ void SendMovementSetCanFly(bool apply); void SendMovementSetCanTransitionBetweenSwimAndFly(bool apply); + void SendMovementSetHover(bool apply); + void SendMovementSetWaterWalking(bool apply); + void SendMovementSetFeatherFall(bool apply); bool CanFly() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY); } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index cf14bb02ed9..4f491c0ebe9 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17598,26 +17598,35 @@ bool Unit::SetHover(bool enable) void Unit::SendMovementHover() { + if (GetTypeId() == TYPEID_PLAYER) + ToPlayer()->SendMovementSetHover(HasUnitMovementFlag(MOVEMENTFLAG_HOVER)); + WorldPacket data(MSG_MOVE_HOVER, 64); data.append(GetPackGUID()); BuildMovementPacket(&data); - SendMessageToSet(&data, true); + SendMessageToSet(&data, false); } void Unit::SendMovementWaterWalking() { + if (GetTypeId() == TYPEID_PLAYER) + ToPlayer()->SendMovementSetWaterWalking(HasUnitMovementFlag(MOVEMENTFLAG_WATERWALKING)); + WorldPacket data(MSG_MOVE_WATER_WALK, 64); data.append(GetPackGUID()); BuildMovementPacket(&data); - SendMessageToSet(&data, true); + SendMessageToSet(&data, false); } void Unit::SendMovementFeatherFall() { + if (GetTypeId() == TYPEID_PLAYER) + ToPlayer()->SendMovementSetFeatherFall(HasUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW)); + WorldPacket data(MSG_MOVE_FEATHER_FALL, 64); data.append(GetPackGUID()); BuildMovementPacket(&data); - SendMessageToSet(&data, true); + SendMessageToSet(&data, false); } void Unit::SendMovementGravityChange() @@ -17625,7 +17634,7 @@ void Unit::SendMovementGravityChange() WorldPacket data(MSG_MOVE_GRAVITY_CHNG, 64); data.append(GetPackGUID()); BuildMovementPacket(&data); - SendMessageToSet(&data, true); + SendMessageToSet(&data, false); } void Unit::SendMovementCanFlyChange() @@ -17650,5 +17659,5 @@ void Unit::SendMovementCanFlyChange() WorldPacket data(MSG_MOVE_UPDATE_CAN_FLY, 64); data.append(GetPackGUID()); BuildMovementPacket(&data); - SendMessageToSet(&data, true); + SendMessageToSet(&data, false); } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index fcbe1afa389..bb826c14dfc 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -707,6 +707,9 @@ enum MovementFlags MOVEMENTFLAG_MASK_TURNING = MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT, + MOVEMENTFLAG_MASK_MOVING_FLY = + MOVEMENTFLAG_FLYING | MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING, + //! TODO if needed: add more flags to this masks that are exclusive to players MOVEMENTFLAG_MASK_PLAYER_ONLY = MOVEMENTFLAG_FLYING, diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index b8a7ee848ed..b0ac0b710c1 100755 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -383,6 +383,12 @@ void MotionMaster::MoveFall(uint32 id/*=0*/) if (fabs(_owner->GetPositionZ() - tz) < 0.1f) return; + if (_owner->GetTypeId() == TYPEID_PLAYER) + { + _owner->AddUnitMovementFlag(MOVEMENTFLAG_FALLING); + _owner->m_movementInfo.SetFallTime(0); + } + Movement::MoveSplineInit init(*_owner); init.MoveTo(_owner->GetPositionX(), _owner->GetPositionY(), tz); init.SetFall(); diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index be6561c2633..88248b7bc55 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -831,8 +831,8 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) in conjunction with any of the moving movement flags such as MOVEMENTFLAG_FORWARD. It will freeze clients that receive this player's movement info. */ - REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ROOT) && mi->HasMovementFlag(MOVEMENTFLAG_MASK_MOVING), - MOVEMENTFLAG_MASK_MOVING); + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ROOT), + MOVEMENTFLAG_ROOT); //! Cannot hover without SPELL_AURA_HOVER REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_HOVER) && !GetPlayer()->HasAuraType(SPELL_AURA_HOVER), diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 6fa6270c444..f41b4bc6c5f 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2856,9 +2856,8 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode target->SetCanFly(apply); if (!apply) { - target->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING); - target->AddUnitMovementFlag(MOVEMENTFLAG_FALLING); - target->m_movementInfo.SetFallTime(0); + target->RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING_FLY); + target->GetMotionMaster()->MoveFall(); } Player* player = target->ToPlayer(); @@ -2889,10 +2888,7 @@ void AuraEffect::HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, if (apply) target->AddUnitMovementFlag(MOVEMENTFLAG_WATERWALKING); else - { target->RemoveUnitMovementFlag(MOVEMENTFLAG_WATERWALKING); - target->AddUnitMovementFlag(MOVEMENTFLAG_FALLING); - } target->SendMovementWaterWalking(); } From bc96df1aae35d2a887ae58f85aeadf0049077b2b Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 8 Apr 2012 17:40:05 +0200 Subject: [PATCH 0467/1149] Core/Shared: Move container functions to shared project under Trinity::Container namespace. Also implement RandomResizeList which takes a predicate function as parameter. Core/ScriptedAI: Extend SummonList::DoAction to take a predicate function as parameter and allow specifying a maximum number of units to be selected. --- src/server/game/AI/CoreAI/UnitAI.h | 2 +- .../game/AI/ScriptedAI/ScriptedCreature.cpp | 12 ---- .../game/AI/ScriptedAI/ScriptedCreature.h | 29 +++++++- src/server/game/DungeonFinding/LFGMgr.cpp | 2 +- .../game/Entities/GameObject/GameObject.cpp | 2 +- src/server/game/Entities/Object/Object.h | 14 ---- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/game/Pools/PoolMgr.cpp | 4 +- src/server/game/Spells/Spell.cpp | 6 +- src/server/game/Spells/SpellEffects.cpp | 4 +- src/server/game/World/World.cpp | 2 +- .../MoltenCore/boss_sulfuron_harbinger.cpp | 2 +- .../Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp | 2 +- .../RubySanctum/boss_saviana_ragefire.cpp | 2 +- .../boss_anubarak_trial.cpp | 6 +- .../boss_blood_queen_lana_thel.cpp | 8 +-- .../boss_deathbringer_saurfang.cpp | 2 +- .../boss_lady_deathwhisper.cpp | 2 +- .../boss_professor_putricide.cpp | 2 +- .../IcecrownCitadel/boss_rotface.cpp | 2 +- .../IcecrownCitadel/boss_sindragosa.cpp | 11 ++-- .../IcecrownCitadel/boss_the_lich_king.cpp | 12 ++-- .../boss_valithria_dreamwalker.cpp | 4 +- .../IcecrownCitadel/icecrown_citadel.cpp | 6 +- .../Northrend/Naxxramas/boss_gothik.cpp | 6 +- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 2 +- .../Ulduar/Ulduar/boss_general_vezax.cpp | 2 +- .../Northrend/VaultOfArchavon/boss_emalon.cpp | 2 +- .../Outland/BlackTemple/boss_supremus.cpp | 3 +- src/server/scripts/Outland/netherstorm.cpp | 2 +- src/server/scripts/Spells/spell_druid.cpp | 2 +- src/server/shared/Containers.h | 66 +++++++++++++++++++ src/server/shared/Utilities/Util.h | 10 +-- 33 files changed, 153 insertions(+), 82 deletions(-) create mode 100644 src/server/shared/Containers.h diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h index b871a25835b..593f0d15e18 100755 --- a/src/server/game/AI/CoreAI/UnitAI.h +++ b/src/server/game/AI/CoreAI/UnitAI.h @@ -223,7 +223,7 @@ class UnitAI targetList.reverse(); if (targetType == SELECT_TARGET_RANDOM) - Trinity::RandomResizeList(targetList, maxTargets); + Trinity::Containers::RandomResizeList(targetList, maxTargets); else targetList.resize(maxTargets); } diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index d80c71bfb35..e48112a5a5f 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -30,18 +30,6 @@ void SummonList::DoZoneInCombat(uint32 entry) } } -void SummonList::DoAction(uint32 entry, int32 info) -{ - for (iterator i = begin(); i != end();) - { - Creature* summon = Unit::GetCreature(*me, *i); - ++i; - if (summon && summon->IsAIEnabled - && (!entry || summon->GetEntry() == entry)) - summon->AI()->DoAction(info); - } -} - void SummonList::DespawnEntry(uint32 entry) { for (iterator i = begin(); i != end();) diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index a01c993cab6..4fac8b3cba5 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -38,7 +38,18 @@ class SummonList : public std::list void Despawn(Creature* summon) { remove(summon->GetGUID()); } void DespawnEntry(uint32 entry); void DespawnAll(); - void DoAction(uint32 entry, int32 info); + + template void DoAction(int32 info, Predicate& predicate, uint16 max = 0) + { + Trinity::Containers::RandomResizeList(*this, predicate, max); + for (iterator i = begin(); i != end(); ) + { + Creature* summon = Unit::GetCreature(*me, *i++); + if (summon && summon->IsAIEnabled) + summon->AI()->DoAction(info); + } + } + void DoZoneInCombat(uint32 entry = 0); void RemoveNotExisting(); bool HasEntry(uint32 entry); @@ -46,6 +57,22 @@ class SummonList : public std::list Creature* me; }; +class EntryCheckPredicate +{ + public: + EntryCheckPredicate(uint32 entry) : _entry(entry) {} + bool operator()(uint64 guid) { return GUID_ENPART(guid) == _entry; } + + private: + uint32 _entry; +}; + +class DummyEntryCheckPredicate +{ + public: + bool operator()(uint64) { return true; } +}; + struct ScriptedAI : public CreatureAI { explicit ScriptedAI(Creature* creature); diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index b936d32e13f..47c298d7467 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1023,7 +1023,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) // Select a random dungeon from the compatible list // TODO - Select the dungeon based on group item Level, not just random // Create a new proposal - pProposal = new LfgProposal(SelectRandomContainerElement(compatibleDungeons)); + pProposal = new LfgProposal(Trinity::Containers::SelectRandomContainerElement(compatibleDungeons)); pProposal->cancelTime = time_t(time(NULL)) + LFG_TIME_PROPOSAL; pProposal->state = LFG_PROPOSAL_INITIATING; pProposal->queues = check; diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 1fe83023976..cc53d0eb79f 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -1432,7 +1432,7 @@ void GameObject::Use(Unit* user) if (info->summoningRitual.casterTargetSpell && info->summoningRitual.casterTargetSpell != 1) // No idea why this field is a bool in some cases for (uint32 i = 0; i < info->summoningRitual.casterTargetSpellTargets; i++) // m_unique_users can contain only player GUIDs - if (Player* target = ObjectAccessor::GetPlayer(*this, SelectRandomContainerElement(m_unique_users))) + if (Player* target = ObjectAccessor::GetPlayer(*this, Trinity::Containers::SelectRandomContainerElement(m_unique_users))) spellCaster->CastSpell(target, info->summoningRitual.casterTargetSpell, true); // finish owners spell diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 6c77bf69a68..39be4d4f529 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -878,20 +878,6 @@ class WorldObject : public Object, public WorldLocation namespace Trinity { - template - void RandomResizeList(std::list &_list, uint32 _size) - { - size_t list_size = _list.size(); - - while (list_size > _size) - { - typename std::list::iterator itr = _list.begin(); - std::advance(itr, urand(0, list_size - 1)); - _list.erase(itr); - --list_size; - } - } - // Binary predicate to sort WorldObjects based on the distance to a reference WorldObject class ObjectDistanceOrderPred { diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 4f491c0ebe9..2bc171857fb 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -14956,7 +14956,7 @@ Unit* Unit::SelectNearbyTarget(Unit* exclude, float dist) const return NULL; // select random - return SelectRandomContainerElement(targets); + return Trinity::Containers::SelectRandomContainerElement(targets); } void Unit::ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply) diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp index 5ebf78e484c..d8548b552d3 100755 --- a/src/server/game/Pools/PoolMgr.cpp +++ b/src/server/game/Pools/PoolMgr.cpp @@ -479,7 +479,7 @@ void PoolGroup::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32 { do { - uint32 questId = SelectRandomContainerElement(currentQuests); + uint32 questId = Trinity::Containers::SelectRandomContainerElement(currentQuests); newQuests.insert(questId); currentQuests.erase(questId); } while (newQuests.size() < limit && !currentQuests.empty()); // failsafe @@ -491,7 +491,7 @@ void PoolGroup::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32 // activate random quests do { - uint32 questId = SelectRandomContainerElement(newQuests); + uint32 questId = Trinity::Containers::SelectRandomContainerElement(newQuests); spawns.ActivateObject(questId, poolId); PoolObject tempObj(questId, 0.0f); Spawn1Object(&tempObj); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index c6d0784fcc1..bc12f85b832 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1055,7 +1055,7 @@ void Spell::SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTarge if ((*j)->IsAffectedOnSpell(m_spellInfo)) maxTargets += (*j)->GetAmount(); - Trinity::RandomResizeList(targets, maxTargets); + Trinity::Containers::RandomResizeList(targets, maxTargets); } // for compability with older code - add only unit and go targets @@ -1350,7 +1350,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge if (m_spellInfo->Id == 5246) //Intimidating Shout unitTargets.remove(m_targets.GetUnitTarget()); - Trinity::RandomResizeList(unitTargets, maxTargets); + Trinity::Containers::RandomResizeList(unitTargets, maxTargets); } CallScriptAfterUnitTargetSelectHandlers(unitTargets, effIndex); @@ -1368,7 +1368,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge if ((*j)->IsAffectedOnSpell(m_spellInfo)) maxTargets += (*j)->GetAmount(); - Trinity::RandomResizeList(gObjTargets, maxTargets); + Trinity::Containers::RandomResizeList(gObjTargets, maxTargets); } for (std::list::iterator itr = gObjTargets.begin(); itr != gObjTargets.end(); ++itr) AddGOTarget(*itr, effMask); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index ce64c2e9560..67202dda66d 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -774,7 +774,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) uint32 maxTargets = std::min(3, attackers.size()); for (uint32 i = 0; i < maxTargets; ++i) { - Unit* attacker = SelectRandomContainerElement(attackers); + Unit* attacker = Trinity::Containers::SelectRandomContainerElement(attackers); AddUnitTarget(attacker, 1 << 1); attackers.erase(attacker); } @@ -2008,7 +2008,7 @@ void Spell::EffectEnergize(SpellEffIndex effIndex) if (!avalibleElixirs.empty()) { // cast random elixir on target - m_caster->CastSpell(unitTarget, SelectRandomContainerElement(avalibleElixirs), true, m_CastItem); + m_caster->CastSpell(unitTarget, Trinity::Containers::SelectRandomContainerElement(avalibleElixirs), true, m_CastItem); } } } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index ccc8bb2c3e7..6e32d33a7bb 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -2602,7 +2602,7 @@ void World::SendAutoBroadcast() std::string msg; - msg = SelectRandomContainerElement(m_Autobroadcasts); + msg = Trinity::Containers::SelectRandomContainerElement(m_Autobroadcasts); uint32 abcenter = sWorld->getIntConfig(CONFIG_AUTOBROADCAST_CENTER); diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp index 9f511c1394a..343298d29fe 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp @@ -103,7 +103,7 @@ class boss_sulfuron : public CreatureScript { std::list healers = DoFindFriendlyMissingBuff(45.0f, SPELL_INSPIRE); if (!healers.empty()) - DoCast(SelectRandomContainerElement(healers), SPELL_INSPIRE); + DoCast(Trinity::Containers::SelectRandomContainerElement(healers), SPELL_INSPIRE); DoCast(me, SPELL_INSPIRE); events.ScheduleEvent(EVENT_INSPIRE, urand(20000, 26000)); diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp index a290b07e60f..18a77519ba2 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp @@ -147,7 +147,7 @@ class boss_moam : public CreatureScript targetList.push_back((*itr)->getTarget()); } - Trinity::RandomResizeList(targetList, 5); + Trinity::Containers::RandomResizeList(targetList, 5); for (std::list::iterator itr = targetList.begin(); itr != targetList.end(); ++itr) DoCast(*itr, SPELL_DRAIN_MANA); diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp index 3407b42b2a7..4e5e01cc745 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp @@ -206,7 +206,7 @@ class spell_saviana_conflagration_init : public SpellScriptLoader unitList.remove_if (ConflagrationTargetSelector()); uint8 maxSize = uint8(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 6 : 3); if (unitList.size() > maxSize) - Trinity::RandomResizeList(unitList, maxSize); + Trinity::Containers::RandomResizeList(unitList, maxSize); } void HandleDummy(SpellEffIndex effIndex) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index 37516e5e0df..c718c0cee5f 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -263,7 +263,8 @@ public: if (instance) instance->SetData(TYPE_ANUBARAK, IN_PROGRESS); //Despawn Scarab Swarms neutral - Summons.DoAction(NPC_SCARAB, ACTION_SCARAB_SUBMERGE); + EntryCheckPredicate pred(NPC_SCARAB); + Summons.DoAction(ACTION_SCARAB_SUBMERGE, pred); //Spawn Burrow for (int i=0; i < 4; i++) me->SummonCreature(NPC_BURROW, AnubarakLoc[i+2]); @@ -304,7 +305,8 @@ public: if (IsHeroic() && m_uiNerubianShadowStrikeTimer <= uiDiff) { - Summons.DoAction(NPC_BURROWER, ACTION_SHADOW_STRIKE); + EntryCheckPredicate pred(NPC_BURROWER); + Summons.DoAction(ACTION_SHADOW_STRIKE, pred); m_uiNerubianShadowStrikeTimer = 30*IN_MILLISECONDS; } else m_uiNerubianShadowStrikeTimer -= uiDiff; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index 784cda8f595..b6544fd9a2a 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -386,7 +386,7 @@ class boss_blood_queen_lana_thel : public CreatureScript ++targetCount; if (Is25ManRaid()) ++targetCount; - Trinity::RandomResizeList(targets, targetCount); + Trinity::Containers::RandomResizeList(targets, targetCount); if (targets.size() > 1) { Talk(SAY_PACT_OF_THE_DARKFALLEN); @@ -409,7 +409,7 @@ class boss_blood_queen_lana_thel : public CreatureScript { std::list targets; SelectRandomTarget(false, &targets); - Trinity::RandomResizeList(targets, uint32(Is25ManRaid() ? 4 : 2)); + Trinity::Containers::RandomResizeList(targets, uint32(Is25ManRaid() ? 4 : 2)); for (std::list::iterator itr = targets.begin(); itr != targets.end(); ++itr) DoCast(*itr, SPELL_TWILIGHT_BLOODBOLT); DoCast(me, SPELL_TWILIGHT_BLOODBOLT_TARGET); @@ -481,7 +481,7 @@ class boss_blood_queen_lana_thel : public CreatureScript return tempTargets.front(); } - return SelectRandomContainerElement(tempTargets); + return Trinity::Containers::SelectRandomContainerElement(tempTargets); } std::set _vampires; @@ -658,7 +658,7 @@ class spell_blood_queen_bloodbolt : public SpellScriptLoader { uint32 targetCount = (targets.size() + 2) / 3; targets.remove_if (BloodboltHitCheck(static_cast(GetCaster()->GetAI()))); - Trinity::RandomResizeList(targets, targetCount); + Trinity::Containers::RandomResizeList(targets, targetCount); // mark targets now, effect hook has missile travel time delay (might cast next in that time) for (std::list::const_iterator itr = targets.begin(); itr != targets.end(); ++itr) GetCaster()->GetAI()->SetGUID((*itr)->GetGUID(), GUID_BLOODBOLT); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 3ce62d939d3..249eed01643 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -1272,7 +1272,7 @@ class spell_deathbringer_boiling_blood : public SpellScriptLoader if (unitList.empty()) return; - Unit* target = SelectRandomContainerElement(unitList); + Unit* target = Trinity::Containers::SelectRandomContainerElement(unitList); unitList.clear(); unitList.push_back(target); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index ea2f73e788f..e2f9faf6a97 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -605,7 +605,7 @@ class boss_lady_deathwhisper : public CreatureScript return; // select random cultist - Creature* cultist = SelectRandomContainerElement(temp); + Creature* cultist = Trinity::Containers::SelectRandomContainerElement(temp); DoCast(cultist, cultist->GetEntry() == NPC_CULT_FANATIC ? SPELL_DARK_TRANSFORMATION_T : SPELL_DARK_EMPOWERMENT_T, true); Talk(uint8(cultist->GetEntry() == NPC_CULT_FANATIC ? SAY_DARK_TRANSFORMATION : SAY_DARK_EMPOWERMENT)); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index 44bc40d08bd..b66632b6eeb 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -781,7 +781,7 @@ class spell_putricide_ooze_channel : public SpellScriptLoader return; } - Unit* target = SelectRandomContainerElement(targetList); + Unit* target = Trinity::Containers::SelectRandomContainerElement(targetList); targetList.clear(); targetList.push_back(target); _target = target; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index 09707b2d9ab..85de6789784 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -498,7 +498,7 @@ class spell_rotface_mutated_infection : public SpellScriptLoader if (targets.empty()) return; - Unit* target = SelectRandomContainerElement(targets); + Unit* target = Trinity::Containers::SelectRandomContainerElement(targets); targets.clear(); targets.push_back(target); _target = target; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 514bd112894..ab924d1b543 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -329,6 +329,7 @@ class boss_sindragosa : public CreatureScript events.ScheduleEvent(EVENT_LAND_GROUND, 1); break; case POINT_LAND_GROUND: + { me->SetCanFly(false); me->SetDisableGravity(false); me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); @@ -337,8 +338,10 @@ class boss_sindragosa : public CreatureScript me->GetMotionMaster()->MovementExpired(); _isInAirPhase = false; // trigger Asphyxiation - summons.DoAction(NPC_ICE_TOMB, ACTION_TRIGGER_ASPHYXIATION); + EntryCheckPredicate pred(NPC_ICE_TOMB); + summons.DoAction(ACTION_TRIGGER_ASPHYXIATION, pred); break; + } default: break; } @@ -1097,7 +1100,7 @@ class spell_sindragosa_unchained_magic : public SpellScriptLoader unitList.remove_if(UnchainedMagicTargetSelector()); uint32 maxSize = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 6 : 2); if (unitList.size() > maxSize) - Trinity::RandomResizeList(unitList, maxSize); + Trinity::Containers::RandomResizeList(unitList, maxSize); } void Register() @@ -1401,7 +1404,7 @@ class spell_frostwarden_handler_order_whelp : public SpellScriptLoader if (unitList.empty()) return; - Unit* target = SelectRandomContainerElement(unitList); + Unit* target = Trinity::Containers::SelectRandomContainerElement(unitList); unitList.clear(); unitList.push_back(target); } @@ -1418,7 +1421,7 @@ class spell_frostwarden_handler_order_whelp : public SpellScriptLoader if (unitList.empty()) return; - SelectRandomContainerElement(unitList)->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true); + Trinity::Containers::SelectRandomContainerElement(unitList)->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true); } void Register() diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 90ee6e1af71..2eb894a5153 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -554,7 +554,8 @@ class boss_the_lich_king : public CreatureScript if (Creature* tirion = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HIGHLORD_TIRION_FORDRING))) tirion->AI()->EnterEvadeMode(); DoCastAOE(SPELL_KILL_FROSTMOURNE_PLAYERS); - summons.DoAction(NPC_STRANGULATE_VEHICLE, ACTION_TELEPORT_BACK); + EntryCheckPredicate pred(NPC_STRANGULATE_VEHICLE); + summons.DoAction(ACTION_TELEPORT_BACK, pred); } void KilledUnit(Unit* victim) @@ -595,12 +596,15 @@ class boss_the_lich_king : public CreatureScript events.ScheduleEvent(EVENT_OUTRO_TALK_8, 17000, 0, PHASE_OUTRO); break; case ACTION_TELEPORT_BACK: - summons.DoAction(NPC_STRANGULATE_VEHICLE, ACTION_TELEPORT_BACK); + { + EntryCheckPredicate pred(NPC_STRANGULATE_VEHICLE); + summons.DoAction(ACTION_TELEPORT_BACK, pred); if (!IsHeroic()) Talk(SAY_LK_FROSTMOURNE_ESCAPE); else DoCastAOE(SPELL_TRIGGER_VILE_SPIRIT_HEROIC); break; + } default: break; } @@ -2550,7 +2554,7 @@ class spell_the_lich_king_valkyr_target_search : public SpellScriptLoader if (unitList.empty()) return; - _target = SelectRandomContainerElement(unitList); + _target = Trinity::Containers::SelectRandomContainerElement(unitList); unitList.clear(); unitList.push_back(_target); GetCaster()->GetAI()->SetGUID(_target->GetGUID()); @@ -2758,7 +2762,7 @@ class spell_the_lich_king_vile_spirit_move_target_search : public SpellScriptLoa if (targets.empty()) return; - _target = SelectRandomContainerElement(targets); + _target = Trinity::Containers::SelectRandomContainerElement(targets); } void HandleScript(SpellEffIndex effIndex) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index af2eb57b7c3..ed1ca4d20fb 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -1196,7 +1196,7 @@ class spell_dreamwalker_summoner : public SpellScriptLoader if (targets.empty()) return; - Unit* target = SelectRandomContainerElement(targets); + Unit* target = Trinity::Containers::SelectRandomContainerElement(targets); targets.clear(); targets.push_back(target); } @@ -1242,7 +1242,7 @@ class spell_dreamwalker_summon_suppresser : public SpellScriptLoader std::list summoners; GetCreatureListWithEntryInGrid(summoners, caster, NPC_WORLD_TRIGGER, 100.0f); summoners.remove_if (Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED)); - Trinity::RandomResizeList(summoners, 2); + Trinity::Containers::RandomResizeList(summoners, 2); if (summoners.empty()) return; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 5720ce0e423..c99fde1739c 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -1368,7 +1368,7 @@ class npc_captain_arnath : public CreatureScript case EVENT_ARNATH_PW_SHIELD: { std::list targets = DoFindFriendlyMissingBuff(40.0f, SPELL_POWER_WORD_SHIELD); - DoCast(SelectRandomContainerElement(targets), SPELL_POWER_WORD_SHIELD); + DoCast(Trinity::Containers::SelectRandomContainerElement(targets), SPELL_POWER_WORD_SHIELD); Events.ScheduleEvent(EVENT_ARNATH_PW_SHIELD, urand(15000, 20000)); break; } @@ -1822,7 +1822,7 @@ class spell_frost_giant_death_plague : public SpellScriptLoader unitList.remove_if (DeathPlagueTargetSelector(GetCaster())); if (!unitList.empty()) { - Unit* target = SelectRandomContainerElement(unitList); + Unit* target = Trinity::Containers::SelectRandomContainerElement(unitList); unitList.clear(); unitList.push_back(target); } @@ -1909,7 +1909,7 @@ class spell_svalna_revive_champion : public SpellScriptLoader void RemoveAliveTarget(std::list& unitList) { unitList.remove_if(AliveCheck()); - Trinity::RandomResizeList(unitList, 2); + Trinity::Containers::RandomResizeList(unitList, 2); } void Land(SpellEffIndex /*effIndex*/) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index 132ecdafa5a..8d23de5427c 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -424,7 +424,8 @@ class boss_gothik : public CreatureScript { if (instance) instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE); - summons.DoAction(0, 0); + DummyEntryCheckPredicate pred; + summons.DoAction(0, pred); //! Magic numbers fail summons.DoZoneInCombat(); mergedSides = true; } @@ -447,7 +448,8 @@ class boss_gothik : public CreatureScript DoScriptText(SAY_TELEPORT, me); DoTeleportTo(PosGroundLiveSide); me->SetReactState(REACT_AGGRESSIVE); - summons.DoAction(0, 0); + DummyEntryCheckPredicate pred; + summons.DoAction(0, pred); //! Magic numbers fail summons.DoZoneInCombat(); events.ScheduleEvent(EVENT_BOLT, 1000); events.ScheduleEvent(EVENT_HARVEST, urand(3000, 15000)); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 5d68da4e75a..33415cda157 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -1678,7 +1678,7 @@ class spell_pursue : public SpellScriptLoader else { //! In the end, only one target should be selected - _target = SelectRandomContainerElement(targets); + _target = Trinity::Containers::SelectRandomContainerElement(targets); FilterTargetsSubsequently(targets); } } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp index 61f82d898b9..3556bf188de 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp @@ -290,7 +290,7 @@ class boss_general_vezax : public CreatureScript if (size < playersMin) return NULL; - return SelectRandomContainerElement(PlayerList); + return Trinity::Containers::SelectRandomContainerElement(PlayerList); } return NULL; diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp index dc58e51a5a1..4980ed36ec3 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp @@ -139,7 +139,7 @@ class boss_emalon : public CreatureScript case EVENT_OVERCHARGE: if (!summons.empty()) { - Creature* minion = Unit::GetCreature(*me, SelectRandomContainerElement(summons)); + Creature* minion = Unit::GetCreature(*me, Trinity::Containers::SelectRandomContainerElement(summons)); if (minion && minion->isAlive()) { minion->CastSpell(me, SPELL_OVERCHARGED, true); diff --git a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp index 0dd1d37116c..ce1732433c8 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp @@ -134,7 +134,8 @@ public: if (!phase || phase == PHASE_CHASE) { phase = PHASE_STRIKE; - summons.DoAction(EVENT_VOLCANO, 0); + DummyEntryCheckPredicate pred; + summons.DoAction(EVENT_VOLCANO, pred); events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE); me->SetSpeed(MOVE_RUN, 1.2f); me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp index 4fdaebeacae..388d18697b9 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/netherstorm.cpp @@ -812,7 +812,7 @@ public: } if (!UnitsWithMana.empty()) { - DoCast(SelectRandomContainerElement(UnitsWithMana), SPELL_MANA_BURN); + DoCast(Trinity::Containers::SelectRandomContainerElement(UnitsWithMana), SPELL_MANA_BURN); ManaBurnTimer = 8000 + (rand() % 10 * 1000); // 8-18 sec cd } else diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 4c440f18bd9..380cac4e5ee 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -250,7 +250,7 @@ class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader return; } - Unit* target = SelectRandomContainerElement(tempTargets); + Unit* target = Trinity::Containers::SelectRandomContainerElement(tempTargets); unitList.clear(); unitList.push_back(target); } diff --git a/src/server/shared/Containers.h b/src/server/shared/Containers.h new file mode 100644 index 00000000000..dff23da763a --- /dev/null +++ b/src/server/shared/Containers.h @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#ifndef TRINITY_CONTAINERS_H +#define TRINITY_CONTAINERS_H + +namespace Trinity +{ + namespace Containers + { + template + void RandomResizeList(std::list &list, uint32 size) + { + size_t list_size = list.size(); + + while (list_size > size) + { + typename std::list::iterator itr = list.begin(); + std::advance(itr, urand(0, list_size - 1)); + list.erase(itr); + --list_size; + } + } + + template + void RandomResizeList(std::list &list, Predicate& predicate, uint32 size) + { + //! First use predicate filter + std::list listCopy; + for (typename std::list::iterator itr = list.begin(); itr != list.end(); ++itr) + if (predicate(*itr)) + listCopy.push_back(*itr); + + if (size) + RandomResizeList(listCopy, size); + + list = listCopy; + } + + /* Select a random element from a container. Note: make sure you explicitly empty check the container */ + template typename C::value_type const& SelectRandomContainerElement(C const& container) + { + typename C::const_iterator it = container.begin(); + std::advance(it, urand(0, container.size() - 1)); + return *it; + } + }; + //! namespace Containers +}; +//! namespace Trinity + +#endif //! #ifdef TRINITY_CONTAINERS_H \ No newline at end of file diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h index 4434ed36645..196882dc2a0 100755 --- a/src/server/shared/Utilities/Util.h +++ b/src/server/shared/Utilities/Util.h @@ -20,7 +20,7 @@ #define _UTIL_H #include "Common.h" - +#include "Containers.h" #include #include @@ -653,12 +653,4 @@ public: }; }; -/* Select a random element from a container. Note: make sure you explicitly empty check the container */ -template typename C::value_type const& SelectRandomContainerElement(C const& container) -{ - typename C::const_iterator it = container.begin(); - std::advance(it, urand(0, container.size() - 1)); - return *it; -} - #endif From 9d6c8add0e46a4700bed1cfcfdda03775ddcc7c6 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 8 Apr 2012 18:58:42 +0200 Subject: [PATCH 0468/1149] Fix non-PCH build and GitExtensions screwup from last changeset --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- src/server/shared/Containers.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index f41b4bc6c5f..9ab375413fb 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5702,7 +5702,7 @@ void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const if (targets.empty()) return; - Unit* spellTarget = SelectRandomContainerElement(targets); + Unit* spellTarget = Trinity::Containers::SelectRandomContainerElement(targets); target->CastSpell(spellTarget, 57840, true); target->CastSpell(spellTarget, 57841, true); diff --git a/src/server/shared/Containers.h b/src/server/shared/Containers.h index dff23da763a..f0242cbff0e 100644 --- a/src/server/shared/Containers.h +++ b/src/server/shared/Containers.h @@ -18,6 +18,11 @@ #ifndef TRINITY_CONTAINERS_H #define TRINITY_CONTAINERS_H +#include + +//! Because circular includes are bad +extern uint32 urand(uint32 min, uint32 max); + namespace Trinity { namespace Containers From 268401029e1bc3fa0a052cb15d86123c5ecd1e6a Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 8 Apr 2012 15:08:54 -0500 Subject: [PATCH 0469/1149] Core/Spells: Implemented SPELL_ATTR4_IGNORE_RESISTANCES. Closes #919 Signed-off-by: Subv --- src/server/game/Entities/Unit/Unit.cpp | 3 ++- src/server/game/Miscellaneous/SharedDefines.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 2bc171857fb..8f1481cb01b 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1540,7 +1540,8 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe DamageInfo dmgInfo = DamageInfo(this, victim, damage, spellInfo, schoolMask, damagetype); // Magic damage, check for resists - if ((schoolMask & SPELL_SCHOOL_MASK_NORMAL) == 0) + // Ignore spells that cant be resisted + if ((schoolMask & SPELL_SCHOOL_MASK_NORMAL) == 0 && (spellInfo->AttributesEx4 & SPELL_ATTR4_IGNORE_RESISTANCES) == 0) { float victimResistance = float(victim->GetResistance(schoolMask)); victimResistance += float(GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, schoolMask)); diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index df524b1409e..f578e24a20d 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -410,7 +410,7 @@ enum SpellAttr3 enum SpellAttr4 { - SPELL_ATTR4_UNK0 = 0x00000001, // 0 + SPELL_ATTR4_IGNORE_RESISTANCES = 0x00000001, // 0 spells with this attribute will completely ignore the target resistances (theese spells cant be resisted) SPELL_ATTR4_PROC_ONLY_ON_CASTER = 0x00000002, // 1 proc only on effects with TARGET_UNIT_CASTER? SPELL_ATTR4_UNK2 = 0x00000004, // 2 SPELL_ATTR4_UNK3 = 0x00000008, // 3 From 38d5fbac0ecbc380e9ebf49b3b09080c8e9e96f6 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 8 Apr 2012 16:22:19 -0500 Subject: [PATCH 0470/1149] Core/Spells: You should be able to revive pets from anywhere without summoning them first Closes #1090 Signed-off-by: Subv --- src/server/game/Spells/Spell.cpp | 5 +---- src/server/game/Spells/SpellEffects.cpp | 12 ++++++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index bc12f85b832..36d7328f37e 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5238,10 +5238,8 @@ SpellCastResult Spell::CheckCast(bool strict) case SPELL_EFFECT_SUMMON_DEAD_PET: { Creature* pet = m_caster->GetGuardianPet(); - if (!pet) - return SPELL_FAILED_NO_PET; - if (pet->isAlive()) + if (pet && pet->isAlive()) return SPELL_FAILED_ALREADY_HAVE_SUMMON; break; @@ -5291,7 +5289,6 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_caster->GetCharmGUID()) return SPELL_FAILED_ALREADY_HAVE_CHARM; - break; } case SPELL_EFFECT_SUMMON_PLAYER: diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 67202dda66d..97e75a0c6db 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -5726,7 +5726,7 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/) return; Pet* pet = player->GetPet(); - if (!pet || pet->isAlive()) + if (pet && pet->isAlive()) return; if (damage < 0) @@ -5734,8 +5734,16 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/) float x, y, z; player->GetPosition(x, y, z); + if (!pet) + { + player->SummonPet(0, x, y, z, player->GetOrientation(), SUMMON_PET, 0); + pet = player->GetPet(); + } + if (!pet) + return; + player->GetMap()->CreatureRelocation(pet, x, y, z, player->GetOrientation()); - + pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE); pet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); pet->setDeathState(ALIVE); From 49e24e2dfbcdc312cb5a4d742262300363263751 Mon Sep 17 00:00:00 2001 From: kaelima Date: Sun, 8 Apr 2012 23:59:52 +0200 Subject: [PATCH 0471/1149] Core/Cleanup: Mostly if(.. -> if (.. and for(.. -> for (.. but also some miscellaneous cleanup --- src/server/game/AI/CoreAI/TotemAI.cpp | 14 ++++------- src/server/game/AI/CoreAI/TotemAI.h | 8 +++--- src/server/game/AI/CreatureAISelector.cpp | 4 +-- src/server/game/Entities/Object/Object.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 4 +-- src/server/game/Entities/Unit/Unit.cpp | 13 +++++----- .../game/Grids/Notifiers/GridNotifiers.h | 2 +- src/server/game/Maps/Map.cpp | 8 +++--- src/server/game/Maps/MapManager.cpp | 16 ++++++------ src/server/game/Miscellaneous/SharedDefines.h | 2 +- .../FleeingMovementGenerator.cpp | 25 +++++++------------ .../FleeingMovementGenerator.h | 6 ++--- .../HomeMovementGenerator.h | 3 +-- .../PointMovementGenerator.cpp | 2 +- .../PointMovementGenerator.h | 6 ++--- .../RandomMovementGenerator.cpp | 6 ++--- .../RandomMovementGenerator.h | 3 +-- .../TargetedMovementGenerator.cpp | 2 +- .../TargetedMovementGenerator.h | 3 +-- .../WaypointMovementGenerator.h | 10 +++----- .../game/Movement/Spline/MoveSpline.cpp | 2 +- .../Movement/Spline/MovementPacketBuilder.cpp | 4 +-- src/server/game/Warden/WardenMac.cpp | 2 +- 23 files changed, 63 insertions(+), 84 deletions(-) diff --git a/src/server/game/AI/CoreAI/TotemAI.cpp b/src/server/game/AI/CoreAI/TotemAI.cpp index 0739b62b605..d12d3c098e8 100755 --- a/src/server/game/AI/CoreAI/TotemAI.cpp +++ b/src/server/game/AI/CoreAI/TotemAI.cpp @@ -27,8 +27,7 @@ #include "GridNotifiersImpl.h" #include "CellImpl.h" -int -TotemAI::Permissible(const Creature* creature) +int TotemAI::Permissible(Creature const* creature) { if (creature->isTotem()) return PERMIT_BASE_PROACTIVE; @@ -41,8 +40,7 @@ TotemAI::TotemAI(Creature* c) : CreatureAI(c), i_victimGuid(0) ASSERT(c->isTotem()); } -void -TotemAI::MoveInLineOfSight(Unit*) +void TotemAI::MoveInLineOfSight(Unit* /*who*/) { } @@ -51,10 +49,9 @@ void TotemAI::EnterEvadeMode() me->CombatStop(true); } -void -TotemAI::UpdateAI(const uint32 /*diff*/) +void TotemAI::UpdateAI(uint32 const /*diff*/) { - if (me->ToTotem()->GetTotemType() != TOTEM_ACTIVE) + if (me->ToTotem()->GetTotemType() != TOTEM_ACTIVE) return; if (!me->isAlive() || me->IsNonMeleeSpellCasted(false)) @@ -98,8 +95,7 @@ TotemAI::UpdateAI(const uint32 /*diff*/) i_victimGuid = 0; } -void -TotemAI::AttackStart(Unit*) +void TotemAI::AttackStart(Unit* /*victim*/) { // Sentry totem sends ping on attack if (me->GetEntry() == SENTRY_TOTEM_ENTRY && me->GetOwner()->GetTypeId() == TYPEID_PLAYER) diff --git a/src/server/game/AI/CoreAI/TotemAI.h b/src/server/game/AI/CoreAI/TotemAI.h index 0fa2920888f..f0d705345ef 100755 --- a/src/server/game/AI/CoreAI/TotemAI.h +++ b/src/server/game/AI/CoreAI/TotemAI.h @@ -31,12 +31,12 @@ class TotemAI : public CreatureAI explicit TotemAI(Creature* c); - void MoveInLineOfSight(Unit*); - void AttackStart(Unit*); + void MoveInLineOfSight(Unit* who); + void AttackStart(Unit* victim); void EnterEvadeMode(); - void UpdateAI(const uint32); - static int Permissible(const Creature*); + void UpdateAI(uint32 const diff); + static int Permissible(Creature const* creature); private: uint64 i_victimGuid; diff --git a/src/server/game/AI/CreatureAISelector.cpp b/src/server/game/AI/CreatureAISelector.cpp index f64bb320542..ebe14c0d7d0 100755 --- a/src/server/game/AI/CreatureAISelector.cpp +++ b/src/server/game/AI/CreatureAISelector.cpp @@ -82,7 +82,7 @@ namespace FactorySelector { const CreatureAICreator* factory = iter->second; const SelectableAI* p = dynamic_cast(factory); - ASSERT(p != NULL); + ASSERT(p); int val = p->Permit(creature); if (val > best_val) { @@ -102,7 +102,7 @@ namespace FactorySelector MovementGenerator* selectMovementGenerator(Creature* creature) { MovementGeneratorRegistry& mv_registry(*MovementGeneratorRepository::instance()); - ASSERT(creature->GetCreatureTemplate() != NULL); + ASSERT(creature->GetCreatureTemplate()); const MovementGeneratorCreator* mv_factory = mv_registry.GetRegistryItem(creature->GetDefaultMovementType()); /* if (mv_factory == NULL) diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 69effaa016e..8f74e50b1e9 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1630,7 +1630,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const default: { float ground_z = GetBaseMap()->GetHeight(GetPhaseMask(), x, y, z, true); - if(ground_z > INVALID_HEIGHT) + if (ground_z > INVALID_HEIGHT) z = ground_z; break; } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 72a10f43533..ea7985f67fe 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -21148,10 +21148,10 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 } uint32 price = 0; - if(crItem->IsGoldRequired(pProto) && pProto->BuyPrice > 0) //Assume price cannot be negative (do not know why it is int32) + if (crItem->IsGoldRequired(pProto) && pProto->BuyPrice > 0) //Assume price cannot be negative (do not know why it is int32) { uint32 maxCount = MAX_MONEY_AMOUNT / pProto->BuyPrice; - if((uint32)count > maxCount) + if ((uint32)count > maxCount) { sLog->outError("Player %s tried to buy %u item id %u, causing overflow", GetName(), (uint32)count, pProto->ItemId); count = (uint8)maxCount; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 8f1481cb01b..2420c804edb 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1494,7 +1494,7 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo } else { - if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*itr)->GetSpellInfo())) + if (ToPlayer()->HasItemFitToSpellRequirements((*itr)->GetSpellInfo())) bonusPct += (*itr)->GetAmount(); } } @@ -1504,6 +1504,7 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo maxArmorPen = float(400 + 85 * victim->getLevel()); else maxArmorPen = 400 + 85 * victim->getLevel() + 4.5f * 85 * (victim->getLevel() - 59); + // Cap armor penetration to this number maxArmorPen = std::min((armor + maxArmorPen) / 3, armor); // Figure out how much armor do we ignore @@ -5751,7 +5752,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Glyph of Polymorph case 56375: { - if(!target) + if (!target) return false; target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE, 0, target->GetAura(32409)); // SW:D shall not be removed. target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT); @@ -5810,7 +5811,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Blessing of Ancient Kings (Val'anyr, Hammer of Ancient Kings) case 64411: { - if(!victim) + if (!victim) return false; basepoints0 = int32(CalculatePctN(damage, 15)); if (AuraEffect* aurEff = victim->GetAuraEffect(64413, 0, GetGUID())) @@ -6121,7 +6122,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Divine Aegis if (dummySpell->SpellIconID == 2820) { - if(!target) + if (!target) return false; // Multiple effects stack, so let's try to find this aura. @@ -6291,7 +6292,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Glyph of Shred case 54815: { - if(!target) + if (!target) return false; // try to find spell Rip on the target @@ -6597,7 +6598,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Explosive Shot if (procSpell->SpellFamilyFlags[2] & 0x200) { - if(!victim) + if (!victim) return false; if (AuraEffect const* pEff = victim->GetAuraEffect(SPELL_AURA_PERIODIC_DUMMY, SPELLFAMILY_HUNTER, 0x0, 0x80000000, 0x0, GetGUID())) basepoints0 = pEff->GetSpellInfo()->CalcPowerCost(this, SpellSchoolMask(pEff->GetSpellInfo()->SchoolMask)) * 4/10/3; diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index bb2a9c5130b..ec79db769da 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -797,7 +797,7 @@ namespace Trinity if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->isTotem()) return false; - if(!u->isTargetableForAttack(false)) + if (!u->isTargetableForAttack(false)) return false; return i_obj->IsWithinDistInMap(u, i_range) && !i_funit->IsFriendlyTo(u); diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index f60a8f20c1c..a1b3d913c99 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -787,20 +787,20 @@ void Map::RemoveCreatureFromMoveList(Creature* c) void Map::MoveAllCreaturesInMoveList() { _creatureToMoveLock = true; - for(std::vector::iterator itr = _creaturesToMove.begin(); itr != _creaturesToMove.end(); ++itr) + for (std::vector::iterator itr = _creaturesToMove.begin(); itr != _creaturesToMove.end(); ++itr) { Creature* c = *itr; - if(c->FindMap() != this) //pet is teleported to another map + if (c->FindMap() != this) //pet is teleported to another map continue; - if(c->_moveState != CREATURE_CELL_MOVE_ACTIVE) + if (c->_moveState != CREATURE_CELL_MOVE_ACTIVE) { c->_moveState = CREATURE_CELL_MOVE_NONE; continue; } c->_moveState = CREATURE_CELL_MOVE_NONE; - if(!c->IsInWorld()) + if (!c->IsInWorld()) continue; // do move or do move to respawn or remove creature if previous all fail diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index 0fb28008c1e..eb09538721d 100755 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -96,32 +96,32 @@ void MapManager::checkAndCorrectGridStatesArray() Map* MapManager::CreateBaseMap(uint32 id) { - Map* m = FindBaseMap(id); + Map* map = FindBaseMap(id); - if (m == NULL) + if (map == NULL) { TRINITY_GUARD(ACE_Thread_Mutex, Lock); const MapEntry* entry = sMapStore.LookupEntry(id); if (entry && entry->Instanceable()) { - m = new MapInstanced(id, i_gridCleanUpDelay); + map = new MapInstanced(id, i_gridCleanUpDelay); } else { - m = new Map(id, i_gridCleanUpDelay, 0, REGULAR_DIFFICULTY); + map = new Map(id, i_gridCleanUpDelay, 0, REGULAR_DIFFICULTY); } - i_maps[id] = m; + i_maps[id] = map; } - ASSERT(m != NULL); - return m; + ASSERT(map); + return map; } Map* MapManager::FindBaseNonInstanceMap(uint32 mapId) const { Map* map = FindBaseMap(mapId); - if(map && map->Instanceable()) + if (map && map->Instanceable()) return NULL; return map; } diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index f578e24a20d..1ddf80484e2 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -410,7 +410,7 @@ enum SpellAttr3 enum SpellAttr4 { - SPELL_ATTR4_IGNORE_RESISTANCES = 0x00000001, // 0 spells with this attribute will completely ignore the target resistances (theese spells cant be resisted) + SPELL_ATTR4_IGNORE_RESISTANCES = 0x00000001, // 0 spells with this attribute will completely ignore the target's resistance (these spells can't be resisted) SPELL_ATTR4_PROC_ONLY_ON_CASTER = 0x00000002, // 1 proc only on effects with TARGET_UNIT_CASTER? SPELL_ATTR4_UNK2 = 0x00000004, // 2 SPELL_ATTR4_UNK3 = 0x00000008, // 3 diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp index 7de5f1095c4..08e27abf050 100755 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp @@ -28,8 +28,7 @@ #define MAX_QUIET_DISTANCE 43.0f template -void -FleeingMovementGenerator::_setTargetLocation(T &owner) +void FleeingMovementGenerator::_setTargetLocation(T &owner) { if (!&owner) return; @@ -53,8 +52,7 @@ FleeingMovementGenerator::_setTargetLocation(T &owner) } template -bool -FleeingMovementGenerator::_getPoint(T &owner, float &x, float &y, float &z) +bool FleeingMovementGenerator::_getPoint(T &owner, float &x, float &y, float &z) { if (!&owner) return false; @@ -65,8 +63,8 @@ FleeingMovementGenerator::_getPoint(T &owner, float &x, float &y, float &z) float temp_x, temp_y, angle; const Map* _map = owner.GetBaseMap(); - //primitive path-finding - for(uint8 i = 0; i < 18; ++i) + // primitive path-finding + for (uint8 i = 0; i < 18; ++i) { if (i_only_forward && i > 2) break; @@ -187,8 +185,7 @@ FleeingMovementGenerator::_getPoint(T &owner, float &x, float &y, float &z) } template -bool -FleeingMovementGenerator::_setMoveData(T &owner) +bool FleeingMovementGenerator::_setMoveData(T &owner) { float cur_dist_xyz = owner.GetDistance(i_caster_x, i_caster_y, i_caster_z); @@ -280,8 +277,7 @@ FleeingMovementGenerator::_setMoveData(T &owner) } template -void -FleeingMovementGenerator::Initialize(T &owner) +void FleeingMovementGenerator::Initialize(T &owner) { if (!&owner) return; @@ -312,8 +308,7 @@ FleeingMovementGenerator::Initialize(T &owner) } template<> -void -FleeingMovementGenerator::_Init(Creature &owner) +void FleeingMovementGenerator::_Init(Creature &owner) { if (!&owner) return; @@ -324,8 +319,7 @@ FleeingMovementGenerator::_Init(Creature &owner) } template<> -void -FleeingMovementGenerator::_Init(Player &) +void FleeingMovementGenerator::_Init(Player &) { is_water_ok = true; is_land_ok = true; @@ -354,8 +348,7 @@ void FleeingMovementGenerator::Reset(T &owner) } template -bool -FleeingMovementGenerator::Update(T &owner, const uint32 &time_diff) +bool FleeingMovementGenerator::Update(T &owner, const uint32 &time_diff) { if (!&owner || !owner.isAlive()) return false; diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h index f795a002821..aec93ad3375 100755 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h @@ -22,8 +22,7 @@ #include "MovementGenerator.h" template -class FleeingMovementGenerator -: public MovementGeneratorMedium< T, FleeingMovementGenerator > +class FleeingMovementGenerator : public MovementGeneratorMedium< T, FleeingMovementGenerator > { public: FleeingMovementGenerator(uint64 fright) : i_frightGUID(fright), i_nextCheckTime(0) {} @@ -55,8 +54,7 @@ class FleeingMovementGenerator TimeTracker i_nextCheckTime; }; -class TimedFleeingMovementGenerator -: public FleeingMovementGenerator +class TimedFleeingMovementGenerator : public FleeingMovementGenerator { public: TimedFleeingMovementGenerator(uint64 fright, uint32 time) : diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h index c724edc91ff..95eb05f281c 100755 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h @@ -27,8 +27,7 @@ template < class T > class HomeMovementGenerator; template <> -class HomeMovementGenerator -: public MovementGeneratorMedium< Creature, HomeMovementGenerator > +class HomeMovementGenerator : public MovementGeneratorMedium< Creature, HomeMovementGenerator > { public: diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index 91b50344ccb..a922c937b5f 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -46,7 +46,7 @@ bool PointMovementGenerator::Update(T &unit, const uint32 & /*diff*/) if (!&unit) return false; - if(unit.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) + if (unit.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) { unit.ClearUnitState(UNIT_STATE_ROAMING_MOVE); return true; diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h index 82578da5f9b..13be9fee77b 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h @@ -23,8 +23,7 @@ #include "FollowerReference.h" template -class PointMovementGenerator -: public MovementGeneratorMedium< T, PointMovementGenerator > +class PointMovementGenerator : public MovementGeneratorMedium< T, PointMovementGenerator > { public: PointMovementGenerator(uint32 _id, float _x, float _y, float _z, float _speed = 0.0f) : id(_id), @@ -46,8 +45,7 @@ class PointMovementGenerator float speed; }; -class AssistanceMovementGenerator -: public PointMovementGenerator +class AssistanceMovementGenerator : public PointMovementGenerator { public: AssistanceMovementGenerator(float _x, float _y, float _z) : diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index e520253eb46..84cd9e88295 100755 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -127,8 +127,7 @@ void RandomMovementGenerator::Initialize(Creature &creature) } template<> -void -RandomMovementGenerator::Reset(Creature &creature) +void RandomMovementGenerator::Reset(Creature &creature) { Initialize(creature); } @@ -141,8 +140,7 @@ void RandomMovementGenerator::Finalize(Creature &creature) } template<> -bool -RandomMovementGenerator::Update(Creature &creature, const uint32 diff) +bool RandomMovementGenerator::Update(Creature &creature, const uint32 diff) { if (creature.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED)) { diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h index 67161b6fc29..07ec3647052 100755 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h @@ -22,8 +22,7 @@ #include "MovementGenerator.h" template -class RandomMovementGenerator -: public MovementGeneratorMedium< T, RandomMovementGenerator > +class RandomMovementGenerator : public MovementGeneratorMedium< T, RandomMovementGenerator > { public: RandomMovementGenerator(float spawn_dist = 0.0f) : i_nextMoveTime(0), wander_distance(spawn_dist) {} diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index 6d507a3b694..eb61db8b4ba 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -78,7 +78,7 @@ void TargetedMovementGeneratorMedium::_setTargetLocation(T &owner) //We don't update Mob Movement, if the difference between New destination and last destination is < BothObjectSize float bothObjectSize = i_target->GetObjectBoundingRadius() + owner.GetObjectBoundingRadius() + CONTACT_DISTANCE; - if( i_destinationHolder.HasDestination() && i_destinationHolder.GetDestinationDiff(x,y,z) < bothObjectSize ) + if ( i_destinationHolder.HasDestination() && i_destinationHolder.GetDestinationDiff(x,y,z) < bothObjectSize ) return; */ diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h index b851dbc0e05..29fd73624e1 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h @@ -34,8 +34,7 @@ class TargetedMovementGeneratorBase }; template -class TargetedMovementGeneratorMedium -: public MovementGeneratorMedium< T, D >, public TargetedMovementGeneratorBase +class TargetedMovementGeneratorMedium : public MovementGeneratorMedium< T, D >, public TargetedMovementGeneratorBase { protected: TargetedMovementGeneratorMedium(Unit &target, float offset, float angle) : diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h index b5b43fcae64..0d8f047c83a 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h @@ -58,9 +58,8 @@ template class WaypointMovementGenerator; template<> -class WaypointMovementGenerator -: public MovementGeneratorMedium< Creature, WaypointMovementGenerator >, -public PathMovementBase +class WaypointMovementGenerator : public MovementGeneratorMedium< Creature, WaypointMovementGenerator >, + public PathMovementBase { public: WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true) @@ -110,9 +109,8 @@ public PathMovementBase /** FlightPathMovementGenerator generates movement of the player for the paths * and hence generates ground and activities for the player. */ -class FlightPathMovementGenerator -: public MovementGeneratorMedium< Player, FlightPathMovementGenerator >, -public PathMovementBase +class FlightPathMovementGenerator : public MovementGeneratorMedium< Player, FlightPathMovementGenerator >, + public PathMovementBase { public: explicit FlightPathMovementGenerator(TaxiPathNodeList const& pathnodes, uint32 startNode = 0) diff --git a/src/server/game/Movement/Spline/MoveSpline.cpp b/src/server/game/Movement/Spline/MoveSpline.cpp index 5d0344f9769..91b4ff08250 100644 --- a/src/server/game/Movement/Spline/MoveSpline.cpp +++ b/src/server/game/Movement/Spline/MoveSpline.cpp @@ -288,7 +288,7 @@ std::string MoveSpline::ToString() const str << "facing angle: " << facing.angle; else if (splineflags.final_target) str << "facing target: " << facing.target; - else if(splineflags.final_point) + else if (splineflags.final_point) str << "facing point: " << facing.f.x << " " << facing.f.y << " " << facing.f.z; str << std::endl; str << "time passed: " << time_passed << std::endl; diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp index e9031f95486..0260767dbe2 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp @@ -111,7 +111,7 @@ namespace Movement Vector3 middle = (real_path[0] + real_path[last_idx]) / 2.f; Vector3 offset; // first and last points already appended - for(uint32 i = 1; i < last_idx; ++i) + for (uint32 i = 1; i < last_idx; ++i) { offset = middle - real_path[i]; data.appendPackXYZ(offset.x, offset.y, offset.z); @@ -169,7 +169,7 @@ namespace Movement { data << move_spline.facing.target; } - else if(splineFlags.final_point) + else if (splineFlags.final_point) { data << move_spline.facing.f.x << move_spline.facing.f.y << move_spline.facing.f.z; } diff --git a/src/server/game/Warden/WardenMac.cpp b/src/server/game/Warden/WardenMac.cpp index f62aa11a339..a60ae765013 100644 --- a/src/server/game/Warden/WardenMac.cpp +++ b/src/server/game/Warden/WardenMac.cpp @@ -122,7 +122,7 @@ void WardenMac::HandleHashResult(ByteBuffer &buff) uint8 mod_seed[16] = { 0x4D, 0x80, 0x8D, 0x2C, 0x77, 0xD9, 0x05, 0xC4, 0x1A, 0x63, 0x80, 0xEC, 0x08, 0x58, 0x6A, 0xFE }; - for(int i = 0; i < 4; ++i) + for (int i = 0; i < 4; ++i) { keyIn[i] = *(int*)(&mod_seed[0] + i * 4); } From 8358af975995ee77df3338b2c5b7d454f2b991c0 Mon Sep 17 00:00:00 2001 From: kaelima Date: Mon, 9 Apr 2012 00:01:18 +0200 Subject: [PATCH 0472/1149] Core/Movement: Use line of sight checks for movement waypoints generated for confused movement and raise the minimum movementtimer to 500 ms. Should close #5301 --- .../ConfusedMovementGenerator.cpp | 53 +++++++++++-------- .../ConfusedMovementGenerator.h | 5 +- 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index da830a9a49b..f08281288b0 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -32,11 +32,10 @@ template void ConfusedMovementGenerator::Initialize(T &unit) { - const float wander_distance=4; - float x,y,z; - x = unit.GetPositionX(); - y = unit.GetPositionY(); - z = unit.GetPositionZ(); + float const wander_distance = 4; + float x = unit.GetPositionX(); + float y = unit.GetPositionY(); + float z = unit.GetPositionZ(); Map const* map = unit.GetBaseMap(); @@ -47,31 +46,41 @@ void ConfusedMovementGenerator::Initialize(T &unit) for (uint8 idx = 0; idx < MAX_CONF_WAYPOINTS + 1; ++idx) { - const float wanderX=wander_distance*(float)rand_norm() - wander_distance/2; - const float wanderY=wander_distance*(float)rand_norm() - wander_distance/2; + float const wanderX = x + (wander_distance * (float)rand_norm() - wander_distance/2); + float const wanderY = y + (wander_distance * (float)rand_norm() - wander_distance/2); - i_waypoints[idx][0] = x + wanderX; - i_waypoints[idx][1] = y + wanderY; + i_waypoints[idx][0] = wanderX; + i_waypoints[idx][1] = wanderY; // prevent invalid coordinates generation Trinity::NormalizeMapCoord(i_waypoints[idx][0]); Trinity::NormalizeMapCoord(i_waypoints[idx][1]); - bool is_water = map->IsInWater(i_waypoints[idx][0],i_waypoints[idx][1],z); - // if generated wrong path just ignore - if ((is_water && !is_water_ok) || (!is_water && !is_land_ok)) + if (unit.IsWithinLOS(wanderX, wanderY, z)) { + bool is_water = map->IsInWater(i_waypoints[idx][0], i_waypoints[idx][1], z); + + if ((is_water && !is_water_ok) || (!is_water && !is_land_ok)) + { + //! Ignore bad generated path. Use the current or previous position. + i_waypoints[idx][0] = idx > 0 ? i_waypoints[idx-1][0] : x; + i_waypoints[idx][1] = idx > 0 ? i_waypoints[idx-1][1] : y; + } + + unit.UpdateAllowedPositionZ(i_waypoints[idx][0], i_waypoints[idx][1], z); + i_waypoints[idx][2] = z; + } + else + { + //! Ignore bad generated path. Use the current or previous position. i_waypoints[idx][0] = idx > 0 ? i_waypoints[idx-1][0] : x; i_waypoints[idx][1] = idx > 0 ? i_waypoints[idx-1][1] : y; } - - unit.UpdateAllowedPositionZ(i_waypoints[idx][0], i_waypoints[idx][1], z); - i_waypoints[idx][2] = z; } unit.StopMoving(); unit.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); - unit.AddUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE); + unit.AddUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_CONFUSED_MOVE); } template<> @@ -94,7 +103,7 @@ void ConfusedMovementGenerator::Reset(T &unit) i_nextMove = 1; i_nextMoveTime.Reset(0); unit.StopMoving(); - unit.AddUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE); + unit.AddUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_CONFUSED_MOVE); } template @@ -110,8 +119,8 @@ bool ConfusedMovementGenerator::Update(T &unit, const uint32 &diff) if (unit.movespline->Finalized()) { - i_nextMove = urand(1,MAX_CONF_WAYPOINTS); - i_nextMoveTime.Reset(urand(0, 1500-1)); // TODO: check the minimum reset time, should be probably higher + i_nextMove = urand(1, MAX_CONF_WAYPOINTS); + i_nextMoveTime.Reset(urand(500, 1200)); // Guessed } } else @@ -123,7 +132,7 @@ bool ConfusedMovementGenerator::Update(T &unit, const uint32 &diff) // start moving unit.AddUnitState(UNIT_STATE_CONFUSED_MOVE); - ASSERT( i_nextMove <= MAX_CONF_WAYPOINTS ); + ASSERT(i_nextMove <= MAX_CONF_WAYPOINTS); float x = i_waypoints[i_nextMove][0]; float y = i_waypoints[i_nextMove][1]; float z = i_waypoints[i_nextMove][2]; @@ -141,14 +150,14 @@ template<> void ConfusedMovementGenerator::Finalize(Player &unit) { unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); - unit.ClearUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE); + unit.ClearUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_CONFUSED_MOVE); } template<> void ConfusedMovementGenerator::Finalize(Creature &unit) { unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); - unit.ClearUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE); + unit.ClearUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_CONFUSED_MOVE); if (unit.getVictim()) unit.SetTarget(unit.getVictim()->GetGUID()); } diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h index b9f96bb785d..7f2226ea069 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h @@ -22,11 +22,10 @@ #include "MovementGenerator.h" #include "Timer.h" -#define MAX_CONF_WAYPOINTS 24 +#define MAX_CONF_WAYPOINTS 24 //! Allows a twelve second confusion if i_nextMove always is the absolute minimum timer. template -class ConfusedMovementGenerator -: public MovementGeneratorMedium< T, ConfusedMovementGenerator > +class ConfusedMovementGenerator : public MovementGeneratorMedium< T, ConfusedMovementGenerator > { public: explicit ConfusedMovementGenerator() : i_nextMoveTime(0) {} From a4a1e19f013f01dbbc6e69758e4f9b21463469c6 Mon Sep 17 00:00:00 2001 From: kaelima Date: Mon, 9 Apr 2012 00:32:15 +0200 Subject: [PATCH 0473/1149] Core/Movement: Minor correction for last changeset --- .../ConfusedMovementGenerator.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index f08281288b0..2dcd9b59741 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -49,16 +49,13 @@ void ConfusedMovementGenerator::Initialize(T &unit) float const wanderX = x + (wander_distance * (float)rand_norm() - wander_distance/2); float const wanderY = y + (wander_distance * (float)rand_norm() - wander_distance/2); - i_waypoints[idx][0] = wanderX; - i_waypoints[idx][1] = wanderY; - // prevent invalid coordinates generation - Trinity::NormalizeMapCoord(i_waypoints[idx][0]); - Trinity::NormalizeMapCoord(i_waypoints[idx][1]); + Trinity::NormalizeMapCoord(wanderX); + Trinity::NormalizeMapCoord(wanderY); if (unit.IsWithinLOS(wanderX, wanderY, z)) { - bool is_water = map->IsInWater(i_waypoints[idx][0], i_waypoints[idx][1], z); + bool is_water = map->IsInWater(wanderX, wanderY, z); if ((is_water && !is_water_ok) || (!is_water && !is_land_ok)) { @@ -67,7 +64,11 @@ void ConfusedMovementGenerator::Initialize(T &unit) i_waypoints[idx][1] = idx > 0 ? i_waypoints[idx-1][1] : y; } - unit.UpdateAllowedPositionZ(i_waypoints[idx][0], i_waypoints[idx][1], z); + unit.UpdateAllowedPositionZ(wanderX, wanderY, z); + + //! Positions are now fine - apply them to this waypoint + i_waypoints[idx][0] = wanderX; + i_waypoints[idx][1] = wanderY; i_waypoints[idx][2] = z; } else From 93ca33a8ccc062626fe0e9f04896b0de0c4d8fd0 Mon Sep 17 00:00:00 2001 From: kaelima Date: Mon, 9 Apr 2012 00:57:14 +0200 Subject: [PATCH 0474/1149] Fix compile --- .../Movement/MovementGenerators/ConfusedMovementGenerator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index 2dcd9b59741..03bc2570c0c 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -46,8 +46,8 @@ void ConfusedMovementGenerator::Initialize(T &unit) for (uint8 idx = 0; idx < MAX_CONF_WAYPOINTS + 1; ++idx) { - float const wanderX = x + (wander_distance * (float)rand_norm() - wander_distance/2); - float const wanderY = y + (wander_distance * (float)rand_norm() - wander_distance/2); + float wanderX = x + (wander_distance * (float)rand_norm() - wander_distance/2); + float wanderY = y + (wander_distance * (float)rand_norm() - wander_distance/2); // prevent invalid coordinates generation Trinity::NormalizeMapCoord(wanderX); From e309c4fe1b4d141dc49faef307c443aa7c595580 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 8 Apr 2012 18:56:36 -0500 Subject: [PATCH 0475/1149] Core/Spells: Fixed Riptide bonus on Chain Heal closes #1152 Signed-off-by: Subv --- ...2012_04_08_03_world_spell_script_names.sql | 3 ++ src/server/game/Spells/SpellEffects.cpp | 11 ----- src/server/scripts/Spells/spell_shaman.cpp | 46 +++++++++++++++++++ 3 files changed, 49 insertions(+), 11 deletions(-) create mode 100644 sql/updates/world/2012_04_08_03_world_spell_script_names.sql diff --git a/sql/updates/world/2012_04_08_03_world_spell_script_names.sql b/sql/updates/world/2012_04_08_03_world_spell_script_names.sql new file mode 100644 index 00000000000..744a8bad10d --- /dev/null +++ b/sql/updates/world/2012_04_08_03_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=-1064; +INSERT INTO `spell_script_names` VALUES +(-1064, 'spell_sha_chain_heal'); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 97e75a0c6db..4e05c9fdac2 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1614,17 +1614,6 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/) // Lifebloom - final heal coef multiplied by original DoT stack else if (m_spellInfo->Id == 33778) addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, addhealth, HEAL, m_spellValue->EffectBasePoints[1]); - // Riptide - increase healing done by Chain Heal - else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_SHAMAN && m_spellInfo->SpellFamilyFlags[0] & 0x100) - { - addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, addhealth, HEAL); - if (AuraEffect* aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_SHAMAN, 0, 0, 0x10, m_originalCasterGUID)) - { - addhealth = int32(addhealth * 1.25f); - // consume aura - unitTarget->RemoveAura(aurEff->GetBase()); - } - } // Death Pact - return pct of max health to caster else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && m_spellInfo->SpellFamilyFlags[0] & 0x00080000) addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, int32(caster->CountPctFromMaxHealth(damage)), HEAL); diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 96ee7a18429..5b5a48f33af 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -542,6 +542,51 @@ class spell_sha_lava_lash : public SpellScriptLoader } }; +// 1064 Chain Heal +class spell_sha_chain_heal : public SpellScriptLoader +{ + public: + spell_sha_chain_heal() : SpellScriptLoader("spell_sha_chain_heal") { } + + class spell_sha_chain_heal_SpellScript : public SpellScript + { + PrepareSpellScript(spell_sha_chain_heal_SpellScript); + + void HandleHeal(SpellEffIndex /*effIndex*/) + { + if (firstHeal) + { + // Check if the target has Riptide + if (AuraEffect* aurEff = GetHitUnit()->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_SHAMAN, 0, 0, 0x10, GetCaster()->GetGUID())) + { + riptide = true; + // Consume it + GetHitUnit()->RemoveAura(aurEff->GetBase()); + } + firstHeal = false; + } + // Riptide increases the Chain Heal effect by 25% + if (riptide) + SetHitHeal(GetHitHeal() * 1.25f); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_sha_chain_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); + firstHeal = true; + riptide = false; + } + + bool firstHeal; + bool riptide; + + }; + + SpellScript* GetSpellScript() const + { + return new spell_sha_chain_heal_SpellScript(); + } +}; void AddSC_shaman_spell_scripts() { @@ -556,4 +601,5 @@ void AddSC_shaman_spell_scripts() new spell_sha_healing_stream_totem(); new spell_sha_mana_spring_totem(); new spell_sha_lava_lash(); + new spell_sha_chain_heal(); } From 3bbabb14000d41f6b2dd1f0faf539d31c623a6a7 Mon Sep 17 00:00:00 2001 From: kaelima Date: Mon, 9 Apr 2012 03:02:45 +0200 Subject: [PATCH 0476/1149] Core/Spell: Fix crash when blinking on transports in instancable maps Closes #789 --- src/server/game/Entities/Player/Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index ea7985f67fe..1fa88ce86e7 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2134,7 +2134,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati if (duel && GetMapId() != mapid && GetMap()->GetGameObject(GetUInt64Value(PLAYER_DUEL_ARBITER))) DuelComplete(DUEL_FLED); - if ((GetMapId() == mapid && !m_transport) || (GetTransport() && GetMapId() == 628)) + if (GetMapId() == mapid) { //lets reset far teleport flag if it wasn't reset during chained teleports SetSemaphoreTeleportFar(false); From 7f903edcd90fe53b1a38d7524ab47c9cc1cecde7 Mon Sep 17 00:00:00 2001 From: kaelima Date: Mon, 9 Apr 2012 03:33:46 +0200 Subject: [PATCH 0477/1149] Core/DBLayer: Fix two crashes when using pdump command Closes #6107 --- .../shared/Database/Implementation/CharacterDatabase.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index a267a8b9d6d..772a52b62cf 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -27,9 +27,9 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_GUILD_BANK_ITEM, "DELETE FROM guild_bank_item WHERE guildid = ? AND TabId = ? AND SlotId = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_EXPIRED_BANS, "UPDATE character_banned SET active = 0 WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate <> bandate", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_GUID_BY_NAME, "SELECT guid FROM characters WHERE name = ?", CONNECTION_BOTH); - PREPARE_STATEMENT(CHAR_SEL_CHECK_NAME, "SELECT 1 FROM characters WHERE name = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_SEL_CHECK_NAME, "SELECT 1 FROM characters WHERE name = ?", CONNECTION_BOTH); PREPARE_STATEMENT(CHAR_SEL_CHECK_GUID, "SELECT 1 FROM characters WHERE guid = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_SUM_CHARS, "SELECT COUNT(guid) FROM characters WHERE account = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_SEL_SUM_CHARS, "SELECT COUNT(guid) FROM characters WHERE account = ?", CONNECTION_BOTH); PREPARE_STATEMENT(CHAR_SEL_CHAR_CREATE_INFO, "SELECT level, race, class FROM characters WHERE account = ? LIMIT 0, ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_CHARACTER_BAN, "INSERT INTO character_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?, 1)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_CHARACTER_BAN, "UPDATE character_banned SET active = 0 WHERE guid = ? AND active != 0", CONNECTION_ASYNC) From fe5a5de0f771360e7902a9434b1aaf713e79af17 Mon Sep 17 00:00:00 2001 From: kaelima Date: Mon, 9 Apr 2012 04:17:12 +0200 Subject: [PATCH 0478/1149] Tools/PlayerDump: - Fixed field number for characters.deleteInfos_Account - Add missing break for "receiver" (DTT_MAIL) --- src/server/game/Tools/PlayerDump.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp index 8d5d16d22b9..476a19b6885 100644 --- a/src/server/game/Tools/PlayerDump.cpp +++ b/src/server/game/Tools/PlayerDump.cpp @@ -306,22 +306,28 @@ bool PlayerDumpWriter::DumpTable(std::string& dump, uint32 guid, char const*tabl switch (type) { case DTT_INVENTORY: - StoreGUID(result, 3, items); break; // item guid collection (character_inventory.item) + StoreGUID(result, 3, items); // item guid collection (character_inventory.item) + break; case DTT_PET: - StoreGUID(result, 0, pets); break; // pet petnumber collection (character_pet.id) + StoreGUID(result, 0, pets); // pet petnumber collection (character_pet.id) + break; case DTT_MAIL: - StoreGUID(result, 0, mails); // mail id collection (mail.id) + StoreGUID(result, 0, mails); // mail id collection (mail.id) + break; case DTT_MAIL_ITEM: - StoreGUID(result, 1, items); break; // item guid collection (mail_items.item_guid) + StoreGUID(result, 1, items); // item guid collection (mail_items.item_guid) + break; case DTT_CHARACTER: { - if (result->GetFieldCount() <= 67) // avoid crashes on next check - return true; - if (result->Fetch()[67].GetUInt32()) // characters.deleteInfos_Account - if filled error + if (result->GetFieldCount() <= 68) // avoid crashes on next check + sLog->outCrash("PlayerDumpWriter::DumpTable - Trying to access non-existing or wrong positioned field (`deleteInfos_Account`) in `characters` table."); + + if (result->Fetch()[68].GetUInt32()) // characters.deleteInfos_Account - if filled error return false; break; } - default: break; + default: + break; } dump += CreateDumpString(tableTo, result); From bfc73920c72c1a5ee60ea5cddf9197dd80d5a3e6 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 9 Apr 2012 10:58:20 +0200 Subject: [PATCH 0479/1149] Scripts/Spells: Corrected Riptide script, preparing variable should be done in Load hook, not Register --- src/server/scripts/Spells/spell_shaman.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 5b5a48f33af..1a0f4576fea 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -552,6 +552,13 @@ class spell_sha_chain_heal : public SpellScriptLoader { PrepareSpellScript(spell_sha_chain_heal_SpellScript); + bool Load() + { + firstHeal = true; + riptide = false; + return true; + } + void HandleHeal(SpellEffIndex /*effIndex*/) { if (firstHeal) @@ -573,13 +580,10 @@ class spell_sha_chain_heal : public SpellScriptLoader void Register() { OnEffectHitTarget += SpellEffectFn(spell_sha_chain_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); - firstHeal = true; - riptide = false; } - + bool firstHeal; bool riptide; - }; SpellScript* GetSpellScript() const From 5f52cb0d8cd2a7036dd40576e5c3c5bb6b4ce1f1 Mon Sep 17 00:00:00 2001 From: kaelima Date: Mon, 9 Apr 2012 13:39:36 +0200 Subject: [PATCH 0480/1149] Core/Spell: fix crash from 268401029e1bc3fa0a052cb15d86123c5ecd1e6a --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 2420c804edb..52269199146 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1542,7 +1542,7 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe // Magic damage, check for resists // Ignore spells that cant be resisted - if ((schoolMask & SPELL_SCHOOL_MASK_NORMAL) == 0 && (spellInfo->AttributesEx4 & SPELL_ATTR4_IGNORE_RESISTANCES) == 0) + if ((schoolMask & SPELL_SCHOOL_MASK_NORMAL) == 0 && (spellInfo && (spellInfo->AttributesEx4 & SPELL_ATTR4_IGNORE_RESISTANCES) == 0)) { float victimResistance = float(victim->GetResistance(schoolMask)); victimResistance += float(GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, schoolMask)); From 3988e8ed96fd494b2cdba73a89ee47a10b338b25 Mon Sep 17 00:00:00 2001 From: kaelima Date: Mon, 9 Apr 2012 14:26:50 +0200 Subject: [PATCH 0481/1149] Core/DBLayer: Correct a type in HandleUnFreezeCommand (lowguid) --- src/server/game/Chat/Commands/Level3.cpp | 39 ++++++++++++------------ 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 54a9edefc03..045d5e144a9 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -4593,40 +4593,38 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args) { std::string name; Player* player; - char *TargetName = strtok((char*)args, " "); //get entered name - if (!TargetName) //if no name entered use target - { - player = getSelectedPlayer(); - if (player) //prevent crash with creature as target - name = player->GetName(); - } + char* targetName = strtok((char*)args, " "); // Get entered name - else // if name entered + if (targetName) { - name = TargetName; + name = targetName; normalizePlayerName(name); player = sObjectAccessor->FindPlayerByName(name.c_str()); } + else // If no name was entered - use target + { + player = getSelectedPlayer(); + if (player) + name = player->GetName(); + } - //effect if (player) { PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str()); - //Reset player faction + allow combat + allow duels + // Reset player faction + allow combat + allow duels player->setFactionForRace(player->getRace()); player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - //allow movement and spells + // Remove Freeze spell (allowing movement and spells) player->RemoveAurasDueToSpell(9454); - //save player + // Save player player->SaveToDB(); } - - if (!player) + else { - if (TargetName) + if (targetName) { // Check for offline players PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_GUID_BY_NAME); @@ -4638,12 +4636,13 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args) SendSysMessage(LANG_COMMAND_FREEZE_WRONG); return true; } - //if player found: delete his freeze aura - Field* fields=result->Fetch(); - uint64 pguid = fields[0].GetUInt64(); + + // If player found: delete his freeze aura + Field* fields = result->Fetch(); + uint32 lowGuid = fields[0].GetUInt32(); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA_FROZEN); - stmt->setUInt32(0, pguid); + stmt->setUInt32(0, lowGuid); CharacterDatabase.Execute(stmt); PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str()); From 4c961ff393da427e023f83fe6bb9b645e5f5c1ff Mon Sep 17 00:00:00 2001 From: kaelima Date: Mon, 9 Apr 2012 14:28:46 +0200 Subject: [PATCH 0482/1149] Core/Scripts: Remove some unnecessary creature/player casts in scripts and do some safer casting in a silithus script --- .../game/AI/ScriptedAI/ScriptedCreature.cpp | 11 ++- .../ScarletEnclave/chapter1.cpp | 13 ++-- .../EasternKingdoms/eversong_woods.cpp | 4 +- .../EasternKingdoms/isle_of_queldanas.cpp | 4 +- src/server/scripts/Kalimdor/silithus.cpp | 72 ++++++++++--------- 5 files changed, 56 insertions(+), 48 deletions(-) diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index e48112a5a5f..0f0e2e416a2 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -297,14 +297,13 @@ void ScriptedAI::DoTeleportTo(const float position[4]) void ScriptedAI::DoTeleportPlayer(Unit* unit, float x, float y, float z, float o) { - if (!unit || unit->GetTypeId() != TYPEID_PLAYER) - { - if (unit) - sLog->outError("TSCR: Creature " UI64FMTD " (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: " UI64FMTD ") to x: %f y:%f z: %f o: %f. Aborted.", me->GetGUID(), me->GetEntry(), unit->GetTypeId(), unit->GetGUID(), x, y, z, o); + if (!unit) return; - } - CAST_PLR(unit)->TeleportTo(unit->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT); + if (Player* player = unit->ToPlayer()) + player->TeleportTo(unit->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT); + else + sLog->outError("TSCR: Creature " UI64FMTD " (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: " UI64FMTD ") to x: %f y:%f z: %f o: %f. Aborted.", me->GetGUID(), me->GetEntry(), unit->GetTypeId(), unit->GetGUID(), x, y, z, o); } void ScriptedAI::DoTeleportAll(float x, float y, float z, float o) diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index ceab845f0a2..37808e2b924 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -809,11 +809,11 @@ public: { for (std::list::const_iterator itr = MinionList.begin(); itr != MinionList.end(); ++itr) { - if (CAST_CRE(*itr)->GetOwner()->GetGUID() == me->GetOwner()->GetGUID()) + if ((*itr)->GetOwner()->GetGUID() == me->GetOwner()->GetGUID()) { - if (CAST_CRE(*itr)->isInCombat() && CAST_CRE(*itr)->getAttackerForHelper()) + if ((*itr)->isInCombat() && (*itr)->getAttackerForHelper()) { - AttackStart(CAST_CRE(*itr)->getAttackerForHelper()); + AttackStart((*itr)->getAttackerForHelper()); } } } @@ -826,10 +826,11 @@ public: { if (Unit* owner = me->GetOwner()) { - if (owner->GetTypeId() == TYPEID_PLAYER && CAST_PLR(owner)->isInCombat()) + Player* plrOwner = owner->ToPlayer(); + if (plrOwner && plrOwner->isInCombat()) { - if (CAST_PLR(owner)->getAttackerForHelper() && CAST_PLR(owner)->getAttackerForHelper()->GetEntry() == GHOSTS) - AttackStart(CAST_PLR(owner)->getAttackerForHelper()); + if (plrOwner->getAttackerForHelper() && plrOwner->getAttackerForHelper()->GetEntry() == GHOSTS) + AttackStart(plrOwner->getAttackerForHelper()); else FindMinions(owner); } diff --git a/src/server/scripts/EasternKingdoms/eversong_woods.cpp b/src/server/scripts/EasternKingdoms/eversong_woods.cpp index 016dd60b39c..8ae72e142c8 100644 --- a/src/server/scripts/EasternKingdoms/eversong_woods.cpp +++ b/src/server/scripts/EasternKingdoms/eversong_woods.cpp @@ -490,14 +490,14 @@ public: { if (PlayerGUID) if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - CAST_PLR(player)->FailQuest(QUEST_UNEXPECTED_RESULT); + player->FailQuest(QUEST_UNEXPECTED_RESULT); } void UpdateAI(const uint32 /*diff*/) { if (KillCount >= 3 && PlayerGUID) if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - CAST_PLR(player)->CompleteQuest(QUEST_UNEXPECTED_RESULT); + player->CompleteQuest(QUEST_UNEXPECTED_RESULT); if (Summon) { diff --git a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp index b0b09c0ec76..27d8ea3e51c 100644 --- a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp +++ b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp @@ -129,8 +129,8 @@ public: PlayerGUID = caster->GetGUID(); if (PlayerGUID) { - Unit* player = Unit::GetUnit(*me, PlayerGUID); - if (player && CAST_PLR(player)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE) + Player* player = Unit::GetPlayer(*me, PlayerGUID); + if (player && player->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE) DoCast(player, 45110, true); } DoCast(me, ENRAGE); diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp index 79c6f7172b5..2e6234c3269 100644 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ b/src/server/scripts/Kalimdor/silithus.cpp @@ -979,16 +979,14 @@ public: //uint8 QirajiWaspCount = 0; for (uint8 i = 0; i < 67; ++i) { - float X = SpawnLocation[locIndex + i].x; - float Y = SpawnLocation[locIndex + i].y; - float Z = SpawnLocation[locIndex + i].z; - float O = SpawnLocation[locIndex + i].o; + float x = SpawnLocation[locIndex + i].x; + float y = SpawnLocation[locIndex + i].y; + float z = SpawnLocation[locIndex + i].z; + float o = SpawnLocation[locIndex + i].o; uint32 desptimer = WavesInfo[WaveCount].DespTimer; - Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, X, Y, Z, O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer); - if (spawn) + if (Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, x, y, z, o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer)) { - spawn->LoadCreaturesAddon(); if (spawn->GetEntry() == 15423) spawn->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15427+rand()%4); if (i >= 30) WaveCount = 1; @@ -998,9 +996,11 @@ public: if (WaveCount < 5) //1-4 Wave { - mob_qiraj_war_spawn::mob_qiraj_war_spawnAI* spawnAI = CAST_AI(mob_qiraj_war_spawn::mob_qiraj_war_spawnAI, spawn->AI()); - spawnAI->MobGUID = me->GetGUID(); - spawnAI->PlayerGUID = PlayerGUID; + if (mob_qiraj_war_spawn::mob_qiraj_war_spawnAI* spawnAI = CAST_AI(mob_qiraj_war_spawn::mob_qiraj_war_spawnAI, spawn->AI())) + { + spawnAI->MobGUID = me->GetGUID(); + spawnAI->PlayerGUID = PlayerGUID; + } } } } @@ -1017,27 +1017,27 @@ public: if (Group* EventGroup = player->GetGroup()) { - Player* GroupMember; + Player* groupMember; uint8 GroupMemberCount = 0; uint8 DeadMemberCount = 0; uint8 FailedMemberCount = 0; - const Group::MemberSlotList members = EventGroup->GetMemberSlots(); + Group::MemberSlotList const members = EventGroup->GetMemberSlots(); for (Group::member_citerator itr = members.begin(); itr!= members.end(); ++itr) { - GroupMember = (Unit::GetPlayer(*me, itr->guid)); - if (!GroupMember) + groupMember = (Unit::GetPlayer(*me, itr->guid)); + if (!groupMember) continue; - if (!GroupMember->IsWithinDistInMap(me, EVENT_AREA_RADIUS) && GroupMember->GetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) == QUEST_STATUS_INCOMPLETE) + if (!groupMember->IsWithinDistInMap(me, EVENT_AREA_RADIUS) && groupMember->GetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) == QUEST_STATUS_INCOMPLETE) { - GroupMember->FailQuest(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD); + groupMember->FailQuest(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD); ++FailedMemberCount; } ++GroupMemberCount; - if (GroupMember->isDead()) + if (groupMember->isDead()) ++DeadMemberCount; } @@ -1081,8 +1081,13 @@ public: void mob_qiraj_war_spawn::mob_qiraj_war_spawnAI::JustDied(Unit* /*slayer*/) { me->RemoveCorpse(); - if (Creature* Mob = (Unit::GetCreature(*me, MobGUID))) - CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, Mob->AI())->LiveCounter(); + + if (!MobGUID) + return; + + if (Creature* mob = Unit::GetCreature(*me, MobGUID)) + if (npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI* triggerAI = CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, mob->AI())) + triggerAI->LiveCounter(); }; @@ -1099,15 +1104,13 @@ public: { if (quest->GetQuestId() == QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) { - - if (Unit* Anachronos_Quest_Trigger = go->FindNearestCreature(15454, 100, player)) + if (Creature* trigger = go->FindNearestCreature(15454, 100, player)) { - - Unit* Merithra = Anachronos_Quest_Trigger->SummonCreature(15378, -8034.535f, 1535.14f, 2.61f, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - Unit* Caelestrasz = Anachronos_Quest_Trigger->SummonCreature(15379, -8032.767f, 1533.148f, 2.61f, 1.5f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - Unit* Arygos = Anachronos_Quest_Trigger->SummonCreature(15380, -8034.52f, 1537.843f, 2.61f, 5.7f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - /* Unit* Fandral = */ Anachronos_Quest_Trigger->SummonCreature(15382, -8028.462f, 1535.843f, 2.61f, 3.141592f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - Creature* Anachronos = Anachronos_Quest_Trigger->SummonCreature(15381, -8028.75f, 1538.795f, 2.61f, 4, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); + Unit* Merithra = trigger->SummonCreature(15378, -8034.535f, 1535.14f, 2.61f, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); + Unit* Caelestrasz = trigger->SummonCreature(15379, -8032.767f, 1533.148f, 2.61f, 1.5f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); + Unit* Arygos = trigger->SummonCreature(15380, -8034.52f, 1537.843f, 2.61f, 5.7f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); + /* Unit* Fandral = */ trigger->SummonCreature(15382, -8028.462f, 1535.843f, 2.61f, 3.141592f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); + Creature* Anachronos = trigger->SummonCreature(15381, -8028.75f, 1538.795f, 2.61f, 4, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); if (Merithra) { @@ -1135,11 +1138,16 @@ public: if (Anachronos) { - CAST_AI(npc_anachronos_the_ancient::npc_anachronos_the_ancientAI, Anachronos->AI())->PlayerGUID = player->GetGUID(); - CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, CAST_CRE(Anachronos_Quest_Trigger)->AI())->Failed=false; - CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, CAST_CRE(Anachronos_Quest_Trigger)->AI())->PlayerGUID = player->GetGUID(); - CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, CAST_CRE(Anachronos_Quest_Trigger)->AI())->EventStarted=true; - CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, CAST_CRE(Anachronos_Quest_Trigger)->AI())->Announced=true; + if (npc_anachronos_the_ancient::npc_anachronos_the_ancientAI* anachronosAI = CAST_AI(npc_anachronos_the_ancient::npc_anachronos_the_ancientAI, Anachronos->AI())) + anachronosAI->PlayerGUID = player->GetGUID(); + + if (npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI* triggerAI = CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, trigger->AI())) + { + triggerAI->Failed = false; + triggerAI->PlayerGUID = player->GetGUID(); + triggerAI->EventStarted = true; + triggerAI->Announced = true; + } } } } From 1f1e243bfa490ff32d8b047793d48d09cad14405 Mon Sep 17 00:00:00 2001 From: kaelima Date: Mon, 9 Apr 2012 15:00:52 +0200 Subject: [PATCH 0483/1149] Core/Movement: Fix some issues with ConfusedMovementGenerator from recent changes. - Z position was not set if LOS-check failed, and thereafter causing a crash when trying to move to a uninitialized z-choord. - Also fixes bad coords in water Closes #6124 --- .../ConfusedMovementGenerator.cpp | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index 03bc2570c0c..54a68f92c66 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -59,24 +59,24 @@ void ConfusedMovementGenerator::Initialize(T &unit) if ((is_water && !is_water_ok) || (!is_water && !is_land_ok)) { - //! Ignore bad generated path. Use the current or previous position. - i_waypoints[idx][0] = idx > 0 ? i_waypoints[idx-1][0] : x; - i_waypoints[idx][1] = idx > 0 ? i_waypoints[idx-1][1] : y; + //! Cannot use coordinates outside our InhabitType. Use the current or previous position. + wanderX = idx > 0 ? i_waypoints[idx-1][0] : x; + wanderY = idx > 0 ? i_waypoints[idx-1][1] : y; } - - unit.UpdateAllowedPositionZ(wanderX, wanderY, z); - - //! Positions are now fine - apply them to this waypoint - i_waypoints[idx][0] = wanderX; - i_waypoints[idx][1] = wanderY; - i_waypoints[idx][2] = z; } else { - //! Ignore bad generated path. Use the current or previous position. - i_waypoints[idx][0] = idx > 0 ? i_waypoints[idx-1][0] : x; - i_waypoints[idx][1] = idx > 0 ? i_waypoints[idx-1][1] : y; + //! Trying to access path outside line of sight. Skip this by using the current or previous position. + wanderX = idx > 0 ? i_waypoints[idx-1][0] : x; + wanderY = idx > 0 ? i_waypoints[idx-1][1] : y; } + + unit.UpdateAllowedPositionZ(wanderX, wanderY, z); + + //! Positions are fine - apply them to this waypoint + i_waypoints[idx][0] = wanderX; + i_waypoints[idx][1] = wanderY; + i_waypoints[idx][2] = z; } unit.StopMoving(); From 7f377964fbdda712bca09cc149e15321dfe8bd21 Mon Sep 17 00:00:00 2001 From: kandera Date: Mon, 9 Apr 2012 10:38:08 -0300 Subject: [PATCH 0484/1149] Core/Scripts: fix unrelenting assault procing on caster (thx gigatotem). both cast spells have target_unit_caster --- src/server/scripts/Spells/spell_warrior.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index c87c2e05289..2ce3c72580e 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -443,7 +443,7 @@ public: Unit* target = GetHitUnit(); if (target->HasUnitState(UNIT_STATE_CASTING)) - GetCaster()->CastSpell(target, spellId, true); + target->CastSpell(target, spellId, true); } void Register() From 3dabe220ce528b7ca6ca5917c19c62904d5d3b7d Mon Sep 17 00:00:00 2001 From: kaelima Date: Mon, 9 Apr 2012 16:03:05 +0200 Subject: [PATCH 0485/1149] Cmake: Remove no longer existing */dep/mersennetwister include Thanks Venugh for noticing --- src/server/game/CMakeLists.txt | 1 - src/server/scripts/CMakeLists.txt | 1 - src/server/shared/CMakeLists.txt | 1 - src/server/worldserver/CMakeLists.txt | 1 - 4 files changed, 4 deletions(-) diff --git a/src/server/game/CMakeLists.txt b/src/server/game/CMakeLists.txt index 1f680f6e9b0..8b81a48c33b 100644 --- a/src/server/game/CMakeLists.txt +++ b/src/server/game/CMakeLists.txt @@ -107,7 +107,6 @@ set(game_STAT_SRCS include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/dep/g3dlite/include - ${CMAKE_SOURCE_DIR}/dep/mersennetwister ${CMAKE_SOURCE_DIR}/dep/SFMT ${CMAKE_SOURCE_DIR}/dep/zlib ${CMAKE_SOURCE_DIR}/src/server/collision diff --git a/src/server/scripts/CMakeLists.txt b/src/server/scripts/CMakeLists.txt index 728d95a0851..f0136b065e8 100644 --- a/src/server/scripts/CMakeLists.txt +++ b/src/server/scripts/CMakeLists.txt @@ -53,7 +53,6 @@ include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/dep/g3dlite/include ${CMAKE_SOURCE_DIR}/dep/SFMT - ${CMAKE_SOURCE_DIR}/dep/mersennetwister ${CMAKE_SOURCE_DIR}/dep/zlib ${CMAKE_SOURCE_DIR}/src/server/shared ${CMAKE_SOURCE_DIR}/src/server/shared/Configuration diff --git a/src/server/shared/CMakeLists.txt b/src/server/shared/CMakeLists.txt index 3ec35b5394a..de998442419 100644 --- a/src/server/shared/CMakeLists.txt +++ b/src/server/shared/CMakeLists.txt @@ -53,7 +53,6 @@ set(shared_STAT_SRCS include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/dep/SFMT - ${CMAKE_SOURCE_DIR}/dep/mersennetwister ${CMAKE_SOURCE_DIR}/dep/sockets/include ${CMAKE_SOURCE_DIR}/dep/utf8cpp ${CMAKE_SOURCE_DIR}/src/server diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt index d1419cb0fcb..0d51f30449e 100644 --- a/src/server/worldserver/CMakeLists.txt +++ b/src/server/worldserver/CMakeLists.txt @@ -48,7 +48,6 @@ include_directories( ${CMAKE_SOURCE_DIR}/dep/gsoap ${CMAKE_SOURCE_DIR}/dep/sockets/include ${CMAKE_SOURCE_DIR}/dep/SFMT - ${CMAKE_SOURCE_DIR}/dep/mersennetwister ${CMAKE_SOURCE_DIR}/src/server/collision ${CMAKE_SOURCE_DIR}/src/server/collision/Management ${CMAKE_SOURCE_DIR}/src/server/collision/Models From abed18d695d1e04787826b41793316202b1ab93a Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 9 Apr 2012 17:36:10 +0200 Subject: [PATCH 0486/1149] Core/DBLayer: More type fixes --- src/server/scripts/Commands/cs_reload.cpp | 162 +++++++++++----------- 1 file changed, 80 insertions(+), 82 deletions(-) diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 5f192ffceee..1c119fdef4c 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -424,7 +424,7 @@ public: continue; } - CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(entry); + CreatureTemplate* cInfo = const_cast(sObjectMgr->GetCreatureTemplate(entry)); if (!cInfo) { handler->PSendSysMessage(LANG_COMMAND_CREATURESTORAGE_NOTFOUND, entry); @@ -435,90 +435,88 @@ public: Field* fields = result->Fetch(); - const_cast(cInfo)->DifficultyEntry[0] = fields[0].GetUInt32(); - const_cast(cInfo)->DifficultyEntry[1] = fields[1].GetUInt32(); - const_cast(cInfo)->DifficultyEntry[2] = fields[2].GetUInt32(); - const_cast(cInfo)->KillCredit[0] = fields[3].GetUInt32(); - const_cast(cInfo)->KillCredit[1] = fields[4].GetUInt32(); - const_cast(cInfo)->Modelid1 = fields[5].GetUInt32(); - const_cast(cInfo)->Modelid2 = fields[6].GetUInt32(); - const_cast(cInfo)->Modelid3 = fields[7].GetUInt32(); - const_cast(cInfo)->Modelid4 = fields[8].GetUInt32(); - const_cast(cInfo)->Name = fields[9].GetString(); - const_cast(cInfo)->SubName = fields[10].GetString(); - const_cast(cInfo)->IconName = fields[11].GetString(); - const_cast(cInfo)->GossipMenuId = fields[12].GetUInt32(); - const_cast(cInfo)->minlevel = fields[13].GetUInt32(); - const_cast(cInfo)->maxlevel = fields[14].GetUInt32(); - const_cast(cInfo)->expansion = fields[15].GetUInt32(); - const_cast(cInfo)->faction_A = fields[16].GetUInt32(); - const_cast(cInfo)->faction_H = fields[17].GetUInt32(); - const_cast(cInfo)->npcflag = fields[18].GetUInt32(); - const_cast(cInfo)->speed_walk = fields[19].GetFloat(); - const_cast(cInfo)->speed_run = fields[20].GetFloat(); - const_cast(cInfo)->scale = fields[21].GetFloat(); - const_cast(cInfo)->rank = fields[22].GetUInt32(); - const_cast(cInfo)->mindmg = fields[23].GetFloat(); - const_cast(cInfo)->maxdmg = fields[24].GetFloat(); - const_cast(cInfo)->dmgschool = fields[25].GetUInt32(); - const_cast(cInfo)->attackpower = fields[26].GetUInt32(); - const_cast(cInfo)->dmg_multiplier = fields[27].GetFloat(); - const_cast(cInfo)->baseattacktime = fields[28].GetUInt32(); - const_cast(cInfo)->rangeattacktime = fields[29].GetUInt32(); - const_cast(cInfo)->unit_class = fields[30].GetUInt32(); - const_cast(cInfo)->unit_flags = fields[31].GetUInt32(); - const_cast(cInfo)->dynamicflags = fields[32].GetUInt32(); - const_cast(cInfo)->family = fields[33].GetUInt32(); - const_cast(cInfo)->trainer_type = fields[34].GetUInt32(); - const_cast(cInfo)->trainer_spell = fields[35].GetUInt32(); - const_cast(cInfo)->trainer_class = fields[36].GetUInt32(); - const_cast(cInfo)->trainer_race = fields[37].GetUInt32(); - const_cast(cInfo)->minrangedmg = fields[38].GetFloat(); - const_cast(cInfo)->maxrangedmg = fields[39].GetFloat(); - const_cast(cInfo)->rangedattackpower = fields[40].GetUInt32(); - const_cast(cInfo)->type = fields[41].GetUInt32(); - const_cast(cInfo)->type_flags = fields[42].GetUInt32(); - const_cast(cInfo)->lootid = fields[43].GetUInt32(); - const_cast(cInfo)->pickpocketLootId = fields[44].GetUInt32(); - const_cast(cInfo)->SkinLootId = fields[45].GetUInt32(); + cInfo->DifficultyEntry[0] = fields[0].GetUInt32(); + cInfo->DifficultyEntry[1] = fields[1].GetUInt32(); + cInfo->DifficultyEntry[2] = fields[2].GetUInt32(); + cInfo->KillCredit[0] = fields[3].GetUInt32(); + cInfo->KillCredit[1] = fields[4].GetUInt32(); + cInfo->Modelid1 = fields[5].GetUInt32(); + cInfo->Modelid2 = fields[6].GetUInt32(); + cInfo->Modelid3 = fields[7].GetUInt32(); + cInfo->Modelid4 = fields[8].GetUInt32(); + cInfo->Name = fields[9].GetString(); + cInfo->SubName = fields[10].GetString(); + cInfo->IconName = fields[11].GetString(); + cInfo->GossipMenuId = fields[12].GetUInt32(); + cInfo->minlevel = fields[13].GetUInt8(); + cInfo->maxlevel = fields[14].GetUInt8(); + cInfo->expansion = fields[15].GetUInt16(); + cInfo->faction_A = fields[16].GetUInt16(); + cInfo->faction_H = fields[17].GetUInt16(); + cInfo->npcflag = fields[18].GetUInt32(); + cInfo->speed_walk = fields[19].GetFloat(); + cInfo->speed_run = fields[20].GetFloat(); + cInfo->scale = fields[21].GetFloat(); + cInfo->rank = fields[22].GetUInt8(); + cInfo->mindmg = fields[23].GetFloat(); + cInfo->maxdmg = fields[24].GetFloat(); + cInfo->dmgschool = fields[25].GetUInt8(); + cInfo->attackpower = fields[26].GetUInt32(); + cInfo->dmg_multiplier = fields[27].GetFloat(); + cInfo->baseattacktime = fields[28].GetUInt32(); + cInfo->rangeattacktime = fields[29].GetUInt32(); + cInfo->unit_class = fields[30].GetUInt8(); + cInfo->unit_flags = fields[31].GetUInt32(); + cInfo->dynamicflags = fields[32].GetUInt32(); + cInfo->family = fields[33].GetUInt8(); + cInfo->trainer_type = fields[34].GetUInt8(); + cInfo->trainer_spell = fields[35].GetUInt32(); + cInfo->trainer_class = fields[36].GetUInt8(); + cInfo->trainer_race = fields[37].GetUInt8(); + cInfo->minrangedmg = fields[38].GetFloat(); + cInfo->maxrangedmg = fields[39].GetFloat(); + cInfo->rangedattackpower = fields[40].GetUInt16(); + cInfo->type = fields[41].GetUInt8(); + cInfo->type_flags = fields[42].GetUInt32(); + cInfo->lootid = fields[43].GetUInt32(); + cInfo->pickpocketLootId = fields[44].GetUInt32(); + cInfo->SkinLootId = fields[45].GetUInt32(); for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) - { - const_cast(cInfo)->resistance[i] = fields[46 + i -1].GetUInt32(); - } + cInfo->resistance[i] = fields[46 + i -1].GetUInt16(); - const_cast(cInfo)->spells[0] = fields[52].GetUInt32(); - const_cast(cInfo)->spells[1] = fields[53].GetUInt32(); - const_cast(cInfo)->spells[2] = fields[54].GetUInt32(); - const_cast(cInfo)->spells[3] = fields[55].GetUInt32(); - const_cast(cInfo)->spells[4] = fields[56].GetUInt32(); - const_cast(cInfo)->spells[5] = fields[57].GetUInt32(); - const_cast(cInfo)->spells[6] = fields[58].GetUInt32(); - const_cast(cInfo)->spells[7] = fields[59].GetUInt32(); - const_cast(cInfo)->PetSpellDataId = fields[60].GetUInt32(); - const_cast(cInfo)->VehicleId = fields[61].GetUInt32(); - const_cast(cInfo)->mingold = fields[62].GetUInt32(); - const_cast(cInfo)->maxgold = fields[63].GetUInt32(); - const_cast(cInfo)->AIName = fields[64].GetString(); - const_cast(cInfo)->MovementType = fields[65].GetUInt32(); - const_cast(cInfo)->InhabitType = fields[66].GetUInt32(); - const_cast(cInfo)->HoverHeight = fields[67].GetFloat(); - const_cast(cInfo)->ModHealth = fields[68].GetFloat(); - const_cast(cInfo)->ModMana = fields[69].GetFloat(); - const_cast(cInfo)->ModArmor = fields[70].GetFloat(); - const_cast(cInfo)->RacialLeader = fields[71].GetBool(); - const_cast(cInfo)->questItems[0] = fields[72].GetUInt32(); - const_cast(cInfo)->questItems[1] = fields[73].GetUInt32(); - const_cast(cInfo)->questItems[2] = fields[74].GetUInt32(); - const_cast(cInfo)->questItems[3] = fields[75].GetUInt32(); - const_cast(cInfo)->questItems[4] = fields[76].GetUInt32(); - const_cast(cInfo)->questItems[5] = fields[77].GetUInt32(); - const_cast(cInfo)->movementId = fields[78].GetUInt32(); - const_cast(cInfo)->RegenHealth = fields[79].GetBool(); - const_cast(cInfo)->equipmentId = fields[80].GetUInt32(); - const_cast(cInfo)->MechanicImmuneMask = fields[81].GetUInt32(); - const_cast(cInfo)->flags_extra = fields[82].GetUInt32(); - const_cast(cInfo)->ScriptID = sObjectMgr->GetScriptId(fields[83].GetCString()); + cInfo->spells[0] = fields[52].GetUInt32(); + cInfo->spells[1] = fields[53].GetUInt32(); + cInfo->spells[2] = fields[54].GetUInt32(); + cInfo->spells[3] = fields[55].GetUInt32(); + cInfo->spells[4] = fields[56].GetUInt32(); + cInfo->spells[5] = fields[57].GetUInt32(); + cInfo->spells[6] = fields[58].GetUInt32(); + cInfo->spells[7] = fields[59].GetUInt32(); + cInfo->PetSpellDataId = fields[60].GetUInt32(); + cInfo->VehicleId = fields[61].GetUInt32(); + cInfo->mingold = fields[62].GetUInt32(); + cInfo->maxgold = fields[63].GetUInt32(); + cInfo->AIName = fields[64].GetString(); + cInfo->MovementType = fields[65].GetUInt8(); + cInfo->InhabitType = fields[66].GetUInt8(); + cInfo->HoverHeight = fields[67].GetFloat(); + cInfo->ModHealth = fields[68].GetFloat(); + cInfo->ModMana = fields[69].GetFloat(); + cInfo->ModArmor = fields[70].GetFloat(); + cInfo->RacialLeader = fields[71].GetBool(); + cInfo->questItems[0] = fields[72].GetUInt32(); + cInfo->questItems[1] = fields[73].GetUInt32(); + cInfo->questItems[2] = fields[74].GetUInt32(); + cInfo->questItems[3] = fields[75].GetUInt32(); + cInfo->questItems[4] = fields[76].GetUInt32(); + cInfo->questItems[5] = fields[77].GetUInt32(); + cInfo->movementId = fields[78].GetUInt32(); + cInfo->RegenHealth = fields[79].GetBool(); + cInfo->equipmentId = fields[80].GetUInt32(); + cInfo->MechanicImmuneMask = fields[81].GetUInt32(); + cInfo->flags_extra = fields[82].GetUInt32(); + cInfo->ScriptID = sObjectMgr->GetScriptId(fields[83].GetCString()); sObjectMgr->CheckCreatureTemplate(cInfo); } From 5d7d635b9ed1250878f6287e676f3387e1fb1dc7 Mon Sep 17 00:00:00 2001 From: click Date: Tue, 10 Apr 2012 02:06:10 +0200 Subject: [PATCH 0487/1149] Core: Add proper log output in Player::Create functions, warning admins about possible hackers during character creation --- src/server/game/Entities/Player/Player.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 1fa88ce86e7..b94a7a59664 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -932,7 +932,8 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) PlayerInfo const* info = sObjectMgr->GetPlayerInfo(createInfo->Race, createInfo->Class); if (!info) { - sLog->outError("Player (Name %s) has incorrect race/class pair. Can't be loaded.", m_name.c_str()); + sLog->outError("Player::Create: Possible hacking-attempt: Account '%s' tried creating a character named '%s' with an invalid race/class pair (%u/%u) - refusing to do so.", + GetSession()->GetAccountId(), m_name.c_str(), createInfo->Race, createInfo->Class); return false; } @@ -944,7 +945,8 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(createInfo->Class); if (!cEntry) { - sLog->outError("Class %u not found in DBC (Wrong DBC files?)", createInfo->Class); + sLog->outError("Player::Create: Possible hacking-attempt: Account '%s' tried creating a character named '%s' with an invalid character class (%u) - refusing to do so (wrong DBC-files?)", + GetSession()->GetAccountId(), m_name.c_str(), createInfo->Class); return false; } @@ -959,7 +961,8 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) if (!IsValidGender(createInfo->Gender)) { - sLog->outError("Player has invalid gender (%hu), can't be loaded.", createInfo->Gender); + sLog->outError("Player::Create: Possible hacking-attempt: Account '%s' tried creating a character named '%s' with an invalid gender (%hu) - refusing to do so", + GetSession()->GetAccountId(), m_name.c_str(), createInfo->Gender); return false; } From a470a5ad93420255338502f48339d13a0aa7bcb0 Mon Sep 17 00:00:00 2001 From: click Date: Tue, 10 Apr 2012 02:11:27 +0200 Subject: [PATCH 0488/1149] Fix a typo in previous commit --- src/server/game/Entities/Player/Player.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b94a7a59664..26ea7c110d2 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -932,7 +932,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) PlayerInfo const* info = sObjectMgr->GetPlayerInfo(createInfo->Race, createInfo->Class); if (!info) { - sLog->outError("Player::Create: Possible hacking-attempt: Account '%s' tried creating a character named '%s' with an invalid race/class pair (%u/%u) - refusing to do so.", + sLog->outError("Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid race/class pair (%u/%u) - refusing to do so.", GetSession()->GetAccountId(), m_name.c_str(), createInfo->Race, createInfo->Class); return false; } @@ -945,7 +945,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(createInfo->Class); if (!cEntry) { - sLog->outError("Player::Create: Possible hacking-attempt: Account '%s' tried creating a character named '%s' with an invalid character class (%u) - refusing to do so (wrong DBC-files?)", + sLog->outError("Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid character class (%u) - refusing to do so (wrong DBC-files?)", GetSession()->GetAccountId(), m_name.c_str(), createInfo->Class); return false; } @@ -961,7 +961,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) if (!IsValidGender(createInfo->Gender)) { - sLog->outError("Player::Create: Possible hacking-attempt: Account '%s' tried creating a character named '%s' with an invalid gender (%hu) - refusing to do so", + sLog->outError("Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid gender (%hu) - refusing to do so", GetSession()->GetAccountId(), m_name.c_str(), createInfo->Gender); return false; } From 6c5cabcf8ba42cc3118696c231a973523fc1d2ca Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 10 Apr 2012 20:04:45 -0500 Subject: [PATCH 0489/1149] Battlegrounds/WSG: Fixed door LoS in Warsong Gulch Closes #6147 Signed-off-by: Subv --- src/server/game/Battlegrounds/Battleground.cpp | 8 +++----- src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp | 4 ++-- src/server/game/Entities/GameObject/GameObject.cpp | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index f3c393eaa36..d6bfde021e7 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1459,9 +1459,8 @@ void Battleground::DoorClose(uint32 type) // If doors are open, close it if (obj->getLootState() == GO_ACTIVATED && obj->GetGoState() != GO_STATE_READY) { - // Change state to allow door to be closed obj->SetLootState(GO_READY); - obj->UseDoorOrButton(RESPAWN_ONE_DAY); + obj->SetGoState(GO_STATE_READY); } } else @@ -1473,9 +1472,8 @@ void Battleground::DoorOpen(uint32 type) { if (GameObject* obj = GetBgMap()->GetGameObject(BgObjects[type])) { - // Change state to be sure they will be opened - obj->SetLootState(GO_READY); - obj->UseDoorOrButton(RESPAWN_ONE_DAY); + obj->SetLootState(GO_ACTIVATED); + obj->SetGoState(GO_STATE_ACTIVE); } else sLog->outError("Battleground::DoorOpen: door gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!", diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index 86ad749b8b7..656c8897f9d 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -179,9 +179,9 @@ void BattlegroundWS::StartingEventCloseDoors() void BattlegroundWS::StartingEventOpenDoors() { - for (uint32 i = BG_WS_OBJECT_DOOR_A_1; i <= BG_WS_OBJECT_DOOR_A_4; ++i) + for (uint32 i = BG_WS_OBJECT_DOOR_A_1; i <= BG_WS_OBJECT_DOOR_A_6; ++i) DoorOpen(i); - for (uint32 i = BG_WS_OBJECT_DOOR_H_1; i <= BG_WS_OBJECT_DOOR_H_2; ++i) + for (uint32 i = BG_WS_OBJECT_DOOR_H_1; i <= BG_WS_OBJECT_DOOR_H_4; ++i) DoorOpen(i); SpawnBGObject(BG_WS_OBJECT_DOOR_A_5, RESPAWN_ONE_DAY); diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index cc53d0eb79f..bf1fc6ac706 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -138,7 +138,7 @@ void GameObject::AddToWorld() bool toggledState = GetGoState() == GO_STATE_READY; if (m_model) GetMap()->Insert(*m_model); - if ((startOpen && !toggledState) || (!startOpen && toggledState)) + if (startOpen ^ toggledState) EnableCollision(false); WorldObject::AddToWorld(); From e9ac667cce1e3e12dddf6c1deb3009f841cb486e Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 10 Apr 2012 20:09:24 -0500 Subject: [PATCH 0490/1149] Battlegrounds/WSG: Missing change from my previous commit --- src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index 656c8897f9d..5a60e371204 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -184,11 +184,6 @@ void BattlegroundWS::StartingEventOpenDoors() for (uint32 i = BG_WS_OBJECT_DOOR_H_1; i <= BG_WS_OBJECT_DOOR_H_4; ++i) DoorOpen(i); - SpawnBGObject(BG_WS_OBJECT_DOOR_A_5, RESPAWN_ONE_DAY); - SpawnBGObject(BG_WS_OBJECT_DOOR_A_6, RESPAWN_ONE_DAY); - SpawnBGObject(BG_WS_OBJECT_DOOR_H_3, RESPAWN_ONE_DAY); - SpawnBGObject(BG_WS_OBJECT_DOOR_H_4, RESPAWN_ONE_DAY); - for (uint32 i = BG_WS_OBJECT_A_FLAG; i <= BG_WS_OBJECT_BERSERKBUFF_2; ++i) SpawnBGObject(i, RESPAWN_IMMEDIATELY); From a998e9e58a42a1a6ad38fc13da1968c9ee6a4b31 Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 10 Apr 2012 20:12:13 -0500 Subject: [PATCH 0491/1149] Collision/GameObjects: Corrected a possible logic fail Signed-off-by: Subv --- src/server/game/Entities/GameObject/GameObject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index bf1fc6ac706..d96c9052b7a 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -135,7 +135,7 @@ void GameObject::AddToWorld() sObjectAccessor->AddObject(this); bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false); // The state can be changed after GameObject::Create but before GameObject::AddToWorld - bool toggledState = GetGoState() == GO_STATE_READY; + bool toggledState = GetGOData() ? GetGOData()->go_state == GO_STATE_READY : false; if (m_model) GetMap()->Insert(*m_model); if (startOpen ^ toggledState) From 26ff19dbf82ab252aa83eba18f8786452d83d292 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 11 Apr 2012 13:40:17 +0200 Subject: [PATCH 0492/1149] Scripts/Silithus: Fix crash when doing "A Pawn on the Eternal Board" Closes #6156 --- src/server/scripts/Kalimdor/silithus.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp index 2e6234c3269..2d91f32fe9d 100644 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ b/src/server/scripts/Kalimdor/silithus.cpp @@ -972,17 +972,15 @@ public: void SummonNextWave() { - //uint8 count = WavesInfo[WaveCount].SpawnCount; uint8 locIndex = WavesInfo[WaveCount].UsedSpawnPoint; - //uint8 KaldoreiSoldierCount = 0; - //uint8 AnubisathConquerorCount = 0; - //uint8 QirajiWaspCount = 0; - for (uint8 i = 0; i < 67; ++i) + uint8 count = locIndex + WavesInfo[WaveCount].SpawnCount; + + for (uint8 i = locIndex; i <= count; ++i) { - float x = SpawnLocation[locIndex + i].x; - float y = SpawnLocation[locIndex + i].y; - float z = SpawnLocation[locIndex + i].z; - float o = SpawnLocation[locIndex + i].o; + float x = SpawnLocation[i].x; + float y = SpawnLocation[i].y; + float z = SpawnLocation[i].z; + float o = SpawnLocation[i].o; uint32 desptimer = WavesInfo[WaveCount].DespTimer; if (Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, x, y, z, o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer)) @@ -1004,6 +1002,7 @@ public: } } } + WaveTimer = WavesInfo[WaveCount].SpawnTimer; AnnounceTimer = WavesInfo[WaveCount].YellTimer; } From 7cc2c6109ac210bc0d34cc612e6b429136cb5f11 Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 11 Apr 2012 10:24:51 -0400 Subject: [PATCH 0493/1149] Core/Spells: Fix vigilance taunt cooldown spell targeting. cleanup some whitespace --- src/server/game/Entities/Unit/Unit.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 52269199146..d5db4ca9714 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -4499,7 +4499,7 @@ float Unit::GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 misc_valu if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) AddPctN(multiplier, (*i)->GetAmount()); } - + for (std::map::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) AddPctN(multiplier, itr->second); @@ -4546,7 +4546,7 @@ int32 Unit::GetTotalAuraModifierByAffectMask(AuraType auratype, SpellInfo const* if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) modifier += (*i)->GetAmount(); } - + for (std::map::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) modifier += itr->second; @@ -8322,6 +8322,12 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg RemoveAuraFromStack(auraSpellInfo->Id); return false; } + if (auraSpellInfo->Id == 50720) + { + target = triggeredByAura->GetCaster(); + if (!target) + return false; + } break; case SPELLFAMILY_WARLOCK: { @@ -9551,7 +9557,7 @@ bool Unit::Attack(Unit* victim, bool meleeAttack) if (this->GetTypeId() == TYPEID_PLAYER) { Pet* playerPet = this->ToPlayer()->GetPet(); - + if (playerPet && playerPet->isAlive()) playerPet->AI()->OwnerAttacked(victim); } From 0506877e2accabfe2c0acce6a2c4d0066e0c321b Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 11 Apr 2012 17:52:44 +0200 Subject: [PATCH 0494/1149] Core/Vehicles: Use DespawnOrUnsummon in Vehicle::Dismiss to call AI despawn hooks. --- src/server/game/Entities/Vehicle/Vehicle.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index f3d6e8abc79..4ce05ff40d3 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -453,11 +453,12 @@ void Vehicle::RelocatePassengers(float x, float y, float z, float ang) void Vehicle::Dismiss() { + if (GetBase()->GetTypeId() != TYPEID_UNIT) + return; + sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::Dismiss Entry: %u, GuidLow %u", _creatureEntry, _me->GetGUIDLow()); Uninstall(); - _me->DestroyForNearbyPlayers(); - _me->CombatStop(); - _me->AddObjectToRemoveList(); + GetBase()->ToCreature()->DespawnOrUnsummon(); } void Vehicle::InitMovementInfoForBase() From be5b91f6bb9f98d40723807a03da6dc00d6b6aff Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 11 Apr 2012 17:53:55 +0200 Subject: [PATCH 0495/1149] Scripts/Icecrown Citadel: Fixed crashes on despawning abominations during Professor Putricide's phase transition --- .../boss_professor_putricide.cpp | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index b66632b6eeb..541e52fb922 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -167,6 +167,33 @@ enum PutricideData #define EXPERIMENT_STATE_OOZE false #define EXPERIMENT_STATE_GAS true +class AbominationDespawner +{ + public: + explicit AbominationDespawner(Unit* owner) : _owner(owner) { } + + bool operator()(uint64 guid) + { + if (Unit* summon = ObjectAccessor::GetUnit(*_owner, guid)) + { + if (summon->GetEntry() == NPC_MUTATED_ABOMINATION_10 || summon->GetEntry() == NPC_MUTATED_ABOMINATION_25) + { + if (Vehicle* veh = summon->GetVehicleKit()) + veh->RemoveAllPassengers(); // also despawns the vehicle + + return true; + } + + return false; + } + + return true; + } + + private: + Unit* _owner; +}; + class boss_professor_putricide : public CreatureScript { public: @@ -477,8 +504,7 @@ class boss_professor_putricide : public CreatureScript SetPhase(PHASE_COMBAT_3); events.ScheduleEvent(EVENT_MUTATED_PLAGUE, 25000); events.CancelEvent(EVENT_UNSTABLE_EXPERIMENT); - summons.DespawnEntry(NPC_MUTATED_ABOMINATION_10); - summons.DespawnEntry(NPC_MUTATED_ABOMINATION_25); + summons.remove_if(AbominationDespawner(me)); break; default: break; From 6407582667f92018a57ff7607f5e353d9079d1fa Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 11 Apr 2012 11:56:35 -0400 Subject: [PATCH 0496/1149] Core/Attributes: change some attribute names to better describe what they are --- src/server/game/Miscellaneous/SharedDefines.h | 22 +++++++++---------- src/server/game/Spells/SpellMgr.cpp | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 1ddf80484e2..22f0ea35413 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -269,7 +269,7 @@ enum SpellAttr0 SPELL_ATTR0_UNK0 = 0x00000001, // 0 SPELL_ATTR0_REQ_AMMO = 0x00000002, // 1 on next ranged SPELL_ATTR0_ON_NEXT_SWING = 0x00000004, // 2 - SPELL_ATTR0_UNK3 = 0x00000008, // 3 not set in 3.0.3 + SPELL_ATTR0_IS_REPLENISHMENT = 0x00000008, // 3 not set in 3.0.3 SPELL_ATTR0_ABILITY = 0x00000010, // 4 client puts 'ability' instead of 'spell' in game strings for these spells SPELL_ATTR0_TRADESPELL = 0x00000020, // 5 trade spells (recipes), will be added by client to a sublist of profession spell SPELL_ATTR0_PASSIVE = 0x00000040, // 6 Passive spell @@ -314,7 +314,7 @@ enum SpellAttr1 SPELL_ATTR1_MELEE_COMBAT_START = 0x00000200, // 9 player starts melee combat after this spell is cast SPELL_ATTR1_NO_THREAT = 0x00000400, // 10 no generates threat on cast 100% (old NO_INITIAL_AGGRO) SPELL_ATTR1_UNK11 = 0x00000800, // 11 aura - SPELL_ATTR1_UNK12 = 0x00001000, // 12 pickpoket + SPELL_ATTR1_IS_PICKPOCKET = 0x00001000, // 12 Pickpocket SPELL_ATTR1_FARSIGHT = 0x00002000, // 13 Client removes farsight on aura loss SPELL_ATTR1_CHANNEL_TRACK_TARGET = 0x00004000, // 14 Client automatically forces player to face target when channeling SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY = 0x00008000, // 15 remove auras on immunity @@ -326,7 +326,7 @@ enum SpellAttr1 SPELL_ATTR1_UNK21 = 0x00200000, // 21 SPELL_ATTR1_REQ_COMBO_POINTS2 = 0x00400000, // 22 Req combo points on target SPELL_ATTR1_UNK23 = 0x00800000, // 23 - SPELL_ATTR1_UNK24 = 0x01000000, // 24 only fishing spells + SPELL_ATTR1_IS_FISHING = 0x01000000, // 24 only fishing spells SPELL_ATTR1_UNK25 = 0x02000000, // 25 SPELL_ATTR1_UNK26 = 0x04000000, // 26 works correctly with [target=focus] and [target=mouseover] macros? SPELL_ATTR1_UNK27 = 0x08000000, // 27 melee spell? @@ -351,17 +351,17 @@ enum SpellAttr2 SPELL_ATTR2_UNK10 = 0x00000400, // 10 related to tame SPELL_ATTR2_HEALTH_FUNNEL = 0x00000800, // 11 SPELL_ATTR2_UNK12 = 0x00001000, // 12 Cleave, Heart Strike, Maul, Sunder Armor, Swipe - SPELL_ATTR2_UNK13 = 0x00002000, // 13 Items enchanted by spells with this flag preserve the enchant to arenas + SPELL_ATTR2_PRESERVE_ENCHANT_IN_ARENA = 0x00002000, // 13 Items enchanted by spells with this flag preserve the enchant to arenas SPELL_ATTR2_UNK14 = 0x00004000, // 14 SPELL_ATTR2_UNK15 = 0x00008000, // 15 not set in 3.0.3 SPELL_ATTR2_TAME_BEAST = 0x00010000, // 16 SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS = 0x00020000, // 17 don't reset timers for melee autoattacks (swings) or ranged autoattacks (autoshoots) - SPELL_ATTR2_UNK18 = 0x00040000, // 18 Only Revive pet - possible req dead pet + SPELL_ATTR2_REQ_DEAD_PET = 0x00040000, // 18 Only Revive pet and Heart of the Pheonix SPELL_ATTR2_NOT_NEED_SHAPESHIFT = 0x00080000, // 19 does not necessarly need shapeshift SPELL_ATTR2_UNK20 = 0x00100000, // 20 SPELL_ATTR2_DAMAGE_REDUCED_SHIELD = 0x00200000, // 21 for ice blocks, pala immunity buffs, priest absorb shields, but used also for other spells -> not sure! SPELL_ATTR2_UNK22 = 0x00400000, // 22 Ambush, Backstab, Cheap Shot, Death Grip, Garrote, Judgements, Mutilate, Pounce, Ravage, Shiv, Shred - SPELL_ATTR2_UNK23 = 0x00800000, // 23 Only mage Arcane Concentration have this flag + SPELL_ATTR2_IS_ARCANE_CONCENTRATION = 0x00800000, // 23 Only mage Arcane Concentration have this flag SPELL_ATTR2_UNK24 = 0x01000000, // 24 SPELL_ATTR2_UNK25 = 0x02000000, // 25 SPELL_ATTR2_UNK26 = 0x04000000, // 26 unaffected by school immunity @@ -388,7 +388,7 @@ enum SpellAttr3 SPELL_ATTR3_BATTLEGROUND = 0x00000800, // 11 Can casted only on battleground SPELL_ATTR3_ONLY_TARGET_GHOSTS = 0x00001000, // 12 SPELL_ATTR3_UNK13 = 0x00002000, // 13 - SPELL_ATTR3_UNK14 = 0x00004000, // 14 "Honorless Target" only this spells have this flag + SPELL_ATTR3_IS_HONORLESS_TARGET = 0x00004000, // 14 "Honorless Target" only this spells have this flag SPELL_ATTR3_UNK15 = 0x00008000, // 15 Auto Shoot, Shoot, Throw, - this is autoshot flag SPELL_ATTR3_CANT_TRIGGER_PROC = 0x00010000, // 16 confirmed with many patchnotes SPELL_ATTR3_NO_INITIAL_AGGRO = 0x00020000, // 17 Soothe Animal, 39758, Mind Soothe @@ -432,16 +432,16 @@ enum SpellAttr4 SPELL_ATTR4_UNK19 = 0x00080000, // 19 proc dalayed, after damage or don't proc on absorb? SPELL_ATTR4_NOT_CHECK_SELFCAST_POWER = 0x00100000, // 20 supersedes message "More powerful spell applied" for self casts. SPELL_ATTR4_UNK21 = 0x00200000, // 21 Pally aura, dk presence, dudu form, warrior stance, shadowform, hunter track - SPELL_ATTR4_UNK22 = 0x00400000, // 22 + SPELL_ATTR4_UNK22 = 0x00400000, // 22 Seal of Command (42058,57770) and Gymer's Smash 55426 SPELL_ATTR4_UNK23 = 0x00800000, // 23 SPELL_ATTR4_UNK24 = 0x01000000, // 24 some shoot spell - SPELL_ATTR4_UNK25 = 0x02000000, // 25 pet scaling auras + SPELL_ATTR4_IS_PET_SCALING = 0x02000000, // 25 pet scaling auras SPELL_ATTR4_CAST_ONLY_IN_OUTLAND = 0x04000000, // 26 Can only be used in Outland. SPELL_ATTR4_UNK27 = 0x08000000, // 27 SPELL_ATTR4_UNK28 = 0x10000000, // 28 Aimed Shot SPELL_ATTR4_UNK29 = 0x20000000, // 29 SPELL_ATTR4_UNK30 = 0x40000000, // 30 - SPELL_ATTR4_UNK31 = 0x80000000 // 31 + SPELL_ATTR4_UNK31 = 0x80000000 // 31 Polymorph (chicken) 228 and Sonic Boom (38052,38488) }; enum SpellAttr5 @@ -461,7 +461,7 @@ enum SpellAttr5 SPELL_ATTR5_UNK12 = 0x00001000, // 12 Cleave related? SPELL_ATTR5_HASTE_AFFECT_DURATION = 0x00002000, // 13 haste effects decrease duration of this SPELL_ATTR5_UNK14 = 0x00004000, // 14 - SPELL_ATTR5_UNK15 = 0x00008000, // 15 + SPELL_ATTR5_UNK15 = 0x00008000, // 15 Inflits on multiple targets? SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK = 0x00010000, // 16 this allows spells with EquippedItemClass to affect spells from other items if the required item is equipped SPELL_ATTR5_USABLE_WHILE_FEARED = 0x00020000, // 17 usable while feared SPELL_ATTR5_USABLE_WHILE_CONFUSED = 0x00040000, // 18 usable while confused diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index cf200f19010..80ed1972a5d 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2094,7 +2094,7 @@ void SpellMgr::LoadEnchantCustomAttr() continue; // TODO: find a better check - if (!(spellInfo->AttributesEx2 & SPELL_ATTR2_UNK13) || !(spellInfo->Attributes & SPELL_ATTR0_NOT_SHAPESHIFT)) + if (!(spellInfo->AttributesEx2 & SPELL_ATTR2_PRESERVE_ENCHANT_IN_ARENA) || !(spellInfo->Attributes & SPELL_ATTR0_NOT_SHAPESHIFT)) continue; for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j) From 490809147baae2364e845614a989847088da9a92 Mon Sep 17 00:00:00 2001 From: Jildor Date: Wed, 11 Apr 2012 18:07:29 +0200 Subject: [PATCH 0497/1149] DB/Spells: Fix Honor Among Thieves proc --- sql/updates/world/2012_04_11_00_world_spell_proc_event.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2012_04_11_00_world_spell_proc_event.sql diff --git a/sql/updates/world/2012_04_11_00_world_spell_proc_event.sql b/sql/updates/world/2012_04_11_00_world_spell_proc_event.sql new file mode 100644 index 00000000000..e5dfbeb0e66 --- /dev/null +++ b/sql/updates/world/2012_04_11_00_world_spell_proc_event.sql @@ -0,0 +1,4 @@ +-- Honor Among Thieves proc +UPDATE `spell_proc_event` SET `CustomChance`=33 WHERE `entry`=51698; -- Rank 1 +UPDATE `spell_proc_event` SET `CustomChance`=66 WHERE `entry`=51700; -- Rank 2 +UPDATE `spell_proc_event` SET `CustomChance`=100 WHERE `entry`=51701; -- Rank 3 From f9ae8e68107d9ab4cb72b2e2d7e5c92f674ed146 Mon Sep 17 00:00:00 2001 From: faramir118 Date: Wed, 11 Apr 2012 19:51:26 +0200 Subject: [PATCH 0498/1149] Core/DBLayer: incorrect use of va_start Signed-off-by: Machiavelli --- src/server/shared/Database/DatabaseWorkerPool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/shared/Database/DatabaseWorkerPool.h b/src/server/shared/Database/DatabaseWorkerPool.h index 5fe31006bb2..8b69accfc23 100755 --- a/src/server/shared/Database/DatabaseWorkerPool.h +++ b/src/server/shared/Database/DatabaseWorkerPool.h @@ -239,7 +239,7 @@ class DatabaseWorkerPool va_list ap; char szQuery[MAX_QUERY_LEN]; - va_start(ap, sql); + va_start(ap, conn); vsnprintf(szQuery, MAX_QUERY_LEN, sql, ap); va_end(ap); From c7927a7796525b958140b0f58bd08851c9215ed3 Mon Sep 17 00:00:00 2001 From: faramir118 Date: Wed, 11 Apr 2012 19:54:35 +0200 Subject: [PATCH 0499/1149] Tools/MapExtractor: proper type for string literals Signed-off-by: Machiavelli --- src/tools/map_extractor/System.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index bbde9f4675e..cf2f2188a70 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -71,7 +71,7 @@ float CONF_flat_height_delta_limit = 0.005f; // If max - min less this value - s float CONF_flat_liquid_delta_limit = 0.001f; // If max - min less this value - liquid surface is flat // List MPQ for extract from -char *CONF_mpq_list[]={ +const char *CONF_mpq_list[]={ "common.MPQ", "common-2.MPQ", "lichking.MPQ", @@ -83,7 +83,7 @@ char *CONF_mpq_list[]={ "patch-5.MPQ", }; -static char* const langs[] = {"enGB", "enUS", "deDE", "esES", "frFR", "koKR", "zhCN", "zhTW", "enCN", "enTW", "esMX", "ruRU" }; +static const char* const langs[] = {"enGB", "enUS", "deDE", "esES", "frFR", "koKR", "zhCN", "zhTW", "enCN", "enTW", "esMX", "ruRU" }; #define LANG_COUNT 12 void CreateDir( const std::string& Path ) From c09cd267390a0b4a8c0a8643d193ebbaf4dadb79 Mon Sep 17 00:00:00 2001 From: faramir118 Date: Sat, 17 Mar 2012 01:39:41 -0500 Subject: [PATCH 0500/1149] wrong signature in a few overrides --- .../CavernsOfTime/DarkPortal/instance_dark_portal.cpp | 4 ++-- .../CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp | 2 +- .../scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp index dabf3db13cb..2c8cd096644 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp @@ -116,9 +116,9 @@ public: DoUpdateWorldState(WORLD_STATE_BM_RIFT, 0); } - bool IsEncounterInProgress() + bool IsEncounterInProgress() const { - if (GetData(TYPE_MEDIVH) == IN_PROGRESS) + if (const_cast(this)->GetData(TYPE_MEDIVH) == IN_PROGRESS) return true; return false; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index 74b9c038482..6252812e10a 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -759,7 +759,7 @@ class spell_powering_up : public SpellScriptLoader uint32 spellId; - bool Validate(SpellEntry const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellEntry*/) { spellId = sSpellMgr->GetSpellIdForDifficulty(SPELL_SURGE_OF_SPEED, GetCaster()); if (!sSpellMgr->GetSpellInfo(spellId)) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 33415cda157..462c767f599 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -1273,7 +1273,7 @@ class go_ulduar_tower : public GameObjectScript public: go_ulduar_tower() : GameObjectScript("go_ulduar_tower") { } - void OnDestroyed(GameObject* go, Player* /*player*/, uint32 /*value*/) + void OnDestroyed(GameObject* go, Player* /*player*/) { InstanceScript* instance = go->GetInstanceScript(); if (!instance) From e3f198ca568e270017585370bca972230dcf67f7 Mon Sep 17 00:00:00 2001 From: faramir118 Date: Sat, 17 Mar 2012 01:40:33 -0500 Subject: [PATCH 0501/1149] couple wrong return types --- src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 4 ++-- src/server/game/Chat/Chat.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 0f0e2e416a2..096ee695bcf 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -177,11 +177,11 @@ SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mec { //No target so we can't cast if (!target) - return false; + return NULL; //Silenced so we can't cast if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED)) - return false; + return NULL; //Using the extended script system we first create a list of viable spells SpellInfo const* apSpell[CREATURE_MAX_SPELLS]; diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 7a4c17d1c5e..22969601c32 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -1335,7 +1335,7 @@ GameTele const* ChatHandler::extractGameTeleFromLink(char* text) // id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r char* cId = extractKeyFromLink(text, "Htele"); if (!cId) - return false; + return NULL; // id case (explicit or from shift link) if (cId[0] >= '0' || cId[0] >= '9') @@ -1507,7 +1507,7 @@ char* ChatHandler::extractQuotedArg(char* args) { char* space = strtok(args, "\""); if (!space) - return false; + return NULL; return strtok(NULL, "\""); } } From d3c9817c601f1afd3f441d2ad5848fdc939d6936 Mon Sep 17 00:00:00 2001 From: faramir118 Date: Sat, 17 Mar 2012 01:45:31 -0500 Subject: [PATCH 0502/1149] make some dtors virtual this will prevent potential for future memory leaks --- src/server/game/Grids/GridStates.h | 1 + src/server/game/Warden/Warden.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game/Grids/GridStates.h b/src/server/game/Grids/GridStates.h index 08b66f6bb35..cf649f8d896 100755 --- a/src/server/game/Grids/GridStates.h +++ b/src/server/game/Grids/GridStates.h @@ -40,6 +40,7 @@ class GridState void setMagic() { i_Magic = MAGIC_TESTVAL; } unsigned int i_Magic; #endif + virtual ~GridState() {}; virtual void Update(Map &, NGridType&, GridInfo &, const uint32 t_diff) const = 0; }; diff --git a/src/server/game/Warden/Warden.h b/src/server/game/Warden/Warden.h index e06ea7dca25..d16890b31b9 100644 --- a/src/server/game/Warden/Warden.h +++ b/src/server/game/Warden/Warden.h @@ -107,7 +107,7 @@ class Warden public: Warden(); - ~Warden(); + virtual ~Warden(); virtual void Init(WorldSession* session, BigNumber* k) = 0; virtual ClientWardenModule* GetModuleForClient() = 0; From 7ae0cf8c35b11f7f44927604fbca521d81c22109 Mon Sep 17 00:00:00 2001 From: faramir118 Date: Tue, 20 Mar 2012 01:03:30 -0500 Subject: [PATCH 0503/1149] fix mistaken fallthrough --- src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index f3d0f5520f0..45335ae7b8b 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -837,6 +837,7 @@ void BattlegroundIC::DestroyGate(Player* player, GameObject* go) { case GO_HORDE_GATE_1: lang_entry = LANG_BG_IC_NORTH_GATE_DESTROYED; + break; case GO_HORDE_GATE_2: case GO_ALLIANCE_GATE_1: lang_entry = LANG_BG_IC_WEST_GATE_DESTROYED; From b1c4e8202e0c3f3a18811bda13e6f32bb0644864 Mon Sep 17 00:00:00 2001 From: faramir118 Date: Wed, 11 Apr 2012 20:00:51 +0200 Subject: [PATCH 0504/1149] Scripts/Karazhan/Midnight: Fix timer logic Signed-off-by: Machiavelli --- src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp index bbf87ac3e73..783ac6baad1 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp @@ -244,8 +244,8 @@ void boss_attumen::boss_attumenAI::UpdateAI(const uint32 diff) Midnight = 0; me->SetVisible(false); me->Kill(me); - } - } else ResetTimer -= diff; + } else ResetTimer -= diff; + } //Return since we have no target if (!UpdateVictim()) From ccf50f4c3d583132ac736e0ec44a1ba5ad3c3b32 Mon Sep 17 00:00:00 2001 From: faramir118 Date: Tue, 20 Mar 2012 01:06:47 -0500 Subject: [PATCH 0505/1149] dead code --- src/server/game/Chat/Channels/Channel.cpp | 1 - src/server/game/Entities/Creature/GossipDef.cpp | 3 --- .../Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp | 1 - 3 files changed, 5 deletions(-) diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index 92cf4d750a8..0e89601e987 100755 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -49,7 +49,6 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team) } else // it's custom channel { - channel_id = 0; m_flags |= CHANNEL_FLAG_CUSTOM; // If storing custom channels in the db is enabled either load or save the channel diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index a39bd8eddf7..836fbe8c7bf 100755 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -47,10 +47,7 @@ void GossipMenu::AddMenuItem(int32 menuItemId, uint8 icon, std::string const& me for (GossipMenuItemContainer::const_iterator itr = _menuItems.begin(); itr != _menuItems.end(); ++itr) { if (int32(itr->first) > menuItemId) - { - menuItemId = menuItemId; break; - } menuItemId = itr->first + 1; } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp index 28457b3b461..22307468f14 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp @@ -226,7 +226,6 @@ public: player->SendNewItem(item, 1, true, false, true); } player->SEND_GOSSIP_MENU(907, creature->GetGUID()); - CAST_AI(hyjalAI, creature->AI()); } return true; } From da8c7d23441467b0da4555fcccf6028a3d9665c1 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 11 Apr 2012 21:30:56 +0200 Subject: [PATCH 0506/1149] Core: Fixed warning C4263: 'bool Creature::SetDisableGravity(bool,bool)' : member function does not override any base class virtual member function --- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/game/Entities/Unit/Unit.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index d5db4ca9714..d49346b232a 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17565,7 +17565,7 @@ bool Unit::SetWalk(bool enable) return true; } -bool Unit::SetDisableGravity(bool disable) +bool Unit::SetDisableGravity(bool disable, bool packetOnly /*= false*/) { if (disable == IsLevitating()) return false; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index bb826c14dfc..00d66518d3f 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -707,7 +707,7 @@ enum MovementFlags MOVEMENTFLAG_MASK_TURNING = MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT, - MOVEMENTFLAG_MASK_MOVING_FLY = + MOVEMENTFLAG_MASK_MOVING_FLY = MOVEMENTFLAG_FLYING | MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING, //! TODO if needed: add more flags to this masks that are exclusive to players @@ -1647,7 +1647,7 @@ class Unit : public WorldObject bool IsLevitating() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);} bool IsWalking() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING);} virtual bool SetWalk(bool enable); - virtual bool SetDisableGravity(bool disable); + virtual bool SetDisableGravity(bool disable, bool packetOnly = false); bool SetHover(bool enable); void SetInFront(Unit const* target); From c38820c3bde1994e575c21daf9fb3cf79326a038 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Wed, 11 Apr 2012 22:35:23 +0300 Subject: [PATCH 0507/1149] Scripts/Twin Valkyr: Fix a crash in spell_powering_up_SpellScript. Author: Vincent-Michael --- .../CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index 6252812e10a..15c83be0104 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -759,7 +759,7 @@ class spell_powering_up : public SpellScriptLoader uint32 spellId; - bool Validate(SpellInfo const* /*spellEntry*/) + bool Load(SpellInfo const* /*spellEntry*/) { spellId = sSpellMgr->GetSpellIdForDifficulty(SPELL_SURGE_OF_SPEED, GetCaster()); if (!sSpellMgr->GetSpellInfo(spellId)) From c2948f6352e7472b1ddfc3db0ac4526622a0ea98 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 11 Apr 2012 22:47:54 +0200 Subject: [PATCH 0508/1149] Scripts/Trial of the Crusader: Fixed spell_powering_up_SpellScript once again --- .../CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index 15c83be0104..241d6239f82 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -759,7 +759,7 @@ class spell_powering_up : public SpellScriptLoader uint32 spellId; - bool Load(SpellInfo const* /*spellEntry*/) + bool Load() { spellId = sSpellMgr->GetSpellIdForDifficulty(SPELL_SURGE_OF_SPEED, GetCaster()); if (!sSpellMgr->GetSpellInfo(spellId)) From 54039b917c496e31d2579f3c2748c122946c6992 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 11 Apr 2012 16:32:01 -0500 Subject: [PATCH 0509/1149] Battlegrounds/WS: Fixed doors Closes #6170 Signed-off-by: Subv --- src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index 5a60e371204..495178f18dd 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -187,7 +187,12 @@ void BattlegroundWS::StartingEventOpenDoors() for (uint32 i = BG_WS_OBJECT_A_FLAG; i <= BG_WS_OBJECT_BERSERKBUFF_2; ++i) SpawnBGObject(i, RESPAWN_IMMEDIATELY); - // players joining later are not egible + SpawnBGObject(BG_WS_OBJECT_DOOR_A_5, RESPAWN_ONE_DAY); + SpawnBGObject(BG_WS_OBJECT_DOOR_A_6, RESPAWN_ONE_DAY); + SpawnBGObject(BG_WS_OBJECT_DOOR_H_3, RESPAWN_ONE_DAY); + SpawnBGObject(BG_WS_OBJECT_DOOR_H_4, RESPAWN_ONE_DAY); + + // players joining later are not eligibles StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, WS_EVENT_START_BATTLE); } From 397ee8ceb549cbfa5de949cd882ddc99cf3ea7c0 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 11 Apr 2012 17:41:36 -0500 Subject: [PATCH 0510/1149] Core/Spells: Execute spell procs after the healing effects of a spell Closes #216 Signed-off-by: Subv --- src/server/game/Spells/Spell.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 36d7328f37e..af3f53e2369 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2442,13 +2442,13 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) else procEx |= PROC_EX_NORMAL_HIT; - // Do triggers for unit (reflect triggers passed on hit phase for correct drop charge) - if (canEffectTrigger && missInfo != SPELL_MISS_REFLECT) - caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo, m_triggeredByAuraSpell); - int32 gain = caster->HealBySpell(unitTarget, m_spellInfo, addhealth, crit); unitTarget->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, m_spellInfo); m_healing = gain; + + // Do triggers for unit (reflect triggers passed on hit phase for correct drop charge) + if (canEffectTrigger && missInfo != SPELL_MISS_REFLECT) + caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo, m_triggeredByAuraSpell); } // Do damage and triggers else if (m_damage > 0) From f60e9a4f8470ad1aee888795a54bf40b8ad0ae98 Mon Sep 17 00:00:00 2001 From: kaelima Date: Thu, 12 Apr 2012 01:11:12 +0200 Subject: [PATCH 0511/1149] DB/Creature: Use proper model for Celestial Steed - fixes some animations Closes #6166 --- sql/updates/world/2012_04_12_00_world_creature_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_04_12_00_world_creature_template.sql diff --git a/sql/updates/world/2012_04_12_00_world_creature_template.sql b/sql/updates/world/2012_04_12_00_world_creature_template.sql new file mode 100644 index 00000000000..ef4596939f5 --- /dev/null +++ b/sql/updates/world/2012_04_12_00_world_creature_template.sql @@ -0,0 +1,2 @@ +-- Update proper modelid for Celestial Steed (31957 is wrong) +UPDATE `creature_template` SET `modelid1`=31958,`modelid2`=0 WHERE `entry`=40625; From 636d553aa83106e57efae5bef0d20d5ed31e98c3 Mon Sep 17 00:00:00 2001 From: kaelima Date: Thu, 12 Apr 2012 01:32:56 +0200 Subject: [PATCH 0512/1149] DB/WDB: Remove temp entry 68686 and replace with existing wdbverified (doesnt really fix anything, just for the sake of using proper entries) --- sql/updates/world/2012_04_12_01_world_creature_template.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sql/updates/world/2012_04_12_01_world_creature_template.sql diff --git a/sql/updates/world/2012_04_12_01_world_creature_template.sql b/sql/updates/world/2012_04_12_01_world_creature_template.sql new file mode 100644 index 00000000000..bfe7b698ae9 --- /dev/null +++ b/sql/updates/world/2012_04_12_01_world_creature_template.sql @@ -0,0 +1,6 @@ +UPDATE `creature_template` SET `WDBVerified`=12340 WHERE `entry`=40624; -- Verified + +-- Remove temp entry 68686 and replace with wdb verified 38686 +UPDATE `creature_template` SET `difficulty_entry_3`=38686 WHERE `entry`=36950; +UPDATE `creature_template` SET `minlevel`=82,`maxlevel`=82,`exp`=2,`faction_A`=84,`faction_H`=84,`mindmg`=488,`maxdmg`=642,`attackpower`=782,`unit_flags`=32832,`dynamicflags`=8,`minrangedmg`=363,`maxrangedmg`=521,`rangedattackpower`=121 WHERE `entry`=38686; +DELETE FROM `creature_template` WHERE `entry`=68686; From 40309110acae2e621db67dc221fb03a145cf84a0 Mon Sep 17 00:00:00 2001 From: tobmaps Date: Thu, 12 Apr 2012 01:50:09 +0200 Subject: [PATCH 0513/1149] DB/Spell Bonus Data: - Set 0 values for some spells that should never scale with spell power. If some have been left out please report an issue. - Set 20% ap coefficient for Howling Blast Closes #6163 Closes #4166 Closes #436 --- .../2012_04_12_02_world_spell_bonus_data.sql | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 sql/updates/world/2012_04_12_02_world_spell_bonus_data.sql diff --git a/sql/updates/world/2012_04_12_02_world_spell_bonus_data.sql b/sql/updates/world/2012_04_12_02_world_spell_bonus_data.sql new file mode 100644 index 00000000000..a6386c4285d --- /dev/null +++ b/sql/updates/world/2012_04_12_02_world_spell_bonus_data.sql @@ -0,0 +1,29 @@ +-- Druid +UPDATE `spell_bonus_data` SET `direct_bonus`=0,`dot_bonus`=0 WHERE `entry` IN (779,1822,60089); +DELETE FROM `spell_bonus_data` WHERE `entry` IN (1079,9007,22568); +INSERT INTO `spell_bonus_data` VALUES +(1079,0,0,-1,-1, 'Druid - Rip'), +(9007,0,0,-1,-1, 'Druid - Pounce Bleed'), +(22568,0,0,-1,-1, 'Druid - Ferocious Bite'); + +-- Hunter +UPDATE `spell_bonus_data` SET `direct_bonus`=0,`dot_bonus`=0 WHERE `entry` IN (3044,3674,53352,13812,13797,1978,42243); +UPDATE `spell_bonus_data` SET `ap_dot_bonus`=0.1 WHERE `entry`=13812; +DELETE FROM `spell_bonus_data` WHERE `entry` IN (24131,53353); +INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES +(24131,0,0,-1,-1, 'Hunter - Wyvern Sting (triggered)'), +(53353,0,0,-1,-1, 'Hunter - Chimera Shot (Serpent)'); +DELETE FROM `spell_ranks` WHERE `first_spell_id`=24131; +INSERT INTO `spell_ranks` VALUES +(24131,24131,1), +(24131,24134,2), +(24131,24135,3), +(24131,27069,4), +(24131,49009,5), +(24131,49010,6); + +-- Rogue +UPDATE `spell_bonus_data` SET `direct_bonus`=0,`dot_bonus`=0 WHERE `entry` IN (2818,2819,11353,11354,25349,26968,27187,57969,57970); + +-- Howling blast +UPDATE `spell_bonus_data` SET `ap_bonus`=0.2 WHERE `entry`=49184; From 2e5962725db3b9a596bede9b067b51588bd6b122 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 11 Apr 2012 18:53:24 -0500 Subject: [PATCH 0514/1149] Core/Spells: Corrected Rupture critical hits, it wont make other dots (incorrectly) crit any longer Signed-off-by: Subv --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 9ab375413fb..0e7090b4bc6 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1231,12 +1231,11 @@ bool AuraEffect::IsPeriodicTickCrit(Unit* target, Unit const* caster) const if ((*itr)->IsAffectedOnSpell(m_spellInfo) && caster->isSpellCrit(target, m_spellInfo, m_spellInfo->GetSchoolMask())) return true; } + // Rupture - since 3.3.3 can crit - if (target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x100000, 0x0, 0x0, caster->GetGUID())) - { - if (caster->isSpellCrit(target, m_spellInfo, m_spellInfo->GetSchoolMask())) - return true; - } + if (m_spellInfo->SpellIconID == 500 && m_spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE) + return caster->isSpellCrit(target, m_spellInfo, m_spellInfo->GetSchoolMask()); + return false; } From 2b2ebfaac0c3250954745e1d993f2b4fbcf5c7ed Mon Sep 17 00:00:00 2001 From: kaelima Date: Thu, 12 Apr 2012 02:12:07 +0200 Subject: [PATCH 0515/1149] DB/Spell Bonus Data: Fix more spell power stacking exploits (items & enchants) Thanks Hitplusone, amort and SignFinder for the list Closes #1701 --- .../world/2012_04_12_02_world_spell_bonus_data.sql | 2 +- .../world/2012_04_12_03_world_spell_bonus_data.sql | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_04_12_03_world_spell_bonus_data.sql diff --git a/sql/updates/world/2012_04_12_02_world_spell_bonus_data.sql b/sql/updates/world/2012_04_12_02_world_spell_bonus_data.sql index a6386c4285d..db35f5d97ee 100644 --- a/sql/updates/world/2012_04_12_02_world_spell_bonus_data.sql +++ b/sql/updates/world/2012_04_12_02_world_spell_bonus_data.sql @@ -1,7 +1,7 @@ -- Druid UPDATE `spell_bonus_data` SET `direct_bonus`=0,`dot_bonus`=0 WHERE `entry` IN (779,1822,60089); DELETE FROM `spell_bonus_data` WHERE `entry` IN (1079,9007,22568); -INSERT INTO `spell_bonus_data` VALUES +INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES (1079,0,0,-1,-1, 'Druid - Rip'), (9007,0,0,-1,-1, 'Druid - Pounce Bleed'), (22568,0,0,-1,-1, 'Druid - Ferocious Bite'); diff --git a/sql/updates/world/2012_04_12_03_world_spell_bonus_data.sql b/sql/updates/world/2012_04_12_03_world_spell_bonus_data.sql new file mode 100644 index 00000000000..d2262e52e98 --- /dev/null +++ b/sql/updates/world/2012_04_12_03_world_spell_bonus_data.sql @@ -0,0 +1,8 @@ +-- Fixes some spell power stacking exploits +DELETE FROM `spell_bonus_data` WHERE `entry` IN (44525,18798,16614,7712,13897); +INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES +(44525,0,0,-1,-1, 'Enchant Weapon - Icebreaker'), +(18798,0,0,-1,-1, 'Item - Freezing Band'), +(16614,0,0,-1,-1, 'Item - Storm Gauntlets'), +(7712,0,0,-1,-1, 'Item - Fiery Retributer | Blazefury Medallion'), +(13897,0,0,-1,-1, 'Enchant Weapon - Fiery Weapon'); From bdaf5e134174ea72ddab0f696b15608d78774384 Mon Sep 17 00:00:00 2001 From: kaelima Date: Thu, 12 Apr 2012 08:05:22 +0200 Subject: [PATCH 0516/1149] DB/Creature: Fix the fly/land animations for Invincible --- sql/updates/world/2012_04_12_04_world_creature_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_04_12_04_world_creature_template.sql diff --git a/sql/updates/world/2012_04_12_04_world_creature_template.sql b/sql/updates/world/2012_04_12_04_world_creature_template.sql new file mode 100644 index 00000000000..35664ec5198 --- /dev/null +++ b/sql/updates/world/2012_04_12_04_world_creature_template.sql @@ -0,0 +1,2 @@ +-- Update modelid for Invincible (with not bugged animation) +UPDATE `creature_template` SET `modelid1`=31007,`modelid2`=0,`WDBVerified`=-12340 WHERE `entry`=38545; From 74b5b3bd8e55d9c9f1d3eb97012604134d6e2484 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Thu, 12 Apr 2012 12:04:04 +0200 Subject: [PATCH 0517/1149] Core/Commands: Remove recently defunct .hover command. All this spell did before hoverheight changes was .cast/.unaura spell 11010. And since we do not have .autoattack, .steadyshot, .heroicstrike, .shootwand etc. either, there's no place for this command in the core (there never was). --- src/server/game/Chat/Chat.cpp | 1 - src/server/game/Chat/Chat.h | 1 - src/server/game/Chat/Commands/Level3.cpp | 19 ------------------- src/server/game/Miscellaneous/Language.h | 6 ++++-- 4 files changed, 4 insertions(+), 23 deletions(-) diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 22969601c32..042f16be3cc 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -382,7 +382,6 @@ ChatCommand* ChatHandler::getCommandTable() { "linkgrave", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleLinkGraveCommand>, "", NULL }, { "neargrave", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleNearGraveCommand>, "", NULL }, { "explorecheat", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleExploreCheatCommand>, "", NULL }, - { "hover", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleHoverCommand>, "", NULL }, { "levelup", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleLevelUpCommand>, "", NULL }, { "showarea", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleShowAreaCommand>, "", NULL }, { "hidearea", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleHideAreaCommand>, "", NULL }, diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index 0a39eb43ddb..e88914a2daf 100755 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -286,7 +286,6 @@ class ChatHandler bool HandleActivateObjectCommand(const char* args); bool HandleSpawnTransportCommand(const char* args); bool HandleExploreCheatCommand(const char* args); - bool HandleHoverCommand(const char* args); bool HandleWaterwalkCommand(const char* args); bool HandleLevelUpCommand(const char* args); bool HandleShowAreaCommand(const char* args); diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 045d5e144a9..30562bb9662 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -2158,25 +2158,6 @@ bool ChatHandler::HandleExploreCheatCommand(const char *args) return true; } -bool ChatHandler::HandleHoverCommand(const char *args) -{ - char* px = strtok((char*)args, " "); - uint32 flag; - if (!px) - flag = 1; - else - flag = atoi(px); - - m_session->GetPlayer()->SetHover(flag); - - if (flag) - SendSysMessage(LANG_HOVER_ENABLED); - else - SendSysMessage(LANG_HOVER_DISABLED); - - return true; -} - void ChatHandler::HandleCharacterLevel(Player* player, uint64 playerGuid, uint32 oldLevel, uint32 newLevel) { if (player) diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 547f1679b61..4b07d19bd7a 100755 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -522,8 +522,10 @@ enum TrinityStrings LANG_YOURS_EXPLORE_SET_ALL = 553, LANG_YOURS_EXPLORE_SET_NOTHING = 554, - LANG_HOVER_ENABLED = 555, - LANG_HOVER_DISABLED = 556, + //! Old ones now free: + // LANG_HOVER_ENABLED = 555, + // LANG_HOVER_DISABLED = 556, + LANG_YOURS_LEVEL_UP = 557, LANG_YOURS_LEVEL_DOWN = 558, LANG_YOURS_LEVEL_PROGRESS_RESET = 559, From 6cb8d607ceb1ef5e902bed4b144f4db76f628f32 Mon Sep 17 00:00:00 2001 From: Subv Date: Thu, 12 Apr 2012 05:52:20 -0500 Subject: [PATCH 0518/1149] Spells/Scripts: Allow OnEffectAbsorb to call PreventDefaultAction in AuraScripts closes #6172 Signed-off-by: Subv --- src/server/game/Spells/Auras/SpellAuras.cpp | 3 ++- src/server/game/Spells/SpellScript.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index b6cdc006d2d..0bf91b1b6c5 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -2243,7 +2243,7 @@ void Aura::CallScriptEffectCalcSpellModHandlers(AuraEffect const* aurEff, SpellM } } -void Aura::CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool & /*defaultPrevented*/) +void Aura::CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool& defaultPrevented) { for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { @@ -2254,6 +2254,7 @@ void Aura::CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication co if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, dmgInfo, absorbAmount); } + defaultPrevented = (*scritr)->_IsDefaultActionPrevented(); (*scritr)->_FinishScriptCall(); } } diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 81f8bbd78c5..ed2f16d6e3e 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -787,6 +787,7 @@ void AuraScript::PreventDefaultAction() case AURA_SCRIPT_HOOK_EFFECT_APPLY: case AURA_SCRIPT_HOOK_EFFECT_REMOVE: case AURA_SCRIPT_HOOK_EFFECT_PERIODIC: + case AURA_SCRIPT_HOOK_EFFECT_ABSORB: m_defaultActionPrevented = true; break; default: From 20a09c5857d10f87958456392356fb6f46095d28 Mon Sep 17 00:00:00 2001 From: Subv Date: Thu, 12 Apr 2012 05:54:33 -0500 Subject: [PATCH 0519/1149] Core/Spells: Fixed Lifebloom's final bloom benefit from Empowered Rejuvenation closes #244 Signed-off-by: Subv --- src/server/game/Entities/Unit/Unit.cpp | 5 +++-- src/server/game/Spells/SpellEffects.cpp | 3 --- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index d49346b232a..eebfd25e3d4 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3608,8 +3608,9 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId { // final heal int32 healAmount = aurEff->GetAmount(); - int32 stack = dispelInfo.GetRemovedCharges(); - CastCustomSpell(this, 33778, &healAmount, &stack, NULL, true, NULL, NULL, aura->GetCasterGUID()); + if (Unit* caster = aura->GetCaster()) + healAmount = caster->SpellHealingBonus(this, aura->GetSpellInfo(), healAmount, HEAL, dispelInfo.GetRemovedCharges()); + CastCustomSpell(this, 33778, &healAmount, NULL, NULL, true, NULL, NULL, aura->GetCasterGUID()); // mana if (Unit* caster = aura->GetCaster()) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 4e05c9fdac2..5078391348f 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1611,9 +1611,6 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/) } } } - // Lifebloom - final heal coef multiplied by original DoT stack - else if (m_spellInfo->Id == 33778) - addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, addhealth, HEAL, m_spellValue->EffectBasePoints[1]); // Death Pact - return pct of max health to caster else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && m_spellInfo->SpellFamilyFlags[0] & 0x00080000) addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, int32(caster->CountPctFromMaxHealth(damage)), HEAL); From 4daafd0c938f52de7184ea72d47ed8a0db960efb Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Thu, 12 Apr 2012 13:29:22 +0200 Subject: [PATCH 0520/1149] Forgot to stage SQL from my previous commit. (.hover command) --- sql/updates/world/2012_04_12_05_world_command.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_04_12_05_world_command.sql diff --git a/sql/updates/world/2012_04_12_05_world_command.sql b/sql/updates/world/2012_04_12_05_world_command.sql new file mode 100644 index 00000000000..8eb87155cb2 --- /dev/null +++ b/sql/updates/world/2012_04_12_05_world_command.sql @@ -0,0 +1,2 @@ +DELETE FROM `trinity_string` WHERE `entry` IN(555,556); +DELETE FROM `command` WHERE `name`='hover'; From dda7fab23037557f7e21745e15f9735f23b5f941 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 12 Apr 2012 09:15:36 -0400 Subject: [PATCH 0521/1149] Core/SpellScripts: Fix crash caused by 6cb8d607ceb1ef5e902bed4b144f4db76f628f32 --- src/server/game/Spells/SpellScript.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index ed2f16d6e3e..df1640df1b7 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -773,6 +773,7 @@ bool AuraScript::_IsDefaultActionPrevented() case AURA_SCRIPT_HOOK_EFFECT_APPLY: case AURA_SCRIPT_HOOK_EFFECT_REMOVE: case AURA_SCRIPT_HOOK_EFFECT_PERIODIC: + case AURA_SCRIPT_HOOK_EFFECT_ABSORB: return m_defaultActionPrevented; default: ASSERT(false && "AuraScript::_IsDefaultActionPrevented is called in a wrong place"); From 74052020235cdb8b2a7b38806b238e44a98f4587 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 12 Apr 2012 15:44:41 +0200 Subject: [PATCH 0522/1149] Removed unused file --- .../Dynamic/TypeContainerFunctionsPtr.h | 168 ------------------ 1 file changed, 168 deletions(-) delete mode 100755 src/server/shared/Dynamic/TypeContainerFunctionsPtr.h diff --git a/src/server/shared/Dynamic/TypeContainerFunctionsPtr.h b/src/server/shared/Dynamic/TypeContainerFunctionsPtr.h deleted file mode 100755 index 2c065d96d4a..00000000000 --- a/src/server/shared/Dynamic/TypeContainerFunctionsPtr.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2005-2009 MaNGOS - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#ifndef TYPECONTAINER_FUNCTIONS_PTR_H -#define TYPECONTAINER_FUNCTIONS_PTR_H - -/* - * Here you'll find a list of helper functions to make - * the TypeContainer usefull. Without it, its hard - * to access or mutate the container. - */ - -#include "Platform/Define.h" -#include "Utilities/TypeList.h" -#include - -namespace Trinity -{ - /* ContainerMapList Helpers */ - // count functions - // template size_t Count(const ContainerMapList &elements, CountedPtr* /*fake*/) - // { - // return elements._element.size(); - // }; - // - // template size_t Count(const ContainerMapList &elements, CountedPtr* /*fake*/) - // { - // return 0; - // } - // - // template size_t Count(const ContainerMapList &elements, CountedPtr* /*fake*/) - // { - // return 0; - // } - // - // template size_t Count(const ContainerMapList >&elements, SPECIFIC_TYPE* fake) - // { - // return Count(elements._elements, fake); - // } - // - // template size_t Count(const ContainerMapList >&elements, SPECIFIC_TYPE* fake) - // { - // return Count(elements._TailElements, fake); - // } - - // non-const find functions - template CountedPtr& Find(ContainerMapList &elements, OBJECT_HANDLE hdl, CountedPtr* /*fake*/) - { - typename std::map >::iterator iter = elements._element.find(hdl); - return (iter == elements._element.end() ? NullPtr((SPECIFIC_TYPE*)NULL) : iter->second); - }; - - template CountedPtr& Find(ContainerMapList &elements, OBJECT_HANDLE hdl, CountedPtr* /*fake*/) - { - return NullPtr((SPECIFIC_TYPE*)NULL);// terminate recursion - } - - template CountedPtr& Find(ContainerMapList &elements, OBJECT_HANDLE hdl, CountedPtr* /*fake*/) - { - return NullPtr((SPECIFIC_TYPE*)NULL);// this is a missed - } - - template CountedPtr& Find(ContainerMapList >&elements, OBJECT_HANDLE hdl, CountedPtr* fake) - { - CountedPtr &t = Find(elements._elements, hdl, fake); - return (!t ? Find(elements._TailElements, hdl, fake) : t); - } - - // const find functions - template const CountedPtr& Find(const ContainerMapList &elements, OBJECT_HANDLE hdl, CountedPtr* /*fake*/) - { - typename CountedPtr::iterator iter = elements._element.find(hdl); - return (iter == elements._element.end() ? NullPtr((SPECIFIC_TYPE*)NULL) : iter->second); - }; - - template const CountedPtr& Find(const ContainerMapList &elements, OBJECT_HANDLE hdl, CountedPtr* /*fake*/) - { - return NullPtr((SPECIFIC_TYPE*)NULL); - } - - template const CountedPtr& Find(const ContainerMapList &elements, OBJECT_HANDLE hdl, CountedPtr* /*fake*/) - { - return NullPtr((SPECIFIC_TYPE*)NULL); - } - - template CountedPtr& Find(const ContainerMapList >&elements, OBJECT_HANDLE hdl, CountedPtr* fake) - { - CountedPtr &t = Find(elements._elements, hdl, fake); - if (!t) - t = Find(elements._TailElement, hdl, fake); - - return t; - } - - // non-const insert functions - template CountedPtr& Insert(ContainerMapList &elements, CountedPtr &obj, OBJECT_HANDLE hdl) - { - elements._element[hdl] = obj; - return obj; - }; - - template CountedPtr& Insert(ContainerMapList &elements, CountedPtr &obj, OBJECT_HANDLE hdl) - { - return NullPtr((SPECIFIC_TYPE*)NULL); - } - - // this is a missed - template CountedPtr& Insert(ContainerMapList &elements, CountedPtr &obj, OBJECT_HANDLE hdl) - { - return NullPtr((SPECIFIC_TYPE*)NULL);// a missed - } - - // Recursion - template CountedPtr& Insert(ContainerMapList >&elements, CountedPtr &obj, OBJECT_HANDLE hdl) - { - CountedPtr &t= Insert(elements._elements, obj, hdl); - return (!t ? Insert(elements._TailElements, obj, hdl) : t); - } - - // non-const remove method - template bool Remove(ContainerMapList &elements, CountedPtr &obj, OBJECT_HANDLE hdl) - { - typename std::map >::iterator iter = elements._element.find(hdl); - if ( iter != elements._element.end() ) - { - elements._element.erase(iter); - return true; - } - - return false; // found... terminate the search - } - - template bool Remove(ContainerMapList &elements, CountedPtr &obj, OBJECT_HANDLE hdl) - { - return false; - } - - // this is a missed - template bool Remove(ContainerMapList &elements, CountedPtr &obj, OBJECT_HANDLE hdl) - { - return false; - } - - template bool Remove(ContainerMapList > &elements, CountedPtr &obj, OBJECT_HANDLE hdl) - { - // The head element is bad - bool t = Remove(elements._elements, obj, hdl); - return ( !t ? Remove(elements._TailElements, obj, hdl) : t ); - } - -} -#endif - From 71bf2684be58f6fdaebaeb480385769bd5934c85 Mon Sep 17 00:00:00 2001 From: kaelima Date: Thu, 12 Apr 2012 17:53:34 +0200 Subject: [PATCH 0523/1149] Core/Script: Use DoMeleeAttackIfReady in default ScriptedAI::UpdateAI method (fixes offhand attacks if not UpdateAI is overridden) --- src/server/game/AI/CreatureAIImpl.h | 1 + src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 10 +--------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/server/game/AI/CreatureAIImpl.h b/src/server/game/AI/CreatureAIImpl.h index f568da80b49..98b0afdefc9 100755 --- a/src/server/game/AI/CreatureAIImpl.h +++ b/src/server/game/AI/CreatureAIImpl.h @@ -604,6 +604,7 @@ inline void UnitAI::DoCast(Unit* victim, uint32 spellId, bool triggered) inline void UnitAI::DoCastVictim(uint32 spellId, bool triggered) { + // Why don't we check for casting unit_state and existing target as we do in DoCast(.. ? me->CastSpell(me->getVictim(), spellId, triggered); } diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 096ee695bcf..6d27d251579 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -114,15 +114,7 @@ void ScriptedAI::UpdateAI(uint32 const /*diff*/) if (!UpdateVictim()) return; - if (me->isAttackReady()) - { - //If we are within range melee the target - if (me->IsWithinMeleeRange(me->getVictim())) - { - me->AttackerStateUpdate(me->getVictim()); - me->resetAttackTimer(); - } - } + DoMeleeAttackIfReady(); } void ScriptedAI::DoStartMovement(Unit* victim, float distance, float angle) From 305cd14e864c5c1651d63ab627d79ddaa8535f16 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 12 Apr 2012 13:29:28 -0400 Subject: [PATCH 0524/1149] Core/Spells: Fix Unrelenting assault proc only on players. --- src/server/scripts/Spells/spell_warrior.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 2ce3c72580e..66e44112b8a 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -441,9 +441,9 @@ public: if (!spellId) return; - Unit* target = GetHitUnit(); - if (target->HasUnitState(UNIT_STATE_CASTING)) - target->CastSpell(target, spellId, true); + if (Player* target = GetHitPlayer()) + if (target->HasUnitState(UNIT_STATE_CASTING)) + target->CastSpell(target, spellId, true); } void Register() From c04e92564b96e104deabc6997edef9f6c89614ff Mon Sep 17 00:00:00 2001 From: Subv Date: Thu, 12 Apr 2012 18:39:40 -0500 Subject: [PATCH 0525/1149] Core/Spells: Apply Lifebloom's final bloom bonus from Empowered Rejuvenation also on expire. thanks @3kids for noticing --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 0e7090b4bc6..1ad6fe557f9 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4928,7 +4928,10 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool // final heal int32 stack = GetBase()->GetStackAmount(); - target->CastCustomSpell(target, 33778, &m_amount, &stack, NULL, true, NULL, this, GetCasterGUID()); + int32 heal = m_amount; + if (caster) + heal = caster->SpellHealingBonus(target, GetSpellInfo(), heal, HEAL, stack); + target->CastCustomSpell(target, 33778, &heal, &stack, NULL, true, NULL, this, GetCasterGUID()); // restore mana if (caster) From 491999280e5d914d6c9cb4cbb2878ce6ce112dcb Mon Sep 17 00:00:00 2001 From: Subv Date: Thu, 12 Apr 2012 20:18:07 -0500 Subject: [PATCH 0526/1149] Core/Spells: You should not be able to cast Create Healthstone if you already have one in your inventory Closes #1498 Signed-off-by: Subv --- src/server/scripts/Spells/spell_warlock.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 29a52406279..1f7e8171e46 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -172,6 +172,19 @@ class spell_warl_create_healthstone : public SpellScriptLoader return true; } + SpellCastResult CheckCast() + { + if (Player* caster = GetCaster()->ToPlayer()) + { + uint8 spellRank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); + ItemPosCountVec dest; + InventoryResult msg = caster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, iTypes[spellRank - 1][0], 1, NULL); + if (msg != EQUIP_ERR_OK) + return SPELL_FAILED_TOO_MANY_OF_ITEM; + } + return SPELL_CAST_OK; + } + void HandleScriptEffect(SpellEffIndex effIndex) { if (Unit* unitTarget = GetHitUnit()) @@ -198,6 +211,7 @@ class spell_warl_create_healthstone : public SpellScriptLoader void Register() { OnEffectHitTarget += SpellEffectFn(spell_warl_create_healthstone_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + OnCheckCast += SpellCheckCastFn(spell_warl_create_healthstone_SpellScript::CheckCast); } }; From 6400c13fcb342fff7e2d808e469f2c57d83766c5 Mon Sep 17 00:00:00 2001 From: Subv Date: Thu, 12 Apr 2012 20:19:23 -0500 Subject: [PATCH 0527/1149] Core/Loading: Make GameObject loot loading faster by removing an unneeded call to an expensive method. Thanks Manuel for pointing it out --- src/server/game/Globals/ObjectMgr.h | 9 --------- src/server/game/Loot/LootMgr.cpp | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 0f2b2382007..f81e7f1f074 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -1025,15 +1025,6 @@ class ObjectMgr return &itr->second; } - bool IsGoOfSpecificEntrySpawned(uint32 entry) const - { - for (GameObjectDataContainer::const_iterator it = _gameObjectDataStore.begin(); it != _gameObjectDataStore.end(); ++it) - if (it->second.id == entry) - return true; - - return false; - } - GameObjectData const* GetGOData(uint32 guid) const { GameObjectDataContainer::const_iterator itr = _gameObjectDataStore.find(guid); diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 1b349b11156..75065158ef6 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -1526,7 +1526,7 @@ void LoadLootTemplates_Gameobject() { if (uint32 lootid = itr->second.GetLootId()) { - if (sObjectMgr->IsGoOfSpecificEntrySpawned(itr->second.entry) && lootIdSet.find(lootid) == lootIdSet.end()) + if (lootIdSet.find(lootid) == lootIdSet.end()) LootTemplates_Gameobject.ReportNotExistedId(lootid); else lootIdSetUsed.insert(lootid); From 126fd13e5d6b57dc0c8830248d44db504c7d103f Mon Sep 17 00:00:00 2001 From: Multivitamin Date: Fri, 13 Apr 2012 10:49:09 +0200 Subject: [PATCH 0528/1149] DEP: Updated Jemalloc to Version 2.5 Signed-off-by: Multivitamin --- dep/jemalloc/VERSION | 2 +- .../include/jemalloc/internal/arena.h | 252 ++++--- .../include/jemalloc/internal/atomic.h | 169 +++++ .../include/jemalloc/internal/bitmap.h | 184 +++++ .../include/jemalloc/internal/chunk.h | 2 +- dep/jemalloc/include/jemalloc/internal/ckh.h | 2 +- dep/jemalloc/include/jemalloc/internal/ctl.h | 1 + dep/jemalloc/include/jemalloc/internal/hash.h | 6 +- .../jemalloc/internal/jemalloc_internal.h | 187 +++-- dep/jemalloc/include/jemalloc/internal/mb.h | 2 +- .../include/jemalloc/internal/mutex.h | 26 +- .../jemalloc/internal/private_namespace.h | 195 +++++ dep/jemalloc/include/jemalloc/internal/prof.h | 144 ++-- .../include/jemalloc/internal/rtree.h | 2 +- .../include/jemalloc/internal/stats.h | 37 +- .../include/jemalloc/internal/tcache.h | 89 ++- dep/jemalloc/include/jemalloc/jemalloc.h | 10 +- dep/jemalloc/include/jemalloc/jemalloc_defs.h | 35 +- dep/jemalloc/src/arena.c | 669 +++++++++++------- dep/jemalloc/src/atomic.c | 2 + dep/jemalloc/src/bitmap.c | 90 +++ dep/jemalloc/src/chunk.c | 16 +- dep/jemalloc/src/chunk_mmap.c | 6 +- dep/jemalloc/src/ckh.c | 46 +- dep/jemalloc/src/ctl.c | 37 +- dep/jemalloc/src/hash.c | 2 +- dep/jemalloc/src/huge.c | 30 +- dep/jemalloc/src/jemalloc.c | 264 +++++-- dep/jemalloc/src/mb.c | 2 +- dep/jemalloc/src/mutex.c | 6 + dep/jemalloc/src/prof.c | 177 ++--- dep/jemalloc/src/rtree.c | 7 +- dep/jemalloc/src/stats.c | 21 +- dep/jemalloc/src/tcache.c | 153 ++-- 34 files changed, 2068 insertions(+), 805 deletions(-) create mode 100644 dep/jemalloc/include/jemalloc/internal/atomic.h create mode 100644 dep/jemalloc/include/jemalloc/internal/bitmap.h create mode 100644 dep/jemalloc/include/jemalloc/internal/private_namespace.h create mode 100644 dep/jemalloc/src/atomic.c create mode 100644 dep/jemalloc/src/bitmap.c diff --git a/dep/jemalloc/VERSION b/dep/jemalloc/VERSION index 585f53edd80..aa85f5a2acf 100644 --- a/dep/jemalloc/VERSION +++ b/dep/jemalloc/VERSION @@ -1 +1 @@ -2.1.0-0-g1c4b088b08d3bc7617a34387e196ce03716160bf +2.2.5-0-gfc1bb70e5f0d9a58b39efa39cc549b5af5104760 diff --git a/dep/jemalloc/include/jemalloc/internal/arena.h b/dep/jemalloc/include/jemalloc/internal/arena.h index 9556c2c68f7..b80c118d811 100644 --- a/dep/jemalloc/include/jemalloc/internal/arena.h +++ b/dep/jemalloc/include/jemalloc/internal/arena.h @@ -19,6 +19,7 @@ #ifdef JEMALLOC_TINY /* Smallest size class to support. */ # define LG_TINY_MIN LG_SIZEOF_PTR +# define TINY_MIN (1U << LG_TINY_MIN) #endif /* @@ -45,9 +46,10 @@ * point is implicitly RUN_BFP bits to the left. * * Note that it is possible to set RUN_MAX_OVRHD low enough that it cannot be - * honored for some/all object sizes, since there is one bit of header overhead - * per object (plus a constant). This constraint is relaxed (ignored) for runs - * that are so small that the per-region overhead is greater than: + * honored for some/all object sizes, since when heap profiling is enabled + * there is one pointer of header overhead per object (plus a constant). This + * constraint is relaxed (ignored) for runs that are so small that the + * per-region overhead is greater than: * * (RUN_MAX_OVRHD / (reg_size << (3+RUN_BFP)) */ @@ -56,6 +58,10 @@ #define RUN_MAX_OVRHD 0x0000003dU #define RUN_MAX_OVRHD_RELAX 0x00001800U +/* Maximum number of regions in one run. */ +#define LG_RUN_MAXREGS 11 +#define RUN_MAXREGS (1U << LG_RUN_MAXREGS) + /* * The minimum ratio of active:dirty pages per arena is computed as: * @@ -69,6 +75,7 @@ typedef struct arena_chunk_map_s arena_chunk_map_t; typedef struct arena_chunk_s arena_chunk_t; typedef struct arena_run_s arena_run_t; +typedef struct arena_bin_info_s arena_bin_info_t; typedef struct arena_bin_s arena_bin_t; typedef struct arena_s arena_t; @@ -105,7 +112,7 @@ struct arena_chunk_map_s { * Run address (or size) and various flags are stored together. The bit * layout looks like (assuming 32-bit system): * - * ???????? ???????? ????---- ----dzla + * ???????? ???????? ????---- ----dula * * ? : Unallocated: Run address for first/last pages, unset for internal * pages. @@ -113,7 +120,7 @@ struct arena_chunk_map_s { * Large: Run size for first page, unset for trailing pages. * - : Unused. * d : dirty? - * z : zeroed? + * u : unzeroed? * l : large? * a : allocated? * @@ -129,30 +136,30 @@ struct arena_chunk_map_s { * [dula] : bit unset * * Unallocated (clean): - * ssssssss ssssssss ssss---- ----du-- + * ssssssss ssssssss ssss---- ----du-a * xxxxxxxx xxxxxxxx xxxx---- -----Uxx - * ssssssss ssssssss ssss---- ----dU-- + * ssssssss ssssssss ssss---- ----dU-a * * Unallocated (dirty): - * ssssssss ssssssss ssss---- ----D--- + * ssssssss ssssssss ssss---- ----D--a * xxxxxxxx xxxxxxxx xxxx---- ----xxxx - * ssssssss ssssssss ssss---- ----D--- + * ssssssss ssssssss ssss---- ----D--a * * Small: - * pppppppp pppppppp pppp---- ----d--a - * pppppppp pppppppp pppp---- -------a - * pppppppp pppppppp pppp---- ----d--a + * pppppppp pppppppp pppp---- ----d--A + * pppppppp pppppppp pppp---- -------A + * pppppppp pppppppp pppp---- ----d--A * * Large: - * ssssssss ssssssss ssss---- ----D-la + * ssssssss ssssssss ssss---- ----D-LA * xxxxxxxx xxxxxxxx xxxx---- ----xxxx - * -------- -------- -------- ----D-la + * -------- -------- -------- ----D-LA * * Large (sampled, size <= PAGE_SIZE): - * ssssssss ssssssss sssscccc ccccD-la + * ssssssss ssssssss sssscccc ccccD-LA * * Large (not sampled, size == PAGE_SIZE): - * ssssssss ssssssss ssss---- ----D-la + * ssssssss ssssssss ssss---- ----D-LA */ size_t bits; #ifdef JEMALLOC_PROF @@ -206,16 +213,52 @@ struct arena_run_s { /* Bin this run is associated with. */ arena_bin_t *bin; - /* Stack of available freed regions, or NULL. */ - void *avail; - - /* Next region that has never been allocated, or run boundary. */ - void *next; + /* Index of next region that has never been allocated, or nregs. */ + uint32_t nextind; /* Number of free regions in run. */ unsigned nfree; }; +/* + * Read-only information associated with each element of arena_t's bins array + * is stored separately, partly to reduce memory usage (only one copy, rather + * than one per arena), but mainly to avoid false cacheline sharing. + */ +struct arena_bin_info_s { + /* Size of regions in a run for this bin's size class. */ + size_t reg_size; + + /* Total size of a run for this bin's size class. */ + size_t run_size; + + /* Total number of regions in a run for this bin's size class. */ + uint32_t nregs; + + /* + * Offset of first bitmap_t element in a run header for this bin's size + * class. + */ + uint32_t bitmap_offset; + + /* + * Metadata used to manipulate bitmaps for runs associated with this + * bin. + */ + bitmap_info_t bitmap_info; + +#ifdef JEMALLOC_PROF + /* + * Offset of first (prof_ctx_t *) in a run header for this bin's size + * class, or 0 if (opt_prof == false). + */ + uint32_t ctx0_offset; +#endif + + /* Offset of first region in a run for this bin's size class. */ + uint32_t reg0_offset; +}; + struct arena_bin_s { /* * All operations on runcur, runs, and stats require that lock be @@ -240,26 +283,6 @@ struct arena_bin_s { */ arena_run_tree_t runs; - /* Size of regions in a run for this bin's size class. */ - size_t reg_size; - - /* Total size of a run for this bin's size class. */ - size_t run_size; - - /* Total number of regions in a run for this bin's size class. */ - uint32_t nregs; - -#ifdef JEMALLOC_PROF - /* - * Offset of first (prof_ctx_t *) in a run header for this bin's size - * class, or 0 if (opt_prof == false). - */ - uint32_t ctx0_offset; -#endif - - /* Offset of first region in a run for this bin's size class. */ - uint32_t reg0_offset; - #ifdef JEMALLOC_STATS /* Bin statistics. */ malloc_bin_stats_t stats; @@ -276,8 +299,18 @@ struct arena_s { unsigned ind; /* - * All non-bin-related operations on this arena require that lock be - * locked. + * Number of threads currently assigned to this arena. This field is + * protected by arenas_lock. + */ + unsigned nthreads; + + /* + * There are three classes of arena operations from a locking + * perspective: + * 1) Thread asssignment (modifies nthreads) is protected by + * arenas_lock. + * 2) Bin-related operations are protected by bin locks. + * 3) Chunk- and run-related operations are protected by this mutex. */ malloc_mutex_t lock; @@ -347,45 +380,35 @@ struct arena_s { /* * bins is used to store trees of free regions of the following sizes, - * assuming a 16-byte quantum, 4 KiB page size, and default - * JEMALLOC_OPTIONS. + * assuming a 64-bit system with 16-byte quantum, 4 KiB page size, and + * default MALLOC_CONF. * * bins[i] | size | * --------+--------+ - * 0 | 2 | - * 1 | 4 | - * 2 | 8 | + * 0 | 8 | * --------+--------+ - * 3 | 16 | - * 4 | 32 | - * 5 | 48 | + * 1 | 16 | + * 2 | 32 | + * 3 | 48 | * : : - * 8 | 96 | - * 9 | 112 | - * 10 | 128 | + * 6 | 96 | + * 7 | 112 | + * 8 | 128 | * --------+--------+ - * 11 | 192 | - * 12 | 256 | - * 13 | 320 | - * 14 | 384 | - * 15 | 448 | - * 16 | 512 | + * 9 | 192 | + * 10 | 256 | + * 11 | 320 | + * 12 | 384 | + * 13 | 448 | + * 14 | 512 | * --------+--------+ - * 17 | 768 | - * 18 | 1024 | - * 19 | 1280 | + * 15 | 768 | + * 16 | 1024 | + * 17 | 1280 | * : : - * 27 | 3328 | - * 28 | 3584 | - * 29 | 3840 | - * --------+--------+ - * 30 | 4 KiB | - * 31 | 6 KiB | - * 33 | 8 KiB | - * : : - * 43 | 28 KiB | - * 44 | 30 KiB | - * 45 | 32 KiB | + * 25 | 3328 | + * 26 | 3584 | + * 27 | 3840 | * --------+--------+ */ arena_bin_t bins[1]; /* Dynamically sized. */ @@ -397,8 +420,16 @@ struct arena_s { extern size_t opt_lg_qspace_max; extern size_t opt_lg_cspace_max; -extern ssize_t opt_lg_dirty_mult; +extern ssize_t opt_lg_dirty_mult; +/* + * small_size2bin is a compact lookup table that rounds request sizes up to + * size classes. In order to reduce cache footprint, the table is compressed, + * and all accesses are via the SMALL_SIZE2BIN macro. + */ extern uint8_t const *small_size2bin; +#define SMALL_SIZE2BIN(s) (small_size2bin[(s-1) >> LG_TINY_MIN]) + +extern arena_bin_info_t *arena_bin_info; /* Various bin-related settings. */ #ifdef JEMALLOC_TINY /* Number of (2^n)-spaced tiny bins. */ @@ -465,8 +496,9 @@ bool arena_boot(void); #ifdef JEMALLOC_H_INLINES #ifndef JEMALLOC_ENABLE_INLINE -unsigned arena_run_regind(arena_run_t *run, arena_bin_t *bin, - const void *ptr, size_t size); +size_t arena_bin_index(arena_t *arena, arena_bin_t *bin); +unsigned arena_run_regind(arena_run_t *run, arena_bin_info_t *bin_info, + const void *ptr); # ifdef JEMALLOC_PROF prof_ctx_t *arena_prof_ctx_get(const void *ptr); void arena_prof_ctx_set(const void *ptr, prof_ctx_t *ctx); @@ -475,21 +507,37 @@ void arena_dalloc(arena_t *arena, arena_chunk_t *chunk, void *ptr); #endif #if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_ARENA_C_)) +JEMALLOC_INLINE size_t +arena_bin_index(arena_t *arena, arena_bin_t *bin) +{ + size_t binind = bin - arena->bins; + assert(binind < nbins); + return (binind); +} + JEMALLOC_INLINE unsigned -arena_run_regind(arena_run_t *run, arena_bin_t *bin, const void *ptr, - size_t size) +arena_run_regind(arena_run_t *run, arena_bin_info_t *bin_info, const void *ptr) { unsigned shift, diff, regind; + size_t size; - assert(run->magic == ARENA_RUN_MAGIC); + dassert(run->magic == ARENA_RUN_MAGIC); + /* + * Freeing a pointer lower than region zero can cause assertion + * failure. + */ + assert((uintptr_t)ptr >= (uintptr_t)run + + (uintptr_t)bin_info->reg0_offset); /* * Avoid doing division with a variable divisor if possible. Using * actual division here can reduce allocator throughput by over 20%! */ - diff = (unsigned)((uintptr_t)ptr - (uintptr_t)run - bin->reg0_offset); + diff = (unsigned)((uintptr_t)ptr - (uintptr_t)run - + bin_info->reg0_offset); /* Rescale (factor powers of 2 out of the numerator and denominator). */ + size = bin_info->reg_size; shift = ffs(size) - 1; diff >>= shift; size >>= shift; @@ -512,8 +560,8 @@ arena_run_regind(arena_run_t *run, arena_bin_t *bin, const void *ptr, * divide by 0, and 1 and 2 are both powers of two, which are * handled above. */ -#define SIZE_INV_SHIFT 21 -#define SIZE_INV(s) (((1U << SIZE_INV_SHIFT) / (s)) + 1) +#define SIZE_INV_SHIFT ((sizeof(unsigned) << 3) - LG_RUN_MAXREGS) +#define SIZE_INV(s) (((1U << SIZE_INV_SHIFT) / (s)) + 1) static const unsigned size_invs[] = { SIZE_INV(3), SIZE_INV(4), SIZE_INV(5), SIZE_INV(6), SIZE_INV(7), @@ -533,7 +581,7 @@ arena_run_regind(arena_run_t *run, arena_bin_t *bin, const void *ptr, #undef SIZE_INV_SHIFT } assert(diff == regind * size); - assert(regind < bin->nregs); + assert(regind < bin_info->nregs); return (regind); } @@ -560,13 +608,14 @@ arena_prof_ctx_get(const void *ptr) arena_run_t *run = (arena_run_t *)((uintptr_t)chunk + (uintptr_t)((pageind - (mapbits >> PAGE_SHIFT)) << PAGE_SHIFT)); - arena_bin_t *bin = run->bin; + size_t binind = arena_bin_index(chunk->arena, run->bin); + arena_bin_info_t *bin_info = &arena_bin_info[binind]; unsigned regind; - assert(run->magic == ARENA_RUN_MAGIC); - regind = arena_run_regind(run, bin, ptr, bin->reg_size); + dassert(run->magic == ARENA_RUN_MAGIC); + regind = arena_run_regind(run, bin_info, ptr); ret = *(prof_ctx_t **)((uintptr_t)run + - bin->ctx0_offset + (regind * + bin_info->ctx0_offset + (regind * sizeof(prof_ctx_t *))); } } else @@ -594,12 +643,16 @@ arena_prof_ctx_set(const void *ptr, prof_ctx_t *ctx) (uintptr_t)((pageind - (mapbits >> PAGE_SHIFT)) << PAGE_SHIFT)); arena_bin_t *bin = run->bin; + size_t binind; + arena_bin_info_t *bin_info; unsigned regind; - assert(run->magic == ARENA_RUN_MAGIC); - regind = arena_run_regind(run, bin, ptr, bin->reg_size); + dassert(run->magic == ARENA_RUN_MAGIC); + binind = arena_bin_index(chunk->arena, bin); + bin_info = &arena_bin_info[binind]; + regind = arena_run_regind(run, bin_info, ptr); - *((prof_ctx_t **)((uintptr_t)run + bin->ctx0_offset + *((prof_ctx_t **)((uintptr_t)run + bin_info->ctx0_offset + (regind * sizeof(prof_ctx_t *)))) = ctx; } else assert((uintptr_t)ctx == (uintptr_t)1U); @@ -615,7 +668,7 @@ arena_dalloc(arena_t *arena, arena_chunk_t *chunk, void *ptr) arena_chunk_map_t *mapelm; assert(arena != NULL); - assert(arena->magic == ARENA_MAGIC); + dassert(arena->magic == ARENA_MAGIC); assert(chunk->arena == arena); assert(ptr != NULL); assert(CHUNK_ADDR2BASE(ptr) != ptr); @@ -638,11 +691,18 @@ arena_dalloc(arena_t *arena, arena_chunk_t *chunk, void *ptr) run = (arena_run_t *)((uintptr_t)chunk + (uintptr_t)((pageind - (mapelm->bits >> PAGE_SHIFT)) << PAGE_SHIFT)); - assert(run->magic == ARENA_RUN_MAGIC); - assert(((uintptr_t)ptr - ((uintptr_t)run + - (uintptr_t)run->bin->reg0_offset)) % - run->bin->reg_size == 0); + dassert(run->magic == ARENA_RUN_MAGIC); bin = run->bin; +#ifdef JEMALLOC_DEBUG + { + size_t binind = arena_bin_index(arena, bin); + arena_bin_info_t *bin_info = + &arena_bin_info[binind]; + assert(((uintptr_t)ptr - ((uintptr_t)run + + (uintptr_t)bin_info->reg0_offset)) % + bin_info->reg_size == 0); + } +#endif malloc_mutex_lock(&bin->lock); arena_dalloc_bin(arena, chunk, ptr, mapelm); malloc_mutex_unlock(&bin->lock); diff --git a/dep/jemalloc/include/jemalloc/internal/atomic.h b/dep/jemalloc/include/jemalloc/internal/atomic.h new file mode 100644 index 00000000000..9a298623f8a --- /dev/null +++ b/dep/jemalloc/include/jemalloc/internal/atomic.h @@ -0,0 +1,169 @@ +/******************************************************************************/ +#ifdef JEMALLOC_H_TYPES + +#endif /* JEMALLOC_H_TYPES */ +/******************************************************************************/ +#ifdef JEMALLOC_H_STRUCTS + +#endif /* JEMALLOC_H_STRUCTS */ +/******************************************************************************/ +#ifdef JEMALLOC_H_EXTERNS + +#define atomic_read_uint64(p) atomic_add_uint64(p, 0) +#define atomic_read_uint32(p) atomic_add_uint32(p, 0) + +#if (LG_SIZEOF_PTR == 3) +# define atomic_read_z(p) \ + (size_t)atomic_add_uint64((uint64_t *)p, (uint64_t)0) +# define atomic_add_z(p, x) \ + (size_t)atomic_add_uint64((uint64_t *)p, (uint64_t)x) +# define atomic_sub_z(p, x) \ + (size_t)atomic_sub_uint64((uint64_t *)p, (uint64_t)x) +#elif (LG_SIZEOF_PTR == 2) +# define atomic_read_z(p) \ + (size_t)atomic_add_uint32((uint32_t *)p, (uint32_t)0) +# define atomic_add_z(p, x) \ + (size_t)atomic_add_uint32((uint32_t *)p, (uint32_t)x) +# define atomic_sub_z(p, x) \ + (size_t)atomic_sub_uint32((uint32_t *)p, (uint32_t)x) +#endif + +#endif /* JEMALLOC_H_EXTERNS */ +/******************************************************************************/ +#ifdef JEMALLOC_H_INLINES + +#ifndef JEMALLOC_ENABLE_INLINE +uint64_t atomic_add_uint64(uint64_t *p, uint64_t x); +uint64_t atomic_sub_uint64(uint64_t *p, uint64_t x); +uint32_t atomic_add_uint32(uint32_t *p, uint32_t x); +uint32_t atomic_sub_uint32(uint32_t *p, uint32_t x); +#endif + +#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_ATOMIC_C_)) +/******************************************************************************/ +/* 64-bit operations. */ +#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 +JEMALLOC_INLINE uint64_t +atomic_add_uint64(uint64_t *p, uint64_t x) +{ + + return (__sync_add_and_fetch(p, x)); +} + +JEMALLOC_INLINE uint64_t +atomic_sub_uint64(uint64_t *p, uint64_t x) +{ + + return (__sync_sub_and_fetch(p, x)); +} +#elif (defined(JEMALLOC_OSATOMIC)) +JEMALLOC_INLINE uint64_t +atomic_add_uint64(uint64_t *p, uint64_t x) +{ + + return (OSAtomicAdd64((int64_t)x, (int64_t *)p)); +} + +JEMALLOC_INLINE uint64_t +atomic_sub_uint64(uint64_t *p, uint64_t x) +{ + + return (OSAtomicAdd64(-((int64_t)x), (int64_t *)p)); +} +#elif (defined(__amd64_) || defined(__x86_64__)) +JEMALLOC_INLINE uint64_t +atomic_add_uint64(uint64_t *p, uint64_t x) +{ + + asm volatile ( + "lock; xaddq %0, %1;" + : "+r" (x), "=m" (*p) /* Outputs. */ + : "m" (*p) /* Inputs. */ + ); + + return (x); +} + +JEMALLOC_INLINE uint64_t +atomic_sub_uint64(uint64_t *p, uint64_t x) +{ + + x = (uint64_t)(-(int64_t)x); + asm volatile ( + "lock; xaddq %0, %1;" + : "+r" (x), "=m" (*p) /* Outputs. */ + : "m" (*p) /* Inputs. */ + ); + + return (x); +} +#else +# if (LG_SIZEOF_PTR == 3) +# error "Missing implementation for 64-bit atomic operations" +# endif +#endif + +/******************************************************************************/ +/* 32-bit operations. */ +#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 +JEMALLOC_INLINE uint32_t +atomic_add_uint32(uint32_t *p, uint32_t x) +{ + + return (__sync_add_and_fetch(p, x)); +} + +JEMALLOC_INLINE uint32_t +atomic_sub_uint32(uint32_t *p, uint32_t x) +{ + + return (__sync_sub_and_fetch(p, x)); +} +#elif (defined(JEMALLOC_OSATOMIC)) +JEMALLOC_INLINE uint32_t +atomic_add_uint32(uint32_t *p, uint32_t x) +{ + + return (OSAtomicAdd32((int32_t)x, (int32_t *)p)); +} + +JEMALLOC_INLINE uint32_t +atomic_sub_uint32(uint32_t *p, uint32_t x) +{ + + return (OSAtomicAdd32(-((int32_t)x), (int32_t *)p)); +} +#elif (defined(__i386__) || defined(__amd64_) || defined(__x86_64__)) +JEMALLOC_INLINE uint32_t +atomic_add_uint32(uint32_t *p, uint32_t x) +{ + + asm volatile ( + "lock; xaddl %0, %1;" + : "+r" (x), "=m" (*p) /* Outputs. */ + : "m" (*p) /* Inputs. */ + ); + + return (x); +} + +JEMALLOC_INLINE uint32_t +atomic_sub_uint32(uint32_t *p, uint32_t x) +{ + + x = (uint32_t)(-(int32_t)x); + asm volatile ( + "lock; xaddl %0, %1;" + : "+r" (x), "=m" (*p) /* Outputs. */ + : "m" (*p) /* Inputs. */ + ); + + return (x); +} +#else +# error "Missing implementation for 32-bit atomic operations" +#endif +#endif + +#endif /* JEMALLOC_H_INLINES */ +/******************************************************************************/ diff --git a/dep/jemalloc/include/jemalloc/internal/bitmap.h b/dep/jemalloc/include/jemalloc/internal/bitmap.h new file mode 100644 index 00000000000..605ebac58c1 --- /dev/null +++ b/dep/jemalloc/include/jemalloc/internal/bitmap.h @@ -0,0 +1,184 @@ +/******************************************************************************/ +#ifdef JEMALLOC_H_TYPES + +/* Maximum bitmap bit count is 2^LG_BITMAP_MAXBITS. */ +#define LG_BITMAP_MAXBITS LG_RUN_MAXREGS + +typedef struct bitmap_level_s bitmap_level_t; +typedef struct bitmap_info_s bitmap_info_t; +typedef unsigned long bitmap_t; +#define LG_SIZEOF_BITMAP LG_SIZEOF_LONG + +/* Number of bits per group. */ +#define LG_BITMAP_GROUP_NBITS (LG_SIZEOF_BITMAP + 3) +#define BITMAP_GROUP_NBITS (ZU(1) << LG_BITMAP_GROUP_NBITS) +#define BITMAP_GROUP_NBITS_MASK (BITMAP_GROUP_NBITS-1) + +/* Maximum number of levels possible. */ +#define BITMAP_MAX_LEVELS \ + (LG_BITMAP_MAXBITS / LG_SIZEOF_BITMAP) \ + + !!(LG_BITMAP_MAXBITS % LG_SIZEOF_BITMAP) + +#endif /* JEMALLOC_H_TYPES */ +/******************************************************************************/ +#ifdef JEMALLOC_H_STRUCTS + +struct bitmap_level_s { + /* Offset of this level's groups within the array of groups. */ + size_t group_offset; +}; + +struct bitmap_info_s { + /* Logical number of bits in bitmap (stored at bottom level). */ + size_t nbits; + + /* Number of levels necessary for nbits. */ + unsigned nlevels; + + /* + * Only the first (nlevels+1) elements are used, and levels are ordered + * bottom to top (e.g. the bottom level is stored in levels[0]). + */ + bitmap_level_t levels[BITMAP_MAX_LEVELS+1]; +}; + +#endif /* JEMALLOC_H_STRUCTS */ +/******************************************************************************/ +#ifdef JEMALLOC_H_EXTERNS + +void bitmap_info_init(bitmap_info_t *binfo, size_t nbits); +size_t bitmap_info_ngroups(const bitmap_info_t *binfo); +size_t bitmap_size(size_t nbits); +void bitmap_init(bitmap_t *bitmap, const bitmap_info_t *binfo); + +#endif /* JEMALLOC_H_EXTERNS */ +/******************************************************************************/ +#ifdef JEMALLOC_H_INLINES + +#ifndef JEMALLOC_ENABLE_INLINE +bool bitmap_full(bitmap_t *bitmap, const bitmap_info_t *binfo); +bool bitmap_get(bitmap_t *bitmap, const bitmap_info_t *binfo, size_t bit); +void bitmap_set(bitmap_t *bitmap, const bitmap_info_t *binfo, size_t bit); +size_t bitmap_sfu(bitmap_t *bitmap, const bitmap_info_t *binfo); +void bitmap_unset(bitmap_t *bitmap, const bitmap_info_t *binfo, size_t bit); +#endif + +#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_BITMAP_C_)) +JEMALLOC_INLINE bool +bitmap_full(bitmap_t *bitmap, const bitmap_info_t *binfo) +{ + unsigned rgoff = binfo->levels[binfo->nlevels].group_offset - 1; + bitmap_t rg = bitmap[rgoff]; + /* The bitmap is full iff the root group is 0. */ + return (rg == 0); +} + +JEMALLOC_INLINE bool +bitmap_get(bitmap_t *bitmap, const bitmap_info_t *binfo, size_t bit) +{ + size_t goff; + bitmap_t g; + + assert(bit < binfo->nbits); + goff = bit >> LG_BITMAP_GROUP_NBITS; + g = bitmap[goff]; + return (!(g & (1LU << (bit & BITMAP_GROUP_NBITS_MASK)))); +} + +JEMALLOC_INLINE void +bitmap_set(bitmap_t *bitmap, const bitmap_info_t *binfo, size_t bit) +{ + size_t goff; + bitmap_t *gp; + bitmap_t g; + + assert(bit < binfo->nbits); + assert(bitmap_get(bitmap, binfo, bit) == false); + goff = bit >> LG_BITMAP_GROUP_NBITS; + gp = &bitmap[goff]; + g = *gp; + assert(g & (1LU << (bit & BITMAP_GROUP_NBITS_MASK))); + g ^= 1LU << (bit & BITMAP_GROUP_NBITS_MASK); + *gp = g; + assert(bitmap_get(bitmap, binfo, bit)); + /* Propagate group state transitions up the tree. */ + if (g == 0) { + unsigned i; + for (i = 1; i < binfo->nlevels; i++) { + bit = goff; + goff = bit >> LG_BITMAP_GROUP_NBITS; + gp = &bitmap[binfo->levels[i].group_offset + goff]; + g = *gp; + assert(g & (1LU << (bit & BITMAP_GROUP_NBITS_MASK))); + g ^= 1LU << (bit & BITMAP_GROUP_NBITS_MASK); + *gp = g; + if (g != 0) + break; + } + } +} + +/* sfu: set first unset. */ +JEMALLOC_INLINE size_t +bitmap_sfu(bitmap_t *bitmap, const bitmap_info_t *binfo) +{ + size_t bit; + bitmap_t g; + unsigned i; + + assert(bitmap_full(bitmap, binfo) == false); + + i = binfo->nlevels - 1; + g = bitmap[binfo->levels[i].group_offset]; + bit = ffsl(g) - 1; + while (i > 0) { + i--; + g = bitmap[binfo->levels[i].group_offset + bit]; + bit = (bit << LG_BITMAP_GROUP_NBITS) + (ffsl(g) - 1); + } + + bitmap_set(bitmap, binfo, bit); + return (bit); +} + +JEMALLOC_INLINE void +bitmap_unset(bitmap_t *bitmap, const bitmap_info_t *binfo, size_t bit) +{ + size_t goff; + bitmap_t *gp; + bitmap_t g; + bool propagate; + + assert(bit < binfo->nbits); + assert(bitmap_get(bitmap, binfo, bit)); + goff = bit >> LG_BITMAP_GROUP_NBITS; + gp = &bitmap[goff]; + g = *gp; + propagate = (g == 0); + assert((g & (1LU << (bit & BITMAP_GROUP_NBITS_MASK))) == 0); + g ^= 1LU << (bit & BITMAP_GROUP_NBITS_MASK); + *gp = g; + assert(bitmap_get(bitmap, binfo, bit) == false); + /* Propagate group state transitions up the tree. */ + if (propagate) { + unsigned i; + for (i = 1; i < binfo->nlevels; i++) { + bit = goff; + goff = bit >> LG_BITMAP_GROUP_NBITS; + gp = &bitmap[binfo->levels[i].group_offset + goff]; + g = *gp; + propagate = (g == 0); + assert((g & (1LU << (bit & BITMAP_GROUP_NBITS_MASK))) + == 0); + g ^= 1LU << (bit & BITMAP_GROUP_NBITS_MASK); + *gp = g; + if (propagate == false) + break; + } + } +} + +#endif + +#endif /* JEMALLOC_H_INLINES */ +/******************************************************************************/ diff --git a/dep/jemalloc/include/jemalloc/internal/chunk.h b/dep/jemalloc/include/jemalloc/internal/chunk.h index a60f0ad7498..54b6a3ec886 100644 --- a/dep/jemalloc/include/jemalloc/internal/chunk.h +++ b/dep/jemalloc/include/jemalloc/internal/chunk.h @@ -50,7 +50,7 @@ extern size_t map_bias; /* Number of arena chunk header pages. */ extern size_t arena_maxclass; /* Max size class for arenas. */ void *chunk_alloc(size_t size, bool base, bool *zero); -void chunk_dealloc(void *chunk, size_t size); +void chunk_dealloc(void *chunk, size_t size, bool unmap); bool chunk_boot(void); #endif /* JEMALLOC_H_EXTERNS */ diff --git a/dep/jemalloc/include/jemalloc/internal/ckh.h b/dep/jemalloc/include/jemalloc/internal/ckh.h index d4e391b6360..3e4ad4c85f9 100644 --- a/dep/jemalloc/include/jemalloc/internal/ckh.h +++ b/dep/jemalloc/include/jemalloc/internal/ckh.h @@ -31,7 +31,7 @@ struct ckhc_s { struct ckh_s { #ifdef JEMALLOC_DEBUG -#define CKH_MAGIG 0x3af2489d +#define CKH_MAGIC 0x3af2489d uint32_t magic; #endif diff --git a/dep/jemalloc/include/jemalloc/internal/ctl.h b/dep/jemalloc/include/jemalloc/internal/ctl.h index 8776ad135a7..f1f5eb70a2a 100644 --- a/dep/jemalloc/include/jemalloc/internal/ctl.h +++ b/dep/jemalloc/include/jemalloc/internal/ctl.h @@ -29,6 +29,7 @@ struct ctl_node_s { struct ctl_arena_stats_s { bool initialized; + unsigned nthreads; size_t pactive; size_t pdirty; #ifdef JEMALLOC_STATS diff --git a/dep/jemalloc/include/jemalloc/internal/hash.h b/dep/jemalloc/include/jemalloc/internal/hash.h index d12cdb8359f..8a46ce30803 100644 --- a/dep/jemalloc/include/jemalloc/internal/hash.h +++ b/dep/jemalloc/include/jemalloc/internal/hash.h @@ -17,7 +17,7 @@ uint64_t hash(const void *key, size_t len, uint64_t seed); #endif -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(HASH_C_)) +#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_HASH_C_)) /* * The following hash function is based on MurmurHash64A(), placed into the * public domain by Austin Appleby. See http://murmurhash.googlepages.com/ for @@ -26,7 +26,7 @@ uint64_t hash(const void *key, size_t len, uint64_t seed); JEMALLOC_INLINE uint64_t hash(const void *key, size_t len, uint64_t seed) { - const uint64_t m = 0xc6a4a7935bd1e995; + const uint64_t m = 0xc6a4a7935bd1e995LLU; const int r = 47; uint64_t h = seed ^ (len * m); const uint64_t *data = (const uint64_t *)key; @@ -62,7 +62,7 @@ hash(const void *key, size_t len, uint64_t seed) h *= m; h ^= h >> r; - return h; + return (h); } #endif diff --git a/dep/jemalloc/include/jemalloc/internal/jemalloc_internal.h b/dep/jemalloc/include/jemalloc/internal/jemalloc_internal.h index 611f0c665a1..cd554bea1b9 100644 --- a/dep/jemalloc/include/jemalloc/internal/jemalloc_internal.h +++ b/dep/jemalloc/include/jemalloc/internal/jemalloc_internal.h @@ -33,6 +33,12 @@ #define JEMALLOC_MANGLE #include "../jemalloc.h" +#include "jemalloc/internal/private_namespace.h" + +#if (defined(JEMALLOC_OSATOMIC) || defined(JEMALLOC_OSSPIN)) +#include +#endif + #ifdef JEMALLOC_ZONE #include #include @@ -55,8 +61,9 @@ extern void (*JEMALLOC_P(malloc_message))(void *wcbopaque, const char *s); * Define a custom assert() in order to reduce the chances of deadlock during * assertion failure. */ -#ifdef JEMALLOC_DEBUG -# define assert(e) do { \ +#ifndef assert +# ifdef JEMALLOC_DEBUG +# define assert(e) do { \ if (!(e)) { \ char line_buf[UMAX2S_BUFSIZE]; \ malloc_write(": "); \ @@ -70,8 +77,15 @@ extern void (*JEMALLOC_P(malloc_message))(void *wcbopaque, const char *s); abort(); \ } \ } while (0) +# else +# define assert(e) +# endif +#endif + +#ifdef JEMALLOC_DEBUG +# define dassert(e) assert(e) #else -#define assert(e) +# define dassert(e) #endif /* @@ -146,12 +160,19 @@ extern void (*JEMALLOC_P(malloc_message))(void *wcbopaque, const char *s); #define QUANTUM_CEILING(a) \ (((a) + QUANTUM_MASK) & ~QUANTUM_MASK) -#define SIZEOF_PTR (1U << LG_SIZEOF_PTR) +#define LONG ((size_t)(1U << LG_SIZEOF_LONG)) +#define LONG_MASK (LONG - 1) -/* We can't use TLS in non-PIC programs, since TLS relies on loader magic. */ -#if (!defined(PIC) && !defined(NO_TLS)) -# define NO_TLS -#endif +/* Return the smallest long multiple that is >= a. */ +#define LONG_CEILING(a) \ + (((a) + LONG_MASK) & ~LONG_MASK) + +#define SIZEOF_PTR (1U << LG_SIZEOF_PTR) +#define PTR_MASK (SIZEOF_PTR - 1) + +/* Return the smallest (void *) multiple that is >= a. */ +#define PTR_CEILING(a) \ + (((a) + PTR_MASK) & ~PTR_MASK) /* * Maximum size of L1 cache line. This is used to avoid cache line aliasing. @@ -198,6 +219,7 @@ extern void (*JEMALLOC_P(malloc_message))(void *wcbopaque, const char *s); #define PAGE_CEILING(s) \ (((s) + PAGE_MASK) & ~PAGE_MASK) +#include "jemalloc/internal/atomic.h" #include "jemalloc/internal/jemprn.h" #include "jemalloc/internal/ckh.h" #include "jemalloc/internal/stats.h" @@ -206,6 +228,7 @@ extern void (*JEMALLOC_P(malloc_message))(void *wcbopaque, const char *s); #include "jemalloc/internal/mb.h" #include "jemalloc/internal/extent.h" #include "jemalloc/internal/arena.h" +#include "jemalloc/internal/bitmap.h" #include "jemalloc/internal/base.h" #include "jemalloc/internal/chunk.h" #include "jemalloc/internal/huge.h" @@ -221,12 +244,14 @@ extern void (*JEMALLOC_P(malloc_message))(void *wcbopaque, const char *s); /******************************************************************************/ #define JEMALLOC_H_STRUCTS +#include "jemalloc/internal/atomic.h" #include "jemalloc/internal/jemprn.h" #include "jemalloc/internal/ckh.h" #include "jemalloc/internal/stats.h" #include "jemalloc/internal/ctl.h" #include "jemalloc/internal/mutex.h" #include "jemalloc/internal/mb.h" +#include "jemalloc/internal/bitmap.h" #include "jemalloc/internal/extent.h" #include "jemalloc/internal/arena.h" #include "jemalloc/internal/base.h" @@ -240,6 +265,13 @@ extern void (*JEMALLOC_P(malloc_message))(void *wcbopaque, const char *s); #endif #include "jemalloc/internal/prof.h" +#ifdef JEMALLOC_STATS +typedef struct { + uint64_t allocated; + uint64_t deallocated; +} thread_allocated_t; +#endif + #undef JEMALLOC_H_STRUCTS /******************************************************************************/ #define JEMALLOC_H_EXTERNS @@ -269,6 +301,7 @@ extern size_t lg_pagesize; extern unsigned ncpus; extern malloc_mutex_t arenas_lock; /* Protects arenas initialization. */ +extern pthread_key_t arenas_tsd; #ifndef NO_TLS /* * Map of pthread_self() --> arenas[???], used for selecting an arena to use @@ -278,9 +311,9 @@ extern __thread arena_t *arenas_tls JEMALLOC_ATTR(tls_model("initial-exec")); # define ARENA_GET() arenas_tls # define ARENA_SET(v) do { \ arenas_tls = (v); \ + pthread_setspecific(arenas_tsd, (void *)(v)); \ } while (0) #else -extern pthread_key_t arenas_tsd; # define ARENA_GET() ((arena_t *)pthread_getspecific(arenas_tsd)) # define ARENA_SET(v) do { \ pthread_setspecific(arenas_tsd, (void *)(v)); \ @@ -295,45 +328,28 @@ extern arena_t **arenas; extern unsigned narenas; #ifdef JEMALLOC_STATS -typedef struct { - uint64_t allocated; - uint64_t deallocated; -} thread_allocated_t; # ifndef NO_TLS extern __thread thread_allocated_t thread_allocated_tls; -# define ALLOCATED_GET() thread_allocated_tls.allocated -# define DEALLOCATED_GET() thread_allocated_tls.deallocated +# define ALLOCATED_GET() (thread_allocated_tls.allocated) +# define ALLOCATEDP_GET() (&thread_allocated_tls.allocated) +# define DEALLOCATED_GET() (thread_allocated_tls.deallocated) +# define DEALLOCATEDP_GET() (&thread_allocated_tls.deallocated) # define ALLOCATED_ADD(a, d) do { \ thread_allocated_tls.allocated += a; \ thread_allocated_tls.deallocated += d; \ } while (0) # else extern pthread_key_t thread_allocated_tsd; -# define ALLOCATED_GET() \ - (uint64_t)((pthread_getspecific(thread_allocated_tsd) != NULL) \ - ? ((thread_allocated_t *) \ - pthread_getspecific(thread_allocated_tsd))->allocated : 0) -# define DEALLOCATED_GET() \ - (uint64_t)((pthread_getspecific(thread_allocated_tsd) != NULL) \ - ? ((thread_allocated_t \ - *)pthread_getspecific(thread_allocated_tsd))->deallocated : \ - 0) +thread_allocated_t *thread_allocated_get_hard(void); + +# define ALLOCATED_GET() (thread_allocated_get()->allocated) +# define ALLOCATEDP_GET() (&thread_allocated_get()->allocated) +# define DEALLOCATED_GET() (thread_allocated_get()->deallocated) +# define DEALLOCATEDP_GET() (&thread_allocated_get()->deallocated) # define ALLOCATED_ADD(a, d) do { \ - thread_allocated_t *thread_allocated = (thread_allocated_t *) \ - pthread_getspecific(thread_allocated_tsd); \ - if (thread_allocated != NULL) { \ - thread_allocated->allocated += (a); \ - thread_allocated->deallocated += (d); \ - } else { \ - thread_allocated = (thread_allocated_t *) \ - imalloc(sizeof(thread_allocated_t)); \ - if (thread_allocated != NULL) { \ - pthread_setspecific(thread_allocated_tsd, \ - thread_allocated); \ - thread_allocated->allocated = (a); \ - thread_allocated->deallocated = (d); \ - } \ - } \ + thread_allocated_t *thread_allocated = thread_allocated_get(); \ + thread_allocated->allocated += (a); \ + thread_allocated->deallocated += (d); \ } while (0) # endif #endif @@ -344,12 +360,14 @@ int buferror(int errnum, char *buf, size_t buflen); void jemalloc_prefork(void); void jemalloc_postfork(void); +#include "jemalloc/internal/atomic.h" #include "jemalloc/internal/jemprn.h" #include "jemalloc/internal/ckh.h" #include "jemalloc/internal/stats.h" #include "jemalloc/internal/ctl.h" #include "jemalloc/internal/mutex.h" #include "jemalloc/internal/mb.h" +#include "jemalloc/internal/bitmap.h" #include "jemalloc/internal/extent.h" #include "jemalloc/internal/arena.h" #include "jemalloc/internal/base.h" @@ -367,6 +385,7 @@ void jemalloc_postfork(void); /******************************************************************************/ #define JEMALLOC_H_INLINES +#include "jemalloc/internal/atomic.h" #include "jemalloc/internal/jemprn.h" #include "jemalloc/internal/ckh.h" #include "jemalloc/internal/stats.h" @@ -384,6 +403,9 @@ size_t s2u(size_t size); size_t sa2u(size_t size, size_t alignment, size_t *run_size_p); void malloc_write(const char *s); arena_t *choose_arena(void); +# if (defined(JEMALLOC_STATS) && defined(NO_TLS)) +thread_allocated_t *thread_allocated_get(void); +# endif #endif #if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_C_)) @@ -414,10 +436,10 @@ s2u(size_t size) { if (size <= small_maxclass) - return arenas[0]->bins[small_size2bin[size]].reg_size; + return (arena_bin_info[SMALL_SIZE2BIN(size)].reg_size); if (size <= arena_maxclass) - return PAGE_CEILING(size); - return CHUNK_CEILING(size); + return (PAGE_CEILING(size)); + return (CHUNK_CEILING(size)); } /* @@ -458,10 +480,8 @@ sa2u(size_t size, size_t alignment, size_t *run_size_p) } if (usize <= arena_maxclass && alignment <= PAGE_SIZE) { - if (usize <= small_maxclass) { - return - (arenas[0]->bins[small_size2bin[usize]].reg_size); - } + if (usize <= small_maxclass) + return (arena_bin_info[SMALL_SIZE2BIN(usize)].reg_size); return (PAGE_CEILING(usize)); } else { size_t run_size; @@ -544,8 +564,22 @@ choose_arena(void) return (ret); } + +#if (defined(JEMALLOC_STATS) && defined(NO_TLS)) +JEMALLOC_INLINE thread_allocated_t * +thread_allocated_get(void) +{ + thread_allocated_t *thread_allocated = (thread_allocated_t *) + pthread_getspecific(thread_allocated_tsd); + + if (thread_allocated == NULL) + return (thread_allocated_get_hard()); + return (thread_allocated); +} +#endif #endif +#include "jemalloc/internal/bitmap.h" #include "jemalloc/internal/rtree.h" #include "jemalloc/internal/tcache.h" #include "jemalloc/internal/arena.h" @@ -557,7 +591,7 @@ choose_arena(void) #ifndef JEMALLOC_ENABLE_INLINE void *imalloc(size_t size); void *icalloc(size_t size); -void *ipalloc(size_t size, size_t alignment, bool zero); +void *ipalloc(size_t usize, size_t alignment, bool zero); size_t isalloc(const void *ptr); # ifdef JEMALLOC_IVSALLOC size_t ivsalloc(const void *ptr); @@ -591,28 +625,39 @@ icalloc(size_t size) } JEMALLOC_INLINE void * -ipalloc(size_t size, size_t alignment, bool zero) +ipalloc(size_t usize, size_t alignment, bool zero) { void *ret; - size_t usize; - size_t run_size -# ifdef JEMALLOC_CC_SILENCE - = 0 -# endif - ; - usize = sa2u(size, alignment, &run_size); - if (usize == 0) - return (NULL); + assert(usize != 0); + assert(usize == sa2u(usize, alignment, NULL)); + if (usize <= arena_maxclass && alignment <= PAGE_SIZE) ret = arena_malloc(usize, zero); - else if (run_size <= arena_maxclass) { - ret = arena_palloc(choose_arena(), usize, run_size, alignment, - zero); - } else if (alignment <= chunksize) - ret = huge_malloc(usize, zero); - else - ret = huge_palloc(usize, alignment, zero); + else { + size_t run_size +#ifdef JEMALLOC_CC_SILENCE + = 0 +#endif + ; + + /* + * Ideally we would only ever call sa2u() once per aligned + * allocation request, and the caller of this function has + * already done so once. However, it's rather burdensome to + * require every caller to pass in run_size, especially given + * that it's only relevant to large allocations. Therefore, + * just call it again here in order to get run_size. + */ + sa2u(usize, alignment, &run_size); + if (run_size <= arena_maxclass) { + ret = arena_palloc(choose_arena(), usize, run_size, + alignment, zero); + } else if (alignment <= chunksize) + ret = huge_malloc(usize, zero); + else + ret = huge_palloc(usize, alignment, zero); + } assert(((uintptr_t)ret & (alignment - 1)) == 0); return (ret); @@ -629,7 +674,7 @@ isalloc(const void *ptr) chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); if (chunk != ptr) { /* Region. */ - assert(chunk->arena->magic == ARENA_MAGIC); + dassert(chunk->arena->magic == ARENA_MAGIC); #ifdef JEMALLOC_PROF ret = arena_salloc_demote(ptr); @@ -683,7 +728,7 @@ iralloc(void *ptr, size_t size, size_t extra, size_t alignment, bool zero, if (alignment != 0 && ((uintptr_t)ptr & ((uintptr_t)alignment-1)) != 0) { - size_t copysize; + size_t usize, copysize; /* * Existing object alignment is inadquate; allocate new space @@ -691,12 +736,18 @@ iralloc(void *ptr, size_t size, size_t extra, size_t alignment, bool zero, */ if (no_move) return (NULL); - ret = ipalloc(size + extra, alignment, zero); + usize = sa2u(size + extra, alignment, NULL); + if (usize == 0) + return (NULL); + ret = ipalloc(usize, alignment, zero); if (ret == NULL) { if (extra == 0) return (NULL); /* Try again, without extra this time. */ - ret = ipalloc(size, alignment, zero); + usize = sa2u(size, alignment, NULL); + if (usize == 0) + return (NULL); + ret = ipalloc(usize, alignment, zero); if (ret == NULL) return (NULL); } diff --git a/dep/jemalloc/include/jemalloc/internal/mb.h b/dep/jemalloc/include/jemalloc/internal/mb.h index 1707aa91d68..dc9f2a54262 100644 --- a/dep/jemalloc/include/jemalloc/internal/mb.h +++ b/dep/jemalloc/include/jemalloc/internal/mb.h @@ -17,7 +17,7 @@ void mb_write(void); #endif -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(MB_C_)) +#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_MB_C_)) #ifdef __i386__ /* * According to the Intel Architecture Software Developer's Manual, current diff --git a/dep/jemalloc/include/jemalloc/internal/mutex.h b/dep/jemalloc/include/jemalloc/internal/mutex.h index dcca01edd5d..62947ced55e 100644 --- a/dep/jemalloc/include/jemalloc/internal/mutex.h +++ b/dep/jemalloc/include/jemalloc/internal/mutex.h @@ -1,7 +1,11 @@ /******************************************************************************/ #ifdef JEMALLOC_H_TYPES +#ifdef JEMALLOC_OSSPIN +typedef OSSpinLock malloc_mutex_t; +#else typedef pthread_mutex_t malloc_mutex_t; +#endif #ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP # define MALLOC_MUTEX_INITIALIZER PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP @@ -41,17 +45,26 @@ JEMALLOC_INLINE void malloc_mutex_lock(malloc_mutex_t *mutex) { - if (isthreaded) + if (isthreaded) { +#ifdef JEMALLOC_OSSPIN + OSSpinLockLock(mutex); +#else pthread_mutex_lock(mutex); +#endif + } } JEMALLOC_INLINE bool malloc_mutex_trylock(malloc_mutex_t *mutex) { - if (isthreaded) + if (isthreaded) { +#ifdef JEMALLOC_OSSPIN + return (OSSpinLockTry(mutex) == false); +#else return (pthread_mutex_trylock(mutex) != 0); - else +#endif + } else return (false); } @@ -59,8 +72,13 @@ JEMALLOC_INLINE void malloc_mutex_unlock(malloc_mutex_t *mutex) { - if (isthreaded) + if (isthreaded) { +#ifdef JEMALLOC_OSSPIN + OSSpinLockUnlock(mutex); +#else pthread_mutex_unlock(mutex); +#endif + } } #endif diff --git a/dep/jemalloc/include/jemalloc/internal/private_namespace.h b/dep/jemalloc/include/jemalloc/internal/private_namespace.h new file mode 100644 index 00000000000..d4f5f96d7b2 --- /dev/null +++ b/dep/jemalloc/include/jemalloc/internal/private_namespace.h @@ -0,0 +1,195 @@ +#define arena_bin_index JEMALLOC_N(arena_bin_index) +#define arena_boot JEMALLOC_N(arena_boot) +#define arena_dalloc JEMALLOC_N(arena_dalloc) +#define arena_dalloc_bin JEMALLOC_N(arena_dalloc_bin) +#define arena_dalloc_large JEMALLOC_N(arena_dalloc_large) +#define arena_malloc JEMALLOC_N(arena_malloc) +#define arena_malloc_large JEMALLOC_N(arena_malloc_large) +#define arena_malloc_small JEMALLOC_N(arena_malloc_small) +#define arena_new JEMALLOC_N(arena_new) +#define arena_palloc JEMALLOC_N(arena_palloc) +#define arena_prof_accum JEMALLOC_N(arena_prof_accum) +#define arena_prof_ctx_get JEMALLOC_N(arena_prof_ctx_get) +#define arena_prof_ctx_set JEMALLOC_N(arena_prof_ctx_set) +#define arena_prof_promoted JEMALLOC_N(arena_prof_promoted) +#define arena_purge_all JEMALLOC_N(arena_purge_all) +#define arena_ralloc JEMALLOC_N(arena_ralloc) +#define arena_ralloc_no_move JEMALLOC_N(arena_ralloc_no_move) +#define arena_run_regind JEMALLOC_N(arena_run_regind) +#define arena_salloc JEMALLOC_N(arena_salloc) +#define arena_salloc_demote JEMALLOC_N(arena_salloc_demote) +#define arena_stats_merge JEMALLOC_N(arena_stats_merge) +#define arena_tcache_fill_small JEMALLOC_N(arena_tcache_fill_small) +#define arenas_bin_i_index JEMALLOC_N(arenas_bin_i_index) +#define arenas_extend JEMALLOC_N(arenas_extend) +#define arenas_lrun_i_index JEMALLOC_N(arenas_lrun_i_index) +#define atomic_add_uint32 JEMALLOC_N(atomic_add_uint32) +#define atomic_add_uint64 JEMALLOC_N(atomic_add_uint64) +#define atomic_sub_uint32 JEMALLOC_N(atomic_sub_uint32) +#define atomic_sub_uint64 JEMALLOC_N(atomic_sub_uint64) +#define base_alloc JEMALLOC_N(base_alloc) +#define base_boot JEMALLOC_N(base_boot) +#define base_node_alloc JEMALLOC_N(base_node_alloc) +#define base_node_dealloc JEMALLOC_N(base_node_dealloc) +#define bitmap_full JEMALLOC_N(bitmap_full) +#define bitmap_get JEMALLOC_N(bitmap_get) +#define bitmap_info_init JEMALLOC_N(bitmap_info_init) +#define bitmap_info_ngroups JEMALLOC_N(bitmap_info_ngroups) +#define bitmap_init JEMALLOC_N(bitmap_init) +#define bitmap_set JEMALLOC_N(bitmap_set) +#define bitmap_sfu JEMALLOC_N(bitmap_sfu) +#define bitmap_size JEMALLOC_N(bitmap_size) +#define bitmap_unset JEMALLOC_N(bitmap_unset) +#define bt_init JEMALLOC_N(bt_init) +#define buferror JEMALLOC_N(buferror) +#define choose_arena JEMALLOC_N(choose_arena) +#define choose_arena_hard JEMALLOC_N(choose_arena_hard) +#define chunk_alloc JEMALLOC_N(chunk_alloc) +#define chunk_alloc_dss JEMALLOC_N(chunk_alloc_dss) +#define chunk_alloc_mmap JEMALLOC_N(chunk_alloc_mmap) +#define chunk_alloc_mmap_noreserve JEMALLOC_N(chunk_alloc_mmap_noreserve) +#define chunk_alloc_swap JEMALLOC_N(chunk_alloc_swap) +#define chunk_boot JEMALLOC_N(chunk_boot) +#define chunk_dealloc JEMALLOC_N(chunk_dealloc) +#define chunk_dealloc_dss JEMALLOC_N(chunk_dealloc_dss) +#define chunk_dealloc_mmap JEMALLOC_N(chunk_dealloc_mmap) +#define chunk_dealloc_swap JEMALLOC_N(chunk_dealloc_swap) +#define chunk_dss_boot JEMALLOC_N(chunk_dss_boot) +#define chunk_in_dss JEMALLOC_N(chunk_in_dss) +#define chunk_in_swap JEMALLOC_N(chunk_in_swap) +#define chunk_mmap_boot JEMALLOC_N(chunk_mmap_boot) +#define chunk_swap_boot JEMALLOC_N(chunk_swap_boot) +#define chunk_swap_enable JEMALLOC_N(chunk_swap_enable) +#define ckh_bucket_search JEMALLOC_N(ckh_bucket_search) +#define ckh_count JEMALLOC_N(ckh_count) +#define ckh_delete JEMALLOC_N(ckh_delete) +#define ckh_evict_reloc_insert JEMALLOC_N(ckh_evict_reloc_insert) +#define ckh_insert JEMALLOC_N(ckh_insert) +#define ckh_isearch JEMALLOC_N(ckh_isearch) +#define ckh_iter JEMALLOC_N(ckh_iter) +#define ckh_new JEMALLOC_N(ckh_new) +#define ckh_pointer_hash JEMALLOC_N(ckh_pointer_hash) +#define ckh_pointer_keycomp JEMALLOC_N(ckh_pointer_keycomp) +#define ckh_rebuild JEMALLOC_N(ckh_rebuild) +#define ckh_remove JEMALLOC_N(ckh_remove) +#define ckh_search JEMALLOC_N(ckh_search) +#define ckh_string_hash JEMALLOC_N(ckh_string_hash) +#define ckh_string_keycomp JEMALLOC_N(ckh_string_keycomp) +#define ckh_try_bucket_insert JEMALLOC_N(ckh_try_bucket_insert) +#define ckh_try_insert JEMALLOC_N(ckh_try_insert) +#define create_zone JEMALLOC_N(create_zone) +#define ctl_boot JEMALLOC_N(ctl_boot) +#define ctl_bymib JEMALLOC_N(ctl_bymib) +#define ctl_byname JEMALLOC_N(ctl_byname) +#define ctl_nametomib JEMALLOC_N(ctl_nametomib) +#define extent_tree_ad_first JEMALLOC_N(extent_tree_ad_first) +#define extent_tree_ad_insert JEMALLOC_N(extent_tree_ad_insert) +#define extent_tree_ad_iter JEMALLOC_N(extent_tree_ad_iter) +#define extent_tree_ad_iter_recurse JEMALLOC_N(extent_tree_ad_iter_recurse) +#define extent_tree_ad_iter_start JEMALLOC_N(extent_tree_ad_iter_start) +#define extent_tree_ad_last JEMALLOC_N(extent_tree_ad_last) +#define extent_tree_ad_new JEMALLOC_N(extent_tree_ad_new) +#define extent_tree_ad_next JEMALLOC_N(extent_tree_ad_next) +#define extent_tree_ad_nsearch JEMALLOC_N(extent_tree_ad_nsearch) +#define extent_tree_ad_prev JEMALLOC_N(extent_tree_ad_prev) +#define extent_tree_ad_psearch JEMALLOC_N(extent_tree_ad_psearch) +#define extent_tree_ad_remove JEMALLOC_N(extent_tree_ad_remove) +#define extent_tree_ad_reverse_iter JEMALLOC_N(extent_tree_ad_reverse_iter) +#define extent_tree_ad_reverse_iter_recurse JEMALLOC_N(extent_tree_ad_reverse_iter_recurse) +#define extent_tree_ad_reverse_iter_start JEMALLOC_N(extent_tree_ad_reverse_iter_start) +#define extent_tree_ad_search JEMALLOC_N(extent_tree_ad_search) +#define extent_tree_szad_first JEMALLOC_N(extent_tree_szad_first) +#define extent_tree_szad_insert JEMALLOC_N(extent_tree_szad_insert) +#define extent_tree_szad_iter JEMALLOC_N(extent_tree_szad_iter) +#define extent_tree_szad_iter_recurse JEMALLOC_N(extent_tree_szad_iter_recurse) +#define extent_tree_szad_iter_start JEMALLOC_N(extent_tree_szad_iter_start) +#define extent_tree_szad_last JEMALLOC_N(extent_tree_szad_last) +#define extent_tree_szad_new JEMALLOC_N(extent_tree_szad_new) +#define extent_tree_szad_next JEMALLOC_N(extent_tree_szad_next) +#define extent_tree_szad_nsearch JEMALLOC_N(extent_tree_szad_nsearch) +#define extent_tree_szad_prev JEMALLOC_N(extent_tree_szad_prev) +#define extent_tree_szad_psearch JEMALLOC_N(extent_tree_szad_psearch) +#define extent_tree_szad_remove JEMALLOC_N(extent_tree_szad_remove) +#define extent_tree_szad_reverse_iter JEMALLOC_N(extent_tree_szad_reverse_iter) +#define extent_tree_szad_reverse_iter_recurse JEMALLOC_N(extent_tree_szad_reverse_iter_recurse) +#define extent_tree_szad_reverse_iter_start JEMALLOC_N(extent_tree_szad_reverse_iter_start) +#define extent_tree_szad_search JEMALLOC_N(extent_tree_szad_search) +#define hash JEMALLOC_N(hash) +#define huge_boot JEMALLOC_N(huge_boot) +#define huge_dalloc JEMALLOC_N(huge_dalloc) +#define huge_malloc JEMALLOC_N(huge_malloc) +#define huge_palloc JEMALLOC_N(huge_palloc) +#define huge_prof_ctx_get JEMALLOC_N(huge_prof_ctx_get) +#define huge_prof_ctx_set JEMALLOC_N(huge_prof_ctx_set) +#define huge_ralloc JEMALLOC_N(huge_ralloc) +#define huge_ralloc_no_move JEMALLOC_N(huge_ralloc_no_move) +#define huge_salloc JEMALLOC_N(huge_salloc) +#define iallocm JEMALLOC_N(iallocm) +#define icalloc JEMALLOC_N(icalloc) +#define idalloc JEMALLOC_N(idalloc) +#define imalloc JEMALLOC_N(imalloc) +#define ipalloc JEMALLOC_N(ipalloc) +#define iralloc JEMALLOC_N(iralloc) +#define isalloc JEMALLOC_N(isalloc) +#define ivsalloc JEMALLOC_N(ivsalloc) +#define jemalloc_darwin_init JEMALLOC_N(jemalloc_darwin_init) +#define jemalloc_postfork JEMALLOC_N(jemalloc_postfork) +#define jemalloc_prefork JEMALLOC_N(jemalloc_prefork) +#define malloc_cprintf JEMALLOC_N(malloc_cprintf) +#define malloc_mutex_destroy JEMALLOC_N(malloc_mutex_destroy) +#define malloc_mutex_init JEMALLOC_N(malloc_mutex_init) +#define malloc_mutex_lock JEMALLOC_N(malloc_mutex_lock) +#define malloc_mutex_trylock JEMALLOC_N(malloc_mutex_trylock) +#define malloc_mutex_unlock JEMALLOC_N(malloc_mutex_unlock) +#define malloc_printf JEMALLOC_N(malloc_printf) +#define malloc_write JEMALLOC_N(malloc_write) +#define mb_write JEMALLOC_N(mb_write) +#define pow2_ceil JEMALLOC_N(pow2_ceil) +#define prof_backtrace JEMALLOC_N(prof_backtrace) +#define prof_boot0 JEMALLOC_N(prof_boot0) +#define prof_boot1 JEMALLOC_N(prof_boot1) +#define prof_boot2 JEMALLOC_N(prof_boot2) +#define prof_ctx_get JEMALLOC_N(prof_ctx_get) +#define prof_ctx_set JEMALLOC_N(prof_ctx_set) +#define prof_free JEMALLOC_N(prof_free) +#define prof_gdump JEMALLOC_N(prof_gdump) +#define prof_idump JEMALLOC_N(prof_idump) +#define prof_lookup JEMALLOC_N(prof_lookup) +#define prof_malloc JEMALLOC_N(prof_malloc) +#define prof_mdump JEMALLOC_N(prof_mdump) +#define prof_realloc JEMALLOC_N(prof_realloc) +#define prof_sample_accum_update JEMALLOC_N(prof_sample_accum_update) +#define prof_sample_threshold_update JEMALLOC_N(prof_sample_threshold_update) +#define prof_tdata_init JEMALLOC_N(prof_tdata_init) +#define pthread_create JEMALLOC_N(pthread_create) +#define rtree_get JEMALLOC_N(rtree_get) +#define rtree_get_locked JEMALLOC_N(rtree_get_locked) +#define rtree_new JEMALLOC_N(rtree_new) +#define rtree_set JEMALLOC_N(rtree_set) +#define s2u JEMALLOC_N(s2u) +#define sa2u JEMALLOC_N(sa2u) +#define stats_arenas_i_bins_j_index JEMALLOC_N(stats_arenas_i_bins_j_index) +#define stats_arenas_i_index JEMALLOC_N(stats_arenas_i_index) +#define stats_arenas_i_lruns_j_index JEMALLOC_N(stats_arenas_i_lruns_j_index) +#define stats_cactive_add JEMALLOC_N(stats_cactive_add) +#define stats_cactive_get JEMALLOC_N(stats_cactive_get) +#define stats_cactive_sub JEMALLOC_N(stats_cactive_sub) +#define stats_print JEMALLOC_N(stats_print) +#define szone2ozone JEMALLOC_N(szone2ozone) +#define tcache_alloc_easy JEMALLOC_N(tcache_alloc_easy) +#define tcache_alloc_large JEMALLOC_N(tcache_alloc_large) +#define tcache_alloc_small JEMALLOC_N(tcache_alloc_small) +#define tcache_alloc_small_hard JEMALLOC_N(tcache_alloc_small_hard) +#define tcache_bin_flush_large JEMALLOC_N(tcache_bin_flush_large) +#define tcache_bin_flush_small JEMALLOC_N(tcache_bin_flush_small) +#define tcache_boot JEMALLOC_N(tcache_boot) +#define tcache_create JEMALLOC_N(tcache_create) +#define tcache_dalloc_large JEMALLOC_N(tcache_dalloc_large) +#define tcache_dalloc_small JEMALLOC_N(tcache_dalloc_small) +#define tcache_destroy JEMALLOC_N(tcache_destroy) +#define tcache_event JEMALLOC_N(tcache_event) +#define tcache_get JEMALLOC_N(tcache_get) +#define tcache_stats_merge JEMALLOC_N(tcache_stats_merge) +#define thread_allocated_get JEMALLOC_N(thread_allocated_get) +#define thread_allocated_get_hard JEMALLOC_N(thread_allocated_get_hard) +#define u2s JEMALLOC_N(u2s) diff --git a/dep/jemalloc/include/jemalloc/internal/prof.h b/dep/jemalloc/include/jemalloc/internal/prof.h index 7864000b88b..e9064ba6e73 100644 --- a/dep/jemalloc/include/jemalloc/internal/prof.h +++ b/dep/jemalloc/include/jemalloc/internal/prof.h @@ -227,9 +227,60 @@ bool prof_boot2(void); /******************************************************************************/ #ifdef JEMALLOC_H_INLINES +#define PROF_ALLOC_PREP(nignore, size, ret) do { \ + prof_tdata_t *prof_tdata; \ + prof_bt_t bt; \ + \ + assert(size == s2u(size)); \ + \ + prof_tdata = PROF_TCACHE_GET(); \ + if (prof_tdata == NULL) { \ + prof_tdata = prof_tdata_init(); \ + if (prof_tdata == NULL) { \ + ret = NULL; \ + break; \ + } \ + } \ + \ + if (opt_prof_active == false) { \ + /* Sampling is currently inactive, so avoid sampling. */\ + ret = (prof_thr_cnt_t *)(uintptr_t)1U; \ + } else if (opt_lg_prof_sample == 0) { \ + /* Don't bother with sampling logic, since sampling */\ + /* interval is 1. */\ + bt_init(&bt, prof_tdata->vec); \ + prof_backtrace(&bt, nignore, prof_bt_max); \ + ret = prof_lookup(&bt); \ + } else { \ + if (prof_tdata->threshold == 0) { \ + /* Initialize. Seed the prng differently for */\ + /* each thread. */\ + prof_tdata->prn_state = \ + (uint64_t)(uintptr_t)&size; \ + prof_sample_threshold_update(prof_tdata); \ + } \ + \ + /* Determine whether to capture a backtrace based on */\ + /* whether size is enough for prof_accum to reach */\ + /* prof_tdata->threshold. However, delay updating */\ + /* these variables until prof_{m,re}alloc(), because */\ + /* we don't know for sure that the allocation will */\ + /* succeed. */\ + /* */\ + /* Use subtraction rather than addition to avoid */\ + /* potential integer overflow. */\ + if (size >= prof_tdata->threshold - \ + prof_tdata->accum) { \ + bt_init(&bt, prof_tdata->vec); \ + prof_backtrace(&bt, nignore, prof_bt_max); \ + ret = prof_lookup(&bt); \ + } else \ + ret = (prof_thr_cnt_t *)(uintptr_t)1U; \ + } \ +} while (0) + #ifndef JEMALLOC_ENABLE_INLINE void prof_sample_threshold_update(prof_tdata_t *prof_tdata); -prof_thr_cnt_t *prof_alloc_prep(size_t size); prof_ctx_t *prof_ctx_get(const void *ptr); void prof_ctx_set(const void *ptr, prof_ctx_t *ctx); bool prof_sample_accum_update(size_t size); @@ -247,8 +298,22 @@ prof_sample_threshold_update(prof_tdata_t *prof_tdata) double u; /* - * Compute prof_sample_threshold as a geometrically distributed random + * Compute sample threshold as a geometrically distributed random * variable with mean (2^opt_lg_prof_sample). + * + * __ __ + * | log(u) | 1 + * prof_tdata->threshold = | -------- |, where p = ------------------- + * | log(1-p) | opt_lg_prof_sample + * 2 + * + * For more information on the math, see: + * + * Non-Uniform Random Variate Generation + * Luc Devroye + * Springer-Verlag, New York, 1986 + * pp 500 + * (http://cg.scs.carleton.ca/~luc/rnbookindex.html) */ prn64(r, 53, prof_tdata->prn_state, (uint64_t)6364136223846793005LLU, (uint64_t)1442695040888963407LLU); @@ -258,71 +323,6 @@ prof_sample_threshold_update(prof_tdata_t *prof_tdata) + (uint64_t)1U; } -JEMALLOC_INLINE prof_thr_cnt_t * -prof_alloc_prep(size_t size) -{ -#ifdef JEMALLOC_ENABLE_INLINE - /* This function does not have its own stack frame, because it is inlined. */ -# define NIGNORE 1 -#else -# define NIGNORE 2 -#endif - prof_thr_cnt_t *ret; - prof_tdata_t *prof_tdata; - prof_bt_t bt; - - assert(size == s2u(size)); - - prof_tdata = PROF_TCACHE_GET(); - if (prof_tdata == NULL) { - prof_tdata = prof_tdata_init(); - if (prof_tdata == NULL) - return (NULL); - } - - if (opt_prof_active == false) { - /* Sampling is currently inactive, so avoid sampling. */ - ret = (prof_thr_cnt_t *)(uintptr_t)1U; - } else if (opt_lg_prof_sample == 0) { - /* - * Don't bother with sampling logic, since sampling interval is - * 1. - */ - bt_init(&bt, prof_tdata->vec); - prof_backtrace(&bt, NIGNORE, prof_bt_max); - ret = prof_lookup(&bt); - } else { - if (prof_tdata->threshold == 0) { - /* - * Initialize. Seed the prng differently for each - * thread. - */ - prof_tdata->prn_state = (uint64_t)(uintptr_t)&size; - prof_sample_threshold_update(prof_tdata); - } - - /* - * Determine whether to capture a backtrace based on whether - * size is enough for prof_accum to reach - * prof_tdata->threshold. However, delay updating these - * variables until prof_{m,re}alloc(), because we don't know - * for sure that the allocation will succeed. - * - * Use subtraction rather than addition to avoid potential - * integer overflow. - */ - if (size >= prof_tdata->threshold - prof_tdata->accum) { - bt_init(&bt, prof_tdata->vec); - prof_backtrace(&bt, NIGNORE, prof_bt_max); - ret = prof_lookup(&bt); - } else - ret = (prof_thr_cnt_t *)(uintptr_t)1U; - } - - return (ret); -#undef NIGNORE -} - JEMALLOC_INLINE prof_ctx_t * prof_ctx_get(const void *ptr) { @@ -334,7 +334,7 @@ prof_ctx_get(const void *ptr) chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); if (chunk != ptr) { /* Region. */ - assert(chunk->arena->magic == ARENA_MAGIC); + dassert(chunk->arena->magic == ARENA_MAGIC); ret = arena_prof_ctx_get(ptr); } else @@ -353,7 +353,7 @@ prof_ctx_set(const void *ptr, prof_ctx_t *ctx) chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); if (chunk != ptr) { /* Region. */ - assert(chunk->arena->magic == ARENA_MAGIC); + dassert(chunk->arena->magic == ARENA_MAGIC); arena_prof_ctx_set(ptr, ctx); } else @@ -374,7 +374,7 @@ prof_sample_accum_update(size_t size) /* Take care to avoid integer overflow. */ if (size >= prof_tdata->threshold - prof_tdata->accum) { prof_tdata->accum -= (prof_tdata->threshold - size); - /* Compute new prof_sample_threshold. */ + /* Compute new sample threshold. */ prof_sample_threshold_update(prof_tdata); while (prof_tdata->accum >= prof_tdata->threshold) { prof_tdata->accum -= prof_tdata->threshold; @@ -401,7 +401,7 @@ prof_malloc(const void *ptr, size_t size, prof_thr_cnt_t *cnt) * always possible to tell in advance how large an * object's usable size will be, so there should never * be a difference between the size passed to - * prof_alloc_prep() and prof_malloc(). + * PROF_ALLOC_PREP() and prof_malloc(). */ assert((uintptr_t)cnt == (uintptr_t)1U); } @@ -445,7 +445,7 @@ prof_realloc(const void *ptr, size_t size, prof_thr_cnt_t *cnt, if (prof_sample_accum_update(size)) { /* * Don't sample. The size passed to - * prof_alloc_prep() was larger than what + * PROF_ALLOC_PREP() was larger than what * actually got allocated, so a backtrace was * captured for this allocation, even though * its actual size was insufficient to cross diff --git a/dep/jemalloc/include/jemalloc/internal/rtree.h b/dep/jemalloc/include/jemalloc/internal/rtree.h index 9d58ebac545..95d6355a5f4 100644 --- a/dep/jemalloc/include/jemalloc/internal/rtree.h +++ b/dep/jemalloc/include/jemalloc/internal/rtree.h @@ -49,7 +49,7 @@ void *rtree_get(rtree_t *rtree, uintptr_t key); bool rtree_set(rtree_t *rtree, uintptr_t key, void *val); #endif -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(RTREE_C_)) +#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_RTREE_C_)) #define RTREE_GET_GENERATE(f) \ /* The least significant bits of the key are ignored. */ \ JEMALLOC_INLINE void * \ diff --git a/dep/jemalloc/include/jemalloc/internal/stats.h b/dep/jemalloc/include/jemalloc/internal/stats.h index 3fc2080a34b..2a9b31d9ffc 100644 --- a/dep/jemalloc/include/jemalloc/internal/stats.h +++ b/dep/jemalloc/include/jemalloc/internal/stats.h @@ -154,6 +154,10 @@ struct chunk_stats_s { extern bool opt_stats_print; +#ifdef JEMALLOC_STATS +extern size_t stats_cactive; +#endif + char *u2s(uint64_t x, unsigned base, char *s); #ifdef JEMALLOC_STATS void malloc_cprintf(void (*write)(void *, const char *), void *cbopaque, @@ -166,9 +170,38 @@ void stats_print(void (*write)(void *, const char *), void *cbopaque, #endif /* JEMALLOC_H_EXTERNS */ /******************************************************************************/ -#ifdef JEMALLOC_STATS #ifdef JEMALLOC_H_INLINES +#ifdef JEMALLOC_STATS + +#ifndef JEMALLOC_ENABLE_INLINE +size_t stats_cactive_get(void); +void stats_cactive_add(size_t size); +void stats_cactive_sub(size_t size); +#endif + +#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_STATS_C_)) +JEMALLOC_INLINE size_t +stats_cactive_get(void) +{ + + return (atomic_read_z(&stats_cactive)); +} + +JEMALLOC_INLINE void +stats_cactive_add(size_t size) +{ + + atomic_add_z(&stats_cactive, size); +} + +JEMALLOC_INLINE void +stats_cactive_sub(size_t size) +{ + + atomic_sub_z(&stats_cactive, size); +} +#endif -#endif /* JEMALLOC_H_INLINES */ #endif /* JEMALLOC_STATS */ +#endif /* JEMALLOC_H_INLINES */ /******************************************************************************/ diff --git a/dep/jemalloc/include/jemalloc/internal/tcache.h b/dep/jemalloc/include/jemalloc/internal/tcache.h index 1ad91a9b1e0..da3c68c5770 100644 --- a/dep/jemalloc/include/jemalloc/internal/tcache.h +++ b/dep/jemalloc/include/jemalloc/internal/tcache.h @@ -2,6 +2,7 @@ /******************************************************************************/ #ifdef JEMALLOC_H_TYPES +typedef struct tcache_bin_info_s tcache_bin_info_t; typedef struct tcache_bin_s tcache_bin_t; typedef struct tcache_s tcache_t; @@ -32,15 +33,22 @@ typedef struct tcache_s tcache_t; /******************************************************************************/ #ifdef JEMALLOC_H_STRUCTS +/* + * Read-only information associated with each element of tcache_t's tbins array + * is stored separately, mainly to reduce memory usage. + */ +struct tcache_bin_info_s { + unsigned ncached_max; /* Upper limit on ncached. */ +}; + struct tcache_bin_s { # ifdef JEMALLOC_STATS tcache_bin_stats_t tstats; # endif - unsigned low_water; /* Min # cached since last GC. */ - unsigned high_water; /* Max # cached since last GC. */ + int low_water; /* Min # cached since last GC. */ + unsigned lg_fill_div; /* Fill (ncached_max >> lg_fill_div). */ unsigned ncached; /* # of cached objects. */ - unsigned ncached_max; /* Upper limit on ncached. */ - void *avail; /* Chain of available objects. */ + void **avail; /* Stack of available objects. */ }; struct tcache_s { @@ -54,6 +62,12 @@ struct tcache_s { unsigned ev_cnt; /* Event count since incremental GC. */ unsigned next_gc_bin; /* Next bin to GC. */ tcache_bin_t tbins[1]; /* Dynamically sized. */ + /* + * The pointer stacks associated with tbins follow as a contiguous + * array. During tcache initialization, the avail pointer in each + * element of tbins is initialized to point to the proper offset within + * this array. + */ }; #endif /* JEMALLOC_H_STRUCTS */ @@ -64,6 +78,8 @@ extern bool opt_tcache; extern ssize_t opt_lg_tcache_max; extern ssize_t opt_lg_tcache_gc_sweep; +extern tcache_bin_info_t *tcache_bin_info; + /* Map of thread-specific caches. */ #ifndef NO_TLS extern __thread tcache_t *tcache_tls @@ -110,7 +126,7 @@ void tcache_destroy(tcache_t *tcache); #ifdef JEMALLOC_STATS void tcache_stats_merge(tcache_t *tcache, arena_t *arena); #endif -void tcache_boot(void); +bool tcache_boot(void); #endif /* JEMALLOC_H_EXTERNS */ /******************************************************************************/ @@ -169,6 +185,7 @@ tcache_event(tcache_t *tcache) if (tcache->ev_cnt == tcache_gc_incr) { size_t binind = tcache->next_gc_bin; tcache_bin_t *tbin = &tcache->tbins[binind]; + tcache_bin_info_t *tbin_info = &tcache_bin_info[binind]; if (tbin->low_water > 0) { /* @@ -192,9 +209,22 @@ tcache_event(tcache_t *tcache) #endif ); } + /* + * Reduce fill count by 2X. Limit lg_fill_div such that + * the fill count is always at least 1. + */ + if ((tbin_info->ncached_max >> (tbin->lg_fill_div+1)) + >= 1) + tbin->lg_fill_div++; + } else if (tbin->low_water < 0) { + /* + * Increase fill count by 2X. Make sure lg_fill_div + * stays greater than 0. + */ + if (tbin->lg_fill_div > 1) + tbin->lg_fill_div--; } tbin->low_water = tbin->ncached; - tbin->high_water = tbin->ncached; tcache->next_gc_bin++; if (tcache->next_gc_bin == nhbins) @@ -208,13 +238,14 @@ tcache_alloc_easy(tcache_bin_t *tbin) { void *ret; - if (tbin->ncached == 0) + if (tbin->ncached == 0) { + tbin->low_water = -1; return (NULL); + } tbin->ncached--; - if (tbin->ncached < tbin->low_water) + if ((int)tbin->ncached < tbin->low_water) tbin->low_water = tbin->ncached; - ret = tbin->avail; - tbin->avail = *(void **)ret; + ret = tbin->avail[tbin->ncached]; return (ret); } @@ -225,7 +256,7 @@ tcache_alloc_small(tcache_t *tcache, size_t size, bool zero) size_t binind; tcache_bin_t *tbin; - binind = small_size2bin[size]; + binind = SMALL_SIZE2BIN(size); assert(binind < nbins); tbin = &tcache->tbins[binind]; ret = tcache_alloc_easy(tbin); @@ -234,7 +265,7 @@ tcache_alloc_small(tcache_t *tcache, size_t size, bool zero) if (ret == NULL) return (NULL); } - assert(arena_salloc(ret) == tcache->arena->bins[binind].reg_size); + assert(arena_salloc(ret) == arena_bin_info[binind].reg_size); if (zero == false) { #ifdef JEMALLOC_FILL @@ -250,7 +281,7 @@ tcache_alloc_small(tcache_t *tcache, size_t size, bool zero) tbin->tstats.nrequests++; #endif #ifdef JEMALLOC_PROF - tcache->prof_accumbytes += tcache->arena->bins[binind].reg_size; + tcache->prof_accumbytes += arena_bin_info[binind].reg_size; #endif tcache_event(tcache); return (ret); @@ -314,6 +345,7 @@ tcache_dalloc_small(tcache_t *tcache, void *ptr) arena_run_t *run; arena_bin_t *bin; tcache_bin_t *tbin; + tcache_bin_info_t *tbin_info; size_t pageind, binind; arena_chunk_map_t *mapelm; @@ -325,7 +357,7 @@ tcache_dalloc_small(tcache_t *tcache, void *ptr) mapelm = &chunk->map[pageind-map_bias]; run = (arena_run_t *)((uintptr_t)chunk + (uintptr_t)((pageind - (mapelm->bits >> PAGE_SHIFT)) << PAGE_SHIFT)); - assert(run->magic == ARENA_RUN_MAGIC); + dassert(run->magic == ARENA_RUN_MAGIC); bin = run->bin; binind = ((uintptr_t)bin - (uintptr_t)&arena->bins) / sizeof(arena_bin_t); @@ -333,23 +365,22 @@ tcache_dalloc_small(tcache_t *tcache, void *ptr) #ifdef JEMALLOC_FILL if (opt_junk) - memset(ptr, 0x5a, bin->reg_size); + memset(ptr, 0x5a, arena_bin_info[binind].reg_size); #endif tbin = &tcache->tbins[binind]; - if (tbin->ncached == tbin->ncached_max) { - tcache_bin_flush_small(tbin, binind, (tbin->ncached_max >> 1) + tbin_info = &tcache_bin_info[binind]; + if (tbin->ncached == tbin_info->ncached_max) { + tcache_bin_flush_small(tbin, binind, (tbin_info->ncached_max >> + 1) #if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) , tcache #endif ); } - assert(tbin->ncached < tbin->ncached_max); - *(void **)ptr = tbin->avail; - tbin->avail = ptr; + assert(tbin->ncached < tbin_info->ncached_max); + tbin->avail[tbin->ncached] = ptr; tbin->ncached++; - if (tbin->ncached > tbin->high_water) - tbin->high_water = tbin->ncached; tcache_event(tcache); } @@ -361,6 +392,7 @@ tcache_dalloc_large(tcache_t *tcache, void *ptr, size_t size) arena_chunk_t *chunk; size_t pageind, binind; tcache_bin_t *tbin; + tcache_bin_info_t *tbin_info; assert((size & PAGE_MASK) == 0); assert(arena_salloc(ptr) > small_maxclass); @@ -377,19 +409,18 @@ tcache_dalloc_large(tcache_t *tcache, void *ptr, size_t size) #endif tbin = &tcache->tbins[binind]; - if (tbin->ncached == tbin->ncached_max) { - tcache_bin_flush_large(tbin, binind, (tbin->ncached_max >> 1) + tbin_info = &tcache_bin_info[binind]; + if (tbin->ncached == tbin_info->ncached_max) { + tcache_bin_flush_large(tbin, binind, (tbin_info->ncached_max >> + 1) #if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) , tcache #endif ); } - assert(tbin->ncached < tbin->ncached_max); - *(void **)ptr = tbin->avail; - tbin->avail = ptr; + assert(tbin->ncached < tbin_info->ncached_max); + tbin->avail[tbin->ncached] = ptr; tbin->ncached++; - if (tbin->ncached > tbin->high_water) - tbin->high_water = tbin->ncached; tcache_event(tcache); } diff --git a/dep/jemalloc/include/jemalloc/jemalloc.h b/dep/jemalloc/include/jemalloc/jemalloc.h index 287dac46ed2..3842e28115e 100644 --- a/dep/jemalloc/include/jemalloc/jemalloc.h +++ b/dep/jemalloc/include/jemalloc/jemalloc.h @@ -7,19 +7,19 @@ extern "C" { #include #include -#define JEMALLOC_VERSION "2.1.0-0-g1c4b088b08d3bc7617a34387e196ce03716160bf" +#define JEMALLOC_VERSION "2.2.5-0-gfc1bb70e5f0d9a58b39efa39cc549b5af5104760" #define JEMALLOC_VERSION_MAJOR 2 -#define JEMALLOC_VERSION_MINOR 1 -#define JEMALLOC_VERSION_BUGFIX 0 +#define JEMALLOC_VERSION_MINOR 2 +#define JEMALLOC_VERSION_BUGFIX 5 #define JEMALLOC_VERSION_NREV 0 -#define JEMALLOC_VERSION_GID "1c4b088b08d3bc7617a34387e196ce03716160bf" +#define JEMALLOC_VERSION_GID "fc1bb70e5f0d9a58b39efa39cc549b5af5104760" #include "jemalloc_defs.h" #ifndef JEMALLOC_P # define JEMALLOC_P(s) s #endif -#define ALLOCM_LG_ALIGN ((int)0x3f) +#define ALLOCM_LG_ALIGN(la) (la) #if LG_SIZEOF_PTR == 2 #define ALLOCM_ALIGN(a) (ffs(a)-1) #else diff --git a/dep/jemalloc/include/jemalloc/jemalloc_defs.h b/dep/jemalloc/include/jemalloc/jemalloc_defs.h index a641b56da03..f0f8fa71a4d 100644 --- a/dep/jemalloc/include/jemalloc/jemalloc_defs.h +++ b/dep/jemalloc/include/jemalloc/jemalloc_defs.h @@ -19,12 +19,33 @@ /* #undef JEMALLOC_P */ #endif +/* + * JEMALLOC_PRIVATE_NAMESPACE is used as a prefix for all library-private APIs. + * For shared libraries, symbol visibility mechanisms prevent these symbols + * from being exported, but for static libraries, naming collisions are a real + * possibility. + */ +#define JEMALLOC_PRIVATE_NAMESPACE "" +#define JEMALLOC_N(string_that_no_one_should_want_to_use_as_a_jemalloc_private_namespace_prefix) string_that_no_one_should_want_to_use_as_a_jemalloc_private_namespace_prefix + /* * Hyper-threaded CPUs may need a special instruction inside spin loops in * order to yield to another virtual CPU. */ #define CPU_SPINWAIT __asm__ volatile("pause") +/* + * Defined if OSAtomic*() functions are available, as provided by Darwin, and + * documented in the atomic(3) manual page. + */ +/* #undef JEMALLOC_OSATOMIC */ + +/* + * Defined if OSSpin*() functions are available, as provided by Darwin, and + * documented in the spinlock(3) manual page. + */ +/* #undef JEMALLOC_OSSPIN */ + /* Defined if __attribute__((...)) syntax is supported. */ #define JEMALLOC_HAVE_ATTR #ifdef JEMALLOC_HAVE_ATTR @@ -54,18 +75,21 @@ /* Use libgcc for profile backtracing if defined. */ /* #undef JEMALLOC_PROF_LIBGCC */ +/* Use gcc intrinsics for profile backtracing if defined. */ +/* #undef JEMALLOC_PROF_GCC */ + /* * JEMALLOC_TINY enables support for tiny objects, which are smaller than one * quantum. */ -/* #undef JEMALLOC_TINY */ +#define JEMALLOC_TINY /* * JEMALLOC_TCACHE enables a thread-specific caching layer for small objects. * This makes it possible to allocate/deallocate objects without any locking * when the cache is in the steady state. */ -/* #undef JEMALLOC_TCACHE */ +#define JEMALLOC_TCACHE /* * JEMALLOC_DSS enables use of sbrk(2) to allocate chunks from the data storage @@ -86,7 +110,7 @@ /* #undef JEMALLOC_SYSV */ /* Support lazy locking (avoid locking unless a second thread is launched). */ -/* #undef JEMALLOC_LAZY_LOCK */ +#define JEMALLOC_LAZY_LOCK /* Determine page size at run time if defined. */ /* #undef DYNAMIC_PAGE_SHIFT */ @@ -133,9 +157,12 @@ /* #undef JEMALLOC_PURGE_MADVISE_FREE */ /* sizeof(void *) == 2^LG_SIZEOF_PTR. */ -#define LG_SIZEOF_PTR 2 +#define LG_SIZEOF_PTR 3 /* sizeof(int) == 2^LG_SIZEOF_INT. */ #define LG_SIZEOF_INT 2 +/* sizeof(long) == 2^LG_SIZEOF_LONG. */ +#define LG_SIZEOF_LONG 3 + #endif /* JEMALLOC_DEFS_H_ */ diff --git a/dep/jemalloc/src/arena.c b/dep/jemalloc/src/arena.c index 7f939b3cd77..d166ca1ec4d 100644 --- a/dep/jemalloc/src/arena.c +++ b/dep/jemalloc/src/arena.c @@ -8,6 +8,7 @@ size_t opt_lg_qspace_max = LG_QSPACE_MAX_DEFAULT; size_t opt_lg_cspace_max = LG_CSPACE_MAX_DEFAULT; ssize_t opt_lg_dirty_mult = LG_DIRTY_MULT_DEFAULT; uint8_t const *small_size2bin; +arena_bin_info_t *arena_bin_info; /* Various bin-related settings. */ unsigned nqbins; @@ -25,26 +26,27 @@ size_t mspace_mask; /* * const_small_size2bin is a static constant lookup table that in the common - * case can be used as-is for small_size2bin. For dynamically linked programs, - * this avoids a page of memory overhead per process. + * case can be used as-is for small_size2bin. */ -#define S2B_1(i) i, -#define S2B_2(i) S2B_1(i) S2B_1(i) -#define S2B_4(i) S2B_2(i) S2B_2(i) +#if (LG_TINY_MIN == 2) +#define S2B_4(i) i, #define S2B_8(i) S2B_4(i) S2B_4(i) +#elif (LG_TINY_MIN == 3) +#define S2B_8(i) i, +#else +# error "Unsupported LG_TINY_MIN" +#endif #define S2B_16(i) S2B_8(i) S2B_8(i) #define S2B_32(i) S2B_16(i) S2B_16(i) #define S2B_64(i) S2B_32(i) S2B_32(i) #define S2B_128(i) S2B_64(i) S2B_64(i) #define S2B_256(i) S2B_128(i) S2B_128(i) /* - * The number of elements in const_small_size2bin is dependent on page size - * and on the definition for SUBPAGE. If SUBPAGE changes, the '- 255' must also - * change, along with the addition/removal of static lookup table element - * definitions. + * The number of elements in const_small_size2bin is dependent on the + * definition for SUBPAGE. */ -static const uint8_t const_small_size2bin[STATIC_PAGE_SIZE - 255] = { - S2B_1(0xffU) /* 0 */ +static JEMALLOC_ATTR(aligned(CACHELINE)) + const uint8_t const_small_size2bin[] = { #if (LG_QUANTUM == 4) /* 16-byte quantum **********************/ # ifdef JEMALLOC_TINY @@ -173,7 +175,6 @@ static void arena_run_trim_tail(arena_t *arena, arena_chunk_t *chunk, arena_run_t *run, size_t oldsize, size_t newsize, bool dirty); static arena_run_t *arena_bin_nonfull_run_get(arena_t *arena, arena_bin_t *bin); static void *arena_bin_malloc_hard(arena_t *arena, arena_bin_t *bin); -static size_t arena_bin_run_size_calc(arena_bin_t *bin, size_t min_run_size); static void arena_dissociate_bin_run(arena_chunk_t *chunk, arena_run_t *run, arena_bin_t *bin); static void arena_dalloc_bin_run(arena_t *arena, arena_chunk_t *chunk, @@ -191,6 +192,9 @@ static bool small_size2bin_init(void); static void small_size2bin_validate(void); #endif static bool small_size2bin_init_hard(void); +static size_t bin_info_run_size_calc(arena_bin_info_t *bin_info, + size_t min_run_size); +static bool bin_info_init(void); /******************************************************************************/ @@ -246,57 +250,48 @@ rb_gen(static JEMALLOC_ATTR(unused), arena_avail_tree_, arena_avail_tree_t, arena_chunk_map_t, u.rb_link, arena_avail_comp) static inline void * -arena_run_reg_alloc(arena_run_t *run, arena_bin_t *bin) +arena_run_reg_alloc(arena_run_t *run, arena_bin_info_t *bin_info) { void *ret; + unsigned regind; + bitmap_t *bitmap = (bitmap_t *)((uintptr_t)run + + (uintptr_t)bin_info->bitmap_offset); - assert(run->magic == ARENA_RUN_MAGIC); + dassert(run->magic == ARENA_RUN_MAGIC); assert(run->nfree > 0); + assert(bitmap_full(bitmap, &bin_info->bitmap_info) == false); + regind = bitmap_sfu(bitmap, &bin_info->bitmap_info); + ret = (void *)((uintptr_t)run + (uintptr_t)bin_info->reg0_offset + + (uintptr_t)(bin_info->reg_size * regind)); run->nfree--; - ret = run->avail; - if (ret != NULL) { - /* Double free can cause assertion failure.*/ - assert(ret != NULL); - /* Write-after free can cause assertion failure. */ - assert((uintptr_t)ret >= (uintptr_t)run + - (uintptr_t)bin->reg0_offset); - assert((uintptr_t)ret < (uintptr_t)run->next); - assert(((uintptr_t)ret - ((uintptr_t)run + - (uintptr_t)bin->reg0_offset)) % (uintptr_t)bin->reg_size == - 0); - run->avail = *(void **)ret; - return (ret); - } - ret = run->next; - run->next = (void *)((uintptr_t)ret + (uintptr_t)bin->reg_size); - assert(ret != NULL); + if (regind == run->nextind) + run->nextind++; + assert(regind < run->nextind); return (ret); } static inline void arena_run_reg_dalloc(arena_run_t *run, void *ptr) { + arena_chunk_t *chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(run); + size_t binind = arena_bin_index(chunk->arena, run->bin); + arena_bin_info_t *bin_info = &arena_bin_info[binind]; + unsigned regind = arena_run_regind(run, bin_info, ptr); + bitmap_t *bitmap = (bitmap_t *)((uintptr_t)run + + (uintptr_t)bin_info->bitmap_offset); - assert(run->nfree < run->bin->nregs); + assert(run->nfree < bin_info->nregs); /* Freeing an interior pointer can cause assertion failure. */ assert(((uintptr_t)ptr - ((uintptr_t)run + - (uintptr_t)run->bin->reg0_offset)) % (uintptr_t)run->bin->reg_size + (uintptr_t)bin_info->reg0_offset)) % (uintptr_t)bin_info->reg_size == 0); - /* - * Freeing a pointer lower than region zero can cause assertion - * failure. - */ assert((uintptr_t)ptr >= (uintptr_t)run + - (uintptr_t)run->bin->reg0_offset); - /* - * Freeing a pointer past in the run's frontier can cause assertion - * failure. - */ - assert((uintptr_t)ptr < (uintptr_t)run->next); + (uintptr_t)bin_info->reg0_offset); + /* Freeing an unallocated pointer can cause assertion failure. */ + assert(bitmap_get(bitmap, &bin_info->bitmap_info, regind)); - *(void **)ptr = run->avail; - run->avail = ptr; + bitmap_unset(bitmap, &bin_info->bitmap_info, regind); run->nfree++; } @@ -320,6 +315,9 @@ arena_run_split(arena_t *arena, arena_run_t *run, size_t size, bool large, size_t old_ndirty, run_ind, total_pages, need_pages, rem_pages, i; size_t flag_dirty; arena_avail_tree_t *runs_avail; +#ifdef JEMALLOC_STATS + size_t cactive_diff; +#endif chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(run); old_ndirty = chunk->ndirty; @@ -338,6 +336,13 @@ arena_run_split(arena_t *arena, arena_run_t *run, size_t size, bool large, rem_pages = total_pages - need_pages; arena_avail_tree_remove(runs_avail, &chunk->map[run_ind-map_bias]); +#ifdef JEMALLOC_STATS + /* Update stats_cactive if nactive is crossing a chunk multiple. */ + cactive_diff = CHUNK_CEILING((arena->nactive + need_pages) << + PAGE_SHIFT) - CHUNK_CEILING(arena->nactive << PAGE_SHIFT); + if (cactive_diff != 0) + stats_cactive_add(cactive_diff); +#endif arena->nactive += need_pages; /* Keep track of trailing unused pages for later use. */ @@ -564,7 +569,7 @@ arena_chunk_dealloc(arena_t *arena, arena_chunk_t *chunk) arena->ndirty -= spare->ndirty; } malloc_mutex_unlock(&arena->lock); - chunk_dealloc((void *)spare, chunksize); + chunk_dealloc((void *)spare, chunksize, true); malloc_mutex_lock(&arena->lock); #ifdef JEMALLOC_STATS arena->stats.mapped -= chunksize; @@ -725,6 +730,9 @@ arena_chunk_purge(arena_t *arena, arena_chunk_t *chunk) assert(pageind + npages <= chunk_npages); if (mapelm->bits & CHUNK_MAP_DIRTY) { size_t i; +#ifdef JEMALLOC_STATS + size_t cactive_diff; +#endif arena_avail_tree_remove( &arena->runs_avail_dirty, mapelm); @@ -747,6 +755,17 @@ arena_chunk_purge(arena_t *arena, arena_chunk_t *chunk) CHUNK_MAP_ALLOCATED; } +#ifdef JEMALLOC_STATS + /* + * Update stats_cactive if nactive is crossing a + * chunk multiple. + */ + cactive_diff = CHUNK_CEILING((arena->nactive + + npages) << PAGE_SHIFT) - + CHUNK_CEILING(arena->nactive << PAGE_SHIFT); + if (cactive_diff != 0) + stats_cactive_add(cactive_diff); +#endif arena->nactive += npages; /* Append to list for later processing. */ ql_elm_new(mapelm, u.ql_link); @@ -763,8 +782,12 @@ arena_chunk_purge(arena_t *arena, arena_chunk_t *chunk) chunk + (uintptr_t)(pageind << PAGE_SHIFT)); assert((mapelm->bits >> PAGE_SHIFT) == 0); - assert(run->magic == ARENA_RUN_MAGIC); - pageind += run->bin->run_size >> PAGE_SHIFT; + dassert(run->magic == ARENA_RUN_MAGIC); + size_t binind = arena_bin_index(arena, + run->bin); + arena_bin_info_t *bin_info = + &arena_bin_info[binind]; + pageind += bin_info->run_size >> PAGE_SHIFT; } } } @@ -845,9 +868,10 @@ arena_purge(arena_t *arena, bool all) } assert(ndirty == arena->ndirty); #endif - assert(arena->ndirty > arena->npurgatory); - assert(arena->ndirty > chunk_npages || all); - assert((arena->nactive >> opt_lg_dirty_mult) < arena->ndirty || all); + assert(arena->ndirty > arena->npurgatory || all); + assert(arena->ndirty - arena->npurgatory > chunk_npages || all); + assert((arena->nactive >> opt_lg_dirty_mult) < (arena->ndirty - + arena->npurgatory) || all); #ifdef JEMALLOC_STATS arena->stats.npurge++; @@ -859,8 +883,10 @@ arena_purge(arena_t *arena, bool all) * multiple threads from racing to reduce ndirty below the threshold. */ npurgatory = arena->ndirty - arena->npurgatory; - if (all == false) + if (all == false) { + assert(npurgatory >= arena->nactive >> opt_lg_dirty_mult); npurgatory -= arena->nactive >> opt_lg_dirty_mult; + } arena->npurgatory += npurgatory; while (npurgatory > 0) { @@ -931,6 +957,9 @@ arena_run_dalloc(arena_t *arena, arena_run_t *run, bool dirty) arena_chunk_t *chunk; size_t size, run_ind, run_pages, flag_dirty; arena_avail_tree_t *runs_avail; +#ifdef JEMALLOC_STATS + size_t cactive_diff; +#endif chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(run); run_ind = (size_t)(((uintptr_t)run - (uintptr_t)chunk) @@ -946,9 +975,19 @@ arena_run_dalloc(arena_t *arena, arena_run_t *run, bool dirty) CHUNK_MAP_LARGE) != 0); assert((chunk->map[run_ind+(size>>PAGE_SHIFT)-1-map_bias].bits & CHUNK_MAP_ALLOCATED) != 0); - } else - size = run->bin->run_size; + } else { + size_t binind = arena_bin_index(arena, run->bin); + arena_bin_info_t *bin_info = &arena_bin_info[binind]; + size = bin_info->run_size; + } run_pages = (size >> PAGE_SHIFT); +#ifdef JEMALLOC_STATS + /* Update stats_cactive if nactive is crossing a chunk multiple. */ + cactive_diff = CHUNK_CEILING(arena->nactive << PAGE_SHIFT) - + CHUNK_CEILING((arena->nactive - run_pages) << PAGE_SHIFT); + if (cactive_diff != 0) + stats_cactive_sub(cactive_diff); +#endif arena->nactive -= run_pages; /* @@ -1174,6 +1213,8 @@ arena_bin_nonfull_run_get(arena_t *arena, arena_bin_t *bin) { arena_chunk_map_t *mapelm; arena_run_t *run; + size_t binind; + arena_bin_info_t *bin_info; /* Look for a usable run. */ mapelm = arena_run_tree_first(&bin->runs); @@ -1197,18 +1238,23 @@ arena_bin_nonfull_run_get(arena_t *arena, arena_bin_t *bin) } /* No existing runs have any space available. */ + binind = arena_bin_index(arena, bin); + bin_info = &arena_bin_info[binind]; + /* Allocate a new run. */ malloc_mutex_unlock(&bin->lock); /******************************/ malloc_mutex_lock(&arena->lock); - run = arena_run_alloc(arena, bin->run_size, false, false); + run = arena_run_alloc(arena, bin_info->run_size, false, false); if (run != NULL) { + bitmap_t *bitmap = (bitmap_t *)((uintptr_t)run + + (uintptr_t)bin_info->bitmap_offset); + /* Initialize run internals. */ run->bin = bin; - run->avail = NULL; - run->next = (void *)((uintptr_t)run + - (uintptr_t)bin->reg0_offset); - run->nfree = bin->nregs; + run->nextind = 0; + run->nfree = bin_info->nregs; + bitmap_init(bitmap, &bin_info->bitmap_info); #ifdef JEMALLOC_DEBUG run->magic = ARENA_RUN_MAGIC; #endif @@ -1259,8 +1305,12 @@ static void * arena_bin_malloc_hard(arena_t *arena, arena_bin_t *bin) { void *ret; + size_t binind; + arena_bin_info_t *bin_info; arena_run_t *run; + binind = arena_bin_index(arena, bin); + bin_info = &arena_bin_info[binind]; bin->runcur = NULL; run = arena_bin_nonfull_run_get(arena, bin); if (bin->runcur != NULL && bin->runcur->nfree > 0) { @@ -1268,22 +1318,22 @@ arena_bin_malloc_hard(arena_t *arena, arena_bin_t *bin) * Another thread updated runcur while this one ran without the * bin lock in arena_bin_nonfull_run_get(). */ - assert(bin->runcur->magic == ARENA_RUN_MAGIC); + dassert(bin->runcur->magic == ARENA_RUN_MAGIC); assert(bin->runcur->nfree > 0); - ret = arena_run_reg_alloc(bin->runcur, bin); + ret = arena_run_reg_alloc(bin->runcur, bin_info); if (run != NULL) { arena_chunk_t *chunk; /* * arena_run_alloc() may have allocated run, or it may - * have pulled it from the bin's run tree. Therefore + * have pulled run from the bin's run tree. Therefore * it is unsafe to make any assumptions about how run * has previously been used, and arena_bin_lower_run() * must be called, as if a region were just deallocated * from the run. */ chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(run); - if (run->nfree == bin->nregs) + if (run->nfree == bin_info->nregs) arena_dalloc_bin_run(arena, chunk, run, bin); else arena_bin_lower_run(arena, chunk, run, bin); @@ -1296,10 +1346,10 @@ arena_bin_malloc_hard(arena_t *arena, arena_bin_t *bin) bin->runcur = run; - assert(bin->runcur->magic == ARENA_RUN_MAGIC); + dassert(bin->runcur->magic == ARENA_RUN_MAGIC); assert(bin->runcur->nfree > 0); - return (arena_run_reg_alloc(bin->runcur, bin)); + return (arena_run_reg_alloc(bin->runcur, bin_info)); } #ifdef JEMALLOC_PROF @@ -1339,18 +1389,19 @@ arena_tcache_fill_small(arena_t *arena, tcache_bin_t *tbin, size_t binind #endif bin = &arena->bins[binind]; malloc_mutex_lock(&bin->lock); - for (i = 0, nfill = (tbin->ncached_max >> 1); i < nfill; i++) { + for (i = 0, nfill = (tcache_bin_info[binind].ncached_max >> + tbin->lg_fill_div); i < nfill; i++) { if ((run = bin->runcur) != NULL && run->nfree > 0) - ptr = arena_run_reg_alloc(run, bin); + ptr = arena_run_reg_alloc(run, &arena_bin_info[binind]); else ptr = arena_bin_malloc_hard(arena, bin); if (ptr == NULL) break; - *(void **)ptr = tbin->avail; - tbin->avail = ptr; + /* Insert such that low regions get used first. */ + tbin->avail[nfill - 1 - i] = ptr; } #ifdef JEMALLOC_STATS - bin->stats.allocated += (i - tbin->ncached) * bin->reg_size; + bin->stats.allocated += i * arena_bin_info[binind].reg_size; bin->stats.nmalloc += i; bin->stats.nrequests += tbin->tstats.nrequests; bin->stats.nfills++; @@ -1358,119 +1409,9 @@ arena_tcache_fill_small(arena_t *arena, tcache_bin_t *tbin, size_t binind #endif malloc_mutex_unlock(&bin->lock); tbin->ncached = i; - if (tbin->ncached > tbin->high_water) - tbin->high_water = tbin->ncached; } #endif -/* - * Calculate bin->run_size such that it meets the following constraints: - * - * *) bin->run_size >= min_run_size - * *) bin->run_size <= arena_maxclass - * *) run header overhead <= RUN_MAX_OVRHD (or header overhead relaxed). - * *) run header size < PAGE_SIZE - * - * bin->nregs and bin->reg0_offset are also calculated here, since these - * settings are all interdependent. - */ -static size_t -arena_bin_run_size_calc(arena_bin_t *bin, size_t min_run_size) -{ - size_t try_run_size, good_run_size; - uint32_t try_nregs, good_nregs; - uint32_t try_hdr_size, good_hdr_size; -#ifdef JEMALLOC_PROF - uint32_t try_ctx0_offset, good_ctx0_offset; -#endif - uint32_t try_reg0_offset, good_reg0_offset; - - assert(min_run_size >= PAGE_SIZE); - assert(min_run_size <= arena_maxclass); - - /* - * Calculate known-valid settings before entering the run_size - * expansion loop, so that the first part of the loop always copies - * valid settings. - * - * The do..while loop iteratively reduces the number of regions until - * the run header and the regions no longer overlap. A closed formula - * would be quite messy, since there is an interdependency between the - * header's mask length and the number of regions. - */ - try_run_size = min_run_size; - try_nregs = ((try_run_size - sizeof(arena_run_t)) / bin->reg_size) - + 1; /* Counter-act try_nregs-- in loop. */ - do { - try_nregs--; - try_hdr_size = sizeof(arena_run_t); -#ifdef JEMALLOC_PROF - if (opt_prof && prof_promote == false) { - /* Pad to a quantum boundary. */ - try_hdr_size = QUANTUM_CEILING(try_hdr_size); - try_ctx0_offset = try_hdr_size; - /* Add space for one (prof_ctx_t *) per region. */ - try_hdr_size += try_nregs * sizeof(prof_ctx_t *); - } else - try_ctx0_offset = 0; -#endif - try_reg0_offset = try_run_size - (try_nregs * bin->reg_size); - } while (try_hdr_size > try_reg0_offset); - - /* run_size expansion loop. */ - do { - /* - * Copy valid settings before trying more aggressive settings. - */ - good_run_size = try_run_size; - good_nregs = try_nregs; - good_hdr_size = try_hdr_size; -#ifdef JEMALLOC_PROF - good_ctx0_offset = try_ctx0_offset; -#endif - good_reg0_offset = try_reg0_offset; - - /* Try more aggressive settings. */ - try_run_size += PAGE_SIZE; - try_nregs = ((try_run_size - sizeof(arena_run_t)) / - bin->reg_size) + 1; /* Counter-act try_nregs-- in loop. */ - do { - try_nregs--; - try_hdr_size = sizeof(arena_run_t); -#ifdef JEMALLOC_PROF - if (opt_prof && prof_promote == false) { - /* Pad to a quantum boundary. */ - try_hdr_size = QUANTUM_CEILING(try_hdr_size); - try_ctx0_offset = try_hdr_size; - /* - * Add space for one (prof_ctx_t *) per region. - */ - try_hdr_size += try_nregs * - sizeof(prof_ctx_t *); - } -#endif - try_reg0_offset = try_run_size - (try_nregs * - bin->reg_size); - } while (try_hdr_size > try_reg0_offset); - } while (try_run_size <= arena_maxclass - && try_run_size <= arena_maxclass - && RUN_MAX_OVRHD * (bin->reg_size << 3) > RUN_MAX_OVRHD_RELAX - && (try_reg0_offset << RUN_BFP) > RUN_MAX_OVRHD * try_run_size - && try_hdr_size < PAGE_SIZE); - - assert(good_hdr_size <= good_reg0_offset); - - /* Copy final settings. */ - bin->run_size = good_run_size; - bin->nregs = good_nregs; -#ifdef JEMALLOC_PROF - bin->ctx0_offset = good_ctx0_offset; -#endif - bin->reg0_offset = good_reg0_offset; - - return (good_run_size); -} - void * arena_malloc_small(arena_t *arena, size_t size, bool zero) { @@ -1479,14 +1420,14 @@ arena_malloc_small(arena_t *arena, size_t size, bool zero) arena_run_t *run; size_t binind; - binind = small_size2bin[size]; + binind = SMALL_SIZE2BIN(size); assert(binind < nbins); bin = &arena->bins[binind]; - size = bin->reg_size; + size = arena_bin_info[binind].reg_size; malloc_mutex_lock(&bin->lock); if ((run = bin->runcur) != NULL && run->nfree > 0) - ret = arena_run_reg_alloc(run, bin); + ret = arena_run_reg_alloc(run, &arena_bin_info[binind]); else ret = arena_bin_malloc_hard(arena, bin); @@ -1690,11 +1631,13 @@ arena_salloc(const void *ptr) arena_run_t *run = (arena_run_t *)((uintptr_t)chunk + (uintptr_t)((pageind - (mapbits >> PAGE_SHIFT)) << PAGE_SHIFT)); - assert(run->magic == ARENA_RUN_MAGIC); + dassert(run->magic == ARENA_RUN_MAGIC); + size_t binind = arena_bin_index(chunk->arena, run->bin); + arena_bin_info_t *bin_info = &arena_bin_info[binind]; assert(((uintptr_t)ptr - ((uintptr_t)run + - (uintptr_t)run->bin->reg0_offset)) % run->bin->reg_size == + (uintptr_t)bin_info->reg0_offset)) % bin_info->reg_size == 0); - ret = run->bin->reg_size; + ret = bin_info->reg_size; } else { assert(((uintptr_t)ptr & PAGE_MASK) == 0); ret = mapbits & ~PAGE_MASK; @@ -1714,10 +1657,11 @@ arena_prof_promoted(const void *ptr, size_t size) assert(ptr != NULL); assert(CHUNK_ADDR2BASE(ptr) != ptr); assert(isalloc(ptr) == PAGE_SIZE); + assert(size <= small_maxclass); chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); pageind = ((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT; - binind = small_size2bin[size]; + binind = SMALL_SIZE2BIN(size); assert(binind < nbins); chunk->map[pageind-map_bias].bits = (chunk->map[pageind-map_bias].bits & ~CHUNK_MAP_CLASS_MASK) | ((binind+1) << CHUNK_MAP_CLASS_SHIFT); @@ -1741,11 +1685,13 @@ arena_salloc_demote(const void *ptr) arena_run_t *run = (arena_run_t *)((uintptr_t)chunk + (uintptr_t)((pageind - (mapbits >> PAGE_SHIFT)) << PAGE_SHIFT)); - assert(run->magic == ARENA_RUN_MAGIC); + dassert(run->magic == ARENA_RUN_MAGIC); + size_t binind = arena_bin_index(chunk->arena, run->bin); + arena_bin_info_t *bin_info = &arena_bin_info[binind]; assert(((uintptr_t)ptr - ((uintptr_t)run + - (uintptr_t)run->bin->reg0_offset)) % run->bin->reg_size == + (uintptr_t)bin_info->reg0_offset)) % bin_info->reg_size == 0); - ret = run->bin->reg_size; + ret = bin_info->reg_size; } else { assert(((uintptr_t)ptr & PAGE_MASK) == 0); ret = mapbits & ~PAGE_MASK; @@ -1754,7 +1700,7 @@ arena_salloc_demote(const void *ptr) size_t binind = ((mapbits & CHUNK_MAP_CLASS_MASK) >> CHUNK_MAP_CLASS_SHIFT) - 1; assert(binind < nbins); - ret = chunk->arena->bins[binind].reg_size; + ret = arena_bin_info[binind].reg_size; } assert(ret != 0); } @@ -1771,17 +1717,22 @@ arena_dissociate_bin_run(arena_chunk_t *chunk, arena_run_t *run, /* Dissociate run from bin. */ if (run == bin->runcur) bin->runcur = NULL; - else if (bin->nregs != 1) { - size_t run_pageind = (((uintptr_t)run - (uintptr_t)chunk)) >> - PAGE_SHIFT; - arena_chunk_map_t *run_mapelm = - &chunk->map[run_pageind-map_bias]; - /* - * This block's conditional is necessary because if the run - * only contains one region, then it never gets inserted into - * the non-full runs tree. - */ - arena_run_tree_remove(&bin->runs, run_mapelm); + else { + size_t binind = arena_bin_index(chunk->arena, bin); + arena_bin_info_t *bin_info = &arena_bin_info[binind]; + + if (bin_info->nregs != 1) { + size_t run_pageind = (((uintptr_t)run - + (uintptr_t)chunk)) >> PAGE_SHIFT; + arena_chunk_map_t *run_mapelm = + &chunk->map[run_pageind-map_bias]; + /* + * This block's conditional is necessary because if the + * run only contains one region, then it never gets + * inserted into the non-full runs tree. + */ + arena_run_tree_remove(&bin->runs, run_mapelm); + } } } @@ -1789,18 +1740,24 @@ static void arena_dalloc_bin_run(arena_t *arena, arena_chunk_t *chunk, arena_run_t *run, arena_bin_t *bin) { + size_t binind; + arena_bin_info_t *bin_info; size_t npages, run_ind, past; assert(run != bin->runcur); assert(arena_run_tree_search(&bin->runs, &chunk->map[ (((uintptr_t)run-(uintptr_t)chunk)>>PAGE_SHIFT)-map_bias]) == NULL); + binind = arena_bin_index(chunk->arena, run->bin); + bin_info = &arena_bin_info[binind]; + malloc_mutex_unlock(&bin->lock); /******************************/ - npages = bin->run_size >> PAGE_SHIFT; + npages = bin_info->run_size >> PAGE_SHIFT; run_ind = (size_t)(((uintptr_t)run - (uintptr_t)chunk) >> PAGE_SHIFT); - past = (size_t)((PAGE_CEILING((uintptr_t)run->next) - (uintptr_t)chunk) - >> PAGE_SHIFT); + past = (size_t)(PAGE_CEILING((uintptr_t)run + + (uintptr_t)bin_info->reg0_offset + (uintptr_t)(run->nextind * + bin_info->reg_size) - (uintptr_t)chunk) >> PAGE_SHIFT); malloc_mutex_lock(&arena->lock); /* @@ -1817,7 +1774,7 @@ arena_dalloc_bin_run(arena_t *arena, arena_chunk_t *chunk, arena_run_t *run, chunk->map[run_ind+npages-1-map_bias].bits = CHUNK_MAP_LARGE | (chunk->map[run_ind+npages-1-map_bias].bits & CHUNK_MAP_FLAGS_MASK); - chunk->map[run_ind-map_bias].bits = bin->run_size | + chunk->map[run_ind-map_bias].bits = bin_info->run_size | CHUNK_MAP_LARGE | (chunk->map[run_ind-map_bias].bits & CHUNK_MAP_FLAGS_MASK); arena_run_trim_tail(arena, chunk, run, (npages << PAGE_SHIFT), @@ -1886,10 +1843,12 @@ arena_dalloc_bin(arena_t *arena, arena_chunk_t *chunk, void *ptr, pageind = ((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT; run = (arena_run_t *)((uintptr_t)chunk + (uintptr_t)((pageind - (mapelm->bits >> PAGE_SHIFT)) << PAGE_SHIFT)); - assert(run->magic == ARENA_RUN_MAGIC); + dassert(run->magic == ARENA_RUN_MAGIC); bin = run->bin; + size_t binind = arena_bin_index(arena, bin); + arena_bin_info_t *bin_info = &arena_bin_info[binind]; #if (defined(JEMALLOC_FILL) || defined(JEMALLOC_STATS)) - size = bin->reg_size; + size = bin_info->reg_size; #endif #ifdef JEMALLOC_FILL @@ -1898,7 +1857,7 @@ arena_dalloc_bin(arena_t *arena, arena_chunk_t *chunk, void *ptr, #endif arena_run_reg_dalloc(run, ptr); - if (run->nfree == bin->nregs) { + if (run->nfree == bin_info->nregs) { arena_dissociate_bin_run(chunk, run, bin); arena_dalloc_bin_run(arena, chunk, run, bin); } else if (run->nfree == 1 && run != bin->runcur) @@ -2132,7 +2091,7 @@ arena_ralloc_large(void *ptr, size_t oldsize, size_t size, size_t extra, chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); arena = chunk->arena; - assert(arena->magic == ARENA_MAGIC); + dassert(arena->magic == ARENA_MAGIC); if (psize < oldsize) { #ifdef JEMALLOC_FILL @@ -2170,11 +2129,11 @@ arena_ralloc_no_move(void *ptr, size_t oldsize, size_t size, size_t extra, */ if (oldsize <= arena_maxclass) { if (oldsize <= small_maxclass) { - assert(choose_arena()->bins[small_size2bin[ - oldsize]].reg_size == oldsize); + assert(arena_bin_info[SMALL_SIZE2BIN(oldsize)].reg_size + == oldsize); if ((size + extra <= small_maxclass && - small_size2bin[size + extra] == - small_size2bin[oldsize]) || (size <= oldsize && + SMALL_SIZE2BIN(size + extra) == + SMALL_SIZE2BIN(oldsize)) || (size <= oldsize && size + extra >= oldsize)) { #ifdef JEMALLOC_FILL if (opt_junk && size < oldsize) { @@ -2210,24 +2169,29 @@ arena_ralloc(void *ptr, size_t oldsize, size_t size, size_t extra, if (ret != NULL) return (ret); - /* * size and oldsize are different enough that we need to move the * object. In that case, fall back to allocating new space and * copying. */ - if (alignment != 0) - ret = ipalloc(size + extra, alignment, zero); - else + if (alignment != 0) { + size_t usize = sa2u(size + extra, alignment, NULL); + if (usize == 0) + return (NULL); + ret = ipalloc(usize, alignment, zero); + } else ret = arena_malloc(size + extra, zero); if (ret == NULL) { if (extra == 0) return (NULL); /* Try again, this time without extra. */ - if (alignment != 0) - ret = ipalloc(size, alignment, zero); - else + if (alignment != 0) { + size_t usize = sa2u(size, alignment, NULL); + if (usize == 0) + return (NULL); + ret = ipalloc(usize, alignment, zero); + } else ret = arena_malloc(size, zero); if (ret == NULL) @@ -2251,9 +2215,9 @@ arena_new(arena_t *arena, unsigned ind) { unsigned i; arena_bin_t *bin; - size_t prev_run_size; arena->ind = ind; + arena->nthreads = 0; if (malloc_mutex_init(&arena->lock)) return (true); @@ -2287,8 +2251,6 @@ arena_new(arena_t *arena, unsigned ind) arena_avail_tree_new(&arena->runs_avail_dirty); /* Initialize bins. */ - prev_run_size = PAGE_SIZE; - i = 0; #ifdef JEMALLOC_TINY /* (2^n)-spaced tiny bins. */ @@ -2298,11 +2260,6 @@ arena_new(arena_t *arena, unsigned ind) return (true); bin->runcur = NULL; arena_run_tree_new(&bin->runs); - - bin->reg_size = (1U << (LG_TINY_MIN + i)); - - prev_run_size = arena_bin_run_size_calc(bin, prev_run_size); - #ifdef JEMALLOC_STATS memset(&bin->stats, 0, sizeof(malloc_bin_stats_t)); #endif @@ -2316,11 +2273,6 @@ arena_new(arena_t *arena, unsigned ind) return (true); bin->runcur = NULL; arena_run_tree_new(&bin->runs); - - bin->reg_size = (i - ntbins + 1) << LG_QUANTUM; - - prev_run_size = arena_bin_run_size_calc(bin, prev_run_size); - #ifdef JEMALLOC_STATS memset(&bin->stats, 0, sizeof(malloc_bin_stats_t)); #endif @@ -2333,12 +2285,6 @@ arena_new(arena_t *arena, unsigned ind) return (true); bin->runcur = NULL; arena_run_tree_new(&bin->runs); - - bin->reg_size = cspace_min + ((i - (ntbins + nqbins)) << - LG_CACHELINE); - - prev_run_size = arena_bin_run_size_calc(bin, prev_run_size); - #ifdef JEMALLOC_STATS memset(&bin->stats, 0, sizeof(malloc_bin_stats_t)); #endif @@ -2351,12 +2297,6 @@ arena_new(arena_t *arena, unsigned ind) return (true); bin->runcur = NULL; arena_run_tree_new(&bin->runs); - - bin->reg_size = sspace_min + ((i - (ntbins + nqbins + ncbins)) - << LG_SUBPAGE); - - prev_run_size = arena_bin_run_size_calc(bin, prev_run_size); - #ifdef JEMALLOC_STATS memset(&bin->stats, 0, sizeof(malloc_bin_stats_t)); #endif @@ -2375,40 +2315,39 @@ small_size2bin_validate(void) { size_t i, size, binind; - assert(small_size2bin[0] == 0xffU); i = 1; # ifdef JEMALLOC_TINY /* Tiny. */ for (; i < (1U << LG_TINY_MIN); i++) { size = pow2_ceil(1U << LG_TINY_MIN); binind = ffs((int)(size >> (LG_TINY_MIN + 1))); - assert(small_size2bin[i] == binind); + assert(SMALL_SIZE2BIN(i) == binind); } for (; i < qspace_min; i++) { size = pow2_ceil(i); binind = ffs((int)(size >> (LG_TINY_MIN + 1))); - assert(small_size2bin[i] == binind); + assert(SMALL_SIZE2BIN(i) == binind); } # endif /* Quantum-spaced. */ for (; i <= qspace_max; i++) { size = QUANTUM_CEILING(i); binind = ntbins + (size >> LG_QUANTUM) - 1; - assert(small_size2bin[i] == binind); + assert(SMALL_SIZE2BIN(i) == binind); } /* Cacheline-spaced. */ for (; i <= cspace_max; i++) { size = CACHELINE_CEILING(i); binind = ntbins + nqbins + ((size - cspace_min) >> LG_CACHELINE); - assert(small_size2bin[i] == binind); + assert(SMALL_SIZE2BIN(i) == binind); } /* Sub-page. */ for (; i <= sspace_max; i++) { size = SUBPAGE_CEILING(i); binind = ntbins + nqbins + ncbins + ((size - sspace_min) >> LG_SUBPAGE); - assert(small_size2bin[i] == binind); + assert(SMALL_SIZE2BIN(i) == binind); } } #endif @@ -2419,12 +2358,12 @@ small_size2bin_init(void) if (opt_lg_qspace_max != LG_QSPACE_MAX_DEFAULT || opt_lg_cspace_max != LG_CSPACE_MAX_DEFAULT - || sizeof(const_small_size2bin) != small_maxclass + 1) + || (sizeof(const_small_size2bin) != ((small_maxclass-1) >> + LG_TINY_MIN) + 1)) return (small_size2bin_init_hard()); small_size2bin = const_small_size2bin; #ifdef JEMALLOC_DEBUG - assert(sizeof(const_small_size2bin) == small_maxclass + 1); small_size2bin_validate(); #endif return (false); @@ -2435,55 +2374,242 @@ small_size2bin_init_hard(void) { size_t i, size, binind; uint8_t *custom_small_size2bin; +#define CUSTOM_SMALL_SIZE2BIN(s) \ + custom_small_size2bin[(s-1) >> LG_TINY_MIN] assert(opt_lg_qspace_max != LG_QSPACE_MAX_DEFAULT || opt_lg_cspace_max != LG_CSPACE_MAX_DEFAULT - || sizeof(const_small_size2bin) != small_maxclass + 1); + || (sizeof(const_small_size2bin) != ((small_maxclass-1) >> + LG_TINY_MIN) + 1)); - custom_small_size2bin = (uint8_t *)base_alloc(small_maxclass + 1); + custom_small_size2bin = (uint8_t *) + base_alloc(small_maxclass >> LG_TINY_MIN); if (custom_small_size2bin == NULL) return (true); - custom_small_size2bin[0] = 0xffU; i = 1; #ifdef JEMALLOC_TINY /* Tiny. */ - for (; i < (1U << LG_TINY_MIN); i++) { + for (; i < (1U << LG_TINY_MIN); i += TINY_MIN) { size = pow2_ceil(1U << LG_TINY_MIN); binind = ffs((int)(size >> (LG_TINY_MIN + 1))); - custom_small_size2bin[i] = binind; + CUSTOM_SMALL_SIZE2BIN(i) = binind; } - for (; i < qspace_min; i++) { + for (; i < qspace_min; i += TINY_MIN) { size = pow2_ceil(i); binind = ffs((int)(size >> (LG_TINY_MIN + 1))); - custom_small_size2bin[i] = binind; + CUSTOM_SMALL_SIZE2BIN(i) = binind; } #endif /* Quantum-spaced. */ - for (; i <= qspace_max; i++) { + for (; i <= qspace_max; i += TINY_MIN) { size = QUANTUM_CEILING(i); binind = ntbins + (size >> LG_QUANTUM) - 1; - custom_small_size2bin[i] = binind; + CUSTOM_SMALL_SIZE2BIN(i) = binind; } /* Cacheline-spaced. */ - for (; i <= cspace_max; i++) { + for (; i <= cspace_max; i += TINY_MIN) { size = CACHELINE_CEILING(i); binind = ntbins + nqbins + ((size - cspace_min) >> LG_CACHELINE); - custom_small_size2bin[i] = binind; + CUSTOM_SMALL_SIZE2BIN(i) = binind; } /* Sub-page. */ - for (; i <= sspace_max; i++) { + for (; i <= sspace_max; i += TINY_MIN) { size = SUBPAGE_CEILING(i); binind = ntbins + nqbins + ncbins + ((size - sspace_min) >> LG_SUBPAGE); - custom_small_size2bin[i] = binind; + CUSTOM_SMALL_SIZE2BIN(i) = binind; } small_size2bin = custom_small_size2bin; #ifdef JEMALLOC_DEBUG small_size2bin_validate(); #endif + return (false); +#undef CUSTOM_SMALL_SIZE2BIN +} + +/* + * Calculate bin_info->run_size such that it meets the following constraints: + * + * *) bin_info->run_size >= min_run_size + * *) bin_info->run_size <= arena_maxclass + * *) run header overhead <= RUN_MAX_OVRHD (or header overhead relaxed). + * *) bin_info->nregs <= RUN_MAXREGS + * + * bin_info->nregs, bin_info->bitmap_offset, and bin_info->reg0_offset are also + * calculated here, since these settings are all interdependent. + */ +static size_t +bin_info_run_size_calc(arena_bin_info_t *bin_info, size_t min_run_size) +{ + size_t try_run_size, good_run_size; + uint32_t try_nregs, good_nregs; + uint32_t try_hdr_size, good_hdr_size; + uint32_t try_bitmap_offset, good_bitmap_offset; +#ifdef JEMALLOC_PROF + uint32_t try_ctx0_offset, good_ctx0_offset; +#endif + uint32_t try_reg0_offset, good_reg0_offset; + + assert(min_run_size >= PAGE_SIZE); + assert(min_run_size <= arena_maxclass); + + /* + * Calculate known-valid settings before entering the run_size + * expansion loop, so that the first part of the loop always copies + * valid settings. + * + * The do..while loop iteratively reduces the number of regions until + * the run header and the regions no longer overlap. A closed formula + * would be quite messy, since there is an interdependency between the + * header's mask length and the number of regions. + */ + try_run_size = min_run_size; + try_nregs = ((try_run_size - sizeof(arena_run_t)) / bin_info->reg_size) + + 1; /* Counter-act try_nregs-- in loop. */ + if (try_nregs > RUN_MAXREGS) { + try_nregs = RUN_MAXREGS + + 1; /* Counter-act try_nregs-- in loop. */ + } + do { + try_nregs--; + try_hdr_size = sizeof(arena_run_t); + /* Pad to a long boundary. */ + try_hdr_size = LONG_CEILING(try_hdr_size); + try_bitmap_offset = try_hdr_size; + /* Add space for bitmap. */ + try_hdr_size += bitmap_size(try_nregs); +#ifdef JEMALLOC_PROF + if (opt_prof && prof_promote == false) { + /* Pad to a quantum boundary. */ + try_hdr_size = QUANTUM_CEILING(try_hdr_size); + try_ctx0_offset = try_hdr_size; + /* Add space for one (prof_ctx_t *) per region. */ + try_hdr_size += try_nregs * sizeof(prof_ctx_t *); + } else + try_ctx0_offset = 0; +#endif + try_reg0_offset = try_run_size - (try_nregs * + bin_info->reg_size); + } while (try_hdr_size > try_reg0_offset); + + /* run_size expansion loop. */ + do { + /* + * Copy valid settings before trying more aggressive settings. + */ + good_run_size = try_run_size; + good_nregs = try_nregs; + good_hdr_size = try_hdr_size; + good_bitmap_offset = try_bitmap_offset; +#ifdef JEMALLOC_PROF + good_ctx0_offset = try_ctx0_offset; +#endif + good_reg0_offset = try_reg0_offset; + + /* Try more aggressive settings. */ + try_run_size += PAGE_SIZE; + try_nregs = ((try_run_size - sizeof(arena_run_t)) / + bin_info->reg_size) + + 1; /* Counter-act try_nregs-- in loop. */ + if (try_nregs > RUN_MAXREGS) { + try_nregs = RUN_MAXREGS + + 1; /* Counter-act try_nregs-- in loop. */ + } + do { + try_nregs--; + try_hdr_size = sizeof(arena_run_t); + /* Pad to a long boundary. */ + try_hdr_size = LONG_CEILING(try_hdr_size); + try_bitmap_offset = try_hdr_size; + /* Add space for bitmap. */ + try_hdr_size += bitmap_size(try_nregs); +#ifdef JEMALLOC_PROF + if (opt_prof && prof_promote == false) { + /* Pad to a quantum boundary. */ + try_hdr_size = QUANTUM_CEILING(try_hdr_size); + try_ctx0_offset = try_hdr_size; + /* + * Add space for one (prof_ctx_t *) per region. + */ + try_hdr_size += try_nregs * + sizeof(prof_ctx_t *); + } +#endif + try_reg0_offset = try_run_size - (try_nregs * + bin_info->reg_size); + } while (try_hdr_size > try_reg0_offset); + } while (try_run_size <= arena_maxclass + && try_run_size <= arena_maxclass + && RUN_MAX_OVRHD * (bin_info->reg_size << 3) > RUN_MAX_OVRHD_RELAX + && (try_reg0_offset << RUN_BFP) > RUN_MAX_OVRHD * try_run_size + && try_nregs < RUN_MAXREGS); + + assert(good_hdr_size <= good_reg0_offset); + + /* Copy final settings. */ + bin_info->run_size = good_run_size; + bin_info->nregs = good_nregs; + bin_info->bitmap_offset = good_bitmap_offset; +#ifdef JEMALLOC_PROF + bin_info->ctx0_offset = good_ctx0_offset; +#endif + bin_info->reg0_offset = good_reg0_offset; + + return (good_run_size); +} + +static bool +bin_info_init(void) +{ + arena_bin_info_t *bin_info; + unsigned i; + size_t prev_run_size; + + arena_bin_info = base_alloc(sizeof(arena_bin_info_t) * nbins); + if (arena_bin_info == NULL) + return (true); + + prev_run_size = PAGE_SIZE; + i = 0; +#ifdef JEMALLOC_TINY + /* (2^n)-spaced tiny bins. */ + for (; i < ntbins; i++) { + bin_info = &arena_bin_info[i]; + bin_info->reg_size = (1U << (LG_TINY_MIN + i)); + prev_run_size = bin_info_run_size_calc(bin_info, prev_run_size); + bitmap_info_init(&bin_info->bitmap_info, bin_info->nregs); + } +#endif + + /* Quantum-spaced bins. */ + for (; i < ntbins + nqbins; i++) { + bin_info = &arena_bin_info[i]; + bin_info->reg_size = (i - ntbins + 1) << LG_QUANTUM; + prev_run_size = bin_info_run_size_calc(bin_info, prev_run_size); + bitmap_info_init(&bin_info->bitmap_info, bin_info->nregs); + } + + /* Cacheline-spaced bins. */ + for (; i < ntbins + nqbins + ncbins; i++) { + bin_info = &arena_bin_info[i]; + bin_info->reg_size = cspace_min + ((i - (ntbins + nqbins)) << + LG_CACHELINE); + prev_run_size = bin_info_run_size_calc(bin_info, prev_run_size); + bitmap_info_init(&bin_info->bitmap_info, bin_info->nregs); + } + + /* Subpage-spaced bins. */ + for (; i < nbins; i++) { + bin_info = &arena_bin_info[i]; + bin_info->reg_size = sspace_min + ((i - (ntbins + nqbins + + ncbins)) << LG_SUBPAGE); + prev_run_size = bin_info_run_size_calc(bin_info, prev_run_size); + bitmap_info_init(&bin_info->bitmap_info, bin_info->nregs); + } + return (false); } @@ -2545,9 +2671,6 @@ arena_boot(void) abort(); } - if (small_size2bin_init()) - return (true); - /* * Compute the header size such that it is large enough to contain the * page map. The page map is biased to omit entries for the header @@ -2571,5 +2694,11 @@ arena_boot(void) arena_maxclass = chunksize - (map_bias << PAGE_SHIFT); + if (small_size2bin_init()) + return (true); + + if (bin_info_init()) + return (true); + return (false); } diff --git a/dep/jemalloc/src/atomic.c b/dep/jemalloc/src/atomic.c new file mode 100644 index 00000000000..77ee313113b --- /dev/null +++ b/dep/jemalloc/src/atomic.c @@ -0,0 +1,2 @@ +#define JEMALLOC_ATOMIC_C_ +#include "jemalloc/internal/jemalloc_internal.h" diff --git a/dep/jemalloc/src/bitmap.c b/dep/jemalloc/src/bitmap.c new file mode 100644 index 00000000000..b47e2629093 --- /dev/null +++ b/dep/jemalloc/src/bitmap.c @@ -0,0 +1,90 @@ +#define JEMALLOC_BITMAP_C_ +#include "jemalloc/internal/jemalloc_internal.h" + +/******************************************************************************/ +/* Function prototypes for non-inline static functions. */ + +static size_t bits2groups(size_t nbits); + +/******************************************************************************/ + +static size_t +bits2groups(size_t nbits) +{ + + return ((nbits >> LG_BITMAP_GROUP_NBITS) + + !!(nbits & BITMAP_GROUP_NBITS_MASK)); +} + +void +bitmap_info_init(bitmap_info_t *binfo, size_t nbits) +{ + unsigned i; + size_t group_count; + + assert(nbits > 0); + assert(nbits <= (ZU(1) << LG_BITMAP_MAXBITS)); + + /* + * Compute the number of groups necessary to store nbits bits, and + * progressively work upward through the levels until reaching a level + * that requires only one group. + */ + binfo->levels[0].group_offset = 0; + group_count = bits2groups(nbits); + for (i = 1; group_count > 1; i++) { + assert(i < BITMAP_MAX_LEVELS); + binfo->levels[i].group_offset = binfo->levels[i-1].group_offset + + group_count; + group_count = bits2groups(group_count); + } + binfo->levels[i].group_offset = binfo->levels[i-1].group_offset + + group_count; + binfo->nlevels = i; + binfo->nbits = nbits; +} + +size_t +bitmap_info_ngroups(const bitmap_info_t *binfo) +{ + + return (binfo->levels[binfo->nlevels].group_offset << LG_SIZEOF_BITMAP); +} + +size_t +bitmap_size(size_t nbits) +{ + bitmap_info_t binfo; + + bitmap_info_init(&binfo, nbits); + return (bitmap_info_ngroups(&binfo)); +} + +void +bitmap_init(bitmap_t *bitmap, const bitmap_info_t *binfo) +{ + size_t extra; + unsigned i; + + /* + * Bits are actually inverted with regard to the external bitmap + * interface, so the bitmap starts out with all 1 bits, except for + * trailing unused bits (if any). Note that each group uses bit 0 to + * correspond to the first logical bit in the group, so extra bits + * are the most significant bits of the last group. + */ + memset(bitmap, 0xffU, binfo->levels[binfo->nlevels].group_offset << + LG_SIZEOF_BITMAP); + extra = (BITMAP_GROUP_NBITS - (binfo->nbits & BITMAP_GROUP_NBITS_MASK)) + & BITMAP_GROUP_NBITS_MASK; + if (extra != 0) + bitmap[binfo->levels[1].group_offset - 1] >>= extra; + for (i = 1; i < binfo->nlevels; i++) { + size_t group_count = binfo->levels[i].group_offset - + binfo->levels[i-1].group_offset; + extra = (BITMAP_GROUP_NBITS - (group_count & + BITMAP_GROUP_NBITS_MASK)) & BITMAP_GROUP_NBITS_MASK; + if (extra != 0) + bitmap[binfo->levels[i+1].group_offset - 1] >>= extra; + } +} diff --git a/dep/jemalloc/src/chunk.c b/dep/jemalloc/src/chunk.c index 301519e8042..d190c6f49b3 100644 --- a/dep/jemalloc/src/chunk.c +++ b/dep/jemalloc/src/chunk.c @@ -70,7 +70,7 @@ RETURN: #ifdef JEMALLOC_IVSALLOC if (base == false && ret != NULL) { if (rtree_set(chunks_rtree, (uintptr_t)ret, ret)) { - chunk_dealloc(ret, size); + chunk_dealloc(ret, size, true); return (NULL); } } @@ -108,7 +108,7 @@ RETURN: } void -chunk_dealloc(void *chunk, size_t size) +chunk_dealloc(void *chunk, size_t size, bool unmap) { assert(chunk != NULL); @@ -125,15 +125,17 @@ chunk_dealloc(void *chunk, size_t size) malloc_mutex_unlock(&chunks_mtx); #endif + if (unmap) { #ifdef JEMALLOC_SWAP - if (swap_enabled && chunk_dealloc_swap(chunk, size) == false) - return; + if (swap_enabled && chunk_dealloc_swap(chunk, size) == false) + return; #endif #ifdef JEMALLOC_DSS - if (chunk_dealloc_dss(chunk, size) == false) - return; + if (chunk_dealloc_dss(chunk, size) == false) + return; #endif - chunk_dealloc_mmap(chunk, size); + chunk_dealloc_mmap(chunk, size); + } } bool diff --git a/dep/jemalloc/src/chunk_mmap.c b/dep/jemalloc/src/chunk_mmap.c index bc367559774..164e86e7b38 100644 --- a/dep/jemalloc/src/chunk_mmap.c +++ b/dep/jemalloc/src/chunk_mmap.c @@ -206,13 +206,15 @@ chunk_alloc_mmap_internal(size_t size, bool noreserve) void * chunk_alloc_mmap(size_t size) { - return chunk_alloc_mmap_internal(size, false); + + return (chunk_alloc_mmap_internal(size, false)); } void * chunk_alloc_mmap_noreserve(size_t size) { - return chunk_alloc_mmap_internal(size, true); + + return (chunk_alloc_mmap_internal(size, true)); } void diff --git a/dep/jemalloc/src/ckh.c b/dep/jemalloc/src/ckh.c index 682a8db65bf..43fcc25239d 100644 --- a/dep/jemalloc/src/ckh.c +++ b/dep/jemalloc/src/ckh.c @@ -34,7 +34,7 @@ * respectively. * ******************************************************************************/ -#define CKH_C_ +#define JEMALLOC_CKH_C_ #include "jemalloc/internal/jemalloc_internal.h" /******************************************************************************/ @@ -73,7 +73,7 @@ ckh_isearch(ckh_t *ckh, const void *key) size_t hash1, hash2, bucket, cell; assert(ckh != NULL); - assert(ckh->magic = CKH_MAGIG); + dassert(ckh->magic == CKH_MAGIC); ckh->hash(key, ckh->lg_curbuckets, &hash1, &hash2); @@ -262,9 +262,15 @@ ckh_grow(ckh_t *ckh) lg_prevbuckets = ckh->lg_curbuckets; lg_curcells = ckh->lg_curbuckets + LG_CKH_BUCKET_CELLS; while (true) { + size_t usize; + lg_curcells++; - tab = (ckhc_t *)ipalloc(sizeof(ckhc_t) << lg_curcells, - ZU(1) << LG_CACHELINE, true); + usize = sa2u(sizeof(ckhc_t) << lg_curcells, CACHELINE, NULL); + if (usize == 0) { + ret = true; + goto RETURN; + } + tab = (ckhc_t *)ipalloc(usize, CACHELINE, true); if (tab == NULL) { ret = true; goto RETURN; @@ -295,7 +301,7 @@ static void ckh_shrink(ckh_t *ckh) { ckhc_t *tab, *ttab; - size_t lg_curcells; + size_t lg_curcells, usize; unsigned lg_prevbuckets; /* @@ -304,8 +310,10 @@ ckh_shrink(ckh_t *ckh) */ lg_prevbuckets = ckh->lg_curbuckets; lg_curcells = ckh->lg_curbuckets + LG_CKH_BUCKET_CELLS - 1; - tab = (ckhc_t *)ipalloc(sizeof(ckhc_t) << lg_curcells, - ZU(1) << LG_CACHELINE, true); + usize = sa2u(sizeof(ckhc_t) << lg_curcells, CACHELINE, NULL); + if (usize == 0) + return; + tab = (ckhc_t *)ipalloc(usize, CACHELINE, true); if (tab == NULL) { /* * An OOM error isn't worth propagating, since it doesn't @@ -340,7 +348,7 @@ bool ckh_new(ckh_t *ckh, size_t minitems, ckh_hash_t *hash, ckh_keycomp_t *keycomp) { bool ret; - size_t mincells; + size_t mincells, usize; unsigned lg_mincells; assert(minitems > 0); @@ -375,15 +383,19 @@ ckh_new(ckh_t *ckh, size_t minitems, ckh_hash_t *hash, ckh_keycomp_t *keycomp) ckh->hash = hash; ckh->keycomp = keycomp; - ckh->tab = (ckhc_t *)ipalloc(sizeof(ckhc_t) << lg_mincells, - (ZU(1) << LG_CACHELINE), true); + usize = sa2u(sizeof(ckhc_t) << lg_mincells, CACHELINE, NULL); + if (usize == 0) { + ret = true; + goto RETURN; + } + ckh->tab = (ckhc_t *)ipalloc(usize, CACHELINE, true); if (ckh->tab == NULL) { ret = true; goto RETURN; } #ifdef JEMALLOC_DEBUG - ckh->magic = CKH_MAGIG; + ckh->magic = CKH_MAGIC; #endif ret = false; @@ -396,7 +408,7 @@ ckh_delete(ckh_t *ckh) { assert(ckh != NULL); - assert(ckh->magic = CKH_MAGIG); + dassert(ckh->magic == CKH_MAGIC); #ifdef CKH_VERBOSE malloc_printf( @@ -421,7 +433,7 @@ ckh_count(ckh_t *ckh) { assert(ckh != NULL); - assert(ckh->magic = CKH_MAGIG); + dassert(ckh->magic == CKH_MAGIC); return (ckh->count); } @@ -452,7 +464,7 @@ ckh_insert(ckh_t *ckh, const void *key, const void *data) bool ret; assert(ckh != NULL); - assert(ckh->magic = CKH_MAGIG); + dassert(ckh->magic == CKH_MAGIC); assert(ckh_search(ckh, key, NULL, NULL)); #ifdef CKH_COUNT @@ -477,7 +489,7 @@ ckh_remove(ckh_t *ckh, const void *searchkey, void **key, void **data) size_t cell; assert(ckh != NULL); - assert(ckh->magic = CKH_MAGIG); + dassert(ckh->magic == CKH_MAGIC); cell = ckh_isearch(ckh, searchkey); if (cell != SIZE_T_MAX) { @@ -509,7 +521,7 @@ ckh_search(ckh_t *ckh, const void *searchkey, void **key, void **data) size_t cell; assert(ckh != NULL); - assert(ckh->magic = CKH_MAGIG); + dassert(ckh->magic == CKH_MAGIC); cell = ckh_isearch(ckh, searchkey); if (cell != SIZE_T_MAX) { @@ -544,7 +556,7 @@ ckh_string_hash(const void *key, unsigned minbits, size_t *hash1, size_t *hash2) } else { ret1 = h; ret2 = hash(key, strlen((const char *)key), - 0x8432a476666bbc13U); + 0x8432a476666bbc13LLU); } *hash1 = ret1; diff --git a/dep/jemalloc/src/ctl.c b/dep/jemalloc/src/ctl.c index 3c8adab90a3..e5336d36949 100644 --- a/dep/jemalloc/src/ctl.c +++ b/dep/jemalloc/src/ctl.c @@ -182,6 +182,7 @@ CTL_PROTO(stats_arenas_i_lruns_j_highruns) CTL_PROTO(stats_arenas_i_lruns_j_curruns) INDEX_PROTO(stats_arenas_i_lruns_j) #endif +CTL_PROTO(stats_arenas_i_nthreads) CTL_PROTO(stats_arenas_i_pactive) CTL_PROTO(stats_arenas_i_pdirty) #ifdef JEMALLOC_STATS @@ -192,6 +193,7 @@ CTL_PROTO(stats_arenas_i_purged) #endif INDEX_PROTO(stats_arenas_i) #ifdef JEMALLOC_STATS +CTL_PROTO(stats_cactive) CTL_PROTO(stats_allocated) CTL_PROTO(stats_active) CTL_PROTO(stats_mapped) @@ -434,6 +436,7 @@ static const ctl_node_t stats_arenas_i_lruns_node[] = { #endif static const ctl_node_t stats_arenas_i_node[] = { + {NAME("nthreads"), CTL(stats_arenas_i_nthreads)}, {NAME("pactive"), CTL(stats_arenas_i_pactive)}, {NAME("pdirty"), CTL(stats_arenas_i_pdirty)} #ifdef JEMALLOC_STATS @@ -458,6 +461,7 @@ static const ctl_node_t stats_arenas_node[] = { static const ctl_node_t stats_node[] = { #ifdef JEMALLOC_STATS + {NAME("cactive"), CTL(stats_cactive)}, {NAME("allocated"), CTL(stats_allocated)}, {NAME("active"), CTL(stats_active)}, {NAME("mapped"), CTL(stats_mapped)}, @@ -620,6 +624,7 @@ ctl_arena_refresh(arena_t *arena, unsigned i) ctl_arena_clear(astats); + sstats->nthreads += astats->nthreads; #ifdef JEMALLOC_STATS ctl_arena_stats_amerge(astats, arena); /* Merge into sum stats as well. */ @@ -657,10 +662,17 @@ ctl_refresh(void) * Clear sum stats, since they will be merged into by * ctl_arena_refresh(). */ + ctl_stats.arenas[narenas].nthreads = 0; ctl_arena_clear(&ctl_stats.arenas[narenas]); malloc_mutex_lock(&arenas_lock); memcpy(tarenas, arenas, sizeof(arena_t *) * narenas); + for (i = 0; i < narenas; i++) { + if (arenas[i] != NULL) + ctl_stats.arenas[i].nthreads = arenas[i]->nthreads; + else + ctl_stats.arenas[i].nthreads = 0; + } malloc_mutex_unlock(&arenas_lock); for (i = 0; i < narenas; i++) { bool initialized = (tarenas[i] != NULL); @@ -1114,8 +1126,8 @@ thread_arena_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, unsigned newind, oldind; newind = oldind = choose_arena()->ind; - WRITE(oldind, unsigned); - READ(newind, unsigned); + WRITE(newind, unsigned); + READ(oldind, unsigned); if (newind != oldind) { arena_t *arena; @@ -1129,6 +1141,8 @@ thread_arena_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, malloc_mutex_lock(&arenas_lock); if ((arena = arenas[newind]) == NULL) arena = arenas_extend(newind); + arenas[oldind]->nthreads--; + arenas[newind]->nthreads++; malloc_mutex_unlock(&arenas_lock); if (arena == NULL) { ret = EAGAIN; @@ -1137,6 +1151,13 @@ thread_arena_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, /* Set new arena association. */ ARENA_SET(arena); +#ifdef JEMALLOC_TCACHE + { + tcache_t *tcache = TCACHE_GET(); + if (tcache != NULL) + tcache->arena = arena; + } +#endif } ret = 0; @@ -1146,9 +1167,9 @@ RETURN: #ifdef JEMALLOC_STATS CTL_RO_NL_GEN(thread_allocated, ALLOCATED_GET(), uint64_t); -CTL_RO_NL_GEN(thread_allocatedp, &ALLOCATED_GET(), uint64_t *); +CTL_RO_NL_GEN(thread_allocatedp, ALLOCATEDP_GET(), uint64_t *); CTL_RO_NL_GEN(thread_deallocated, DEALLOCATED_GET(), uint64_t); -CTL_RO_NL_GEN(thread_deallocatedp, &DEALLOCATED_GET(), uint64_t *); +CTL_RO_NL_GEN(thread_deallocatedp, DEALLOCATEDP_GET(), uint64_t *); #endif /******************************************************************************/ @@ -1284,9 +1305,9 @@ CTL_RO_NL_GEN(opt_overcommit, opt_overcommit, bool) /******************************************************************************/ -CTL_RO_NL_GEN(arenas_bin_i_size, arenas[0]->bins[mib[2]].reg_size, size_t) -CTL_RO_NL_GEN(arenas_bin_i_nregs, arenas[0]->bins[mib[2]].nregs, uint32_t) -CTL_RO_NL_GEN(arenas_bin_i_run_size, arenas[0]->bins[mib[2]].run_size, size_t) +CTL_RO_NL_GEN(arenas_bin_i_size, arena_bin_info[mib[2]].reg_size, size_t) +CTL_RO_NL_GEN(arenas_bin_i_nregs, arena_bin_info[mib[2]].nregs, uint32_t) +CTL_RO_NL_GEN(arenas_bin_i_run_size, arena_bin_info[mib[2]].run_size, size_t) const ctl_node_t * arenas_bin_i_index(const size_t *mib, size_t miblen, size_t i) { @@ -1531,6 +1552,7 @@ stats_arenas_i_lruns_j_index(const size_t *mib, size_t miblen, size_t j) } #endif +CTL_RO_GEN(stats_arenas_i_nthreads, ctl_stats.arenas[mib[2]].nthreads, unsigned) CTL_RO_GEN(stats_arenas_i_pactive, ctl_stats.arenas[mib[2]].pactive, size_t) CTL_RO_GEN(stats_arenas_i_pdirty, ctl_stats.arenas[mib[2]].pdirty, size_t) #ifdef JEMALLOC_STATS @@ -1562,6 +1584,7 @@ RETURN: } #ifdef JEMALLOC_STATS +CTL_RO_GEN(stats_cactive, &stats_cactive, size_t *) CTL_RO_GEN(stats_allocated, ctl_stats.allocated, size_t) CTL_RO_GEN(stats_active, ctl_stats.active, size_t) CTL_RO_GEN(stats_mapped, ctl_stats.mapped, size_t) diff --git a/dep/jemalloc/src/hash.c b/dep/jemalloc/src/hash.c index 6a13d7a03c0..cfa4da0275c 100644 --- a/dep/jemalloc/src/hash.c +++ b/dep/jemalloc/src/hash.c @@ -1,2 +1,2 @@ -#define HASH_C_ +#define JEMALLOC_HASH_C_ #include "jemalloc/internal/jemalloc_internal.h" diff --git a/dep/jemalloc/src/huge.c b/dep/jemalloc/src/huge.c index 0aadc4339a9..a4f9b054ed5 100644 --- a/dep/jemalloc/src/huge.c +++ b/dep/jemalloc/src/huge.c @@ -50,6 +50,7 @@ huge_malloc(size_t size, bool zero) malloc_mutex_lock(&huge_mtx); extent_tree_ad_insert(&huge, node); #ifdef JEMALLOC_STATS + stats_cactive_add(csize); huge_nmalloc++; huge_allocated += csize; #endif @@ -83,7 +84,7 @@ huge_palloc(size_t size, size_t alignment, bool zero) * alignment, in order to assure the alignment can be achieved, then * unmap leading and trailing chunks. */ - assert(alignment >= chunksize); + assert(alignment > chunksize); chunk_size = CHUNK_CEILING(size); @@ -109,12 +110,12 @@ huge_palloc(size_t size, size_t alignment, bool zero) if (offset == 0) { /* Trim trailing space. */ chunk_dealloc((void *)((uintptr_t)ret + chunk_size), alloc_size - - chunk_size); + - chunk_size, true); } else { size_t trailsize; /* Trim leading space. */ - chunk_dealloc(ret, alignment - offset); + chunk_dealloc(ret, alignment - offset, true); ret = (void *)((uintptr_t)ret + (alignment - offset)); @@ -123,7 +124,7 @@ huge_palloc(size_t size, size_t alignment, bool zero) /* Trim trailing space. */ assert(trailsize < alloc_size); chunk_dealloc((void *)((uintptr_t)ret + chunk_size), - trailsize); + trailsize, true); } } @@ -134,6 +135,7 @@ huge_palloc(size_t size, size_t alignment, bool zero) malloc_mutex_lock(&huge_mtx); extent_tree_ad_insert(&huge, node); #ifdef JEMALLOC_STATS + stats_cactive_add(chunk_size); huge_nmalloc++; huge_allocated += chunk_size; #endif @@ -192,7 +194,7 @@ huge_ralloc(void *ptr, size_t oldsize, size_t size, size_t extra, * different size class. In that case, fall back to allocating new * space and copying. */ - if (alignment != 0) + if (alignment > chunksize) ret = huge_palloc(size + extra, alignment, zero); else ret = huge_malloc(size + extra, zero); @@ -201,7 +203,7 @@ huge_ralloc(void *ptr, size_t oldsize, size_t size, size_t extra, if (extra == 0) return (NULL); /* Try again, this time without extra. */ - if (alignment != 0) + if (alignment > chunksize) ret = huge_palloc(size, alignment, zero); else ret = huge_malloc(size, zero); @@ -232,6 +234,13 @@ huge_ralloc(void *ptr, size_t oldsize, size_t size, size_t extra, ) { size_t newsize = huge_salloc(ret); + /* + * Remove ptr from the tree of huge allocations before + * performing the remap operation, in order to avoid the + * possibility of another thread acquiring that mapping before + * this one removes it from the tree. + */ + huge_dalloc(ptr, false); if (mremap(ptr, oldsize, newsize, MREMAP_MAYMOVE|MREMAP_FIXED, ret) == MAP_FAILED) { /* @@ -251,9 +260,8 @@ huge_ralloc(void *ptr, size_t oldsize, size_t size, size_t extra, if (opt_abort) abort(); memcpy(ret, ptr, copysize); - idalloc(ptr); - } else - huge_dalloc(ptr, false); + chunk_dealloc_mmap(ptr, oldsize); + } } else #endif { @@ -278,6 +286,7 @@ huge_dalloc(void *ptr, bool unmap) extent_tree_ad_remove(&huge, node); #ifdef JEMALLOC_STATS + stats_cactive_sub(node->size); huge_ndalloc++; huge_allocated -= node->size; #endif @@ -292,9 +301,10 @@ huge_dalloc(void *ptr, bool unmap) memset(node->addr, 0x5a, node->size); #endif #endif - chunk_dealloc(node->addr, node->size); } + chunk_dealloc(node->addr, node->size, unmap); + base_node_dealloc(node); } diff --git a/dep/jemalloc/src/jemalloc.c b/dep/jemalloc/src/jemalloc.c index 2aebc51dd19..a161c2e26e1 100644 --- a/dep/jemalloc/src/jemalloc.c +++ b/dep/jemalloc/src/jemalloc.c @@ -7,12 +7,10 @@ malloc_mutex_t arenas_lock; arena_t **arenas; unsigned narenas; -static unsigned next_arena; +pthread_key_t arenas_tsd; #ifndef NO_TLS __thread arena_t *arenas_tls JEMALLOC_ATTR(tls_model("initial-exec")); -#else -pthread_key_t arenas_tsd; #endif #ifdef JEMALLOC_STATS @@ -30,7 +28,13 @@ static bool malloc_initialized = false; static pthread_t malloc_initializer = (unsigned long)0; /* Used to avoid initialization races. */ -static malloc_mutex_t init_lock = MALLOC_MUTEX_INITIALIZER; +static malloc_mutex_t init_lock = +#ifdef JEMALLOC_OSSPIN + 0 +#else + MALLOC_MUTEX_INITIALIZER +#endif + ; #ifdef DYNAMIC_PAGE_SHIFT size_t pagesize; @@ -70,6 +74,7 @@ size_t opt_narenas = 0; static void wrtmessage(void *cbopaque, const char *s); static void stats_print_atexit(void); static unsigned malloc_ncpus(void); +static void arenas_cleanup(void *arg); #if (defined(JEMALLOC_STATS) && defined(NO_TLS)) static void thread_allocated_cleanup(void *arg); #endif @@ -79,6 +84,7 @@ static void malloc_conf_error(const char *msg, const char *k, size_t klen, const char *v, size_t vlen); static void malloc_conf_init(void); static bool malloc_init_hard(void); +static int imemalign(void **memptr, size_t alignment, size_t size); /******************************************************************************/ /* malloc_message() setup. */ @@ -147,13 +153,53 @@ choose_arena_hard(void) arena_t *ret; if (narenas > 1) { + unsigned i, choose, first_null; + + choose = 0; + first_null = narenas; malloc_mutex_lock(&arenas_lock); - if ((ret = arenas[next_arena]) == NULL) - ret = arenas_extend(next_arena); - next_arena = (next_arena + 1) % narenas; + assert(arenas[0] != NULL); + for (i = 1; i < narenas; i++) { + if (arenas[i] != NULL) { + /* + * Choose the first arena that has the lowest + * number of threads assigned to it. + */ + if (arenas[i]->nthreads < + arenas[choose]->nthreads) + choose = i; + } else if (first_null == narenas) { + /* + * Record the index of the first uninitialized + * arena, in case all extant arenas are in use. + * + * NB: It is possible for there to be + * discontinuities in terms of initialized + * versus uninitialized arenas, due to the + * "thread.arena" mallctl. + */ + first_null = i; + } + } + + if (arenas[choose] == 0 || first_null == narenas) { + /* + * Use an unloaded arena, or the least loaded arena if + * all arenas are already initialized. + */ + ret = arenas[choose]; + } else { + /* Initialize a new arena. */ + ret = arenas_extend(first_null); + } + ret->nthreads++; malloc_mutex_unlock(&arenas_lock); - } else + } else { ret = arenas[0]; + malloc_mutex_lock(&arenas_lock); + ret->nthreads++; + malloc_mutex_unlock(&arenas_lock); + } ARENA_SET(ret); @@ -213,6 +259,28 @@ stats_print_atexit(void) JEMALLOC_P(malloc_stats_print)(NULL, NULL, NULL); } +#if (defined(JEMALLOC_STATS) && defined(NO_TLS)) +thread_allocated_t * +thread_allocated_get_hard(void) +{ + thread_allocated_t *thread_allocated = (thread_allocated_t *) + imalloc(sizeof(thread_allocated_t)); + if (thread_allocated == NULL) { + static thread_allocated_t static_thread_allocated = {0, 0}; + malloc_write(": Error allocating TSD;" + " mallctl(\"thread.{de,}allocated[p]\", ...)" + " will be inaccurate\n"); + if (opt_abort) + abort(); + return (&static_thread_allocated); + } + pthread_setspecific(thread_allocated_tsd, thread_allocated); + thread_allocated->allocated = 0; + thread_allocated->deallocated = 0; + return (thread_allocated); +} +#endif + /* * End miscellaneous support functions. */ @@ -237,6 +305,16 @@ malloc_ncpus(void) return (ret); } +static void +arenas_cleanup(void *arg) +{ + arena_t *arena = (arena_t *)arg; + + malloc_mutex_lock(&arenas_lock); + arena->nthreads--; + malloc_mutex_unlock(&arenas_lock); +} + #if (defined(JEMALLOC_STATS) && defined(NO_TLS)) static void thread_allocated_cleanup(void *arg) @@ -421,8 +499,8 @@ malloc_conf_init(void) if ((opts = getenv(envname)) != NULL) { /* * Do nothing; opts is already initialized to - * the value of the JEMALLOC_OPTIONS - * environment variable. + * the value of the MALLOC_CONF environment + * variable. */ } else { /* No configuration specified. */ @@ -611,7 +689,7 @@ malloc_init_hard(void) result = sysconf(_SC_PAGESIZE); assert(result != -1); - pagesize = (unsigned)result; + pagesize = (size_t)result; /* * We assume that pagesize is a power of 2 when calculating @@ -671,7 +749,10 @@ malloc_init_hard(void) } #ifdef JEMALLOC_TCACHE - tcache_boot(); + if (tcache_boot()) { + malloc_mutex_unlock(&init_lock); + return (true); + } #endif if (huge_boot()) { @@ -688,6 +769,14 @@ malloc_init_hard(void) } #endif + if (malloc_mutex_init(&arenas_lock)) + return (true); + + if (pthread_key_create(&arenas_tsd, arenas_cleanup) != 0) { + malloc_mutex_unlock(&init_lock); + return (true); + } + /* * Create enough scaffolding to allow recursive allocation in * malloc_ncpus(). @@ -712,8 +801,7 @@ malloc_init_hard(void) * threaded mode. */ ARENA_SET(arenas[0]); - - malloc_mutex_init(&arenas_lock); + arenas[0]->nthreads++; #ifdef JEMALLOC_PROF if (prof_boot2()) { @@ -753,15 +841,6 @@ malloc_init_hard(void) malloc_write(")\n"); } - next_arena = (narenas > 0) ? 1 : 0; - -#ifdef NO_TLS - if (pthread_key_create(&arenas_tsd, NULL) != 0) { - malloc_mutex_unlock(&init_lock); - return (true); - } -#endif - /* Allocate and initialize arenas. */ arenas = (arena_t **)base_alloc(sizeof(arena_t *) * narenas); if (arenas == NULL) { @@ -793,7 +872,6 @@ malloc_init_hard(void) return (false); } - #ifdef JEMALLOC_ZONE JEMALLOC_ATTR(constructor) void @@ -862,7 +940,8 @@ JEMALLOC_P(malloc)(size_t size) #ifdef JEMALLOC_PROF if (opt_prof) { usize = s2u(size); - if ((cnt = prof_alloc_prep(usize)) == NULL) { + PROF_ALLOC_PREP(1, usize, cnt); + if (cnt == NULL) { ret = NULL; goto OOM; } @@ -911,19 +990,23 @@ RETURN: } JEMALLOC_ATTR(nonnull(1)) -JEMALLOC_ATTR(visibility("default")) -int -JEMALLOC_P(posix_memalign)(void **memptr, size_t alignment, size_t size) +#ifdef JEMALLOC_PROF +/* + * Avoid any uncertainty as to how many backtrace frames to ignore in + * PROF_ALLOC_PREP(). + */ +JEMALLOC_ATTR(noinline) +#endif +static int +imemalign(void **memptr, size_t alignment, size_t size) { int ret; - void *result; -#if (defined(JEMALLOC_PROF) || defined(JEMALLOC_STATS)) size_t usize -# ifdef JEMALLOC_CC_SILENCE +#ifdef JEMALLOC_CC_SILENCE = 0 -# endif - ; #endif + ; + void *result; #ifdef JEMALLOC_PROF prof_thr_cnt_t *cnt # ifdef JEMALLOC_CC_SILENCE @@ -973,34 +1056,38 @@ JEMALLOC_P(posix_memalign)(void **memptr, size_t alignment, size_t size) goto RETURN; } + usize = sa2u(size, alignment, NULL); + if (usize == 0) { + result = NULL; + ret = ENOMEM; + goto RETURN; + } + #ifdef JEMALLOC_PROF if (opt_prof) { - usize = sa2u(size, alignment, NULL); - if ((cnt = prof_alloc_prep(usize)) == NULL) { + PROF_ALLOC_PREP(2, usize, cnt); + if (cnt == NULL) { result = NULL; ret = EINVAL; } else { if (prof_promote && (uintptr_t)cnt != (uintptr_t)1U && usize <= small_maxclass) { - result = ipalloc(small_maxclass+1, - alignment, false); + assert(sa2u(small_maxclass+1, + alignment, NULL) != 0); + result = ipalloc(sa2u(small_maxclass+1, + alignment, NULL), alignment, false); if (result != NULL) { arena_prof_promoted(result, usize); } } else { - result = ipalloc(size, alignment, + result = ipalloc(usize, alignment, false); } } } else #endif - { -#ifdef JEMALLOC_STATS - usize = sa2u(size, alignment, NULL); -#endif - result = ipalloc(size, alignment, false); - } + result = ipalloc(usize, alignment, false); } if (result == NULL) { @@ -1032,6 +1119,15 @@ RETURN: return (ret); } +JEMALLOC_ATTR(nonnull(1)) +JEMALLOC_ATTR(visibility("default")) +int +JEMALLOC_P(posix_memalign)(void **memptr, size_t alignment, size_t size) +{ + + return imemalign(memptr, alignment, size); +} + JEMALLOC_ATTR(malloc) JEMALLOC_ATTR(visibility("default")) void * @@ -1087,7 +1183,8 @@ JEMALLOC_P(calloc)(size_t num, size_t size) #ifdef JEMALLOC_PROF if (opt_prof) { usize = s2u(num_size); - if ((cnt = prof_alloc_prep(usize)) == NULL) { + PROF_ALLOC_PREP(1, usize, cnt); + if (cnt == NULL) { ret = NULL; goto RETURN; } @@ -1200,7 +1297,9 @@ JEMALLOC_P(realloc)(void *ptr, size_t size) if (opt_prof) { usize = s2u(size); old_ctx = prof_ctx_get(ptr); - if ((cnt = prof_alloc_prep(usize)) == NULL) { + PROF_ALLOC_PREP(1, usize, cnt); + if (cnt == NULL) { + old_ctx = NULL; ret = NULL; goto OOM; } @@ -1210,8 +1309,13 @@ JEMALLOC_P(realloc)(void *ptr, size_t size) false, false); if (ret != NULL) arena_prof_promoted(ret, usize); - } else + else + old_ctx = NULL; + } else { ret = iralloc(ptr, size, 0, 0, false, false); + if (ret == NULL) + old_ctx = NULL; + } } else #endif { @@ -1249,7 +1353,8 @@ OOM: #ifdef JEMALLOC_PROF if (opt_prof) { usize = s2u(size); - if ((cnt = prof_alloc_prep(usize)) == NULL) + PROF_ALLOC_PREP(1, usize, cnt); + if (cnt == NULL) ret = NULL; else { if (prof_promote && (uintptr_t)cnt != @@ -1354,7 +1459,7 @@ JEMALLOC_P(memalign)(size_t alignment, size_t size) #ifdef JEMALLOC_CC_SILENCE int result = #endif - JEMALLOC_P(posix_memalign)(&ret, alignment, size); + imemalign(&ret, alignment, size); #ifdef JEMALLOC_CC_SILENCE if (result != 0) return (NULL); @@ -1373,7 +1478,7 @@ JEMALLOC_P(valloc)(size_t size) #ifdef JEMALLOC_CC_SILENCE int result = #endif - JEMALLOC_P(posix_memalign)(&ret, PAGE_SIZE, size); + imemalign(&ret, PAGE_SIZE, size); #ifdef JEMALLOC_CC_SILENCE if (result != 0) return (NULL); @@ -1454,15 +1559,18 @@ JEMALLOC_P(mallctlbymib)(const size_t *mib, size_t miblen, void *oldp, } JEMALLOC_INLINE void * -iallocm(size_t size, size_t alignment, bool zero) +iallocm(size_t usize, size_t alignment, bool zero) { + assert(usize == ((alignment == 0) ? s2u(usize) : sa2u(usize, alignment, + NULL))); + if (alignment != 0) - return (ipalloc(size, alignment, zero)); + return (ipalloc(usize, alignment, zero)); else if (zero) - return (icalloc(size)); + return (icalloc(usize)); else - return (imalloc(size)); + return (imalloc(usize)); } JEMALLOC_ATTR(nonnull(1)) @@ -1485,38 +1593,43 @@ JEMALLOC_P(allocm)(void **ptr, size_t *rsize, size_t size, int flags) if (malloc_init()) goto OOM; + usize = (alignment == 0) ? s2u(size) : sa2u(size, alignment, NULL); + if (usize == 0) + goto OOM; + #ifdef JEMALLOC_PROF if (opt_prof) { - usize = (alignment == 0) ? s2u(size) : sa2u(size, alignment, - NULL); - if ((cnt = prof_alloc_prep(usize)) == NULL) + PROF_ALLOC_PREP(1, usize, cnt); + if (cnt == NULL) goto OOM; if (prof_promote && (uintptr_t)cnt != (uintptr_t)1U && usize <= small_maxclass) { - p = iallocm(small_maxclass+1, alignment, zero); + size_t usize_promoted = (alignment == 0) ? + s2u(small_maxclass+1) : sa2u(small_maxclass+1, + alignment, NULL); + assert(usize_promoted != 0); + p = iallocm(usize_promoted, alignment, zero); if (p == NULL) goto OOM; arena_prof_promoted(p, usize); } else { - p = iallocm(size, alignment, zero); + p = iallocm(usize, alignment, zero); if (p == NULL) goto OOM; } - + prof_malloc(p, usize, cnt); if (rsize != NULL) *rsize = usize; } else #endif { - p = iallocm(size, alignment, zero); + p = iallocm(usize, alignment, zero); if (p == NULL) goto OOM; #ifndef JEMALLOC_STATS if (rsize != NULL) #endif { - usize = (alignment == 0) ? s2u(size) : sa2u(size, - alignment, NULL); #ifdef JEMALLOC_STATS if (rsize != NULL) #endif @@ -1559,7 +1672,6 @@ JEMALLOC_P(rallocm)(void **ptr, size_t *rsize, size_t size, size_t extra, bool no_move = flags & ALLOCM_NO_MOVE; #ifdef JEMALLOC_PROF prof_thr_cnt_t *cnt; - prof_ctx_t *old_ctx; #endif assert(ptr != NULL); @@ -1574,25 +1686,33 @@ JEMALLOC_P(rallocm)(void **ptr, size_t *rsize, size_t size, size_t extra, /* * usize isn't knowable before iralloc() returns when extra is * non-zero. Therefore, compute its maximum possible value and - * use that in prof_alloc_prep() to decide whether to capture a + * use that in PROF_ALLOC_PREP() to decide whether to capture a * backtrace. prof_realloc() will use the actual usize to * decide whether to sample. */ size_t max_usize = (alignment == 0) ? s2u(size+extra) : sa2u(size+extra, alignment, NULL); + prof_ctx_t *old_ctx = prof_ctx_get(p); old_size = isalloc(p); - old_ctx = prof_ctx_get(p); - if ((cnt = prof_alloc_prep(max_usize)) == NULL) + PROF_ALLOC_PREP(1, max_usize, cnt); + if (cnt == NULL) goto OOM; - if (prof_promote && (uintptr_t)cnt != (uintptr_t)1U && max_usize - <= small_maxclass) { + /* + * Use minimum usize to determine whether promotion may happen. + */ + if (prof_promote && (uintptr_t)cnt != (uintptr_t)1U + && ((alignment == 0) ? s2u(size) : sa2u(size, + alignment, NULL)) <= small_maxclass) { q = iralloc(p, small_maxclass+1, (small_maxclass+1 >= size+extra) ? 0 : size+extra - (small_maxclass+1), alignment, zero, no_move); if (q == NULL) goto ERR; - usize = isalloc(q); - arena_prof_promoted(q, usize); + if (max_usize < PAGE_SIZE) { + usize = max_usize; + arena_prof_promoted(q, usize); + } else + usize = isalloc(q); } else { q = iralloc(p, size, extra, alignment, zero, no_move); if (q == NULL) @@ -1600,6 +1720,8 @@ JEMALLOC_P(rallocm)(void **ptr, size_t *rsize, size_t size, size_t extra, usize = isalloc(q); } prof_realloc(q, usize, cnt, old_size, old_ctx); + if (rsize != NULL) + *rsize = usize; } else #endif { diff --git a/dep/jemalloc/src/mb.c b/dep/jemalloc/src/mb.c index 30a1a2e997a..dc2c0a256fd 100644 --- a/dep/jemalloc/src/mb.c +++ b/dep/jemalloc/src/mb.c @@ -1,2 +1,2 @@ -#define MB_C_ +#define JEMALLOC_MB_C_ #include "jemalloc/internal/jemalloc_internal.h" diff --git a/dep/jemalloc/src/mutex.c b/dep/jemalloc/src/mutex.c index 3ecb18a340e..ca89ef1c962 100644 --- a/dep/jemalloc/src/mutex.c +++ b/dep/jemalloc/src/mutex.c @@ -55,6 +55,9 @@ pthread_create(pthread_t *__restrict thread, bool malloc_mutex_init(malloc_mutex_t *mutex) { +#ifdef JEMALLOC_OSSPIN + *mutex = 0; +#else pthread_mutexattr_t attr; if (pthread_mutexattr_init(&attr) != 0) @@ -70,6 +73,7 @@ malloc_mutex_init(malloc_mutex_t *mutex) } pthread_mutexattr_destroy(&attr); +#endif return (false); } @@ -77,8 +81,10 @@ void malloc_mutex_destroy(malloc_mutex_t *mutex) { +#ifndef JEMALLOC_OSSPIN if (pthread_mutex_destroy(mutex) != 0) { malloc_write(": Error in pthread_mutex_destroy()\n"); abort(); } +#endif } diff --git a/dep/jemalloc/src/prof.c b/dep/jemalloc/src/prof.c index 636cccef52a..8a144b4e46c 100644 --- a/dep/jemalloc/src/prof.c +++ b/dep/jemalloc/src/prof.c @@ -3,15 +3,15 @@ #ifdef JEMALLOC_PROF /******************************************************************************/ -#ifdef JEMALLOC_PROF_LIBGCC -#include -#endif - #ifdef JEMALLOC_PROF_LIBUNWIND #define UNW_LOCAL_ONLY #include #endif +#ifdef JEMALLOC_PROF_LIBGCC +#include +#endif + /******************************************************************************/ /* Data. */ @@ -169,39 +169,7 @@ prof_leave(void) prof_gdump(); } -#ifdef JEMALLOC_PROF_LIBGCC -static _Unwind_Reason_Code -prof_unwind_init_callback(struct _Unwind_Context *context, void *arg) -{ - - return (_URC_NO_REASON); -} - -static _Unwind_Reason_Code -prof_unwind_callback(struct _Unwind_Context *context, void *arg) -{ - prof_unwind_data_t *data = (prof_unwind_data_t *)arg; - - if (data->nignore > 0) - data->nignore--; - else { - data->bt->vec[data->bt->len] = (void *)_Unwind_GetIP(context); - data->bt->len++; - if (data->bt->len == data->max) - return (_URC_END_OF_STACK); - } - - return (_URC_NO_REASON); -} - -void -prof_backtrace(prof_bt_t *bt, unsigned nignore, unsigned max) -{ - prof_unwind_data_t data = {bt, nignore, max}; - - _Unwind_Backtrace(prof_unwind_callback, &data); -} -#elif defined(JEMALLOC_PROF_LIBUNWIND) +#ifdef JEMALLOC_PROF_LIBUNWIND void prof_backtrace(prof_bt_t *bt, unsigned nignore, unsigned max) { @@ -236,7 +204,41 @@ prof_backtrace(prof_bt_t *bt, unsigned nignore, unsigned max) break; } } -#else +#endif +#ifdef JEMALLOC_PROF_LIBGCC +static _Unwind_Reason_Code +prof_unwind_init_callback(struct _Unwind_Context *context, void *arg) +{ + + return (_URC_NO_REASON); +} + +static _Unwind_Reason_Code +prof_unwind_callback(struct _Unwind_Context *context, void *arg) +{ + prof_unwind_data_t *data = (prof_unwind_data_t *)arg; + + if (data->nignore > 0) + data->nignore--; + else { + data->bt->vec[data->bt->len] = (void *)_Unwind_GetIP(context); + data->bt->len++; + if (data->bt->len == data->max) + return (_URC_END_OF_STACK); + } + + return (_URC_NO_REASON); +} + +void +prof_backtrace(prof_bt_t *bt, unsigned nignore, unsigned max) +{ + prof_unwind_data_t data = {bt, nignore, max}; + + _Unwind_Backtrace(prof_unwind_callback, &data); +} +#endif +#ifdef JEMALLOC_PROF_GCC void prof_backtrace(prof_bt_t *bt, unsigned nignore, unsigned max) { @@ -432,6 +434,7 @@ prof_lookup(prof_bt_t *bt) prof_ctx_t *p; void *v; } ctx; + bool new_ctx; /* * This thread's cache lacks bt. Look for it in the global @@ -468,12 +471,26 @@ prof_lookup(prof_bt_t *bt) idalloc(ctx.v); return (NULL); } + /* + * Artificially raise curobjs, in order to avoid a race + * condition with prof_ctx_merge()/prof_ctx_destroy(). + * + * No locking is necessary for ctx here because no other + * threads have had the opportunity to fetch it from + * bt2ctx yet. + */ + ctx.p->cnt_merged.curobjs++; + new_ctx = true; + } else { + /* + * Artificially raise curobjs, in order to avoid a race + * condition with prof_ctx_merge()/prof_ctx_destroy(). + */ + malloc_mutex_lock(&ctx.p->lock); + ctx.p->cnt_merged.curobjs++; + malloc_mutex_unlock(&ctx.p->lock); + new_ctx = false; } - /* - * Acquire ctx's lock before releasing bt2ctx_mtx, in order to - * avoid a race condition with prof_ctx_destroy(). - */ - malloc_mutex_lock(&ctx.p->lock); prof_leave(); /* Link a prof_thd_cnt_t into ctx for this thread. */ @@ -486,8 +503,9 @@ prof_lookup(prof_bt_t *bt) */ ret.p = ql_last(&prof_tdata->lru_ql, lru_link); assert(ret.v != NULL); - ckh_remove(&prof_tdata->bt2cnt, ret.p->ctx->bt, NULL, - NULL); + if (ckh_remove(&prof_tdata->bt2cnt, ret.p->ctx->bt, + NULL, NULL)) + assert(false); ql_remove(&prof_tdata->lru_ql, ret.p, lru_link); prof_ctx_merge(ret.p->ctx, ret.p); /* ret can now be re-used. */ @@ -498,7 +516,8 @@ prof_lookup(prof_bt_t *bt) /* Allocate and partially initialize a new cnt. */ ret.v = imalloc(sizeof(prof_thr_cnt_t)); if (ret.p == NULL) { - malloc_mutex_unlock(&ctx.p->lock); + if (new_ctx) + prof_ctx_destroy(ctx.p); return (NULL); } ql_elm_new(ret.p, cnts_link); @@ -509,12 +528,15 @@ prof_lookup(prof_bt_t *bt) ret.p->epoch = 0; memset(&ret.p->cnts, 0, sizeof(prof_cnt_t)); if (ckh_insert(&prof_tdata->bt2cnt, btkey.v, ret.v)) { - malloc_mutex_unlock(&ctx.p->lock); + if (new_ctx) + prof_ctx_destroy(ctx.p); idalloc(ret.v); return (NULL); } ql_head_insert(&prof_tdata->lru_ql, ret.p, lru_link); + malloc_mutex_lock(&ctx.p->lock); ql_tail_insert(&ctx.p->cnts_ql, ret.p, cnts_link); + ctx.p->cnt_merged.curobjs--; malloc_mutex_unlock(&ctx.p->lock); } else { /* Move ret to the front of the LRU. */ @@ -628,11 +650,10 @@ prof_ctx_destroy(prof_ctx_t *ctx) /* * Check that ctx is still unused by any thread cache before destroying - * it. prof_lookup() interlocks bt2ctx_mtx and ctx->lock in order to - * avoid a race condition with this function, and prof_ctx_merge() - * artificially raises ctx->cnt_merged.curobjs in order to avoid a race - * between the main body of prof_ctx_merge() and entry into this - * function. + * it. prof_lookup() artificially raises ctx->cnt_merge.curobjs in + * order to avoid a race condition with this function, as does + * prof_ctx_merge() in order to avoid a race between the main body of + * prof_ctx_merge() and entry into this function. */ prof_enter(); malloc_mutex_lock(&ctx->lock); @@ -641,7 +662,8 @@ prof_ctx_destroy(prof_ctx_t *ctx) assert(ctx->cnt_merged.accumobjs == 0); assert(ctx->cnt_merged.accumbytes == 0); /* Remove ctx from bt2ctx. */ - ckh_remove(&bt2ctx, ctx->bt, NULL, NULL); + if (ckh_remove(&bt2ctx, ctx->bt, NULL, NULL)) + assert(false); prof_leave(); /* Destroy ctx. */ malloc_mutex_unlock(&ctx->lock); @@ -649,7 +671,10 @@ prof_ctx_destroy(prof_ctx_t *ctx) malloc_mutex_destroy(&ctx->lock); idalloc(ctx); } else { - /* Compensate for increment in prof_ctx_merge(). */ + /* + * Compensate for increment in prof_ctx_merge() or + * prof_lookup(). + */ ctx->cnt_merged.curobjs--; malloc_mutex_unlock(&ctx->lock); prof_leave(); @@ -1056,7 +1081,7 @@ prof_bt_hash(const void *key, unsigned minbits, size_t *hash1, size_t *hash2) } else { ret1 = h; ret2 = hash(bt->vec, bt->len * sizeof(void *), - 0x8432a476666bbc13U); + 0x8432a476666bbc13LLU); } *hash1 = ret1; @@ -1093,7 +1118,6 @@ prof_tdata_init(void) prof_tdata->vec = imalloc(sizeof(void *) * prof_bt_max); if (prof_tdata->vec == NULL) { - ckh_delete(&prof_tdata->bt2cnt); idalloc(prof_tdata); return (NULL); @@ -1111,33 +1135,26 @@ prof_tdata_init(void) static void prof_tdata_cleanup(void *arg) { - prof_tdata_t *prof_tdata; + prof_thr_cnt_t *cnt; + prof_tdata_t *prof_tdata = (prof_tdata_t *)arg; - prof_tdata = PROF_TCACHE_GET(); - if (prof_tdata != NULL) { - prof_thr_cnt_t *cnt; + /* + * Delete the hash table. All of its contents can still be iterated + * over via the LRU. + */ + ckh_delete(&prof_tdata->bt2cnt); - /* - * Delete the hash table. All of its contents can still be - * iterated over via the LRU. - */ - ckh_delete(&prof_tdata->bt2cnt); - - /* - * Iteratively merge cnt's into the global stats and delete - * them. - */ - while ((cnt = ql_last(&prof_tdata->lru_ql, lru_link)) != NULL) { - prof_ctx_merge(cnt->ctx, cnt); - ql_remove(&prof_tdata->lru_ql, cnt, lru_link); - idalloc(cnt); - } - - idalloc(prof_tdata->vec); - - idalloc(prof_tdata); - PROF_TCACHE_SET(NULL); + /* Iteratively merge cnt's into the global stats and delete them. */ + while ((cnt = ql_last(&prof_tdata->lru_ql, lru_link)) != NULL) { + ql_remove(&prof_tdata->lru_ql, cnt, lru_link); + prof_ctx_merge(cnt->ctx, cnt); + idalloc(cnt); } + + idalloc(prof_tdata->vec); + + idalloc(prof_tdata); + PROF_TCACHE_SET(NULL); } void diff --git a/dep/jemalloc/src/rtree.c b/dep/jemalloc/src/rtree.c index 7753743c5e6..eb0ff1e24af 100644 --- a/dep/jemalloc/src/rtree.c +++ b/dep/jemalloc/src/rtree.c @@ -1,4 +1,4 @@ -#define RTREE_C_ +#define JEMALLOC_RTREE_C_ #include "jemalloc/internal/jemalloc_internal.h" rtree_t * @@ -20,7 +20,10 @@ rtree_new(unsigned bits) memset(ret, 0, offsetof(rtree_t, level2bits) + (sizeof(unsigned) * height)); - malloc_mutex_init(&ret->mutex); + if (malloc_mutex_init(&ret->mutex)) { + /* Leak the rtree. */ + return (NULL); + } ret->height = height; if (bits_per_level * height > bits) ret->level2bits[0] = bits % bits_per_level; diff --git a/dep/jemalloc/src/stats.c b/dep/jemalloc/src/stats.c index 3dfe0d232a6..dc172e425c0 100644 --- a/dep/jemalloc/src/stats.c +++ b/dep/jemalloc/src/stats.c @@ -39,6 +39,10 @@ bool opt_stats_print = false; +#ifdef JEMALLOC_STATS +size_t stats_cactive = 0; +#endif + /******************************************************************************/ /* Function prototypes for non-inline static functions. */ @@ -319,6 +323,7 @@ static void stats_arena_print(void (*write_cb)(void *, const char *), void *cbopaque, unsigned i) { + unsigned nthreads; size_t pagesize, pactive, pdirty, mapped; uint64_t npurge, nmadvise, purged; size_t small_allocated; @@ -328,6 +333,9 @@ stats_arena_print(void (*write_cb)(void *, const char *), void *cbopaque, CTL_GET("arenas.pagesize", &pagesize, size_t); + CTL_I_GET("stats.arenas.0.nthreads", &nthreads, unsigned); + malloc_cprintf(write_cb, cbopaque, + "assigned threads: %u\n", nthreads); CTL_I_GET("stats.arenas.0.pactive", &pactive, size_t); CTL_I_GET("stats.arenas.0.pdirty", &pdirty, size_t); CTL_I_GET("stats.arenas.0.npurge", &npurge, uint64_t); @@ -669,21 +677,26 @@ stats_print(void (*write_cb)(void *, const char *), void *cbopaque, #ifdef JEMALLOC_STATS { int err; - size_t ssz; + size_t sszp, ssz; + size_t *cactive; size_t allocated, active, mapped; size_t chunks_current, chunks_high, swap_avail; uint64_t chunks_total; size_t huge_allocated; uint64_t huge_nmalloc, huge_ndalloc; + sszp = sizeof(size_t *); ssz = sizeof(size_t); + CTL_GET("stats.cactive", &cactive, size_t *); CTL_GET("stats.allocated", &allocated, size_t); CTL_GET("stats.active", &active, size_t); CTL_GET("stats.mapped", &mapped, size_t); malloc_cprintf(write_cb, cbopaque, - "Allocated: %zu, active: %zu, mapped: %zu\n", allocated, - active, mapped); + "Allocated: %zu, active: %zu, mapped: %zu\n", + allocated, active, mapped); + malloc_cprintf(write_cb, cbopaque, + "Current active ceiling: %zu\n", atomic_read_z(cactive)); /* Print chunk stats. */ CTL_GET("stats.chunks.total", &chunks_total, uint64_t); @@ -735,7 +748,7 @@ stats_print(void (*write_cb)(void *, const char *), void *cbopaque, ninitialized++; } - if (ninitialized > 1) { + if (ninitialized > 1 || unmerged == false) { /* Print merged arena stats. */ malloc_cprintf(write_cb, cbopaque, "\nMerged arenas stats:\n"); diff --git a/dep/jemalloc/src/tcache.c b/dep/jemalloc/src/tcache.c index cbbe7a113a9..31c329e1613 100644 --- a/dep/jemalloc/src/tcache.c +++ b/dep/jemalloc/src/tcache.c @@ -8,6 +8,9 @@ bool opt_tcache = true; ssize_t opt_lg_tcache_max = LG_TCACHE_MAXCLASS_DEFAULT; ssize_t opt_lg_tcache_gc_sweep = LG_TCACHE_GC_SWEEP_DEFAULT; +tcache_bin_info_t *tcache_bin_info; +static unsigned stack_nelms; /* Total stack elms per tcache. */ + /* Map of thread-specific caches. */ #ifndef NO_TLS __thread tcache_t *tcache_tls JEMALLOC_ATTR(tls_model("initial-exec")); @@ -55,18 +58,19 @@ tcache_bin_flush_small(tcache_bin_t *tbin, size_t binind, unsigned rem #endif ) { - void *flush, *deferred, *ptr; + void *ptr; unsigned i, nflush, ndeferred; - bool first_pass; +#ifdef JEMALLOC_STATS + bool merged_stats = false; +#endif assert(binind < nbins); assert(rem <= tbin->ncached); - assert(tbin->ncached > 0 || tbin->avail == NULL); - for (flush = tbin->avail, nflush = tbin->ncached - rem, first_pass = - true; flush != NULL; flush = deferred, nflush = ndeferred) { + for (nflush = tbin->ncached - rem; nflush > 0; nflush = ndeferred) { /* Lock the arena bin associated with the first object. */ - arena_chunk_t *chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(flush); + arena_chunk_t *chunk = (arena_chunk_t *)CHUNK_ADDR2BASE( + tbin->avail[0]); arena_t *arena = chunk->arena; arena_bin_t *bin = &arena->bins[binind]; @@ -82,17 +86,17 @@ tcache_bin_flush_small(tcache_bin_t *tbin, size_t binind, unsigned rem malloc_mutex_lock(&bin->lock); #ifdef JEMALLOC_STATS if (arena == tcache->arena) { + assert(merged_stats == false); + merged_stats = true; bin->stats.nflushes++; bin->stats.nrequests += tbin->tstats.nrequests; tbin->tstats.nrequests = 0; } #endif - deferred = NULL; ndeferred = 0; for (i = 0; i < nflush; i++) { - ptr = flush; + ptr = tbin->avail[i]; assert(ptr != NULL); - flush = *(void **)ptr; chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); if (chunk->arena == arena) { size_t pageind = ((uintptr_t)ptr - @@ -107,21 +111,31 @@ tcache_bin_flush_small(tcache_bin_t *tbin, size_t binind, unsigned rem * locked. Stash the object, so that it can be * handled in a future pass. */ - *(void **)ptr = deferred; - deferred = ptr; + tbin->avail[ndeferred] = ptr; ndeferred++; } } malloc_mutex_unlock(&bin->lock); - - if (first_pass) { - tbin->avail = flush; - first_pass = false; - } } +#ifdef JEMALLOC_STATS + if (merged_stats == false) { + /* + * The flush loop didn't happen to flush to this thread's + * arena, so the stats didn't get merged. Manually do so now. + */ + arena_bin_t *bin = &tcache->arena->bins[binind]; + malloc_mutex_lock(&bin->lock); + bin->stats.nflushes++; + bin->stats.nrequests += tbin->tstats.nrequests; + tbin->tstats.nrequests = 0; + malloc_mutex_unlock(&bin->lock); + } +#endif + memmove(tbin->avail, &tbin->avail[tbin->ncached - rem], + rem * sizeof(void *)); tbin->ncached = rem; - if (tbin->ncached < tbin->low_water) + if ((int)tbin->ncached < tbin->low_water) tbin->low_water = tbin->ncached; } @@ -132,18 +146,19 @@ tcache_bin_flush_large(tcache_bin_t *tbin, size_t binind, unsigned rem #endif ) { - void *flush, *deferred, *ptr; + void *ptr; unsigned i, nflush, ndeferred; - bool first_pass; +#ifdef JEMALLOC_STATS + bool merged_stats = false; +#endif assert(binind < nhbins); assert(rem <= tbin->ncached); - assert(tbin->ncached > 0 || tbin->avail == NULL); - for (flush = tbin->avail, nflush = tbin->ncached - rem, first_pass = - true; flush != NULL; flush = deferred, nflush = ndeferred) { + for (nflush = tbin->ncached - rem; nflush > 0; nflush = ndeferred) { /* Lock the arena associated with the first object. */ - arena_chunk_t *chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(flush); + arena_chunk_t *chunk = (arena_chunk_t *)CHUNK_ADDR2BASE( + tbin->avail[0]); arena_t *arena = chunk->arena; malloc_mutex_lock(&arena->lock); @@ -155,6 +170,7 @@ tcache_bin_flush_large(tcache_bin_t *tbin, size_t binind, unsigned rem tcache->prof_accumbytes = 0; #endif #ifdef JEMALLOC_STATS + merged_stats = true; arena->stats.nrequests_large += tbin->tstats.nrequests; arena->stats.lstats[binind - nbins].nrequests += tbin->tstats.nrequests; @@ -163,12 +179,10 @@ tcache_bin_flush_large(tcache_bin_t *tbin, size_t binind, unsigned rem #if (defined(JEMALLOC_PROF) || defined(JEMALLOC_STATS)) } #endif - deferred = NULL; ndeferred = 0; for (i = 0; i < nflush; i++) { - ptr = flush; + ptr = tbin->avail[i]; assert(ptr != NULL); - flush = *(void **)ptr; chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); if (chunk->arena == arena) arena_dalloc_large(arena, chunk, ptr); @@ -179,21 +193,32 @@ tcache_bin_flush_large(tcache_bin_t *tbin, size_t binind, unsigned rem * Stash the object, so that it can be handled * in a future pass. */ - *(void **)ptr = deferred; - deferred = ptr; + tbin->avail[ndeferred] = ptr; ndeferred++; } } malloc_mutex_unlock(&arena->lock); - - if (first_pass) { - tbin->avail = flush; - first_pass = false; - } } +#ifdef JEMALLOC_STATS + if (merged_stats == false) { + /* + * The flush loop didn't happen to flush to this thread's + * arena, so the stats didn't get merged. Manually do so now. + */ + arena_t *arena = tcache->arena; + malloc_mutex_lock(&arena->lock); + arena->stats.nrequests_large += tbin->tstats.nrequests; + arena->stats.lstats[binind - nbins].nrequests += + tbin->tstats.nrequests; + tbin->tstats.nrequests = 0; + malloc_mutex_unlock(&arena->lock); + } +#endif + memmove(tbin->avail, &tbin->avail[tbin->ncached - rem], + rem * sizeof(void *)); tbin->ncached = rem; - if (tbin->ncached < tbin->low_water) + if ((int)tbin->ncached < tbin->low_water) tbin->low_water = tbin->ncached; } @@ -201,10 +226,14 @@ tcache_t * tcache_create(arena_t *arena) { tcache_t *tcache; - size_t size; + size_t size, stack_offset; unsigned i; size = offsetof(tcache_t, tbins) + (sizeof(tcache_bin_t) * nhbins); + /* Naturally align the pointer stacks. */ + size = PTR_CEILING(size); + stack_offset = size; + size += stack_nelms * sizeof(void *); /* * Round up to the nearest multiple of the cacheline size, in order to * avoid the possibility of false cacheline sharing. @@ -217,6 +246,8 @@ tcache_create(arena_t *arena) if (size <= small_maxclass) tcache = (tcache_t *)arena_malloc_small(arena, size, true); + else if (size <= tcache_maxclass) + tcache = (tcache_t *)arena_malloc_large(arena, size, true); else tcache = (tcache_t *)icalloc(size); @@ -233,15 +264,12 @@ tcache_create(arena_t *arena) tcache->arena = arena; assert((TCACHE_NSLOTS_SMALL_MAX & 1U) == 0); - for (i = 0; i < nbins; i++) { - if ((arena->bins[i].nregs << 1) <= TCACHE_NSLOTS_SMALL_MAX) { - tcache->tbins[i].ncached_max = (arena->bins[i].nregs << - 1); - } else - tcache->tbins[i].ncached_max = TCACHE_NSLOTS_SMALL_MAX; + for (i = 0; i < nhbins; i++) { + tcache->tbins[i].lg_fill_div = 1; + tcache->tbins[i].avail = (void **)((uintptr_t)tcache + + (uintptr_t)stack_offset); + stack_offset += tcache_bin_info[i].ncached_max * sizeof(void *); } - for (; i < nhbins; i++) - tcache->tbins[i].ncached_max = TCACHE_NSLOTS_LARGE; TCACHE_SET(tcache); @@ -252,6 +280,7 @@ void tcache_destroy(tcache_t *tcache) { unsigned i; + size_t tcache_size; #ifdef JEMALLOC_STATS /* Unlink from list of extant tcaches. */ @@ -308,7 +337,8 @@ tcache_destroy(tcache_t *tcache) } #endif - if (arena_salloc(tcache) <= small_maxclass) { + tcache_size = arena_salloc(tcache); + if (tcache_size <= small_maxclass) { arena_chunk_t *chunk = CHUNK_ADDR2BASE(tcache); arena_t *arena = chunk->arena; size_t pageind = ((uintptr_t)tcache - (uintptr_t)chunk) >> @@ -322,6 +352,13 @@ tcache_destroy(tcache_t *tcache) malloc_mutex_lock(&bin->lock); arena_dalloc_bin(arena, chunk, tcache, mapelm); malloc_mutex_unlock(&bin->lock); + } else if (tcache_size <= tcache_maxclass) { + arena_chunk_t *chunk = CHUNK_ADDR2BASE(tcache); + arena_t *arena = chunk->arena; + + malloc_mutex_lock(&arena->lock); + arena_dalloc_large(arena, chunk, tcache); + malloc_mutex_unlock(&arena->lock); } else idalloc(tcache); } @@ -378,11 +415,13 @@ tcache_stats_merge(tcache_t *tcache, arena_t *arena) } #endif -void +bool tcache_boot(void) { if (opt_tcache) { + unsigned i; + /* * If necessary, clamp opt_lg_tcache_max, now that * small_maxclass and arena_maxclass are known. @@ -397,6 +436,28 @@ tcache_boot(void) nhbins = nbins + (tcache_maxclass >> PAGE_SHIFT); + /* Initialize tcache_bin_info. */ + tcache_bin_info = (tcache_bin_info_t *)base_alloc(nhbins * + sizeof(tcache_bin_info_t)); + if (tcache_bin_info == NULL) + return (true); + stack_nelms = 0; + for (i = 0; i < nbins; i++) { + if ((arena_bin_info[i].nregs << 1) <= + TCACHE_NSLOTS_SMALL_MAX) { + tcache_bin_info[i].ncached_max = + (arena_bin_info[i].nregs << 1); + } else { + tcache_bin_info[i].ncached_max = + TCACHE_NSLOTS_SMALL_MAX; + } + stack_nelms += tcache_bin_info[i].ncached_max; + } + for (; i < nhbins; i++) { + tcache_bin_info[i].ncached_max = TCACHE_NSLOTS_LARGE; + stack_nelms += tcache_bin_info[i].ncached_max; + } + /* Compute incremental GC event threshold. */ if (opt_lg_tcache_gc_sweep >= 0) { tcache_gc_incr = ((1U << opt_lg_tcache_gc_sweep) / @@ -412,6 +473,8 @@ tcache_boot(void) abort(); } } + + return (false); } /******************************************************************************/ #endif /* JEMALLOC_TCACHE */ From 397d84488343c1c32e2253e9f51c6deedcb24e9b Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 13 Apr 2012 16:18:30 +0100 Subject: [PATCH 0529/1149] DB/SAI: Revert some mistakes in SAI db data (target_types were added to action_param6; contiguous fields) Please, don't do this error. --- sql/updates/world/2012_04_13_00_world_sai.sql | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sql/updates/world/2012_04_13_00_world_sai.sql diff --git a/sql/updates/world/2012_04_13_00_world_sai.sql b/sql/updates/world/2012_04_13_00_world_sai.sql new file mode 100644 index 00000000000..0fd4bdddd9b --- /dev/null +++ b/sql/updates/world/2012_04_13_00_world_sai.sql @@ -0,0 +1,25 @@ +UPDATE `smart_scripts` SET `target_type`=`action_param6` WHERE +(`entryorguid`=369200 AND `source_type`=9 AND `id`=3) OR +(`entryorguid`=369201 AND `source_type`=9 AND `id`=3) OR +(`entryorguid`=3692 AND `source_type`=0 AND `id`=2) OR +(`entryorguid`=3692 AND `source_type`=0 AND `id`=3) OR +(`entryorguid`=3584 AND `source_type`=0 AND `id`=3) OR +(`entryorguid`=3584 AND `source_type`=0 AND `id`=4) OR +(`entryorguid`=954600 AND `source_type`=9 AND `id`=2) OR +(`entryorguid`=954600 AND `source_type`=9 AND `id`=3) OR +(`entryorguid`=7207 AND `source_type`=0 AND `id`=1) OR +(`entryorguid`=7207 AND `source_type`=0 AND `id`=2) OR +(`entryorguid`=911700 AND `source_type`=9 AND `id`=3); + +UPDATE `smart_scripts` SET `action_param6`=0 WHERE +(`entryorguid`=369200 AND `source_type`=9 AND `id`=3) OR +(`entryorguid`=369201 AND `source_type`=9 AND `id`=3) OR +(`entryorguid`=3692 AND `source_type`=0 AND `id`=2) OR +(`entryorguid`=3692 AND `source_type`=0 AND `id`=3) OR +(`entryorguid`=3584 AND `source_type`=0 AND `id`=3) OR +(`entryorguid`=3584 AND `source_type`=0 AND `id`=4) OR +(`entryorguid`=954600 AND `source_type`=9 AND `id`=2) OR +(`entryorguid`=954600 AND `source_type`=9 AND `id`=3) OR +(`entryorguid`=7207 AND `source_type`=0 AND `id`=1) OR +(`entryorguid`=7207 AND `source_type`=0 AND `id`=2) OR +(`entryorguid`=911700 AND `source_type`=9 AND `id`=3); From 4b81de9d3a3578a7e6b9dad79cec709dc9fa0c83 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 13 Apr 2012 18:32:47 +0200 Subject: [PATCH 0530/1149] Core/Movement: Changed casting check in TargetedMovementGenerator to be able to freely manipulate cast+move interaction in scripts --- .../Movement/MovementGenerators/TargetedMovementGenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index eb61db8b4ba..fdff5a92564 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -135,7 +135,7 @@ bool TargetedMovementGeneratorMedium::Update(T &owner, const uint32 & time_ } // prevent movement while casting spells with cast time or channel time - if (owner.IsNonMeleeSpellCasted(false, false, true)) + if (owner.HasUnitState(UNIT_STATE_CASTING)) { if (!owner.IsStopped()) owner.StopMoving(); From c1ba60d68cdb1f3acf97a2b94fe336b35cf4c777 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 13 Apr 2012 12:41:36 -0400 Subject: [PATCH 0531/1149] DB: various db fixes from patches. authors are mentioned above the patches. closes #2169, closes #3344, closes #4162, closes #3530, closes #5982, closes #5849, closes #6098, closes #5569, closes #5493, closes #5510, closes #5470, closes #5408, closes #5406, closes #4875, closes #5457, closes #4467, closes #4043, closes #3899, closes #3859, closes #3518. signed off by nayd --- .../world/2012_04_13_01_world_misc.sql | 219 ++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 sql/updates/world/2012_04_13_01_world_misc.sql diff --git a/sql/updates/world/2012_04_13_01_world_misc.sql b/sql/updates/world/2012_04_13_01_world_misc.sql new file mode 100644 index 00000000000..fbcae4f3756 --- /dev/null +++ b/sql/updates/world/2012_04_13_01_world_misc.sql @@ -0,0 +1,219 @@ +-- Gnomish Playback Device (item 52709) Targeting condition -- by norfik closes #2169 +DELETE FROM `conditions` WHERE `SourceEntry`=74222 AND `ConditionValue1` IN (1268, 7955, 6119); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(17, 0, 74222, 1, 19, 1268, 0, 0, 63, '', 'Gnomish Playback Device on Ozzie Togglevolt'), +(17, 0, 74222, 2, 19, 7955, 0, 0, 63, '', 'Gnomish Playback Device on Milli Featherwhistle'), +(17, 0, 74222, 3, 19, 6119, 0, 0, 63, '', 'Gnomish Playback Device on Tog Rustsprocket'); + +-- fix revenge ap coeff -- by ric101 closes #3344 +UPDATE spell_bonus_data SET ap_bonus = 0.310 WHERE entry = 6572; + +-- fix life seed sp coeff -- by warpten closes #4162 +DELETE FROM `spell_bonus_data` WHERE `entry`=48503; +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(48503,0,0,0,0, 'Druid - Living Seed Heal'); + +-- fix glyph of shadowflame proc only allow on damage. by kandera closes #3530 +UPDATE `spell_proc_event` SET `procEx` = procEx|262144 WHERE`entry` = 63310; -- Glyph of shadowflame fix + +-- Disable deprecated quests /in 2.4/ from Midsummer Festival - The Festival of Fire {A/H} by trista closes #5982 +DELETE FROM `Disables` WHERE `sourceType` = 1 AND `entry` in (9367,9368); +INSERT INTO `Disables` (`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) VALUES +(1,9367,0,0,0,'Disable quest The Festival of Fire {A}/Deprecated after 2.4 Midsummer Festival revamp/'), +(1,9368,0,0,0,'Disable quest The Festival of Fire {H}/Deprecated after 2.4 Midsummer Festival revamp/'); + +-- fix gameobject spawn for just maces sign -- by mrsmite closes #5849 +DELETE FROM `gameobject` WHERE `guid` = 10714; +UPDATE `gameobject` SET `guid` = 10714 WHERE `guid` = 61895 AND `id` = 2157; + +-- update npc texts. by helias closes #6098 +DELETE FROM `npc_text` WHERE `ID` IN (10719,10782,10783,10787,10788,2838,9072,9110,10310,13293,13641,14089,15077,15155,15240,15412,15866,15873,15877,8663,8244,8254,8255,8282,8291,8296,8298,11093,3464,4776,4713,12130,13002,9984,12977,12978,10918,10999,10986,10991); +INSERT INTO `npc_text` (`ID`, `text0_0`, `text0_1`, `lang0`, `prob0`, `em0_0`, `em0_1`, `em0_2`, `em0_3`, `em0_4`, `em0_5`) VALUES +(10719, '$B$BWorry not, child. Look in your pack and you will find it once more.', NULL, 0, 1, 0, 0, 0, 0, 0, 0), +(10782, 'Sayoc, da ugly orc here, teach you daggers. You want teaching in other places, you talk to Ileda in da Farstrider Square of Silvermoon or Archibald in the War Quarter of Undercity, hokay?', 'Sayoc, da ugly orc here, teach you daggers. You want teaching in other places, you talk to Ileda in da Farstrider Square of Silvermoon or Archibald in the War Quarter of Undercity, hokay?', 1, 1, 0, 0, 0, 0, 0, 0), +(10783, 'You want to punch things, yah? Talk to Sayoc right here. He teach you.', 'You want to punch things, yah? Talk to Sayoc right here. He teach you.', 1, 1, 0, 0, 0, 0, 0, 0), +(10787, 'Ileda of da blood elves, in Farstrider Square of Silvermoon, train her students in both one and two-handed swords. Archibald, da Undercity"s weapon master, also train you, mon. He in da War Quarter.', 'Ileda of da blood elves, in Farstrider Square of Silvermoon, train her students in both one and two-handed swords. Archibald, da Undercity"s weapon master, also train you, mon. He in da War Quarter.', 1, 1, 0, 0, 0, 0, 0, 0), +(10788, 'Hanashi here knows staves. If you want a sturdier instructor, go to Thunder Bluff. Ansekhwa will teach you on the lower central rise there.', '', 1, 1, 0, 0, 0, 0, 0, 0), +(2838, '', 'Sure thing, $N. Here"s another for you.', 0, 1, 0, 0, 0, 0, 0, 0), +(9072, 'A search of the corpse"s clothing and equipment reveals the insignia you need, undamaged by the battle and foul environment.', '', 0, 1, 0, 0, 0, 0, 0, 0), +(9110, 'Say, you happen to see that arch in the lake to the west? I wonder where that goes? I should go divin" over there.', '', 0, 1, 0, 1, 0, 0, 0, 0), +(10310, 'You must be exalted with the blood elves before I will teach you a riding skill, $c.', '', 1, 1, 0, 1, 0, 0, 0, 0), +(13293, 'Please hurry, $N. I am in a great deal of pain and time is running out.', '', 0, 1, 0, 0, 0, 0, 0, 0), +(13641, '', '', 0, 1, 0, 0, 0, 0, 0, 0), +(14089, 'I"ve got a lead on Norgannon"s keystone, which guards access to Ulduar"s archives, but the Titans divided it into two pieces and secreted them away.$B$BOne of the pieces, the keystone"s shell, is held within the Inventor"s Library on the northern coast, south of Ulduar itself. The first thing you"ll need to do is retrieve the fragments of an access disk from the library"s guardians.', '', 0, 1, 0, 0, 0, 0, 0, 0), +(15077, 'There you are! I was beginning to think that the Sunreavers had intercepted you. Are you ready to deliver the tome to our representatives in Icecrown?', '', 0, 1, 0, 0, 0, 0, 0, 0), +(15155, 'These appear to be the remains of Thalorien Dawnseeker, the last wielder of Quel"Delar.', '', 0, 1, 0, 0, 0, 0, 0, 0), +(15240, 'I will escort you into the Sunwell when you"re ready.', 'I will escort you into the Sunwell when you"re ready.', 0, 1, 0, 0, 0, 0, 0, 0), +(15412, 'We got the final barrier blockin" entry to Frostwing Halls down, $g lad:lass;. Only Sindragosa stands between the Lich King and divine retribution! What are ye waitin" for?!', '', 0, 1, 0, 5, 0, 0, 0, 0), +(15866, 'De Darkspears have a home again! An" we couldn"t have done it wit"out ya helpin", $N. Now, we celebrate!', '', 0, 1, 0, 1, 0, 1, 0, 0), +(15873, 'Vol"jin told me ta keep hittin" da drum till he gets back. If ya be waitin" for him, he"d be back soon to take back da Isles.$B$BJust wait here and enjoy da music!', '', 0, 1, 0, 0, 0, 0, 0, 0), +(15877, 'We require da help of allies on da islands.$B$BZen"tabra has been watching over da animals of de Islands for some time now. We"d need her help and da help of da animal creatures.$B$BBwonsamdi is a powerful loa dat controls de spirits of de dead on da islands. His blessing is crucial for our attack.$B$BOnce our allies have joined us, Zalazane and his army of mind-controlled trolls will have no chance! Then, da Echo Isles will be de Darkspears!', '', 0, 1, 0, 0, 0, 0, 0, 0), +(8663, 'Thank you for delivering that list! My leg is almost recovered enough that I"ll be able to walk back to the crash site.', '', 0, 1, 0, 0, 0, 0, 0, 0), +(8244, 'We"ve been so wrapped up in this war, some of us forgot to make time for love.', '', 0, 1, 0, 0, 0, 0, 0, 0), +(8254, 'You work with machines for so long, sometimes you forget about real hearts.', '', 0, 1, 0, 0, 0, 0, 0, 0), +(8255, '', 'When you have lived as long as I, it becomes easy to forget about love for years. It is always good to be reminded.', 0, 1, 0, 0, 0, 0, 0, 0), +(8282, '', 'You look like you"ve had your heart broken. Come back when you"re not so sad.', 0, 1, 0, 25, 0, 153, 0, 0), +(8291, 'What, you don"t have a token to give me? Don"t you love me?', '', 0, 1, 0, 18, 0, 0, 0, 0), +(8296, 'It looks like you"ve already found love. You can give me a love token, but I"m not giving you anything nice. I"m waiting for someone special.', 'It looks like you"ve already found love. You can give me a love token, but I"m not giving you anything nice. I"m waiting for someone special.', 0, 1, 0, 1, 0, 0, 0, 0), +(8298, 'I"d like you better if you would apply some perfume.', 'I"d like you better if you would apply some perfume.', 0, 1, 0, 24, 0, 0, 0, 0), +(11093, 'Let"s get out of here!', '', 0, 1, 0, 5, 0, 0, 0, 0), +(3464, '', 'You do fine work, but it"s a bit rough around the edges. Don"t worry about it, it will come with practice. Speaking of which, how about we see what you"ve been working on?', 7, 1, 0, 0, 0, 0, 0, 0), +(4776, 'The battle is over, and the people of Darrowshire are saved.', '', 0, 1, 0, 0, 0, 0, 0, 0), +(4713, 'The Nightmare is finally over! Darrowshire, forgive me!', '', 0, 1, 0, 15, 0, 0, 0, 0), +(12130, '', '', 0, 1, 0, 0, 0, 0, 0, 0), +(13002, 'There ya go, mon. Try ta be more careful with this one, won"t ya?$b$bNow head down ta Drak"Zin Ruins and drink it near the pedestal!', NULL, 0, 1, 0, 0, 0, 0, 0, 0), +(9984, 'What are ye doin" here?! Get yer chatty self ta Alterac Vallery, where ye"re needed!', '', 7, 1, 1, 5, 0, 0, 0, 0), +(12977, 'Blight, Blight, Blight... that"s all I hear about around here. I miss the diversity!$b$bHere, here. You have pets, yes? Of course you do. Of course. Little pets. I have a mixture for them. It will make them ca-- ah, clever and strong creatures, yes. Yes. ', '', 1, 1, 396, 5, 0, 0, 0, 0), +(12978, 'Careful with it. It"s unstable and loses its potency quickly. Use it soon! And... preferably within eyesight, yes...', '', 1, 1, 5, 0, 0, 0, 0, 0), +(10918, 'The boy"s too stupid still to say it -- not enough crystal exposure yet -- but, he"s thankful for what you did in getting him those flasks.$B$BNow, only nine more sons to go. Gah!$B$B$B$BWant to take one of them off of our hands? We"ll sell him to you cheap.', '', 0, 1, 0, 1, 0, 5, 0, 6), +(10999, 'Friend! It"s been too long. What can we get for you?', '', 0, 1, 1, 1, 0, 0, 0, 0), +(10986, 'Our drinks should quench even the mightiest of thirsts.', '', 0, 1, 1, 396, 0, 0, 0, 0), +(10991, 'What can I say, $N? Yer the finest o" the Sha"tari Skyguard!$B$BJust don"t be lettin" that go ta yer head. I can still teach ya a thing or two, $G lad : lass;!$B$B', '', 0, 0, 0, 0, 0, 0, 0, 0); + +-- Fix Kor'kron War Rider flying by trista closes #5569 +UPDATE `creature_template` SET `inhabittype`=5,`speed_walk`=1, `speed_run`=1 WHERE `entry`=26813; + +-- Gretta the Arbiter (Storm Peaks, Brunhilldar) by mweinelt closes #5493 +-- Daily Quest Pooling +-- Source: http://www.wowwiki.com/Gretta_the_Arbiter +SET @pool_id := 354; + +DELETE FROM `pool_template` WHERE `entry` = @pool_id; +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(@pool_id, 1, 'Gretta the Arbiter - Daily Quests'); + +DELETE FROM `pool_quest` WHERE `entry` IN (13424, 13423, 13422, 13425); +INSERT INTO `pool_quest` (`entry`, `pool_entry`, `description`) VALUES +(13424, @pool_id, 'Back to the Pit'), +(13423, @pool_id, 'Defending Your Title'), +(13422, @pool_id, 'Maintaining Discipline'), +(13425, @pool_id, 'The Aberrations Must Die'); + +-- Pathing for Arzeth the Merciless Entry: 19354 by kiperr closes #5510 +SET @NPC := 69051; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-617.6182,`position_y`=4800.323,`position_z`=38.53064 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-546.5514,4799.893,33.83914,0,0,0,100,0), +(@PATH,2,-512.5808,4799.929,32.09928,0,0,0,100,0), +(@PATH,3,-480.9247,4799.97,28.25657,0,0,0,100,0), +(@PATH,4,-512.6269,4799.873,32.09928,0,0,0,100,0), +(@PATH,5,-542.1885,4799.724,33.71414,0,0,0,100,0), +(@PATH,6,-570.3811,4800.449,34.60215,0,0,0,100,0), +(@PATH,7,-592.3809,4800.299,35.85215,0,0,0,100,0), +(@PATH,8,-617.6182,4800.323,38.53064,0,0,0,100,0), +(@PATH,9,-659.4124,4799.819,49.09505,0,0,0,100,0), +(@PATH,10,-582.4199,4800.242,34.97715,0,0,0,100,0), +(@PATH,11,-546.5514,4799.893,33.83914,0,0,0,100,0), +(@PATH,12,-542.1885,4799.724,33.71414,0,0,0,100,0), +(@PATH,13,-570.3811,4800.449,34.60215,0,0,0,100,0), +(@PATH,14,-592.3809,4800.299,35.85215,0,0,0,100,0), +(@PATH,15,-617.6182,4800.323,38.53064,0,0,0,100,0), +(@PATH,16,-659.4124,4799.819,49.09505,0,0,0,100,0), +(@PATH,17,-512.5808,4799.929,32.09928,0,0,0,100,0), +(@PATH,18,-480.9247,4799.97,28.25657,0,0,0,100,0), +(@PATH,19,-512.6269,4799.873,32.09928,0,0,0,100,0), +(@PATH,20,-542.1885,4799.724,33.71414,0,0,0,100,0), +(@PATH,21,-570.3811,4800.449,34.60215,0,0,0,100,0), +(@PATH,22,-592.3809,4800.299,35.85215,0,0,0,100,0), +(@PATH,23,-617.6182,4800.323,38.53064,0,0,0,100,0), +(@PATH,24,-659.4124,4799.819,49.09505,0,0,0,100,0), +(@PATH,25,-582.4199,4800.242,34.97715,0,0,0,100,0), +(@PATH,26,-512.6269,4799.873,32.09928,0,0,0,100,0), +(@PATH,27,-542.1885,4799.724,33.71414,0,0,0,100,0), +(@PATH,28,-570.3811,4800.449,34.60215,0,0,0,100,0), +(@PATH,29,-592.3809,4800.299,35.85215,0,0,0,100,0), +(@PATH,30,-617.6182,4800.323,38.53064,0,0,0,100,0); + +-- Dark Portal - corrects the entry position and orientation by cdawg closes #5470 +UPDATE `areatrigger_teleport` SET `target_position_x`=-248.149292, `target_position_y`=921.874953, `target_position_z`=84.388448, `target_orientation`=1.584155 WHERE `id`=4354; + +-- Add pamphlets to mail loot by gecko32 closes #5408 +DELETE FROM `mail_loot_template` WHERE `entry` BETWEEN 224 AND 233; +INSERT INTO `mail_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES +(224, 46875, 100, 1, 0, 1, 1), -- Riding Training Pamphlet Elwynn Forest +(225, 46876, 100, 1, 0, 1, 1), -- Riding Training Pamphlet Darnassus +(226, 46877, 100, 1, 0, 1, 1), -- Riding Training Pamphlet Dun Morogh drawf +(227, 46879, 100, 1, 0, 1, 1), -- Riding Training Pamphlet Azuremyst Isle +(228, 46878, 100, 1, 0, 1, 1), -- Riding Training Pamphlet Dun Morogh gnome +(229, 46884, 100, 1, 0, 1, 1), -- Riding Training Pamphlet Mulgore +(230, 46883, 100, 1, 0, 1, 1), -- Riding Training Pamphlet Durator +(231, 46880, 100, 1, 0, 1, 1), -- Riding Training Pamphlet Orgrimmar +(232, 46882, 100, 1, 0, 1, 1), -- Riding Training Pamphlet Eversong Woods +(233, 46881, 100, 1, 0, 1, 1); -- Riding Training Pamphlet Tirisfal Glades + +-- fix coordinates for cannoneer whessan by mosoo closes #5406 +UPDATE `creature` SET `position_x`=-2093.53, `position_y`=-3496.47, `position_z`=130.084, `orientation`=3.008 WHERE `id`=3455 LIMIT 1; + +-- fix quest requirement for the last of her kind by shlomi 1515 closes #4875 +UPDATE `quest_template` SET `PrevQuestID` = 12900 WHERE `id` = 12983; + +-- Add rep reward to ICC25 Trash by gecko32 closes #5457 +DELETE FROM `creature_onkill_reputation` WHERE `creature_id` IN (37655,38031,38057,38058,38059,38061,38062,38063,38064,38072,38073,38074,38075,38076,38098,38099,38100,38101,38102,38103,38105,38108,38110,38126,38130,38131,38132,38133,38139,38151,38219,38220,38418,38445,38446,38479,38480,38481); +INSERT INTO `creature_onkill_reputation` (`creature_id`, `RewOnKillRepFaction1`, `RewOnKillRepFaction2`, `MaxStanding1`, `IsTeamAward1`, `RewOnKillRepValue1`, `MaxStanding2`, `IsTeamAward2`, `RewOnKillRepValue2`, `TeamDependent`) VALUES +(37655, 1156, 0, 7, 0, 45, 0, 0, 0, 0), -- Decaying colossus +(38031, 1156, 0, 7, 0, 45, 0, 0, 0, 0), -- Deathbound Ward +(38057, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Servant of the throne +(38058, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Nerub'ar Broodkeeper +(38059, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Ancient Skeletal Soldier +(38061, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- The Damned +(38062, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Plague Scientist +(38063, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Vengeful Fleshreaper +(38064, 1156, 0, 7, 0, 150, 0, 0, 0, 0), -- Stinky +(38072, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Deathspeacker Attedent +(38073, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Deathspeacker Disciple +(38074, 1156, 0, 7, 0, 45, 0, 0, 0, 0), -- Deathspeacker High Preist +(38075, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Deathspeacker Servant +(38076, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Deathspeacker Zealot +(38098, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Darkfallen Advisor +(38099, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Darkfallen Archmage +(38100, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Darkfallen Blood Knight +(38101, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Darkfallen Lieutenant +(38102, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Darkfallen Commander +(38103, 1156, 0, 7, 0, 150, 0, 0, 0, 0), -- Precious +(38105, 1156, 0, 7, 0, 2, 0, 0, 0, 0), -- Plagued Zombie +(38108, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Blighted Abomination +(38110, 1156, 0, 7, 0, 30, 0, 0, 0, 0), -- Pustulating Horror +(38126, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Ymirjar Frostbinder +(38130, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Ymirjar Deathbringer +(38131, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Ymirjar Huntress +(38132, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Ymirjar Battle-Maiden +(38133, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Ymirjar Warlord +(38139, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Frostwarden Handler +(38151, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Frostwing Whelp +(38219, 1156, 0, 7, 0, 150, 0, 0, 0, 0), -- Spinestalker +(38220, 1156, 0, 7, 0, 150, 0, 0, 0, 0), -- Rimefang +(38418, 1156, 0, 7, 0, 45, 0, 0, 0, 0), -- Val'kyr Herald +(38445, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Spire Minion +(38446, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Frenzied Abomination +(38479, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Darkfallen Tactician +(38480, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Darkfallen Noble +(38481, 1156, 0, 7, 0, 15, 0, 0, 0, 0); -- Spire Gargoyle + +-- fix procs by warpten closes #4467 for +-- Needle-Encrusted Scorpion +DELETE FROM `spell_proc_event` WHERE `entry`=71404; +INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`procFlags`,`procEx`,`ppmRate`,`CustomChance`,`Cooldown`) VALUES +(71404,0,0,0,0,0,0,2,0,0,50); + +-- Black Magic +DELETE FROM `spell_proc_event` WHERE `entry`=59630; +INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`procFlags`,`procEx`,`ppmRate`,`CustomChance`,`Cooldown`) VALUES +(59630,0,0,0,0,0,0,0,0,0,35); + +-- Environment Creature Hight Update by shlomi1515 closes #4043 +UPDATE `creature` SET `position_z`=558.210022 WHERE `guid` IN (85141,85143,85154,85153,85142,85151,85152,85150); +UPDATE `creature` SET `position_z`=586.302 WHERE `guid` IN (85145,85144,85146); +UPDATE `creature` SET `position_z`=586.263 WHERE `guid` IN (85147,85148,85149); + +-- fix winterskorn raider not landing by nayd closes #3899 +UPDATE `creature_template` SET `InhabitType`=`InhabitType`|1 WHERE `entry`=23665; + +-- fix head of onyxia's loot closes by kandera #3851 +UPDATE `item_template` SET `flags` = flags|4096 WHERE `entry` IN (18422,18423,49644,49643); + +-- fix visual for plagued dragonsflayer tribesman by shlomi1515 closes #3518 +DELETE FROM `creature_addon` WHERE `guid` = 97540; From 5466092d23a5e01c8edddb6a54390b4df96889b8 Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 13 Apr 2012 11:53:43 -0500 Subject: [PATCH 0532/1149] Core/Spells: Fixed Recklessness charges being dropped twice. Closes #932 --- src/server/game/Entities/Unit/Unit.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index eebfd25e3d4..8ecd22ec629 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -8200,6 +8200,16 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp CastCustomSpell(this, 70845, &basepoints0, NULL, NULL, true); break; } + // Recklessness + case 1719: + { + //! Possible hack alert + //! Don't drop charges on proc, they will be dropped on SpellMod removal + //! Before this change, it was dropping two charges per attack, one in ProcDamageAndSpellFor, and one in RemoveSpellMods. + //! The reason of this behaviour is Recklessness having three auras, 2 of them can not proc (isTriggeredAura array) but the other one can, making the whole spell proc. + *handled = true; + break; + } default: break; } From 3f796d4f9fba311c05da0bef430420524d8b5921 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 13 Apr 2012 13:07:17 -0400 Subject: [PATCH 0533/1149] SQL: fix a few mistakes in a previous commit --- sql/updates/world/2012_04_13_01_world_misc.sql | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sql/updates/world/2012_04_13_01_world_misc.sql b/sql/updates/world/2012_04_13_01_world_misc.sql index fbcae4f3756..e4d04449a3f 100644 --- a/sql/updates/world/2012_04_13_01_world_misc.sql +++ b/sql/updates/world/2012_04_13_01_world_misc.sql @@ -1,12 +1,12 @@ -- Gnomish Playback Device (item 52709) Targeting condition -- by norfik closes #2169 -DELETE FROM `conditions` WHERE `SourceEntry`=74222 AND `ConditionValue1` IN (1268, 7955, 6119); +DELETE FROM `conditions` WHERE `SourceEntry`=74222 AND `ConditionValue2` IN (1268, 7955, 6119); INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES -(17, 0, 74222, 1, 19, 1268, 0, 0, 63, '', 'Gnomish Playback Device on Ozzie Togglevolt'), -(17, 0, 74222, 2, 19, 7955, 0, 0, 63, '', 'Gnomish Playback Device on Milli Featherwhistle'), -(17, 0, 74222, 3, 19, 6119, 0, 0, 63, '', 'Gnomish Playback Device on Tog Rustsprocket'); +(17, 0, 74222, 1, 31, 3, 1268, 0, 63, '', 'Gnomish Playback Device on Ozzie Togglevolt'), +(17, 0, 74222, 2, 31, 3, 7955, 0, 63, '', 'Gnomish Playback Device on Milli Featherwhistle'), +(17, 0, 74222, 3, 31, 3, 6119, 0, 63, '', 'Gnomish Playback Device on Tog Rustsprocket'); -- fix revenge ap coeff -- by ric101 closes #3344 -UPDATE spell_bonus_data SET ap_bonus = 0.310 WHERE entry = 6572; +UPDATE `spell_bonus_data` SET `ap_bonus` = 0.310 WHERE `entry` = 6572; -- fix life seed sp coeff -- by warpten closes #4162 DELETE FROM `spell_bonus_data` WHERE `entry`=48503; @@ -17,8 +17,8 @@ INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus` UPDATE `spell_proc_event` SET `procEx` = procEx|262144 WHERE`entry` = 63310; -- Glyph of shadowflame fix -- Disable deprecated quests /in 2.4/ from Midsummer Festival - The Festival of Fire {A/H} by trista closes #5982 -DELETE FROM `Disables` WHERE `sourceType` = 1 AND `entry` in (9367,9368); -INSERT INTO `Disables` (`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) VALUES +DELETE FROM `disables` WHERE `sourceType` = 1 AND `entry` in (9367,9368); +INSERT INTO `disables` (`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) VALUES (1,9367,0,0,0,'Disable quest The Festival of Fire {A}/Deprecated after 2.4 Midsummer Festival revamp/'), (1,9368,0,0,0,'Disable quest The Festival of Fire {H}/Deprecated after 2.4 Midsummer Festival revamp/'); From c055a8617d4011395d7c2bfe39a8b475e65c5955 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 13 Apr 2012 19:53:42 +0200 Subject: [PATCH 0534/1149] Scripts/Icecrown Citadel * Fixed Professor Putricide Tear Gas stunning himself * Fixed visual of Unstable Experiment * Fixed oozes not picking new targets after hitting old * Fixed Gas Cloud not using melee attack * Removed ooze summon position hack Closes #4301 Closes #2726 Closes #5119 Closes #4464 Closes #2874 Closes #4407 Closes #2421 Closes #4899 --- .../world/2012_04_13_02_world_misc.sql | 18 ++ src/server/game/Entities/Unit/Unit.cpp | 9 +- src/server/game/Spells/SpellMgr.cpp | 6 +- .../boss_professor_putricide.cpp | 158 ++++++++++++------ .../shared/Database/DatabaseWorkerPool.h | 4 +- 5 files changed, 128 insertions(+), 67 deletions(-) create mode 100644 sql/updates/world/2012_04_13_02_world_misc.sql diff --git a/sql/updates/world/2012_04_13_02_world_misc.sql b/sql/updates/world/2012_04_13_02_world_misc.sql new file mode 100644 index 00000000000..7c71af78cd7 --- /dev/null +++ b/sql/updates/world/2012_04_13_02_world_misc.sql @@ -0,0 +1,18 @@ +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry` IN (38308,38309,37824); -- Professor Putricide triggers +UPDATE `creature_template` SET `ScriptName`='npc_gas_cloud' WHERE `entry`=37562; -- Gas Cloud +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_putricide_ooze_summon'; +DELETE FROM `spell_target_position` WHERE `id` IN (71413,71414); +INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES +(71414,631,4335.00,3206.75,389.399,0), +(71413,631,4380.43,3206.55,389.398,0); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (71615,71618,71412,71415); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`Comment`) VALUES +(13,4,71615,31,3,37690,'Putricide - Tear Gas on Slime Puddle'), +(13,1,71618,31,3,37562,'Putricide - Tear Gas on Gas Cloud'), +(13,2,71618,31,3,37697,'Putricide - Tear Gas on Volatile Ooze'), +(13,4,71618,31,3,38159,'Putricide - Tear Gas on Choking Gas Bomb'); + +UPDATE `spell_script_names` SET `ScriptName`='spell_putricide_clear_aura_effect_value' WHERE `ScriptName`='spell_putricide_clear_mutated_plague'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(71620,'spell_putricide_clear_aura_effect_value'); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 8ecd22ec629..0550e7bbfda 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7396,8 +7396,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere if (GetTypeId() != TYPEID_PLAYER || !victim || !victim->isAlive() || !castItem || !castItem->IsEquipped()) return false; - Player* player = ToPlayer(); - WeaponAttackType attType = WeaponAttackType(player->GetAttackBySlot(castItem->GetSlot())); + WeaponAttackType attType = WeaponAttackType(Player::GetAttackBySlot(castItem->GetSlot())); if ((attType != BASE_ATTACK && attType != OFF_ATTACK) || (attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK) || (attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK)) @@ -7985,11 +7984,7 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp for (uint8 i = 1; i < stack; ++i) dmg += mod * stack; if (Unit* caster = triggeredByAura->GetCaster()) - { caster->CastCustomSpell(70701, SPELLVALUE_BASE_POINT0, dmg); - if (Creature* creature = caster->ToCreature()) - creature->DespawnOrUnsummon(1); - } break; } // Ball of Flames Proc @@ -17576,7 +17571,7 @@ bool Unit::SetWalk(bool enable) return true; } -bool Unit::SetDisableGravity(bool disable, bool packetOnly /*= false*/) +bool Unit::SetDisableGravity(bool disable, bool /*packetOnly = false*/) { if (disable == IsLevitating()) return false; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 80ed1972a5d..05431ef0a16 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3347,9 +3347,9 @@ void SpellMgr::LoadDbcDataCorrections() case 70460: // Coldflame Jets (Traps after Saurfang) spellInfo->DurationIndex = 1; // 10 seconds break; - case 71413: // Green Ooze Summon (Professor Putricide) - case 71414: // Orange Ooze Summon (Professor Putricide) - spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_DEST; + case 71412: // Green Ooze Summon (Professor Putricide) + case 71415: // Orange Ooze Summon (Professor Putricide) + spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_TARGET_ANY; break; case 71159: // Awaken Plagued Zombies spellInfo->DurationIndex = 21; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index 541e52fb922..273f2a20b4b 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -64,6 +64,9 @@ enum Spells SPELL_MALLEABLE_GOO = 70852, SPELL_UNSTABLE_EXPERIMENT = 70351, SPELL_TEAR_GAS = 71617, // phase transition + SPELL_TEAR_GAS_CREATURE = 71618, + SPELL_TEAR_GAS_CANCEL = 71620, + SPELL_TEAR_GAS_PERIODIC_TRIGGER = 73170, SPELL_CREATE_CONCOCTION = 71621, SPELL_GUZZLE_POTIONS = 71893, SPELL_OOZE_TANK_PROTECTION = 71770, // protects the tank @@ -86,6 +89,7 @@ enum Spells SPELL_GASEOUS_BLOAT_PROC = 70215, SPELL_GASEOUS_BLOAT = 70672, SPELL_GASEOUS_BLOAT_PROTECTION = 70812, + SPELL_EXPUNGED_GAS = 70701, // Volatile Ooze SPELL_OOZE_ERUPTION = 70492, @@ -595,13 +599,15 @@ class boss_professor_putricide : public CreatureScript break; case EVENT_TEAR_GAS: me->GetMotionMaster()->MovePoint(POINT_TABLE, tablePos); + DoCast(me, SPELL_TEAR_GAS_PERIODIC_TRIGGER, true); break; case EVENT_RESUME_ATTACK: me->SetReactState(REACT_DEFENSIVE); AttackStart(me->getVictim()); // remove Tear Gas + me->RemoveAurasDueToSpell(SPELL_TEAR_GAS_PERIODIC_TRIGGER); instance->DoRemoveAurasDueToSpellOnPlayers(71615); - instance->DoRemoveAurasDueToSpellOnPlayers(71618); + DoCastAOE(SPELL_TEAR_GAS_CANCEL); instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_GAS_VARIABLE); instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_OOZE_VARIABLE); break; @@ -699,27 +705,36 @@ class npc_volatile_ooze : public CreatureScript public: npc_volatile_ooze() : CreatureScript("npc_volatile_ooze") { } - struct npc_volatile_oozeAI : public ScriptedAI + struct npc_putricide_oozeAI : public ScriptedAI { - npc_volatile_oozeAI(Creature* creature) : ScriptedAI(creature) + npc_putricide_oozeAI(Creature* creature) : ScriptedAI(creature) { _newTargetSelectTimer = 0; } void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) { - if (!_newTargetSelectTimer && sSpellMgr->GetSpellDifficultyId(spell->Id) == sSpellMgr->GetSpellDifficultyId(SPELL_OOZE_ERUPTION)) + if (!_newTargetSelectTimer && spell->Id == sSpellMgr->GetSpellIdForDifficulty(SPELL_OOZE_ERUPTION, me)) + _newTargetSelectTimer = 1000; + } + + void SpellHit(Unit* /*caster*/, SpellInfo const* spell) + { + if (spell->Id == SPELL_TEAR_GAS_CREATURE) _newTargetSelectTimer = 1000; } void UpdateAI(uint32 const diff) { - if (!UpdateVictim()) + if (!UpdateVictim() && !_newTargetSelectTimer) return; if (!_newTargetSelectTimer) return; + if (me->HasAura(SPELL_TEAR_GAS_CREATURE)) + return; + if (_newTargetSelectTimer <= diff) { _newTargetSelectTimer = 0; @@ -730,13 +745,68 @@ class npc_volatile_ooze : public CreatureScript } private: - // no need to use EventMap for just one event uint32 _newTargetSelectTimer; }; CreatureAI* GetAI(Creature* creature) const { - return GetIcecrownCitadelAI(creature); + return GetIcecrownCitadelAI(creature); + } +}; + +class npc_gas_cloud : public CreatureScript +{ + public: + npc_gas_cloud() : CreatureScript("npc_gas_cloud") { } + + struct npc_gas_cloudAI : public ScriptedAI + { + npc_gas_cloudAI(Creature* creature) : ScriptedAI(creature) + { + _newTargetSelectTimer = 0; + } + + void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) + { + if (!_newTargetSelectTimer && spell->Id == sSpellMgr->GetSpellIdForDifficulty(SPELL_EXPUNGED_GAS, me)) + _newTargetSelectTimer = 1000; + } + + void SpellHit(Unit* /*caster*/, SpellInfo const* spell) + { + if (spell->Id == SPELL_TEAR_GAS_CREATURE) + _newTargetSelectTimer = 1000; + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim() && !_newTargetSelectTimer) + return; + + DoMeleeAttackIfReady(); + + if (!_newTargetSelectTimer) + return; + + if (me->HasAura(SPELL_TEAR_GAS_CREATURE)) + return; + + if (_newTargetSelectTimer <= diff) + { + _newTargetSelectTimer = 0; + me->CastCustomSpell(SPELL_GASEOUS_BLOAT, SPELLVALUE_AURA_STACK, 10, me, false); + } + else + _newTargetSelectTimer -= diff; + } + + private: + uint32 _newTargetSelectTimer; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetIcecrownCitadelAI(creature); } }; @@ -755,8 +825,8 @@ class spell_putricide_gaseous_bloat : public SpellScriptLoader if (Unit* caster = GetCaster()) { target->RemoveAuraFromStack(GetSpellInfo()->Id, GetCasterGUID()); - if (!target->HasAura(GetId())&& caster->GetTypeId() == TYPEID_UNIT) - caster->ToCreature()->DespawnOrUnsummon(); + if (!target->HasAura(GetId())) + caster->CastCustomSpell(SPELL_GASEOUS_BLOAT, SPELLVALUE_AURA_STACK, 10, caster, false); } } @@ -823,7 +893,19 @@ class spell_putricide_ooze_channel : public SpellScriptLoader void StartAttack() { GetCaster()->ClearUnitState(UNIT_STATE_CASTING); + GetCaster()->DeleteThreatList(); GetCaster()->ToCreature()->AI()->AttackStart(GetHitUnit()); + GetCaster()->AddThreat(GetHitUnit(), 500000000.0f); // value seen in sniff + } + + // temporary, until SelectTarget are not called on empty lists + void CheckTarget() + { + if (_target) + return; + + FinishCast(SPELL_FAILED_NO_VALID_TARGETS); + GetCaster()->ToCreature()->DespawnOrUnsummon(1); // despawn next update } void Register() @@ -832,6 +914,7 @@ class spell_putricide_ooze_channel : public SpellScriptLoader OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_ooze_channel_SpellScript::SetTarget, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_ooze_channel_SpellScript::SetTarget, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY); AfterHit += SpellHitFn(spell_putricide_ooze_channel_SpellScript::StartAttack); + OnCast += SpellCastFn(spell_putricide_ooze_channel_SpellScript::CheckTarget); } Unit* _target; @@ -931,13 +1014,13 @@ class spell_putricide_unstable_experiment : public SpellScriptLoader uint32 stage = GetCaster()->ToCreature()->AI()->GetData(DATA_EXPERIMENT_STAGE); Creature* target = NULL; std::list creList; - GetCreatureListWithEntryInGrid(creList, GetCaster(), NPC_ABOMINATION_WING_MAD_SCIENTIST_STALKER, 100.0f); + GetCreatureListWithEntryInGrid(creList, GetCaster(), NPC_ABOMINATION_WING_MAD_SCIENTIST_STALKER, 200.0f); // 2 of them are spawned at green place - weird trick blizz for (std::list::iterator itr = creList.begin(); itr != creList.end(); ++itr) { target = *itr; std::list tmp; - GetCreatureListWithEntryInGrid(tmp, target, NPC_ABOMINATION_WING_MAD_SCIENTIST_STALKER, 1.0f); + GetCreatureListWithEntryInGrid(tmp, target, NPC_ABOMINATION_WING_MAD_SCIENTIST_STALKER, 10.0f); if ((!stage && tmp.size() > 1) || (stage && tmp.size() == 1)) break; } @@ -957,42 +1040,6 @@ class spell_putricide_unstable_experiment : public SpellScriptLoader } }; -class spell_putricide_ooze_summon : public SpellScriptLoader -{ - public: - spell_putricide_ooze_summon() : SpellScriptLoader("spell_putricide_ooze_summon") { } - - class spell_putricide_ooze_summon_AuraScript : public AuraScript - { - PrepareAuraScript(spell_putricide_ooze_summon_AuraScript); - - void HandleTriggerSpell(AuraEffect const* aurEff) - { - PreventDefaultAction(); - if (Unit* caster = GetCaster()) - { - uint32 triggerSpellId = GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell; - float x, y, z; - GetTarget()->GetPosition(x, y, z); - z = GetTarget()->GetMap()->GetHeight(GetTarget()->GetPhaseMask(), x, y, z, true, 25.0f); - x += 10.0f * cosf(caster->GetOrientation()); - y += 10.0f * sinf(caster->GetOrientation()); - caster->CastSpell(x, y, z, triggerSpellId, true, NULL, NULL, GetCasterGUID()); - } - } - - void Register() - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_putricide_ooze_summon_AuraScript::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); - } - }; - - AuraScript* GetAuraScript() const - { - return new spell_putricide_ooze_summon_AuraScript(); - } -}; - class spell_putricide_ooze_eruption_searcher : public SpellScriptLoader { public: @@ -1455,14 +1502,15 @@ class spell_putricide_regurgitated_ooze : public SpellScriptLoader } }; -class spell_putricide_clear_mutated_plague : public SpellScriptLoader +// Removes aura with id stored in effect value +class spell_putricide_clear_aura_effect_value : public SpellScriptLoader { public: - spell_putricide_clear_mutated_plague() : SpellScriptLoader("spell_putricide_clear_mutated_plague") { } + spell_putricide_clear_aura_effect_value() : SpellScriptLoader("spell_putricide_clear_aura_effect_value") { } - class spell_putricide_clear_mutated_plague_SpellScript : public SpellScript + class spell_putricide_clear_aura_effect_value_SpellScript : public SpellScript { - PrepareSpellScript(spell_putricide_clear_mutated_plague_SpellScript); + PrepareSpellScript(spell_putricide_clear_aura_effect_value_SpellScript); void HandleScript(SpellEffIndex effIndex) { @@ -1473,13 +1521,13 @@ class spell_putricide_clear_mutated_plague : public SpellScriptLoader void Register() { - OnEffectHitTarget += SpellEffectFn(spell_putricide_clear_mutated_plague_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffectHitTarget += SpellEffectFn(spell_putricide_clear_aura_effect_value_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; SpellScript* GetSpellScript() const { - return new spell_putricide_clear_mutated_plague_SpellScript(); + return new spell_putricide_clear_aura_effect_value_SpellScript(); } }; @@ -1518,12 +1566,12 @@ void AddSC_boss_professor_putricide() { new boss_professor_putricide(); new npc_volatile_ooze(); + new npc_gas_cloud(); new spell_putricide_gaseous_bloat(); new spell_putricide_ooze_channel(); new spell_putricide_slime_puddle(); new spell_putricide_slime_puddle_aura(); new spell_putricide_unstable_experiment(); - new spell_putricide_ooze_summon(); new spell_putricide_ooze_eruption_searcher(); new spell_putricide_choking_gas_bomb(); new spell_putricide_unbound_plague(); @@ -1534,6 +1582,6 @@ void AddSC_boss_professor_putricide() new spell_putricide_mutated_transformation(); new spell_putricide_mutated_transformation_dmg(); new spell_putricide_regurgitated_ooze(); - new spell_putricide_clear_mutated_plague(); + new spell_putricide_clear_aura_effect_value(); new spell_stinky_precious_decimate(); } diff --git a/src/server/shared/Database/DatabaseWorkerPool.h b/src/server/shared/Database/DatabaseWorkerPool.h index 8b69accfc23..314d196cc06 100755 --- a/src/server/shared/Database/DatabaseWorkerPool.h +++ b/src/server/shared/Database/DatabaseWorkerPool.h @@ -102,7 +102,7 @@ class DatabaseWorkerPool //! Shuts down delaythreads for this connection pool by underlying deactivate(). //! The next dequeue attempt in the worker thread tasks will result in an error, - //! ultimately ending the worker thread task. + //! ultimately ending the worker thread task. _queue->queue()->close(); for (uint8 i = 0; i < _connectionCount[IDX_ASYNC]; ++i) @@ -114,7 +114,7 @@ class DatabaseWorkerPool t->Close(); //! Closes the actualy MySQL connection. } - sLog->outSQLDriver("Asynchronous connections on DatabasePool '%s' terminated. Proceeding with synchronous connections.", + sLog->outSQLDriver("Asynchronous connections on DatabasePool '%s' terminated. Proceeding with synchronous connections.", GetDatabaseName()); //! Shut down the synchronous connections From b9c50a8b6ee4335a98518a7329fe94133e5ee69b Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 13 Apr 2012 13:36:28 -0500 Subject: [PATCH 0535/1149] Core/Spells: Prevent Siphon Life from proccing on Corruption apply. Closes #6150 Signed-off-by: Subv --- src/server/game/Entities/Unit/Unit.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 0550e7bbfda..536f99019b0 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6000,6 +6000,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Siphon Life case 63108: { + if (!damage) + break; // Glyph of Siphon Life if (HasAura(56216)) triggerAmount += triggerAmount / 4; From a28742bffeca3764468b3f307a86c14e2f3e3607 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 13 Apr 2012 20:50:34 +0100 Subject: [PATCH 0536/1149] Core/BG: When starting a battleground teleport the player to start location if it goes outside of the allowed "waiting" area (for example, getting out of the "bubble" in EotS) Allowed waiting area is calculated as the distance specified in database (battleground_template.StartMaxDist) and the battleground start point for each team A distance of 0 is ignored (not used in SotA nor arenas) The values in DB might need some tweaks, open a pull request if you calculate better ones Closes #180 Initial patch and idea by Rat Also added validation (DBError log) to some fields in battleground_template table --- .../world/2012_04_13_02_world_bg_template.sql | 7 ++++ .../game/Battlegrounds/Battleground.cpp | 37 +++++++++++++++++-- src/server/game/Battlegrounds/Battleground.h | 4 ++ .../game/Battlegrounds/BattlegroundMgr.cpp | 28 ++++++++------ .../game/Battlegrounds/BattlegroundMgr.h | 1 + src/server/game/Miscellaneous/SharedDefines.h | 28 +++++++------- 6 files changed, 77 insertions(+), 28 deletions(-) create mode 100644 sql/updates/world/2012_04_13_02_world_bg_template.sql diff --git a/sql/updates/world/2012_04_13_02_world_bg_template.sql b/sql/updates/world/2012_04_13_02_world_bg_template.sql new file mode 100644 index 00000000000..a426d7c6831 --- /dev/null +++ b/sql/updates/world/2012_04_13_02_world_bg_template.sql @@ -0,0 +1,7 @@ +ALTER TABLE `battleground_template` ADD `StartMaxDist` float NOT NULL DEFAULT 0 AFTER `HordeStartO`; + +UPDATE `battleground_template` SET `StartMaxDist`=200 WHERE `id`=30; -- IC +UPDATE `battleground_template` SET `StartMaxDist`=100 WHERE `id`=1; -- AV +UPDATE `battleground_template` SET `StartMaxDist`=75 WHERE `id` IN (2,3,7); -- WSG, AB, EotS + +UPDATE `battleground_template` SET `MinLvl`=1 WHERE `id`=32; diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index d6bfde021e7..d3348fd21d1 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -144,6 +144,7 @@ Battleground::Battleground() m_Winner = 2; m_StartTime = 0; m_ResetStatTimer = 0; + m_ValidStartPositionTimer = 0; m_Events = 0; m_IsRated = false; m_BuffChange = false; @@ -177,6 +178,8 @@ Battleground::Battleground() m_ArenaTeamIds[BG_TEAM_ALLIANCE] = 0; m_ArenaTeamIds[BG_TEAM_HORDE] = 0; + m_StartMaxDist = 0.0f; + m_ArenaTeamRatingChanges[BG_TEAM_ALLIANCE] = 0; m_ArenaTeamRatingChanges[BG_TEAM_HORDE] = 0; @@ -291,6 +294,7 @@ void Battleground::Update(uint32 diff) // Update start time and reset stats timer m_StartTime += diff; m_ResetStatTimer += diff; + m_ValidStartPositionTimer += diff; PostUpdateImpl(diff); } @@ -453,19 +457,19 @@ inline void Battleground::_ProcessJoin(uint32 diff) // First start warning - 2 or 1 minute SendMessageToAll(StartMessageIds[BG_STARTING_EVENT_FIRST], CHAT_MSG_BG_SYSTEM_NEUTRAL); } - // After 1 minute or 30 seconds, warning is signalled + // After 1 minute or 30 seconds, warning is signaled else if (GetStartDelayTime() <= StartDelayTimes[BG_STARTING_EVENT_SECOND] && !(m_Events & BG_STARTING_EVENT_2)) { m_Events |= BG_STARTING_EVENT_2; SendMessageToAll(StartMessageIds[BG_STARTING_EVENT_SECOND], CHAT_MSG_BG_SYSTEM_NEUTRAL); } - // After 30 or 15 seconds, warning is signalled + // After 30 or 15 seconds, warning is signaled else if (GetStartDelayTime() <= StartDelayTimes[BG_STARTING_EVENT_THIRD] && !(m_Events & BG_STARTING_EVENT_3)) { m_Events |= BG_STARTING_EVENT_3; SendMessageToAll(StartMessageIds[BG_STARTING_EVENT_THIRD], CHAT_MSG_BG_SYSTEM_NEUTRAL); } - // Delay expired (atfer 2 or 1 minute) + // Delay expired (after 2 or 1 minute) else if (GetStartDelayTime() <= 0 && !(m_Events & BG_STARTING_EVENT_4)) { m_Events |= BG_STARTING_EVENT_4; @@ -526,6 +530,33 @@ inline void Battleground::_ProcessJoin(uint32 diff) sWorld->SendWorldText(LANG_BG_STARTED_ANNOUNCE_WORLD, GetName(), GetMinLevel(), GetMaxLevel()); } } + + // Find if the player left our start zone; if so, teleport it back + if (m_ValidStartPositionTimer > 1000) + { + m_ValidStartPositionTimer = 0; + float maxDist = GetStartMaxDist(); + if (maxDist > 0.0f) + { + for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) + { + if (Player *plr = ObjectAccessor::FindPlayer(itr->first)) + { + float x, y, z, o; + uint32 team = plr->GetBGTeam(); + GetTeamStartLoc(team, x, y, z, o); + + float dist = plr->GetDistance(x, y, z); + + if (dist >= maxDist) + { + sLog->outError("BATTLEGROUND: Sending %s back to start location (possible exploit)", plr->GetName()); + plr->TeleportTo(GetMapId(), x, y, z, o); + } + } + } + } + } } inline void Battleground::_ProcessLeave(uint32 diff) diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index 32f6ebc92de..01dfbb23033 100755 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -443,6 +443,8 @@ class Battleground Z = m_TeamStartLocZ[idx]; O = m_TeamStartLocO[idx]; } + void SetStartMaxDist(float startMaxDist) { m_StartMaxDist = startMaxDist; } + float GetStartMaxDist() const { return m_StartMaxDist; } // Packet Transfer // method that should fill worldpacket with actual world states (not yet implemented for all battlegrounds!) @@ -617,6 +619,7 @@ class Battleground uint32 m_ClientInstanceID; // the instance-id which is sent to the client and without any other internal use uint32 m_StartTime; uint32 m_ResetStatTimer; + uint32 m_ValidStartPositionTimer; int32 m_EndTime; // it is set to 120000 when bg is ending and it decreases itself uint32 m_LastResurrectTime; BattlegroundBracketId m_BracketId; @@ -698,6 +701,7 @@ class Battleground float m_TeamStartLocY[BG_TEAMS_COUNT]; float m_TeamStartLocZ[BG_TEAMS_COUNT]; float m_TeamStartLocO[BG_TEAMS_COUNT]; + float m_StartMaxDist; uint32 ScriptId; }; #endif diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index e1b99cbdcb9..a106f11ae82 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -660,6 +660,7 @@ uint32 BattlegroundMgr::CreateBattleground(CreateBattlegroundData& data) bg->SetName(data.BattlegroundName); bg->SetTeamStartLoc(ALLIANCE, data.Team1StartLocX, data.Team1StartLocY, data.Team1StartLocZ, data.Team1StartLocO); bg->SetTeamStartLoc(HORDE, data.Team2StartLocX, data.Team2StartLocY, data.Team2StartLocZ, data.Team2StartLocO); + bg->SetStartMaxDist(data.StartMaxDist); bg->SetLevelRange(data.LevelMin, data.LevelMax); bg->SetScriptId(data.scriptId); @@ -677,8 +678,8 @@ void BattlegroundMgr::CreateInitialBattlegrounds() uint8 selectionWeight; BattlemasterListEntry const* bl; - // 0 1 2 3 4 5 6 7 8 9 10 - QueryResult result = WorldDatabase.Query("SELECT id, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl, AllianceStartLoc, AllianceStartO, HordeStartLoc, HordeStartO, Weight, ScriptName FROM battleground_template"); + // 0 1 2 3 4 5 6 7 8 9 10 11 + QueryResult result = WorldDatabase.Query("SELECT id, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl, AllianceStartLoc, AllianceStartO, HordeStartLoc, HordeStartO, StartMaxDist, Weight, ScriptName FROM battleground_template"); if (!result) { @@ -712,17 +713,20 @@ void BattlegroundMgr::CreateInitialBattlegrounds() data.MaxPlayersPerTeam = fields[2].GetUInt16(); data.LevelMin = fields[3].GetUInt8(); data.LevelMax = fields[4].GetUInt8(); - //check values from DB - if (data.MaxPlayersPerTeam == 0 || data.MinPlayersPerTeam == 0 || data.MinPlayersPerTeam > data.MaxPlayersPerTeam) + + // check values from DB + if (data.MaxPlayersPerTeam == 0 || data.MinPlayersPerTeam > data.MaxPlayersPerTeam) { - data.MinPlayersPerTeam = 0; // by default now expected strong full bg requirement - data.MaxPlayersPerTeam = 40; + sLog->outErrorDb("Table `battleground_template` for id %u has bad values for MinPlayersPerTeam (%u) and MaxPlayersPerTeam(%u)", + data.bgTypeId, data.MinPlayersPerTeam, data.MaxPlayersPerTeam); + continue; } + if (data.LevelMin == 0 || data.LevelMax == 0 || data.LevelMin > data.LevelMax) { - //TO-DO: FIX ME - data.LevelMin = 0;//bl->minlvl; - data.LevelMax = 80;//bl->maxlvl; + sLog->outErrorDb("Table `battleground_template` for id %u has bad values for LevelMin (%u) and LevelMax(%u)", + data.bgTypeId, data.LevelMin, data.LevelMax); + continue; } startId = fields[5].GetUInt32(); @@ -767,8 +771,10 @@ void BattlegroundMgr::CreateInitialBattlegrounds() continue; } - selectionWeight = fields[9].GetUInt8(); - data.scriptId = sObjectMgr->GetScriptId(fields[10].GetCString()); + data.StartMaxDist = fields[9].GetFloat(); + + selectionWeight = fields[10].GetUInt8(); + data.scriptId = sObjectMgr->GetScriptId(fields[11].GetCString()); data.BattlegroundName = bl->name[sWorld->GetDefaultDbcLocale()]; data.MapID = bl->mapid[0]; diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.h b/src/server/game/Battlegrounds/BattlegroundMgr.h index 88559d07993..7afb83da0a6 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.h +++ b/src/server/game/Battlegrounds/BattlegroundMgr.h @@ -50,6 +50,7 @@ struct CreateBattlegroundData float Team2StartLocY; float Team2StartLocZ; float Team2StartLocO; + float StartMaxDist; uint32 scriptId; }; diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 22f0ea35413..0386e6b4214 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -3294,20 +3294,20 @@ enum BanReturn // indexes of BattlemasterList.dbc enum BattlegroundTypeId { - BATTLEGROUND_TYPE_NONE = 0, - BATTLEGROUND_AV = 1, - BATTLEGROUND_WS = 2, - BATTLEGROUND_AB = 3, - BATTLEGROUND_NA = 4, - BATTLEGROUND_BE = 5, - BATTLEGROUND_AA = 6, - BATTLEGROUND_EY = 7, - BATTLEGROUND_RL = 8, - BATTLEGROUND_SA = 9, - BATTLEGROUND_DS = 10, - BATTLEGROUND_RV = 11, - BATTLEGROUND_IC = 30, - BATTLEGROUND_RB = 32 + BATTLEGROUND_TYPE_NONE = 0, // None + BATTLEGROUND_AV = 1, // Alterac Valley + BATTLEGROUND_WS = 2, // Warsong Gulch + BATTLEGROUND_AB = 3, // Arathi Basin + BATTLEGROUND_NA = 4, // Nagrand Arena + BATTLEGROUND_BE = 5, // Blade's Edge Arena + BATTLEGROUND_AA = 6, // All Arenas + BATTLEGROUND_EY = 7, // Eye of the Storm + BATTLEGROUND_RL = 8, // Ruins of Lordaernon + BATTLEGROUND_SA = 9, // Strand of the Ancients + BATTLEGROUND_DS = 10, // Dalaran Sewers + BATTLEGROUND_RV = 11, // Ring of Valor + BATTLEGROUND_IC = 30, // Isle of Conquest + BATTLEGROUND_RB = 32 // Random Battleground }; #define MAX_BATTLEGROUND_TYPE_ID 33 From ba957e6a0e5861abb4d80a6ca7a4d4da0b15163e Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 13 Apr 2012 18:31:18 -0500 Subject: [PATCH 0537/1149] Core/Spells: Reapply glyph bonuses that depend on stance when you shapeshift into that instance Closes #1076 and possibly others Signed-off-by: Subv --- .../game/Spells/Auras/SpellAuraEffects.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 1ad6fe557f9..a1bb14b3e16 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1474,6 +1474,23 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const if (spellInfo->Stances & (1<<(GetMiscValue()-1))) target->CastSpell(target, itr->first, true, NULL, this); } + + // Also do it for Glyphs + for (uint32 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i) + { + if (uint32 glyphId = target->ToPlayer()->GetGlyph(i)) + { + if (GlyphPropertiesEntry const* glyph = sGlyphPropertiesStore.LookupEntry(glyphId)) + { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(glyph->SpellId); + if (!spellInfo || !(spellInfo->Attributes & (SPELL_ATTR0_PASSIVE | SPELL_ATTR0_HIDDEN_CLIENTSIDE))) + continue; + if (spellInfo->Stances & (1<<(GetMiscValue()-1))) + target->CastSpell(target, glyph->SpellId, true, NULL, this); + } + } + } + // Leader of the Pack if (target->ToPlayer()->HasSpell(17007)) { From 98e184799970a74b436a8040f24c27c9abb96dc4 Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 13 Apr 2012 18:58:27 -0500 Subject: [PATCH 0538/1149] Player/Items: Fix the item durations when the item is stored in a bag different than the default backpack Closes #1026 Signed-off-by: Subv --- src/server/game/Entities/Player/Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 26ea7c110d2..25429a18eec 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -17657,7 +17657,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) ItemPosCountVec dest; err = CanStoreItem(itr->second->GetSlot(), slot, dest, item); if (err == EQUIP_ERR_OK) - itr->second->StoreItem(slot, item, true); + item = StoreItem(dest, item, true); } } From eeb237f55d5d6e1e5d654de1dccc8a6ba2313b64 Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 13 Apr 2012 19:33:20 -0500 Subject: [PATCH 0539/1149] Core/Spells: Add 45 seconds proc cooldown to Blackened Naaru Silver. Closes #1509 Signed-off-by: Subv --- sql/updates/world/2012_04_13_03_world_spell_proc_event.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2012_04_13_03_world_spell_proc_event.sql diff --git a/sql/updates/world/2012_04_13_03_world_spell_proc_event.sql b/sql/updates/world/2012_04_13_03_world_spell_proc_event.sql new file mode 100644 index 00000000000..3ea68187687 --- /dev/null +++ b/sql/updates/world/2012_04_13_03_world_spell_proc_event.sql @@ -0,0 +1,4 @@ +-- Blackened Naaru Silver proc cooldown +DELETE FROM `spell_proc_event` WHERE `entry`=45355; +INSERT INTO `spell_proc_event`(`entry`,`schoolmask`,`spellfamilyname`,`spellfamilymask0`,`spellfamilymask1`,`spellfamilymask2`,`procflags`,`procex`,`ppmrate`,`customchance`,`cooldown`) VALUES +(45355,0,0,0,0,0,0,0,0,0,45); \ No newline at end of file From 63ec9f22998948b4cf2af4450b2d41ce398bfc96 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 14 Apr 2012 11:09:40 +0200 Subject: [PATCH 0540/1149] Core/Player: Send calendar raid lockout remove before removing player from instance save (may invalidate instance save) --- src/server/game/Entities/Player/Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 25429a18eec..53bafbd4521 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -18318,10 +18318,10 @@ void Player::UnbindInstance(BoundInstancesMap::iterator &itr, Difficulty difficu CharacterDatabase.Execute(stmt); } - itr->second.save->RemovePlayer(this); // save can become invalid if (itr->second.perm) GetSession()->SendCalendarRaidLockout(itr->second.save, false); + itr->second.save->RemovePlayer(this); // save can become invalid m_boundInstances[difficulty].erase(itr++); } } From f51b62979f79fb9a404faad7b719d51a69358ae7 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 14 Apr 2012 11:15:12 +0200 Subject: [PATCH 0541/1149] SQL: Renamed files to match the order they were commited in. --- ..._world_bg_template.sql => 2012_04_13_03_world_bg_template.sql} | 0 ...ll_proc_event.sql => 2012_04_13_04_world_spell_proc_event.sql} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename sql/updates/world/{2012_04_13_02_world_bg_template.sql => 2012_04_13_03_world_bg_template.sql} (100%) rename sql/updates/world/{2012_04_13_03_world_spell_proc_event.sql => 2012_04_13_04_world_spell_proc_event.sql} (100%) diff --git a/sql/updates/world/2012_04_13_02_world_bg_template.sql b/sql/updates/world/2012_04_13_03_world_bg_template.sql similarity index 100% rename from sql/updates/world/2012_04_13_02_world_bg_template.sql rename to sql/updates/world/2012_04_13_03_world_bg_template.sql diff --git a/sql/updates/world/2012_04_13_03_world_spell_proc_event.sql b/sql/updates/world/2012_04_13_04_world_spell_proc_event.sql similarity index 100% rename from sql/updates/world/2012_04_13_03_world_spell_proc_event.sql rename to sql/updates/world/2012_04_13_04_world_spell_proc_event.sql From efdf2ede304a27461b3a901a59e0510721082849 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sat, 14 Apr 2012 14:45:32 +0200 Subject: [PATCH 0542/1149] DB/Loot: add Bogblossom to Bogblossom object, thx Helias Closes #5922 --- .../world/2012_04_14_00_world_gameobject_loot_template.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2012_04_14_00_world_gameobject_loot_template.sql diff --git a/sql/updates/world/2012_04_14_00_world_gameobject_loot_template.sql b/sql/updates/world/2012_04_14_00_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..dea4b771068 --- /dev/null +++ b/sql/updates/world/2012_04_14_00_world_gameobject_loot_template.sql @@ -0,0 +1,3 @@ +-- Add Bogblossom to this Bogblossom object for the druid quest (other one already contains it) +DELETE FROM `gameobject_loot_template` WHERE (`entry`=10961) AND (`item`=31950); +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES (10961,31950,-100,0,0,1,1); From 0ec7016ccac555545598aac9464ba7f26659dafd Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 14 Apr 2012 08:23:23 -0500 Subject: [PATCH 0543/1149] Core/Spells: Corrected logic check for SPELL_ATTR4_IGNORE_RESISTANCES Signed-off-by: Subv --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 536f99019b0..52078922021 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1542,7 +1542,7 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe // Magic damage, check for resists // Ignore spells that cant be resisted - if ((schoolMask & SPELL_SCHOOL_MASK_NORMAL) == 0 && (spellInfo && (spellInfo->AttributesEx4 & SPELL_ATTR4_IGNORE_RESISTANCES) == 0)) + if ((schoolMask & SPELL_SCHOOL_MASK_NORMAL) == 0 && (!spellInfo || (spellInfo->AttributesEx4 & SPELL_ATTR4_IGNORE_RESISTANCES) == 0) { float victimResistance = float(victim->GetResistance(schoolMask)); victimResistance += float(GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, schoolMask)); From ca6c8845b22c7009e9b096369ed62670e05a9ba1 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sat, 14 Apr 2012 15:30:40 +0200 Subject: [PATCH 0544/1149] DB/Loot: Add some missing loot definitions to prevent some startup errors --- .../2012_04_14_01_world_gameobject_loot_template.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 sql/updates/world/2012_04_14_01_world_gameobject_loot_template.sql diff --git a/sql/updates/world/2012_04_14_01_world_gameobject_loot_template.sql b/sql/updates/world/2012_04_14_01_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..a3dd0c39865 --- /dev/null +++ b/sql/updates/world/2012_04_14_01_world_gameobject_loot_template.sql @@ -0,0 +1,11 @@ +-- Add missing gameobject_loot_templates to prevent startup errors +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (3458,3459,3460,3461,15920,16841,26878,27725); +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(3458,4594,100,0,0,1,1), -- Rockscale Cod on Feast Fish +(3459,3771,100,0,0,1,1), -- Wild Hog Shank On Feast Boar +(3460,4538,100,0,0,1,1), -- Snapvine Watermelon on Feast Fruit +(3461,1708,100,0,0,1,1), -- Sweet Nectar on Feast Goblet +(15920,17822,-100,0,0,1,1), -- Weird Map on weird object +(16841,18950,-100,0,0,1,1), -- Chambermaid Pillaclenchers Pillow on Pillaclencher's Ornate Pillow +(26878,45062,100,0,0,1,1), -- Dusty Journal on Dusty Journal (different ID) +(27725,49648,100,0,0,1,1); -- Borrowed Tabard on Clean Laundry (might need condition!) From 0d90f7c25790f06fba8eafc6a035e36a938d1f52 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 14 Apr 2012 08:44:19 -0500 Subject: [PATCH 0545/1149] Fixed build from my previous commit --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 52078922021..200f1b42ca7 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1542,7 +1542,7 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe // Magic damage, check for resists // Ignore spells that cant be resisted - if ((schoolMask & SPELL_SCHOOL_MASK_NORMAL) == 0 && (!spellInfo || (spellInfo->AttributesEx4 & SPELL_ATTR4_IGNORE_RESISTANCES) == 0) + if ((schoolMask & SPELL_SCHOOL_MASK_NORMAL) == 0 && (!spellInfo || (spellInfo->AttributesEx4 & SPELL_ATTR4_IGNORE_RESISTANCES) == 0)) { float victimResistance = float(victim->GetResistance(schoolMask)); victimResistance += float(GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, schoolMask)); From ab8e69873c23ca48f981930d443509225792a070 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 14 Apr 2012 10:17:21 -0500 Subject: [PATCH 0546/1149] Core/Spells: Fixed Bloodworm's heal effect and damage Closes #1808 Thanks @A-Metaphysical-Drama for the damage part Signed-off-by: Subv --- .../world/2012_04_14_02_world_creature_template_addon.sql | 3 +++ src/server/game/Entities/Pet/Pet.cpp | 7 +++++++ src/server/game/Entities/Unit/StatSystem.cpp | 2 ++ 3 files changed, 12 insertions(+) create mode 100644 sql/updates/world/2012_04_14_02_world_creature_template_addon.sql diff --git a/sql/updates/world/2012_04_14_02_world_creature_template_addon.sql b/sql/updates/world/2012_04_14_02_world_creature_template_addon.sql new file mode 100644 index 00000000000..6aaa7da383e --- /dev/null +++ b/sql/updates/world/2012_04_14_02_world_creature_template_addon.sql @@ -0,0 +1,3 @@ +UPDATE `creature_template_addon` SET `auras`='50453' WHERE `entry`=28017; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=28017; +UPDATE `creature_template` SET `ainame` = '' WHERE `entry`=28017; \ No newline at end of file diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index fcb89e33dc1..586f09bd79c 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -1041,6 +1041,13 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4))); break; } + case 28017: // Bloodworms + { + SetCreateHealth(4 * petlevel); + SetBonusDamage(int32(m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * 0.006f)); + SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - 30 - (petlevel / 4))); + SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel - 30 + (petlevel / 4))); + } } break; } diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 69771129ac9..2da1c1b88cb 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -1068,6 +1068,7 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType) #define ENTRY_TREANT 1964 #define ENTRY_FIRE_ELEMENTAL 15438 #define ENTRY_GHOUL 26125 +#define ENTRY_BLOODWORM 28017 bool Guardian::UpdateStats(Stats stat) { @@ -1229,6 +1230,7 @@ void Guardian::UpdateMaxHealth() case ENTRY_SUCCUBUS: multiplicator = 9.1f; break; case ENTRY_FELHUNTER: multiplicator = 9.5f; break; case ENTRY_FELGUARD: multiplicator = 11.0f; break; + case ENTRY_BLOODWORM: multiplicator = 1.0f; break; default: multiplicator = 10.0f; break; } From a3bdaf7e6d614f081ddc073aa6cec3e158f8617f Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 14 Apr 2012 17:49:51 +0200 Subject: [PATCH 0547/1149] Core/Scripts: Added support for creating custom GameObjectAI classes, similar to how creature scripts work. --- src/server/game/AI/CreatureAISelector.cpp | 3 +++ src/server/game/Scripting/ScriptMgr.cpp | 8 ++++++++ src/server/game/Scripting/ScriptMgr.h | 5 +++++ .../scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp | 1 - 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/server/game/AI/CreatureAISelector.cpp b/src/server/game/AI/CreatureAISelector.cpp index ebe14c0d7d0..1a0c6652e74 100755 --- a/src/server/game/AI/CreatureAISelector.cpp +++ b/src/server/game/AI/CreatureAISelector.cpp @@ -133,6 +133,9 @@ namespace FactorySelector const GameObjectAICreator* ai_factory = NULL; GameObjectAIRegistry& ai_registry(*GameObjectAIRepository::instance()); + if (GameObjectAI* scriptedAI = sScriptMgr->GetGameObjectAI(go)) + return scriptedAI; + ai_factory = ai_registry.GetRegistryItem(go->GetAIName()); //future goAI types go here diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index aac615180c8..9de0951c5ef 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -954,6 +954,14 @@ bool ScriptMgr::OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effInd return tmpscript->OnDummyEffect(caster, spellId, effIndex, target); } +GameObjectAI* ScriptMgr::GetGameObjectAI(GameObject* go) +{ + ASSERT(go); + + GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, NULL); + tmpscript->GetAI(go); +} + bool ScriptMgr::OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger) { ASSERT(player); diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 3b65a5cf256..6fe058d336a 100755 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -39,6 +39,7 @@ class Creature; class CreatureAI; class DynamicObject; class GameObject; +class GameObjectAI; class Guild; class GridMap; class Group; @@ -471,6 +472,9 @@ class GameObjectScript : public ScriptObject, public UpdatableScript // Called when the game object is damaged (destructible buildings only). virtual void OnDamaged(GameObject* /*go*/, Player* /*player*/) { } + + // Called when a GameObjectAI object is needed for the gameobject. + virtual GameObjectAI* GetAI(GameObject* /*go*/) const { return NULL; } }; class AreaTriggerScript : public ScriptObject @@ -911,6 +915,7 @@ class ScriptMgr void OnGameObjectDestroyed(GameObject* go, Player* player); void OnGameObjectDamaged(GameObject* go, Player* player); void OnGameObjectUpdate(GameObject* go, uint32 diff); + GameObjectAI* GetGameObjectAI(GameObject* go); public: /* AreaTriggerScript */ diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index e12393f047f..22858cf69e5 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -234,7 +234,6 @@ class instance_ulduar : public InstanceMapScript case NPC_ALGALON: AlgalonGUID = creature->GetGUID(); break; - // Hodir's Helper NPCs case NPC_EIVI_NIGHTFEATHER: if (TeamInInstance == HORDE) From b7a9db16d6051889d3a6fb38d10db5e8a672b7ed Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 14 Apr 2012 11:14:38 -0500 Subject: [PATCH 0548/1149] Spells/Bonus: Fixed spell power bonus of Lava Burst, taken from DrDamage and verified Closes #1819 --- sql/updates/world/2012_04_14_03_world_spell_bonus_data.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2012_04_14_03_world_spell_bonus_data.sql diff --git a/sql/updates/world/2012_04_14_03_world_spell_bonus_data.sql b/sql/updates/world/2012_04_14_03_world_spell_bonus_data.sql new file mode 100644 index 00000000000..ee081c17078 --- /dev/null +++ b/sql/updates/world/2012_04_14_03_world_spell_bonus_data.sql @@ -0,0 +1 @@ +UPDATE `spell_bonus_data` SET `direct_bonus`=0.8930 WHERE `entry`=51505; From 4f14693ef29402c6cfdab38879f9722235e4e1a9 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 14 Apr 2012 18:26:16 +0200 Subject: [PATCH 0549/1149] Core/Scripts: Corrected previous commit and added a few AI hooks to GameObjectAI --- src/server/game/AI/CoreAI/GameObjectAI.h | 23 ++++++++++++--------- src/server/game/AI/SmartScripts/SmartAI.cpp | 2 +- src/server/game/AI/SmartScripts/SmartAI.h | 2 +- src/server/game/Scripting/ScriptMgr.cpp | 2 +- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/server/game/AI/CoreAI/GameObjectAI.h b/src/server/game/AI/CoreAI/GameObjectAI.h index b9d385ba675..f4555649210 100644 --- a/src/server/game/AI/CoreAI/GameObjectAI.h +++ b/src/server/game/AI/CoreAI/GameObjectAI.h @@ -33,21 +33,24 @@ class GameObjectAI explicit GameObjectAI(GameObject* g) : go(g) {} virtual ~GameObjectAI() {} - virtual void UpdateAI(const uint32 /*diff*/) {} + virtual void UpdateAI(uint32 /*diff*/) {} virtual void InitializeAI() { Reset(); } virtual void Reset() {}; - static int Permissible(const GameObject* go); + static int Permissible(GameObject const* go); - virtual bool GossipHello(Player* /*player*/) {return false;} - virtual bool GossipSelect(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/) {return false;} - virtual bool GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/) {return false;} - virtual bool QuestAccept(Player* /*player*/, Quest const* /*quest*/) {return false;} - virtual bool QuestReward(Player* /*player*/, Quest const* /*quest*/, uint32 /*opt*/) {return false;} - virtual uint32 GetDialogStatus(Player* /*player*/) {return 100;} + virtual bool GossipHello(Player* /*player*/) { return false; } + virtual bool GossipSelect(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/) { return false; } + virtual bool GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, char const* /*code*/) { return false; } + virtual bool QuestAccept(Player* /*player*/, Quest const* /*quest*/) { return false; } + virtual bool QuestReward(Player* /*player*/, Quest const* /*quest*/, uint32 /*opt*/) { return false; } + virtual uint32 GetDialogStatus(Player* /*player*/) { return 100; } virtual void Destroyed(Player* /*player*/, uint32 /*eventId*/) {} + virtual uint32 GetData(uint32 /*id*/) { return 0; } + virtual void SetData64(uint32 /*id*/, uint64 /*value*/) {} + virtual uint64 GetData64(uint32 /*id*/) { return 0; } virtual void SetData(uint32 /*id*/, uint32 /*value*/) {} virtual void OnGameEvent(bool /*start*/, uint16 /*eventId*/) {} virtual void OnStateChanged(uint32 /*state*/, Unit* /*unit*/) { } @@ -58,8 +61,8 @@ class NullGameObjectAI : public GameObjectAI public: explicit NullGameObjectAI(GameObject* g); - void UpdateAI(const uint32 /*diff*/) {} + void UpdateAI(uint32 /*diff*/) {} - static int Permissible(const GameObject* /*go*/) { return PERMIT_BASE_IDLE; } + static int Permissible(GameObject const* /*go*/) { return PERMIT_BASE_IDLE; } }; #endif diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 4eb7f8a7f50..2a412bffb22 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -854,7 +854,7 @@ int SmartGameObjectAI::Permissible(const GameObject* g) return PERMIT_BASE_NO; } -void SmartGameObjectAI::UpdateAI(const uint32 diff) +void SmartGameObjectAI::UpdateAI(uint32 diff) { GetScript()->OnUpdate(diff); } diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h index 94e5e65cf8b..bfd1c7b9d41 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.h +++ b/src/server/game/AI/SmartScripts/SmartAI.h @@ -239,7 +239,7 @@ public: SmartGameObjectAI(GameObject* g) : GameObjectAI(g), go(g) {} ~SmartGameObjectAI() {} - void UpdateAI(const uint32 diff); + void UpdateAI(uint32 diff); void InitializeAI(); void Reset(); SmartScript* GetScript() { return &mScript; } diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 9de0951c5ef..01d56cf8060 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -959,7 +959,7 @@ GameObjectAI* ScriptMgr::GetGameObjectAI(GameObject* go) ASSERT(go); GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, NULL); - tmpscript->GetAI(go); + return tmpscript->GetAI(go); } bool ScriptMgr::OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger) From 06278fe7fb2698fa3ff62eec3e84baebcb62a4ce Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 14 Apr 2012 12:01:07 -0500 Subject: [PATCH 0550/1149] Spells/Procs: Fixed Sacred Shield 6 seconds internal cooldown. Thanks @Warpten P.D.: You were using the wrong spellid Closes #1711 --- sql/updates/world/2012_04_14_04_world_spell_proc_event.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2012_04_14_04_world_spell_proc_event.sql diff --git a/sql/updates/world/2012_04_14_04_world_spell_proc_event.sql b/sql/updates/world/2012_04_14_04_world_spell_proc_event.sql new file mode 100644 index 00000000000..78a869e655a --- /dev/null +++ b/sql/updates/world/2012_04_14_04_world_spell_proc_event.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_proc_event` WHERE `entry`=53601; +INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`procFlags`,`procEx`,`ppmRate`,`CustomChance`,`Cooldown`) VALUES +(53601, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0, 0, 6); From 8c3d0e23689f8cbe4f4d7381dd9ebe9a905adfa8 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 14 Apr 2012 14:07:31 -0500 Subject: [PATCH 0551/1149] Core/Spells: Dont remove auras on stance change if the stance you are moving to is also allowed by the spell. Closes #2758 Signed-off-by: Subv --- .../game/Spells/Auras/SpellAuraEffects.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index a1bb14b3e16..dbbd89c7533 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1600,10 +1600,25 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const } } + const Unit::AuraEffectList& shapeshifts = target->GetAuraEffectsByType(SPELL_AURA_MOD_SHAPESHIFT); + AuraEffect* newAura = NULL; + // Iterate through all the shapeshift auras that the target has, if there is another aura with SPELL_AURA_MOD_SHAPESHIFT, then this aura is being removed due to that one being applied + for (Unit::AuraEffectList::const_iterator itr = shapeshifts.begin(); itr != shapeshifts.end(); ++itr) + { + if ((*itr) != this) + { + newAura = *itr; + break; + } + } Unit::AuraApplicationMap& tAuras = target->GetAppliedAuras(); for (Unit::AuraApplicationMap::iterator itr = tAuras.begin(); itr != tAuras.end();) { - if (itr->second->GetBase()->IsRemovedOnShapeLost(target)) + // Use the new aura to see on what stance the target will be + uint32 newStance = (1<<((newAura ? newAura->GetMiscValue() : 0)-1)); + + // If the stances are not compatible with the spell, remove it + if (itr->second->GetBase()->IsRemovedOnShapeLost(target) && !(itr->second->GetBase()->GetSpellInfo()->Stances & newStance)) target->RemoveAura(itr); else ++itr; From 8a33ddc010a4be4a181191d2b8b06dee611a1a9c Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 15 Apr 2012 01:30:50 +0200 Subject: [PATCH 0552/1149] Core/BG: Fix a logic mistake in ResetStat timer It should only be executed every 5 seconds, not in every update --- src/server/game/Battlegrounds/Battleground.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index d3348fd21d1..44192a74123 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -426,7 +426,7 @@ inline void Battleground::_ProcessJoin(uint32 diff) // ********************************************************* ModifyStartDelayTime(diff); - if (m_ResetStatTimer <= 5000) + if (m_ResetStatTimer > 5000) { m_ResetStatTimer = 0; for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) From 3d8aaabaf3f4c627a583ff8c5a611a7b02400931 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 14 Apr 2012 20:03:47 -0500 Subject: [PATCH 0553/1149] Core/Spells: Do not proc spells with PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_(NEG|POS) if there is no target, reimplemented Storm, Earth and Fire talent in another way Closes #3367 Closes #2424 If you find more spells that are broken because of this, please notify us Signed-off-by: Subv --- .../2012_04_14_05_world_spell_proc_event.sql | 1 + src/server/game/Entities/Unit/Unit.cpp | 14 --------- src/server/game/Spells/Spell.cpp | 30 ------------------- src/server/scripts/Spells/spell_shaman.cpp | 19 ++++++++++++ 4 files changed, 20 insertions(+), 44 deletions(-) create mode 100644 sql/updates/world/2012_04_14_05_world_spell_proc_event.sql diff --git a/sql/updates/world/2012_04_14_05_world_spell_proc_event.sql b/sql/updates/world/2012_04_14_05_world_spell_proc_event.sql new file mode 100644 index 00000000000..8cb2b1d3d2b --- /dev/null +++ b/sql/updates/world/2012_04_14_05_world_spell_proc_event.sql @@ -0,0 +1 @@ +DELETE FROM `spell_proc_event` WHERE `entry` IN (51486,51485,51483); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 200f1b42ca7..4da56b72017 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7356,20 +7356,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere triggered_spell_id = 63685; break; } - // Storm, Earth and Fire - if (dummySpell->SpellIconID == 3063) - { - // Earthbind Totem summon only - if (procSpell->Id != 2484) - return false; - - float chance = (float)triggerAmount; - if (!roll_chance_f(chance)) - return false; - - triggered_spell_id = 64695; - break; - } // Ancestral Awakening if (dummySpell->SpellIconID == 3065) { diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index af3f53e2369..df2b9c35320 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3427,36 +3427,6 @@ void Spell::_handle_immediate_phase() // process items for (std::list::iterator ihit= m_UniqueItemInfo.begin(); ihit != m_UniqueItemInfo.end(); ++ihit) DoAllEffectOnTarget(&(*ihit)); - - if (!m_originalCaster) - return; - // Handle procs on cast - // TODO: finish new proc system:P - if (m_UniqueTargetInfo.empty()) - { - uint32 procAttacker = m_procAttacker; - if (!procAttacker) - { - bool positive = m_spellInfo->IsPositive(); - switch (m_spellInfo->DmgClass) - { - case SPELL_DAMAGE_CLASS_MAGIC: - if (positive) - procAttacker |= PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS; - else - procAttacker |= PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG; - break; - case SPELL_DAMAGE_CLASS_NONE: - if (positive) - procAttacker |= PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS; - else - procAttacker |= PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG; - break; - } - } - // Proc damage for spells which have only dest targets (2484 should proc 51486 for example) - m_originalCaster->ProcDamageAndSpell(NULL, procAttacker, 0, m_procEx | PROC_EX_NORMAL_HIT, 0, BASE_ATTACK, m_spellInfo, m_triggeredByAuraSpell); - } } void Spell::_handle_finish_phase() diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 1a0f4576fea..84e3bd8d604 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -35,6 +35,9 @@ enum ShamanSpells SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1 = 8349, SHAMAN_SPELL_SATED = 57724, SHAMAN_SPELL_EXHAUSTION = 57723, + + SHAMAN_SPELL_STORM_EARTH_AND_FIRE = 51483, + EARTHBIND_TOTEM_SPELL_EARTHGRAB = 64695, // For Earthen Power SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM = 6474, @@ -221,9 +224,25 @@ class spell_sha_earthbind_totem : public SpellScriptLoader caster->CastSpell(caster, SHAMAN_TOTEM_SPELL_EARTHEN_POWER, true, NULL, aurEff); } + void Apply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (!GetCaster()) + return; + Player* owner = GetCaster()->GetCharmerOrOwnerPlayerOrPlayerItself(); + if (!owner) + return; + // Storm, Earth and Fire + if (AuraEffect* aurEff = owner->GetAuraEffectOfRankedSpell(SHAMAN_SPELL_STORM_EARTH_AND_FIRE, EFFECT_1)) + { + if (roll_chance_i(aurEff->GetAmount())) + GetCaster()->CastSpell(GetCaster(), EARTHBIND_TOTEM_SPELL_EARTHGRAB, false); + } + } + void Register() { OnEffectPeriodic += AuraEffectPeriodicFn(spell_sha_earthbind_totem_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + OnEffectApply += AuraEffectApplyFn(spell_sha_earthbind_totem_AuraScript::Apply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL); } }; From c7eeb0b59c6c2b9419c2fb3fc81ae74301404c7c Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 15 Apr 2012 09:30:34 -0500 Subject: [PATCH 0554/1149] Scripts/Commands: Make the .modify reputation command only modify the specified reputation (ignore spillovers) Patch by @ogeraisi --- src/server/scripts/Commands/cs_modify.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 32ee96dacfe..70f44dd05d0 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1234,7 +1234,7 @@ public: return false; } - target->GetReputationMgr().SetReputation(factionEntry, amount); + target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount); handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name[handler->GetSessionDbcLocale()], factionId, handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry)); return true; From f7e0aedaf05e3edb1445d304cadf9c22931d9e2f Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 15 Apr 2012 09:45:51 -0500 Subject: [PATCH 0555/1149] Fixed broken compile --- src/server/scripts/Commands/cs_modify.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 70f44dd05d0..bb3a4d65b76 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1234,7 +1234,7 @@ public: return false; } - target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount); + target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount, false); handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name[handler->GetSessionDbcLocale()], factionId, handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry)); return true; From 39b3589dcb543f5ba6703d6ea2324dc5318f18b4 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 15 Apr 2012 17:41:37 +0200 Subject: [PATCH 0556/1149] Fixed Fixed broken compile --- src/server/game/Reputation/ReputationMgr.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/game/Reputation/ReputationMgr.h b/src/server/game/Reputation/ReputationMgr.h index 401503783b9..a073845ea73 100755 --- a/src/server/game/Reputation/ReputationMgr.h +++ b/src/server/game/Reputation/ReputationMgr.h @@ -132,6 +132,9 @@ class ReputationMgr void ApplyForceReaction(uint32 faction_id, ReputationRank rank, bool apply); + //! Public for chat command needs + bool SetOneFactionReputation(FactionEntry const* factionEntry, int32 standing, bool incremental); + public: // senders void SendInitialReputations(); void SendForceReactions(); @@ -142,7 +145,6 @@ class ReputationMgr void Initialize(); uint32 GetDefaultStateFlags(FactionEntry const* factionEntry) const; bool SetReputation(FactionEntry const* factionEntry, int32 standing, bool incremental); - bool SetOneFactionReputation(FactionEntry const* factionEntry, int32 standing, bool incremental); void SetVisible(FactionState* faction); void SetAtWar(FactionState* faction, bool atWar) const; void SetInactive(FactionState* faction, bool inactive) const; From bcffd87950c15ed0c1f8cf6003ae21f72b809f5e Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Mon, 16 Apr 2012 15:50:01 +0200 Subject: [PATCH 0557/1149] [DB/GameEvent] Add missing Game Event - Pilgrim's Bounty --- sql/updates/world/2012_04_16_00_world_game_event.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2012_04_16_00_world_game_event.sql diff --git a/sql/updates/world/2012_04_16_00_world_game_event.sql b/sql/updates/world/2012_04_16_00_world_game_event.sql new file mode 100644 index 00000000000..1dc3fe3ad91 --- /dev/null +++ b/sql/updates/world/2012_04_16_00_world_game_event.sql @@ -0,0 +1,4 @@ +SET @Event = 26; -- Pilgrim's Bounty +DELETE FROM `game_event` WHERE `eventEntry`=@Event; +INSERT INTO `game_event` (`eventEntry`,`start_time`,`end_time`,`occurence`,`length`,`holiday`,`description`,`world_event`) VALUES +(@Event,'2012-11-18 01:00:00','2020-12-31 05:00:00',525600,10020,404,'Pilgrim\'s Bounty',0); From 413cfac9532d1b8d32b0eeb4c9d1b0972127a352 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 16 Apr 2012 11:40:29 -0400 Subject: [PATCH 0558/1149] Core/NPC: add essence infused moonstone, key to the focusing iris (and hc) to the list of keys gettable from locksmith npcs. (per aokromes) --- src/server/scripts/World/npcs_special.cpp | 48 +++++++++++++++++++---- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 6858827ed8e..61b997bba35 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -2400,6 +2400,9 @@ enum eLockSmith QUEST_HOTTER_THAN_HELL_H = 10764, QUEST_RETURN_TO_KHAGDAR = 9837, QUEST_CONTAINMENT = 13159, + QUEST_ETERNAL_VIGILANCE = 11011, + QUEST_KEY_TO_THE_FOCUSING_IRIS = 13372, + QUEST_HC_KEY_TO_THE_FOCUSING_IRIS = 13375, ITEM_ARCATRAZ_KEY = 31084, ITEM_SHADOWFORGE_KEY = 11000, @@ -2407,21 +2410,28 @@ enum eLockSmith ITEM_SHATTERED_HALLS_KEY = 28395, ITEM_THE_MASTERS_KEY = 24490, ITEM_VIOLET_HOLD_KEY = 42482, + ITEM_ESSENCE_INFUSED_MOONSTONE = 32449, + ITEM_KEY_TO_THE_FOCUSING_IRIS = 44582, + ITEM_HC_KEY_TO_THE_FOCUSING_IRIS = 44581, SPELL_ARCATRAZ_KEY = 54881, SPELL_SHADOWFORGE_KEY = 54882, SPELL_SKELETON_KEY = 54883, SPELL_SHATTERED_HALLS_KEY = 54884, SPELL_THE_MASTERS_KEY = 54885, - SPELL_VIOLET_HOLD_KEY = 67253 + SPELL_VIOLET_HOLD_KEY = 67253, + SPELL_ESSENCE_INFUSED_MOONSTONE = 40173, }; -#define GOSSIP_LOST_ARCATRAZ_KEY "I've lost my key to the Arcatraz." -#define GOSSIP_LOST_SHADOWFORGE_KEY "I've lost my key to the Blackrock Depths." -#define GOSSIP_LOST_SKELETON_KEY "I've lost my key to the Scholomance." -#define GOSSIP_LOST_SHATTERED_HALLS_KEY "I've lost my key to the Shattered Halls." -#define GOSSIP_LOST_THE_MASTERS_KEY "I've lost my key to the Karazhan." -#define GOSSIP_LOST_VIOLET_HOLD_KEY "I've lost my key to the Violet Hold." +#define GOSSIP_LOST_ARCATRAZ_KEY "I've lost my key to the Arcatraz." +#define GOSSIP_LOST_SHADOWFORGE_KEY "I've lost my key to the Blackrock Depths." +#define GOSSIP_LOST_SKELETON_KEY "I've lost my key to the Scholomance." +#define GOSSIP_LOST_SHATTERED_HALLS_KEY "I've lost my key to the Shattered Halls." +#define GOSSIP_LOST_THE_MASTERS_KEY "I've lost my key to the Karazhan." +#define GOSSIP_LOST_VIOLET_HOLD_KEY "I've lost my key to the Violet Hold." +#define GOSSIP_LOST_ESSENCE_INFUSED_MOONSTONE "I've lost my Essence-Infused Moonstone." +#define GOSSIP_LOST_KEY_TO_THE_FOCUSING_IRIS "I've lost my Key to the Focusing Iris." +#define GOSSIP_LOST_HC_KEY_TO_THE_FOCUSING_IRIS "I've lost my Heroic Key to the Focusing Iris." class npc_locksmith : public CreatureScript { @@ -2456,6 +2466,18 @@ public: if (player->GetQuestRewardStatus(QUEST_CONTAINMENT) && !player->HasItemCount(ITEM_VIOLET_HOLD_KEY, 1, true)) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_VIOLET_HOLD_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + // Essence-Infused Moonstone + if (player->GetQuestRewardStatus(QUEST_ETERNAL_VIGILANCE) && !player->HasItemCount(ITEM_ESSENCE_INFUSED_MOONSTONE, 1, true)) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_ESSENCE_INFUSED_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); + + // Key to the Focusing Iris + if (player->GetQuestRewardStatus(QUEST_KEY_TO_THE_FOCUSING_IRIS) && !player->HasItemCount(ITEM_KEY_TO_THE_FOCUSING_IRIS, 1, true)) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_KEY_TO_THE_FOCUSING_IRIS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); + + // Heroic Key to the Focusing Iris + if (player->GetQuestRewardStatus(QUEST_HC_KEY_TO_THE_FOCUSING_IRIS) && !player->HasItemCount(ITEM_HC_KEY_TO_THE_FOCUSING_IRIS, 1, true)) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_HC_KEY_TO_THE_FOCUSING_IRIS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9); + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; @@ -2490,6 +2512,18 @@ public: player->CLOSE_GOSSIP_MENU(); player->CastSpell(player, SPELL_VIOLET_HOLD_KEY, false); break; + case GOSSIP_ACTION_INFO_DEF + 7: + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player, SPELL_ESSENCE_INFUSED_MOONSTONE, false); + break; + case GOSSIP_ACTION_INFO_DEF + 8: + player->CLOSE_GOSSIP_MENU(); + player->AddItem(ITEM_KEY_TO_THE_FOCUSING_IRIS,1); + break; + case GOSSIP_ACTION_INFO_DEF + 9: + player->CLOSE_GOSSIP_MENU(); + player->AddItem(ITEM_HC_KEY_TO_THE_FOCUSING_IRIS,1); + break; } return true; } From bb97ff7601161bb4a76bc2102605edb71bea0099 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 29 Mar 2012 13:14:21 -0400 Subject: [PATCH 0559/1149] Attempt on converting updatewaterstate for use with units (pets and vehicles) --- src/server/game/Entities/Player/Player.cpp | 5 --- src/server/game/Entities/Unit/Unit.cpp | 45 ++++++++++++++++++++++ src/server/game/Entities/Unit/Unit.h | 2 + src/server/game/Movement/MotionMaster.cpp | 3 ++ 4 files changed, 50 insertions(+), 5 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 53bafbd4521..31bd17ffc8f 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -6830,11 +6830,6 @@ bool Player::UpdatePosition(float x, float y, float z, float orientation, bool t if (GetGroup()) SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION); - // code block for underwater state update - // Unit::UpdatePosition() checks for validity and updates our coordinates - // so we re-fetch them instead of using "raw" coordinates from function params - UpdateUnderwaterState(GetMap(), GetPositionX(), GetPositionY(), GetPositionZ()); - if (GetTrader() && !IsWithinDistInMap(GetTrader(), INTERACTION_DISTANCE)) GetSession()->SendCancelTrade(); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 4da56b72017..259f428dfb4 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3089,6 +3089,48 @@ bool Unit::IsUnderWater() const return GetBaseMap()->IsUnderWater(GetPositionX(), GetPositionY(), GetPositionZ()); } +void Unit::UpdateUnderwaterState(Map* m, float x, float y, float z) +{ + if (!isPet() && !IsVehicle()) + return; + + LiquidData liquid_status; + ZLiquidStatus res = m->getLiquidStatus(x, y, z, MAP_ALL_LIQUIDS, &liquid_status); + if (!res) + { + if (_lastLiquid && _lastLiquid->SpellId) + RemoveAurasDueToSpell(_lastLiquid->SpellId); + + RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_NOT_UNDERWATER); + _lastLiquid = NULL; + return; + } + + if (uint32 liqEntry = liquid_status.entry) + { + LiquidTypeEntry const* liquid = sLiquidTypeStore.LookupEntry(liqEntry); + if (_lastLiquid && _lastLiquid->SpellId && _lastLiquid->Id != liqEntry) + RemoveAurasDueToSpell(_lastLiquid->SpellId); + + if (liquid && liquid->SpellId) + { + if (res & (LIQUID_MAP_UNDER_WATER | LIQUID_MAP_IN_WATER)) + CastSpell(this, liquid->SpellId, true); + else + RemoveAurasDueToSpell(liquid->SpellId); + } + + RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_NOT_ABOVEWATER); + _lastLiquid = liquid; + } + else if (_lastLiquid && _lastLiquid->SpellId) + { + RemoveAurasDueToSpell(_lastLiquid->SpellId); + RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_NOT_UNDERWATER); + _lastLiquid = NULL; + } +} + void Unit::DeMorph() { SetDisplayId(GetNativeDisplayId()); @@ -17255,6 +17297,9 @@ bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool tel else if (turn) UpdateOrientation(orientation); + // code block for underwater state update + UpdateUnderwaterState(GetMap(), x, y, z); + return (relocated || turn); } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 00d66518d3f..828d87216df 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1580,6 +1580,7 @@ class Unit : public WorldObject virtual bool IsInWater() const; virtual bool IsUnderWater() const; + virtual void UpdateUnderwaterState(Map* m, float x, float y, float z); bool isInAccessiblePlaceFor(Creature const* c) const; void SendHealSpellLog(Unit* victim, uint32 SpellID, uint32 Damage, uint32 OverHeal, uint32 Absorb, bool critical = false); @@ -2353,6 +2354,7 @@ class Unit : public WorldObject uint32 m_state; // Even derived shouldn't modify uint32 m_CombatTimer; uint32 m_lastManaUse; // msecs + LiquidTypeEntry const* _lastLiquid; TimeTrackerSmall m_movesplineTimer; Diminishing m_Diminishing; diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index b0ac0b710c1..c0e1eb842ae 100755 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -114,6 +114,9 @@ void MotionMaster::UpdateMotion(uint32 diff) _cleanFlag &= ~MMCF_RESET; } + + // probably not the best place to pu this but im not really sure where else to put it. + _owner->UpdateUnderwaterState(_owner->GetMap(), _owner->GetPositionX(), _owner->GetPositionY(), _owner->GetPositionZ()); } void MotionMaster::DirectClean(bool reset) From a8ae4cf1e3981d5c14c5a1eb5c3d6435e7e35bb2 Mon Sep 17 00:00:00 2001 From: Joni Date: Mon, 16 Apr 2012 18:41:31 +0200 Subject: [PATCH 0560/1149] Add warden documentation to ban reason --- src/server/game/Warden/Warden.cpp | 4 +++- src/server/game/Warden/WardenCheckMgr.cpp | 11 +++++++++-- src/server/game/Warden/WardenCheckMgr.h | 2 ++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/server/game/Warden/Warden.cpp b/src/server/game/Warden/Warden.cpp index fa30adde72a..0734e0a0f63 100644 --- a/src/server/game/Warden/Warden.cpp +++ b/src/server/game/Warden/Warden.cpp @@ -187,7 +187,9 @@ std::string Warden::Penalty(WardenCheck* check /*= NULL*/) duration << sWorld->getIntConfig(CONFIG_WARDEN_CLIENT_BAN_DURATION) << "s"; std::string accountName; AccountMgr::GetName(_session->GetAccountId(), accountName); - sWorld->BanAccount(BAN_ACCOUNT, accountName, duration.str(), "Warden Anticheat violation","Server"); + std::stringstream banReason; + banReason << "Warden Anticheat Violation: " << check->Comment << " (CheckId: " << check->CheckId << ")"; + sWorld->BanAccount(BAN_ACCOUNT, accountName, duration.str(), banReason.str(),"Server"); return "Ban"; break; diff --git a/src/server/game/Warden/WardenCheckMgr.cpp b/src/server/game/Warden/WardenCheckMgr.cpp index 90d1cfc0140..f4c7a5069cf 100644 --- a/src/server/game/Warden/WardenCheckMgr.cpp +++ b/src/server/game/Warden/WardenCheckMgr.cpp @@ -63,8 +63,8 @@ void WardenCheckMgr::LoadWardenChecks() CheckStore.resize(maxCheckId + 1); - // 0 1 2 3 4 5 6 - result = WorldDatabase.Query("SELECT id, type, data, result, address, length, str FROM warden_checks ORDER BY id ASC"); + // 0 1 2 3 4 5 6 7 + result = WorldDatabase.Query("SELECT id, type, data, result, address, length, str, comment FROM warden_checks ORDER BY id ASC"); uint32 count = 0; do @@ -78,9 +78,11 @@ void WardenCheckMgr::LoadWardenChecks() uint32 address = fields[4].GetUInt32(); uint8 length = fields[5].GetUInt8(); std::string str = fields[6].GetString(); + std::string comment = fields[7].GetString(); WardenCheck* wardenCheck = new WardenCheck(); wardenCheck->Type = checkType; + wardenCheck->CheckId = id; // Initialize action with default action from config wardenCheck->Action = WardenActions(sWorld->getIntConfig(CONFIG_WARDEN_CLIENT_FAIL_ACTION)); @@ -134,6 +136,11 @@ void WardenCheckMgr::LoadWardenChecks() CheckResultStore[id] = wr; } + if (comment.empty()) + wardenCheck->Comment = "Undocumented Check"; + else + wardenCheck->Comment = comment; + ++count; } while (result->NextRow()); diff --git a/src/server/game/Warden/WardenCheckMgr.h b/src/server/game/Warden/WardenCheckMgr.h index 45de18081c2..7a83d8f0c6d 100644 --- a/src/server/game/Warden/WardenCheckMgr.h +++ b/src/server/game/Warden/WardenCheckMgr.h @@ -36,6 +36,8 @@ struct WardenCheck uint32 Address; // PROC_CHECK, MEM_CHECK, PAGE_CHECK uint8 Length; // PROC_CHECK, MEM_CHECK, PAGE_CHECK std::string Str; // LUA, MPQ, DRIVER + std::string Comment; + uint16 CheckId; enum WardenActions Action; }; From 0f48da6ed15f26b16a3d40e187978c09c2f565e6 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 16 Apr 2012 20:33:19 +0200 Subject: [PATCH 0561/1149] Spell/Warrior: Fixed Concussion Blow damage part Thanks ShinDarth --- src/server/scripts/Spells/spell_warrior.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 66e44112b8a..3e4c043ae47 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -365,7 +365,7 @@ class spell_warr_concussion_blow : public SpellScriptLoader void HandleDummy(SpellEffIndex /* effIndex */) { - SetHitDamage(GetHitDamage() + CalculatePctF(GetHitDamage(),GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK))); + SetHitDamage(CalculatePctN(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetEffectValue())); } void Register() From 3189b57bf527fa82faea289400c61a3f969d390a Mon Sep 17 00:00:00 2001 From: kaelima Date: Tue, 17 Apr 2012 02:14:41 +0200 Subject: [PATCH 0562/1149] Core/Unit: Always initialize a pointer before using it. (less segfaults, more fun) --- src/server/game/Entities/Unit/Unit.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 259f428dfb4..da23a7ba010 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -252,6 +252,7 @@ m_HostileRefManager(this) _focusSpell = NULL; _targetLocked = false; + _lastLiquid = NULL; } //////////////////////////////////////////////////////////// From de3db06731c2b966920b408e3347651c832b23f7 Mon Sep 17 00:00:00 2001 From: Shocker Date: Tue, 17 Apr 2012 04:24:59 +0300 Subject: [PATCH 0563/1149] Update PackageList.txt after recent jemalloc update --- dep/PackageList.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dep/PackageList.txt b/dep/PackageList.txt index ef1b9b58fca..e5003ec744a 100644 --- a/dep/PackageList.txt +++ b/dep/PackageList.txt @@ -14,7 +14,7 @@ G3D (a commercial-grade C++ 3D engine available as Open Source (BSD License) jemalloc (a general-purpose scalable concurrent malloc-implementation) http://www.canonware.com/jemalloc/ - Version: 2.1.0 + Version: 2.2.5 libMPQ (a library for reading MPQ files) https://libmpq.org/ @@ -38,4 +38,4 @@ zlib (A Massively Spiffy Yet Delicately Unobtrusive Compression Library) gSOAP (a portable development toolkit for C and C++ XML Web services and XML data bindings) http://gsoap2.sourceforge.net/ - Version: 2.8.0 + Version: 2.8.2 From 61cb2db1bd57e90e56a62853c9445e243a189125 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 17 Apr 2012 10:16:31 +0200 Subject: [PATCH 0564/1149] Core/Player: Removed _lastLiquid from Player class, no need to have it in both Unit and Player --- src/server/game/Entities/Player/Player.cpp | 1 - src/server/game/Entities/Player/Player.h | 1 - src/server/game/Entities/Unit/Unit.h | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 31bd17ffc8f..0992c488315 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -724,7 +724,6 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep for (uint8 i=0; i uint32 m_lastFallTime; float m_lastFallZ; - LiquidTypeEntry const* _lastLiquid; int32 m_MirrorTimer[MAX_TIMERS]; uint8 m_MirrorTimerFlags; uint8 m_MirrorTimerFlagsLast; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 828d87216df..5a6276d3b0c 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2320,6 +2320,7 @@ class Unit : public WorldObject Vehicle* m_vehicleKit; uint32 m_unitTypeMask; + LiquidTypeEntry const* _lastLiquid; bool IsAlwaysVisibleFor(WorldObject const* seer) const; bool IsAlwaysDetectableFor(WorldObject const* seer) const; @@ -2354,7 +2355,6 @@ class Unit : public WorldObject uint32 m_state; // Even derived shouldn't modify uint32 m_CombatTimer; uint32 m_lastManaUse; // msecs - LiquidTypeEntry const* _lastLiquid; TimeTrackerSmall m_movesplineTimer; Diminishing m_Diminishing; From 17d87c0103703d38eb64f595e8a2155553b39d29 Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 17 Apr 2012 09:56:08 -0400 Subject: [PATCH 0565/1149] Core/Misc: researched the reasons for instance reset failure and added them as comments to the sendresetinstancefailed function. --- src/server/game/Entities/Player/Player.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 0992c488315..141902fbbdc 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -19777,7 +19777,11 @@ void Player::SendResetInstanceSuccess(uint32 MapId) void Player::SendResetInstanceFailed(uint32 reason, uint32 MapId) { - // TODO: find what other fail reasons there are besides players in the instance + /*reasons for instance reset failure: + // 0: There are players inside the instance. + // 1: There are players offline in your party. + // 2>: There are players in your party attempting to zone into an instance. + */ WorldPacket data(SMSG_INSTANCE_RESET_FAILED, 4); data << uint32(reason); data << uint32(MapId); From 3bfe59b41d4e4111e1641012ff07f6f480b3d055 Mon Sep 17 00:00:00 2001 From: The Game Date: Tue, 17 Apr 2012 11:40:58 -0400 Subject: [PATCH 0566/1149] Fix unit tracking to not being limited to the caster of SPELL_AURA_MOD_STALKED, fixes https://github.com/TrinityCore/TrinityCore/issues/6208 --- src/server/game/Entities/Object/Object.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 70b680c6ae0..851c0f47e0f 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -626,7 +626,11 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* if (!target->isAllowedToLoot(creature)) dynamicFlags &= ~UNIT_DYNFLAG_LOOTABLE; } - + if(Unit const* unit = ToUnit()) + { + if(!unit->HasAuraTypeWithCaster(SPELL_AURA_MOD_STALKED, target->GetGUID())) + dynamicFlags &= ~UNIT_DYNFLAG_TRACK_UNIT; + } *data << dynamicFlags; } // FG: pretend that OTHER players in own group are friendly ("blue") From 839abe4dca9ae326b7c8397212318d98acdbcb05 Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 17 Apr 2012 11:45:26 -0400 Subject: [PATCH 0567/1149] Core/Spells: fix holy shock cast on friendly opposing team going on cooldown and saying invalid target. spell will now fail with invalid target and not cause a cooldown --- src/server/scripts/Spells/spell_paladin.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index d823c629d4b..9f7f7d847e1 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -285,9 +285,20 @@ class spell_pal_holy_shock : public SpellScriptLoader } } + SpellCastResult CheckCast() + { + Player* caster = GetCaster()->ToPlayer(); + if (GetTargetUnit()) + if (Player* target = GetTargetUnit()->ToPlayer()) + if (caster->GetTeam() != target->GetTeam() && !caster->IsValidAttackTarget(target)) + return SPELL_FAILED_BAD_TARGETS; + return SPELL_CAST_OK; + } + void Register() { // add dummy effect spell handler to Holy Shock + OnCheckCast += SpellCheckCastFn(spell_pal_holy_shock_SpellScript::CheckCast); OnEffectHitTarget += SpellEffectFn(spell_pal_holy_shock_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; From 5dd561dcacfaf16bdbdd3932a40a94a7cd85a633 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Tue, 17 Apr 2012 19:55:32 +0200 Subject: [PATCH 0568/1149] DB/Creatures: Add missing northrend rare elite mobs: Arcturis and Skoll Closes #1324 --- .../world/2012_04_17_00_world_creature.sql | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 sql/updates/world/2012_04_17_00_world_creature.sql diff --git a/sql/updates/world/2012_04_17_00_world_creature.sql b/sql/updates/world/2012_04_17_00_world_creature.sql new file mode 100644 index 00000000000..ebf0fb42a59 --- /dev/null +++ b/sql/updates/world/2012_04_17_00_world_creature.sql @@ -0,0 +1,28 @@ +SET @GUID1 := 41781; +SET @GUID2 := 41783; + +DELETE FROM creature WHERE guid IN (@GUID1,@GUID2); +INSERT INTO `creature` +(`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`) +VALUES +(@GUID1 ,38453,571,1,1,3561.821,-2736.367,136.0317,0), -- Arcturis in Grizzly Hills +(@GUID2,35189,571,1,1,7101.845,-1443.734,924.2609,0.178631); -- Skoll in The Storm Peaks + +UPDATE `creature_template` SET `faction_A` = 190, `faction_H`=190 WHERE `entry` IN (38453,35189); + +SET @NPC= @GUID1*10; +-- Add pathing for Arcturis +DELETE FROM `creature_addon` WHERE `guid` = @GUID1; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(@GUID1,@NPC,0,0,0,0,''); -- Add path for Acturis +-- Add waypoint data for the path: +DELETE FROM `waypoint_data` WHERE `id`=@NPC; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`) VALUES +(@NPC,1,3563.499,-2737.698,137.1898), +(@NPC,2,3565.249,-2738.698,138.4398), +(@NPC,3,3566.749,-2739.948,139.9398), +(@NPC,4,3568.249,-2740.698,140.6898), +(@NPC,5,3567.839,-2741.380,141.9256), +(@NPC,6,3569.999,-2741.948,142.1898), +(@NPC,7,3570.749,-2742.448,143.1898), +(@NPC,8,3572.676,-2743.528,144.8479); From a998554f8f69d2e8453d800f9f8ffe2afc1ee18d Mon Sep 17 00:00:00 2001 From: kaelima Date: Tue, 17 Apr 2012 22:33:45 +0200 Subject: [PATCH 0569/1149] Script/Pit of Saron: Fix logic in spell_tyrannus_overlord_brand should fix #6247 --- .../FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp index 88e9bedcd07..8d015adf4a4 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp @@ -387,8 +387,7 @@ class player_overlord_brandAI : public PlayerAI void SetGUID(uint64 guid, int32 /*type*/) { tyrannus = ObjectAccessor::GetCreature(*me, guid); - if (!tyrannus) - me->IsAIEnabled = false; + me->IsAIEnabled = tyrannus != NULL; } void DamageDealt(Unit* /*victim*/, uint32& damage, DamageEffectType /*damageType*/) @@ -423,10 +422,9 @@ class spell_tyrannus_overlord_brand : public SpellScriptLoader return; oldAI = GetTarget()->GetAI(); + oldAIState = GetTarget()->IsAIEnabled; GetTarget()->SetAI(new player_overlord_brandAI(GetTarget()->ToPlayer())); GetTarget()->GetAI()->SetGUID(GetCasterGUID()); - oldAIState = GetTarget()->IsAIEnabled; - GetTarget()->IsAIEnabled = true; } void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) From d97f9c37bb437481241bab4b5268170a792751d3 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 18 Apr 2012 02:43:00 +0200 Subject: [PATCH 0570/1149] DB/Creature: Set correct spellclick spell and ability spell for Valkyrion Harpoon Gun --- sql/updates/world/2012_04_18_00_world_npc_spellclick_spells.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_04_18_00_world_npc_spellclick_spells.sql diff --git a/sql/updates/world/2012_04_18_00_world_npc_spellclick_spells.sql b/sql/updates/world/2012_04_18_00_world_npc_spellclick_spells.sql new file mode 100644 index 00000000000..3bad860290b --- /dev/null +++ b/sql/updates/world/2012_04_18_00_world_npc_spellclick_spells.sql @@ -0,0 +1,2 @@ +UPDATE `npc_spellclick_spells` SET `spell_id`=57053 WHERE `npc_entry`=30066 AND `spell_id`=56678; +UPDATE `creature_template` SET `spell1`=55812 WHERE `entry`=30066; From ceac8959e336ae4ff7033282a1992ca7a285798d Mon Sep 17 00:00:00 2001 From: elecyb Date: Tue, 17 Apr 2012 22:16:24 -0300 Subject: [PATCH 0571/1149] Core/Warden: Documented more warden checks --- sql/updates/world/2012_04_17_00_world_warden_checks.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 sql/updates/world/2012_04_17_00_world_warden_checks.sql diff --git a/sql/updates/world/2012_04_17_00_world_warden_checks.sql b/sql/updates/world/2012_04_17_00_world_warden_checks.sql new file mode 100644 index 00000000000..74539f99fb3 --- /dev/null +++ b/sql/updates/world/2012_04_17_00_world_warden_checks.sql @@ -0,0 +1,8 @@ +UPDATE `warden_checks` SET `comment`='Swimming_FallCalc - movement state' WHERE `id`=15; +UPDATE `warden_checks` SET `comment`='CreateMovementStatus' WHERE `id`=72; +UPDATE `warden_checks` SET `comment`='OnStartSwim OnSplineStartSwim - movement state' WHERE `id`=170; +UPDATE `warden_checks` SET `comment`='DefaultServerLogin - account name' WHERE `id`=198; +UPDATE `warden_checks` SET `comment`='Login Checksum - authentication process' WHERE `id`=320; +UPDATE `warden_checks` SET `comment`='CalcFallStartElevation - (some kind of wall climb)' WHERE `id`=329; +UPDATE `warden_checks` SET `comment`='Code injection at 0x40100A' WHERE `id`=381; +UPDATE `warden_checks` SET `comment`='Login State - (May be false positive)' WHERE `id`=437; From 35024272d2967231b64b4cbaf983ece6216cd1e3 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Wed, 18 Apr 2012 09:22:24 +0200 Subject: [PATCH 0572/1149] DB/Creature: Update spawntime for Arcturis & Skoll --- sql/updates/world/2012_04_18_01_world_creature.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2012_04_18_01_world_creature.sql diff --git a/sql/updates/world/2012_04_18_01_world_creature.sql b/sql/updates/world/2012_04_18_01_world_creature.sql new file mode 100644 index 00000000000..e2d6bdac95b --- /dev/null +++ b/sql/updates/world/2012_04_18_01_world_creature.sql @@ -0,0 +1 @@ +UPDATE `creature` SET `spawntimesecs`=39600 WHERE `guid` IN (41781,41783); -- Set the spawntime to 11 hours for Arcturis & Skoll From 1be4027a9082c4cd746849697d8409077907348b Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Wed, 18 Apr 2012 11:10:39 +0200 Subject: [PATCH 0573/1149] DB/Loot: Keepers of Ulduar loot. BEWARE: chest-assignments has been GUESSED in some cases. Script-updates will prove this either wrong or right. MIGHT NOT WORK UNTILL SCRIPTS GET FIXED --- ...04_18_02_world_reference_loot_template.sql | 377 ++++++++++++++++++ 1 file changed, 377 insertions(+) create mode 100644 sql/updates/world/2012_04_18_02_world_reference_loot_template.sql diff --git a/sql/updates/world/2012_04_18_02_world_reference_loot_template.sql b/sql/updates/world/2012_04_18_02_world_reference_loot_template.sql new file mode 100644 index 00000000000..4ed922060d9 --- /dev/null +++ b/sql/updates/world/2012_04_18_02_world_reference_loot_template.sql @@ -0,0 +1,377 @@ +-- ---------------------- +-- -- Various Cleanups -- +-- ---------------------- +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=10 AND `SourceGroup`=34105; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=4 AND `SourceGroup` IN (27081,27085,27073,26963,26955); +DELETE FROM `reference_loot_template` WHERE `entry` IN (12020,12021,12022,34105,34125,34126,34127,34128,34129,34130); +DELETE FROM `gameobject_loot_template` WHERE `entry`=10961; -- Bad Bogblossom fix was bad +UPDATE `gameobject_template` SET `data1`=26956 WHERE `entry`=194315; +-- ------------------------------- +-- -- Variables and definitions -- +-- ------------------------------- +-- Freya 10 man +SET @Freya10k0ID := 194324; -- Freyas Gift 10man ALL elders alive +SET @Freya10k1ID := 194326; -- Freyas Gift 10man killed 1 elder +SET @Freya10k2ID := 194328; -- Freyas Gift 10man killed 2 elder +SET @Freya10k3ID := 194330; -- Freyas Gift 10man killed 3 elder +-- Freya 25 man +SET @Freya25k0ID := 194325; -- Freyas Gift 25man ALL elders alive +SET @Freya25k1ID := 194327; -- Freyas Gift 25man killed 1 elder +SET @Freya25k2ID := 194329; -- Freyas Gift 25man killed 2 elder +SET @Freya25k3ID := 194331; -- Freyas Gift 25man killed 3 elder +-- Hodir +SET @Hodir10nID := 194307; -- Cache of Winter 10man +SET @Hodir10hID := 194200; -- Rare Cache of Winter 10man +SET @Hodir25nID := 194308; -- Cache of Winter 25man +SET @Hodir25hID := 194201; -- Rare Cache of Winter 25man +-- Mimiron +SET @Mimiron10nID := 194789; -- Cache of Innovations 10man +SET @Mimiron25nID := 194956; -- Cache of Innovations 25man +SET @Mimiron10hID := 194957; -- Cache of Innovation 10 man Hardmode +SET @Mimiron25hID := 194958; -- Cache of Innovation 25 man Hardmode +-- Thorim +SET @Thorim10nID := 194312; -- Cache of Storms 10man +SET @Thorim10hID := 194313; -- Cache of Storms 10 man Hardmode +SET @Thorim25nID := 194314; -- Cache of Storms 25man +SET @Thorim25hID := 194315; -- Cache of Storms 25 man Hardmode + +-- Use procedure to get Lootid from data1 field and assign it to a variable +-- Freya 10 +CALL `sp_get_go_lootid`(@Freya10k0ID,@Freya10k0); +CALL `sp_get_go_lootid`(@Freya10k1ID,@Freya10k1); +CALL `sp_get_go_lootid`(@Freya10k2ID,@Freya10k2); +CALL `sp_get_go_lootid`(@Freya10k3ID,@Freya10k3); +-- Freya 25 +CALL `sp_get_go_lootid`(@Freya25k0ID,@Freya25k0); +CALL `sp_get_go_lootid`(@Freya25k1ID,@Freya25k1); +CALL `sp_get_go_lootid`(@Freya25k2ID,@Freya25k2); +CALL `sp_get_go_lootid`(@Freya25k3ID,@Freya25k3); +-- Hodir 10 +CALL `sp_get_go_lootid`(@Hodir10nID,@Hodir10n); +CALL `sp_get_go_lootid`(@Hodir10hID,@Hodir10h); +-- Hodir 25 +CALL `sp_get_go_lootid`(@Hodir25nID,@Hodir25n); +CALL `sp_get_go_lootid`(@Hodir25hID,@Hodir25h); +-- Mimiron +CALL `sp_get_go_lootid`(@Mimiron10nID,@Mimiron10n); +CALL `sp_get_go_lootid`(@Mimiron10hID,@Mimiron10h); +CALL `sp_get_go_lootid`(@Mimiron25nID,@Mimiron25n); +CALL `sp_get_go_lootid`(@Mimiron25hID,@Mimiron25h); +-- Thorim +CALL `sp_get_go_lootid`(@Thorim10nID,@Thorim10n); +CALL `sp_get_go_lootid`(@Thorim10hID,@Thorim10h); +CALL `sp_get_go_lootid`(@Thorim25nID,@Thorim25n); +CALL `sp_get_go_lootid`(@Thorim25hID,@Thorim25h); +-- Set References +SET @Freya10Ref := 34365; +SET @Freya25Ref := @Freya10Ref+1; +SET @Hodir10Ref := @Freya10Ref+2; +SET @Hodir25Ref := @Freya10Ref+3; +SET @Mimiron10Ref := @Freya10Ref+4; +SET @Mimiron25Ref := @Freya10Ref+5; +SET @Thorim10Ref := @Freya10Ref+6; +SET @Thorim25Ref := @Freya10Ref+7; +SET @HandToken := 12026; +SET @LegToken := @HandToken+1; +SET @LegsToken := @HandToken+2; +SET @ChestToken := @HandToken+3; +SET @HeadToken := @HandToken+4; +SET @GloveToken := @HandToken+5; +SET @ShoulderToken := @HandToken+6; +SET @HelmToken := @HandToken+7; +SET @Recipe := 34154; +-- ------------------------- +-- -- Reference Templates -- +-- ------------------------- +-- Delete previous templates if existing +DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN @Freya10Ref AND @Freya10Ref+7; +DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN @HandToken AND @HandToken+7; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Freya 10 man +(@Freya10Ref,45934,0,1,1,1,1), -- Unraveling Reach +(@Freya10Ref,45935,0,1,1,1,1), -- Ironbark Faceguard +(@Freya10Ref,45941,0,1,1,1,1), -- Chestguard of the Lasher +(@Freya10Ref,45936,0,1,1,1,1), -- Legplates of Flourishing Resolve +(@Freya10Ref,45940,0,1,1,1,1), -- Tunic of the Limber Stalker +-- Freya 25 man +(@Freya25Ref,45483,0,1,1,1,1), -- Boots of the Servant +(@Freya25Ref,45482,0,1,1,1,1), -- Leggings of the Lifetender +(@Freya25Ref,45481,0,1,1,1,1), -- Gauntlets of Ruthless Reprisal +(@Freya25Ref,45480,0,1,1,1,1), -- Nymph Heart Charm +(@Freya25Ref,45479,0,1,1,1,1), -- The Lifebinder +-- Freya Tokens +(@HandToken,45644,0,1,1,1,1), -- Gloves of the Wayward Conqueror +(@HandToken,45645,0,1,1,1,1), -- Gloves of the Wayward Protector +(@HandToken,45646,0,1,1,1,1), -- Gloves of the Wayward Vanquisher +(@LegToken,45653,0,1,1,1,1), -- Legplates of the Wayward Conqueror +(@LegToken,45654,0,1,1,1,1), -- Legplates of the Wayward Protector +(@LegToken,45655,0,1,1,1,1), -- Legplates of the Wayward Vanquisher +-- Hodir 10 man +(@Hodir10Ref,45874,0,1,1,1,1), -- Signet of Winter +(@Hodir10Ref,45458,0,1,1,1,1), -- Stormedge +(@Hodir10Ref,45873,0,1,1,1,1), -- Winter's Frigid Embrace +(@Hodir10Ref,45872,0,1,1,1,1), -- Avalanche +(@Hodir10Ref,45454,0,1,1,1,1), -- Cowl of Icy Breaths +-- Hodir 25 man +(@Hodir25Ref,45452,0,1,1,1,1), -- Frostplate Greaves +(@Hodir25Ref,45454,0,1,1,1,1), -- Frost-Bound Chain Bracers +(@Hodir25Ref,45453,0,1,1,1,1), -- Winter's Icy Embrace +(@Hodir25Ref,45450,0,1,1,1,1), -- Northern Barrier +(@Hodir25Ref,45451,0,1,1,1,1), -- Frozen Loop +-- Hodir Tokens +(@LegsToken,45650,0,1,1,1,1), -- Leggings of the Wayward Conqueror +(@LegsToken,45651,0,1,1,1,1), -- Leggings of the Wayward Protector +(@LegsToken,45652,0,1,1,1,1), -- Leggings of the Wayward Vanquisher +(@ChestToken,45632,0,1,1,1,1), -- Breastplate of the Wayward Conqueror +(@ChestToken,45633,0,1,1,1,1), -- Breastplate of the Wayward Protector +(@ChestToken,45634,0,1,1,1,1), -- Breastplate of the Wayward Vanquisher +-- Mimiron 10 man +(@Mimiron10Ref,45974,0,1,1,1,1), -- Shoulderguards of Assimilation +(@Mimiron10Ref,45976,0,1,1,1,1), -- Static Charge Handwraps +(@Mimiron10Ref,45972,0,1,1,1,1), -- Pulse Baton +(@Mimiron10Ref,45973,0,1,1,1,1), -- Stylish Power Cape +(@Mimiron10Ref,45975,0,1,1,1,1), -- Cable of the Metrognome +-- Mimiron 25 man +(@Mimiron25Ref,45492,0,1,1,1,1), -- Malleable Steelweave Mantle +(@Mimiron25Ref,45493,0,1,1,1,1), -- Asimov's Drape +(@Mimiron25Ref,45490,0,1,1,1,1), -- Pandora's Plea +(@Mimiron25Ref,45491,0,1,1,1,1), -- Waistguard of the Creator +(@Mimiron25Ref,45489,0,1,1,1,1), -- Insanity's Grip +-- Mimiron Tokens +(@HeadToken,45647,0,1,1,1,1), -- Helm of the Wayward Conqueror +(@HeadToken,45648,0,1,1,1,1), -- Helm of the Wayward Protector +(@HeadToken,45649,0,1,1,1,1), -- Helm of the Wayward Vanquisher +(@GloveToken,45641,0,1,1,1,1), -- Gauntlets of the Wayward Conqueror +(@GloveToken,45642,0,1,1,1,1), -- Gauntlets of the Wayward Protector +(@GloveToken,45643,0,1,1,1,1), -- Gauntlets of the Wayward Vanquisher +-- Thorim 10 man +(@Thorim10Ref,45927,0,1,1,1,1), -- Handwraps of Resonance +(@Thorim10Ref,45894,0,1,1,1,1), -- Leggings of Unstable Discharge +(@Thorim10Ref,45895,0,1,1,1,1), -- Belt of the Blood Pit +(@Thorim10Ref,45893,0,1,1,1,1), -- Guise of the Midgard Serpent +(@Thorim10Ref,45892,0,1,1,1,1), -- Legacy of Thunder +-- Throim 25 man +(@Thorim25Ref,45468,0,1,1,1,1), -- Leggings of Lost Love +(@Thorim25Ref,45466,0,1,1,1,1), -- Scale of Fates +(@Thorim25Ref,45467,0,1,1,1,1), -- Belt of the Betrayed +(@Thorim25Ref,45469,0,1,1,1,1), -- Sif's Promise +(@Thorim25Ref,45463,0,1,1,1,1), -- Vulmir, the Northern Tempest +-- Thorim Tokens +(@ShoulderToken,45659,0,1,1,1,1), -- Spaulders of the Wayward Conqueror +(@ShoulderToken,45660,0,1,1,1,1), -- Spaulders of the Wayward Protector +(@ShoulderToken,45661,0,1,1,1,1), -- Spaulders of the Wayward Vanquisher +(@HelmToken,45638,0,1,1,1,1), -- Crown of the Wayward Conqueror +(@HelmToken,45639,0,1,1,1,1), -- Crown of the Wayward Protector +(@HelmToken,45640,0,1,1,1,1); -- Crown of the Wayward Vanquisher +-- ------------------------------- +-- -- Gameobject Loot Templates -- +-- ------------------------------- +-- Delete previous templates if existing +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (@Freya10k3,@Freya10k2,@Freya10k1,@Freya10k0,@Freya25k3,@Freya25k2,@Freya25k1,@Freya25k0,@Hodir10n,@Hodir10h,@Hodir25n,@Hodir25h,@Mimiron10n,@Mimiron10h,@Mimiron25n,@Mimiron25h,@Thorim10n,@Thorim10h,@Thorim25n,@Thorim25h); +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- ------------------ +-- -- Freya 10 man -- +-- ------------------ +-- Normal Mode: +(@Freya10k3,1,100,1,0,-@Freya10Ref,1), -- 1 from normal loot +(@Freya10k3,2,100,1,0,-@HandToken,1), -- 1 from tokens +(@Freya10k3,46110,100,1,0,1,1), -- Alchemist's Cache +(@Freya10k3,47241,100,1,0,1,1), -- 1x Emblem of Triumph +-- Hard Mode: 1 elder alive +(@Freya10k2,1,100,1,0,-@Freya10Ref,1), -- 1 from normal loot +(@Freya10k2,2,100,1,0,-@HandToken,1), -- 1 from tokens +(@Freya10k2,46110,100,1,0,1,1), -- Alchemist's Cache +(@Freya10k2,47241,100,1,0,2,2), -- 2x Emblem of Triumph +(@Freya10k2,45087,100,1,0,1,1), -- Runed Orb +(@Freya10k2,3,100,1,0,-34349,1), -- 1x Emblem of Triumph for Alive Elders +-- Hard Mode: 2 elders alive +(@Freya10k1,1,100,1,0,-@Freya10Ref,1), -- 1 from normal loot +(@Freya10k1,2,100,1,0,-@HandToken,1), -- 1 from tokens +(@Freya10k1,46110,100,1,0,1,1), -- Alchemist's Cache +(@Freya10k1,47241,100,1,0,3,3), -- 3x Emblem of Triumph +(@Freya10k1,45087,100,1,0,1,1), -- Runed Orb +(@Freya10k1,3,100,1,0,-@Recipe,1), -- 1 from Recipe +(@Freya10k1,4,100,1,0,-34349,2), -- 2x Emblem of Triumph for Alive Elders +-- Hard Mode: 3 elders alive +(@Freya10k0,1,100,1,0,-@Freya10Ref,1), -- 1 from normal loot +(@Freya10k0,2,100,1,0,-@HandToken,1), -- 1 from tokens +(@Freya10k0,46110,100,1,0,1,1), -- Alchemist's Cache +(@Freya10k0,47241,100,1,0,3,3), -- 3x Emblem of Triumph (self) +(@Freya10k0,45087,100,1,0,1,1), -- Runed Orb +(@Freya10k0,3,100,1,0,-@Recipe,1), -- 1 from Recipe +(@Freya10k0,45788,-100,1,0,1,1), -- Freya's Sigil 10 man QUEST ONLY +(@Freya10k0,4,100,1,0,-34349,1), -- 3x Emblem of Triumph for Alive Elders +-- 1 from Hardmode items: +(@Freya10k0,45943,0,1,1,1,1), -- Gloves of Whispering Winds +(@Freya10k0,45946,0,1,1,1,1), -- Fire Orchid Signet +(@Freya10k0,45945,0,1,1,1,1), -- Seed of Budding Carnage +(@Freya10k0,45947,0,1,1,1,1), -- Serilas, Blood Blade of Invar One-Arm +(@Freya10k0,45294,0,1,1,1,1), -- Petrified Ivy Sprig +-- ------------------ +-- -- Freya 25 man -- +-- ------------------ +-- Normal Mode: +(@Freya25k3,1,100,1,0,-@Freya25Ref,1), -- 1 from normal loot +(@Freya25k3,2,100,1,0,-@LegToken,2), -- 2 from tokens +(@Freya25k3,47241,100,1,0,1,1), -- 1x Emblem of Triumph +(@Freya25k3,46110,100,1,0,1,1), -- Alchemist's Cache +(@Freya25k3,3,10,1,0,-@Recipe,1), -- Chance on Recipe +(@Freya25k3,45087,10,1,0,1,1), -- Chance on Runed Orb +(@Freya25k3,45083,5,1,0,1,1), -- Fragment of Val'anyr +-- Hard Mode: 1 elder alive +(@Freya25k2,1,100,1,0,-@Freya25Ref,1), -- 1 from normal loot +(@Freya25k2,2,100,1,0,-@LegToken,2), -- 2 from tokens +(@Freya25k2,47241,100,1,0,2,2), -- 2x Emblem of Triumph +(@Freya25k2,46110,100,1,0,1,1), -- Alchemist's Cache +(@Freya25k2,3,10,1,0,-@Recipe,1), -- Chance on Recipe +(@Freya25k2,4,10,1,0,-34350,1), -- Chance on Runed Orb +(@Freya25k2,45087,100,1,0,2,2), -- 2x Runed Orb +(@Freya25k2,45083,7,1,0,1,1), -- Fragment of Val'anyr +(@Freya25k2,5,100,1,0,-34349,1), -- 1x Emblem of Triumph for Alive Elder +-- Hard Mode: 2 elders alive +(@Freya25k1,1,100,1,0,-@Freya25Ref,1), -- 1 from normal loot +(@Freya25k1,2,100,1,0,-@LegToken,2), -- 2 from tokens +(@Freya25k1,47241,100,1,0,3,3), -- 3x Emblem of Triumph +(@Freya25k1,46110,100,1,0,1,1), -- Alchemist's Cache +(@Freya25k1,3,10,1,0,-34350,1), -- Chance on Runed Orb +(@Freya25k1,45087,100,1,0,2,2), -- 2x Runed Orb +(@Freya25k1,4,100,1,0,-@Recipe,1), -- Recipe +(@Freya25k1,5,10,1,0,-@Recipe,1), -- Chance on Recipe +(@Freya25k1,45083,9,1,0,1,1), -- Fragment of Val'anyr +(@Freya25k1,6,100,1,0,-34349,2), -- 2x Emblem of Triumph for Alive Elder +-- Hard Mode: 3 elders alive +(@Freya25k0,1,100,1,0,-@Freya25Ref,1), -- 1 from normal loot +(@Freya25k0,2,100,1,0,-@LegToken,2), -- 2 from tokens +(@Freya25k0,47241,100,1,0,3,3), -- 3x Emblem of Triumph +(@Freya25k0,46110,100,1,0,1,1), -- Alchemist's Cache +(@Freya25k0,3,10,1,0,-34350,1), -- Chance on Runed Orb +(@Freya25k0,45087,100,1,0,2,2), -- 2x Runed Orb +(@Freya25k0,4,100,1,0,-@Recipe,1), -- Recipe +(@Freya25k0,5,10,1,0,-@Recipe,1), -- Chance on Recipe +(@Freya25k0,45814,-100,1,0,1,1), -- Freya's Sigil 25 man QUEST ONLY +(@Freya25k0,45083,20,1,0,1,1), -- Fragment of Val'anyr +(@Freya25k2,6,100,1,0,-34349,3), -- 3x Emblem of Triumph for Alive Elder +-- 1 from Hardmode items +(@Freya25k0,45484,0,1,1,1,1), -- Bladetwister +(@Freya25k0,45486,0,1,1,1,1), -- Drape of the Sullen Goddess +(@Freya25k0,45487,0,1,1,1,1), -- Handguards of Revitalization +(@Freya25k0,45488,0,1,1,1,1), -- Leggings of the Enslaved Idol +(@Freya25k0,45613,0,1,1,1,1), -- Dreambinder +(@Freya25k0,45485,0,1,1,1,1), -- Bronze Pendant of the Vanir +-- ------------------ +-- -- Hodir 10 man -- +-- ------------------ +(@Hodir10n,1,100,1,0,-@Hodir10Ref,1), -- 1x Normal Loot Item +(@Hodir10n,2,100,1,0,-@LegsToken,1), -- 1x Token +(@Hodir10n,47241,100,1,0,1,1), -- Emblem of Triumph +-- Hard mode: +(@Hodir10h,1,100,1,0,-@Hodir10Ref,1), -- 1x Normal Loot Item +(@Hodir10h,2,100,1,0,-@LegsToken,1), -- 1x Token +(@Hodir10h,47241,100,1,0,1,1), -- Emblem of Triumph +(@Hodir10h,45786,-100,1,0,1,1), -- Hodir's Sigil +-- 1 from Hardmode items +(@Hodir10h,45887,0,1,1,1,1), -- Ice Layered Barrier +(@Hodir10h,45888,0,1,1,1,1), -- Bitter Cold Armguards +(@Hodir10h,45886,0,1,1,1,1), -- Icecore Staff +(@Hodir10h,45876,0,1,1,1,1), -- Shiver +(@Hodir10h,45877,0,1,1,1,1), -- The Boreal Guard +-- ------------------ +-- -- Hodir 25 man -- +-- ------------------ +(@Hodir25n,1,100,1,0,-@Hodir25Ref,1), -- 1x Normal Loot Item +(@Hodir25n,2,100,1,0,-@ChestToken,1), -- 1x Token +(@Hodir25n,47241,100,1,0,1,1), -- Emblem of Triumph +(@Hodir25n,3,10,1,0,-@Recipe,1), -- Chance on Recipe +(@Hodir25n,45087,10,1,0,1,1), -- Chance on Runed Orb +(@Hodir25n,45083,10,1,0,1,1), -- Fragment of Val'anyr +-- Hard mode: +(@Hodir25h,1,100,1,0,-@Hodir25Ref,1), -- 1x Normal Loot Item +(@Hodir25h,2,100,1,0,-@ChestToken,2), -- 2x Token +(@Hodir25h,47241,100,1,0,1,1), -- Emblem of Triumph +(@Hodir25h,45815,-100,1,0,1,1), -- Hodir's Sigil +(@Hodir25h,3,10,1,0,-@Recipe,1), -- Chance on Recipe +(@Hodir25h,45087,10,1,0,1,1), -- Chance on Runed Orb +(@Hodir25h,45083,20,1,0,1,1), -- Fragment of Val'anyr +-- -------------------- +-- -- Mimiron 10 man -- +-- -------------------- +(@Mimiron10n,1,100,1,0,-@Mimiron10Ref,1), -- 1x Normal Loot Item +(@Mimiron10n,2,100,1,0,-@HeadToken,1), -- 1x Token +(@Mimiron10n,47241,100,1,0,1,1), -- 1x Emblem of Triumph +-- Hardmode 10 man +(@Mimiron10h,1,100,1,0,-@Mimiron10Ref,1), -- 1x Normal Loot Item +(@Mimiron10h,2,100,1,0,-@HeadToken,1), -- 1x Token +(@Mimiron10h,47241,100,1,0,1,1), -- 1x Emblem of Triumph +(@Mimiron10h,45787,-100,1,0,1,1), -- Mimiron's Sigel (QUEST ONLY, HARDMODE ONLY) +-- 1 from Hardmode items +(@Mimiron10h,45989,0,1,1,1,1), -- Tempered Mercury Greaves +(@Mimiron10h,45982,0,1,1,1,1), -- Fused Alloy Legplates +(@Mimiron10h,45993,0,1,1,1,1), -- Mimiron's Flight Goggles +(@Mimiron10h,45988,0,1,1,1,1), -- Greaves of the Iron Army +(@Mimiron10h,45990,0,1,1,1,1), -- Fusion Blade +-- -------------------- +-- -- Mimiron 25 man -- +-- -------------------- +(@Mimiron25n,1,100,1,0,-@Mimiron25Ref,1), -- 1x Normal Loot Item +(@Mimiron25n,2,100,1,0,-@GloveToken,2), -- 2x Token +(@Mimiron25n,47241,100,1,0,1,1), -- 1x Emblem of Triumph +(@Mimiron25n,3,10,1,0,-@Recipe,1), -- Chance on Recipe +(@Mimiron25n,45087,10,1,0,1,1), -- Chance on Runed Orb +(@Mimiron25n,45083,8,1,0,1,1), -- Fragment of Val'anyr Normal +-- Hard Mode 25 man +(@Mimiron25h,1,100,1,0,-@Mimiron25Ref,1), -- 1x Normal Loot Item +(@Mimiron25h,2,100,1,0,-@GloveToken,2), -- 2x Token +(@Mimiron25h,47241,100,1,0,1,1), -- 1x Emblem of Triumph +(@Mimiron25h,3,10,1,0,-@Recipe,1), -- Chance on Recipe +(@Mimiron25h,45087,10,1,0,1,1), -- Chance on Runed Orb +(@Mimiron25h,45816,-100,1,0,1,1), -- Mimiron's Sigel (QUEST ONLY, HARDMODE ONLY) +(@Mimiron25h,45083,18,1,0,1,1), -- Fragment of Val'anyr Hardmode +-- 1 from Hardmode items +(@Mimiron25h,45496,0,1,1,1,1), -- Titanskin Cloak +(@Mimiron25h,45494,0,1,1,1,1), -- Delirium's Touch +(@Mimiron25h,45663,0,1,1,1,1), -- Armbands of Bedlam +(@Mimiron25h,45620,0,1,1,1,1), -- Starshard Edge +(@Mimiron25h,45495,0,1,1,1,1), -- Conductive Seal +(@Mimiron25h,45497,0,1,1,1,1), -- Crown of Luminescence +-- ------------------- +-- -- Thorim 10 man -- +-- ------------------- +(@Thorim10n,1,100,1,0,-@Thorim10Ref,1), -- 1x Normal Loot Item +(@Thorim10n,2,100,1,0,-@ShoulderToken,1), -- 1x Token +(@Thorim10n,47241,100,1,0,1,1), -- 1x Emblem of Triumph +-- Hardmode 10 man +(@Thorim10h,1,100,1,0,-@Thorim10Ref,1), -- 1x Normal Loot Item +(@Thorim10h,2,100,1,0,-@ShoulderToken,1), -- 1x Token +(@Thorim10h,47241,100,1,0,1,1), -- 1x Emblem of Triumph +(@Thorim10h,45784,-100,2,0,1,1), -- Thorim's Sigil (QUEST ONLY, HARDMODE ONLY) +-- 1 from Hardmode items +(@Thorim10h,45933,0,2,1,1,1), -- Pendant of the Shallow Grave +(@Thorim10h,45929,0,2,1,1,1), -- Sif's Remembrance +(@Thorim10h,45928,0,2,1,1,1), -- Gauntlets of the Thunder God +(@Thorim10h,45931,0,2,1,1,1), -- Mjolnir Runestone +(@Thorim10h,45930,0,2,1,1,1), -- Combatant's Bootblade +-- ------------------- +-- -- Thorim 25 man -- +-- ------------------- +(@Thorim25n,1,100,3,0,-@Thorim25Ref,1), -- 1x Normal Loot Item +(@Thorim25n,2,100,3,0,-@HelmToken,2), -- 2x Token +(@Thorim25n,47241,100,3,0,1,1), -- 1x Emblem of Triumph +(@Thorim25n,3,10,3,0,-@Recipe,1), -- Chance on Recipe +(@Thorim25n,45087,10,3,0,1,1), -- Chance on Runed Orb +(@Thorim25n,45083,8,1,0,1,1), -- Fragment of Val'anyr Normal +-- Hardmode 25 man +(@Thorim25h,1,100,3,0,-@Thorim25Ref,1), -- 1x Normal Loot Item +(@Thorim25h,2,100,3,0,-@HelmToken,2), -- 2x Token +(@Thorim25h,47241,100,3,0,1,1), -- 1x Emblem of Triumph +(@Thorim25h,3,10,3,0,-@Recipe,1), -- Chance on Recipe +(@Thorim25h,45087,10,3,0,1,1), -- Chance on Runed Orb +(@Thorim25h,45817,-100,1,0,1,1), -- Thorim's Sigil (QUEST ONLY, HARDMODE ONLY) +(@Thorim25h,45083,18,1,0,1,1), -- Fragment of Val'anyr Hardmode +-- 1 from Hardmode items +(@Thorim25h,45471,0,1,1,1,1), -- Fate's Clutch +(@Thorim25h,45570,0,1,1,1,1), -- Skyforge Crossbow +(@Thorim25h,45472,0,1,1,1,1), -- Warhelm of the Champion +(@Thorim25h,45474,0,1,1,1,1), -- Pauldrons of the Combatant +(@Thorim25h,45470,0,1,1,1,1), -- Wisdom's Hold +(@Thorim25h,45473,0,1,1,1,1); -- Embrace of the Gladiator + From bec761a3e0809c93ca0dd84844ed9635fcce2ac6 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 18 Apr 2012 12:44:56 +0200 Subject: [PATCH 0574/1149] Core/Creatures: Set melee sheath as default only for creatures that do not have creature_addon data --- src/server/game/Entities/Creature/Creature.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 6a8ae07291a..a7b57c7323c 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -357,8 +357,9 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data) m_regenHealth = cInfo->RegenHealth; - // creatures always have melee weapon ready if any - SetSheath(SHEATH_STATE_MELEE); + // creatures always have melee weapon ready if any unless specified otherwise + if (!GetCreatureAddon()) + SetSheath(SHEATH_STATE_MELEE); SelectLevel(GetCreatureTemplate()); if (team == HORDE) From a483eb5f11bef57060397ffb8eae07c337f2fc56 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 18 Apr 2012 12:45:58 +0200 Subject: [PATCH 0575/1149] Core/Scripts: Added possibility to remove phase setting from EventMap and an empty-checking method --- src/server/game/AI/CreatureAIImpl.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/game/AI/CreatureAIImpl.h b/src/server/game/AI/CreatureAIImpl.h index 98b0afdefc9..d097adf38ec 100755 --- a/src/server/game/AI/CreatureAIImpl.h +++ b/src/server/game/AI/CreatureAIImpl.h @@ -326,11 +326,15 @@ class EventMap : private std::map uint32 GetPhaseMask() const { return (_phase >> 24) & 0xFF; } + bool Empty() const { return empty(); } + // Sets event phase, must be in range 1 - 8 void SetPhase(uint32 phase) { if (phase && phase < 8) _phase = (1 << (phase + 24)); + else if (!phase) + _phase = 0; } // Creates new event entry in map with given id, time, group if given (1 - 8) and phase if given (1 - 8) From 284894b20b40af00951bdc25dd66dc759bc1d273 Mon Sep 17 00:00:00 2001 From: Frca Date: Wed, 18 Apr 2012 15:10:00 +0200 Subject: [PATCH 0576/1149] Core: Do not set TeleportDestination as reference in WorldSession::HandleMoveWorldportAckOpcode() Signed-off-by: Frca --- src/server/game/Handlers/MovementHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index f1217e58b3f..6c0365a05e9 100755 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -46,7 +46,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() GetPlayer()->SetSemaphoreTeleportFar(false); // get the teleport destination - WorldLocation &loc = GetPlayer()->GetTeleportDest(); + const WorldLocation loc = GetPlayer()->GetTeleportDest(); // possible errors in the coordinate validity check if (!MapManager::IsValidMapCoord(loc)) From d157f4f8045861beec5ec056a4925e6060a01ccd Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Wed, 18 Apr 2012 16:42:32 +0200 Subject: [PATCH 0577/1149] DB/Loot: Increase dropchance for Venture Co. Explosives Closes #6243 --- .../world/2012_04_18_03_world_creature_loot_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_04_18_03_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_04_18_03_world_creature_loot_template.sql b/sql/updates/world/2012_04_18_03_world_creature_loot_template.sql new file mode 100644 index 00000000000..5ad26809cdf --- /dev/null +++ b/sql/updates/world/2012_04_18_03_world_creature_loot_template.sql @@ -0,0 +1,2 @@ +-- Increase dropchance for Venture Co. Explosives +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=-10 WHERE `entry` IN(28123,28124) AND `item`=39651; From 5a37d68d5e96ac63a0e6fd1514627cdf0813d570 Mon Sep 17 00:00:00 2001 From: Helias Date: Wed, 18 Apr 2012 16:49:59 +0200 Subject: [PATCH 0578/1149] DB/Loot: Add some missing Pickpocket loot templates for Northrend creatures ohi Closes #6039 --- ...8_04_world_pickpocketing_loot_template.sql | 501 ++++++++++++++++++ 1 file changed, 501 insertions(+) create mode 100644 sql/updates/world/2012_04_18_04_world_pickpocketing_loot_template.sql diff --git a/sql/updates/world/2012_04_18_04_world_pickpocketing_loot_template.sql b/sql/updates/world/2012_04_18_04_world_pickpocketing_loot_template.sql new file mode 100644 index 00000000000..ab1c562f7dd --- /dev/null +++ b/sql/updates/world/2012_04_18_04_world_pickpocketing_loot_template.sql @@ -0,0 +1,501 @@ +-- implement missing Northrend pickpocket loot +-- reference IDs +SET @NEWREF0 := 10026; +SET @NEWREF1 := @NEWREF0+1; +SET @NEWREF2 := @NEWREF0+2; +SET @NEWREF3 := @NEWREF0+3; +SET @NEWREF4 := @NEWREF0+4; +SET @NEWREF5 := @NEWREF0+5; +SET @NEWREF6 := @NEWREF0+6; +SET @NEWREF7 := @NEWREF0+7; +SET @NEWREF8 := @NEWREF0+8; +SET @NEWREF9 := @NEWREF0+9; +-- new references +DELETE FROM `reference_loot_template` WHERE entry IN (@NEWREF0, @NEWREF1, @NEWREF2, @NEWREF3, @NEWREF4, @NEWREF5, @NEWREF6, @NEWREF7, @NEWREF8, @NEWREF9); +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`mincountOrRef`,`maxcount`) VALUES +(@NEWREF0,33447,25,1,1),-- Runic Healing Potion +(@NEWREF0,35953,30,1,1),-- Mead Basted Caribou +(@NEWREF0,38260,50,1,1),-- Empty Tobacco Pouch +(@NEWREF0,43575,80,1,1),-- Reinforced Junkbox +(@NEWREF1,36862,4,1,1),-- Wrogn Troll Dice +(@NEWREF1,40202,20,1,1),-- Sizzling Grizzly Flank +(@NEWREF2,33452,30,1,1),-- Honey-Spiced Lichen +(@NEWREF2,38269,35,1,1),-- Soggy Handkerchief +(@NEWREF3,33454,15,1,1),-- Salted Venison +(@NEWREF3,38261,13,1,1),-- Ben House Key +(@NEWREF4,38263,19,1,1),-- Too-Small Amband +(@NEWREF4,38264,18,1,1),-- A Very Pretty Rock +(@NEWREF5,29448,9,1,1),-- Mag'har Mild Cheese +(@NEWREF5,29450,13,1,1),-- Telaari Grapes +(@NEWREF5,37467,40,1,1),-- A Steamy Romance Novel: Forbidden Love +(@NEWREF6,35947,25,1,1),-- Sparkling Frostcap +(@NEWREF6,38269,40,1,1),-- Soggy Handkerchief +(@NEWREF7,33447,25,1,1),-- Runic Healing Potion +(@NEWREF7,35947,25,1,1),-- Sparkling Frostcap +(@NEWREF7,38269,40,1,1),-- Soggy Handkerchief +(@NEWREF7,43575,80,1,1),-- Reinforced Junkbox +(@NEWREF8,35948,11,1,1),-- Savory Snowplum +(@NEWREF8,35950,9,1,1),-- Sweet Potato Bread +(@NEWREF8,35952,8,1,1),-- Briny Hardcheese +(@NEWREF9,33447,25,1,1),-- Runic Healing Potion +(@NEWREF9,38260,50,1,1),-- Empty Tobacco Pouch +(@NEWREF9,43575,80,1,1); -- Reinforced Junkbox +-- implement pickpokect loot +UPDATE `creature_template` SET `pickpocketloot`=entry WHERE `entry` IN (25800,23667,23674,23760,23796,23865,23875,23963,24069,24262,24400,24460,25351,25427,25428,25429,25430,25601,25801,26073,26202,26334,26413,26447,26480,26481,26620,26621,26624,26626,26635,26636,26637,26639,26658,26681,26696,26727,26729,26800,26802,26836,26948,27105,27210,27211,/**/27234,27235,27247,27278,27289,27334,27342,27431,27533,27580,27639,27640,27699,27800,27859,27860,27961,27964,27965,28494,28496,28565,28803,28837,28838,28848,28961,28965,29369,29407,29553,29554,29656,29793,29820,29822,29836,29874,29875,29885,29920,30283,30319,30856,30868,31396,31554,32263); +UPDATE `creature_template` SET `pickpocketloot`=25430 WHERE `entry` IN (23654,23656,23663,23665,25434,26728,26827,26926,27554,32572); +UPDATE `creature_template` SET `pickpocketloot`=26481 WHERE `entry` IN (23662,23940,24016,24161,26493,26655,27007,27009); +UPDATE `creature_template` SET `pickpocketloot`=25351 WHERE `entry` IN (23993,24540,25224,25383,26343,26492,26891,26946,27224,27226,27283,27360,27552,27799,27823,27826,28564,28750); +UPDATE `creature_template` SET `pickpocketloot`=27533 WHERE `entry` IN (26555,26669,26670,26694,26830,27871,28022,28108,28242,28268,28419,29123,29133,29722,29738,30701,30894,30922,30949,31139,31150,31779,31847,32278,32505); +UPDATE `creature_template` SET `pickpocketloot`=30319 WHERE `entry` IN (30111,30179); +DELETE FROM `pickpocketing_loot_template` WHERE entry IN (25800,23656,23662,23663,23665,23667,23674,23760,23796,23865,23875,23940,23963,23993,24016,24069,24161,24262,24400,24460,24540,25224,25351,25383,25427,25428,25429,25430,25434,25601,25801,26073,26202,26334,26343,26413,26447,26480,26481,26492,26493,26555,26620,26621,26624,26626,26635,26636,26637,26639,26655,26658,26669,26670,26681,26694,26696,26727,26728,26729,26800,26802,26827,26830,26836,26891,26926,26946,26948,27007,27009,27105,27210,27211,27224,27226,27234,27235,27247,27278,27283,27289,27334,27342,27360,27431,27533,27552,27554,27580,27639,27640,27699,27799,27800,27823,27826,27859,27860,27871,27961,27964,27965,28022,28108,28242,28268,28419,28494,28496,28564,28565,28750,28803,28837,28838,28848,28961,28965,29123,29133,29369,29407,29553,29554,29656,29722,29738,29793,29820,29822,29836,29874,29875,29885,29920,30111,30179,30283,30319,30701,30856,30868,30894,30922,30949,31139,31150,31396,31554,31779,31847,32263,32278,32505,32572); +INSERT INTO `pickpocketing_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Plague Walker +(30283,43575,100,0,1,1),-- Reinforced Junkbox +(30283,0,100,0,-@NEWREF6,1), +-- Twilight Darkcaster +(30319,0,100,0,-@NEWREF0,1), +(30319,33449,11,0,1,1),-- Crusty Flatbread +(30319,1,100,0,-@NEWREF1,1), +(30319,2,100,0,-@NEWREF3,1), +-- High Priest Talet-Kha +(26073,43575,58,0,1,1),-- Reinforced Junkbox +(26073,0,100,0,-@NEWREF5,1), +(26073,33449,8,0,1,1),-- Crusty Flatbread +(26073,33447,8,0,1,1),-- Runic Healing Potion +-- Nedar, Lord of Rhinos +(25801,0,100,0,-@NEWREF5,1), +(25801,33447,6,0,1,1),-- Runic Healing Potion +(25801,38261,6,0,1,1),-- Bent House Key +-- Clam Master K +(25800,43575,47,0,1,1),-- Reinforced Junkbox +(25800,0,100,0,-@NEWREF5,1), +(25800,38261,15,0,1,1),-- Bent House Key +(25800,33449,5,0,1,1),-- Crusty Flatbread +(25800,33447,5,0,1,1),-- Runic Healing Potion +-- Magmothregar +(25430,0,100,0,-@NEWREF3,1), +(25430,1,100,0,-@NEWREF9,1), +(25430,33449,7,0,1,1),-- Crusty Flatbread +(25430,36862,4,0,1,1),-- Wrogn Troll Dice +-- Kaganishu +(25427,43575,43,0,1,1),-- Reinforced Junkbox +(25427,33454,35,0,1,1),-- Salted Venison +(25427,0,100,0,-@NEWREF4,1), +(25427,33447,8,0,1,1),-- Runic Healing Potion +-- Prince Valanar +(25601,43575,43,0,1,1),-- Reinforced Junkbox +(25601,37467,39,0,1,1),-- A Steamy Romance Novel: Forbidden Love +(25601,33447,9,0,1,1),-- Runic Healing Potion +(25601,38261,9,0,1,1),-- Bent House Key +(25601,33449,4,0,1,1),-- Crusty Flatbread +(25601,29450,4,0,1,1),-- Telaari Grapes +-- Ghostly Sage +(25351,43575,42,0,1,1),-- Reinforced Junkbox +(25351,0,100,0,-@NEWREF2,1), +(25351,33447,10,0,1,1),-- Runic Healing Potion +-- Luthion the Vile +(27860,43575,42,0,1,1),-- Reinforced Junkbox +(27860,0,100,0,-@NEWREF5,1), +(27860,38261,13,0,1,1),-- Bent House Key +(27860,33449,6,0,1,1),-- Crusty Flatbread +(27860,33447,6,0,1,1),-- Runic Healing Potion +-- Reckless Scavenger +(26658,0,100,0,-@NEWREF2,1), +(26658,43575,40,0,1,1),-- Reinforced Junkbox +-- Ziggurat Defender +(26202,43575,40,0,1,1),-- Reinforced Junkbox +(26202,0,100,0,-@NEWREF2,1), +(26202,33447,7,0,1,1),-- Runic Healing Potion +(26202,29569,3,0,1,1),-- Strong Junkbox +-- Magmoth Forager +(25429,43575,39,0,1,1),-- Reinforced Junkbox +(25429,33454,27,0,1,1),-- Salted Venison +(25429,0,100,0,-@NEWREF4,1), +(25429,33447,10,0,1,1),-- Runic Healing Potion +(25429,38266,0.5,0,1,1),-- Rotund Relic +-- Magmoth Shaman +(25428,43575,39,0,1,1),-- Reinforced Junkbox +(25428,33454,28,0,1,1),-- Salted Venison +(25428,0,100,0,-@NEWREF4,1), +(25428,33447,9,0,1,1),-- Runic Healing Potion +(25428,38266,0.5,0,1,1),-- Rotund Relic +-- Vanthryn the Merciless +(27859,43575,39,0,1,1),-- Reinforced Junkbox +(27859,0,100,0,-@NEWREF5,1), +(27859,33449,12,0,1,1),-- Crusty Flatbread +(27859,38261,12,0,1,1),-- Bent House Key +(27859,33447,3,0,1,1),-- Runic Healing Potion +-- Unbound Corrupter +(30868,43575,47,0,1,1),-- Reinforced Junkbox +(30868,40202,18,0,1,1),-- Sizzling Grizzly Flank +(30868,33447,16,0,1,1),-- Runic Healing Potion +(30868,0,100,0,-@NEWREF4,1), +-- Unbound Trickster +(30856,43575,38,0,1,1),-- Reinforced Junkbox +(30856,0,100,0,-@NEWREF4,1), +(30856,33447,19,0,1,1),-- Runic Healing Potion +(30856,40202,14,0,1,1),-- Sizzling Grizzly Flank +-- Kreug Oathbreaker +(27105,43575,63,0,1,1),-- Reinforced Junkbox +(27105,33447,25,0,1,1),-- Runic Healing Potion +(27105,38269,13,0,1,1),-- Soggy Handkerchief +-- Lead Cannoneer Zierhut +(27235,43575,53,0,1,1),-- Reinforced Junkbox +(27235,0,100,0,-@NEWREF5,1), +(27235,33447,8,0,1,1),-- Runic Healing Potion +(27235,38261,8,0,1,1),-- Bent House Key +-- Devout Bodyguard +(27247,43575,50,0,1,1),-- Reinforced Junkbox +(27247,37467,42,0,1,1),-- A Steamy Romance Novel: Forbidden Love +(27247,33447,8,0,1,1),-- Runic Healing Potion +(27247,29450,8,0,1,1),-- Telaari Grapes +(27247,38261,8,0,1,1),-- Bent House Key +-- Magnataur Alpha +(26481,0,100,0,-@NEWREF9,1), +(26481,1,100,0,-@NEWREF3,1), +(26481,33449,5,0,1,1),-- Crusty Flatbread +-- High General Abbendis +(27210,43575,48,0,1,1),-- Reinforced Junkbox +(27210,0,100,0,-@NEWREF5,1), +(27210,33449,10,0,1,1),-- Crusty Flatbread +(27210,33447,10,0,1,1),-- Runic Healing Potion +(27210,38261,8,0,1,1),-- Bent House Key +-- Anub'ar Dreadweaver +(26413,43575,44,0,1,1),-- Reinforced Junkbox +(26413,43576,22,0,1,1),-- Chitin Polish +(26413,33452,11,0,1,1),-- Honey-Spiced Lichen +(26413,33447,11,0,1,1),-- Runic Healing Potion +(26413,43577,11,0,1,1),-- Carapace Cleanser +-- Naxxramas Necrolord +(27289,33452,44,0,1,1),-- Honey-Spiced Lichen +(27289,43575,44,0,1,1),-- Reinforced Junkbox +(27289,33447,11,0,1,1),-- Runic Healing Potion +-- Onslaught Commander Iustus +(27334,37467,50,0,1,1),-- A Steamy Romance Novel: Forbidden Love +(27334,43575,44,0,1,1),-- Reinforced Junkbox +(27334,29448,13,0,1,1),-- Mag'har Mild Cheese +(27334,38261,6,0,1,1),-- Bent House Key +-- Blacksmith Goodman +(27234,43575,41,0,1,1),-- Reinforced Junkbox +(27234,0,100,0,-@NEWREF5,1), +(27234,38261,13,0,1,1),-- Bent House Key +(27234,33447,9,0,1,1),-- Runic Healing Potion +(27234,33449,7,0,1,1),-- Crusty Flatbread +-- Magnataur Youngling +(26480,33449,19,0,1,1),-- Crusty Flatbread +(26480,0,100,0,-@NEWREF3,1), +(26480,1,100,0,-@NEWREF9,1), +-- Bloodpaw Warrior +(27342,43575,40,0,1,1),-- Reinforced Junkbox +(27342,33454,26,0,1,1),-- Salted Venison +(27342,0,100,0,-@NEWREF4,1), +(27342,33447,11,0,1,1),-- Runic Healing Potion +(27342,38266,0.6,0,1,1),-- Rotund Relic +-- Frigid Geist +(27533,0,100,0,-@NEWREF7,1), +-- Snowplain Zealot +(27278,43575,40,0,1,1),-- Reinforced Junkbox +(27278,33454,22,0,1,1),-- Salted Venison +(27278,0,100,0,-@NEWREF4,1), +(27278,33447,12,0,1,1),-- Runic Healing Potion +(27278,38266,0.3,0,1,1),-- Rotund Relic +-- Hulking Atrocity +(26948,43575,39,0,1,1),-- Reinforced Junkbox +(26948,0,100,0,-@NEWREF2,1), +(26948,33447,9,0,1,1),-- Runic Healing Potion +(26948,29569,0.3,0,1,1),-- Strong Junkbox +(26948,38268,0.3,0,1,1),-- Spare Hand +-- Onslaught Executioner +(27211,43575,39,0,1,1),-- Reinforced Junkbox +(27211,0,100,0,-@NEWREF5,1), +(27211,33449,12,0,1,1),-- Crusty Flatbread +(27211,38261,11,0,1,1),-- Bent House Key +(27211,33447,5,0,1,1),-- Runic Healing Potion +-- Gigantaur +(26836,0,100,0,-@NEWREF9,1), +(26836,1,100,0,-@NEWREF3,1), +(26836,33449,12,0,1,1),-- Crusty Flatbread +-- Leprous Servant +(27800,43575,38,0,1,1),-- Reinforced Junkbox +(27800,0,100,0,-@NEWREF2,1), +(27800,33447,7,0,1,1),-- Runic Healing Potion +(27800,38268,2,0,1,1),-- Spare Hand +-- Wretched Belcher +(26624,43575,100,0,1,1),-- Reinforced Junkbox +(26624,0,100,0,-@NEWREF2,1), +(26624,33447,25,0,1,1),-- Runic Healing Potion +(26624,35947,25,0,1,1),-- Sparkling Frostcap +-- Drakkari Commander +(27431,43575,90,0,1,1),-- Reinforced Junkbox +(27431,0,100,0,-@NEWREF2,1), +(27431,33447,26,0,1,1),-- Runic Healing Potion +(27431,35947,10,0,1,1),-- Sparkling Frostcap +-- Drakkari Guardian +(26620,0,100,0,-@NEWREF0,1), +(26620,33454,17,0,1,1),-- Salted Venison +(26620,33449,9,0,1,1),-- Crusty Flatbread +(26620,38261,9,0,1,1),-- Bent House Key +(26620,1,100,0,-@NEWREF1,1), +-- Risen Drakkari Soulmage +(26636,43575,85,0,1,1),-- Reinforced Junkbox +(26636,0,100,0,-@NEWREF2,1), +(26636,35947,21,0,1,1),-- Sparkling Frostcap +(26636,33447,16,0,1,1),-- Runic Healing Potion +-- Ghoul Tormentor +(26621,43575,81,0,1,1),-- Reinforced Junkbox +(26621,0,100,0,-@NEWREF2,1), +(26621,35947,24,0,1,1),-- Sparkling Frostcap +(26621,33447,14,0,1,1),-- Runic Healing Potion +-- Risen Drakkari Warrior +(26635,43575,71,0,1,1),-- Reinforced Junkbox +(26635,0,100,0,-@NEWREF2,1), +(26635,33447,29,0,1,1),-- Runic Healing Potion +(26635,35947,18,0,1,1),-- Sparkling Frostcap +(26635,38268,0.8,0,1,1),-- Spare Hand +-- Risen Drakkari Handler +(26637,0,100,0,-@NEWREF2,1), +(26637,43575,67,0,1,1),-- Reinforced Junkbox +(26637,33447,30,0,1,1),-- Runic Healing Potion +(26637,35947,18,0,1,1),-- Sparkling Frostcap +-- Scourge Reanimator +(26626,0,100,0,-@NEWREF2,1), +(26626,43575,67,0,1,1),-- Reinforced Junkbox +(26626,33447,21,0,1,1),-- Runic Healing Potion +(26626,35947,21,0,1,1),-- Sparkling Frostcap +-- Drakkari Shaman +(26639,0,100,0,-@NEWREF0,1), +(26639,33449,18,0,1,1),-- Crusty Flatbread +(26639,1,100,0,-@NEWREF3,1), +(26639,40202,11,0,1,1),-- Sizzling Grizzly Flank +-- Selas +(27580,43575,50,0,1,1),-- Reinforced Junkbox +(27580,0,100,0,-@NEWREF3,1), +(27580,38260,20,0,1,1),-- Empty Tobacco Pouch +-- Forgemaster Damrath +(26334,43575,48,0,1,1),-- Reinforced Junkbox +(26334,0,100,0,-@NEWREF5,1), +(26334,33447,9,0,1,1),-- Runic Healing Potion +(26334,38261,9,0,1,1),-- Bent House Key +-- Grumbald One-Eye +(26681,43575,39,0,1,1),-- Reinforced Junkbox +(26681,33454,28,0,1,1),-- Salted Venison +(26681,0,100,0,-@NEWREF4,1), +(26681,33447,9,0,1,1),-- Runic Healing Potion +-- Drakkari Shaman +(26447,0,100,0,-@NEWREF9,1), +(26447,1,100,0,-@NEWREF3,1), +(26447,33449,10,0,1,1),-- Crusty Flatbread +(26447,35799,0.2,0,1,1),-- Frozen Mojo +(26447,36862,0.2,0,1,1),-- Wrogn Troll Dice +-- Drakkari God Hunter +(29820,0,100,0,-@NEWREF0,1), +(29820,1,100,0,-@NEWREF1,1), +-- Drakkari Battle Rider +(29836,0,100,0,-@NEWREF0,1), +(29836,40202,18,0,1,1),-- Sizzling Grizzly Flank +-- Ruins Dweller +(29920,43575,71,0,1,1),-- Reinforced Junkbox +(29920,37452,69,0,1,1),-- Fatty Bluefin +(29920,38274,58,0,1,1),-- Large Snail Shell +(29920,38273,35,0,1,1),-- Brain Coral +(29920,33447,16,0,1,1),-- Runic Healing Potion +-- Drakkari Fire Weaver +(29822,0,100,0,-@NEWREF0,1), +(29822,40202,24,0,1,1),-- Sizzling Grizzly Flank +-- Drakkari Inciter +(29874,0,100,0,-@NEWREF0,1), +(29874,36862,16,0,1,1),-- Wrogn Troll Dice +(29874,40202,12,0,1,1),-- Sizzling Grizzly Flank +-- Titanium Siegebreaker +(28961,0,100,0,-@NEWREF0,1), +(28961,40202,35,0,1,1),-- Sizzling Grizzly Flank +-- Stormforged Sentinel +(28837,0,100,0,-@NEWREF0,1), +(28837,40202,16,0,1,1),-- Sizzling Grizzly Flank +-- Titanium Thunderer +(28965,0,100,0,-@NEWREF0,1), +(28965,40202,44,0,1,1),-- Sizzling Grizzly Flank +-- Titanium Vanguard +(28838,0,100,0,-@NEWREF0,1), +(28838,40202,27,0,1,1),-- Sizzling Grizzly Flank +-- Dark Rune Scholar +(27964,0,100,0,-@NEWREF9,1), +(27964,1,100,0,-@NEWREF1,1), +-- Dark Rune Worker +(27961,0,100,0,-@NEWREF0,1), +(27961,40202,29,0,1,1),-- Sizzling Grizzly Flank +(27961,36862,4,0,1,1),-- Wrogn Troll Dice +-- Dark Rune Shaper +(27965,0,100,0,-@NEWREF0,1), +(27965,40202,28,0,1,1),-- Sizzling Grizzly Flank +-- Steel Gate Archaeologist +(24400,0,100,0,-@NEWREF0,1), +(24400,1,100,0,-@NEWREF5,1), +(24400,33449,7,0,1,1),-- Crusty Flatbread +(24400,38261,9,0,1,1),-- Bent House Key +-- Blacksouled Keeper +(23875,0,100,0,-@NEWREF0,1), +(23875,1,100,0,-@NEWREF3,1), +(23875,33449,14,0,1,1),-- Crusty Flatbread +-- Winterskorn Rune-Seer +(23667,0,100,0,-@NEWREF0,1), +(23667,33449,7,0,1,1),-- Crusty Flatbread +(23667,33454,7,0,1,1),-- Salted Venison +-- Sergeant Lorric +(23963,43575,45,0,1,1),-- Reinforced Junkbox +(23963,0,100,0,-@NEWREF5,1), +(23963,33447,13,0,1,1),-- Runic Healing Potion +(23963,38261,11,0,1,1),-- Bent House Key +(23963,33449,7,0,1,1),-- Crusty Flatbread +-- Gjalerhorn Scavenger +(27699,0,100,0,-@NEWREF4,1), +(27699,43575,43,0,1,1),-- Reinforced Junkbox +(27699,33454,22,0,1,1),-- Salted Venison +(27699,33447,7,0,1,1),-- Runic Healing Potion +(27699,29569,0.8,0,1,1),-- Strong Junkbox +-- Iron Rune Binder +(23796,0,100,0,-@NEWREF5,1), +(23796,43575,42,0,1,1),-- Reinforced Junkbox +(23796,38261,12,0,1,1),-- Bent House Key +(23796,33449,11,0,1,1),-- Crusty Flatbread +(23796,33447,9,0,1,1),-- Runic Healing Potion +(23796,29569,0.5,0,1,1),-- Strong Junkbox +-- Forsaken Plaguebringer +(23760,0,100,0,-@NEWREF2,1), +(23760,43575,41,0,1,1),-- Reinforced Junkbox +(23760,33447,10,0,1,1),-- Runic Healing Potion +(23760,38268,0.3,0,1,1),-- Spare Hand +-- Chillmere Tidehunter +(24460,43575,40,0,1,1),-- Reinforced Junkbox +(24460,38274,33,0,1,1),-- Large Snail Shell +(24460,37452,18,0,1,1),-- Fatty Bluefin +(24460,38273,15,0,1,1),-- Brain Coral +(24460,33447,7,0,1,1),-- Runic Healing Potion +-- Vrykul Soul +(24262,0,100,0,-@NEWREF2,1), +(24262,43575,40,0,1,1),-- Reinforced Junkbox +(24262,33447,3,0,1,1),-- Runic Healing Potion +-- Iron Rune Sage +(23674,0,100,0,-@NEWREF5,1), +(23674,43575,39,0,1,1),-- Reinforced Junkbox +(23674,38261,13,0,1,1),-- Bent House Key +(23674,33449,9,0,1,1),-- Crusty Flatbread +(23674,33447,6,0,1,1),-- Runic Healing Potion +-- Vengeance Bringer +(23865,43575,39,0,1,1),-- Reinforced Junkbox +(23865,0,100,0,-@NEWREF2,1), +-- Restless Lookout +(31554,43575,80,0,1,1),-- Reinforced Junkbox +(31554,35947,40,0,1,1),-- Sparkling Frostcap +-- Val'kyr Taskmistress +(31396,43575,56,0,1,1),-- Reinforced Junkbox +(31396,35947,38,0,1,1),-- Sparkling Frostcap +(31396,33447,15,0,1,1),-- Runic Healing Potion +-- Overseer Veraj +(32263,43575,42,0,1,1),-- Reinforced Junkbox +(32263,37467,28,0,1,1),-- A Steamy Romance Novel: Forbidden Love +(32263,38261,15,0,1,1),-- Bent House Key +(32263,33447,13,0,1,1),-- Runic Healing Potion +(32263,0,100,0,-@NEWREF8,1), +-- Steward +(26729,0,100,0,-@NEWREF0,1), +(26729,1,100,0,-@NEWREF3,1), +(26729,33449,31,0,1,1),-- Crusty Flatbread +(26729,29569,0.5,0,1,1),-- Strong Junkbox +-- Alliance Berserker +(26800,43575,62,0,1,1),-- Reinforced Junkbox +(26800,33449,19,0,1,1),-- Crusty Flatbread +(26800,38261,16,0,1,1),-- Bent House Key +(26800,33447,10,0,1,1),-- Runic Healing Potion +(26800,0,100,0,-@NEWREF5,1), +-- Alliance Ranger +(26802,0,100,0,-@NEWREF5,1), +(26802,43575,60,0,1,1),-- Reinforced Junkbox +(26802,38261,34,0,1,1),-- Bent House Key +(26802,33449,24,0,1,1),-- Crusty Flatbread +(26802,33447,12,0,1,1),-- Runic Healing Potion +-- Mage Hunter Ascendant +(26727,0,100,0,-@NEWREF0,1), +(26727,1,100,0,-@NEWREF3,1), +(26727,33449,29,0,1,1),-- Crusty Flatbread +-- Ring-Lord Sorceress +(27639,43575,87,0,1,1),-- Reinforced Junkbox +(27639,37467,46,0,1,1),-- A Steamy Romance Novel: Forbidden Love +(27639,38261,28,0,1,1),-- Bent House Key +(27639,33447,19,0,1,1),-- Runic Healing Potion +(27639,0,100,0,-@NEWREF8,1), +(27639,36863,1.6,0,1,1),-- Decahedral Dwarven Dice +-- Ring-Lord Conjurer +(27640,37467,67,0,1,1),-- A Steamy Romance Novel: Forbidden Love +(27640,43575,64,0,1,1),-- Reinforced Junkbox +(27640,33447,30,0,1,1),-- Runic Healing Potion +(27640,38261,26,0,1,1),-- Bent House Key +(27640,0,100,0,-@NEWREF8,1), +-- Mildred the Cruel +(29885,0,100,0,-@NEWREF0,1), +(29885,40202,13,0,1,1),-- Sizzling Grizzly Flank +-- Snowblind Devotee +(29407,43575,42,0,1,1),-- Reinforced Junkbox +(29407,40202,29,0,1,1),-- Sizzling Grizzly Flank +(29407,0,100,0,-@NEWREF4,1), +(29407,33447,12,0,1,1),-- Runic Healing Potion +-- Snowblind Devotee +(29554,43575,43,0,1,1),-- Reinforced Junkbox +(29554,40202,27,0,1,1),-- Sizzling Grizzly Flank +(29554,0,100,0,-@NEWREF4,1), +(29554,33447,12,0,1,1),-- Runic Healing Potion +(29554,38266,0.2,0,1,1),-- Rotund Relic +-- Frostfeather Witch +(29793,43575,40,0,1,1),-- Reinforced Junkbox +(29793,40202,21,0,1,1),-- Sizzling Grizzly Flank +(29793,0,100,0,-@NEWREF4,1), +(29793,33447,16,0,1,1),-- Runic Healing Potion +-- Icemane Yeti +(29875,43575,39,0,1,1),-- Reinforced Junkbox +(29875,40202,23,0,1,1),-- Sizzling Grizzly Flank +(29875,0,100,0,-@NEWREF4,1), +(29875,33447,15,0,1,1),-- Runic Healing Potion +(29875,38266,0.3,0,1,1),-- Rotund Relic +-- Garm Watcher +(29553,0,100,0,-@NEWREF0,1), +(29553,1,100,0,-@NEWREF1,1), +(29553,24231,0.3,0,2,2),-- Coarse Snuff +-- Stormforged Taskmaster +(29369,43575,38,0,1,1),-- Reinforced Junkbox +(29369,37467,34,0,1,1),-- A Steamy Romance Novel: Forbidden Love +(29369,33447,13,0,1,1),-- Runic Healing Potion +(29369,38261,6,0,1,1),-- Bent House Key +(29369,0,100,0,-@NEWREF8,1), +-- Dragonflayer Bonecrusher +(24069,0,100,0,-@NEWREF0,1), +(24069,1,100,0,-@NEWREF1,1), +(24069,29569,47,0,1,1),-- Strong Junkbox +(24069,29570,34,0,1,1),-- A Gnome Effigy +(24069,27855,22,0,1,1),-- Mag'har Grainbread +(24069,27854,19,0,1,1),-- Smoked Talbuk Venison +(24069,22829,10,0,1,1),-- Super Healing Potion +(24069,23438,1.2,0,1,1),-- Star of Elune +-- Ymirjar Berserker +(26696,0,100,0,-@NEWREF7,1), +(26696,29569,1.1,0,1,1),-- Strong Junkbox +-- Kutube'sa +(28494,0,100,0,-@NEWREF0,1), +(28494,1,100,0,-@NEWREF1,1), +-- Chulo the Mad +(28496,0,100,0,-@NEWREF0,1), +(28496,40202,6,0,1,1),-- Sizzling Grizzly Flank +-- Drakuru's Guard +(28803,43575,50,0,1,1),-- Reinforced Junkbox +(28803,33447,33,0,1,1),-- Runic Healing Potion +(28803,38269,17,0,1,1),-- Soggy Handkerchief +-- Prophet of Har'koa +(28848,0,100,0,-@NEWREF0,1), +(28848,40202,3,0,1,1),-- Sizzling Grizzly Flank +-- Decaying Ghoul +(28565,0,100,0,-@NEWREF7,1), +(28565,22829,0.9,0,1,1),-- Super Healing Potion +-- Drakuru Berserker +(29656,0,100,0,-@NEWREF0,1), +(29656,1,100,0,-@NEWREF3,1), +(29656,33449,11,0,1,1),-- Crusty Flatbread +(29656,29569,0.9,0,1,1); -- Strong Junkbox From 0497283c1e71620f12fb2118fa51bb3a5987a797 Mon Sep 17 00:00:00 2001 From: Moriquendu Date: Wed, 18 Apr 2012 17:00:44 +0200 Subject: [PATCH 0579/1149] DB/Conditions: Add a condition to the Lovely Charm aura Closes #5359 --- sql/updates/world/2012_04_18_05_world_conditions.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2012_04_18_05_world_conditions.sql diff --git a/sql/updates/world/2012_04_18_05_world_conditions.sql b/sql/updates/world/2012_04_18_05_world_conditions.sql new file mode 100644 index 00000000000..ecf80f270a3 --- /dev/null +++ b/sql/updates/world/2012_04_18_05_world_conditions.sql @@ -0,0 +1,4 @@ +-- Add condition to the Lovely Charm aura +DELETE FROM conditions WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`= 69511; +INSERT INTO conditions (SourceTypeOrReferenceId, SourceGroup, SourceEntry, ElseGroup, ConditionTypeOrReference, ConditionValue1, ConditionValue2, ConditionValue3, ErrorTextId, ScriptName, COMMENT) VALUES +(17,0,69511,0,12,8,0,0,0, '', 'Lovely Charm - Only during event'); From 7dc228ea54dca734a9badcc41d5a4efe9f18c650 Mon Sep 17 00:00:00 2001 From: The Game Date: Wed, 18 Apr 2012 13:39:07 -0400 Subject: [PATCH 0580/1149] Fix code style, thanks Discover. --- src/server/game/Entities/Object/Object.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 851c0f47e0f..8bf22c8b7a0 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -626,11 +626,9 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* if (!target->isAllowedToLoot(creature)) dynamicFlags &= ~UNIT_DYNFLAG_LOOTABLE; } - if(Unit const* unit = ToUnit()) - { - if(!unit->HasAuraTypeWithCaster(SPELL_AURA_MOD_STALKED, target->GetGUID())) + if (Unit const* unit = ToUnit()) + if (!unit->HasAuraTypeWithCaster(SPELL_AURA_MOD_STALKED, target->GetGUID())) dynamicFlags &= ~UNIT_DYNFLAG_TRACK_UNIT; - } *data << dynamicFlags; } // FG: pretend that OTHER players in own group are friendly ("blue") From 5b80e7360bb588c47ee157e1e19f1a7dff834510 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 18 Apr 2012 13:57:12 -0500 Subject: [PATCH 0581/1149] Core/Collision: Disable LoS check for destroyed destructible buildings. More research has to be done. Closes #6228 --- src/server/game/Entities/GameObject/GameObject.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index d96c9052b7a..f58dd6b2e4d 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -1825,6 +1825,7 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* m_goValue->Building.Health = m_goValue->Building.MaxHealth; SetGoAnimProgress(255); } + EnableCollision(true); break; case GO_DESTRUCTIBLE_DAMAGED: { @@ -1881,6 +1882,7 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* m_goValue->Building.Health = 0; SetGoAnimProgress(0); } + EnableCollision(false); break; } case GO_DESTRUCTIBLE_REBUILDING: @@ -1900,6 +1902,7 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* m_goValue->Building.Health = m_goValue->Building.MaxHealth; SetGoAnimProgress(255); } + EnableCollision(true); break; } } From 4818c70dcb4fba92919333d50a54458c4f4e5e7e Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 18 Apr 2012 22:27:40 +0200 Subject: [PATCH 0582/1149] Core/Spells: Removed unneeded phase check from spell casts, its already done in canSeeOrDetect for spells that need it. Probably more phase checks are not needed either --- .../game/AI/EventAI/CreatureEventAI.cpp | 2 +- src/server/game/Combat/ThreatManager.cpp | 3 ++- src/server/game/Entities/Object/Object.h | 4 +-- src/server/game/Entities/Unit/Unit.cpp | 4 +-- .../game/Grids/Notifiers/GridNotifiers.h | 2 +- .../game/Grids/Notifiers/GridNotifiersImpl.h | 25 ++++++++----------- 6 files changed, 18 insertions(+), 22 deletions(-) diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp index 7a2b83273c9..835705a0d7c 100755 --- a/src/server/game/AI/EventAI/CreatureEventAI.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp @@ -1107,7 +1107,7 @@ void CreatureEventAI::UpdateAI(const uint32 diff) break; case EVENT_T_RANGE: if (me->getVictim()) - if (me->IsInMap(me->getVictim())) + if (me->IsInMap(me->getVictim()) && me->InSamePhase(me->getVictim())) if (me->IsInRange(me->getVictim(), (float)(*i).Event.range.minDist, (float)(*i).Event.range.maxDist)) ProcessEvent(*i); break; diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index d82e43ba83b..e604eaf9024 100755 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -75,7 +75,7 @@ bool ThreatCalcHelper::isValidProcess(Unit* hatedUnit, Unit* hatingUnit, SpellIn return false; // not in same map or phase - if (!hatedUnit->IsInMap(hatingUnit)) + if (!hatedUnit->IsInMap(hatingUnit) || !hatedUnit->InSamePhase(hatingUnit)) return false; // spell not causing threat @@ -182,6 +182,7 @@ void HostileReference::updateOnlineStatus() && (getTarget()->GetTypeId() != TYPEID_PLAYER || !getTarget()->ToPlayer()->isGameMaster()) && !getTarget()->HasUnitState(UNIT_STATE_IN_FLIGHT) && getTarget()->IsInMap(getSourceUnit()) + && getTarget()->InSamePhase(getSourceUnit()) ) { Creature* creature = getSourceUnit()->ToCreature(); diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 39be4d4f529..3693f683b24 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -685,7 +685,7 @@ class WorldObject : public Object, public WorldLocation bool IsInMap(const WorldObject* obj) const { if (obj) - return IsInWorld() && obj->IsInWorld() && (GetMap() == obj->GetMap()) && InSamePhase(obj); + return IsInWorld() && obj->IsInWorld() && (GetMap() == obj->GetMap()); return false; } bool IsWithinDist3d(float x, float y, float z, float dist) const @@ -703,7 +703,7 @@ class WorldObject : public Object, public WorldLocation } bool IsWithinDistInMap(WorldObject const* obj, float dist2compare, bool is3D = true) const { - return obj && IsInMap(obj) && _IsWithinDist(obj, dist2compare, is3D); + return obj && IsInMap(obj) && InSamePhase(obj) && _IsWithinDist(obj, dist2compare, is3D); } bool IsWithinLOS(float x, float y, float z) const; bool IsWithinLOSInMap(const WorldObject* obj) const; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index da23a7ba010..fb91c3fc9f1 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -460,7 +460,7 @@ void Unit::resetAttackTimer(WeaponAttackType type) bool Unit::IsWithinCombatRange(const Unit* obj, float dist2compare) const { - if (!obj || !IsInMap(obj)) + if (!obj || !IsInMap(obj) || !InSamePhase(obj)) return false; float dx = GetPositionX() - obj->GetPositionX(); @@ -476,7 +476,7 @@ bool Unit::IsWithinCombatRange(const Unit* obj, float dist2compare) const bool Unit::IsWithinMeleeRange(const Unit* obj, float dist) const { - if (!obj || !IsInMap(obj)) + if (!obj || !IsInMap(obj) || !InSamePhase(obj)) return false; float dx = GetPositionX() - obj->GetPositionX(); diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index ec79db769da..e81822e72be 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -1287,7 +1287,7 @@ namespace Trinity AllWorldObjectsInRange(const WorldObject* object, float maxRange) : m_pObject(object), m_fRange(maxRange) {} bool operator() (WorldObject* go) { - return m_pObject->IsWithinDist(go, m_fRange, false); + return m_pObject->IsWithinDist(go, m_fRange, false) && m_pObject->InSamePhase(go); } private: const WorldObject* m_pObject; diff --git a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h index 40b3863679b..e3cda4dd76d 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h +++ b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h @@ -251,9 +251,8 @@ void Trinity::WorldObjectListSearcher::Visit(PlayerMapType &m) return; for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) - if (itr->getSource()->InSamePhase(i_phaseMask)) - if (i_check(itr->getSource())) - i_objects.push_back(itr->getSource()); + if (i_check(itr->getSource())) + i_objects.push_back(itr->getSource()); } template @@ -263,9 +262,8 @@ void Trinity::WorldObjectListSearcher::Visit(CreatureMapType &m) return; for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) - if (itr->getSource()->InSamePhase(i_phaseMask)) - if (i_check(itr->getSource())) - i_objects.push_back(itr->getSource()); + if (i_check(itr->getSource())) + i_objects.push_back(itr->getSource()); } template @@ -275,9 +273,8 @@ void Trinity::WorldObjectListSearcher::Visit(CorpseMapType &m) return; for (CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr) - if (itr->getSource()->InSamePhase(i_phaseMask)) - if (i_check(itr->getSource())) - i_objects.push_back(itr->getSource()); + if (i_check(itr->getSource())) + i_objects.push_back(itr->getSource()); } template @@ -287,9 +284,8 @@ void Trinity::WorldObjectListSearcher::Visit(GameObjectMapType &m) return; for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr) - if (itr->getSource()->InSamePhase(i_phaseMask)) - if (i_check(itr->getSource())) - i_objects.push_back(itr->getSource()); + if (i_check(itr->getSource())) + i_objects.push_back(itr->getSource()); } template @@ -299,9 +295,8 @@ void Trinity::WorldObjectListSearcher::Visit(DynamicObjectMapType &m) return; for (DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr) - if (itr->getSource()->InSamePhase(i_phaseMask)) - if (i_check(itr->getSource())) - i_objects.push_back(itr->getSource()); + if (i_check(itr->getSource())) + i_objects.push_back(itr->getSource()); } // Gameobject searchers From 55bfb6247fb6ff4aa7ac1f24bc1ce18de15721ed Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Wed, 18 Apr 2012 23:03:16 +0200 Subject: [PATCH 0583/1149] DB/Creature: Remove skinning loot from Blackwing Spellbinder Closes #2228 --- sql/updates/world/2012_04_18_06_world_creature_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_04_18_06_world_creature_template.sql diff --git a/sql/updates/world/2012_04_18_06_world_creature_template.sql b/sql/updates/world/2012_04_18_06_world_creature_template.sql new file mode 100644 index 00000000000..8c167c2ffa1 --- /dev/null +++ b/sql/updates/world/2012_04_18_06_world_creature_template.sql @@ -0,0 +1,2 @@ +-- Remove Skinning loot from Blackwing Spellbinder +UPDATE `creature_template` SET `skinloot`=0 WHERE `entry`=12457; From 189287a51bc6b29ef566a4c19c5d32bee27e4708 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Wed, 18 Apr 2012 23:08:06 +0200 Subject: [PATCH 0584/1149] DB/Loot: Set correct area/zone for Dalaran Underbelly Closes #2115 --- sql/updates/world/2012_04_18_07_world_fishing_loot_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_04_18_07_world_fishing_loot_template.sql diff --git a/sql/updates/world/2012_04_18_07_world_fishing_loot_template.sql b/sql/updates/world/2012_04_18_07_world_fishing_loot_template.sql new file mode 100644 index 00000000000..6c39cc95b48 --- /dev/null +++ b/sql/updates/world/2012_04_18_07_world_fishing_loot_template.sql @@ -0,0 +1,2 @@ +-- update wrong area. +UPDATE `fishing_loot_template` SET `entry`=4560 WHERE `entry`=4395 AND `item`=11026; From ccb211374e10d2506d6af24a05378823ac240032 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Thu, 19 Apr 2012 00:02:27 +0200 Subject: [PATCH 0585/1149] DB/Loot: Add loot for some Hrothgar's Landing creatures Closes #1813 --- ..._04_18_08_world_creature_loot_template.sql | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 sql/updates/world/2012_04_18_08_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_04_18_08_world_creature_loot_template.sql b/sql/updates/world/2012_04_18_08_world_creature_loot_template.sql new file mode 100644 index 00000000000..4b00685ed55 --- /dev/null +++ b/sql/updates/world/2012_04_18_08_world_creature_loot_template.sql @@ -0,0 +1,22 @@ +-- Add loot for Hrothgar's Landing +DELETE FROM `creature_loot_template` WHERE `entry` IN (34980,34838,34839,34965); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- AURIAYA 10-man +-- Drottinn Hrothgar - http://old.wowhead.com/npc=34980 +(34980,46859,-100,1,0,1,1), -- Stolen Tallstrider Leg +-- Kvaldir Reaver +(34838,46859,-100,1,0,1,1), -- Stolen Tallstrider Leg +(34838,49676,5,1,0,1,1), -- Kvaldir Attack Plans +(34838,33470,35,1,0,1,4), -- 1-4x Frostweave Cloth +(34838,1,10,1,0,-24727,1), -- 1 of Northrend scrolls +(34838,2,10,1,0,-26002,1), -- Northrend Grey Item Reference1 +(34838,3,2,1,0,-35080,1), -- Northrend Green Item Reference +-- Kvaldir Mist Binder +(34839,46859,-100,1,0,1,1), -- Stolen Tallstrider Leg +(34839,49676,5,1,0,1,1), -- Kvaldir Attack Plans +(34839,33470,35,1,0,1,4), -- 1-4x Frostweave Cloth +(34839,1,10,1,0,-24727,1), -- 1 of Northrend scrolls +(34839,2,10,1,0,-26002,1), -- Northrend Grey Item Reference1 +(34839,3, 2,1,0,-35080,1), -- Northrend Green Item Reference +-- Mistcaller Yngvar +(34965,46859,-100,1,0,1,1); -- Stolen Tallstrider Leg From 584161bc6db7fd150f857eddefad54cd2c4ad9f2 Mon Sep 17 00:00:00 2001 From: Gecko32 Date: Thu, 19 Apr 2012 10:38:14 +0200 Subject: [PATCH 0586/1149] DB/Loot: Add missing loot templates for some creatures in naxx25 remove scraps from naxx10 Closes # 2776 --- .../world/2012_04_19_00_world_creature_template.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/2012_04_19_00_world_creature_template.sql diff --git a/sql/updates/world/2012_04_19_00_world_creature_template.sql b/sql/updates/world/2012_04_19_00_world_creature_template.sql new file mode 100644 index 00000000000..e9abd40095e --- /dev/null +++ b/sql/updates/world/2012_04_19_00_world_creature_template.sql @@ -0,0 +1,7 @@ +-- update Plague Slime & Marauding Geist to naxx25 trash lootid +UPDATE `creature_template` SET `lootid`=100005 WHERE `entry` IN(29575,30424); +-- update Plague Slime & Marauding Geist to naxx10 trash lootid +UPDATE `creature_template` SET `lootid`=100003 WHERE `entry` IN(16243,30083); +DELETE FROM `creature_loot_template` WHERE `entry` IN(30424,29575,16243,30083); +-- Remove scraps for naxx10 from creature creature_loot_template +DELETE FROM `creature_loot_template` WHERE `item` IN (22373,22374,22375,22376); From 435a9a566a326424cf6ec924dedbae7b41802f06 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 19 Apr 2012 14:28:45 +0200 Subject: [PATCH 0587/1149] Core/Creatures: Changed how boss creatures are identified, creature_template.rank was not a good indicator --- src/server/game/Entities/Creature/Creature.h | 2 +- src/server/game/Miscellaneous/SharedDefines.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 4b5b07fd8a5..f6d03ca38b2 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -507,7 +507,7 @@ class Creature : public Unit, public GridObject, public MapCreature if (isPet()) return false; - return GetCreatureTemplate()->rank == CREATURE_ELITE_WORLDBOSS; + return GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_BOSS; } bool IsDungeonBoss() const; diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 0386e6b4214..06aca10879d 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -2566,7 +2566,7 @@ enum CreatureTypeFlags { CREATURE_TYPEFLAGS_TAMEABLE = 0x00000001, // Tameable by any hunter CREATURE_TYPEFLAGS_GHOST = 0x00000002, // Creature are also visible for not alive player. Allow gossip interaction if npcflag allow? - CREATURE_TYPEFLAGS_UNK2 = 0x00000004, + CREATURE_TYPEFLAGS_BOSS = 0x00000004, CREATURE_TYPEFLAGS_UNK3 = 0x00000008, CREATURE_TYPEFLAGS_UNK4 = 0x00000010, CREATURE_TYPEFLAGS_UNK5 = 0x00000020, From 190b5e261584594ccfa3f9536db1da4363a79a52 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Thu, 19 Apr 2012 14:51:32 +0200 Subject: [PATCH 0588/1149] DB/Loot: Add more pickpocketing loot templates for Northrend. Special thx for Gecko32 to do the prework Closes #5106 --- ...9_01_world_pickpocketing_loot_template.sql | 202 ++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 sql/updates/world/2012_04_19_01_world_pickpocketing_loot_template.sql diff --git a/sql/updates/world/2012_04_19_01_world_pickpocketing_loot_template.sql b/sql/updates/world/2012_04_19_01_world_pickpocketing_loot_template.sql new file mode 100644 index 00000000000..997b16ff65d --- /dev/null +++ b/sql/updates/world/2012_04_19_01_world_pickpocketing_loot_template.sql @@ -0,0 +1,202 @@ +-- Fix to add pickpocketing loot for humoniods in borean tundra +SET @GORLOCREF := 25100; +SET @BERYLREF := @GORLOCREF+1; +SET @BLOODREF := @GORLOCREF+2; +SET @CHIEFREF := @GORLOCREF+3; +SET @CULTREF := @GORLOCREF+4; +SET @KVALDIRREF := @GORLOCREF+5; +SET @CLAXREF := @GORLOCREF+6; +SET @MAGMOTHREF := @GORLOCREF+7; +-- Create reference templates +DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN @GORLOCREF AND @GORLOCREF+7; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@GORLOCREF,29576,57,1,0,1,1), -- Shark Bait +(@GORLOCREF,29569,30,1,0,1,1), -- Strong Junkbox +(@GORLOCREF,27858,8,1,0,1,1), -- Sunspring Carp +(@GORLOCREF,22829,3,1,0,1,1), -- Super Healing Potion +(@GORLOCREF,23436,0.5,1,0,1,1), -- Living Ruby +(@GORLOCREF,23437,0.5,1,0,1,1), -- Talasite +(@GORLOCREF,23440,0.5,1,0,1,1), -- Dawnstone +(@GORLOCREF,23438,0.5,1,0,1,1), -- Star of Elune +(@GORLOCREF,23439,0.5,1,0,1,1), -- Noble Topaz +-- -------------------------------------------------- +(@BERYLREF,37467,32.5,1,0,1,1), -- A Steamy Romance Novel: Forbidden Love +(@BERYLREF,43575,31,1,0,1,1), -- Reinforced Junkbox +(@BERYLREF,38261,10,1,0,1,1), -- Bent House Key +(@BERYLREF,29448,7,1,0,1,1), -- Mag'har Mild Cheese +(@BERYLREF,29450,7,1,0,1,1), -- Telaari Grapes +(@BERYLREF,33447,6,1,0,1,1), -- Runic Healing Potion +(@BERYLREF,33449,6,1,0,1,1), -- Crusty Flatbread +(@BERYLREF,36863,0.5,1,0,1,1), -- Decahedral Dwarven Dice +-- -------------------------------------------------- +(@BLOODREF,29572,37,1,0,1,1), -- Aboriginal Carvings +(@BLOODREF,29569,33,1,0,1,1), -- Strong Junkbox +(@BLOODREF,8952,20,1,0,1,1), -- Roasted Quail +(@BLOODREF,22829,8,1,0,1,1), -- Super Healing Potion +(@BLOODREF,23438,0.5,1,0,1,1), -- Star of Elune +(@BLOODREF,23436,0.5,1,0,1,1), -- Living Ruby +(@BLOODREF,23441,0.5,1,0,1,1), -- Nightseye +(@BLOODREF,23437,0.5,1,0,1,1), -- Talasite +(@BLOODREF,23440,0.5,1,0,1,1), -- Dawnstone +-- -------------------------------------------------- +(@CHIEFREF,29569,50,1,0,1,1), -- Strong Junkbox +(@CHIEFREF,27858,20,1,0,1,1), -- Sunspring Carp +(@CHIEFREF,29576,20,1,0,1,1), -- Shark Bait +(@CHIEFREF,22829,10,1,0,1,1), -- Super Healing Potion +-- -------------------------------------------------- +(@CULTREF,29569,40,1,0,1,1), -- Strong Junkbox +(@CULTREF,29571,37,1,0,1,1), -- A Steamy Romance Novel +(@CULTREF,30458,8,1,0,1,1), -- Stromgarde Muenster +(@CULTREF,27855,7,1,0,1,1), -- Mag'har Grainbread +(@CULTREF,27856,6,1,0,1,1), -- Skethyl Berries +(@CULTREF,22829,2,1,0,1,1), -- Super Healing Potion +(@CULTREF,36863,0.5,1,0,1,1), -- Decahedral Dwarven Dice +-- -------------------------------------------------- +(@KVALDIRREF,29569,39,1,0,1,1), -- Strong Junkbox +(@KVALDIRREF,29570,28,1,0,1,1), -- A Gnome Effigy +(@KVALDIRREF,27855,12,1,0,1,1), -- Mag'har Grainbread +(@KVALDIRREF,27854,12,1,0,1,1), -- Smoked Talbuk Venison +(@KVALDIRREF,22829,7,1,0,1,1), -- Super Healing Potion +(@KVALDIRREF,23436,0.5,1,0,1,1), -- Living Ruby +(@KVALDIRREF,23441,0.5,1,0,1,1), -- Nightseye +(@KVALDIRREF,23440,0.5,1,0,1,1), -- Dawnstone +(@KVALDIRREF,23439,0.5,1,0,1,1), -- Noble Topaz +(@KVALDIRREF,23437,0.5,1,0,1,1), -- Talasite +-- -------------------------------------------------- +(@CLAXREF,43575,28,1,0,1,1), -- Reinforced Junkbox +(@CLAXREF,38273,26,1,0,1,1), -- Brain Coral +(@CLAXREF,38274,23,1,0,1,1), -- Large Snail Shell +(@CLAXREF,37452,17,1,0,1,1), -- Fatty Bluefin +(@CLAXREF,33447,6,1,0,1,1), -- Runic Healing Potion +-- -------------------------------------------------- +(@MAGMOTHREF,38260,33,1,0,1,1), -- Empty Tobacco Pouch +(@MAGMOTHREF,38261,21,1,0,1,1), -- Bent House Key +(@MAGMOTHREF,33449,16,1,0,1,1), -- Crusty Flatbread +(@MAGMOTHREF,43575,16,1,0,1,1), -- Reinforced Junkbox +(@MAGMOTHREF,33454,9,1,0,1,1), -- Salted Venison +(@MAGMOTHREF,33447,5,1,0,1,1), -- Runic Healing Potion +(@MAGMOTHREF,36862,1,1,0,1,1); -- Worn Troll Dice +-- ------------------- +-- -- NPC Variables -- +-- ------------------- +SET @NPC := 25686; +SET @NPC1 := 25700; +SET @NPC2 := 25687; +SET @NPC3 := 25685; +SET @NPC4 := 25449; +SET @NPC5 := 25316; +SET @NPC6 := 25353; +SET @NPC7 := 25719; +SET @NPC8 := 25804; +SET @NPC9 := 25392; +SET @NPC10 := 25651; +SET @NPC11 := 25836; +SET @NPC12 := 25979; +SET @NPC13 := 25806; +SET @NPC14 := 25720; +SET @NPC15 := 25803; +SET @NPC16 := 25880; +SET @NPC17 := 25618; +SET @NPC18 := 25839; +SET @NPC19 := 25470; +SET @NPC20 := 24567; +SET @NPC21 := 25467; +SET @NPC22 := 25468; +SET @NPC23 := 25501; +SET @NPC24 := 25726; +SET @NPC25 := 25701; +SET @NPC26 := 25725; +SET @NPC27 := 25699; +SET @NPC28 := 24576; +SET @NPC29 := 25605; +SET @NPC30 := 25609; +SET @NPC31 := 25378; +SET @NPC32 := 25843; +SET @NPC33 := 25496; +SET @NPC34 := 25479; +SET @NPC35 := 25760; +SET @NPC36 := 26266; +SET @NPC37 := 26451; +SET @NPC38 := 25521; +SET @NPC39 := 25613; +SET @NPC40 := 25522; +SET @NPC41 := 25520; +SET @NPC42 := 25209; +SET @NPC43 := 25210; +SET @NPC44 := 25216; +SET @NPC45 := 25215; +SET @NPC46 := 25217; +SET @NPC47 := 25789; +SET @NPC48 := 24469; +SET @NPC49 := 25432; +SET @NPC50 := 25433; +SET @NPC51 := 25615; +SET @NPC52 := 25523; +-- ---------------------- +-- -- Assign the loots -- +-- ---------------------- +UPDATE `creature_template` SET `pickpocketloot`=`entry` WHERE `entry` IN (@NPC,@NPC1,@NPC2,@NPC3,@NPC4,@NPC5,@NPC6,@NPC7,@NPC8,@NPC9,@NPC10,@NPC11,@NPC12,@NPC13,@NPC14,@NPC15,@NPC16,@NPC17,@NPC18,@NPC19,@NPC20,@NPC21,@NPC22,@NPC23,@NPC24,@NPC25,@NPC26,@NPC27,@NPC28,@NPC29,@NPC30,@NPC31,@NPC32,@NPC33,@NPC34,@NPC35,@NPC36,@NPC37,@NPC38,@NPC39,@NPC40,@NPC41,@NPC42,@NPC43,@NPC44,@NPC45,@NPC46,@NPC47,@NPC48,@NPC49,@NPC50,@NPC51,@NPC52); +DELETE FROM `pickpocketing_loot_template` WHERE `entry` IN (@NPC,@NPC1,@NPC2,@NPC3,@NPC4,@NPC5,@NPC6,@NPC7,@NPC8,@NPC9,@NPC10,@NPC11,@NPC12,@NPC13,@NPC14,@NPC15,@NPC16,@NPC17,@NPC18,@NPC19,@NPC20,@NPC21,@NPC22,@NPC23,@NPC24,@NPC25,@NPC26,@NPC27,@NPC28,@NPC29,@NPC30,@NPC31,@NPC32,@NPC33,@NPC34,@NPC35,@NPC36,@NPC37,@NPC38,@NPC39,@NPC40,@NPC41,@NPC42,@NPC43,@NPC44,@NPC45,@NPC46,@NPC47,@NPC48,@NPC49,@NPC50,@NPC51,@NPC52); +INSERT INTO `pickpocketing_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- ----------------------------------------------------------------------------------------------- +(@NPC,1,100,1,0,-@GORLOCREF,1), -- Gorloc ref loot template on Gorloc Gibberer +(@NPC1,1,100,1,0,-@GORLOCREF,1), -- Gorloc ref loot template on Gorloc Hunter +(@NPC2,1,100,1,0,-@GORLOCREF,1), -- Gorloc ref loot template on Gorloc Steam Belcher +(@NPC3,1,100,1,0,-@GORLOCREF,1), -- Gorloc ref loot template on Gorloc Waddler +-- ----------------------------------------------------------------------------------------------- +(@NPC4,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Beryl Reclaimer +(@NPC5,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Beryl Sorcerer +(@NPC6,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Beryl Treasure Hunter +(@NPC7,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Coldarra Spellbinder +(@NPC8,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Harold Lane +(@NPC9,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on High Priest Andorath +(@NPC10,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Cultist Necrolyte +(@NPC11,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Loot Crazed Diver +(@NPC12,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Loot Crazed Hunter +(@NPC13,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Loot Crazed Poacher +(@NPC14,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Inquisitor Caleras +(@NPC15,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Karen "I Don't Caribou" the Culler +(@NPC16,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Minion of Kaw +(@NPC17,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Varidus the Flenser +(@NPC18,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Northsea Mercenary +-- ----------------------------------------------------------------------------------------------- +(@NPC19,1,100,1,0,-@BLOODREF,1), -- Bloodspore ref loot template on Bloodspore Firestarter +(@NPC20,1,100,1,0,-@BLOODREF,1), -- Bloodspore ref loot template on Den Vermin +(@NPC21,1,100,1,0,-@BLOODREF,1), -- Bloodspore ref loot template on Bloodspore Harvester +(@NPC22,1,100,1,0,-@BLOODREF,1), -- Bloodspore ref loot template on Bloodspore Roaster +(@NPC23,1,100,1,0,-@BLOODREF,1), -- Bloodspore ref loot template on Gammoth Tender +-- ----------------------------------------------------------------------------------------------- +(@NPC24,1,100,1,0,-@CHIEFREF,1), -- Chieftian ref loot template on Chieftain Burblegobble +(@NPC25,1,100,1,0,-@CHIEFREF,1), -- Chieftian ref loot template on Gorloc Dredger +(@NPC26,1,100,1,0,-@CHIEFREF,1), -- Chieftian ref loot template on Chieftain GurgleBoggle +(@NPC27,1,100,1,0,-@CHIEFREF,1), -- Chieftian ref loot template on Gorloc Mud Splasher +(@NPC28,1,100,1,0,-@CHIEFREF,1), -- Chieftian ref loot template on Riplash Myrmidon +-- ----------------------------------------------------------------------------------------------- +(@NPC29,1,100,1,0,-@CULTREF,1), -- Cultist ref loot template on Clandestine Cultist +(@NPC30,1,100,1,0,-@CULTREF,1), -- Cultist ref loot template on En'kilah Necrolord +(@NPC31,1,100,1,0,-@CULTREF,1), -- Cultist ref loot template on En'kilah Necromancer +(@NPC32,1,100,1,0,-@CULTREF,1), -- Cultist ref loot template on Northsea Thug +-- ----------------------------------------------------------------------------------------------- +(@NPC33,1,100,1,0,-@KVALDIRREF,1), -- Kvaldir ref loot template on Kvaldir Mist Lord +(@NPC34,1,100,1,0,-@KVALDIRREF,1), -- Kvaldir ref loot template on Kvaldir Mistweaver +(@NPC35,1,100,1,0,-@KVALDIRREF,1), -- Kvaldir ref loot template on Kvaldir Raider +(@NPC36,1,100,1,0,-@KVALDIRREF,1), -- Kvaldir ref loot template on Heigarr the Horrible +(@NPC37,1,100,1,0,-@KVALDIRREF,1), -- Kvaldir ref loot template on Ragnar Drakkarlund +(@NPC37,35774,-100,1,0,1,1), -- Trident of Naz'jan on Ragnar Drakkarlund +(@NPC38,1,100,1,0,-@KVALDIRREF,1), -- Kvaldir ref loot template on Skadir Longboatsman +(@NPC39,1,100,1,0,-@KVALDIRREF,1), -- Kvaldir ref loot template on Skadir Mistweaver +(@NPC40,1,100,1,0,-@KVALDIRREF,1), -- Kvaldir ref loot template on Skadir Raider +(@NPC41,1,100,1,0,-@KVALDIRREF,1), -- Kvaldir ref loot template on Skadir Runecaster +-- ----------------------------------------------------------------------------------------------- +(@NPC42,1,100,1,0,-@CLAXREF,1), -- Clax ref loot template on Claximus +(@NPC43,1,100,1,0,-@CLAXREF,1), -- Clax ref loot template on Keymaster Urmgrgl +(@NPC44,1,100,1,0,-@CLAXREF,1), -- Clax ref loot template on Winterfin Oracle +(@NPC45,1,100,1,0,-@CLAXREF,1), -- Clax ref loot template on Winterfin Shorestriker +(@NPC46,1,100,1,0,-@CLAXREF,1), -- Clax ref loot template on Winterfin Warrior +-- ----------------------------------------------------------------------------------------------- +(@NPC47,1,100,1,0,-@MAGMOTHREF,1), -- Magmoth2 ref loot template on Gammothra the Tormentor +(@NPC48,1,100,1,0,-@MAGMOTHREF,1), -- Magmoth ref loot template on Magnataur Huntress +(@NPC49,1,100,1,0,-@MAGMOTHREF,1), -- Magmoth ref loot template on Mate of Magmothregar +(@NPC50,1,100,1,0,-@MAGMOTHREF,1), -- Magmoth ref loot template on Offspring of Magmothregar +(@NPC51,1,100,1,0,-@MAGMOTHREF,1), -- Magmoth ref loot template on Plagued Magnataur +(@NPC52,1,100,1,0,-@MAGMOTHREF,1); -- Magmoth ref loot template on Skadir Mariner From 9231f04d0f6292e916eb043bdc2e413d8fd8769f Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Thu, 19 Apr 2012 14:56:09 +0200 Subject: [PATCH 0589/1149] DB/Loot: remove unused templates --- .../world/2012_04_19_02_world_creature_loot_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_04_19_02_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_04_19_02_world_creature_loot_template.sql b/sql/updates/world/2012_04_19_02_world_creature_loot_template.sql new file mode 100644 index 00000000000..336cd61c0eb --- /dev/null +++ b/sql/updates/world/2012_04_19_02_world_creature_loot_template.sql @@ -0,0 +1,2 @@ +-- fix DB-error on startup +DELETE FROM `creature_loot_template` WHERE `entry` IN (34965,34980); From 3c2dd7c5edf7eaee1a7314e390aa2f51f3310687 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 19 Apr 2012 23:19:27 +0200 Subject: [PATCH 0590/1149] Scripts/Ulduar: Algalon the Observer --- .../2012_04_19_03_world_instance_ulduar.sql | 174 +++ .../game/Entities/Creature/Creature.cpp | 6 +- src/server/game/Entities/Player/Player.cpp | 13 + src/server/game/Scripting/ScriptLoader.cpp | 2 + src/server/game/Spells/SpellMgr.cpp | 13 + src/server/game/Spells/SpellScript.cpp | 2 +- src/server/game/Spells/SpellScript.h | 2 +- src/server/scripts/CMakeLists.txt | 1 + src/server/scripts/Northrend/CMakeLists.txt | 2 +- .../Northrend/Ulduar/Ulduar/boss_algalon.cpp | 376 ----- .../Ulduar/boss_algalon_the_observer.cpp | 1374 +++++++++++++++++ .../Ulduar/Ulduar/instance_ulduar.cpp | 270 +++- .../scripts/Northrend/Ulduar/Ulduar/ulduar.h | 229 ++- 13 files changed, 1981 insertions(+), 483 deletions(-) create mode 100644 sql/updates/world/2012_04_19_03_world_instance_ulduar.sql delete mode 100644 src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon.cpp create mode 100644 src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp diff --git a/sql/updates/world/2012_04_19_03_world_instance_ulduar.sql b/sql/updates/world/2012_04_19_03_world_instance_ulduar.sql new file mode 100644 index 00000000000..a39ed9c01d5 --- /dev/null +++ b/sql/updates/world/2012_04_19_03_world_instance_ulduar.sql @@ -0,0 +1,174 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1603019 AND -1603000; +UPDATE `creature_template` SET `ScriptName`='' WHERE `ScriptName` IN ('boss_algalon','mob_collapsing_star'); + +-- Difficulty linking +UPDATE `creature_template` SET `difficulty_entry_1`=34296 WHERE `entry`=32953; -- Black Hole + +UPDATE `creature_template` SET `minlevel`=80,`maxlevel`=80,`faction_A`=35,`faction_H`=35,`unit_flags`=0x8300,`equipment_id`=2478 WHERE `entry`=34064; -- Brann Bronzebeard +UPDATE `creature_template` SET `speed_walk`=4,`speed_run`=2.14286,`exp`=2,`minlevel`=83,`maxlevel`=83,`faction_A`=190,`faction_H`=190,`unit_flags`=0x8100,`BaseAttackTime`=1000,`equipment_id`=2479 WHERE `entry` IN (32871,33070); -- Algalon the Observer +UPDATE `creature_template` SET `faction_A`=190,`faction_H`=190,`exp`=2,`minlevel`=83,`maxlevel`=83,`unit_flags`=0x2000000,`speed_run`=1,`InhabitType`=4 WHERE `entry`=34246; -- Azeroth +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`exp`=2,`minlevel`=74,`maxlevel`=74,`unit_flags`=0x2000000,`flags_extra`=0x80,`InhabitType`=4 WHERE `entry`=33086; -- Algalon Stalker +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`unit_flags`=0x2008000,`speed_run`=1,`equipment_id`=2480,`InhabitType`=4 WHERE `entry` IN (33052,33116); -- Living Constellation +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`speed_run`=1,`RegenHealth`=0 WHERE `entry` IN (32955,34215); -- Collapsing Star +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`exp`=2,`minlevel`=80,`maxlevel`=80,`unit_flags`=0x2000000,`speed_run`=1,`InhabitType`=4 WHERE `entry` IN (32953,34296); -- Black Hole +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`minlevel`=81,`maxlevel`=81,`unit_flags`=0x8000,`speed_walk`=4,`speed_run`=1.42857,`InhabitType`=4 WHERE `entry` IN(33089,34097,34221,34222); -- Dark Matter +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`unit_flags`=0x2000000,`flags_extra`=0x80 WHERE `entry`=34100; -- Algalon Void Zone Visual Stalker +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`unit_flags`=0x2000000,`speed_run`=1,`InhabitType`=4 WHERE `entry`=34099; -- Worm Hole +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`exp`=2,`minlevel`=74,`maxlevel`=74,`unit_flags`=0x2000000,`flags_extra`=0x80,`InhabitType`=4 WHERE `entry`=33104; -- Algalon Stalker Asteroid Target 01 +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`exp`=2,`minlevel`=74,`maxlevel`=74,`unit_flags`=0x2000000,`flags_extra`=0x80,`InhabitType`=4 WHERE `entry`=33105; -- Algalon Stalker Asteroid Target 02 + +UPDATE `creature_model_info` SET `bounding_radius`=0.93,`combat_reach`=9,`gender`=0 WHERE `modelid`=28641; -- Algalon the Observer +UPDATE `creature_model_info` SET `bounding_radius`=0.02,`combat_reach`=0.2,`gender`=2 WHERE `modelid`=29133; -- Azeroth +UPDATE `creature_model_info` SET `bounding_radius`=0.62,`combat_reach`=0,`gender`=2 WHERE `modelid`=28741; -- Living Constellation +UPDATE `creature_model_info` SET `bounding_radius`=1,`combat_reach`=1,`gender`=2 WHERE `modelid`=28988; -- Collapsing Star +UPDATE `creature_model_info` SET `bounding_radius`=1,`combat_reach`=1,`gender`=2 WHERE `modelid`=28460; -- Black Hole + +UPDATE `gameobject_template` SET `faction`=114,`flags`=32 WHERE `entry`=194910; -- Doodad_UL_SigilDoor_03 +UPDATE `gameobject_template` SET `data0`=579 WHERE `entry`=194628; -- Celestial Planetarium Access + +UPDATE `creature_template` SET `ScriptName`='boss_algalon_the_observer' WHERE `entry`=32871; -- Algalon the Observer +UPDATE `creature_template` SET `ScriptName`='npc_living_constellation' WHERE `entry`=33052; -- Living Constellation +UPDATE `creature_template` SET `ScriptName`='npc_collapsing_star' WHERE `entry`=32955; -- Collapsing Star +UPDATE `creature_template` SET `ScriptName`='npc_brann_bronzebeard_algalon' WHERE `entry`=34064; -- Brann Bronzebeard +UPDATE `gameobject_template` SET `ScriptName`='go_celestial_planetarium_access' WHERE `entry` IN (194628,194752); -- Celestial Planetarium Access +UPDATE `creature_template` SET `AIName`='NullCreatureAI' WHERE `entry` IN (32953,34099); -- Black Hole + +DELETE FROM `creature` WHERE `guid` IN (41781,41783,41790,41811,41812,41814,41819,41820,41821,41822,41823,41875); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`MovementType`) VALUES +(41781,33086,603,3,1,1627.400,-339.4133,417.4044,1.378810,7200,0,0), -- Algalon Stalker +(41783,33086,603,3,1,1622.681,-344.2576,417.3955,1.378810,7200,0,0), -- Algalon Stalker +(41790,33086,603,3,1,1629.984,-271.4798,417.4045,4.782202,7200,0,0), -- Algalon Stalker +(41811,33086,603,3,1,1630.005,-345.5189,417.3955,1.378810,7200,0,0), -- Algalon Stalker +(41812,33089,603,3,16,1622.451,-321.1563,417.6188,4.677482,7200,20,1), -- Dark Matter +(41814,33089,603,3,16,1649.438,-319.8127,418.3941,1.082104,7200,20,1), -- Dark Matter +(41819,33089,603,3,16,1615.060,-291.6816,417.7796,3.490659,7200,20,1), -- Dark Matter +(41820,33089,603,3,16,1647.005,-288.6790,417.3955,3.490659,7200,20,1), -- Dark Matter +(41821,33089,603,3,16,1622.451,-321.1563,417.6188,4.677482,7200,20,1), -- Dark Matter +(41822,33089,603,3,16,1649.438,-319.8127,418.3941,1.082104,7200,20,1), -- Dark Matter +(41823,33089,603,3,16,1615.060,-291.6816,417.7796,3.490659,7200,20,1), -- Dark Matter +(41875,33089,603,3,16,1647.005,-288.6790,417.3955,3.490659,7200,20,1); -- Dark Matter + +SET @OGUID := 252; +DELETE FROM `gameobject` WHERE `id` IN (194767,194910,194911,194715,194716,194148,194253,194628,194752,194821,194822); +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(@OGUID+00,194767,603,3,17,1632.024,-182.9211,427.6681,0.000000,0,0,8.742278E-08,1, 604800,255,1), -- Doodad_UL_SigilDoor_01 +(@OGUID+04,194911,603,3,17,1632.024,-182.9211,408.4224,3.141593,0,0,8.742278E-08,1, 604800,255,1), -- Doodad_UL_SigilDoor_02 +(@OGUID+10,194910,603,3,17,1632.053,-266.1495,438.5608,0.000000,0,0,8.742278E-08,1, 604800,255,0), -- Doodad_UL_SigilDoor_03 +(@OGUID+12,194715,603,3,17,1632.053,-307.6541,417.3211,0.000000,0,0,8.742278E-08,1, 604800,255,0), -- Doodad_UL_UniverseFloor_01 +(@OGUID+19,194716,603,3,17,1632.251,-307.5483,416.2641,0.000000,0,0,8.742278E-08,1, 604800,255,1), -- Doodad_UL_UniverseFloor_02 +(@OGUID+22,194148,603,3,17,1632.053,-307.6541,417.3211,0.000000,0,0,8.742278E-08,1, 604800,255,1), -- Doodad_UL_UniverseGlobe01 +(@OGUID+24,194253,603,3,17,1631.908,-246.4970,417.3211,0.000000,0,0,8.742278E-08,1, 604800,255,1), -- Doodad_UL_Ulduar_Trapdoor_03 +(@OGUID+29,194628,603,1, 1,1646.182,-174.6881,427.2536,1.553341,0,0,0.000000E-00,1, 604800,255,1), -- Celestial Planetarium Access +(@OGUID+33,194752,603,2, 1,1646.182,-174.6881,427.2536,1.553341,0,0,0.000000E-00,1, 604800,255,1), -- Celestial Planetarium Access +(@OGUID+37,194821,603,1, 1,1632.099,-306.5609,417.3210,4.694937,0,0,0.000000E-00,1,-604800,255,1), -- Gift of the Observer (10 man) +(@OGUID+46,194822,603,2, 1,1632.099,-306.5609,417.3210,4.694937,0,0,0.000000E-00,1,-604800,255,1); -- Gift of the Observer (25 man) + +DELETE FROM `creature_equip_template` WHERE `entry` IN (2478,2479,2480); +INSERT INTO `creature_equip_template` (`entry`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES +(2478,1903,25972,0), +(2479,45985,45985,0), +(2480,44952,0,0); + +DELETE FROM `creature_template_addon` WHERE `entry` IN (32871,33070,33052,33116,33089,34221,34097,34222,33105); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`auras`) VALUES +(32871,0,0x0000000,0x0,NULL), -- Algalon the Observer +(33070,0,0x0000000,0x0,NULL), -- Algalon the Observer +(33052,0,0x3000000,0x1,NULL), -- Living Constellation +(33116,0,0x3000000,0x1,NULL), -- Living Constellation +(33089,0,0x3000000,0x1,NULL), -- Dark Matter +(34221,0,0x3000000,0x1,NULL), -- Dark Matter +(34097,0,0x3000000,0x1,NULL), -- Unleashed Dark Matter +(34222,0,0x3000000,0x1,NULL), -- Unleashed Dark Matter +(33105,0,0x3000000,0x1,NULL); -- Algalon Stalker Asteroid Target 02 + +DELETE FROM `creature_text` WHERE `entry` IN (32871,34064); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`sound`,`emote`,`comment`) VALUES +(34064,0,0,'We did it, lads! We got here before Algalon''s arrival. Maybe we can rig the systems to interfere with his analysis--',14,15824,0,'Brann Bronzebeard - SAY_BRANN_ALGALON_INTRO_1'), +(34064,1,0,'I''ll head back to the Archivum and see if I can jam his signal. I might be able to buy us some time while you take care of him.',12,15825,0,'Brann Bronzebeard - SAY_BRANN_ALGALON_INTRO_2'), +(34064,2,0,'I know just the place. Will you be all right?',14,15823,6,'Brann Bronzebeard - SAY_BRANN_ALGALON_OUTRO'), +(32871,0,0,'Translocation complete. Commencing planetary analysis of Azeroth.',12,15405,0,'Algalon the Observer - SAY_ALGALON_INTRO_1'), +(32871,1,0,'Stand back, mortals. I''m not here to fight you.',12,15406,0,'Algalon the Observer - SAY_ALGALON_INTRO_2'), +(32871,2,0,'It is in the universe''s best interest to re-originate this planet should my analysis find systemic corruption. Do not interfere.',12,15407,0,'Algalon the Observer - SAY_ALGALON_INTRO_3'), +(32871,3,0,'Your actions are illogical. All possible results for this encounter have been calculated. The Pantheon will receive the Observer''s message regardless of outcome.',14,15386,0,'Algalon the Observer - SAY_ALGALON_START_TIMER'), +(32871,4,0,'See your world through my eyes: A universe so vast as to be immeasurable - incomprehensible even to your greatest minds.',14,15390,1,'Algalon the Observer - SAY_ALGALON_AGGRO'), +(32871,5,0,'The stars come to my aid!',14,15392,0,'Algalon the Observer - SAY_ALGALON_COLLAPSING_STAR'), +(32871,6,0,'%s begins to Summon Collapsing Stars!',41,0,0,'Algalon the Observer - EMOTE_ALGALON_COLLAPSING_STAR'), +(32871,7,0,'Witness the fury of the cosmos!',14,15396,0,'Algalon the Observer - SAY_ALGALONG_BIG_BANG'), +(32871,8,0,'%s begins to cast Big Bang!',41,0,0,'Algalon the Observer - EMOTE_ALGALON_BIG_BANG'), +(32871,9,0,'You are out of time.',14,15394,0,'Algalon the Observer - SAY_ALGALON_ASCEND'), +(32871,10,0,'%s begins to cast Cosmic Smash!',41,0,0,'Algalon the Observer - EMOTE_ALGALON_COSMIC_SMASH'), +(32871,11,0,'Behold the tools of creation!',14,15397,0,'Algalon the Observer - SAY_ALGALON_PHASE_TWO'), +(32871,12,0,'I have seen worlds bathed in the Makers'' flames, their denizens fading without as much as a whimper. Entire planetary systems born and razed in the time that it takes your mortal hearts to beat once. Yet all throughout, my own heart devoid of emotion... of empathy. I. Have. Felt. Nothing. A million-million lives wasted. Had they all held within them your tenacity? Had they all loved life as you do?',14,15393,1,'Algalon the Observer - SAY_ALGALON_OUTRO_1'), +(32871,13,0,'Perhaps it is your imperfections... that which grants you free will... that allows you to persevere against all cosmically calculated odds. You prevail where the Titan''s own perfect creations have failed.',14,15401,1,'Algalon the Observer - SAY_ALGALON_OUTRO_2'), +(32871,14,0,'I''ve rearranged the reply code - your planet will be spared. I cannot be certain of my own calculations anymore.',14,15402,1,'Algalon the Observer - SAY_ALGALON_OUTRO_3'), +(32871,15,0,'I lack the strength to transmit the signal. You must... hurry... find a place of power... close to the skies.',14,15403,1,'Algalon the Observer - SAY_ALGALON_OUTRO_4'), +(32871,16,0,'Do not worry about my fate, Bronzen. If the signal is not transmitted in time, re-origination will proceed regardless. Save... your world...',14,15404,1,'Algalon the Observer - SAY_ALGALON_OUTRO_5'), +(32871,17,0,'Analysis complete. There is partial corruption in the planet''s life-support systems as well as complete corruption in most of the planet''s defense mechanisms.',12,15398,0,'Algalon the Observer - SAY_ALGALON_DESPAWN_1'), +(32871,18,0,'Begin uplink: Reply Code: ''Omega''. Planetary re-origination requested.',12,15399,0,'Algalon the Observer - SAY_ALGALON_DESPAWN_2'), +(32871,19,0,'Farewell, mortals. Your bravery is admirable, for such flawed creatures.',12,15400,0,'Algalon the Observer - SAY_ALGALON_DESPAWN_3'), +(32871,20,0,'Loss of life unavoidable.',14,15387,0,'Algalon the Observer - SAY_ALGALON_KILL'), +(32871,20,1,'I do what I must.',14,15388,0,'Algalon the Observer - SAY_ALGALON_KILL'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (64996,62266,65509,62304,64597); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`Comment`) VALUES +(13,1,64996,31,3,34246,'Algalon the Observer - Reorigination on Azeroth'), +(13,1,62266,31,3,33052,'Algalon Stalker - target Living Constellation'), +(13,1,65509,31,3,33052,'Black Hole - target Living Constellation'), +(13,1,62304,31,3,33104,'Cosmic Smash - target trigger'), +(13,1,64597,31,3,33104,'Cosmic Smash - target trigger'); + +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_algalon_phase_punch'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_algalon_arcane_barrage'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_algalon_trigger_3_adds'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_algalon_collapse'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_algalon_big_bang'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_algalon_remove_phase'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_algalon_cosmic_smash'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_algalon_cosmic_smash_damage'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_algalon_supermassive_fail'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(64412,'spell_algalon_phase_punch'), +(64599,'spell_algalon_arcane_barrage'), +(64607,'spell_algalon_arcane_barrage'), +(62266,'spell_algalon_trigger_3_adds'), +(62018,'spell_algalon_collapse'), +(64443,'spell_algalon_big_bang'), +(64584,'spell_algalon_big_bang'), +(64445,'spell_algalon_remove_phase'), +(62295,'spell_algalon_cosmic_smash'), +(62311,'spell_algalon_cosmic_smash_damage'), +(64596,'spell_algalon_cosmic_smash_damage'), +(65311,'spell_algalon_supermassive_fail'); + +SET @DIFF_ID := 3262; +DELETE FROM `spelldifficulty_dbc` WHERE `id` BETWEEN @DIFF_ID AND @DIFF_ID+5; +INSERT INTO `spelldifficulty_dbc` (`id`,`spellid0`,`spellid1`) VALUES +(@DIFF_ID+0,64395,64592), +(@DIFF_ID+1,64599,64607), +(@DIFF_ID+2,64443,64584), +(@DIFF_ID+3,64122,65108), +(@DIFF_ID+4,62301,64598), +(@DIFF_ID+5,62304,64597); + +UPDATE `instance_encounters` SET `creditType`=1,`creditEntry`=65184 WHERE `entry` IN (757,771); -- Algalon the Observer + +DELETE FROM `disables` WHERE `sourceType`=4 AND `entry` IN (10565,10566,10678,9990,9991,10567,10569,10698,10780,10781,10782,10783,10568,10570); +DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (10565,10566,10678,9990,9991,10567,10569,10698,10780,10781,10782,10783,10568,10570); +INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`ScriptName`) VALUES +(10565,12,0,0,''), -- Algalon the Observer kills (Ulduar 10 player) +(10566,12,1,0,''), -- Algalon the Observer kills (Ulduar 25 player) +(10678,12,0,0,''), -- Herald of the Titans +(10678,18,0,0,''), -- Herald of the Titans +(9990,12,0,0,''), -- Lich King 10-player bosses killed +(9991,12,1,0,''), -- Lich King 25-player bosses killed +(10567,12,0,0,''), -- Observed (10 player) +(10569,12,1,0,''), -- Observed (25 player) +(10698,12,1,0,''), -- Realm First! Celestial Defender +(10780,12,0,0,''), -- Supermassive (10 player) +(10781,12,0,0,''), -- Supermassive (10 player) +(10782,12,1,0,''), -- Supermassive (25 player) +(10783,12,1,0,''), -- Supermassive (25 player) +(10568,11,0,0,'achievement_he_feeds_on_your_tears'), -- He Feeds On Your Tears (10 player) +(10568,12,0,0,''), -- He Feeds On Your Tears (10 player) +(10570,11,0,0,'achievement_he_feeds_on_your_tears'), -- He Feeds On Your Tears (25 player) +(10570,12,1,0,''); -- He Feeds On Your Tears (25 player) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index a7b57c7323c..ed89041ff66 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -796,10 +796,12 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, //! Need to be called after LoadCreaturesAddon - MOVEMENTFLAG_HOVER is set there if (HasUnitMovementFlag(MOVEMENTFLAG_HOVER)) + { z += GetFloatValue(UNIT_FIELD_HOVERHEIGHT); - //! Relocate again with updated Z coord - Relocate(x, y, z, ang); + //! Relocate again with updated Z coord + Relocate(x, y, z, ang); + } uint32 displayID = GetNativeDisplayId(); CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 141902fbbdc..7c70fe9358e 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -9217,6 +9217,9 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) case 4100: // The Culling of Stratholme NumberOfFields = 13; break; + case 4273: // Ulduar + NumberOfFields = 10; + break; default: NumberOfFields = 12; break; @@ -9761,6 +9764,16 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) data << uint32(3932) << uint32(0); // 13 WORLDSTATE_TIME_GUARDIAN_SHOW } break; + // Ulduar + case 4273: + if (instance && mapid == 603) + instance->FillInitialWorldStates(data); + else + { + data << uint32(4132) << uint32(0); // 9 WORLDSTATE_SHOW_CRATES + data << uint32(4131) << uint32(0); // 10 WORLDSTATE_CRATES_REVEALED + } + break; default: data << uint32(0x914) << uint32(0x0); // 7 data << uint32(0x913) << uint32(0x0); // 8 diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 76c3f1c073c..476b0082617 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -425,6 +425,7 @@ void AddSC_ulduar_teleporter(); void AddSC_boss_mimiron(); void AddSC_boss_hodir(); void AddSC_boss_freya(); +void AddSC_boss_algalon_the_observer(); void AddSC_instance_ulduar(); void AddSC_boss_keleseth(); //Utgarde Keep void AddSC_boss_skarvald_dalronn(); @@ -1129,6 +1130,7 @@ void AddNorthrendScripts() AddSC_boss_mimiron(); AddSC_boss_hodir(); AddSC_boss_freya(); + AddSC_boss_algalon_the_observer(); AddSC_instance_ulduar(); AddSC_boss_keleseth(); //Utgarde Keep AddSC_boss_skarvald_dalronn(); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 05431ef0a16..3de87790be9 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3298,6 +3298,19 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->EffectImplicitTargetB[1] = TARGET_UNIT_NEARBY_ENTRY; spellInfo->EffectImplicitTargetB[2] = TARGET_UNIT_NEARBY_ENTRY; break; + case 62301: // Cosmic Smash (Algalon the Observer) + spellInfo->MaxAffectedTargets = 1; + break; + case 64598: // Cosmic Smash (Algalon the Observer) + spellInfo->MaxAffectedTargets = 3; + break; + case 62293: // Cosmic Smash (Algalon the Observer) + spellInfo->EffectImplicitTargetB[0] = TARGET_DEST_CASTER; + break; + case 62311: // Cosmic Smash (Algalon the Observer) + case 64596: // Cosmic Smash (Algalon the Observer) + spellInfo->rangeIndex = 6; // 100yd + break; // ENDOF ULDUAR SPELLS // // TRIAL OF THE CRUSADER SPELLS diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index df1640df1b7..44a2dd4dedb 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -403,7 +403,7 @@ GameObject* SpellScript::GetHitGObj() return m_spell->gameObjTarget; } -WorldLocation const* SpellScript::GetHitDest() +WorldLocation* SpellScript::GetHitDest() { if (!IsInEffectHook()) { diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index e84a56c8dbb..26393040a1e 100755 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -325,7 +325,7 @@ class SpellScript : public _SpellScript // returns: target of current effect if it was GameObject otherwise NULL GameObject* GetHitGObj(); // returns: destination of current effect - WorldLocation const* GetHitDest(); + WorldLocation* GetHitDest(); // setter/getter for for damage done by spell to target of spell hit // returns damage calculated before hit, and real dmg done after hit int32 GetHitDamage(); diff --git a/src/server/scripts/CMakeLists.txt b/src/server/scripts/CMakeLists.txt index f0136b065e8..792fdeb3e7b 100644 --- a/src/server/scripts/CMakeLists.txt +++ b/src/server/scripts/CMakeLists.txt @@ -119,6 +119,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/server/game/Maps ${CMAKE_SOURCE_DIR}/src/server/game/Movement ${CMAKE_SOURCE_DIR}/src/server/game/Movement/MovementGenerators + ${CMAKE_SOURCE_DIR}/src/server/game/Movement/Spline ${CMAKE_SOURCE_DIR}/src/server/game/Movement/Waypoints ${CMAKE_SOURCE_DIR}/src/server/game/Opcodes ${CMAKE_SOURCE_DIR}/src/server/game/OutdoorPvP diff --git a/src/server/scripts/Northrend/CMakeLists.txt b/src/server/scripts/Northrend/CMakeLists.txt index 31aa924365d..3502e7fb104 100644 --- a/src/server/scripts/Northrend/CMakeLists.txt +++ b/src/server/scripts/Northrend/CMakeLists.txt @@ -22,7 +22,7 @@ set(scripts_STAT_SRCS Northrend/Ulduar/Ulduar/ulduar_teleporter.cpp Northrend/Ulduar/Ulduar/boss_thorim.cpp Northrend/Ulduar/Ulduar/boss_ignis.cpp - Northrend/Ulduar/Ulduar/boss_algalon.cpp + Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp Northrend/Ulduar/Ulduar/instance_ulduar.cpp Northrend/Ulduar/Ulduar/boss_auriaya.cpp Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon.cpp deleted file mode 100644 index 2dd13e7ce07..00000000000 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon.cpp +++ /dev/null @@ -1,376 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ulduar.h" - -#define GAMEOBJECT_GIVE_OF_THE_OBSERVER 194821 - -enum Spells -{ - SPELL_ASCEND = 64487, - SPELL_BERSERK = 47008, - SPELL_BIG_BANG = 64443, - H_SPELL_BIG_BANG = 64584, - SPELL_COSMIC_SMASH = 62301, - H_SPELL_COSMIC_SMASH = 64598, - SPELL_PHASE_PUNCH = 64412, - SPELL_QUANTUM_STRIKE = 64395, - H_SPELL_QUANTUM_STRIKE = 64592, - SPELL_BLACK_HOLE_EXPLOSION = 64122, - SPELL_ARCANE_BARAGE = 64599, - H_SPELL_ARCANE_BARAGE = 64607 -}; - -enum Creatures -{ - CREATURE_COLLAPSING_STAR = 32955, - CREATURE_BLACK_HOLE = 32953, - CREATURE_LIVING_CONSTELLATION = 33052, - CREATURE_DARK_MATTER = 33089 -}; - -enum Yells -{ - SAY_AGGRO = -1603000, - SAY_SLAY_1 = -1603001, - SAY_SLAY_2 = -1603002, - SAY_ENGADED_FOR_FIRTS_TIME = -1603003, - SAY_PHASE_2 = -1603004, - SAY_SUMMON_COLLAPSING_STAR = -1603005, - SAY_DEATH_1 = -1603006, - SAY_DEATH_2 = -1603007, - SAY_DEATH_3 = -1603008, - SAY_DEATH_4 = -1603009, - SAY_DEATH_5 = -1603010, - SAY_BERSERK = -1603011, - SAY_BIG_BANG_1 = -1603012, - SAY_BIG_BANG_2 = -1603013, - SAY_TIMER_1 = -1603014, - SAY_TIMER_2 = -1603015, - SAY_TIMER_3 = -1603016, - SAY_SUMMON_1 = -1603017, - SAY_SUMMON_2 = -1603018, - SAY_SUMMON_3 = -1603019, -}; - -class boss_algalon : public CreatureScript -{ -public: - boss_algalon() : CreatureScript("boss_algalon") { } - - CreatureAI* GetAI(Creature* creature) const - { - return GetUlduarAI(creature); - } - - struct boss_algalonAI : public ScriptedAI - { - boss_algalonAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - Summon = false; // not in reset. intro speech done only once. - } - - InstanceScript* instance; - - std::list m_lCollapsingStarGUIDList; - - uint32 Phase; - uint32 Ascend_Timer; - uint32 Berserk_Timer; - uint32 BigBang_Timer; - uint32 CosmicSmash_Timer; - uint32 PhasePunch_Timer; - uint32 QuantumStrike_Timer; - uint32 CollapsingStar_Timer; - uint32 uiPhase_timer; - uint32 uiStep; - - uint64 BlackHoleGUID; - - bool Enrage; - bool Summon; - - void EnterCombat(Unit* who) - { - if (Summon) - { - DoScriptText(SAY_AGGRO, me); - me->InterruptSpell(CURRENT_CHANNELED_SPELL); - DoZoneInCombat(who->ToCreature()); - } - else - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetReactState(REACT_PASSIVE); - uiStep = 1; - } - - if (instance) - instance->SetData(BOSS_ALGALON, IN_PROGRESS); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); - } - - void Reset() - { - Phase = 1; - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (instance) - instance->SetData(BOSS_ALGALON, NOT_STARTED); - - BlackHoleGUID = 0; - - uiPhase_timer = 0; - Ascend_Timer = 480000; //8 minutes - QuantumStrike_Timer = urand(4000, 14000); - Berserk_Timer = 360000; //6 minutes - CollapsingStar_Timer = urand(15000, 20000); //Spawns between 15 to 20 seconds - BigBang_Timer = 90000; - PhasePunch_Timer = 8000; - CosmicSmash_Timer = urand(30000, 60000); - Enrage = false; - } - - void JumpToNextStep(uint32 uiTimer) - { - uiPhase_timer = uiTimer; - ++uiStep; - } - - void DespawnCollapsingStar() - { - if (m_lCollapsingStarGUIDList.empty()) - return; - - for (std::list::const_iterator itr = m_lCollapsingStarGUIDList.begin(); itr != m_lCollapsingStarGUIDList.end(); ++itr) - { - if (Creature* temp = Unit::GetCreature(*me, *itr)) - { - if (temp->isAlive()) - temp->DespawnOrUnsummon(); - } - } - m_lCollapsingStarGUIDList.clear(); - } - - void JustSummoned(Creature* summoned) - { - if (summoned->GetEntry() == CREATURE_COLLAPSING_STAR) - { - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (me->getVictim()) - summoned->AI()->AttackStart(target ? target : me->getVictim()); - m_lCollapsingStarGUIDList.push_back(summoned->GetGUID()); - } - } - - void SummonCollapsingStar(Unit* target) - { - DoScriptText(SAY_SUMMON_COLLAPSING_STAR, me); - me->SummonCreature(CREATURE_COLLAPSING_STAR, target->GetPositionX()+15.0f, target->GetPositionY()+15.0f, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 100000); - me->SummonCreature(CREATURE_BLACK_HOLE, target->GetPositionX()+15.0f, target->GetPositionY()+15.0f, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 27000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (Phase == 1 && HealthBelowPct(20)) - { - Phase = 2; - DoScriptText(SAY_PHASE_2, me); - } - - if (HealthBelowPct(2)) - { - me->SummonGameObject(GAMEOBJECT_GIVE_OF_THE_OBSERVER, 1634.258667f, -295.101166f, 417.321381f, 0, 0, 0, 0, 0, 0); - - // All of them. or random? - DoScriptText(SAY_DEATH_1, me); - DoScriptText(SAY_DEATH_2, me); - DoScriptText(SAY_DEATH_3, me); - DoScriptText(SAY_DEATH_4, me); - DoScriptText(SAY_DEATH_5, me); - - me->DisappearAndDie(); - - if (instance) - instance->SetData(BOSS_ALGALON, DONE); - - return; - } - - if (Phase == 1) - { - if (!Summon) - { - if (uiPhase_timer <= diff) - { - switch (uiStep) - { - case 1: - DoScriptText(SAY_SUMMON_1, me); - JumpToNextStep(3000); - break; - case 2: - DoScriptText(SAY_SUMMON_2, me); - JumpToNextStep(3000); - break; - case 3: - DoScriptText(SAY_SUMMON_3, me); - JumpToNextStep(3000); - break; - case 4: - DoScriptText(SAY_ENGADED_FOR_FIRTS_TIME, me); - JumpToNextStep(3000); - break; - case 5: - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetReactState(REACT_AGGRESSIVE); - Summon = true; - break; - } - } else uiPhase_timer -= diff; - - return; - } - - if (QuantumStrike_Timer <= diff) - { - DoCast(me->getVictim(), RAID_MODE(SPELL_QUANTUM_STRIKE, H_SPELL_QUANTUM_STRIKE), true); - - QuantumStrike_Timer = urand(4000, 14000); - } else QuantumStrike_Timer -= diff; - - if (BigBang_Timer <= diff) - { - DoScriptText(RAND(SAY_BIG_BANG_1, SAY_BIG_BANG_2), me); - DoCast(me->getVictim(), RAID_MODE(SPELL_BIG_BANG, H_SPELL_BIG_BANG), true); - - BigBang_Timer = 90000; - } else BigBang_Timer -= diff; - - if (Ascend_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ASCEND, true); - - Ascend_Timer = 480000; - } else Ascend_Timer -= diff; - - if (PhasePunch_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_PHASE_PUNCH, true); - - PhasePunch_Timer = 8000; - } else PhasePunch_Timer -= diff; - - if (CosmicSmash_Timer <= diff) - { - DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), RAID_MODE(SPELL_COSMIC_SMASH, H_SPELL_COSMIC_SMASH), true); - - CosmicSmash_Timer = urand(30000, 60000); - } else CosmicSmash_Timer -= diff; - - if (Berserk_Timer <= diff) - { - DoScriptText(SAY_BERSERK, me); - DoCast(me->getVictim(), SPELL_BERSERK, true); - - Berserk_Timer = 360000; - } else Berserk_Timer -= diff; - - DoMeleeAttackIfReady(); - - EnterEvadeIfOutOfCombatArea(diff); - } - - if (Phase == 2) - { - if (Enrage) - { - if (Ascend_Timer <= diff) - { - DoCast(me, SPELL_ASCEND); - DoScriptText(SAY_BERSERK, me); - Ascend_Timer = urand(360000, 365000); - Enrage = false; - } else Ascend_Timer -= diff; - } - } - - DoMeleeAttackIfReady(); - } - }; - -}; - -//Collapsing Star -class mob_collapsing_star : public CreatureScript -{ -public: - mob_collapsing_star() : CreatureScript("mob_collapsing_star") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_collapsing_starAI(creature); - } - - struct mob_collapsing_starAI : public ScriptedAI - { - mob_collapsing_starAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - InstanceScript* instance; - - uint32 BlackHoleExplosion_Timer; - - void Reset() - { - BlackHoleExplosion_Timer = 0; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (BlackHoleExplosion_Timer <= diff) - { - me->CastSpell(me, SPELL_BLACK_HOLE_EXPLOSION, false); - BlackHoleExplosion_Timer = 0; - } else BlackHoleExplosion_Timer -= diff; - } - }; - -}; - -void AddSC_boss_Algalon() -{ - new boss_algalon(); - new mob_collapsing_star(); -} diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp new file mode 100644 index 00000000000..4465fc08792 --- /dev/null +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -0,0 +1,1374 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include "ObjectMgr.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "GameObjectAI.h" +#include "MapManager.h" +#include "MoveSplineInit.h" +#include "ulduar.h" + +enum Texts +{ + SAY_BRANN_ALGALON_INTRO_1 = 0, + SAY_BRANN_ALGALON_INTRO_2 = 1, + SAY_BRANN_ALGALON_OUTRO = 2, + + SAY_ALGALON_INTRO_1 = 0, + SAY_ALGALON_INTRO_2 = 1, + SAY_ALGALON_INTRO_3 = 2, + SAY_ALGALON_START_TIMER = 3, + SAY_ALGALON_AGGRO = 4, + SAY_ALGALON_COLLAPSING_STAR = 5, + EMOTE_ALGALON_COLLAPSING_STAR = 6, + SAY_ALGALON_BIG_BANG = 7, + EMOTE_ALGALON_BIG_BANG = 8, + SAY_ALGALON_ASCEND = 9, + EMOTE_ALGALON_COSMIC_SMASH = 10, + SAY_ALGALON_PHASE_TWO = 11, + SAY_ALGALON_OUTRO_1 = 12, + SAY_ALGALON_OUTRO_2 = 13, + SAY_ALGALON_OUTRO_3 = 14, + SAY_ALGALON_OUTRO_4 = 15, + SAY_ALGALON_OUTRO_5 = 16, + SAY_ALGALON_DESPAWN_1 = 17, + SAY_ALGALON_DESPAWN_2 = 18, + SAY_ALGALON_DESPAWN_3 = 19, + SAY_ALGALON_KILL = 20, +}; + +enum Spells +{ + // Algalon the Observer + SPELL_ARRIVAL = 64997, + SPELL_RIDE_THE_LIGHTNING = 64986, + SPELL_SUMMON_AZEROTH = 64994, + SPELL_REORIGINATION = 64996, + SPELL_SUPERMASSIVE_FAIL = 65311, + SPELL_QUANTUM_STRIKE = 64395, + SPELL_PHASE_PUNCH = 64412, + SPELL_BIG_BANG = 64443, + SPELL_ASCEND_TO_THE_HEAVENS = 64487, + SPELL_COSMIC_SMASH = 62301, + SPELL_COSMIC_SMASH_TRIGGERED = 62304, + SPELL_COSMIC_SMASH_VISUAL_STATE = 62300, + SPELL_SELF_STUN = 65256, + SPELL_KILL_CREDIT = 65184, + SPELL_TELEPORT = 62940, + + // Algalon Stalker + SPELL_TRIGGER_3_ADDS = 62266, // Triggers Living Constellation + + // Living Constellation + SPELL_ARCANE_BARRAGE = 64599, + + // Collapsing Star + SPELL_COLLAPSE = 62018, + SPELL_BLACK_HOLE_SPAWN_VISUAL = 62003, + SPELL_SUMMON_BLACK_HOLE = 62189, + + // Black Hole + SPELL_BLACK_HOLE_TRIGGER = 62185, + SPELL_CONSTELLATION_PHASE_TRIGGER = 65508, + SPELL_CONSTELLATION_PHASE_EFFECT = 65509, + SPELL_BLACK_HOLE_EXPLOSION = 64122, + SPELL_SUMMON_VOID_ZONE_VISUAL = 64470, + SPELL_VOID_ZONE_VISUAL = 64469, + SPELL_BLACK_HOLE_CREDIT = 65312, + + // Worm Hole + SPELL_WORM_HOLE_TRIGGER = 65251, + SPELL_SUMMON_UNLEASHED_DARK_MATTER = 64450, +}; + +uint32 const PhasePunchAlphaId[5] = {64435, 64434, 64428, 64421, 64417}; + +enum Events +{ + // Celestial Planetarium Access + EVENT_DESPAWN_CONSOLE = 1, + + // Brann Bronzebeard + EVENT_BRANN_MOVE_INTRO = 2, + EVENT_SUMMON_ALGALON = 3, + EVENT_BRANN_OUTRO_1 = 4, + EVENT_BRANN_OUTRO_2 = 5, + + // Algalon the Observer + EVENT_INTRO_1 = 6, + EVENT_INTRO_2 = 7, + EVENT_INTRO_3 = 8, + EVENT_INTRO_FINISH = 9, + EVENT_START_COMBAT = 10, + EVENT_INTRO_TIMER_DONE = 11, + EVENT_QUANTUM_STRIKE = 12, + EVENT_PHASE_PUNCH = 13, + EVENT_SUMMON_COLLAPSING_STAR = 14, + EVENT_BIG_BANG = 15, + EVENT_RESUME_UPDATING = 16, + EVENT_ASCEND_TO_THE_HEAVENS = 17, + EVENT_EVADE = 18, + EVENT_COSMIC_SMASH = 19, + EVENT_UNLOCK_YELL = 20, + EVENT_OUTRO_START = 21, + EVENT_OUTRO_1 = 22, + EVENT_OUTRO_2 = 23, + EVENT_OUTRO_3 = 24, + EVENT_OUTRO_4 = 25, + EVENT_OUTRO_5 = 26, + EVENT_OUTRO_6 = 27, + EVENT_OUTRO_7 = 28, + EVENT_OUTRO_8 = 29, + EVENT_OUTRO_9 = 30, + EVENT_OUTRO_10 = 31, + EVENT_OUTRO_11 = 32, + EVENT_OUTRO_12 = 33, + EVENT_OUTRO_13 = 34, + EVENT_OUTRO_14 = 35, + EVENT_DESPAWN_ALGALON_1 = 36, + EVENT_DESPAWN_ALGALON_2 = 37, + EVENT_DESPAWN_ALGALON_3 = 38, + + // Living Constellation + EVENT_ARCANE_BARRAGE = 39, +}; + +enum Actions +{ + ACTION_START_INTRO = 0, + ACTION_FINISH_INTRO = 1, + ACTION_ACTIVATE_STAR = 2, + ACTION_BIG_BANG = 3, + ACTION_ASCEND = 4, + ACTION_OUTRO = 5, +}; + +enum Points +{ + POINT_BRANN_INTRO = 0, + MAX_BRANN_WAYPOINTS_INTRO = 10, + POINT_BRANN_OUTRO = 10, + POINT_BRANN_OUTRO_END = 11, + + POINT_ALGALON_LAND = 1, + POINT_ALGALON_OUTRO = 2, +}; + +enum EncounterPhases +{ + PHASE_NORMAL = 0, + PHASE_ROLE_PLAY = 1, + PHASE_BIG_BANG = 2, + + PHASE_MASK_NO_UPDATE = (1 << PHASE_ROLE_PLAY) | (1 << PHASE_BIG_BANG), + PHASE_MASK_NO_CAST_CHECK = 1 << PHASE_ROLE_PLAY, +}; + +enum AchievmentInfo +{ + EVENT_ID_SUPERMASSIVE_START = 21697, + DATA_HAS_FED_ON_TEARS = 30043005, +}; + + +Position const BrannIntroSpawnPos = {1676.277f, -162.5308f, 427.3326f, 3.235537f}; +Position const BrannIntroWaypoint[MAX_BRANN_WAYPOINTS_INTRO] = +{ + {1642.482f, -164.0812f, 427.2602f, 0.0f}, + {1635.000f, -169.5145f, 427.2523f, 0.0f}, + {1632.814f, -173.9334f, 427.2621f, 0.0f}, + {1632.676f, -190.5927f, 425.8831f, 0.0f}, + {1631.497f, -214.2221f, 418.1152f, 0.0f}, + {1624.717f, -224.6876f, 418.1152f, 0.0f}, + {1631.497f, -214.2221f, 418.1152f, 0.0f}, + {1632.676f, -190.5927f, 425.8831f, 0.0f}, + {1632.814f, -173.9334f, 427.2621f, 0.0f}, + {1635.000f, -169.5145f, 427.2523f, 0.0f}, +}; +Position const AlgalonSummonPos = {1632.531f, -304.8516f, 450.1123f, 1.530165f}; +Position const AlgalonLandPos = {1632.668f, -302.7656f, 417.3211f, 1.530165f}; + +#define LIVING_CONSTELLATION_COUNT 11 +Position const ConstellationPos[LIVING_CONSTELLATION_COUNT] = +{ + {1625.208f, -267.2771f, 446.4296f, 5.044002f}, + {1658.279f, -262.5490f, 441.9073f, 4.188790f}, + {1678.677f, -276.3280f, 427.7531f, 3.979351f}, + {1593.389f, -299.4325f, 432.4636f, 6.073746f}, + {1685.613f, -300.1219f, 443.2366f, 3.385939f}, + {1591.706f, -263.8201f, 441.4153f, 5.253441f}, + {1668.317f, -324.7676f, 457.9394f, 3.211406f}, + {1592.242f, -325.5323f, 446.9508f, 0.226893f}, + {1635.821f, -363.3442f, 424.3459f, 1.466077f}, + {1672.188f, -357.2484f, 436.7337f, 2.338741f}, + {1615.800f, -348.0065f, 442.9586f, 1.134464f}, +}; + +#define COLLAPSING_STAR_COUNT 4 +Position const CollapsingStarPos[COLLAPSING_STAR_COUNT] = +{ + {1649.438f, -319.8127f, 418.3941f, 1.082104f}, + {1647.005f, -288.6790f, 417.3955f, 3.490659f}, + {1622.451f, -321.1563f, 417.6188f, 4.677482f}, + {1615.060f, -291.6816f, 417.7796f, 3.490659f}, +}; +Position const AlgalonOutroPos = {1633.64f, -317.78f, 417.3211f, 0.0f}; +Position const BrannOutroPos[3] = +{ + {1632.023f, -243.7434f, 417.9118f, 0.0f}, + {1631.986f, -297.7831f, 417.3210f, 0.0f}, + {1633.832f, -216.2948f, 417.0463f, 0.0f}, +}; + +class ActivateLivingConstellation : public BasicEvent +{ + public: + ActivateLivingConstellation(Unit* owner) : _owner(owner), _instance(owner->GetInstanceScript()) + { + } + + bool Execute(uint64 execTime, uint32 /*diff*/) + { + if (!_instance || _instance->GetBossState(BOSS_ALGALON) != IN_PROGRESS) + return true; // delete event + + _owner->CastSpell((Unit*)NULL, SPELL_TRIGGER_3_ADDS, TRIGGERED_FULL_MASK); + _owner->m_Events.AddEvent(this, execTime + urand(45000, 50000)); + return false; + } + + private: + Unit* _owner; + InstanceScript* _instance; +}; + +class CosmicSmashDamageEvent : public BasicEvent +{ + public: + CosmicSmashDamageEvent(Unit* caster) : _caster(caster) + { + } + + bool Execute(uint64 /*execTime*/, uint32 /*diff*/) + { + _caster->CastSpell((Unit*)NULL, SPELL_COSMIC_SMASH_TRIGGERED, TRIGGERED_FULL_MASK); + return true; + } + + private: + Unit* _caster; +}; + +class SummonUnleashedDarkMatter : public BasicEvent +{ + public: + SummonUnleashedDarkMatter(Unit* caster) : _caster(caster) + { + } + + bool Execute(uint64 execTime, uint32 /*diff*/) + { + _caster->CastSpell((Unit*)NULL, SPELL_SUMMON_UNLEASHED_DARK_MATTER, TRIGGERED_FULL_MASK); + _caster->m_Events.AddEvent(this, execTime + 30000); + return false; + } + + private: + Unit* _caster; +}; + +class boss_algalon_the_observer : public CreatureScript +{ + public: + boss_algalon_the_observer() : CreatureScript("boss_algalon_the_observer") {} + + struct boss_algalon_the_observerAI : public BossAI + { + boss_algalon_the_observerAI(Creature* creature) : BossAI(creature, BOSS_ALGALON) + { + _firstPull = true; + _fedOnTears = false; + } + + void Reset() + { + _Reset(); + me->SetReactState(REACT_PASSIVE); + _phaseTwo = false; + _fightWon = false; + _hasYelled = false; + } + + void KilledUnit(Unit* victim) + { + if (victim->GetTypeId() == TYPEID_UNIT) + { + _fedOnTears = true; + if (!_hasYelled) + { + _hasYelled = true; + events.ScheduleEvent(EVENT_UNLOCK_YELL, 1000); + Talk(SAY_ALGALON_KILL); + } + } + } + + void DoAction(int32 const action) + { + switch (action) + { + case ACTION_START_INTRO: + { + me->SetFlag(UNIT_FIELD_FLAGS_2, 0x20); + me->SetDisableGravity(true); + DoCast(me, SPELL_ARRIVAL, true); + DoCast(me, SPELL_RIDE_THE_LIGHTNING, true); + me->GetMotionMaster()->MovePoint(POINT_ALGALON_LAND, AlgalonLandPos); + me->SetHomePosition(AlgalonLandPos); + Movement::MoveSplineInit init(*me); + init.MoveTo(AlgalonLandPos.GetPositionX(), AlgalonLandPos.GetPositionY(), AlgalonLandPos.GetPositionZ()); + init.SetOrientationFixed(true); + init.Launch(); + events.Reset(); + events.SetPhase(PHASE_ROLE_PLAY); + events.ScheduleEvent(EVENT_INTRO_1, 5000, 0, PHASE_ROLE_PLAY); + events.ScheduleEvent(EVENT_INTRO_2, 15000, 0, PHASE_ROLE_PLAY); + events.ScheduleEvent(EVENT_INTRO_3, 23000, 0, PHASE_ROLE_PLAY); + events.ScheduleEvent(EVENT_INTRO_FINISH, 36000, 0, PHASE_ROLE_PLAY); + break; + } + case ACTION_ASCEND: + events.SetPhase(PHASE_BIG_BANG); + events.CancelEvent(EVENT_RESUME_UPDATING); + events.ScheduleEvent(EVENT_ASCEND_TO_THE_HEAVENS, 1500); + break; + case EVENT_DESPAWN_ALGALON: + events.Reset(); + events.SetPhase(PHASE_ROLE_PLAY); + events.ScheduleEvent(EVENT_ASCEND_TO_THE_HEAVENS, 1); + events.ScheduleEvent(EVENT_DESPAWN_ALGALON_1, 5000); + events.ScheduleEvent(EVENT_DESPAWN_ALGALON_2, 17000); + events.ScheduleEvent(EVENT_DESPAWN_ALGALON_3, 26000); + me->DespawnOrUnsummon(34000); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_NPC); + break; + case ACTION_INIT_ALGALON: + _firstPull = false; + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + break;; + } + } + + uint32 GetData(uint32 type) + { + return type == DATA_HAS_FED_ON_TEARS ? _fedOnTears : 1; + } + + void EnterCombat(Unit* /*target*/) + { + uint32 introDelay = 0; + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_NPC); + events.Reset(); + events.SetPhase(PHASE_ROLE_PLAY); + + if (!_firstPull) + { + Talk(SAY_ALGALON_AGGRO); + _EnterCombat(); + introDelay = 8000; + } + else + { + _firstPull = false; + Talk(SAY_ALGALON_START_TIMER); + if (Creature* brann = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BRANN_BRONZEBEARD_ALG))) + brann->AI()->DoAction(ACTION_FINISH_INTRO); + + me->setActive(true); + DoZoneInCombat(); + introDelay = 26000; + summons.DespawnEntry(NPC_AZEROTH); + instance->SetData(EVENT_DESPAWN_ALGALON, 0); + events.ScheduleEvent(EVENT_START_COMBAT, 18000); + } + + events.ScheduleEvent(EVENT_INTRO_TIMER_DONE, introDelay); + events.ScheduleEvent(EVENT_QUANTUM_STRIKE, 3500 + introDelay); + events.ScheduleEvent(EVENT_PHASE_PUNCH, 15500 + introDelay); + events.ScheduleEvent(EVENT_SUMMON_COLLAPSING_STAR, 18000 + introDelay); + events.ScheduleEvent(EVENT_BIG_BANG, 90000 + introDelay); + events.ScheduleEvent(EVENT_ASCEND_TO_THE_HEAVENS, 360000 + introDelay); + events.ScheduleEvent(EVENT_COSMIC_SMASH, 25000 + introDelay); + + std::list stalkers; + me->GetCreatureListWithEntryInGrid(stalkers, NPC_ALGALON_STALKER, 200.0f); + for (std::list::iterator itr = stalkers.begin(); itr != stalkers.end(); ++itr) + (*itr)->m_Events.KillAllEvents(true); + } + + void MovementInform(uint32 movementType, uint32 pointId) + { + if (movementType != POINT_MOTION_TYPE) + return; + + if (pointId == POINT_ALGALON_LAND) + me->SetDisableGravity(false); + else if (pointId == POINT_ALGALON_OUTRO) + { + me->SetFacingTo(1.605703f); + events.ScheduleEvent(EVENT_OUTRO_3, 1200); + events.ScheduleEvent(EVENT_OUTRO_4, 2400); + events.ScheduleEvent(EVENT_OUTRO_5, 8500); + events.ScheduleEvent(EVENT_OUTRO_6, 15500); + events.ScheduleEvent(EVENT_OUTRO_7, 55500); + events.ScheduleEvent(EVENT_OUTRO_8, 73500); + events.ScheduleEvent(EVENT_OUTRO_9, 85500); + events.ScheduleEvent(EVENT_OUTRO_10, 108500); + events.ScheduleEvent(EVENT_OUTRO_11, 123500); + } + } + + void JustSummoned(Creature* summon) + { + summons.Summon(summon); + switch (summon->GetEntry()) + { + case NPC_AZEROTH: + DoCastAOE(SPELL_REORIGINATION, true); + break; + case NPC_COLLAPSING_STAR: + summon->SetReactState(REACT_PASSIVE); + summon->GetMotionMaster()->MoveRandom(20.0f); + summon->CastSpell(summon, SPELL_COLLAPSE, TRIGGERED_FULL_MASK); + break; + case NPC_BLACK_HOLE: + summon->SetReactState(REACT_PASSIVE); + summon->CastSpell((Unit*)NULL, SPELL_BLACK_HOLE_TRIGGER, TRIGGERED_FULL_MASK); + summon->CastSpell(summon, SPELL_CONSTELLATION_PHASE_TRIGGER, TRIGGERED_FULL_MASK); + summon->CastSpell((Unit*)NULL, SPELL_BLACK_HOLE_EXPLOSION); + summon->CastSpell(summon, SPELL_SUMMON_VOID_ZONE_VISUAL, TRIGGERED_FULL_MASK); + break; + case NPC_ALGALON_VOID_ZONE_VISUAL_STALKER: + summon->CastSpell(summon, SPELL_VOID_ZONE_VISUAL, TRIGGERED_FULL_MASK); + break; + case NPC_ALGALON_STALKER_ASTEROID_TARGET_01: + summon->CastSpell(summon, SPELL_COSMIC_SMASH_VISUAL_STATE, TRIGGERED_FULL_MASK); + break; + case NPC_ALGALON_STALKER_ASTEROID_TARGET_02: + summon->m_Events.AddEvent(new CosmicSmashDamageEvent(summon), summon->m_Events.CalculateTime(3250)); + break; + case NPC_WORM_HOLE: + summon->SetReactState(REACT_PASSIVE); + summon->CastSpell(summon, SPELL_WORM_HOLE_TRIGGER, TRIGGERED_FULL_MASK); + summon->CastSpell(summon, SPELL_SUMMON_VOID_ZONE_VISUAL, TRIGGERED_FULL_MASK); + break; + case NPC_UNLEASHED_DARK_MATTER: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, NonTankTargetSelector(me))) + if (summon->Attack(target, true)) + summon->GetMotionMaster()->MoveChase(target); + break; + } + } + + void EnterEvadeMode() + { + instance->SetBossState(BOSS_ALGALON, FAIL); + BossAI::EnterEvadeMode(); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + me->SetSheath(SHEATH_STATE_UNARMED); + } + + void DamageTaken(Unit* /*attacker*/, uint32& damage) + { + if (_fightWon) + { + damage = 0; + return; + } + + if (!_phaseTwo && me->HealthBelowPctDamaged(20, damage)) + { + _phaseTwo = true; + Talk(SAY_ALGALON_PHASE_TWO); + summons.DespawnEntry(NPC_LIVING_CONSTELLATION); + summons.DespawnEntry(NPC_COLLAPSING_STAR); + summons.DespawnEntry(NPC_BLACK_HOLE); + summons.DespawnEntry(NPC_ALGALON_VOID_ZONE_VISUAL_STALKER); + events.CancelEvent(EVENT_SUMMON_COLLAPSING_STAR); + std::list stalkers; + me->GetCreatureListWithEntryInGrid(stalkers, NPC_ALGALON_STALKER, 200.0f); + for (std::list::iterator itr = stalkers.begin(); itr != stalkers.end(); ++itr) + (*itr)->m_Events.KillAllEvents(true); + for (uint32 i = 0; i < COLLAPSING_STAR_COUNT; ++i) + if (Creature* wormHole = DoSummon(NPC_WORM_HOLE, CollapsingStarPos[i], TEMPSUMMON_MANUAL_DESPAWN)) + wormHole->m_Events.AddEvent(new SummonUnleashedDarkMatter(wormHole), wormHole->m_Events.CalculateTime(i >= 2 ? 8000 : 6000)); + } + else if ((int32(me->GetHealth()) - int32(damage)) < CalculatePctF(int32(me->GetMaxHealth()), 2.5f) && !_fightWon) + { + _fightWon = true; + damage = 0; + me->SetReactState(REACT_PASSIVE); + me->AttackStop(); + me->setFaction(35); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoCast(me, SPELL_SELF_STUN); + events.Reset(); + summons.DespawnAll(); + events.SetPhase(PHASE_ROLE_PLAY); + events.ScheduleEvent(EVENT_OUTRO_START, 1500); + events.ScheduleEvent(EVENT_OUTRO_1, 7200); + events.ScheduleEvent(EVENT_OUTRO_2, 8700); + } + } + + void UpdateAI(uint32 const diff) + { + if ((!(events.GetPhaseMask() & PHASE_MASK_NO_UPDATE) && !UpdateVictim()) || !CheckInRoom()) + return; + + events.Update(diff); + + if (!(events.GetPhaseMask() & PHASE_MASK_NO_CAST_CHECK)) + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_INTRO_1: + me->RemoveAurasDueToSpell(SPELL_RIDE_THE_LIGHTNING); + Talk(SAY_ALGALON_INTRO_1); + break; + case EVENT_INTRO_2: + DoCastAOE(SPELL_SUMMON_AZEROTH, true); + Talk(SAY_ALGALON_INTRO_2); + break; + case EVENT_INTRO_3: + Talk(SAY_ALGALON_INTRO_3); + break; + case EVENT_INTRO_FINISH: + events.Reset(); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + break; + case EVENT_START_COMBAT: + instance->SetBossState(BOSS_ALGALON, IN_PROGRESS); + break; + case EVENT_INTRO_TIMER_DONE: + { + events.SetPhase(PHASE_NORMAL); + me->SetSheath(SHEATH_STATE_MELEE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetReactState(REACT_DEFENSIVE); + DoCastAOE(SPELL_SUPERMASSIVE_FAIL, true); + //! Workaround for Creature::_IsTargetAcceptable returning false + //! for creatures that start combat in REACT_PASSIVE and UNIT_FLAG_NOT_SELECTABLE + //! causing them to immediately evade + if (!me->getThreatManager().isThreatListEmpty()) + AttackStart(me->getThreatManager().getHostilTarget()); + for (uint32 i = 0; i < LIVING_CONSTELLATION_COUNT; ++i) + if (Creature* summon = DoSummon(NPC_LIVING_CONSTELLATION, ConstellationPos[i], 0, TEMPSUMMON_DEAD_DESPAWN)) + summon->SetReactState(REACT_PASSIVE); + + std::list stalkers; + me->GetCreatureListWithEntryInGrid(stalkers, NPC_ALGALON_STALKER, 200.0f); + if (!stalkers.empty()) + { + Unit* stalker = Trinity::Containers::SelectRandomContainerElement(stalkers); + stalker->m_Events.AddEvent(new ActivateLivingConstellation(stalker), stalker->m_Events.CalculateTime(urand(45000, 50000))); + } + break; + } + case EVENT_QUANTUM_STRIKE: + DoCastVictim(SPELL_QUANTUM_STRIKE); + events.ScheduleEvent(EVENT_QUANTUM_STRIKE, urand(3000, 5000)); + break; + case EVENT_PHASE_PUNCH: + DoCastVictim(SPELL_PHASE_PUNCH); + events.ScheduleEvent(EVENT_PHASE_PUNCH, 15500); + break; + case EVENT_SUMMON_COLLAPSING_STAR: + Talk(SAY_ALGALON_COLLAPSING_STAR); + Talk(EMOTE_ALGALON_COLLAPSING_STAR); + for (uint32 i = 0; i < COLLAPSING_STAR_COUNT; ++i) + me->SummonCreature(NPC_COLLAPSING_STAR, CollapsingStarPos[i], TEMPSUMMON_CORPSE_DESPAWN); + events.ScheduleEvent(EVENT_SUMMON_COLLAPSING_STAR, 60000); + break; + case EVENT_BIG_BANG: + { + Talk(SAY_ALGALON_BIG_BANG); + Talk(EMOTE_ALGALON_BIG_BANG); + events.SetPhase(PHASE_BIG_BANG); + std::list constellations; + me->GetCreatureListWithEntryInGrid(constellations, NPC_LIVING_CONSTELLATION, 200.0f); + for (std::list::iterator itr = constellations.begin(); itr != constellations.end(); ++itr) + (*itr)->AI()->DoAction(ACTION_BIG_BANG); + DoCastAOE(SPELL_BIG_BANG); + events.ScheduleEvent(EVENT_BIG_BANG, 90500); + events.ScheduleEvent(EVENT_RESUME_UPDATING, 9500); + break; + } + case EVENT_RESUME_UPDATING: + events.SetPhase(0); + break; + case EVENT_ASCEND_TO_THE_HEAVENS: + Talk(SAY_ALGALON_ASCEND); + DoCastAOE(SPELL_ASCEND_TO_THE_HEAVENS); + events.ScheduleEvent(EVENT_EVADE, 2500); + break; + case EVENT_EVADE: + EnterEvadeMode(); + break; + case EVENT_COSMIC_SMASH: + Talk(EMOTE_ALGALON_COSMIC_SMASH); + DoCastAOE(SPELL_COSMIC_SMASH); + events.ScheduleEvent(EVENT_COSMIC_SMASH, 25500); + break; + case EVENT_UNLOCK_YELL: + _hasYelled = false; + break; + case EVENT_OUTRO_START: + instance->SetBossState(BOSS_ALGALON, DONE); + break; + case EVENT_OUTRO_1: + me->RemoveAllAuras(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_RENAME); + break; + case EVENT_OUTRO_2: + _EnterEvadeMode(); + me->AddUnitState(UNIT_STATE_EVADE); + me->GetMotionMaster()->MovePoint(POINT_ALGALON_OUTRO, AlgalonOutroPos); + break; + case EVENT_OUTRO_3: + DoCastAOE(SPELL_KILL_CREDIT); + break; + case EVENT_OUTRO_4: + DoCastAOE(SPELL_SUPERMASSIVE_FAIL); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + break; + case EVENT_OUTRO_5: + if (Creature* brann = DoSummon(NPC_BRANN_BRONZBEARD_ALG, BrannOutroPos[0], 131500, TEMPSUMMON_TIMED_DESPAWN)) + brann->AI()->DoAction(ACTION_OUTRO); + break; + case EVENT_OUTRO_6: + Talk(SAY_ALGALON_OUTRO_1); + me->SetStandState(UNIT_STAND_STATE_KNEEL); + break; + case EVENT_OUTRO_7: + Talk(SAY_ALGALON_OUTRO_2); + break; + case EVENT_OUTRO_8: + Talk(SAY_ALGALON_OUTRO_3); + break; + case EVENT_OUTRO_9: + Talk(SAY_ALGALON_OUTRO_4); + break; + case EVENT_OUTRO_10: + Talk(SAY_ALGALON_OUTRO_5); + break; + case EVENT_OUTRO_11: + me->SetStandState(UNIT_STAND_STATE_STAND); + DoCast(me, SPELL_TELEPORT); + me->DespawnOrUnsummon(1500); + break; + } + } + + DoMeleeAttackIfReady(); + } + + private: + bool _firstPull; + bool _fedOnTears; + bool _phaseTwo; + bool _fightWon; + bool _hasYelled; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetUlduarAI(creature); + } +}; + +class npc_living_constellation : public CreatureScript +{ + public: + npc_living_constellation() : CreatureScript("npc_living_constellation") { } + + struct npc_living_constellationAI : public CreatureAI + { + npc_living_constellationAI(Creature* creature) : CreatureAI(creature) + { + } + + void Reset() + { + _events.Reset(); + _events.ScheduleEvent(EVENT_ARCANE_BARRAGE, 2500); + _isActive = false; + } + + uint32 GetData(uint32 /*type*/) + { + return _isActive ? 1 : 0; + } + + void DoAction(int32 const action) + { + if (action != ACTION_ACTIVATE_STAR) + return; + + switch (action) + { + case ACTION_ACTIVATE_STAR: + if (Creature* algalon = me->FindNearestCreature(NPC_ALGALON, 200.0f)) + { + if (Unit* target = algalon->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0, NonTankTargetSelector(algalon))) + { + me->SetReactState(REACT_AGGRESSIVE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + AttackStart(target); + DoZoneInCombat(); + _isActive = true; + } + } + break; + case ACTION_BIG_BANG: + _events.SetPhase(PHASE_BIG_BANG); + _events.DelayEvents(9500); + _events.ScheduleEvent(EVENT_RESUME_UPDATING, 9500); + break; + } + } + + void SpellHit(Unit* caster, SpellInfo const* spell) + { + if (spell->Id != SPELL_CONSTELLATION_PHASE_EFFECT || caster->GetTypeId() != TYPEID_UNIT) + return; + + me->DespawnOrUnsummon(1); + if (InstanceScript* instance = me->GetInstanceScript()) + instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EVENT_ID_SUPERMASSIVE_START); + caster->CastSpell((Unit*)NULL, SPELL_BLACK_HOLE_CREDIT, TRIGGERED_FULL_MASK); + caster->ToCreature()->DespawnOrUnsummon(1); + } + + void UpdateAI(uint32 const diff) + { + if (!(_events.GetPhaseMask() & PHASE_MASK_NO_UPDATE) && !UpdateVictim()) + return; + + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_ARCANE_BARRAGE: + DoCastAOE(SPELL_ARCANE_BARRAGE); + _events.ScheduleEvent(EVENT_ARCANE_BARRAGE, 2500); + break; + case EVENT_RESUME_UPDATING: + _events.SetPhase(0); + break; + } + } + } + + private: + EventMap _events; + bool _isActive; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetUlduarAI(creature); + } +}; + +class npc_collapsing_star : public CreatureScript +{ + public: + npc_collapsing_star() : CreatureScript("npc_collapsing_star") { } + + struct npc_collapsing_starAI : public PassiveAI + { + npc_collapsing_starAI(Creature* creature) : PassiveAI(creature) + { + _dying = false; + } + + void JustSummoned(Creature* summon) + { + if (summon->GetEntry() != NPC_BLACK_HOLE) + return; + + if (TempSummon* summ = me->ToTempSummon()) + if (Creature* algalon = ObjectAccessor::GetCreature(*me, summ->GetSummonerGUID())) + algalon->AI()->JustSummoned(summon); + + me->DespawnOrUnsummon(1); + } + + void DamageTaken(Unit* /*attacker*/, uint32& damage) + { + if (_dying) + { + damage = 0; + return; + } + + if (damage >= me->GetHealth()) + { + _dying = true; + damage = 0; + DoCast(me, SPELL_BLACK_HOLE_SPAWN_VISUAL, true); + DoCast(me, SPELL_SUMMON_BLACK_HOLE, true); + } + } + + bool _dying; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetUlduarAI(creature); + } +}; + +class npc_brann_bronzebeard_algalon : public CreatureScript +{ + public: + npc_brann_bronzebeard_algalon() : CreatureScript("npc_brann_bronzebeard_algalon") { } + + struct npc_brann_bronzebeard_algalonAI : public CreatureAI + { + npc_brann_bronzebeard_algalonAI(Creature* creature) : CreatureAI(creature) + { + } + + void DoAction(int32 const action) + { + switch (action) + { + case ACTION_START_INTRO: + _currentPoint = 0; + _events.Reset(); + me->SetWalk(false); + _events.ScheduleEvent(EVENT_BRANN_MOVE_INTRO, 1); + break; + case ACTION_FINISH_INTRO: + Talk(SAY_BRANN_ALGALON_INTRO_2); + _events.ScheduleEvent(EVENT_BRANN_MOVE_INTRO, 1); + break; + case ACTION_OUTRO: + me->GetMotionMaster()->MovePoint(POINT_BRANN_OUTRO, BrannOutroPos[1]); + _events.ScheduleEvent(EVENT_BRANN_OUTRO_1, 89500); + _events.ScheduleEvent(EVENT_BRANN_OUTRO_2, 116500); + break; + } + } + + void MovementInform(uint32 movementType, uint32 pointId) + { + if (movementType != POINT_MOTION_TYPE) + return; + + uint32 delay = 1; + _currentPoint = pointId + 1; + switch (pointId) + { + case 2: + delay = 8000; + me->SetWalk(true); + break; + case 5: + me->SetWalk(false); + Talk(SAY_BRANN_ALGALON_INTRO_1); + _events.ScheduleEvent(EVENT_SUMMON_ALGALON, 7500); + return; + case 9: + me->DespawnOrUnsummon(1); + return; + case POINT_BRANN_OUTRO: + case POINT_BRANN_OUTRO_END: + return; + } + + _events.ScheduleEvent(EVENT_BRANN_MOVE_INTRO, delay); + } + + void UpdateAI(uint32 const diff) + { + UpdateVictim(); + + if (_events.Empty()) + return; + + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_BRANN_MOVE_INTRO: + if (_currentPoint < MAX_BRANN_WAYPOINTS_INTRO) + me->GetMotionMaster()->MovePoint(_currentPoint, BrannIntroWaypoint[_currentPoint]); + break; + case EVENT_SUMMON_ALGALON: + if (Creature* algalon = me->GetMap()->SummonCreature(NPC_ALGALON, AlgalonSummonPos)) + algalon->AI()->DoAction(ACTION_START_INTRO); + break; + case EVENT_BRANN_OUTRO_1: + Talk(SAY_BRANN_ALGALON_OUTRO); + break; + case EVENT_BRANN_OUTRO_2: + me->GetMotionMaster()->MovePoint(POINT_BRANN_OUTRO_END, BrannOutroPos[2]); + break; + } + } + } + + private: + EventMap _events; + uint32 _currentPoint; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetUlduarAI(creature); + } +}; + +class go_celestial_planetarium_access : public GameObjectScript +{ + public: + go_celestial_planetarium_access() : GameObjectScript("go_celestial_planetarium_access") {} + + struct go_celestial_planetarium_accessAI : public GameObjectAI + { + go_celestial_planetarium_accessAI(GameObject* go) : GameObjectAI(go) + { + } + + bool GossipHello(Player* player) + { + bool hasKey = true; + if (LockEntry const* lock = sLockStore.LookupEntry(go->GetGOInfo()->goober.lockId)) + { + hasKey = false; + for (uint32 i = 0; i < MAX_LOCK_CASE; ++i) + { + if (!lock->Index[i]) + continue; + + if (player->HasItemCount(lock->Index[i], 1)) + { + hasKey = true; + break; + } + } + } + + if (!hasKey) + return false; + + // Start Algalon event + go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); + _events.ScheduleEvent(EVENT_DESPAWN_CONSOLE, 5000); + if (Creature* brann = go->SummonCreature(NPC_BRANN_BRONZBEARD_ALG, BrannIntroSpawnPos)) + brann->AI()->DoAction(ACTION_START_INTRO); + + if (InstanceScript* instance = go->GetInstanceScript()) + { + instance->SetData(DATA_ALGALON_SUMMON_STATE, 1); + if (GameObject* sigil = ObjectAccessor::GetGameObject(*go, instance->GetData64(DATA_SIGILDOOR_01))) + sigil->SetGoState(GO_STATE_ACTIVE); + + if (GameObject* sigil = ObjectAccessor::GetGameObject(*go, instance->GetData64(DATA_SIGILDOOR_02))) + sigil->SetGoState(GO_STATE_ACTIVE); + } + + return false; + } + + void UpdateAI(uint32 diff) + { + if (_events.Empty()) + return; + + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_DESPAWN_CONSOLE: + go->Delete(); + break; + } + } + } + + EventMap _events; + }; + + GameObjectAI* GetAI(GameObject* go) const + { + return GetUlduarAI(go); + } +}; + +class spell_algalon_phase_punch : public SpellScriptLoader +{ + public: + spell_algalon_phase_punch() : SpellScriptLoader("spell_algalon_phase_punch") { } + + class spell_algalon_phase_punch_AuraScript : public AuraScript + { + PrepareAuraScript(spell_algalon_phase_punch_AuraScript); + + void HandlePeriodic(AuraEffect const* aurEff) + { + PreventDefaultAction(); + if (GetStackAmount() != 1) + GetTarget()->RemoveAurasDueToSpell(PhasePunchAlphaId[GetStackAmount() - 2]); + GetTarget()->CastSpell(GetTarget(), PhasePunchAlphaId[GetStackAmount() - 1], TRIGGERED_FULL_MASK); + if (GetStackAmount() == 5) + Remove(AURA_REMOVE_BY_DEFAULT); + } + + void OnRemove(AuraEffect const*, AuraEffectHandleModes) + { + if (GetStackAmount() != 5) + GetTarget()->RemoveAurasDueToSpell(PhasePunchAlphaId[GetStackAmount() - 1]); + } + + void Register() + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_algalon_phase_punch_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + OnEffectRemove += AuraEffectRemoveFn(spell_algalon_phase_punch_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_algalon_phase_punch_AuraScript(); + } +}; + +class NotVictimFilter +{ + public: + NotVictimFilter(Unit* caster) : _victim(caster->getVictim()) + { + } + + bool operator()(Unit* target) + { + return target != _victim; + } + + private: + Unit* _victim; +}; + +class spell_algalon_arcane_barrage : public SpellScriptLoader +{ + public: + spell_algalon_arcane_barrage() : SpellScriptLoader("spell_algalon_arcane_barrage") { } + + class spell_algalon_arcane_barrage_SpellScript : public SpellScript + { + PrepareSpellScript(spell_algalon_arcane_barrage_SpellScript); + + void SelectTarget(std::list& targets) + { + targets.remove_if(NotVictimFilter(GetCaster())); + } + + void Register() + { + OnUnitTargetSelect += SpellUnitTargetFn(spell_algalon_arcane_barrage_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_algalon_arcane_barrage_SpellScript(); + } +}; + +class ActiveConstellationFilter +{ + public: + bool operator()(Unit* target) const + { + return target->GetAI()->GetData(0); + } +}; + +class spell_algalon_trigger_3_adds : public SpellScriptLoader +{ + public: + spell_algalon_trigger_3_adds() : SpellScriptLoader("spell_algalon_trigger_3_adds") { } + + class spell_algalon_trigger_3_adds_SpellScript : public SpellScript + { + PrepareSpellScript(spell_algalon_trigger_3_adds_SpellScript); + + void SelectTarget(std::list& targets) + { + targets.remove_if(ActiveConstellationFilter()); + } + + void HandleDummy(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + Creature* target = GetHitCreature(); + if (!target) + return; + + target->AI()->DoAction(ACTION_ACTIVATE_STAR); + } + + void Register() + { + OnUnitTargetSelect += SpellUnitTargetFn(spell_algalon_trigger_3_adds_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_algalon_trigger_3_adds_SpellScript(); + } +}; + +class spell_algalon_collapse : public SpellScriptLoader +{ + public: + spell_algalon_collapse() : SpellScriptLoader("spell_algalon_collapse") { } + + class spell_algalon_collapse_AuraScript : public AuraScript + { + PrepareAuraScript(spell_algalon_collapse_AuraScript); + + void HandlePeriodic(AuraEffect const* /*aurEff*/) + { + PreventDefaultAction(); + GetTarget()->DealDamage(GetTarget(), GetTarget()->CountPctFromMaxHealth(1), NULL, NODAMAGE); + } + + void Register() + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_algalon_collapse_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_algalon_collapse_AuraScript(); + } +}; + +class spell_algalon_big_bang : public SpellScriptLoader +{ + public: + spell_algalon_big_bang() : SpellScriptLoader("spell_algalon_big_bang") { } + + class spell_algalon_big_bang_SpellScript : public SpellScript + { + PrepareSpellScript(spell_algalon_big_bang_SpellScript); + + bool Load() + { + _targetCount = 0; + return true; + } + + void CountTargets(std::list& targets) + { + _targetCount = targets.size(); + } + + void CheckTargets() + { + if (!_targetCount) + GetCaster()->GetAI()->DoAction(ACTION_ASCEND); + } + + void Register() + { + OnUnitTargetSelect += SpellUnitTargetFn(spell_algalon_big_bang_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + AfterCast += SpellCastFn(spell_algalon_big_bang_SpellScript::CheckTargets); + } + + uint32 _targetCount; + }; + + SpellScript* GetSpellScript() const + { + return new spell_algalon_big_bang_SpellScript(); + } +}; + +class spell_algalon_remove_phase : public SpellScriptLoader +{ + public: + spell_algalon_remove_phase() : SpellScriptLoader("spell_algalon_remove_phase") { } + + class spell_algalon_remove_phase_AuraScript : public AuraScript + { + PrepareAuraScript(spell_algalon_remove_phase_AuraScript); + + void HandlePeriodic(AuraEffect const* /*aurEff*/) + { + PreventDefaultAction(); + GetTarget()->RemoveAurasByType(SPELL_AURA_PHASE); + } + + void Register() + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_algalon_remove_phase_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_algalon_remove_phase_AuraScript(); + } +}; + +class spell_algalon_cosmic_smash : public SpellScriptLoader +{ + public: + spell_algalon_cosmic_smash() : SpellScriptLoader("spell_algalon_cosmic_smash") { } + + class spell_algalon_cosmic_smash_SpellScript : public SpellScript + { + PrepareSpellScript(spell_algalon_cosmic_smash_SpellScript); + + void ModDestHeight(SpellEffIndex /*effIndex*/) + { + Position offset = {0.0f, 0.0f, 65.0f, 0.0f}; + const_cast(GetTargetDest())->RelocateOffset(offset); + GetHitDest()->RelocateOffset(offset); + } + + void Register() + { + OnEffectLaunch += SpellEffectFn(spell_algalon_cosmic_smash_SpellScript::ModDestHeight, EFFECT_0, SPELL_EFFECT_SUMMON); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_algalon_cosmic_smash_SpellScript(); + } +}; + +class spell_algalon_cosmic_smash_damage : public SpellScriptLoader +{ + public: + spell_algalon_cosmic_smash_damage() : SpellScriptLoader("spell_algalon_cosmic_smash_damage") { } + + class spell_algalon_cosmic_smash_damage_SpellScript : public SpellScript + { + PrepareSpellScript(spell_algalon_cosmic_smash_damage_SpellScript); + + void RecalculateDamage() + { + if (!GetTargetDest() || !GetHitUnit()) + return; + + float distance = GetHitUnit()->GetDistance2d(GetTargetDest()->GetPositionX(), GetTargetDest()->GetPositionY()); + if (distance > 6.0f) + SetHitDamage(int32(float(GetHitDamage()) / distance) * 2); + } + + void Register() + { + OnHit += SpellHitFn(spell_algalon_cosmic_smash_damage_SpellScript::RecalculateDamage); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_algalon_cosmic_smash_damage_SpellScript(); + } +}; + +class spell_algalon_supermassive_fail : public SpellScriptLoader +{ + public: + spell_algalon_supermassive_fail() : SpellScriptLoader("spell_algalon_supermassive_fail") { } + + class spell_algalon_supermassive_fail_SpellScript : public SpellScript + { + PrepareSpellScript(spell_algalon_supermassive_fail_SpellScript); + + void RecalculateDamage() + { + if (!GetHitPlayer()) + return; + + GetHitPlayer()->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, ACHIEVEMENT_CRITERIA_CONDITION_NO_SPELL_HIT, GetSpellInfo()->Id, true); + } + + void Register() + { + OnHit += SpellHitFn(spell_algalon_supermassive_fail_SpellScript::RecalculateDamage); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_algalon_supermassive_fail_SpellScript(); + } +}; + +class achievement_he_feeds_on_your_tears : public AchievementCriteriaScript +{ + public: + achievement_he_feeds_on_your_tears() : AchievementCriteriaScript("achievement_he_feeds_on_your_tears") { } + + bool OnCheck(Player* /*source*/, Unit* target) + { + return !target->GetAI()->GetData(DATA_HAS_FED_ON_TEARS); + } +}; + +void AddSC_boss_algalon_the_observer() +{ + new boss_algalon_the_observer(); + new npc_living_constellation(); + new npc_collapsing_star(); + new npc_brann_bronzebeard_algalon(); + new go_celestial_planetarium_access(); + new spell_algalon_phase_punch(); + new spell_algalon_arcane_barrage(); + new spell_algalon_trigger_3_adds(); + new spell_algalon_collapse(); + new spell_algalon_big_bang(); + new spell_algalon_remove_phase(); + new spell_algalon_cosmic_smash(); + new spell_algalon_cosmic_smash_damage(); + new spell_algalon_supermassive_fail(); + new achievement_he_feeds_on_your_tears(); +} diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index 22858cf69e5..654d763ddbc 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -22,9 +22,14 @@ static DoorData const doorData[] = { - { GO_LEVIATHAN_DOOR, BOSS_LEVIATHAN, DOOR_TYPE_ROOM, BOUNDARY_S }, - { GO_XT_002_DOOR, BOSS_XT002, DOOR_TYPE_ROOM, BOUNDARY_S }, - { 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE }, + {GO_LEVIATHAN_DOOR, BOSS_LEVIATHAN, DOOR_TYPE_ROOM, BOUNDARY_S }, + {GO_XT_002_DOOR, BOSS_XT002, DOOR_TYPE_ROOM, BOUNDARY_S }, + {GO_DOODAD_UL_SIGILDOOR_03, BOSS_ALGALON, DOOR_TYPE_ROOM, BOUNDARY_W }, + {GO_DOODAD_UL_UNIVERSEFLOOR_01, BOSS_ALGALON, DOOR_TYPE_ROOM, BOUNDARY_NONE }, + {GO_DOODAD_UL_UNIVERSEFLOOR_02, BOSS_ALGALON, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_NONE }, + {GO_DOODAD_UL_UNIVERSEGLOBE01, BOSS_ALGALON, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_NONE }, + {GO_DOODAD_UL_ULDUAR_TRAPDOOR_03, BOSS_ALGALON, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_NONE }, + {0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE }, }; class instance_ulduar : public InstanceMapScript @@ -36,7 +41,6 @@ class instance_ulduar : public InstanceMapScript { instance_ulduar_InstanceMapScript(InstanceMap* map) : InstanceScript(map) { } - uint32 Encounter[MAX_ENCOUNTER]; std::string m_strInstData; // Creatures @@ -72,6 +76,12 @@ class instance_ulduar : public InstanceMapScript uint64 HodirDoorGUID; uint64 HodirIceDoorGUID; uint64 ArchivumDoorGUID; + uint64 AlgalonSigilDoorGUID[3]; + uint64 AlgalonFloorGUID[2]; + uint64 AlgalonUniverseGUID; + uint64 AlgalonTrapdoorGUID; + uint64 BrannBronzebeardAlgGUID; + uint64 GiftOfTheObserverGUID; // Miscellaneous uint32 TeamInInstance; @@ -111,35 +121,49 @@ class instance_ulduar : public InstanceMapScript HodirDoorGUID = 0; HodirIceDoorGUID = 0; ArchivumDoorGUID = 0; + AlgalonUniverseGUID = 0; + AlgalonTrapdoorGUID = 0; + BrannBronzebeardAlgGUID = 0; + GiftOfTheObserverGUID = 0; + _algalonTimer = 61; + _maxArmorItemLevel = 0; + _maxWeaponItemLevel = 0; TeamInInstance = 0; HodirRareCacheData = 0; ColossusData = 0; elderCount = 0; conSpeedAtory = false; Unbroken = true; + _summonAlgalon = false; - memset(Encounter, 0, sizeof(Encounter)); + memset(AlgalonSigilDoorGUID, 0, sizeof(AlgalonSigilDoorGUID)); + memset(AlgalonFloorGUID, 0, sizeof(AlgalonFloorGUID)); memset(XTToyPileGUIDs, 0, sizeof(XTToyPileGUIDs)); memset(AssemblyGUIDs, 0, sizeof(AssemblyGUIDs)); memset(RazorHarpoonGUIDs, 0, sizeof(RazorHarpoonGUIDs)); memset(KeeperGUIDs, 0, sizeof(KeeperGUIDs)); } - bool IsEncounterInProgress() const + void FillInitialWorldStates(WorldPacket& packet) { - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - { - if (Encounter[i] == IN_PROGRESS) - return true; - } - - return false; + packet << uint32(WORLD_STATE_ALGALON_TIMER_ENABLED) << uint32(_algalonTimer && _algalonTimer <= 60); + packet << uint32(WORLD_STATE_ALGALON_DESPAWN_TIMER) << uint32(std::min(_algalonTimer, 60)); } void OnPlayerEnter(Player* player) { if (!TeamInInstance) TeamInInstance = player->GetTeam(); + + if (_summonAlgalon) + { + _summonAlgalon = false; + TempSummon* algalon = instance->SummonCreature(NPC_ALGALON, AlgalonLandPos); + if (_algalonTimer && _algalonTimer <= 60) + algalon->AI()->DoAction(ACTION_INIT_ALGALON); + else + algalon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + } } void OnCreatureCreate(Creature* creature) @@ -267,9 +291,32 @@ class instance_ulduar : public InstanceMapScript if (TeamInInstance == HORDE) creature->UpdateEntry(NPC_BATTLE_PRIEST_GINA, HORDE); break; + case NPC_BRANN_BRONZBEARD_ALG: + BrannBronzebeardAlgGUID = creature->GetGUID(); + break; + //! These creatures are summoned by something else than Algalon + //! but need to be controlled/despawned by him - so they need to be + //! registered in his summon list + case NPC_ALGALON_VOID_ZONE_VISUAL_STALKER: + case NPC_ALGALON_STALKER_ASTEROID_TARGET_01: + case NPC_ALGALON_STALKER_ASTEROID_TARGET_02: + case NPC_UNLEASHED_DARK_MATTER: + if (Creature* algalon = instance->GetCreature(AlgalonGUID)) + algalon->AI()->JustSummoned(creature); + break; } + } - } + void OnCreatureRemove(Creature* creature) + { + switch (creature->GetEntry()) + { + case NPC_BRANN_BRONZBEARD_ALG: + if (BrannBronzebeardAlgGUID == creature->GetGUID()) + BrannBronzebeardAlgGUID = 0; + break; + } + } void OnGameObjectCreate(GameObject* gameObject) { @@ -340,6 +387,45 @@ class instance_ulduar : public InstanceMapScript if (GetBossState(BOSS_ASSEMBLY_OF_IRON) != DONE) HandleGameObject(ArchivumDoorGUID, false); break; + case GO_CELESTIAL_PLANETARIUM_ACCESS_10: + case GO_CELESTIAL_PLANETARIUM_ACCESS_25: + if (_algalonSummoned) + gameObject->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); + break; + case GO_DOODAD_UL_SIGILDOOR_01: + AlgalonSigilDoorGUID[0] = gameObject->GetGUID(); + if (_algalonSummoned) + gameObject->SetGoState(GO_STATE_ACTIVE); + break; + case GO_DOODAD_UL_SIGILDOOR_02: + AlgalonSigilDoorGUID[1] = gameObject->GetGUID(); + if (_algalonSummoned) + gameObject->SetGoState(GO_STATE_ACTIVE); + break; + case GO_DOODAD_UL_SIGILDOOR_03: + AlgalonSigilDoorGUID[2] = gameObject->GetGUID(); + AddDoor(gameObject, true); + break; + case GO_DOODAD_UL_UNIVERSEFLOOR_01: + AlgalonFloorGUID[0] = gameObject->GetGUID(); + AddDoor(gameObject, true); + break; + case GO_DOODAD_UL_UNIVERSEFLOOR_02: + AlgalonFloorGUID[1] = gameObject->GetGUID(); + AddDoor(gameObject, true); + break; + case GO_DOODAD_UL_UNIVERSEGLOBE01: + AlgalonUniverseGUID = gameObject->GetGUID(); + AddDoor(gameObject, true); + break; + case GO_DOODAD_UL_ULDUAR_TRAPDOOR_03: + AlgalonTrapdoorGUID = gameObject->GetGUID(); + AddDoor(gameObject, true); + break; + case GO_GIFT_OF_THE_OBSERVER_10: + case GO_GIFT_OF_THE_OBSERVER_25: + GiftOfTheObserverGUID = gameObject->GetGUID(); + break; } } @@ -348,10 +434,14 @@ class instance_ulduar : public InstanceMapScript switch (gameObject->GetEntry()) { case GO_LEVIATHAN_DOOR: + case GO_XT_002_DOOR: + case GO_DOODAD_UL_SIGILDOOR_03: + case GO_DOODAD_UL_UNIVERSEFLOOR_01: + case GO_DOODAD_UL_UNIVERSEFLOOR_02: + case GO_DOODAD_UL_UNIVERSEGLOBE01: + case GO_DOODAD_UL_ULDUAR_TRAPDOOR_03: AddDoor(gameObject, false); break; - case GO_XT_002_DOOR: - AddDoor(gameObject, false); default: break; } @@ -389,6 +479,7 @@ class instance_ulduar : public InstanceMapScript // Flame Leviathan's Tower Event triggers Creature* FlameLeviathan = instance->GetCreature(LeviathanGUID); if (FlameLeviathan && FlameLeviathan->isAlive()) // No leviathan, no event triggering ;) + { switch (eventId) { case EVENT_TOWER_OF_STORM_DESTROYED: @@ -404,6 +495,7 @@ class instance_ulduar : public InstanceMapScript FlameLeviathan->AI()->DoAction(ACTION_TOWER_OF_LIFE_DESTROYED); break; } + } } @@ -464,6 +556,52 @@ class instance_ulduar : public InstanceMapScript if (GameObject* gameObject = instance->GetGameObject(ThorimChestGUID)) gameObject->SetRespawnTime(gameObject->GetRespawnDelay()); break; + case BOSS_ALGALON: + if (state == DONE) + { + _events.CancelEvent(EVENT_UPDATE_ALGALON_TIMER); + _events.CancelEvent(EVENT_DESPAWN_ALGALON); + DoUpdateWorldState(WORLD_STATE_ALGALON_TIMER_ENABLED, 0); + _algalonTimer = 61; + if (GameObject* gameObject = instance->GetGameObject(GiftOfTheObserverGUID)) + gameObject->SetRespawnTime(gameObject->GetRespawnDelay()); + // get item level (recheck weapons) + Map::PlayerList const& players = instance->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + if (Player* player = itr->getSource()) + for (uint8 slot = EQUIPMENT_SLOT_MAINHAND; slot <= EQUIPMENT_SLOT_RANGED; ++slot) + if (Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) + if (item->GetTemplate()->ItemLevel > _maxWeaponItemLevel) + _maxWeaponItemLevel = item->GetTemplate()->ItemLevel; + } + else if (state == IN_PROGRESS) + { + // get item level (armor cannot be swapped in combat) + Map::PlayerList const& players = instance->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* player = itr->getSource()) + { + for (uint8 slot = EQUIPMENT_SLOT_START; slot < EQUIPMENT_SLOT_END; ++slot) + { + if (slot == EQUIPMENT_SLOT_TABARD || slot == EQUIPMENT_SLOT_BODY) + continue; + + if (Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) + { + if (slot >= EQUIPMENT_SLOT_MAINHAND && slot <= EQUIPMENT_SLOT_RANGED) + { + if (item->GetTemplate()->ItemLevel > _maxWeaponItemLevel) + _maxWeaponItemLevel = item->GetTemplate()->ItemLevel; + } + else if (item->GetTemplate()->ItemLevel > _maxArmorItemLevel) + _maxArmorItemLevel = item->GetTemplate()->ItemLevel; + } + } + } + } + } + break; } return true; @@ -496,6 +634,16 @@ class instance_ulduar : public InstanceMapScript case DATA_UNBROKEN: Unbroken = bool(data); break; + case EVENT_DESPAWN_ALGALON: + DoUpdateWorldState(WORLD_STATE_ALGALON_TIMER_ENABLED, 1); + DoUpdateWorldState(WORLD_STATE_ALGALON_DESPAWN_TIMER, 60); + _algalonTimer = 60; + _events.ScheduleEvent(EVENT_DESPAWN_ALGALON, 3600000); + _events.ScheduleEvent(EVENT_UPDATE_ALGALON_TIMER, 60000); + break; + case DATA_ALGALON_SUMMON_STATE: + _algalonSummoned = true; + break; default: break; } @@ -570,6 +718,22 @@ class instance_ulduar : public InstanceMapScript return KeeperGUIDs[1]; case BOSS_STONEBARK: return KeeperGUIDs[2]; + case DATA_SIGILDOOR_01: + return AlgalonSigilDoorGUID[0]; + case DATA_SIGILDOOR_02: + return AlgalonSigilDoorGUID[1]; + case DATA_SIGILDOOR_03: + return AlgalonSigilDoorGUID[2]; + case DATA_UNIVERSE_FLOOR_01: + return AlgalonFloorGUID[0]; + case DATA_UNIVERSE_FLOOR_02: + return AlgalonFloorGUID[1]; + case DATA_UNIVERSE_GLOBE: + return AlgalonUniverseGUID; + case DATA_ALGALON_TRAPDOOR: + return AlgalonTrapdoorGUID; + case DATA_BRANN_BRONZEBEARD_ALG: + return BrannBronzebeardAlgGUID; } return 0; @@ -592,12 +756,23 @@ class instance_ulduar : public InstanceMapScript return 0; } + bool CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* , Unit const* /* = NULL */, uint32 /* = 0 */) + { + switch (criteriaId) + { + case CRITERIA_HERALD_OF_TITANS: + return _maxArmorItemLevel <= MAX_HERALD_ARMOR_ITEMLEVEL && _maxWeaponItemLevel <= MAX_HERALD_WEAPON_ITEMLEVEL; + } + + return false; + } + std::string GetSaveData() { OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << "U U " << GetBossSaveData() << GetData(DATA_COLOSSUS); + saveStream << "U U " << GetBossSaveData() << GetData(DATA_COLOSSUS) << ' ' << _algalonTimer << ' ' << (_algalonSummoned ? 1 : 0); OUT_SAVE_INST_DATA_COMPLETE; return saveStream.str(); @@ -627,15 +802,68 @@ class instance_ulduar : public InstanceMapScript if (tmpState == IN_PROGRESS || tmpState > SPECIAL) tmpState = NOT_STARTED; - if (i == DATA_COLOSSUS) - SetData(i, tmpState); - else - SetBossState(i, EncounterState(tmpState)); + SetBossState(i, EncounterState(tmpState)); + } + + uint32 tempState; + loadStream >> tempState; + if (tempState == IN_PROGRESS || tempState > SPECIAL) + tempState = NOT_STARTED; + SetData(DATA_COLOSSUS, tempState); + + loadStream >> _algalonTimer; + loadStream >> tempState; + _algalonSummoned = tempState != 0; + if (_algalonSummoned && GetBossState(BOSS_ALGALON) != DONE) + { + _summonAlgalon = true; + if (_algalonTimer && _algalonTimer <= 60) + { + _events.ScheduleEvent(EVENT_UPDATE_ALGALON_TIMER, 60000); + DoUpdateWorldState(WORLD_STATE_ALGALON_TIMER_ENABLED, 1); + DoUpdateWorldState(WORLD_STATE_ALGALON_DESPAWN_TIMER, _algalonTimer); + } } } OUT_LOAD_INST_DATA_COMPLETE; } + + void Update(uint32 diff) + { + if (_events.Empty()) + return; + + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_UPDATE_ALGALON_TIMER: + SaveToDB(); + DoUpdateWorldState(WORLD_STATE_ALGALON_DESPAWN_TIMER, --_algalonTimer); + if (_algalonTimer) + _events.ScheduleEvent(EVENT_UPDATE_ALGALON_TIMER, 60000); + else + { + DoUpdateWorldState(WORLD_STATE_ALGALON_TIMER_ENABLED, 0); + _events.CancelEvent(EVENT_UPDATE_ALGALON_TIMER); + if (Creature* algalon = instance->GetCreature(AlgalonGUID)) + algalon->AI()->DoAction(EVENT_DESPAWN_ALGALON); + } + break; + } + } + } + + private: + EventMap _events; + uint32 _algalonTimer; + bool _summonAlgalon; + bool _algalonSummoned; + uint32 _maxArmorItemLevel; + uint32 _maxWeaponItemLevel; }; InstanceScript* GetInstanceScript(InstanceMap* map) const diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h index a31954b8a16..d3b4684772f 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h @@ -18,9 +18,12 @@ #ifndef DEF_ULDUAR_H #define DEF_ULDUAR_H -#include "ObjectMgr.h" +#include "Creature.h" +#include "GameObject.h" #define UlduarScriptName "instance_ulduar" +extern Position const AlgalonLandPos; + enum UlduarBosses { MAX_ENCOUNTER = 20, @@ -50,98 +53,124 @@ enum UlduarBosses enum UlduarNPCs { // General - NPC_LEVIATHAN = 33113, - NPC_SALVAGED_DEMOLISHER = 33109, - NPC_SALVAGED_SIEGE_ENGINE = 33060, - NPC_IGNIS = 33118, - NPC_RAZORSCALE = 33186, - NPC_RAZORSCALE_CONTROLLER = 33233, - NPC_STEELFORGED_DEFFENDER = 33236, - NPC_EXPEDITION_COMMANDER = 33210, - NPC_XT002 = 33293, - NPC_XT_TOY_PILE = 33337, - NPC_STEELBREAKER = 32867, - NPC_MOLGEIM = 32927, - NPC_BRUNDIR = 32857, - NPC_KOLOGARN = 32930, - NPC_FOCUSED_EYEBEAM = 33632, - NPC_FOCUSED_EYEBEAM_RIGHT = 33802, - NPC_LEFT_ARM = 32933, - NPC_RIGHT_ARM = 32934, - NPC_RUBBLE = 33768, - NPC_AURIAYA = 33515, - NPC_MIMIRON = 33350, - NPC_HODIR = 32845, - NPC_THORIM = 32865, - NPC_FREYA = 32906, - NPC_VEZAX = 33271, - NPC_YOGGSARON = 33288, - NPC_ALGALON = 32871, + NPC_LEVIATHAN = 33113, + NPC_SALVAGED_DEMOLISHER = 33109, + NPC_SALVAGED_SIEGE_ENGINE = 33060, + NPC_IGNIS = 33118, + NPC_RAZORSCALE = 33186, + NPC_RAZORSCALE_CONTROLLER = 33233, + NPC_STEELFORGED_DEFFENDER = 33236, + NPC_EXPEDITION_COMMANDER = 33210, + NPC_XT002 = 33293, + NPC_XT_TOY_PILE = 33337, + NPC_STEELBREAKER = 32867, + NPC_MOLGEIM = 32927, + NPC_BRUNDIR = 32857, + NPC_KOLOGARN = 32930, + NPC_FOCUSED_EYEBEAM = 33632, + NPC_FOCUSED_EYEBEAM_RIGHT = 33802, + NPC_LEFT_ARM = 32933, + NPC_RIGHT_ARM = 32934, + NPC_RUBBLE = 33768, + NPC_AURIAYA = 33515, + NPC_MIMIRON = 33350, + NPC_HODIR = 32845, + NPC_THORIM = 32865, + NPC_FREYA = 32906, + NPC_VEZAX = 33271, + NPC_YOGGSARON = 33288, + NPC_ALGALON = 32871, // Mimiron - NPC_LEVIATHAN_MKII = 33432, - NPC_VX_001 = 33651, - NPC_AERIAL_COMMAND_UNIT = 33670, + NPC_LEVIATHAN_MKII = 33432, + NPC_VX_001 = 33651, + NPC_AERIAL_COMMAND_UNIT = 33670, // Freya's Keepers - NPC_IRONBRANCH = 32913, - NPC_BRIGHTLEAF = 32915, - NPC_STONEBARK = 32914, + NPC_IRONBRANCH = 32913, + NPC_BRIGHTLEAF = 32915, + NPC_STONEBARK = 32914, // Hodir's Helper NPCs - NPC_TOR_GREYCLOUD = 32941, - NPC_KAR_GREYCLOUD = 33333, - NPC_EIVI_NIGHTFEATHER = 33325, - NPC_ELLIE_NIGHTFEATHER = 32901, - NPC_SPIRITWALKER_TARA = 33332, - NPC_SPIRITWALKER_YONA = 32950, - NPC_ELEMENTALIST_MAHFUUN = 33328, - NPC_ELEMENTALIST_AVUUN = 32900, - NPC_AMIRA_BLAZEWEAVER = 33331, - NPC_VEESHA_BLAZEWEAVER = 32946, - NPC_MISSY_FLAMECUFFS = 32893, - NPC_SISSY_FLAMECUFFS = 33327, - NPC_BATTLE_PRIEST_ELIZA = 32948, - NPC_BATTLE_PRIEST_GINA = 33330, - NPC_FIELD_MEDIC_PENNY = 32897, - NPC_FIELD_MEDIC_JESSI = 33326, + NPC_TOR_GREYCLOUD = 32941, + NPC_KAR_GREYCLOUD = 33333, + NPC_EIVI_NIGHTFEATHER = 33325, + NPC_ELLIE_NIGHTFEATHER = 32901, + NPC_SPIRITWALKER_TARA = 33332, + NPC_SPIRITWALKER_YONA = 32950, + NPC_ELEMENTALIST_MAHFUUN = 33328, + NPC_ELEMENTALIST_AVUUN = 32900, + NPC_AMIRA_BLAZEWEAVER = 33331, + NPC_VEESHA_BLAZEWEAVER = 32946, + NPC_MISSY_FLAMECUFFS = 32893, + NPC_SISSY_FLAMECUFFS = 33327, + NPC_BATTLE_PRIEST_ELIZA = 32948, + NPC_BATTLE_PRIEST_GINA = 33330, + NPC_FIELD_MEDIC_PENNY = 32897, + NPC_FIELD_MEDIC_JESSI = 33326, // Freya's trash NPCs - NPC_CORRUPTED_SERVITOR = 33354, - NPC_MISGUIDED_NYMPH = 33355, - NPC_GUARDIAN_LASHER = 33430, - NPC_FOREST_SWARMER = 33431, - NPC_MANGROVE_ENT = 33525, - NPC_IRONROOT_LASHER = 33526, - NPC_NATURES_BLADE = 33527, - NPC_GUARDIAN_OF_LIFE = 33528, + NPC_CORRUPTED_SERVITOR = 33354, + NPC_MISGUIDED_NYMPH = 33355, + NPC_GUARDIAN_LASHER = 33430, + NPC_FOREST_SWARMER = 33431, + NPC_MANGROVE_ENT = 33525, + NPC_IRONROOT_LASHER = 33526, + NPC_NATURES_BLADE = 33527, + NPC_GUARDIAN_OF_LIFE = 33528, + + // Algalon the Observer + NPC_BRANN_BRONZBEARD_ALG = 34064, + NPC_AZEROTH = 34246, + NPC_LIVING_CONSTELLATION = 33052, + NPC_ALGALON_STALKER = 33086, + NPC_COLLAPSING_STAR = 32955, + NPC_BLACK_HOLE = 32953, + NPC_WORM_HOLE = 34099, + NPC_ALGALON_VOID_ZONE_VISUAL_STALKER = 34100, + NPC_ALGALON_STALKER_ASTEROID_TARGET_01 = 33104, + NPC_ALGALON_STALKER_ASTEROID_TARGET_02 = 33105, + NPC_UNLEASHED_DARK_MATTER = 34097, }; enum UlduarGameObjects { - GO_KOLOGARN_CHEST_HERO = 195047, - GO_KOLOGARN_CHEST = 195046, - GO_KOLOGARN_BRIDGE = 194232, - GO_KOLOGARN_DOOR = 194553, - GO_THORIM_CHEST_HERO = 194315, - GO_THORIM_CHEST = 194314, - GO_HODIR_RARE_CACHE_OF_WINTER = 194200, - GO_HODIR_RARE_CACHE_OF_WINTER_HERO = 194201, - GO_HODIR_CHEST_HERO = 194308, - GO_HODIR_CHEST = 194307, - GO_LEVIATHAN_DOOR = 194905, - GO_LEVIATHAN_GATE = 194630, - GO_XT_002_DOOR = 194631, - GO_VEZAX_DOOR = 194750, - GO_MOLE_MACHINE = 194316, - GO_RAZOR_HARPOON_1 = 194542, - GO_RAZOR_HARPOON_2 = 194541, - GO_RAZOR_HARPOON_3 = 194543, - GO_RAZOR_HARPOON_4 = 194519, - GO_RAZOR_BROKEN_HARPOON = 194565, - GO_HODIR_DOOR = 194634, - GO_HODIR_ICE_DOOR = 194441, - GO_ARCHIVUM_DOOR = 194556, + GO_KOLOGARN_CHEST_HERO = 195047, + GO_KOLOGARN_CHEST = 195046, + GO_KOLOGARN_BRIDGE = 194232, + GO_KOLOGARN_DOOR = 194553, + GO_THORIM_CHEST_HERO = 194315, + GO_THORIM_CHEST = 194314, + GO_HODIR_RARE_CACHE_OF_WINTER = 194200, + GO_HODIR_RARE_CACHE_OF_WINTER_HERO = 194201, + GO_HODIR_CHEST_HERO = 194308, + GO_HODIR_CHEST = 194307, + GO_LEVIATHAN_DOOR = 194905, + GO_LEVIATHAN_GATE = 194630, + GO_XT_002_DOOR = 194631, + GO_VEZAX_DOOR = 194750, + GO_MOLE_MACHINE = 194316, + GO_RAZOR_HARPOON_1 = 194542, + GO_RAZOR_HARPOON_2 = 194541, + GO_RAZOR_HARPOON_3 = 194543, + GO_RAZOR_HARPOON_4 = 194519, + GO_RAZOR_BROKEN_HARPOON = 194565, + GO_HODIR_DOOR = 194634, + GO_HODIR_ICE_DOOR = 194441, + GO_ARCHIVUM_DOOR = 194556, + + // Algalon the Observer + GO_CELESTIAL_PLANETARIUM_ACCESS_10 = 194628, + GO_CELESTIAL_PLANETARIUM_ACCESS_25 = 194752, + GO_DOODAD_UL_SIGILDOOR_01 = 194767, + GO_DOODAD_UL_SIGILDOOR_02 = 194911, + GO_DOODAD_UL_SIGILDOOR_03 = 194910, + GO_DOODAD_UL_UNIVERSEFLOOR_01 = 194715, + GO_DOODAD_UL_UNIVERSEFLOOR_02 = 194716, + GO_DOODAD_UL_UNIVERSEGLOBE01 = 194148, + GO_DOODAD_UL_ULDUAR_TRAPDOOR_03 = 194253, + GO_GIFT_OF_THE_OBSERVER_10 = 194821, + GO_GIFT_OF_THE_OBSERVER_25 = 194822, }; enum LeviathanData @@ -161,6 +190,7 @@ enum UlduarAchievementCriteriaIds { CRITERIA_CON_SPEED_ATORY = 21597, CRITERIA_DISARMED = 21687, + CRITERIA_HERALD_OF_TITANS = 10678, }; enum UlduarData @@ -180,12 +210,38 @@ enum UlduarData // Hodir DATA_HODIR_RARE_CACHE, + + // Algalon the Observer + DATA_ALGALON_SUMMON_STATE, + DATA_SIGILDOOR_01, + DATA_SIGILDOOR_02, + DATA_SIGILDOOR_03, + DATA_UNIVERSE_FLOOR_01, + DATA_UNIVERSE_FLOOR_02, + DATA_UNIVERSE_GLOBE, + DATA_ALGALON_TRAPDOOR, + DATA_BRANN_BRONZEBEARD_ALG, +}; + +enum UlduarWorldStates +{ + WORLD_STATE_ALGALON_DESPAWN_TIMER = 4131, + WORLD_STATE_ALGALON_TIMER_ENABLED = 4132, }; enum UlduarAchievementData { // FL Achievement boolean DATA_UNBROKEN = 29052906, // 2905, 2906 are achievement IDs, + MAX_HERALD_ARMOR_ITEMLEVEL = 226, + MAX_HERALD_WEAPON_ITEMLEVEL = 232, +}; + +enum UlduarEvents +{ + EVENT_DESPAWN_ALGALON = 1, + EVENT_UPDATE_ALGALON_TIMER = 2, + ACTION_INIT_ALGALON = 6, }; template @@ -199,6 +255,17 @@ CreatureAI* GetUlduarAI(Creature* creature) return NULL; } +template +GameObjectAI* GetUlduarAI(GameObject* go) +{ + if (InstanceMap* instance = go->GetMap()->ToInstanceMap()) + if (instance->GetInstanceScript()) + if (instance->GetScriptId() == sObjectMgr->GetScriptId(UlduarScriptName)) + return new AI(go); + + return NULL; +} + class PlayerOrPetCheck { public: From a5da806cc6ccd71918e89f0b66ecc15a3ed6be93 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 19 Apr 2012 23:30:40 +0200 Subject: [PATCH 0591/1149] Scripts/Ulduar: Fixed some WIP code for Algalon --- .../Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index 4465fc08792..ab2d8126fd2 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -360,7 +360,8 @@ class boss_algalon_the_observer : public CreatureScript case EVENT_DESPAWN_ALGALON: events.Reset(); events.SetPhase(PHASE_ROLE_PLAY); - events.ScheduleEvent(EVENT_ASCEND_TO_THE_HEAVENS, 1); + if (me->isInCombat()) + events.ScheduleEvent(EVENT_ASCEND_TO_THE_HEAVENS, 1); events.ScheduleEvent(EVENT_DESPAWN_ALGALON_1, 5000); events.ScheduleEvent(EVENT_DESPAWN_ALGALON_2, 17000); events.ScheduleEvent(EVENT_DESPAWN_ALGALON_3, 26000); @@ -731,9 +732,6 @@ class npc_living_constellation : public CreatureScript void DoAction(int32 const action) { - if (action != ACTION_ACTIVATE_STAR) - return; - switch (action) { case ACTION_ACTIVATE_STAR: From c6618575a29d1592b4ffc6b4359516af41736432 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 19 Apr 2012 23:50:32 +0200 Subject: [PATCH 0592/1149] Fixed build without PCH --- .../Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp | 1 + src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index ab2d8126fd2..4776c95ac88 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -18,6 +18,7 @@ #include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "PassiveAI.h" #include "GameObjectAI.h" #include "MapManager.h" #include "MoveSplineInit.h" diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h index d3b4684772f..d35f0559080 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h @@ -18,8 +18,7 @@ #ifndef DEF_ULDUAR_H #define DEF_ULDUAR_H -#include "Creature.h" -#include "GameObject.h" +#include "ObjectMgr.h" #define UlduarScriptName "instance_ulduar" extern Position const AlgalonLandPos; From 479af777f1b75d1e62ae1bb59c6a2b62a6484009 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 20 Apr 2012 00:01:07 +0200 Subject: [PATCH 0593/1149] More include fixes --- .../Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index 4776c95ac88..6f87d7fcd2a 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -18,6 +18,7 @@ #include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellScript.h" #include "PassiveAI.h" #include "GameObjectAI.h" #include "MapManager.h" From a5aba350a087386e7d46f837c88e8c4e90eb7bd6 Mon Sep 17 00:00:00 2001 From: Subv Date: Thu, 19 Apr 2012 18:33:25 -0500 Subject: [PATCH 0594/1149] Core/SmartAI: Allow SMART_ACTION_SUMMON_GO and SMART_ACTION_SUMMON_CREATURE to use x, y, z and o parameters as relative offsets for a summoning position (example, summon creature 20 yards in front of the invoker) Signed-off-by: Subv --- src/server/game/AI/SmartScripts/SmartScript.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 209eb38e13a..31038faf369 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1119,12 +1119,13 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - if (!IsUnit(*itr)) - continue; - (*itr)->GetPosition(x, y, z, o); + x += e.target.x; + y += e.target.y; + z += e.target.z; + o += e.target.o; if (Creature* summon = GetBaseObject()->SummonCreature(e.action.summonCreature.creature, x, y, z, o, (TempSummonType)e.action.summonCreature.type, e.action.summonCreature.duration)) - if (unit && e.action.summonCreature.attackInvoker) + if (e.action.summonCreature.attackInvoker) summon->AI()->AttackStart((*itr)->ToUnit()); } @@ -1154,6 +1155,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u continue; (*itr)->GetPosition(x, y, z, o); + x += e.target.x + y += e.target.y + z += e.target.z + o += e.target.o GetBaseObject()->SummonGameObject(e.action.summonGO.entry, x, y, z, o, 0, 0, 0, 0, e.action.summonGO.despawnTime); } From 50f2be538cd5de97051c2920c9bcfc0a7a5e3091 Mon Sep 17 00:00:00 2001 From: Subv Date: Thu, 19 Apr 2012 18:43:41 -0500 Subject: [PATCH 0595/1149] Fixed build --- src/server/game/AI/SmartScripts/SmartScript.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 31038faf369..893c8f4580e 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1155,10 +1155,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u continue; (*itr)->GetPosition(x, y, z, o); - x += e.target.x - y += e.target.y - z += e.target.z - o += e.target.o + x += e.target.x; + y += e.target.y; + z += e.target.z; + o += e.target.o; GetBaseObject()->SummonGameObject(e.action.summonGO.entry, x, y, z, o, 0, 0, 0, 0, e.action.summonGO.despawnTime); } From 5b7e4b093b4b4fbc6943a09b459785a873cc1bea Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Fri, 20 Apr 2012 13:36:23 +0200 Subject: [PATCH 0596/1149] DB/Loot: Adjust the mechanic for Argent Crusade Trophy's to prevent issues after looting Closes #2993 --- ...12_04_20_00_world_gameobject_loot_template.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 sql/updates/world/2012_04_20_00_world_gameobject_loot_template.sql diff --git a/sql/updates/world/2012_04_20_00_world_gameobject_loot_template.sql b/sql/updates/world/2012_04_20_00_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..47a22d519d0 --- /dev/null +++ b/sql/updates/world/2012_04_20_00_world_gameobject_loot_template.sql @@ -0,0 +1,15 @@ +SET @Ref := 12002; +DELETE FROM `reference_loot_template` WHERE `entry`=@Ref; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@Ref,47242,100,1,0,1,1); +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (195668,195667,195666,195665,195672,195671,195670,195669) AND `item`=47242; +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (195668,195667,195666,195665,195672,195671,195670,195669) AND `mincountOrRef` = -@Ref; +INSERT INTO gameobject_loot_template (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(195665,5,100,1,0,-@Ref,4), -- 10 man,50 attempts +(195666,3,100,1,0,-@Ref,4), -- 10 man,45+ attempts +(195667,3,100,1,0,-@Ref,2), -- 10 man,25+ attempts +(195668,1,100,1,0,-@Ref,2), -- 10 man,0+ attempts +(195669,6,100,1,0,-@Ref,4), -- 25 man,50 attempts +(195670,4,100,1,0,-@Ref,4), -- 25 man,45+ attempts +(195671,4,100,1,0,-@Ref,2), -- 25 man,25+ attempts +(195672,2,100,1,0,-@Ref,2); -- 25 man,0+ attempts From b39b8e1fe435576a71e1477ed985260012062321 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Fri, 20 Apr 2012 14:43:07 +0200 Subject: [PATCH 0597/1149] DB/Loot: Add items to Cache of the Ley Guardian Closes #2691 --- .../world/2012_04_20_01_world_item_loot_template.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 sql/updates/world/2012_04_20_01_world_item_loot_template.sql diff --git a/sql/updates/world/2012_04_20_01_world_item_loot_template.sql b/sql/updates/world/2012_04_20_01_world_item_loot_template.sql new file mode 100644 index 00000000000..af52ade0b25 --- /dev/null +++ b/sql/updates/world/2012_04_20_01_world_item_loot_template.sql @@ -0,0 +1,10 @@ +SET @Bag := 52676; +DELETE FROM `item_loot_template` WHERE `entry`=@Bag; +INSERT INTO `item_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@Bag,36933,0,1,1,1,3),-- Forest Emerald +(@Bag,36918,0,1,1,1,3),-- Scarlet Ruby +(@Bag,36921,0,1,1,1,3),-- Autumn's Glow +(@Bag,36930,0,1,1,1,3),-- Monarch Topaz +(@Bag,36924,0,1,1,1,3),-- Sky Sapphire +(@Bag,36927,0,1,1,1,3),-- Twilight Opal +(@Bag,43953,5,1,0,1,1); -- Reins of the Blue Drake From d0fa53c087ea56e44fc1b9da498a27c20e45a385 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Fri, 20 Apr 2012 14:50:22 +0200 Subject: [PATCH 0598/1149] DB/Loot: Add Recipe Mighty Arcane Protection Potion to Cult Researcher and Frostbrood Spawn Closes #2385 --- .../world/2012_04_20_02_world_creature_loot_template.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2012_04_20_02_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_04_20_02_world_creature_loot_template.sql b/sql/updates/world/2012_04_20_02_world_creature_loot_template.sql new file mode 100644 index 00000000000..09b5beee75c --- /dev/null +++ b/sql/updates/world/2012_04_20_02_world_creature_loot_template.sql @@ -0,0 +1,4 @@ +DELETE FROM `creature_loot_template` WHERE `entry` IN (31702,32297) AND `item`=44564; +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(31702,44564,0.5,1,0,1,1), -- Recipe: Mighty Arcane Protection Potion on Frostbrood Spawn +(32297,44564,0.5,1,0,1,1); -- Recipe: Mighty Arcane Protection Potion on Cult Researcher From da9554b6a14a2e567eff943d924ad02c8cc4d01a Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Fri, 20 Apr 2012 20:06:24 +0200 Subject: [PATCH 0599/1149] DB/Loot: Add Formula: Enchant Gloves - Angler in some lootscheme's Closes #4602 --- .../world/2012_04_20_03_world_creature_loot_template.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/2012_04_20_03_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_04_20_03_world_creature_loot_template.sql b/sql/updates/world/2012_04_20_03_world_creature_loot_template.sql new file mode 100644 index 00000000000..a0b586ee0d9 --- /dev/null +++ b/sql/updates/world/2012_04_20_03_world_creature_loot_template.sql @@ -0,0 +1,7 @@ +SET @ITEM := 50406; -- Formula: Enchant Gloves - Angler +UPDATE `creature_template` SET `lootid` = `entry` WHERE `entry` IN(26343,26344,26336); +DELETE FROM `creature_loot_template` WHERE `item`=@ITEM; +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(26343, @ITEM, 1.1, 1, 0, 1, 1), -- Indu'Le Fisherman +(26336, @ITEM, 0.9, 1, 0, 1, 1), -- Indu'Le Mystic +(26344, @ITEM, 1, 1, 0, 1, 1); -- Indu'Le Warrior From b3f0c7fbcfdce2fb825269c368838a49e9f879df Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Fri, 20 Apr 2012 20:19:49 +0200 Subject: [PATCH 0600/1149] DB/Loot: increase dropchance for Grimescale Murloc Head Closes #4161 --- .../world/2012_04_20_04_world_creature_loot_template.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2012_04_20_04_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_04_20_04_world_creature_loot_template.sql b/sql/updates/world/2012_04_20_04_world_creature_loot_template.sql new file mode 100644 index 00000000000..73e01efa23e --- /dev/null +++ b/sql/updates/world/2012_04_20_04_world_creature_loot_template.sql @@ -0,0 +1,3 @@ +-- Make Grimscale Murlocs drop their heads faster... +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=-66 WHERE `item`=21757; + From a16b07188f6e57eeb17d468638a127f6237666f4 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Fri, 20 Apr 2012 23:00:17 +0200 Subject: [PATCH 0601/1149] DB/Gameobject: Fix Horrible error from UP34 --- sql/updates/world/2012_04_20_05_gameobject_template.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 sql/updates/world/2012_04_20_05_gameobject_template.sql diff --git a/sql/updates/world/2012_04_20_05_gameobject_template.sql b/sql/updates/world/2012_04_20_05_gameobject_template.sql new file mode 100644 index 00000000000..6fdd2be9f2f --- /dev/null +++ b/sql/updates/world/2012_04_20_05_gameobject_template.sql @@ -0,0 +1,8 @@ +-- Restore horrible mistake in UP34 from myself +UPDATE `gameobject_template` SET `data1`=27512 WHERE `entry`=195669; +UPDATE `gameobject_template` SET `data1`=27517 WHERE `entry`=195670; +UPDATE `gameobject_template` SET `data1`=27518 WHERE `entry`=195671; +-- Fix loottemplates along with it +UPDATE `gameobject_loot_template` SET `entry`=27512 WHERE `entry`=195669 +UPDATE `gameobject_loot_template` SET `entry`=27517 WHERE `entry`=195670; +UPDATE `gameobject_loot_template` SET `entry`=27518 WHERE `entry`=195671; From fb787aee5e50c152f9e4031961ec1c34153f12e5 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Fri, 20 Apr 2012 23:17:31 +0200 Subject: [PATCH 0602/1149] Commit: Typofix, this thing just haunts me... --- sql/updates/world/2012_04_20_05_gameobject_template.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/updates/world/2012_04_20_05_gameobject_template.sql b/sql/updates/world/2012_04_20_05_gameobject_template.sql index 6fdd2be9f2f..24400b16a5c 100644 --- a/sql/updates/world/2012_04_20_05_gameobject_template.sql +++ b/sql/updates/world/2012_04_20_05_gameobject_template.sql @@ -3,6 +3,6 @@ UPDATE `gameobject_template` SET `data1`=27512 WHERE `entry`=195669; UPDATE `gameobject_template` SET `data1`=27517 WHERE `entry`=195670; UPDATE `gameobject_template` SET `data1`=27518 WHERE `entry`=195671; -- Fix loottemplates along with it -UPDATE `gameobject_loot_template` SET `entry`=27512 WHERE `entry`=195669 +UPDATE `gameobject_loot_template` SET `entry`=27512 WHERE `entry`=195669; UPDATE `gameobject_loot_template` SET `entry`=27517 WHERE `entry`=195670; UPDATE `gameobject_loot_template` SET `entry`=27518 WHERE `entry`=195671; From e9fd6d19798c25f2971f37cd270722efac279cdf Mon Sep 17 00:00:00 2001 From: MrSmite Date: Fri, 20 Apr 2012 20:22:40 -0400 Subject: [PATCH 0603/1149] Fix pets attacking on non-harmful spells --- src/server/game/Spells/Spell.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index df2b9c35320..f055d669925 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3107,13 +3107,13 @@ void Spell::cast(bool skipCheck) // should be done before the spell is actually executed sScriptMgr->OnPlayerSpellCast(playerCaster, this, skipCheck); - // Let any pets know we've attacked something. As of 3.0.2 pets begin - // attacking their owner's target immediately - if (Pet* playerPet = playerCaster->GetPet()) - { - if (playerPet->isAlive() && playerPet->isControlled() && (m_targets.GetTargetMask() & TARGET_FLAG_UNIT)) - playerPet->AI()->OwnerAttacked(m_targets.GetObjectTarget()->ToUnit()); - } + // As of 3.0.2 pets begin attacking their owner's target immediately + // Let any pets know we've attacked something. Check DmgClass for harmful spells only + // This prevents spells such as Hunter's Mark from triggering pet attack + if (this->GetSpellInfo()->DmgClass != SPELL_DAMAGE_CLASS_NONE) + if (Pet* playerPet = playerCaster->GetPet()) + if (playerPet->isAlive() && playerPet->isControlled() && (m_targets.GetTargetMask() & TARGET_FLAG_UNIT)) + playerPet->AI()->OwnerAttacked(m_targets.GetObjectTarget()->ToUnit()); } SetExecutedCurrently(true); From 9559a488771eec4f6ea7826df6ad459ca44fa21f Mon Sep 17 00:00:00 2001 From: kaelima Date: Sat, 21 Apr 2012 02:42:59 +0200 Subject: [PATCH 0604/1149] Core/Spell: Attempt to fix some rare steady shot crashes ref issue #5689 --- src/server/game/Spells/SpellEffects.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 5078391348f..371d4cdc5e0 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -666,19 +666,19 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) if (found) damage += m_spellInfo->Effects[EFFECT_1].CalcValue(); - if (m_caster->GetTypeId() == TYPEID_PLAYER) + if (Player* caster = m_caster->ToPlayer()) { // Add Ammo and Weapon damage plus RAP * 0.1 - Item* item = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK); - if (item) + if (Item* item = caster->GetWeaponForAttack(RANGED_ATTACK)) { - float dmg_min = item->GetTemplate()->Damage->DamageMin; - float dmg_max = item->GetTemplate()->Damage->DamageMax; + ItemTemplate const* weaponTemplate = item->GetTemplate(); + float dmg_min = weaponTemplate->Damage[0].DamageMin; + float dmg_max = weaponTemplate->Damage[0].DamageMax; if (dmg_max == 0.0f && dmg_min > dmg_max) damage += int32(dmg_min); else damage += irand(int32(dmg_min), int32(dmg_max)); - damage += int32(m_caster->ToPlayer()->GetAmmoDPS()*item->GetTemplate()->Delay*0.001f); + damage += int32(caster->GetAmmoDPS() * weaponTemplate->Delay * 0.001f); } } } From 408c78dcd7311588d7ceeb0f0e98d0831b500632 Mon Sep 17 00:00:00 2001 From: Vincent-Core Date: Sat, 7 Apr 2012 12:17:21 +0200 Subject: [PATCH 0605/1149] Core/Spells * Converted percent based damage dealing spell effects to scripts * Fix Leviroth Self-Impale damage Closes #6085 Signed-off-by: Shauren --- ...2012_04_21_00_world_spell_script_names.sql | 14 +++++++ src/server/game/Spells/SpellEffects.cpp | 17 -------- .../TrialOfTheCrusader/boss_lord_jaraxxus.cpp | 31 -------------- .../Northrend/Ulduar/Ulduar/boss_xt002.cpp | 8 +++- src/server/scripts/Spells/spell_generic.cpp | 40 +++++++++++++++++++ 5 files changed, 61 insertions(+), 49 deletions(-) create mode 100644 sql/updates/world/2012_04_21_00_world_spell_script_names.sql diff --git a/sql/updates/world/2012_04_21_00_world_spell_script_names.sql b/sql/updates/world/2012_04_21_00_world_spell_script_names.sql new file mode 100644 index 00000000000..e61ef4aec74 --- /dev/null +++ b/sql/updates/world/2012_04_21_00_world_spell_script_names.sql @@ -0,0 +1,14 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (20625,29142,35139,42393,49882,55269,56578,38441,66316,67100,67101,67102); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(20625,'spell_gen_default_count_pct_from_max_hp'), -- Ritual of Doom Sacrifice +(29142,'spell_gen_default_count_pct_from_max_hp'), -- Eyesore Blaster +(35139,'spell_gen_default_count_pct_from_max_hp'), -- Throw Boom's Doom +(42393,'spell_gen_default_count_pct_from_max_hp'), -- Brewfest - Attack Keg +(49882,'spell_gen_default_count_pct_from_max_hp'), -- Leviroth Self-Impale +(55269,'spell_gen_default_count_pct_from_max_hp'), -- Deathly Stare +(56578,'spell_gen_default_count_pct_from_max_hp'), -- Rapid-Fire Harpoon +(38441,'spell_gen_50pct_count_pct_from_max_hp'), -- Cataclysmic Bolt +(66316,'spell_gen_50pct_count_pct_from_max_hp'), -- Spinning Pain Spike 10m +(67100,'spell_gen_50pct_count_pct_from_max_hp'), -- Spinning Pain Spike 25m +(67101,'spell_gen_50pct_count_pct_from_max_hp'), -- Spinning Pain Spike 10m heroic +(67102,'spell_gen_50pct_count_pct_from_max_hp'); -- Spinning Pain Spike 25m heroic diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 371d4cdc5e0..c72ccbacc3d 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -390,23 +390,6 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) if (!unitTarget->HasAura(27825)) return; break; - // Cataclysmic Bolt - case 38441: - { - damage = unitTarget->CountPctFromMaxHealth(50); - break; - } - case 20625: // Ritual of Doom Sacrifice - case 29142: // Eyesore Blaster - case 35139: // Throw Boom's Doom - case 42393: // Brewfest - Attack Keg - case 55269: // Deathly Stare - case 56578: // Rapid-Fire Harpoon - case 62775: // Tympanic Tantrum - { - damage = unitTarget->CountPctFromMaxHealth(damage); - break; - } // Gargoyle Strike case 51963: { diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index 6f817a6d0eb..a7328b43826 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -515,36 +515,6 @@ public: }; -class spell_spinning_pain_spike : public SpellScriptLoader -{ - public: - spell_spinning_pain_spike() : SpellScriptLoader("spell_spinning_pain_spike") {} - - class spell_spinning_pain_spike_SpellScript : public SpellScript - { - PrepareSpellScript(spell_spinning_pain_spike_SpellScript); - - void HandleScript(SpellEffIndex /*eff*/) - { - Unit* target = GetHitUnit(); - if (!target) - return; - - if (target->isAlive()) - SetHitDamage(target->CountPctFromMaxHealth(50)); - } - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_spinning_pain_spike_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_spinning_pain_spike_SpellScript(); - } -}; - void AddSC_boss_jaraxxus() { new boss_jaraxxus(); @@ -553,5 +523,4 @@ void AddSC_boss_jaraxxus() new mob_fel_infernal(); new mob_nether_portal(); new mob_mistress_of_pain(); - new spell_spinning_pain_spike(); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index 727f40aef81..c7091b42c5a 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -947,13 +947,19 @@ class spell_xt002_tympanic_tantrum : public SpellScriptLoader void FilterTargets(std::list& unitList) { - unitList.remove_if (PlayerOrPetCheck()); + unitList.remove_if(PlayerOrPetCheck()); + } + + void RecalculateDamage() + { + SetHitDamage(GetHitUnit()->CountPctFromMaxHealth(GetHitDamage())); } void Register() { OnUnitTargetSelect += SpellUnitTargetFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); OnUnitTargetSelect += SpellUnitTargetFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnHit += SpellHitFn(spell_xt002_tympanic_tantrum_SpellScript::RecalculateDamage); } }; diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 035f9ec98b2..2d431331691 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2618,6 +2618,44 @@ class spell_gen_wg_water : public SpellScriptLoader } }; +class spell_gen_count_pct_from_max_hp : public SpellScriptLoader +{ + public: + spell_gen_count_pct_from_max_hp(char const* name, int32 damagePct = 0) : SpellScriptLoader(name), _damagePct(damagePct) { } + + class spell_gen_count_pct_from_max_hp_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_count_pct_from_max_hp_SpellScript) + + public: + spell_gen_count_pct_from_max_hp_SpellScript(int32 damagePct) : SpellScript(), _damagePct(damagePct) { } + + void RecalculateDamage() + { + if (!_damagePct) + _damagePct = GetHitDamage(); + + SetHitDamage(GetHitUnit()->CountPctFromMaxHealth(_damagePct)); + } + + void Register() + { + OnHit += SpellHitFn(spell_gen_count_pct_from_max_hp_SpellScript::RecalculateDamage); + } + + private: + int32 _damagePct; + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_count_pct_from_max_hp_SpellScript(_damagePct); + } + + private: + int32 _damagePct; +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -2669,4 +2707,6 @@ void AddSC_generic_spell_scripts() new spell_gen_chaos_blast(); new spell_gen_ds_flush_knockback(); new spell_gen_wg_water(); + new spell_gen_count_pct_from_max_hp("spell_gen_default_count_pct_from_max_hp"); + new spell_gen_count_pct_from_max_hp("spell_gen_50pct_count_pct_from_max_hp", 50); } From 5c3ee06f49d0061ef78042a637f5ca5dc787f2ab Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 21 Apr 2012 16:29:26 +0200 Subject: [PATCH 0606/1149] Core/Errors: Improved OS detection for windows crash reporting --- .../shared/Debugging/WheatyExceptionReport.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/server/shared/Debugging/WheatyExceptionReport.cpp b/src/server/shared/Debugging/WheatyExceptionReport.cpp index 63648f66e29..febc5ef3573 100644 --- a/src/server/shared/Debugging/WheatyExceptionReport.cpp +++ b/src/server/shared/Debugging/WheatyExceptionReport.cpp @@ -195,7 +195,23 @@ BOOL WheatyExceptionReport::_GetWindowsVersion(TCHAR* szVersion, DWORD cntMax) case VER_PLATFORM_WIN32_NT: // Test for the specific product family. if (osvi.dwMajorVersion == 6) - _tcsncat(szVersion, _T("Windows Vista or Windows Server 2008 "), cntMax); + { + #if WINVER < 0x0500 + if (osvi.wReserved[1] == VER_NT_WORKSTATION) + #else + if (osvi.wProductType == VER_NT_WORKSTATION) + #endif // WINVER < 0x0500 + { + if (osvi.dwMinorVersion == 1) + _tcsncat(szVersion, _T("Windows 7 "), cntMax); + else + _tcsncat(szVersion, _T("Windows Vista "), cntMax); + } + else if (osvi.dwMinorVersion == 1) + _tcsncat(szVersion, _T("Windows Server 2008 R2 "), cntMax); + else + _tcsncat(szVersion, _T("Windows Server 2008 "), cntMax); + } if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2) _tcsncat(szVersion, _T("Microsoft Windows Server 2003 "), cntMax); if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) From 2921e28de38d539f2ac82f11be2a9721eb6cc92d Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 21 Apr 2012 20:10:11 +0200 Subject: [PATCH 0607/1149] Core/Maps: Increased default ground search range, 10 yards was insufficient for many flying creatures --- src/server/game/Maps/Map.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 766e3d23f93..6ba08646f25 100755 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -228,7 +228,7 @@ enum LevelRequirementVsMode #define MAX_HEIGHT 100000.0f // can be use for find ground height at surface #define INVALID_HEIGHT -100000.0f // for check, must be equal to VMAP_INVALID_HEIGHT, real value for unknown height is VMAP_INVALID_HEIGHT_VALUE #define MAX_FALL_DISTANCE 250000.0f // "unlimited fall" to find VMap ground if it is available, just larger than MAX_HEIGHT - INVALID_HEIGHT -#define DEFAULT_HEIGHT_SEARCH 10.0f // default search distance to find height at nearby locations +#define DEFAULT_HEIGHT_SEARCH 50.0f // default search distance to find height at nearby locations #define MIN_UNLOAD_DELAY 1 // immediate unload typedef std::map CreatureGroupHolderType; From c47d295e2afc59ceeb24abc7e4b59647da6eaa4b Mon Sep 17 00:00:00 2001 From: Ramusik Date: Sat, 21 Apr 2012 21:44:20 +0300 Subject: [PATCH 0608/1149] Scripts/Outland: Boss Doomlord Kazzak - Implement Berserk - Some style corrections --- .../scripts/Outland/boss_doomlord_kazzak.cpp | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp index 147d2d60359..a213713ae1a 100644 --- a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp +++ b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp @@ -31,15 +31,15 @@ enum Texts enum Spells { - SPELL_SHADOWVOLLEY = 32963, + SPELL_SHADOW_VOLLEY = 32963, SPELL_CLEAVE = 31779, SPELL_THUNDERCLAP = 36706, - SPELL_VOIDBOLT = 39329, - SPELL_MARKOFKAZZAK = 32960, - SPELL_MARKOFKAZZAK_DAMAGE = 32961, + SPELL_VOID_BOLT = 39329, + SPELL_MARK_OF_KAZZAK = 32960, SPELL_ENRAGE = 32964, - SPELL_CAPTURESOUL = 32966, - SPELL_TWISTEDREFLECTION = 21063 + SPELL_CAPTURE_SOUL = 32966, + SPELL_TWISTED_REFLECTION = 21063, + SPELL_BERSERK = 32965, }; enum Events @@ -47,10 +47,11 @@ enum Events EVENT_SHADOW_VOLLEY = 1, EVENT_CLEAVE = 2, EVENT_THUNDERCLAP = 3, - EVENT_VOIDBOLT = 4, + EVENT_VOID_BOLT = 4, EVENT_MARK_OF_KAZZAK = 5, EVENT_ENRAGE = 6, - EVENT_TWISTED_REFLECTION = 7 + EVENT_TWISTED_REFLECTION = 7, + EVENT_BERSERK = 8 }; class boss_doomlord_kazzak : public CreatureScript @@ -70,10 +71,11 @@ class boss_doomlord_kazzak : public CreatureScript _events.ScheduleEvent(EVENT_SHADOW_VOLLEY, urand(6000, 10000)); _events.ScheduleEvent(EVENT_CLEAVE, 7000); _events.ScheduleEvent(EVENT_THUNDERCLAP, urand(14000, 18000)); - _events.ScheduleEvent(EVENT_VOIDBOLT, 30000); + _events.ScheduleEvent(EVENT_VOID_BOLT, 30000); _events.ScheduleEvent(EVENT_MARK_OF_KAZZAK, 25000); _events.ScheduleEvent(EVENT_ENRAGE, 60000); _events.ScheduleEvent(EVENT_TWISTED_REFLECTION, 33000); + _events.ScheduleEvent(EVENT_BERSERK, 180000); } void JustRespawned() @@ -92,7 +94,7 @@ class boss_doomlord_kazzak : public CreatureScript if (victim->GetTypeId() != TYPEID_PLAYER) return; - DoCast(me, SPELL_CAPTURESOUL); + DoCast(me, SPELL_CAPTURE_SOUL); Talk(SAY_KILL); } @@ -118,7 +120,7 @@ class boss_doomlord_kazzak : public CreatureScript switch (eventId) { case EVENT_SHADOW_VOLLEY: - DoCastVictim(SPELL_SHADOWVOLLEY); + DoCastVictim(SPELL_SHADOW_VOLLEY); _events.ScheduleEvent(EVENT_SHADOW_VOLLEY, urand(4000, 6000)); break; case EVENT_CLEAVE: @@ -129,13 +131,13 @@ class boss_doomlord_kazzak : public CreatureScript DoCastVictim(SPELL_THUNDERCLAP); _events.ScheduleEvent(EVENT_THUNDERCLAP, urand(10000, 14000)); break; - case EVENT_VOIDBOLT: - DoCastVictim(SPELL_VOIDBOLT); - _events.ScheduleEvent(EVENT_VOIDBOLT, urand(15000, 18000)); + case EVENT_VOID_BOLT: + DoCastVictim(SPELL_VOID_BOLT); + _events.ScheduleEvent(EVENT_VOID_BOLT, urand(15000, 18000)); break; case EVENT_MARK_OF_KAZZAK: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true)) - DoCast(target, SPELL_MARKOFKAZZAK); + DoCast(target, SPELL_MARK_OF_KAZZAK); _events.ScheduleEvent(EVENT_MARK_OF_KAZZAK, 20000); break; case EVENT_ENRAGE: @@ -145,9 +147,12 @@ class boss_doomlord_kazzak : public CreatureScript break; case EVENT_TWISTED_REFLECTION: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true)) - DoCast(target, SPELL_TWISTEDREFLECTION); + DoCast(target, SPELL_TWISTED_REFLECTION); _events.ScheduleEvent(EVENT_TWISTED_REFLECTION, 15000); break; + case EVENT_BERSERK: + DoCast(me, SPELL_BERSERK); + break; default: break; } From 98f9472715e782119807ebdf3193d3d626c87925 Mon Sep 17 00:00:00 2001 From: Xanvial Date: Sun, 22 Apr 2012 08:40:22 +0700 Subject: [PATCH 0609/1149] Convert script of npc tabard vendor to SAI and add missing tabard recovery --- sql/updates/world/2012_04_22_00_world_sai.sql | 72 ++++++++ src/server/scripts/World/npcs_special.cpp | 167 ------------------ 2 files changed, 72 insertions(+), 167 deletions(-) create mode 100644 sql/updates/world/2012_04_22_00_world_sai.sql diff --git a/sql/updates/world/2012_04_22_00_world_sai.sql b/sql/updates/world/2012_04_22_00_world_sai.sql new file mode 100644 index 00000000000..0a84b09c087 --- /dev/null +++ b/sql/updates/world/2012_04_22_00_world_sai.sql @@ -0,0 +1,72 @@ +-- SAI for Tabard Vendor Elizabeth Ross +SET @ROSS := 28776; +SET @GOSSIP := 9832; + +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ROSS; + +DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP AND `id`>0 AND `id`<11; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`) VALUES +(@GOSSIP, 1, 0, 'I''ve lost my Blood Knight Tabard.', 1, 1, 0, 0, 0, 0, ''), +(@GOSSIP, 2, 0, 'I''ve lost my Tabard of the Hand.', 1, 1, 0, 0, 0, 0, ''), +(@GOSSIP, 3, 0, 'I''ve lost my Tabard of the Protector.', 1, 1, 0, 0, 0, 0, ''), +(@GOSSIP, 4, 0, 'I''ve lost my Green Trophy Tabard of the Illidari.', 1, 1, 0, 0, 0, 0, ''), +(@GOSSIP, 5, 0, 'I''ve lost my Purple Trophy Tabard of the Illidari.', 1, 1, 0, 0, 0, 0, ''), +(@GOSSIP, 6, 0, 'I''ve lost my Tabard of Summer Skies.', 1, 1, 0, 0, 0, 0, ''), +(@GOSSIP, 7, 0, 'I''ve lost my Tabard of Summer Flames.', 1, 1, 0, 0, 0, 0, ''), +(@GOSSIP, 8, 0, 'I''ve lost my Loremaster''s Colors.', 1, 1, 0, 0, 0, 0, ''), +(@GOSSIP, 9, 0, 'I''ve lost my Tabard of the Explorer.', 1, 1, 0, 0, 0, 0, ''), +(@GOSSIP, 10, 0, 'I''ve lost my Tabard of the Achiever.', 1, 1, 0, 0, 0, 0, ''); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ROSS AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(@ROSS, 0, 0, 0, 62, 0, 100, 0, @GOSSIP, 1, 0, 0, 11, 54974, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Blood Knight Tabard'), +(@ROSS, 0, 1, 0, 62, 0, 100, 0, @GOSSIP, 1, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'), +(@ROSS, 0, 2, 0, 62, 0, 100, 0, @GOSSIP, 2, 0, 0, 11, 54976, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of the Hand'), +(@ROSS, 0, 3, 0, 62, 0, 100, 0, @GOSSIP, 2, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'), +(@ROSS, 0, 4, 0, 62, 0, 100, 0, @GOSSIP, 3, 0, 0, 11, 55008, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of the Protector'), +(@ROSS, 0, 5, 0, 62, 0, 100, 0, @GOSSIP, 3, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'), +(@ROSS, 0, 6, 0, 62, 0, 100, 0, @GOSSIP, 4, 0, 0, 11, 54977, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Green Trophy Tabard of the Illidari'), +(@ROSS, 0, 7, 0, 62, 0, 100, 0, @GOSSIP, 4, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'), +(@ROSS, 0, 8, 0, 62, 0, 100, 0, @GOSSIP, 5, 0, 0, 11, 54982, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Purple Trophy Tabard of the Illidari'), +(@ROSS, 0, 9, 0, 62, 0, 100, 0, @GOSSIP, 5, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'), +(@ROSS, 0, 10, 0, 62, 0, 100, 0, @GOSSIP, 6, 0, 0, 11, 62768, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of Summer Skies'), +(@ROSS, 0, 11, 0, 62, 0, 100, 0, @GOSSIP, 6, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'), +(@ROSS, 0, 12, 0, 62, 0, 100, 0, @GOSSIP, 7, 0, 0, 11, 62769, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of Summer Flames'), +(@ROSS, 0, 13, 0, 62, 0, 100, 0, @GOSSIP, 7, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'), +(@ROSS, 0, 14, 0, 62, 0, 100, 0, @GOSSIP, 8, 0, 0, 11, 58194, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Loremaster''s Colors'), +(@ROSS, 0, 15, 0, 62, 0, 100, 0, @GOSSIP, 8, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'), +(@ROSS, 0, 16, 0, 62, 0, 100, 0, @GOSSIP, 9, 0, 0, 11, 58224, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of the Explorer'), +(@ROSS, 0, 17, 0, 62, 0, 100, 0, @GOSSIP, 9, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'), +(@ROSS, 0, 18, 0, 62, 0, 100, 0, @GOSSIP, 10, 0, 0, 11, 55006, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of the Achiever'), +(@ROSS, 0, 19, 0, 62, 0, 100, 0, @GOSSIP, 10, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,@GOSSIP,1,0,2,25549,1,1,1,0,'','Only show gossip if player doesn''t have Blood Knight Tabard'), +(15,@GOSSIP,1,0,8,9737,0,0,0,0,'','Only show gossip if player already finished quest True Masters of Light'), +(15,@GOSSIP,2,0,2,24344,1,1,1,0,'','Only show gossip if player doesn''t have Tabard of the Hand'), +(15,@GOSSIP,2,0,8,9762,0,0,0,0,'','Only show gossip if player already finished quest The Unwritten Prophecy'), +(15,@GOSSIP,3,0,2,28788,1,1,1,0,'','Only show gossip if player doesn''t have Tabard of the protector'), +(15,@GOSSIP,3,0,8,10259,0,0,0,0,'','Only show gossip if player already finished quest Into the Breach'), +(15,@GOSSIP,4,0,2,31404,1,1,1,0,'','Only show gossip if player doesn''t have Green Trophy Tabard of Illidari'), +(15,@GOSSIP,4,0,2,31405,1,1,1,0,'','Only show gossip if player doesn''t have Purple Trophy Tabard of Illidari'), +(15,@GOSSIP,4,0,2,31408,1,1,1,0,'','Only show gossip if player doesn''t have Offering of the Sha''tar'), +(15,@GOSSIP,4,0,8,10781,0,0,0,0,'','Only show gossip if player already finished quest Battle of the Crimson Watch'), +(15,@GOSSIP,5,0,2,31404,1,1,1,0,'','Only show gossip if player doesn''t have Green Trophy Tabard of Illidari'), +(15,@GOSSIP,5,0,2,31405,1,1,1,0,'','Only show gossip if player doesn''t have Purple Trophy Tabard of Illidari'), +(15,@GOSSIP,5,0,2,31408,1,1,1,0,'','Only show gossip if player doesn''t have Offering of the Sha''tar'), +(15,@GOSSIP,5,0,8,10781,0,0,0,0,'','Only show gossip if player already finished quest Battle of the Crimson Watch'), +(15,@GOSSIP,6,0,2,35279,1,1,1,0,'','Only show gossip if player doesn''t have Tabard of Summer Skies'), +(15,@GOSSIP,6,0,2,35280,1,1,1,0,'','Only show gossip if player doesn''t have Tabard of Summer Flames'), +(15,@GOSSIP,6,0,8,11972,0,0,0,0,'','Only show gossip if player already finished quest Shards of Ahune'), +(15,@GOSSIP,7,0,2,35279,1,1,1,0,'','Only show gossip if player doesn''t have Tabard of Summer Skies'), +(15,@GOSSIP,7,0,2,35280,1,1,1,0,'','Only show gossip if player doesn''t have Tabard of Summer Flames'), +(15,@GOSSIP,7,0,8,11972,0,0,0,0,'','Only show gossip if player already finished quest Shards of Ahune'), +(15,@GOSSIP,8,0,2,43300,1,1,1,0,'','Only show gossip if player doesn''t have Loremaster''s Colors'), +(15,@GOSSIP,8,0,17,1681,0,0,0,0,'','Only show gossip if player have achievement Loremaster (A)'), +(15,@GOSSIP,8,1,2,43300,1,1,1,0,'','Only show gossip if player doesn''t have Loremaster''s Colors'), +(15,@GOSSIP,8,1,17,1682,0,0,0,0,'','Only show gossip if player have achievement Loremaster (H)'), +(15,@GOSSIP,9,0,2,43348,1,1,1,0,'','Only show gossip if player doesn''t have Tabard of the Explorer'), +(15,@GOSSIP,9,0,17,45,0,0,0,0,'','Only show gossip if player have achievement Explore Northrend'), +(15,@GOSSIP,10,0,2,40643,1,1,1,0,'','Only show gossip if player doesn''t have Tabard of the Explorer'), +(15,@GOSSIP,10,0,17,1021,0,0,0,0,'','Only show gossip if player have achievement Twenty-Five Tabards'); diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 61b997bba35..e1cfd077444 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -2529,172 +2529,6 @@ public: } }; -/*###### -## npc_tabard_vendor -######*/ - -enum -{ - QUEST_TRUE_MASTERS_OF_LIGHT = 9737, - QUEST_THE_UNWRITTEN_PROPHECY = 9762, - QUEST_INTO_THE_BREACH = 10259, - QUEST_BATTLE_OF_THE_CRIMSON_WATCH = 10781, - QUEST_SHARDS_OF_AHUNE = 11972, - - ACHIEVEMENT_EXPLORE_NORTHREND = 45, - ACHIEVEMENT_TWENTYFIVE_TABARDS = 1021, - ACHIEVEMENT_THE_LOREMASTER_A = 1681, - ACHIEVEMENT_THE_LOREMASTER_H = 1682, - - ITEM_TABARD_OF_THE_HAND = 24344, - ITEM_TABARD_OF_THE_BLOOD_KNIGHT = 25549, - ITEM_TABARD_OF_THE_PROTECTOR = 28788, - ITEM_OFFERING_OF_THE_SHATAR = 31408, - ITEM_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI = 31404, - ITEM_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI = 31405, - ITEM_TABARD_OF_THE_SUMMER_SKIES = 35279, - ITEM_TABARD_OF_THE_SUMMER_FLAMES = 35280, - ITEM_TABARD_OF_THE_ACHIEVER = 40643, - ITEM_LOREMASTERS_COLORS = 43300, - ITEM_TABARD_OF_THE_EXPLORER = 43348, - - SPELL_TABARD_OF_THE_BLOOD_KNIGHT = 54974, - SPELL_TABARD_OF_THE_HAND = 54976, - SPELL_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI = 54977, - SPELL_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI = 54982, - SPELL_TABARD_OF_THE_ACHIEVER = 55006, - SPELL_TABARD_OF_THE_PROTECTOR = 55008, - SPELL_LOREMASTERS_COLORS = 58194, - SPELL_TABARD_OF_THE_EXPLORER = 58224, - SPELL_TABARD_OF_SUMMER_SKIES = 62768, - SPELL_TABARD_OF_SUMMER_FLAMES = 62769 -}; - -#define GOSSIP_LOST_TABARD_OF_BLOOD_KNIGHT "I've lost my Tabard of Blood Knight." -#define GOSSIP_LOST_TABARD_OF_THE_HAND "I've lost my Tabard of the Hand." -#define GOSSIP_LOST_TABARD_OF_THE_PROTECTOR "I've lost my Tabard of the Protector." -#define GOSSIP_LOST_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI "I've lost my Green Trophy Tabard of the Illidari." -#define GOSSIP_LOST_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI "I've lost my Purple Trophy Tabard of the Illidari." -#define GOSSIP_LOST_TABARD_OF_SUMMER_SKIES "I've lost my Tabard of Summer Skies." -#define GOSSIP_LOST_TABARD_OF_SUMMER_FLAMES "I've lost my Tabard of Summer Flames." -#define GOSSIP_LOST_LOREMASTERS_COLORS "I've lost my Loremaster's Colors." -#define GOSSIP_LOST_TABARD_OF_THE_EXPLORER "I've lost my Tabard of the Explorer." -#define GOSSIP_LOST_TABARD_OF_THE_ACHIEVER "I've lost my Tabard of the Achiever." - -class npc_tabard_vendor : public CreatureScript -{ -public: - npc_tabard_vendor() : CreatureScript("npc_tabard_vendor") { } - - bool OnGossipHello(Player* player, Creature* creature) - { - bool lostBloodKnight = false; - bool lostHand = false; - bool lostProtector = false; - bool lostIllidari = false; - bool lostSummer = false; - - //Tabard of the Blood Knight - if (player->GetQuestRewardStatus(QUEST_TRUE_MASTERS_OF_LIGHT) && !player->HasItemCount(ITEM_TABARD_OF_THE_BLOOD_KNIGHT, 1, true)) - lostBloodKnight = true; - - //Tabard of the Hand - if (player->GetQuestRewardStatus(QUEST_THE_UNWRITTEN_PROPHECY) && !player->HasItemCount(ITEM_TABARD_OF_THE_HAND, 1, true)) - lostHand = true; - - //Tabard of the Protector - if (player->GetQuestRewardStatus(QUEST_INTO_THE_BREACH) && !player->HasItemCount(ITEM_TABARD_OF_THE_PROTECTOR, 1, true)) - lostProtector = true; - - //Green Trophy Tabard of the Illidari - //Purple Trophy Tabard of the Illidari - if (player->GetQuestRewardStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH) && - (!player->HasItemCount(ITEM_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI, 1, true) && - !player->HasItemCount(ITEM_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI, 1, true) && - !player->HasItemCount(ITEM_OFFERING_OF_THE_SHATAR, 1, true))) - lostIllidari = true; - - //Tabard of Summer Skies - //Tabard of Summer Flames - if (player->GetQuestRewardStatus(QUEST_SHARDS_OF_AHUNE) && - !player->HasItemCount(ITEM_TABARD_OF_THE_SUMMER_SKIES, 1, true) && - !player->HasItemCount(ITEM_TABARD_OF_THE_SUMMER_FLAMES, 1, true)) - lostSummer = true; - - if (lostBloodKnight || lostHand || lostProtector || lostIllidari || lostSummer) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - - if (lostBloodKnight) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_TABARD_OF_BLOOD_KNIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - if (lostHand) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_TABARD_OF_THE_HAND, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - - if (lostProtector) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_TABARD_OF_THE_PROTECTOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - - if (lostIllidari) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - } - - if (lostSummer) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_TABARD_OF_SUMMER_SKIES, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_TABARD_OF_SUMMER_FLAMES, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); - } - - player->SEND_GOSSIP_MENU(13583, creature->GetGUID()); - } - else - player->GetSession()->SendListInventory(creature->GetGUID()); - - return true; - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_TRADE: - player->GetSession()->SendListInventory(creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 1: - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_TABARD_OF_THE_BLOOD_KNIGHT, false); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_TABARD_OF_THE_HAND, false); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_TABARD_OF_THE_PROTECTOR, false); - break; - case GOSSIP_ACTION_INFO_DEF + 4: - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI, false); - break; - case GOSSIP_ACTION_INFO_DEF + 5: - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI, false); - break; - case GOSSIP_ACTION_INFO_DEF + 6: - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_TABARD_OF_SUMMER_SKIES, false); - break; - case GOSSIP_ACTION_INFO_DEF + 7: - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_TABARD_OF_SUMMER_FLAMES, false); - break; - } - return true; - } -}; - /*###### ## npc_experience ######*/ @@ -3158,7 +2992,6 @@ void AddSC_npcs_special() new npc_wormhole(); new npc_pet_trainer(); new npc_locksmith(); - new npc_tabard_vendor(); new npc_experience(); new npc_fire_elemental(); new npc_earth_elemental(); From 8cf7d9185725b14b31f35c73f167a665edce543f Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Sun, 22 Apr 2012 13:58:22 +0300 Subject: [PATCH 0610/1149] Core/DB: Quest The Emissary. Fix condition in item spell(usable only when npc is above 95% hp). Added correct faction,unit_flags and emote to Leviroth. --- sql/updates/world/2012_04_05_00_world_creature_misc.sql | 5 +++++ src/server/scripts/Spells/spell_item.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_04_05_00_world_creature_misc.sql diff --git a/sql/updates/world/2012_04_05_00_world_creature_misc.sql b/sql/updates/world/2012_04_05_00_world_creature_misc.sql new file mode 100644 index 00000000000..ae35b3fba5d --- /dev/null +++ b/sql/updates/world/2012_04_05_00_world_creature_misc.sql @@ -0,0 +1,5 @@ +UPDATE `creature_template` SET `faction_A`=1914,`faction_H`=1914,`unit_flags`=33024 WHERE `entry`=26452; + +DELETE FROM `creature_template_addon` WHERE `entry`=26452; +INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(26452,0,0,0,1,383,''); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 666477e68e7..80520f44c3e 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1535,7 +1535,7 @@ class spell_item_impale_leviroth : public SpellScriptLoader void HandleDummy(SpellEffIndex /* effIndex */) { if (Unit* target = GetHitCreature()) - if (target->GetEntry() == NPC_LEVIROTH && target->HealthBelowPct(95)) + if (target->GetEntry() == NPC_LEVIROTH && !target->HealthBelowPct(95)) target->CastSpell(target, SPELL_LEVIROTH_SELF_IMPALE, true); } From ddd25ce7166fc34f9e3411863da80f84d3693c34 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sun, 22 Apr 2012 04:29:49 +0200 Subject: [PATCH 0611/1149] Battleground/Strand of the Ancients: Fix broken gate state --- .../Battlegrounds/Zones/BattlegroundSA.cpp | 10 +-- .../game/Battlegrounds/Zones/BattlegroundSA.h | 89 ++++++++++++++----- 2 files changed, 73 insertions(+), 26 deletions(-) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index 6d784488aad..977897b8d48 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -534,16 +534,16 @@ void BattlegroundSA::EventPlayerDamagedGO(Player* /*player*/, GameObject* go, ui if (eventType == go->GetGOInfo()->building.damagedEvent) { - uint32 i = GetGateIDFromDestroyEventID(eventType); + uint32 i = getGateIdFromDamagedOrDestroyEventId(eventType); GateStatus[i] = BG_SA_GATE_DAMAGED; - uint32 uws = GetWorldStateFromGateID(i); + uint32 uws = getWorldStateFromGateId(i); if (uws) UpdateWorldState(uws, GateStatus[i]); } if (eventType == go->GetGOInfo()->building.destroyedEvent) { - if (go->GetGOInfo()->building.destroyedEvent == 19837) + if (go->GetGOInfo()->building.destroyedEvent == BG_SA_EVENT_ANCIENT_GATE_DESTROYED) SendWarningToAll(LANG_BG_SA_CHAMBER_BREACHED); else SendWarningToAll(LANG_BG_SA_WAS_DESTROYED, go->GetGOInfo()->name.c_str()); @@ -603,7 +603,7 @@ void BattlegroundSA::DemolisherStartState(bool start) void BattlegroundSA::DestroyGate(Player* player, GameObject* go) { - uint32 i = GetGateIDFromDestroyEventID(go->GetGOInfo()->building.destroyedEvent); + uint32 i = getGateIdFromDamagedOrDestroyEventId(go->GetGOInfo()->building.destroyedEvent); if (!GateStatus[i]) return; @@ -612,7 +612,7 @@ void BattlegroundSA::DestroyGate(Player* player, GameObject* go) if (g->GetGOValue()->Building.Health == 0) { GateStatus[i] = BG_SA_GATE_DESTROYED; - uint32 uws = GetWorldStateFromGateID(i); + uint32 uws = getWorldStateFromGateId(i); if (uws) UpdateWorldState(uws, GateStatus[i]); bool rewardHonor = true; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h index 76a772ff978..2ade101ce54 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h @@ -45,9 +45,30 @@ enum BG_SA_Status enum BG_SA_GateState { - BG_SA_GATE_OK = 1, - BG_SA_GATE_DAMAGED = 2, - BG_SA_GATE_DESTROYED = 3 + BG_SA_GATE_OK = 1, + BG_SA_GATE_DAMAGED = 2, + BG_SA_GATE_DESTROYED = 3 +}; + +enum BG_SA_EventIdGate +{ + BG_SA_EVENT_GREEN_GATE_DAMAGED = 19041, + BG_SA_EVENT_GREEN_GATE_DESTROYED = 19046, + + BG_SA_EVENT_BLUE_GATE_DAMAGED = 19040, + BG_SA_EVENT_BLUE_GATE_DESTROYED = 19045, + + BG_SA_EVENT_RED_GATE_DAMAGED = 19042, + BG_SA_EVENT_RED_GATE_DESTROYED = 19047, + + BG_SA_EVENT_PURPLE_GATE_DAMAGED = 19048, + BG_SA_EVENT_PURPLE_GATE_DESTROYED = 19043, + + BG_SA_EVENT_YELLOW_GATE_DAMAGED = 19049, + BG_SA_EVENT_YELLOW_GATE_DESTROYED = 19044, + + BG_SA_EVENT_ANCIENT_GATE_DAMAGED = 19836, + BG_SA_EVENT_ANCIENT_GATE_DESTROYED = 19837 }; enum BG_SA_Timers @@ -443,34 +464,60 @@ class BattlegroundSA : public Battleground /// Called when a player use a gamobject (relic) virtual void EventPlayerUsedGO(Player* Source, GameObject* object); /// Return gate id, relative to bg data, according to gameobject id - uint32 GetGateIDFromDestroyEventID(uint32 id) + uint32 getGateIdFromDamagedOrDestroyEventId(uint32 id) { - uint32 i = 0; switch (id) { - case 19046: i = BG_SA_GREEN_GATE; break; //Green gate destroyed - case 19045: i = BG_SA_BLUE_GATE; break; //blue gate - case 19047: i = BG_SA_RED_GATE; break; //red gate - case 19048: i = BG_SA_PURPLE_GATE; break; //purple gate - case 19049: i = BG_SA_YELLOW_GATE; break; //yellow gate - case 19837: i = BG_SA_ANCIENT_GATE; break; //ancient gate + // Green gate + case BG_SA_EVENT_GREEN_GATE_DAMAGED: + case BG_SA_EVENT_GREEN_GATE_DESTROYED: + return BG_SA_GREEN_GATE; + // Blue gate + case BG_SA_EVENT_BLUE_GATE_DAMAGED: + case BG_SA_EVENT_BLUE_GATE_DESTROYED: + return BG_SA_BLUE_GATE; + // Red gate + case BG_SA_EVENT_RED_GATE_DAMAGED: + case BG_SA_EVENT_RED_GATE_DESTROYED: + return BG_SA_RED_GATE; + // Purple gate + case BG_SA_EVENT_PURPLE_GATE_DAMAGED: + case BG_SA_EVENT_PURPLE_GATE_DESTROYED: + return BG_SA_PURPLE_GATE; + // Yellow gate + case BG_SA_EVENT_YELLOW_GATE_DAMAGED: + case BG_SA_EVENT_YELLOW_GATE_DESTROYED: + return BG_SA_YELLOW_GATE; + // Ancient gate + case BG_SA_EVENT_ANCIENT_GATE_DAMAGED: + case BG_SA_EVENT_ANCIENT_GATE_DESTROYED: + return BG_SA_ANCIENT_GATE; + default: + break; } - return i; + return 0; } /// Return worldstate id, according to door id - uint32 GetWorldStateFromGateID(uint32 id) + uint32 getWorldStateFromGateId(uint32 id) { - uint32 uws = 0; switch (id) { - case BG_SA_GREEN_GATE: uws = BG_SA_GREEN_GATEWS; break; - case BG_SA_YELLOW_GATE: uws = BG_SA_YELLOW_GATEWS; break; - case BG_SA_BLUE_GATE: uws = BG_SA_BLUE_GATEWS; break; - case BG_SA_RED_GATE: uws = BG_SA_RED_GATEWS; break; - case BG_SA_PURPLE_GATE: uws = BG_SA_PURPLE_GATEWS; break; - case BG_SA_ANCIENT_GATE: uws = BG_SA_ANCIENT_GATEWS; break; + case BG_SA_GREEN_GATE: + return BG_SA_GREEN_GATEWS; + case BG_SA_YELLOW_GATE: + return BG_SA_YELLOW_GATEWS; + case BG_SA_BLUE_GATE: + return BG_SA_BLUE_GATEWS; + case BG_SA_RED_GATE: + return BG_SA_RED_GATEWS; + case BG_SA_PURPLE_GATE: + return BG_SA_PURPLE_GATEWS; + case BG_SA_ANCIENT_GATE: + return BG_SA_ANCIENT_GATEWS; + default: + break; } - return uws; + return 0; } /// Called on battleground ending From 8d5660a0bf8b64c2578f5bcbb3ba34fb76fceab4 Mon Sep 17 00:00:00 2001 From: Xanvial Date: Sun, 22 Apr 2012 19:02:20 +0700 Subject: [PATCH 0612/1149] Use SMART_EVENT_LINK to close gossip --- sql/updates/world/2012_04_22_00_world_sai.sql | 31 +++++++------------ 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/sql/updates/world/2012_04_22_00_world_sai.sql b/sql/updates/world/2012_04_22_00_world_sai.sql index 0a84b09c087..f223883c8a7 100644 --- a/sql/updates/world/2012_04_22_00_world_sai.sql +++ b/sql/updates/world/2012_04_22_00_world_sai.sql @@ -19,26 +19,17 @@ INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, DELETE FROM `smart_scripts` WHERE `entryorguid`=@ROSS AND `source_type`=0; INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES -(@ROSS, 0, 0, 0, 62, 0, 100, 0, @GOSSIP, 1, 0, 0, 11, 54974, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Blood Knight Tabard'), -(@ROSS, 0, 1, 0, 62, 0, 100, 0, @GOSSIP, 1, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'), -(@ROSS, 0, 2, 0, 62, 0, 100, 0, @GOSSIP, 2, 0, 0, 11, 54976, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of the Hand'), -(@ROSS, 0, 3, 0, 62, 0, 100, 0, @GOSSIP, 2, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'), -(@ROSS, 0, 4, 0, 62, 0, 100, 0, @GOSSIP, 3, 0, 0, 11, 55008, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of the Protector'), -(@ROSS, 0, 5, 0, 62, 0, 100, 0, @GOSSIP, 3, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'), -(@ROSS, 0, 6, 0, 62, 0, 100, 0, @GOSSIP, 4, 0, 0, 11, 54977, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Green Trophy Tabard of the Illidari'), -(@ROSS, 0, 7, 0, 62, 0, 100, 0, @GOSSIP, 4, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'), -(@ROSS, 0, 8, 0, 62, 0, 100, 0, @GOSSIP, 5, 0, 0, 11, 54982, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Purple Trophy Tabard of the Illidari'), -(@ROSS, 0, 9, 0, 62, 0, 100, 0, @GOSSIP, 5, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'), -(@ROSS, 0, 10, 0, 62, 0, 100, 0, @GOSSIP, 6, 0, 0, 11, 62768, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of Summer Skies'), -(@ROSS, 0, 11, 0, 62, 0, 100, 0, @GOSSIP, 6, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'), -(@ROSS, 0, 12, 0, 62, 0, 100, 0, @GOSSIP, 7, 0, 0, 11, 62769, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of Summer Flames'), -(@ROSS, 0, 13, 0, 62, 0, 100, 0, @GOSSIP, 7, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'), -(@ROSS, 0, 14, 0, 62, 0, 100, 0, @GOSSIP, 8, 0, 0, 11, 58194, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Loremaster''s Colors'), -(@ROSS, 0, 15, 0, 62, 0, 100, 0, @GOSSIP, 8, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'), -(@ROSS, 0, 16, 0, 62, 0, 100, 0, @GOSSIP, 9, 0, 0, 11, 58224, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of the Explorer'), -(@ROSS, 0, 17, 0, 62, 0, 100, 0, @GOSSIP, 9, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'), -(@ROSS, 0, 18, 0, 62, 0, 100, 0, @GOSSIP, 10, 0, 0, 11, 55006, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of the Achiever'), -(@ROSS, 0, 19, 0, 62, 0, 100, 0, @GOSSIP, 10, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'); +(@ROSS, 0, 0, 10, 62, 0, 100, 0, @GOSSIP, 1, 0, 0, 11, 54974, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Blood Knight Tabard'), +(@ROSS, 0, 1, 10, 62, 0, 100, 0, @GOSSIP, 2, 0, 0, 11, 54976, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of the Hand'), +(@ROSS, 0, 2, 10, 62, 0, 100, 0, @GOSSIP, 3, 0, 0, 11, 55008, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of the Protector'), +(@ROSS, 0, 3, 10, 62, 0, 100, 0, @GOSSIP, 4, 0, 0, 11, 54977, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Green Trophy Tabard of the Illidari'), +(@ROSS, 0, 4, 10, 62, 0, 100, 0, @GOSSIP, 5, 0, 0, 11, 54982, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Purple Trophy Tabard of the Illidari'), +(@ROSS, 0, 5, 10, 62, 0, 100, 0, @GOSSIP, 6, 0, 0, 11, 62768, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of Summer Skies'), +(@ROSS, 0, 6, 10, 62, 0, 100, 0, @GOSSIP, 7, 0, 0, 11, 62769, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of Summer Flames'), +(@ROSS, 0, 7, 10, 62, 0, 100, 0, @GOSSIP, 8, 0, 0, 11, 58194, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Loremaster''s Colors'), +(@ROSS, 0, 8, 10, 62, 0, 100, 0, @GOSSIP, 9, 0, 0, 11, 58224, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of the Explorer'), +(@ROSS, 0, 9, 10, 62, 0, 100, 0, @GOSSIP, 10, 0, 0, 11, 55006, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of the Achiever'), +(@ROSS, 0, 10, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'); DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP; INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES From 0a82c93a974226e3a1dfcb600ceaac0dd7c41a26 Mon Sep 17 00:00:00 2001 From: Frca Date: Sun, 22 Apr 2012 19:24:44 +0200 Subject: [PATCH 0613/1149] Codestyle Signed-off-by: Frca --- src/server/game/Handlers/MovementHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 6c0365a05e9..b3d663e1850 100755 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -46,7 +46,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() GetPlayer()->SetSemaphoreTeleportFar(false); // get the teleport destination - const WorldLocation loc = GetPlayer()->GetTeleportDest(); + WorldLocation const loc = GetPlayer()->GetTeleportDest(); // possible errors in the coordinate validity check if (!MapManager::IsValidMapCoord(loc)) From ccda7c8a408e6800a161162fa5c4014265a1125e Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sun, 22 Apr 2012 20:29:47 +0200 Subject: [PATCH 0614/1149] Core/Shaman: Fix Earthen Power --- ...2012_04_22_01_world_spell_script_names.sql | 3 + src/server/scripts/Spells/spell_shaman.cpp | 56 ++++++++++++++++--- 2 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 sql/updates/world/2012_04_22_01_world_spell_script_names.sql diff --git a/sql/updates/world/2012_04_22_01_world_spell_script_names.sql b/sql/updates/world/2012_04_22_01_world_spell_script_names.sql new file mode 100644 index 00000000000..bd4becdc3f4 --- /dev/null +++ b/sql/updates/world/2012_04_22_01_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=59566; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(59566,'spell_sha_earthen_power'); diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 84e3bd8d604..f16f663ae2d 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -215,13 +215,12 @@ class spell_sha_earthbind_totem : public SpellScriptLoader void HandleEffectPeriodic(AuraEffect const* aurEff) { - if (Unit* target = GetTarget()) - if (Unit* caster = aurEff->GetBase()->GetCaster()) - if (TempSummon* summon = caster->ToTempSummon()) - if (Unit* owner = summon->GetOwner()) - if (AuraEffect* aur = owner->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0)) - if (roll_chance_i(aur->GetBaseAmount()) && target->HasAuraWithMechanic(1 << MECHANIC_SNARE)) - caster->CastSpell(caster, SHAMAN_TOTEM_SPELL_EARTHEN_POWER, true, NULL, aurEff); + if (!GetCaster()) + return; + if (Player* owner = GetCaster()->GetCharmerOrOwnerPlayerOrPlayerItself()) + if (AuraEffect* aur = owner->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0)) + if (roll_chance_i(aur->GetBaseAmount())) + GetTarget()->CastSpell((Unit*)NULL, SHAMAN_TOTEM_SPELL_EARTHEN_POWER, true); } void Apply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) @@ -252,6 +251,46 @@ class spell_sha_earthbind_totem : public SpellScriptLoader } }; +class EarthenPowerTargetSelector +{ + public: + EarthenPowerTargetSelector() { } + + bool operator() (Unit* target) + { + if (!target->HasAuraWithMechanic(1 << MECHANIC_SNARE)) + return true; + + return false; + } +}; + +class spell_sha_earthen_power : public SpellScriptLoader +{ + public: + spell_sha_earthen_power() : SpellScriptLoader("spell_sha_earthen_power") { } + + class spell_sha_earthen_power_SpellScript : public SpellScript + { + PrepareSpellScript(spell_sha_earthen_power_SpellScript); + + void FilterTargets(std::list& unitList) + { + unitList.remove_if(EarthenPowerTargetSelector()); + } + + void Register() + { + OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_earthen_power_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_sha_earthen_power_SpellScript(); + } +}; + class spell_sha_bloodlust : public SpellScriptLoader { public: @@ -270,7 +309,7 @@ class spell_sha_bloodlust : public SpellScriptLoader void RemoveInvalidTargets(std::list& targets) { - targets.remove_if (Trinity::UnitAuraCheck(true, SHAMAN_SPELL_SATED)); + targets.remove_if(Trinity::UnitAuraCheck(true, SHAMAN_SPELL_SATED)); } void ApplyDebuff() @@ -617,6 +656,7 @@ void AddSC_shaman_spell_scripts() new spell_sha_fire_nova(); new spell_sha_mana_tide_totem(); new spell_sha_earthbind_totem(); + new spell_sha_earthen_power(); new spell_sha_bloodlust(); new spell_sha_heroism(); new spell_sha_ancestral_awakening_proc(); From 1cbcbe5ba1b51d2117b3f21cef93ab20d98b3ce4 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 23 Apr 2012 11:45:22 -0400 Subject: [PATCH 0615/1149] Core/Battleground: correct checking for which flag was on the ground. fixes issue with not being able to pick up flags --- src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index 495178f18dd..d100dc645a2 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -476,7 +476,7 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target } //Alliance flag on ground(not in base) (returned or picked up again from ground!) - if (GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10) && BgObjects[BG_WS_OBJECT_A_FLAG] == target_obj->GetGUID()) + if (GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10) && target_obj->GetGOInfo()->entry == BG_OBJECT_A_FLAG_GROUND_WS_ENTRY) { if (Source->GetTeam() == ALLIANCE) { @@ -510,7 +510,7 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target } //Horde flag on ground(not in base) (returned or picked up again) - if (GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10) && BgObjects[BG_WS_OBJECT_H_FLAG] == target_obj->GetGUID()) + if (GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10) && target_obj->GetGOInfo()->entry == BG_OBJECT_H_FLAG_GROUND_WS_ENTRY) { if (Source->GetTeam() == HORDE) { From a9ad4099ec99d2ba3eefc2ff393b3d32d0fcaccb Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 23 Apr 2012 18:10:18 +0200 Subject: [PATCH 0616/1149] Scripts/Icecrown Citadel * Sister Svalna will now fly and land properly * Fixed visuals in Blood Prince Council fight * Flying triggers will now fly properly --- .../world/2012_04_23_00_world_creatures.sql | 12 ++++ .../boss_blood_prince_council.cpp | 65 ++++++------------- .../boss_professor_putricide.cpp | 2 +- .../IcecrownCitadel/boss_sindragosa.cpp | 2 + .../IcecrownCitadel/icecrown_citadel.cpp | 14 ++-- 5 files changed, 44 insertions(+), 51 deletions(-) create mode 100644 sql/updates/world/2012_04_23_00_world_creatures.sql diff --git a/sql/updates/world/2012_04_23_00_world_creatures.sql b/sql/updates/world/2012_04_23_00_world_creatures.sql new file mode 100644 index 00000000000..3730fabf552 --- /dev/null +++ b/sql/updates/world/2012_04_23_00_world_creatures.sql @@ -0,0 +1,12 @@ +UPDATE `creature_template` SET `flags_extra`=0x82,`ModelId1`=1126,`ModelId2`=16925 WHERE `entry` IN (38008,38641,38773,38774); -- Blood Orb Controller +UPDATE `creature_template` SET `flags_extra`=0x80,`ModelId1`=19725,`ModelId2`=31095,`baseattacktime`=2000,`speed_walk`=0.8,`speed_run`=0.28571 WHERE `entry` IN (38454,38775,38776,38777); -- Kinetic Bomb +UPDATE `creature_template` SET `exp`=2,`baseattacktime`=2000,`ModelId1`=19725,`ModelId2`=21342 WHERE `entry`=38458; -- Kinetic Bomb Target +UPDATE `creature_template` SET `baseattacktime`=2000,`speed_walk`=4.4,`ModelId1`=19725,`ModelId2`=26767 WHERE `entry` IN (38332,38451); -- Ball of Flame +UPDATE `creature_template` SET `flags_extra`=0x80 WHERE `entry`=37950; -- Valithria Dreamwalker +UPDATE `creature_template` SET `InhabitType`=4 WHERE `InhabitType`&4 AND `flags_extra`&0x80; -- make flying triggers fly +UPDATE `creature_template` SET `InhabitType`=4,`HoverHeight`=12 WHERE `entry`=37126; -- Sister Svalna +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=37950; -- Valithria Dreamwalker +UPDATE `creature_model_info` SET `bounding_radius`=1,`combat_reach`=0,`gender`=0 WHERE `modelid`=31095; -- Kinetic Bomb +UPDATE `creature_model_info` SET `bounding_radius`=0.5,`combat_reach`=1,`gender`=0 WHERE `modelid`=21342; -- Kinetic Bomb Target +UPDATE `creature_model_info` SET `bounding_radius`=0.5,`combat_reach`=1,`gender`=0 WHERE `modelid`=26767; -- Ball of Flame +UPDATE `creature_template_addon` SET `bytes1`=50331648,`bytes2`=1,`mount`=0,`emote`=0,`auras`=NULL WHERE `entry`=38454; -- Kinetic Bomb diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index de104a78e43..8090fc98101 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -103,6 +103,7 @@ enum Spells SPELL_UNSTABLE = 72059, SPELL_KINETIC_BOMB_VISUAL = 72054, SPELL_KINETIC_BOMB_EXPLOSION = 72052, + SPELL_KINETIC_BOMB_KNOCKBACK = 72087, // Shock Vortex SPELL_SHOCK_VORTEX_PERIODIC = 71945, @@ -443,20 +444,12 @@ class boss_prince_keleseth_icc : public CreatureScript { summons.Summon(summon); Position pos; - pos.Relocate(summon); + me->GetPosition(&pos); float maxRange = me->GetDistance2d(summon); float angle = me->GetAngle(summon); - // prevent spawning outside of room - while (!me->IsWithinLOS(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ())) - { - maxRange -= 5.0f; - if (maxRange < 5.0f) - break; - - summon->MovePosition(pos, float(rand_norm() * maxRange), angle); - } - + me->MovePositionToFirstCollision(pos, maxRange, angle); summon->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation()); + summon->ToTempSummon()->SetTempSummonType(TEMPSUMMON_CORPSE_DESPAWN); } void DamageDealt(Unit* /*target*/, uint32& damage, DamageEffectType damageType) @@ -894,6 +887,7 @@ class boss_prince_valanar_icc : public CreatureScript summon->GetPosition(x, y, z); float ground_Z = summon->GetMap()->GetHeight(summon->GetPhaseMask(), x, y, z, true, 500.0f); summon->GetMotionMaster()->MovePoint(POINT_KINETIC_BOMB_IMPACT, x, y, ground_Z); + summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); break; } case NPC_SHOCK_VORTEX: @@ -1073,7 +1067,7 @@ class npc_blood_queen_lana_thel : public CreatureScript if (_introDone) return; - if (!me->IsWithinDistInMap(who, 35.0f)) + if (!me->IsWithinDistInMap(who, 35.0f, false)) return; _introDone = true; @@ -1232,12 +1226,12 @@ class npc_kinetic_bomb : public CreatureScript void Reset() { _events.Reset(); - me->SetDisplayId(DISPLAY_KINETIC_BOMB); + me->SetWalk(true); me->CastSpell(me, SPELL_UNSTABLE, true); me->CastSpell(me, SPELL_KINETIC_BOMB_VISUAL, true); me->SetReactState(REACT_PASSIVE); - me->SetSpeed(MOVE_FLIGHT, IsHeroic() ? 0.3f : 0.15f, true); me->GetPosition(_x, _y, _groundZ); + me->DespawnOrUnsummon(60000); _groundZ = me->GetMap()->GetHeight(me->GetPhaseMask(), _x, _y, _groundZ, true, 500.0f); } @@ -1247,9 +1241,9 @@ class npc_kinetic_bomb : public CreatureScript _events.ScheduleEvent(EVENT_BOMB_DESPAWN, 1000); else if (action == ACTION_KINETIC_BOMB_JUMP) { - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MoveJump(_x, _y, me->GetPositionZ() + 7.0f, 1.0f, 7.0f); - _events.ScheduleEvent(EVENT_CONTINUE_FALLING, 700); + if (!me->HasAura(SPELL_KINETIC_BOMB_KNOCKBACK)) + me->GetMotionMaster()->MoveCharge(_x, _y, me->GetPositionZ() + 100.0f, me->GetSpeed(MOVE_RUN), 0); + _events.RescheduleEvent(EVENT_CONTINUE_FALLING, 3000); } } @@ -1263,10 +1257,10 @@ class npc_kinetic_bomb : public CreatureScript { case EVENT_BOMB_DESPAWN: me->SetVisible(false); + me->DespawnOrUnsummon(5000); break; case EVENT_CONTINUE_FALLING: - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MovePoint(POINT_KINETIC_BOMB_IMPACT, _x, _y, _groundZ); + me->GetMotionMaster()->MoveCharge(_x, _y, _groundZ, me->GetSpeed(MOVE_WALK), POINT_KINETIC_BOMB_IMPACT); break; default: break; @@ -1329,17 +1323,16 @@ class npc_dark_nucleus : public CreatureScript void DamageTaken(Unit* attacker, uint32& /*damage*/) { - if (attacker == me) + if (attacker == me || attacker == me->getVictim()) return; - if (!_lockedTarget) - if (me->getVictim() == attacker) - _lockedTarget = true; + me->DeleteThreatList(); + me->AddThreat(attacker, 500000000.0f); } - void UpdateAI(const uint32 diff) + void UpdateAI(uint32 const diff) { - if (!me->isInCombat()) + if (!UpdateVictim()) return; if (_targetAuraCheck <= diff) @@ -1355,23 +1348,6 @@ class npc_dark_nucleus : public CreatureScript } else _targetAuraCheck -= diff; - - if (!_lockedTarget) - { - if (Unit* victim = me->SelectVictim()) - { - if (me->getVictim() && me->getVictim() != victim) - { - me->getVictim()->RemoveAurasDueToSpell(SPELL_SHADOW_RESONANCE_RESIST, me->GetGUID()); - _lockedTarget = true; - } - - _lockedTarget = true; - AttackStart(victim); - DoCast(victim, SPELL_SHADOW_RESONANCE_RESIST); - me->ClearUnitState(UNIT_STATE_CASTING); - } - } } private: @@ -1525,6 +1501,7 @@ class spell_valanar_kinetic_bomb : public SpellScriptLoader Position offset = {0.0f, 0.0f, 20.0f, 0.0f}; summonPos.RelocateOffset(offset); SetTargetDest(summonPos); + GetHitDest()->RelocateOffset(offset); } void Register() @@ -1586,7 +1563,7 @@ class spell_valanar_kinetic_bomb_knockback : public SpellScriptLoader void Register() { - AfterHit += SpellHitFn(spell_valanar_kinetic_bomb_knockback_SpellScript::KnockIntoAir); + BeforeHit += SpellHitFn(spell_valanar_kinetic_bomb_knockback_SpellScript::KnockIntoAir); } }; @@ -1663,7 +1640,7 @@ class spell_blood_council_shadow_prison_damage : public SpellScriptLoader void AddExtraDamage() { if (Aura* aur = GetHitUnit()->GetAura(GetSpellInfo()->Id)) - if (AuraEffect const* eff = aur->GetEffect(1)) + if (AuraEffect const* eff = aur->GetEffect(EFFECT_1)) SetHitDamage(GetHitDamage() + eff->GetAmount()); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index 273f2a20b4b..c043cb27c7c 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -544,7 +544,7 @@ class boss_professor_putricide : public CreatureScript void UpdateAI(uint32 const diff) { - if ((!UpdateVictim() && !(events.GetPhaseMask() & PHASE_MASK_NOT_SELF)) || !CheckInRoom()) + if ((!(events.GetPhaseMask() & PHASE_MASK_NOT_SELF) && !UpdateVictim()) || !CheckInRoom()) return; events.Update(diff); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index ab924d1b543..ebf9ae02a95 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -713,6 +713,7 @@ class npc_spinestalker : public CreatureScript me->SetDisableGravity(false); me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->SetHomePosition(SpinestalkerLandPos); + me->SetFacingTo(SpinestalkerLandPos.GetOrientation()); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -839,6 +840,7 @@ class npc_rimefang : public CreatureScript me->SetDisableGravity(false); me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->SetHomePosition(RimefangLandPos); + me->SetFacingTo(RimefangLandPos.GetOrientation()); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index c99fde1739c..8d562a23f67 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -796,7 +796,8 @@ class boss_sister_svalna : public CreatureScript { _JustReachedHome(); me->SetReactState(REACT_PASSIVE); - me->SetCanFly(false); + me->SetDisableGravity(false); + me->SetHover(false); } void DoAction(int32 const action) @@ -838,13 +839,14 @@ class boss_sister_svalna : public CreatureScript void MovementInform(uint32 type, uint32 id) { - if (type != POINT_MOTION_TYPE || id != POINT_LAND) + if (type != EFFECT_MOTION_TYPE || id != POINT_LAND) return; _isEventInProgress = false; me->setActive(false); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); - me->SetCanFly(false); + me->SetDisableGravity(false); + me->SetHover(false); } void SpellHitTarget(Unit* target, SpellInfo const* spell) @@ -1921,10 +1923,10 @@ class spell_svalna_revive_champion : public SpellScriptLoader Position pos; caster->GetPosition(&pos); caster->GetNearPosition(pos, 5.0f, 0.0f); - pos.m_positionZ = caster->GetBaseMap()->GetHeight(caster->GetPhaseMask(), pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), true, 20.0f); - pos.m_positionZ += 0.05f; + //pos.m_positionZ = caster->GetBaseMap()->GetHeight(caster->GetPhaseMask(), pos.GetPositionX(), pos.GetPositionY(), caster->GetPositionZ(), true, 50.0f); + //pos.m_positionZ += 0.05f; caster->SetHomePosition(pos); - caster->GetMotionMaster()->MovePoint(POINT_LAND, pos); + caster->GetMotionMaster()->MoveLand(POINT_LAND, pos, caster->GetSpeed(MOVE_FLIGHT)); } void Register() From 5da5021464c649d84c755a921eae43519eba8567 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 23 Apr 2012 13:42:54 -0400 Subject: [PATCH 0617/1149] Core/Spells: fix rocket boots extreme (+lite) spell cooldown issue. --- src/server/scripts/Spells/spell_item.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 666477e68e7..73a77b06408 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1744,6 +1744,7 @@ class spell_item_rocket_boots : public SpellScriptLoader if (Battleground* bg = caster->GetBattleground()) bg->EventPlayerDroppedFlag(caster); + caster->RemoveSpellCooldown(SPELL_ROCKET_BOOTS_PROC); caster->CastSpell(caster, SPELL_ROCKET_BOOTS_PROC, true, NULL); } From c4123289916daa7bd1c7feb191e8c647fd17b163 Mon Sep 17 00:00:00 2001 From: click Date: Mon, 23 Apr 2012 20:23:30 +0200 Subject: [PATCH 0618/1149] Revert "DEP: Updated Jemalloc to Version 2.5" - this version of the jemalloc-library is crashy at best, and should not have been pushed. Further investigations on why this occurs is required before it will be slammed into master. This reverts commit 126fd13e5d6b57dc0c8830248d44db504c7d103f. --- dep/jemalloc/VERSION | 2 +- .../include/jemalloc/internal/arena.h | 252 +++---- .../include/jemalloc/internal/atomic.h | 169 ----- .../include/jemalloc/internal/bitmap.h | 184 ----- .../include/jemalloc/internal/chunk.h | 2 +- dep/jemalloc/include/jemalloc/internal/ckh.h | 2 +- dep/jemalloc/include/jemalloc/internal/ctl.h | 1 - dep/jemalloc/include/jemalloc/internal/hash.h | 6 +- .../jemalloc/internal/jemalloc_internal.h | 185 ++--- dep/jemalloc/include/jemalloc/internal/mb.h | 2 +- .../include/jemalloc/internal/mutex.h | 26 +- .../jemalloc/internal/private_namespace.h | 195 ----- dep/jemalloc/include/jemalloc/internal/prof.h | 144 ++-- .../include/jemalloc/internal/rtree.h | 2 +- .../include/jemalloc/internal/stats.h | 37 +- .../include/jemalloc/internal/tcache.h | 89 +-- dep/jemalloc/include/jemalloc/jemalloc.h | 10 +- dep/jemalloc/include/jemalloc/jemalloc_defs.h | 35 +- dep/jemalloc/src/arena.c | 669 +++++++----------- dep/jemalloc/src/atomic.c | 2 - dep/jemalloc/src/bitmap.c | 90 --- dep/jemalloc/src/chunk.c | 16 +- dep/jemalloc/src/chunk_mmap.c | 6 +- dep/jemalloc/src/ckh.c | 46 +- dep/jemalloc/src/ctl.c | 37 +- dep/jemalloc/src/hash.c | 2 +- dep/jemalloc/src/huge.c | 30 +- dep/jemalloc/src/jemalloc.c | 268 ++----- dep/jemalloc/src/mb.c | 2 +- dep/jemalloc/src/mutex.c | 6 - dep/jemalloc/src/prof.c | 177 +++-- dep/jemalloc/src/rtree.c | 7 +- dep/jemalloc/src/stats.c | 21 +- dep/jemalloc/src/tcache.c | 157 ++-- 34 files changed, 808 insertions(+), 2071 deletions(-) delete mode 100644 dep/jemalloc/include/jemalloc/internal/atomic.h delete mode 100644 dep/jemalloc/include/jemalloc/internal/bitmap.h delete mode 100644 dep/jemalloc/include/jemalloc/internal/private_namespace.h delete mode 100644 dep/jemalloc/src/atomic.c delete mode 100644 dep/jemalloc/src/bitmap.c diff --git a/dep/jemalloc/VERSION b/dep/jemalloc/VERSION index aa85f5a2acf..585f53edd80 100644 --- a/dep/jemalloc/VERSION +++ b/dep/jemalloc/VERSION @@ -1 +1 @@ -2.2.5-0-gfc1bb70e5f0d9a58b39efa39cc549b5af5104760 +2.1.0-0-g1c4b088b08d3bc7617a34387e196ce03716160bf diff --git a/dep/jemalloc/include/jemalloc/internal/arena.h b/dep/jemalloc/include/jemalloc/internal/arena.h index b80c118d811..9556c2c68f7 100644 --- a/dep/jemalloc/include/jemalloc/internal/arena.h +++ b/dep/jemalloc/include/jemalloc/internal/arena.h @@ -19,7 +19,6 @@ #ifdef JEMALLOC_TINY /* Smallest size class to support. */ # define LG_TINY_MIN LG_SIZEOF_PTR -# define TINY_MIN (1U << LG_TINY_MIN) #endif /* @@ -46,10 +45,9 @@ * point is implicitly RUN_BFP bits to the left. * * Note that it is possible to set RUN_MAX_OVRHD low enough that it cannot be - * honored for some/all object sizes, since when heap profiling is enabled - * there is one pointer of header overhead per object (plus a constant). This - * constraint is relaxed (ignored) for runs that are so small that the - * per-region overhead is greater than: + * honored for some/all object sizes, since there is one bit of header overhead + * per object (plus a constant). This constraint is relaxed (ignored) for runs + * that are so small that the per-region overhead is greater than: * * (RUN_MAX_OVRHD / (reg_size << (3+RUN_BFP)) */ @@ -58,10 +56,6 @@ #define RUN_MAX_OVRHD 0x0000003dU #define RUN_MAX_OVRHD_RELAX 0x00001800U -/* Maximum number of regions in one run. */ -#define LG_RUN_MAXREGS 11 -#define RUN_MAXREGS (1U << LG_RUN_MAXREGS) - /* * The minimum ratio of active:dirty pages per arena is computed as: * @@ -75,7 +69,6 @@ typedef struct arena_chunk_map_s arena_chunk_map_t; typedef struct arena_chunk_s arena_chunk_t; typedef struct arena_run_s arena_run_t; -typedef struct arena_bin_info_s arena_bin_info_t; typedef struct arena_bin_s arena_bin_t; typedef struct arena_s arena_t; @@ -112,7 +105,7 @@ struct arena_chunk_map_s { * Run address (or size) and various flags are stored together. The bit * layout looks like (assuming 32-bit system): * - * ???????? ???????? ????---- ----dula + * ???????? ???????? ????---- ----dzla * * ? : Unallocated: Run address for first/last pages, unset for internal * pages. @@ -120,7 +113,7 @@ struct arena_chunk_map_s { * Large: Run size for first page, unset for trailing pages. * - : Unused. * d : dirty? - * u : unzeroed? + * z : zeroed? * l : large? * a : allocated? * @@ -136,30 +129,30 @@ struct arena_chunk_map_s { * [dula] : bit unset * * Unallocated (clean): - * ssssssss ssssssss ssss---- ----du-a + * ssssssss ssssssss ssss---- ----du-- * xxxxxxxx xxxxxxxx xxxx---- -----Uxx - * ssssssss ssssssss ssss---- ----dU-a + * ssssssss ssssssss ssss---- ----dU-- * * Unallocated (dirty): - * ssssssss ssssssss ssss---- ----D--a + * ssssssss ssssssss ssss---- ----D--- * xxxxxxxx xxxxxxxx xxxx---- ----xxxx - * ssssssss ssssssss ssss---- ----D--a + * ssssssss ssssssss ssss---- ----D--- * * Small: - * pppppppp pppppppp pppp---- ----d--A - * pppppppp pppppppp pppp---- -------A - * pppppppp pppppppp pppp---- ----d--A + * pppppppp pppppppp pppp---- ----d--a + * pppppppp pppppppp pppp---- -------a + * pppppppp pppppppp pppp---- ----d--a * * Large: - * ssssssss ssssssss ssss---- ----D-LA + * ssssssss ssssssss ssss---- ----D-la * xxxxxxxx xxxxxxxx xxxx---- ----xxxx - * -------- -------- -------- ----D-LA + * -------- -------- -------- ----D-la * * Large (sampled, size <= PAGE_SIZE): - * ssssssss ssssssss sssscccc ccccD-LA + * ssssssss ssssssss sssscccc ccccD-la * * Large (not sampled, size == PAGE_SIZE): - * ssssssss ssssssss ssss---- ----D-LA + * ssssssss ssssssss ssss---- ----D-la */ size_t bits; #ifdef JEMALLOC_PROF @@ -213,52 +206,16 @@ struct arena_run_s { /* Bin this run is associated with. */ arena_bin_t *bin; - /* Index of next region that has never been allocated, or nregs. */ - uint32_t nextind; + /* Stack of available freed regions, or NULL. */ + void *avail; + + /* Next region that has never been allocated, or run boundary. */ + void *next; /* Number of free regions in run. */ unsigned nfree; }; -/* - * Read-only information associated with each element of arena_t's bins array - * is stored separately, partly to reduce memory usage (only one copy, rather - * than one per arena), but mainly to avoid false cacheline sharing. - */ -struct arena_bin_info_s { - /* Size of regions in a run for this bin's size class. */ - size_t reg_size; - - /* Total size of a run for this bin's size class. */ - size_t run_size; - - /* Total number of regions in a run for this bin's size class. */ - uint32_t nregs; - - /* - * Offset of first bitmap_t element in a run header for this bin's size - * class. - */ - uint32_t bitmap_offset; - - /* - * Metadata used to manipulate bitmaps for runs associated with this - * bin. - */ - bitmap_info_t bitmap_info; - -#ifdef JEMALLOC_PROF - /* - * Offset of first (prof_ctx_t *) in a run header for this bin's size - * class, or 0 if (opt_prof == false). - */ - uint32_t ctx0_offset; -#endif - - /* Offset of first region in a run for this bin's size class. */ - uint32_t reg0_offset; -}; - struct arena_bin_s { /* * All operations on runcur, runs, and stats require that lock be @@ -283,6 +240,26 @@ struct arena_bin_s { */ arena_run_tree_t runs; + /* Size of regions in a run for this bin's size class. */ + size_t reg_size; + + /* Total size of a run for this bin's size class. */ + size_t run_size; + + /* Total number of regions in a run for this bin's size class. */ + uint32_t nregs; + +#ifdef JEMALLOC_PROF + /* + * Offset of first (prof_ctx_t *) in a run header for this bin's size + * class, or 0 if (opt_prof == false). + */ + uint32_t ctx0_offset; +#endif + + /* Offset of first region in a run for this bin's size class. */ + uint32_t reg0_offset; + #ifdef JEMALLOC_STATS /* Bin statistics. */ malloc_bin_stats_t stats; @@ -299,18 +276,8 @@ struct arena_s { unsigned ind; /* - * Number of threads currently assigned to this arena. This field is - * protected by arenas_lock. - */ - unsigned nthreads; - - /* - * There are three classes of arena operations from a locking - * perspective: - * 1) Thread asssignment (modifies nthreads) is protected by - * arenas_lock. - * 2) Bin-related operations are protected by bin locks. - * 3) Chunk- and run-related operations are protected by this mutex. + * All non-bin-related operations on this arena require that lock be + * locked. */ malloc_mutex_t lock; @@ -380,35 +347,45 @@ struct arena_s { /* * bins is used to store trees of free regions of the following sizes, - * assuming a 64-bit system with 16-byte quantum, 4 KiB page size, and - * default MALLOC_CONF. + * assuming a 16-byte quantum, 4 KiB page size, and default + * JEMALLOC_OPTIONS. * * bins[i] | size | * --------+--------+ - * 0 | 8 | + * 0 | 2 | + * 1 | 4 | + * 2 | 8 | * --------+--------+ - * 1 | 16 | - * 2 | 32 | - * 3 | 48 | + * 3 | 16 | + * 4 | 32 | + * 5 | 48 | * : : - * 6 | 96 | - * 7 | 112 | - * 8 | 128 | + * 8 | 96 | + * 9 | 112 | + * 10 | 128 | * --------+--------+ - * 9 | 192 | - * 10 | 256 | - * 11 | 320 | - * 12 | 384 | - * 13 | 448 | - * 14 | 512 | + * 11 | 192 | + * 12 | 256 | + * 13 | 320 | + * 14 | 384 | + * 15 | 448 | + * 16 | 512 | * --------+--------+ - * 15 | 768 | - * 16 | 1024 | - * 17 | 1280 | + * 17 | 768 | + * 18 | 1024 | + * 19 | 1280 | * : : - * 25 | 3328 | - * 26 | 3584 | - * 27 | 3840 | + * 27 | 3328 | + * 28 | 3584 | + * 29 | 3840 | + * --------+--------+ + * 30 | 4 KiB | + * 31 | 6 KiB | + * 33 | 8 KiB | + * : : + * 43 | 28 KiB | + * 44 | 30 KiB | + * 45 | 32 KiB | * --------+--------+ */ arena_bin_t bins[1]; /* Dynamically sized. */ @@ -420,16 +397,8 @@ struct arena_s { extern size_t opt_lg_qspace_max; extern size_t opt_lg_cspace_max; -extern ssize_t opt_lg_dirty_mult; -/* - * small_size2bin is a compact lookup table that rounds request sizes up to - * size classes. In order to reduce cache footprint, the table is compressed, - * and all accesses are via the SMALL_SIZE2BIN macro. - */ +extern ssize_t opt_lg_dirty_mult; extern uint8_t const *small_size2bin; -#define SMALL_SIZE2BIN(s) (small_size2bin[(s-1) >> LG_TINY_MIN]) - -extern arena_bin_info_t *arena_bin_info; /* Various bin-related settings. */ #ifdef JEMALLOC_TINY /* Number of (2^n)-spaced tiny bins. */ @@ -496,9 +465,8 @@ bool arena_boot(void); #ifdef JEMALLOC_H_INLINES #ifndef JEMALLOC_ENABLE_INLINE -size_t arena_bin_index(arena_t *arena, arena_bin_t *bin); -unsigned arena_run_regind(arena_run_t *run, arena_bin_info_t *bin_info, - const void *ptr); +unsigned arena_run_regind(arena_run_t *run, arena_bin_t *bin, + const void *ptr, size_t size); # ifdef JEMALLOC_PROF prof_ctx_t *arena_prof_ctx_get(const void *ptr); void arena_prof_ctx_set(const void *ptr, prof_ctx_t *ctx); @@ -507,37 +475,21 @@ void arena_dalloc(arena_t *arena, arena_chunk_t *chunk, void *ptr); #endif #if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_ARENA_C_)) -JEMALLOC_INLINE size_t -arena_bin_index(arena_t *arena, arena_bin_t *bin) -{ - size_t binind = bin - arena->bins; - assert(binind < nbins); - return (binind); -} - JEMALLOC_INLINE unsigned -arena_run_regind(arena_run_t *run, arena_bin_info_t *bin_info, const void *ptr) +arena_run_regind(arena_run_t *run, arena_bin_t *bin, const void *ptr, + size_t size) { unsigned shift, diff, regind; - size_t size; - dassert(run->magic == ARENA_RUN_MAGIC); - /* - * Freeing a pointer lower than region zero can cause assertion - * failure. - */ - assert((uintptr_t)ptr >= (uintptr_t)run + - (uintptr_t)bin_info->reg0_offset); + assert(run->magic == ARENA_RUN_MAGIC); /* * Avoid doing division with a variable divisor if possible. Using * actual division here can reduce allocator throughput by over 20%! */ - diff = (unsigned)((uintptr_t)ptr - (uintptr_t)run - - bin_info->reg0_offset); + diff = (unsigned)((uintptr_t)ptr - (uintptr_t)run - bin->reg0_offset); /* Rescale (factor powers of 2 out of the numerator and denominator). */ - size = bin_info->reg_size; shift = ffs(size) - 1; diff >>= shift; size >>= shift; @@ -560,8 +512,8 @@ arena_run_regind(arena_run_t *run, arena_bin_info_t *bin_info, const void *ptr) * divide by 0, and 1 and 2 are both powers of two, which are * handled above. */ -#define SIZE_INV_SHIFT ((sizeof(unsigned) << 3) - LG_RUN_MAXREGS) -#define SIZE_INV(s) (((1U << SIZE_INV_SHIFT) / (s)) + 1) +#define SIZE_INV_SHIFT 21 +#define SIZE_INV(s) (((1U << SIZE_INV_SHIFT) / (s)) + 1) static const unsigned size_invs[] = { SIZE_INV(3), SIZE_INV(4), SIZE_INV(5), SIZE_INV(6), SIZE_INV(7), @@ -581,7 +533,7 @@ arena_run_regind(arena_run_t *run, arena_bin_info_t *bin_info, const void *ptr) #undef SIZE_INV_SHIFT } assert(diff == regind * size); - assert(regind < bin_info->nregs); + assert(regind < bin->nregs); return (regind); } @@ -608,14 +560,13 @@ arena_prof_ctx_get(const void *ptr) arena_run_t *run = (arena_run_t *)((uintptr_t)chunk + (uintptr_t)((pageind - (mapbits >> PAGE_SHIFT)) << PAGE_SHIFT)); - size_t binind = arena_bin_index(chunk->arena, run->bin); - arena_bin_info_t *bin_info = &arena_bin_info[binind]; + arena_bin_t *bin = run->bin; unsigned regind; - dassert(run->magic == ARENA_RUN_MAGIC); - regind = arena_run_regind(run, bin_info, ptr); + assert(run->magic == ARENA_RUN_MAGIC); + regind = arena_run_regind(run, bin, ptr, bin->reg_size); ret = *(prof_ctx_t **)((uintptr_t)run + - bin_info->ctx0_offset + (regind * + bin->ctx0_offset + (regind * sizeof(prof_ctx_t *))); } } else @@ -643,16 +594,12 @@ arena_prof_ctx_set(const void *ptr, prof_ctx_t *ctx) (uintptr_t)((pageind - (mapbits >> PAGE_SHIFT)) << PAGE_SHIFT)); arena_bin_t *bin = run->bin; - size_t binind; - arena_bin_info_t *bin_info; unsigned regind; - dassert(run->magic == ARENA_RUN_MAGIC); - binind = arena_bin_index(chunk->arena, bin); - bin_info = &arena_bin_info[binind]; - regind = arena_run_regind(run, bin_info, ptr); + assert(run->magic == ARENA_RUN_MAGIC); + regind = arena_run_regind(run, bin, ptr, bin->reg_size); - *((prof_ctx_t **)((uintptr_t)run + bin_info->ctx0_offset + *((prof_ctx_t **)((uintptr_t)run + bin->ctx0_offset + (regind * sizeof(prof_ctx_t *)))) = ctx; } else assert((uintptr_t)ctx == (uintptr_t)1U); @@ -668,7 +615,7 @@ arena_dalloc(arena_t *arena, arena_chunk_t *chunk, void *ptr) arena_chunk_map_t *mapelm; assert(arena != NULL); - dassert(arena->magic == ARENA_MAGIC); + assert(arena->magic == ARENA_MAGIC); assert(chunk->arena == arena); assert(ptr != NULL); assert(CHUNK_ADDR2BASE(ptr) != ptr); @@ -691,18 +638,11 @@ arena_dalloc(arena_t *arena, arena_chunk_t *chunk, void *ptr) run = (arena_run_t *)((uintptr_t)chunk + (uintptr_t)((pageind - (mapelm->bits >> PAGE_SHIFT)) << PAGE_SHIFT)); - dassert(run->magic == ARENA_RUN_MAGIC); + assert(run->magic == ARENA_RUN_MAGIC); + assert(((uintptr_t)ptr - ((uintptr_t)run + + (uintptr_t)run->bin->reg0_offset)) % + run->bin->reg_size == 0); bin = run->bin; -#ifdef JEMALLOC_DEBUG - { - size_t binind = arena_bin_index(arena, bin); - arena_bin_info_t *bin_info = - &arena_bin_info[binind]; - assert(((uintptr_t)ptr - ((uintptr_t)run + - (uintptr_t)bin_info->reg0_offset)) % - bin_info->reg_size == 0); - } -#endif malloc_mutex_lock(&bin->lock); arena_dalloc_bin(arena, chunk, ptr, mapelm); malloc_mutex_unlock(&bin->lock); diff --git a/dep/jemalloc/include/jemalloc/internal/atomic.h b/dep/jemalloc/include/jemalloc/internal/atomic.h deleted file mode 100644 index 9a298623f8a..00000000000 --- a/dep/jemalloc/include/jemalloc/internal/atomic.h +++ /dev/null @@ -1,169 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -#define atomic_read_uint64(p) atomic_add_uint64(p, 0) -#define atomic_read_uint32(p) atomic_add_uint32(p, 0) - -#if (LG_SIZEOF_PTR == 3) -# define atomic_read_z(p) \ - (size_t)atomic_add_uint64((uint64_t *)p, (uint64_t)0) -# define atomic_add_z(p, x) \ - (size_t)atomic_add_uint64((uint64_t *)p, (uint64_t)x) -# define atomic_sub_z(p, x) \ - (size_t)atomic_sub_uint64((uint64_t *)p, (uint64_t)x) -#elif (LG_SIZEOF_PTR == 2) -# define atomic_read_z(p) \ - (size_t)atomic_add_uint32((uint32_t *)p, (uint32_t)0) -# define atomic_add_z(p, x) \ - (size_t)atomic_add_uint32((uint32_t *)p, (uint32_t)x) -# define atomic_sub_z(p, x) \ - (size_t)atomic_sub_uint32((uint32_t *)p, (uint32_t)x) -#endif - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#ifndef JEMALLOC_ENABLE_INLINE -uint64_t atomic_add_uint64(uint64_t *p, uint64_t x); -uint64_t atomic_sub_uint64(uint64_t *p, uint64_t x); -uint32_t atomic_add_uint32(uint32_t *p, uint32_t x); -uint32_t atomic_sub_uint32(uint32_t *p, uint32_t x); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_ATOMIC_C_)) -/******************************************************************************/ -/* 64-bit operations. */ -#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 -JEMALLOC_INLINE uint64_t -atomic_add_uint64(uint64_t *p, uint64_t x) -{ - - return (__sync_add_and_fetch(p, x)); -} - -JEMALLOC_INLINE uint64_t -atomic_sub_uint64(uint64_t *p, uint64_t x) -{ - - return (__sync_sub_and_fetch(p, x)); -} -#elif (defined(JEMALLOC_OSATOMIC)) -JEMALLOC_INLINE uint64_t -atomic_add_uint64(uint64_t *p, uint64_t x) -{ - - return (OSAtomicAdd64((int64_t)x, (int64_t *)p)); -} - -JEMALLOC_INLINE uint64_t -atomic_sub_uint64(uint64_t *p, uint64_t x) -{ - - return (OSAtomicAdd64(-((int64_t)x), (int64_t *)p)); -} -#elif (defined(__amd64_) || defined(__x86_64__)) -JEMALLOC_INLINE uint64_t -atomic_add_uint64(uint64_t *p, uint64_t x) -{ - - asm volatile ( - "lock; xaddq %0, %1;" - : "+r" (x), "=m" (*p) /* Outputs. */ - : "m" (*p) /* Inputs. */ - ); - - return (x); -} - -JEMALLOC_INLINE uint64_t -atomic_sub_uint64(uint64_t *p, uint64_t x) -{ - - x = (uint64_t)(-(int64_t)x); - asm volatile ( - "lock; xaddq %0, %1;" - : "+r" (x), "=m" (*p) /* Outputs. */ - : "m" (*p) /* Inputs. */ - ); - - return (x); -} -#else -# if (LG_SIZEOF_PTR == 3) -# error "Missing implementation for 64-bit atomic operations" -# endif -#endif - -/******************************************************************************/ -/* 32-bit operations. */ -#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 -JEMALLOC_INLINE uint32_t -atomic_add_uint32(uint32_t *p, uint32_t x) -{ - - return (__sync_add_and_fetch(p, x)); -} - -JEMALLOC_INLINE uint32_t -atomic_sub_uint32(uint32_t *p, uint32_t x) -{ - - return (__sync_sub_and_fetch(p, x)); -} -#elif (defined(JEMALLOC_OSATOMIC)) -JEMALLOC_INLINE uint32_t -atomic_add_uint32(uint32_t *p, uint32_t x) -{ - - return (OSAtomicAdd32((int32_t)x, (int32_t *)p)); -} - -JEMALLOC_INLINE uint32_t -atomic_sub_uint32(uint32_t *p, uint32_t x) -{ - - return (OSAtomicAdd32(-((int32_t)x), (int32_t *)p)); -} -#elif (defined(__i386__) || defined(__amd64_) || defined(__x86_64__)) -JEMALLOC_INLINE uint32_t -atomic_add_uint32(uint32_t *p, uint32_t x) -{ - - asm volatile ( - "lock; xaddl %0, %1;" - : "+r" (x), "=m" (*p) /* Outputs. */ - : "m" (*p) /* Inputs. */ - ); - - return (x); -} - -JEMALLOC_INLINE uint32_t -atomic_sub_uint32(uint32_t *p, uint32_t x) -{ - - x = (uint32_t)(-(int32_t)x); - asm volatile ( - "lock; xaddl %0, %1;" - : "+r" (x), "=m" (*p) /* Outputs. */ - : "m" (*p) /* Inputs. */ - ); - - return (x); -} -#else -# error "Missing implementation for 32-bit atomic operations" -#endif -#endif - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ diff --git a/dep/jemalloc/include/jemalloc/internal/bitmap.h b/dep/jemalloc/include/jemalloc/internal/bitmap.h deleted file mode 100644 index 605ebac58c1..00000000000 --- a/dep/jemalloc/include/jemalloc/internal/bitmap.h +++ /dev/null @@ -1,184 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -/* Maximum bitmap bit count is 2^LG_BITMAP_MAXBITS. */ -#define LG_BITMAP_MAXBITS LG_RUN_MAXREGS - -typedef struct bitmap_level_s bitmap_level_t; -typedef struct bitmap_info_s bitmap_info_t; -typedef unsigned long bitmap_t; -#define LG_SIZEOF_BITMAP LG_SIZEOF_LONG - -/* Number of bits per group. */ -#define LG_BITMAP_GROUP_NBITS (LG_SIZEOF_BITMAP + 3) -#define BITMAP_GROUP_NBITS (ZU(1) << LG_BITMAP_GROUP_NBITS) -#define BITMAP_GROUP_NBITS_MASK (BITMAP_GROUP_NBITS-1) - -/* Maximum number of levels possible. */ -#define BITMAP_MAX_LEVELS \ - (LG_BITMAP_MAXBITS / LG_SIZEOF_BITMAP) \ - + !!(LG_BITMAP_MAXBITS % LG_SIZEOF_BITMAP) - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -struct bitmap_level_s { - /* Offset of this level's groups within the array of groups. */ - size_t group_offset; -}; - -struct bitmap_info_s { - /* Logical number of bits in bitmap (stored at bottom level). */ - size_t nbits; - - /* Number of levels necessary for nbits. */ - unsigned nlevels; - - /* - * Only the first (nlevels+1) elements are used, and levels are ordered - * bottom to top (e.g. the bottom level is stored in levels[0]). - */ - bitmap_level_t levels[BITMAP_MAX_LEVELS+1]; -}; - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -void bitmap_info_init(bitmap_info_t *binfo, size_t nbits); -size_t bitmap_info_ngroups(const bitmap_info_t *binfo); -size_t bitmap_size(size_t nbits); -void bitmap_init(bitmap_t *bitmap, const bitmap_info_t *binfo); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#ifndef JEMALLOC_ENABLE_INLINE -bool bitmap_full(bitmap_t *bitmap, const bitmap_info_t *binfo); -bool bitmap_get(bitmap_t *bitmap, const bitmap_info_t *binfo, size_t bit); -void bitmap_set(bitmap_t *bitmap, const bitmap_info_t *binfo, size_t bit); -size_t bitmap_sfu(bitmap_t *bitmap, const bitmap_info_t *binfo); -void bitmap_unset(bitmap_t *bitmap, const bitmap_info_t *binfo, size_t bit); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_BITMAP_C_)) -JEMALLOC_INLINE bool -bitmap_full(bitmap_t *bitmap, const bitmap_info_t *binfo) -{ - unsigned rgoff = binfo->levels[binfo->nlevels].group_offset - 1; - bitmap_t rg = bitmap[rgoff]; - /* The bitmap is full iff the root group is 0. */ - return (rg == 0); -} - -JEMALLOC_INLINE bool -bitmap_get(bitmap_t *bitmap, const bitmap_info_t *binfo, size_t bit) -{ - size_t goff; - bitmap_t g; - - assert(bit < binfo->nbits); - goff = bit >> LG_BITMAP_GROUP_NBITS; - g = bitmap[goff]; - return (!(g & (1LU << (bit & BITMAP_GROUP_NBITS_MASK)))); -} - -JEMALLOC_INLINE void -bitmap_set(bitmap_t *bitmap, const bitmap_info_t *binfo, size_t bit) -{ - size_t goff; - bitmap_t *gp; - bitmap_t g; - - assert(bit < binfo->nbits); - assert(bitmap_get(bitmap, binfo, bit) == false); - goff = bit >> LG_BITMAP_GROUP_NBITS; - gp = &bitmap[goff]; - g = *gp; - assert(g & (1LU << (bit & BITMAP_GROUP_NBITS_MASK))); - g ^= 1LU << (bit & BITMAP_GROUP_NBITS_MASK); - *gp = g; - assert(bitmap_get(bitmap, binfo, bit)); - /* Propagate group state transitions up the tree. */ - if (g == 0) { - unsigned i; - for (i = 1; i < binfo->nlevels; i++) { - bit = goff; - goff = bit >> LG_BITMAP_GROUP_NBITS; - gp = &bitmap[binfo->levels[i].group_offset + goff]; - g = *gp; - assert(g & (1LU << (bit & BITMAP_GROUP_NBITS_MASK))); - g ^= 1LU << (bit & BITMAP_GROUP_NBITS_MASK); - *gp = g; - if (g != 0) - break; - } - } -} - -/* sfu: set first unset. */ -JEMALLOC_INLINE size_t -bitmap_sfu(bitmap_t *bitmap, const bitmap_info_t *binfo) -{ - size_t bit; - bitmap_t g; - unsigned i; - - assert(bitmap_full(bitmap, binfo) == false); - - i = binfo->nlevels - 1; - g = bitmap[binfo->levels[i].group_offset]; - bit = ffsl(g) - 1; - while (i > 0) { - i--; - g = bitmap[binfo->levels[i].group_offset + bit]; - bit = (bit << LG_BITMAP_GROUP_NBITS) + (ffsl(g) - 1); - } - - bitmap_set(bitmap, binfo, bit); - return (bit); -} - -JEMALLOC_INLINE void -bitmap_unset(bitmap_t *bitmap, const bitmap_info_t *binfo, size_t bit) -{ - size_t goff; - bitmap_t *gp; - bitmap_t g; - bool propagate; - - assert(bit < binfo->nbits); - assert(bitmap_get(bitmap, binfo, bit)); - goff = bit >> LG_BITMAP_GROUP_NBITS; - gp = &bitmap[goff]; - g = *gp; - propagate = (g == 0); - assert((g & (1LU << (bit & BITMAP_GROUP_NBITS_MASK))) == 0); - g ^= 1LU << (bit & BITMAP_GROUP_NBITS_MASK); - *gp = g; - assert(bitmap_get(bitmap, binfo, bit) == false); - /* Propagate group state transitions up the tree. */ - if (propagate) { - unsigned i; - for (i = 1; i < binfo->nlevels; i++) { - bit = goff; - goff = bit >> LG_BITMAP_GROUP_NBITS; - gp = &bitmap[binfo->levels[i].group_offset + goff]; - g = *gp; - propagate = (g == 0); - assert((g & (1LU << (bit & BITMAP_GROUP_NBITS_MASK))) - == 0); - g ^= 1LU << (bit & BITMAP_GROUP_NBITS_MASK); - *gp = g; - if (propagate == false) - break; - } - } -} - -#endif - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ diff --git a/dep/jemalloc/include/jemalloc/internal/chunk.h b/dep/jemalloc/include/jemalloc/internal/chunk.h index 54b6a3ec886..a60f0ad7498 100644 --- a/dep/jemalloc/include/jemalloc/internal/chunk.h +++ b/dep/jemalloc/include/jemalloc/internal/chunk.h @@ -50,7 +50,7 @@ extern size_t map_bias; /* Number of arena chunk header pages. */ extern size_t arena_maxclass; /* Max size class for arenas. */ void *chunk_alloc(size_t size, bool base, bool *zero); -void chunk_dealloc(void *chunk, size_t size, bool unmap); +void chunk_dealloc(void *chunk, size_t size); bool chunk_boot(void); #endif /* JEMALLOC_H_EXTERNS */ diff --git a/dep/jemalloc/include/jemalloc/internal/ckh.h b/dep/jemalloc/include/jemalloc/internal/ckh.h index 3e4ad4c85f9..d4e391b6360 100644 --- a/dep/jemalloc/include/jemalloc/internal/ckh.h +++ b/dep/jemalloc/include/jemalloc/internal/ckh.h @@ -31,7 +31,7 @@ struct ckhc_s { struct ckh_s { #ifdef JEMALLOC_DEBUG -#define CKH_MAGIC 0x3af2489d +#define CKH_MAGIG 0x3af2489d uint32_t magic; #endif diff --git a/dep/jemalloc/include/jemalloc/internal/ctl.h b/dep/jemalloc/include/jemalloc/internal/ctl.h index f1f5eb70a2a..8776ad135a7 100644 --- a/dep/jemalloc/include/jemalloc/internal/ctl.h +++ b/dep/jemalloc/include/jemalloc/internal/ctl.h @@ -29,7 +29,6 @@ struct ctl_node_s { struct ctl_arena_stats_s { bool initialized; - unsigned nthreads; size_t pactive; size_t pdirty; #ifdef JEMALLOC_STATS diff --git a/dep/jemalloc/include/jemalloc/internal/hash.h b/dep/jemalloc/include/jemalloc/internal/hash.h index 8a46ce30803..d12cdb8359f 100644 --- a/dep/jemalloc/include/jemalloc/internal/hash.h +++ b/dep/jemalloc/include/jemalloc/internal/hash.h @@ -17,7 +17,7 @@ uint64_t hash(const void *key, size_t len, uint64_t seed); #endif -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_HASH_C_)) +#if (defined(JEMALLOC_ENABLE_INLINE) || defined(HASH_C_)) /* * The following hash function is based on MurmurHash64A(), placed into the * public domain by Austin Appleby. See http://murmurhash.googlepages.com/ for @@ -26,7 +26,7 @@ uint64_t hash(const void *key, size_t len, uint64_t seed); JEMALLOC_INLINE uint64_t hash(const void *key, size_t len, uint64_t seed) { - const uint64_t m = 0xc6a4a7935bd1e995LLU; + const uint64_t m = 0xc6a4a7935bd1e995; const int r = 47; uint64_t h = seed ^ (len * m); const uint64_t *data = (const uint64_t *)key; @@ -62,7 +62,7 @@ hash(const void *key, size_t len, uint64_t seed) h *= m; h ^= h >> r; - return (h); + return h; } #endif diff --git a/dep/jemalloc/include/jemalloc/internal/jemalloc_internal.h b/dep/jemalloc/include/jemalloc/internal/jemalloc_internal.h index cd554bea1b9..611f0c665a1 100644 --- a/dep/jemalloc/include/jemalloc/internal/jemalloc_internal.h +++ b/dep/jemalloc/include/jemalloc/internal/jemalloc_internal.h @@ -33,12 +33,6 @@ #define JEMALLOC_MANGLE #include "../jemalloc.h" -#include "jemalloc/internal/private_namespace.h" - -#if (defined(JEMALLOC_OSATOMIC) || defined(JEMALLOC_OSSPIN)) -#include -#endif - #ifdef JEMALLOC_ZONE #include #include @@ -61,9 +55,8 @@ extern void (*JEMALLOC_P(malloc_message))(void *wcbopaque, const char *s); * Define a custom assert() in order to reduce the chances of deadlock during * assertion failure. */ -#ifndef assert -# ifdef JEMALLOC_DEBUG -# define assert(e) do { \ +#ifdef JEMALLOC_DEBUG +# define assert(e) do { \ if (!(e)) { \ char line_buf[UMAX2S_BUFSIZE]; \ malloc_write(": "); \ @@ -77,15 +70,8 @@ extern void (*JEMALLOC_P(malloc_message))(void *wcbopaque, const char *s); abort(); \ } \ } while (0) -# else -# define assert(e) -# endif -#endif - -#ifdef JEMALLOC_DEBUG -# define dassert(e) assert(e) #else -# define dassert(e) +#define assert(e) #endif /* @@ -160,19 +146,12 @@ extern void (*JEMALLOC_P(malloc_message))(void *wcbopaque, const char *s); #define QUANTUM_CEILING(a) \ (((a) + QUANTUM_MASK) & ~QUANTUM_MASK) -#define LONG ((size_t)(1U << LG_SIZEOF_LONG)) -#define LONG_MASK (LONG - 1) - -/* Return the smallest long multiple that is >= a. */ -#define LONG_CEILING(a) \ - (((a) + LONG_MASK) & ~LONG_MASK) - #define SIZEOF_PTR (1U << LG_SIZEOF_PTR) -#define PTR_MASK (SIZEOF_PTR - 1) -/* Return the smallest (void *) multiple that is >= a. */ -#define PTR_CEILING(a) \ - (((a) + PTR_MASK) & ~PTR_MASK) +/* We can't use TLS in non-PIC programs, since TLS relies on loader magic. */ +#if (!defined(PIC) && !defined(NO_TLS)) +# define NO_TLS +#endif /* * Maximum size of L1 cache line. This is used to avoid cache line aliasing. @@ -219,7 +198,6 @@ extern void (*JEMALLOC_P(malloc_message))(void *wcbopaque, const char *s); #define PAGE_CEILING(s) \ (((s) + PAGE_MASK) & ~PAGE_MASK) -#include "jemalloc/internal/atomic.h" #include "jemalloc/internal/jemprn.h" #include "jemalloc/internal/ckh.h" #include "jemalloc/internal/stats.h" @@ -228,7 +206,6 @@ extern void (*JEMALLOC_P(malloc_message))(void *wcbopaque, const char *s); #include "jemalloc/internal/mb.h" #include "jemalloc/internal/extent.h" #include "jemalloc/internal/arena.h" -#include "jemalloc/internal/bitmap.h" #include "jemalloc/internal/base.h" #include "jemalloc/internal/chunk.h" #include "jemalloc/internal/huge.h" @@ -244,14 +221,12 @@ extern void (*JEMALLOC_P(malloc_message))(void *wcbopaque, const char *s); /******************************************************************************/ #define JEMALLOC_H_STRUCTS -#include "jemalloc/internal/atomic.h" #include "jemalloc/internal/jemprn.h" #include "jemalloc/internal/ckh.h" #include "jemalloc/internal/stats.h" #include "jemalloc/internal/ctl.h" #include "jemalloc/internal/mutex.h" #include "jemalloc/internal/mb.h" -#include "jemalloc/internal/bitmap.h" #include "jemalloc/internal/extent.h" #include "jemalloc/internal/arena.h" #include "jemalloc/internal/base.h" @@ -265,13 +240,6 @@ extern void (*JEMALLOC_P(malloc_message))(void *wcbopaque, const char *s); #endif #include "jemalloc/internal/prof.h" -#ifdef JEMALLOC_STATS -typedef struct { - uint64_t allocated; - uint64_t deallocated; -} thread_allocated_t; -#endif - #undef JEMALLOC_H_STRUCTS /******************************************************************************/ #define JEMALLOC_H_EXTERNS @@ -301,7 +269,6 @@ extern size_t lg_pagesize; extern unsigned ncpus; extern malloc_mutex_t arenas_lock; /* Protects arenas initialization. */ -extern pthread_key_t arenas_tsd; #ifndef NO_TLS /* * Map of pthread_self() --> arenas[???], used for selecting an arena to use @@ -311,9 +278,9 @@ extern __thread arena_t *arenas_tls JEMALLOC_ATTR(tls_model("initial-exec")); # define ARENA_GET() arenas_tls # define ARENA_SET(v) do { \ arenas_tls = (v); \ - pthread_setspecific(arenas_tsd, (void *)(v)); \ } while (0) #else +extern pthread_key_t arenas_tsd; # define ARENA_GET() ((arena_t *)pthread_getspecific(arenas_tsd)) # define ARENA_SET(v) do { \ pthread_setspecific(arenas_tsd, (void *)(v)); \ @@ -328,28 +295,45 @@ extern arena_t **arenas; extern unsigned narenas; #ifdef JEMALLOC_STATS +typedef struct { + uint64_t allocated; + uint64_t deallocated; +} thread_allocated_t; # ifndef NO_TLS extern __thread thread_allocated_t thread_allocated_tls; -# define ALLOCATED_GET() (thread_allocated_tls.allocated) -# define ALLOCATEDP_GET() (&thread_allocated_tls.allocated) -# define DEALLOCATED_GET() (thread_allocated_tls.deallocated) -# define DEALLOCATEDP_GET() (&thread_allocated_tls.deallocated) +# define ALLOCATED_GET() thread_allocated_tls.allocated +# define DEALLOCATED_GET() thread_allocated_tls.deallocated # define ALLOCATED_ADD(a, d) do { \ thread_allocated_tls.allocated += a; \ thread_allocated_tls.deallocated += d; \ } while (0) # else extern pthread_key_t thread_allocated_tsd; -thread_allocated_t *thread_allocated_get_hard(void); - -# define ALLOCATED_GET() (thread_allocated_get()->allocated) -# define ALLOCATEDP_GET() (&thread_allocated_get()->allocated) -# define DEALLOCATED_GET() (thread_allocated_get()->deallocated) -# define DEALLOCATEDP_GET() (&thread_allocated_get()->deallocated) +# define ALLOCATED_GET() \ + (uint64_t)((pthread_getspecific(thread_allocated_tsd) != NULL) \ + ? ((thread_allocated_t *) \ + pthread_getspecific(thread_allocated_tsd))->allocated : 0) +# define DEALLOCATED_GET() \ + (uint64_t)((pthread_getspecific(thread_allocated_tsd) != NULL) \ + ? ((thread_allocated_t \ + *)pthread_getspecific(thread_allocated_tsd))->deallocated : \ + 0) # define ALLOCATED_ADD(a, d) do { \ - thread_allocated_t *thread_allocated = thread_allocated_get(); \ - thread_allocated->allocated += (a); \ - thread_allocated->deallocated += (d); \ + thread_allocated_t *thread_allocated = (thread_allocated_t *) \ + pthread_getspecific(thread_allocated_tsd); \ + if (thread_allocated != NULL) { \ + thread_allocated->allocated += (a); \ + thread_allocated->deallocated += (d); \ + } else { \ + thread_allocated = (thread_allocated_t *) \ + imalloc(sizeof(thread_allocated_t)); \ + if (thread_allocated != NULL) { \ + pthread_setspecific(thread_allocated_tsd, \ + thread_allocated); \ + thread_allocated->allocated = (a); \ + thread_allocated->deallocated = (d); \ + } \ + } \ } while (0) # endif #endif @@ -360,14 +344,12 @@ int buferror(int errnum, char *buf, size_t buflen); void jemalloc_prefork(void); void jemalloc_postfork(void); -#include "jemalloc/internal/atomic.h" #include "jemalloc/internal/jemprn.h" #include "jemalloc/internal/ckh.h" #include "jemalloc/internal/stats.h" #include "jemalloc/internal/ctl.h" #include "jemalloc/internal/mutex.h" #include "jemalloc/internal/mb.h" -#include "jemalloc/internal/bitmap.h" #include "jemalloc/internal/extent.h" #include "jemalloc/internal/arena.h" #include "jemalloc/internal/base.h" @@ -385,7 +367,6 @@ void jemalloc_postfork(void); /******************************************************************************/ #define JEMALLOC_H_INLINES -#include "jemalloc/internal/atomic.h" #include "jemalloc/internal/jemprn.h" #include "jemalloc/internal/ckh.h" #include "jemalloc/internal/stats.h" @@ -403,9 +384,6 @@ size_t s2u(size_t size); size_t sa2u(size_t size, size_t alignment, size_t *run_size_p); void malloc_write(const char *s); arena_t *choose_arena(void); -# if (defined(JEMALLOC_STATS) && defined(NO_TLS)) -thread_allocated_t *thread_allocated_get(void); -# endif #endif #if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_C_)) @@ -436,10 +414,10 @@ s2u(size_t size) { if (size <= small_maxclass) - return (arena_bin_info[SMALL_SIZE2BIN(size)].reg_size); + return arenas[0]->bins[small_size2bin[size]].reg_size; if (size <= arena_maxclass) - return (PAGE_CEILING(size)); - return (CHUNK_CEILING(size)); + return PAGE_CEILING(size); + return CHUNK_CEILING(size); } /* @@ -480,8 +458,10 @@ sa2u(size_t size, size_t alignment, size_t *run_size_p) } if (usize <= arena_maxclass && alignment <= PAGE_SIZE) { - if (usize <= small_maxclass) - return (arena_bin_info[SMALL_SIZE2BIN(usize)].reg_size); + if (usize <= small_maxclass) { + return + (arenas[0]->bins[small_size2bin[usize]].reg_size); + } return (PAGE_CEILING(usize)); } else { size_t run_size; @@ -564,22 +544,8 @@ choose_arena(void) return (ret); } - -#if (defined(JEMALLOC_STATS) && defined(NO_TLS)) -JEMALLOC_INLINE thread_allocated_t * -thread_allocated_get(void) -{ - thread_allocated_t *thread_allocated = (thread_allocated_t *) - pthread_getspecific(thread_allocated_tsd); - - if (thread_allocated == NULL) - return (thread_allocated_get_hard()); - return (thread_allocated); -} -#endif #endif -#include "jemalloc/internal/bitmap.h" #include "jemalloc/internal/rtree.h" #include "jemalloc/internal/tcache.h" #include "jemalloc/internal/arena.h" @@ -591,7 +557,7 @@ thread_allocated_get(void) #ifndef JEMALLOC_ENABLE_INLINE void *imalloc(size_t size); void *icalloc(size_t size); -void *ipalloc(size_t usize, size_t alignment, bool zero); +void *ipalloc(size_t size, size_t alignment, bool zero); size_t isalloc(const void *ptr); # ifdef JEMALLOC_IVSALLOC size_t ivsalloc(const void *ptr); @@ -625,39 +591,28 @@ icalloc(size_t size) } JEMALLOC_INLINE void * -ipalloc(size_t usize, size_t alignment, bool zero) +ipalloc(size_t size, size_t alignment, bool zero) { void *ret; + size_t usize; + size_t run_size +# ifdef JEMALLOC_CC_SILENCE + = 0 +# endif + ; - assert(usize != 0); - assert(usize == sa2u(usize, alignment, NULL)); - + usize = sa2u(size, alignment, &run_size); + if (usize == 0) + return (NULL); if (usize <= arena_maxclass && alignment <= PAGE_SIZE) ret = arena_malloc(usize, zero); - else { - size_t run_size -#ifdef JEMALLOC_CC_SILENCE - = 0 -#endif - ; - - /* - * Ideally we would only ever call sa2u() once per aligned - * allocation request, and the caller of this function has - * already done so once. However, it's rather burdensome to - * require every caller to pass in run_size, especially given - * that it's only relevant to large allocations. Therefore, - * just call it again here in order to get run_size. - */ - sa2u(usize, alignment, &run_size); - if (run_size <= arena_maxclass) { - ret = arena_palloc(choose_arena(), usize, run_size, - alignment, zero); - } else if (alignment <= chunksize) - ret = huge_malloc(usize, zero); - else - ret = huge_palloc(usize, alignment, zero); - } + else if (run_size <= arena_maxclass) { + ret = arena_palloc(choose_arena(), usize, run_size, alignment, + zero); + } else if (alignment <= chunksize) + ret = huge_malloc(usize, zero); + else + ret = huge_palloc(usize, alignment, zero); assert(((uintptr_t)ret & (alignment - 1)) == 0); return (ret); @@ -674,7 +629,7 @@ isalloc(const void *ptr) chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); if (chunk != ptr) { /* Region. */ - dassert(chunk->arena->magic == ARENA_MAGIC); + assert(chunk->arena->magic == ARENA_MAGIC); #ifdef JEMALLOC_PROF ret = arena_salloc_demote(ptr); @@ -728,7 +683,7 @@ iralloc(void *ptr, size_t size, size_t extra, size_t alignment, bool zero, if (alignment != 0 && ((uintptr_t)ptr & ((uintptr_t)alignment-1)) != 0) { - size_t usize, copysize; + size_t copysize; /* * Existing object alignment is inadquate; allocate new space @@ -736,18 +691,12 @@ iralloc(void *ptr, size_t size, size_t extra, size_t alignment, bool zero, */ if (no_move) return (NULL); - usize = sa2u(size + extra, alignment, NULL); - if (usize == 0) - return (NULL); - ret = ipalloc(usize, alignment, zero); + ret = ipalloc(size + extra, alignment, zero); if (ret == NULL) { if (extra == 0) return (NULL); /* Try again, without extra this time. */ - usize = sa2u(size, alignment, NULL); - if (usize == 0) - return (NULL); - ret = ipalloc(usize, alignment, zero); + ret = ipalloc(size, alignment, zero); if (ret == NULL) return (NULL); } diff --git a/dep/jemalloc/include/jemalloc/internal/mb.h b/dep/jemalloc/include/jemalloc/internal/mb.h index dc9f2a54262..1707aa91d68 100644 --- a/dep/jemalloc/include/jemalloc/internal/mb.h +++ b/dep/jemalloc/include/jemalloc/internal/mb.h @@ -17,7 +17,7 @@ void mb_write(void); #endif -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_MB_C_)) +#if (defined(JEMALLOC_ENABLE_INLINE) || defined(MB_C_)) #ifdef __i386__ /* * According to the Intel Architecture Software Developer's Manual, current diff --git a/dep/jemalloc/include/jemalloc/internal/mutex.h b/dep/jemalloc/include/jemalloc/internal/mutex.h index 62947ced55e..dcca01edd5d 100644 --- a/dep/jemalloc/include/jemalloc/internal/mutex.h +++ b/dep/jemalloc/include/jemalloc/internal/mutex.h @@ -1,11 +1,7 @@ /******************************************************************************/ #ifdef JEMALLOC_H_TYPES -#ifdef JEMALLOC_OSSPIN -typedef OSSpinLock malloc_mutex_t; -#else typedef pthread_mutex_t malloc_mutex_t; -#endif #ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP # define MALLOC_MUTEX_INITIALIZER PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP @@ -45,26 +41,17 @@ JEMALLOC_INLINE void malloc_mutex_lock(malloc_mutex_t *mutex) { - if (isthreaded) { -#ifdef JEMALLOC_OSSPIN - OSSpinLockLock(mutex); -#else + if (isthreaded) pthread_mutex_lock(mutex); -#endif - } } JEMALLOC_INLINE bool malloc_mutex_trylock(malloc_mutex_t *mutex) { - if (isthreaded) { -#ifdef JEMALLOC_OSSPIN - return (OSSpinLockTry(mutex) == false); -#else + if (isthreaded) return (pthread_mutex_trylock(mutex) != 0); -#endif - } else + else return (false); } @@ -72,13 +59,8 @@ JEMALLOC_INLINE void malloc_mutex_unlock(malloc_mutex_t *mutex) { - if (isthreaded) { -#ifdef JEMALLOC_OSSPIN - OSSpinLockUnlock(mutex); -#else + if (isthreaded) pthread_mutex_unlock(mutex); -#endif - } } #endif diff --git a/dep/jemalloc/include/jemalloc/internal/private_namespace.h b/dep/jemalloc/include/jemalloc/internal/private_namespace.h deleted file mode 100644 index d4f5f96d7b2..00000000000 --- a/dep/jemalloc/include/jemalloc/internal/private_namespace.h +++ /dev/null @@ -1,195 +0,0 @@ -#define arena_bin_index JEMALLOC_N(arena_bin_index) -#define arena_boot JEMALLOC_N(arena_boot) -#define arena_dalloc JEMALLOC_N(arena_dalloc) -#define arena_dalloc_bin JEMALLOC_N(arena_dalloc_bin) -#define arena_dalloc_large JEMALLOC_N(arena_dalloc_large) -#define arena_malloc JEMALLOC_N(arena_malloc) -#define arena_malloc_large JEMALLOC_N(arena_malloc_large) -#define arena_malloc_small JEMALLOC_N(arena_malloc_small) -#define arena_new JEMALLOC_N(arena_new) -#define arena_palloc JEMALLOC_N(arena_palloc) -#define arena_prof_accum JEMALLOC_N(arena_prof_accum) -#define arena_prof_ctx_get JEMALLOC_N(arena_prof_ctx_get) -#define arena_prof_ctx_set JEMALLOC_N(arena_prof_ctx_set) -#define arena_prof_promoted JEMALLOC_N(arena_prof_promoted) -#define arena_purge_all JEMALLOC_N(arena_purge_all) -#define arena_ralloc JEMALLOC_N(arena_ralloc) -#define arena_ralloc_no_move JEMALLOC_N(arena_ralloc_no_move) -#define arena_run_regind JEMALLOC_N(arena_run_regind) -#define arena_salloc JEMALLOC_N(arena_salloc) -#define arena_salloc_demote JEMALLOC_N(arena_salloc_demote) -#define arena_stats_merge JEMALLOC_N(arena_stats_merge) -#define arena_tcache_fill_small JEMALLOC_N(arena_tcache_fill_small) -#define arenas_bin_i_index JEMALLOC_N(arenas_bin_i_index) -#define arenas_extend JEMALLOC_N(arenas_extend) -#define arenas_lrun_i_index JEMALLOC_N(arenas_lrun_i_index) -#define atomic_add_uint32 JEMALLOC_N(atomic_add_uint32) -#define atomic_add_uint64 JEMALLOC_N(atomic_add_uint64) -#define atomic_sub_uint32 JEMALLOC_N(atomic_sub_uint32) -#define atomic_sub_uint64 JEMALLOC_N(atomic_sub_uint64) -#define base_alloc JEMALLOC_N(base_alloc) -#define base_boot JEMALLOC_N(base_boot) -#define base_node_alloc JEMALLOC_N(base_node_alloc) -#define base_node_dealloc JEMALLOC_N(base_node_dealloc) -#define bitmap_full JEMALLOC_N(bitmap_full) -#define bitmap_get JEMALLOC_N(bitmap_get) -#define bitmap_info_init JEMALLOC_N(bitmap_info_init) -#define bitmap_info_ngroups JEMALLOC_N(bitmap_info_ngroups) -#define bitmap_init JEMALLOC_N(bitmap_init) -#define bitmap_set JEMALLOC_N(bitmap_set) -#define bitmap_sfu JEMALLOC_N(bitmap_sfu) -#define bitmap_size JEMALLOC_N(bitmap_size) -#define bitmap_unset JEMALLOC_N(bitmap_unset) -#define bt_init JEMALLOC_N(bt_init) -#define buferror JEMALLOC_N(buferror) -#define choose_arena JEMALLOC_N(choose_arena) -#define choose_arena_hard JEMALLOC_N(choose_arena_hard) -#define chunk_alloc JEMALLOC_N(chunk_alloc) -#define chunk_alloc_dss JEMALLOC_N(chunk_alloc_dss) -#define chunk_alloc_mmap JEMALLOC_N(chunk_alloc_mmap) -#define chunk_alloc_mmap_noreserve JEMALLOC_N(chunk_alloc_mmap_noreserve) -#define chunk_alloc_swap JEMALLOC_N(chunk_alloc_swap) -#define chunk_boot JEMALLOC_N(chunk_boot) -#define chunk_dealloc JEMALLOC_N(chunk_dealloc) -#define chunk_dealloc_dss JEMALLOC_N(chunk_dealloc_dss) -#define chunk_dealloc_mmap JEMALLOC_N(chunk_dealloc_mmap) -#define chunk_dealloc_swap JEMALLOC_N(chunk_dealloc_swap) -#define chunk_dss_boot JEMALLOC_N(chunk_dss_boot) -#define chunk_in_dss JEMALLOC_N(chunk_in_dss) -#define chunk_in_swap JEMALLOC_N(chunk_in_swap) -#define chunk_mmap_boot JEMALLOC_N(chunk_mmap_boot) -#define chunk_swap_boot JEMALLOC_N(chunk_swap_boot) -#define chunk_swap_enable JEMALLOC_N(chunk_swap_enable) -#define ckh_bucket_search JEMALLOC_N(ckh_bucket_search) -#define ckh_count JEMALLOC_N(ckh_count) -#define ckh_delete JEMALLOC_N(ckh_delete) -#define ckh_evict_reloc_insert JEMALLOC_N(ckh_evict_reloc_insert) -#define ckh_insert JEMALLOC_N(ckh_insert) -#define ckh_isearch JEMALLOC_N(ckh_isearch) -#define ckh_iter JEMALLOC_N(ckh_iter) -#define ckh_new JEMALLOC_N(ckh_new) -#define ckh_pointer_hash JEMALLOC_N(ckh_pointer_hash) -#define ckh_pointer_keycomp JEMALLOC_N(ckh_pointer_keycomp) -#define ckh_rebuild JEMALLOC_N(ckh_rebuild) -#define ckh_remove JEMALLOC_N(ckh_remove) -#define ckh_search JEMALLOC_N(ckh_search) -#define ckh_string_hash JEMALLOC_N(ckh_string_hash) -#define ckh_string_keycomp JEMALLOC_N(ckh_string_keycomp) -#define ckh_try_bucket_insert JEMALLOC_N(ckh_try_bucket_insert) -#define ckh_try_insert JEMALLOC_N(ckh_try_insert) -#define create_zone JEMALLOC_N(create_zone) -#define ctl_boot JEMALLOC_N(ctl_boot) -#define ctl_bymib JEMALLOC_N(ctl_bymib) -#define ctl_byname JEMALLOC_N(ctl_byname) -#define ctl_nametomib JEMALLOC_N(ctl_nametomib) -#define extent_tree_ad_first JEMALLOC_N(extent_tree_ad_first) -#define extent_tree_ad_insert JEMALLOC_N(extent_tree_ad_insert) -#define extent_tree_ad_iter JEMALLOC_N(extent_tree_ad_iter) -#define extent_tree_ad_iter_recurse JEMALLOC_N(extent_tree_ad_iter_recurse) -#define extent_tree_ad_iter_start JEMALLOC_N(extent_tree_ad_iter_start) -#define extent_tree_ad_last JEMALLOC_N(extent_tree_ad_last) -#define extent_tree_ad_new JEMALLOC_N(extent_tree_ad_new) -#define extent_tree_ad_next JEMALLOC_N(extent_tree_ad_next) -#define extent_tree_ad_nsearch JEMALLOC_N(extent_tree_ad_nsearch) -#define extent_tree_ad_prev JEMALLOC_N(extent_tree_ad_prev) -#define extent_tree_ad_psearch JEMALLOC_N(extent_tree_ad_psearch) -#define extent_tree_ad_remove JEMALLOC_N(extent_tree_ad_remove) -#define extent_tree_ad_reverse_iter JEMALLOC_N(extent_tree_ad_reverse_iter) -#define extent_tree_ad_reverse_iter_recurse JEMALLOC_N(extent_tree_ad_reverse_iter_recurse) -#define extent_tree_ad_reverse_iter_start JEMALLOC_N(extent_tree_ad_reverse_iter_start) -#define extent_tree_ad_search JEMALLOC_N(extent_tree_ad_search) -#define extent_tree_szad_first JEMALLOC_N(extent_tree_szad_first) -#define extent_tree_szad_insert JEMALLOC_N(extent_tree_szad_insert) -#define extent_tree_szad_iter JEMALLOC_N(extent_tree_szad_iter) -#define extent_tree_szad_iter_recurse JEMALLOC_N(extent_tree_szad_iter_recurse) -#define extent_tree_szad_iter_start JEMALLOC_N(extent_tree_szad_iter_start) -#define extent_tree_szad_last JEMALLOC_N(extent_tree_szad_last) -#define extent_tree_szad_new JEMALLOC_N(extent_tree_szad_new) -#define extent_tree_szad_next JEMALLOC_N(extent_tree_szad_next) -#define extent_tree_szad_nsearch JEMALLOC_N(extent_tree_szad_nsearch) -#define extent_tree_szad_prev JEMALLOC_N(extent_tree_szad_prev) -#define extent_tree_szad_psearch JEMALLOC_N(extent_tree_szad_psearch) -#define extent_tree_szad_remove JEMALLOC_N(extent_tree_szad_remove) -#define extent_tree_szad_reverse_iter JEMALLOC_N(extent_tree_szad_reverse_iter) -#define extent_tree_szad_reverse_iter_recurse JEMALLOC_N(extent_tree_szad_reverse_iter_recurse) -#define extent_tree_szad_reverse_iter_start JEMALLOC_N(extent_tree_szad_reverse_iter_start) -#define extent_tree_szad_search JEMALLOC_N(extent_tree_szad_search) -#define hash JEMALLOC_N(hash) -#define huge_boot JEMALLOC_N(huge_boot) -#define huge_dalloc JEMALLOC_N(huge_dalloc) -#define huge_malloc JEMALLOC_N(huge_malloc) -#define huge_palloc JEMALLOC_N(huge_palloc) -#define huge_prof_ctx_get JEMALLOC_N(huge_prof_ctx_get) -#define huge_prof_ctx_set JEMALLOC_N(huge_prof_ctx_set) -#define huge_ralloc JEMALLOC_N(huge_ralloc) -#define huge_ralloc_no_move JEMALLOC_N(huge_ralloc_no_move) -#define huge_salloc JEMALLOC_N(huge_salloc) -#define iallocm JEMALLOC_N(iallocm) -#define icalloc JEMALLOC_N(icalloc) -#define idalloc JEMALLOC_N(idalloc) -#define imalloc JEMALLOC_N(imalloc) -#define ipalloc JEMALLOC_N(ipalloc) -#define iralloc JEMALLOC_N(iralloc) -#define isalloc JEMALLOC_N(isalloc) -#define ivsalloc JEMALLOC_N(ivsalloc) -#define jemalloc_darwin_init JEMALLOC_N(jemalloc_darwin_init) -#define jemalloc_postfork JEMALLOC_N(jemalloc_postfork) -#define jemalloc_prefork JEMALLOC_N(jemalloc_prefork) -#define malloc_cprintf JEMALLOC_N(malloc_cprintf) -#define malloc_mutex_destroy JEMALLOC_N(malloc_mutex_destroy) -#define malloc_mutex_init JEMALLOC_N(malloc_mutex_init) -#define malloc_mutex_lock JEMALLOC_N(malloc_mutex_lock) -#define malloc_mutex_trylock JEMALLOC_N(malloc_mutex_trylock) -#define malloc_mutex_unlock JEMALLOC_N(malloc_mutex_unlock) -#define malloc_printf JEMALLOC_N(malloc_printf) -#define malloc_write JEMALLOC_N(malloc_write) -#define mb_write JEMALLOC_N(mb_write) -#define pow2_ceil JEMALLOC_N(pow2_ceil) -#define prof_backtrace JEMALLOC_N(prof_backtrace) -#define prof_boot0 JEMALLOC_N(prof_boot0) -#define prof_boot1 JEMALLOC_N(prof_boot1) -#define prof_boot2 JEMALLOC_N(prof_boot2) -#define prof_ctx_get JEMALLOC_N(prof_ctx_get) -#define prof_ctx_set JEMALLOC_N(prof_ctx_set) -#define prof_free JEMALLOC_N(prof_free) -#define prof_gdump JEMALLOC_N(prof_gdump) -#define prof_idump JEMALLOC_N(prof_idump) -#define prof_lookup JEMALLOC_N(prof_lookup) -#define prof_malloc JEMALLOC_N(prof_malloc) -#define prof_mdump JEMALLOC_N(prof_mdump) -#define prof_realloc JEMALLOC_N(prof_realloc) -#define prof_sample_accum_update JEMALLOC_N(prof_sample_accum_update) -#define prof_sample_threshold_update JEMALLOC_N(prof_sample_threshold_update) -#define prof_tdata_init JEMALLOC_N(prof_tdata_init) -#define pthread_create JEMALLOC_N(pthread_create) -#define rtree_get JEMALLOC_N(rtree_get) -#define rtree_get_locked JEMALLOC_N(rtree_get_locked) -#define rtree_new JEMALLOC_N(rtree_new) -#define rtree_set JEMALLOC_N(rtree_set) -#define s2u JEMALLOC_N(s2u) -#define sa2u JEMALLOC_N(sa2u) -#define stats_arenas_i_bins_j_index JEMALLOC_N(stats_arenas_i_bins_j_index) -#define stats_arenas_i_index JEMALLOC_N(stats_arenas_i_index) -#define stats_arenas_i_lruns_j_index JEMALLOC_N(stats_arenas_i_lruns_j_index) -#define stats_cactive_add JEMALLOC_N(stats_cactive_add) -#define stats_cactive_get JEMALLOC_N(stats_cactive_get) -#define stats_cactive_sub JEMALLOC_N(stats_cactive_sub) -#define stats_print JEMALLOC_N(stats_print) -#define szone2ozone JEMALLOC_N(szone2ozone) -#define tcache_alloc_easy JEMALLOC_N(tcache_alloc_easy) -#define tcache_alloc_large JEMALLOC_N(tcache_alloc_large) -#define tcache_alloc_small JEMALLOC_N(tcache_alloc_small) -#define tcache_alloc_small_hard JEMALLOC_N(tcache_alloc_small_hard) -#define tcache_bin_flush_large JEMALLOC_N(tcache_bin_flush_large) -#define tcache_bin_flush_small JEMALLOC_N(tcache_bin_flush_small) -#define tcache_boot JEMALLOC_N(tcache_boot) -#define tcache_create JEMALLOC_N(tcache_create) -#define tcache_dalloc_large JEMALLOC_N(tcache_dalloc_large) -#define tcache_dalloc_small JEMALLOC_N(tcache_dalloc_small) -#define tcache_destroy JEMALLOC_N(tcache_destroy) -#define tcache_event JEMALLOC_N(tcache_event) -#define tcache_get JEMALLOC_N(tcache_get) -#define tcache_stats_merge JEMALLOC_N(tcache_stats_merge) -#define thread_allocated_get JEMALLOC_N(thread_allocated_get) -#define thread_allocated_get_hard JEMALLOC_N(thread_allocated_get_hard) -#define u2s JEMALLOC_N(u2s) diff --git a/dep/jemalloc/include/jemalloc/internal/prof.h b/dep/jemalloc/include/jemalloc/internal/prof.h index e9064ba6e73..7864000b88b 100644 --- a/dep/jemalloc/include/jemalloc/internal/prof.h +++ b/dep/jemalloc/include/jemalloc/internal/prof.h @@ -227,60 +227,9 @@ bool prof_boot2(void); /******************************************************************************/ #ifdef JEMALLOC_H_INLINES -#define PROF_ALLOC_PREP(nignore, size, ret) do { \ - prof_tdata_t *prof_tdata; \ - prof_bt_t bt; \ - \ - assert(size == s2u(size)); \ - \ - prof_tdata = PROF_TCACHE_GET(); \ - if (prof_tdata == NULL) { \ - prof_tdata = prof_tdata_init(); \ - if (prof_tdata == NULL) { \ - ret = NULL; \ - break; \ - } \ - } \ - \ - if (opt_prof_active == false) { \ - /* Sampling is currently inactive, so avoid sampling. */\ - ret = (prof_thr_cnt_t *)(uintptr_t)1U; \ - } else if (opt_lg_prof_sample == 0) { \ - /* Don't bother with sampling logic, since sampling */\ - /* interval is 1. */\ - bt_init(&bt, prof_tdata->vec); \ - prof_backtrace(&bt, nignore, prof_bt_max); \ - ret = prof_lookup(&bt); \ - } else { \ - if (prof_tdata->threshold == 0) { \ - /* Initialize. Seed the prng differently for */\ - /* each thread. */\ - prof_tdata->prn_state = \ - (uint64_t)(uintptr_t)&size; \ - prof_sample_threshold_update(prof_tdata); \ - } \ - \ - /* Determine whether to capture a backtrace based on */\ - /* whether size is enough for prof_accum to reach */\ - /* prof_tdata->threshold. However, delay updating */\ - /* these variables until prof_{m,re}alloc(), because */\ - /* we don't know for sure that the allocation will */\ - /* succeed. */\ - /* */\ - /* Use subtraction rather than addition to avoid */\ - /* potential integer overflow. */\ - if (size >= prof_tdata->threshold - \ - prof_tdata->accum) { \ - bt_init(&bt, prof_tdata->vec); \ - prof_backtrace(&bt, nignore, prof_bt_max); \ - ret = prof_lookup(&bt); \ - } else \ - ret = (prof_thr_cnt_t *)(uintptr_t)1U; \ - } \ -} while (0) - #ifndef JEMALLOC_ENABLE_INLINE void prof_sample_threshold_update(prof_tdata_t *prof_tdata); +prof_thr_cnt_t *prof_alloc_prep(size_t size); prof_ctx_t *prof_ctx_get(const void *ptr); void prof_ctx_set(const void *ptr, prof_ctx_t *ctx); bool prof_sample_accum_update(size_t size); @@ -298,22 +247,8 @@ prof_sample_threshold_update(prof_tdata_t *prof_tdata) double u; /* - * Compute sample threshold as a geometrically distributed random + * Compute prof_sample_threshold as a geometrically distributed random * variable with mean (2^opt_lg_prof_sample). - * - * __ __ - * | log(u) | 1 - * prof_tdata->threshold = | -------- |, where p = ------------------- - * | log(1-p) | opt_lg_prof_sample - * 2 - * - * For more information on the math, see: - * - * Non-Uniform Random Variate Generation - * Luc Devroye - * Springer-Verlag, New York, 1986 - * pp 500 - * (http://cg.scs.carleton.ca/~luc/rnbookindex.html) */ prn64(r, 53, prof_tdata->prn_state, (uint64_t)6364136223846793005LLU, (uint64_t)1442695040888963407LLU); @@ -323,6 +258,71 @@ prof_sample_threshold_update(prof_tdata_t *prof_tdata) + (uint64_t)1U; } +JEMALLOC_INLINE prof_thr_cnt_t * +prof_alloc_prep(size_t size) +{ +#ifdef JEMALLOC_ENABLE_INLINE + /* This function does not have its own stack frame, because it is inlined. */ +# define NIGNORE 1 +#else +# define NIGNORE 2 +#endif + prof_thr_cnt_t *ret; + prof_tdata_t *prof_tdata; + prof_bt_t bt; + + assert(size == s2u(size)); + + prof_tdata = PROF_TCACHE_GET(); + if (prof_tdata == NULL) { + prof_tdata = prof_tdata_init(); + if (prof_tdata == NULL) + return (NULL); + } + + if (opt_prof_active == false) { + /* Sampling is currently inactive, so avoid sampling. */ + ret = (prof_thr_cnt_t *)(uintptr_t)1U; + } else if (opt_lg_prof_sample == 0) { + /* + * Don't bother with sampling logic, since sampling interval is + * 1. + */ + bt_init(&bt, prof_tdata->vec); + prof_backtrace(&bt, NIGNORE, prof_bt_max); + ret = prof_lookup(&bt); + } else { + if (prof_tdata->threshold == 0) { + /* + * Initialize. Seed the prng differently for each + * thread. + */ + prof_tdata->prn_state = (uint64_t)(uintptr_t)&size; + prof_sample_threshold_update(prof_tdata); + } + + /* + * Determine whether to capture a backtrace based on whether + * size is enough for prof_accum to reach + * prof_tdata->threshold. However, delay updating these + * variables until prof_{m,re}alloc(), because we don't know + * for sure that the allocation will succeed. + * + * Use subtraction rather than addition to avoid potential + * integer overflow. + */ + if (size >= prof_tdata->threshold - prof_tdata->accum) { + bt_init(&bt, prof_tdata->vec); + prof_backtrace(&bt, NIGNORE, prof_bt_max); + ret = prof_lookup(&bt); + } else + ret = (prof_thr_cnt_t *)(uintptr_t)1U; + } + + return (ret); +#undef NIGNORE +} + JEMALLOC_INLINE prof_ctx_t * prof_ctx_get(const void *ptr) { @@ -334,7 +334,7 @@ prof_ctx_get(const void *ptr) chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); if (chunk != ptr) { /* Region. */ - dassert(chunk->arena->magic == ARENA_MAGIC); + assert(chunk->arena->magic == ARENA_MAGIC); ret = arena_prof_ctx_get(ptr); } else @@ -353,7 +353,7 @@ prof_ctx_set(const void *ptr, prof_ctx_t *ctx) chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); if (chunk != ptr) { /* Region. */ - dassert(chunk->arena->magic == ARENA_MAGIC); + assert(chunk->arena->magic == ARENA_MAGIC); arena_prof_ctx_set(ptr, ctx); } else @@ -374,7 +374,7 @@ prof_sample_accum_update(size_t size) /* Take care to avoid integer overflow. */ if (size >= prof_tdata->threshold - prof_tdata->accum) { prof_tdata->accum -= (prof_tdata->threshold - size); - /* Compute new sample threshold. */ + /* Compute new prof_sample_threshold. */ prof_sample_threshold_update(prof_tdata); while (prof_tdata->accum >= prof_tdata->threshold) { prof_tdata->accum -= prof_tdata->threshold; @@ -401,7 +401,7 @@ prof_malloc(const void *ptr, size_t size, prof_thr_cnt_t *cnt) * always possible to tell in advance how large an * object's usable size will be, so there should never * be a difference between the size passed to - * PROF_ALLOC_PREP() and prof_malloc(). + * prof_alloc_prep() and prof_malloc(). */ assert((uintptr_t)cnt == (uintptr_t)1U); } @@ -445,7 +445,7 @@ prof_realloc(const void *ptr, size_t size, prof_thr_cnt_t *cnt, if (prof_sample_accum_update(size)) { /* * Don't sample. The size passed to - * PROF_ALLOC_PREP() was larger than what + * prof_alloc_prep() was larger than what * actually got allocated, so a backtrace was * captured for this allocation, even though * its actual size was insufficient to cross diff --git a/dep/jemalloc/include/jemalloc/internal/rtree.h b/dep/jemalloc/include/jemalloc/internal/rtree.h index 95d6355a5f4..9d58ebac545 100644 --- a/dep/jemalloc/include/jemalloc/internal/rtree.h +++ b/dep/jemalloc/include/jemalloc/internal/rtree.h @@ -49,7 +49,7 @@ void *rtree_get(rtree_t *rtree, uintptr_t key); bool rtree_set(rtree_t *rtree, uintptr_t key, void *val); #endif -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_RTREE_C_)) +#if (defined(JEMALLOC_ENABLE_INLINE) || defined(RTREE_C_)) #define RTREE_GET_GENERATE(f) \ /* The least significant bits of the key are ignored. */ \ JEMALLOC_INLINE void * \ diff --git a/dep/jemalloc/include/jemalloc/internal/stats.h b/dep/jemalloc/include/jemalloc/internal/stats.h index 2a9b31d9ffc..3fc2080a34b 100644 --- a/dep/jemalloc/include/jemalloc/internal/stats.h +++ b/dep/jemalloc/include/jemalloc/internal/stats.h @@ -154,10 +154,6 @@ struct chunk_stats_s { extern bool opt_stats_print; -#ifdef JEMALLOC_STATS -extern size_t stats_cactive; -#endif - char *u2s(uint64_t x, unsigned base, char *s); #ifdef JEMALLOC_STATS void malloc_cprintf(void (*write)(void *, const char *), void *cbopaque, @@ -170,38 +166,9 @@ void stats_print(void (*write)(void *, const char *), void *cbopaque, #endif /* JEMALLOC_H_EXTERNS */ /******************************************************************************/ -#ifdef JEMALLOC_H_INLINES #ifdef JEMALLOC_STATS +#ifdef JEMALLOC_H_INLINES -#ifndef JEMALLOC_ENABLE_INLINE -size_t stats_cactive_get(void); -void stats_cactive_add(size_t size); -void stats_cactive_sub(size_t size); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_STATS_C_)) -JEMALLOC_INLINE size_t -stats_cactive_get(void) -{ - - return (atomic_read_z(&stats_cactive)); -} - -JEMALLOC_INLINE void -stats_cactive_add(size_t size) -{ - - atomic_add_z(&stats_cactive, size); -} - -JEMALLOC_INLINE void -stats_cactive_sub(size_t size) -{ - - atomic_sub_z(&stats_cactive, size); -} -#endif - -#endif /* JEMALLOC_STATS */ #endif /* JEMALLOC_H_INLINES */ +#endif /* JEMALLOC_STATS */ /******************************************************************************/ diff --git a/dep/jemalloc/include/jemalloc/internal/tcache.h b/dep/jemalloc/include/jemalloc/internal/tcache.h index da3c68c5770..1ad91a9b1e0 100644 --- a/dep/jemalloc/include/jemalloc/internal/tcache.h +++ b/dep/jemalloc/include/jemalloc/internal/tcache.h @@ -2,7 +2,6 @@ /******************************************************************************/ #ifdef JEMALLOC_H_TYPES -typedef struct tcache_bin_info_s tcache_bin_info_t; typedef struct tcache_bin_s tcache_bin_t; typedef struct tcache_s tcache_t; @@ -33,22 +32,15 @@ typedef struct tcache_s tcache_t; /******************************************************************************/ #ifdef JEMALLOC_H_STRUCTS -/* - * Read-only information associated with each element of tcache_t's tbins array - * is stored separately, mainly to reduce memory usage. - */ -struct tcache_bin_info_s { - unsigned ncached_max; /* Upper limit on ncached. */ -}; - struct tcache_bin_s { # ifdef JEMALLOC_STATS tcache_bin_stats_t tstats; # endif - int low_water; /* Min # cached since last GC. */ - unsigned lg_fill_div; /* Fill (ncached_max >> lg_fill_div). */ + unsigned low_water; /* Min # cached since last GC. */ + unsigned high_water; /* Max # cached since last GC. */ unsigned ncached; /* # of cached objects. */ - void **avail; /* Stack of available objects. */ + unsigned ncached_max; /* Upper limit on ncached. */ + void *avail; /* Chain of available objects. */ }; struct tcache_s { @@ -62,12 +54,6 @@ struct tcache_s { unsigned ev_cnt; /* Event count since incremental GC. */ unsigned next_gc_bin; /* Next bin to GC. */ tcache_bin_t tbins[1]; /* Dynamically sized. */ - /* - * The pointer stacks associated with tbins follow as a contiguous - * array. During tcache initialization, the avail pointer in each - * element of tbins is initialized to point to the proper offset within - * this array. - */ }; #endif /* JEMALLOC_H_STRUCTS */ @@ -78,8 +64,6 @@ extern bool opt_tcache; extern ssize_t opt_lg_tcache_max; extern ssize_t opt_lg_tcache_gc_sweep; -extern tcache_bin_info_t *tcache_bin_info; - /* Map of thread-specific caches. */ #ifndef NO_TLS extern __thread tcache_t *tcache_tls @@ -126,7 +110,7 @@ void tcache_destroy(tcache_t *tcache); #ifdef JEMALLOC_STATS void tcache_stats_merge(tcache_t *tcache, arena_t *arena); #endif -bool tcache_boot(void); +void tcache_boot(void); #endif /* JEMALLOC_H_EXTERNS */ /******************************************************************************/ @@ -185,7 +169,6 @@ tcache_event(tcache_t *tcache) if (tcache->ev_cnt == tcache_gc_incr) { size_t binind = tcache->next_gc_bin; tcache_bin_t *tbin = &tcache->tbins[binind]; - tcache_bin_info_t *tbin_info = &tcache_bin_info[binind]; if (tbin->low_water > 0) { /* @@ -209,22 +192,9 @@ tcache_event(tcache_t *tcache) #endif ); } - /* - * Reduce fill count by 2X. Limit lg_fill_div such that - * the fill count is always at least 1. - */ - if ((tbin_info->ncached_max >> (tbin->lg_fill_div+1)) - >= 1) - tbin->lg_fill_div++; - } else if (tbin->low_water < 0) { - /* - * Increase fill count by 2X. Make sure lg_fill_div - * stays greater than 0. - */ - if (tbin->lg_fill_div > 1) - tbin->lg_fill_div--; } tbin->low_water = tbin->ncached; + tbin->high_water = tbin->ncached; tcache->next_gc_bin++; if (tcache->next_gc_bin == nhbins) @@ -238,14 +208,13 @@ tcache_alloc_easy(tcache_bin_t *tbin) { void *ret; - if (tbin->ncached == 0) { - tbin->low_water = -1; + if (tbin->ncached == 0) return (NULL); - } tbin->ncached--; - if ((int)tbin->ncached < tbin->low_water) + if (tbin->ncached < tbin->low_water) tbin->low_water = tbin->ncached; - ret = tbin->avail[tbin->ncached]; + ret = tbin->avail; + tbin->avail = *(void **)ret; return (ret); } @@ -256,7 +225,7 @@ tcache_alloc_small(tcache_t *tcache, size_t size, bool zero) size_t binind; tcache_bin_t *tbin; - binind = SMALL_SIZE2BIN(size); + binind = small_size2bin[size]; assert(binind < nbins); tbin = &tcache->tbins[binind]; ret = tcache_alloc_easy(tbin); @@ -265,7 +234,7 @@ tcache_alloc_small(tcache_t *tcache, size_t size, bool zero) if (ret == NULL) return (NULL); } - assert(arena_salloc(ret) == arena_bin_info[binind].reg_size); + assert(arena_salloc(ret) == tcache->arena->bins[binind].reg_size); if (zero == false) { #ifdef JEMALLOC_FILL @@ -281,7 +250,7 @@ tcache_alloc_small(tcache_t *tcache, size_t size, bool zero) tbin->tstats.nrequests++; #endif #ifdef JEMALLOC_PROF - tcache->prof_accumbytes += arena_bin_info[binind].reg_size; + tcache->prof_accumbytes += tcache->arena->bins[binind].reg_size; #endif tcache_event(tcache); return (ret); @@ -345,7 +314,6 @@ tcache_dalloc_small(tcache_t *tcache, void *ptr) arena_run_t *run; arena_bin_t *bin; tcache_bin_t *tbin; - tcache_bin_info_t *tbin_info; size_t pageind, binind; arena_chunk_map_t *mapelm; @@ -357,7 +325,7 @@ tcache_dalloc_small(tcache_t *tcache, void *ptr) mapelm = &chunk->map[pageind-map_bias]; run = (arena_run_t *)((uintptr_t)chunk + (uintptr_t)((pageind - (mapelm->bits >> PAGE_SHIFT)) << PAGE_SHIFT)); - dassert(run->magic == ARENA_RUN_MAGIC); + assert(run->magic == ARENA_RUN_MAGIC); bin = run->bin; binind = ((uintptr_t)bin - (uintptr_t)&arena->bins) / sizeof(arena_bin_t); @@ -365,22 +333,23 @@ tcache_dalloc_small(tcache_t *tcache, void *ptr) #ifdef JEMALLOC_FILL if (opt_junk) - memset(ptr, 0x5a, arena_bin_info[binind].reg_size); + memset(ptr, 0x5a, bin->reg_size); #endif tbin = &tcache->tbins[binind]; - tbin_info = &tcache_bin_info[binind]; - if (tbin->ncached == tbin_info->ncached_max) { - tcache_bin_flush_small(tbin, binind, (tbin_info->ncached_max >> - 1) + if (tbin->ncached == tbin->ncached_max) { + tcache_bin_flush_small(tbin, binind, (tbin->ncached_max >> 1) #if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) , tcache #endif ); } - assert(tbin->ncached < tbin_info->ncached_max); - tbin->avail[tbin->ncached] = ptr; + assert(tbin->ncached < tbin->ncached_max); + *(void **)ptr = tbin->avail; + tbin->avail = ptr; tbin->ncached++; + if (tbin->ncached > tbin->high_water) + tbin->high_water = tbin->ncached; tcache_event(tcache); } @@ -392,7 +361,6 @@ tcache_dalloc_large(tcache_t *tcache, void *ptr, size_t size) arena_chunk_t *chunk; size_t pageind, binind; tcache_bin_t *tbin; - tcache_bin_info_t *tbin_info; assert((size & PAGE_MASK) == 0); assert(arena_salloc(ptr) > small_maxclass); @@ -409,18 +377,19 @@ tcache_dalloc_large(tcache_t *tcache, void *ptr, size_t size) #endif tbin = &tcache->tbins[binind]; - tbin_info = &tcache_bin_info[binind]; - if (tbin->ncached == tbin_info->ncached_max) { - tcache_bin_flush_large(tbin, binind, (tbin_info->ncached_max >> - 1) + if (tbin->ncached == tbin->ncached_max) { + tcache_bin_flush_large(tbin, binind, (tbin->ncached_max >> 1) #if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) , tcache #endif ); } - assert(tbin->ncached < tbin_info->ncached_max); - tbin->avail[tbin->ncached] = ptr; + assert(tbin->ncached < tbin->ncached_max); + *(void **)ptr = tbin->avail; + tbin->avail = ptr; tbin->ncached++; + if (tbin->ncached > tbin->high_water) + tbin->high_water = tbin->ncached; tcache_event(tcache); } diff --git a/dep/jemalloc/include/jemalloc/jemalloc.h b/dep/jemalloc/include/jemalloc/jemalloc.h index 3842e28115e..287dac46ed2 100644 --- a/dep/jemalloc/include/jemalloc/jemalloc.h +++ b/dep/jemalloc/include/jemalloc/jemalloc.h @@ -7,19 +7,19 @@ extern "C" { #include #include -#define JEMALLOC_VERSION "2.2.5-0-gfc1bb70e5f0d9a58b39efa39cc549b5af5104760" +#define JEMALLOC_VERSION "2.1.0-0-g1c4b088b08d3bc7617a34387e196ce03716160bf" #define JEMALLOC_VERSION_MAJOR 2 -#define JEMALLOC_VERSION_MINOR 2 -#define JEMALLOC_VERSION_BUGFIX 5 +#define JEMALLOC_VERSION_MINOR 1 +#define JEMALLOC_VERSION_BUGFIX 0 #define JEMALLOC_VERSION_NREV 0 -#define JEMALLOC_VERSION_GID "fc1bb70e5f0d9a58b39efa39cc549b5af5104760" +#define JEMALLOC_VERSION_GID "1c4b088b08d3bc7617a34387e196ce03716160bf" #include "jemalloc_defs.h" #ifndef JEMALLOC_P # define JEMALLOC_P(s) s #endif -#define ALLOCM_LG_ALIGN(la) (la) +#define ALLOCM_LG_ALIGN ((int)0x3f) #if LG_SIZEOF_PTR == 2 #define ALLOCM_ALIGN(a) (ffs(a)-1) #else diff --git a/dep/jemalloc/include/jemalloc/jemalloc_defs.h b/dep/jemalloc/include/jemalloc/jemalloc_defs.h index f0f8fa71a4d..a641b56da03 100644 --- a/dep/jemalloc/include/jemalloc/jemalloc_defs.h +++ b/dep/jemalloc/include/jemalloc/jemalloc_defs.h @@ -19,33 +19,12 @@ /* #undef JEMALLOC_P */ #endif -/* - * JEMALLOC_PRIVATE_NAMESPACE is used as a prefix for all library-private APIs. - * For shared libraries, symbol visibility mechanisms prevent these symbols - * from being exported, but for static libraries, naming collisions are a real - * possibility. - */ -#define JEMALLOC_PRIVATE_NAMESPACE "" -#define JEMALLOC_N(string_that_no_one_should_want_to_use_as_a_jemalloc_private_namespace_prefix) string_that_no_one_should_want_to_use_as_a_jemalloc_private_namespace_prefix - /* * Hyper-threaded CPUs may need a special instruction inside spin loops in * order to yield to another virtual CPU. */ #define CPU_SPINWAIT __asm__ volatile("pause") -/* - * Defined if OSAtomic*() functions are available, as provided by Darwin, and - * documented in the atomic(3) manual page. - */ -/* #undef JEMALLOC_OSATOMIC */ - -/* - * Defined if OSSpin*() functions are available, as provided by Darwin, and - * documented in the spinlock(3) manual page. - */ -/* #undef JEMALLOC_OSSPIN */ - /* Defined if __attribute__((...)) syntax is supported. */ #define JEMALLOC_HAVE_ATTR #ifdef JEMALLOC_HAVE_ATTR @@ -75,21 +54,18 @@ /* Use libgcc for profile backtracing if defined. */ /* #undef JEMALLOC_PROF_LIBGCC */ -/* Use gcc intrinsics for profile backtracing if defined. */ -/* #undef JEMALLOC_PROF_GCC */ - /* * JEMALLOC_TINY enables support for tiny objects, which are smaller than one * quantum. */ -#define JEMALLOC_TINY +/* #undef JEMALLOC_TINY */ /* * JEMALLOC_TCACHE enables a thread-specific caching layer for small objects. * This makes it possible to allocate/deallocate objects without any locking * when the cache is in the steady state. */ -#define JEMALLOC_TCACHE +/* #undef JEMALLOC_TCACHE */ /* * JEMALLOC_DSS enables use of sbrk(2) to allocate chunks from the data storage @@ -110,7 +86,7 @@ /* #undef JEMALLOC_SYSV */ /* Support lazy locking (avoid locking unless a second thread is launched). */ -#define JEMALLOC_LAZY_LOCK +/* #undef JEMALLOC_LAZY_LOCK */ /* Determine page size at run time if defined. */ /* #undef DYNAMIC_PAGE_SHIFT */ @@ -157,12 +133,9 @@ /* #undef JEMALLOC_PURGE_MADVISE_FREE */ /* sizeof(void *) == 2^LG_SIZEOF_PTR. */ -#define LG_SIZEOF_PTR 3 +#define LG_SIZEOF_PTR 2 /* sizeof(int) == 2^LG_SIZEOF_INT. */ #define LG_SIZEOF_INT 2 -/* sizeof(long) == 2^LG_SIZEOF_LONG. */ -#define LG_SIZEOF_LONG 3 - #endif /* JEMALLOC_DEFS_H_ */ diff --git a/dep/jemalloc/src/arena.c b/dep/jemalloc/src/arena.c index d166ca1ec4d..7f939b3cd77 100644 --- a/dep/jemalloc/src/arena.c +++ b/dep/jemalloc/src/arena.c @@ -8,7 +8,6 @@ size_t opt_lg_qspace_max = LG_QSPACE_MAX_DEFAULT; size_t opt_lg_cspace_max = LG_CSPACE_MAX_DEFAULT; ssize_t opt_lg_dirty_mult = LG_DIRTY_MULT_DEFAULT; uint8_t const *small_size2bin; -arena_bin_info_t *arena_bin_info; /* Various bin-related settings. */ unsigned nqbins; @@ -26,27 +25,26 @@ size_t mspace_mask; /* * const_small_size2bin is a static constant lookup table that in the common - * case can be used as-is for small_size2bin. + * case can be used as-is for small_size2bin. For dynamically linked programs, + * this avoids a page of memory overhead per process. */ -#if (LG_TINY_MIN == 2) -#define S2B_4(i) i, +#define S2B_1(i) i, +#define S2B_2(i) S2B_1(i) S2B_1(i) +#define S2B_4(i) S2B_2(i) S2B_2(i) #define S2B_8(i) S2B_4(i) S2B_4(i) -#elif (LG_TINY_MIN == 3) -#define S2B_8(i) i, -#else -# error "Unsupported LG_TINY_MIN" -#endif #define S2B_16(i) S2B_8(i) S2B_8(i) #define S2B_32(i) S2B_16(i) S2B_16(i) #define S2B_64(i) S2B_32(i) S2B_32(i) #define S2B_128(i) S2B_64(i) S2B_64(i) #define S2B_256(i) S2B_128(i) S2B_128(i) /* - * The number of elements in const_small_size2bin is dependent on the - * definition for SUBPAGE. + * The number of elements in const_small_size2bin is dependent on page size + * and on the definition for SUBPAGE. If SUBPAGE changes, the '- 255' must also + * change, along with the addition/removal of static lookup table element + * definitions. */ -static JEMALLOC_ATTR(aligned(CACHELINE)) - const uint8_t const_small_size2bin[] = { +static const uint8_t const_small_size2bin[STATIC_PAGE_SIZE - 255] = { + S2B_1(0xffU) /* 0 */ #if (LG_QUANTUM == 4) /* 16-byte quantum **********************/ # ifdef JEMALLOC_TINY @@ -175,6 +173,7 @@ static void arena_run_trim_tail(arena_t *arena, arena_chunk_t *chunk, arena_run_t *run, size_t oldsize, size_t newsize, bool dirty); static arena_run_t *arena_bin_nonfull_run_get(arena_t *arena, arena_bin_t *bin); static void *arena_bin_malloc_hard(arena_t *arena, arena_bin_t *bin); +static size_t arena_bin_run_size_calc(arena_bin_t *bin, size_t min_run_size); static void arena_dissociate_bin_run(arena_chunk_t *chunk, arena_run_t *run, arena_bin_t *bin); static void arena_dalloc_bin_run(arena_t *arena, arena_chunk_t *chunk, @@ -192,9 +191,6 @@ static bool small_size2bin_init(void); static void small_size2bin_validate(void); #endif static bool small_size2bin_init_hard(void); -static size_t bin_info_run_size_calc(arena_bin_info_t *bin_info, - size_t min_run_size); -static bool bin_info_init(void); /******************************************************************************/ @@ -250,48 +246,57 @@ rb_gen(static JEMALLOC_ATTR(unused), arena_avail_tree_, arena_avail_tree_t, arena_chunk_map_t, u.rb_link, arena_avail_comp) static inline void * -arena_run_reg_alloc(arena_run_t *run, arena_bin_info_t *bin_info) +arena_run_reg_alloc(arena_run_t *run, arena_bin_t *bin) { void *ret; - unsigned regind; - bitmap_t *bitmap = (bitmap_t *)((uintptr_t)run + - (uintptr_t)bin_info->bitmap_offset); - dassert(run->magic == ARENA_RUN_MAGIC); + assert(run->magic == ARENA_RUN_MAGIC); assert(run->nfree > 0); - assert(bitmap_full(bitmap, &bin_info->bitmap_info) == false); - regind = bitmap_sfu(bitmap, &bin_info->bitmap_info); - ret = (void *)((uintptr_t)run + (uintptr_t)bin_info->reg0_offset + - (uintptr_t)(bin_info->reg_size * regind)); run->nfree--; - if (regind == run->nextind) - run->nextind++; - assert(regind < run->nextind); + ret = run->avail; + if (ret != NULL) { + /* Double free can cause assertion failure.*/ + assert(ret != NULL); + /* Write-after free can cause assertion failure. */ + assert((uintptr_t)ret >= (uintptr_t)run + + (uintptr_t)bin->reg0_offset); + assert((uintptr_t)ret < (uintptr_t)run->next); + assert(((uintptr_t)ret - ((uintptr_t)run + + (uintptr_t)bin->reg0_offset)) % (uintptr_t)bin->reg_size == + 0); + run->avail = *(void **)ret; + return (ret); + } + ret = run->next; + run->next = (void *)((uintptr_t)ret + (uintptr_t)bin->reg_size); + assert(ret != NULL); return (ret); } static inline void arena_run_reg_dalloc(arena_run_t *run, void *ptr) { - arena_chunk_t *chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(run); - size_t binind = arena_bin_index(chunk->arena, run->bin); - arena_bin_info_t *bin_info = &arena_bin_info[binind]; - unsigned regind = arena_run_regind(run, bin_info, ptr); - bitmap_t *bitmap = (bitmap_t *)((uintptr_t)run + - (uintptr_t)bin_info->bitmap_offset); - assert(run->nfree < bin_info->nregs); + assert(run->nfree < run->bin->nregs); /* Freeing an interior pointer can cause assertion failure. */ assert(((uintptr_t)ptr - ((uintptr_t)run + - (uintptr_t)bin_info->reg0_offset)) % (uintptr_t)bin_info->reg_size + (uintptr_t)run->bin->reg0_offset)) % (uintptr_t)run->bin->reg_size == 0); + /* + * Freeing a pointer lower than region zero can cause assertion + * failure. + */ assert((uintptr_t)ptr >= (uintptr_t)run + - (uintptr_t)bin_info->reg0_offset); - /* Freeing an unallocated pointer can cause assertion failure. */ - assert(bitmap_get(bitmap, &bin_info->bitmap_info, regind)); + (uintptr_t)run->bin->reg0_offset); + /* + * Freeing a pointer past in the run's frontier can cause assertion + * failure. + */ + assert((uintptr_t)ptr < (uintptr_t)run->next); - bitmap_unset(bitmap, &bin_info->bitmap_info, regind); + *(void **)ptr = run->avail; + run->avail = ptr; run->nfree++; } @@ -315,9 +320,6 @@ arena_run_split(arena_t *arena, arena_run_t *run, size_t size, bool large, size_t old_ndirty, run_ind, total_pages, need_pages, rem_pages, i; size_t flag_dirty; arena_avail_tree_t *runs_avail; -#ifdef JEMALLOC_STATS - size_t cactive_diff; -#endif chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(run); old_ndirty = chunk->ndirty; @@ -336,13 +338,6 @@ arena_run_split(arena_t *arena, arena_run_t *run, size_t size, bool large, rem_pages = total_pages - need_pages; arena_avail_tree_remove(runs_avail, &chunk->map[run_ind-map_bias]); -#ifdef JEMALLOC_STATS - /* Update stats_cactive if nactive is crossing a chunk multiple. */ - cactive_diff = CHUNK_CEILING((arena->nactive + need_pages) << - PAGE_SHIFT) - CHUNK_CEILING(arena->nactive << PAGE_SHIFT); - if (cactive_diff != 0) - stats_cactive_add(cactive_diff); -#endif arena->nactive += need_pages; /* Keep track of trailing unused pages for later use. */ @@ -569,7 +564,7 @@ arena_chunk_dealloc(arena_t *arena, arena_chunk_t *chunk) arena->ndirty -= spare->ndirty; } malloc_mutex_unlock(&arena->lock); - chunk_dealloc((void *)spare, chunksize, true); + chunk_dealloc((void *)spare, chunksize); malloc_mutex_lock(&arena->lock); #ifdef JEMALLOC_STATS arena->stats.mapped -= chunksize; @@ -730,9 +725,6 @@ arena_chunk_purge(arena_t *arena, arena_chunk_t *chunk) assert(pageind + npages <= chunk_npages); if (mapelm->bits & CHUNK_MAP_DIRTY) { size_t i; -#ifdef JEMALLOC_STATS - size_t cactive_diff; -#endif arena_avail_tree_remove( &arena->runs_avail_dirty, mapelm); @@ -755,17 +747,6 @@ arena_chunk_purge(arena_t *arena, arena_chunk_t *chunk) CHUNK_MAP_ALLOCATED; } -#ifdef JEMALLOC_STATS - /* - * Update stats_cactive if nactive is crossing a - * chunk multiple. - */ - cactive_diff = CHUNK_CEILING((arena->nactive + - npages) << PAGE_SHIFT) - - CHUNK_CEILING(arena->nactive << PAGE_SHIFT); - if (cactive_diff != 0) - stats_cactive_add(cactive_diff); -#endif arena->nactive += npages; /* Append to list for later processing. */ ql_elm_new(mapelm, u.ql_link); @@ -782,12 +763,8 @@ arena_chunk_purge(arena_t *arena, arena_chunk_t *chunk) chunk + (uintptr_t)(pageind << PAGE_SHIFT)); assert((mapelm->bits >> PAGE_SHIFT) == 0); - dassert(run->magic == ARENA_RUN_MAGIC); - size_t binind = arena_bin_index(arena, - run->bin); - arena_bin_info_t *bin_info = - &arena_bin_info[binind]; - pageind += bin_info->run_size >> PAGE_SHIFT; + assert(run->magic == ARENA_RUN_MAGIC); + pageind += run->bin->run_size >> PAGE_SHIFT; } } } @@ -868,10 +845,9 @@ arena_purge(arena_t *arena, bool all) } assert(ndirty == arena->ndirty); #endif - assert(arena->ndirty > arena->npurgatory || all); - assert(arena->ndirty - arena->npurgatory > chunk_npages || all); - assert((arena->nactive >> opt_lg_dirty_mult) < (arena->ndirty - - arena->npurgatory) || all); + assert(arena->ndirty > arena->npurgatory); + assert(arena->ndirty > chunk_npages || all); + assert((arena->nactive >> opt_lg_dirty_mult) < arena->ndirty || all); #ifdef JEMALLOC_STATS arena->stats.npurge++; @@ -883,10 +859,8 @@ arena_purge(arena_t *arena, bool all) * multiple threads from racing to reduce ndirty below the threshold. */ npurgatory = arena->ndirty - arena->npurgatory; - if (all == false) { - assert(npurgatory >= arena->nactive >> opt_lg_dirty_mult); + if (all == false) npurgatory -= arena->nactive >> opt_lg_dirty_mult; - } arena->npurgatory += npurgatory; while (npurgatory > 0) { @@ -957,9 +931,6 @@ arena_run_dalloc(arena_t *arena, arena_run_t *run, bool dirty) arena_chunk_t *chunk; size_t size, run_ind, run_pages, flag_dirty; arena_avail_tree_t *runs_avail; -#ifdef JEMALLOC_STATS - size_t cactive_diff; -#endif chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(run); run_ind = (size_t)(((uintptr_t)run - (uintptr_t)chunk) @@ -975,19 +946,9 @@ arena_run_dalloc(arena_t *arena, arena_run_t *run, bool dirty) CHUNK_MAP_LARGE) != 0); assert((chunk->map[run_ind+(size>>PAGE_SHIFT)-1-map_bias].bits & CHUNK_MAP_ALLOCATED) != 0); - } else { - size_t binind = arena_bin_index(arena, run->bin); - arena_bin_info_t *bin_info = &arena_bin_info[binind]; - size = bin_info->run_size; - } + } else + size = run->bin->run_size; run_pages = (size >> PAGE_SHIFT); -#ifdef JEMALLOC_STATS - /* Update stats_cactive if nactive is crossing a chunk multiple. */ - cactive_diff = CHUNK_CEILING(arena->nactive << PAGE_SHIFT) - - CHUNK_CEILING((arena->nactive - run_pages) << PAGE_SHIFT); - if (cactive_diff != 0) - stats_cactive_sub(cactive_diff); -#endif arena->nactive -= run_pages; /* @@ -1213,8 +1174,6 @@ arena_bin_nonfull_run_get(arena_t *arena, arena_bin_t *bin) { arena_chunk_map_t *mapelm; arena_run_t *run; - size_t binind; - arena_bin_info_t *bin_info; /* Look for a usable run. */ mapelm = arena_run_tree_first(&bin->runs); @@ -1238,23 +1197,18 @@ arena_bin_nonfull_run_get(arena_t *arena, arena_bin_t *bin) } /* No existing runs have any space available. */ - binind = arena_bin_index(arena, bin); - bin_info = &arena_bin_info[binind]; - /* Allocate a new run. */ malloc_mutex_unlock(&bin->lock); /******************************/ malloc_mutex_lock(&arena->lock); - run = arena_run_alloc(arena, bin_info->run_size, false, false); + run = arena_run_alloc(arena, bin->run_size, false, false); if (run != NULL) { - bitmap_t *bitmap = (bitmap_t *)((uintptr_t)run + - (uintptr_t)bin_info->bitmap_offset); - /* Initialize run internals. */ run->bin = bin; - run->nextind = 0; - run->nfree = bin_info->nregs; - bitmap_init(bitmap, &bin_info->bitmap_info); + run->avail = NULL; + run->next = (void *)((uintptr_t)run + + (uintptr_t)bin->reg0_offset); + run->nfree = bin->nregs; #ifdef JEMALLOC_DEBUG run->magic = ARENA_RUN_MAGIC; #endif @@ -1305,12 +1259,8 @@ static void * arena_bin_malloc_hard(arena_t *arena, arena_bin_t *bin) { void *ret; - size_t binind; - arena_bin_info_t *bin_info; arena_run_t *run; - binind = arena_bin_index(arena, bin); - bin_info = &arena_bin_info[binind]; bin->runcur = NULL; run = arena_bin_nonfull_run_get(arena, bin); if (bin->runcur != NULL && bin->runcur->nfree > 0) { @@ -1318,22 +1268,22 @@ arena_bin_malloc_hard(arena_t *arena, arena_bin_t *bin) * Another thread updated runcur while this one ran without the * bin lock in arena_bin_nonfull_run_get(). */ - dassert(bin->runcur->magic == ARENA_RUN_MAGIC); + assert(bin->runcur->magic == ARENA_RUN_MAGIC); assert(bin->runcur->nfree > 0); - ret = arena_run_reg_alloc(bin->runcur, bin_info); + ret = arena_run_reg_alloc(bin->runcur, bin); if (run != NULL) { arena_chunk_t *chunk; /* * arena_run_alloc() may have allocated run, or it may - * have pulled run from the bin's run tree. Therefore + * have pulled it from the bin's run tree. Therefore * it is unsafe to make any assumptions about how run * has previously been used, and arena_bin_lower_run() * must be called, as if a region were just deallocated * from the run. */ chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(run); - if (run->nfree == bin_info->nregs) + if (run->nfree == bin->nregs) arena_dalloc_bin_run(arena, chunk, run, bin); else arena_bin_lower_run(arena, chunk, run, bin); @@ -1346,10 +1296,10 @@ arena_bin_malloc_hard(arena_t *arena, arena_bin_t *bin) bin->runcur = run; - dassert(bin->runcur->magic == ARENA_RUN_MAGIC); + assert(bin->runcur->magic == ARENA_RUN_MAGIC); assert(bin->runcur->nfree > 0); - return (arena_run_reg_alloc(bin->runcur, bin_info)); + return (arena_run_reg_alloc(bin->runcur, bin)); } #ifdef JEMALLOC_PROF @@ -1389,19 +1339,18 @@ arena_tcache_fill_small(arena_t *arena, tcache_bin_t *tbin, size_t binind #endif bin = &arena->bins[binind]; malloc_mutex_lock(&bin->lock); - for (i = 0, nfill = (tcache_bin_info[binind].ncached_max >> - tbin->lg_fill_div); i < nfill; i++) { + for (i = 0, nfill = (tbin->ncached_max >> 1); i < nfill; i++) { if ((run = bin->runcur) != NULL && run->nfree > 0) - ptr = arena_run_reg_alloc(run, &arena_bin_info[binind]); + ptr = arena_run_reg_alloc(run, bin); else ptr = arena_bin_malloc_hard(arena, bin); if (ptr == NULL) break; - /* Insert such that low regions get used first. */ - tbin->avail[nfill - 1 - i] = ptr; + *(void **)ptr = tbin->avail; + tbin->avail = ptr; } #ifdef JEMALLOC_STATS - bin->stats.allocated += i * arena_bin_info[binind].reg_size; + bin->stats.allocated += (i - tbin->ncached) * bin->reg_size; bin->stats.nmalloc += i; bin->stats.nrequests += tbin->tstats.nrequests; bin->stats.nfills++; @@ -1409,9 +1358,119 @@ arena_tcache_fill_small(arena_t *arena, tcache_bin_t *tbin, size_t binind #endif malloc_mutex_unlock(&bin->lock); tbin->ncached = i; + if (tbin->ncached > tbin->high_water) + tbin->high_water = tbin->ncached; } #endif +/* + * Calculate bin->run_size such that it meets the following constraints: + * + * *) bin->run_size >= min_run_size + * *) bin->run_size <= arena_maxclass + * *) run header overhead <= RUN_MAX_OVRHD (or header overhead relaxed). + * *) run header size < PAGE_SIZE + * + * bin->nregs and bin->reg0_offset are also calculated here, since these + * settings are all interdependent. + */ +static size_t +arena_bin_run_size_calc(arena_bin_t *bin, size_t min_run_size) +{ + size_t try_run_size, good_run_size; + uint32_t try_nregs, good_nregs; + uint32_t try_hdr_size, good_hdr_size; +#ifdef JEMALLOC_PROF + uint32_t try_ctx0_offset, good_ctx0_offset; +#endif + uint32_t try_reg0_offset, good_reg0_offset; + + assert(min_run_size >= PAGE_SIZE); + assert(min_run_size <= arena_maxclass); + + /* + * Calculate known-valid settings before entering the run_size + * expansion loop, so that the first part of the loop always copies + * valid settings. + * + * The do..while loop iteratively reduces the number of regions until + * the run header and the regions no longer overlap. A closed formula + * would be quite messy, since there is an interdependency between the + * header's mask length and the number of regions. + */ + try_run_size = min_run_size; + try_nregs = ((try_run_size - sizeof(arena_run_t)) / bin->reg_size) + + 1; /* Counter-act try_nregs-- in loop. */ + do { + try_nregs--; + try_hdr_size = sizeof(arena_run_t); +#ifdef JEMALLOC_PROF + if (opt_prof && prof_promote == false) { + /* Pad to a quantum boundary. */ + try_hdr_size = QUANTUM_CEILING(try_hdr_size); + try_ctx0_offset = try_hdr_size; + /* Add space for one (prof_ctx_t *) per region. */ + try_hdr_size += try_nregs * sizeof(prof_ctx_t *); + } else + try_ctx0_offset = 0; +#endif + try_reg0_offset = try_run_size - (try_nregs * bin->reg_size); + } while (try_hdr_size > try_reg0_offset); + + /* run_size expansion loop. */ + do { + /* + * Copy valid settings before trying more aggressive settings. + */ + good_run_size = try_run_size; + good_nregs = try_nregs; + good_hdr_size = try_hdr_size; +#ifdef JEMALLOC_PROF + good_ctx0_offset = try_ctx0_offset; +#endif + good_reg0_offset = try_reg0_offset; + + /* Try more aggressive settings. */ + try_run_size += PAGE_SIZE; + try_nregs = ((try_run_size - sizeof(arena_run_t)) / + bin->reg_size) + 1; /* Counter-act try_nregs-- in loop. */ + do { + try_nregs--; + try_hdr_size = sizeof(arena_run_t); +#ifdef JEMALLOC_PROF + if (opt_prof && prof_promote == false) { + /* Pad to a quantum boundary. */ + try_hdr_size = QUANTUM_CEILING(try_hdr_size); + try_ctx0_offset = try_hdr_size; + /* + * Add space for one (prof_ctx_t *) per region. + */ + try_hdr_size += try_nregs * + sizeof(prof_ctx_t *); + } +#endif + try_reg0_offset = try_run_size - (try_nregs * + bin->reg_size); + } while (try_hdr_size > try_reg0_offset); + } while (try_run_size <= arena_maxclass + && try_run_size <= arena_maxclass + && RUN_MAX_OVRHD * (bin->reg_size << 3) > RUN_MAX_OVRHD_RELAX + && (try_reg0_offset << RUN_BFP) > RUN_MAX_OVRHD * try_run_size + && try_hdr_size < PAGE_SIZE); + + assert(good_hdr_size <= good_reg0_offset); + + /* Copy final settings. */ + bin->run_size = good_run_size; + bin->nregs = good_nregs; +#ifdef JEMALLOC_PROF + bin->ctx0_offset = good_ctx0_offset; +#endif + bin->reg0_offset = good_reg0_offset; + + return (good_run_size); +} + void * arena_malloc_small(arena_t *arena, size_t size, bool zero) { @@ -1420,14 +1479,14 @@ arena_malloc_small(arena_t *arena, size_t size, bool zero) arena_run_t *run; size_t binind; - binind = SMALL_SIZE2BIN(size); + binind = small_size2bin[size]; assert(binind < nbins); bin = &arena->bins[binind]; - size = arena_bin_info[binind].reg_size; + size = bin->reg_size; malloc_mutex_lock(&bin->lock); if ((run = bin->runcur) != NULL && run->nfree > 0) - ret = arena_run_reg_alloc(run, &arena_bin_info[binind]); + ret = arena_run_reg_alloc(run, bin); else ret = arena_bin_malloc_hard(arena, bin); @@ -1631,13 +1690,11 @@ arena_salloc(const void *ptr) arena_run_t *run = (arena_run_t *)((uintptr_t)chunk + (uintptr_t)((pageind - (mapbits >> PAGE_SHIFT)) << PAGE_SHIFT)); - dassert(run->magic == ARENA_RUN_MAGIC); - size_t binind = arena_bin_index(chunk->arena, run->bin); - arena_bin_info_t *bin_info = &arena_bin_info[binind]; + assert(run->magic == ARENA_RUN_MAGIC); assert(((uintptr_t)ptr - ((uintptr_t)run + - (uintptr_t)bin_info->reg0_offset)) % bin_info->reg_size == + (uintptr_t)run->bin->reg0_offset)) % run->bin->reg_size == 0); - ret = bin_info->reg_size; + ret = run->bin->reg_size; } else { assert(((uintptr_t)ptr & PAGE_MASK) == 0); ret = mapbits & ~PAGE_MASK; @@ -1657,11 +1714,10 @@ arena_prof_promoted(const void *ptr, size_t size) assert(ptr != NULL); assert(CHUNK_ADDR2BASE(ptr) != ptr); assert(isalloc(ptr) == PAGE_SIZE); - assert(size <= small_maxclass); chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); pageind = ((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT; - binind = SMALL_SIZE2BIN(size); + binind = small_size2bin[size]; assert(binind < nbins); chunk->map[pageind-map_bias].bits = (chunk->map[pageind-map_bias].bits & ~CHUNK_MAP_CLASS_MASK) | ((binind+1) << CHUNK_MAP_CLASS_SHIFT); @@ -1685,13 +1741,11 @@ arena_salloc_demote(const void *ptr) arena_run_t *run = (arena_run_t *)((uintptr_t)chunk + (uintptr_t)((pageind - (mapbits >> PAGE_SHIFT)) << PAGE_SHIFT)); - dassert(run->magic == ARENA_RUN_MAGIC); - size_t binind = arena_bin_index(chunk->arena, run->bin); - arena_bin_info_t *bin_info = &arena_bin_info[binind]; + assert(run->magic == ARENA_RUN_MAGIC); assert(((uintptr_t)ptr - ((uintptr_t)run + - (uintptr_t)bin_info->reg0_offset)) % bin_info->reg_size == + (uintptr_t)run->bin->reg0_offset)) % run->bin->reg_size == 0); - ret = bin_info->reg_size; + ret = run->bin->reg_size; } else { assert(((uintptr_t)ptr & PAGE_MASK) == 0); ret = mapbits & ~PAGE_MASK; @@ -1700,7 +1754,7 @@ arena_salloc_demote(const void *ptr) size_t binind = ((mapbits & CHUNK_MAP_CLASS_MASK) >> CHUNK_MAP_CLASS_SHIFT) - 1; assert(binind < nbins); - ret = arena_bin_info[binind].reg_size; + ret = chunk->arena->bins[binind].reg_size; } assert(ret != 0); } @@ -1717,22 +1771,17 @@ arena_dissociate_bin_run(arena_chunk_t *chunk, arena_run_t *run, /* Dissociate run from bin. */ if (run == bin->runcur) bin->runcur = NULL; - else { - size_t binind = arena_bin_index(chunk->arena, bin); - arena_bin_info_t *bin_info = &arena_bin_info[binind]; - - if (bin_info->nregs != 1) { - size_t run_pageind = (((uintptr_t)run - - (uintptr_t)chunk)) >> PAGE_SHIFT; - arena_chunk_map_t *run_mapelm = - &chunk->map[run_pageind-map_bias]; - /* - * This block's conditional is necessary because if the - * run only contains one region, then it never gets - * inserted into the non-full runs tree. - */ - arena_run_tree_remove(&bin->runs, run_mapelm); - } + else if (bin->nregs != 1) { + size_t run_pageind = (((uintptr_t)run - (uintptr_t)chunk)) >> + PAGE_SHIFT; + arena_chunk_map_t *run_mapelm = + &chunk->map[run_pageind-map_bias]; + /* + * This block's conditional is necessary because if the run + * only contains one region, then it never gets inserted into + * the non-full runs tree. + */ + arena_run_tree_remove(&bin->runs, run_mapelm); } } @@ -1740,24 +1789,18 @@ static void arena_dalloc_bin_run(arena_t *arena, arena_chunk_t *chunk, arena_run_t *run, arena_bin_t *bin) { - size_t binind; - arena_bin_info_t *bin_info; size_t npages, run_ind, past; assert(run != bin->runcur); assert(arena_run_tree_search(&bin->runs, &chunk->map[ (((uintptr_t)run-(uintptr_t)chunk)>>PAGE_SHIFT)-map_bias]) == NULL); - binind = arena_bin_index(chunk->arena, run->bin); - bin_info = &arena_bin_info[binind]; - malloc_mutex_unlock(&bin->lock); /******************************/ - npages = bin_info->run_size >> PAGE_SHIFT; + npages = bin->run_size >> PAGE_SHIFT; run_ind = (size_t)(((uintptr_t)run - (uintptr_t)chunk) >> PAGE_SHIFT); - past = (size_t)(PAGE_CEILING((uintptr_t)run + - (uintptr_t)bin_info->reg0_offset + (uintptr_t)(run->nextind * - bin_info->reg_size) - (uintptr_t)chunk) >> PAGE_SHIFT); + past = (size_t)((PAGE_CEILING((uintptr_t)run->next) - (uintptr_t)chunk) + >> PAGE_SHIFT); malloc_mutex_lock(&arena->lock); /* @@ -1774,7 +1817,7 @@ arena_dalloc_bin_run(arena_t *arena, arena_chunk_t *chunk, arena_run_t *run, chunk->map[run_ind+npages-1-map_bias].bits = CHUNK_MAP_LARGE | (chunk->map[run_ind+npages-1-map_bias].bits & CHUNK_MAP_FLAGS_MASK); - chunk->map[run_ind-map_bias].bits = bin_info->run_size | + chunk->map[run_ind-map_bias].bits = bin->run_size | CHUNK_MAP_LARGE | (chunk->map[run_ind-map_bias].bits & CHUNK_MAP_FLAGS_MASK); arena_run_trim_tail(arena, chunk, run, (npages << PAGE_SHIFT), @@ -1843,12 +1886,10 @@ arena_dalloc_bin(arena_t *arena, arena_chunk_t *chunk, void *ptr, pageind = ((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT; run = (arena_run_t *)((uintptr_t)chunk + (uintptr_t)((pageind - (mapelm->bits >> PAGE_SHIFT)) << PAGE_SHIFT)); - dassert(run->magic == ARENA_RUN_MAGIC); + assert(run->magic == ARENA_RUN_MAGIC); bin = run->bin; - size_t binind = arena_bin_index(arena, bin); - arena_bin_info_t *bin_info = &arena_bin_info[binind]; #if (defined(JEMALLOC_FILL) || defined(JEMALLOC_STATS)) - size = bin_info->reg_size; + size = bin->reg_size; #endif #ifdef JEMALLOC_FILL @@ -1857,7 +1898,7 @@ arena_dalloc_bin(arena_t *arena, arena_chunk_t *chunk, void *ptr, #endif arena_run_reg_dalloc(run, ptr); - if (run->nfree == bin_info->nregs) { + if (run->nfree == bin->nregs) { arena_dissociate_bin_run(chunk, run, bin); arena_dalloc_bin_run(arena, chunk, run, bin); } else if (run->nfree == 1 && run != bin->runcur) @@ -2091,7 +2132,7 @@ arena_ralloc_large(void *ptr, size_t oldsize, size_t size, size_t extra, chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); arena = chunk->arena; - dassert(arena->magic == ARENA_MAGIC); + assert(arena->magic == ARENA_MAGIC); if (psize < oldsize) { #ifdef JEMALLOC_FILL @@ -2129,11 +2170,11 @@ arena_ralloc_no_move(void *ptr, size_t oldsize, size_t size, size_t extra, */ if (oldsize <= arena_maxclass) { if (oldsize <= small_maxclass) { - assert(arena_bin_info[SMALL_SIZE2BIN(oldsize)].reg_size - == oldsize); + assert(choose_arena()->bins[small_size2bin[ + oldsize]].reg_size == oldsize); if ((size + extra <= small_maxclass && - SMALL_SIZE2BIN(size + extra) == - SMALL_SIZE2BIN(oldsize)) || (size <= oldsize && + small_size2bin[size + extra] == + small_size2bin[oldsize]) || (size <= oldsize && size + extra >= oldsize)) { #ifdef JEMALLOC_FILL if (opt_junk && size < oldsize) { @@ -2169,29 +2210,24 @@ arena_ralloc(void *ptr, size_t oldsize, size_t size, size_t extra, if (ret != NULL) return (ret); + /* * size and oldsize are different enough that we need to move the * object. In that case, fall back to allocating new space and * copying. */ - if (alignment != 0) { - size_t usize = sa2u(size + extra, alignment, NULL); - if (usize == 0) - return (NULL); - ret = ipalloc(usize, alignment, zero); - } else + if (alignment != 0) + ret = ipalloc(size + extra, alignment, zero); + else ret = arena_malloc(size + extra, zero); if (ret == NULL) { if (extra == 0) return (NULL); /* Try again, this time without extra. */ - if (alignment != 0) { - size_t usize = sa2u(size, alignment, NULL); - if (usize == 0) - return (NULL); - ret = ipalloc(usize, alignment, zero); - } else + if (alignment != 0) + ret = ipalloc(size, alignment, zero); + else ret = arena_malloc(size, zero); if (ret == NULL) @@ -2215,9 +2251,9 @@ arena_new(arena_t *arena, unsigned ind) { unsigned i; arena_bin_t *bin; + size_t prev_run_size; arena->ind = ind; - arena->nthreads = 0; if (malloc_mutex_init(&arena->lock)) return (true); @@ -2251,6 +2287,8 @@ arena_new(arena_t *arena, unsigned ind) arena_avail_tree_new(&arena->runs_avail_dirty); /* Initialize bins. */ + prev_run_size = PAGE_SIZE; + i = 0; #ifdef JEMALLOC_TINY /* (2^n)-spaced tiny bins. */ @@ -2260,6 +2298,11 @@ arena_new(arena_t *arena, unsigned ind) return (true); bin->runcur = NULL; arena_run_tree_new(&bin->runs); + + bin->reg_size = (1U << (LG_TINY_MIN + i)); + + prev_run_size = arena_bin_run_size_calc(bin, prev_run_size); + #ifdef JEMALLOC_STATS memset(&bin->stats, 0, sizeof(malloc_bin_stats_t)); #endif @@ -2273,6 +2316,11 @@ arena_new(arena_t *arena, unsigned ind) return (true); bin->runcur = NULL; arena_run_tree_new(&bin->runs); + + bin->reg_size = (i - ntbins + 1) << LG_QUANTUM; + + prev_run_size = arena_bin_run_size_calc(bin, prev_run_size); + #ifdef JEMALLOC_STATS memset(&bin->stats, 0, sizeof(malloc_bin_stats_t)); #endif @@ -2285,6 +2333,12 @@ arena_new(arena_t *arena, unsigned ind) return (true); bin->runcur = NULL; arena_run_tree_new(&bin->runs); + + bin->reg_size = cspace_min + ((i - (ntbins + nqbins)) << + LG_CACHELINE); + + prev_run_size = arena_bin_run_size_calc(bin, prev_run_size); + #ifdef JEMALLOC_STATS memset(&bin->stats, 0, sizeof(malloc_bin_stats_t)); #endif @@ -2297,6 +2351,12 @@ arena_new(arena_t *arena, unsigned ind) return (true); bin->runcur = NULL; arena_run_tree_new(&bin->runs); + + bin->reg_size = sspace_min + ((i - (ntbins + nqbins + ncbins)) + << LG_SUBPAGE); + + prev_run_size = arena_bin_run_size_calc(bin, prev_run_size); + #ifdef JEMALLOC_STATS memset(&bin->stats, 0, sizeof(malloc_bin_stats_t)); #endif @@ -2315,39 +2375,40 @@ small_size2bin_validate(void) { size_t i, size, binind; + assert(small_size2bin[0] == 0xffU); i = 1; # ifdef JEMALLOC_TINY /* Tiny. */ for (; i < (1U << LG_TINY_MIN); i++) { size = pow2_ceil(1U << LG_TINY_MIN); binind = ffs((int)(size >> (LG_TINY_MIN + 1))); - assert(SMALL_SIZE2BIN(i) == binind); + assert(small_size2bin[i] == binind); } for (; i < qspace_min; i++) { size = pow2_ceil(i); binind = ffs((int)(size >> (LG_TINY_MIN + 1))); - assert(SMALL_SIZE2BIN(i) == binind); + assert(small_size2bin[i] == binind); } # endif /* Quantum-spaced. */ for (; i <= qspace_max; i++) { size = QUANTUM_CEILING(i); binind = ntbins + (size >> LG_QUANTUM) - 1; - assert(SMALL_SIZE2BIN(i) == binind); + assert(small_size2bin[i] == binind); } /* Cacheline-spaced. */ for (; i <= cspace_max; i++) { size = CACHELINE_CEILING(i); binind = ntbins + nqbins + ((size - cspace_min) >> LG_CACHELINE); - assert(SMALL_SIZE2BIN(i) == binind); + assert(small_size2bin[i] == binind); } /* Sub-page. */ for (; i <= sspace_max; i++) { size = SUBPAGE_CEILING(i); binind = ntbins + nqbins + ncbins + ((size - sspace_min) >> LG_SUBPAGE); - assert(SMALL_SIZE2BIN(i) == binind); + assert(small_size2bin[i] == binind); } } #endif @@ -2358,12 +2419,12 @@ small_size2bin_init(void) if (opt_lg_qspace_max != LG_QSPACE_MAX_DEFAULT || opt_lg_cspace_max != LG_CSPACE_MAX_DEFAULT - || (sizeof(const_small_size2bin) != ((small_maxclass-1) >> - LG_TINY_MIN) + 1)) + || sizeof(const_small_size2bin) != small_maxclass + 1) return (small_size2bin_init_hard()); small_size2bin = const_small_size2bin; #ifdef JEMALLOC_DEBUG + assert(sizeof(const_small_size2bin) == small_maxclass + 1); small_size2bin_validate(); #endif return (false); @@ -2374,242 +2435,55 @@ small_size2bin_init_hard(void) { size_t i, size, binind; uint8_t *custom_small_size2bin; -#define CUSTOM_SMALL_SIZE2BIN(s) \ - custom_small_size2bin[(s-1) >> LG_TINY_MIN] assert(opt_lg_qspace_max != LG_QSPACE_MAX_DEFAULT || opt_lg_cspace_max != LG_CSPACE_MAX_DEFAULT - || (sizeof(const_small_size2bin) != ((small_maxclass-1) >> - LG_TINY_MIN) + 1)); + || sizeof(const_small_size2bin) != small_maxclass + 1); - custom_small_size2bin = (uint8_t *) - base_alloc(small_maxclass >> LG_TINY_MIN); + custom_small_size2bin = (uint8_t *)base_alloc(small_maxclass + 1); if (custom_small_size2bin == NULL) return (true); + custom_small_size2bin[0] = 0xffU; i = 1; #ifdef JEMALLOC_TINY /* Tiny. */ - for (; i < (1U << LG_TINY_MIN); i += TINY_MIN) { + for (; i < (1U << LG_TINY_MIN); i++) { size = pow2_ceil(1U << LG_TINY_MIN); binind = ffs((int)(size >> (LG_TINY_MIN + 1))); - CUSTOM_SMALL_SIZE2BIN(i) = binind; + custom_small_size2bin[i] = binind; } - for (; i < qspace_min; i += TINY_MIN) { + for (; i < qspace_min; i++) { size = pow2_ceil(i); binind = ffs((int)(size >> (LG_TINY_MIN + 1))); - CUSTOM_SMALL_SIZE2BIN(i) = binind; + custom_small_size2bin[i] = binind; } #endif /* Quantum-spaced. */ - for (; i <= qspace_max; i += TINY_MIN) { + for (; i <= qspace_max; i++) { size = QUANTUM_CEILING(i); binind = ntbins + (size >> LG_QUANTUM) - 1; - CUSTOM_SMALL_SIZE2BIN(i) = binind; + custom_small_size2bin[i] = binind; } /* Cacheline-spaced. */ - for (; i <= cspace_max; i += TINY_MIN) { + for (; i <= cspace_max; i++) { size = CACHELINE_CEILING(i); binind = ntbins + nqbins + ((size - cspace_min) >> LG_CACHELINE); - CUSTOM_SMALL_SIZE2BIN(i) = binind; + custom_small_size2bin[i] = binind; } /* Sub-page. */ - for (; i <= sspace_max; i += TINY_MIN) { + for (; i <= sspace_max; i++) { size = SUBPAGE_CEILING(i); binind = ntbins + nqbins + ncbins + ((size - sspace_min) >> LG_SUBPAGE); - CUSTOM_SMALL_SIZE2BIN(i) = binind; + custom_small_size2bin[i] = binind; } small_size2bin = custom_small_size2bin; #ifdef JEMALLOC_DEBUG small_size2bin_validate(); #endif - return (false); -#undef CUSTOM_SMALL_SIZE2BIN -} - -/* - * Calculate bin_info->run_size such that it meets the following constraints: - * - * *) bin_info->run_size >= min_run_size - * *) bin_info->run_size <= arena_maxclass - * *) run header overhead <= RUN_MAX_OVRHD (or header overhead relaxed). - * *) bin_info->nregs <= RUN_MAXREGS - * - * bin_info->nregs, bin_info->bitmap_offset, and bin_info->reg0_offset are also - * calculated here, since these settings are all interdependent. - */ -static size_t -bin_info_run_size_calc(arena_bin_info_t *bin_info, size_t min_run_size) -{ - size_t try_run_size, good_run_size; - uint32_t try_nregs, good_nregs; - uint32_t try_hdr_size, good_hdr_size; - uint32_t try_bitmap_offset, good_bitmap_offset; -#ifdef JEMALLOC_PROF - uint32_t try_ctx0_offset, good_ctx0_offset; -#endif - uint32_t try_reg0_offset, good_reg0_offset; - - assert(min_run_size >= PAGE_SIZE); - assert(min_run_size <= arena_maxclass); - - /* - * Calculate known-valid settings before entering the run_size - * expansion loop, so that the first part of the loop always copies - * valid settings. - * - * The do..while loop iteratively reduces the number of regions until - * the run header and the regions no longer overlap. A closed formula - * would be quite messy, since there is an interdependency between the - * header's mask length and the number of regions. - */ - try_run_size = min_run_size; - try_nregs = ((try_run_size - sizeof(arena_run_t)) / bin_info->reg_size) - + 1; /* Counter-act try_nregs-- in loop. */ - if (try_nregs > RUN_MAXREGS) { - try_nregs = RUN_MAXREGS - + 1; /* Counter-act try_nregs-- in loop. */ - } - do { - try_nregs--; - try_hdr_size = sizeof(arena_run_t); - /* Pad to a long boundary. */ - try_hdr_size = LONG_CEILING(try_hdr_size); - try_bitmap_offset = try_hdr_size; - /* Add space for bitmap. */ - try_hdr_size += bitmap_size(try_nregs); -#ifdef JEMALLOC_PROF - if (opt_prof && prof_promote == false) { - /* Pad to a quantum boundary. */ - try_hdr_size = QUANTUM_CEILING(try_hdr_size); - try_ctx0_offset = try_hdr_size; - /* Add space for one (prof_ctx_t *) per region. */ - try_hdr_size += try_nregs * sizeof(prof_ctx_t *); - } else - try_ctx0_offset = 0; -#endif - try_reg0_offset = try_run_size - (try_nregs * - bin_info->reg_size); - } while (try_hdr_size > try_reg0_offset); - - /* run_size expansion loop. */ - do { - /* - * Copy valid settings before trying more aggressive settings. - */ - good_run_size = try_run_size; - good_nregs = try_nregs; - good_hdr_size = try_hdr_size; - good_bitmap_offset = try_bitmap_offset; -#ifdef JEMALLOC_PROF - good_ctx0_offset = try_ctx0_offset; -#endif - good_reg0_offset = try_reg0_offset; - - /* Try more aggressive settings. */ - try_run_size += PAGE_SIZE; - try_nregs = ((try_run_size - sizeof(arena_run_t)) / - bin_info->reg_size) - + 1; /* Counter-act try_nregs-- in loop. */ - if (try_nregs > RUN_MAXREGS) { - try_nregs = RUN_MAXREGS - + 1; /* Counter-act try_nregs-- in loop. */ - } - do { - try_nregs--; - try_hdr_size = sizeof(arena_run_t); - /* Pad to a long boundary. */ - try_hdr_size = LONG_CEILING(try_hdr_size); - try_bitmap_offset = try_hdr_size; - /* Add space for bitmap. */ - try_hdr_size += bitmap_size(try_nregs); -#ifdef JEMALLOC_PROF - if (opt_prof && prof_promote == false) { - /* Pad to a quantum boundary. */ - try_hdr_size = QUANTUM_CEILING(try_hdr_size); - try_ctx0_offset = try_hdr_size; - /* - * Add space for one (prof_ctx_t *) per region. - */ - try_hdr_size += try_nregs * - sizeof(prof_ctx_t *); - } -#endif - try_reg0_offset = try_run_size - (try_nregs * - bin_info->reg_size); - } while (try_hdr_size > try_reg0_offset); - } while (try_run_size <= arena_maxclass - && try_run_size <= arena_maxclass - && RUN_MAX_OVRHD * (bin_info->reg_size << 3) > RUN_MAX_OVRHD_RELAX - && (try_reg0_offset << RUN_BFP) > RUN_MAX_OVRHD * try_run_size - && try_nregs < RUN_MAXREGS); - - assert(good_hdr_size <= good_reg0_offset); - - /* Copy final settings. */ - bin_info->run_size = good_run_size; - bin_info->nregs = good_nregs; - bin_info->bitmap_offset = good_bitmap_offset; -#ifdef JEMALLOC_PROF - bin_info->ctx0_offset = good_ctx0_offset; -#endif - bin_info->reg0_offset = good_reg0_offset; - - return (good_run_size); -} - -static bool -bin_info_init(void) -{ - arena_bin_info_t *bin_info; - unsigned i; - size_t prev_run_size; - - arena_bin_info = base_alloc(sizeof(arena_bin_info_t) * nbins); - if (arena_bin_info == NULL) - return (true); - - prev_run_size = PAGE_SIZE; - i = 0; -#ifdef JEMALLOC_TINY - /* (2^n)-spaced tiny bins. */ - for (; i < ntbins; i++) { - bin_info = &arena_bin_info[i]; - bin_info->reg_size = (1U << (LG_TINY_MIN + i)); - prev_run_size = bin_info_run_size_calc(bin_info, prev_run_size); - bitmap_info_init(&bin_info->bitmap_info, bin_info->nregs); - } -#endif - - /* Quantum-spaced bins. */ - for (; i < ntbins + nqbins; i++) { - bin_info = &arena_bin_info[i]; - bin_info->reg_size = (i - ntbins + 1) << LG_QUANTUM; - prev_run_size = bin_info_run_size_calc(bin_info, prev_run_size); - bitmap_info_init(&bin_info->bitmap_info, bin_info->nregs); - } - - /* Cacheline-spaced bins. */ - for (; i < ntbins + nqbins + ncbins; i++) { - bin_info = &arena_bin_info[i]; - bin_info->reg_size = cspace_min + ((i - (ntbins + nqbins)) << - LG_CACHELINE); - prev_run_size = bin_info_run_size_calc(bin_info, prev_run_size); - bitmap_info_init(&bin_info->bitmap_info, bin_info->nregs); - } - - /* Subpage-spaced bins. */ - for (; i < nbins; i++) { - bin_info = &arena_bin_info[i]; - bin_info->reg_size = sspace_min + ((i - (ntbins + nqbins + - ncbins)) << LG_SUBPAGE); - prev_run_size = bin_info_run_size_calc(bin_info, prev_run_size); - bitmap_info_init(&bin_info->bitmap_info, bin_info->nregs); - } - return (false); } @@ -2671,6 +2545,9 @@ arena_boot(void) abort(); } + if (small_size2bin_init()) + return (true); + /* * Compute the header size such that it is large enough to contain the * page map. The page map is biased to omit entries for the header @@ -2694,11 +2571,5 @@ arena_boot(void) arena_maxclass = chunksize - (map_bias << PAGE_SHIFT); - if (small_size2bin_init()) - return (true); - - if (bin_info_init()) - return (true); - return (false); } diff --git a/dep/jemalloc/src/atomic.c b/dep/jemalloc/src/atomic.c deleted file mode 100644 index 77ee313113b..00000000000 --- a/dep/jemalloc/src/atomic.c +++ /dev/null @@ -1,2 +0,0 @@ -#define JEMALLOC_ATOMIC_C_ -#include "jemalloc/internal/jemalloc_internal.h" diff --git a/dep/jemalloc/src/bitmap.c b/dep/jemalloc/src/bitmap.c deleted file mode 100644 index b47e2629093..00000000000 --- a/dep/jemalloc/src/bitmap.c +++ /dev/null @@ -1,90 +0,0 @@ -#define JEMALLOC_BITMAP_C_ -#include "jemalloc/internal/jemalloc_internal.h" - -/******************************************************************************/ -/* Function prototypes for non-inline static functions. */ - -static size_t bits2groups(size_t nbits); - -/******************************************************************************/ - -static size_t -bits2groups(size_t nbits) -{ - - return ((nbits >> LG_BITMAP_GROUP_NBITS) + - !!(nbits & BITMAP_GROUP_NBITS_MASK)); -} - -void -bitmap_info_init(bitmap_info_t *binfo, size_t nbits) -{ - unsigned i; - size_t group_count; - - assert(nbits > 0); - assert(nbits <= (ZU(1) << LG_BITMAP_MAXBITS)); - - /* - * Compute the number of groups necessary to store nbits bits, and - * progressively work upward through the levels until reaching a level - * that requires only one group. - */ - binfo->levels[0].group_offset = 0; - group_count = bits2groups(nbits); - for (i = 1; group_count > 1; i++) { - assert(i < BITMAP_MAX_LEVELS); - binfo->levels[i].group_offset = binfo->levels[i-1].group_offset - + group_count; - group_count = bits2groups(group_count); - } - binfo->levels[i].group_offset = binfo->levels[i-1].group_offset - + group_count; - binfo->nlevels = i; - binfo->nbits = nbits; -} - -size_t -bitmap_info_ngroups(const bitmap_info_t *binfo) -{ - - return (binfo->levels[binfo->nlevels].group_offset << LG_SIZEOF_BITMAP); -} - -size_t -bitmap_size(size_t nbits) -{ - bitmap_info_t binfo; - - bitmap_info_init(&binfo, nbits); - return (bitmap_info_ngroups(&binfo)); -} - -void -bitmap_init(bitmap_t *bitmap, const bitmap_info_t *binfo) -{ - size_t extra; - unsigned i; - - /* - * Bits are actually inverted with regard to the external bitmap - * interface, so the bitmap starts out with all 1 bits, except for - * trailing unused bits (if any). Note that each group uses bit 0 to - * correspond to the first logical bit in the group, so extra bits - * are the most significant bits of the last group. - */ - memset(bitmap, 0xffU, binfo->levels[binfo->nlevels].group_offset << - LG_SIZEOF_BITMAP); - extra = (BITMAP_GROUP_NBITS - (binfo->nbits & BITMAP_GROUP_NBITS_MASK)) - & BITMAP_GROUP_NBITS_MASK; - if (extra != 0) - bitmap[binfo->levels[1].group_offset - 1] >>= extra; - for (i = 1; i < binfo->nlevels; i++) { - size_t group_count = binfo->levels[i].group_offset - - binfo->levels[i-1].group_offset; - extra = (BITMAP_GROUP_NBITS - (group_count & - BITMAP_GROUP_NBITS_MASK)) & BITMAP_GROUP_NBITS_MASK; - if (extra != 0) - bitmap[binfo->levels[i+1].group_offset - 1] >>= extra; - } -} diff --git a/dep/jemalloc/src/chunk.c b/dep/jemalloc/src/chunk.c index d190c6f49b3..301519e8042 100644 --- a/dep/jemalloc/src/chunk.c +++ b/dep/jemalloc/src/chunk.c @@ -70,7 +70,7 @@ RETURN: #ifdef JEMALLOC_IVSALLOC if (base == false && ret != NULL) { if (rtree_set(chunks_rtree, (uintptr_t)ret, ret)) { - chunk_dealloc(ret, size, true); + chunk_dealloc(ret, size); return (NULL); } } @@ -108,7 +108,7 @@ RETURN: } void -chunk_dealloc(void *chunk, size_t size, bool unmap) +chunk_dealloc(void *chunk, size_t size) { assert(chunk != NULL); @@ -125,17 +125,15 @@ chunk_dealloc(void *chunk, size_t size, bool unmap) malloc_mutex_unlock(&chunks_mtx); #endif - if (unmap) { #ifdef JEMALLOC_SWAP - if (swap_enabled && chunk_dealloc_swap(chunk, size) == false) - return; + if (swap_enabled && chunk_dealloc_swap(chunk, size) == false) + return; #endif #ifdef JEMALLOC_DSS - if (chunk_dealloc_dss(chunk, size) == false) - return; + if (chunk_dealloc_dss(chunk, size) == false) + return; #endif - chunk_dealloc_mmap(chunk, size); - } + chunk_dealloc_mmap(chunk, size); } bool diff --git a/dep/jemalloc/src/chunk_mmap.c b/dep/jemalloc/src/chunk_mmap.c index 164e86e7b38..bc367559774 100644 --- a/dep/jemalloc/src/chunk_mmap.c +++ b/dep/jemalloc/src/chunk_mmap.c @@ -206,15 +206,13 @@ chunk_alloc_mmap_internal(size_t size, bool noreserve) void * chunk_alloc_mmap(size_t size) { - - return (chunk_alloc_mmap_internal(size, false)); + return chunk_alloc_mmap_internal(size, false); } void * chunk_alloc_mmap_noreserve(size_t size) { - - return (chunk_alloc_mmap_internal(size, true)); + return chunk_alloc_mmap_internal(size, true); } void diff --git a/dep/jemalloc/src/ckh.c b/dep/jemalloc/src/ckh.c index 43fcc25239d..682a8db65bf 100644 --- a/dep/jemalloc/src/ckh.c +++ b/dep/jemalloc/src/ckh.c @@ -34,7 +34,7 @@ * respectively. * ******************************************************************************/ -#define JEMALLOC_CKH_C_ +#define CKH_C_ #include "jemalloc/internal/jemalloc_internal.h" /******************************************************************************/ @@ -73,7 +73,7 @@ ckh_isearch(ckh_t *ckh, const void *key) size_t hash1, hash2, bucket, cell; assert(ckh != NULL); - dassert(ckh->magic == CKH_MAGIC); + assert(ckh->magic = CKH_MAGIG); ckh->hash(key, ckh->lg_curbuckets, &hash1, &hash2); @@ -262,15 +262,9 @@ ckh_grow(ckh_t *ckh) lg_prevbuckets = ckh->lg_curbuckets; lg_curcells = ckh->lg_curbuckets + LG_CKH_BUCKET_CELLS; while (true) { - size_t usize; - lg_curcells++; - usize = sa2u(sizeof(ckhc_t) << lg_curcells, CACHELINE, NULL); - if (usize == 0) { - ret = true; - goto RETURN; - } - tab = (ckhc_t *)ipalloc(usize, CACHELINE, true); + tab = (ckhc_t *)ipalloc(sizeof(ckhc_t) << lg_curcells, + ZU(1) << LG_CACHELINE, true); if (tab == NULL) { ret = true; goto RETURN; @@ -301,7 +295,7 @@ static void ckh_shrink(ckh_t *ckh) { ckhc_t *tab, *ttab; - size_t lg_curcells, usize; + size_t lg_curcells; unsigned lg_prevbuckets; /* @@ -310,10 +304,8 @@ ckh_shrink(ckh_t *ckh) */ lg_prevbuckets = ckh->lg_curbuckets; lg_curcells = ckh->lg_curbuckets + LG_CKH_BUCKET_CELLS - 1; - usize = sa2u(sizeof(ckhc_t) << lg_curcells, CACHELINE, NULL); - if (usize == 0) - return; - tab = (ckhc_t *)ipalloc(usize, CACHELINE, true); + tab = (ckhc_t *)ipalloc(sizeof(ckhc_t) << lg_curcells, + ZU(1) << LG_CACHELINE, true); if (tab == NULL) { /* * An OOM error isn't worth propagating, since it doesn't @@ -348,7 +340,7 @@ bool ckh_new(ckh_t *ckh, size_t minitems, ckh_hash_t *hash, ckh_keycomp_t *keycomp) { bool ret; - size_t mincells, usize; + size_t mincells; unsigned lg_mincells; assert(minitems > 0); @@ -383,19 +375,15 @@ ckh_new(ckh_t *ckh, size_t minitems, ckh_hash_t *hash, ckh_keycomp_t *keycomp) ckh->hash = hash; ckh->keycomp = keycomp; - usize = sa2u(sizeof(ckhc_t) << lg_mincells, CACHELINE, NULL); - if (usize == 0) { - ret = true; - goto RETURN; - } - ckh->tab = (ckhc_t *)ipalloc(usize, CACHELINE, true); + ckh->tab = (ckhc_t *)ipalloc(sizeof(ckhc_t) << lg_mincells, + (ZU(1) << LG_CACHELINE), true); if (ckh->tab == NULL) { ret = true; goto RETURN; } #ifdef JEMALLOC_DEBUG - ckh->magic = CKH_MAGIC; + ckh->magic = CKH_MAGIG; #endif ret = false; @@ -408,7 +396,7 @@ ckh_delete(ckh_t *ckh) { assert(ckh != NULL); - dassert(ckh->magic == CKH_MAGIC); + assert(ckh->magic = CKH_MAGIG); #ifdef CKH_VERBOSE malloc_printf( @@ -433,7 +421,7 @@ ckh_count(ckh_t *ckh) { assert(ckh != NULL); - dassert(ckh->magic == CKH_MAGIC); + assert(ckh->magic = CKH_MAGIG); return (ckh->count); } @@ -464,7 +452,7 @@ ckh_insert(ckh_t *ckh, const void *key, const void *data) bool ret; assert(ckh != NULL); - dassert(ckh->magic == CKH_MAGIC); + assert(ckh->magic = CKH_MAGIG); assert(ckh_search(ckh, key, NULL, NULL)); #ifdef CKH_COUNT @@ -489,7 +477,7 @@ ckh_remove(ckh_t *ckh, const void *searchkey, void **key, void **data) size_t cell; assert(ckh != NULL); - dassert(ckh->magic == CKH_MAGIC); + assert(ckh->magic = CKH_MAGIG); cell = ckh_isearch(ckh, searchkey); if (cell != SIZE_T_MAX) { @@ -521,7 +509,7 @@ ckh_search(ckh_t *ckh, const void *searchkey, void **key, void **data) size_t cell; assert(ckh != NULL); - dassert(ckh->magic == CKH_MAGIC); + assert(ckh->magic = CKH_MAGIG); cell = ckh_isearch(ckh, searchkey); if (cell != SIZE_T_MAX) { @@ -556,7 +544,7 @@ ckh_string_hash(const void *key, unsigned minbits, size_t *hash1, size_t *hash2) } else { ret1 = h; ret2 = hash(key, strlen((const char *)key), - 0x8432a476666bbc13LLU); + 0x8432a476666bbc13U); } *hash1 = ret1; diff --git a/dep/jemalloc/src/ctl.c b/dep/jemalloc/src/ctl.c index e5336d36949..3c8adab90a3 100644 --- a/dep/jemalloc/src/ctl.c +++ b/dep/jemalloc/src/ctl.c @@ -182,7 +182,6 @@ CTL_PROTO(stats_arenas_i_lruns_j_highruns) CTL_PROTO(stats_arenas_i_lruns_j_curruns) INDEX_PROTO(stats_arenas_i_lruns_j) #endif -CTL_PROTO(stats_arenas_i_nthreads) CTL_PROTO(stats_arenas_i_pactive) CTL_PROTO(stats_arenas_i_pdirty) #ifdef JEMALLOC_STATS @@ -193,7 +192,6 @@ CTL_PROTO(stats_arenas_i_purged) #endif INDEX_PROTO(stats_arenas_i) #ifdef JEMALLOC_STATS -CTL_PROTO(stats_cactive) CTL_PROTO(stats_allocated) CTL_PROTO(stats_active) CTL_PROTO(stats_mapped) @@ -436,7 +434,6 @@ static const ctl_node_t stats_arenas_i_lruns_node[] = { #endif static const ctl_node_t stats_arenas_i_node[] = { - {NAME("nthreads"), CTL(stats_arenas_i_nthreads)}, {NAME("pactive"), CTL(stats_arenas_i_pactive)}, {NAME("pdirty"), CTL(stats_arenas_i_pdirty)} #ifdef JEMALLOC_STATS @@ -461,7 +458,6 @@ static const ctl_node_t stats_arenas_node[] = { static const ctl_node_t stats_node[] = { #ifdef JEMALLOC_STATS - {NAME("cactive"), CTL(stats_cactive)}, {NAME("allocated"), CTL(stats_allocated)}, {NAME("active"), CTL(stats_active)}, {NAME("mapped"), CTL(stats_mapped)}, @@ -624,7 +620,6 @@ ctl_arena_refresh(arena_t *arena, unsigned i) ctl_arena_clear(astats); - sstats->nthreads += astats->nthreads; #ifdef JEMALLOC_STATS ctl_arena_stats_amerge(astats, arena); /* Merge into sum stats as well. */ @@ -662,17 +657,10 @@ ctl_refresh(void) * Clear sum stats, since they will be merged into by * ctl_arena_refresh(). */ - ctl_stats.arenas[narenas].nthreads = 0; ctl_arena_clear(&ctl_stats.arenas[narenas]); malloc_mutex_lock(&arenas_lock); memcpy(tarenas, arenas, sizeof(arena_t *) * narenas); - for (i = 0; i < narenas; i++) { - if (arenas[i] != NULL) - ctl_stats.arenas[i].nthreads = arenas[i]->nthreads; - else - ctl_stats.arenas[i].nthreads = 0; - } malloc_mutex_unlock(&arenas_lock); for (i = 0; i < narenas; i++) { bool initialized = (tarenas[i] != NULL); @@ -1126,8 +1114,8 @@ thread_arena_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, unsigned newind, oldind; newind = oldind = choose_arena()->ind; - WRITE(newind, unsigned); - READ(oldind, unsigned); + WRITE(oldind, unsigned); + READ(newind, unsigned); if (newind != oldind) { arena_t *arena; @@ -1141,8 +1129,6 @@ thread_arena_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, malloc_mutex_lock(&arenas_lock); if ((arena = arenas[newind]) == NULL) arena = arenas_extend(newind); - arenas[oldind]->nthreads--; - arenas[newind]->nthreads++; malloc_mutex_unlock(&arenas_lock); if (arena == NULL) { ret = EAGAIN; @@ -1151,13 +1137,6 @@ thread_arena_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, /* Set new arena association. */ ARENA_SET(arena); -#ifdef JEMALLOC_TCACHE - { - tcache_t *tcache = TCACHE_GET(); - if (tcache != NULL) - tcache->arena = arena; - } -#endif } ret = 0; @@ -1167,9 +1146,9 @@ RETURN: #ifdef JEMALLOC_STATS CTL_RO_NL_GEN(thread_allocated, ALLOCATED_GET(), uint64_t); -CTL_RO_NL_GEN(thread_allocatedp, ALLOCATEDP_GET(), uint64_t *); +CTL_RO_NL_GEN(thread_allocatedp, &ALLOCATED_GET(), uint64_t *); CTL_RO_NL_GEN(thread_deallocated, DEALLOCATED_GET(), uint64_t); -CTL_RO_NL_GEN(thread_deallocatedp, DEALLOCATEDP_GET(), uint64_t *); +CTL_RO_NL_GEN(thread_deallocatedp, &DEALLOCATED_GET(), uint64_t *); #endif /******************************************************************************/ @@ -1305,9 +1284,9 @@ CTL_RO_NL_GEN(opt_overcommit, opt_overcommit, bool) /******************************************************************************/ -CTL_RO_NL_GEN(arenas_bin_i_size, arena_bin_info[mib[2]].reg_size, size_t) -CTL_RO_NL_GEN(arenas_bin_i_nregs, arena_bin_info[mib[2]].nregs, uint32_t) -CTL_RO_NL_GEN(arenas_bin_i_run_size, arena_bin_info[mib[2]].run_size, size_t) +CTL_RO_NL_GEN(arenas_bin_i_size, arenas[0]->bins[mib[2]].reg_size, size_t) +CTL_RO_NL_GEN(arenas_bin_i_nregs, arenas[0]->bins[mib[2]].nregs, uint32_t) +CTL_RO_NL_GEN(arenas_bin_i_run_size, arenas[0]->bins[mib[2]].run_size, size_t) const ctl_node_t * arenas_bin_i_index(const size_t *mib, size_t miblen, size_t i) { @@ -1552,7 +1531,6 @@ stats_arenas_i_lruns_j_index(const size_t *mib, size_t miblen, size_t j) } #endif -CTL_RO_GEN(stats_arenas_i_nthreads, ctl_stats.arenas[mib[2]].nthreads, unsigned) CTL_RO_GEN(stats_arenas_i_pactive, ctl_stats.arenas[mib[2]].pactive, size_t) CTL_RO_GEN(stats_arenas_i_pdirty, ctl_stats.arenas[mib[2]].pdirty, size_t) #ifdef JEMALLOC_STATS @@ -1584,7 +1562,6 @@ RETURN: } #ifdef JEMALLOC_STATS -CTL_RO_GEN(stats_cactive, &stats_cactive, size_t *) CTL_RO_GEN(stats_allocated, ctl_stats.allocated, size_t) CTL_RO_GEN(stats_active, ctl_stats.active, size_t) CTL_RO_GEN(stats_mapped, ctl_stats.mapped, size_t) diff --git a/dep/jemalloc/src/hash.c b/dep/jemalloc/src/hash.c index cfa4da0275c..6a13d7a03c0 100644 --- a/dep/jemalloc/src/hash.c +++ b/dep/jemalloc/src/hash.c @@ -1,2 +1,2 @@ -#define JEMALLOC_HASH_C_ +#define HASH_C_ #include "jemalloc/internal/jemalloc_internal.h" diff --git a/dep/jemalloc/src/huge.c b/dep/jemalloc/src/huge.c index a4f9b054ed5..0aadc4339a9 100644 --- a/dep/jemalloc/src/huge.c +++ b/dep/jemalloc/src/huge.c @@ -50,7 +50,6 @@ huge_malloc(size_t size, bool zero) malloc_mutex_lock(&huge_mtx); extent_tree_ad_insert(&huge, node); #ifdef JEMALLOC_STATS - stats_cactive_add(csize); huge_nmalloc++; huge_allocated += csize; #endif @@ -84,7 +83,7 @@ huge_palloc(size_t size, size_t alignment, bool zero) * alignment, in order to assure the alignment can be achieved, then * unmap leading and trailing chunks. */ - assert(alignment > chunksize); + assert(alignment >= chunksize); chunk_size = CHUNK_CEILING(size); @@ -110,12 +109,12 @@ huge_palloc(size_t size, size_t alignment, bool zero) if (offset == 0) { /* Trim trailing space. */ chunk_dealloc((void *)((uintptr_t)ret + chunk_size), alloc_size - - chunk_size, true); + - chunk_size); } else { size_t trailsize; /* Trim leading space. */ - chunk_dealloc(ret, alignment - offset, true); + chunk_dealloc(ret, alignment - offset); ret = (void *)((uintptr_t)ret + (alignment - offset)); @@ -124,7 +123,7 @@ huge_palloc(size_t size, size_t alignment, bool zero) /* Trim trailing space. */ assert(trailsize < alloc_size); chunk_dealloc((void *)((uintptr_t)ret + chunk_size), - trailsize, true); + trailsize); } } @@ -135,7 +134,6 @@ huge_palloc(size_t size, size_t alignment, bool zero) malloc_mutex_lock(&huge_mtx); extent_tree_ad_insert(&huge, node); #ifdef JEMALLOC_STATS - stats_cactive_add(chunk_size); huge_nmalloc++; huge_allocated += chunk_size; #endif @@ -194,7 +192,7 @@ huge_ralloc(void *ptr, size_t oldsize, size_t size, size_t extra, * different size class. In that case, fall back to allocating new * space and copying. */ - if (alignment > chunksize) + if (alignment != 0) ret = huge_palloc(size + extra, alignment, zero); else ret = huge_malloc(size + extra, zero); @@ -203,7 +201,7 @@ huge_ralloc(void *ptr, size_t oldsize, size_t size, size_t extra, if (extra == 0) return (NULL); /* Try again, this time without extra. */ - if (alignment > chunksize) + if (alignment != 0) ret = huge_palloc(size, alignment, zero); else ret = huge_malloc(size, zero); @@ -234,13 +232,6 @@ huge_ralloc(void *ptr, size_t oldsize, size_t size, size_t extra, ) { size_t newsize = huge_salloc(ret); - /* - * Remove ptr from the tree of huge allocations before - * performing the remap operation, in order to avoid the - * possibility of another thread acquiring that mapping before - * this one removes it from the tree. - */ - huge_dalloc(ptr, false); if (mremap(ptr, oldsize, newsize, MREMAP_MAYMOVE|MREMAP_FIXED, ret) == MAP_FAILED) { /* @@ -260,8 +251,9 @@ huge_ralloc(void *ptr, size_t oldsize, size_t size, size_t extra, if (opt_abort) abort(); memcpy(ret, ptr, copysize); - chunk_dealloc_mmap(ptr, oldsize); - } + idalloc(ptr); + } else + huge_dalloc(ptr, false); } else #endif { @@ -286,7 +278,6 @@ huge_dalloc(void *ptr, bool unmap) extent_tree_ad_remove(&huge, node); #ifdef JEMALLOC_STATS - stats_cactive_sub(node->size); huge_ndalloc++; huge_allocated -= node->size; #endif @@ -301,10 +292,9 @@ huge_dalloc(void *ptr, bool unmap) memset(node->addr, 0x5a, node->size); #endif #endif + chunk_dealloc(node->addr, node->size); } - chunk_dealloc(node->addr, node->size, unmap); - base_node_dealloc(node); } diff --git a/dep/jemalloc/src/jemalloc.c b/dep/jemalloc/src/jemalloc.c index a161c2e26e1..2aebc51dd19 100644 --- a/dep/jemalloc/src/jemalloc.c +++ b/dep/jemalloc/src/jemalloc.c @@ -7,10 +7,12 @@ malloc_mutex_t arenas_lock; arena_t **arenas; unsigned narenas; +static unsigned next_arena; -pthread_key_t arenas_tsd; #ifndef NO_TLS __thread arena_t *arenas_tls JEMALLOC_ATTR(tls_model("initial-exec")); +#else +pthread_key_t arenas_tsd; #endif #ifdef JEMALLOC_STATS @@ -28,13 +30,7 @@ static bool malloc_initialized = false; static pthread_t malloc_initializer = (unsigned long)0; /* Used to avoid initialization races. */ -static malloc_mutex_t init_lock = -#ifdef JEMALLOC_OSSPIN - 0 -#else - MALLOC_MUTEX_INITIALIZER -#endif - ; +static malloc_mutex_t init_lock = MALLOC_MUTEX_INITIALIZER; #ifdef DYNAMIC_PAGE_SHIFT size_t pagesize; @@ -74,7 +70,6 @@ size_t opt_narenas = 0; static void wrtmessage(void *cbopaque, const char *s); static void stats_print_atexit(void); static unsigned malloc_ncpus(void); -static void arenas_cleanup(void *arg); #if (defined(JEMALLOC_STATS) && defined(NO_TLS)) static void thread_allocated_cleanup(void *arg); #endif @@ -84,7 +79,6 @@ static void malloc_conf_error(const char *msg, const char *k, size_t klen, const char *v, size_t vlen); static void malloc_conf_init(void); static bool malloc_init_hard(void); -static int imemalign(void **memptr, size_t alignment, size_t size); /******************************************************************************/ /* malloc_message() setup. */ @@ -153,53 +147,13 @@ choose_arena_hard(void) arena_t *ret; if (narenas > 1) { - unsigned i, choose, first_null; - - choose = 0; - first_null = narenas; malloc_mutex_lock(&arenas_lock); - assert(arenas[0] != NULL); - for (i = 1; i < narenas; i++) { - if (arenas[i] != NULL) { - /* - * Choose the first arena that has the lowest - * number of threads assigned to it. - */ - if (arenas[i]->nthreads < - arenas[choose]->nthreads) - choose = i; - } else if (first_null == narenas) { - /* - * Record the index of the first uninitialized - * arena, in case all extant arenas are in use. - * - * NB: It is possible for there to be - * discontinuities in terms of initialized - * versus uninitialized arenas, due to the - * "thread.arena" mallctl. - */ - first_null = i; - } - } - - if (arenas[choose] == 0 || first_null == narenas) { - /* - * Use an unloaded arena, or the least loaded arena if - * all arenas are already initialized. - */ - ret = arenas[choose]; - } else { - /* Initialize a new arena. */ - ret = arenas_extend(first_null); - } - ret->nthreads++; + if ((ret = arenas[next_arena]) == NULL) + ret = arenas_extend(next_arena); + next_arena = (next_arena + 1) % narenas; malloc_mutex_unlock(&arenas_lock); - } else { + } else ret = arenas[0]; - malloc_mutex_lock(&arenas_lock); - ret->nthreads++; - malloc_mutex_unlock(&arenas_lock); - } ARENA_SET(ret); @@ -259,28 +213,6 @@ stats_print_atexit(void) JEMALLOC_P(malloc_stats_print)(NULL, NULL, NULL); } -#if (defined(JEMALLOC_STATS) && defined(NO_TLS)) -thread_allocated_t * -thread_allocated_get_hard(void) -{ - thread_allocated_t *thread_allocated = (thread_allocated_t *) - imalloc(sizeof(thread_allocated_t)); - if (thread_allocated == NULL) { - static thread_allocated_t static_thread_allocated = {0, 0}; - malloc_write(": Error allocating TSD;" - " mallctl(\"thread.{de,}allocated[p]\", ...)" - " will be inaccurate\n"); - if (opt_abort) - abort(); - return (&static_thread_allocated); - } - pthread_setspecific(thread_allocated_tsd, thread_allocated); - thread_allocated->allocated = 0; - thread_allocated->deallocated = 0; - return (thread_allocated); -} -#endif - /* * End miscellaneous support functions. */ @@ -305,16 +237,6 @@ malloc_ncpus(void) return (ret); } -static void -arenas_cleanup(void *arg) -{ - arena_t *arena = (arena_t *)arg; - - malloc_mutex_lock(&arenas_lock); - arena->nthreads--; - malloc_mutex_unlock(&arenas_lock); -} - #if (defined(JEMALLOC_STATS) && defined(NO_TLS)) static void thread_allocated_cleanup(void *arg) @@ -499,8 +421,8 @@ malloc_conf_init(void) if ((opts = getenv(envname)) != NULL) { /* * Do nothing; opts is already initialized to - * the value of the MALLOC_CONF environment - * variable. + * the value of the JEMALLOC_OPTIONS + * environment variable. */ } else { /* No configuration specified. */ @@ -689,7 +611,7 @@ malloc_init_hard(void) result = sysconf(_SC_PAGESIZE); assert(result != -1); - pagesize = (size_t)result; + pagesize = (unsigned)result; /* * We assume that pagesize is a power of 2 when calculating @@ -749,10 +671,7 @@ malloc_init_hard(void) } #ifdef JEMALLOC_TCACHE - if (tcache_boot()) { - malloc_mutex_unlock(&init_lock); - return (true); - } + tcache_boot(); #endif if (huge_boot()) { @@ -769,14 +688,6 @@ malloc_init_hard(void) } #endif - if (malloc_mutex_init(&arenas_lock)) - return (true); - - if (pthread_key_create(&arenas_tsd, arenas_cleanup) != 0) { - malloc_mutex_unlock(&init_lock); - return (true); - } - /* * Create enough scaffolding to allow recursive allocation in * malloc_ncpus(). @@ -801,7 +712,8 @@ malloc_init_hard(void) * threaded mode. */ ARENA_SET(arenas[0]); - arenas[0]->nthreads++; + + malloc_mutex_init(&arenas_lock); #ifdef JEMALLOC_PROF if (prof_boot2()) { @@ -841,6 +753,15 @@ malloc_init_hard(void) malloc_write(")\n"); } + next_arena = (narenas > 0) ? 1 : 0; + +#ifdef NO_TLS + if (pthread_key_create(&arenas_tsd, NULL) != 0) { + malloc_mutex_unlock(&init_lock); + return (true); + } +#endif + /* Allocate and initialize arenas. */ arenas = (arena_t **)base_alloc(sizeof(arena_t *) * narenas); if (arenas == NULL) { @@ -872,6 +793,7 @@ malloc_init_hard(void) return (false); } + #ifdef JEMALLOC_ZONE JEMALLOC_ATTR(constructor) void @@ -940,8 +862,7 @@ JEMALLOC_P(malloc)(size_t size) #ifdef JEMALLOC_PROF if (opt_prof) { usize = s2u(size); - PROF_ALLOC_PREP(1, usize, cnt); - if (cnt == NULL) { + if ((cnt = prof_alloc_prep(usize)) == NULL) { ret = NULL; goto OOM; } @@ -990,23 +911,19 @@ RETURN: } JEMALLOC_ATTR(nonnull(1)) -#ifdef JEMALLOC_PROF -/* - * Avoid any uncertainty as to how many backtrace frames to ignore in - * PROF_ALLOC_PREP(). - */ -JEMALLOC_ATTR(noinline) -#endif -static int -imemalign(void **memptr, size_t alignment, size_t size) +JEMALLOC_ATTR(visibility("default")) +int +JEMALLOC_P(posix_memalign)(void **memptr, size_t alignment, size_t size) { int ret; - size_t usize -#ifdef JEMALLOC_CC_SILENCE - = 0 -#endif - ; void *result; +#if (defined(JEMALLOC_PROF) || defined(JEMALLOC_STATS)) + size_t usize +# ifdef JEMALLOC_CC_SILENCE + = 0 +# endif + ; +#endif #ifdef JEMALLOC_PROF prof_thr_cnt_t *cnt # ifdef JEMALLOC_CC_SILENCE @@ -1056,38 +973,34 @@ imemalign(void **memptr, size_t alignment, size_t size) goto RETURN; } - usize = sa2u(size, alignment, NULL); - if (usize == 0) { - result = NULL; - ret = ENOMEM; - goto RETURN; - } - #ifdef JEMALLOC_PROF if (opt_prof) { - PROF_ALLOC_PREP(2, usize, cnt); - if (cnt == NULL) { + usize = sa2u(size, alignment, NULL); + if ((cnt = prof_alloc_prep(usize)) == NULL) { result = NULL; ret = EINVAL; } else { if (prof_promote && (uintptr_t)cnt != (uintptr_t)1U && usize <= small_maxclass) { - assert(sa2u(small_maxclass+1, - alignment, NULL) != 0); - result = ipalloc(sa2u(small_maxclass+1, - alignment, NULL), alignment, false); + result = ipalloc(small_maxclass+1, + alignment, false); if (result != NULL) { arena_prof_promoted(result, usize); } } else { - result = ipalloc(usize, alignment, + result = ipalloc(size, alignment, false); } } } else #endif - result = ipalloc(usize, alignment, false); + { +#ifdef JEMALLOC_STATS + usize = sa2u(size, alignment, NULL); +#endif + result = ipalloc(size, alignment, false); + } } if (result == NULL) { @@ -1119,15 +1032,6 @@ RETURN: return (ret); } -JEMALLOC_ATTR(nonnull(1)) -JEMALLOC_ATTR(visibility("default")) -int -JEMALLOC_P(posix_memalign)(void **memptr, size_t alignment, size_t size) -{ - - return imemalign(memptr, alignment, size); -} - JEMALLOC_ATTR(malloc) JEMALLOC_ATTR(visibility("default")) void * @@ -1183,8 +1087,7 @@ JEMALLOC_P(calloc)(size_t num, size_t size) #ifdef JEMALLOC_PROF if (opt_prof) { usize = s2u(num_size); - PROF_ALLOC_PREP(1, usize, cnt); - if (cnt == NULL) { + if ((cnt = prof_alloc_prep(usize)) == NULL) { ret = NULL; goto RETURN; } @@ -1297,9 +1200,7 @@ JEMALLOC_P(realloc)(void *ptr, size_t size) if (opt_prof) { usize = s2u(size); old_ctx = prof_ctx_get(ptr); - PROF_ALLOC_PREP(1, usize, cnt); - if (cnt == NULL) { - old_ctx = NULL; + if ((cnt = prof_alloc_prep(usize)) == NULL) { ret = NULL; goto OOM; } @@ -1309,13 +1210,8 @@ JEMALLOC_P(realloc)(void *ptr, size_t size) false, false); if (ret != NULL) arena_prof_promoted(ret, usize); - else - old_ctx = NULL; - } else { + } else ret = iralloc(ptr, size, 0, 0, false, false); - if (ret == NULL) - old_ctx = NULL; - } } else #endif { @@ -1353,8 +1249,7 @@ OOM: #ifdef JEMALLOC_PROF if (opt_prof) { usize = s2u(size); - PROF_ALLOC_PREP(1, usize, cnt); - if (cnt == NULL) + if ((cnt = prof_alloc_prep(usize)) == NULL) ret = NULL; else { if (prof_promote && (uintptr_t)cnt != @@ -1459,7 +1354,7 @@ JEMALLOC_P(memalign)(size_t alignment, size_t size) #ifdef JEMALLOC_CC_SILENCE int result = #endif - imemalign(&ret, alignment, size); + JEMALLOC_P(posix_memalign)(&ret, alignment, size); #ifdef JEMALLOC_CC_SILENCE if (result != 0) return (NULL); @@ -1478,7 +1373,7 @@ JEMALLOC_P(valloc)(size_t size) #ifdef JEMALLOC_CC_SILENCE int result = #endif - imemalign(&ret, PAGE_SIZE, size); + JEMALLOC_P(posix_memalign)(&ret, PAGE_SIZE, size); #ifdef JEMALLOC_CC_SILENCE if (result != 0) return (NULL); @@ -1559,18 +1454,15 @@ JEMALLOC_P(mallctlbymib)(const size_t *mib, size_t miblen, void *oldp, } JEMALLOC_INLINE void * -iallocm(size_t usize, size_t alignment, bool zero) +iallocm(size_t size, size_t alignment, bool zero) { - assert(usize == ((alignment == 0) ? s2u(usize) : sa2u(usize, alignment, - NULL))); - if (alignment != 0) - return (ipalloc(usize, alignment, zero)); + return (ipalloc(size, alignment, zero)); else if (zero) - return (icalloc(usize)); + return (icalloc(size)); else - return (imalloc(usize)); + return (imalloc(size)); } JEMALLOC_ATTR(nonnull(1)) @@ -1593,43 +1485,38 @@ JEMALLOC_P(allocm)(void **ptr, size_t *rsize, size_t size, int flags) if (malloc_init()) goto OOM; - usize = (alignment == 0) ? s2u(size) : sa2u(size, alignment, NULL); - if (usize == 0) - goto OOM; - #ifdef JEMALLOC_PROF if (opt_prof) { - PROF_ALLOC_PREP(1, usize, cnt); - if (cnt == NULL) + usize = (alignment == 0) ? s2u(size) : sa2u(size, alignment, + NULL); + if ((cnt = prof_alloc_prep(usize)) == NULL) goto OOM; if (prof_promote && (uintptr_t)cnt != (uintptr_t)1U && usize <= small_maxclass) { - size_t usize_promoted = (alignment == 0) ? - s2u(small_maxclass+1) : sa2u(small_maxclass+1, - alignment, NULL); - assert(usize_promoted != 0); - p = iallocm(usize_promoted, alignment, zero); + p = iallocm(small_maxclass+1, alignment, zero); if (p == NULL) goto OOM; arena_prof_promoted(p, usize); } else { - p = iallocm(usize, alignment, zero); + p = iallocm(size, alignment, zero); if (p == NULL) goto OOM; } - prof_malloc(p, usize, cnt); + if (rsize != NULL) *rsize = usize; } else #endif { - p = iallocm(usize, alignment, zero); + p = iallocm(size, alignment, zero); if (p == NULL) goto OOM; #ifndef JEMALLOC_STATS if (rsize != NULL) #endif { + usize = (alignment == 0) ? s2u(size) : sa2u(size, + alignment, NULL); #ifdef JEMALLOC_STATS if (rsize != NULL) #endif @@ -1672,6 +1559,7 @@ JEMALLOC_P(rallocm)(void **ptr, size_t *rsize, size_t size, size_t extra, bool no_move = flags & ALLOCM_NO_MOVE; #ifdef JEMALLOC_PROF prof_thr_cnt_t *cnt; + prof_ctx_t *old_ctx; #endif assert(ptr != NULL); @@ -1686,33 +1574,25 @@ JEMALLOC_P(rallocm)(void **ptr, size_t *rsize, size_t size, size_t extra, /* * usize isn't knowable before iralloc() returns when extra is * non-zero. Therefore, compute its maximum possible value and - * use that in PROF_ALLOC_PREP() to decide whether to capture a + * use that in prof_alloc_prep() to decide whether to capture a * backtrace. prof_realloc() will use the actual usize to * decide whether to sample. */ size_t max_usize = (alignment == 0) ? s2u(size+extra) : sa2u(size+extra, alignment, NULL); - prof_ctx_t *old_ctx = prof_ctx_get(p); old_size = isalloc(p); - PROF_ALLOC_PREP(1, max_usize, cnt); - if (cnt == NULL) + old_ctx = prof_ctx_get(p); + if ((cnt = prof_alloc_prep(max_usize)) == NULL) goto OOM; - /* - * Use minimum usize to determine whether promotion may happen. - */ - if (prof_promote && (uintptr_t)cnt != (uintptr_t)1U - && ((alignment == 0) ? s2u(size) : sa2u(size, - alignment, NULL)) <= small_maxclass) { + if (prof_promote && (uintptr_t)cnt != (uintptr_t)1U && max_usize + <= small_maxclass) { q = iralloc(p, small_maxclass+1, (small_maxclass+1 >= size+extra) ? 0 : size+extra - (small_maxclass+1), alignment, zero, no_move); if (q == NULL) goto ERR; - if (max_usize < PAGE_SIZE) { - usize = max_usize; - arena_prof_promoted(q, usize); - } else - usize = isalloc(q); + usize = isalloc(q); + arena_prof_promoted(q, usize); } else { q = iralloc(p, size, extra, alignment, zero, no_move); if (q == NULL) @@ -1720,8 +1600,6 @@ JEMALLOC_P(rallocm)(void **ptr, size_t *rsize, size_t size, size_t extra, usize = isalloc(q); } prof_realloc(q, usize, cnt, old_size, old_ctx); - if (rsize != NULL) - *rsize = usize; } else #endif { diff --git a/dep/jemalloc/src/mb.c b/dep/jemalloc/src/mb.c index dc2c0a256fd..30a1a2e997a 100644 --- a/dep/jemalloc/src/mb.c +++ b/dep/jemalloc/src/mb.c @@ -1,2 +1,2 @@ -#define JEMALLOC_MB_C_ +#define MB_C_ #include "jemalloc/internal/jemalloc_internal.h" diff --git a/dep/jemalloc/src/mutex.c b/dep/jemalloc/src/mutex.c index ca89ef1c962..3ecb18a340e 100644 --- a/dep/jemalloc/src/mutex.c +++ b/dep/jemalloc/src/mutex.c @@ -55,9 +55,6 @@ pthread_create(pthread_t *__restrict thread, bool malloc_mutex_init(malloc_mutex_t *mutex) { -#ifdef JEMALLOC_OSSPIN - *mutex = 0; -#else pthread_mutexattr_t attr; if (pthread_mutexattr_init(&attr) != 0) @@ -73,7 +70,6 @@ malloc_mutex_init(malloc_mutex_t *mutex) } pthread_mutexattr_destroy(&attr); -#endif return (false); } @@ -81,10 +77,8 @@ void malloc_mutex_destroy(malloc_mutex_t *mutex) { -#ifndef JEMALLOC_OSSPIN if (pthread_mutex_destroy(mutex) != 0) { malloc_write(": Error in pthread_mutex_destroy()\n"); abort(); } -#endif } diff --git a/dep/jemalloc/src/prof.c b/dep/jemalloc/src/prof.c index 8a144b4e46c..636cccef52a 100644 --- a/dep/jemalloc/src/prof.c +++ b/dep/jemalloc/src/prof.c @@ -3,15 +3,15 @@ #ifdef JEMALLOC_PROF /******************************************************************************/ +#ifdef JEMALLOC_PROF_LIBGCC +#include +#endif + #ifdef JEMALLOC_PROF_LIBUNWIND #define UNW_LOCAL_ONLY #include #endif -#ifdef JEMALLOC_PROF_LIBGCC -#include -#endif - /******************************************************************************/ /* Data. */ @@ -169,7 +169,39 @@ prof_leave(void) prof_gdump(); } -#ifdef JEMALLOC_PROF_LIBUNWIND +#ifdef JEMALLOC_PROF_LIBGCC +static _Unwind_Reason_Code +prof_unwind_init_callback(struct _Unwind_Context *context, void *arg) +{ + + return (_URC_NO_REASON); +} + +static _Unwind_Reason_Code +prof_unwind_callback(struct _Unwind_Context *context, void *arg) +{ + prof_unwind_data_t *data = (prof_unwind_data_t *)arg; + + if (data->nignore > 0) + data->nignore--; + else { + data->bt->vec[data->bt->len] = (void *)_Unwind_GetIP(context); + data->bt->len++; + if (data->bt->len == data->max) + return (_URC_END_OF_STACK); + } + + return (_URC_NO_REASON); +} + +void +prof_backtrace(prof_bt_t *bt, unsigned nignore, unsigned max) +{ + prof_unwind_data_t data = {bt, nignore, max}; + + _Unwind_Backtrace(prof_unwind_callback, &data); +} +#elif defined(JEMALLOC_PROF_LIBUNWIND) void prof_backtrace(prof_bt_t *bt, unsigned nignore, unsigned max) { @@ -204,41 +236,7 @@ prof_backtrace(prof_bt_t *bt, unsigned nignore, unsigned max) break; } } -#endif -#ifdef JEMALLOC_PROF_LIBGCC -static _Unwind_Reason_Code -prof_unwind_init_callback(struct _Unwind_Context *context, void *arg) -{ - - return (_URC_NO_REASON); -} - -static _Unwind_Reason_Code -prof_unwind_callback(struct _Unwind_Context *context, void *arg) -{ - prof_unwind_data_t *data = (prof_unwind_data_t *)arg; - - if (data->nignore > 0) - data->nignore--; - else { - data->bt->vec[data->bt->len] = (void *)_Unwind_GetIP(context); - data->bt->len++; - if (data->bt->len == data->max) - return (_URC_END_OF_STACK); - } - - return (_URC_NO_REASON); -} - -void -prof_backtrace(prof_bt_t *bt, unsigned nignore, unsigned max) -{ - prof_unwind_data_t data = {bt, nignore, max}; - - _Unwind_Backtrace(prof_unwind_callback, &data); -} -#endif -#ifdef JEMALLOC_PROF_GCC +#else void prof_backtrace(prof_bt_t *bt, unsigned nignore, unsigned max) { @@ -434,7 +432,6 @@ prof_lookup(prof_bt_t *bt) prof_ctx_t *p; void *v; } ctx; - bool new_ctx; /* * This thread's cache lacks bt. Look for it in the global @@ -471,26 +468,12 @@ prof_lookup(prof_bt_t *bt) idalloc(ctx.v); return (NULL); } - /* - * Artificially raise curobjs, in order to avoid a race - * condition with prof_ctx_merge()/prof_ctx_destroy(). - * - * No locking is necessary for ctx here because no other - * threads have had the opportunity to fetch it from - * bt2ctx yet. - */ - ctx.p->cnt_merged.curobjs++; - new_ctx = true; - } else { - /* - * Artificially raise curobjs, in order to avoid a race - * condition with prof_ctx_merge()/prof_ctx_destroy(). - */ - malloc_mutex_lock(&ctx.p->lock); - ctx.p->cnt_merged.curobjs++; - malloc_mutex_unlock(&ctx.p->lock); - new_ctx = false; } + /* + * Acquire ctx's lock before releasing bt2ctx_mtx, in order to + * avoid a race condition with prof_ctx_destroy(). + */ + malloc_mutex_lock(&ctx.p->lock); prof_leave(); /* Link a prof_thd_cnt_t into ctx for this thread. */ @@ -503,9 +486,8 @@ prof_lookup(prof_bt_t *bt) */ ret.p = ql_last(&prof_tdata->lru_ql, lru_link); assert(ret.v != NULL); - if (ckh_remove(&prof_tdata->bt2cnt, ret.p->ctx->bt, - NULL, NULL)) - assert(false); + ckh_remove(&prof_tdata->bt2cnt, ret.p->ctx->bt, NULL, + NULL); ql_remove(&prof_tdata->lru_ql, ret.p, lru_link); prof_ctx_merge(ret.p->ctx, ret.p); /* ret can now be re-used. */ @@ -516,8 +498,7 @@ prof_lookup(prof_bt_t *bt) /* Allocate and partially initialize a new cnt. */ ret.v = imalloc(sizeof(prof_thr_cnt_t)); if (ret.p == NULL) { - if (new_ctx) - prof_ctx_destroy(ctx.p); + malloc_mutex_unlock(&ctx.p->lock); return (NULL); } ql_elm_new(ret.p, cnts_link); @@ -528,15 +509,12 @@ prof_lookup(prof_bt_t *bt) ret.p->epoch = 0; memset(&ret.p->cnts, 0, sizeof(prof_cnt_t)); if (ckh_insert(&prof_tdata->bt2cnt, btkey.v, ret.v)) { - if (new_ctx) - prof_ctx_destroy(ctx.p); + malloc_mutex_unlock(&ctx.p->lock); idalloc(ret.v); return (NULL); } ql_head_insert(&prof_tdata->lru_ql, ret.p, lru_link); - malloc_mutex_lock(&ctx.p->lock); ql_tail_insert(&ctx.p->cnts_ql, ret.p, cnts_link); - ctx.p->cnt_merged.curobjs--; malloc_mutex_unlock(&ctx.p->lock); } else { /* Move ret to the front of the LRU. */ @@ -650,10 +628,11 @@ prof_ctx_destroy(prof_ctx_t *ctx) /* * Check that ctx is still unused by any thread cache before destroying - * it. prof_lookup() artificially raises ctx->cnt_merge.curobjs in - * order to avoid a race condition with this function, as does - * prof_ctx_merge() in order to avoid a race between the main body of - * prof_ctx_merge() and entry into this function. + * it. prof_lookup() interlocks bt2ctx_mtx and ctx->lock in order to + * avoid a race condition with this function, and prof_ctx_merge() + * artificially raises ctx->cnt_merged.curobjs in order to avoid a race + * between the main body of prof_ctx_merge() and entry into this + * function. */ prof_enter(); malloc_mutex_lock(&ctx->lock); @@ -662,8 +641,7 @@ prof_ctx_destroy(prof_ctx_t *ctx) assert(ctx->cnt_merged.accumobjs == 0); assert(ctx->cnt_merged.accumbytes == 0); /* Remove ctx from bt2ctx. */ - if (ckh_remove(&bt2ctx, ctx->bt, NULL, NULL)) - assert(false); + ckh_remove(&bt2ctx, ctx->bt, NULL, NULL); prof_leave(); /* Destroy ctx. */ malloc_mutex_unlock(&ctx->lock); @@ -671,10 +649,7 @@ prof_ctx_destroy(prof_ctx_t *ctx) malloc_mutex_destroy(&ctx->lock); idalloc(ctx); } else { - /* - * Compensate for increment in prof_ctx_merge() or - * prof_lookup(). - */ + /* Compensate for increment in prof_ctx_merge(). */ ctx->cnt_merged.curobjs--; malloc_mutex_unlock(&ctx->lock); prof_leave(); @@ -1081,7 +1056,7 @@ prof_bt_hash(const void *key, unsigned minbits, size_t *hash1, size_t *hash2) } else { ret1 = h; ret2 = hash(bt->vec, bt->len * sizeof(void *), - 0x8432a476666bbc13LLU); + 0x8432a476666bbc13U); } *hash1 = ret1; @@ -1118,6 +1093,7 @@ prof_tdata_init(void) prof_tdata->vec = imalloc(sizeof(void *) * prof_bt_max); if (prof_tdata->vec == NULL) { + ckh_delete(&prof_tdata->bt2cnt); idalloc(prof_tdata); return (NULL); @@ -1135,26 +1111,33 @@ prof_tdata_init(void) static void prof_tdata_cleanup(void *arg) { - prof_thr_cnt_t *cnt; - prof_tdata_t *prof_tdata = (prof_tdata_t *)arg; + prof_tdata_t *prof_tdata; - /* - * Delete the hash table. All of its contents can still be iterated - * over via the LRU. - */ - ckh_delete(&prof_tdata->bt2cnt); + prof_tdata = PROF_TCACHE_GET(); + if (prof_tdata != NULL) { + prof_thr_cnt_t *cnt; - /* Iteratively merge cnt's into the global stats and delete them. */ - while ((cnt = ql_last(&prof_tdata->lru_ql, lru_link)) != NULL) { - ql_remove(&prof_tdata->lru_ql, cnt, lru_link); - prof_ctx_merge(cnt->ctx, cnt); - idalloc(cnt); + /* + * Delete the hash table. All of its contents can still be + * iterated over via the LRU. + */ + ckh_delete(&prof_tdata->bt2cnt); + + /* + * Iteratively merge cnt's into the global stats and delete + * them. + */ + while ((cnt = ql_last(&prof_tdata->lru_ql, lru_link)) != NULL) { + prof_ctx_merge(cnt->ctx, cnt); + ql_remove(&prof_tdata->lru_ql, cnt, lru_link); + idalloc(cnt); + } + + idalloc(prof_tdata->vec); + + idalloc(prof_tdata); + PROF_TCACHE_SET(NULL); } - - idalloc(prof_tdata->vec); - - idalloc(prof_tdata); - PROF_TCACHE_SET(NULL); } void diff --git a/dep/jemalloc/src/rtree.c b/dep/jemalloc/src/rtree.c index eb0ff1e24af..7753743c5e6 100644 --- a/dep/jemalloc/src/rtree.c +++ b/dep/jemalloc/src/rtree.c @@ -1,4 +1,4 @@ -#define JEMALLOC_RTREE_C_ +#define RTREE_C_ #include "jemalloc/internal/jemalloc_internal.h" rtree_t * @@ -20,10 +20,7 @@ rtree_new(unsigned bits) memset(ret, 0, offsetof(rtree_t, level2bits) + (sizeof(unsigned) * height)); - if (malloc_mutex_init(&ret->mutex)) { - /* Leak the rtree. */ - return (NULL); - } + malloc_mutex_init(&ret->mutex); ret->height = height; if (bits_per_level * height > bits) ret->level2bits[0] = bits % bits_per_level; diff --git a/dep/jemalloc/src/stats.c b/dep/jemalloc/src/stats.c index dc172e425c0..3dfe0d232a6 100644 --- a/dep/jemalloc/src/stats.c +++ b/dep/jemalloc/src/stats.c @@ -39,10 +39,6 @@ bool opt_stats_print = false; -#ifdef JEMALLOC_STATS -size_t stats_cactive = 0; -#endif - /******************************************************************************/ /* Function prototypes for non-inline static functions. */ @@ -323,7 +319,6 @@ static void stats_arena_print(void (*write_cb)(void *, const char *), void *cbopaque, unsigned i) { - unsigned nthreads; size_t pagesize, pactive, pdirty, mapped; uint64_t npurge, nmadvise, purged; size_t small_allocated; @@ -333,9 +328,6 @@ stats_arena_print(void (*write_cb)(void *, const char *), void *cbopaque, CTL_GET("arenas.pagesize", &pagesize, size_t); - CTL_I_GET("stats.arenas.0.nthreads", &nthreads, unsigned); - malloc_cprintf(write_cb, cbopaque, - "assigned threads: %u\n", nthreads); CTL_I_GET("stats.arenas.0.pactive", &pactive, size_t); CTL_I_GET("stats.arenas.0.pdirty", &pdirty, size_t); CTL_I_GET("stats.arenas.0.npurge", &npurge, uint64_t); @@ -677,26 +669,21 @@ stats_print(void (*write_cb)(void *, const char *), void *cbopaque, #ifdef JEMALLOC_STATS { int err; - size_t sszp, ssz; - size_t *cactive; + size_t ssz; size_t allocated, active, mapped; size_t chunks_current, chunks_high, swap_avail; uint64_t chunks_total; size_t huge_allocated; uint64_t huge_nmalloc, huge_ndalloc; - sszp = sizeof(size_t *); ssz = sizeof(size_t); - CTL_GET("stats.cactive", &cactive, size_t *); CTL_GET("stats.allocated", &allocated, size_t); CTL_GET("stats.active", &active, size_t); CTL_GET("stats.mapped", &mapped, size_t); malloc_cprintf(write_cb, cbopaque, - "Allocated: %zu, active: %zu, mapped: %zu\n", - allocated, active, mapped); - malloc_cprintf(write_cb, cbopaque, - "Current active ceiling: %zu\n", atomic_read_z(cactive)); + "Allocated: %zu, active: %zu, mapped: %zu\n", allocated, + active, mapped); /* Print chunk stats. */ CTL_GET("stats.chunks.total", &chunks_total, uint64_t); @@ -748,7 +735,7 @@ stats_print(void (*write_cb)(void *, const char *), void *cbopaque, ninitialized++; } - if (ninitialized > 1 || unmerged == false) { + if (ninitialized > 1) { /* Print merged arena stats. */ malloc_cprintf(write_cb, cbopaque, "\nMerged arenas stats:\n"); diff --git a/dep/jemalloc/src/tcache.c b/dep/jemalloc/src/tcache.c index 31c329e1613..cbbe7a113a9 100644 --- a/dep/jemalloc/src/tcache.c +++ b/dep/jemalloc/src/tcache.c @@ -8,9 +8,6 @@ bool opt_tcache = true; ssize_t opt_lg_tcache_max = LG_TCACHE_MAXCLASS_DEFAULT; ssize_t opt_lg_tcache_gc_sweep = LG_TCACHE_GC_SWEEP_DEFAULT; -tcache_bin_info_t *tcache_bin_info; -static unsigned stack_nelms; /* Total stack elms per tcache. */ - /* Map of thread-specific caches. */ #ifndef NO_TLS __thread tcache_t *tcache_tls JEMALLOC_ATTR(tls_model("initial-exec")); @@ -58,19 +55,18 @@ tcache_bin_flush_small(tcache_bin_t *tbin, size_t binind, unsigned rem #endif ) { - void *ptr; + void *flush, *deferred, *ptr; unsigned i, nflush, ndeferred; -#ifdef JEMALLOC_STATS - bool merged_stats = false; -#endif + bool first_pass; assert(binind < nbins); assert(rem <= tbin->ncached); + assert(tbin->ncached > 0 || tbin->avail == NULL); - for (nflush = tbin->ncached - rem; nflush > 0; nflush = ndeferred) { + for (flush = tbin->avail, nflush = tbin->ncached - rem, first_pass = + true; flush != NULL; flush = deferred, nflush = ndeferred) { /* Lock the arena bin associated with the first object. */ - arena_chunk_t *chunk = (arena_chunk_t *)CHUNK_ADDR2BASE( - tbin->avail[0]); + arena_chunk_t *chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(flush); arena_t *arena = chunk->arena; arena_bin_t *bin = &arena->bins[binind]; @@ -86,17 +82,17 @@ tcache_bin_flush_small(tcache_bin_t *tbin, size_t binind, unsigned rem malloc_mutex_lock(&bin->lock); #ifdef JEMALLOC_STATS if (arena == tcache->arena) { - assert(merged_stats == false); - merged_stats = true; bin->stats.nflushes++; bin->stats.nrequests += tbin->tstats.nrequests; tbin->tstats.nrequests = 0; } #endif + deferred = NULL; ndeferred = 0; for (i = 0; i < nflush; i++) { - ptr = tbin->avail[i]; + ptr = flush; assert(ptr != NULL); + flush = *(void **)ptr; chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); if (chunk->arena == arena) { size_t pageind = ((uintptr_t)ptr - @@ -111,31 +107,21 @@ tcache_bin_flush_small(tcache_bin_t *tbin, size_t binind, unsigned rem * locked. Stash the object, so that it can be * handled in a future pass. */ - tbin->avail[ndeferred] = ptr; + *(void **)ptr = deferred; + deferred = ptr; ndeferred++; } } malloc_mutex_unlock(&bin->lock); - } -#ifdef JEMALLOC_STATS - if (merged_stats == false) { - /* - * The flush loop didn't happen to flush to this thread's - * arena, so the stats didn't get merged. Manually do so now. - */ - arena_bin_t *bin = &tcache->arena->bins[binind]; - malloc_mutex_lock(&bin->lock); - bin->stats.nflushes++; - bin->stats.nrequests += tbin->tstats.nrequests; - tbin->tstats.nrequests = 0; - malloc_mutex_unlock(&bin->lock); - } -#endif - memmove(tbin->avail, &tbin->avail[tbin->ncached - rem], - rem * sizeof(void *)); + if (first_pass) { + tbin->avail = flush; + first_pass = false; + } + } + tbin->ncached = rem; - if ((int)tbin->ncached < tbin->low_water) + if (tbin->ncached < tbin->low_water) tbin->low_water = tbin->ncached; } @@ -146,19 +132,18 @@ tcache_bin_flush_large(tcache_bin_t *tbin, size_t binind, unsigned rem #endif ) { - void *ptr; + void *flush, *deferred, *ptr; unsigned i, nflush, ndeferred; -#ifdef JEMALLOC_STATS - bool merged_stats = false; -#endif + bool first_pass; assert(binind < nhbins); assert(rem <= tbin->ncached); + assert(tbin->ncached > 0 || tbin->avail == NULL); - for (nflush = tbin->ncached - rem; nflush > 0; nflush = ndeferred) { + for (flush = tbin->avail, nflush = tbin->ncached - rem, first_pass = + true; flush != NULL; flush = deferred, nflush = ndeferred) { /* Lock the arena associated with the first object. */ - arena_chunk_t *chunk = (arena_chunk_t *)CHUNK_ADDR2BASE( - tbin->avail[0]); + arena_chunk_t *chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(flush); arena_t *arena = chunk->arena; malloc_mutex_lock(&arena->lock); @@ -170,7 +155,6 @@ tcache_bin_flush_large(tcache_bin_t *tbin, size_t binind, unsigned rem tcache->prof_accumbytes = 0; #endif #ifdef JEMALLOC_STATS - merged_stats = true; arena->stats.nrequests_large += tbin->tstats.nrequests; arena->stats.lstats[binind - nbins].nrequests += tbin->tstats.nrequests; @@ -179,10 +163,12 @@ tcache_bin_flush_large(tcache_bin_t *tbin, size_t binind, unsigned rem #if (defined(JEMALLOC_PROF) || defined(JEMALLOC_STATS)) } #endif + deferred = NULL; ndeferred = 0; for (i = 0; i < nflush; i++) { - ptr = tbin->avail[i]; + ptr = flush; assert(ptr != NULL); + flush = *(void **)ptr; chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); if (chunk->arena == arena) arena_dalloc_large(arena, chunk, ptr); @@ -193,32 +179,21 @@ tcache_bin_flush_large(tcache_bin_t *tbin, size_t binind, unsigned rem * Stash the object, so that it can be handled * in a future pass. */ - tbin->avail[ndeferred] = ptr; + *(void **)ptr = deferred; + deferred = ptr; ndeferred++; } } malloc_mutex_unlock(&arena->lock); - } -#ifdef JEMALLOC_STATS - if (merged_stats == false) { - /* - * The flush loop didn't happen to flush to this thread's - * arena, so the stats didn't get merged. Manually do so now. - */ - arena_t *arena = tcache->arena; - malloc_mutex_lock(&arena->lock); - arena->stats.nrequests_large += tbin->tstats.nrequests; - arena->stats.lstats[binind - nbins].nrequests += - tbin->tstats.nrequests; - tbin->tstats.nrequests = 0; - malloc_mutex_unlock(&arena->lock); - } -#endif - memmove(tbin->avail, &tbin->avail[tbin->ncached - rem], - rem * sizeof(void *)); + if (first_pass) { + tbin->avail = flush; + first_pass = false; + } + } + tbin->ncached = rem; - if ((int)tbin->ncached < tbin->low_water) + if (tbin->ncached < tbin->low_water) tbin->low_water = tbin->ncached; } @@ -226,14 +201,10 @@ tcache_t * tcache_create(arena_t *arena) { tcache_t *tcache; - size_t size, stack_offset; + size_t size; unsigned i; size = offsetof(tcache_t, tbins) + (sizeof(tcache_bin_t) * nhbins); - /* Naturally align the pointer stacks. */ - size = PTR_CEILING(size); - stack_offset = size; - size += stack_nelms * sizeof(void *); /* * Round up to the nearest multiple of the cacheline size, in order to * avoid the possibility of false cacheline sharing. @@ -246,8 +217,6 @@ tcache_create(arena_t *arena) if (size <= small_maxclass) tcache = (tcache_t *)arena_malloc_small(arena, size, true); - else if (size <= tcache_maxclass) - tcache = (tcache_t *)arena_malloc_large(arena, size, true); else tcache = (tcache_t *)icalloc(size); @@ -264,12 +233,15 @@ tcache_create(arena_t *arena) tcache->arena = arena; assert((TCACHE_NSLOTS_SMALL_MAX & 1U) == 0); - for (i = 0; i < nhbins; i++) { - tcache->tbins[i].lg_fill_div = 1; - tcache->tbins[i].avail = (void **)((uintptr_t)tcache + - (uintptr_t)stack_offset); - stack_offset += tcache_bin_info[i].ncached_max * sizeof(void *); + for (i = 0; i < nbins; i++) { + if ((arena->bins[i].nregs << 1) <= TCACHE_NSLOTS_SMALL_MAX) { + tcache->tbins[i].ncached_max = (arena->bins[i].nregs << + 1); + } else + tcache->tbins[i].ncached_max = TCACHE_NSLOTS_SMALL_MAX; } + for (; i < nhbins; i++) + tcache->tbins[i].ncached_max = TCACHE_NSLOTS_LARGE; TCACHE_SET(tcache); @@ -280,7 +252,6 @@ void tcache_destroy(tcache_t *tcache) { unsigned i; - size_t tcache_size; #ifdef JEMALLOC_STATS /* Unlink from list of extant tcaches. */ @@ -337,8 +308,7 @@ tcache_destroy(tcache_t *tcache) } #endif - tcache_size = arena_salloc(tcache); - if (tcache_size <= small_maxclass) { + if (arena_salloc(tcache) <= small_maxclass) { arena_chunk_t *chunk = CHUNK_ADDR2BASE(tcache); arena_t *arena = chunk->arena; size_t pageind = ((uintptr_t)tcache - (uintptr_t)chunk) >> @@ -352,13 +322,6 @@ tcache_destroy(tcache_t *tcache) malloc_mutex_lock(&bin->lock); arena_dalloc_bin(arena, chunk, tcache, mapelm); malloc_mutex_unlock(&bin->lock); - } else if (tcache_size <= tcache_maxclass) { - arena_chunk_t *chunk = CHUNK_ADDR2BASE(tcache); - arena_t *arena = chunk->arena; - - malloc_mutex_lock(&arena->lock); - arena_dalloc_large(arena, chunk, tcache); - malloc_mutex_unlock(&arena->lock); } else idalloc(tcache); } @@ -415,13 +378,11 @@ tcache_stats_merge(tcache_t *tcache, arena_t *arena) } #endif -bool +void tcache_boot(void) { if (opt_tcache) { - unsigned i; - /* * If necessary, clamp opt_lg_tcache_max, now that * small_maxclass and arena_maxclass are known. @@ -436,28 +397,6 @@ tcache_boot(void) nhbins = nbins + (tcache_maxclass >> PAGE_SHIFT); - /* Initialize tcache_bin_info. */ - tcache_bin_info = (tcache_bin_info_t *)base_alloc(nhbins * - sizeof(tcache_bin_info_t)); - if (tcache_bin_info == NULL) - return (true); - stack_nelms = 0; - for (i = 0; i < nbins; i++) { - if ((arena_bin_info[i].nregs << 1) <= - TCACHE_NSLOTS_SMALL_MAX) { - tcache_bin_info[i].ncached_max = - (arena_bin_info[i].nregs << 1); - } else { - tcache_bin_info[i].ncached_max = - TCACHE_NSLOTS_SMALL_MAX; - } - stack_nelms += tcache_bin_info[i].ncached_max; - } - for (; i < nhbins; i++) { - tcache_bin_info[i].ncached_max = TCACHE_NSLOTS_LARGE; - stack_nelms += tcache_bin_info[i].ncached_max; - } - /* Compute incremental GC event threshold. */ if (opt_lg_tcache_gc_sweep >= 0) { tcache_gc_incr = ((1U << opt_lg_tcache_gc_sweep) / @@ -473,8 +412,6 @@ tcache_boot(void) abort(); } } - - return (false); } /******************************************************************************/ #endif /* JEMALLOC_TCACHE */ From b07341f998bb9305707f300f52bfce5515d555a5 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 23 Apr 2012 14:35:12 -0400 Subject: [PATCH 0619/1149] Core/Spells: Fix spell cast of greatmother's soulcatcher. closes #1882 --- .../world/2012_04_23_01_world_conditions.sql | 5 +++ src/server/scripts/Spells/spell_item.cpp | 31 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 sql/updates/world/2012_04_23_01_world_conditions.sql diff --git a/sql/updates/world/2012_04_23_01_world_conditions.sql b/sql/updates/world/2012_04_23_01_world_conditions.sql new file mode 100644 index 00000000000..c731426aa3f --- /dev/null +++ b/sql/updates/world/2012_04_23_01_world_conditions.sql @@ -0,0 +1,5 @@ +-- setup alternate conditions for spell 46488 +DELETE FROM `conditions` WHERE `SourceEntry` = 46488 AND `ElseGroup` = 1; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,46488,0,1,31,1,3,26817,0,0,0,'',''), +(13,1,46488,0,1,36,1,0,0,0,1,0,'',''); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 73a77b06408..3c5d6438275 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -2021,6 +2021,37 @@ class spell_item_muisek_vessel : public SpellScriptLoader } }; +enum GreatmothersSoulcather +{ + SPELL_FORCE_CAST_SUMMON_GNOME_SOUL = 46486, +}; +class spell_item_greatmothers_soulcatcher : public SpellScriptLoader +{ +public: + spell_item_greatmothers_soulcatcher() : SpellScriptLoader("spell_item_greatmothers_soulcatcher") { } + + class spell_item_greatmothers_soulcatcher_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_greatmothers_soulcatcher_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetHitUnit()) + GetCaster()->CastSpell(GetCaster(),SPELL_FORCE_CAST_SUMMON_GNOME_SOUL); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_greatmothers_soulcatcher_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_greatmothers_soulcatcher_SpellScript(); + } +}; + void AddSC_item_spell_scripts() { // 23074 Arcanite Dragonling From 81ec7a6c71a9deda2f3c35fdf7eaf3788bac7cad Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Mon, 23 Apr 2012 22:06:48 +0200 Subject: [PATCH 0620/1149] DB/Loot: Rework Prospecting Loot Templates, includes grouping and referencing Closes #6275 --- ..._23_02_world_prospecting_loot_template.sql | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 sql/updates/world/2012_04_23_02_world_prospecting_loot_template.sql diff --git a/sql/updates/world/2012_04_23_02_world_prospecting_loot_template.sql b/sql/updates/world/2012_04_23_02_world_prospecting_loot_template.sql new file mode 100644 index 00000000000..6ea44d92722 --- /dev/null +++ b/sql/updates/world/2012_04_23_02_world_prospecting_loot_template.sql @@ -0,0 +1,112 @@ +SET @TinRef := 13000; +SET @TBC1 := @TinRef+1; +SET @TBC2 := @TinRef+2; +SET @WOTLK1 := @TinRef+3; +SET @WOTLK2 := @TinRef+4; +SET @WOTLK3 := @TinRef+5; + +SET @Copper := 2770; +SET @Tin := 2771; +SET @Iron := 2772; +SET @Mithril := 3858; +SET @Thorium := 10620; +SET @FelIron := 23424; +SET @Adamantite := 23425; +SET @Cobalt := 36909; +SET @Saronite := 36912; +SET @Titanium := 36910; + +-- Reference Loot Templates +DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN @TinRef AND @TinRef+5; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Stupid Tin +(@TinRef,1529,0,1,1,1,1), -- Jade +(@TinRef,3864,0,1,1,1,1), -- Citrine +(@TinRef,7909,0,1,1,1,1), -- Aquamarine +-- TBC Greens +(@TBC1,21929,0,1,1,1,2), -- Flame Spessarite +(@TBC1,23077,0,1,1,1,2), -- Blood Garnet +(@TBC1,23079,0,1,1,1,2), -- Deep Peridot +(@TBC1,23107,0,1,1,1,2), -- Shadow Draenite +(@TBC1,23112,0,1,1,1,2), -- Golden Draenite +(@TBC1,23117,0,1,1,1,2), -- Azure Moonstone +-- TBC Blues +(@TBC2,23436,0,1,1,1,1), -- Living Ruby +(@TBC2,23437,0,1,1,1,1), -- Talasite +(@TBC2,23438,0,1,1,1,1), -- Star of Elune +(@TBC2,23439,0,1,1,1,1), -- Noble Topaz +(@TBC2,23440,0,1,1,1,1), -- Dawnstone +(@TBC2,23441,0,1,1,1,1), -- Nightseye +-- WOTLK Greens +(@WOTLK1,36917,0,1,1,1,2), -- Bloodstone +(@WOTLK1,36920,0,1,1,1,2), -- Sun Crystal +(@WOTLK1,36923,0,1,1,1,2), -- Chalcedony +(@WOTLK1,36926,0,1,1,1,2), -- Shadow Crystal +(@WOTLK1,36929,0,1,1,1,2), -- Huge Citrine +(@WOTLK1,36932,0,1,1,1,2), -- Dark Jade +-- WOTLK Blues +(@WOTLK2,36918,0,1,1,1,2), -- Scarlet Ruby +(@WOTLK2,36921,0,1,1,1,2), -- Autumn's Glow +(@WOTLK2,36924,0,1,1,1,2), -- Sky Sapphire +(@WOTLK2,36927,0,1,1,1,2), -- Twilight Opal +(@WOTLK2,36930,0,1,1,1,2), -- Monarch Topaz +(@WOTLK2,36933,0,1,1,1,2), -- Forest Emerald +-- WOTLK Epics +(@WOTLK3,36919,0,1,1,1,1), -- Cardinal Ruby +(@WOTLK3,36922,0,1,1,1,1), -- King's Amber +(@WOTLK3,36925,0,1,1,1,1), -- Majestic Zircon +(@WOTLK3,36928,0,1,1,1,1), -- Dreadstone +(@WOTLK3,36931,0,1,1,1,1), -- Ametrine +(@WOTLK3,36934,0,1,1,1,1); -- Eye of Zul +-- -------------------------------------------------------- +-- Prospecting Loot Templates +DELETE FROM `prospecting_loot_template` WHERE `entry` IN (@Copper,@Tin,@Iron,@Mithril,@Thorium,@FelIron,@Adamantite,@Cobalt,@Saronite,@Titanium); +INSERT INTO `prospecting_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Copper Ore +(@Copper,774,0,1,1,1,1), -- Malachite +(@Copper,818,0,1,1,1,1), -- Tigerseye +(@Copper,1210,10,1,0,1,1), -- Shadowgem +-- Tin Ore +(@Tin,1210,0,1,1,1,2), -- Shadowgem +(@Tin,1705,0,1,1,1,2), -- Lesser Moonstone +(@Tin,1206,0,1,1,1,2), -- Moss Agate +(@Tin,1,10,1,0,-@TinRef,1), -- One Rare gem chance +-- Iron Ore +(@Iron,1529,30,1,1,1,2), -- Jade +(@Iron,1705,30,1,1,1,2), -- Lesser Moonstone +(@Iron,3864,30,1,1,1,2), -- Citrine +(@Iron,7909,5,1,1,1,1), -- Aquamarine +(@Iron,7910,5,1,1,1,1), -- Star Ruby +-- Mithril Ore +(@Mithril,3864,30,1,1,1,2), -- Citrine +(@Mithril,7909,30,1,1,1,2), -- Aquamarine +(@Mithril,7910,30,1,1,1,2), -- Star Ruby +(@Mithril,12361,2.5,1,1,1,1), -- Blue Sapphire +(@Mithril,12364,2.5,1,1,1,1), -- Huge Emerald +(@Mithril,12799,2.5,1,1,1,1), -- Large Opal +(@Mithril,12800,2.5,1,1,1,1), -- Azerothian Diamond +-- Thorium Ore +(@Thorium,7910,30,1,1,1,2), -- Star Ruby +(@Thorium,12361,15,1,1,1,2), -- Blue Sapphire +(@Thorium,12364,15,1,1,1,2), -- Huge Emerald +(@Thorium,12799,15,1,1,1,2), -- Large Opal +(@Thorium,12800,15,1,1,1,2), -- Azerothian Diamond +(@Thorium,1,10,1,1,-@TBC1,1), -- one from TBC Greens +-- Fel Iron Ore +(@FelIron,1,95,1,1,-@TBC1,1), -- One from TBC Greens +(@FelIron,2,05,1,1,-@TBC2,1), -- One from TBC Blues +-- Adamantite Ore +(@Adamantite,24243,100,1,0,1,1), -- Adamantite Powder +(@Adamantite,1,100,1,1,-@TBC1,1), -- One from TBC Greens +(@Adamantite,2, 10,1,1,-@TBC2,1), -- One from TBC Blues +-- Cobalt Ore +(@Cobalt,1,95,1,1,-@WOTLK1,1), -- One from WOTLK Greens +(@Cobalt,2,05,1,1,-@WOTLK2,1), -- One from WOTLK Blues +-- Saronite Ore +(@Saronite,1,85,1,1,-@WOTLK1,2), -- One from WOTLK Greens +(@Saronite,2,15,1,1,-@WOTLK2,1), -- One from WOTLK Blues +-- Titanium Ore +(@Titanium,46849,75,1,0,1,1), -- Titanium Powder +(@Titanium,1,75,1,1,-@WOTLK1,2), -- Two from WOTLK Greens +(@Titanium,2,25,1,1,-@WOTLK2,1), -- One from WOTLK Blues +(@Titanium,3,20,1,0,-@WOTLK3,1); -- One from WOTLK Epics From 7901e28b762396fbb74e236d184619b6594c9dfd Mon Sep 17 00:00:00 2001 From: Helias Date: Mon, 23 Apr 2012 22:13:35 +0200 Subject: [PATCH 0621/1149] DB/Loot: Add some missing skinning loot templates Closes #5972 --- ..._04_23_03_world_skinning_loot_template.sql | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 sql/updates/world/2012_04_23_03_world_skinning_loot_template.sql diff --git a/sql/updates/world/2012_04_23_03_world_skinning_loot_template.sql b/sql/updates/world/2012_04_23_03_world_skinning_loot_template.sql new file mode 100644 index 00000000000..a1aa9e070f2 --- /dev/null +++ b/sql/updates/world/2012_04_23_03_world_skinning_loot_template.sql @@ -0,0 +1,44 @@ +UPDATE `creature_template` SET `skinloot`=entry WHERE `entry` IN (30260, 32517, 27641, 28860); +UPDATE `creature_template` SET `skinloot`=70202 WHERE `entry` IN (25774,29693); +UPDATE `creature_template` SET `skinloot`=70203 WHERE `entry`=28257; +UPDATE `creature_template` SET `skinloot`=70207 WHERE `entry`=34137; +UPDATE `creature_template` SET `skinloot`=70208 WHERE `entry` IN (32572,25448,25716,25713); +UPDATE `creature_template` SET `skinloot`=70210 WHERE `entry` IN (33528,40419,26723,31134,36891); +UPDATE `creature_template` SET `skinloot`=70211 WHERE `entry` IN (28847,30206,29875,29931,28203,30432); +UPDATE `creature_template` SET `skinloot`=70212 WHERE `entry` IN (27645,32377,29838,26628,26622,32490,38453,32485,26633,32400,32361,29768,29735,26641,27644,27642,26735,26730,26722,33776,35189,26716,26672,29664,29774); +UPDATE `creature_template` SET `skinloot`=70213 WHERE `entry` IN (27483,29312); +UPDATE `creature_template` SET `skinloot`=70214 WHERE `entry` IN (37217,34564); +UPDATE `creature_template` SET `skinloot`=27641 WHERE `entry` IN (31385,34269,34270,27641,30905,30353); + +DELETE FROM `skinning_loot_template` WHERE entry IN (30260,32517,70212,70213,70214,28860,27641); +INSERT INTO `skinning_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `groupid`, `mincountOrRef`, `maxcount`) VALUES +-- Stoic Mammoth +(30260,33568,100,0,1,3), -- Borean Leather +(30260,42542,-50,0,1,1), -- Stoic Mammoth Hide +-- Loque'nahak +(32517,33568,0,1,1,3), -- Borean Leather +(32517,44128,2,1,1,1), -- Arctic Fur +(32517,44687,100,0,1,1), -- Loque'Nahak's Pelt +-- skinloot 70212 +(70212,33568,0,1,1,3), -- Borean Leather +(70212,44128,1,1,1,1), -- Arctic Fur +-- skinloot 70213 +(70213,33568,0,1,5,12), -- Borean Leather +(70213,44128,1,1,1,1), -- Arctic Fur +-- skinloot 70214 +(70214,33568,0,1,12,16), -- Borean Leather +(70214,44128,25,1,1,1), -- Arctic Fur +-- Sartharion +(28860,33568,0,1,8,12), -- Borean Leather +(28860,38557,0,1,8,12),-- Icy Dragonscale +(28860,44128,1,1,1,1), -- Arctic Fur +-- Centrifuge Construct +(27641,41337,85,0,1,3), -- Whizzed-Out Gizmo +(27641,41338,80,0,1,3), -- Sprung Whirlygig +(27641,39690,15,0,1,3), -- Volatile Blasting Trigger +(27641,39684,8,0,1,1), -- Hair Trigger +(27641,36813,8,0,1,3), -- Sprung Sprocket +(27641,39681,8,0,2,4), -- Handful of Cobalt Bolts +(27641,49050,2,0,1,1), -- Schematic: Jeeves +(27641,39682,1,0,1,1), -- Overcharged Capacitor +(27641,39685,1,0,1,1); -- Indestructible Frame From e98dc0e8384ff86f79abe6d741d16a55ba448911 Mon Sep 17 00:00:00 2001 From: Gecko32 Date: Mon, 23 Apr 2012 22:18:42 +0200 Subject: [PATCH 0622/1149] DB/Loot: Correct Mote of Life dropchance Closes #5692 --- .../world/2012_04_23_04_world_creature_loot_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_04_23_04_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_04_23_04_world_creature_loot_template.sql b/sql/updates/world/2012_04_23_04_world_creature_loot_template.sql new file mode 100644 index 00000000000..94d2b092d12 --- /dev/null +++ b/sql/updates/world/2012_04_23_04_world_creature_loot_template.sql @@ -0,0 +1,2 @@ +-- Correct dropchance for Mote of Life, wowhead was wrong (as usual) +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=18.5307 WHERE `entry`=22307 AND `item`=22575; From ef9733e62bade33c37051c9e491222b6fdca7d4d Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Mon, 23 Apr 2012 22:22:21 +0200 Subject: [PATCH 0623/1149] DB/Loot: Correct dropchances for the Quest Kindness Closes #6301 --- .../world/2012_04_23_05_world_creature_loot_template.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2012_04_23_05_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_04_23_05_world_creature_loot_template.sql b/sql/updates/world/2012_04_23_05_world_creature_loot_template.sql new file mode 100644 index 00000000000..ddf0780d362 --- /dev/null +++ b/sql/updates/world/2012_04_23_05_world_creature_loot_template.sql @@ -0,0 +1,3 @@ +-- Update the dropchance to 100% if on quest +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=-100 WHERE `entry`=21477 AND `item`=31372; -- Rocknail Flayer Carcass +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=-100 WHERE `entry`=21478 AND `item`=31373; -- Rocknail Flayer Giblets From e1a90bc779dc7f5c7f568749bac02645288ee8d7 Mon Sep 17 00:00:00 2001 From: Kezo90 Date: Mon, 23 Apr 2012 22:29:56 +0200 Subject: [PATCH 0624/1149] DB/Spells: bonus data corrections: - Lacerate DD scale with Attack Power, - Living Bomb scales correctly, - lots of spells do not scale with Spell Power, - minor corrections around Seals and Judgements. --- .../2012_04_23_02_world_spell_bonus_data.sql | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 sql/updates/world/2012_04_23_02_world_spell_bonus_data.sql diff --git a/sql/updates/world/2012_04_23_02_world_spell_bonus_data.sql b/sql/updates/world/2012_04_23_02_world_spell_bonus_data.sql new file mode 100644 index 00000000000..b7f61f407b4 --- /dev/null +++ b/sql/updates/world/2012_04_23_02_world_spell_bonus_data.sql @@ -0,0 +1,102 @@ +-- Death Knight +DELETE FROM `spell_bonus_data` WHERE `entry` IN(58621, 47632, 47633, 50444, 70890, 50526, 48982, 59754, 49184); +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(58621, 0, -1, 0.08, -1, 'Death Knight - Glyph of Chains of Ice'), -- Shouldn't scale with SP. +(47632, 0, -1, 0.15, -1, 'Death Knight - Death Coil'), -- Shouldn't scale with SP. +(47633, 0, -1, 0.15, -1, 'Death Knight - Death Coil (Heal)'), -- Shouldn't scale with SP. +(50444, 0, -1, 0.105, -1, 'Death Knight - Corpse Explosion (Triggered)'), -- Shouldn't scale with SP. +(70890, 0, -1, -1, -1, 'Death Knight - Scourge Strike (Shadow)'), -- Shouldn't scale with SP. +(50526, 0, -1, -1, -1, 'Death Knight - Wandering Plague (Triggered)'), -- Shouldn't scale with SP. +(48982, 0, -1, -1, -1, 'Death Knight - Rune Tap'), -- Shouldn't scale with SP. +(59754, 0, -1, -1, -1, 'Death Knight - Glyph of Rune Tap (Triggered)'), -- Shouldn't scale with SP. +(49184, 0, -1, 0.2, -1, 'Death Knight - Howling Blast'); -- Shouldn't scale with SP. + +-- Druid +DELETE FROM `spell_bonus_data` WHERE `entry` IN(48450, 48451); -- Lifebloom Rank 2, Rank 3 +DELETE FROM `spell_bonus_data` WHERE `entry` IN(48567, 48568); -- Lacerate Rank 2, Rank 3 +DELETE FROM `spell_bonus_data` WHERE `entry` IN(33745, 9007); +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(33745, 0, 0, 0.01, 0.01, 'Druid - Lacerate ($AP*0.05/number of ticks)'), -- Direct damage should scale with AP, based on DrDamage addon(3.3.5a). +(9007, -1, 0, -1, 0.03, 'Druid - Pounce Bleed (Triggered)'); -- Shouldn't scale with SP. Increase AP coefficient, based on DrDamage addon(3.3.5a) and Wowwiki.com. + +-- Hunter +DELETE FROM `spell_bonus_data` WHERE `entry` IN(56641, 42243, 3674, 19306, 1495, 63468, 136); +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(56641, 0, -1, 0.1, -1, 'Hunter - Steady Shot'), -- Shouldn't scale with SP. +(42243, 0, -1, 0.0837, -1, 'Hunter - Volley (Triggered)'), -- Shouldn't scale with SP. +(3674, -1, 0, -1, 0.023, 'Hunter - Black Arrow ($RAP*0.1 / number of ticks)'), -- Shouldn't scale with SP. Increase AP coefficient, based on DrDamage addon(3.3.5a). +(19306, 0, -1, 0.2, -1, 'Hunter - Counterattack'), -- Shouldn't scale with SP. +(1495, 0, -1, 0.2, -1, 'Hunter - Mongoose Bite'), -- Shouldn't scale with SP. +(63468, -1, 0, -1, -1, 'Hunter - Piercing Shots'), -- Shouldn't scale with SP. +(136, -1, 0, -1, -1, 'Hunter - Mend Pet'); -- Shouldn't scale with SP. + +-- Mage +DELETE FROM `spell_bonus_data` WHERE `entry`=7269; -- Arcane Missiles Triggered Spell Rank 2 +DELETE FROM `spell_bonus_data` WHERE `entry` IN(133, 44614, 44457, 44461); +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(133, 1, 0, -1, -1, 'Mage - Fireball'), -- DoT componenet shouldn't scale. +(44614, 0.8571, 0, -1, -1, 'Mage - Frostfire Bolt'), -- DoT componenet shouldn't scale. +(44457, -1, 0.2, -1, -1, 'Mage - Living Bomb ($SP*0.8 / number of ticks)'), -- Direct damage bonus correction. +(44461, 0.4286, -1, -1, -1, 'Mage - Living Bomb (Triggered)'); -- Direct damage bonus correction. + +-- Paladin +DELETE FROM `spell_bonus_data` WHERE `entry` IN(633, 54158, 20467, 20187, 31803, 53742, 31804, 53733); +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(633, 0, -1, -1, -1, 'Paladin - Lay on Hands'), -- Shouldn't scale with SP. +(54158, 0.27, -1, 0.175, -1, 'Paladin - Judgement (Seal of Light, Seal of Wisdom, Seal of Justice)'), -- Increase coefficient, based on Wowwiki.com. +(20467, 0.14, -1, 0.115, -1, 'Paladin - Judgement of Command'), -- Decrease coefficient, based on Wowwiki.com. +(20187, 0.355, -1, 0.225, -1, 'Paladin - Judgement of Righteousness'), -- Increase coefficient, based on Wowwiki.com. +(31803, -1, 0.0132, -1, 0.0252, 'Paladin - Holy Vengeance'), -- Decrease coefficient, based on DrDamage addon(3.3.5a) and Wowwiki.com. +(53742, -1, 0.0132, -1, 0.0252, 'Paladin - Blood Corruption'), -- Decrease coefficient, based on DrDamage addon(3.3.5a) and Wowwiki.com. +(31804, 0.24, -1, 0.15, -1, 'Paladin - Judgement of Vengeance'), -- Increase coefficient, based on Wowwiki.com. +(53733, 0.24, -1, 0.15, -1, 'Paladin - Judgement of Corruption'); -- Increase coefficient, based on Wowwiki.com. + +-- Priest +DELETE FROM `spell_bonus_data` WHERE `entry` IN(52983, 52954, 58985); -- Penance Heal Rank 2, Rank 3, Rank 4 +DELETE FROM `spell_bonus_data` WHERE `entry` IN(52998, 52999, 53000); -- Penance Hurt Rank 2, Rank 3, Rank 4 +DELETE FROM `spell_bonus_data` WHERE `entry` IN(7001); +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(7001, -1, 0.626, -1, -1, 'Priest - Lightwell Renew ($SP*1.878 / number of ticks)'); -- Increase coefficient, based on DrDamage addon(3.3.5a). + +-- Rogue +DELETE FROM `spell_bonus_data` WHERE `entry` IN(819, 11353, 11354, 25349, 26968, 27187, 57969, 57970); -- Deadly Poison Rank 2, Rank 3, etc. +DELETE FROM `spell_bonus_data` WHERE `entry` IN(8685, 8689, 11335, 11336, 11337, 26890, 57964, 57965); -- Instant Poison Rank 2, Rank 3, etc. +DELETE FROM `spell_bonus_data` WHERE `entry` IN(13222, 13223, 13224, 27189, 57974, 57975); -- Wound Poison Rank 2, Rank 3, etc. +DELETE FROM `spell_bonus_data` WHERE `entry` IN(32645, 2098, 703, 1776, 1943, 8680, 26688, 13218); +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(32645, 0, -1, -1, -1, 'Rogue - Envenom'), -- Shouldn't scale with SP. +(2098, 0, -1, -1, -1, 'Rogue - Eviscerate'), -- Shouldn't scale with SP. +(703, -1, 0, -1, 0.07, 'Rogue - Garrote'), -- Shouldn't scale with SP. +(1776, 0, -1, 0.21, -1, 'Rogue - Gouge'), -- Shouldn't scale with SP. +(1943, -1, 0, -1, -1, 'Rogue - Rupture'), -- Shouldn't scale with SP. +(8680, 0, -1, 0.1, -1, 'Rogue - Instant Poison'), -- Shouldn't scale with SP. +(26688, 0, -1, 0, -1, 'Rogue - Anesthetic Poison'), -- Shouldn't scale with SP nor AP. +(13218, 0, -1, 0.04, -1, 'Rogue - Wound Poison'); -- Shouldn't scale with SP. + + -- Warlock Healthstones Shouldn't scale with SP. +DELETE FROM `spell_bonus_data` WHERE `entry` IN (6262, 23468, 23469, 6263, 23470, 23471, 5720, 23472, 23473, 5723, 23474, 23475, 11732, 23476, 23477, 27235, 27236, 27237, 47874, 47873, 47872, 47875, 47876, 47877); +INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES +(6262, 0, -1, 0, -1, 'Warlock - HS - Minor Healthstone (with 0/2 Improved Healthstone)'), +(23468, 0, -1, 0, -1, 'Warlock - HS - Minor Healthstone (with 1/2 Improved Healthstone)'), +(23469, 0, -1, 0, -1, 'Warlock - HS - Minor Healthstone (with 2/2 Improved Healthstone)'), +(6263, 0, -1, 0, -1, 'Warlock - HS - Lesser Healthstone (with 0/2 Improved Healthstone)'), +(23470, 0, -1, 0, -1, 'Warlock - HS - Lesser Healthstone (with 1/2 Improved Healthstone)'), +(23471, 0, -1, 0, -1, 'Warlock - HS - Lesser Healthstone (with 2/2 Improved Healthstone)'), +(5720, 0, -1, 0, -1, 'Warlock - HS - Healthstone (with 0/2 Improved Healthstone)'), +(23472, 0, -1, 0, -1, 'Warlock - HS - Healthstone (with 1/2 Improved Healthstone)'), +(23473, 0, -1, 0, -1, 'Warlock - HS - Healthstone (with 2/2 Improved Healthstone)'), +(5723, 0, -1, 0, -1, 'Warlock - HS - Greater Healthstone (with 0/2 Improved Healthstone)'), +(23474, 0, -1, 0, -1, 'Warlock - HS - Greater Healthstone (with 1/2 Improved Healthstone)'), +(23475, 0, -1, 0, -1, 'Warlock - HS - Greater Healthstone (with 2/2 Improved Healthstone)'), +(11732, 0, -1, 0, -1, 'Warlock - HS - Major Healthstone (with 0/2 Improved Healthstone)'), +(23476, 0, -1, 0, -1, 'Warlock - HS - Major Healthstone (with 1/2 Improved Healthstone)'), +(23477, 0, -1, 0, -1, 'Warlock - HS - Major Healthstone (with 2/2 Improved Healthstone)'), +(27235, 0, -1, 0, -1, 'Warlock - HS - Master Healthstone (with 0/2 Improved Healthstone)'), +(27236, 0, -1, 0, -1, 'Warlock - HS - Master Healthstone (with 1/2 Improved Healthstone)'), +(27237, 0, -1, 0, -1, 'Warlock - HS - Master Healthstone (with 2/2 Improved Healthstone)'), +(47874, 0, -1, 0, -1, 'Warlock - HS - Demonic Healthstone (with 0/2 Improved Healthstone)'), +(47873, 0, -1, 0, -1, 'Warlock - HS - Demonic Healthstone (with 1/2 Improved Healthstone)'), +(47872, 0, -1, 0, -1, 'Warlock - HS - Demonic Healthstone (with 2/2 Improved Healthstone)'), +(47875, 0, -1, 0, -1, 'Warlock - HS - Fel Healthstone (with 0/2 Improved Healthstone)'), +(47876, 0, -1, 0, -1, 'Warlock - HS - Fel Healthstone (with 1/2 Improved Healthstone)'), +(47877, 0, -1, 0, -1, 'Warlock - HS - Fel Healthstone (with 2/2 Improved Healthstone)'); From 15e2210c3056cc93cc96445042e771c97e18262b Mon Sep 17 00:00:00 2001 From: Kezo90 Date: Mon, 23 Apr 2012 22:30:59 +0200 Subject: [PATCH 0625/1149] DB/Spells: remove unneeded 'Mangle - Remover'. --- sql/updates/world/2012_04_23_04_world_spell_linked_spell.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2012_04_23_04_world_spell_linked_spell.sql diff --git a/sql/updates/world/2012_04_23_04_world_spell_linked_spell.sql b/sql/updates/world/2012_04_23_04_world_spell_linked_spell.sql new file mode 100644 index 00000000000..48613dca725 --- /dev/null +++ b/sql/updates/world/2012_04_23_04_world_spell_linked_spell.sql @@ -0,0 +1 @@ +DELETE FROM `spell_linked_spell` WHERE `comment`='Mangle - Remover'; -- This stacking rule became useless when written in the `spell_group` table. \ No newline at end of file From 61219cf9db08f40e53c8e91a0e90e93900e43f61 Mon Sep 17 00:00:00 2001 From: Kezo90 Date: Mon, 23 Apr 2012 22:31:39 +0200 Subject: [PATCH 0626/1149] DB/Spells: Rogue T9 2P - Should proc only from Rupture ticks. --- sql/updates/world/2012_04_23_03_world_spell_proc_event.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2012_04_23_03_world_spell_proc_event.sql diff --git a/sql/updates/world/2012_04_23_03_world_spell_proc_event.sql b/sql/updates/world/2012_04_23_03_world_spell_proc_event.sql new file mode 100644 index 00000000000..dfa57b031c3 --- /dev/null +++ b/sql/updates/world/2012_04_23_03_world_spell_proc_event.sql @@ -0,0 +1,4 @@ + -- Rogue T9 2P - Should proc only from Rupture ticks. +DELETE FROM `spell_proc_event` WHERE `entry` IN(67209); +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `procFlags`) VALUES +(67209, 0x01, 8, 0x100000, 0x50000); \ No newline at end of file From 125efc7dc805aebc9b3c3e7f56ea2f4c2aed109e Mon Sep 17 00:00:00 2001 From: Shocker Date: Tue, 24 Apr 2012 03:29:16 +0300 Subject: [PATCH 0627/1149] DB/SQLs: Small corrections to sql files from recent pull requests --- ..._04_00_world_command.sql => 2012_04_24_00_world_command.sql} | 2 +- ..._proc_event.sql => 2012_04_24_01_world_spell_proc_event.sql} | 2 +- ..._warden_checks.sql => 2012_04_24_02_world_warden_checks.sql} | 0 ...ipt_names.sql => 2012_04_24_03_world_spell_script_names.sql} | 1 + ..._proc_event.sql => 2012_04_24_04_world_spell_proc_event.sql} | 2 +- 5 files changed, 4 insertions(+), 3 deletions(-) rename sql/updates/world/{2012_04_04_00_world_command.sql => 2012_04_24_00_world_command.sql} (99%) rename sql/updates/world/{2012_04_11_00_world_spell_proc_event.sql => 2012_04_24_01_world_spell_proc_event.sql} (87%) rename sql/updates/world/{2012_04_17_00_world_warden_checks.sql => 2012_04_24_02_world_warden_checks.sql} (100%) rename sql/updates/world/{2012_04_22_01_world_spell_script_names.sql => 2012_04_24_03_world_spell_script_names.sql} (90%) rename sql/updates/world/{2012_04_23_03_world_spell_proc_event.sql => 2012_04_24_04_world_spell_proc_event.sql} (85%) diff --git a/sql/updates/world/2012_04_04_00_world_command.sql b/sql/updates/world/2012_04_24_00_world_command.sql similarity index 99% rename from sql/updates/world/2012_04_04_00_world_command.sql rename to sql/updates/world/2012_04_24_00_world_command.sql index 9adb3cff1d9..25912392347 100644 --- a/sql/updates/world/2012_04_04_00_world_command.sql +++ b/sql/updates/world/2012_04_24_00_world_command.sql @@ -7,4 +7,4 @@ INSERT INTO `command` (`name`, `security`, `help`) VALUES ('modify speed all', 1 ('modify talentpoints', 1, 'Syntax: .modify talentpoints #amount\r\n\r\nSet free talent points for selected character or character\'s pet. It will be reset to default expected at next levelup/login/quest reward.'), ('morph', 2, 'Syntax: .morph #displayid\r\n\r\nChange your current model id to #displayid.'), ('modify arenapoints', 1, 'Syntax: .modify arenapoints #value\r\nAdd $amount arena points to the selected player.'); -UPDATE `command` SET `help`='Syntax: .modify speed $speedtype #rate\r\n\r\nModify the running speed of the selected player to "normal base run speed"= 1. If no player is selected, modify your speed.\r\n\r\n$speedtypes may be fly, all, walk, backwalk, or swim.\r\n\r\n #rate may range from 0.1 to 50.' WHERE `name`='modify speed' LIMIT 1; \ No newline at end of file +UPDATE `command` SET `help`='Syntax: .modify speed $speedtype #rate\r\n\r\nModify the running speed of the selected player to "normal base run speed"= 1. If no player is selected, modify your speed.\r\n\r\n$speedtypes may be fly, all, walk, backwalk, or swim.\r\n\r\n #rate may range from 0.1 to 50.' WHERE `name`='modify speed' LIMIT 1; diff --git a/sql/updates/world/2012_04_11_00_world_spell_proc_event.sql b/sql/updates/world/2012_04_24_01_world_spell_proc_event.sql similarity index 87% rename from sql/updates/world/2012_04_11_00_world_spell_proc_event.sql rename to sql/updates/world/2012_04_24_01_world_spell_proc_event.sql index e5dfbeb0e66..6e997931bb5 100644 --- a/sql/updates/world/2012_04_11_00_world_spell_proc_event.sql +++ b/sql/updates/world/2012_04_24_01_world_spell_proc_event.sql @@ -1,4 +1,4 @@ --- Honor Among Thieves proc +-- Honor Among Thieves proc chance UPDATE `spell_proc_event` SET `CustomChance`=33 WHERE `entry`=51698; -- Rank 1 UPDATE `spell_proc_event` SET `CustomChance`=66 WHERE `entry`=51700; -- Rank 2 UPDATE `spell_proc_event` SET `CustomChance`=100 WHERE `entry`=51701; -- Rank 3 diff --git a/sql/updates/world/2012_04_17_00_world_warden_checks.sql b/sql/updates/world/2012_04_24_02_world_warden_checks.sql similarity index 100% rename from sql/updates/world/2012_04_17_00_world_warden_checks.sql rename to sql/updates/world/2012_04_24_02_world_warden_checks.sql diff --git a/sql/updates/world/2012_04_22_01_world_spell_script_names.sql b/sql/updates/world/2012_04_24_03_world_spell_script_names.sql similarity index 90% rename from sql/updates/world/2012_04_22_01_world_spell_script_names.sql rename to sql/updates/world/2012_04_24_03_world_spell_script_names.sql index bd4becdc3f4..a53d8bd585c 100644 --- a/sql/updates/world/2012_04_22_01_world_spell_script_names.sql +++ b/sql/updates/world/2012_04_24_03_world_spell_script_names.sql @@ -1,3 +1,4 @@ +-- Earthen Power DELETE FROM `spell_script_names` WHERE `spell_id`=59566; INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES (59566,'spell_sha_earthen_power'); diff --git a/sql/updates/world/2012_04_23_03_world_spell_proc_event.sql b/sql/updates/world/2012_04_24_04_world_spell_proc_event.sql similarity index 85% rename from sql/updates/world/2012_04_23_03_world_spell_proc_event.sql rename to sql/updates/world/2012_04_24_04_world_spell_proc_event.sql index dfa57b031c3..5ba6f24ccf8 100644 --- a/sql/updates/world/2012_04_23_03_world_spell_proc_event.sql +++ b/sql/updates/world/2012_04_24_04_world_spell_proc_event.sql @@ -1,4 +1,4 @@ -- Rogue T9 2P - Should proc only from Rupture ticks. DELETE FROM `spell_proc_event` WHERE `entry` IN(67209); INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `procFlags`) VALUES -(67209, 0x01, 8, 0x100000, 0x50000); \ No newline at end of file +(67209, 0x01, 8, 0x100000, 0x50000); From dac537c588ce8464fcfdb69b76f13cdd8aa6ee02 Mon Sep 17 00:00:00 2001 From: Kezo90 Date: Tue, 24 Apr 2012 09:19:04 +0200 Subject: [PATCH 0628/1149] fixup! DB/Spells: remove unneeded 'Mangle - Remover'. --- ...2012_04_23_04_world_spell_linked_spell.sql | 1 - ...2012_04_24_xx_world_spell_linked_spell.sql | 51 +++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) delete mode 100644 sql/updates/world/2012_04_23_04_world_spell_linked_spell.sql create mode 100644 sql/updates/world/2012_04_24_xx_world_spell_linked_spell.sql diff --git a/sql/updates/world/2012_04_23_04_world_spell_linked_spell.sql b/sql/updates/world/2012_04_23_04_world_spell_linked_spell.sql deleted file mode 100644 index 48613dca725..00000000000 --- a/sql/updates/world/2012_04_23_04_world_spell_linked_spell.sql +++ /dev/null @@ -1 +0,0 @@ -DELETE FROM `spell_linked_spell` WHERE `comment`='Mangle - Remover'; -- This stacking rule became useless when written in the `spell_group` table. \ No newline at end of file diff --git a/sql/updates/world/2012_04_24_xx_world_spell_linked_spell.sql b/sql/updates/world/2012_04_24_xx_world_spell_linked_spell.sql new file mode 100644 index 00000000000..6109c8db068 --- /dev/null +++ b/sql/updates/world/2012_04_24_xx_world_spell_linked_spell.sql @@ -0,0 +1,51 @@ +-- delete 'Mangle - Remover' +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33876 AND `spell_effect`=-48564 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33876 AND `spell_effect`=-48563 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33876 AND `spell_effect`=-33987 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33876 AND `spell_effect`=-33986 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33876 AND `spell_effect`=-33878 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33878 AND `spell_effect`=-48566 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33878 AND `spell_effect`=-48565 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33878 AND `spell_effect`=-33983 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33878 AND `spell_effect`=-33982 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33878 AND `spell_effect`=-33876 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33982 AND `spell_effect`=-48564 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33982 AND `spell_effect`=-48563 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33982 AND `spell_effect`=-33987 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33982 AND `spell_effect`=-33986 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33982 AND `spell_effect`=-33878 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33983 AND `spell_effect`=-48564 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33983 AND `spell_effect`=-48563 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33983 AND `spell_effect`=-33987 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33983 AND `spell_effect`=-33986 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33983 AND `spell_effect`=-33878 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33986 AND `spell_effect`=-48566 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33986 AND `spell_effect`=-48565 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33986 AND `spell_effect`=-33983 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33986 AND `spell_effect`=-33982 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33986 AND `spell_effect`=-33876 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33987 AND `spell_effect`=-48566 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33987 AND `spell_effect`=-48565 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33987 AND `spell_effect`=-33983 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33987 AND `spell_effect`=-33982 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33987 AND `spell_effect`=-33876 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48563 AND `spell_effect`=-48566 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48563 AND `spell_effect`=-48565 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48563 AND `spell_effect`=-33983 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48563 AND `spell_effect`=-33982 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48563 AND `spell_effect`=-33876 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48564 AND `spell_effect`=-48566 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48564 AND `spell_effect`=-48565 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48564 AND `spell_effect`=-33983 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48564 AND `spell_effect`=-33982 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48564 AND `spell_effect`=-33876 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48565 AND `spell_effect`=-48564 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48565 AND `spell_effect`=-48563 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48565 AND `spell_effect`=-33987 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48565 AND `spell_effect`=-33986 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48565 AND `spell_effect`=-33878 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48566 AND `spell_effect`=-48564 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48566 AND `spell_effect`=-48563 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48566 AND `spell_effect`=-33987 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48566 AND `spell_effect`=-33986 AND `type`=1; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48566 AND `spell_effect`=-33878 AND `type`=1; From 396b1ded1a047182c2c3d0244f94ff6baba1d36d Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Tue, 24 Apr 2012 10:11:54 +0200 Subject: [PATCH 0629/1149] DB/Loot: Fix loot for some Bloodsail creatures, thx Exodius Closes # 5483 --- .../world/2012_04_24_05_world_creature_loot_template.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sql/updates/world/2012_04_24_05_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_04_24_05_world_creature_loot_template.sql b/sql/updates/world/2012_04_24_05_world_creature_loot_template.sql new file mode 100644 index 00000000000..c524999b492 --- /dev/null +++ b/sql/updates/world/2012_04_24_05_world_creature_loot_template.sql @@ -0,0 +1,9 @@ +-- Apply same loot template to below mentioned Bloodsail NPCs as that of Bloodsail Raider 1561 +-- (Mage 1562, Swashbuckler 1563, Warlock 1564, Sea Dog 1565) +UPDATE `creature_template` SET `lootid`=1561 WHERE `entry` IN (1562,1563,1564,1565); +-- Remove Loot from `creature_loot_template` for above mentioned NPCs because it contains only 2 items. +-- Those 2 items, along with complete loot template for these mobs is applied in query above. +DELETE FROM `creature_loot_template` WHERE `entry` IN (1562,1563,1564,1565); +-- Remove loot and gold drop from Bloodsail Warlock's Minions +UPDATE `creature_template` SET `lootid`=0, `mingold`=0 AND `maxgold`=0 WHERE `entry` IN (10928,12922); +DELETE FROM `creature_loot_template` WHERE `entry` IN (10928,12922); From 1851a2e9e3a44d997488adaee43ac274476baef8 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 24 Apr 2012 16:53:37 +0200 Subject: [PATCH 0630/1149] Scripts: Replaced calls to ForcedDespawn with DespawnOrUnsummon (calls appropriate AI hooks in case of temporary summons) and made ForcedDespawn private --- src/server/game/Entities/Creature/Creature.cpp | 2 +- src/server/game/Entities/Creature/Creature.h | 3 ++- .../EasternKingdoms/ScarletEnclave/chapter1.cpp | 4 ++-- src/server/scripts/Kalimdor/bloodmyst_isle.cpp | 2 +- src/server/scripts/Kalimdor/durotar.cpp | 4 ++-- src/server/scripts/Kalimdor/dustwallow_marsh.cpp | 2 +- .../IcecrownCitadel/boss_valithria_dreamwalker.cpp | 4 ++-- .../Northrend/IcecrownCitadel/icecrown_citadel.cpp | 2 +- .../scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp | 4 ++-- .../scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp | 10 +++++----- src/server/scripts/Northrend/borean_tundra.cpp | 2 +- src/server/scripts/Northrend/storm_peaks.cpp | 6 +++--- src/server/scripts/Outland/blades_edge_mountains.cpp | 2 +- src/server/scripts/Outland/nagrand.cpp | 4 ++-- src/server/scripts/Outland/netherstorm.cpp | 2 +- src/server/scripts/Spells/spell_item.cpp | 2 +- src/server/scripts/Spells/spell_quest.cpp | 2 +- src/server/scripts/World/go_scripts.cpp | 6 +++--- 18 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index ed89041ff66..fde85feb8d9 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -135,7 +135,7 @@ CreatureBaseStats const* CreatureBaseStats::GetBaseStats(uint8 level, uint8 unit bool ForcedDespawnDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) { - m_owner.ForcedDespawn(); + m_owner.DespawnOrUnsummon(); // since we are here, we are not TempSummon as object type cannot change during runtime return true; } diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index f6d03ca38b2..f6021a7d7ec 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -635,7 +635,6 @@ class Creature : public Unit, public GridObject, public MapCreature void RemoveCorpse(bool setSpawnTime = true); - void ForcedDespawn(uint32 timeMSToDespawn = 0); void DespawnOrUnsummon(uint32 msTimeToDespawn = 0); time_t const& GetRespawnTime() const { return m_respawnTime; } @@ -763,6 +762,8 @@ class Creature : public Unit, public GridObject, public MapCreature bool IsInvisibleDueToDespawn() const; bool CanAlwaysSee(WorldObject const* obj) const; private: + void ForcedDespawn(uint32 timeMSToDespawn = 0); + //WaypointMovementGenerator vars uint32 m_waypointID; uint32 m_path_id; diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 37808e2b924..bf887bec164 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -664,7 +664,7 @@ public: { CAST_PLR(charmer)->GroupEventHappens(12687, me); charmer->RemoveAurasDueToSpell(SPELL_EFFECT_OVERTAKE); - CAST_CRE(who)->ForcedDespawn(); + CAST_CRE(who)->DespawnOrUnsummon(); //CAST_CRE(who)->Respawn(true); } @@ -767,7 +767,7 @@ public: //Todo: Creatures must not be removed, but, must instead // stand next to Gothik and be commanded into the pit // and dig into the ground. - CAST_CRE(who)->ForcedDespawn(); + CAST_CRE(who)->DespawnOrUnsummon(); if (CAST_PLR(owner)->GetQuestStatus(12698) == QUEST_STATUS_COMPLETE) owner->RemoveAllMinionsByEntry(GHOULS); diff --git a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp index ffc2fb3fb61..6c692a6738b 100644 --- a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp +++ b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp @@ -193,7 +193,7 @@ public: if (type == POINT_MOTION_TYPE && id == 1) { DoScriptText(SAY_DIRECTION, me); - me->ForcedDespawn(); + me->DespawnOrUnsummon(); } } }; diff --git a/src/server/scripts/Kalimdor/durotar.cpp b/src/server/scripts/Kalimdor/durotar.cpp index 88bc3352ea1..fe5bedf4c98 100644 --- a/src/server/scripts/Kalimdor/durotar.cpp +++ b/src/server/scripts/Kalimdor/durotar.cpp @@ -264,7 +264,7 @@ class npc_tiger_matriarch : public CreatureScript vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER); vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER); } - me->ForcedDespawn(); + me->DespawnOrUnsummon(); } void DamageTaken(Unit* attacker, uint32& damage) @@ -287,7 +287,7 @@ class npc_tiger_matriarch : public CreatureScript vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER); } - me->ForcedDespawn(); + me->DespawnOrUnsummon(); } } diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp index 4a1b67ba477..cbacc4fdf66 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp @@ -847,7 +847,7 @@ public: player->KilledMonsterCredit(NPC_THERAMORE_PRISONER, 0); prisoner->AI()->Talk(SAY_FREE); // We also emote cry here (handled in creature_text.emote) - prisoner->ForcedDespawn(6000); + prisoner->DespawnOrUnsummon(6000); } return true; } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index ed1ca4d20fb..c40a521c794 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -262,7 +262,7 @@ class ValithriaDespawner : public BasicEvent if (CreatureData const* data = creature->GetCreatureData()) creature->SetPosition(data->posX, data->posY, data->posZ, data->orientation); - creature->ForcedDespawn(); + creature->DespawnOrUnsummon(); creature->SetCorpseDelay(corpseDelay); creature->SetRespawnDelay(respawnDelay); @@ -1087,7 +1087,7 @@ class npc_dream_cloud : public CreatureScript me->GetMotionMaster()->MoveIdle(); // must use originalCaster the same for all clouds to allow stacking me->CastSpell(me, EMERALD_VIGOR, false, NULL, NULL, _instance->GetData64(DATA_VALITHRIA_DREAMWALKER)); - me->ForcedDespawn(100); + me->DespawnOrUnsummon(100); break; default: break; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 8d562a23f67..5b208768b0c 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -346,7 +346,7 @@ class FrostwingGauntletRespawner if (CreatureData const* data = creature->GetCreatureData()) creature->SetPosition(data->posX, data->posY, data->posZ, data->orientation); - creature->ForcedDespawn(); + creature->DespawnOrUnsummon(); creature->SetCorpseDelay(corpseDelay); creature->SetRespawnDelay(respawnDelay); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp index 6c2c08f07a0..472ff153d73 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp @@ -298,14 +298,14 @@ class npc_auriaya_seeping_trigger : public CreatureScript void Reset() { - me->ForcedDespawn(600000); + me->DespawnOrUnsummon(600000); DoCast(me, SPELL_SEEPING_ESSENCE); } void UpdateAI(uint32 const /*diff*/) { if (instance->GetBossState(BOSS_AURIAYA) != IN_PROGRESS) - me->ForcedDespawn(); + me->DespawnOrUnsummon(); } private: diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index 4ea38a7642d..a3c9cb847e5 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -507,7 +507,7 @@ class boss_freya : public CreatureScript for (uint8 n = 0; n < 3; ++n) { summons.remove(Elemental[n][i]->GetGUID()); - Elemental[n][i]->ForcedDespawn(5000); + Elemental[n][i]->DespawnOrUnsummon(5000); trioDefeated[i] = true; Elemental[n][i]->CastSpell(me, SPELL_REMOVE_10STACK, true); } @@ -664,12 +664,12 @@ class boss_freya : public CreatureScript case NPC_DETONATING_LASHER: summoned->CastSpell(me, SPELL_REMOVE_2STACK, true); summoned->CastSpell(who, SPELL_DETONATE, true); - summoned->ForcedDespawn(5000); + summoned->DespawnOrUnsummon(5000); summons.remove(summoned->GetGUID()); break; case NPC_ANCIENT_CONSERVATOR: summoned->CastSpell(me, SPELL_REMOVE_25STACK, true); - summoned->ForcedDespawn(5000); + summoned->DespawnOrUnsummon(5000); summons.remove(summoned->GetGUID()); break; } @@ -1385,7 +1385,7 @@ class npc_healthy_spore : public CreatureScript if (lifeTimer <= diff) { me->RemoveAurasDueToSpell(SPELL_GROW); - me->ForcedDespawn(2200); + me->DespawnOrUnsummon(2200); lifeTimer = urand(22000, 30000); } else @@ -1423,7 +1423,7 @@ class npc_eonars_gift : public CreatureScript { me->RemoveAurasDueToSpell(SPELL_GROW); DoCast(SPELL_LIFEBINDERS_GIFT); - me->ForcedDespawn(2500); + me->DespawnOrUnsummon(2500); lifeBindersGiftTimer = 12000; } else diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index f83538b344c..8b51618eedd 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -186,7 +186,7 @@ public: if (owner->GetTypeId() == TYPEID_PLAYER) { owner->CastSpell(owner, 46231, true); - CAST_CRE(who)->ForcedDespawn(); + CAST_CRE(who)->DespawnOrUnsummon(); } } } diff --git a/src/server/scripts/Northrend/storm_peaks.cpp b/src/server/scripts/Northrend/storm_peaks.cpp index 251bdb8278a..15239e9f836 100644 --- a/src/server/scripts/Northrend/storm_peaks.cpp +++ b/src/server/scripts/Northrend/storm_peaks.cpp @@ -550,7 +550,7 @@ public: // drake unsummoned, passengers dropped if (!me->IsOnVehicle(drake) && !hasEmptySeats) - me->ForcedDespawn(3000); + me->DespawnOrUnsummon(3000); if (enter_timer <= 0) return; @@ -605,7 +605,7 @@ public: me->ExitVehicle(); me->CastSpell(me, SPELL_SUMMON_LIBERATED, true); - me->ForcedDespawn(500); + me->DespawnOrUnsummon(500); // drake is empty now, deliver credit for drake and despawn him if (drake->GetVehicleKit()->HasEmptySeat(1) && @@ -616,7 +616,7 @@ public: if (rider->ToPlayer()) rider->ToPlayer()->KilledMonsterCredit(29709, 0); - drake->ForcedDespawn(0); + drake->DespawnOrUnsummon(0); } } } diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index 7a371170d7d..cf0955ed89c 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -855,7 +855,7 @@ class npc_simon_bunny : public CreatureScript if (GameObject* relic = me->FindNearestGameObject(large ? GO_APEXIS_MONUMENT : GO_APEXIS_RELIC, searchDistance)) relic->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - me->ForcedDespawn(1000); + me->DespawnOrUnsummon(1000); } /* diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp index 8080a1402af..871a2f200bb 100644 --- a/src/server/scripts/Outland/nagrand.cpp +++ b/src/server/scripts/Outland/nagrand.cpp @@ -450,7 +450,7 @@ public: { if (Say_Timer <= diff) { - me->ForcedDespawn(); + me->DespawnOrUnsummon(); ReleasedFromCage = false; } else @@ -689,7 +689,7 @@ class go_warmaul_prison : public GameObjectScript player->KilledMonsterCredit(NPC_MAGHAR_PRISONER, 0); prisoner->AI()->Talk(SAY_FREE, player->GetGUID()); - prisoner->ForcedDespawn(6000); + prisoner->DespawnOrUnsummon(6000); } return true; } diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp index 388d18697b9..afc18c71b92 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/netherstorm.cpp @@ -1057,7 +1057,7 @@ class go_captain_tyralius_prison : public GameObjectScript player->KilledMonsterCredit(NPC_CAPTAIN_TYRALIUS, 0); tyralius->AI()->Talk(SAY_FREE); - tyralius->ForcedDespawn(8000); + tyralius->DespawnOrUnsummon(8000); } return true; } diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 3c5d6438275..300e54ab027 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -2006,7 +2006,7 @@ class spell_item_muisek_vessel : public SpellScriptLoader { if (Creature* target = GetHitCreature()) if (target->isDead()) - target->ForcedDespawn(); + target->DespawnOrUnsummon(); } void Register() diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 48faf83cd2f..06678407b93 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -837,7 +837,7 @@ class spell_q12659_ahunaes_knife : public SpellScriptLoader Player* caster = GetCaster()->ToPlayer(); if (Creature* target = GetHitCreature()) { - target->ForcedDespawn(); + target->DespawnOrUnsummon(); caster->KilledMonsterCredit(NPC_SCALPS_KC_BUNNY, 0); } } diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 60ddf8990a7..790a9d0f814 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -1174,7 +1174,7 @@ class go_gjalerbron_cage : public GameObjectScript player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER, 0); prisoner->AI()->Talk(SAY_FREE); - prisoner->ForcedDespawn(6000); + prisoner->DespawnOrUnsummon(6000); } } return true; @@ -1201,7 +1201,7 @@ class go_large_gjalerbron_cage : public GameObjectScript { go->UseDoorOrButton(); player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER, (*itr)->GetGUID()); - (*itr)->ForcedDespawn(6000); + (*itr)->DespawnOrUnsummon(6000); (*itr)->AI()->Talk(SAY_FREE); } } @@ -1235,7 +1235,7 @@ class go_veil_skith_cage : public GameObjectScript { go->UseDoorOrButton(); player->KilledMonsterCredit(NPC_CAPTIVE_CHILD, (*itr)->GetGUID()); - (*itr)->ForcedDespawn(5000); + (*itr)->DespawnOrUnsummon(5000); (*itr)->GetMotionMaster()->MovePoint(1, go->GetPositionX()+5, go->GetPositionY(), go->GetPositionZ()); (*itr)->AI()->Talk(SAY_FREE_0); (*itr)->GetMotionMaster()->Clear(); From 05bb8e4fcd47b3d127de73927701fd2d5aa3e752 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 24 Apr 2012 17:19:41 +0200 Subject: [PATCH 0631/1149] Core/Vehicles: Fixed creature passengers falling off vehicles at client side --- src/server/game/Entities/Vehicle/Vehicle.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index 4ce05ff40d3..c297ce1e792 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -285,9 +285,6 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion, uint8 typ // return; // Something went wrong in the spellsystem //} - // This is not good, we have to send update twice - accessory->SendMovementFlagUpdate(); - if (GetBase()->GetTypeId() == TYPEID_UNIT) sScriptMgr->OnInstallAccessory(this, accessory); } @@ -352,6 +349,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) unit->m_movementInfo.t_pos.m_orientation = 0; unit->m_movementInfo.t_time = 0; // 1 for player unit->m_movementInfo.t_seat = seat->first; + unit->m_movementInfo.t_guid = _me->GetGUID(); if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER From 61bc8e1c6f82558b3cb1f441ffad1d40dca198a9 Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 24 Apr 2012 11:59:08 -0400 Subject: [PATCH 0632/1149] Core/Spells: added function to initiation script. DB/SAI: added rest of quest to database for Greatmother's Soulcatcher --- .../world/2012_04_24_06_world_misc.sql | 31 +++++++++++++++++++ src/server/scripts/Spells/spell_item.cpp | 1 + 2 files changed, 32 insertions(+) create mode 100644 sql/updates/world/2012_04_24_06_world_misc.sql diff --git a/sql/updates/world/2012_04_24_06_world_misc.sql b/sql/updates/world/2012_04_24_06_world_misc.sql new file mode 100644 index 00000000000..2e095a76cd9 --- /dev/null +++ b/sql/updates/world/2012_04_24_06_world_misc.sql @@ -0,0 +1,31 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` = 46485; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(46485,'spell_item_greatmothers_soulcatcher'); + +DELETE FROM `conditions` WHERE `SourceEntry` IN (46485,46488); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,46485,0,1,31,1,3,26817,0,0,0,'',''), +(13,1,46485,0,1,36,1,0,0,0,1,0,'',''), +(13,1,46488,0,1,31,1,3,26817,0,0,0,'',''), +(13,1,46488,0,1,36,1,0,0,0,1,0,'',''); + +-- Gnome Soul SAI +SET @ENTRY := 26096; +SET @SPELL_ARCANE_EXPLOSION := 35426; +UPDATE creature_template SET AIName="SmartAI" WHERE entry=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,54,0,100,0,0,0,0,0,33,@ENTRY,0,0,0,0,0,7,0,0,0,0,0,0,0,"Gnome Soul - On Just Summoned - Quest Credit"), +(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,45,1,1,0,0,0,0,19,25814,10,1,0,0,0,0,"Gnome Soul - On Just Summoned - Set Data Fizzcrank Mechagnome"), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,69,1,0,0,0,0,0,7,0,0,0,0,0,0,0,"Gnome Soul - On Just Summoned - Move to Summoner"), + +(@ENTRY,0,3,4,34,0,100,0,1,0,0,0,11,@SPELL_ARCANE_EXPLOSION,0,0,0,0,0,1,0,0,0,0,0,0,0,"Gnome Soul - Reached Summoner - Cast Arcane Explosion Visual"), +(@ENTRY,0,4,0,61,0,100,0,0,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Gnome Soul - Reached Summoner - Forced Despawn"); + +-- Fizzcrank Mechagnome SAI +SET @ENTRY := 25814; +UPDATE creature_template SET AIName="SmartAI" WHERE entry=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,1,1,10000,0,0,0,0,0,0,0,0,0,0,0,0,"Fizzcrank Mechagnome - Chance Say on Aggro"), +(@ENTRY,1,0,0,38,0,100,0,1,1,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Fizzcrank Mechagnome - On Data Set - Forced Despawn"); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 300e54ab027..eb2d3187636 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -2104,4 +2104,5 @@ void AddSC_item_spell_scripts() new spell_item_uded(); new spell_item_chicken_cover(); new spell_item_muisek_vessel(); + new spell_item_greatmothers_soulcatcher(); } From 9320131892f4458f506a87f7976c5b60fb9ce4e0 Mon Sep 17 00:00:00 2001 From: The Game Date: Tue, 24 Apr 2012 13:11:22 -0400 Subject: [PATCH 0633/1149] Check if unit has UNIT_DYNFLAG_TRACK_UNIT before checking auras to prevent prevent unnecessary operations, thanks you QAston for suggesting. --- src/server/game/Entities/Object/Object.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 8bf22c8b7a0..e26bc0a6ea1 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -626,9 +626,10 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* if (!target->isAllowedToLoot(creature)) dynamicFlags &= ~UNIT_DYNFLAG_LOOTABLE; } - if (Unit const* unit = ToUnit()) - if (!unit->HasAuraTypeWithCaster(SPELL_AURA_MOD_STALKED, target->GetGUID())) - dynamicFlags &= ~UNIT_DYNFLAG_TRACK_UNIT; + if(dynamicFlags & UNIT_DYNFLAG_TRACK_UNIT) + if (Unit const* unit = ToUnit()) + if (!unit->HasAuraTypeWithCaster(SPELL_AURA_MOD_STALKED, target->GetGUID())) + dynamicFlags &= ~UNIT_DYNFLAG_TRACK_UNIT; *data << dynamicFlags; } // FG: pretend that OTHER players in own group are friendly ("blue") From 2e9196162e6c17972b7b863dddf3acacd79eb624 Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 24 Apr 2012 13:26:17 -0400 Subject: [PATCH 0634/1149] Core/Spells: Fix wrong target in Bloodthirst spell script. Closes #3359 --- src/server/scripts/Spells/spell_warrior.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 3e4c043ae47..3b683eb5795 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -397,8 +397,7 @@ class spell_warr_bloodthirst : public SpellScriptLoader void HandleDummy(SpellEffIndex /* effIndex */) { int32 damage = GetEffectValue(); - if (GetHitUnit()) - GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_BLOODTHIRST, &damage, NULL, NULL, true, NULL); + GetCaster()->CastCustomSpell(GetCaster(), SPELL_BLOODTHIRST, &damage, NULL, NULL, true, NULL); } void Register() From e6a6f6539d59357c617b2679e9123d0a05954e6b Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 24 Apr 2012 13:39:37 -0400 Subject: [PATCH 0635/1149] Core/Spells: Correct tick damage for health funnel. (thx alp22) Closes #3465 --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index dbbd89c7533..31a8e57825c 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1616,7 +1616,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const { // Use the new aura to see on what stance the target will be uint32 newStance = (1<<((newAura ? newAura->GetMiscValue() : 0)-1)); - + // If the stances are not compatible with the spell, remove it if (itr->second->GetBase()->IsRemovedOnShapeLost(target) && !(itr->second->GetBase()->GetSpellInfo()->Stances & newStance)) target->RemoveAura(itr); @@ -6473,7 +6473,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const // damage caster for heal amount if (target != caster && GetSpellInfo()->AttributesEx2 & SPELL_ATTR2_HEALTH_FUNNEL) { - uint32 funnelDamage = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); // damage is not affected by spell power + uint32 funnelDamage = GetSpellInfo()->ManaPerSecond; // damage is not affected by spell power if ((int32)funnelDamage > gain) funnelDamage = gain; uint32 funnelAbsorb = 0; From bf0d001cd3bc5347fecd92d8fbec2a196d6dcda9 Mon Sep 17 00:00:00 2001 From: Discover- Date: Wed, 25 Apr 2012 08:15:05 +0200 Subject: [PATCH 0636/1149] DB/Misc: Fix start-up errors and non-working SmartAI from 61bc8e1c6f82558b3cb1f441ffad1d40dca198a9. Thanks @Xanvial for spotting the SAI issue and @joschiwald for the condition start-up errors. --- sql/updates/world/2012_04_25_00_world_misc.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2012_04_25_00_world_misc.sql diff --git a/sql/updates/world/2012_04_25_00_world_misc.sql b/sql/updates/world/2012_04_25_00_world_misc.sql new file mode 100644 index 00000000000..3d2f20fdc8c --- /dev/null +++ b/sql/updates/world/2012_04_25_00_world_misc.sql @@ -0,0 +1,3 @@ +UPDATE `smart_scripts` SET `source_type`=0,`id`=1 WHERE `entryorguid`=24814 AND `source_type`=1 AND `event_type`=38; +UPDATE `conditions` SET `SourceTypeOrReferenceId`=17 WHERE `SourceEntry` IN (46485,46488); +UPDATE `conditions` SET `ElseGroup`=0 WHERE `SourceEntry` IN (46485,46488) AND `ConditionValue1`=26817; From 5878a790db5d6a0a8acb8cdac656632bf53e3a10 Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 25 Apr 2012 09:02:09 -0400 Subject: [PATCH 0637/1149] Core/Spells: Fix prayer of mending bonus from t9 healing 2 piece set. Closes #4069 --- ...2012_04_25_01_world_spell_script_names.sql | 3 ++ src/server/scripts/Spells/spell_priest.cpp | 47 +++++++++++++++++-- 2 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 sql/updates/world/2012_04_25_01_world_spell_script_names.sql diff --git a/sql/updates/world/2012_04_25_01_world_spell_script_names.sql b/sql/updates/world/2012_04_25_01_world_spell_script_names.sql new file mode 100644 index 00000000000..e42f1979229 --- /dev/null +++ b/sql/updates/world/2012_04_25_01_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` = 33110; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(33110,'spell_pri_prayer_of_mending_heal'); \ No newline at end of file diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index d2bba2b8bc3..2ef782d6dcf 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -291,12 +291,53 @@ class spell_pri_reflective_shield_trigger : public SpellScriptLoader } }; +enum PrayerOfMending +{ + SPELL_T9_HEALING_2_PIECE = 67201, +}; +// Prayer of Mending Heal +class spell_pri_prayer_of_mending_heal : public SpellScriptLoader +{ +public: + spell_pri_prayer_of_mending_heal() : SpellScriptLoader("spell_pri_prayer_of_mending_heal") { } + + class spell_pri_prayer_of_mending_heal_SpellScript : public SpellScript + { + PrepareSpellScript(spell_pri_prayer_of_mending_heal_SpellScript); + + void HandleHeal(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetOriginalCaster()) + { + if (Aura* aur = caster->GetAura(SPELL_T9_HEALING_2_PIECE)) + { + int32 heal = GetHitHeal(); + AddPctN(heal, aur->GetSpellInfo()->Effects[0]->CalcValue()); + SetHitHeal(heal); + } + } + + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_pri_prayer_of_mending_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_pri_prayer_of_mending_heal_SpellScript(); + } +}; + void AddSC_priest_spell_scripts() { new spell_pri_guardian_spirit(); - new spell_pri_mana_burn; - new spell_pri_pain_and_suffering_proc; - new spell_pri_penance; + new spell_pri_mana_burn(); + new spell_pri_pain_and_suffering_proc(); + new spell_pri_penance(); new spell_pri_reflective_shield_trigger(); new spell_pri_mind_sear(); + new spell_pri_prayer_of_mending_heal(); } From 0ec4d55ca641bc8c5e117bec28d16255830f53fa Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 25 Apr 2012 09:15:09 -0400 Subject: [PATCH 0638/1149] Core/Spells: Fix build error introduced in previous commit. --- src/server/scripts/Spells/spell_priest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 2ef782d6dcf..65bbd86d5e1 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -312,7 +312,7 @@ public: if (Aura* aur = caster->GetAura(SPELL_T9_HEALING_2_PIECE)) { int32 heal = GetHitHeal(); - AddPctN(heal, aur->GetSpellInfo()->Effects[0]->CalcValue()); + AddPctN(heal, aur->GetSpellInfo()->Effects[0].CalcValue(); SetHitHeal(heal); } } From b528f70639769b131ca1624269aa622b70b5535e Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 25 Apr 2012 09:20:18 -0400 Subject: [PATCH 0639/1149] Core/Spells: get effect value correctly. thx shauren! --- src/server/scripts/Spells/spell_priest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 65bbd86d5e1..5d471afdd2a 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -309,10 +309,10 @@ public: { if (Unit* caster = GetOriginalCaster()) { - if (Aura* aur = caster->GetAura(SPELL_T9_HEALING_2_PIECE)) + if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_T9_HEALING_2_PIECE,EFFECT_0)) { int32 heal = GetHitHeal(); - AddPctN(heal, aur->GetSpellInfo()->Effects[0].CalcValue(); + AddPctN(heal, aurEff->GetAmount()); SetHitHeal(heal); } } From 57866f3465dad99fc2f4f714631fa02b05f9d96c Mon Sep 17 00:00:00 2001 From: Aristoo Date: Wed, 25 Apr 2012 16:38:51 +0300 Subject: [PATCH 0640/1149] Script/Trial of the Crusader: Fix define for Permafrost --- .../TrialOfTheCrusader/boss_anubarak_trial.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index c718c0cee5f..f329b940e1f 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -104,7 +104,7 @@ enum BossSpells SPELL_SPIKE_TELE = 66170, }; -#define SPELL_PERMAFROST_HELPER RAID_MODE(66193, 67856, 67855, 67857) +#define SPELL_PERMAFROST_HELPER RAID_MODE(66193, 67855, 67856, 67857) enum SummonActions { From 13b68af78dbc51f44656ecfddb1bfb27dc44a21a Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 25 Apr 2012 13:47:26 -0400 Subject: [PATCH 0641/1149] Core/Spells: Convert some spells from spell_scripts in the db to a generic spellscript. --- ...2012_04_25_02_world_spell_script_names.sql | 12 ++++++ src/server/scripts/Spells/spell_generic.cpp | 43 ++++++++++++++++--- 2 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 sql/updates/world/2012_04_25_02_world_spell_script_names.sql diff --git a/sql/updates/world/2012_04_25_02_world_spell_script_names.sql b/sql/updates/world/2012_04_25_02_world_spell_script_names.sql new file mode 100644 index 00000000000..6d8974664f4 --- /dev/null +++ b/sql/updates/world/2012_04_25_02_world_spell_script_names.sql @@ -0,0 +1,12 @@ +select id from spell_scripts where command = 18 order by id asc; +DELETE FROM `spell_scripts` WHERE `id` IN (15998,25952,29435,45980,51592,51910,52267,54420); +DELETE FROM `spell_script_names` WHERE `spell_id` IN (15998,25952,29435,45980,51592,51910,52267,54420); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(15998, 'spell_gen_despawn_self'), +(25952, 'spell_gen_despawn_self'), +(29435, 'spell_gen_despawn_self'), +(45980, 'spell_gen_despawn_self'), +(51592, 'spell_gen_despawn_self'), +(51910, 'spell_gen_despawn_self'), +(52267, 'spell_gen_despawn_self'), +(54420, 'spell_gen_despawn_self'); \ No newline at end of file diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 2d431331691..f7e895f97f4 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -169,7 +169,7 @@ class spell_gen_burn_brutallus : public SpellScriptLoader } }; -enum eCannibalizeSpells +enum CannibalizeSpells { SPELL_CANNIBALIZE_TRIGGERED = 20578, }; @@ -224,7 +224,7 @@ class spell_gen_cannibalize : public SpellScriptLoader }; // 45472 Parachute -enum eParachuteSpells +enum ParachuteSpells { SPELL_PARACHUTE = 45472, SPELL_PARACHUTE_BUFF = 44795, @@ -365,7 +365,7 @@ class spell_gen_remove_flight_auras : public SpellScriptLoader }; // 66118 Leeching Swarm -enum eLeechingSwarmSpells +enum LeechingSwarmSpells { SPELL_LEECHING_SWARM_DMG = 66240, SPELL_LEECHING_SWARM_HEAL = 66125, @@ -481,7 +481,7 @@ class spell_gen_elune_candle : public SpellScriptLoader }; // 24750 Trick -enum eTrickSpells +enum TrickSpells { SPELL_PIRATE_COSTUME_MALE = 24708, SPELL_PIRATE_COSTUME_FEMALE = 24709, @@ -557,7 +557,7 @@ class spell_gen_trick : public SpellScriptLoader }; // 24751 Trick or Treat -enum eTrickOrTreatSpells +enum TrickOrTreatSpells { SPELL_TRICK = 24714, SPELL_TREAT = 24715, @@ -2656,6 +2656,38 @@ class spell_gen_count_pct_from_max_hp : public SpellScriptLoader int32 _damagePct; }; +class spell_gen_despawn_self : public SpellScriptLoader +{ +public: + spell_gen_despawn_self() : SpellScriptLoader("spell_gen_despawn_self") { } + + class spell_gen_despawn_self_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_despawn_self_SpellScript); + + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_UNIT; + } + void HandleDummy(SpellEffIndex effIndex) + { + GetCaster()->ToCreature()->DespawnOrUnsummon(); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_despawn_self_SpellScript::HandleDummy, EFFECT_FIRST_FOUND, SPELL_EFFECT_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_gen_despawn_self_SpellScript::HandleDummy, EFFECT_FIRST_FOUND, SPELL_EFFECT_SCRIPT_EFFECT); + + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_despawn_self_SpellScript(); + } +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -2709,4 +2741,5 @@ void AddSC_generic_spell_scripts() new spell_gen_wg_water(); new spell_gen_count_pct_from_max_hp("spell_gen_default_count_pct_from_max_hp"); new spell_gen_count_pct_from_max_hp("spell_gen_50pct_count_pct_from_max_hp", 50); + new spell_gen_despawn_self(); } From 1b5fa3a6f3cc1ac0ace75a3d0676e7ea044eb0de Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 25 Apr 2012 14:21:56 -0400 Subject: [PATCH 0642/1149] Core/Spells: fix sql file from previous commit and add newline after load function --- sql/updates/world/2012_04_25_02_world_spell_script_names.sql | 1 - src/server/scripts/Spells/spell_generic.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/updates/world/2012_04_25_02_world_spell_script_names.sql b/sql/updates/world/2012_04_25_02_world_spell_script_names.sql index 6d8974664f4..ea6b95559c6 100644 --- a/sql/updates/world/2012_04_25_02_world_spell_script_names.sql +++ b/sql/updates/world/2012_04_25_02_world_spell_script_names.sql @@ -1,4 +1,3 @@ -select id from spell_scripts where command = 18 order by id asc; DELETE FROM `spell_scripts` WHERE `id` IN (15998,25952,29435,45980,51592,51910,52267,54420); DELETE FROM `spell_script_names` WHERE `spell_id` IN (15998,25952,29435,45980,51592,51910,52267,54420); INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index f7e895f97f4..3f75c7d41a9 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2669,6 +2669,7 @@ public: { return GetCaster()->GetTypeId() == TYPEID_UNIT; } + void HandleDummy(SpellEffIndex effIndex) { GetCaster()->ToCreature()->DespawnOrUnsummon(); From ede6c38a43f462356868bef6771f2fc09f6362e8 Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 25 Apr 2012 15:17:38 -0400 Subject: [PATCH 0643/1149] DB/Spells: fixes the effect stacking of Greater/Blessing of Sanctuary/Kings. Closes #768 --- sql/updates/world/2012_04_25_03_world_spell_group.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 sql/updates/world/2012_04_25_03_world_spell_group.sql diff --git a/sql/updates/world/2012_04_25_03_world_spell_group.sql b/sql/updates/world/2012_04_25_03_world_spell_group.sql new file mode 100644 index 00000000000..a6fa90ad41d --- /dev/null +++ b/sql/updates/world/2012_04_25_03_world_spell_group.sql @@ -0,0 +1,11 @@ +DELETE FROM `spell_group` WHERE `id` IN (1117,1118); +INSERT INTO `spell_group` (`id`,`spell_id`) VALUES +(1117,25898), +(1117,25899), +(1118,20911), +(1118,20217); + +DELETE FROM `spell_group_stack_rules` WHERE `group_id` in (1117,1118); +INSERT INTO `spell_group_stack_rules` (`group_id`,`stack_rule`) VALUES +(1117,3), +(1118,3); From aee77546e9a0be3a2d779d92aff7618732737a91 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 26 Apr 2012 09:13:07 -0400 Subject: [PATCH 0644/1149] Core/Spells,DB/Conditions: Fix startup errors associated with bf0d001cd3bc5347fecd92d8fbec2a196d6dcda9 and 13b68af78dbc51f44656ecfddb1bfb27dc44a21a Closes #6346 --- sql/updates/world/2012_04_26_00_world_conditions.sql | 1 + src/server/scripts/Spells/spell_generic.cpp | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 sql/updates/world/2012_04_26_00_world_conditions.sql diff --git a/sql/updates/world/2012_04_26_00_world_conditions.sql b/sql/updates/world/2012_04_26_00_world_conditions.sql new file mode 100644 index 00000000000..943fe386085 --- /dev/null +++ b/sql/updates/world/2012_04_26_00_world_conditions.sql @@ -0,0 +1 @@ +UPDATE `conditions` SET `ElseGroup` = 0, `SourceGroup` = 0 WHERE `SourceEntry` IN (46485,46488) AND `ConditionValue2` = 26817; diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 3f75c7d41a9..13ea2740abb 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2672,14 +2672,13 @@ public: void HandleDummy(SpellEffIndex effIndex) { - GetCaster()->ToCreature()->DespawnOrUnsummon(); + if (GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_DUMMY || GetSpellInfo()->Effects[effIndex].Effect = SPELL_EFFECT_SCRIPT_EFFECT) + GetCaster()->ToCreature()->DespawnOrUnsummon(); } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_gen_despawn_self_SpellScript::HandleDummy, EFFECT_FIRST_FOUND, SPELL_EFFECT_DUMMY); - OnEffectHitTarget += SpellEffectFn(spell_gen_despawn_self_SpellScript::HandleDummy, EFFECT_FIRST_FOUND, SPELL_EFFECT_SCRIPT_EFFECT); - + OnEffectHitTarget += SpellEffectFn(spell_gen_despawn_self_SpellScript::HandleDummy, EFFECT_ALL, SPELL_EFFECT_ANY); } }; From 0bd368db36b0f5c753284aa2a56033560d266fe7 Mon Sep 17 00:00:00 2001 From: kandera Date: Thu, 26 Apr 2012 10:16:57 -0300 Subject: [PATCH 0645/1149] DB/Conditions: fix conditions where claues from previous commit --- sql/updates/world/2012_04_26_00_world_conditions.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/updates/world/2012_04_26_00_world_conditions.sql b/sql/updates/world/2012_04_26_00_world_conditions.sql index 943fe386085..8d525cad057 100644 --- a/sql/updates/world/2012_04_26_00_world_conditions.sql +++ b/sql/updates/world/2012_04_26_00_world_conditions.sql @@ -1 +1 @@ -UPDATE `conditions` SET `ElseGroup` = 0, `SourceGroup` = 0 WHERE `SourceEntry` IN (46485,46488) AND `ConditionValue2` = 26817; +UPDATE `conditions` SET `ElseGroup` = 0, `SourceGroup` = 0 WHERE `SourceEntry` IN (46485,46488); From 16e367bb84a46bafd4b2a0cb12f1cd54a14cf8d1 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 26 Apr 2012 09:28:48 -0400 Subject: [PATCH 0646/1149] Core/Spells: fix build error with previous commits. --- src/server/scripts/Spells/spell_generic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 13ea2740abb..7fd37ede316 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2672,7 +2672,7 @@ public: void HandleDummy(SpellEffIndex effIndex) { - if (GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_DUMMY || GetSpellInfo()->Effects[effIndex].Effect = SPELL_EFFECT_SCRIPT_EFFECT) + if (GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_DUMMY || GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_SCRIPT_EFFECT) GetCaster()->ToCreature()->DespawnOrUnsummon(); } From bf7a32b79eb6efd0d7c9f733ca21abf92ca3a9d3 Mon Sep 17 00:00:00 2001 From: Jildor Date: Thu, 26 Apr 2012 15:38:48 +0200 Subject: [PATCH 0647/1149] Scripts/Icecrown Citadel: Fixed Deathbringer Saurfang berserk timer on heroic mode. --- .../Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 249eed01643..e424cd16eaa 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -297,7 +297,7 @@ class boss_deathbringer_saurfang : public CreatureScript Talk(SAY_AGGRO); events.ScheduleEvent(EVENT_SUMMON_BLOOD_BEAST, 30000, 0, PHASE_COMBAT); - events.ScheduleEvent(EVENT_BERSERK, 480000, 0, PHASE_COMBAT); + events.ScheduleEvent(EVENT_BERSERK, IsHeroic() ? 360000 : 480000, 0, PHASE_COMBAT); events.ScheduleEvent(EVENT_BOILING_BLOOD, 15500, 0, PHASE_COMBAT); events.ScheduleEvent(EVENT_BLOOD_NOVA, 17000, 0, PHASE_COMBAT); events.ScheduleEvent(EVENT_RUNE_OF_BLOOD, 20000, 0, PHASE_COMBAT); From b5a5080df0ab41e97ecbf71a4cc4341cea3f6323 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 26 Apr 2012 11:15:23 -0400 Subject: [PATCH 0648/1149] Core/Spells: fix penance and holy shock targetting for non faction friendly npcs that appear friendly. should also fix the issue with using mixed groups --- src/server/scripts/Spells/spell_paladin.cpp | 4 ++-- src/server/scripts/Spells/spell_priest.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 9f7f7d847e1..c8c563d3d5d 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -289,8 +289,8 @@ class spell_pal_holy_shock : public SpellScriptLoader { Player* caster = GetCaster()->ToPlayer(); if (GetTargetUnit()) - if (Player* target = GetTargetUnit()->ToPlayer()) - if (caster->GetTeam() != target->GetTeam() && !caster->IsValidAttackTarget(target)) + if (Unit* target = GetTargetUnit()) + if (!caster->IsFriendlyTo(target) && !caster->IsValidAttackTarget(target)) return SPELL_FAILED_BAD_TARGETS; return SPELL_CAST_OK; } diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 5d471afdd2a..47cec6ce516 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -228,8 +228,8 @@ class spell_pri_penance : public SpellScriptLoader { Player* caster = GetCaster()->ToPlayer(); if (GetTargetUnit()) - if (Player* target = GetTargetUnit()->ToPlayer()) - if (caster->GetTeam() != target->GetTeam() && !caster->IsValidAttackTarget(target)) + if (Unit* target = GetTargetUnit()) + if (!caster->IsFriendlyTo(target) && !caster->IsValidAttackTarget(target)) return SPELL_FAILED_BAD_TARGETS; return SPELL_CAST_OK; } From a97646ca5a9c1297744b1b5557984ab187ec4982 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 26 Apr 2012 12:46:02 -0400 Subject: [PATCH 0649/1149] DB/Conditions: fix another conditions error from bf0d001cd3bc5347fecd92d8fbec2a196d6dcda9 --- sql/updates/world/2012_04_26_01_world_conditions.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2012_04_26_01_world_conditions.sql diff --git a/sql/updates/world/2012_04_26_01_world_conditions.sql b/sql/updates/world/2012_04_26_01_world_conditions.sql new file mode 100644 index 00000000000..c43f08652ba --- /dev/null +++ b/sql/updates/world/2012_04_26_01_world_conditions.sql @@ -0,0 +1 @@ +UPDATE `conditions` SET `source_type` = 0, `id` = 1 WHERE `entryorguid` = 25814 AND `source_type` = 1 AND `id` = 0; From 778afa11ac80837c877d043c6146e18c1aab89aa Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 26 Apr 2012 12:50:37 -0400 Subject: [PATCH 0650/1149] DB/SAI: andd now this should be fixed ONCE AND FOR ALL --- sql/updates/world/2012_04_26_01_world_conditions.sql | 1 - sql/updates/world/2012_04_26_01_world_smart_scripts.sql | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 sql/updates/world/2012_04_26_01_world_conditions.sql create mode 100644 sql/updates/world/2012_04_26_01_world_smart_scripts.sql diff --git a/sql/updates/world/2012_04_26_01_world_conditions.sql b/sql/updates/world/2012_04_26_01_world_conditions.sql deleted file mode 100644 index c43f08652ba..00000000000 --- a/sql/updates/world/2012_04_26_01_world_conditions.sql +++ /dev/null @@ -1 +0,0 @@ -UPDATE `conditions` SET `source_type` = 0, `id` = 1 WHERE `entryorguid` = 25814 AND `source_type` = 1 AND `id` = 0; diff --git a/sql/updates/world/2012_04_26_01_world_smart_scripts.sql b/sql/updates/world/2012_04_26_01_world_smart_scripts.sql new file mode 100644 index 00000000000..e90e7b58433 --- /dev/null +++ b/sql/updates/world/2012_04_26_01_world_smart_scripts.sql @@ -0,0 +1 @@ +UPDATE `smart_scripts` SET `source_type` = 0, `id` = 1 WHERE `entryorguid` = 25814 AND `source_type` = 1 AND `id` = 0; From 51656d7e609a4a079e636c74e5f1cd34d9141742 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 27 Apr 2012 15:38:09 +0200 Subject: [PATCH 0651/1149] Scripts/Icecrown Citadel: Fixed Scent of Blood on heroic mode of Deathbringer Saurfang encounter --- .../2012_04_27_00_world_instance_icc.sql | 5 +++ src/server/game/Spells/SpellEffects.cpp | 8 ++--- src/server/game/Spells/SpellMgr.cpp | 13 +++++-- .../boss_deathbringer_saurfang.cpp | 35 +++++++++++-------- 4 files changed, 39 insertions(+), 22 deletions(-) create mode 100644 sql/updates/world/2012_04_27_00_world_instance_icc.sql diff --git a/sql/updates/world/2012_04_27_00_world_instance_icc.sql b/sql/updates/world/2012_04_27_00_world_instance_icc.sql new file mode 100644 index 00000000000..6738e4904ab --- /dev/null +++ b/sql/updates/world/2012_04_27_00_world_instance_icc.sql @@ -0,0 +1,5 @@ +DELETE FROM `creature_text` WHERE `entry`=37813 AND `groupid`=14; +INSERT INTO `creature_text` (`entry`,`groupid`,`text`,`type`,`comment`) VALUES (37813,14,'%s''s Blood Beasts gain the scent of blood!',41,'Deathbringer Saurfang - EMOTE_SCENT_OF_BLOOD'); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=72771; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`Comment`) VALUES +(13,3,72771,31,3,38508,'Deathbringer Saurfang - Scent of Blood on Blood Beast'); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index c72ccbacc3d..d3566c24a48 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1085,10 +1085,6 @@ void Spell::EffectForceCast(SpellEffIndex effIndex) case 52349: // Overtake unitTarget->CastCustomSpell(unitTarget, spellInfo->Id, &damage, NULL, NULL, true, NULL, NULL, m_originalCasterGUID); return; - case 72378: // Blood Nova - case 73058: // Blood Nova - m_caster->CastSpell(unitTarget, damage, true); // additional spell cast - break; } } @@ -5710,9 +5706,9 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/) } if (!pet) return; - + player->GetMap()->CreatureRelocation(pet, x, y, z, player->GetOrientation()); - + pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE); pet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); pet->setDeathState(ALIVE); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 3de87790be9..64e1527b8d3 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3346,13 +3346,22 @@ void SpellMgr::LoadDbcDataCorrections() case 70835: // Bone Storm (Lord Marrowgar) case 70836: // Bone Storm (Lord Marrowgar) case 72864: // Death Plague (Rotting Frost Giant) - case 72378: // Blood Nova (Deathbringer Saurfang) - case 73058: // Blood Nova (Deathbringer Saurfang) case 71160: // Plague Stench (Stinky) case 71161: // Plague Stench (Stinky) case 71123: // Decimate (Stinky & Precious) spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_100_YARDS; // 100yd break; + case 72378: // Blood Nova (Deathbringer Saurfang) + case 73058: // Blood Nova (Deathbringer Saurfang) + spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; + spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; + break; + case 72769: // Scent of Blood (Deathbringer Saurfang) + spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; + // no break + case 72771: // Scent of Blood (Deathbringer Saurfang) + spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; + break; case 72723: // Resistant Skin (Deathbringer Saurfang adds) // this spell initially granted Shadow damage immunity, however it was removed but the data was left in client spellInfo->Effect[2] = 0; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index e424cd16eaa..afc7c503bee 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -39,6 +39,7 @@ enum ScriptTexts SAY_FRENZY = 11, SAY_BERSERK = 12, SAY_DEATH = 13, + EMOTE_SCENT_OF_BLOOD = 14, // High Overlord Saurfang SAY_INTRO_HORDE_1 = 0, @@ -145,6 +146,7 @@ enum EventTypes EVENT_BOILING_BLOOD = 20, EVENT_BLOOD_NOVA = 21, EVENT_RUNE_OF_BLOOD = 22, + EVENT_SCENT_OF_BLOOD = 52, EVENT_OUTRO_ALLIANCE_1 = 23, EVENT_OUTRO_ALLIANCE_2 = 24, @@ -374,16 +376,13 @@ class boss_deathbringer_saurfang : public CreatureScript if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true)) summon->AI()->AttackStart(target); - if (IsHeroic()) - DoCast(summon, SPELL_SCENT_OF_BLOOD); - - summon->AI()->DoCast(summon, SPELL_BLOOD_LINK_BEAST, true); - summon->AI()->DoCast(summon, SPELL_RESISTANT_SKIN, true); + summon->CastSpell(summon, SPELL_BLOOD_LINK_BEAST, true); + summon->CastSpell(summon, SPELL_RESISTANT_SKIN, true); summons.Summon(summon); DoZoneInCombat(summon); } - void SummonedCreatureDespawn(Creature* summon) + void SummonedCreatureDies(Creature* summon, Unit* /*killer*/) { summons.Despawn(summon); } @@ -463,18 +462,13 @@ class boss_deathbringer_saurfang : public CreatureScript DoCast(me, SPELL_SUMMON_BLOOD_BEAST_25_MAN+i25); Talk(SAY_BLOOD_BEASTS); events.ScheduleEvent(EVENT_SUMMON_BLOOD_BEAST, 40000, 0, PHASE_COMBAT); + if (IsHeroic()) + events.ScheduleEvent(EVENT_SCENT_OF_BLOOD, 10000, 0, PHASE_COMBAT); break; case EVENT_BLOOD_NOVA: - { - // select at range only - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, -10.0f, true); - if (!target) - target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true); // noone? select melee - if (target) - DoCast(target, SPELL_BLOOD_NOVA_TRIGGER); + DoCastAOE(SPELL_BLOOD_NOVA_TRIGGER); events.ScheduleEvent(EVENT_BLOOD_NOVA, urand(20000, 25000), 0, PHASE_COMBAT); break; - } case EVENT_RUNE_OF_BLOOD: DoCastVictim(SPELL_RUNE_OF_BLOOD); events.ScheduleEvent(EVENT_RUNE_OF_BLOOD, urand(20000, 25000), 0, PHASE_COMBAT); @@ -487,6 +481,13 @@ class boss_deathbringer_saurfang : public CreatureScript DoCast(me, SPELL_BERSERK); Talk(SAY_BERSERK); break; + case EVENT_SCENT_OF_BLOOD: + if (!summons.empty()) + { + Talk(EMOTE_SCENT_OF_BLOOD); + DoCastAOE(SPELL_SCENT_OF_BLOOD); + } + break; default: break; } @@ -1237,10 +1238,16 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader unitList.push_back(target); } + void HandleForceCast(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetHitUnit(), uint32(GetEffectValue()), TRIGGERED_FULL_MASK); + } + void Register() { OnUnitTargetSelect += SpellUnitTargetFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); OnUnitTargetSelect += SpellUnitTargetFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsSubsequent, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnEffectHitTarget += SpellEffectFn(spell_deathbringer_blood_nova_targeting_SpellScript::HandleForceCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST); } Unit* target; From 8f19d0050923f30f150a6ac0d6c85a3f2bbb8b04 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Fri, 27 Apr 2012 16:24:16 +0200 Subject: [PATCH 0652/1149] Core/Battleground: * Fix typo in commit ddd25ce7166fc34f9e3411863da80f84d3693c34 * Fix codestyle --- .../game/Battlegrounds/Zones/BattlegroundSA.h | 134 +++++++++--------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h index 2ade101ce54..c18806490f2 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h @@ -30,8 +30,8 @@ class BattlegroundSAScore : public BattlegroundScore uint8 gates_destroyed; }; -#define BG_SA_FLAG_AMOUNT 3 -#define BG_SA_DEMOLISHER_AMOUNT 4 +#define BG_SA_FLAG_AMOUNT 3 +#define BG_SA_DEMOLISHER_AMOUNT 4 enum BG_SA_Status { @@ -52,20 +52,20 @@ enum BG_SA_GateState enum BG_SA_EventIdGate { - BG_SA_EVENT_GREEN_GATE_DAMAGED = 19041, - BG_SA_EVENT_GREEN_GATE_DESTROYED = 19046, - BG_SA_EVENT_BLUE_GATE_DAMAGED = 19040, BG_SA_EVENT_BLUE_GATE_DESTROYED = 19045, + BG_SA_EVENT_GREEN_GATE_DAMAGED = 19041, + BG_SA_EVENT_GREEN_GATE_DESTROYED = 19046, + BG_SA_EVENT_RED_GATE_DAMAGED = 19042, BG_SA_EVENT_RED_GATE_DESTROYED = 19047, - BG_SA_EVENT_PURPLE_GATE_DAMAGED = 19048, - BG_SA_EVENT_PURPLE_GATE_DESTROYED = 19043, + BG_SA_EVENT_PURPLE_GATE_DAMAGED = 19043, + BG_SA_EVENT_PURPLE_GATE_DESTROYED = 19048, - BG_SA_EVENT_YELLOW_GATE_DAMAGED = 19049, - BG_SA_EVENT_YELLOW_GATE_DESTROYED = 19044, + BG_SA_EVENT_YELLOW_GATE_DAMAGED = 19044, + BG_SA_EVENT_YELLOW_GATE_DESTROYED = 19049, BG_SA_EVENT_ANCIENT_GATE_DAMAGED = 19836, BG_SA_EVENT_ANCIENT_GATE_DESTROYED = 19837 @@ -73,38 +73,38 @@ enum BG_SA_EventIdGate enum BG_SA_Timers { - BG_SA_BOAT_START = 60*IN_MILLISECONDS, - BG_SA_WARMUPLENGTH = 120*IN_MILLISECONDS, - BG_SA_ROUNDLENGTH = 600*IN_MILLISECONDS + BG_SA_BOAT_START = 60 * IN_MILLISECONDS, + BG_SA_WARMUPLENGTH = 120 * IN_MILLISECONDS, + BG_SA_ROUNDLENGTH = 600 * IN_MILLISECONDS }; enum BG_SA_WorldStates { - BG_SA_TIMER_MINS = 3559, - BG_SA_TIMER_SEC_TENS = 3560, - BG_SA_TIMER_SEC_DECS = 3561, - BG_SA_ALLY_ATTACKS = 4352, - BG_SA_HORDE_ATTACKS = 4353, - BG_SA_PURPLE_GATEWS = 3614, - BG_SA_RED_GATEWS = 3617, - BG_SA_BLUE_GATEWS = 3620, - BG_SA_GREEN_GATEWS = 3623, - BG_SA_YELLOW_GATEWS = 3638, - BG_SA_ANCIENT_GATEWS = 3849, - BG_SA_LEFT_GY_ALLIANCE = 3635, - BG_SA_RIGHT_GY_ALLIANCE = 3636, - BG_SA_CENTER_GY_ALLIANCE = 3637, - BG_SA_RIGHT_ATT_TOKEN_ALL = 3627, - BG_SA_LEFT_ATT_TOKEN_ALL = 3626, - BG_SA_LEFT_ATT_TOKEN_HRD = 3629, - BG_SA_RIGHT_ATT_TOKEN_HRD = 3628, - BG_SA_HORDE_DEFENCE_TOKEN = 3631, - BG_SA_ALLIANCE_DEFENCE_TOKEN = 3630, - BG_SA_RIGHT_GY_HORDE = 3632, - BG_SA_LEFT_GY_HORDE = 3633, - BG_SA_CENTER_GY_HORDE = 3634, - BG_SA_BONUS_TIMER = 0xdf3, - BG_SA_ENABLE_TIMER = 3564, + BG_SA_TIMER_MINS = 3559, + BG_SA_TIMER_SEC_TENS = 3560, + BG_SA_TIMER_SEC_DECS = 3561, + BG_SA_ALLY_ATTACKS = 4352, + BG_SA_HORDE_ATTACKS = 4353, + BG_SA_PURPLE_GATEWS = 3614, + BG_SA_RED_GATEWS = 3617, + BG_SA_BLUE_GATEWS = 3620, + BG_SA_GREEN_GATEWS = 3623, + BG_SA_YELLOW_GATEWS = 3638, + BG_SA_ANCIENT_GATEWS = 3849, + BG_SA_LEFT_GY_ALLIANCE = 3635, + BG_SA_RIGHT_GY_ALLIANCE = 3636, + BG_SA_CENTER_GY_ALLIANCE = 3637, + BG_SA_RIGHT_ATT_TOKEN_ALL = 3627, + BG_SA_LEFT_ATT_TOKEN_ALL = 3626, + BG_SA_LEFT_ATT_TOKEN_HRD = 3629, + BG_SA_RIGHT_ATT_TOKEN_HRD = 3628, + BG_SA_HORDE_DEFENCE_TOKEN = 3631, + BG_SA_ALLIANCE_DEFENCE_TOKEN = 3630, + BG_SA_RIGHT_GY_HORDE = 3632, + BG_SA_LEFT_GY_HORDE = 3633, + BG_SA_CENTER_GY_HORDE = 3634, + BG_SA_BONUS_TIMER = 0xdf3, + BG_SA_ENABLE_TIMER = 3564, }; enum npc @@ -143,14 +143,14 @@ enum BG_SA_NPCs enum BG_SA_Boat { - BG_SA_BOAT_ONE_A =193182, - BG_SA_BOAT_TWO_H =193183, - BG_SA_BOAT_ONE_H =193184, - BG_SA_BOAT_TWO_A =193185, + BG_SA_BOAT_ONE_A = 193182, + BG_SA_BOAT_TWO_H = 193183, + BG_SA_BOAT_ONE_H = 193184, + BG_SA_BOAT_TWO_A = 193185, }; -const uint32 BG_SA_NpcEntries[BG_SA_MAXNPC] = - { +uint32 const BG_SA_NpcEntries[BG_SA_MAXNPC] = +{ NPC_ANTI_PERSONNAL_CANNON, NPC_ANTI_PERSONNAL_CANNON, NPC_ANTI_PERSONNAL_CANNON, @@ -161,25 +161,25 @@ const uint32 BG_SA_NpcEntries[BG_SA_MAXNPC] = NPC_ANTI_PERSONNAL_CANNON, NPC_ANTI_PERSONNAL_CANNON, NPC_ANTI_PERSONNAL_CANNON, - //4 beach demolishers + // 4 beach demolishers NPC_DEMOLISHER_SA, NPC_DEMOLISHER_SA, NPC_DEMOLISHER_SA, NPC_DEMOLISHER_SA, - //Triggers + // Triggers 23472, 23472, 23472, 23472, 23472, - //Used Demolisher Salesman + // Used Demolisher Salesman NPC_RIGGER_SPARKLIGHT, NPC_GORGRIL_RIGSPARK - }; +}; -const float BG_SA_NpcSpawnlocs[BG_SA_MAXNPC + BG_SA_DEMOLISHER_AMOUNT][4] = +float const BG_SA_NpcSpawnlocs[BG_SA_MAXNPC + BG_SA_DEMOLISHER_AMOUNT][4] = { - //Cannons + // Cannons { 1436.429f, 110.05f, 41.407f, 5.4f }, { 1404.9023f, 84.758f, 41.183f, 5.46f }, { 1068.693f, -86.951f, 93.81f, 0.02f }, @@ -190,21 +190,21 @@ const float BG_SA_NpcSpawnlocs[BG_SA_MAXNPC + BG_SA_DEMOLISHER_AMOUNT][4] = { 1249.634f, -224.189f, 66.72f, 0.635f }, { 1236.213f, 92.287f, 64.965f, 5.751f }, { 1215.11f, 57.772f, 64.739f, 5.78f }, - //Demolishers + // Demolishers { 1611.597656f, -117.270073f, 8.719355f, 2.513274f}, { 1575.562500f, -158.421875f, 5.024450f, 2.129302f}, { 1618.047729f, 61.424641f, 7.248210f, 3.979351f}, { 1575.103149f, 98.873344f, 2.830360f, 3.752458f}, - //trigger + // Triggers { 1453.49f, -250.453f, 30.896f, 4.2883f}, { 1377.05f, 97.036f, 30.8605f, 2.46539f}, { 1186.05f, 58.8048f, 56.5491f, 2.75992f}, { 1042.83f, -72.839f, 84.8145f, 3.58615f}, { 1233.62f, -250.49f, 55.4036f, 3.7016f}, - //Npcs + // Npcs { 1348.644165f, -298.786469f, 31.080130f, 1.710423f}, { 1358.191040f, 195.527786f, 31.018187f, 4.171337f}, - //Demolishers2 + // Demolishers 2 { 1371.055786f, -317.071136f, 35.007359f, 1.947460f}, { 1424.034912f, -260.195190f, 31.084425f, 2.820013f}, { 1353.139893f, 223.745438f, 35.265411f, 4.343684f}, @@ -242,7 +242,7 @@ enum BG_SA_Objects BG_SA_MAXOBJ = BG_SA_BOMB+68 }; -const float BG_SA_ObjSpawnlocs[BG_SA_MAXOBJ][4] = +float const BG_SA_ObjSpawnlocs[BG_SA_MAXOBJ][4] = { { 1411.57f, 108.163f, 28.692f, 5.441f }, { 1055.452f, -108.1f, 82.134f, 0.034f }, @@ -251,30 +251,30 @@ const float BG_SA_ObjSpawnlocs[BG_SA_MAXOBJ][4] = { 1214.681f, 81.21f, 53.413f, 5.745f }, { 878.555f, -108.2f, 117.845f, 0.0f }, { 836.5f, -108.8f, 120.219f, 0.0f }, - //Ships + // Ships { 2679.696777f, -826.891235f, 3.712860f, 5.78367f}, //rot2 1 rot3 0.0002f { 2574.003662f, 981.261475f, 2.603424f, 0.807696f}, - //Sigils + // Sigils { 1414.054f, 106.72f, 41.442f, 5.441f }, { 1060.63f, -107.8f, 94.7f, 0.034f }, { 1433.383f, -216.4f, 43.642f, 0.9736f }, { 1230.75f, -210.724f, 67.611f, 0.5023f }, { 1217.8f, 79.532f, 66.58f, 5.745f }, - //Flagpoles + // Flagpoles { 1215.114258f, -65.711861f, 70.084267f, -3.124123f}, {1338.863892f, -153.336533f, 30.895121f, -2.530723f}, {1309.124268f, 9.410645f, 30.893402f, -1.623156f}, - //Flags + // Flags { 1215.108032f, -65.715767f, 70.084267f, -3.124123f}, { 1338.859253f, -153.327316f, 30.895077f, -2.530723f}, { 1309.192017f, 9.416233f, 30.893402f, 1.518436f}, - //Portal + // Portal {1468.380005f, -225.798996f, 30.896200f, 0.0f}, //blue {1394.270020f, 72.551399f, 31.054300f, 0.0f}, //green {1065.260010f, -89.79501f, 81.073402f, 0.0f}, //yellow {1216.069946f, 47.904301f, 54.278198f, 0.0f}, //purple {1255.569946f, -233.548996f, 56.43699f, 0.0f}, //red - //Bombs + // Bombs {1333.45f, 211.354f, 31.0538f, 5.03666f}, {1334.29f, 209.582f, 31.0532f, 1.28088f}, {1332.72f, 210.049f, 31.0532f, 1.28088f}, @@ -358,7 +358,7 @@ const float BG_SA_ObjSpawnlocs[BG_SA_MAXOBJ][4] = * to get horde ones. */ -const uint32 BG_SA_ObjEntries[BG_SA_MAXOBJ + BG_SA_FLAG_AMOUNT] = +uint32 const BG_SA_ObjEntries[BG_SA_MAXOBJ + BG_SA_FLAG_AMOUNT] = { 190722, 190727, @@ -388,7 +388,7 @@ const uint32 BG_SA_ObjEntries[BG_SA_MAXOBJ + BG_SA_FLAG_AMOUNT] = 190753 }; -const uint32 BG_SA_Factions[2] = +uint32 const BG_SA_Factions[2] = { 1732, 1735, @@ -413,13 +413,13 @@ const uint32 BG_SA_GYEntries[BG_SA_MAX_GY] = 1348, }; -const float BG_SA_GYOrientation[BG_SA_MAX_GY] = +float const BG_SA_GYOrientation[BG_SA_MAX_GY] = { 6.202f, - 1.926f, //right capturable GY - 3.917f, //left capturable GY - 3.104f, //center, capturable - 6.148f, //defender last GY + 1.926f, // right capturable GY + 3.917f, // left capturable GY + 3.104f, // center, capturable + 6.148f, // defender last GY }; struct BG_SA_RoundScore From e8bfcb686f2400b80659d4f65ec523cb07e17c06 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 28 Apr 2012 02:56:29 +0200 Subject: [PATCH 0653/1149] Core/Spell: Fix not using Disengage while rooted --- src/server/game/Spells/Spell.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index f055d669925..28b089f91cd 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5333,8 +5333,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_caster->GetTypeId() == TYPEID_PLAYER && m_spellInfo->Id == 781 && !m_caster->isInCombat()) return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; - Unit* target = m_targets.GetUnitTarget(); - if (m_caster == target && m_caster->HasUnitState(UNIT_STATE_ROOT)) + if (m_caster->HasUnitState(UNIT_STATE_ROOT)) { if (m_caster->GetTypeId() == TYPEID_PLAYER) return SPELL_FAILED_ROOTED; From 13aef050799a09d6b2e1b634208a6e8823c0875e Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sat, 28 Apr 2012 09:46:40 +0200 Subject: [PATCH 0654/1149] DB/Loot: Ulduar Descent into Madness bosses loot --- ...04_28_00_world_reference_loot_template.sql | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 sql/updates/world/2012_04_28_00_world_reference_loot_template.sql diff --git a/sql/updates/world/2012_04_28_00_world_reference_loot_template.sql b/sql/updates/world/2012_04_28_00_world_reference_loot_template.sql new file mode 100644 index 00000000000..b59ba90fdbc --- /dev/null +++ b/sql/updates/world/2012_04_28_00_world_reference_loot_template.sql @@ -0,0 +1,158 @@ +-- The Descent into Madness +-- References +-- ------------------------------- +-- -- Variables and definitions -- +-- ------------------------------- +-- Set References +SET @Vezax10Ref := 34373; +SET @Vezax25Ref := @Vezax10Ref+1; +SET @Yogg10Ref := @Vezax10Ref+2; +SET @Yogg25Ref := @Vezax10Ref+3; +SET @Chest := 12034; +SET @Shoulder := 12035; +SET @EmblemRef := 34349; +SET @Recipe := 34154; +SET @Vezax10 := 33271; +SET @Vezax25 := 33449; +SET @Yogg10 := 33288; +SET @Yogg25 := 33955; + +-- ------------------------- +-- -- Reference Templates -- +-- ------------------------- +-- Delete previous templates if existing +DELETE FROM `reference_loot_template` WHERE `entry` IN (34131,34132,34133,34164,34165); +DELETE FROM `reference_loot_template` WHERE `entry` IN (@Vezax10Ref,@Vezax25Ref,@Yogg10Ref,@Yogg25Ref,@Chest,@Shoulder); +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Vezax 10 man +(@Vezax10Ref,46014,0,1,1,1,1), -- Saronite Animus Cloak +(@Vezax10Ref,46008,0,1,1,1,1), -- Choker of the Abyss +(@Vezax10Ref,46010,0,1,1,1,1), -- Darkstone Ring +(@Vezax10Ref,45996,0,1,1,1,1), -- Hoperender +(@Vezax10Ref,46015,0,1,1,1,1), -- Pendant of Endless Despair +(@Vezax10Ref,46013,0,1,1,1,1), -- Underworld Mantle +(@Vezax10Ref,46012,0,1,1,1,1), -- Vestments of the Piercing Light +(@Vezax10Ref,46009,0,1,1,1,1), -- Bindings of the Depths +(@Vezax10Ref,45997,0,1,1,1,1), -- Gauntlets of the Wretched +(@Vezax10Ref,46011,0,1,1,1,1), -- Shadowbite +-- Vezax 25 man +(@Vezax25Ref,45513,0,1,1,1,1), -- Boots of the Forgotten Dephts +(@Vezax25Ref,45509,0,1,1,1,1), -- Idol of the Corruptor +(@Vezax25Ref,45501,0,1,1,1,1), -- Boots of the Underdweller +(@Vezax25Ref,45512,0,1,1,1,1), -- Grips of the Unbroken +(@Vezax25Ref,45503,0,1,1,1,1), -- Metallic Loop of the Sufferer +(@Vezax25Ref,45505,0,1,1,1,1), -- Belt of Clinging Hope +(@Vezax25Ref,45502,0,1,1,1,1), -- Helm of the Faceless +(@Vezax25Ref,45145,0,1,1,1,1), -- Libram of the Sacred Shield +(@Vezax25Ref,45508,0,1,1,1,1), -- Belt of the Darkspeaker +(@Vezax25Ref,45504,0,1,1,1,1), -- Darkcore Leggings +(@Vezax25Ref,45514,0,1,1,1,1), -- Mantle of the Unknowing +(@Vezax25Ref,45515,0,1,1,1,1), -- Ring of the Vacant Eye +(@Vezax25Ref,45507,0,1,1,1,1), -- The General's Heart +-- Yogg 10 man +(@Yogg10Ref,46016,0,1,1,1,1), -- Abaddon +(@Yogg10Ref,46018,0,1,1,1,1), -- Deliverance +(@Yogg10Ref,46019,0,1,1,1,1), -- Leggings of the Insatiable +(@Yogg10Ref,46021,0,1,1,1,1), -- Royal Seal of King Llane +(@Yogg10Ref,46022,0,1,1,1,1), -- Pendant of a Thousand Maws +(@Yogg10Ref,46024,0,1,1,1,1), -- Kingsbane +(@Yogg10Ref,46025,0,1,1,1,1), -- Devotion +(@Yogg10Ref,46028,0,1,1,1,1), -- Faceguard of the Eyeless Horror +(@Yogg10Ref,46030,0,1,1,1,1), -- Threads of the Dragon Council +(@Yogg10Ref,46031,0,1,1,1,1), -- Touch of Madness +-- Yogg 25 man +(@Yogg25Ref,45521,0,1,1,1,1), -- Earthshaper +(@Yogg25Ref,45522,0,1,1,1,1), -- Blood of the Old God +(@Yogg25Ref,45523,0,1,1,1,1), -- Garona's Guise +(@Yogg25Ref,45524,0,1,1,1,1), -- Chestguard of Insidious Intent +(@Yogg25Ref,45525,0,1,1,1,1), -- Godbane Signet +(@Yogg25Ref,45527,0,1,1,1,1), -- Soulscribe +(@Yogg25Ref,45529,0,1,1,1,1), -- Shawl of Haunted Memories +(@Yogg25Ref,45530,0,1,1,1,1), -- Sanity's Bond +(@Yogg25Ref,45531,0,1,1,1,1), -- Chestguard of the Fallen God +(@Yogg25Ref,45532,0,1,1,1,1), -- Cowl of Dark Whispers +-- Chest for Yogg +(@Chest,45635,0,1,1,1,1), -- Chestguard of the Wayward Conqueror +(@Chest,45636,0,1,1,1,1), -- Chestguard of the Wayward Protector +(@Chest,45637,0,1,1,1,1), -- Chestguard of the Wayward Vanquisher +(@Shoulder,45656,0,1,1,1,1), -- Mantle of the Wayward Conqueror +(@Shoulder,45657,0,1,1,1,1), -- Mantle of the Wayward Protector +(@Shoulder,45658,0,1,1,1,1); -- Mantle of the Wayward Vanquisher + +DELETE FROM `creature_loot_template` WHERE `entry` IN(@Vezax10,@Vezax25,@Yogg10,@Yogg25); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- ---------------------------------------------------------- +-- General Vezax +-- ---------------------------------------------------------- +-- 10 man mode +(@Vezax10,1,100,3,0,-@Vezax10Ref,2), -- 2x Normal Loot Item +(@Vezax10,47241,100,3,0,1,1), -- 1x Emblem of Triumph +-- hardmode loot 10 +(@Vezax10,46032,0,2,1,1,1), -- Drape of the Faceless General +(@Vezax10,46034,0,2,1,1,1), -- Leggings of Profound Darkness +(@Vezax10,46033,0,2,1,1,1), -- Tortured Earth +(@Vezax10,46035,0,2,1,1,1), -- Aesuga, Hand of the Ardent Champion +(@Vezax10,46036,0,2,1,1,1), -- Void Sabre +-- 25 man mode +(@Vezax25,1,100,3,0,-@Vezax25Ref,3), -- 3x Normal Loot Item +(@Vezax25,47241,100,3,0,1,1), -- 1x Emblem of Triumph +(@Vezax25,2,10,1,0,-@Recipe,1), -- Chance on Recipe +(@Vezax25,3,10,1,0,-34350,1), -- Chance on Runed Orb +-- hardmode loot 25 +(@Vezax25,45498,0,2,1,1,1), -- Lotrafen, Spear of the Damned +(@Vezax25,45511,0,2,1,1,1), -- Scepter of Lost Souls +(@Vezax25,45516,0,2,1,1,1), -- Voldrethar, Dark Blade of Oblivion +(@Vezax25,45517,0,2,1,1,1), -- Pendulum of Infinity +(@Vezax25,45519,0,2,1,1,1), -- Vestments of the Blind Denizen +(@Vezax25,45518,0,2,1,1,1), -- Flare of the Heavens +(@Vezax25,45520,0,2,1,1,1), -- Handwraps of the Vigilant +-- ---------------------------------------------------------- +-- Yogg Saron +-- ---------------------------------------------------------- +-- 10 man +-- All modes +(@Yogg10,1,100,31,0,-@Yogg10Ref,1), -- 1x Normal Loot item for modes 0&1&2&3&4 +(@Yogg10,2,100,31,0,-@Chest,1), -- 1x Tier token for modes 0&1&2&3&4 +(@Yogg10,47241,100,31,0,1,1), -- 1x Emblem of Triumph for modes 0&1&2&3&4 +-- Extra for <3 watchers +(@Yogg10,3,100,30,0,-@EmblemRef,1), -- additional Emblem for modes2&3 +-- Extra for <2 watchers +(@Yogg10,4,100,28,0,-34350,1), -- Runed Orb for 0&1&2 +(@Yogg10,5,10,28,0,-@Recipe,1), -- Chance on Recipe for 0&1&2 +-- Extra for <1 watchers +(@Yogg10,6,100,24,0,-@EmblemRef,1), -- additional Emblem for 0&1 +(@Yogg10,7,100,24,0,-@Recipe,1), -- Garanteed Recipe for 0&1 +-- Hardmode 10 loot +(@Yogg10,46067,0,24,1,1,1), -- Hammer of Crushing Whispers +(@Yogg10,46068,0,24,1,1,1), -- Amice of Inconceivable Horror +(@Yogg10,46095,0,24,1,1,1), -- Soul-Devouring Cinch +(@Yogg10,46096,0,24,1,1,1), -- Signet of Soft Lament +(@Yogg10,46097,0,24,1,1,1), -- Caress of Insanity +-- Extra for 0 watchers +(@Yogg10,46312,100,16,0,1,1), -- Vanquished Clutches of Yogg-Saron +-- 25 man mode +-- All modes +(@Yogg25,1,100,31,0,-@Yogg25Ref,2), -- 2x Normal Loot item for modes 0&1&2&3&4 +(@Yogg25,2,100,31,0,-@Shoulder,2), -- 2x Tier token for modes 0&1&2&3&4 +(@Yogg25,47241,100,31,0,1,1), -- 1x Emblem of Triumph for modes 0&1&2&3&4 +(@Yogg25,3,10,31,0,-34350,1), -- Chance on Runed Orb for modes 0&1&2&3&4 +(@Yogg25,4,10,31,0,-@Recipe,1), -- Chance on Recipe for 0&1&2&3&4 +(@Yogg25,45897,100,31,0,1,1), -- Fragment of Val'anyr +-- Extra for <3 watchers +(@Yogg25,5,100,30,0,-@EmblemRef,1), -- additional Emblem for modes2&3 +-- Extra for <2 watchers +(@Yogg25,6,100,28,0,-34350,1), -- Runed Orb for 0&1&2 +-- Extra for <1 watchers +(@Yogg25,7,100,24,0,-@EmblemRef,1), -- additional Emblem for 0&1 +(@Yogg25,8,100,24,0,-@Recipe,1), -- Garanteed Recipe for 0&1 +-- Hardmode 25 loot +(@Yogg25,45533,0,24,1,1,1), -- Dark Edge of Depravity +(@Yogg25,45534,0,24,1,1,1), -- Seal of the Betrayed King +(@Yogg25,45535,0,24,1,1,1), -- Show of Faith +(@Yogg25,45536,0,24,1,1,1), -- Legguards of Cunning Deception +(@Yogg25,45537,0,24,1,1,1), -- Threads of the False Oracle +-- Extra for 0 watchers +(@Yogg25,45693,100,16,0,1,1); -- Mimiron's Head + +-- Cleanups +DELETE FROM `conditions` WHERE `SourceEntry`=45897 AND `SourceGroup`=33955; \ No newline at end of file From d6666386cd7d1667548fadda628ec9e53a39a035 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sat, 28 Apr 2012 10:26:25 +0200 Subject: [PATCH 0655/1149] DB/Loot: Cleanup some ugly reference_templates --- ...04_28_01_world_reference_loot_template.sql | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 sql/updates/world/2012_04_28_01_world_reference_loot_template.sql diff --git a/sql/updates/world/2012_04_28_01_world_reference_loot_template.sql b/sql/updates/world/2012_04_28_01_world_reference_loot_template.sql new file mode 100644 index 00000000000..e46c45e497a --- /dev/null +++ b/sql/updates/world/2012_04_28_01_world_reference_loot_template.sql @@ -0,0 +1,22 @@ +SET @Triumph :=47241; +-- Cleanup some unneeded references +DELETE FROM `reference_loot_template` WHERE `entry` IN (34167,34168,34169); +UPDATE `creature_loot_template` SET `mincountOrRef`=-34349 WHERE `mincountOrRef` IN (-34167,-34168,-34169); +-- Fix this weird defined reference for ulduar +UPDATE `reference_loot_template` SET `ChanceOrQuestChance`=100,`groupid`=0 WHERE `entry`=34349; +-- Remove Emblem of Triumph from reference_loot +DELETE FROM `reference_loot_template` WHERE `item`=@Triumph AND `entry`IN (12025,35034,35040,35049); +-- Actual Emblem on creature as it should be +DELETE FROM `creature_loot_template` WHERE `entry` IN (30397,30398,31365,31367,31656,31679) AND `item`=@Triumph; +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(30397,@Triumph,100,1,0,1,1), -- Commander Kolurg (1) +(30398,@Triumph,100,1,0,1,1), -- Commander Stoutbeard (1) +(31365,@Triumph,100,1,0,1,1), -- Drakkari Colossus (1) +(31367,@Triumph,100,1,0,1,1), -- Drakkari Elemental (1) +(31656,@Triumph,100,1,0,1,1), -- Dalronn the Controller (1) +(31679,@Triumph,100,1,0,1,1); -- Skarvald the Constructor (1) +-- Similar action for gameobjects +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (27416,27417) AND `item`=@Triumph; +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(27417,@Triumph,100,1,0,1,1), -- Confessor's Cache +(27416,@Triumph,100,1,0,1,1); -- Eadric's Cache From b899f5fc942902153ff369737ca835a997495299 Mon Sep 17 00:00:00 2001 From: QAston Date: Sat, 28 Apr 2012 14:53:40 +0200 Subject: [PATCH 0656/1149] Core/SpellScripts: rename GetTarget*() functions to GetExplTarget*(), so the names reflect better what those functions do. Also update some comments. --- src/server/game/Spells/SpellScript.cpp | 15 +++++--- src/server/game/Spells/SpellScript.h | 34 ++++++++++++------- src/server/scripts/Examples/example_spell.cpp | 2 +- .../scripts/Kalimdor/dustwallow_marsh.cpp | 2 +- .../TrialOfTheCrusader/boss_twin_valkyr.cpp | 2 +- .../boss_blood_prince_council.cpp | 4 +-- .../boss_blood_queen_lana_thel.cpp | 2 +- .../boss_professor_putricide.cpp | 10 +++--- .../IcecrownCitadel/boss_rotface.cpp | 4 +-- .../IcecrownCitadel/boss_sindragosa.cpp | 2 +- .../IcecrownCitadel/boss_the_lich_king.cpp | 4 +-- .../Ulduar/boss_algalon_the_observer.cpp | 6 ++-- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 2 +- .../Ulduar/Ulduar/boss_razorscale.cpp | 2 +- src/server/scripts/Spells/spell_dk.cpp | 2 +- src/server/scripts/Spells/spell_druid.cpp | 4 +-- src/server/scripts/Spells/spell_generic.cpp | 2 +- src/server/scripts/Spells/spell_hunter.cpp | 4 +-- src/server/scripts/Spells/spell_paladin.cpp | 7 ++-- src/server/scripts/Spells/spell_priest.cpp | 7 ++-- src/server/scripts/Spells/spell_quest.cpp | 2 +- src/server/scripts/Spells/spell_warlock.cpp | 4 +-- 22 files changed, 68 insertions(+), 55 deletions(-) diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 44a2dd4dedb..e12c5d62d9f 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -320,29 +320,34 @@ SpellInfo const* SpellScript::GetSpellInfo() return m_spell->GetSpellInfo(); } -WorldLocation const* SpellScript::GetTargetDest() +WorldLocation const* SpellScript::GetExplTargetDest() { if (m_spell->m_targets.HasDst()) return m_spell->m_targets.GetDstPos(); return NULL; } -void SpellScript::SetTargetDest(WorldLocation& loc) +void SpellScript::SetExplTargetDest(WorldLocation& loc) { m_spell->m_targets.SetDst(loc); } -Unit* SpellScript::GetTargetUnit() +Unit* SpellScript::GetExplTargetWorldObject() +{ + return m_spell->m_targets.GetObjectTarget(); +} + +Unit* SpellScript::GetExplTargetUnit() { return m_spell->m_targets.GetUnitTarget(); } -GameObject* SpellScript::GetTargetGObj() +GameObject* SpellScript::GetExplTargetGObj() { return m_spell->m_targets.GetGOTarget(); } -Item* SpellScript::GetTargetItem() +Item* SpellScript::GetExplTargetItem() { return m_spell->m_targets.GetItemTarget(); } diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index 26393040a1e..7b194b7827f 100755 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -295,25 +295,35 @@ class SpellScript : public _SpellScript SpellInfo const* GetSpellInfo(); SpellValue const* GetSpellValue(); - // methods useable after spell targets are set - // accessors to the "focus" targets of the spell - // note: do not confuse these with spell hit targets + // methods useable after spell is prepared + // accessors to the explicit targets of the spell + // explicit target - target selected by caster (player, game client, or script - DoCast(explicitTarget, ...), required for spell to be cast + // examples: + // -shadowstep - explicit target is the unit you want to go behind of + // -chain heal - explicit target is the unit to be healed first + // -holy nova/arcane explosion - explicit target = NULL because target you are selecting doesn't affect how spell targets are selected + // you can determine if spell requires explicit targets by dbc columns: + // - Targets - mask of explicit target types + // - ImplicitTargetXX set to TARGET_XXX_TARGET_YYY, _TARGET_ here means that explicit target is used by the effect, so spell needs one too + // returns: WorldLocation which was selected as a spell destination or NULL - WorldLocation const* GetTargetDest(); + WorldLocation const* GetExplTargetDest(); - void SetTargetDest(WorldLocation& loc); + void SetExplTargetDest(WorldLocation& loc); - // returns: Unit which was selected as a spell target or NULL - Unit* GetTargetUnit(); + // returns: WorldObject which was selected as an explicit spell target or NULL if there's no target + WorldObject* GetExplTargetWorldObject(); - // returns: GameObject which was selected as a spell target or NULL - GameObject* GetTargetGObj(); + // returns: Unit which was selected as an explicit spell target or NULL if there's no target + Unit* GetExplTargetUnit(); - // returns: Item which was selected as a spell target or NULL - Item* GetTargetItem(); + // returns: GameObject which was selected as an explicit spell target or NULL if there's no target + GameObject* GetExplTargetGObj(); + + // returns: Item which was selected as an explicit spell target or NULL if there's no target + Item* GetExplTargetItem(); // methods useable only during spell hit on target, or during spell launch on target: - // returns: target of current effect if it was Unit otherwise NULL Unit* GetHitUnit(); // returns: target of current effect if it was Creature otherwise NULL diff --git a/src/server/scripts/Examples/example_spell.cpp b/src/server/scripts/Examples/example_spell.cpp index 8c721c141af..70d7f43135c 100644 --- a/src/server/scripts/Examples/example_spell.cpp +++ b/src/server/scripts/Examples/example_spell.cpp @@ -102,7 +102,7 @@ class spell_ex_5581 : public SpellScriptLoader { // in this hook you can add additional requirements for spell caster (and throw a client error if reqs're not passed) // in this case we're disallowing to select non-player as a target of the spell - //if (!GetTargetUnit() || GetTargetUnit()->ToPlayer()) + //if (!GetExplTargetUnit() || GetExplTargetUnit()->ToPlayer()) //return SPELL_FAILED_BAD_TARGETS; return SPELL_CAST_OK; } diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp index cbacc4fdf66..e4ed3793385 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp @@ -713,7 +713,7 @@ class spell_ooze_zap : public SpellScriptLoader if (!GetCaster()->HasAura(GetSpellInfo()->Effects[EFFECT_1].CalcValue())) return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; // This is actually correct - if (!GetTargetUnit()) + if (!GetExplTargetUnit()) return SPELL_FAILED_BAD_TARGETS; return SPELL_CAST_OK; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index 241d6239f82..cf84abb482f 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -769,7 +769,7 @@ class spell_powering_up : public SpellScriptLoader void HandleScriptEffect(SpellEffIndex /*effIndex*/) { - if (Unit* target = GetTargetUnit()) + if (Unit* target = GetExplTargetUnit()) if (urand(0, 99) < 15) target->CastSpell(target, spellId, true); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index 8090fc98101..d091a87dbfe 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -1497,10 +1497,10 @@ class spell_valanar_kinetic_bomb : public SpellScriptLoader void ChangeSummonPos(SpellEffIndex /*effIndex*/) { - WorldLocation summonPos = *GetTargetDest(); + WorldLocation summonPos = *GetExplTargetDest(); Position offset = {0.0f, 0.0f, 20.0f, 0.0f}; summonPos.RelocateOffset(offset); - SetTargetDest(summonPos); + SetExplTargetDest(summonPos); GetHitDest()->RelocateOffset(offset); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index b6544fd9a2a..f086e8dc9cf 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -522,7 +522,7 @@ class spell_blood_queen_vampiric_bite : public SpellScriptLoader SpellCastResult CheckTarget() { - if (IsVampire(GetTargetUnit())) + if (IsVampire(GetExplTargetUnit())) { SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_CANT_TARGET_VAMPIRES); return SPELL_FAILED_CUSTOM_ERROR; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index c043cb27c7c..a0fca522f61 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -1280,11 +1280,11 @@ class spell_putricide_mutation_init : public SpellScriptLoader SpellCastResult CheckRequirementInternal(SpellCustomErrors& extendedError) { - InstanceScript* instance = GetTargetUnit()->GetInstanceScript(); + InstanceScript* instance = GetExplTargetUnit()->GetInstanceScript(); if (!instance) return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; - Creature* professor = ObjectAccessor::GetCreature(*GetTargetUnit(), instance->GetData64(DATA_PROFESSOR_PUTRICIDE)); + Creature* professor = ObjectAccessor::GetCreature(*GetExplTargetUnit(), instance->GetData64(DATA_PROFESSOR_PUTRICIDE)); if (!professor) return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; @@ -1305,17 +1305,17 @@ class spell_putricide_mutation_init : public SpellScriptLoader SpellCastResult CheckRequirement() { - if (!GetTargetUnit()) + if (!GetExplTargetUnit()) return SPELL_FAILED_BAD_TARGETS; - if (GetTargetUnit()->GetTypeId() != TYPEID_PLAYER) + if (GetExplTargetUnit()->GetTypeId() != TYPEID_PLAYER) return SPELL_FAILED_TARGET_NOT_PLAYER; SpellCustomErrors extension = SPELL_CUSTOM_ERROR_NONE; SpellCastResult result = CheckRequirementInternal(extension); if (result != SPELL_CAST_OK) { - Spell::SendCastResult(GetTargetUnit()->ToPlayer(), GetSpellInfo(), 0, result, extension); + Spell::SendCastResult(GetExplTargetUnit()->ToPlayer(), GetSpellInfo(), 0, result, extension); return result; } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index 85de6789784..a4ab13f6ada 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -716,13 +716,13 @@ class spell_rotface_unstable_ooze_explosion : public SpellScriptLoader void CheckTarget(SpellEffIndex effIndex) { PreventHitDefaultEffect(EFFECT_0); - if (!GetTargetDest()) + if (!GetExplTargetDest()) return; uint32 triggered_spell_id = GetSpellInfo()->Effects[effIndex].TriggerSpell; float x, y, z; - GetTargetDest()->GetPosition(x, y, z); + GetExplTargetDest()->GetPosition(x, y, z); // let Rotface handle the cast - caster dies before this executes if (InstanceScript* script = GetCaster()->GetInstanceScript()) if (Creature* rotface = script->instance->GetCreature(script->GetData64(DATA_ROTFACE))) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index ebf9ae02a95..6039ace44ab 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -1344,7 +1344,7 @@ class spell_rimefang_icy_blast : public SpellScriptLoader void HandleTriggerMissile(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); - if (Position const* pos = GetTargetDest()) + if (Position const* pos = GetExplTargetDest()) if (TempSummon* summon = GetCaster()->SummonCreature(NPC_ICY_BLAST, *pos, TEMPSUMMON_TIMED_DESPAWN, 40000)) summon->CastSpell(summon, SPELL_ICY_BLAST_AREA, true); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 2eb894a5153..4dab215d1da 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -2470,7 +2470,7 @@ class spell_the_lich_king_summon_into_air : public SpellScriptLoader void ModDestHeight(SpellEffIndex effIndex) { static Position const offset = {0.0f, 0.0f, 15.0f, 0.0f}; - WorldLocation* dest = const_cast(GetTargetDest()); + WorldLocation* dest = const_cast(GetExplTargetDest()); dest->RelocateOffset(offset); // spirit bombs get higher if (GetSpellInfo()->Effects[effIndex].MiscValue == NPC_SPIRIT_BOMB) @@ -2727,7 +2727,7 @@ class spell_the_lich_king_vile_spirits_visual : public SpellScriptLoader void ModDestHeight(SpellEffIndex /*effIndex*/) { Position offset = {0.0f, 0.0f, 15.0f, 0.0f}; - const_cast(GetTargetDest())->RelocateOffset(offset); + const_cast(GetExplTargetDest())->RelocateOffset(offset); } void Register() diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index 6f87d7fcd2a..661b3530bb8 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -1267,7 +1267,7 @@ class spell_algalon_cosmic_smash : public SpellScriptLoader void ModDestHeight(SpellEffIndex /*effIndex*/) { Position offset = {0.0f, 0.0f, 65.0f, 0.0f}; - const_cast(GetTargetDest())->RelocateOffset(offset); + const_cast(GetExplTargetDest())->RelocateOffset(offset); GetHitDest()->RelocateOffset(offset); } @@ -1294,10 +1294,10 @@ class spell_algalon_cosmic_smash_damage : public SpellScriptLoader void RecalculateDamage() { - if (!GetTargetDest() || !GetHitUnit()) + if (!GetExplTargetDest() || !GetHitUnit()) return; - float distance = GetHitUnit()->GetDistance2d(GetTargetDest()->GetPositionX(), GetTargetDest()->GetPositionY()); + float distance = GetHitUnit()->GetDistance2d(GetExplTargetDest()->GetPositionX(), GetExplTargetDest()->GetPositionY()); if (distance > 6.0f) SetHitDamage(int32(float(GetHitDamage()) / distance) * 2); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 462c767f599..0e453eceaa1 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -1743,7 +1743,7 @@ class spell_vehicle_throw_passenger : public SpellScriptLoader { // use 99 because it is 3d search std::list targetList; - Trinity::WorldObjectSpellAreaTargetCheck check(99, GetTargetDest(), GetCaster(), GetCaster(), GetSpellInfo(), TARGET_CHECK_DEFAULT, NULL); + Trinity::WorldObjectSpellAreaTargetCheck check(99, GetExplTargetDest(), GetCaster(), GetCaster(), GetSpellInfo(), TARGET_CHECK_DEFAULT, NULL); Trinity::WorldObjectListSearcher searcher(GetCaster(), targetList, check); GetCaster()->GetMap()->VisitAll(GetCaster()->m_positionX, GetCaster()->m_positionY, 99, searcher); float minDist = 99 * 99; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index a1323b07899..e8e938dc06b 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp @@ -1006,7 +1006,7 @@ class spell_razorscale_devouring_flame : public SpellScriptLoader PreventHitDefaultEffect(effIndex); Unit* caster = GetCaster(); uint32 entry = uint32(GetSpellInfo()->Effects[effIndex].MiscValue); - WorldLocation const* summonLocation = GetTargetDest(); + WorldLocation const* summonLocation = GetExplTargetDest(); if (!caster || !summonLocation) return; diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 5d874faf411..13190ed013f 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -775,7 +775,7 @@ class spell_dk_death_grip : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { int32 damage = GetEffectValue(); - Position const* pos = GetTargetDest(); + Position const* pos = GetExplTargetDest(); if (Unit* target = GetHitUnit()) { if (!target->HasAuraType(SPELL_AURA_DEFLECT_SPELLS)) // Deterrence diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 380cac4e5ee..898350dbd71 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -237,7 +237,7 @@ class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader } else { - unitList.remove(GetTargetUnit()); + unitList.remove(GetExplTargetUnit()); std::list tempTargets; for (std::list::const_iterator itr = unitList.begin(); itr != unitList.end(); ++itr) if ((*itr)->GetTypeId() == TYPEID_PLAYER && GetCaster()->IsInRaidWith(*itr)) @@ -279,7 +279,7 @@ class spell_dru_starfall_aoe : public SpellScriptLoader void FilterTargets(std::list& unitList) { - unitList.remove(GetTargetUnit()); + unitList.remove(GetExplTargetUnit()); } void Register() diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 7fd37ede316..501c7c47676 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1282,7 +1282,7 @@ class spell_gen_launch : public SpellScriptLoader void Launch() { - WorldLocation const* const position = GetTargetDest(); + WorldLocation const* const position = GetExplTargetDest(); if (Player* player = GetHitPlayer()) { diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 5d8e8f84e6a..a7fb2eb9077 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -286,8 +286,8 @@ class spell_hun_masters_call : public SpellScriptLoader target->CastSpell(target, HUNTER_SPELL_MASTERS_CALL_TRIGGERED, castMask); // there is a possibility that this effect should access effect 0 (dummy) target, but i dubt that // it's more likely that on on retail it's possible to call target selector based on dbc values - // anyways, we're using GetTargetUnit() here and it's ok - if (Unit* ally = GetTargetUnit()) + // anyways, we're using GetExplTargetUnit() here and it's ok + if (Unit* ally = GetExplTargetUnit()) { target->CastSpell(ally, GetEffectValue(), castMask); target->CastSpell(ally, GetSpellInfo()->Effects[EFFECT_0].CalcValue(), castMask); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index c8c563d3d5d..cf8cae68c58 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -288,10 +288,9 @@ class spell_pal_holy_shock : public SpellScriptLoader SpellCastResult CheckCast() { Player* caster = GetCaster()->ToPlayer(); - if (GetTargetUnit()) - if (Unit* target = GetTargetUnit()) - if (!caster->IsFriendlyTo(target) && !caster->IsValidAttackTarget(target)) - return SPELL_FAILED_BAD_TARGETS; + if (Unit* target = GetExplTargetUnit()) + if (!caster->IsFriendlyTo(target) && !caster->IsValidAttackTarget(target)) + return SPELL_FAILED_BAD_TARGETS; return SPELL_CAST_OK; } diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 47cec6ce516..8088004c9d1 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -227,10 +227,9 @@ class spell_pri_penance : public SpellScriptLoader SpellCastResult CheckCast() { Player* caster = GetCaster()->ToPlayer(); - if (GetTargetUnit()) - if (Unit* target = GetTargetUnit()) - if (!caster->IsFriendlyTo(target) && !caster->IsValidAttackTarget(target)) - return SPELL_FAILED_BAD_TARGETS; + if (Unit* target = GetExplTargetUnit()) + if (!caster->IsFriendlyTo(target) && !caster->IsValidAttackTarget(target)) + return SPELL_FAILED_BAD_TARGETS; return SPELL_CAST_OK; } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 06678407b93..9d042da0789 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -275,7 +275,7 @@ class spell_q11396_11399_scourging_crystal_controller : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { - if (Unit* target = GetTargetUnit()) + if (Unit* target = GetExplTargetUnit()) if (target->GetTypeId() == TYPEID_UNIT && target->HasAura(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3)) // Make sure nobody else is channeling the same target if (!target->HasAura(SPELL_SCOURGING_CRYSTAL_CONTROLLER)) diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 1f7e8171e46..838b9e4f932 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -301,8 +301,8 @@ class spell_warl_seed_of_corruption : public SpellScriptLoader void FilterTargets(std::list& unitList) { - if (GetTargetUnit()) - unitList.remove(GetTargetUnit()); + if (GetExplTargetUnit()) + unitList.remove(GetExplTargetUnit()); } void Register() From b53485e05326f9ed6562aa78fee282f255eac339 Mon Sep 17 00:00:00 2001 From: QAston Date: Sat, 28 Apr 2012 15:10:52 +0200 Subject: [PATCH 0657/1149] Fix build and correct minor codestyle issue. --- src/server/game/Entities/Object/Object.cpp | 6 ++++-- src/server/game/Spells/SpellScript.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index e26bc0a6ea1..fc1b56c4b8c 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -626,8 +626,10 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* if (!target->isAllowedToLoot(creature)) dynamicFlags &= ~UNIT_DYNFLAG_LOOTABLE; } - if(dynamicFlags & UNIT_DYNFLAG_TRACK_UNIT) - if (Unit const* unit = ToUnit()) + + // unit UNIT_DYNFLAG_TRACK_UNIT should only be sent to caster of SPELL_AURA_MOD_STALKED auras + if (Unit const* unit = ToUnit()) + if (dynamicFlags & UNIT_DYNFLAG_TRACK_UNIT) if (!unit->HasAuraTypeWithCaster(SPELL_AURA_MOD_STALKED, target->GetGUID())) dynamicFlags &= ~UNIT_DYNFLAG_TRACK_UNIT; *data << dynamicFlags; diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index e12c5d62d9f..e6ce80c20f0 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -332,7 +332,7 @@ void SpellScript::SetExplTargetDest(WorldLocation& loc) m_spell->m_targets.SetDst(loc); } -Unit* SpellScript::GetExplTargetWorldObject() +WorldObject* SpellScript::GetExplTargetWorldObject() { return m_spell->m_targets.GetObjectTarget(); } From 879070bc80351bebe5c781396740210a37cf52ac Mon Sep 17 00:00:00 2001 From: Chaplain Date: Sat, 28 Apr 2012 15:10:52 +0300 Subject: [PATCH 0658/1149] Core/Spells: Separation caster/target part damage/heal bonus calculations. *Implement HoT/DoT save caster side bonuses and apply target mods on each tick --- src/server/game/Entities/Pet/Pet.cpp | 10 +- src/server/game/Entities/Unit/StatSystem.cpp | 6 +- src/server/game/Entities/Unit/Unit.cpp | 622 +++++++++--------- src/server/game/Entities/Unit/Unit.h | 24 +- .../game/Spells/Auras/SpellAuraEffects.cpp | 61 +- .../game/Spells/Auras/SpellAuraEffects.h | 8 +- src/server/game/Spells/Auras/SpellAuras.cpp | 10 +- src/server/game/Spells/SpellEffects.cpp | 56 +- src/server/game/Spells/SpellInfo.cpp | 29 + src/server/game/Spells/SpellInfo.h | 2 + src/server/scripts/Spells/spell_hunter.cpp | 3 +- src/server/scripts/Spells/spell_shaman.cpp | 4 +- src/server/scripts/Spells/spell_warrior.cpp | 5 +- 13 files changed, 472 insertions(+), 368 deletions(-) diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 586f09bd79c..f3a736daceb 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -940,14 +940,14 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) { case 510: // mage Water Elemental { - SetBonusDamage(int32(m_owner->SpellBaseDamageBonus(SPELL_SCHOOL_MASK_FROST) * 0.33f)); + SetBonusDamage(int32(m_owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FROST) * 0.33f)); break; } case 1964: //force of nature { if (!pInfo) SetCreateHealth(30 + 30*petlevel); - float bonusDmg = m_owner->SpellBaseDamageBonus(SPELL_SCHOOL_MASK_NATURE) * 0.15f; + float bonusDmg = m_owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_NATURE) * 0.15f; SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel * 2.5f - (petlevel / 2) + bonusDmg)); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel * 2.5f + (petlevel / 2) + bonusDmg)); break; @@ -967,7 +967,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) SetCreateHealth(40*petlevel); SetCreateMana(28 + 10*petlevel); } - SetBonusDamage(int32(m_owner->SpellBaseDamageBonus(SPELL_SCHOOL_MASK_FIRE) * 0.5f)); + SetBonusDamage(int32(m_owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FIRE) * 0.5f)); SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel * 4 - petlevel)); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel * 4 + petlevel)); break; @@ -979,7 +979,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) SetCreateMana(28 + 10*petlevel); SetCreateHealth(28 + 30*petlevel); } - int32 bonus_dmg = (int32(m_owner->SpellBaseDamageBonus(SPELL_SCHOOL_MASK_SHADOW)* 0.3f)); + int32 bonus_dmg = (int32(m_owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_SHADOW)* 0.3f)); SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float((petlevel * 4 - petlevel) + bonus_dmg)); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float((petlevel * 4 + petlevel) + bonus_dmg)); @@ -1020,7 +1020,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) } case 31216: // Mirror Image { - SetBonusDamage(int32(m_owner->SpellBaseDamageBonus(SPELL_SCHOOL_MASK_FROST) * 0.33f)); + SetBonusDamage(int32(m_owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FROST) * 0.33f)); SetDisplayId(m_owner->GetDisplayId()); if (!pInfo) { diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 2da1c1b88cb..5cec0cf4375 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -142,13 +142,13 @@ void Player::ApplySpellPowerBonus(int32 amount, bool apply) void Player::UpdateSpellDamageAndHealingBonus() { - // Magic damage modifiers implemented in Unit::SpellDamageBonus + // Magic damage modifiers implemented in Unit::SpellDamageBonusDone // This information for client side use only // Get healing bonus for all schools - SetStatInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, SpellBaseHealingBonus(SPELL_SCHOOL_MASK_ALL)); + SetStatInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, SpellBaseHealingBonusDone(SPELL_SCHOOL_MASK_ALL)); // Get damage bonus for all schools for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) - SetStatInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i, SpellBaseDamageBonus(SpellSchoolMask(1 << i))); + SetStatInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i, SpellBaseDamageBonusDone(SpellSchoolMask(1 << i))); } bool Player::UpdateAllStats() diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index fb91c3fc9f1..a04e2ac0e48 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -953,7 +953,9 @@ uint32 Unit::SpellNonMeleeDamageLog(Unit* victim, uint32 spellID, uint32 damage) { SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID); SpellNonMeleeDamage damageInfo(this, victim, spellInfo->Id, spellInfo->SchoolMask); - damage = SpellDamageBonus(victim, spellInfo, damage, SPELL_DIRECT_DAMAGE); + damage = SpellDamageBonusDone(victim, spellInfo, damage, SPELL_DIRECT_DAMAGE); + damage = victim->SpellDamageBonusTaken(spellInfo, damage, SPELL_DIRECT_DAMAGE); + CalculateSpellDamageTaken(&damageInfo, damage, spellInfo); DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); SendSpellNonMeleeDamageLog(&damageInfo); @@ -1148,7 +1150,8 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam damage += CalculateDamage(damageInfo->attackType, false, true); // Add melee damage bonus - MeleeDamageBonus(damageInfo->target, &damage, damageInfo->attackType); + damage = MeleeDamageBonusDone(damageInfo->target, damage, damageInfo->attackType); + damage = MeleeDamageBonusTaken(damage, damageInfo->attackType); // Calculate armor reduction if (IsDamageReducedByArmor((SpellSchoolMask)(damageInfo->damageSchoolMask))) @@ -1400,7 +1403,10 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) uint32 damage = (*dmgShieldItr)->GetAmount(); if (Unit* caster = (*dmgShieldItr)->GetCaster()) - damage = caster->SpellDamageBonus(this, i_spellProto, damage, SPELL_DIRECT_DAMAGE); + { + damage = caster->SpellDamageBonusDone(this, i_spellProto, damage, SPELL_DIRECT_DAMAGE); + damage = this->SpellDamageBonusTaken(i_spellProto, damage, SPELL_DIRECT_DAMAGE); + } // No Unit::CalcAbsorbResist here - opcode doesn't send that data - this damage is probably not affected by that victim->DealDamageMods(this, damage, NULL); @@ -3652,7 +3658,10 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId // final heal int32 healAmount = aurEff->GetAmount(); if (Unit* caster = aura->GetCaster()) - healAmount = caster->SpellHealingBonus(this, aura->GetSpellInfo(), healAmount, HEAL, dispelInfo.GetRemovedCharges()); + { + healAmount = caster->SpellHealingBonusDone(this, aura->GetSpellInfo(), healAmount, HEAL, dispelInfo.GetRemovedCharges()); + healAmount = this->SpellHealingBonusTaken(aura->GetSpellInfo(), healAmount, HEAL, dispelInfo.GetRemovedCharges()); + } CastCustomSpell(this, 33778, &healAmount, NULL, NULL, true, NULL, NULL, aura->GetCasterGUID()); // mana @@ -6724,8 +6733,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere return false; triggered_spell_id = 25742; float ap = GetTotalAttackPowerValue(BASE_ATTACK); - int32 holy = SpellBaseDamageBonus(SPELL_SCHOOL_MASK_HOLY) + - SpellBaseDamageBonusForVictim(SPELL_SCHOOL_MASK_HOLY, victim); + int32 holy = SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_HOLY) + + victim->SpellBaseDamageBonusTaken(SPELL_SCHOOL_MASK_HOLY); basepoints0 = (int32)GetAttackTime(BASE_ATTACK) * int32(ap * 0.022f + 0.044f * holy) / 1000; break; } @@ -7435,8 +7444,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere float fire_onhit = float(CalculatePctF(dummySpell->Effects[EFFECT_0]. CalcValue(), 1.0f)); - float add_spellpower = (float)(SpellBaseDamageBonus(SPELL_SCHOOL_MASK_FIRE) - + SpellBaseDamageBonusForVictim(SPELL_SCHOOL_MASK_FIRE, victim)); + float add_spellpower = (float)(SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FIRE) + + victim->SpellBaseDamageBonusTaken(SPELL_SCHOOL_MASK_FIRE)); // 1.3speed = 5%, 2.6speed = 10%, 4.0 speed = 15%, so, 1.0speed = 3.84% ApplyPctF(add_spellpower, 3.84f); @@ -9007,7 +9016,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg { if (AuraEffect* aurEff = owner->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, 3220, 0)) { - basepoints0 = int32((aurEff->GetAmount() * owner->SpellBaseDamageBonus(SpellSchoolMask(SPELL_SCHOOL_MASK_MAGIC)) + 100.0f) / 100.0f); // TODO: Is it right? + basepoints0 = int32((aurEff->GetAmount() * owner->SpellBaseDamageBonusDone(SpellSchoolMask(SPELL_SCHOOL_MASK_MAGIC)) + 100.0f) / 100.0f); // TODO: Is it right? CastCustomSpell(this, trigger_spell_id, &basepoints0, &basepoints0, NULL, true, castItem, triggeredByAura); return true; } @@ -10374,7 +10383,7 @@ void Unit::EnergizeBySpell(Unit* victim, uint32 spellID, uint32 damage, Powers p victim->getHostileRefManager().threatAssist(this, float(damage) * 0.5f, spellInfo); } -uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack) +uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack) { if (!spellProto || !victim || damagetype == DIRECT_DAMAGE) return pdamage; @@ -10387,15 +10396,13 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 // For totems get damage bonus from owner if (GetTypeId() == TYPEID_UNIT && ToCreature()->isTotem()) if (Unit* owner = GetOwner()) - return owner->SpellDamageBonus(victim, spellProto, pdamage, damagetype); + return owner->SpellDamageBonusDone(victim, spellProto, pdamage, damagetype); - // Taken/Done total percent damage auras + // Done total percent damage auras float DoneTotalMod = 1.0f; float ApCoeffMod = 1.0f; int32 DoneTotal = 0; - int32 TakenTotal = 0; - // ..done // Pet damage? if (GetTypeId() == TYPEID_UNIT && !ToCreature()->isPet()) DoneTotalMod *= ToCreature()->GetSpellDamageMod(ToCreature()->GetCreatureTemplate()->rank); @@ -10726,50 +10733,8 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 break; } - // ..taken - float TakenTotalMod = 1.0f; - - // from positive and negative SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN - // multiplicative bonus, for example Dispersion + Shadowform (0.10*0.85=0.085) - TakenTotalMod *= victim->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, spellProto->GetSchoolMask()); - - // .. taken pct: dummy auras - AuraEffectList const& mDummyAuras = victim->GetAuraEffectsByType(SPELL_AURA_DUMMY); - for (AuraEffectList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i) - { - switch ((*i)->GetSpellInfo()->SpellIconID) - { - // Cheat Death - case 2109: - if ((*i)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) - { - if (victim->GetTypeId() != TYPEID_PLAYER) - continue; - float mod = victim->ToPlayer()->GetRatingBonusValue(CR_CRIT_TAKEN_MELEE) * (-8.0f); - AddPctF(TakenTotalMod, std::max(mod, float((*i)->GetAmount()))); - } - break; - } - } - - // From caster spells - AuraEffectList const& mOwnerTaken = victim->GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER); - for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i) - if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectedOnSpell(spellProto)) - AddPctN(TakenTotalMod, (*i)->GetAmount()); - - // Mod damage from spell mechanic - if (uint32 mechanicMask = spellProto->GetAllEffectsMechanicMask()) - { - AuraEffectList const& mDamageDoneMechanic = victim->GetAuraEffectsByType(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT); - for (AuraEffectList::const_iterator i = mDamageDoneMechanic.begin(); i != mDamageDoneMechanic.end(); ++i) - if (mechanicMask & uint32(1<<((*i)->GetMiscValue()))) - AddPctN(TakenTotalMod, (*i)->GetAmount()); - } - - // Taken/Done fixed damage bonus auras - int32 DoneAdvertisedBenefit = SpellBaseDamageBonus(spellProto->GetSchoolMask()); - int32 TakenAdvertisedBenefit = SpellBaseDamageBonusForVictim(spellProto->GetSchoolMask(), victim); + // Done fixed damage bonus auras + int32 DoneAdvertisedBenefit = SpellBaseDamageBonusDone(spellProto->GetSchoolMask()); // Pets just add their bonus damage to their spell damage // note that their spell damage is just gain of their own auras if (HasUnitTypeMask(UNIT_MASK_GUARDIAN)) @@ -10804,67 +10769,13 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 } } // Default calculation - if (DoneAdvertisedBenefit || TakenAdvertisedBenefit) + if (DoneAdvertisedBenefit) { if (!bonus || coeff < 0) - { - // Damage Done from spell damage bonus - int32 CastingTime = spellProto->IsChanneled() ? spellProto->GetDuration() : spellProto->CalcCastTime(); - // Damage over Time spells bonus calculation - float DotFactor = 1.0f; - if (damagetype == DOT) - { - int32 DotDuration = spellProto->GetDuration(); - // 200% limit - if (DotDuration > 0) - { - if (DotDuration > 30000) - DotDuration = 30000; - if (!spellProto->IsChanneled()) - DotFactor = DotDuration / 15000.0f; - uint8 x = 0; - for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j) - { - if (spellProto->Effects[j].Effect == SPELL_EFFECT_APPLY_AURA && ( - spellProto->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE || - spellProto->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_LEECH)) - { - x = j; - break; - } - } - int32 DotTicks = 6; - if (spellProto->Effects[x].Amplitude != 0) - DotTicks = DotDuration / spellProto->Effects[x].Amplitude; - if (DotTicks) - { - DoneAdvertisedBenefit /= DotTicks; - TakenAdvertisedBenefit /= DotTicks; - } - } - } - // Distribute Damage over multiple effects, reduce by AoE - CastingTime = GetCastingTimeForBonus(spellProto, damagetype, CastingTime); - - // 50% for damage and healing spells for leech spells from damage bonus and 0% from healing - for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j) - { - if (spellProto->Effects[j].Effect == SPELL_EFFECT_HEALTH_LEECH || - (spellProto->Effects[j].Effect == SPELL_EFFECT_APPLY_AURA && spellProto->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_LEECH)) - { - CastingTime /= 2; - break; - } - } - if (spellProto->SchoolMask != SPELL_SCHOOL_MASK_NORMAL) - coeff = (CastingTime / 3500.0f) * DotFactor; - else - coeff = DotFactor; - } + coeff = CalculateDefaultCoefficient(spellProto, damagetype) * int32(stack); float factorMod = CalculateLevelPenalty(spellProto) * stack; - // level penalty still applied on Taken bonus - is it blizzlike? - TakenTotal+= int32(TakenAdvertisedBenefit * factorMod); + if (Player* modOwner = GetSpellModOwner()) { coeff *= 100.0f; @@ -10892,16 +10803,89 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 if (Player* modOwner = GetSpellModOwner()) modOwner->ApplySpellMod(spellProto->Id, damagetype == DOT ? SPELLMOD_DOT : SPELLMOD_DAMAGE, tmpDamage); - tmpDamage = (tmpDamage + TakenTotal) * TakenTotalMod; + return uint32(std::max(tmpDamage, 0.0f)); +} + +uint32 Unit::SpellDamageBonusTaken(SpellInfo const* spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack) +{ + if (!spellProto || damagetype == DIRECT_DAMAGE) + return pdamage; + + int32 TakenTotal = 0; + float TakenTotalMod = 1.0f; + + //from positive and negative SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN + //multiplicative bonus, for example Dispersion + Shadowform (0.10*0.85=0.085) + TakenTotalMod *= GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, spellProto->GetSchoolMask()); + + //.. taken pct: dummy auras + AuraEffectList const& mDummyAuras = GetAuraEffectsByType(SPELL_AURA_DUMMY); + for (AuraEffectList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i) + { + switch ((*i)->GetSpellInfo()->SpellIconID) + { + // Cheat Death + case 2109: + if ((*i)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) + { + if (GetTypeId() != TYPEID_PLAYER) + continue; + float mod = ToPlayer()->GetRatingBonusValue(CR_CRIT_TAKEN_MELEE) * (-8.0f); + AddPctF(TakenTotalMod, std::max(mod, float((*i)->GetAmount()))); + } + break; + } + } + + // From caster spells + AuraEffectList const& mOwnerTaken = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER); + for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i) + if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectedOnSpell(spellProto)) + AddPctN(TakenTotalMod, (*i)->GetAmount()); + + // Mod damage from spell mechanic + if (uint32 mechanicMask = spellProto->GetAllEffectsMechanicMask()) + { + AuraEffectList const& mDamageDoneMechanic = GetAuraEffectsByType(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT); + for (AuraEffectList::const_iterator i = mDamageDoneMechanic.begin(); i != mDamageDoneMechanic.end(); ++i) + if (mechanicMask & uint32(1<<((*i)->GetMiscValue()))) + AddPctN(TakenTotalMod, (*i)->GetAmount()); + } + + int32 TakenAdvertisedBenefit = SpellBaseDamageBonusTaken(spellProto->GetSchoolMask()); + + // Check for table values + float coeff = 0; + SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id); + if (bonus) + coeff = (damagetype == DOT) ? bonus->dot_damage : bonus->direct_damage; + + // Default calculation + if (TakenAdvertisedBenefit) + { + if (!bonus || coeff < 0) + coeff = CalculateDefaultCoefficient(spellProto, damagetype) * int32(stack); + + float factorMod = CalculateLevelPenalty(spellProto) * stack; + // level penalty still applied on Taken bonus - is it blizzlike? + if (Player* modOwner = GetSpellModOwner()) + { + coeff *= 100.0f; + modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_BONUS_MULTIPLIER, coeff); + coeff /= 100.0f; + } + TakenTotal+= int32(TakenAdvertisedBenefit * coeff * factorMod); + } + + float tmpDamage = (pdamage + TakenTotal) * TakenTotalMod; return uint32(std::max(tmpDamage, 0.0f)); } -int32 Unit::SpellBaseDamageBonus(SpellSchoolMask schoolMask) +int32 Unit::SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) { int32 DoneAdvertisedBenefit = 0; - // ..done AuraEffectList const& mDamageDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE); for (AuraEffectList::const_iterator i = mDamageDone.begin(); i != mDamageDone.end(); ++i) if (((*i)->GetMiscValue() & schoolMask) != 0 && @@ -10937,19 +10921,11 @@ int32 Unit::SpellBaseDamageBonus(SpellSchoolMask schoolMask) return DoneAdvertisedBenefit > 0 ? DoneAdvertisedBenefit : 0; } -int32 Unit::SpellBaseDamageBonusForVictim(SpellSchoolMask schoolMask, Unit* victim) +int32 Unit::SpellBaseDamageBonusTaken(SpellSchoolMask schoolMask) { - uint32 creatureTypeMask = victim->GetCreatureTypeMask(); - int32 TakenAdvertisedBenefit = 0; - // ..done (for creature type by mask) in taken - AuraEffectList const& mDamageDoneCreature = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE_CREATURE); - for (AuraEffectList::const_iterator i = mDamageDoneCreature.begin(); i != mDamageDoneCreature.end(); ++i) - if (creatureTypeMask & uint32((*i)->GetMiscValue())) - TakenAdvertisedBenefit += (*i)->GetAmount(); - // ..taken - AuraEffectList const& mDamageTaken = victim->GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_TAKEN); + AuraEffectList const& mDamageTaken = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_TAKEN); for (AuraEffectList::const_iterator i = mDamageTaken.begin(); i != mDamageTaken.end(); ++i) if (((*i)->GetMiscValue() & schoolMask) != 0) TakenAdvertisedBenefit += (*i)->GetAmount(); @@ -11218,23 +11194,19 @@ uint32 Unit::SpellCriticalHealingBonus(SpellInfo const* spellProto, uint32 damag return damage; } -uint32 Unit::SpellHealingBonus(Unit* victim, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack) +uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack) { // For totems get healing bonus from owner (statue isn't totem in fact) if (GetTypeId() == TYPEID_UNIT && ToCreature()->isTotem()) if (Unit* owner = GetOwner()) - return owner->SpellHealingBonus(victim, spellProto, healamount, damagetype, stack); + return owner->SpellHealingBonusDone(victim, spellProto, healamount, damagetype, stack); // no bonus for heal potions/bandages if (spellProto->SpellFamilyName == SPELLFAMILY_POTION) return healamount; - // Healing Done - // Taken/Done total percent damage auras float DoneTotalMod = 1.0f; - float TakenTotalMod = 1.0f; int32 DoneTotal = 0; - int32 TakenTotal = 0; // Healing done percent AuraEffectList const& mHealingDonePct = GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_DONE_PERCENT); @@ -11297,28 +11269,11 @@ uint32 Unit::SpellHealingBonus(Unit* victim, SpellInfo const* spellProto, uint32 } } - // Taken/Done fixed damage bonus auras - int32 DoneAdvertisedBenefit = SpellBaseHealingBonus(spellProto->GetSchoolMask()); - int32 TakenAdvertisedBenefit = SpellBaseHealingBonusForVictim(spellProto->GetSchoolMask(), victim); - - bool scripted = false; - - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - { - switch (spellProto->Effects[i].ApplyAuraName) - { - // These auras do not use healing coeff - case SPELL_AURA_PERIODIC_LEECH: - case SPELL_AURA_PERIODIC_HEALTH_FUNNEL: - scripted = true; - break; - } - if (spellProto->Effects[i].Effect == SPELL_EFFECT_HEALTH_LEECH) - scripted = true; - } + // Done fixed damage bonus auras + int32 DoneAdvertisedBenefit = SpellBaseHealingBonusDone(spellProto->GetSchoolMask()); // Check for table values - SpellBonusEntry const* bonus = !scripted ? sSpellMgr->GetSpellBonusData(spellProto->Id) : NULL; + SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id); float coeff = 0; float factorMod = 1.0f; if (bonus) @@ -11338,94 +11293,53 @@ uint32 Unit::SpellHealingBonus(Unit* victim, SpellInfo const* spellProto, uint32 (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass !=SPELL_DAMAGE_CLASS_MELEE)? RANGED_ATTACK : BASE_ATTACK)); } } - else // scripted bonus - { - // Gift of the Naaru - if (spellProto->SpellFamilyFlags[2] & 0x80000000 && spellProto->SpellIconID == 329) - { - scripted = true; - int32 apBonus = int32(std::max(GetTotalAttackPowerValue(BASE_ATTACK), GetTotalAttackPowerValue(RANGED_ATTACK))); - if (apBonus > DoneAdvertisedBenefit) - DoneTotal += int32(apBonus * 0.22f); // 22% of AP per tick - else - DoneTotal += int32(DoneAdvertisedBenefit * 0.377f); // 37.7% of BH per tick - } - // Earthliving - 0.45% of normal hot coeff - else if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags[1] & 0x80000) - factorMod *= 0.45f; - // Already set to scripted? so not uses healing bonus coefficient - // No heal coeff for SPELL_DAMAGE_CLASS_NONE class spells by default - else if (scripted || spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE) - { - scripted = true; - coeff = 0.0f; - } - } // Default calculation - if (DoneAdvertisedBenefit || TakenAdvertisedBenefit) + if (DoneAdvertisedBenefit) { - if ((!bonus && !scripted) || coeff < 0) - { - // Damage Done from spell damage bonus - int32 CastingTime = !spellProto->IsChanneled() ? spellProto->CalcCastTime() : spellProto->GetDuration(); - // Damage over Time spells bonus calculation - float DotFactor = 1.0f; - if (damagetype == DOT) - { - int32 DotDuration = spellProto->GetDuration(); - // 200% limit - if (DotDuration > 0) - { - if (DotDuration > 30000) DotDuration = 30000; - if (!spellProto->IsChanneled()) DotFactor = DotDuration / 15000.0f; - uint32 x = 0; - for (uint8 j = 0; j < MAX_SPELL_EFFECTS; j++) - { - if (spellProto->Effects[j].Effect == SPELL_EFFECT_APPLY_AURA && ( - spellProto->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE || - spellProto->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_LEECH)) - { - x = j; - break; - } - } - int32 DotTicks = 6; - if (spellProto->Effects[x].Amplitude != 0) - DotTicks = DotDuration / spellProto->Effects[x].Amplitude; - if (DotTicks) - { - DoneAdvertisedBenefit = DoneAdvertisedBenefit * int32(stack) / DotTicks; - TakenAdvertisedBenefit = TakenAdvertisedBenefit * int32(stack) / DotTicks; - } - } - } - // Distribute Damage over multiple effects, reduce by AoE - CastingTime = GetCastingTimeForBonus(spellProto, damagetype, CastingTime); - // 50% for damage and healing spells for leech spells from damage bonus and 0% from healing - for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j) - { - if (spellProto->Effects[j].Effect == SPELL_EFFECT_HEALTH_LEECH || - (spellProto->Effects[j].Effect == SPELL_EFFECT_APPLY_AURA && spellProto->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_LEECH)) - { - CastingTime /= 2; - break; - } - } - // As wowwiki says: C = (Cast Time / 3.5) * 1.88 (for healing spells) - coeff = (CastingTime / 3500.0f) * DotFactor * 1.88f; - } + if (!bonus || coeff < 0) + coeff = CalculateDefaultCoefficient(spellProto, damagetype) * int32(stack) * 1.88f; // As wowwiki says: C = (Cast Time / 3.5) * 1.88 (for healing spells) factorMod *= CalculateLevelPenalty(spellProto) * stack; - // level penalty still applied on Taken bonus - is it blizzlike? - TakenTotal += int32(TakenAdvertisedBenefit * factorMod); + if (Player* modOwner = GetSpellModOwner()) { coeff *= 100.0f; modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_BONUS_MULTIPLIER, coeff); coeff /= 100.0f; } - DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod); + + // Gift of the Naaru + if (spellProto->SpellFamilyFlags[2] & 0x80000000 && spellProto->SpellIconID == 329) + { + int32 apBonus = int32(std::max(GetTotalAttackPowerValue(BASE_ATTACK), GetTotalAttackPowerValue(RANGED_ATTACK))); + if (apBonus > DoneAdvertisedBenefit) + DoneTotal += int32(apBonus * 0.22f); // 22% of AP per tick + else + DoneTotal += int32(DoneAdvertisedBenefit * 0.377f); // 37.7% of BH per tick + } + else + { + // Earthliving - 0.45% of normal hot coeff + if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags[1] & 0x80000) + factorMod *= 0.45f; + + DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod); + } + } + + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + switch (spellProto->Effects[i].ApplyAuraName) + { + // Bonus healing does not apply to these spells + case SPELL_AURA_PERIODIC_LEECH: + case SPELL_AURA_PERIODIC_HEALTH_FUNNEL: + DoneTotal = 0; + break; + } + if (spellProto->Effects[i].Effect == SPELL_EFFECT_HEALTH_LEECH) + DoneTotal = 0; } // use float as more appropriate for negative values and percent applying @@ -11434,53 +11348,106 @@ uint32 Unit::SpellHealingBonus(Unit* victim, SpellInfo const* spellProto, uint32 if (Player* modOwner = GetSpellModOwner()) modOwner->ApplySpellMod(spellProto->Id, damagetype == DOT ? SPELLMOD_DOT : SPELLMOD_DAMAGE, heal); + return uint32(std::max(heal, 0.0f)); +} + +uint32 Unit::SpellHealingBonusTaken(SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack) +{ + float TakenTotalMod = 1.0f; + + // Healing taken percent + float minval = (float)GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT); + if (minval) + AddPctF(TakenTotalMod, minval); + + float maxval = (float)GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT); + if (maxval) + AddPctF(TakenTotalMod, maxval); + + // Tenacity increase healing % taken + if (AuraEffect const* Tenacity = GetAuraEffect(58549, 0)) + AddPctN(TakenTotalMod, Tenacity->GetAmount()); + + // Healing Done + int32 TakenTotal = 0; + + // Taken fixed damage bonus auras + int32 TakenAdvertisedBenefit = SpellBaseHealingBonusTaken(spellProto->GetSchoolMask()); + // Nourish cast if (spellProto->SpellFamilyName == SPELLFAMILY_DRUID && spellProto->SpellFamilyFlags[1] & 0x2000000) { // Rejuvenation, Regrowth, Lifebloom, or Wild Growth - if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_DRUID, 0x50, 0x4000010, 0)) + if (GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_DRUID, 0x50, 0x4000010, 0)) // increase healing by 20% TakenTotalMod *= 1.2f; } - // Taken mods - - // Tenacity increase healing % taken - if (AuraEffect const* Tenacity = victim->GetAuraEffect(58549, 0)) - AddPctN(TakenTotalMod, Tenacity->GetAmount()); - - // Healing taken percent - float minval = (float)victim->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT); - if (minval) - AddPctF(TakenTotalMod, minval); - - float maxval = (float)victim->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT); - if (maxval) - AddPctF(TakenTotalMod, maxval); - if (damagetype == DOT) { // Healing over time taken percent - float minval_hot = (float)victim->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT); + float minval_hot = (float)GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT); if (minval_hot) AddPctF(TakenTotalMod, minval_hot); - float maxval_hot = (float)victim->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT); + float maxval_hot = (float)GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT); if (maxval_hot) AddPctF(TakenTotalMod, maxval_hot); } - AuraEffectList const& mHealingGet= victim->GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_RECEIVED); + // Check for table values + SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id); + float coeff = 0; + float factorMod = 1.0f; + if (bonus) + coeff = (damagetype == DOT) ? bonus->dot_damage : bonus->direct_damage; + + // Default calculation + if (TakenAdvertisedBenefit) + { + if (!bonus || coeff < 0) + coeff = CalculateDefaultCoefficient(spellProto, damagetype) * int32(stack) * 1.88f; // As wowwiki says: C = (Cast Time / 3.5) * 1.88 (for healing spells) + + factorMod *= CalculateLevelPenalty(spellProto) * int32(stack); + if (Player* modOwner = GetSpellModOwner()) + { + coeff *= 100.0f; + modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_BONUS_MULTIPLIER, coeff); + coeff /= 100.0f; + } + + // Earthliving - 0.45% of normal hot coeff + if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags[1] & 0x80000) + factorMod *= 0.45f; + + TakenTotal += int32(TakenAdvertisedBenefit * coeff * factorMod); + } + + AuraEffectList const& mHealingGet= GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_RECEIVED); for (AuraEffectList::const_iterator i = mHealingGet.begin(); i != mHealingGet.end(); ++i) if (GetGUID() == (*i)->GetCasterGUID() && (*i)->IsAffectedOnSpell(spellProto)) AddPctN(TakenTotalMod, (*i)->GetAmount()); - heal = (int32(heal) + TakenTotal) * TakenTotalMod; + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + switch (spellProto->Effects[i].ApplyAuraName) + { + // Bonus healing does not apply to these spells + case SPELL_AURA_PERIODIC_LEECH: + case SPELL_AURA_PERIODIC_HEALTH_FUNNEL: + TakenTotal = 0; + break; + } + if (spellProto->Effects[i].Effect == SPELL_EFFECT_HEALTH_LEECH) + TakenTotal = 0; + } + + float heal = (int32(healamount) + TakenTotal) * TakenTotalMod; return uint32(std::max(heal, 0.0f)); } -int32 Unit::SpellBaseHealingBonus(SpellSchoolMask schoolMask) +int32 Unit::SpellBaseHealingBonusDone(SpellSchoolMask schoolMask) { int32 AdvertisedBenefit = 0; @@ -11513,13 +11480,15 @@ int32 Unit::SpellBaseHealingBonus(SpellSchoolMask schoolMask) return AdvertisedBenefit; } -int32 Unit::SpellBaseHealingBonusForVictim(SpellSchoolMask schoolMask, Unit* victim) +int32 Unit::SpellBaseHealingBonusTaken(SpellSchoolMask schoolMask) { int32 AdvertisedBenefit = 0; - AuraEffectList const& mDamageTaken = victim->GetAuraEffectsByType(SPELL_AURA_MOD_HEALING); + + AuraEffectList const& mDamageTaken = GetAuraEffectsByType(SPELL_AURA_MOD_HEALING); for (AuraEffectList::const_iterator i = mDamageTaken.begin(); i != mDamageTaken.end(); ++i) if (((*i)->GetMiscValue() & schoolMask) != 0) AdvertisedBenefit += (*i)->GetAmount(); + return AdvertisedBenefit; } @@ -11662,21 +11631,20 @@ bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) cons return false; } -void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attType, SpellInfo const* spellProto) +uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType attType, SpellInfo const* spellProto) { if (!victim) - return; + return 0; - if (*pdamage == 0) - return; + if (pdamage == 0) + return 0; uint32 creatureTypeMask = victim->GetCreatureTypeMask(); - // Taken/Done fixed damage bonus auras + // Done fixed damage bonus auras int32 DoneFlatBenefit = 0; - int32 TakenFlatBenefit = 0; - // ..done (for creature type by mask) in taken + // ..done AuraEffectList const& mDamageDoneCreature = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE_CREATURE); for (AuraEffectList::const_iterator i = mDamageDoneCreature.begin(); i != mDamageDoneCreature.end(); ++i) if (creatureTypeMask & uint32((*i)->GetMiscValue())) @@ -11722,20 +11690,8 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT DoneFlatBenefit += int32(APbonus/14.0f * GetAPMultiplier(attType, normalized)); } - // ..taken - AuraEffectList const& mDamageTaken = victim->GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_TAKEN); - for (AuraEffectList::const_iterator i = mDamageTaken.begin(); i != mDamageTaken.end(); ++i) - if ((*i)->GetMiscValue() & GetMeleeDamageSchoolMask()) - TakenFlatBenefit += (*i)->GetAmount(); - - if (attType != RANGED_ATTACK) - TakenFlatBenefit += victim->GetTotalAuraModifier(SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN); - else - TakenFlatBenefit += victim->GetTotalAuraModifier(SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN); - - // Done/Taken total percent damage auras + // Done total percent damage auras float DoneTotalMod = 1.0f; - float TakenTotalMod = 1.0f; // ..done AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); @@ -11841,11 +11797,43 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT break; } + float tmpDamage = float(int32(pdamage) + DoneFlatBenefit) * DoneTotalMod; + + // apply spellmod to Done damage + if (spellProto) + if (Player* modOwner = GetSpellModOwner()) + modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_DAMAGE, tmpDamage); + + // bonus result can be negative + return uint32(std::max(tmpDamage, 0.0f)); +} + +uint32 Unit::MeleeDamageBonusTaken(uint32 pdamage, WeaponAttackType attType, SpellInfo const *spellProto) +{ + if (pdamage == 0) + return 0; + + int32 TakenFlatBenefit = 0; + // ..taken - TakenTotalMod *= victim->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, GetMeleeDamageSchoolMask()); + AuraEffectList const& mDamageTaken = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_TAKEN); + for (AuraEffectList::const_iterator i = mDamageTaken.begin(); i != mDamageTaken.end(); ++i) + if ((*i)->GetMiscValue() & GetMeleeDamageSchoolMask()) + TakenFlatBenefit += (*i)->GetAmount(); + + if (attType != RANGED_ATTACK) + TakenFlatBenefit += GetTotalAuraModifier(SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN); + else + TakenFlatBenefit += GetTotalAuraModifier(SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN); + + // Taken total percent damage auras + float TakenTotalMod = 1.0f; + + // ..taken + TakenTotalMod *= GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, GetMeleeDamageSchoolMask()); // From caster spells - AuraEffectList const& mOwnerTaken = victim->GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER); + AuraEffectList const& mOwnerTaken = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER); for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i) if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectedOnSpell(spellProto)) AddPctN(TakenTotalMod, (*i)->GetAmount()); @@ -11862,7 +11850,7 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT if (mechanicMask) { - AuraEffectList const& mDamageDoneMechanic = victim->GetAuraEffectsByType(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT); + AuraEffectList const& mDamageDoneMechanic = GetAuraEffectsByType(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT); for (AuraEffectList::const_iterator i = mDamageDoneMechanic.begin(); i != mDamageDoneMechanic.end(); ++i) if (mechanicMask & uint32(1<<((*i)->GetMiscValue()))) AddPctN(TakenTotalMod, (*i)->GetAmount()); @@ -11870,7 +11858,7 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT } // .. taken pct: dummy auras - AuraEffectList const& mDummyAuras = victim->GetAuraEffectsByType(SPELL_AURA_DUMMY); + AuraEffectList const& mDummyAuras = GetAuraEffectsByType(SPELL_AURA_DUMMY); for (AuraEffectList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i) { switch ((*i)->GetSpellInfo()->SpellIconID) @@ -11879,9 +11867,9 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT case 2109: if ((*i)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) { - if (victim->GetTypeId() != TYPEID_PLAYER) + if (GetTypeId() != TYPEID_PLAYER) continue; - float mod = victim->ToPlayer()->GetRatingBonusValue(CR_CRIT_TAKEN_MELEE) * (-8.0f); + float mod = ToPlayer()->GetRatingBonusValue(CR_CRIT_TAKEN_MELEE) * (-8.0f); AddPctF(TakenTotalMod, std::max(mod, float((*i)->GetAmount()))); } break; @@ -11889,38 +11877,31 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT } // .. taken pct: class scripts - /*AuraEffectList const& mclassScritAuras = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); - for (AuraEffectList::const_iterator i = mclassScritAuras.begin(); i != mclassScritAuras.end(); ++i) - { - switch ((*i)->GetMiscValue()) - { - } - }*/ + //*AuraEffectList const& mclassScritAuras = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); + //for (AuraEffectList::const_iterator i = mclassScritAuras.begin(); i != mclassScritAuras.end(); ++i) + //{ + // switch ((*i)->GetMiscValue()) + // { + // } + //}*/ if (attType != RANGED_ATTACK) { - AuraEffectList const& mModMeleeDamageTakenPercent = victim->GetAuraEffectsByType(SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN_PCT); + AuraEffectList const& mModMeleeDamageTakenPercent = GetAuraEffectsByType(SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN_PCT); for (AuraEffectList::const_iterator i = mModMeleeDamageTakenPercent.begin(); i != mModMeleeDamageTakenPercent.end(); ++i) AddPctN(TakenTotalMod, (*i)->GetAmount()); } else { - AuraEffectList const& mModRangedDamageTakenPercent = victim->GetAuraEffectsByType(SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT); + AuraEffectList const& mModRangedDamageTakenPercent = GetAuraEffectsByType(SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT); for (AuraEffectList::const_iterator i = mModRangedDamageTakenPercent.begin(); i != mModRangedDamageTakenPercent.end(); ++i) AddPctN(TakenTotalMod, (*i)->GetAmount()); } - float tmpDamage = float(int32(*pdamage) + DoneFlatBenefit) * DoneTotalMod; - - // apply spellmod to Done damage - if (spellProto) - if (Player* modOwner = GetSpellModOwner()) - modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_DAMAGE, tmpDamage); - - tmpDamage = (tmpDamage + TakenFlatBenefit) * TakenTotalMod; + float tmpDamage = (float(pdamage) + TakenFlatBenefit) * TakenTotalMod; // bonus result can be negative - *pdamage = uint32(std::max(tmpDamage, 0.0f)); + return uint32(std::max(tmpDamage, 0.0f)); } void Unit::ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply) @@ -14501,7 +14482,8 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: doing %u damage from spell id %u (triggered by %s aura of spell %u)", triggeredByAura->GetAmount(), spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); SpellNonMeleeDamage damageInfo(this, target, spellInfo->Id, spellInfo->SchoolMask); - uint32 newDamage = SpellDamageBonus(target, spellInfo, triggeredByAura->GetAmount(), SPELL_DIRECT_DAMAGE); + uint32 newDamage = SpellDamageBonusDone(target, spellInfo, triggeredByAura->GetAmount(), SPELL_DIRECT_DAMAGE); + newDamage = target->SpellDamageBonusTaken(spellInfo, newDamage, SPELL_DIRECT_DAMAGE); CalculateSpellDamageTaken(&damageInfo, newDamage, spellInfo); DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); SendSpellNonMeleeDamageLog(&damageInfo); @@ -15028,7 +15010,7 @@ void Unit::ApplyCastTimePercentMod(float val, bool apply) ApplyPercentModFloatValue(UNIT_MOD_CAST_SPEED, -val, apply); } -uint32 Unit::GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime) +uint32 Unit::GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime) const { // Not apply this to creature casted spells with casttime == 0 if (CastingTime == 0 && GetTypeId() == TYPEID_UNIT && !ToCreature()->isPet()) @@ -15101,20 +15083,21 @@ uint32 Unit::GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectTyp if (AreaEffect) CastingTime /= 2; - // -5% of total per any additional effect - for (uint8 i = 0; i < effects; ++i) + // 50% for damage and healing spells for leech spells from damage bonus and 0% from healing + for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j) { - if (CastingTime > 175) + if (spellProto->Effects[j].Effect == SPELL_EFFECT_HEALTH_LEECH || + (spellProto->Effects[j].Effect == SPELL_EFFECT_APPLY_AURA && spellProto->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_LEECH)) { - CastingTime -= 175; - } - else - { - CastingTime = 0; + CastingTime /= 2; break; } } + // -5% of total per any additional effect + for (uint8 i = 0; i < effects; ++i) + CastingTime *= 0.95f; + return CastingTime; } @@ -15145,6 +15128,29 @@ void Unit::UpdateAuraForGroup(uint8 slot) } } +float Unit::CalculateDefaultCoefficient(SpellInfo const *spellInfo, DamageEffectType damagetype) const +{ + // Damage over Time spells bonus calculation + float DotFactor = 1.0f; + if (damagetype == DOT) + { + + int32 DotDuration = spellInfo->GetDuration(); + if (!spellInfo->IsChanneled() && DotDuration > 0) + DotFactor = DotDuration / 15000.0f; + + if (uint32 DotTicks = spellInfo->GetMaxTicks()) + DotFactor /= DotTicks; + } + + int32 CastingTime = spellInfo->IsChanneled() ? spellInfo->GetDuration() : spellInfo->CalcCastTime(); + // Distribute Damage over multiple effects, reduce by AoE + CastingTime = GetCastingTimeForBonus(spellInfo, damagetype, CastingTime); + + // As wowwiki says: C = (Cast Time / 3.5) + return (CastingTime / 3500.0f) * DotFactor; +} + float Unit::GetAPMultiplier(WeaponAttackType attType, bool normalized) { if (!normalized || GetTypeId() != TYPEID_PLAYER) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 5a6276d3b0c..e7ea70dc290 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2034,12 +2034,20 @@ class Unit : public WorldObject void UnsummonAllTotems(); Unit* GetMagicHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo); Unit* GetMeleeHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo = NULL); - int32 SpellBaseDamageBonus(SpellSchoolMask schoolMask); - int32 SpellBaseHealingBonus(SpellSchoolMask schoolMask); - int32 SpellBaseDamageBonusForVictim(SpellSchoolMask schoolMask, Unit* victim); - int32 SpellBaseHealingBonusForVictim(SpellSchoolMask schoolMask, Unit* victim); - uint32 SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 damage, DamageEffectType damagetype, uint32 stack = 1); - uint32 SpellHealingBonus(Unit* victim, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1); + + int32 SpellBaseDamageBonusDone(SpellSchoolMask schoolMask); + int32 SpellBaseDamageBonusTaken(SpellSchoolMask schoolMask); + uint32 SpellDamageBonusDone(Unit* victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1); + uint32 SpellDamageBonusTaken(SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1); + int32 SpellBaseHealingBonusDone(SpellSchoolMask schoolMask); + int32 SpellBaseHealingBonusTaken(SpellSchoolMask schoolMask); + uint32 SpellHealingBonusDone(Unit* victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1); + uint32 SpellHealingBonusTaken(SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1); + + uint32 MeleeDamageBonusDone(Unit *pVictim, uint32 damage, WeaponAttackType attType, SpellInfo const *spellProto = NULL); + uint32 MeleeDamageBonusTaken(uint32 pdamage,WeaponAttackType attType, SpellInfo const *spellProto = NULL); + + bool isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType = BASE_ATTACK); bool isBlockCritical(); bool isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType = BASE_ATTACK) const; @@ -2051,8 +2059,8 @@ class Unit : public WorldObject void SetContestedPvP(Player* attackedPlayer = NULL); - void MeleeDamageBonus(Unit* victim, uint32 *damage, WeaponAttackType attType, SpellInfo const* spellProto = NULL); - uint32 GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime); + uint32 GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime) const; + float CalculateDefaultCoefficient(SpellInfo const *spellInfo, DamageEffectType damagetype) const; uint32 GetRemainingPeriodicAmount(uint64 caster, uint32 spellId, AuraType auraType, uint8 effectIndex = 0) const; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index dbbd89c7533..d9368810945 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -490,7 +490,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) if (GetSpellInfo()->SpellFamilyFlags[1] & 0x1 && GetSpellInfo()->SpellFamilyFlags[2] & 0x8) { // +80.68% from sp bonus - DoneActualBenefit += caster->SpellBaseDamageBonus(m_spellInfo->GetSchoolMask()) * 0.8068f; + DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8068f; // Glyph of Ice Barrier: its weird having a SPELLMOD_ALL_EFFECTS here but its blizzards doing :) // Glyph of Ice Barrier is only applied at the spell damage bonus because it was already applied to the base value in CalculateSpellDamage DoneActualBenefit = caster->ApplyEffectModifiers(GetSpellInfo(), m_effIndex, DoneActualBenefit); @@ -499,13 +499,13 @@ int32 AuraEffect::CalculateAmount(Unit* caster) else if (GetSpellInfo()->SpellFamilyFlags[0] & 0x8 && GetSpellInfo()->SpellFamilyFlags[2] & 0x8) { // +80.68% from sp bonus - DoneActualBenefit += caster->SpellBaseDamageBonus(m_spellInfo->GetSchoolMask()) * 0.8068f; + DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8068f; } // Frost Ward else if (GetSpellInfo()->SpellFamilyFlags[0] & 0x100 && GetSpellInfo()->SpellFamilyFlags[2] & 0x8) { // +80.68% from sp bonus - DoneActualBenefit += caster->SpellBaseDamageBonus(m_spellInfo->GetSchoolMask()) * 0.8068f; + DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8068f; } break; case SPELLFAMILY_WARLOCK: @@ -513,7 +513,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) if (m_spellInfo->SpellFamilyFlags[2] & 0x40) { // +80.68% from sp bonus - DoneActualBenefit += caster->SpellBaseDamageBonus(m_spellInfo->GetSchoolMask()) * 0.8068f; + DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8068f; } break; case SPELLFAMILY_PRIEST: @@ -527,7 +527,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) if (AuraEffect const* pAurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 2899, 1)) bonus += CalculatePctN(1.0f, pAurEff->GetAmount()); - DoneActualBenefit += caster->SpellBaseHealingBonus(m_spellInfo->GetSchoolMask()) * bonus; + DoneActualBenefit += caster->SpellBaseHealingBonusDone(m_spellInfo->GetSchoolMask()) * bonus; // Improved PW: Shield: its weird having a SPELLMOD_ALL_EFFECTS here but its blizzards doing :) // Improved PW: Shield is only applied at the spell healing bonus because it was already applied to the base value in CalculateSpellDamage DoneActualBenefit = caster->ApplyEffectModifiers(GetSpellInfo(), m_effIndex, DoneActualBenefit); @@ -555,7 +555,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) //+75.00% from sp bonus float bonus = 0.75f; - DoneActualBenefit += caster->SpellBaseHealingBonus(m_spellInfo->GetSchoolMask()) * bonus; + DoneActualBenefit += caster->SpellBaseHealingBonusDone(m_spellInfo->GetSchoolMask()) * bonus; // Divine Guardian is only applied at the spell healing bonus because it was already applied to the base value in CalculateSpellDamage DoneActualBenefit = caster->ApplyEffectModifiers(GetSpellInfo(), m_effIndex, DoneActualBenefit); DoneActualBenefit *= caster->CalculateLevelPenalty(GetSpellInfo()); @@ -584,7 +584,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_MAGE && GetSpellInfo()->SpellFamilyFlags[0] & 0x8000 && m_spellInfo->SpellFamilyFlags[2] & 0x8) { // +80.53% from +spd bonus - DoneActualBenefit += caster->SpellBaseDamageBonus(m_spellInfo->GetSchoolMask()) * 0.8053f;; + DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8053f;; } break; case SPELL_AURA_DUMMY: @@ -592,9 +592,13 @@ int32 AuraEffect::CalculateAmount(Unit* caster) break; // Earth Shield if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_SHAMAN && m_spellInfo->SpellFamilyFlags[1] & 0x400) - amount = caster->SpellHealingBonus(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, SPELL_DIRECT_DAMAGE); + { + amount = caster->SpellHealingBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, SPELL_DIRECT_DAMAGE); + amount = GetBase()->GetUnitOwner()->SpellHealingBonusTaken(GetSpellInfo(), amount, SPELL_DIRECT_DAMAGE); + } break; case SPELL_AURA_PERIODIC_DAMAGE: + m_canBeRecalculated = true; if (!caster) break; // Rupture @@ -656,6 +660,9 @@ int32 AuraEffect::CalculateAmount(Unit* caster) amount = int32((float)amount / GetTotalTicks()); } break; + case SPELL_AURA_PERIODIC_DAMAGE_PERCENT: + m_canBeRecalculated = true; + break; case SPELL_AURA_PERIODIC_ENERGIZE: if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_GENERIC) { @@ -672,6 +679,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) ApplyPctU(amount, GetBase()->GetUnitOwner()->GetCreatePowers(POWER_MANA)); break; case SPELL_AURA_PERIODIC_HEAL: + m_canBeRecalculated = true; if (!caster) break; // Lightwell Renew @@ -933,6 +941,7 @@ void AuraEffect::ChangeAmount(int32 newAmount, bool mark, bool onStackOrReapply) handleMask |= AURA_EFFECT_HANDLE_CHANGE_AMOUNT; if (onStackOrReapply) handleMask |= AURA_EFFECT_HANDLE_REAPPLY; + if (!handleMask) return; @@ -1259,7 +1268,7 @@ void AuraEffect::SendTickImmune(Unit* target, Unit* caster) const caster->SendSpellDamageImmune(target, m_spellInfo->Id); } -void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit* caster) const +void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit* caster) { bool prevented = GetBase()->CallScriptEffectPeriodicHandlers(this, aurApp); if (prevented) @@ -4962,7 +4971,10 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool int32 stack = GetBase()->GetStackAmount(); int32 heal = m_amount; if (caster) - heal = caster->SpellHealingBonus(target, GetSpellInfo(), heal, HEAL, stack); + { + heal = caster->SpellHealingBonusDone(target, GetSpellInfo(), heal, HEAL, stack); + heal = target->SpellHealingBonusTaken(GetSpellInfo(), heal, HEAL, stack); + } target->CastCustomSpell(target, 33778, &heal, &stack, NULL, true, NULL, this, GetCasterGUID()); // restore mana @@ -6139,7 +6151,7 @@ void AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick(Unit* target, Unit* sLog->outDebug(LOG_FILTER_SPELLS_AURAS,"AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell %u has non-existent spell %u in EffectTriggered[%d] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex()); } -void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const +void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) { if (!caster || !target->isAlive()) return; @@ -6190,7 +6202,10 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const if (GetAuraType() == SPELL_AURA_PERIODIC_DAMAGE) { - damage = caster->SpellDamageBonus(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); + if (m_canBeRecalculated) + SetAmount(caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount())); + + damage = target->SpellDamageBonusTaken(GetSpellInfo(), GetAmount(), DOT, GetBase()->GetStackAmount()); // Calculate armor mitigation if (Unit::IsDamageReducedByArmor(GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), GetEffIndex())) @@ -6280,7 +6295,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const caster->DealDamage(target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true); } -void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) const +void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) { if (!caster || !target->isAlive()) return; @@ -6300,7 +6315,11 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL); uint32 damage = std::max(GetAmount(), 0); - damage = caster->SpellDamageBonus(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); + + if (m_canBeRecalculated) + SetAmount(caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount())); + + damage = target->SpellDamageBonusTaken(GetSpellInfo(), GetAmount(), DOT, GetBase()->GetStackAmount()); bool crit = IsPeriodicTickCrit(target, caster); if (crit) @@ -6338,12 +6357,12 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c if (caster->isAlive()) caster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo()); int32 new_damage = caster->DealDamage(target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), false); - if (caster->isAlive()) { float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster); - uint32 heal = uint32(caster->SpellHealingBonus(caster, GetSpellInfo(), uint32(new_damage * gainMultiplier), DOT, GetBase()->GetStackAmount())); + uint32 heal = uint32(caster->SpellHealingBonusDone(caster, GetSpellInfo(), uint32(new_damage * gainMultiplier), DOT, GetBase()->GetStackAmount())); + heal = uint32(caster->SpellHealingBonusTaken(GetSpellInfo(), heal, DOT, GetBase()->GetStackAmount())); int32 gain = caster->HealBySpell(caster, GetSpellInfo(), heal); caster->getHostileRefManager().threatAssist(caster, gain * 0.5f, GetSpellInfo()); @@ -6378,7 +6397,7 @@ void AuraEffect::HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster) caster->HealBySpell(target, GetSpellInfo(), damage); } -void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const +void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) { if (!caster || !target->isAlive()) return; @@ -6447,7 +6466,10 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const damage += addition; } - damage = caster->SpellHealingBonus(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); + if (m_canBeRecalculated) + SetAmount(caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount())); + + damage = target->SpellHealingBonusTaken(GetSpellInfo(), GetAmount(), DOT, GetBase()->GetStackAmount()); } bool crit = IsPeriodicTickCrit(target, caster); @@ -6737,7 +6759,8 @@ void AuraEffect::HandleProcTriggerDamageAuraProc(AuraApplication* aurApp, ProcEv Unit* target = aurApp->GetTarget(); Unit* triggerTarget = eventInfo.GetProcTarget(); SpellNonMeleeDamage damageInfo(target, triggerTarget, GetId(), GetSpellInfo()->SchoolMask); - uint32 damage = target->SpellDamageBonus(triggerTarget, GetSpellInfo(), GetAmount(), SPELL_DIRECT_DAMAGE); + uint32 damage = target->SpellDamageBonusDone(triggerTarget, GetSpellInfo(), GetAmount(), SPELL_DIRECT_DAMAGE); + damage = triggerTarget->SpellDamageBonusTaken(GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); target->CalculateSpellDamageTaken(&damageInfo, damage, GetSpellInfo()); target->DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); target->SendSpellNonMeleeDamageLog(&damageInfo); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index 64079918638..77742e17e51 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -83,7 +83,7 @@ class AuraEffect bool HasSpellClassMask() const { return m_spellInfo->Effects[m_effIndex].SpellClassMask; } void SendTickImmune(Unit* target, Unit* caster) const; - void PeriodicTick(AuraApplication * aurApp, Unit* caster) const; + void PeriodicTick(AuraApplication * aurApp, Unit* caster); void HandleProc(AuraApplication* aurApp, ProcEventInfo& eventInfo); @@ -285,10 +285,10 @@ class AuraEffect void HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const; void HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster) const; void HandlePeriodicTriggerSpellWithValueAuraTick(Unit* target, Unit* caster) const; - void HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const; - void HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) const; + void HandlePeriodicDamageAurasTick(Unit* target, Unit* caster); + void HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster); void HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster) const; - void HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const; + void HandlePeriodicHealAurasTick(Unit* target, Unit* caster); void HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) const; void HandleObsModPowerAuraTick(Unit* target, Unit* caster) const; void HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) const; diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 0bf91b1b6c5..b3169ce6fcc 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1212,8 +1212,11 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b // Improved Devouring Plague if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 3790, 1)) { - int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * caster->SpellDamageBonus(target, GetSpellInfo(), GetEffect(0)->GetAmount(), DOT) / 100; + uint32 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), GetEffect(0)->GetAmount(), DOT); + damage = target->SpellDamageBonusTaken(GetSpellInfo(), damage, DOT); + int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * int32(damage) / 100; int32 heal = int32(CalculatePctN(basepoints0, 15)); + caster->CastCustomSpell(target, 63675, &basepoints0, NULL, NULL, true, NULL, GetEffect(0)); caster->CastCustomSpell(caster, 75999, &heal, NULL, NULL, true, NULL, GetEffect(0)); } @@ -1224,7 +1227,10 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b // Empowered Renew if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 3021, 1)) { - int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * caster->SpellHealingBonus(target, GetSpellInfo(), GetEffect(0)->GetAmount(), HEAL) / 100; + uint32 damage = caster->SpellHealingBonusDone(target, GetSpellInfo(), GetEffect(0)->GetAmount(), HEAL); + damage = target->SpellHealingBonusTaken(GetSpellInfo(), damage, HEAL); + + int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * int32(damage) / 100; caster->CastCustomSpell(target, 63544, &basepoints0, NULL, NULL, true, NULL, GetEffect(0)); } } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index c72ccbacc3d..7a6030d634c 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -467,7 +467,8 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) if (aura) { uint32 pdamage = uint32(std::max(aura->GetAmount(), 0)); - pdamage = m_caster->SpellDamageBonus(unitTarget, aura->GetSpellInfo(), pdamage, DOT, aura->GetBase()->GetStackAmount()); + pdamage = m_caster->SpellDamageBonusDone(unitTarget, aura->GetSpellInfo(), pdamage, DOT, aura->GetBase()->GetStackAmount()); + pdamage = unitTarget->SpellDamageBonusTaken(aura->GetSpellInfo(), pdamage, DOT, aura->GetBase()->GetStackAmount()); uint32 pct_dir = m_caster->CalculateSpellDamage(unitTarget, m_spellInfo, (effIndex + 1)); uint8 baseTotalTicks = uint8(m_caster->CalcSpellDuration(aura->GetSpellInfo()) / aura->GetSpellInfo()->Effects[EFFECT_0].Amplitude); damage += int32(CalculatePctU(pdamage * baseTotalTicks, pct_dir)); @@ -505,7 +506,8 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) // Shadow Word: Death - deals damage equal to damage done to caster if (m_spellInfo->SpellFamilyFlags[1] & 0x2) { - int32 back_damage = m_caster->SpellDamageBonus(unitTarget, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE); + int32 back_damage = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE); + back_damage = unitTarget->SpellDamageBonusTaken(m_spellInfo, (uint32)back_damage, SPELL_DIRECT_DAMAGE); // Pain and Suffering reduces damage if (AuraEffect* aurEff = m_caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 2874, 0)) AddPctN(back_damage, -aurEff->GetAmount()); @@ -712,7 +714,10 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) } if (m_originalCaster && damage > 0 && apply_direct_bonus) - damage = m_originalCaster->SpellDamageBonus(unitTarget, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE); + { + damage = m_originalCaster->SpellDamageBonusDone(unitTarget, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE); + damage = unitTarget->SpellDamageBonusTaken(m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE); + } m_damage += damage; } @@ -1395,7 +1400,8 @@ void Spell::EffectPowerDrain(SpellEffIndex effIndex) return; // add spell damage bonus - damage = m_caster->SpellDamageBonus(unitTarget, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); + damage = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); + damage = unitTarget->SpellDamageBonusTaken(m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); // resilience reduce mana draining effect at spell crit damage reduction (added in 2.4) int32 power = damage; @@ -1558,7 +1564,10 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/) int32 tickheal = targetAura->GetAmount(); if (Unit* auraCaster = targetAura->GetCaster()) - tickheal = auraCaster->SpellHealingBonus(unitTarget, targetAura->GetSpellInfo(), tickheal, DOT); + { + tickheal = auraCaster->SpellHealingBonusDone(unitTarget, targetAura->GetSpellInfo(), tickheal, DOT); + tickheal = unitTarget->SpellHealingBonusTaken(targetAura->GetSpellInfo(), tickheal, DOT); + } //int32 tickheal = targetAura->GetSpellInfo()->EffectBasePoints[idx] + 1; //It is said that talent bonus should not be included @@ -1582,7 +1591,8 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/) // Glyph of Nourish else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags[1] & 0x2000000) { - addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, addhealth, HEAL); + addhealth = caster->SpellHealingBonusDone(unitTarget, m_spellInfo, addhealth, HEAL); + addhealth = unitTarget->SpellHealingBonusTaken(m_spellInfo, addhealth, HEAL); if (AuraEffect const* aurEff = m_caster->GetAuraEffect(62971, 0)) { @@ -1596,9 +1606,11 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/) } // Death Pact - return pct of max health to caster else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && m_spellInfo->SpellFamilyFlags[0] & 0x00080000) - addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, int32(caster->CountPctFromMaxHealth(damage)), HEAL); + addhealth = caster->SpellHealingBonusDone(unitTarget, m_spellInfo, int32(caster->CountPctFromMaxHealth(damage)), HEAL); else - addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, addhealth, HEAL); + addhealth = caster->SpellHealingBonusDone(unitTarget, m_spellInfo, addhealth, HEAL); + + addhealth = unitTarget->SpellHealingBonusTaken(m_spellInfo, addhealth, HEAL); // Remove Grievious bite if fully healed if (unitTarget->HasAura(48920) && (unitTarget->GetHealth() + addhealth >= unitTarget->GetMaxHealth())) @@ -1624,7 +1636,10 @@ void Spell::EffectHealPct(SpellEffIndex /*effIndex*/) if (m_spellInfo->Id == 59754 && unitTarget == m_caster) return; - m_healing += m_originalCaster->SpellHealingBonus(unitTarget, m_spellInfo, unitTarget->CountPctFromMaxHealth(damage), HEAL); + uint32 heal = m_originalCaster->SpellHealingBonusDone(unitTarget, m_spellInfo, unitTarget->CountPctFromMaxHealth(damage), HEAL); + heal = unitTarget->SpellHealingBonusTaken(m_spellInfo, heal, HEAL); + + m_healing += heal; } void Spell::EffectHealMechanical(SpellEffIndex /*effIndex*/) @@ -1639,7 +1654,9 @@ void Spell::EffectHealMechanical(SpellEffIndex /*effIndex*/) if (!m_originalCaster) return; - m_healing += m_originalCaster->SpellHealingBonus(unitTarget, m_spellInfo, uint32(damage), HEAL); + uint32 heal = m_originalCaster->SpellHealingBonusDone(unitTarget, m_spellInfo, uint32(damage), HEAL); + + m_healing += unitTarget->SpellHealingBonusTaken(m_spellInfo, heal, HEAL);; } void Spell::EffectHealthLeech(SpellEffIndex effIndex) @@ -1650,7 +1667,8 @@ void Spell::EffectHealthLeech(SpellEffIndex effIndex) if (!unitTarget || !unitTarget->isAlive() || damage < 0) return; - damage = m_caster->SpellDamageBonus(unitTarget, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); + damage = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); + damage = unitTarget->SpellDamageBonusTaken(m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "HealthLeech :%i", damage); @@ -1662,7 +1680,9 @@ void Spell::EffectHealthLeech(SpellEffIndex effIndex) if (m_caster->isAlive()) { - healthGain = m_caster->SpellHealingBonus(m_caster, m_spellInfo, healthGain, HEAL); + healthGain = m_caster->SpellHealingBonusDone(m_caster, m_spellInfo, healthGain, HEAL); + healthGain = m_caster->SpellHealingBonusTaken(m_spellInfo, healthGain, HEAL); + m_caster->HealBySpell(m_caster, m_spellInfo, uint32(healthGain)); } } @@ -3356,7 +3376,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) if (m_spellInfo->Id == 20467) { spell_bonus += int32(0.08f * m_caster->GetTotalAttackPowerValue(BASE_ATTACK)); - spell_bonus += int32(0.13f * m_caster->SpellBaseDamageBonus(m_spellInfo->GetSchoolMask())); + spell_bonus += int32(0.13f * m_caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask())); } break; } @@ -3525,8 +3545,9 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) uint32 eff_damage(std::max(weaponDamage, 0)); // Add melee damage bonuses (also check for negative) - m_caster->MeleeDamageBonus(unitTarget, &eff_damage, m_attackType, m_spellInfo); - m_damage += eff_damage; + uint32 damage = m_caster->MeleeDamageBonusDone(unitTarget, eff_damage, m_attackType, m_spellInfo); + + m_damage += unitTarget->MeleeDamageBonusTaken(damage, m_attackType, m_spellInfo); } void Spell::EffectThreat(SpellEffIndex /*effIndex*/) @@ -3569,7 +3590,10 @@ void Spell::EffectHealMaxHealth(SpellEffIndex /*effIndex*/) addhealth = unitTarget->GetMaxHealth() - unitTarget->GetHealth(); if (m_originalCaster) - m_healing += m_originalCaster->SpellHealingBonus(unitTarget, m_spellInfo, addhealth, HEAL); + { + uint32 heal = m_originalCaster->SpellHealingBonusDone(unitTarget, m_spellInfo, addhealth, HEAL); + m_healing += unitTarget->SpellHealingBonusTaken(m_spellInfo, heal, HEAL); + } } void Spell::EffectInterruptCast(SpellEffIndex effIndex) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 07ab71207f1..7732908ac47 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1972,6 +1972,35 @@ uint32 SpellInfo::CalcCastTime(Unit* caster, Spell* spell) const return (castTime > 0) ? uint32(castTime) : 0; } +uint32 SpellInfo::GetMaxTicks() const +{ + int32 DotDuration = GetDuration(); + if (DotDuration == 0) + return 1; + + // 200% limit + if (DotDuration > 30000) + DotDuration = 30000; + + uint8 x = 0; + for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j) + { + if (Effects[j].Effect == SPELL_EFFECT_APPLY_AURA && ( + Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE || + Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_HEAL || + Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_LEECH)) + { + x = j; + break; + } + } + + if (Effects[x].Amplitude != 0) + return DotDuration / Effects[x].Amplitude; + + return 6; +} + uint32 SpellInfo::GetRecoveryTime() const { return RecoveryTime > CategoryRecoveryTime ? RecoveryTime : CategoryRecoveryTime; diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index b82f7dbd61d..54430cd7116 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -440,6 +440,8 @@ public: int32 GetDuration() const; int32 GetMaxDuration() const; + uint32 GetMaxTicks() const; + uint32 CalcCastTime(Unit* caster = NULL, Spell* spell = NULL) const; uint32 GetRecoveryTime() const; diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 5d8e8f84e6a..891c7b79270 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -137,8 +137,9 @@ class spell_hun_chimera_shot : public SpellScriptLoader { int32 TickCount = aurEff->GetTotalTicks(); spellId = HUNTER_SPELL_CHIMERA_SHOT_SERPENT; - basePoint = caster->SpellDamageBonus(unitTarget, aura->GetSpellInfo(), aurEff->GetAmount(), DOT, aura->GetStackAmount()); + basePoint = caster->SpellDamageBonusDone(unitTarget, aura->GetSpellInfo(), aurEff->GetAmount(), DOT, aura->GetStackAmount()); ApplyPctN(basePoint, TickCount * 40); + basePoint = unitTarget->SpellDamageBonusTaken(aura->GetSpellInfo(), basePoint, DOT, aura->GetStackAmount()); } // Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting. else if (familyFlag[1] & 0x00000080) diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 84e3bd8d604..00e89391a7e 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -449,7 +449,7 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader if (Unit* owner = caster->GetOwner()) { if (triggeringSpell) - damage = int32(owner->SpellHealingBonus(target, triggeringSpell, damage, HEAL)); + damage = int32(owner->SpellHealingBonusDone(target, triggeringSpell, damage, HEAL)); // Restorative Totems if (AuraEffect* dummy = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, ICON_ID_RESTORATIVE_TOTEMS, 1)) @@ -458,6 +458,8 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader // Glyph of Healing Stream Totem if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_GLYPH_OF_HEALING_STREAM_TOTEM, EFFECT_0)) AddPctN(damage, aurEff->GetAmount()); + + damage = int32(target->SpellHealingBonusTaken(triggeringSpell, damage, HEAL)); } caster->CastCustomSpell(target, SPELL_HEALING_STREAM_TOTEM_HEAL, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID()); } diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 3e4c043ae47..d2c35b514e1 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -181,7 +181,7 @@ class spell_warr_deep_wounds : public SpellScriptLoader if (Unit* caster = GetCaster()) { // apply percent damage mods - damage = caster->SpellDamageBonus(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); + damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); ApplyPctN(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id)); @@ -193,6 +193,9 @@ class spell_warr_deep_wounds : public SpellScriptLoader damage += aurEff->GetAmount() * (ticks - aurEff->GetTickNumber()); damage = damage / ticks; + + damage = target->SpellDamageBonusTaken(GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); + caster->CastCustomSpell(target, SPELL_DEEP_WOUNDS_RANK_PERIODIC, &damage, NULL, NULL, true); } } From 7f51c399c61ec538997b52f0a9508e6b78137b47 Mon Sep 17 00:00:00 2001 From: kaelima Date: Mon, 30 Apr 2012 02:07:59 +0200 Subject: [PATCH 0659/1149] Core/DBLayer: CHAR_DEL_CHAR_AURA_FROZEN query should be asynchronous Closes issue #6273 Also corrected one opcode name in Opcodes.cpp (changes nothing) --- src/server/game/Server/Protocol/Opcodes.cpp | 4 ++-- .../shared/Database/Implementation/CharacterDatabase.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index c6ccfaa8004..aa6013fae3d 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -76,7 +76,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x02F*/ { "SMSG_DEBUG_AISTATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x030*/ { "CMSG_DISABLE_PVP_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x031*/ { "CMSG_ADVANCE_SPAWN_TIME", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x032*/ { "SMSG_DESTRUCTIBLE_BUILDING_DAMAGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, + /*0x032*/ { "SMSG_DESTRUCTIBLE_BUILDING_DAMAGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x033*/ { "CMSG_AUTH_SRP6_BEGIN", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x034*/ { "CMSG_AUTH_SRP6_PROOF", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x035*/ { "CMSG_AUTH_SRP6_RECODE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, @@ -558,7 +558,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x211*/ { "CMSG_GMTICKET_GETTICKET", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketGetTicketOpcode }, /*0x212*/ { "SMSG_GMTICKET_GETTICKET", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x213*/ { "CMSG_UNLEARN_TALENTS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x214*/ { "SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, + /*0x214*/ { "SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x215*/ { "SMSG_GAMEOBJECT_DESPAWN_ANIM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x216*/ { "MSG_CORPSE_QUERY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode }, /*0x217*/ { "CMSG_GMTICKET_DELETETICKET", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode }, diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 772a52b62cf..6bdf3ba9230 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -435,8 +435,8 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_PET_SPELL, "SELECT spell, active FROM pet_spell WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_PET_SPELL_COOLDOWN, "SELECT spell, time FROM pet_spell_cooldown WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_PET_DECLINED_NAME, "SELECT genitive, dative, accusative, instrumental, prepositional FROM character_pet_declinedname WHERE owner = ? AND id = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_GUID_BY_NAME, "SELECT characters.guid FROM characters WHERE characters.name = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_DEL_CHAR_AURA_FROZEN, "DELETE FROM character_aura WHERE character_aura.spell = 9454 AND character_aura.guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_GUID_BY_NAME, "SELECT guid FROM characters WHERE name = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_DEL_CHAR_AURA_FROZEN, "DELETE FROM character_aura WHERE spell = 9454 AND guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM, "SELECT COUNT(itemEntry) FROM character_inventory ci INNER JOIN item_instance ii ON ii.guid = ci.item WHERE itemEntry = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_MAIL_COUNT_ITEM, "SELECT COUNT(itemEntry) FROM mail_items mi INNER JOIN item_instance ii ON ii.guid = mi.item_guid WHERE itemEntry = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_AUCTIONHOUSE_COUNT_ITEM,"SELECT COUNT(itemEntry) FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE itemEntry = ?", CONNECTION_SYNCH); From a12faa5e9d4c27c6455fd16436d10321c6dd7693 Mon Sep 17 00:00:00 2001 From: Amit Date: Mon, 30 Apr 2012 13:53:25 +0300 Subject: [PATCH 0660/1149] Fix log typo with spell_group at SpellMgr.cpp --- src/server/game/Spells/SpellMgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 64e1527b8d3..06e4978eb58 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1602,7 +1602,7 @@ void SpellMgr::LoadSpellGroups() uint32 group_id = fields[0].GetUInt32(); if (group_id <= SPELL_GROUP_DB_RANGE_MIN && group_id >= SPELL_GROUP_CORE_RANGE_MAX) { - sLog->outErrorDb("SpellGroup id %u listed in `spell_groups` is in core range, but is not defined in core!", group_id); + sLog->outErrorDb("SpellGroup id %u listed in `spell_group` is in core range, but is not defined in core!", group_id); continue; } int32 spell_id = fields[1].GetInt32(); @@ -1618,7 +1618,7 @@ void SpellMgr::LoadSpellGroups() { if (groups.find(abs(itr->second)) == groups.end()) { - sLog->outErrorDb("SpellGroup id %u listed in `spell_groups` does not exist", abs(itr->second)); + sLog->outErrorDb("SpellGroup id %u listed in `spell_group` does not exist", abs(itr->second)); mSpellGroupSpell.erase(itr++); } else From 7a8f6b84c99929dc158fcecbfa55546bcc0020af Mon Sep 17 00:00:00 2001 From: 4m1g0 Date: Tue, 1 May 2012 02:11:44 +0200 Subject: [PATCH 0661/1149] Scripts/the_barrens: Fix quest "The Affray" and some cleanup. Closes: #4764 Also Closes: #6354 --- src/server/scripts/Kalimdor/the_barrens.cpp | 38 +++++---------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/src/server/scripts/Kalimdor/the_barrens.cpp b/src/server/scripts/Kalimdor/the_barrens.cpp index c56991e2553..933ad4de3eb 100644 --- a/src/server/scripts/Kalimdor/the_barrens.cpp +++ b/src/server/scripts/Kalimdor/the_barrens.cpp @@ -408,42 +408,26 @@ public: return; if (!pWarrior->isAlive() && pWarrior->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE) { - EventInProgress = false; DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, me); pWarrior->FailQuest(1719); - for (uint8 i = 0; i < 6; ++i) + for (uint8 i = 0; i < 6; ++i) // unsummon challengers { if (AffrayChallenger[i]) { Creature* creature = Unit::GetCreature((*me), AffrayChallenger[i]); - if (creature) { - if (creature->isAlive()) - { - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); - creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - creature->setDeathState(JUST_DIED); - } - } + if (creature && creature->isAlive()) + creature->DisappearAndDie(); } - AffrayChallenger[i] = 0; - Challenger_down[i] = false; } - if (BigWill) + if (BigWill) // unsummon bigWill { Creature* creature = Unit::GetCreature((*me), BigWill); - if (creature) - { - if (creature->isAlive()) - { - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); - creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - creature->setDeathState(JUST_DIED); - } - } + if (creature && creature->isAlive()) + creature->DisappearAndDie(); } - BigWill = 0; + Reset(); } if (!EventGrate && EventInProgress) @@ -453,7 +437,7 @@ public: if (x >= -1684 && x <= -1674 && y >= -4334 && y <= -4324) { pWarrior->AreaExploredOrEventHappens(1719); - DoScriptText(SAY_TWIGGY_FLATHEAD_BEGIN, me); + DoScriptText(SAY_TWIGGY_FLATHEAD_BEGIN, me, pWarrior); for (uint8 i = 0; i < 6; ++i) { @@ -525,11 +509,7 @@ public: if (!creature || !creature->isAlive()) { DoScriptText(SAY_TWIGGY_FLATHEAD_OVER, me); - EventInProgress = false; - EventBigWill = false; - EventGrate = false; - PlayerGUID = 0; - Wave = 0; + Reset(); } } } else Wave_Timer -= diff; From 73da25007e16239cefe543f86f00aa99bfda3d02 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Tue, 1 May 2012 17:10:20 -0230 Subject: [PATCH 0662/1149] DB/Creature: Add missing Challe & Orphan Matron Aria Spawns --- sql/updates/world/2012_05_1_00_world_creature.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sql/updates/world/2012_05_1_00_world_creature.sql diff --git a/sql/updates/world/2012_05_1_00_world_creature.sql b/sql/updates/world/2012_05_1_00_world_creature.sql new file mode 100644 index 00000000000..367800ee613 --- /dev/null +++ b/sql/updates/world/2012_05_1_00_world_creature.sql @@ -0,0 +1,9 @@ +-- Add missing Challe & Orphan Matron Aria Spawns +SET @GUID := 41876; +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+1; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@GUID,23101,530,1,1,-480.4989,7499.029,181.2889,3.560472,120,0,0,1,0,0), +(@GUID+1,34365,571,1,1,5716.604,642.8611,646.2927,5.88176,120,0,0,1,0,0); +-- Add to game event creature +DELETE FROM `game_event_creature` WHERE `guid`=@GUID+1; +INSERT INTO `game_event_creature` (`eventEntry`,`guid`) VALUES (10,@GUID+1); From d8e4e164c6b54444a233db9613f4564085410c7d Mon Sep 17 00:00:00 2001 From: Malcrom Date: Tue, 1 May 2012 17:14:24 -0230 Subject: [PATCH 0663/1149] DB/Creature: Fix error in previous commit. --- sql/updates/world/2012_05_1_00_world_creature.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/updates/world/2012_05_1_00_world_creature.sql b/sql/updates/world/2012_05_1_00_world_creature.sql index 367800ee613..c0509d0d132 100644 --- a/sql/updates/world/2012_05_1_00_world_creature.sql +++ b/sql/updates/world/2012_05_1_00_world_creature.sql @@ -2,8 +2,8 @@ SET @GUID := 41876; DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+1; INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES -(@GUID,23101,530,1,1,-480.4989,7499.029,181.2889,3.560472,120,0,0,1,0,0), -(@GUID+1,34365,571,1,1,5716.604,642.8611,646.2927,5.88176,120,0,0,1,0,0); +(@GUID,23101,530,1,1,0,0,-480.4989,7499.029,181.2889,3.560472,120,0,0,1,0,0), +(@GUID+1,34365,571,1,1,0,0,5716.604,642.8611,646.2927,5.88176,120,0,0,1,0,0); -- Add to game event creature DELETE FROM `game_event_creature` WHERE `guid`=@GUID+1; INSERT INTO `game_event_creature` (`eventEntry`,`guid`) VALUES (10,@GUID+1); From 28da592ad13e05eb6b25335fa83bfd4da80fdc94 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Wed, 2 May 2012 23:08:10 +0200 Subject: [PATCH 0664/1149] DB/Loot: Add loot for 25 man to Stinky & Precious, Add Skinning loot; Fix naming in previous SQL submission Closes #6370 --- ...orld_creature.sql => 2012_05_01_00_world_creature.sql} | 0 .../world/2012_05_02_00_world_creature_loot_template.sql | 8 ++++++++ 2 files changed, 8 insertions(+) rename sql/updates/world/{2012_05_1_00_world_creature.sql => 2012_05_01_00_world_creature.sql} (100%) create mode 100644 sql/updates/world/2012_05_02_00_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_05_1_00_world_creature.sql b/sql/updates/world/2012_05_01_00_world_creature.sql similarity index 100% rename from sql/updates/world/2012_05_1_00_world_creature.sql rename to sql/updates/world/2012_05_01_00_world_creature.sql diff --git a/sql/updates/world/2012_05_02_00_world_creature_loot_template.sql b/sql/updates/world/2012_05_02_00_world_creature_loot_template.sql new file mode 100644 index 00000000000..f0721e63635 --- /dev/null +++ b/sql/updates/world/2012_05_02_00_world_creature_loot_template.sql @@ -0,0 +1,8 @@ +DELETE FROM `creature_loot_template` WHERE `entry` IN(38064,38103); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Precious 25 man +(38103,1,100,1,0,-35069,2), -- Two From ICC Trashgenerated on Precious +(38103,52019,30,1,0,1,1), -- Precious Ribbon on Precious +(38064,1,100,1,0,-35069,2); -- Two From ICC Trashgenerated on Stinky +-- add skinning loot for Stinky & Precious +UPDATE `creature_template` SET `skinloot`=70214 WHERE `entry` IN (37025,38064,37217,38103); From 224d85fe11d519c47f91f65670c60aad9669032b Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Thu, 3 May 2012 13:39:14 +0200 Subject: [PATCH 0665/1149] DB/Spawns: Readd the rare spawns that got overwritten --- .../world/2012_05_03_00_world_creature.sql | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 sql/updates/world/2012_05_03_00_world_creature.sql diff --git a/sql/updates/world/2012_05_03_00_world_creature.sql b/sql/updates/world/2012_05_03_00_world_creature.sql new file mode 100644 index 00000000000..d906dba78bc --- /dev/null +++ b/sql/updates/world/2012_05_03_00_world_creature.sql @@ -0,0 +1,29 @@ +SET @GUID1 := 42158; +SET @GUID2 := 42159; +-- add creature +DELETE FROM creature WHERE guid IN (@GUID1,@GUID2); +INSERT INTO `creature` +(`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`) +VALUES +(@GUID1 ,38453,571,1,1,3561.821,-2736.367,136.0317,0), -- Arcturis in Grizzly Hills +(@GUID2,35189,571,1,1,7101.845,-1443.734,924.2609,0.178631); -- Skoll in The Storm Peaks +-- Update template +UPDATE `creature_template` SET `faction_A` = 190, `faction_H`=190 WHERE `entry` IN (38453,35189); +SET @NPC= @GUID1*10; +-- Add pathing for Arcturis +DELETE FROM `creature_addon` WHERE `guid` = @GUID1; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(@GUID1,@NPC,0,0,0,0,''); -- Add path for Acturis +-- Add waypoint data for the path: +DELETE FROM `waypoint_data` WHERE `id`=@NPC; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`) VALUES +(@NPC,1,3563.499,-2737.698,137.1898), +(@NPC,2,3565.249,-2738.698,138.4398), +(@NPC,3,3566.749,-2739.948,139.9398), +(@NPC,4,3568.249,-2740.698,140.6898), +(@NPC,5,3567.839,-2741.380,141.9256), +(@NPC,6,3569.999,-2741.948,142.1898), +(@NPC,7,3570.749,-2742.448,143.1898), +(@NPC,8,3572.676,-2743.528,144.8479); +-- Spawntimefix +UPDATE `creature` SET `spawntimesecs`=39600 WHERE `guid` IN (@GUID1,@GUID2); -- Set the spawntime to 11 hours for Arcturis & Skoll From 9614d495986317b47b81d3d1b7a87964a3312163 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 3 May 2012 08:53:24 -0400 Subject: [PATCH 0666/1149] DB/Misc: bunch of updates for culling of stratholme. fixes the end spell for credit. adds spawns for the second area. corrects a ton of texts. fixes some db issues --- .../world/2012_05_03_01_world_cos_misc.sql | 153 ++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 sql/updates/world/2012_05_03_01_world_cos_misc.sql diff --git a/sql/updates/world/2012_05_03_01_world_cos_misc.sql b/sql/updates/world/2012_05_03_01_world_cos_misc.sql new file mode 100644 index 00000000000..6c2ea6d3a95 --- /dev/null +++ b/sql/updates/world/2012_05_03_01_world_cos_misc.sql @@ -0,0 +1,153 @@ +UPDATE `script_texts` SET `emote` = 432 WHERE `entry` IN (-1595111); +UPDATE `script_texts` SET `emote` = 396 WHERE `entry` IN (-1595070,-1595075,-1595078,-1595079,-1595088,-1595103,-1595106,-1595107,-1595108,-1595109,-1595113,-1595114,-1595115,-1595116); +UPDATE `script_texts` SET `emote` = 397 WHERE `entry` IN (-1595071,-1595084,-1595093); +UPDATE `script_texts` SET `emote` = 274 WHERE `entry` IN (-1595091); +UPDATE `script_texts` SET `emote` = 5 WHERE `entry` IN (-1595073,-1595118); +UPDATE `script_texts` SET `emote` = 6 WHERE `entry` IN (-1595076); +UPDATE `script_texts` SET `emote` = 1 WHERE `entry` IN (-1595083,-1595100,-1595104,-1595120); +UPDATE `script_texts` SET `emote` = 0 WHERE `entry` IN (-1595009,-1595010,-1595081,-1595082,-1595085,-1595119); + +UPDATE `script_texts` SET `type` = 1 WHERE `entry` IN (-1595009,-1595010,-1595087,-1595094,-1595095,-1595093); +UPDATE `script_texts` SET `type` = 0 WHERE `entry` IN (-1595077,-1595078,-1595119); + +UPDATE `script_texts` SET `content_default` = "Champions, meet me at the Town Hall at once. We must take the fight to Mal'Ganis." WHERE `entry` = -1595095; +UPDATE `script_texts` SET `content_default` = "Follow me, I know the way through." WHERE `entry` = -1595096; +UPDATE `script_texts` SET `content_default` = "Take position here, and I will lead a small force inside Stratholme to begin the culling. We must contain and purge the infected for the sake of all of Lordaeron!" WHERE entry = -1595087; +UPDATE `script_texts` SET `content_default` = "Ah, you've finally arrived Prince Arthas. You're here just in the nick of time." WHERE `entry` = -1595097; +UPDATE `script_texts` SET `content_default` = "Yes, I'm glad I could get to you before the plague." WHERE `entry` = -1595098; +UPDATE `script_texts` SET `content_default` = "As if I could forget. Listen, Uther, there's something about the plague you should know..." WHERE `entry` = -1595072; +UPDATE `script_texts` SET `content_default` = "There's no need for you to understand, Arthas. All you need to do is die." WHERE `entry` = -1595100; +UPDATE `script_texts` SET `content_default` = "More vile sorcery! Be ready for anything!" WHERE `entry` = -1595102; +UPDATE `script_texts` SET `content_default` = "Watch your backs: they have us surrounded in this hall." WHERE `entry` = -1595104; +UPDATE `script_texts` SET `content_default` = "Mal'Ganis is not making this easy." WHERE `entry` = -1595106; +UPDATE `script_texts` SET `content_default` = "What else can he put in my way?" WHERE `entry` = -1595108; +UPDATE `script_texts` SET `content_default` = "I do what I must for Lordaeron, and neither your words nor your actions will stop me." WHERE `entry` = -1595109; +UPDATE `script_texts` SET `content_default` = "The quickest path to Mal'Ganis lies behind that bookshelf ahead." WHERE `entry` = -1595110; +UPDATE `script_texts` SET `content_default` = "I'm relieved this secret passage still works." WHERE `entry` = -1595112; +UPDATE `script_texts` SET `content_default` = "Let's move through here as quickly as possible. If the undead don't kill us, the fires might." WHERE `entry` = -1595113; +UPDATE `script_texts` SET `content_default` = "Rest a moment and clear your lungs, but we must move again soon." WHERE `entry` = -1595114; +UPDATE `script_texts` SET `content_default` = "That's enough; we must move again. Mal'Ganis awaits." WHERE `entry` = -1595115; +UPDATE `script_texts` SET `content_default` = "At last some good luck. Market Row has not caught fire yet. Mal'Ganis is supposed to be in Crusaders' Square, which is just ahead. Tell me when you're ready to move forward." WHERE `entry` = -1595116; +UPDATE `script_texts` SET `content_default` = "Justice will be done." WHERE `entry` = -1595117; +UPDATE `script_texts` SET `content_default` = "We're going to finish this right now, Mal'Ganis. Just you... and me." WHERE `entry` = -1595118; + +UPDATE `script_texts` SET `comment` = concat(`comment`,". NEEDS VERIFICATION") WHERE `entry` IN (-1595101,-1595105); + +SET @GUID := 88474; +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, +`MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) +VALUES +(@GUID+00,27737,595,3,1,25543,0,2319.89,1285.78,131.407,1.72169,60,10,0,630,0,1,0,0,0), +(@GUID+01,27737,595,3,1,10979,0,2308.12,1304.21,127.601,4.39662,60,10,0,630,0,1,0,0,0), +(@GUID+02,27737,595,3,1,25542,0,2335.47,1262.04,132.921,1.42079,60,10,0,630,0,1,0,0,0), +(@GUID+03,27737,595,3,1,25543,0,2297.73,1338.75,124.622,2.5574,60,10,0,630,0,1,0,0,0), +(@GUID+04,27737,595,3,1,10979,0,2322.65,1265.39,133.033,5.6524,60,10,0,630,0,1,0,0,0), +(@GUID+05,27737,595,3,1,10973,0,2277.83,1331.92,124.19,3.48045,60,10,0,630,0,1,0,0,0), +(@GUID+06,27737,595,3,1,25543,0,2294.18,1316.93,125.672,6.05649,60,10,0,630,0,1,0,0,0), +(@GUID+07,27737,595,3,1,10973,0,2310.56,1369,128.372,5.03364,60,10,0,630,0,1,0,0,0), +(@GUID+08,27737,595,3,1,10979,0,2306.15,1322.85,125.708,4.99133,60,10,0,630,0,1,0,0,0), +(@GUID+09,27737,595,3,1,10973,0,2320.14,1297.48,129.694,1.35248,60,10,0,630,0,1,0,0,0), +(@GUID+10,27737,595,3,1,25542,0,2291.57,1327.27,124.545,5.32358,60,10,0,630,0,1,0,0,0), +(@GUID+11,27737,595,3,1,25542,0,2308.04,1352.65,126.907,5.83741,60,10,0,630,0,1,0,0,0), +(@GUID+12,27737,595,3,1,10979,0,2329.44,1281.11,132.636,2.25207,60,10,0,630,0,1,0,0,0), +(@GUID+13,27737,595,3,1,0,0,2407.32,1423.8,131.522,6.24743,60,10,0,706,0,1,0,0,0), +(@GUID+14,27737,595,3,1,0,0,2417.26,1428.41,131.652,6.20423,60,10,0,730,0,1,0,0,0), +(@GUID+15,27737,595,3,1,0,0,2420.48,1419.99,130.716,0.0977616,60,10,0,706,0,1,0,0,0), +(@GUID+16,27737,595,3,1,0,0,2426.63,1413.41,130.464,0.404064,60,10,0,730,0,1,0,0,0), +(@GUID+17,27737,595,3,1,0,0,2430.46,1417.6,130.557,0.125247,60,10,0,730,0,1,0,0,0), +(@GUID+18,27737,595,3,1,0,0,2433.94,1427.03,131.18,0.0584885,60,10,0,706,0,1,0,0,0), +(@GUID+19,27737,595,3,1,0,0,2446.5,1428.37,131.013,6.10606,60,10,0,756,0,1,0,0,0), +(@GUID+20,27737,595,3,1,0,0,2449.49,1423.35,130.588,5.77619,60,10,0,706,0,1,0,0,0), +(@GUID+21,27737,595,3,1,0,0,2441.92,1424.41,130.606,6.07857,60,10,0,706,0,1,0,0,0), +(@GUID+22,27737,595,3,1,0,0,2450.6,1438.61,132.213,4.74889,60,10,0,730,0,1,0,0,0), +(@GUID+23,27737,595,3,1,0,0,2460.17,1436.46,131.501,4.73711,60,10,0,756,0,1,0,0,0), +(@GUID+24,27737,595,3,1,0,0,2444.68,1421.68,130.324,6.01338,60,10,0,756,0,1,0,0,0), +(@GUID+25,27737,595,3,1,0,0,2456.87,1419.07,130.488,5.39763,60,10,0,706,0,1,0,0,0), +(@GUID+26,27737,595,3,1,0,0,2464.27,1422.15,130.976,5.22092,60,10,0,756,0,1,0,0,0), +(@GUID+27,27737,595,3,1,0,0,2468.21,1403.06,130.39,5.6364,60,10,0,756,0,1,0,0,0), +(@GUID+28,27737,595,3,1,0,0,2460.88,1406.8,130.508,5.96234,60,10,0,756,0,1,0,0,0), +(@GUID+29,27737,595,3,1,0,0,2485.77,1398.35,130.795,4.71591,60,10,0,756,0,1,0,0,0), +(@GUID+30,27737,595,3,1,0,0,2485.79,1380.46,130.15,5.02928,60,10,0,730,0,1,0,0,0), +(@GUID+31,27737,595,3,1,0,0,2475.77,1396.31,130.124,4.84079,60,10,0,730,0,1,0,0,0), +(@GUID+32,27737,595,3,1,0,0,2476.92,1387.21,129.401,5.05128,60,10,0,730,0,1,0,0,0), +(@GUID+33,27737,595,3,1,0,0,2483.24,1389.37,130.123,4.74104,60,10,0,730,0,1,0,0,0), +(@GUID+34,27737,595,3,1,0,0,2480.2,1370.15,129.533,5.79583,60,10,0,706,0,1,0,0,0), +(@GUID+35,27737,595,3,1,0,0,2481.54,1375.11,129.642,5.4644,60,10,0,730,0,1,0,0,0), +(@GUID+36,27737,595,3,1,0,0,2489.44,1359.42,131.233,5.378,60,10,0,730,0,1,0,0,0), +(@GUID+37,27737,595,3,1,0,0,2486.59,1356.19,131.876,5.7275,60,10,0,756,0,1,0,0,0), +(@GUID+38,27737,595,3,1,0,0,2495.53,1348.61,133.072,5.52722,60,10,0,730,0,1,0,0,0), +(@GUID+39,27737,595,3,1,0,0,2504.48,1349.65,132.856,5.11881,60,10,0,730,0,1,0,0,0), +(@GUID+40,27737,595,3,1,0,0,2493.11,1380.29,130.24,4.93189,60,10,0,706,0,1,0,0,0), +(@GUID+41,27737,595,3,1,0,0,2487.18,1392.64,130.512,4.93818,60,10,0,706,0,1,0,0,0), +(@GUID+42,27737,595,3,1,0,0,2506.49,1336.89,132.794,5.19343,60,10,0,756,0,1,0,0,0), +(@GUID+43,27737,595,3,1,0,0,2518.2,1306.39,130.623,4.81723,60,10,0,756,0,1,0,0,0), +(@GUID+44,27737,595,3,1,0,0,2513.4,1299.67,130.868,4.4206,60,10,0,756,0,1,0,0,0), +(@GUID+45,27737,595,3,1,0,0,2511.45,1291.47,130.808,5.00729,60,10,0,756,0,1,0,0,0), +(@GUID+46,27737,595,3,1,0,0,2518.56,1292.32,130.528,5.16438,60,10,0,756,0,1,0,0,0), +(@GUID+47,27737,595,3,1,0,0,2515.49,1279.85,129.214,5.28847,60,10,0,730,0,1,0,0,0), +(@GUID+48,27737,595,3,1,0,0,2514.37,1285.92,129.934,5.70473,60,10,0,706,0,1,0,0,0), +(@GUID+49,27737,595,3,1,0,0,2522.65,1274.29,128.576,5.44634,60,10,0,706,0,1,0,0,0), +(@GUID+50,27737,595,3,1,0,0,2535.38,1275.77,127.42,5.49817,60,10,0,756,0,1,0,0,0), +(@GUID+51,27737,595,3,1,0,0,2537.59,1273.1,127.05,5.02693,60,10,0,730,0,1,0,0,0), +(@GUID+52,27737,595,3,1,0,0,2547.49,1261.7,126.44,4.78425,60,10,0,730,0,1,0,0,0), +(@GUID+53,27737,595,3,1,0,0,2534.36,1261.06,127.125,4.3994,60,10,0,756,0,1,0,0,0), +(@GUID+54,27737,595,3,1,0,0,2532.69,1251.44,127.452,5.4479,60,10,0,730,0,1,0,0,0), +(@GUID+55,27737,595,3,1,0,0,2551.84,1252.35,125.455,5.04342,60,10,0,706,0,1,0,0,0), +(@GUID+56,27737,595,3,1,0,0,2536.1,1244,126.928,5.16515,60,10,0,756,0,1,0,0,0), +(@GUID+57,27737,595,3,1,0,0,2543.63,1247.23,126.131,5.19735,60,10,0,706,0,1,0,0,0), +(@GUID+58,27737,595,3,1,0,0,2554.21,1238.95,125.475,4.64836,60,10,0,730,0,1,0,0,0), +(@GUID+59,27737,595,3,1,0,0,2548.89,1227.37,126.375,5.31517,60,10,0,756,0,1,0,0,0), +(@GUID+60,27737,595,3,1,0,0,2560.46,1225.4,125.496,4.85335,60,10,0,706,0,1,0,0,0), +(@GUID+61,27737,595,3,1,0,0,2555.11,1218.55,125.944,5.11646,60,10,0,730,0,1,0,0,0), +(@GUID+62,27737,595,3,1,0,0,2561.91,1211.56,125.38,5.5877,60,10,0,730,0,1,0,0,0), +(@GUID+63,27737,595,3,1,0,0,2568.67,1202.96,125.509,4.96095,60,10,0,756,0,1,0,0,0), +(@GUID+64,27737,595,3,1,0,0,2571.93,1193.48,125.619,5.07641,60,10,0,756,0,1,0,0,0), +(@GUID+65,27737,595,3,1,0,0,2577.77,1180.88,125.562,4.64522,60,10,0,756,0,1,0,0,0), +(@GUID+66,27737,595,3,1,0,0,2574.2,1166.63,126.089,4.44966,60,10,0,706,0,1,0,0,0), +(@GUID+67,27737,595,3,1,0,0,2564.78,1166.82,127.092,4.2266,60,10,0,756,0,1,0,0,0), +(@GUID+68,27737,595,3,1,0,0,2577.56,1158.41,126.385,4.07738,60,10,0,756,0,1,0,0,0), +(@GUID+69,27737,595,3,1,0,0,2567.93,1176.56,126.2,4.7489,60,10,0,706,0,1,0,0,0), +(@GUID+70,27737,595,3,1,0,0,2559.28,1189.46,126.642,4.73319,60,10,0,756,0,1,0,0,0), +(@GUID+71,27737,595,3,1,0,0,2554.14,1213.37,126.599,5.13845,60,10,0,706,0,1,0,0,0), +(@GUID+72,27737,595,3,1,0,0,2560.58,1218.48,125.281,4.97351,60,10,0,730,0,1,0,0,0), +(@GUID+73,27737,595,3,1,0,0,2570.2,1170.58,126.311,4.64365,60,10,0,756,0,1,0,0,0), +(@GUID+74,27729,595,3,1,0,0,2496.57,1354.66,132.217,5.13691,120,5,0,63000,0,1,0,0,0), +(@GUID+75,27729,595,3,1,0,0,2494.22,1365.17,130.812,5.15654,120,5,0,63000,0,1,0,0,0), +(@GUID+76,27729,595,3,1,0,0,2440.41,1434.46,131.456,5.69372,120,5,0,63000,0,1,0,0,0), +(@GUID+77,27729,595,3,1,0,0,2433.18,1421.13,130.644,0.046706,120,5,0,63000,0,1,0,0,0), +(@GUID+78,27734,595,3,1,0,0,2546.07,1239.17,125.945,5.07801,120,5,0,63000,0,1,0,0,0), +(@GUID+79,27734,595,3,1,0,0,2458.58,1426.22,131.056,5.42984,120,5,0,63000,0,1,0,0,0), +(@GUID+80,27736,595,3,1,0,0,2488.11,1364.91,130.402,5.35524,120,5,0,130330,0,1,0,0,0), +(@GUID+81,28199,595,3,1,0,0,2527.63,1267.59,128.168,5.12906,120,5,0,63000,0,1,0,0,0), +(@GUID+82,28199,595,3,1,0,0,2528.06,1284.34,128.877,5.14869,120,5,0,63000,0,1,0,0,0), +(@GUID+83,28199,595,3,1,0,0,2466.27,1414.57,130.977,5.18637,120,5,0,63000,0,1,0,0,0), +(@GUID+84,28200,595,3,1,0,0,2570.51,1181.4,125.809,4.61855,120,5,0,50400,44070,1,0,0,0), +(@GUID+85,28200,595,3,1,0,0,2560.45,1202.05,126.031,4.85417,120,5,0,50400,44070,1,0,0,0), +(@GUID+86,28200,595,3,1,0,0,2487.85,1373.29,130.236,5.078,120,5,0,50400,44070,1,0,0,0), +(@GUID+87,28200,595,3,1,0,0,2416.7,1416.52,130.379,0.191224,120,5,0,50400,44070,1,0,0,0), +(@GUID+88,28200,595,3,1,0,0,2424.42,1422.68,130.868,0.25327,120,5,0,50400,44070,1,0,0,0), +(@GUID+89,28201,595,3,1,0,0,2540.67,1254.82,126.274,4.97198,120,5,0,130330,0,1,0,0,0), +(@GUID+90,28201,595,3,1,0,0,2410.03,1417.19,130.577,0.191229,120,5,0,130330,0,1,0,0,0), +(@GUID+91,28249,595,3,1,0,0,2562.66,1177.9,126.716,4.77171,120,5,0,63000,0,1,0,0,0), +(@GUID+92,28249,595,3,1,0,0,2566.72,1190.41,125.837,4.7992,120,5,0,63000,0,1,0,0,0), +(@GUID+93,28249,595,3,1,0,0,2472.34,1404.76,130.752,5.20601,120,5,0,63000,0,1,0,0,0), +(@GUID+94,28249,595,3,1,0,0,2460.59,1413.26,130.46,5.4377,120,5,0,63000,0,1,0,0,0), +(@GUID+95,28249,595,3,1,0,0,2415.04,1423.52,131.111,0.214785,120,5,0,63000,0,1,0,0,0); + +DELETE FROM `script_texts` WHERE entry BETWEEN -1595052 AND -1595048; +INSERT INTO `script_texts` (npc_entry,entry, content_default, comment) VALUES +(27913,-1595048, "Scourge forces have been spotted near the Elder's Square Gate!","Spawns near elder's square gate."), +(27913,-1595059, "Scourge forces have been spotted near the Town Hall!","Spawns near town hall."), +(27913,-1595050, "Scourge forces have been spotted near the King's Square fountain!","Spawns near king's square."), +(27913,-1595051, "Scourge forces have been spotted near the Market Row Gate!", "Spawns near market row gate."), +(27913,-1595052, "Scourge forces have been spotted near the Festival Lane Gate!", "Spawns near festval lane gate."); + +UPDATE `creature_template` SET `dynamicflags` = 0 WHERE `entry` IN (32273,32313); +UPDATE `areatrigger_teleport` SET id = 5181 WHERE id = 5148; +UPDATE `creature_template` SET `flags_extra` = 128 WHERE `entry` = 20562; +UPDATE `script_waypoint` SET location_x = 2449.32, location_y = 1191.09 WHERE entry = 26499 AND pointid = 26; + +UPDATE `creature_template` SET `lootid` = 32273 WHERE `entry` IN (32273, 32313); + +-- thx warpten (fix for credit spell) +UPDATE `spell_dbc` SET `Attributes` = '8388992', `AttributesEx2` = '5', `AttributesEx3` = '269484288' WHERE `Id` = 58630; From b23986590f1c3db7278018eb64bf577807fff685 Mon Sep 17 00:00:00 2001 From: WishToDie Date: Thu, 3 May 2012 15:51:43 +0200 Subject: [PATCH 0667/1149] DB/Quest: Correct Chaining for Childrens Week Quests Closes #6404 --- .../2012_05_03_02_world_quest_template.sql | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 sql/updates/world/2012_05_03_02_world_quest_template.sql diff --git a/sql/updates/world/2012_05_03_02_world_quest_template.sql b/sql/updates/world/2012_05_03_02_world_quest_template.sql new file mode 100644 index 00000000000..49953bd2166 --- /dev/null +++ b/sql/updates/world/2012_05_03_02_world_quest_template.sql @@ -0,0 +1,28 @@ +-- Wolvar Orphan quest order +UPDATE `quest_template` SET `prevquestid`=13927,`exclusivegroup`=-13930 WHERE `id` IN (13930,13934,13951); +UPDATE `quest_template` SET `prevquestid`=13930,`exclusivegroup`=-13955 WHERE `id` IN (13955,13957); +UPDATE `quest_template` SET `prevquestid`=13955,`exclusivegroup`=0 WHERE `id`=13938; +UPDATE `quest_template` SET `prevquestid`=13938,`exclusivegroup`=0 WHERE `id`=13960; +-- Oracle Orphan quest order +UPDATE `quest_template` SET `prevquestid`=13926,`exclusivegroup`=-13929 WHERE `id` IN (13929,13933,13950); +UPDATE `quest_template` SET `prevquestid`=13929,`exclusivegroup`=-13954 WHERE `id` IN (13954,13956); +UPDATE `quest_template` SET `prevquestid`=13954,`exclusivegroup`=0 WHERE `id`=13937; +UPDATE `quest_template` SET `prevquestid`=13937,`exclusivegroup`=0 WHERE `id`=13959; +-- Human Orphan quest order +UPDATE `quest_template` SET `prevquestid`=1468,`exclusivegroup`=-1479 WHERE `id` IN (1479,1558,1687); +UPDATE `quest_template` SET `prevquestid`=1479,`exclusivegroup`=-558 WHERE `id` IN (558,4822); +UPDATE `quest_template` SET `prevquestid`=558,`exclusivegroup`=0 WHERE `id`=171; +-- Orcish Orphan quest order +UPDATE `quest_template` SET `prevquestid`=172,`exclusivegroup`=-910 WHERE `id` IN (910,911,1800); +UPDATE `quest_template` SET `prevquestid`=910,`exclusivegroup`=-915 WHERE `id` IN (915,925); +UPDATE `quest_template` SET `prevquestid`=915,`exclusivegroup`=0 WHERE `id`=5502; +-- Draenei Orphan quest order +UPDATE `quest_template` SET `prevquestid`=10943,`exclusivegroup`=-10950 WHERE `id` IN (10950,10952,10954); +UPDATE `quest_template` SET `prevquestid`=10950,`exclusivegroup`=-10956 WHERE `id` IN (10956,10962); +UPDATE `quest_template` SET `NextQuestIdChain`=10968 WHERE `id`=10956; +UPDATE `quest_template` SET `prevquestid`=10968,`exclusivegroup`=0 WHERE `id`=10966; +-- Blood Elf Orphan quest order +UPDATE `quest_template` SET `prevquestid`=10942,`exclusivegroup`=-10945 WHERE `id` IN (10945,10951,10953); +UPDATE `quest_template` SET `prevquestid`=10945,`exclusivegroup`=-10960 WHERE `id` IN (10960,10963); +UPDATE `quest_template` SET `prevquestid`=10960,`exclusivegroup`=0 WHERE `id`=11975; +UPDATE `quest_template` SET `prevquestid`=11975,`exclusivegroup`=0 WHERE `id`=10967; From a708982a22256fcf292f4d772a0e36ef3029a4b9 Mon Sep 17 00:00:00 2001 From: WishToDie Date: Thu, 3 May 2012 16:23:40 +0200 Subject: [PATCH 0668/1149] DB/Quest: correct NPC quest relation for quest 171 --- .../world/2012_05_03_03_world_creature_questrelation.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_05_03_03_world_creature_questrelation.sql diff --git a/sql/updates/world/2012_05_03_03_world_creature_questrelation.sql b/sql/updates/world/2012_05_03_03_world_creature_questrelation.sql new file mode 100644 index 00000000000..1da4f6d29ad --- /dev/null +++ b/sql/updates/world/2012_05_03_03_world_creature_questrelation.sql @@ -0,0 +1,2 @@ +-- Set correct NPC for A Warden of the Alliance +UPDATE `creature_questrelation` SET `id`=14305 WHERE `quest`=171; From 5dff4bf66f1d0cc2c058466ca557222dd4edf0a5 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Thu, 3 May 2012 17:12:01 +0200 Subject: [PATCH 0669/1149] DB/Quest: move some questrelations to the seasonal tables --- ..._03_04_world_game_event_creature_quest.sql | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 sql/updates/world/2012_05_03_04_world_game_event_creature_quest.sql diff --git a/sql/updates/world/2012_05_03_04_world_game_event_creature_quest.sql b/sql/updates/world/2012_05_03_04_world_game_event_creature_quest.sql new file mode 100644 index 00000000000..62fd4415549 --- /dev/null +++ b/sql/updates/world/2012_05_03_04_world_game_event_creature_quest.sql @@ -0,0 +1,57 @@ +DELETE FROM `creature_questrelation` WHERE `id` IN (14305,14444,22817,22818,33532,33533,34365); +DELETE FROM `game_event_creature_quest` WHERE `eventEntry`=10; +INSERT INTO `game_event_creature_quest` (`eventEntry`,`id`,`quest`) VALUES +-- Alliance +(10,14450,1468), -- Orphan Matron Nightingale - Children's Week +(10,14305,1479), -- Human Orphan - The Bough of the Eternals +(10,14305,1558), -- Human Orphan - The Stonewrought Dam +(10,14305,1687), -- Human Orphan - Spooky Lighthouse +(10,14305,558), -- Human Orphan - Jaina's Autograph +(10,14305,4822), -- Human Orphan - You Scream, I Scream... +-- Horde +(10,14451,172), -- Orphan Matron Battlewail - Children's Week +(10,14444,910), -- Orcish Orphan - Down at the Docks +(10,14444,911), -- Orcish Orphan - Gateway to the Frontier +(10,14444,1800), -- Orcish Orphan - Lordaeron Throne Room +(10,14444,915), -- Orcish Orphan - You Scream, I Scream... +(10,14444,925), -- Orcish Orphan - Cairne's Hoofprint +(10,14444,5502), -- Orcish Orphan - A Warden of the Horde +-- Outlands: Blood Elfs +(10,22819,10942), -- Orphan Matron Mercy - Children's Week +(10,22817,10945), -- Blood Elf Orphan - Hch'uu and the Mushroom People +(10,22817,10951), -- Blood Elf Orphan - A Trip to the Dark Portal +(10,22817,10953), -- Blood Elf Orphan - Visit the Throne of the Elements +(10,22817,11975), -- Blood Elf Orphan - Now, When I Grow Up... +(10,22817,10963), -- Blood Elf Orphan - Time to Visit the Caverns +(10,22817,10967), -- Blood Elf Orphan - Back to the Orphanage +-- Outlands: Draenei +(10,22819,10943), -- Orphan Matron Mercy - Children's Week +(10,22818,10950), -- Draenei Orphan - Auchindoun and the Ring of Observance +(10,22818,10952), -- Draenei Orphan - A Trip to the Dark Portal +(10,22818,10954), -- Draenei Orphan - Jheel is at Aeris Landing! +(10,22818,10956), -- Draenei Orphan - The Seat of the Naaru +(10,22818,10962), -- Draenei Orphan - Time to Visit the Caverns +(10,22818,10966), -- Draenei Orphan - Back to the Orphanage +-- Northrend: Wolvar +(10,34365,13927), -- Orphan Matron Aria - Little Orphan Kekek Of The Wolvar +(10,33532,13930), -- Wolvar Orphan - Home Of The Bear-Men +(10,33532,13934), -- Wolvar Orphan - The Bronze Dragonshrine +(10,33532,13951), -- Wolvar Orphan - Playmates! +(10,33532,13955), -- Wolvar Orphan - The Dragon Queen +(10,33532,13957), -- Wolvar Orphan - The Mighty Hemet Nesingwary +(10,33532,13960), -- Wolvar Orphan - Back To The Orphanage +-- Northrend: Oracles +(10,34365,13926), -- Orphan Matron Aria - Little Orphan Roo Of The Oracles +(10,33533,13929), -- Oracle Orphan - The Biggest Tree Ever! +(10,33533,13933), -- Oracle Orphan - The Bronze Dragonshrine +(10,33533,13937), -- Oracle Orphan - A Trip To The Wonderworks +(10,33533,13950), -- Oracle Orphan - Playmates! +(10,33533,13954), -- Oracle Orphan - The Dragon Queen +(10,33533,13956), -- Oracle Orphan - Meeting a Great One +(10,33533,13959); -- Oracle Orphan - Back To The Orphanage + +-- Removed "When I Grow Up..." and replace it with "Now, When I Grow Up..." +UPDATE `quest_template` SET `prevquestid`=10945,`exclusivegroup`=-11975 WHERE `id` IN (11975,10963); +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=10960; +INSERT INTO `disables` (`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) VALUES +(1,10960,0,'','','Deprecated quest: When I grow up...'); From a8a5b5a8f02bbb112abbb9ca418939f003c74a22 Mon Sep 17 00:00:00 2001 From: kandera Date: Thu, 3 May 2012 12:45:28 -0300 Subject: [PATCH 0670/1149] Core/Seasonal: move quest resetting to the beginning of the event. --- src/server/game/Events/GameEventMgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index a8492726e75..d5e85d2cf2f 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -1124,8 +1124,6 @@ void GameEventMgr::UnApplyEvent(uint16 event_id) UpdateEventNPCVendor(event_id, false); // update bg holiday UpdateBattlegroundSettings(); - // check for seasonal quest reset. - sWorld->ResetEventSeasonalQuests(event_id); } void GameEventMgr::ApplyNewEvent(uint16 event_id) @@ -1160,6 +1158,8 @@ void GameEventMgr::ApplyNewEvent(uint16 event_id) UpdateEventNPCVendor(event_id, true); // update bg holiday UpdateBattlegroundSettings(); + // check for seasonal quest reset. + sWorld->ResetEventSeasonalQuests(event_id); } void GameEventMgr::UpdateEventNPCFlags(uint16 event_id) From 58b05da8df4a0b330d55ccdd296730608b749490 Mon Sep 17 00:00:00 2001 From: MacWarrior Date: Fri, 4 May 2012 16:42:23 +0300 Subject: [PATCH 0671/1149] Fix creature's save --- src/server/game/Entities/Creature/Creature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index fde85feb8d9..acdf2b16f2a 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1128,7 +1128,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) stmt->setUInt8(index++, uint8(GetDefaultMovementType())); stmt->setUInt32(index++, npcflag); stmt->setUInt32(index++, unit_flags); - stmt->setUInt32(index, dynamicflags); + stmt->setUInt32(index++, dynamicflags); trans->Append(stmt); WorldDatabase.CommitTransaction(trans); From d94a89c4652e5ffd488c3cdaebd56df8b268bb3e Mon Sep 17 00:00:00 2001 From: Chaplain Date: Fri, 4 May 2012 18:35:11 +0300 Subject: [PATCH 0672/1149] Clean misused m_canBeRecalculated. *When we solve problem with m_amount we could make right solution for caster/victim damage calculation. --- .../game/Spells/Auras/SpellAuraEffects.cpp | 23 +++++-------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index d9368810945..172a5612000 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -598,7 +598,6 @@ int32 AuraEffect::CalculateAmount(Unit* caster) } break; case SPELL_AURA_PERIODIC_DAMAGE: - m_canBeRecalculated = true; if (!caster) break; // Rupture @@ -660,9 +659,6 @@ int32 AuraEffect::CalculateAmount(Unit* caster) amount = int32((float)amount / GetTotalTicks()); } break; - case SPELL_AURA_PERIODIC_DAMAGE_PERCENT: - m_canBeRecalculated = true; - break; case SPELL_AURA_PERIODIC_ENERGIZE: if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_GENERIC) { @@ -679,7 +675,6 @@ int32 AuraEffect::CalculateAmount(Unit* caster) ApplyPctU(amount, GetBase()->GetUnitOwner()->GetCreatePowers(POWER_MANA)); break; case SPELL_AURA_PERIODIC_HEAL: - m_canBeRecalculated = true; if (!caster) break; // Lightwell Renew @@ -6202,10 +6197,8 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) if (GetAuraType() == SPELL_AURA_PERIODIC_DAMAGE) { - if (m_canBeRecalculated) - SetAmount(caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount())); - - damage = target->SpellDamageBonusTaken(GetSpellInfo(), GetAmount(), DOT, GetBase()->GetStackAmount()); + damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); + damage = target->SpellDamageBonusTaken(GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); // Calculate armor mitigation if (Unit::IsDamageReducedByArmor(GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), GetEffIndex())) @@ -6316,10 +6309,8 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) uint32 damage = std::max(GetAmount(), 0); - if (m_canBeRecalculated) - SetAmount(caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount())); - - damage = target->SpellDamageBonusTaken(GetSpellInfo(), GetAmount(), DOT, GetBase()->GetStackAmount()); + damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); + damage = target->SpellDamageBonusTaken(GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); bool crit = IsPeriodicTickCrit(target, caster); if (crit) @@ -6466,10 +6457,8 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) damage += addition; } - if (m_canBeRecalculated) - SetAmount(caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount())); - - damage = target->SpellHealingBonusTaken(GetSpellInfo(), GetAmount(), DOT, GetBase()->GetStackAmount()); + damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); + damage = target->SpellHealingBonusTaken(GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); } bool crit = IsPeriodicTickCrit(target, caster); From 7a0b30dbf9e2195e12bd2aecc8b28f5c3eb9b28c Mon Sep 17 00:00:00 2001 From: Malcrom Date: Fri, 4 May 2012 22:10:26 -0230 Subject: [PATCH 0673/1149] DB/waypoints: Added a few paths for Trallamar, Hellfire Penn. --- .../world/2012_05_04_00_world_waypoints.sql | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 sql/updates/world/2012_05_04_00_world_waypoints.sql diff --git a/sql/updates/world/2012_05_04_00_world_waypoints.sql b/sql/updates/world/2012_05_04_00_world_waypoints.sql new file mode 100644 index 00000000000..8c1528c6ef6 --- /dev/null +++ b/sql/updates/world/2012_05_04_00_world_waypoints.sql @@ -0,0 +1,137 @@ +-- Thrallamar Grunt pathing +SET @NPC := 57505; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=168.3949,`position_y`=2641.357,`position_z`=86.32077 WHERE `guid`=@NPC; +UPDATE `creature_addon` SET `path_id`=@PATH WHERE `guid`=@NPC; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,168.3949,2641.357,86.32077,0,0,0,100,0), +(@PATH,2,186.5067,2615.882,87.28357,0,0,0,100,0), +(@PATH,3,188.9113,2601.655,87.28357,0,0,0,100,0), +(@PATH,4,198.3909,2602.661,87.28357,0,0,0,100,0), +(@PATH,5,201.5686,2609.845,87.28357,0,0,0,100,0), +(@PATH,6,187.2484,2616.44,87.28357,0,0,0,100,0), +(@PATH,7,168.7871,2641.268,86.32077,0,0,0,100,0), +(@PATH,8,155.2003,2681.998,84.82113,0,0,0,100,0), +(@PATH,9,194.6133,2692.07,90.61374,0,0,0,100,0), +(@PATH,10,215.4427,2693.589,90.69872,0,0,0,100,0), +(@PATH,11,219.0203,2692.25,90.69665,0,0,0,100,0), +(@PATH,12,225.5117,2680.063,90.68996,0,0,0,100,0), +(@PATH,13,235.309,2679.308,90.69373,0,0,0,100,0), +(@PATH,14,246.9184,2682.646,90.70419,0,0,0,100,0), +(@PATH,15,252.4411,2688.479,90.70386,0,0,0,100,0), +(@PATH,16,255.0155,2699.197,90.70283,0,0,0,100,0), +(@PATH,17,251.5234,2707.998,90.70486,0,0,0,100,0), +(@PATH,18,243.2346,2712.791,90.70392,0,0,0,100,0), +(@PATH,19,231.9871,2713.626,90.70399,0,0,0,100,0), +(@PATH,20,221.1457,2709.591,90.69753,0,0,0,100,0), +(@PATH,21,218.8803,2695.845,90.69318,0,0,0,100,0), +(@PATH,22,215.4517,2693.612,90.69869,0,0,0,100,0), +(@PATH,23,194.7944,2692.039,90.65273,0,0,0,100,0), +(@PATH,24,175.8115,2687.591,86.68189,0,0,0,100,0), +(@PATH,25,155.2143,2682.375,84.82113,0,0,0,100,0), +(@PATH,26,131.8727,2679.832,84.56969,0,0,0,100,0), +(@PATH,27,130.0859,2666.262,84.1262,0,0,0,100,0), +(@PATH,28,153.1291,2650.22,86.15128,0,0,0,100,0); + +-- Remove dup Thrallamar Grunt spawn +DELETE FROM `creature` WHERE `guid`=57532; +DELETE FROM `creature_addon` WHERE `guid`=57532; + +-- Bat Rider Guard pathing +SET @NPC := 54840; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=156.9029,`position_y`=2554.784,`position_z`=170.8949 WHERE `guid`=@NPC; +UPDATE `creature_addon` SET `path_id`=@PATH WHERE `guid`=@NPC; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,156.9029,2554.784,170.8949,0,0,0,100,0), +(@PATH,2,52.51677,2602.816,139.7838,0,0,0,100,0), +(@PATH,3,42.10146,2627.056,139.7838,0,0,0,100,0), +(@PATH,4,37.17329,2663.729,139.7838,0,0,0,100,0), +(@PATH,5,62.91933,2687.96,139.7838,0,0,0,100,0), +(@PATH,6,96.1871,2688.141,148.4226,0,0,0,100,0), +(@PATH,7,129.818,2690.786,151.256,0,0,0,100,0), +(@PATH,8,165.6888,2715.398,170.8949,0,0,0,100,0), +(@PATH,9,199.7751,2744.93,170.8949,0,0,0,100,0), +(@PATH,10,246.0857,2761.154,170.8949,0,0,0,100,0), +(@PATH,11,295.0904,2757.991,170.8949,0,0,0,100,0), +(@PATH,12,309.3468,2726.089,170.8949,0,0,0,100,0), +(@PATH,13,303.8448,2682.588,170.8949,0,0,0,100,0), +(@PATH,14,289.3104,2650.866,170.8949,0,0,0,100,0), +(@PATH,15,261.2743,2618.831,170.8949,0,0,0,100,0), +(@PATH,16,233.6436,2578.997,170.8949,0,0,0,100,0), +(@PATH,17,199.3375,2546.226,170.8949,0,0,0,100,0); + +-- Bat Rider Guard pathing +SET @NPC := 54841; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=65.97776,`position_y`=2661.205,`position_z`=163.6752 WHERE `guid`=@NPC; +UPDATE `creature_addon` SET `path_id`=@PATH WHERE `guid`=@NPC; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,65.97776,2661.205,163.6752,0,0,0,100,0), +(@PATH,2,85.52612,2668.312,163.6752,0,0,0,100,0), +(@PATH,3,119.9537,2689.26,163.6752,0,0,0,100,0), +(@PATH,4,121.8238,2721.88,163.6752,0,0,0,100,0), +(@PATH,5,142.6907,2750.891,163.6752,0,0,0,100,0), +(@PATH,6,149.9812,2788.504,163.6752,0,0,0,100,0), +(@PATH,7,142.9353,2830.464,163.6752,0,0,0,100,0), +(@PATH,8,115.1711,2822.444,163.6752,0,0,0,100,0), +(@PATH,9,57.16672,2791.644,163.6752,0,0,0,100,0), +(@PATH,10,38.80463,2758.823,163.6752,0,0,0,100,0), +(@PATH,11,19.69282,2714.784,163.6752,0,0,0,100,0), +(@PATH,12,23.22027,2677.714,163.6752,0,0,0,100,0); + +-- Bat Rider Guard pathing +SET @NPC := 54842; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=263.5968,`position_y`=2694.818,`position_z`=169.7312 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,4097); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,263.5968,2694.818,169.7312,0,0,0,100,0), +(@PATH,2,184.0861,2784.899,154.4534,0,0,0,100,0), +(@PATH,3,154.2815,2754.787,154.3701,0,0,0,100,0), +(@PATH,4,127.0308,2740.488,154.3701,0,0,0,100,0), +(@PATH,5,118.0444,2706.509,154.3701,0,0,0,100,0), +(@PATH,6,115.7577,2669.386,158.6756,0,0,0,100,0), +(@PATH,7,131.4314,2622.531,162.1478,0,0,0,100,0), +(@PATH,8,154.8241,2607.207,164.4812,0,0,0,100,0), +(@PATH,9,176.3283,2571.343,168.5645,0,0,0,100,0), +(@PATH,10,221.6267,2559.683,172.1201,0,0,0,100,0), +(@PATH,11,245.392,2593.423,169.8978,0,0,0,100,0), +(@PATH,12,251.0069,2617.749,169.7312,0,0,0,100,0), +(@PATH,13,263.0581,2644.614,169.7312,0,0,0,100,0); + +-- Bat Rider Guard pathing +SET @NPC := 54843; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=62.42025,`position_y`=2785.719,`position_z`=192.1124 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,4097); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,62.42025,2785.719,192.1124,0,0,0,100,0), +(@PATH,2,159.9371,2842.977,208.279,0,0,0,100,0), +(@PATH,3,183.0578,2845.035,208.279,0,0,0,100,0), +(@PATH,4,211.2432,2864.757,214.2235,0,0,0,100,0), +(@PATH,5,238.1182,2871.979,220.9457,0,0,0,100,0), +(@PATH,6,252.9173,2853.913,220.9457,0,0,0,100,0), +(@PATH,7,255.0203,2812.634,220.9457,0,0,0,100,0), +(@PATH,8,240.4993,2780.929,220.9457,0,0,0,100,0), +(@PATH,9,195.4901,2773.965,209.3901,0,0,0,100,0), +(@PATH,10,162.1341,2742.294,212.9179,0,0,0,100,0), +(@PATH,11,125.4935,2720.611,197.9457,0,0,0,100,0), +(@PATH,12,93.49241,2699.757,192.1124,0,0,0,100,0), +(@PATH,13,58.35324,2681.49,192.1124,0,0,0,100,0), +(@PATH,14,22.8833,2715.123,192.1124,0,0,0,100,0), +(@PATH,15,30.10514,2764.5,192.1124,0,0,0,100,0); + +-- Fix Bat Rider Guard InhabitType +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=15242; + +-- Remove dup Bat Rider Guard spawns +DELETE FROM `creature` WHERE `guid` IN (54839,54844,54845); +DELETE FROM `creature_addon` WHERE `guid` IN (54839,54844,54845); From eefbd909040dc57a1a77d41170416d5feb7715b9 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 5 May 2012 02:01:14 -0230 Subject: [PATCH 0674/1149] DB/SAI: Speech by Martik Tor'seldor, Thrallamar --- sql/updates/world/2012_05_04_01_world_sai.sql | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sql/updates/world/2012_05_04_01_world_sai.sql diff --git a/sql/updates/world/2012_05_04_01_world_sai.sql b/sql/updates/world/2012_05_04_01_world_sai.sql new file mode 100644 index 00000000000..925a220cd77 --- /dev/null +++ b/sql/updates/world/2012_05_04_01_world_sai.sql @@ -0,0 +1,32 @@ +-- Speech by Martik Tor'seldor, Thrallamar +SET @ENTRY := 16577; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@ENTRY*100; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,0,30000,50000,360000,360000,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Martik Tor''seldor - OOC - Load script every 6 min ooc'), +(@ENTRY,0,1,0,25,0,100,0,0,0,0,0,11,18100,32,0,0,0,0,1,0,0,0,0,0,0,0, 'Martik Tor''seldor - Reset - Cast Frost Armor'), +(@ENTRY*100,9,0,0,0,0,100,0,1000,1000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldor Say text 0'), +(@ENTRY*100,9,1,0,0,0,100,0,3000,3000,0,0,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldor emote'), +(@ENTRY*100,9,2,0,0,0,100,0,3000,3000,0,0,5,6,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldor emote'), +(@ENTRY*100,9,3,0,0,0,100,0,3000,3000,0,0,1,0,0,0,0,0,0,10,57487,16578,0,0,0,0,0,'Blood Elf Pilgrim Say text 0'), +(@ENTRY*100,9,4,0,0,0,100,0,3000,3000,0,0,5,6,0,0,0,0,0,10,57487,16578,0,0,0,0,0,'Blood Elf Pilgrim emote'), +(@ENTRY*100,9,5,0,0,0,100,0,3000,3000,0,0,66,0,0,0,0,0,0,10,57487,16578,0,0,0,0,0,'Martik Tor''seldor turn to'), +(@ENTRY*100,9,6,0,0,0,100,0,1000,1000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldor Say text 1'), +(@ENTRY*100,9,7,0,0,0,100,0,4000,4000,0,0,1,1,0,0,0,0,0,10,57487,16578,0,0,0,0,0,'Blood Elf Pilgrim Say text 1'), +(@ENTRY*100,9,8,0,0,0,100,0,3000,3000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldor Say text 2'), +(@ENTRY*100,9,9,0,0,0,100,0,3000,3000,0,0,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldor emote'), +(@ENTRY*100,9,10,0,0,0,100,0,3000,3000,0,0,5,273,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldor emote'), +(@ENTRY*100,9,11,0,0,0,100,0,3000,3000,0,0,1,2,0,0,0,0,0,10,57487,16578,0,0,0,0,0,'Blood Elf Pilgrim Say text 2'), +(@ENTRY*100,9,12,0,0,0,100,0,1000,1000,0,0,5,15,0,0,0,0,0,9,16578,0,20,0,0,0,0,'Blood Elf Pilgrim emote'), +(@ENTRY*100,9,13,0,0,0,100,0,3000,3000,0,0,66,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldor turn to'); +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry` IN (16577,16578); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(16577,0,0, 'Brothers and sisters, I have been to the promised land. I have tasted in the sublim energy. I have felt bliss - bliss so engrossing and all encompassing that I was left wondering if I had stumbled upon the dreams of gods.!',12,0,100,5,0,0, 'Martik Tor''seldor'), +(16577,1,0, 'In paradise, you merely reach out and take from the Nether.',12,0,100,1,0,0, 'Martik Tor''seldor'), +(16577,2,0, 'From the very air! Tendrils of arcane energy light up the obsidian sky as plumes of raw magic rise up from fissures in the land. Kneel and drink from the fissure as you do from a stream or well. Pluck a tendril from the heavens as if it were an apple hanging from a branch.',12,0,100,5,0,0, 'Martik Tor''seldor'), +(16578,0,0, 'Tell us more, Martik. What is it? What does it feel like?',12,0,100,1,0,0, 'Blood Elf Pilgrim'), +(16578,1,0, 'But how?',12,0,100,6,0,0, 'Blood Elf Pilgrim'), +(16578,2,0, '%s smiles/gasps.',16,0,100,0,0,0, 'Blood Elf Pilgrim'); From 58622c4986be6280aa5b0b38922e31b797ca1269 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 5 May 2012 10:09:37 -0230 Subject: [PATCH 0675/1149] DB/Misc: Fixed some spelling in comments. --- .../world/2012_05_04_00_world_waypoints.sql | 4 +-- sql/updates/world/2012_05_04_01_world_sai.sql | 30 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/sql/updates/world/2012_05_04_00_world_waypoints.sql b/sql/updates/world/2012_05_04_00_world_waypoints.sql index 8c1528c6ef6..a07bde59d49 100644 --- a/sql/updates/world/2012_05_04_00_world_waypoints.sql +++ b/sql/updates/world/2012_05_04_00_world_waypoints.sql @@ -1,4 +1,4 @@ --- Thrallamar Grunt pathing +-- Thrallmar Grunt pathing SET @NPC := 57505; SET @PATH := @NPC*10; UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=168.3949,`position_y`=2641.357,`position_z`=86.32077 WHERE `guid`=@NPC; @@ -34,7 +34,7 @@ INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z` (@PATH,27,130.0859,2666.262,84.1262,0,0,0,100,0), (@PATH,28,153.1291,2650.22,86.15128,0,0,0,100,0); --- Remove dup Thrallamar Grunt spawn +-- Remove dup Thrallmar Grunt spawn DELETE FROM `creature` WHERE `guid`=57532; DELETE FROM `creature_addon` WHERE `guid`=57532; diff --git a/sql/updates/world/2012_05_04_01_world_sai.sql b/sql/updates/world/2012_05_04_01_world_sai.sql index 925a220cd77..7021fc92548 100644 --- a/sql/updates/world/2012_05_04_01_world_sai.sql +++ b/sql/updates/world/2012_05_04_01_world_sai.sql @@ -1,32 +1,32 @@ --- Speech by Martik Tor'seldor, Thrallamar +-- Speech by Martik Tor'seldoi, Thrallmar SET @ENTRY := 16577; UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@ENTRY*100; INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES -(@ENTRY,0,0,0,1,0,100,0,30000,50000,360000,360000,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Martik Tor''seldor - OOC - Load script every 6 min ooc'), -(@ENTRY,0,1,0,25,0,100,0,0,0,0,0,11,18100,32,0,0,0,0,1,0,0,0,0,0,0,0, 'Martik Tor''seldor - Reset - Cast Frost Armor'), -(@ENTRY*100,9,0,0,0,0,100,0,1000,1000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldor Say text 0'), -(@ENTRY*100,9,1,0,0,0,100,0,3000,3000,0,0,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldor emote'), -(@ENTRY*100,9,2,0,0,0,100,0,3000,3000,0,0,5,6,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldor emote'), +(@ENTRY,0,0,0,1,0,100,0,30000,50000,360000,360000,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Martik Tor''seldoi - OOC - Load script every 6 min ooc'), +(@ENTRY,0,1,0,25,0,100,0,0,0,0,0,11,18100,32,0,0,0,0,1,0,0,0,0,0,0,0, 'Martik Tor''seldoi - Reset - Cast Frost Armor'), +(@ENTRY*100,9,0,0,0,0,100,0,1000,1000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldoi Say text 0'), +(@ENTRY*100,9,1,0,0,0,100,0,3000,3000,0,0,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldoi emote'), +(@ENTRY*100,9,2,0,0,0,100,0,3000,3000,0,0,5,6,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldoi emote'), (@ENTRY*100,9,3,0,0,0,100,0,3000,3000,0,0,1,0,0,0,0,0,0,10,57487,16578,0,0,0,0,0,'Blood Elf Pilgrim Say text 0'), (@ENTRY*100,9,4,0,0,0,100,0,3000,3000,0,0,5,6,0,0,0,0,0,10,57487,16578,0,0,0,0,0,'Blood Elf Pilgrim emote'), -(@ENTRY*100,9,5,0,0,0,100,0,3000,3000,0,0,66,0,0,0,0,0,0,10,57487,16578,0,0,0,0,0,'Martik Tor''seldor turn to'), -(@ENTRY*100,9,6,0,0,0,100,0,1000,1000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldor Say text 1'), +(@ENTRY*100,9,5,0,0,0,100,0,3000,3000,0,0,66,0,0,0,0,0,0,10,57487,16578,0,0,0,0,0,'Martik Tor''seldoi turn to'), +(@ENTRY*100,9,6,0,0,0,100,0,1000,1000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldoi Say text 1'), (@ENTRY*100,9,7,0,0,0,100,0,4000,4000,0,0,1,1,0,0,0,0,0,10,57487,16578,0,0,0,0,0,'Blood Elf Pilgrim Say text 1'), -(@ENTRY*100,9,8,0,0,0,100,0,3000,3000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldor Say text 2'), -(@ENTRY*100,9,9,0,0,0,100,0,3000,3000,0,0,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldor emote'), -(@ENTRY*100,9,10,0,0,0,100,0,3000,3000,0,0,5,273,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldor emote'), +(@ENTRY*100,9,8,0,0,0,100,0,3000,3000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldoi Say text 2'), +(@ENTRY*100,9,9,0,0,0,100,0,3000,3000,0,0,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldoi emote'), +(@ENTRY*100,9,10,0,0,0,100,0,3000,3000,0,0,5,273,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldoi emote'), (@ENTRY*100,9,11,0,0,0,100,0,3000,3000,0,0,1,2,0,0,0,0,0,10,57487,16578,0,0,0,0,0,'Blood Elf Pilgrim Say text 2'), (@ENTRY*100,9,12,0,0,0,100,0,1000,1000,0,0,5,15,0,0,0,0,0,9,16578,0,20,0,0,0,0,'Blood Elf Pilgrim emote'), -(@ENTRY*100,9,13,0,0,0,100,0,3000,3000,0,0,66,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldor turn to'); +(@ENTRY*100,9,13,0,0,0,100,0,3000,3000,0,0,66,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldoi turn to'); -- NPC talk text insert from sniff DELETE FROM `creature_text` WHERE `entry` IN (16577,16578); INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES -(16577,0,0, 'Brothers and sisters, I have been to the promised land. I have tasted in the sublim energy. I have felt bliss - bliss so engrossing and all encompassing that I was left wondering if I had stumbled upon the dreams of gods.!',12,0,100,5,0,0, 'Martik Tor''seldor'), -(16577,1,0, 'In paradise, you merely reach out and take from the Nether.',12,0,100,1,0,0, 'Martik Tor''seldor'), -(16577,2,0, 'From the very air! Tendrils of arcane energy light up the obsidian sky as plumes of raw magic rise up from fissures in the land. Kneel and drink from the fissure as you do from a stream or well. Pluck a tendril from the heavens as if it were an apple hanging from a branch.',12,0,100,5,0,0, 'Martik Tor''seldor'), +(16577,0,0, 'Brothers and sisters, I have been to the promised land. I have tasted in the sublim energy. I have felt bliss - bliss so engrossing and all encompassing that I was left wondering if I had stumbled upon the dreams of gods.!',12,0,100,5,0,0, 'Martik Tor''seldoi'), +(16577,1,0, 'In paradise, you merely reach out and take from the Nether.',12,0,100,1,0,0, 'Martik Tor''seldoi'), +(16577,2,0, 'From the very air! Tendrils of arcane energy light up the obsidian sky as plumes of raw magic rise up from fissures in the land. Kneel and drink from the fissure as you do from a stream or well. Pluck a tendril from the heavens as if it were an apple hanging from a branch.',12,0,100,5,0,0, 'Martik Tor''seldoi'), (16578,0,0, 'Tell us more, Martik. What is it? What does it feel like?',12,0,100,1,0,0, 'Blood Elf Pilgrim'), (16578,1,0, 'But how?',12,0,100,6,0,0, 'Blood Elf Pilgrim'), (16578,2,0, '%s smiles/gasps.',16,0,100,0,0,0, 'Blood Elf Pilgrim'); From 4afb1c4f3d152c2d02f56a3ed62b090f55463f60 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 5 May 2012 12:32:38 -0230 Subject: [PATCH 0676/1149] DB/SAI: Forge of Souls Trash fixup --- sql/updates/world/2012_05_05_00_world_sai.sql | 205 ++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 sql/updates/world/2012_05_05_00_world_sai.sql diff --git a/sql/updates/world/2012_05_05_00_world_sai.sql b/sql/updates/world/2012_05_05_00_world_sai.sql new file mode 100644 index 00000000000..e03c36337af --- /dev/null +++ b/sql/updates/world/2012_05_05_00_world_sai.sql @@ -0,0 +1,205 @@ +-- Forge of Souls Trash update + +-- Npc Updates + +-- Spiteful Apparition +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=36551; +UPDATE `creature` SET `spawndist`=20,`MovementType`=1,`curhealth`=1,`curmana`=0 WHERE `id`=36551; +DELETE FROM `creature_template_addon` WHERE `entry`=36551; +INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES (36551,1, '69105 69136'); +-- Spiteful Apparition (Ambient) +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=36967; +UPDATE `creature` SET `spawndist`=20,`MovementType`=1,`curhealth`=1,`curmana`=0 WHERE `id`=36967; +DELETE FROM `creature_template_addon` WHERE `entry`=36967; +INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES (36967,1, '69663 69658'); +-- Spectral Warden +UPDATE `creature_addon` SET `auras`='69144' WHERE `guid` IN (SELECT `guid` FROM `creature` WHERE `id`=36666); + +-- SAI Updates + +-- Spiteful Apparition SAI +SET @ENTRY := 36551; -- NPC entry +SET @SPELL1 := 41253; -- Greater Invisibility +SET @SPELL2 := 68895; -- Spite (Normal) +SET @SPELL3 := 70212; -- Spite (Heroic) +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,25,0,100,6,0,0,0,0,11,@SPELL1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Spiteful Apparition - On Reset - Cast Greater Invisibility'), +(@ENTRY,0,1,0,10,0,100,6,0,10,3000,4000,28,@SPELL1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Spiteful Apparition - OOC range - Remove Greater Invisibility'), +(@ENTRY,0,2,0,0,0,100,2,7000,9000,7000,9000,11,@SPELL2,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Spiteful Apparition - Combat - Cast Spite "Normal"'), +(@ENTRY,0,3,0,0,0,100,4,7000,9000,7000,9000,11,@SPELL3,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Spiteful Apparition - Combat - Cast Spite "Heroic"'); + +-- Soulguard Reaper SAI +SET @ENTRY := 36499; -- NPC entry +SET @SPELL1 := 68797; -- Soulguard Channel +SET @SPELL2 := 69058; -- Shadow Lance +SET @SPELL3 := 69060; -- Frost Nova (Normal) +SET @SPELL4 := 70209; -- Frost Nova (Heroic) +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,7,0,0,0,0,11,@SPELL1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Reaper - OOC - Cast Soulguard Channel'), +(@ENTRY,0,1,0,0,0,100,6,5000,6000,7000,9000,11,@SPELL2,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Reaper - Combat - Cast Shadow Lance'), +(@ENTRY,0,2,0,0,0,100,2,7000,9000,8000,10000,11,@SPELL3,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Soulguard Reaper - Combat - Cast Frost Nova "Normal"'), +(@ENTRY,0,3,0,0,0,100,4,7000,9000,8000,10000,11,@SPELL4,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Soulguard Reaper - Combat - Cast Frost Nova "Heroic"'), +(@ENTRY,0,4,0,4,0,100,6,0,0,0,0,39,30,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Reaper - Aggro - Call for help'); + +-- Soulguard Beam Focus Target +SET @ENTRY := 36508; -- NPC entry +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (-201770,-201785,-201741); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(-201770,0,0,0,1,0,100,6,1000,1000,5000,5000,45,0,1,0,0,0,0,19,36620,60,0,0,0,0,0, 'Soulguard Beam Focus Target - OOC - Set data on Soulguard Adept'), +(-201785,0,0,0,1,0,100,6,1000,1000,5000,5000,45,0,1,0,0,0,0,19,36620,60,0,0,0,0,0, 'Soulguard Beam Focus Target - OOC - Set data on Soulguard Adept'), +(-201741,0,0,0,1,0,100,6,1000,1000,5000,5000,45,0,1,0,0,0,0,19,36620,60,0,0,0,0,0, 'Soulguard Beam Focus Target - OOC - Set data on Soulguard Adept'), +(-201741,0,1,0,1,0,100,6,1000,1000,5000,5000,45,0,1,0,0,0,0,19,36564,60,0,0,0,0,0, 'Soulguard Beam Focus Target - OOC - Set data on Soulguard Bonecaster'); + +-- Spectral Warden SAI +SET @ENTRY := 36666; -- NPC entry +SET @SPELL1 := 69633; -- Veil of Shadow +SET @SPELL2 := 69148; -- Wail of Souls (Normal) +SET @SPELL3 := 70210; -- Wail of Souls (Heroic) +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,6,5000,6000,9000,10000,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Spectral Warden - Combat - Cast Veil of Shadow'), +(@ENTRY,0,1,0,0,0,100,2,9000,11000,5000,6000,11,@SPELL1,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Spectral Warden - Combat - Cast Wail of Souls'), +(@ENTRY,0,2,0,0,0,100,4,9000,11000,5000,6000,11,@SPELL2,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Spectral Warden - Combat - Cast Wail of Souls'); + +-- Soulguard Watchman SAI +SET @ENTRY := 36478; -- NPC entry +SET @SPELL1 := 69056; -- Shroud of Runes +SET @SPELL2 := 69053; -- Unholy Rage +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,50,6,0,10000,16000,20000,11,@SPELL1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Watchman - Combat - Cast Shroud of Runes'), +(@ENTRY,0,1,2,0,0,100,6,8000,16000,32000,40000,11,@SPELL2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Watchman - Combat - Cast Unholy Rage'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Watchman - Combat - Say 0'), +(@ENTRY,0,3,0,4,0,100,6,0,0,0,0,39,20,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Watchman - Aggro - Call for help'); +-- NPC talk text insert +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0, '%s goes into a frenzy!',16,0,100,0,0,0, 'Soulguard Watchman'); + +-- Soul Horror SAI +SET @ENTRY := 36522; -- NPC entry +SET @SPELL1 := 69088; -- Soul Strike (Normal) +SET @SPELL2 := 70211; -- Soul Strike (Heroic) +SET @SPELL3 := 69107; -- Killing Spree Invis Aura +SET @SPELL4 := 69106; -- Killing Spree Aura +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,2,5000,6000,5000,6000,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soul Horror - Combat - Cast Soul Strike'), +(@ENTRY,0,1,0,0,0,100,4,5000,6000,5000,6000,11,@SPELL2,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soul Horror - Combat - Cast Soul Strike'), +(@ENTRY,0,4,0,4,0,100,6,0,0,0,0,39,35,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soul Horror - Aggro - Call for help'); + +-- Soulguard Animator SAI +SET @ENTRY := 36516; -- NPC entry +SET @SPELL1 := 68834; -- Soulguard Channel Beam02 +SET @SPELL2 := 69562; -- Raise Dead +SET @SPELL3 := 69131; -- Soul Sickness +SET @SPELL4 := 69128; -- Soul Siphon +SET @SPELL5 := 69068; -- Shadow Bolt (Normal) +SET @SPELL6 := 70208; -- Shadow Bolt (Heroic) +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,7,1000,1000,1000,1000,11,@SPELL1,0,0,0,0,0,9,36522,1,15,0,0,0,0, 'Soulguard Animator - OOC - Cast Soulguard Channel Beam02'), +(@ENTRY,0,1,0,0,1,100,6,20000,25000,20000,25000,11,@SPELL2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Animator - Combat - Cast Raise Dead'), +(@ENTRY,0,2,0,0,0,100,6,7000,9000,9000,11000,11,@SPELL3,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Soulguard Animator - Combat - Cast Soul Sickness'), +(@ENTRY,0,3,0,0,0,100,6,9000,11000,7000,9000,11,@SPELL4,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Soulguard Animator - Combat - Cast Soul Siphon'), +(@ENTRY,0,4,0,0,0,100,2,4000,5000,3500,4500,11,@SPELL5,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Animator - Combat - Cast Shadow Bolt "Normal"'), +(@ENTRY,0,5,0,0,0,100,4,4000,5000,3500,4500,11,@SPELL6,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Animator - Combat - Cast Shadow Bolt "Heroic"'), +(@ENTRY,0,6,7,4,0,100,6,0,0,0,0,39,35,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Animator - Aggro - Call for help'), +(@ENTRY,0,7,0,61,0,100,6,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Animator - Aggro - Set phase 1'), +(@ENTRY,0,8,9,38,0,100,7,0,2,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Animator - Data set 2 - Set data'), +(@ENTRY,0,9,0,61,0,100,6,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Animator - Data set 2 - Set phase 2'), +(@ENTRY,0,10,11,38,0,100,7,0,3,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Animator - Data set 3 - Set data'), +(@ENTRY,0,11,0,61,0,100,6,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Animator - Data set 3 - Set phase 1'); + +-- Soulguard Adept SAI +SET @ENTRY := 36620; -- NPC entry +SET @SPELL1 := 68834; -- Soulguard Channel Beam02 +SET @SPELL2 := 69562; -- Raise Dead +SET @SPELL3 := 69068; -- Shadow Bolt (Normal) +SET @SPELL4 := 70208; -- Shadow Bolt (Heroic) +SET @SPELL5 := 69066; -- Drain Life (Normal) +SET @SPELL6 := 70213; -- Drain Life (Heroic) +SET @SPELL7 := 69564; -- Shadow Mend (Normal) +SET @SPELL8 := 70205; -- Shadow Mend (Heroic) +SET @SPELL9 := 68797; -- Soulguard Channel +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,7,1000,1000,1000,1000,11,@SPELL1,0,0,0,0,0,9,36522,1,15,0,0,0,0, 'Soulguard Adept - OOC - Cast Soulguard Channel Beam02'), +(@ENTRY,0,1,0,0,4,100,6,20000,25000,20000,25000,11,@SPELL2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Adept - Combat - Cast Raise Dead'), +(@ENTRY,0,2,0,0,0,100,2,7000,8000,3500,4500,11,@SPELL3,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Adept - Combat - Cast Shadow Bolt "Normal"'), +(@ENTRY,0,3,0,0,0,100,4,7000,8000,3500,4500,11,@SPELL4,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Adept - Combat - Cast Shadow Bolt "Heroic"'), +(@ENTRY,0,4,0,0,0,100,2,6000,7000,8000,10000,11,@SPELL5,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Soulguard Adept - Combat - Cast Drain Life "Normal"'), +(@ENTRY,0,5,0,0,0,100,4,6000,7000,8000,10000,11,@SPELL6,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Soulguard Adept - Combat - Cast Drain Life "Heroic"'), +(@ENTRY,0,6,0,0,0,100,2,30000,35000,18000,22000,11,@SPELL7,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Adept - Combat - Cast Shadow Mend "Normal"'), +(@ENTRY,0,7,0,0,0,100,4,30000,35000,18000,22000,11,@SPELL8,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Adept - Combat - Cast Shadow Mend "Heroic"'), +(@ENTRY,0,8,0,25,0,100,6,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Adept - On Reset - Set phase 1'), +(@ENTRY,0,9,0,38,1,100,6,0,1,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Adept - On dataset 0 1 - Set phase 2'), +(@ENTRY,0,10,0,1,2,100,7,0,0,0,0,11,@SPELL9,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Adept - OOC - Cast Soulguard Channel'), +(@ENTRY,0,11,12,4,0,100,6,0,0,0,0,39,35,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Adept - Aggro - Call for help'), +(@ENTRY,0,12,0,61,0,100,6,0,0,0,0,22,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Adept - Aggro - Set phase 3'), +(@ENTRY,0,13,14,38,0,100,7,0,2,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Adept - Data set 2 - Set data'), +(@ENTRY,0,14,0,61,0,100,6,0,0,0,0,22,4,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Adept - Data set 2 - Set phase 4'), +(@ENTRY,0,15,16,38,0,100,7,0,3,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Adept - Data set 3 - Set data'), +(@ENTRY,0,16,0,61,0,100,6,0,0,0,0,22,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Adept - Data set 3 - Set phase 3'); + +-- Soulguard Bonecaster SAI +SET @ENTRY := 36564; -- NPC entry +SET @SPELL1 := 68834; -- Soulguard Channel Beam02 +SET @SPELL2 := 69562; -- Raise Dead +SET @SPELL3 := 69080; -- Bone Volley (Normal) +SET @SPELL4 := 70206; -- Bone Volley (Heroic) +SET @SPELL5 := 69069; -- Shield of Bones (Normal) +SET @SPELL6 := 70207; -- Shield of Bones (Heroic) +SET @SPELL7 := 68797; -- Soulguard Channel +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,7,1000,1000,1000,1000,11,@SPELL1,0,0,0,0,0,9,36522,1,15,0,0,0,0, 'Soulguard Bonecaster - OOC - Cast Soulguard Channel Beam02'), +(@ENTRY,0,1,0,0,4,100,6,20000,25000,20000,25000,11,@SPELL2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Combat - Cast Raise Dead'), +(@ENTRY,0,2,0,0,0,100,2,5000,7000,6000,8000,11,@SPELL3,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Combat - Cast Bone Volley "Normal"'), +(@ENTRY,0,3,0,0,0,100,4,5000,7000,6000,8000,11,@SPELL4,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Combat - Cast Bone Volley "Heroic"'), +(@ENTRY,0,4,0,0,0,100,2,5000,7000,7000,9000,11,@SPELL5,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Combat - Cast Shield of Bones "Normal"'), +(@ENTRY,0,5,0,0,0,100,4,5000,7000,7000,9000,11,@SPELL6,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Combat - Cast Shield of Bones "Heroic"'), +(@ENTRY,0,6,0,25,0,100,6,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Bonecaster - On Reset - Set phase 1'), +(@ENTRY,0,7,0,38,1,100,6,0,1,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Bonecaster - On dataset 0 1 - Set phase 2'), +(@ENTRY,0,8,0,1,2,100,7,0,0,0,0,11,@SPELL7,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Bonecaster - OOC - Cast Soulguard Channel'), +(@ENTRY,0,9,10,4,0,100,6,0,0,0,0,39,35,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Aggro - Call for help'), +(@ENTRY,0,10,0,61,0,100,6,0,0,0,0,22,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Aggro - Set phase 3'), +(@ENTRY,0,11,12,38,0,100,7,0,2,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Data set 2 - Set data'), +(@ENTRY,0,12,0,61,0,100,6,0,0,0,0,22,4,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Data set 2 - Set phase 4'), +(@ENTRY,0,13,14,38,0,100,7,0,3,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Data set 3 - Set data'), +(@ENTRY,0,14,0,61,0,100,6,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Data set 3 - Set phase 3'); + +-- Ghoul Minion SAI +SET @ENTRY := 36916; -- NPC entry +SET @SPELL1 := 69088; -- Soul Strike (Normal) +SET @SPELL2 := 70211; -- Soul Strike (Heroic) +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,54,0,100,6,0,0,0,0,45,0,2,0,0,0,0,23,0,0,0,0,0,0,0, 'Ghoul Minion - Just Summoned - Set Data Summoner'), +(@ENTRY,0,1,0,61,0,100,6,0,0,0,0,89,5,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Ghoul Minion - Just Summoned - Set Random Movement'), +(@ENTRY,0,2,0,0,0,100,6,115000,115000,115000,115000,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Ghoul Minion - combat - die after 2 min'), +(@ENTRY,0,3,0,1,0,100,6,15000,15000,15000,15000,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Ghoul Minion - OOC - die after 15 sec'), +(@ENTRY,0,4,5,6,0,100,6,15000,15000,15000,15000,45,0,3,0,0,0,0,23,0,0,0,0,0,0,0, 'Ghoul Minion - on Death - Set data summoner'), +(@ENTRY,0,5,0,61,0,100,6,15000,15000,15000,15000,41,3000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Ghoul Minion - on Death - despawn after 3 sec'); From 706a2d4175ceae1e05af349d0beba54156761689 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 5 May 2012 12:37:27 -0230 Subject: [PATCH 0677/1149] Core/Scripts: Remove core Forge of Souls trash scripts now done in SAI. --- .../ForgeOfSouls/forge_of_souls.cpp | 579 ------------------ 1 file changed, 579 deletions(-) diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp index 3158d58716f..1469e26fd20 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp @@ -18,53 +18,6 @@ #include "ScriptPCH.h" #include "forge_of_souls.h" -enum Spells -{ - //Spiteful Apparition - SPELL_SPITE = 68895, - H_SPELL_SPITE = 70212, - - //Spectral Warden - SPELL_VEIL_OF_SHADOWS = 69633, - SPELL_WAIL_OF_SOULS = 69148, - H_SPELL_WAIL_OF_SOULS = 70210, - - //Soulguard Watchman - SPELL_SHROUD_OF_RUNES = 69056, - SPELL_UNHOLY_RAGE = 69053, - - //Soulguard Reaper - SPELL_FROST_NOVA = 69060, - H_SPELL_FROST_NOVA = 70209, - SPELL_SHADOW_LANCE = 69058, - - //Soulguard Bonecaster - SPELL_BONE_VOLLEY = 69080, - H_SPELL_BONE_VOLLEY = 70206, - SPELL_RAISE_DEAD = 69562, - SPELL_SHIELD_OF_BONES = 69069, - H_SPELL_SHIELD_OF_BONES = 70207, - - //Soulguard Animator - // Raise dead 69562 - SPELL_SHADOW_BOLT = 69068, - H_SPELL_SHADOW_BOLT = 70208, - SPELL_SOUL_SICKNESS = 69131, - SPELL_SOUL_SIPHON = 69128, - - //Soulguard Adept - //Raise dead 69562 - //Shadow Bolt 69068/70208 - SPELL_DRAIN_LIFE = 69066, - H_SPELL_DRAIN_LIFE = 70213, - SPELL_SHADOW_MEND = 69564, - H_SPELL_SHADOW_MEND = 70205, - - //Soul Horror - SPELL_SOUL_STRIKE = 69088, - H_SPELL_SOUL_STRIKE = 70211, -}; - enum Events { EVENT_NONE, @@ -78,38 +31,6 @@ enum Events EVENT_INTRO_6, EVENT_INTRO_7, EVENT_INTRO_8, - - //Spiteful Apparition - EVENT_SPITE, - - //Spectral Warden - EVENT_VEIL_OF_SHADOWS, - EVENT_WAIL_OF_SOULS, - - //Soulguard Watchman - EVENT_SHROUD_OF_RUNES, - EVENT_UNHOLY_RAGE, - - //Soulguard Reaper - EVENT_FROST_NOVA, - EVENT_SHADOW_LANCE, - - //Soulguard Bonecaster - EVENT_BONE_VOLLEY, - EVENT_RAISE_DEAD, - EVENT_SHIELD_OF_BONES, - - //Soulguard Animator - EVENT_SHADOW_BOLT, - EVENT_SOUL_SICKNESS, - EVENT_SOUL_SIPHON, - - //Soulguard Adept - EVENT_DRAIN_LIFE, - EVENT_SHADOW_MEND, - - //Soul Horror - EVENT_SOUL_STRIKE, }; /****************************************SYLVANAS************************************/ @@ -410,508 +331,8 @@ public: } }; -class mob_spiteful_apparition : public CreatureScript -{ -public: - mob_spiteful_apparition() : CreatureScript("mob_spiteful_apparition") { } - - struct mob_spiteful_apparitionAI: public ScriptedAI - { - mob_spiteful_apparitionAI(Creature* creature) : ScriptedAI(creature) - { - } - - EventMap events; - - void Reset() - { - events.Reset(); - } - - void EnterCombat(Unit* /*who*/) - { - events.ScheduleEvent(EVENT_SPITE, 8000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_SPITE: - DoCastVictim(SPELL_SPITE); - events.RescheduleEvent(EVENT_SPITE, 8000); - return; - } - } - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_spiteful_apparitionAI(creature); - } -}; - -class mob_spectral_warden : public CreatureScript -{ -public: - mob_spectral_warden() : CreatureScript("mob_spectral_warden") { } - - struct mob_spectral_wardenAI: public ScriptedAI - { - mob_spectral_wardenAI(Creature* creature) : ScriptedAI(creature) - { - } - - EventMap events; - - void Reset() - { - events.Reset(); - } - - void EnterCombat(Unit* /*who*/) - { - events.ScheduleEvent(EVENT_VEIL_OF_SHADOWS, 5000); - events.ScheduleEvent(EVENT_WAIL_OF_SOULS, 10000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_VEIL_OF_SHADOWS: - DoCastVictim(SPELL_VEIL_OF_SHADOWS); - events.RescheduleEvent(EVENT_VEIL_OF_SHADOWS, 10000); - return; - case EVENT_WAIL_OF_SOULS: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_WAIL_OF_SOULS); - events.RescheduleEvent(EVENT_WAIL_OF_SOULS, 5000); - return; - } - } - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_spectral_wardenAI(creature); - } -}; - -class mob_soulguard_watchman : public CreatureScript -{ -public: - mob_soulguard_watchman() : CreatureScript("mob_soulguard_watchman") { } - - struct mob_soulguard_watchmanAI: public ScriptedAI - { - mob_soulguard_watchmanAI(Creature* creature) : ScriptedAI(creature) { } - - EventMap events; - - void Reset() - { - events.Reset(); - } - - void EnterCombat(Unit* /*who*/) - { - events.ScheduleEvent(EVENT_SHROUD_OF_RUNES, 1000); - events.ScheduleEvent(EVENT_UNHOLY_RAGE, 1000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_SHROUD_OF_RUNES: - DoCast(me, SPELL_SHROUD_OF_RUNES); - events.RescheduleEvent(EVENT_SHROUD_OF_RUNES, 5000); - return; - case EVENT_UNHOLY_RAGE: - DoCast(me, SPELL_UNHOLY_RAGE); - events.RescheduleEvent(EVENT_UNHOLY_RAGE, 99999); - return; - } - } - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_soulguard_watchmanAI(creature); - } -}; - -class mob_soulguard_reaper : public CreatureScript -{ -public: - mob_soulguard_reaper() : CreatureScript("mob_soulguard_reaper") { } - - struct mob_soulguard_reaperAI: public ScriptedAI - { - mob_soulguard_reaperAI(Creature* creature) : ScriptedAI(creature) { } - - EventMap events; - - void Reset() - { - events.Reset(); - } - - void EnterCombat(Unit* /*who*/) - { - events.ScheduleEvent(EVENT_FROST_NOVA, 8000); - events.ScheduleEvent(EVENT_SHADOW_LANCE, 5000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_FROST_NOVA: - DoCast(me, SPELL_FROST_NOVA); - events.RescheduleEvent(EVENT_FROST_NOVA, 9600); - return; - case EVENT_SHADOW_LANCE: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_SHADOW_LANCE); - events.RescheduleEvent(EVENT_SHADOW_LANCE, 8000); - return; - } - } - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_soulguard_reaperAI(creature); - } -}; - -class mob_soulguard_bonecaster : public CreatureScript -{ -public: - mob_soulguard_bonecaster() : CreatureScript("mob_soulguard_bonecaster") { } - - struct mob_soulguard_bonecasterAI: public ScriptedAI - { - mob_soulguard_bonecasterAI(Creature* creature) : ScriptedAI(creature) { } - - EventMap events; - - void Reset() - { - events.Reset(); - } - - void EnterCombat(Unit* /*who*/) - { - events.ScheduleEvent(EVENT_BONE_VOLLEY, 6000); - events.ScheduleEvent(EVENT_RAISE_DEAD, 25000); - events.ScheduleEvent(EVENT_SHIELD_OF_BONES, 6000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_BONE_VOLLEY: - DoCastAOE(SPELL_BONE_VOLLEY); - events.RescheduleEvent(EVENT_BONE_VOLLEY, 7000); - return; - case EVENT_RAISE_DEAD: - DoCast(me, SPELL_RAISE_DEAD); - events.RescheduleEvent(EVENT_RAISE_DEAD, 25000); - return; - case EVENT_SHIELD_OF_BONES: - DoCast(me, SPELL_SHIELD_OF_BONES); - events.RescheduleEvent(EVENT_SHIELD_OF_BONES, 8000); - return; - } - } - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_soulguard_bonecasterAI(creature); - } -}; - -class mob_soulguard_animator : public CreatureScript -{ -public: - mob_soulguard_animator() : CreatureScript("mob_soulguard_animator") { } - - struct mob_soulguard_animatorAI : public ScriptedAI - { - mob_soulguard_animatorAI(Creature* creature) : ScriptedAI(creature) - { - } - - EventMap events; - - void Reset() - { - events.Reset(); - } - - void EnterCombat(Unit* /*who*/) - { - events.ScheduleEvent(EVENT_RAISE_DEAD, 25000); - events.ScheduleEvent(EVENT_SHADOW_BOLT, 5000); - events.ScheduleEvent(EVENT_SOUL_SICKNESS, 8000); - events.ScheduleEvent(EVENT_SOUL_SIPHON, 10000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_RAISE_DEAD: - DoCast(me, SPELL_RAISE_DEAD); - events.RescheduleEvent(EVENT_RAISE_DEAD, 25000); - return; - case EVENT_SHADOW_BOLT: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_SHADOW_BOLT); - events.RescheduleEvent(EVENT_SHADOW_BOLT, 5000); - return; - case EVENT_SOUL_SICKNESS: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_SOUL_SICKNESS); - events.RescheduleEvent(EVENT_SOUL_SICKNESS, 10000); - return; - case EVENT_SOUL_SIPHON: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_SOUL_SIPHON); - events.RescheduleEvent(EVENT_SOUL_SIPHON, 8000); - return; - } - } - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_soulguard_animatorAI(creature); - } -}; - -class mob_soulguard_adept : public CreatureScript -{ -public: - mob_soulguard_adept() : CreatureScript("mob_soulguard_adept") { } - - struct mob_soulguard_adeptAI: public ScriptedAI - { - mob_soulguard_adeptAI(Creature* creature) : ScriptedAI(creature) - { - } - - EventMap events; - - void Reset() - { - events.Reset(); - } - - void EnterCombat(Unit* /*who*/) - { - events.ScheduleEvent(EVENT_RAISE_DEAD, 25000); - events.ScheduleEvent(EVENT_SHADOW_BOLT, 8000); - events.ScheduleEvent(EVENT_DRAIN_LIFE, 7000); - events.ScheduleEvent(EVENT_SHADOW_MEND, 35000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_RAISE_DEAD: - DoCast(me, SPELL_RAISE_DEAD); - events.RescheduleEvent(EVENT_RAISE_DEAD, 25000); - return; - case EVENT_SHADOW_BOLT: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_SHADOW_BOLT); - events.RescheduleEvent(EVENT_SHADOW_BOLT, 4000); - return; - case EVENT_DRAIN_LIFE: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_DRAIN_LIFE); - events.RescheduleEvent(EVENT_DRAIN_LIFE, 9000); - return; - case EVENT_SHADOW_MEND: - DoCast(me, SPELL_SHADOW_MEND); - events.RescheduleEvent(EVENT_SHADOW_MEND, 20000); - return; - } - } - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_soulguard_adeptAI(creature); - } -}; - -class mob_soul_horror : public CreatureScript -{ -public: - mob_soul_horror() : CreatureScript("mob_soul_horror") { } - - struct mob_soul_horrorAI : public ScriptedAI - { - mob_soul_horrorAI(Creature* creature) : ScriptedAI(creature) { } - - EventMap events; - - void Reset() - { - events.Reset(); - } - - void EnterCombat(Unit* /*who*/) - { - events.ScheduleEvent(EVENT_SOUL_STRIKE, 6000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_SOUL_STRIKE: - DoCast(me->getVictim(), SPELL_SOUL_STRIKE); - events.RescheduleEvent(EVENT_SOUL_STRIKE, 8000); - return; - } - } - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_soul_horrorAI(creature); - } -}; - void AddSC_forge_of_souls() { new npc_sylvanas_fos(); new npc_jaina_fos(); - new mob_spiteful_apparition(); - new mob_spectral_warden(); - new mob_soulguard_watchman(); - new mob_soulguard_reaper(); - new mob_soulguard_bonecaster(); - new mob_soulguard_animator(); - new mob_soulguard_adept(); - new mob_soul_horror(); } From 68e96d50d913d1a5af64c8af4373633ffe5d3d6c Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 5 May 2012 14:55:16 -0230 Subject: [PATCH 0678/1149] DB/creature_template: Set proper faction for Ymirjar Skycaller (Heroic) --- sql/updates/world/2012_05_05_01_world_creature_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_05_05_01_world_creature_template.sql diff --git a/sql/updates/world/2012_05_05_01_world_creature_template.sql b/sql/updates/world/2012_05_05_01_world_creature_template.sql new file mode 100644 index 00000000000..bc9dfbda78d --- /dev/null +++ b/sql/updates/world/2012_05_05_01_world_creature_template.sql @@ -0,0 +1,2 @@ +-- Set proper faction for Ymirjar Skycaller (Heroic) +UPDATE `creature_template` SET `faction_A`=1885,`faction_H`=1885 WHERE `entry`=37643; \ No newline at end of file From fb9cbf96a75713940b2d400f5936ac8ef79fe73c Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 5 May 2012 15:08:36 -0230 Subject: [PATCH 0679/1149] DB/creature_template: Fix missing line from previous commit. --- sql/updates/world/2012_05_05_01_world_creature_template.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/updates/world/2012_05_05_01_world_creature_template.sql b/sql/updates/world/2012_05_05_01_world_creature_template.sql index bc9dfbda78d..2eeaf2f40d2 100644 --- a/sql/updates/world/2012_05_05_01_world_creature_template.sql +++ b/sql/updates/world/2012_05_05_01_world_creature_template.sql @@ -1,2 +1,2 @@ -- Set proper faction for Ymirjar Skycaller (Heroic) -UPDATE `creature_template` SET `faction_A`=1885,`faction_H`=1885 WHERE `entry`=37643; \ No newline at end of file +UPDATE `creature_template` SET `faction_A`=1885,`faction_H`=1885 WHERE `entry`=37643; From 072bab69512bb91d13905ad422ab90c6ef629299 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 5 May 2012 21:08:16 -0230 Subject: [PATCH 0680/1149] DB/Gameobjects: Add some missing Blood of Heroes spawns --- sql/updates/world/2012_05_05_02_world_gameobject.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 sql/updates/world/2012_05_05_02_world_gameobject.sql diff --git a/sql/updates/world/2012_05_05_02_world_gameobject.sql b/sql/updates/world/2012_05_05_02_world_gameobject.sql new file mode 100644 index 00000000000..c0b2c6b147b --- /dev/null +++ b/sql/updates/world/2012_05_05_02_world_gameobject.sql @@ -0,0 +1,10 @@ +-- Add some missing Blood of Heroes spawns +SET @GUID := 5276; +DELETE FROM `gameobject` WHERE `guid` BETWEEN @GUID AND @GUID+5; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(@GUID,176213,0,1,1,1529.10242,-1427.06946,65.49049,-3.001947,0,0,-0.9975634,0.06976615,7200,100,1), +(@GUID+1,176213,0,1,1,1705.87439,-4690.138,48.9742165,-3.08918333,0,0,-0.9996567,0.02620165,7200,100,1), +(@GUID+2,176213,0,1,1,1846.79382,-3825.265,135.5159,1.83259487,0,0,0.7933531,0.6087617,7200,100,1), +(@GUID+3,176213,0,1,1,1748.16333,-4453.13525,74.26272,-2.0594883,0,0,0,0,7200,100,1), +(@GUID+4,176213,0,1,1,2159.835,-2442.754,62.0804,-0.4886912,0,0,-0.2419214,0.9702958,7200,100,1), +(@GUID+5,176213,0,1,1,1342.557,-1382.568,46.89193,2.775069,0,0,0.9832544,0.182238,7200,100,1); From f34e650fe0f6a2a6c5ade1e71064cd5575a3caf5 Mon Sep 17 00:00:00 2001 From: kaelima Date: Sun, 6 May 2012 02:37:31 +0200 Subject: [PATCH 0681/1149] Core/Accounts: Delete all bans related to an account when it has been deleted. --- src/server/game/Accounts/AccountMgr.cpp | 9 +++++++++ .../shared/Database/Implementation/CharacterDatabase.cpp | 1 + .../shared/Database/Implementation/CharacterDatabase.h | 1 + .../shared/Database/Implementation/LoginDatabase.cpp | 2 +- .../shared/Database/Implementation/LoginDatabase.h | 1 + 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index 9963ade54f9..8076f800356 100755 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -91,10 +91,15 @@ AccountOpResult DeleteAccount(uint32 accountId) stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_TUTORIALS); stmt->setUInt32(0, accountId); CharacterDatabase.Execute(stmt); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ACCOUNT_DATA); stmt->setUInt32(0, accountId); CharacterDatabase.Execute(stmt); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_BAN); + stmt->setUInt32(0, accountId); + CharacterDatabase.Execute(stmt); + SQLTransaction trans = LoginDatabase.BeginTransaction(); stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT); @@ -109,6 +114,10 @@ AccountOpResult DeleteAccount(uint32 accountId) stmt->setUInt32(0, accountId); trans->Append(stmt); + stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_BANNED); + stmt->setUInt32(0, accountId); + trans->Append(stmt); + LoginDatabase.CommitTransaction(trans); return AOR_OK; diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 6bdf3ba9230..d315c6417ea 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -33,6 +33,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_CHAR_CREATE_INFO, "SELECT level, race, class FROM characters WHERE account = ? LIMIT 0, ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_CHARACTER_BAN, "INSERT INTO character_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?, 1)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_CHARACTER_BAN, "UPDATE character_banned SET active = 0 WHERE guid = ? AND active != 0", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_CHARACTER_BAN, "DELETE cb FROM character_banned cb INNER JOIN characters c ON c.guid = cb.guid WHERE c.account = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_BANINFO, "SELECT FROM_UNIXTIME(bandate), unbandate-bandate, active, unbandate, banreason, bannedby FROM character_banned WHERE guid = ? ORDER BY bandate ASC", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_SEL_GUID_BY_NAME_FILTER, "SELECT guid, name FROM characters WHERE name LIKE CONCAT('%%', ?, '%%')", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_SEL_BANINFO_LIST, "SELECT bandate, unbandate, bannedby, banreason FROM character_banned WHERE guid = ? ORDER BY unbandate", CONNECTION_SYNCH) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index d2c9f3b3ac4..cf6bbd7bdfa 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -53,6 +53,7 @@ enum CharacterDatabaseStatements CHAR_SEL_CHAR_CREATE_INFO, CHAR_INS_CHARACTER_BAN, CHAR_UPD_CHARACTER_BAN, + CHAR_DEL_CHARACTER_BAN, CHAR_SEL_BANINFO, CHAR_SEL_GUID_BY_NAME_FILTER, CHAR_SEL_BANINFO_LIST, diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp index 70d874be31d..028d927a720 100755 --- a/src/server/shared/Database/Implementation/LoginDatabase.cpp +++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp @@ -33,6 +33,7 @@ void LoginDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_BANNED_ALL, "SELECT account.id, username FROM account, account_banned WHERE account.id = account_banned.id AND active = 1 GROUP BY account.id", CONNECTION_SYNCH); PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME, "SELECT account.id, username FROM account, account_banned WHERE account.id = account_banned.id AND active = 1 AND username LIKE CONCAT('%%', ?, '%%') GROUP BY account.id", CONNECTION_SYNCH); PREPARE_STATEMENT(LOGIN_INS_ACCOUNT_AUTO_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban', 1)", CONNECTION_ASYNC) + PREPARE_STATEMENT(LOGIN_DEL_ACCOUNT_BANNED, "DELETE FROM account_banned WHERE id = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(LOGIN_SEL_SESSIONKEY, "SELECT a.sessionkey, a.id, aa.gmlevel FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE username = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(LOGIN_UPD_VS, "UPDATE account SET v = ?, s = ? WHERE username = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_UPD_LOGONPROOF, "UPDATE account SET sessionkey = ?, last_ip = ?, last_login = NOW(), locale = ?, failed_logins = 0, os = ? WHERE username = ?", CONNECTION_ASYNC) @@ -86,5 +87,4 @@ void LoginDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_WHOIS, "SELECT username, email, last_ip FROM account WHERE id = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(LOGIN_SEL_REALMLIST_SECURITY_LEVEL, "SELECT allowedSecurityLevel from realmlist WHERE id = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(LOGIN_DEL_ACCOUNT, "DELETE FROM account WHERE id = ?", CONNECTION_ASYNC); - } diff --git a/src/server/shared/Database/Implementation/LoginDatabase.h b/src/server/shared/Database/Implementation/LoginDatabase.h index 2b9d94cbceb..7c2a94eec94 100755 --- a/src/server/shared/Database/Implementation/LoginDatabase.h +++ b/src/server/shared/Database/Implementation/LoginDatabase.h @@ -51,6 +51,7 @@ enum LoginDatabaseStatements LOGIN_SEL_ACCOUNT_BANNED_ALL, LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME, LOGIN_INS_ACCOUNT_AUTO_BANNED, + LOGIN_DEL_ACCOUNT_BANNED, LOGIN_SEL_SESSIONKEY, LOGIN_UPD_VS, LOGIN_UPD_LOGONPROOF, From 85ca26c382914916f71d4c69d62fcbf8cf387dfa Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 5 May 2012 23:37:14 -0230 Subject: [PATCH 0682/1149] DB/SAI: Add SAI for Wrathbone Laborer, fix unit flags, remove cpp script. --- sql/updates/world/2012_05_05_03_world_sai.sql | 17 +++++ .../FrozenHalls/PitOfSaron/pit_of_saron.cpp | 76 ------------------- 2 files changed, 17 insertions(+), 76 deletions(-) create mode 100644 sql/updates/world/2012_05_05_03_world_sai.sql diff --git a/sql/updates/world/2012_05_05_03_world_sai.sql b/sql/updates/world/2012_05_05_03_world_sai.sql new file mode 100644 index 00000000000..fce3b5bc957 --- /dev/null +++ b/sql/updates/world/2012_05_05_03_world_sai.sql @@ -0,0 +1,17 @@ +-- Wrathbone Laborer SAI +SET @ENTRY := 36830; -- NPC entry +SET @SPELL1 := 70302; -- Blinding Dirt +SET @SPELL2 := 70278; -- Puncture Wound (Normal) +SET @SPELL3 := 70279; -- Puncture Wound (Heroic) +SET @SPELL4 := 69572; -- Shovelled! (Normal) +SET @SPELL5 := 70280; -- Shovelled! (Heroic) +UPDATE `creature_template` SET `unit_flags`=`unit_flags`&~256,`AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,6,7000,8000,10000,11000,11,@SPELL1,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Blinding Dirt'), +(@ENTRY,0,1,0,0,0,100,2,8000,9000,9000,10000,11,@SPELL2,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Puncture Wound (Normal)'), +(@ENTRY,0,2,0,0,0,100,4,8000,9000,9000,10000,11,@SPELL3,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Puncture Wound (Heroic)'), +(@ENTRY,0,3,0,0,0,100,2,5000,6000,7000,8000,11,@SPELL4,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Shovelled! (Normal)'), +(@ENTRY,0,4,0,0,0,100,4,5000,6000,7000,8000,11,@SPELL5,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Shovelled! (Heroic)'), +(@ENTRY,0,5,0,1,0,100,6,1000,3000,3000,3000,5,38,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Wrathbone Laborer - OOC - emote'); diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp index 70d72e52e67..b6c821ef66a 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp @@ -25,9 +25,6 @@ enum eSpells SPELL_HELLFIRE = 69586, SPELL_TACTICAL_BLINK = 69584, SPELL_FROST_BREATH = 69527, //Iceborn Proto-Drake - SPELL_BLINDING_DIRT = 70302, //Wrathbone Laborer - SPELL_PUNCTURE_WOUND = 70278, - SPELL_SHOVELLED = 69572, SPELL_LEAPING_FACE_MAUL = 69504, // Geist Ambusher }; @@ -36,11 +33,6 @@ enum eEvents // Ymirjar Flamebearer EVENT_FIREBALL = 1, EVENT_TACTICAL_BLINK = 2, - - //Wrathbone Laborer - EVENT_BLINDING_DIRT = 3, - EVENT_PUNCTURE_WOUND = 4, - EVENT_SHOVELLED = 5, }; class mob_ymirjar_flamebearer : public CreatureScript @@ -157,73 +149,6 @@ class mob_iceborn_protodrake : public CreatureScript } }; -class mob_wrathbone_laborer : public CreatureScript -{ - public: - mob_wrathbone_laborer() : CreatureScript("mob_wrathbone_laborer") { } - - struct mob_wrathbone_laborerAI: public ScriptedAI - { - mob_wrathbone_laborerAI(Creature* creature) : ScriptedAI(creature) - { - } - - void Reset() - { - _events.Reset(); - } - - void EnterCombat(Unit* /*who*/) - { - _events.ScheduleEvent(EVENT_BLINDING_DIRT, 8000); - _events.ScheduleEvent(EVENT_PUNCTURE_WOUND, 9000); - _events.ScheduleEvent(EVENT_SHOVELLED, 5000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - _events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = _events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_BLINDING_DIRT: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 10.0f, true)) - DoCast(target, SPELL_BLINDING_DIRT); - _events.RescheduleEvent(EVENT_BLINDING_DIRT, 10000); - return; - case EVENT_PUNCTURE_WOUND: - DoCastVictim(SPELL_PUNCTURE_WOUND); - _events.RescheduleEvent(EVENT_PUNCTURE_WOUND, 9000); - return; - case EVENT_SHOVELLED: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, -5.0f)) - DoCast(target, SPELL_SHOVELLED); - _events.RescheduleEvent(EVENT_SHOVELLED, 7000); - return; - } - } - - DoMeleeAttackIfReady(); - } - - private: - EventMap _events; - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_wrathbone_laborerAI(creature); - } -}; - class mob_geist_ambusher : public CreatureScript { public: @@ -310,7 +235,6 @@ class spell_trash_mob_glacial_strike : public SpellScriptLoader void AddSC_pit_of_saron() { new mob_ymirjar_flamebearer(); - new mob_wrathbone_laborer(); new mob_iceborn_protodrake(); new mob_geist_ambusher(); new spell_trash_mob_glacial_strike(); From 5d3782bcf9a8ffb33edc27cbb63955e8194e2389 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 5 May 2012 23:39:52 -0230 Subject: [PATCH 0683/1149] DB/creature_template: Some updates for Pit of Saron --- .../2012_05_05_04_world_creature_template.sql | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 sql/updates/world/2012_05_05_04_world_creature_template.sql diff --git a/sql/updates/world/2012_05_05_04_world_creature_template.sql b/sql/updates/world/2012_05_05_04_world_creature_template.sql new file mode 100644 index 00000000000..7c4f13dd667 --- /dev/null +++ b/sql/updates/world/2012_05_05_04_world_creature_template.sql @@ -0,0 +1,27 @@ +-- Fix InhabitType for Eye of the Lich King +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=36913; +-- Updates From CDawg +-- Wrathbone Laborer (heroic) - fix hostility and adds equipment +UPDATE `creature_template` SET `unit_flags`=`unit_flags`&~256,`equipment_id`=104 WHERE `entry`=37638; +-- Wrathbone Siegesmith (Heroic) add equipment +UPDATE `creature_template` SET `equipment_id`=122 WHERE `entry`=37639; +-- Fallen Warrior add equipment +UPDATE `creature_template` SET `equipment_id`=2328 WHERE `entry`=37612; +-- Forgemaster Garfrost add equipment +UPDATE `creature_template` SET `equipment_id`=2325 WHERE `entry`=37613; +-- Deathwhisper Necrolyte add equipment +UPDATE `creature_template` SET `equipment_id`=2365 WHERE `entry`=37609; +-- Deathwhisper Shadowcaster - add equipment +UPDATE `creature_template` SET `equipment_id`=2365 WHERE `entry`=38025; +-- Alliance slaves add equipments +UPDATE `creature_template` SET `equipment_id`=254 WHERE `entry`=37645; +UPDATE `creature_template` SET `equipment_id`=254 WHERE `entry`=37646; +UPDATE `creature_template` SET `equipment_id`=254 WHERE `entry`=37647; +UPDATE `creature_template` SET `equipment_id`=254 WHERE `entry`=37648; +-- horde slaves add equipments +UPDATE `creature_template` SET `equipment_id`=254 WHERE `entry`=37649; +UPDATE `creature_template` SET `equipment_id`=254 WHERE `entry`=37650; +UPDATE `creature_template` SET `equipment_id`=254 WHERE `entry`=37651; +UPDATE `creature_template` SET `equipment_id`=254 WHERE `entry`=37652; +-- Ymirjar Skycaller (heroic) - Fix unit flags and add equipment +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|32832,`equipment_id`=2438 WHERE `entry`=37643; From aa482f7b58fe87c93f8c4f5b4995928ce4436117 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 5 May 2012 23:58:48 -0230 Subject: [PATCH 0684/1149] DB/creature_template: Fix a few target dummys to not allow skillup --- sql/updates/world/2012_05_05_05_world_creature_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_05_05_05_world_creature_template.sql diff --git a/sql/updates/world/2012_05_05_05_world_creature_template.sql b/sql/updates/world/2012_05_05_05_world_creature_template.sql new file mode 100644 index 00000000000..a2f2a217252 --- /dev/null +++ b/sql/updates/world/2012_05_05_05_world_creature_template.sql @@ -0,0 +1,2 @@ +-- Fix skillup on some target dummys +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|262144 WHERE `entry` IN (31144,2674,2673); From 2c4faaadf6cceada6c673f475fea34b670684a42 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 6 May 2012 00:34:39 -0230 Subject: [PATCH 0685/1149] DB/SAI: Updated SAI for Wrathbone Laborer. Was never aware of the dbc spell geek thing. --- sql/updates/world/2012_05_05_06_world_sai.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 sql/updates/world/2012_05_05_06_world_sai.sql diff --git a/sql/updates/world/2012_05_05_06_world_sai.sql b/sql/updates/world/2012_05_05_06_world_sai.sql new file mode 100644 index 00000000000..7b064af4a4e --- /dev/null +++ b/sql/updates/world/2012_05_05_06_world_sai.sql @@ -0,0 +1,13 @@ +-- Wrathbone Laborer SAI +SET @ENTRY := 36830; -- NPC entry +SET @SPELL1 := 70302; -- Blinding Dirt +SET @SPELL2 := 70278; -- Puncture Wound +SET @SPELL3 := 69572; -- Shovelled! +UPDATE `creature_template` SET `unit_flags`=`unit_flags`&~256,`AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,6,7000,8000,10000,11000,11,@SPELL1,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Blinding Dirt'), +(@ENTRY,0,1,0,0,0,100,6,8000,9000,9000,10000,11,@SPELL2,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Puncture Wound (Normal)'), +(@ENTRY,0,2,0,0,0,100,6,5000,6000,7000,8000,11,@SPELL3,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Shovelled! (Normal)'), +(@ENTRY,0,3,0,1,0,100,6,1000,3000,3000,3000,5,38,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Wrathbone Laborer - OOC - emote'); From 97a772e1cf03a348a7ce233f4d5f0ef31c039b76 Mon Sep 17 00:00:00 2001 From: gecko32 Date: Sun, 6 May 2012 11:30:03 +0200 Subject: [PATCH 0686/1149] DB/Loot: Add missing gold drops to ToC Partial fix for #5449 --- sql/updates/world/2012_05_06_00_world_creature_template.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/2012_05_06_00_world_creature_template.sql diff --git a/sql/updates/world/2012_05_06_00_world_creature_template.sql b/sql/updates/world/2012_05_06_00_world_creature_template.sql new file mode 100644 index 00000000000..30dbf85c28d --- /dev/null +++ b/sql/updates/world/2012_05_06_00_world_creature_template.sql @@ -0,0 +1,5 @@ +-- Gold for Toc based on old.wowhead +UPDATE `creature_template` SET `mingold`=850000,`maxgold`=950000 WHERE `entry` IN(34797,35447,35448,35449); -- Icehowl +UPDATE `creature_template` SET `mingold`=550000,`maxgold`=650000 WHERE `entry` IN(34780,35216,35268,35269); -- Lord Jaraxxus +UPDATE `creature_template` SET `mingold`=650000,`maxgold`=700000 WHERE `entry` IN(34497,35350,35351,35352,34496,35347,35348,35359); -- Fjola Lightbane & Eydis Darkbane +UPDATE `creature_template` SET `mingold`=500000,`maxgold`=600000 WHERE `entry` IN(34564,34566,35615,35616); -- Anub'arak From 5a291149c1288b338c96c951e92ad9dde2c61732 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sun, 6 May 2012 11:48:25 +0200 Subject: [PATCH 0687/1149] DB/Loot: Add gold drops to Ulduar Closes #5449 --- .../world/2012_05_06_01_world_creature_template.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 sql/updates/world/2012_05_06_01_world_creature_template.sql diff --git a/sql/updates/world/2012_05_06_01_world_creature_template.sql b/sql/updates/world/2012_05_06_01_world_creature_template.sql new file mode 100644 index 00000000000..fa0c9af5805 --- /dev/null +++ b/sql/updates/world/2012_05_06_01_world_creature_template.sql @@ -0,0 +1,11 @@ +-- Based on old.wowhead.com +UPDATE `creature_template` SET `mingold`=1600000,`maxgold`=1800000 WHERE `entry` IN (33113,34003); -- Flame Levithian +UPDATE `creature_template` SET `mingold`=1100000,`maxgold`=1300000 WHERE `entry` IN (33118,33190); -- Ignis the Furnace Master +UPDATE `creature_template` SET `mingold`=280000,`maxgold`=360000 WHERE `entry` IN (33186,33724); -- Razorscale +UPDATE `creature_template` SET `mingold`=670000,`maxgold`=750000 WHERE `entry` IN (33293,33885); -- XT-002 Deconstructor +UPDATE `creature_template` SET `mingold`=1680000,`maxgold`=1900000 WHERE `entry` IN (32857,33694); -- Stormcaller Brundir +UPDATE `creature_template` SET `mingold`=1680000,`maxgold`=1900000 WHERE `entry` IN (32927,33692); -- Runemaster Molgeim +UPDATE `creature_template` SET `mingold`=1680000,`maxgold`=1900000 WHERE `entry` IN (32867,33693); -- Steelbreaker +UPDATE `creature_template` SET `mingold`=1220000,`maxgold`=1500000 WHERE `entry` IN (33515,34175); -- Auriaya +UPDATE `creature_template` SET `mingold`=1650000,`maxgold`=1950000 WHERE `entry` IN (33271,33449); -- General Vezax +UPDATE `creature_template` SET `mingold`=2020000,`maxgold`=2220000 WHERE `entry` IN (33288,33955); -- Yogg-Saron From 7be70393e5b63118af0f5bad812b410d57d35fac Mon Sep 17 00:00:00 2001 From: kaelima Date: Mon, 7 May 2012 14:33:24 +0200 Subject: [PATCH 0688/1149] Movement/WaypointGenerator: Fix issue where waypoints with delay always would turn to 0.0 orientation --- .../MovementGenerators/WaypointMovementGenerator.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index 81fe1606ede..25730f92161 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -107,7 +107,7 @@ bool WaypointMovementGenerator::StartMove(Creature &creature) i_currentNode = (i_currentNode+1) % i_path->size(); } - const WaypointData *node = i_path->at(i_currentNode); + WaypointData const* node = i_path->at(i_currentNode); m_isArrivalDone = false; @@ -116,7 +116,8 @@ bool WaypointMovementGenerator::StartMove(Creature &creature) Movement::MoveSplineInit init(creature); init.MoveTo(node->x, node->y, node->z); - if (node->orientation != 100 && node->delay != 0) + //! Accepts angles such as 0.00001 and -0.00001, 0 must be ignored, default value in waypoint table + if (node->orientation && node->delay) init.SetFacing(node->orientation); init.SetWalk(!node->run); From 5378d2eb48097fd50cd367ee191fae99fbd11e75 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 May 2012 11:00:56 -0230 Subject: [PATCH 0689/1149] DB/waypoints: A few missing paths for pit of saron --- .../world/2012_05_07_00_world_waypoints.sql | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sql/updates/world/2012_05_07_00_world_waypoints.sql diff --git a/sql/updates/world/2012_05_07_00_world_waypoints.sql b/sql/updates/world/2012_05_07_00_world_waypoints.sql new file mode 100644 index 00000000000..f24b7c9c254 --- /dev/null +++ b/sql/updates/world/2012_05_07_00_world_waypoints.sql @@ -0,0 +1,73 @@ +-- Wrathbone Siegesmith pathing +SET @NPC := 202159; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=646.5851,`position_y`=-191.1892,`position_z`=526.8476 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,646.5851,-191.1892,526.8476,0,0,0,100,0), +(@PATH,2,648.8837,-181.967,526.7226,0,0,0,100,0), +(@PATH,3,649.4167,-179.4531,526.7226,14000,0,0,100,0), +(@PATH,4,652.1736,-183.3594,526.7226,0,0,0,100,0), +(@PATH,5,648.5643,-188.309,526.8476,0,0,0,100,0), +(@PATH,6,642.5313,-193.4826,527.3874,0,0,0,100,0), +(@PATH,7,633.688,-200.741,528.941,12000,0,0,100,0), +(@PATH,8,641.9254,-196.5747,528.9726,0,0,0,100,0); + +-- Wrathbone Siegesmith pathing +SET @NPC := 201855; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=723.5469,`position_y`=-170.9497,`position_z`=527.5121 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,723.5469,-170.9497,527.5121,13000,0,0,100,0), +(@PATH,2,726.6484,-173.3438,527.1627,0,0,0,100,0), +(@PATH,3,726.6484,-174.3438,527.1627,0,0,0,100,0), +(@PATH,4,725.25,-175.2379,526.8134,0,0,0,100,0), +(@PATH,5,722.0521,-181.5122,526.8134,0,0,0,100,0), +(@PATH,6,721.2031,-187.8142,526.8134,0,0,0,100,0), +(@PATH,7,717.7917,-194.4358,526.8134,0,0,0,100,0), +(@PATH,8,719.3073,-202.2691,527.1509,0,0,0,100,0), +(@PATH,9,720.3403,-206.1198,527.7932,12000,0,0,100,0), +(@PATH,10,717.6111,-199.5035,526.9384,0,0,0,100,0), +(@PATH,11,717.566,-189.0642,526.8134,0,0,0,100,0), +(@PATH,12,718.5764,-182.3958,526.8134,0,0,0,100,0), +(@PATH,13,719.9531,-176.0729,526.8134,0,0,0,100,0); + +-- Forgemaster Garfrost pathing +SET @NPC := 201992; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=712.1371,`position_y`=-215.7014,`position_z`=527.066 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`auras`) VALUES (@NPC,@PATH,1,'68792'); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,712.1371,-215.7014,527.066,0,0,0,100,0), +(@PATH,2,719.507,-227.8559,527.066,3000,0,0,100,0), +(@PATH,3,712.1371,-215.7014,527.066,0,0,0,100,0), +(@PATH,4,685.1805,-207.349,526.8424,0,0,0,100,0), +(@PATH,5,664.5191,-203.3472,526.816,0,0,0,100,0), +(@PATH,6,645.033,-208.5295,528.941,0,0,0,100,0), +(@PATH,7,653.0729,-194.3681,526.7226,0,0,0,100,0), +(@PATH,8,664.8646,-195.2135,526.7226,0,0,0,100,0), +(@PATH,9,686.0816,-213.8264,526.8424,0,0,0,100,0), +(@PATH,10,697.9757,-221.6215,526.8424,0,0,0,100,0), +(@PATH,11,708.0903,-211.908,527.066,0,0,0,100,0), +(@PATH,12,717.8924,-204.6979,527.191,0,0,0,100,0), +(@PATH,13,699.0504,-201.3438,526.8424,0,0,0,100,0), +(@PATH,14,672.066,-201.1493,526.8424,0,0,0,100,0), +(@PATH,15,655.9496,-203.4931,526.816,0,0,0,100,0), +(@PATH,16,672.066,-201.1493,526.8424,0,0,0,100,0), +(@PATH,17,699.0504,-201.3438,526.8424,0,0,0,100,0), +(@PATH,18,717.8924,-204.6979,527.191,0,0,0,100,0), +(@PATH,19,708.0903,-211.908,527.066,0,0,0,100,0), +(@PATH,20,697.9757,-221.6215,526.8424,0,0,0,100,0), +(@PATH,21,686.0816,-213.8264,526.8424,0,0,0,100,0), +(@PATH,22,664.8646,-195.2135,526.7226,0,0,0,100,0), +(@PATH,23,653.0729,-194.3681,526.7226,0,0,0,100,0), +(@PATH,24,645.033,-208.5295,528.941,0,0,0,100,0), +(@PATH,25,664.5191,-203.3472,526.816,0,0,0,100,0), +(@PATH,26,685.1805,-207.349,526.8424,0,0,0,100,0); From f4b629a61d4800a0aa40b3942d6f5c749819257f Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 May 2012 16:12:04 -0230 Subject: [PATCH 0690/1149] DB/SAI: Some misc fixes for Pit of Saron --- sql/updates/world/2012_05_07_01_world_sai.sql | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 sql/updates/world/2012_05_07_01_world_sai.sql diff --git a/sql/updates/world/2012_05_07_01_world_sai.sql b/sql/updates/world/2012_05_07_01_world_sai.sql new file mode 100644 index 00000000000..83676d31df9 --- /dev/null +++ b/sql/updates/world/2012_05_07_01_world_sai.sql @@ -0,0 +1,51 @@ +-- Ymirjar Skycaller SAI addition +SET @ENTRY := 31260; -- NPC entry +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY AND `id`=2; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,2,0,25,0,100,6,0,0,0,0,11,46598,0,0,0,0,0,19,36891,20,0,0,0,0,0, 'Ymirjar Skycaller - Reset - Cast Ride Vehicle Hardcoded'); + +-- Wrathbone Laborer SAI +SET @ENTRY := -201800; -- NPC entry +SET @SPELL1 := 70302; -- Blinding Dirt +SET @SPELL2 := 70278; -- Puncture Wound +SET @SPELL3 := 69572; -- Shovelled! +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,6,7000,8000,10000,11000,11,@SPELL1,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Blinding Dirt'), +(@ENTRY,0,1,0,0,0,100,6,8000,9000,9000,10000,11,@SPELL2,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Puncture Wound (Normal)'), +(@ENTRY,0,2,0,0,0,100,6,5000,6000,7000,8000,11,@SPELL3,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Shovelled! (Normal)'); + +-- Wrathbone Laborer pathing +SET @NPC := 201800; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=584.4202,`position_y`=188.9149,`position_z`=509.6726 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,584.4202,188.9149,509.6726,0,0,0,100,0), +(@PATH,2,583.6736,193.9653,509.7404,3000,0,48,100,0), +(@PATH,3,583.6736,193.9653,509.7404,3000,0,48,100,0), +(@PATH,4,583.6736,193.9653,509.7404,3000,0,48,100,0), +(@PATH,5,583.6736,193.9653,509.7404,3000,0,48,100,0), +(@PATH,6,594.0781,190.2622,508.8613,0,0,0,100,0), +(@PATH,7,604.9809,191.5451,507.6583,0,0,0,100,0), +(@PATH,8,617.8438,191.3455,507.5206,0,0,0,100,0), +(@PATH,9,633.1597,186.8281,508.6275,3000,0,48,100,0), +(@PATH,10,633.1597,186.8281,508.6275,3000,0,48,100,0), +(@PATH,11,624.3472,190.9705,507.7706,0,0,0,100,0), +(@PATH,12,613.3229,189.9236,507.3956,0,0,0,100,0), +(@PATH,13,604.5156,189.651,507.3956,0,0,0,100,0), +(@PATH,14,593.9844,187.4479,508.9778,0,0,0,100,0), +(@PATH,15,584.4202,188.9149,509.6726,0,0,0,100,0); +DELETE FROM `waypoint_scripts` WHERE `id`=48; +INSERT INTO `waypoint_scripts` (`id`,`delay`,`command`,`datalong`,`guid`) VALUES +(48,0,1,38,67); + +-- Add Overlord Drakuru riders to Stonespine Gargoyle +UPDATE creature_template SET InhabitType=4,`flags_extra`=`flags_extra`|128 WHERE entry=28717; +DELETE FROM `creature` WHERE `id`=28717 AND `map`=658; +DELETE FROM `vehicle_template_accessory` WHERE `entry`=36896; +INSERT INTO `vehicle_template_accessory` (`entry`,`accessory_entry`,`seat_id`,`minion`,`description`,`summontype`,`summontimer`) VALUES +(36896,28717,1,0, 'Overlord Drakuru on Stonespine Gargoyle',6,30000); From fdc4f679215912e21cdaa643a3cb81c203f94bb6 Mon Sep 17 00:00:00 2001 From: Discover- Date: Tue, 8 May 2012 00:10:09 +0200 Subject: [PATCH 0691/1149] Database/Quests: Script quest Arelion's Mistress. Closes #3120 --- sql/updates/world/2012_05_08_00_world_sai.sql | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 sql/updates/world/2012_05_08_00_world_sai.sql diff --git a/sql/updates/world/2012_05_08_00_world_sai.sql b/sql/updates/world/2012_05_08_00_world_sai.sql new file mode 100644 index 00000000000..8a776b5f2d2 --- /dev/null +++ b/sql/updates/world/2012_05_08_00_world_sai.sql @@ -0,0 +1,89 @@ +-- [Q] Arelion's Mistress +-- Viera Sunwhisper SAI +-- Twinkle SAI +SET @ENTRY_VIERA := 17226; +SET @ENTRY_TWINKLE := 17230; +SET @QUEST_PLEASURES := 9483; +SET @SPELL_RETRIBUTION := 30077; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@ENTRY_VIERA,@ENTRY_TWINKLE); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY_VIERA,@ENTRY_TWINKLE,@ENTRY_VIERA*100,@ENTRY_VIERA*100+1); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY_VIERA,0,0,0,20,0,100,0,@QUEST_PLEASURES,0,0,0,80,@ENTRY_VIERA*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On Quest Finish - Run Script'), +(@ENTRY_VIERA*100,9,0,0,0,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Viera Sunwhisper - On Script - Remove Quest Flag"), +(@ENTRY_VIERA*100,9,1,0,0,0,100,0,2000,2000,0,0,53,0,@ENTRY_VIERA,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On Script - Start WP 1'), +(@ENTRY_VIERA*100,9,2,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'Viera Sunwhisper - On Script - Say Line 0'), +(@ENTRY_VIERA*100,9,3,0,0,0,100,0,0,0,0,0,91,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On Script - Stand Up'), +(@ENTRY_VIERA*100,9,4,0,0,0,100,0,6500,6500,0,0,45,0,1,0,0,0,0,10,61963,@ENTRY_TWINKLE,0,0,0,0,0,'Viera Sunwhisper - On Script - Set Data 0 1 Twinkle'), +(@ENTRY_VIERA,0,1,2,40,0,100,0,10,@ENTRY_VIERA,0,0,66,0,0,0,0,0,0,11,@ENTRY_TWINKLE,15,0,0,0,0,0,'Viera Sunwhisper - On WP 10 - Face Twinkle'), +(@ENTRY_VIERA,0,2,0,61,0,100,0,0,0,0,0,54,1000000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On WP 10 - Pause WP'), + +(@ENTRY_TWINKLE,0,0,0,38,0,100,0,0,1,0,0,53,1,@ENTRY_TWINKLE,0,0,0,0,1,0,0,0,0,0,0,0,'Twinkle - On Data 0 1 Set - Start WP 1 (run)'), +(@ENTRY_TWINKLE,0,1,0,40,0,100,0,13,@ENTRY_TWINKLE,0,0,54,1000000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Twinkle - On WP 13 - Pause WP'), +(@ENTRY_TWINKLE,0,2,0,38,0,100,0,1,2,0,0,53,1,@ENTRY_TWINKLE*10,0,0,0,0,1,0,0,0,0,0,0,0,'Twinkle - On Data Set 1 2 - Start WP 2 (run)'), +(@ENTRY_TWINKLE,0,3,0,40,0,100,0,4,@ENTRY_TWINKLE*10,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On WP 4 (2) - Force Despawn'), + +(@ENTRY_VIERA,0,3,0,8,0,100,0,@SPELL_RETRIBUTION,0,0,0,80,@ENTRY_VIERA*100+1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On Spellhit - Run Second Script'), +(@ENTRY_VIERA*100+1,9,0,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On Script - Say Line 1'), +(@ENTRY_VIERA*100+1,9,1,0,0,0,100,0,0,0,0,0,33,@ENTRY_VIERA,0,0,0,0,0,7,0,0,0,0,0,0,0,'Viera Sunwhisper - On Script - Quest Credit'), +(@ENTRY_VIERA*100+1,9,2,0,0,0,100,0,3000,3000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On Script - Say Line 2'), +(@ENTRY_VIERA*100+1,9,3,0,0,0,100,0,5000,5000,0,0,1,0,0,0,0,0,0,9,@ENTRY_TWINKLE,0,25,0,0,0,0,'Twinkle - On Script - Say Line 0'), +(@ENTRY_VIERA*100+1,9,4,0,0,0,100,0,2000,2000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On Script - Say Line 3'), +(@ENTRY_VIERA*100+1,9,5,0,0,0,100,0,0,0,0,0,45,1,2,0,0,0,0,10,61963,@ENTRY_TWINKLE,0,0,0,0,0,'Viera Sunwhisper - On Script - Set Data 1 2 Twinkle'), +(@ENTRY_VIERA*100+1,9,6,0,0,0,100,0,0,0,0,0,53,1,@ENTRY_VIERA*10,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On Script - Start WP 2 (run)'), +(@ENTRY_VIERA,0,4,0,40,0,100,0,4,@ENTRY_VIERA*10,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On WP 4 (2) - Force Despawn'); + +-- Waypoints for Viera Sunwhisper +DELETE FROM `waypoints` WHERE `entry` IN (@ENTRY_VIERA,@ENTRY_VIERA*10); +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY_VIERA,1,-653.739197,4145.138184,64.200729,'Viera Sunwhisper'), +(@ENTRY_VIERA,2,-658.875732,4147.715332,64.168304,'Viera Sunwhisper'), +(@ENTRY_VIERA,3,-681.465088,4147.636230,64.118073,'Viera Sunwhisper'), +(@ENTRY_VIERA,4,-686.400696,4161.865234,59.707859,'Viera Sunwhisper'), +(@ENTRY_VIERA,5,-695.956909,4179.237305,57.618931,'Viera Sunwhisper'), +(@ENTRY_VIERA,6,-699.832153,4189.959473,57.503750,'Viera Sunwhisper'), +(@ENTRY_VIERA,7,-708.518616,4184.436035,55.275894,'Viera Sunwhisper'), +(@ENTRY_VIERA,8,-716.137268,4178.130371,52.637508,'Viera Sunwhisper'), +(@ENTRY_VIERA,9,-719.865295,4174.992676,51.554867,'Viera Sunwhisper'), +(@ENTRY_VIERA,10,-720.839417,4162.232422,50.805923,'Viera Sunwhisper'), + +(@ENTRY_VIERA*10,1,-722.323486,4147.936523,50.337898,'Viera Sunwhisper'), +(@ENTRY_VIERA*10,2,-726.639343,4125.156250,48.479683,'Viera Sunwhisper'), +(@ENTRY_VIERA*10,3,-727.648315,4109.684082,47.528461,'Viera Sunwhisper'), +(@ENTRY_VIERA*10,4,-727.874329,4093.438721,46.446579,'Viera Sunwhisper'); + +-- Waypoints for Twinkle +DELETE FROM `waypoints` WHERE `entry` IN (@ENTRY_TWINKLE,@ENTRY_TWINKLE*10); +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY_TWINKLE,1,-605.445190,4165.205078,64.081802,'Twinkle'), +(@ENTRY_TWINKLE,2,-619.293335,4161.776855,63.217815,'Twinkle'), +(@ENTRY_TWINKLE,3,-629.536560,4153.708984,64.067123,'Twinkle'), +(@ENTRY_TWINKLE,4,-644.773438,4151.062988,64.174675,'Twinkle'), +(@ENTRY_TWINKLE,5,-658.875732,4147.715332,64.168304,'Twinkle'), +(@ENTRY_TWINKLE,6,-681.465088,4147.636230,64.118073,'Twinkle'), +(@ENTRY_TWINKLE,7,-686.400696,4161.865234,59.707859,'Twinkle'), +(@ENTRY_TWINKLE,8,-695.956909,4179.237305,57.618931,'Twinkle'), +(@ENTRY_TWINKLE,9,-699.832153,4189.959473,57.503750,'Twinkle'), +(@ENTRY_TWINKLE,10,-708.518616,4184.436035,55.275894,'Twinkle'), +(@ENTRY_TWINKLE,11,-716.137268,4178.130371,52.637508,'Twinkle'), +(@ENTRY_TWINKLE,12,-719.865295,4174.992676,51.554867,'Twinkle'), +(@ENTRY_TWINKLE,13,-720.636292,4166.637695,50.815567,'Twinkle'), + +(@ENTRY_TWINKLE*10,1,-722.323486,4147.936523,50.337898,'Twinkle'), +(@ENTRY_TWINKLE*10,2,-726.639343,4125.156250,48.479683,'Twinkle'), +(@ENTRY_TWINKLE*10,3,-727.648315,4109.684082,47.528461,'Twinkle'), +(@ENTRY_TWINKLE*10,4,-727.874329,4093.438721,46.446579,'Twinkle'); + +-- Spawn spell focus object on correct position +DELETE FROM `gameobject` WHERE `id`=300071 AND `guid`=303; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(303,300071,530,1,1,-720.803,4162.77,50.7916,4.61029,0,0,0.742267,-0.670104,300,0,1); + +-- Texts +DELETE FROM `creature_text` WHERE `entry` IN (@ENTRY_VIERA,@ENTRY_TWINKLE); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY_VIERA,0,0,"Ok, let's go. I know just the perfect spot!",12,0,100,0,0,0,'Viera Sunwhisper'), +(@ENTRY_VIERA,1,0,"I can't wait to try this wine!",12,0,100,0,0,0,'Viera Sunwhisper'), +(@ENTRY_VIERA,2,0,"What... is happening... to me? Get this cat away from me!",12,0,100,0,0,0,'Viera Sunwhisper'), +(@ENTRY_VIERA,3,0,"%s scurries away, attempting to flee from Twinkle",16,0,100,0,0,0,'Viera Sunwhisper'), + +(@ENTRY_TWINKLE,0,0,"%s looks at Viera Sunwhisper with very hungry eyes",16,0,100,0,0,0,'Twinkle'); From 7386aafaf618af00d30521f106ada59ac4833c03 Mon Sep 17 00:00:00 2001 From: Svannon Date: Mon, 7 May 2012 16:57:28 -0600 Subject: [PATCH 0692/1149] Core/AI - Fix Evade Bug --- .../game/Movement/MovementGenerators/HomeMovementGenerator.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp index 311b69c06b7..a8bdb698432 100755 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp @@ -25,7 +25,6 @@ void HomeMovementGenerator::Initialize(Creature & owner) { - owner.AddUnitState(UNIT_STATE_EVADE); _setTargetLocation(owner); } From 51ed0525ae5a2315589c4ae3be609539312dd529 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 May 2012 20:49:04 -0230 Subject: [PATCH 0693/1149] DB/gameobject: Add missing Ice Wall spawn to Pit of Saron. --- sql/updates/world/2012_05_08_01_world_gameobject.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/2012_05_08_01_world_gameobject.sql diff --git a/sql/updates/world/2012_05_08_01_world_gameobject.sql b/sql/updates/world/2012_05_08_01_world_gameobject.sql new file mode 100644 index 00000000000..e6fc74a5e80 --- /dev/null +++ b/sql/updates/world/2012_05_08_01_world_gameobject.sql @@ -0,0 +1,5 @@ +-- Add Missing Ice Wall, Pit of Saron +SET @GUID := 303; +DELETE FROM `gameobject` WHERE `guid`=@GUID; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(@GUID,201885,658,3,1,932.2674,-80.6684,591.6761,2.286379,0,0,0,0,300,100,1); From 2956631f82989a6777c231b0c02999651050161a Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 May 2012 21:01:54 -0230 Subject: [PATCH 0694/1149] DB/gameobject: Change guid, Discovered is my nemisis! --- sql/updates/world/2012_05_08_01_world_gameobject.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/updates/world/2012_05_08_01_world_gameobject.sql b/sql/updates/world/2012_05_08_01_world_gameobject.sql index e6fc74a5e80..b83d02b4762 100644 --- a/sql/updates/world/2012_05_08_01_world_gameobject.sql +++ b/sql/updates/world/2012_05_08_01_world_gameobject.sql @@ -1,5 +1,5 @@ -- Add Missing Ice Wall, Pit of Saron -SET @GUID := 303; +SET @GUID := 305; DELETE FROM `gameobject` WHERE `guid`=@GUID; INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES (@GUID,201885,658,3,1,932.2674,-80.6684,591.6761,2.286379,0,0,0,0,300,100,1); From 5b02191a1d217b2d035415815e080ba827caa686 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 May 2012 21:26:56 -0230 Subject: [PATCH 0695/1149] DB/Misc: Updates for Pit of Saron. --- sql/updates/world/2012_05_08_01_world_misc.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sql/updates/world/2012_05_08_01_world_misc.sql diff --git a/sql/updates/world/2012_05_08_01_world_misc.sql b/sql/updates/world/2012_05_08_01_world_misc.sql new file mode 100644 index 00000000000..8f19132fa27 --- /dev/null +++ b/sql/updates/world/2012_05_08_01_world_misc.sql @@ -0,0 +1,9 @@ +-- Spell area spells for entering POS +DELETE FROM `spell_area` WHERE `spell` IN (70056,70057); +INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`) VALUES +(70056,4904,0,0,0,0,690,2,1), -- Send Script Event (22717) +(70057,4904,0,0,0,0,1101,2,1); -- Send Script Event (22718) + +-- Fix flags and equipment for Ymirjar Deathbringer +UPDATE `creature_template` SET `unit_flags`=`unit_flags`&~256 WHERE `entry` IN (36892,37641); +UPDATE `creature_template` SET `equipment_id`=2444 WHERE `entry`=37641; From d2a33afc373e5c56a222a59a7ce7701864821dc8 Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 8 May 2012 09:15:52 -0400 Subject: [PATCH 0696/1149] Core/Items: fix deletion of items when the bag they are in gets deleted on load. also checks for items that have no real bag for possible expoits. --- src/server/game/Entities/Player/Player.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 7c70fe9358e..c285d8df788 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -17606,6 +17606,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) uint32 zoneId = GetZoneId(); std::map bagMap; // fast guid lookup for bags + std::map invalidBagMap; // fast guid lookup for bags std::list problematicItems; SQLTransaction trans = CharacterDatabase.BeginTransaction(); @@ -17650,9 +17651,15 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) // Remember bags that may contain items in them if (err == EQUIP_ERR_OK) + { if (IsBagPos(item->GetPos())) if (Bag* pBag = item->ToBag()) bagMap[item->GetGUIDLow()] = pBag; + } + else + if (IsBagPos(item->GetPos())) + if (Bag* pBag = item->ToBag()) + invalidBagMap[item->GetGUIDLow()] = pBag; } else { @@ -17666,6 +17673,17 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) if (err == EQUIP_ERR_OK) item = StoreItem(dest, item, true); } + else if (invalidBagMap.find(bagGuid) != invalidBagMap.end() && std::find(problematicItems.begin(),problematicItems.end(),(*invalidBagMap.find(bagGuid)))) + err = EQUIP_ERR_INT_BAG_ERROR; + else + { + sLog->outError("Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) which doesnt have a valid bag (Bag GUID: %u, slot: %u). Possible cheat?", + GetGUIDLow(), GetName(), item->GetGUIDLow(), item->GetEntry(), bagGuid, slot); + item->DeleteFromInventoryDB(trans); + delete item; + continue; + } + } // Item's state may have changed after storing From 6c15bee88415006efe7111b6f7febd70b9a2ca50 Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 8 May 2012 09:17:04 -0400 Subject: [PATCH 0697/1149] Core/AI: fix the call to help handler to use distance from the npc and not the victim of the npc. (thx shauren) --- src/server/game/Grids/Notifiers/GridNotifiers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index e81822e72be..6ca31b22e37 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -972,7 +972,7 @@ namespace Trinity return; // too far - if (!u->IsWithinDistInMap(i_enemy, i_range)) + if (!u->IsWithinDistInMap(i_funit, i_range)) return; // only if see assisted creature's enemy From 5fc2c8cda37151520cd1ac26def420c978dc54dd Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 8 May 2012 10:06:38 -0400 Subject: [PATCH 0698/1149] Core/Items: fix compile error from previous commit. use item instead of bag. --- src/server/game/Entities/Player/Player.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index c285d8df788..d38489ef5a9 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -17606,7 +17606,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) uint32 zoneId = GetZoneId(); std::map bagMap; // fast guid lookup for bags - std::map invalidBagMap; // fast guid lookup for bags + std::map invalidBagMap; // fast guid lookup for bags std::list problematicItems; SQLTransaction trans = CharacterDatabase.BeginTransaction(); @@ -17659,7 +17659,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) else if (IsBagPos(item->GetPos())) if (Bag* pBag = item->ToBag()) - invalidBagMap[item->GetGUIDLow()] = pBag; + invalidBagMap[item->GetGUIDLow()] = item; } else { @@ -17673,8 +17673,12 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) if (err == EQUIP_ERR_OK) item = StoreItem(dest, item, true); } - else if (invalidBagMap.find(bagGuid) != invalidBagMap.end() && std::find(problematicItems.begin(),problematicItems.end(),(*invalidBagMap.find(bagGuid)))) + else if (invalidBagMap.find(bagGuid) != invalidBagMap.end()) + { + std::map::iterator itr = invalidBagMap.find(bagGuid); + if (std::find(problematicItems.begin(),problematicItems.end(),itr->second) != problematicItems.end()) err = EQUIP_ERR_INT_BAG_ERROR; + } else { sLog->outError("Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) which doesnt have a valid bag (Bag GUID: %u, slot: %u). Possible cheat?", From 1af30a9ea24f90abaefeb0782ccbd40d376da3ce Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 9 May 2012 01:48:18 +0200 Subject: [PATCH 0699/1149] Scripts/Wormhole: Add rare 6th option to "Underground". Fixed some teleport positions (from sniffs) And made some random cleanup for npc_shadowfiend and npc_lightwell --- ...2_05_09_00_world_spell_target_position.sql | 7 + src/server/scripts/World/npcs_special.cpp | 203 +++++++++--------- 2 files changed, 109 insertions(+), 101 deletions(-) create mode 100644 sql/updates/world/2012_05_09_00_world_spell_target_position.sql diff --git a/sql/updates/world/2012_05_09_00_world_spell_target_position.sql b/sql/updates/world/2012_05_09_00_world_spell_target_position.sql new file mode 100644 index 00000000000..a6e9d7289b7 --- /dev/null +++ b/sql/updates/world/2012_05_09_00_world_spell_target_position.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_target_position` WHERE `id` IN (67834, 68081); +INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES +(67834, 571, 3167.01, 5586.04, 880.067, 0), +(68081, 571, 5857.252, 516.8015, 599.82, 2.987); + +UPDATE `spell_target_position` SET `target_position_x`=6136.89,`target_position_y`=4785.55,`target_position_z`=100.673 WHERE `id`=67835; +UPDATE `spell_target_position` SET `target_position_x`=8301.39,`target_position_y`=1501.34,`target_position_z`=870.555 WHERE `id`=67836; diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index e1cfd077444..13880d240bf 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1975,33 +1975,31 @@ public: class npc_lightwell : public CreatureScript { -public: - npc_lightwell() : CreatureScript("npc_lightwell") { } + public: + npc_lightwell() : CreatureScript("npc_lightwell") { } - struct npc_lightwellAI : public PassiveAI - { - npc_lightwellAI(Creature* creature) : PassiveAI(creature) {} - - void Reset() + struct npc_lightwellAI : public PassiveAI { - DoCast(me, 59907, false); // Spell for Lightwell Charges - } + npc_lightwellAI(Creature* creature) : PassiveAI(creature) + { + DoCast(me, 59907, false); + } - void EnterEvadeMode() + void EnterEvadeMode() + { + if (!me->isAlive()) + return; + + me->DeleteThreatList(); + me->CombatStop(true); + me->ResetPlayerDamageReq(); + } + }; + + CreatureAI* GetAI(Creature* creature) const { - if (!me->isAlive()) - return; - - me->DeleteThreatList(); - me->CombatStop(true); - me->ResetPlayerDamageReq(); + return new npc_lightwellAI(creature); } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_lightwellAI(creature); - } }; enum eTrainingDummy @@ -2099,34 +2097,26 @@ public: class npc_shadowfiend : public CreatureScript { -public: - npc_shadowfiend() : CreatureScript("npc_shadowfiend") { } + public: + npc_shadowfiend() : CreatureScript("npc_shadowfiend") { } - struct npc_shadowfiendAI : public ScriptedAI - { - npc_shadowfiendAI(Creature* creature) : ScriptedAI(creature) {} - - void DamageTaken(Unit* /*killer*/, uint32& damage) + struct npc_shadowfiendAI : public ScriptedAI { - if (me->isSummon()) - if (Unit* owner = me->ToTempSummon()->GetSummoner()) - if (owner->HasAura(GLYPH_OF_SHADOWFIEND) && damage >= me->GetHealth()) - owner->CastSpell(owner, GLYPH_OF_SHADOWFIEND_MANA, true); - } + npc_shadowfiendAI(Creature* creature) : ScriptedAI(creature) {} - void UpdateAI(uint32 const /*diff*/) + void DamageTaken(Unit* /*killer*/, uint32& damage) + { + if (me->isSummon()) + if (Unit* owner = me->ToTempSummon()->GetSummoner()) + if (owner->HasAura(GLYPH_OF_SHADOWFIEND) && damage >= me->GetHealth()) + owner->CastSpell(owner, GLYPH_OF_SHADOWFIEND_MANA, true); + } + }; + + CreatureAI* GetAI(Creature* creature) const { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); + return new npc_shadowfiendAI(creature); } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_shadowfiendAI(creature); - } }; /*###### @@ -2193,7 +2183,7 @@ public: } }; - CreatureAI *GetAI(Creature* creature) const + CreatureAI* GetAI(Creature* creature) const { return new npc_fire_elementalAI(creature); } @@ -2238,7 +2228,7 @@ public: } }; - CreatureAI *GetAI(Creature* creature) const + CreatureAI* GetAI(Creature* creature) const { return new npc_earth_elementalAI(creature); } @@ -2248,78 +2238,89 @@ public: # npc_wormhole ######*/ -#define GOSSIP_ENGINEERING1 "Borean Tundra." -#define GOSSIP_ENGINEERING2 "Howling Fjord." -#define GOSSIP_ENGINEERING3 "Sholazar Basin." -#define GOSSIP_ENGINEERING4 "Icecrown." -#define GOSSIP_ENGINEERING5 "Storm Peaks." +#define GOSSIP_ENGINEERING1 "Borean Tundra" +#define GOSSIP_ENGINEERING2 "Howling Fjord" +#define GOSSIP_ENGINEERING3 "Sholazar Basin" +#define GOSSIP_ENGINEERING4 "Icecrown" +#define GOSSIP_ENGINEERING5 "Storm Peaks" +#define GOSSIP_ENGINEERING6 "Underground..." -enum eWormhole +enum WormholeSpells { - SPELL_HOWLING_FJORD = 67838, + SPELL_BOREAN_TUNDRA = 67834, SPELL_SHOLAZAR_BASIN = 67835, SPELL_ICECROWN = 67836, SPELL_STORM_PEAKS = 67837, + SPELL_HOWLING_FJORD = 67838, + SPELL_UNDERGROUND = 68081, TEXT_WORMHOLE = 907 }; class npc_wormhole : public CreatureScript { -public: - npc_wormhole() : CreatureScript("npc_wormhole") { } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isSummon()) + public: + npc_wormhole() : CreatureScript("npc_wormhole") { - if (player == creature->ToTempSummon()->GetSummoner()) + showUnderground = urand(0, 100) == 0; // Guessed value, it is really rare though + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isSummon()) { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + if (player == creature->ToTempSummon()->GetSummoner()) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - player->PlayerTalkClass->SendGossipMenu(TEXT_WORMHOLE, creature->GetGUID()); + if (showUnderground) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + + player->PlayerTalkClass->SendGossipMenu(TEXT_WORMHOLE, creature->GetGUID()); + } } + return true; } - return true; - } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - bool roll = urand(0, 1); - - switch (action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { - case GOSSIP_ACTION_INFO_DEF + 1: //Borean Tundra - player->CLOSE_GOSSIP_MENU(); - if (roll) //At the moment we don't have chance on spell_target_position table so we hack this - player->TeleportTo(571, 4305.505859f, 5450.839844f, 63.005806f, 0.627286f); - else - player->TeleportTo(571, 3201.936279f, 5630.123535f, 133.658798f, 3.855272f); - break; - case GOSSIP_ACTION_INFO_DEF + 2: //Howling Fjord - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_HOWLING_FJORD, true); - break; - case GOSSIP_ACTION_INFO_DEF + 3: //Sholazar Basin - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_SHOLAZAR_BASIN, true); - break; - case GOSSIP_ACTION_INFO_DEF + 4: //Icecrown - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_ICECROWN, true); - break; - case GOSSIP_ACTION_INFO_DEF + 5: //Storm peaks - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_STORM_PEAKS, true); - break; + player->PlayerTalkClass->ClearMenus(); + + switch (action) + { + case GOSSIP_ACTION_INFO_DEF + 1: // Borean Tundra + player->CLOSE_GOSSIP_MENU(); + creature->CastSpell(player, SPELL_BOREAN_TUNDRA, false); + break; + case GOSSIP_ACTION_INFO_DEF + 2: // Howling Fjord + player->CLOSE_GOSSIP_MENU(); + creature->CastSpell(player, SPELL_HOWLING_FJORD, false); + break; + case GOSSIP_ACTION_INFO_DEF + 3: // Sholazar Basin + player->CLOSE_GOSSIP_MENU(); + creature->CastSpell(player, SPELL_SHOLAZAR_BASIN, false); + break; + case GOSSIP_ACTION_INFO_DEF + 4: // Icecrown + player->CLOSE_GOSSIP_MENU(); + creature->CastSpell(player, SPELL_ICECROWN, false); + break; + case GOSSIP_ACTION_INFO_DEF + 5: // Storm peaks + player->CLOSE_GOSSIP_MENU(); + creature->CastSpell(player, SPELL_STORM_PEAKS, false); + break; + case GOSSIP_ACTION_INFO_DEF + 6: // Underground + player->CLOSE_GOSSIP_MENU(); + creature->CastSpell(player, SPELL_UNDERGROUND, false); + break; + } + return true; } - return true; - } + private: + bool underGround; }; /*###### @@ -2865,7 +2866,7 @@ public: } }; - CreatureAI *GetAI(Creature* creature) const + CreatureAI* GetAI(Creature* creature) const { return new npc_fireworkAI(creature); } From 7d561c884ee35fc92a48e353a4a1d21b3ef43788 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 9 May 2012 02:25:46 +0200 Subject: [PATCH 0700/1149] Correct typo from 1af30a9ea24f90abaefeb0782ccbd40d376da3ce --- src/server/scripts/World/npcs_special.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 13880d240bf..9b100618235 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -2320,7 +2320,7 @@ class npc_wormhole : public CreatureScript return true; } private: - bool underGround; + bool showUnderground; }; /*###### From d50b23d9f9d06225edc42b10893583d85bd58911 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 9 May 2012 03:08:34 +0200 Subject: [PATCH 0701/1149] Core/Transport: Set GAMEOBJECT_FLAGS from DB for transports, not hardcoded --- src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp | 2 +- src/server/game/Entities/Transport/Transport.cpp | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index 45335ae7b8b..ccc9493e234 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -931,7 +931,7 @@ Transport* BattlegroundIC::CreateTransport(uint32 goEntry, uint32 period) float o = 1; // creates the Gameobject - if (!t->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_MO_TRANSPORT), goEntry, mapid, x, y, z, o, 100, 0)) + if (!t->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_MO_TRANSPORT), goEntry, mapid, x, y, z, o, 255, 0)) { delete t; return NULL; diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 81a505b7acc..9578605ac6f 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -52,7 +52,7 @@ void MapManager::LoadTransports() uint32 period = fields[3].GetUInt32(); uint32 scriptId = sObjectMgr->GetScriptId(fields[4].GetCString()); - const GameObjectTemplate* goinfo = sObjectMgr->GetGameObjectTemplate(entry); + GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(entry); if (!goinfo) { @@ -86,7 +86,7 @@ void MapManager::LoadTransports() float o = 1.0f; // creates the Gameobject - if (!t->Create(lowguid, entry, mapid, x, y, z, o, 100, 0)) + if (!t->Create(lowguid, entry, mapid, x, y, z, o, 255, 0)) { delete t; continue; @@ -217,8 +217,7 @@ bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, floa SetFloatValue(OBJECT_FIELD_SCALE_X, goinfo->size); SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction); - //SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags); - SetUInt32Value(GAMEOBJECT_FLAGS, MAKE_PAIR32(0x28, 0x64)); + SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags); SetUInt32Value(GAMEOBJECT_LEVEL, m_period); SetEntry(goinfo->entry); From cb36825a3abd268470c6c6d70386ae6269ff3d8e Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 9 May 2012 13:49:49 +0200 Subject: [PATCH 0702/1149] Script/Wormhole: Correct randomize logic for underground option --- src/server/scripts/World/npcs_special.cpp | 36 ++++++++++++++++++----- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 9b100618235..ecd1a439a58 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -2254,16 +2254,33 @@ enum WormholeSpells SPELL_HOWLING_FJORD = 67838, SPELL_UNDERGROUND = 68081, - TEXT_WORMHOLE = 907 + TEXT_WORMHOLE = 907, + + DATA_SHOW_UNDERGROUND = 1, }; class npc_wormhole : public CreatureScript { public: - npc_wormhole() : CreatureScript("npc_wormhole") + npc_wormhole() : CreatureScript("npc_wormhole") {} + + struct npc_wormholeAI : public PassiveAI { - showUnderground = urand(0, 100) == 0; // Guessed value, it is really rare though - } + npc_wormholeAI(Creature* creature) : PassiveAI(creature) {} + + void InitializeAI() + { + _showUnderground = urand(0, 100) == 0; // Guessed value, it is really rare though + } + + uint32 GetData(uint32 type) + { + return (type == DATA_SHOW_UNDERGROUND && _showUnderground) ? 1 : 0; + } + + private: + bool _showUnderground; + }; bool OnGossipHello(Player* player, Creature* creature) { @@ -2277,12 +2294,13 @@ class npc_wormhole : public CreatureScript player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - if (showUnderground) + if (creature->AI()->GetData(DATA_SHOW_UNDERGROUND)) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); player->PlayerTalkClass->SendGossipMenu(TEXT_WORMHOLE, creature->GetGUID()); } } + return true; } @@ -2317,10 +2335,14 @@ class npc_wormhole : public CreatureScript creature->CastSpell(player, SPELL_UNDERGROUND, false); break; } + return true; } - private: - bool showUnderground; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_wormholeAI(creature); + } }; /*###### From 1fec4a5af240699758330fa4be0108ba00003878 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 9 May 2012 13:52:31 +0200 Subject: [PATCH 0703/1149] Core/Gameobject: Set artkit once in GameObject::Create --- src/server/game/Entities/GameObject/GameObject.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index f58dd6b2e4d..e871f99b38c 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -222,9 +222,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa // GAMEOBJECT_BYTES_1, index at 0, 1, 2 and 3 SetGoType(GameobjectTypes(goinfo->type)); SetGoState(go_state); - - SetGoArtKit(0); // unknown what this is - SetByteValue(GAMEOBJECT_BYTES_1, 2, artKit); + SetGoArtKit(artKit); switch (goinfo->type) { From d6d45633c8ca34176d066755ba8be182b1ed7ac7 Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 9 May 2012 10:07:18 -0400 Subject: [PATCH 0704/1149] Core/Commands: Add level 3 command for setting npc data. used for testing scripts. --- .../world/2012_05_09_01_world_commands.sql | 8 +++++ src/server/game/Miscellaneous/Language.h | 3 +- src/server/scripts/Commands/cs_npc.cpp | 34 +++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_05_09_01_world_commands.sql diff --git a/sql/updates/world/2012_05_09_01_world_commands.sql b/sql/updates/world/2012_05_09_01_world_commands.sql new file mode 100644 index 00000000000..dcd4c9130eb --- /dev/null +++ b/sql/updates/world/2012_05_09_01_world_commands.sql @@ -0,0 +1,8 @@ +DELETE FROM `trinity_string` WHERE `entry` = 555; +INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES +(555,"SetData performed on [GUID: %u, entry: %u, name: %s] Field: %u, Data: %u, with %s"); + +DELETE FROM `command` WHERE `name` = "npc set data"; +INSERT INTO `command` (`name`,`security`,`help`) VALUES +("npc set data", 3, "Syntax: .npc set data $field $data +Sets data for the selected creature. Used for testing Scripting"); diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 4b07d19bd7a..aec72835d86 100755 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -522,8 +522,9 @@ enum TrinityStrings LANG_YOURS_EXPLORE_SET_ALL = 553, LANG_YOURS_EXPLORE_SET_NOTHING = 554, + LANG_NPC_SETDATA = 555, + //! Old ones now free: - // LANG_HOVER_ENABLED = 555, // LANG_HOVER_DISABLED = 556, LANG_YOURS_LEVEL_UP = 557, diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index a9959c60201..6089d256387 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -73,6 +73,7 @@ public: { "phase", SEC_GAMEMASTER, false, &HandleNpcSetPhaseCommand, "", NULL }, { "spawndist", SEC_GAMEMASTER, false, &HandleNpcSetSpawnDistCommand, "", NULL }, { "spawntime", SEC_GAMEMASTER, false, &HandleNpcSetSpawnTimeCommand, "", NULL }, + { "data", SEC_ADMINISTRATOR, false, &HandleNpcSetDataCommand, "", NULL }, //{ TODO: fix or remove these commands { "name", SEC_GAMEMASTER, false, &HandleNpcSetNameCommand, "", NULL }, { "subname", SEC_GAMEMASTER, false, &HandleNpcSetSubNameCommand, "", NULL }, @@ -524,6 +525,39 @@ public: return true; } + //set data of creature for testing scripting + static bool HandleNpcSetDataCommand(ChatHandler* handler, const char* args) + { + if (!*args) + return false; + + char* arg1 = strtok((char*)args, " "); + char* arg2 = strtok((char*)NULL, ""); + + if (!arg1 || !arg2) + return false; + + uint32 data_1 = (uint32)atoi(arg1); + uint32 data_2 = (uint32)atoi(arg2); + + if (!data_1 || !data_2) + return false; + + Creature* creature = handler->getSelectedCreature(); + + if (!creature) + { + handler->SendSysMessage(LANG_SELECT_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + + creature->AI()->SetData(data_1, data_2); + std::string AIorScript = creature->GetAIName() != "" ? "AI type: " + creature->GetAIName() : (creature->GetScriptName() != "" ? "Script Name: " + creature->GetScriptName() : "No AI or Script Name Set"); + handler->PSendSysMessage(LANG_NPC_SETDATA, creature->GetGUID(), creature->GetEntry(), creature->GetName(), data_1, data_2, AIorScript); + return true; + } + //npc follow handling static bool HandleNpcFollowCommand(ChatHandler* handler, const char* /*args*/) { From 0f3db42ffc7e2d5a3c4985802dcafe0c5f075738 Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 9 May 2012 12:14:31 -0400 Subject: [PATCH 0705/1149] Core/Commands: fix build error with non-pch builds --- src/server/scripts/Commands/cs_npc.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 6089d256387..2c5136ed428 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -28,6 +28,7 @@ EndScriptData */ #include "Transport.h" #include "CreatureGroups.h" #include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand +#include "CreatureAI.h" class npc_commandscript : public CommandScript { From 890c7e64e17b1303809787255b09a9818ff46c50 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Wed, 9 May 2012 22:40:59 +0200 Subject: [PATCH 0706/1149] Battleground/Strand of the Ancients: Fix Achievement: Not Even a Scratch --- ...012_05_09_02_achievement_criteria_data.sql | 6 +++++ .../Battlegrounds/Zones/BattlegroundSA.cpp | 12 +++++----- .../game/Battlegrounds/Zones/BattlegroundSA.h | 9 ++++++-- .../scripts/World/achievement_scripts.cpp | 22 +++++++++++++++++++ 4 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 sql/updates/world/2012_05_09_02_achievement_criteria_data.sql diff --git a/sql/updates/world/2012_05_09_02_achievement_criteria_data.sql b/sql/updates/world/2012_05_09_02_achievement_criteria_data.sql new file mode 100644 index 00000000000..e1c0529fffe --- /dev/null +++ b/sql/updates/world/2012_05_09_02_achievement_criteria_data.sql @@ -0,0 +1,6 @@ +DELETE FROM `disables` WHERE `entry` IN (7626,7634) AND `sourceType`=4; + +DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (7626,7634); +INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `value1`, `value2`, `ScriptName`) VALUES +(7626, 11, 0, 0, 'achievement_not_even_a_scratch'), +(7634, 11, 0, 0, 'achievement_not_even_a_scratch'); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index 977897b8d48..d20efbddbbe 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -56,6 +56,8 @@ void BattlegroundSA::Reset() GateStatus[i] = BG_SA_GATE_OK; ShipsStarted = false; gateDestroyed = false; + _notEvenAScratch[BG_TEAM_ALLIANCE] = true; + _notEvenAScratch[BG_TEAM_HORDE] = true; Status = BG_SA_WARMUP; } @@ -553,13 +555,13 @@ void BattlegroundSA::EventPlayerDamagedGO(Player* /*player*/, GameObject* go, ui SendWarningToAll(LANG_BG_SA_IS_UNDER_ATTACK, go->GetGOInfo()->name.c_str()); } -void BattlegroundSA::HandleKillUnit(Creature* unit, Player* killer) +void BattlegroundSA::HandleKillUnit(Creature* creature, Player* killer) { - if (!unit) - return; - - if (unit->GetEntry() == NPC_DEMOLISHER_SA) + if (creature->GetEntry() == NPC_DEMOLISHER_SA) + { UpdatePlayerScore(killer, SCORE_DESTROYED_DEMOLISHER, 1); + _notEvenAScratch[Attackers] = false; + } } /* diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h index c18806490f2..fd11cb2c5ea 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h @@ -456,7 +456,7 @@ class BattlegroundSA : public Battleground /// Called when a player deal damage to building (door) virtual void EventPlayerDamagedGO(Player* player, GameObject* go, uint32 eventType); /// Called when a player kill a unit in bg - virtual void HandleKillUnit(Creature* unit, Player* killer); + virtual void HandleKillUnit(Creature* creature, Player* killer); /// Return the nearest graveyard where player can respawn virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player); /// Called when a player click on flag (graveyard flag) @@ -531,9 +531,12 @@ class BattlegroundSA : public Battleground /// Update score board void UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor = true); - // Achievement Defense of the Ancients + // Achievement: Defense of the Ancients bool gateDestroyed; + // Achievement: Not Even a Scratch + bool notEvenAScratch(uint32 team) const { return _notEvenAScratch[GetTeamIndexByTeamId(team)]; } + /// Id of attacker team TeamId Attackers; @@ -615,5 +618,7 @@ class BattlegroundSA : public Battleground bool InitSecondRound; std::map DemoliserRespawnList; + // Achievement: Not Even a Scratch + bool _notEvenAScratch[BG_TEAMS_COUNT]; }; #endif diff --git a/src/server/scripts/World/achievement_scripts.cpp b/src/server/scripts/World/achievement_scripts.cpp index 9bcf450b3aa..3dc737f0c95 100755 --- a/src/server/scripts/World/achievement_scripts.cpp +++ b/src/server/scripts/World/achievement_scripts.cpp @@ -313,6 +313,27 @@ class achievement_tilted : public AchievementCriteriaScript } }; +class achievement_not_even_a_scratch : public AchievementCriteriaScript +{ + public: + achievement_not_even_a_scratch() : AchievementCriteriaScript("achievement_not_even_a_scratch") { } + + bool OnCheck(Player* source, Unit* /*target*/) + { + if (!source) + return false; + + Battleground* battleground = source->GetBattleground(); + if (!battleground) + return false; + + if (static_cast(battleground)->notEvenAScratch(source->GetTeam())) + return true; + + return false; + } +}; + void AddSC_achievement_scripts() { new achievement_resilient_victory(); @@ -331,4 +352,5 @@ void AddSC_achievement_scripts() new achievement_arena_kills("achievement_arena_5v5_kills", ARENA_TYPE_5v5); new achievement_bg_sa_defense_of_ancients(); new achievement_tilted(); + new achievement_not_even_a_scratch(); } From 36542c9180d0ee5b390e87ac9f63194b6e922eb4 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 9 May 2012 21:39:32 -0230 Subject: [PATCH 0707/1149] DB/SAI: Fixup for Quest Quest:The Path to the Citadel "Alliance and Horde" --- sql/updates/world/2012_05_09_02_world_sai.sql | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sql/updates/world/2012_05_09_02_world_sai.sql diff --git a/sql/updates/world/2012_05_09_02_world_sai.sql b/sql/updates/world/2012_05_09_02_world_sai.sql new file mode 100644 index 00000000000..01004b23505 --- /dev/null +++ b/sql/updates/world/2012_05_09_02_world_sai.sql @@ -0,0 +1,116 @@ +-- Fixup for Quest Quest:The Path to the Citadel "Alliance and Horde" + +-- Alliance slave add missing equipments +UPDATE `creature_template` SET `equipment_id`=254 WHERE `entry`=36767; + +-- Horde Slave SAI +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry` IN (36770,36771,36772,36773); +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (36770,36771,36772,36773); +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (3677000); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(36770,0,0,0,11,0,100,6,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - On Reset - Emotestate'), +(36771,0,0,0,11,0,100,6,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - On Reset - Emotestate'), +(36772,0,0,0,11,0,100,6,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - On Reset - Emotestate'), +(36773,0,0,0,11,0,100,6,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - On Reset - Emotestate'), +(36770,0,1,0,8,0,100,7,71281,0,0,0,80,3677000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - On Spellhit - Run Script'), +(36771,0,1,0,8,0,100,7,71281,0,0,0,80,3677000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - On Spellhit - Run Script'), +(36772,0,1,0,8,0,100,7,71281,0,0,0,80,3677000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - On Spellhit - Run Script'), +(36773,0,1,0,8,0,100,7,71281,0,0,0,80,3677000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - On Spellhit - Run Script'), +-- Script +(3677000,9,0,0,0,0,100,0,500,500,500,500,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Horde Slave - Script - Turnto envoker'), +(3677000,9,1,0,0,0,100,0,500,500,500,500,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - Script - say text'), +(3677000,9,2,0,0,0,100,0,100,100,100,100,18,512,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - Script - set unitflag'), +(3677000,9,3,0,0,0,100,0,100,100,100,100,2,250,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - Script - set faction'), +(3677000,9,4,0,0,0,100,0,100,100,100,100,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - Script - set Emotestate'), +(3677000,9,5,0,0,0,100,0,100,100,100,100,33,36770,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Horde Slave - Script - give quest credit'), +(3677000,9,6,0,0,0,100,0,100,100,100,100,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - Script - set run on'), +(3677000,9,7,0,0,0,100,0,500,500,500,500,69,1,0,0,0,0,0,19,23837,70,0,0,0,0,0, 'Horde Slave - Script - move to closest trigger'), +(3677000,9,8,0,0,0,100,0,8000,8000,8000,8000,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - Script - despawn'); + +-- Alliance Slave SAI +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry` IN (36764,36765,36766,36767); +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (36764,36765,36766,36767); +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (3676400); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(36764,0,0,0,11,0,100,6,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - On Reset - Emotestate'), +(36765,0,0,0,11,0,100,6,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - On Reset - Emotestate'), +(36766,0,0,0,11,0,100,6,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - On Reset - Emotestate'), +(36767,0,0,0,11,0,100,6,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - On Reset - Emotestate'), +(36764,0,1,0,8,0,100,7,71281,0,0,0,80,3676400,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - On Spellhit - Run Script'), +(36765,0,1,0,8,0,100,7,71281,0,0,0,80,3676400,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - On Spellhit - Run Script'), +(36766,0,1,0,8,0,100,7,71281,0,0,0,80,3676400,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - On Spellhit - Run Script'), +(36767,0,1,0,8,0,100,7,71281,0,0,0,80,3676400,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - On Spellhit - Run Script'), +-- Script +(3676400,9,0,0,0,0,100,0,500,500,500,500,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Alliance Slave - Script - Turnto envoker'), +(3676400,9,1,0,0,0,100,0,500,500,500,500,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - Script - say text'), +(3676400,9,2,0,0,0,100,0,100,100,100,100,18,512,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - Script - set unitflag'), +(3676400,9,3,0,0,0,100,0,100,100,100,100,2,250,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - Script - set faction'), +(3676400,9,4,0,0,0,100,0,100,100,100,100,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - Script - set Emotestate'), +(3676400,9,5,0,0,0,100,0,100,100,100,100,33,36764,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Alliance Slave - Script - give quest credit'), +(3676400,9,6,0,0,0,100,0,100,100,100,100,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - Script - set run on'), +(3676400,9,7,0,0,0,100,0,500,500,500,500,69,1,0,0,0,0,0,19,23837,70,0,0,0,0,0, 'Alliance Slave - Script - move to closest trigger'), +(3676400,9,8,0,0,0,100,0,8000,8000,8000,8000,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - Script - despawn'); + +-- Ball and chain SAI +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry` IN (201969); +DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid` IN (201969); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(201969,1,0,0,64,0,100,6,0,0,0,0,85,71281,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Ball and chain - On Gossip Hello - Envoker cast on self'); + +-- Spell Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=71281; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,71281,0,31,3,36770,0,0,'','Spell 71281 targets entry 36770'), +(13,1,71281,1,31,3,36771,0,0,'','Spell 71281 targets entry 36771'), +(13,1,71281,2,31,3,36772,0,0,'','Spell 71281 targets entry 36772'), +(13,1,71281,3,31,3,36773,0,0,'','Spell 71281 targets entry 36773'), +(13,1,71281,4,31,3,36764,0,0,'','Spell 71281 targets entry 36764'), +(13,1,71281,5,31,3,36765,0,0,'','Spell 71281 targets entry 36765'), +(13,1,71281,6,31,3,36766,0,0,'','Spell 71281 targets entry 36766'), +(13,1,71281,7,31,3,36767,0,0,'','Spell 71281 targets entry 36767'); + +-- Creature text from sniff +DELETE FROM `creature_text` WHERE `entry` IN (36770,36771,36772,36773,36764,36765,36766,36767); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +-- Alliance Slaves +(36764,0,0, 'You''re a beautiful sight... you have no idea.',12,0,100,0,0,0, 'Alliance Slave'), +(36764,0,1, '%s lets his mining pick drag on the ground as she approaches, clearly exhausted.',16,0,100,0,0,0, 'Alliance Slave'), +(36764,0,2, 'Have my babies.',12,0,100,0,0,0, 'Alliance Slave'), +(36764,0,3, 'If by life or death I can repay you, I will.',12,0,100,0,0,0, 'Alliance Slave'), +(36764,0,4, 'I''m going to return to the front of the quarry. Kill a few extra for me.',12,0,100,0,0,0, 'Alliance Slave'), +(36765,0,0, 'You''re a beautiful sight... you have no idea.',12,0,100,0,0,0, 'Alliance Slave'), +(36765,0,1, '%s lets his mining pick drag on the ground as she approaches, clearly exhausted.',16,0,100,0,0,0, 'Alliance Slave'), +(36765,0,2, 'Have my babies.',12,0,100,0,0,0, 'Alliance Slave'), +(36765,0,3, 'If by life or death I can repay you, I will.',12,0,100,0,0,0, 'Alliance Slave'), +(36765,0,4, 'I''m going to return to the front of the quarry. Kill a few extra for me.',12,0,100,0,0,0, 'Alliance Slave'), +(36766,0,0, 'You''re a beautiful sight... you have no idea.',12,0,100,0,0,0, 'Alliance Slave'), +(36766,0,1, '%s lets his mining pick drag on the ground as she approaches, clearly exhausted.',16,0,100,0,0,0, 'Alliance Slave'), +(36766,0,2, 'Have my babies.',12,0,100,0,0,0, 'Alliance Slave'), +(36766,0,3, 'If by life or death I can repay you, I will.',12,0,100,0,0,0, 'Alliance Slave'), +(36766,0,4, 'I''m going to return to the front of the quarry. Kill a few extra for me.',12,0,100,0,0,0, 'Alliance Slave'), +(36767,0,0, 'You''re a beautiful sight... you have no idea.',12,0,100,0,0,0, 'Alliance Slave'), +(36767,0,1, '%s lets his mining pick drag on the ground as she approaches, clearly exhausted.',16,0,100,0,0,0, 'Alliance Slave'), +(36767,0,2, 'Have my babies.',12,0,100,0,0,0, 'Alliance Slave'), +(36767,0,3, 'If by life or death I can repay you, I will.',12,0,100,0,0,0, 'Alliance Slave'), +(36767,0,4, 'I''m going to return to the front of the quarry. Kill a few extra for me.',12,0,100,0,0,0, 'Alliance Slave'), +-- Horde Slaves +(36770,0,0, 'You''re a beautiful sight... you have no idea.',12,0,100,0,0,0, 'Horde Slave'), +(36770,0,1, '%s lets his mining pick drag on the ground as she approaches, clearly exhausted.',16,0,100,0,0,0, 'Horde Slave'), +(36770,0,2, 'Have my babies.',12,0,100,0,0,0, 'Horde Slave'), +(36770,0,3, 'If by life or death I can repay you, I will.',12,0,100,0,0,0, 'Horde Slave'), +(36770,0,4, 'I''m going to return to the front of the quarry. Kill a few extra for me.',12,0,100,0,0,0, 'Horde Slave'), +(36771,0,0, 'You''re a beautiful sight... you have no idea.',12,0,100,0,0,0, 'Horde Slave'), +(36771,0,1, '%s lets his mining pick drag on the ground as she approaches, clearly exhausted.',16,0,100,0,0,0, 'Horde Slave'), +(36771,0,2, 'Have my babies.',12,0,100,0,0,0, 'Horde Slave'), +(36771,0,3, 'If by life or death I can repay you, I will.',12,0,100,0,0,0, 'Horde Slave'), +(36771,0,4, 'I''m going to return to the front of the quarry. Kill a few extra for me.',12,0,100,0,0,0, 'Horde Slave'), +(36772,0,0, 'You''re a beautiful sight... you have no idea.',12,0,100,0,0,0, 'Horde Slave'), +(36772,0,1, '%s lets his mining pick drag on the ground as she approaches, clearly exhausted.',16,0,100,0,0,0, 'Horde Slave'), +(36772,0,2, 'Have my babies.',12,0,100,0,0,0, 'Horde Slave'), +(36772,0,3, 'If by life or death I can repay you, I will.',12,0,100,0,0,0, 'Horde Slave'), +(36772,0,4, 'I''m going to return to the front of the quarry. Kill a few extra for me.',12,0,100,0,0,0, 'Horde Slave'), +(36773,0,0, 'You''re a beautiful sight... you have no idea.',12,0,100,0,0,0, 'Horde Slave'), +(36773,0,1, '%s lets his mining pick drag on the ground as she approaches, clearly exhausted.',16,0,100,0,0,0, 'Horde Slave'), +(36773,0,2, 'Have my babies.',12,0,100,0,0,0, 'Horde Slave'), +(36773,0,3, 'If by life or death I can repay you, I will.',12,0,100,0,0,0, 'Horde Slave'), +(36773,0,4, 'I''m going to return to the front of the quarry. Kill a few extra for me.',12,0,100,0,0,0, 'Horde Slave'); From b5ff1633541bb1d7d2c4f2efd26a8a53544ae4eb Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 9 May 2012 22:11:27 -0230 Subject: [PATCH 0708/1149] DB/misc: Misc updates for Pit of Saron --- .../world/2012_05_09_03_world_misc.sql | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 sql/updates/world/2012_05_09_03_world_misc.sql diff --git a/sql/updates/world/2012_05_09_03_world_misc.sql b/sql/updates/world/2012_05_09_03_world_misc.sql new file mode 100644 index 00000000000..5d47b27323c --- /dev/null +++ b/sql/updates/world/2012_05_09_03_world_misc.sql @@ -0,0 +1,56 @@ +-- Update Scourgelord Tyrannus "Make him fly" +UPDATE `creature_template_addon` SET `bytes1`=50331648 WHERE `entry`=36794; + +-- Put Rimefang in the air and make him fly +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=36661; +UPDATE `creature_template_addon` SET `bytes1`=50331648 WHERE `entry`=36661; + +-- Deathwhisper Necrolyte SAI +SET @ENTRY := 36788; -- NPC entry +SET @SPELL1 := 69577; -- Shadow Bolt +SET @SPELL2 := 69578; -- Conversion Beam +SET @SPELL3 := 45104; -- Shadow Channelling +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,6,100,100,3000,3000,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Deathwhisper Necrolyte - Combat - Cast Shadow Bolt'), +(@ENTRY,0,1,0,0,0,100,6,9000,9000,24000,24000,11,@SPELL2,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Deathwhisper Necrolyte - Combat - Cast Conversion Beam'), + +-- Deathwhisper Necrolyte pathing +SET @NPC := 202231; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=592.975,`position_y`=176.104,`position_z`=508.746 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,596.0208,175.5243,508.3654,0,0,0,100,0), +(@PATH,2,605.2656,157.7101,507.2126,0,0,0,100,0), +(@PATH,3,604.4063,146.283,507.3376,0,0,0,100,0), +(@PATH,4,592.2899,131.4271,507.8163,0,0,0,100,0), +(@PATH,5,577.4531,118.224,508.3163,0,0,0,100,0), +(@PATH,6,563.0695,103.7309,514.1504,0,0,0,100,0), +(@PATH,7,557.7743,89.41319,523.1727,0,0,0,100,0), +(@PATH,8,560.9583,77.65278,525.4227,0,0,0,100,0), +(@PATH,9,560.9583,77.65278,525.4227,0,0,0,100,0), +(@PATH,10,571.0139,69.43403,525.2753,0,0,0,100,0), +(@PATH,11,560.9583,77.65278,525.4227,0,0,0,100,0), +(@PATH,12,557.7743,89.41319,523.1727,0,0,0,100,0), +(@PATH,13,563.0695,103.7309,514.1504,0,0,0,100,0), +(@PATH,14,577.4531,118.224,508.3163,0,0,0,100,0), +(@PATH,15,592.2899,131.4271,507.8163,0,0,0,100,0), +(@PATH,16,604.4063,146.283,507.3376,0,0,0,100,0), +(@PATH,17,605.2656,157.7101,507.2126,0,0,0,100,0), +(@PATH,18,596.0208,175.5243,508.3654,0,0,0,100,0); + +DELETE FROM `creature_formations` WHERE `leaderGUID`=202231; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(202231,202231,0,0,2), +(202231,202099,7,288,2), +(202231,202282,7,324,2), +(202231,202125,7,360,2), +(202231,202203,7,36,2), +(202231,201960,7,72,2); + +-- Remove a dupe spawn +DELETE * FROM `creature` WHERE `guid`=201998; +DELETE * FROM `creature_addon` WHERE `guid`=201998; From 9c3842fe491ac73edb1a9d8224947ef414695785 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 9 May 2012 22:13:13 -0230 Subject: [PATCH 0709/1149] DB/Misc: fix sql error :| --- sql/updates/world/2012_05_09_03_world_misc.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/updates/world/2012_05_09_03_world_misc.sql b/sql/updates/world/2012_05_09_03_world_misc.sql index 5d47b27323c..75c04b88df9 100644 --- a/sql/updates/world/2012_05_09_03_world_misc.sql +++ b/sql/updates/world/2012_05_09_03_world_misc.sql @@ -52,5 +52,5 @@ INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`gro (202231,201960,7,72,2); -- Remove a dupe spawn -DELETE * FROM `creature` WHERE `guid`=201998; -DELETE * FROM `creature_addon` WHERE `guid`=201998; +DELETE FROM `creature` WHERE `guid`=201998; +DELETE FROM `creature_addon` WHERE `guid`=201998; From 4aa2032cd4ea0647168c3bdedb09172c9915ac64 Mon Sep 17 00:00:00 2001 From: Discover- Date: Thu, 10 May 2012 13:15:09 +0200 Subject: [PATCH 0710/1149] Database/Errors: Fix another SQL error from b5ff1633541bb1d7d2c4f2efd26a8a53544ae4eb :thumbsdown: --- sql/updates/world/2012_05_09_03_world_misc.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/updates/world/2012_05_09_03_world_misc.sql b/sql/updates/world/2012_05_09_03_world_misc.sql index 75c04b88df9..63e162fcfce 100644 --- a/sql/updates/world/2012_05_09_03_world_misc.sql +++ b/sql/updates/world/2012_05_09_03_world_misc.sql @@ -13,7 +13,7 @@ SET @SPELL3 := 45104; -- Shadow Channelling DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES (@ENTRY,0,0,0,0,0,100,6,100,100,3000,3000,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Deathwhisper Necrolyte - Combat - Cast Shadow Bolt'), -(@ENTRY,0,1,0,0,0,100,6,9000,9000,24000,24000,11,@SPELL2,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Deathwhisper Necrolyte - Combat - Cast Conversion Beam'), +(@ENTRY,0,1,0,0,0,100,6,9000,9000,24000,24000,11,@SPELL2,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Deathwhisper Necrolyte - Combat - Cast Conversion Beam'); -- Deathwhisper Necrolyte pathing SET @NPC := 202231; From 7a6314595a9159c8ba9e10239585f882f10af55d Mon Sep 17 00:00:00 2001 From: Discover- Date: Thu, 10 May 2012 13:27:28 +0200 Subject: [PATCH 0711/1149] Database/Quests: Script quest See On The Other Side. Closes #4174 Closes #3340 Partly closes #5200 --- sql/updates/world/2012_05_10_00_world_sai.sql | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 sql/updates/world/2012_05_10_00_world_sai.sql diff --git a/sql/updates/world/2012_05_10_00_world_sai.sql b/sql/updates/world/2012_05_10_00_world_sai.sql new file mode 100644 index 00000000000..c6d6e914345 --- /dev/null +++ b/sql/updates/world/2012_05_10_00_world_sai.sql @@ -0,0 +1,42 @@ +-- [Q] See You on the Other Side + +-- Gan'jo SAI +SET @ENTRY := 26924; +SET @QUEST := 12121; +SET @GOSSIP := 10220; +SET @SPELL_RESURRECT := 61613; +UPDATE `creature_template` SET `npcflag`=3,`AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,62,0,100,0,@GOSSIP,0,0,0,11,@SPELL_RESURRECT,1,0,0,0,0,7,0,0,0,0,0,0,0,"Gan'jo - On Gossip Select - Cast Ganjo Resurrection"), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Gan'jo - On Gossip Select - Close Gossip"); + +-- Essence of Warlord Jin'arrak SAI +SET @ENTRY := 26902; +SET @SPELL_DIE_EFFECT := 61611; +SET @SPELL_CAMERA_SHAKE := 47533; +UPDATE `creature_template` SET `AIName`='SmartAI',`flags_extra`=128 WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100) AND `source_type` IN (0,9); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,54,0,100,0,0,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,"Essence of Warlord Jin'arrak - On Just Summoned - Run Script"), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,85,@SPELL_CAMERA_SHAKE,0,0,0,0,0,7,0,0,0,0,0,0,0,"Essence of Warlord Jin'arrak - On Script - Invoker Cast Camera Shake - Small"), +(@ENTRY*100,9,1,0,0,0,100,0,4000,4000,0,0,33,@ENTRY,0,0,0,0,0,7,0,0,0,0,0,0,0,"Essence of Warlord Jin'arrak - On Script - Killed Monster Credit"), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Essence of Warlord Jin'arrak - On Script - Monster Whisper Line 0"), +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,85,@SPELL_CAMERA_SHAKE,0,0,0,0,0,7,0,0,0,0,0,0,0,"Essence of Warlord Jin'arrak - On Script - Invoker Cast Camera Shake - Small"), +(@ENTRY*100,9,4,0,0,0,100,0,3000,3000,0,0,85,@SPELL_DIE_EFFECT,0,0,0,0,0,7,0,0,0,0,0,0,0,"Essence of Warlord Jin'arrak - On Script - Invoker Cast On The Other Side"); + +-- Essence of Warlord Jin'arrak text +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"How dare you summon me without an offering!",42,0,0,0,0,0,"Essence of Warlord Jin'arrak"); + +-- Ganjo's Resurrection removes On The Other Side +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=@SPELL_RESURRECT; +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES +(@SPELL_RESURRECT,-@SPELL_DIE_EFFECT,1,"Ganjo's Resurrection removes On The Other Side"); + +-- Conditions for Gan'jo's gossip option +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTarget`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`comment`) VALUES +(15,@GOSSIP,0,0,0,1,@SPELL_DIE_EFFECT,0,"Ganjo's Gossip - requires aura See You On The Other Side"), +(15,@GOSSIP,0,0,1,9,@QUEST,0,"Ganjo's Gossip - requires quest See You On The Other Side to be rewarded"); From 0ecd9e72d0745ed0e79f8730f808153139a795a1 Mon Sep 17 00:00:00 2001 From: Discover- Date: Thu, 10 May 2012 13:43:40 +0200 Subject: [PATCH 0712/1149] Scripts/Quests: Script quest Leave Nothing to Chance. Closes #1863 Closes #3087 Closes #2061 --- .../world/2012_05_10_01_world_misc.sql | 37 ++++++++++++ src/server/scripts/Spells/spell_quest.cpp | 58 +++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 sql/updates/world/2012_05_10_01_world_misc.sql diff --git a/sql/updates/world/2012_05_10_01_world_misc.sql b/sql/updates/world/2012_05_10_01_world_misc.sql new file mode 100644 index 00000000000..a7a30d518a2 --- /dev/null +++ b/sql/updates/world/2012_05_10_01_world_misc.sql @@ -0,0 +1,37 @@ +-- [Q] Leave Nothing to Chance + +-- Lower Wintergarde Mine Shaft and Upper Wintergarde Mine Shaft +UPDATE `creature_template` SET `MovementType`=0,`flags_extra`=`flags_extra`|128 WHERE `entry`IN (27437,27436); +UPDATE `creature` SET `MovementType`=0,`spawndist`=0 WHERE `id` IN (27437,27436); + +-- Wintergarde Mine Bomb SAI +SET @ENTRY := 27435; +SET @SPELL_EXPLOSION := 48742; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,1,0,100,1,14000,14000,0,0,11,@SPELL_EXPLOSION,2,0,0,0,0,1,0,0,0,0,0,0,0,"Wintergarde Mine Bomb - Out of Combat - Cast Wintergarde Mine Explosion"), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,41,3000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wintergarde Mine Bomb - On Wintergarde Mine Explosion Cast - Forced Despawn"); + +-- Spawn missing spell focus object for upper mine +DELETE FROM `gameobject` WHERE `id`=188711 AND `guid`=370; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(370,188711,571,1,1,3898.18,-881.748,119.533,0.421023,0,0,0.20896,0.977924,300,0,1); + +-- Spawn missing Upper Wintergarde Mine Shaft +DELETE FROM `creature` WHERE `id`=27436 AND `guid`=42576; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(42576,27436,571,1,1,0,0,3899.86,-883.613,119.536,0.0636665,300,0,0,42,0,0,0,0,0); + +-- Spellscriptname +DELETE FROM `spell_script_names` WHERE `spell_id`=@SPELL_EXPLOSION; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(@SPELL_EXPLOSION,'spell_q12277_wintergarde_mine_explosion'); + +-- The conditions will make it works exactly like it should. Thanks a lot Josh. +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=@SPELL_EXPLOSION; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,@SPELL_EXPLOSION,0,31,3,27437,0,0,'',"Wintergarde Mine Explosion - Lower Wintergarde Mine Shaft"), -- Effect 0 - SPELL_EFFECT_DUMMY +(13,1,@SPELL_EXPLOSION,1,31,3,27436,0,0,'',"Wintergarde Mine Explosion - Upper Wintergarde Mine Shaft"), -- Effect 0 - SPELL_EFFECT_DUMMY +(13,2,@SPELL_EXPLOSION,0,31,4,0,0,0,'',"Wintergarde Mine Explosion - Targets Players"), -- Effect 1 - SPELL_EFFECT_KNOCK_BACK +(13,4,@SPELL_EXPLOSION,0,31,5,188712,0,0,'',"Wintergarde Mine Explosion - Wintergarde Mine Cave In (2)"); -- Effect 2 - SPELL_EFFECT_ACTIVATE_OBJECT diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 9d042da0789..87db81d2518 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1105,6 +1105,63 @@ public: } }; +enum LeaveNothingToChance +{ + NPC_UPPER_MINE_SHAFT = 27436, + NPC_LOWER_MINE_SHAFT = 27437, + + SPELL_UPPER_MINE_SHAFT_CREDIT = 48744, + SPELL_LOWER_MINE_SHAFT_CREDIT = 48745, +}; + +class spell_q12277_wintergarde_mine_explosion : public SpellScriptLoader +{ + public: + spell_q12277_wintergarde_mine_explosion() : SpellScriptLoader("spell_q12277_wintergarde_mine_explosion") { } + + class spell_q12277_wintergarde_mine_explosion_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q12277_wintergarde_mine_explosion_SpellScript) + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Creature* unitTarget = GetHitCreature()) + { + if (Unit* caster = GetCaster()) + { + if (caster->GetTypeId() == TYPEID_UNIT) + { + if (Unit* owner = caster->GetOwner()) + { + switch (unitTarget->GetEntry()) + { + case NPC_UPPER_MINE_SHAFT: + caster->CastSpell(owner, SPELL_UPPER_MINE_SHAFT_CREDIT, true); + break; + case NPC_LOWER_MINE_SHAFT: + caster->CastSpell(owner, SPELL_LOWER_MINE_SHAFT_CREDIT, true); + break; + default: + break; + } + } + } + } + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_q12277_wintergarde_mine_explosion_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_q12277_wintergarde_mine_explosion_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -1131,4 +1188,5 @@ void AddSC_quest_spell_scripts() new spell_q14112_14145_chum_the_water(); new spell_q9452_cast_net(); new spell_q12987_read_pronouncement(); + new spell_q12277_wintergarde_mine_explosion(); } From 70739ec9deb967cd64bc96791278018c0e7b97ea Mon Sep 17 00:00:00 2001 From: Discover- Date: Thu, 10 May 2012 13:50:22 +0200 Subject: [PATCH 0713/1149] Scripts/Commands: Fix compile under Linux (d6d45633c8ca34176d066755ba8be182b1ed7ac7). Credits go to @PuniCZ --- src/server/scripts/Commands/cs_npc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 2c5136ed428..832f7958fc8 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -555,7 +555,7 @@ public: creature->AI()->SetData(data_1, data_2); std::string AIorScript = creature->GetAIName() != "" ? "AI type: " + creature->GetAIName() : (creature->GetScriptName() != "" ? "Script Name: " + creature->GetScriptName() : "No AI or Script Name Set"); - handler->PSendSysMessage(LANG_NPC_SETDATA, creature->GetGUID(), creature->GetEntry(), creature->GetName(), data_1, data_2, AIorScript); + handler->PSendSysMessage(LANG_NPC_SETDATA, creature->GetGUID(), creature->GetEntry(), creature->GetName(), data_1, data_2, AIorScript.c_str()); return true; } From 5057a8156dc0b2f8664ca952d1da2954f385b2f2 Mon Sep 17 00:00:00 2001 From: Discover- Date: Thu, 10 May 2012 13:52:22 +0200 Subject: [PATCH 0714/1149] Scripts/Quests: Fix compile from 0ecd9e72d0745ed0e79f8730f808153139a795a1 - sorry guys. Thanks @Vincent-Michael. --- src/server/scripts/Spells/spell_quest.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 87db81d2518..810cc20e04b 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1118,11 +1118,11 @@ class spell_q12277_wintergarde_mine_explosion : public SpellScriptLoader { public: spell_q12277_wintergarde_mine_explosion() : SpellScriptLoader("spell_q12277_wintergarde_mine_explosion") { } - + class spell_q12277_wintergarde_mine_explosion_SpellScript : public SpellScript { - PrepareSpellScript(spell_q12277_wintergarde_mine_explosion_SpellScript) - + PrepareSpellScript(spell_q12277_wintergarde_mine_explosion_SpellScript); + void HandleDummy(SpellEffIndex /*effIndex*/) { if (Creature* unitTarget = GetHitCreature()) @@ -1149,13 +1149,13 @@ class spell_q12277_wintergarde_mine_explosion : public SpellScriptLoader } } } - + void Register() { OnEffectHitTarget += SpellEffectFn(spell_q12277_wintergarde_mine_explosion_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; - + SpellScript* GetSpellScript() const { return new spell_q12277_wintergarde_mine_explosion_SpellScript(); From 133652624c3774bf506beac9a442707b8d72d096 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 10 May 2012 09:03:26 -0400 Subject: [PATCH 0715/1149] DB/CreatureTemplate: fix startup error with loot ids. --- sql/updates/world/2012_05_10_02_world_creature_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_05_10_02_world_creature_template.sql diff --git a/sql/updates/world/2012_05_10_02_world_creature_template.sql b/sql/updates/world/2012_05_10_02_world_creature_template.sql new file mode 100644 index 00000000000..28893f24fdf --- /dev/null +++ b/sql/updates/world/2012_05_10_02_world_creature_template.sql @@ -0,0 +1,2 @@ +-- fix creauture_template loot id for infinite corruptor. could have sworn this was already in the db. +UPDATE `creature_template` SET `lootid` = 0 WHERE `entry` IN (32313,32273); From 62b1d4b8e13f35688fae7cc212699a86033f4887 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 10 May 2012 10:08:16 -0400 Subject: [PATCH 0716/1149] DB/Misc: various fixes from the issue tracker. Remove obsolete requirement 'cooking profession' from quest 'Beer Basted Boar Ribs' (thx tifkat) closes #5198 Fix proc for Death's Verdict/Choice (author: kandera) closes #6041 Disables quest "Desperate Research" for all factions author trista closes #5285 Disables scourge invasion connected quests Limit Bloodgem Shard use to Netherstorm Cristal Target author: nelegalno closes #4165 Path of xx and A Change of Heart (Ashen Band rings) author: studioworks closes #2544 spawn farmer torp author: zxbiohazardzx closes #6256 Disgusting Oozeling aura author: gecko32 closes #6197 Mr. Chilly Add aura chilly for Periodic slide Update to Change to $n in page text author: gecko32 closes #5930 Update frost shock and you to only be for shamans. author: whit33r closes #4727 fixes ashen band of destruction proc author: kandera fixes quest credit from Fel reaver no thanks! author: tREAk & shlomi1515 closes #3715 fix areatrigger for wickerman camp author: boomper closes #3549 yous have da darkrune should be daily author: kaelima closes #3457 fix infinite corruptor loot id author: vincent-michael --- .../world/2012_05_10_03_world_misc.sql | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 sql/updates/world/2012_05_10_03_world_misc.sql diff --git a/sql/updates/world/2012_05_10_03_world_misc.sql b/sql/updates/world/2012_05_10_03_world_misc.sql new file mode 100644 index 00000000000..339f52ac0bb --- /dev/null +++ b/sql/updates/world/2012_05_10_03_world_misc.sql @@ -0,0 +1,129 @@ + -- Remove obsolete requirement 'cooking profession' from quest 'Beer Basted Boar Ribs' (thx tifkat) closes #5198 +UPDATE `quest_template` SET `RequiredSkillId`=0, `RequiredSkillPoints`=0 WHERE `Id`=384; + +-- Fix proc for Death's Verdict/Choice (author: kandera) closes #6041 +UPDATE `spell_proc_event` SET `procFlags` = 0, `procEx` = `procEx`|262144 WHERE `entry` in (67702, 67771); + +-- Disables quest "Desperate Research" for all factions author trista closes #5285 +DELETE FROM `disables` WHERE `sourceType` = 1 AND `entry` in (12782,12783,12811,12784,12752,12775,12777,12753,12808,12772); +INSERT INTO `disables` (`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) VALUES +(1,12782,0,0,0,'Disable quest from Scourge Invasion for Blood Elves'), +(1,12783,0,0,0,'Disable quest from Scourge Invasion for Orcs'), +(1,12811,0,0,0,'Disable quest from Scourge Invasion for Trolls'), +(1,12784,0,0,0,'Disable quest from Scourge Invasion for Tauren'), +(1,12752,0,0,0,'Disable quest from Scourge Invasion for undead'), +(1,12775,0,0,0,'Disable quest from Scourge Invasion for Human'), +(1,12777,0,0,0,'Disable quest from Scourge Invasion for Draenei'), +(1,12753,0,0,0,'Disable quest from Scourge Invasion for Dwarves'), +(1,12808,0,0,0,'Disable quest from Scourge Invasion for Gnomes'), +(1,12772,0,0,0,'Disable quest from Scourge Invasion for Night Elves'); +-- Disables scourge invasion connected quests listed below +DELETE FROM `disables` WHERE `sourceType` = 1 AND `entry` in (12788,12812,12785,12786,12787,12774,12776,12771,12809,12773); +INSERT INTO `disables` (`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) VALUES +(1,12788,0,0,0,'Disable quest from Scourge Invasion for Blood Elves'), +(1,12812,0,0,0,'Disable quest from Scourge Invasion for Orcs'), +(1,12785,0,0,0,'Disable quest from Scourge Invasion for Trolls'), +(1,12786,0,0,0,'Disable quest from Scourge Invasion for Tauren'), +(1,12787,0,0,0,'Disable quest from Scourge Invasion for undead'), +(1,12774,0,0,0,'Disable quest from Scourge Invasion for Human'), +(1,12776,0,0,0,'Disable quest from Scourge Invasion for Draenei'), +(1,12771,0,0,0,'Disable quest from Scourge Invasion for Dwarves'), +(1,12809,0,0,0,'Disable quest from Scourge Invasion for Gnomes'), +(1,12773,0,0,0,'Disable quest from Scourge Invasion for Night Elves'); + +-- Limit Bloodgem Shard use to Netherstorm Cristal Target author: nelegalno closes #4165 +DELETE FROM `conditions` WHERE (`SourceEntry`=34367 AND `SourceTypeOrReferenceId`=17 AND `ConditionTypeOrReference`=29); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(17,0,34367,0,29,19421,15,0,64,'','Limit Bloodgem Shard use to Netherstorm Cristal Target'); + +-- Path of xx and A Change of Heart (Ashen Band rings) author: studioworks closes #2544 +UPDATE `quest_template` SET `PrevQuestId`=0 WHERE `id` IN +(24827,24834,24835,24823,24828,24829,25239,25240,25242,24826,24832,24833,24825,24830,24831,24819,24820,24821,24822,24836,24837,24838,24839,24840,24841,24842,24843,24844,24845,24846,24847,25246,25247,25248,25249); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=19 AND `SourceEntry` IN +-- Paths +(24827,24834,24835,24823,24828,24829,25239,25240,25242,24826,24832,24833,24825,24830,24831, +-- A Change of Heart +24819,24820,24821,24822,24836,24837,24838,24839,24840,24841,24842,24843,24844,24845,24846,24847,25246,25247,25248,25249); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`Comment`) VALUES +-- Path of Courage +(19,0,24827,0,2,50375,1,0,'Path of Courage 1'), +(19,0,24834,0,2,50388,1,0,'Path of Courage 2'), +(19,0,24835,0,2,50403,1,0,'Path of Courage 3'), +-- Path of Destruction +(19,0,24823,0,2,50384,1,0,'Path of Destruction 1'), +(19,0,24828,0,2,50377,1,0,'Path of Destruction 2'), +(19,0,24829,0,2,50397,1,0,'Path of Destruction 3'), +-- Path of Might +(19,0,25239,0,2,52569,1,0,'Path of Might 1'), +(19,0,25240,0,2,52570,1,0,'Path of Might 2'), +(19,0,25242,0,2,52571,1,0,'Path of Might 3'), +-- Path of Vengeance +(19,0,24826,0,2,50376,1,0,'Path of Vengeance 1'), +(19,0,24832,0,2,50387,1,0,'Path of Vengeance 2'), +(19,0,24833,0,2,50401,1,0,'Path of Vengeance 3'), +-- Path of Wisdom +(19,0,24825,0,2,50378,1,0,'Path of Wisdom 1'), +(19,0,24830,0,2,50386,1,0,'Path of Wisdom 2'), +(19,0,24831,0,2,50399,1,0,'Path of Wisdom 3'), +-- A Change of Heart +(19,0,24819,0,2,50377,1,0,'A Change of Heart'), +(19,0,24820,0,2,50376,1,0,'A Change of Heart'), +(19,0,24821,0,2,50375,1,0,'A Change of Heart'), +(19,0,24822,0,2,50378,1,0,'A Change of Heart'), +(19,0,24836,0,2,50384,1,0,'A Change of Heart'), +(19,0,24837,0,2,50386,1,0,'A Change of Heart'), +(19,0,24838,0,2,50387,1,0,'A Change of Heart'), +(19,0,24839,0,2,50388,1,0,'A Change of Heart'), +(19,0,24840,0,2,50397,1,0,'A Change of Heart'), +(19,0,24841,0,2,50399,1,0,'A Change of Heart'), +(19,0,24842,0,2,50401,1,0,'A Change of Heart'), +(19,0,24843,0,2,50403,1,0,'A Change of Heart'), +(19,0,24844,0,2,50398,1,0,'A Change of Heart'), +(19,0,24845,0,2,50400,1,0,'A Change of Heart'), +(19,0,24846,0,2,50402,1,0,'A Change of Heart'), +(19,0,24847,0,2,50404,1,0,'A Change of Heart'), +(19,0,25246,0,2,52572,1,0,'A Change of Heart'), +(19,0,25247,0,2,52569,1,0,'A Change of Heart'), +(19,0,25248,0,2,52570,1,0,'A Change of Heart'), +(19,0,25249,0,2,52571,1,0,'A Change of Heart'); + +-- spawn farmer torp author: zxbiohazardzx closes #6256 +SET @guid := 42652; +DELETE FROM `creature` WHERE `guid`=@guid; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`) +VALUES +(@guid,25607,571,1,1,2886.325,6385.55,92.96985,1.4512,120); -- Farmer Torp + +-- Disgusting Oozeling aura author: gecko32 closes #6197 +UPDATE `creature_template_addon` SET `auras`='25163' WHERE `entry`=15429; +-- Mr. Chilly +-- Add aura chilly for Periodic slide +DELETE FROM `creature_template_addon` WHERE `entry`=29726; +INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES +(29726, 0, 0, 0, 0, 0, '61811'); + +-- Update to Change to $n in page text author: gecko32 closes #5930 +UPDATE `page_text` SET `text`='This proof of deed is to verify that $n slew Margol the Rager, scourge of the searing gorge.$B$BThe Ironforge museum recognizes this achievement and thanks the bearer for their generous contribution.$B$B-Head Curator Thorius Stonetender' WHERE `entry`=1231; + +-- Update frost shock and you to only be for shamans. author: whit33r closes #4727 +UPDATE `quest_template` SET `RequiredClasses`=64 WHERE `id` = 7505; + +-- fixes ashen band of destruction proc author: kandera +DELETE FROM `spell_proc_event` WHERE `entry` = 72417; +INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`procFlags`,`procEx`,`ppmRate`,`CustomChance`,`Cooldown`) VALUES +(72417,0,0,0,0,0,327680,0,0,0,60); + +-- fixes quest credit from Fel reaver no thanks! author: tREAk & shlomi1515 closes #3715 +UPDATE `spell_dbc` SET `Effect1`=16,`EffectMiscValue1`=10855 WHERE `id`=38758; +DELETE FROM `creature_ai_scripts` WHERE creature_id=22293; + +-- fix areatrigger for wickerman camp author: boomper closes #3549 +DELETE FROM `areatrigger_involvedrelation` WHERE `id` =3991; +INSERT INTO `areatrigger_involvedrelation` (`id`, `quest`) +VALUES (3991,1658); + +-- yous have da darkrune should be daily author: kaelima closes #3457 +UPDATE `quest_template` SET `SpecialFlags` = `SpecialFlags` | 1 WHERE `id` = 11027; + +-- fix infinite corruptor loot id author: vincent-michael +UPDATE `creature_template` SET `lootid` = 32313 WHERE `entry` =32313; From 9d5c59939f0ebb5e7a078ebac67b9cc0029fb7d9 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 10 May 2012 12:11:49 -0230 Subject: [PATCH 0717/1149] DB/creature sai: Add missing Disturbed Glacial Revenant spawn to Pit of Saron Heroic with SAI. --- .../world/2012_05_10_04_world_ceature_sai.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 sql/updates/world/2012_05_10_04_world_ceature_sai.sql diff --git a/sql/updates/world/2012_05_10_04_world_ceature_sai.sql b/sql/updates/world/2012_05_10_04_world_ceature_sai.sql new file mode 100644 index 00000000000..5f01e951c4b --- /dev/null +++ b/sql/updates/world/2012_05_10_04_world_ceature_sai.sql @@ -0,0 +1,14 @@ +-- Spawn Disturbed Glacial Revenant +DELETE FROM `creature` WHERE `guid`=201998; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`, `position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(201998,36874,658,2,1,0,0,1053.894,-93.05556,632.8575,4.223697,86400,0,0,1,0,0,0,0,0); +DELETE FROM `creature_addon` WHERE `guid`=201998; +INSERT INTO `creature_addon` (`guid`,`bytes2`) VALUES +(201998,1); + +-- Disturbed Glacial Revenant SAI +SET @ENTRY := 36874; -- NPC entry +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,4,0,0,12000,15000,11,55216,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Disturbed Glacial Revenant - Combat - Cast Avalanche'); From 469ba0b0e797c64040d0b4a3fbe371d8d5baa0b6 Mon Sep 17 00:00:00 2001 From: Chaplain Date: Thu, 10 May 2012 19:39:29 +0300 Subject: [PATCH 0718/1149] Clean up for 58f63509cd4 *restore const methods in spellauraeffects *fix typo in Unit::CalculateMeleeDamage thx bytewarrior *minor speed up in SpellInfo::GetMaxTicks() thx Warpten *deleted duble ';;' thx bytewarrior *speed up in SpellInfo::GetMaxTicks() thx goes to Vincent-Michael --- .../game/AI/ScriptedAI/ScriptedEscortAI.cpp | 2 +- src/server/game/Entities/Unit/Unit.cpp | 2 +- .../game/Spells/Auras/SpellAuraEffects.cpp | 10 ++++---- .../game/Spells/Auras/SpellAuraEffects.h | 8 +++---- src/server/game/Spells/SpellEffects.cpp | 2 +- src/server/game/Spells/SpellInfo.cpp | 24 +++++++++---------- 6 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 688d48b41ad..2243734f642 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -383,7 +383,7 @@ void npc_escortAI::FillPointMovementListForCreature() if (movePoints.empty()) return; - ScriptPointVector::const_iterator itrEnd = movePoints.end();; + ScriptPointVector::const_iterator itrEnd = movePoints.end(); for (ScriptPointVector::const_iterator itr = movePoints.begin(); itr != itrEnd; ++itr) { Escort_Waypoint point(itr->uiPointId, itr->fX, itr->fY, itr->fZ, itr->uiWaitTime); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a04e2ac0e48..f4f41ff6b5f 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1151,7 +1151,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam damage += CalculateDamage(damageInfo->attackType, false, true); // Add melee damage bonus damage = MeleeDamageBonusDone(damageInfo->target, damage, damageInfo->attackType); - damage = MeleeDamageBonusTaken(damage, damageInfo->attackType); + damage = damageInfo->target->MeleeDamageBonusTaken(damage, damageInfo->attackType); // Calculate armor reduction if (IsDamageReducedByArmor((SpellSchoolMask)(damageInfo->damageSchoolMask))) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index e3d220d744f..c14e79dfe78 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -584,7 +584,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_MAGE && GetSpellInfo()->SpellFamilyFlags[0] & 0x8000 && m_spellInfo->SpellFamilyFlags[2] & 0x8) { // +80.53% from +spd bonus - DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8053f;; + DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8053f; } break; case SPELL_AURA_DUMMY: @@ -1263,7 +1263,7 @@ void AuraEffect::SendTickImmune(Unit* target, Unit* caster) const caster->SendSpellDamageImmune(target, m_spellInfo->Id); } -void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit* caster) +void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit* caster) const { bool prevented = GetBase()->CallScriptEffectPeriodicHandlers(this, aurApp); if (prevented) @@ -6146,7 +6146,7 @@ void AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick(Unit* target, Unit* sLog->outDebug(LOG_FILTER_SPELLS_AURAS,"AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell %u has non-existent spell %u in EffectTriggered[%d] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex()); } -void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) +void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const { if (!caster || !target->isAlive()) return; @@ -6288,7 +6288,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) caster->DealDamage(target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true); } -void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) +void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) const { if (!caster || !target->isAlive()) return; @@ -6388,7 +6388,7 @@ void AuraEffect::HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster) caster->HealBySpell(target, GetSpellInfo(), damage); } -void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) +void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const { if (!caster || !target->isAlive()) return; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index 77742e17e51..64079918638 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -83,7 +83,7 @@ class AuraEffect bool HasSpellClassMask() const { return m_spellInfo->Effects[m_effIndex].SpellClassMask; } void SendTickImmune(Unit* target, Unit* caster) const; - void PeriodicTick(AuraApplication * aurApp, Unit* caster); + void PeriodicTick(AuraApplication * aurApp, Unit* caster) const; void HandleProc(AuraApplication* aurApp, ProcEventInfo& eventInfo); @@ -285,10 +285,10 @@ class AuraEffect void HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const; void HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster) const; void HandlePeriodicTriggerSpellWithValueAuraTick(Unit* target, Unit* caster) const; - void HandlePeriodicDamageAurasTick(Unit* target, Unit* caster); - void HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster); + void HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const; + void HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) const; void HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster) const; - void HandlePeriodicHealAurasTick(Unit* target, Unit* caster); + void HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const; void HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) const; void HandleObsModPowerAuraTick(Unit* target, Unit* caster) const; void HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) const; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 06493dd070a..ba3e54075a1 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1652,7 +1652,7 @@ void Spell::EffectHealMechanical(SpellEffIndex /*effIndex*/) uint32 heal = m_originalCaster->SpellHealingBonusDone(unitTarget, m_spellInfo, uint32(damage), HEAL); - m_healing += unitTarget->SpellHealingBonusTaken(m_spellInfo, heal, HEAL);; + m_healing += unitTarget->SpellHealingBonusTaken(m_spellInfo, heal, HEAL); } void Spell::EffectHealthLeech(SpellEffIndex effIndex) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 7732908ac47..e9e1b0eee8d 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1982,22 +1982,20 @@ uint32 SpellInfo::GetMaxTicks() const if (DotDuration > 30000) DotDuration = 30000; - uint8 x = 0; - for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j) + for (uint8 x = 0; x < MAX_SPELL_EFFECTS; x++) { - if (Effects[j].Effect == SPELL_EFFECT_APPLY_AURA && ( - Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE || - Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_HEAL || - Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_LEECH)) - { - x = j; - break; - } + if (Effects[x].Effect == SPELL_EFFECT_APPLY_AURA) + switch (Effects[x].ApplyAuraName) + { + case SPELL_AURA_PERIODIC_DAMAGE: + case SPELL_AURA_PERIODIC_HEAL: + case SPELL_AURA_PERIODIC_LEECH: + if (Effects[x].Amplitude != 0) + return DotDuration / Effects[x].Amplitude; + break; + } } - if (Effects[x].Amplitude != 0) - return DotDuration / Effects[x].Amplitude; - return 6; } From 587e6cb77eefb1615eded5c24815f7470fab1662 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 10 May 2012 20:22:22 -0230 Subject: [PATCH 0719/1149] DB/waypoints: Add some missing pathing to Pit of Saron --- .../world/2012_05_10_05_world_waypoints.sql | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 sql/updates/world/2012_05_10_05_world_waypoints.sql diff --git a/sql/updates/world/2012_05_10_05_world_waypoints.sql b/sql/updates/world/2012_05_10_05_world_waypoints.sql new file mode 100644 index 00000000000..1677d74c4a7 --- /dev/null +++ b/sql/updates/world/2012_05_10_05_world_waypoints.sql @@ -0,0 +1,88 @@ +-- Deathwhisper Necrolyte pathing +SET @NPC := 202103; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,555.3976,303.5347,507.6232,0,0,0,100,0), +(@PATH,2,568.4896,297.9913,506.9572,0,0,0,100,0), +(@PATH,3,586.1476,292.5486,506.3322,0,0,0,100,0), +(@PATH,4,598.5833,292.6007,506.3322,0,0,0,100,0), +(@PATH,5,602.3438,300.2135,506.9457,0,0,0,100,0), +(@PATH,6,603.0573,307.5399,507.6957,0,0,0,100,0), +(@PATH,7,611.7239,316.1129,508.4457,0,0,0,100,0), +(@PATH,8,620.0677,312.684,508.1957,0,0,0,100,0), +(@PATH,9,622.184,305.0868,508.3207,0,0,0,100,0), +(@PATH,10,616.684,295.2083,507.8819,0,0,0,100,0), +(@PATH,11,613.9236,287.4288,507.0737,0,0,0,100,0), +(@PATH,12,618.5174,272.882,507.6097,0,0,0,100,0), +(@PATH,13,621.4445,263.4861,507.9438,0,0,0,100,0), +(@PATH,14,618.5174,272.882,507.6097,0,0,0,100,0), +(@PATH,15,613.9236,287.4288,507.0737,0,0,0,100,0), +(@PATH,16,616.684,295.2083,507.8819,0,0,0,100,0), +(@PATH,17,622.184,305.0868,508.3207,0,0,0,100,0), +(@PATH,18,620.0677,312.684,508.1,0,0,0,100,0), +(@PATH,19,611.7239,316.1129,508.4457,0,0,0,100,0), +(@PATH,20,603.0573,307.5399,507.6629,0,0,0,100,0), +(@PATH,21,602.3438,300.2135,506.8405,0,0,0,100,0), +(@PATH,22,598.5833,292.6007,506.3498,0,0,0,100,0), +(@PATH,23,586.1476,292.5486,506.3322,0,0,0,100,0), +(@PATH,24,568.4896,297.9913,506.9572,0,0,0,100,0); +DELETE FROM `creature_formations` WHERE `leaderGUID`=@NPC; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(@NPC,@NPC,0,0,2), +(@NPC,201819,7,270,2), +(@NPC,201934,7,306,2), +(@NPC,202121,7,342,2), +(@NPC,202196,7,18,2), +(@NPC,202098,7,54,2), +(@NPC,201954,7,90,2); + +-- Deathwhisper Necrolyte pathing +SET @NPC := 202273; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +UPDATE `creature` SET `position_x`=611.9375,`position_y`=117.441,`position_z`=508.0308 WHERE `guid` IN (202273,202054,201845,201914,202145,202227,201988); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,611.9375,117.441,508.0308,0,0,0,100,0), +(@PATH,2,620.9531,139.3004,506.531,0,0,0,100,0), +(@PATH,3,624.3854,153.9531,507.3376,0,0,0,100,0), +(@PATH,4,625.8316,167.6233,507.4478,0,0,0,100,0), +(@PATH,5,622.8368,183.6788,507.7706,0,0,0,100,0), +(@PATH,6,625.8316,167.6233,507.4478,0,0,0,100,0), +(@PATH,7,624.3854,153.9531,507.3376,0,0,0,100,0), +(@PATH,8,620.9531,139.3004,506.531,0,0,0,100,0), +(@PATH,9,611.9375,117.441,508.0308,0,0,0,100,0), +(@PATH,10,610.8828,99.47656,510.0737,0,0,0,100,0); +DELETE FROM `creature_formations` WHERE `leaderGUID`=@NPC; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(@NPC,@NPC,0,0,2), +(@NPC,202054,7,270,2), +(@NPC,201845,7,306,2), +(@NPC,201914,7,342,2), +(@NPC,202145,7,18,2), +(@NPC,202227,7,54,2), +(@NPC,201988,7,90,2); + +-- Fix previous creature removal +DELETE FROM `creature` WHERE `id`=42160; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`, `position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(42160,36881,658,3,1,0,0,592.975,176.104,510.1582,508.746,86400,0,0,1,0,0); +UPDATE `creature` SET `position_x`=611.9375,`position_y`=117.441,`position_z`=508.0308 WHERE `guid` IN (202273,202054,201845,201914,202145,202227,201988); +DELETE FROM `creature_formations` WHERE `leaderGUID`=202231; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(202231,202231,0,0,2), +(202231,202099,7,270,2), +(202231,202282,7,306,2), +(202231,202125,7,342,2), +(202231,202203,7,18,2), +(202231,201960,7,54,2), +(202231,42160,7,90,2); + +-- Update Scourgelord Tyrannus "Make him fly" +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=36794; From f12ec9d058dc7d90957376a3dea3325ffb93f9d8 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 10 May 2012 21:17:43 -0230 Subject: [PATCH 0720/1149] DB/waypoints: Add missing path to Pit of Saron --- .../world/2012_05_10_06_world_waypoints.sql | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 sql/updates/world/2012_05_10_06_world_waypoints.sql diff --git a/sql/updates/world/2012_05_10_06_world_waypoints.sql b/sql/updates/world/2012_05_10_06_world_waypoints.sql new file mode 100644 index 00000000000..6fd04d0e4da --- /dev/null +++ b/sql/updates/world/2012_05_10_06_world_waypoints.sql @@ -0,0 +1,40 @@ +-- Deathwhisper Necrolyte pathing +SET @NPC := 202063; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +UPDATE `creature` SET `position_x`=631.8229,`position_y`=229.7292,`position_z`=508.0604 WHERE `guid` IN (202028,202000,201957,201820,202122,202199); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,631.8229,229.7292,508.0604,0,0,0,100,0), +(@PATH,2,643.8733,215.2674,508.2268,0,0,0,100,0), +(@PATH,3,659.0139,215.9635,507.8518,0,0,0,100,0), +(@PATH,4,674.184,213.5833,508.8467,0,0,0,100,0), +(@PATH,5,678.8004,201.066,508.4717,0,0,0,100,0), +(@PATH,6,662.4636,183.0694,507.9585,0,0,0,100,0), +(@PATH,7,650.8941,171.5642,507.7085,0,0,0,100,0), +(@PATH,8,637.7292,155.2569,507.9196,0,0,0,100,0), +(@PATH,9,644.6389,130.2639,510.4212,0,0,0,100,0), +(@PATH,10,654.9896,121.3038,511.9212,0,0,0,100,0), +(@PATH,11,677.7448,136.6528,512.7715,0,0,0,100,0), +(@PATH,12,678.2847,149.1233,507.8965,0,0,0,100,0), +(@PATH,13,677.7448,136.6528,512.7715,0,0,0,100,0), +(@PATH,14,654.9896,121.3038,511.9212,0,0,0,100,0), +(@PATH,15,644.6389,130.2639,510.4212,0,0,0,100,0), +(@PATH,16,637.7292,155.2569,507.9196,0,0,0,100,0), +(@PATH,17,650.8941,171.5642,507.7085,0,0,0,100,0), +(@PATH,18,662.4636,183.0694,507.9585,0,0,0,100,0), +(@PATH,19,678.8004,201.066,508.4717,0,0,0,100,0), +(@PATH,20,674.184,213.5833,508.8467,0,0,0,100,0), +(@PATH,21,659.0139,215.9635,507.8518,0,0,0,100,0), +(@PATH,22,643.8733,215.2674,508.2268,0,0,0,100,0); +DELETE FROM `creature_formations` WHERE `leaderGUID`=@NPC; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(@NPC,@NPC,0,0,2), +(@NPC,202028,7,270,2), +(@NPC,202000,7,306,2), +(@NPC,201957,7,342,2), +(@NPC,201820,7,18,2), +(@NPC,202122,7,54,2), +(@NPC,202199,7,90,2); From d8a1a0e05ada916705388af91a7f533350df8d9c Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 11 May 2012 13:12:09 +0200 Subject: [PATCH 0721/1149] Scripts/Pit of Saron: Unlock passage to Tyrannus after first 2 bosses are down. --- .../PitOfSaron/instance_pit_of_saron.cpp | 27 +++++++++++++++++++ .../FrozenHalls/PitOfSaron/pit_of_saron.h | 1 + 2 files changed, 28 insertions(+) diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp index 24529801564..02782a22452 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp @@ -23,6 +23,12 @@ Position const SlaveLeaderPos = {689.7158f, -104.8736f, 513.7360f, 0.0f}; // position for Jaina and Sylvanas Position const EventLeaderPos2 = {1054.368f, 107.14620f, 628.4467f, 0.0f}; +DoorData const Doors[] = +{ + {GO_ICE_WALL, DATA_GARFROST, DOOR_TYPE_PASSAGE, BOUNDARY_NONE}, + {GO_ICE_WALL, DATA_ICK, DOOR_TYPE_PASSAGE, BOUNDARY_NONE}, +}; + class instance_pit_of_saron : public InstanceMapScript { public: @@ -33,6 +39,7 @@ class instance_pit_of_saron : public InstanceMapScript instance_pit_of_saron_InstanceScript(Map* map) : InstanceScript(map) { SetBossNumber(MAX_ENCOUNTER); + LoadDoorData(Doors); _garfrostGUID = 0; _krickGUID = 0; _ickGUID = 0; @@ -154,6 +161,26 @@ class instance_pit_of_saron : public InstanceMapScript } } + void OnGameObjectCreate(GameObject* go) + { + switch (go->GetEntry()) + { + case GO_ICE_WALL: + AddDoor(go, true); + break; + } + } + + void OnGameObjectRemove(GameObject* go) + { + switch (go->GetEntry()) + { + case GO_ICE_WALL: + AddDoor(go, false); + break; + } + } + bool SetBossState(uint32 type, EncounterState state) { if (!InstanceScript::SetBossState(type, state)) diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h index 728e0ccd955..4252f4f59a8 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h @@ -90,6 +90,7 @@ enum CreatureIds enum GameObjectIds { GO_SARONITE_ROCK = 196485, + GO_ICE_WALL = 201885, }; #endif From 4e354d6ca90b8aead894e95c8a55151f9b90027b Mon Sep 17 00:00:00 2001 From: joschiwald Date: Fri, 11 May 2012 22:43:06 +0200 Subject: [PATCH 0722/1149] Core/Spells: fix damage mods from caster on target --- src/server/game/Entities/Unit/Unit.cpp | 32 +++++++++---------- src/server/game/Entities/Unit/Unit.h | 6 ++-- .../game/Spells/Auras/SpellAuraEffects.cpp | 14 ++++---- src/server/game/Spells/Auras/SpellAuras.cpp | 4 +-- src/server/game/Spells/SpellEffects.cpp | 26 +++++++-------- src/server/scripts/Spells/spell_hunter.cpp | 2 +- src/server/scripts/Spells/spell_shaman.cpp | 2 +- src/server/scripts/Spells/spell_warrior.cpp | 2 +- 8 files changed, 44 insertions(+), 44 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f4f41ff6b5f..1783db9b14e 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -954,7 +954,7 @@ uint32 Unit::SpellNonMeleeDamageLog(Unit* victim, uint32 spellID, uint32 damage) SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID); SpellNonMeleeDamage damageInfo(this, victim, spellInfo->Id, spellInfo->SchoolMask); damage = SpellDamageBonusDone(victim, spellInfo, damage, SPELL_DIRECT_DAMAGE); - damage = victim->SpellDamageBonusTaken(spellInfo, damage, SPELL_DIRECT_DAMAGE); + damage = victim->SpellDamageBonusTaken(this, spellInfo, damage, SPELL_DIRECT_DAMAGE); CalculateSpellDamageTaken(&damageInfo, damage, spellInfo); DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); @@ -1151,7 +1151,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam damage += CalculateDamage(damageInfo->attackType, false, true); // Add melee damage bonus damage = MeleeDamageBonusDone(damageInfo->target, damage, damageInfo->attackType); - damage = damageInfo->target->MeleeDamageBonusTaken(damage, damageInfo->attackType); + damage = damageInfo->target->MeleeDamageBonusTaken(this, damage, damageInfo->attackType); // Calculate armor reduction if (IsDamageReducedByArmor((SpellSchoolMask)(damageInfo->damageSchoolMask))) @@ -1405,7 +1405,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) if (Unit* caster = (*dmgShieldItr)->GetCaster()) { damage = caster->SpellDamageBonusDone(this, i_spellProto, damage, SPELL_DIRECT_DAMAGE); - damage = this->SpellDamageBonusTaken(i_spellProto, damage, SPELL_DIRECT_DAMAGE); + damage = this->SpellDamageBonusTaken(caster, i_spellProto, damage, SPELL_DIRECT_DAMAGE); } // No Unit::CalcAbsorbResist here - opcode doesn't send that data - this damage is probably not affected by that @@ -3660,7 +3660,7 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId if (Unit* caster = aura->GetCaster()) { healAmount = caster->SpellHealingBonusDone(this, aura->GetSpellInfo(), healAmount, HEAL, dispelInfo.GetRemovedCharges()); - healAmount = this->SpellHealingBonusTaken(aura->GetSpellInfo(), healAmount, HEAL, dispelInfo.GetRemovedCharges()); + healAmount = this->SpellHealingBonusTaken(caster, aura->GetSpellInfo(), healAmount, HEAL, dispelInfo.GetRemovedCharges()); } CastCustomSpell(this, 33778, &healAmount, NULL, NULL, true, NULL, NULL, aura->GetCasterGUID()); @@ -10806,7 +10806,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin return uint32(std::max(tmpDamage, 0.0f)); } -uint32 Unit::SpellDamageBonusTaken(SpellInfo const* spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack) +uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack) { if (!spellProto || damagetype == DIRECT_DAMAGE) return pdamage; @@ -10840,7 +10840,7 @@ uint32 Unit::SpellDamageBonusTaken(SpellInfo const* spellProto, uint32 pdamage, // From caster spells AuraEffectList const& mOwnerTaken = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER); for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i) - if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectedOnSpell(spellProto)) + if ((*i)->GetCasterGUID() == caster->GetGUID() && (*i)->IsAffectedOnSpell(spellProto)) AddPctN(TakenTotalMod, (*i)->GetAmount()); // Mod damage from spell mechanic @@ -11351,7 +11351,7 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui return uint32(std::max(heal, 0.0f)); } -uint32 Unit::SpellHealingBonusTaken(SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack) +uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack) { float TakenTotalMod = 1.0f; @@ -11425,7 +11425,7 @@ uint32 Unit::SpellHealingBonusTaken(SpellInfo const *spellProto, uint32 healamou AuraEffectList const& mHealingGet= GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_RECEIVED); for (AuraEffectList::const_iterator i = mHealingGet.begin(); i != mHealingGet.end(); ++i) - if (GetGUID() == (*i)->GetCasterGUID() && (*i)->IsAffectedOnSpell(spellProto)) + if (caster->GetGUID() == (*i)->GetCasterGUID() && (*i)->IsAffectedOnSpell(spellProto)) AddPctN(TakenTotalMod, (*i)->GetAmount()); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) @@ -11808,7 +11808,7 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType return uint32(std::max(tmpDamage, 0.0f)); } -uint32 Unit::MeleeDamageBonusTaken(uint32 pdamage, WeaponAttackType attType, SpellInfo const *spellProto) +uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackType attType, SpellInfo const *spellProto) { if (pdamage == 0) return 0; @@ -11832,15 +11832,15 @@ uint32 Unit::MeleeDamageBonusTaken(uint32 pdamage, WeaponAttackType attType, Spe // ..taken TakenTotalMod *= GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, GetMeleeDamageSchoolMask()); - // From caster spells - AuraEffectList const& mOwnerTaken = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER); - for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i) - if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectedOnSpell(spellProto)) - AddPctN(TakenTotalMod, (*i)->GetAmount()); - // .. taken pct (special attacks) if (spellProto) { + // From caster spells + AuraEffectList const& mOwnerTaken = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER); + for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i) + if ((*i)->GetCasterGUID() == attacker->GetGUID() && (*i)->IsAffectedOnSpell(spellProto)) + AddPctN(TakenTotalMod, (*i)->GetAmount()); + // Mod damage from spell mechanic uint32 mechanicMask = spellProto->GetAllEffectsMechanicMask(); @@ -14483,7 +14483,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: doing %u damage from spell id %u (triggered by %s aura of spell %u)", triggeredByAura->GetAmount(), spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); SpellNonMeleeDamage damageInfo(this, target, spellInfo->Id, spellInfo->SchoolMask); uint32 newDamage = SpellDamageBonusDone(target, spellInfo, triggeredByAura->GetAmount(), SPELL_DIRECT_DAMAGE); - newDamage = target->SpellDamageBonusTaken(spellInfo, newDamage, SPELL_DIRECT_DAMAGE); + newDamage = target->SpellDamageBonusTaken(this, spellInfo, newDamage, SPELL_DIRECT_DAMAGE); CalculateSpellDamageTaken(&damageInfo, newDamage, spellInfo); DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); SendSpellNonMeleeDamageLog(&damageInfo); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index e7ea70dc290..c3cfc415c41 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2038,14 +2038,14 @@ class Unit : public WorldObject int32 SpellBaseDamageBonusDone(SpellSchoolMask schoolMask); int32 SpellBaseDamageBonusTaken(SpellSchoolMask schoolMask); uint32 SpellDamageBonusDone(Unit* victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1); - uint32 SpellDamageBonusTaken(SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1); + uint32 SpellDamageBonusTaken(Unit* caster, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1); int32 SpellBaseHealingBonusDone(SpellSchoolMask schoolMask); int32 SpellBaseHealingBonusTaken(SpellSchoolMask schoolMask); uint32 SpellHealingBonusDone(Unit* victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1); - uint32 SpellHealingBonusTaken(SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1); + uint32 SpellHealingBonusTaken(Unit* caster, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1); uint32 MeleeDamageBonusDone(Unit *pVictim, uint32 damage, WeaponAttackType attType, SpellInfo const *spellProto = NULL); - uint32 MeleeDamageBonusTaken(uint32 pdamage,WeaponAttackType attType, SpellInfo const *spellProto = NULL); + uint32 MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage,WeaponAttackType attType, SpellInfo const *spellProto = NULL); bool isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType = BASE_ATTACK); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index c14e79dfe78..bdbc5cb79d1 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -594,7 +594,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_SHAMAN && m_spellInfo->SpellFamilyFlags[1] & 0x400) { amount = caster->SpellHealingBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, SPELL_DIRECT_DAMAGE); - amount = GetBase()->GetUnitOwner()->SpellHealingBonusTaken(GetSpellInfo(), amount, SPELL_DIRECT_DAMAGE); + amount = GetBase()->GetUnitOwner()->SpellHealingBonusTaken(caster, GetSpellInfo(), amount, SPELL_DIRECT_DAMAGE); } break; case SPELL_AURA_PERIODIC_DAMAGE: @@ -4968,7 +4968,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool if (caster) { heal = caster->SpellHealingBonusDone(target, GetSpellInfo(), heal, HEAL, stack); - heal = target->SpellHealingBonusTaken(GetSpellInfo(), heal, HEAL, stack); + heal = target->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, HEAL, stack); } target->CastCustomSpell(target, 33778, &heal, &stack, NULL, true, NULL, this, GetCasterGUID()); @@ -6198,7 +6198,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const if (GetAuraType() == SPELL_AURA_PERIODIC_DAMAGE) { damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); - damage = target->SpellDamageBonusTaken(GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); + damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); // Calculate armor mitigation if (Unit::IsDamageReducedByArmor(GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), GetEffIndex())) @@ -6310,7 +6310,7 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c uint32 damage = std::max(GetAmount(), 0); damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); - damage = target->SpellDamageBonusTaken(GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); + damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); bool crit = IsPeriodicTickCrit(target, caster); if (crit) @@ -6353,7 +6353,7 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster); uint32 heal = uint32(caster->SpellHealingBonusDone(caster, GetSpellInfo(), uint32(new_damage * gainMultiplier), DOT, GetBase()->GetStackAmount())); - heal = uint32(caster->SpellHealingBonusTaken(GetSpellInfo(), heal, DOT, GetBase()->GetStackAmount())); + heal = uint32(caster->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, DOT, GetBase()->GetStackAmount())); int32 gain = caster->HealBySpell(caster, GetSpellInfo(), heal); caster->getHostileRefManager().threatAssist(caster, gain * 0.5f, GetSpellInfo()); @@ -6458,7 +6458,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const } damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); - damage = target->SpellHealingBonusTaken(GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); + damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); } bool crit = IsPeriodicTickCrit(target, caster); @@ -6749,7 +6749,7 @@ void AuraEffect::HandleProcTriggerDamageAuraProc(AuraApplication* aurApp, ProcEv Unit* triggerTarget = eventInfo.GetProcTarget(); SpellNonMeleeDamage damageInfo(target, triggerTarget, GetId(), GetSpellInfo()->SchoolMask); uint32 damage = target->SpellDamageBonusDone(triggerTarget, GetSpellInfo(), GetAmount(), SPELL_DIRECT_DAMAGE); - damage = triggerTarget->SpellDamageBonusTaken(GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); + damage = triggerTarget->SpellDamageBonusTaken(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); target->CalculateSpellDamageTaken(&damageInfo, damage, GetSpellInfo()); target->DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); target->SendSpellNonMeleeDamageLog(&damageInfo); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index b3169ce6fcc..4dda1c731a7 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1213,7 +1213,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 3790, 1)) { uint32 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), GetEffect(0)->GetAmount(), DOT); - damage = target->SpellDamageBonusTaken(GetSpellInfo(), damage, DOT); + damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT); int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * int32(damage) / 100; int32 heal = int32(CalculatePctN(basepoints0, 15)); @@ -1228,7 +1228,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 3021, 1)) { uint32 damage = caster->SpellHealingBonusDone(target, GetSpellInfo(), GetEffect(0)->GetAmount(), HEAL); - damage = target->SpellHealingBonusTaken(GetSpellInfo(), damage, HEAL); + damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, HEAL); int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * int32(damage) / 100; caster->CastCustomSpell(target, 63544, &basepoints0, NULL, NULL, true, NULL, GetEffect(0)); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index ba3e54075a1..b1a3cd687df 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -468,7 +468,7 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) { uint32 pdamage = uint32(std::max(aura->GetAmount(), 0)); pdamage = m_caster->SpellDamageBonusDone(unitTarget, aura->GetSpellInfo(), pdamage, DOT, aura->GetBase()->GetStackAmount()); - pdamage = unitTarget->SpellDamageBonusTaken(aura->GetSpellInfo(), pdamage, DOT, aura->GetBase()->GetStackAmount()); + pdamage = unitTarget->SpellDamageBonusTaken(m_caster, aura->GetSpellInfo(), pdamage, DOT, aura->GetBase()->GetStackAmount()); uint32 pct_dir = m_caster->CalculateSpellDamage(unitTarget, m_spellInfo, (effIndex + 1)); uint8 baseTotalTicks = uint8(m_caster->CalcSpellDuration(aura->GetSpellInfo()) / aura->GetSpellInfo()->Effects[EFFECT_0].Amplitude); damage += int32(CalculatePctU(pdamage * baseTotalTicks, pct_dir)); @@ -507,7 +507,7 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) if (m_spellInfo->SpellFamilyFlags[1] & 0x2) { int32 back_damage = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE); - back_damage = unitTarget->SpellDamageBonusTaken(m_spellInfo, (uint32)back_damage, SPELL_DIRECT_DAMAGE); + back_damage = unitTarget->SpellDamageBonusTaken(m_caster, m_spellInfo, (uint32)back_damage, SPELL_DIRECT_DAMAGE); // Pain and Suffering reduces damage if (AuraEffect* aurEff = m_caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 2874, 0)) AddPctN(back_damage, -aurEff->GetAmount()); @@ -716,7 +716,7 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) if (m_originalCaster && damage > 0 && apply_direct_bonus) { damage = m_originalCaster->SpellDamageBonusDone(unitTarget, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE); - damage = unitTarget->SpellDamageBonusTaken(m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE); + damage = unitTarget->SpellDamageBonusTaken(m_originalCaster, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE); } m_damage += damage; @@ -1397,7 +1397,7 @@ void Spell::EffectPowerDrain(SpellEffIndex effIndex) // add spell damage bonus damage = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); - damage = unitTarget->SpellDamageBonusTaken(m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); + damage = unitTarget->SpellDamageBonusTaken(m_caster, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); // resilience reduce mana draining effect at spell crit damage reduction (added in 2.4) int32 power = damage; @@ -1562,7 +1562,7 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/) if (Unit* auraCaster = targetAura->GetCaster()) { tickheal = auraCaster->SpellHealingBonusDone(unitTarget, targetAura->GetSpellInfo(), tickheal, DOT); - tickheal = unitTarget->SpellHealingBonusTaken(targetAura->GetSpellInfo(), tickheal, DOT); + tickheal = unitTarget->SpellHealingBonusTaken(auraCaster, targetAura->GetSpellInfo(), tickheal, DOT); } //int32 tickheal = targetAura->GetSpellInfo()->EffectBasePoints[idx] + 1; //It is said that talent bonus should not be included @@ -1588,7 +1588,7 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/) else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags[1] & 0x2000000) { addhealth = caster->SpellHealingBonusDone(unitTarget, m_spellInfo, addhealth, HEAL); - addhealth = unitTarget->SpellHealingBonusTaken(m_spellInfo, addhealth, HEAL); + addhealth = unitTarget->SpellHealingBonusTaken(caster, m_spellInfo, addhealth, HEAL); if (AuraEffect const* aurEff = m_caster->GetAuraEffect(62971, 0)) { @@ -1606,7 +1606,7 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/) else addhealth = caster->SpellHealingBonusDone(unitTarget, m_spellInfo, addhealth, HEAL); - addhealth = unitTarget->SpellHealingBonusTaken(m_spellInfo, addhealth, HEAL); + addhealth = unitTarget->SpellHealingBonusTaken(caster, m_spellInfo, addhealth, HEAL); // Remove Grievious bite if fully healed if (unitTarget->HasAura(48920) && (unitTarget->GetHealth() + addhealth >= unitTarget->GetMaxHealth())) @@ -1633,7 +1633,7 @@ void Spell::EffectHealPct(SpellEffIndex /*effIndex*/) return; uint32 heal = m_originalCaster->SpellHealingBonusDone(unitTarget, m_spellInfo, unitTarget->CountPctFromMaxHealth(damage), HEAL); - heal = unitTarget->SpellHealingBonusTaken(m_spellInfo, heal, HEAL); + heal = unitTarget->SpellHealingBonusTaken(m_originalCaster, m_spellInfo, heal, HEAL); m_healing += heal; } @@ -1652,7 +1652,7 @@ void Spell::EffectHealMechanical(SpellEffIndex /*effIndex*/) uint32 heal = m_originalCaster->SpellHealingBonusDone(unitTarget, m_spellInfo, uint32(damage), HEAL); - m_healing += unitTarget->SpellHealingBonusTaken(m_spellInfo, heal, HEAL); + m_healing += unitTarget->SpellHealingBonusTaken(m_originalCaster, m_spellInfo, heal, HEAL); } void Spell::EffectHealthLeech(SpellEffIndex effIndex) @@ -1664,7 +1664,7 @@ void Spell::EffectHealthLeech(SpellEffIndex effIndex) return; damage = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); - damage = unitTarget->SpellDamageBonusTaken(m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); + damage = unitTarget->SpellDamageBonusTaken(m_caster, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "HealthLeech :%i", damage); @@ -1677,7 +1677,7 @@ void Spell::EffectHealthLeech(SpellEffIndex effIndex) if (m_caster->isAlive()) { healthGain = m_caster->SpellHealingBonusDone(m_caster, m_spellInfo, healthGain, HEAL); - healthGain = m_caster->SpellHealingBonusTaken(m_spellInfo, healthGain, HEAL); + healthGain = m_caster->SpellHealingBonusTaken(m_caster, m_spellInfo, healthGain, HEAL); m_caster->HealBySpell(m_caster, m_spellInfo, uint32(healthGain)); } @@ -3543,7 +3543,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) // Add melee damage bonuses (also check for negative) uint32 damage = m_caster->MeleeDamageBonusDone(unitTarget, eff_damage, m_attackType, m_spellInfo); - m_damage += unitTarget->MeleeDamageBonusTaken(damage, m_attackType, m_spellInfo); + m_damage += unitTarget->MeleeDamageBonusTaken(m_caster, damage, m_attackType, m_spellInfo); } void Spell::EffectThreat(SpellEffIndex /*effIndex*/) @@ -3588,7 +3588,7 @@ void Spell::EffectHealMaxHealth(SpellEffIndex /*effIndex*/) if (m_originalCaster) { uint32 heal = m_originalCaster->SpellHealingBonusDone(unitTarget, m_spellInfo, addhealth, HEAL); - m_healing += unitTarget->SpellHealingBonusTaken(m_spellInfo, heal, HEAL); + m_healing += unitTarget->SpellHealingBonusTaken(m_originalCaster, m_spellInfo, heal, HEAL); } } diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 53a78e42c3c..896ed331bde 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -139,7 +139,7 @@ class spell_hun_chimera_shot : public SpellScriptLoader spellId = HUNTER_SPELL_CHIMERA_SHOT_SERPENT; basePoint = caster->SpellDamageBonusDone(unitTarget, aura->GetSpellInfo(), aurEff->GetAmount(), DOT, aura->GetStackAmount()); ApplyPctN(basePoint, TickCount * 40); - basePoint = unitTarget->SpellDamageBonusTaken(aura->GetSpellInfo(), basePoint, DOT, aura->GetStackAmount()); + basePoint = unitTarget->SpellDamageBonusTaken(caster, aura->GetSpellInfo(), basePoint, DOT, aura->GetStackAmount()); } // Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting. else if (familyFlag[1] & 0x00000080) diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 7e2756f28a5..f50dbb7773d 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -498,7 +498,7 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_GLYPH_OF_HEALING_STREAM_TOTEM, EFFECT_0)) AddPctN(damage, aurEff->GetAmount()); - damage = int32(target->SpellHealingBonusTaken(triggeringSpell, damage, HEAL)); + damage = int32(target->SpellHealingBonusTaken(owner, triggeringSpell, damage, HEAL)); } caster->CastCustomSpell(target, SPELL_HEALING_STREAM_TOTEM_HEAL, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID()); } diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index bb271139b6a..194753d6e90 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -194,7 +194,7 @@ class spell_warr_deep_wounds : public SpellScriptLoader damage = damage / ticks; - damage = target->SpellDamageBonusTaken(GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); + damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); caster->CastCustomSpell(target, SPELL_DEEP_WOUNDS_RANK_PERIODIC, &damage, NULL, NULL, true); } From 1327591a926bd6eaa5b1dcc7e1aa2f39e5e1c08b Mon Sep 17 00:00:00 2001 From: Malcrom Date: Fri, 11 May 2012 20:18:16 -0230 Subject: [PATCH 0723/1149] DB/Gameobject_template: Update flags for two Pit of Saron object. --- sql/updates/world/2012_05_11_01_world_gameobject_template.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2012_05_11_01_world_gameobject_template.sql diff --git a/sql/updates/world/2012_05_11_01_world_gameobject_template.sql b/sql/updates/world/2012_05_11_01_world_gameobject_template.sql new file mode 100644 index 00000000000..630a166276b --- /dev/null +++ b/sql/updates/world/2012_05_11_01_world_gameobject_template.sql @@ -0,0 +1,4 @@ +-- Lock Ice Wall and make untargetable +UPDATE `gameobject_template` SET `flags`=18 WHERE `entry`=201885; +-- Saronite Rock Should be untargetable +UPDATE `gameobject_template` SET `flags`=18 WHERE `entry`=196485; From a24110507e35b2ced9a58088f85e52392853be0b Mon Sep 17 00:00:00 2001 From: Malcrom Date: Fri, 11 May 2012 20:19:52 -0230 Subject: [PATCH 0724/1149] DB/waypoints: Add path for one Scourgelord Tyrannus spawn, Pit of Saron --- .../world/2012_05_11_00_world_waypoints.sql | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 sql/updates/world/2012_05_11_00_world_waypoints.sql diff --git a/sql/updates/world/2012_05_11_00_world_waypoints.sql b/sql/updates/world/2012_05_11_00_world_waypoints.sql new file mode 100644 index 00000000000..fa4e18f6468 --- /dev/null +++ b/sql/updates/world/2012_05_11_00_world_waypoints.sql @@ -0,0 +1,31 @@ +-- Scourgelord Tyrannus pathing +SET @NPC := 201951; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=873.783,`position_y`=136.9774,`position_z`=623.6115,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`) VALUES (@NPC,@PATH,50331648,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,873.783,136.9774,623.6115,0,0,0,100,0), +(@PATH,2,872.9045,139.2743,622.4446,0,0,0,100,0), +(@PATH,3,888.7917,171.3403,591.3615,0,0,0,100,0), +(@PATH,4,861.3073,209.8455,591.3615,0,0,0,100,0), +(@PATH,5,830.4913,254.5556,591.3615,0,0,0,100,0), +(@PATH,6,780.4844,277.6406,591.3615,0,0,0,100,0), +(@PATH,7,732.6771,272.4635,591.3615,0,0,0,100,0), +(@PATH,8,683.9028,265.276,591.3615,0,0,0,100,0), +(@PATH,9,612.3368,284.7934,553.4998,0,0,0,100,0), +(@PATH,10,554.816,303.1858,553.4998,0,0,0,100,0), +(@PATH,11,498.1024,309.0625,553.4998,0,0,0,100,0), +(@PATH,12,470.4167,230.0174,553.4998,0,0,0,100,0), +(@PATH,13,454.0087,175.2135,553.4998,0,0,0,100,0), +(@PATH,14,492.4288,127.1806,583.1108,0,0,0,100,0), +(@PATH,15,551.2604,121.6354,583.1108,0,0,0,100,0), +(@PATH,16,647.5573,126.3542,583.1108,0,0,0,100,0), +(@PATH,17,766.2222,130.9254,583.1108,0,0,0,100,0), +(@PATH,18,829.408,42.33854,583.1108,0,0,0,100,0), +(@PATH,19,746.7101,-53.03299,583.1108,0,0,0,100,0), +(@PATH,20,663.2379,-77.32291,583.1108,0,0,0,100,0), +(@PATH,21,618.6389,3.369792,583.1108,0,0,0,100,0), +(@PATH,22,641.8559,89.27604,583.1108,0,0,0,100,0), +(@PATH,23,794.1667,115.6858,583.1108,0,0,0,100,0); From e39634246ed49933b8d18854740793a0b2445145 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Fri, 11 May 2012 20:56:23 -0230 Subject: [PATCH 0725/1149] DB/conditions: Add conditions for Pit of Saron Script spells --- .../world/2012_05_11_02_world_conditions.sql | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 sql/updates/world/2012_05_11_02_world_conditions.sql diff --git a/sql/updates/world/2012_05_11_02_world_conditions.sql b/sql/updates/world/2012_05_11_02_world_conditions.sql new file mode 100644 index 00000000000..a10c27a0ef5 --- /dev/null +++ b/sql/updates/world/2012_05_11_02_world_conditions.sql @@ -0,0 +1,23 @@ +-- Spell Conditions for spell Necromantic Power 69347 +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=69347; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,69347,0,31,3,37496,0,0,'','Spell 69347 targets entry 37496'), +(13,1,69347,1,31,3,37497,0,0,'','Spell 69347 targets entry 37497'), +(13,1,69347,2,31,3,37498,0,0,'','Spell 69347 targets entry 37498'), +(13,1,69347,3,31,3,37584,0,0,'','Spell 69347 targets entry 37584'), +(13,1,69347,4,31,3,37587,0,0,'','Spell 69347 targets entry 37587'), +(13,1,69347,5,31,3,37588,0,0,'','Spell 69347 targets entry 37588'); + +-- Spell Conditions for spell Shriek of the Highborne 70512 +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=70512; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,70512,3,31,3,37584,0,0,'','Spell 70512 targets entry 37584'), +(13,1,70512,4,31,3,37587,0,0,'','Spell 70512 targets entry 37587'), +(13,1,70512,5,31,3,37588,0,0,'','Spell 70512 targets entry 37588'); + +-- Spell Conditions for spell Empowered Blizzard 70130 +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=70130; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,70130,0,31,3,37496,0,0,'','Spell 70130 targets entry 37496'), +(13,1,70130,1,31,3,37497,0,0,'','Spell 70130 targets entry 37497'), +(13,1,70130,2,31,3,37498,0,0,'','Spell 70130 targets entry 37498'); From d770c125e97cf4313d2c32adbb6d9ceab308d477 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 12 May 2012 12:19:41 -0230 Subject: [PATCH 0726/1149] Core/Scripts: Fix Halls of Reflection Portcullis door in Pit of Saron. Now requires Tyrannus boss kill to open. --- .../world/2012_05_12_00_world_gameobject_template.sql | 2 ++ .../FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp | 7 +++++++ .../Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h | 1 + 3 files changed, 10 insertions(+) create mode 100644 sql/updates/world/2012_05_12_00_world_gameobject_template.sql diff --git a/sql/updates/world/2012_05_12_00_world_gameobject_template.sql b/sql/updates/world/2012_05_12_00_world_gameobject_template.sql new file mode 100644 index 00000000000..ffa932c8640 --- /dev/null +++ b/sql/updates/world/2012_05_12_00_world_gameobject_template.sql @@ -0,0 +1,2 @@ +-- Lock Halls of Reflection Portcullis +UPDATE `gameobject_template` SET `flags`=18 WHERE `entry`=201848; diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp index 02782a22452..c75bdb8095f 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp @@ -27,6 +27,7 @@ DoorData const Doors[] = { {GO_ICE_WALL, DATA_GARFROST, DOOR_TYPE_PASSAGE, BOUNDARY_NONE}, {GO_ICE_WALL, DATA_ICK, DOOR_TYPE_PASSAGE, BOUNDARY_NONE}, + {GO_HALLS_OF_REFLECTION_PORTCULLIS, DATA_TYRANNUS, DOOR_TYPE_PASSAGE, BOUNDARY_NONE}, }; class instance_pit_of_saron : public InstanceMapScript @@ -168,6 +169,9 @@ class instance_pit_of_saron : public InstanceMapScript case GO_ICE_WALL: AddDoor(go, true); break; + case GO_HALLS_OF_REFLECTION_PORTCULLIS: + AddDoor(go, true); + break; } } @@ -178,6 +182,9 @@ class instance_pit_of_saron : public InstanceMapScript case GO_ICE_WALL: AddDoor(go, false); break; + case GO_HALLS_OF_REFLECTION_PORTCULLIS: + AddDoor(go, true); + break; } } diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h index 4252f4f59a8..768c3ba40ec 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h @@ -91,6 +91,7 @@ enum GameObjectIds { GO_SARONITE_ROCK = 196485, GO_ICE_WALL = 201885, + GO_HALLS_OF_REFLECTION_PORTCULLIS = 201848, }; #endif From 8a1417ae750765e1013f428545c8a49da6aa4e92 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 12 May 2012 12:23:21 -0230 Subject: [PATCH 0727/1149] Core/Scripts: Fix for previous --- .../Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp index c75bdb8095f..fa7b027961c 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp @@ -183,7 +183,7 @@ class instance_pit_of_saron : public InstanceMapScript AddDoor(go, false); break; case GO_HALLS_OF_REFLECTION_PORTCULLIS: - AddDoor(go, true); + AddDoor(go, false); break; } } From fa3ee22849e5f1634caedd75c7d28f031839a1a3 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 12 May 2012 12:49:36 -0230 Subject: [PATCH 0728/1149] Core/Script: Optimize code for previous commit for Pit of Saron. --- .../FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp index fa7b027961c..1301acf4c99 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp @@ -167,8 +167,6 @@ class instance_pit_of_saron : public InstanceMapScript switch (go->GetEntry()) { case GO_ICE_WALL: - AddDoor(go, true); - break; case GO_HALLS_OF_REFLECTION_PORTCULLIS: AddDoor(go, true); break; @@ -180,8 +178,6 @@ class instance_pit_of_saron : public InstanceMapScript switch (go->GetEntry()) { case GO_ICE_WALL: - AddDoor(go, false); - break; case GO_HALLS_OF_REFLECTION_PORTCULLIS: AddDoor(go, false); break; From 024a39af9f4c78dadadb5bfbde46ca1eaaf97f89 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 12 May 2012 21:11:41 +0200 Subject: [PATCH 0729/1149] Core: Tweaked ASSERT macro a bit - removed library assert as on Windows platforms it calls abort() and does not generaty crash dump files. --- src/server/shared/Debugging/Errors.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/shared/Debugging/Errors.h b/src/server/shared/Debugging/Errors.h index 6927fdb483f..48a8bda32ed 100755 --- a/src/server/shared/Debugging/Errors.h +++ b/src/server/shared/Debugging/Errors.h @@ -24,10 +24,10 @@ #include #include -#define WPAssert( assertion ) { if (!(assertion)) { ACE_Stack_Trace st; sLog->outError( "\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n", __FILE__, __LINE__, __FUNCTION__, #assertion, st.c_str()); assert( #assertion &&0 ); ((void(*)())NULL)();} } -#define WPError( assertion, errmsg ) if ( ! (assertion) ) { sLog->outError( "%\n%s:%i in %s ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); assert( false ); } -#define WPWarning( assertion, errmsg ) if ( ! (assertion) ) { sLog->outError( "\n%s:%i in %s WARNING:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); } -#define WPFatal( assertion, errmsg ) if ( ! (assertion) ) { sLog->outError( "\n%s:%i in %s FATAL ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); ACE_OS::sleep(10); assert( #assertion &&0 ); abort(); } +#define WPAssert(assertion) { if (!(assertion)) { ACE_Stack_Trace st; sLog->outError("\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n", __FILE__, __LINE__, __FUNCTION__, #assertion, st.c_str()); *((volatile int*)NULL) = 0; } } +#define WPError(assertion, errmsg) { if (!(assertion)) { sLog->outError("%\n%s:%i in %s ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg); *((volatile int*)NULL) = 0; } } +#define WPWarning(assertion, errmsg) { if (!(assertion)) { sLog->outError("\n%s:%i in %s WARNING:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg); } } +#define WPFatal(assertion, errmsg) { if (!(assertion)) { sLog->outError("\n%s:%i in %s FATAL ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg); ACE_OS::sleep(10); *((volatile int*)NULL) = 0; } } #define ASSERT WPAssert #endif From 44c88301c6b13dcac11f5478c37cd271781c3575 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sun, 13 May 2012 00:09:17 +0200 Subject: [PATCH 0730/1149] DB/Loot: Fix Loot you get from Satchel of Helpful Goods. Fixes #1183 --- ...2012_05_12_01_world_item_loot_template.sql | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sql/updates/world/2012_05_12_01_world_item_loot_template.sql diff --git a/sql/updates/world/2012_05_12_01_world_item_loot_template.sql b/sql/updates/world/2012_05_12_01_world_item_loot_template.sql new file mode 100644 index 00000000000..052b749c48c --- /dev/null +++ b/sql/updates/world/2012_05_12_01_world_item_loot_template.sql @@ -0,0 +1,92 @@ +DELETE FROM `item_loot_template` WHERE `entry` BETWEEN 51999 AND 52005; +INSERT INTO `item_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Satchel of Helpfull Goods (level 0-25) +(51999,51964,0,1,1,1,1), -- Vigorous Belt +(51999,51968,0,1,1,1,1), -- Enumerated Wrap +(51999,51978,0,1,1,1,1), -- Earthbound Girdle +(51999,51994,25,1,1,1,1), -- Tumultuous Cloak +-- Satchel of Helpfull Goods (level 26-35) +(52000,51965,0,1,1,1,1), -- Vigorous Handguards +(52000,51973,0,1,1,1,1), -- Enumerated Handwraps +(52000,51980,0,1,1,1,1), -- Earthbound Handgrips +(52000,51996,25,1,1,1,1), -- Tumultuous Necklace +-- Satchel of Helpfull Goods (level 36-45) +(52001,51966,0,1,1,1,1), -- Vigorous Spaulders +(52001,51974,0,1,1,1,1), -- Enumerated Shoulderpads +(52001,51976,0,1,1,1,1), -- Earthbound Shoulderguards +(52001,51984,0,1,1,1,1), -- Stalwart Shoulderpads +(52001,51992,25,1,1,1,1), -- Tumultuous Ring +-- Satchel of Helpfull Goods (level 46-55) +(52002,51962,0,1,1,1,1), -- Vigorous Bracers +(52002,51963,0,1,1,1,1), -- Vigorous Stompers +(52002,51967,0,1,1,1,1), -- Enumerated Sandals +(52002,51972,0,1,1,1,1), -- Enumerated Bracers +(52002,51981,0,1,1,1,1), -- Earthbound Wristguards +(52002,51982,0,1,1,1,1), -- Earthbound Boots +(52002,51989,0,1,1,1,1), -- Stalwart Bands +(52002,51990,0,1,1,1,1), -- Stalwart Treads +-- Satchel of Helpfull Goods (level 56-60) +(52003,51959,0,1,1,1,1), -- Vigorous Belt +(52003,51971,0,1,1,1,1), -- Enumerated Belt +(52003,51977,0,1,1,1,1), -- Earthbound Girdle +(52003,51985,0,1,1,1,1), -- Stalwart Belt +(52003,51993,25,1,1,1,1), -- Turbulent Cloak +-- Satchel of Helpfull Goods (level 61-64) +(52004,51960,0,1,1,1,1), -- Vigorous Gloves +(52004,51970,0,1,1,1,1), -- Enumerated Gloves +(52004,51979,0,1,1,1,1), -- Earthbound Grips +(52004,51987,0,1,1,1,1), -- Stalwart Grips +(52004,51995,25,1,1,1,1), -- Turbulent Necklace +-- Satchel of Helpfull Goods (level 65-70) +(52005,51961,0,1,1,1,1), -- Vigorous Shoulderguards +(52005,51969,0,1,1,1,1), -- Enumerated Shoulders +(52005,51975,0,1,1,1,1), -- Earthbound Shoulders +(52005,51983,0,1,1,1,1), -- Stalwart Shoulderguards +(52005,51991,25,1,0,1,1); -- Turbulent Signet +-- ------------------------------------------------------------------- +-- Set some Parameters +-- ------------------------------------------------------------------- +SET @Cloth := 400; -- Class Bitmask: 16 (Priest) +128 (Mage) +256 (Warlock) +SET @Leather1 := 1100; -- Class Bitmask: 4 (Hunter) +8 (Rogue) +64 (Shaman) +1024 (Druid) +SET @Leather2 := 1032; -- Class Bitmask: 8 (Rogue) +1024 (Druid) +SET @Mail1 := 3; -- Class Bitmask: 1 (Warrior) +2 (Paladin) +SET @Mail2 := 68; -- Class Bitmask: 4 (Hunter) +8 (Shaman) +SET @Plate := 35; -- Class Bitmask: 1 (Warrior) +2 (Paladin) +32 (DeathKnight) +-- Add conditions to make sure everyone gets beneficial loot for their class +-- ------------------------------------------------------------------- +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=5 AND `SourceGroup` BETWEEN 51999 AND 52005 ; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +-- Cloth Items +(5,51999,51968,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Wrap only for clothusers'), +(5,52000,51973,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Handwraps only for clothusers'), +(5,52001,51974,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Shoulderpads only for clothusers'), +(5,52002,51967,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Sandals only for clothusers'), +(5,52002,51972,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Bracers only for clothusers'), +(5,52003,51971,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Belt only for clothusers'), +(5,52004,51970,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Gloves only for clothusers'), +(5,52005,51969,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Shoulders only for clothusers'), +-- Leather Items +(5,51999,51964,0,0,15,0,@Leather1,0,0,0,0,'','SOHG: Vigorous Belt only for leatherusers'), +(5,52000,51965,0,0,15,0,@Leather1,0,0,0,0,'','SOHG: Vigorous Handguards only for leatherusers'), +(5,52001,51966,0,0,15,0,@Leather2,0,0,0,0,'','SOHG: Vigorous Spaulders only for leatherusers'), +(5,52002,51962,0,0,15,0,@Leather2,0,0,0,0,'','SOHG: Vigorous Bracers only for leatherusers'), +(5,52002,51963,0,0,15,0,@Leather2,0,0,0,0,'','SOHG: Vigorous Stompers only for leatherusers'), +(5,52003,51959,0,0,15,0,@Leather2,0,0,0,0,'','SOHG: Vigorous Belt only for leatherusers'), +(5,52004,51960,0,0,15,0,@Leather2,0,0,0,0,'','SOHG: Vigorous Gloves only for leatherusers'), +(5,52005,51961,0,0,15,0,@Leather2,0,0,0,0,'','SOHG: Vigorous Shoulderguards only for leatherusers'), +-- Mail Items +(5,51999,51978,0,0,15,0,@Mail1,0,0,0,0,'','SOHG: Earthbound Girdle only for mail users'), +(5,52000,51980,0,0,15,0,@Mail1,0,0,0,0,'','SOHG: Earthbound Handgrips only for mail users'), +(5,52001,51976,0,0,15,0,@Mail2,0,0,0,0,'','SOHG: Earthbound Shoulderguards only for mail users'), +(5,52002,51982,0,0,15,0,@Mail2,0,0,0,0,'','SOHG: Earthbound Boots only for mail users'), +(5,52002,51981,0,0,15,0,@Mail2,0,0,0,0,'','SOHG: Earthbound Wristguards only for mail users'), +(5,52003,51977,0,0,15,0,@Mail2,0,0,0,0,'','SOHG: Earthbound Girdle only for mail users'), +(5,52004,51979,0,0,15,0,@Mail2,0,0,0,0,'','SOHG: Earthbound Grips only for mail users'), +(5,52005,51975,0,0,15,0,@Mail2,0,0,0,0,'','SOHG: Earthbound Shoulders only for mail users'), +-- Plate Items +(5,52001,51984,0,0,15,0,@Plate,0,0,0,0,'','SOHG: Stalwart Shoulderpads only for plate users'), +(5,52002,51989,0,0,15,0,@Plate,0,0,0,0,'','SOHG: Stalwart Bands only for plate users'), +(5,52002,51990,0,0,15,0,@Plate,0,0,0,0,'','SOHG: Stalwart Treads only for plate users'), +(5,52003,51985,0,0,15,0,@Plate,0,0,0,0,'','SOHG: Stalwart Belt only for plate users'), +(5,52004,51987,0,0,15,0,@Plate,0,0,0,0,'','SOHG: Stalwart Grips only for plate users'), +(5,52005,51983,0,0,15,0,@Plate,0,0,0,0,'','SOHG: Stalwart Shoulderguards only for plate users'); From 7190b1f33680a08fd311840c517388b92eaaba0f Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sun, 13 May 2012 00:40:55 +0200 Subject: [PATCH 0731/1149] DB/Loot: Add loot for HoR, fixing some startup errors along the way --- ...5_12_02_world_gameobject_loot_template.sql | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 sql/updates/world/2012_05_12_02_world_gameobject_loot_template.sql diff --git a/sql/updates/world/2012_05_12_02_world_gameobject_loot_template.sql b/sql/updates/world/2012_05_12_02_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..b1f445faa59 --- /dev/null +++ b/sql/updates/world/2012_05_12_02_world_gameobject_loot_template.sql @@ -0,0 +1,37 @@ +-- Add Reference Loots +SET @RefNormal := 35091; +SET @RefHeroic := 35092; +DELETE FROM `reference_loot_template` WHERE `entry` IN (@RefNormal,@RefHeroic); +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Normal Loot +(@RefNormal,49839,0,1,1,1,1), -- Mourning Malice +(@RefNormal,49840,0,1,1,1,1), -- Hate-Forged Cleaver +(@RefNormal,49841,0,1,1,1,1), -- Blackened Geist Ribs +(@RefNormal,49842,0,1,1,1,1), -- Tapestry of the Frozen Throne +(@RefNormal,49843,0,1,1,1,1), -- Crystalline Citadel Gauntlets +(@RefNormal,49844,0,1,1,1,1), -- Crypt Fiend Slayer +(@RefNormal,49845,0,1,1,1,1), -- Bone Golem Scapula +(@RefNormal,49846,0,1,1,1,1), -- Chilled Heart of the Glacier +(@RefNormal,49847,0,1,1,1,1), -- Legguards of Untimely Demise +(@RefNormal,49848,0,1,1,1,1), -- Grim Lasher Shoulderguards +(@RefNormal,49849,0,1,1,1,1), -- Tattered Glacial-Woven Hood +(@RefNormal,49851,0,1,1,1,1), -- Greathelm of the Silver Hand +-- Heroic Loot +(@RefHeroic,50303,0,1,1,1,1), -- Black Icicle +(@RefHeroic,50302,0,1,1,1,1), -- Liar's Tongue +(@RefHeroic,50311,0,1,1,1,1), -- Second Helm of the Executioner +(@RefHeroic,50312,0,1,1,1,1), -- Chestguard of Broken Branches +(@RefHeroic,50310,0,1,1,1,1), -- Fossilized Ammonite Choker +(@RefHeroic,50313,0,1,1,1,1), -- Oath of Empress Zoe +(@RefHeroic,50309,0,1,1,1,1), -- Shriveled Heart +(@RefHeroic,50314,0,1,1,1,1), -- Strip of Remorse +(@RefHeroic,50308,0,1,1,1,1), -- Blighted Leather Footpads +(@RefHeroic,50305,0,1,1,1,1), -- Grinning Skull Boots +(@RefHeroic,50306,0,1,1,1,1), -- The Lady's Promise +(@RefHeroic,50304,0,1,1,1,1); -- Hoarfrost Gauntlets +-- Assign to the chest +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (27985,27993); +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(27985,1,100,1,0,-@RefNormal,2), -- Two from Normal Reference Loot +(27993,1,100,1,0,-@RefHeroic,2), -- Two from Heroic Reference Loot +(27993,43102,85,1,0,1,1); -- Frozen Orb From 5709929d2b575e83f427c7f48cd6bd0d7ed1b29d Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 13 May 2012 11:33:42 -0230 Subject: [PATCH 0732/1149] Core/Threat: Fix by faq. Turning gm on, now drops threat. Dead mobs no longer holds threat on player. Also fixed some Engrish. --- src/server/game/Combat/ThreatManager.cpp | 4 ++++ src/server/game/Entities/Creature/Creature.cpp | 10 +++++----- src/server/game/Entities/Unit/Unit.cpp | 9 ++++++--- src/server/game/Entities/Unit/Unit.h | 2 +- .../Northrend/IcecrownCitadel/icecrown_citadel.cpp | 2 +- src/server/scripts/Spells/spell_item.cpp | 2 +- 6 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index e604eaf9024..104d2d3d52b 100755 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -535,6 +535,10 @@ void ThreatManager::processThreatEvent(ThreatRefStatusChangeEvent* threatRefStat setCurrentVictim(NULL); setDirty(true); } + if (getOwner() && getOwner()->IsInWorld()) + if (Unit* target = ObjectAccessor::GetUnit(*getOwner(), hostilRef->getUnitGuid())) + if (getOwner()->IsInMap(target)) + getOwner()->SendRemoveFromThreatListOpcode(hostilRef); iThreatContainer.remove(hostilRef); iThreatOfflineContainer.addReference(hostilRef); } diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index acdf2b16f2a..d120713636d 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -468,9 +468,9 @@ void Creature::Update(uint32 diff) switch (m_deathState) { - case JUST_ALIVED: - // Must not be called, see Creature::setDeathState JUST_ALIVED -> ALIVE promoting. - sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_ALIVED (4)", GetGUIDLow(), GetEntry()); + case JUST_RESPAWNED: + // Must not be called, see Creature::setDeathState JUST_RESPAWNED -> ALIVE promoting. + sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_RESPAWNED (4)", GetGUIDLow(), GetEntry()); break; case JUST_DIED: // Must not be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting. @@ -1555,7 +1555,7 @@ void Creature::setDeathState(DeathState s) Unit::setDeathState(CORPSE); } - else if (s == JUST_ALIVED) + else if (s == JUST_RESPAWNED) { //if (isPet()) // setActive(true); @@ -1611,7 +1611,7 @@ void Creature::Respawn(bool force) CreatureTemplate const* cinfo = GetCreatureTemplate(); SelectLevel(cinfo); - setDeathState(JUST_ALIVED); + setDeathState(JUST_RESPAWNED); uint32 displayID = GetNativeDisplayId(); CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 1783db9b14e..18b4b79a502 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12823,9 +12823,8 @@ void Unit::setDeathState(DeathState s) { // death state needs to be updated before RemoveAllAurasOnDeath() calls HandleChannelDeathItem(..) so that // it can be used to check creation of death items (such as soul shards). - m_deathState = s; - if (s != ALIVE && s != JUST_ALIVED) + if (s != ALIVE && s != JUST_RESPAWNED) { CombatStop(); DeleteThreatList(); @@ -12868,8 +12867,12 @@ void Unit::setDeathState(DeathState s) if (ZoneScript* zoneScript = GetZoneScript() ? GetZoneScript() : (ZoneScript*)GetInstanceScript()) zoneScript->OnUnitDeath(this); } - else if (s == JUST_ALIVED) + else if (s == JUST_RESPAWNED) + { RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); // clear skinnable for creature and player (at battleground) + } + + m_deathState = s; } /*######################################## diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index c3cfc415c41..2d6c5b1a86e 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -465,7 +465,7 @@ enum DeathState JUST_DIED = 1, CORPSE = 2, DEAD = 3, - JUST_ALIVED = 4, + JUST_RESPAWNED = 4, }; enum UnitState diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 5b208768b0c..fab9a5f0740 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -1290,7 +1290,7 @@ struct npc_argent_captainAI : public ScriptedAI if (spell->Id == SPELL_REVIVE_CHAMPION && !IsUndead) { IsUndead = true; - me->setDeathState(JUST_ALIVED); + me->setDeathState(JUST_RESPAWNED); uint32 newEntry = 0; switch (me->GetEntry()) { diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index eb2d3187636..045ae5a6f9a 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1095,7 +1095,7 @@ class spell_item_shimmering_vessel : public SpellScriptLoader void HandleDummy(SpellEffIndex /* effIndex */) { if (Creature* target = GetHitCreature()) - target->setDeathState(JUST_ALIVED); + target->setDeathState(JUST_RESPAWNED); } void Register() From 79a735fb01c3dc2c812f12a4c09612a1b2db942e Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 12 May 2012 13:21:05 +0200 Subject: [PATCH 0733/1149] Core/Spell: * Fix Spells with DmgClass SPELL_DAMAGE_CLASS_NONE * Fix SPELL_AURA_PERIODIC_HEAL calculation * Fix Swiftmend heal calculation * Fix some codestyle --- src/server/game/Entities/Unit/Unit.cpp | 50 ++++++++++++------- .../game/Spells/Auras/SpellAuraEffects.cpp | 2 +- src/server/game/Spells/SpellEffects.cpp | 3 -- 3 files changed, 32 insertions(+), 23 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 1783db9b14e..5f2f3bc2873 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11201,12 +11201,12 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui if (Unit* owner = GetOwner()) return owner->SpellHealingBonusDone(victim, spellProto, healamount, damagetype, stack); - // no bonus for heal potions/bandages + // No bonus healing for potion spells if (spellProto->SpellFamilyName == SPELLFAMILY_POTION) return healamount; - float DoneTotalMod = 1.0f; - int32 DoneTotal = 0; + float DoneTotalMod = 1.0f; + int32 DoneTotal = 0; // Healing done percent AuraEffectList const& mHealingDonePct = GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_DONE_PERCENT); @@ -11270,7 +11270,7 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui } // Done fixed damage bonus auras - int32 DoneAdvertisedBenefit = SpellBaseHealingBonusDone(spellProto->GetSchoolMask()); + int32 DoneAdvertisedBenefit = SpellBaseHealingBonusDone(spellProto->GetSchoolMask()); // Check for table values SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id); @@ -11283,16 +11283,22 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui coeff = bonus->dot_damage; if (bonus->ap_dot_bonus > 0) DoneTotal += int32(bonus->ap_dot_bonus * stack * GetTotalAttackPowerValue( - (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass !=SPELL_DAMAGE_CLASS_MELEE)? RANGED_ATTACK : BASE_ATTACK)); + (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass !=SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK)); } else { coeff = bonus->direct_damage; if (bonus->ap_bonus > 0) DoneTotal += int32(bonus->ap_bonus * stack * GetTotalAttackPowerValue( - (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass !=SPELL_DAMAGE_CLASS_MELEE)? RANGED_ATTACK : BASE_ATTACK)); + (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass !=SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK)); } } + else + { + // No bonus healing for SPELL_DAMAGE_CLASS_NONE class spells by default + if (spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE) + return healamount < 0 ? 0 : healamount; + } // Default calculation if (DoneAdvertisedBenefit) @@ -11320,11 +11326,11 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui } else { - // Earthliving - 0.45% of normal hot coeff - if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags[1] & 0x80000) - factorMod *= 0.45f; + // Earthliving - 0.45% of normal hot coeff + if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags[1] & 0x80000) + factorMod *= 0.45f; - DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod); + DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod); } } @@ -11339,7 +11345,7 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui break; } if (spellProto->Effects[i].Effect == SPELL_EFFECT_HEALTH_LEECH) - DoneTotal = 0; + DoneTotal = 0; } // use float as more appropriate for negative values and percent applying @@ -11351,16 +11357,16 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui return uint32(std::max(heal, 0.0f)); } -uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack) +uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack) { - float TakenTotalMod = 1.0f; + float TakenTotalMod = 1.0f; // Healing taken percent - float minval = (float)GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT); + float minval = float(GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT)); if (minval) AddPctF(TakenTotalMod, minval); - float maxval = (float)GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT); + float maxval = float(GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT)); if (maxval) AddPctF(TakenTotalMod, maxval); @@ -11369,7 +11375,7 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const *spellProto, u AddPctN(TakenTotalMod, Tenacity->GetAmount()); // Healing Done - int32 TakenTotal = 0; + int32 TakenTotal = 0; // Taken fixed damage bonus auras int32 TakenAdvertisedBenefit = SpellBaseHealingBonusTaken(spellProto->GetSchoolMask()); @@ -11386,11 +11392,11 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const *spellProto, u if (damagetype == DOT) { // Healing over time taken percent - float minval_hot = (float)GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT); + float minval_hot = float(GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT)); if (minval_hot) AddPctF(TakenTotalMod, minval_hot); - float maxval_hot = (float)GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT); + float maxval_hot = float(GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT)); if (maxval_hot) AddPctF(TakenTotalMod, maxval_hot); } @@ -11401,6 +11407,12 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const *spellProto, u float factorMod = 1.0f; if (bonus) coeff = (damagetype == DOT) ? bonus->dot_damage : bonus->direct_damage; + else + { + // No bonus healing for SPELL_DAMAGE_CLASS_NONE class spells by default + if (spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE) + return healamount < 0 ? 0 : healamount; + } // Default calculation if (TakenAdvertisedBenefit) @@ -11439,7 +11451,7 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const *spellProto, u break; } if (spellProto->Effects[i].Effect == SPELL_EFFECT_HEALTH_LEECH) - TakenTotal = 0; + TakenTotal = 0; } float heal = (int32(healamount) + TakenTotal) * TakenTotalMod; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index bdbc5cb79d1..7d245539c97 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -6457,7 +6457,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const damage += addition; } - damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); + damage = caster->SpellHealingBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index b1a3cd687df..352b91c635c 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1560,10 +1560,7 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/) int32 tickheal = targetAura->GetAmount(); if (Unit* auraCaster = targetAura->GetCaster()) - { tickheal = auraCaster->SpellHealingBonusDone(unitTarget, targetAura->GetSpellInfo(), tickheal, DOT); - tickheal = unitTarget->SpellHealingBonusTaken(auraCaster, targetAura->GetSpellInfo(), tickheal, DOT); - } //int32 tickheal = targetAura->GetSpellInfo()->EffectBasePoints[idx] + 1; //It is said that talent bonus should not be included From a1ff27a1c64d87717d0b0f65905ffff064329fb7 Mon Sep 17 00:00:00 2001 From: kaelima Date: Sun, 13 May 2012 17:47:12 +0200 Subject: [PATCH 0734/1149] Core/Threat: Some corrections to 5709929d2b575e83f427c7f48cd6bd0d7ed1b29d Fixes HandleChannelDeathItem (spells such as Drain Soul), which got broken by moving m_deathState = s, thanks Shauren --- src/server/game/Combat/ThreatManager.cpp | 5 +- src/server/game/Entities/Unit/Unit.cpp | 7 +- .../game/Spells/Auras/SpellAuraEffects.cpp | 105 +++++++++--------- 3 files changed, 53 insertions(+), 64 deletions(-) diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index 104d2d3d52b..9737d4584ea 100755 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -535,10 +535,7 @@ void ThreatManager::processThreatEvent(ThreatRefStatusChangeEvent* threatRefStat setCurrentVictim(NULL); setDirty(true); } - if (getOwner() && getOwner()->IsInWorld()) - if (Unit* target = ObjectAccessor::GetUnit(*getOwner(), hostilRef->getUnitGuid())) - if (getOwner()->IsInMap(target)) - getOwner()->SendRemoveFromThreatListOpcode(hostilRef); + iOwner->SendRemoveFromThreatListOpcode(hostilRef); iThreatContainer.remove(hostilRef); iThreatOfflineContainer.addReference(hostilRef); } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index e78c18ea3de..b1fcdf888c2 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12833,9 +12833,6 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) void Unit::setDeathState(DeathState s) { - // death state needs to be updated before RemoveAllAurasOnDeath() calls HandleChannelDeathItem(..) so that - // it can be used to check creation of death items (such as soul shards). - if (s != ALIVE && s != JUST_RESPAWNED) { CombatStop(); @@ -12880,9 +12877,7 @@ void Unit::setDeathState(DeathState s) zoneScript->OnUnitDeath(this); } else if (s == JUST_RESPAWNED) - { - RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); // clear skinnable for creature and player (at battleground) - } + RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); // clear skinnable for creature and player (at battleground) m_deathState = s; } diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 7d245539c97..d28ba9e1e19 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5272,66 +5272,63 @@ void AuraEffect::HandleChannelDeathItem(AuraApplication const* aurApp, uint8 mod if (!(mode & AURA_EFFECT_HANDLE_REAL)) return; - if (!apply) + if (apply || aurApp->GetRemoveMode() != AURA_REMOVE_BY_DEATH) + return; + + Unit* caster = GetCaster(); + + if (!caster || caster->GetTypeId() != TYPEID_PLAYER) + return; + + Player* plCaster = caster->ToPlayer(); + Unit* target = aurApp->GetTarget(); + + // Item amount + if (GetAmount() <= 0) + return; + + if (GetSpellInfo()->Effects[m_effIndex].ItemType == 0) + return; + + // Soul Shard + if (GetSpellInfo()->Effects[m_effIndex].ItemType == 6265) { - Unit* caster = GetCaster(); - - if (!caster || caster->GetTypeId() != TYPEID_PLAYER) + // Soul Shard only from units that grant XP or honor + if (!plCaster->isHonorOrXPTarget(target) || + (target->GetTypeId() == TYPEID_UNIT && !target->ToCreature()->isTappedBy(plCaster))) return; - Player* plCaster = caster->ToPlayer(); - Unit* target = aurApp->GetTarget(); - - if (target->getDeathState() != JUST_DIED) - return; - - // Item amount - if (GetAmount() <= 0) - return; - - if (GetSpellInfo()->Effects[m_effIndex].ItemType == 0) - return; - - // Soul Shard - if (GetSpellInfo()->Effects[m_effIndex].ItemType == 6265) + // If this is Drain Soul, check for Glyph of Drain Soul + if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellInfo()->SpellFamilyFlags[0] & 0x00004000)) { - // Soul Shard only from units that grant XP or honor - if (!plCaster->isHonorOrXPTarget(target) || - (target->GetTypeId() == TYPEID_UNIT && !target->ToCreature()->isTappedBy(plCaster))) - return; - - // If this is Drain Soul, check for Glyph of Drain Soul - if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellInfo()->SpellFamilyFlags[0] & 0x00004000)) - { - // Glyph of Drain Soul - chance to create an additional Soul Shard - if (AuraEffect* aur = caster->GetAuraEffect(58070, 0)) - if (roll_chance_i(aur->GetMiscValue())) - caster->CastSpell(caster, 58068, true, 0, aur); // We _could_ simply do ++count here, but Blizz does it this way :) - } + // Glyph of Drain Soul - chance to create an additional Soul Shard + if (AuraEffect* aur = caster->GetAuraEffect(58070, 0)) + if (roll_chance_i(aur->GetMiscValue())) + caster->CastSpell(caster, 58068, true, 0, aur); // We _could_ simply do ++count here, but Blizz does it this way :) } - - //Adding items - uint32 noSpaceForCount = 0; - uint32 count = m_amount; - - ItemPosCountVec dest; - InventoryResult msg = plCaster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, GetSpellInfo()->Effects[m_effIndex].ItemType, count, &noSpaceForCount); - if (msg != EQUIP_ERR_OK) - { - count-=noSpaceForCount; - plCaster->SendEquipError(msg, NULL, NULL, GetSpellInfo()->Effects[m_effIndex].ItemType); - if (count == 0) - return; - } - - Item* newitem = plCaster->StoreNewItem(dest, GetSpellInfo()->Effects[m_effIndex].ItemType, true); - if (!newitem) - { - plCaster->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); - return; - } - plCaster->SendNewItem(newitem, count, true, true); } + + //Adding items + uint32 noSpaceForCount = 0; + uint32 count = m_amount; + + ItemPosCountVec dest; + InventoryResult msg = plCaster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, GetSpellInfo()->Effects[m_effIndex].ItemType, count, &noSpaceForCount); + if (msg != EQUIP_ERR_OK) + { + count-=noSpaceForCount; + plCaster->SendEquipError(msg, NULL, NULL, GetSpellInfo()->Effects[m_effIndex].ItemType); + if (count == 0) + return; + } + + Item* newitem = plCaster->StoreNewItem(dest, GetSpellInfo()->Effects[m_effIndex].ItemType, true); + if (!newitem) + { + plCaster->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); + return; + } + plCaster->SendNewItem(newitem, count, true, true); } void AuraEffect::HandleBindSight(AuraApplication const* aurApp, uint8 mode, bool apply) const From e122f9fd30680433cb246d98f2666d1ddcdd0c02 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sun, 13 May 2012 18:08:57 +0200 Subject: [PATCH 0735/1149] Core/Spell: * Fix Nourish heal calculation * Fix some codestyle --- src/server/game/Entities/Unit/Unit.cpp | 18 +++++++++--------- src/server/game/Spells/SpellEffects.cpp | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index b1fcdf888c2..f79adb2b232 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10600,7 +10600,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin break; } } - break; + break; case SPELLFAMILY_PRIEST: // Mind Flay if (spellProto->SpellFamilyFlags[0] & 0x800000) @@ -10633,7 +10633,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin if (victim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT)) AddPctN(DoneTotalMod, aurEff->GetAmount()); } - break; + break; case SPELLFAMILY_PALADIN: // Judgement of Vengeance/Judgement of Corruption if ((spellProto->SpellFamilyFlags[1] & 0x400000) && spellProto->SpellIconID == 2292) @@ -10651,7 +10651,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin if (stacks) AddPctU(DoneTotalMod, 10 * stacks); } - break; + break; case SPELLFAMILY_DRUID: // Thorns if (spellProto->SpellFamilyFlags[0] & 0x100) @@ -10660,7 +10660,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin if (AuraEffect* aurEff = GetAuraEffectOfRankedSpell(16836, 0)) AddPctN(DoneTotalMod, aurEff->GetAmount()); } - break; + break; case SPELLFAMILY_WARLOCK: // Fire and Brimstone if (spellProto->SpellFamilyFlags[1] & 0x00020040) @@ -10682,14 +10682,14 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin if (spellProto->SpellFamilyFlags[1] & 0x00400000 && isPet()) if (uint8 count = victim->GetDoTsByCaster(GetOwnerGUID())) AddPctN(DoneTotalMod, 15 * count); - break; + break; case SPELLFAMILY_HUNTER: // Steady Shot if (spellProto->SpellFamilyFlags[1] & 0x1) if (AuraEffect* aurEff = GetAuraEffect(56826, 0)) // Glyph of Steady Shot if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_HUNTER, 0x00004000, 0, 0, GetGUID())) AddPctN(DoneTotalMod, aurEff->GetAmount()); - break; + break; case SPELLFAMILY_DEATHKNIGHT: // Improved Icy Touch if (spellProto->SpellFamilyFlags[0] & 0x2) @@ -10730,7 +10730,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin } } } - break; + break; } // Done fixed damage bonus auras @@ -10751,7 +10751,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin if (bonus->ap_dot_bonus > 0) { WeaponAttackType attType = (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK; - float APbonus = (float) victim->GetTotalAuraModifier(attType == BASE_ATTACK ? SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS : SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS); + float APbonus = float(victim->GetTotalAuraModifier(attType == BASE_ATTACK ? SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS : SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS)); APbonus += GetTotalAttackPowerValue(attType); DoneTotal += int32(bonus->ap_dot_bonus * stack * ApCoeffMod * APbonus); } @@ -10762,7 +10762,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin if (bonus->ap_bonus > 0) { WeaponAttackType attType = (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK; - float APbonus = (float) victim->GetTotalAuraModifier(attType == BASE_ATTACK ? SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS : SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS); + float APbonus = float(victim->GetTotalAuraModifier(attType == BASE_ATTACK ? SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS : SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS)); APbonus += GetTotalAttackPowerValue(attType); DoneTotal += int32(bonus->ap_bonus * stack * ApCoeffMod * APbonus); } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 352b91c635c..c306da9d43b 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1581,12 +1581,12 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/) //addhealth += tickheal * tickcount; //addhealth = caster->SpellHealingBonus(m_spellInfo, addhealth, HEAL, unitTarget); } - // Glyph of Nourish + // Nourish else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags[1] & 0x2000000) { addhealth = caster->SpellHealingBonusDone(unitTarget, m_spellInfo, addhealth, HEAL); - addhealth = unitTarget->SpellHealingBonusTaken(caster, m_spellInfo, addhealth, HEAL); + // Glyph of Nourish if (AuraEffect const* aurEff = m_caster->GetAuraEffect(62971, 0)) { Unit::AuraEffectList const& Periodic = unitTarget->GetAuraEffectsByType(SPELL_AURA_PERIODIC_HEAL); From 42b0dfc94f9e9960a38024624f0a0f9886c5ccbd Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 13 May 2012 14:36:24 -0230 Subject: [PATCH 0736/1149] Core/Scripts: Update text for Garfrost to creature_text. Added some missing text & added call for help to aggro. --- .../2012_05_13_00_world_creature_text.sql | 13 ++++++++ .../PitOfSaron/boss_forgemaster_garfrost.cpp | 31 +++++++++++++------ 2 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 sql/updates/world/2012_05_13_00_world_creature_text.sql diff --git a/sql/updates/world/2012_05_13_00_world_creature_text.sql b/sql/updates/world/2012_05_13_00_world_creature_text.sql new file mode 100644 index 00000000000..8d083156fb0 --- /dev/null +++ b/sql/updates/world/2012_05_13_00_world_creature_text.sql @@ -0,0 +1,13 @@ +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry`=36494; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(36494,0,0, 'Tiny creatures under feet, you bring Garfrost something good to eat!',14,0,100,0,0,0, 'Forgemaster Garfrost'), +(36494,1,0, 'Axe too weak. Garfrost make better and CRUSH YOU.',14,0,100,0,0,0, 'Forgemaster Garfrost'), +(36494,2,0, 'Garfrost tired of puny mortals. Now your bones will freeze!',14,0,100,0,0,0, 'Forgemaster Garfrost'), +(36494,3,0, 'Garfrost hope giant underpants clean. Save boss great shame. For later.',14,0,100,0,0,0, 'Forgemaster Garfrost'), +(36494,4,0, 'Will save for snack. For later.',12,0,100,0,0,0, 'Forgemaster Garfrost'), +(36494,4,1, 'That one maybe not so good to eat now. Stupid Garfrost! BAD! BAD!',12,0,100,0,0,0, 'Forgemaster Garfrost'), +(36494,5,0, '%s hurls a massive saronite boulder at you!',16,0,100,0,0,0, 'Forgemaster Garfrost'), +(36494,6,0, '%s casts |cFF00AACCDeep Freeze|r at $n.',41,0,100,0,0,0, 'Forgemaster Garfrost'); +-- Remove old script text +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1658006 AND -1658001; diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp index 64609efd7ff..a3b8c5df4e7 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp @@ -20,14 +20,15 @@ enum Yells { - SAY_AGGRO = -1658001, - SAY_SLAY_1 = -1658002, - SAY_SLAY_2 = -1658003, - SAY_DEATH = -1658004, - SAY_PHASE2 = -1658005, - SAY_PHASE3 = -1658006, + SAY_AGGRO = 0, + SAY_PHASE2 = 1, + SAY_PHASE3 = 2, + SAY_DEATH = 3, + SAY_SLAY = 4, + SAY_THROW_SARONITE = 5, + SAY_CAST_DEEP_FREEZE = 6, - SAY_TYRANNUS_DEATH = -1658007, + SAY_TYRANNUS_DEATH = -1658007, // todo }; enum Spells @@ -107,8 +108,9 @@ class boss_garfrost : public CreatureScript void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); DoCast(me, SPELL_PERMAFROST); + me->CallForHelp(70.0f); events.ScheduleEvent(EVENT_THROW_SARONITE, 7000); instance->SetBossState(DATA_GARFROST, IN_PROGRESS); @@ -117,12 +119,13 @@ class boss_garfrost : public CreatureScript void KilledUnit(Unit* victim) { if (victim->GetTypeId() == TYPEID_PLAYER) - DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); + Talk(SAY_SLAY); } void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); + if (Creature* tyrannus = me->GetCreature(*me, instance->GetData64(DATA_TYRANNUS))) DoScriptText(SAY_TYRANNUS_DEATH, tyrannus); @@ -134,6 +137,7 @@ class boss_garfrost : public CreatureScript if (events.GetPhaseMask() & PHASE_ONE_MASK && !HealthAbovePct(66)) { events.SetPhase(PHASE_TWO); + Talk(SAY_PHASE2); events.DelayEvents(8000); DoCast(me, SPELL_THUNDERING_STOMP); events.ScheduleEvent(EVENT_JUMP, 1500); @@ -143,6 +147,7 @@ class boss_garfrost : public CreatureScript if (events.GetPhaseMask() & PHASE_TWO_MASK && !HealthAbovePct(33)) { events.SetPhase(PHASE_THREE); + Talk(SAY_PHASE3); events.DelayEvents(8000); DoCast(me, SPELL_THUNDERING_STOMP); events.ScheduleEvent(EVENT_JUMP, 1500); @@ -199,7 +204,10 @@ class boss_garfrost : public CreatureScript { case EVENT_THROW_SARONITE: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + { + Talk(SAY_THROW_SARONITE); DoCast(target, SPELL_THROW_SARONITE); + } events.ScheduleEvent(EVENT_THROW_SARONITE, urand(12500, 20000)); break; case EVENT_CHILLING_WAVE: @@ -208,7 +216,10 @@ class boss_garfrost : public CreatureScript break; case EVENT_DEEP_FREEZE: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + { + Talk(SAY_CAST_DEEP_FREEZE); DoCast(target, SPELL_DEEP_FREEZE); + } events.ScheduleEvent(EVENT_DEEP_FREEZE, 35000, 0, PHASE_THREE); break; case EVENT_JUMP: From fa7e9d3c0d492cbf5e4563d8292674145dfef5a0 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 13 May 2012 15:14:32 -0230 Subject: [PATCH 0737/1149] Core/Scripts: And some Gameobject enums for future scripting of Blackrock Spire. --- .../BlackrockSpire/blackrock_spire.h | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h index e51c6b9130d..cef08375c13 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h @@ -61,7 +61,34 @@ enum AdditionalData enum GameObjects { - GO_WHELP_SPAWNER = 175622, //trap spawned by go id 175124 + GO_WHELP_SPAWNER = 175622, // trap spawned by go id 175124 + + // Doors + GO_EMBERSEER_IN = 175244, // First door to Pyroguard Emberseer + GO_DOORS = 175705, // Second door to Pyroguard Emberseer + GO_EMBERSEER_OUT = 175153, // Door after Pyroguard Emberseer event + GO_GYTH_ENTRY_DOOR = 164726, + GO_GYTH_COMBAT_DOOR = 175185, + GO_GYTH_EXIT_DOOR = 175186, + GO_DRAKKISATH_DOOR_1 = 175946, + GO_DRAKKISATH_DOOR_2 = 175947, + + // Runes + GO_ROOM_1_RUNE = 175197, + GO_ROOM_2_RUNE = 175199, + GO_ROOM_3_RUNE = 175195, + GO_ROOM_4_RUNE = 175200, + GO_ROOM_5_RUNE = 175198, + GO_ROOM_6_RUNE = 175196, + GO_ROOM_7_RUNE = 175194, + + GO_EMBERSEER_RUNE_1 = 175266, + GO_EMBERSEER_RUNE_2 = 175267, + GO_EMBERSEER_RUNE_3 = 175268, + GO_EMBERSEER_RUNE_4 = 175269, + GO_EMBERSEER_RUNE_5 = 175270, + GO_EMBERSEER_RUNE_6 = 175271, + GO_EMBERSEER_RUNE_7 = 175272, }; #endif From ede623b473199426e736fc12829c283a9f181587 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sun, 13 May 2012 21:07:59 +0200 Subject: [PATCH 0738/1149] Core/Spell: * Fix SPELL_DAMAGE_CLASS_NONE calculation for SpellHealingBonusTaken * Fix some codestyles --- src/server/game/Entities/Unit/Unit.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f79adb2b232..5b0a3820b0e 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10814,11 +10814,11 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui int32 TakenTotal = 0; float TakenTotalMod = 1.0f; - //from positive and negative SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN - //multiplicative bonus, for example Dispersion + Shadowform (0.10*0.85=0.085) + // from positive and negative SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN + // multiplicative bonus, for example Dispersion + Shadowform (0.10*0.85=0.085) TakenTotalMod *= GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, spellProto->GetSchoolMask()); - //.. taken pct: dummy auras + //.. taken pct: dummy auras AuraEffectList const& mDummyAuras = GetAuraEffectsByType(SPELL_AURA_DUMMY); for (AuraEffectList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i) { @@ -11411,7 +11411,10 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, u { // No bonus healing for SPELL_DAMAGE_CLASS_NONE class spells by default if (spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE) + { + healamount = int32(healamount * TakenTotalMod); return healamount < 0 ? 0 : healamount; + } } // Default calculation @@ -11820,7 +11823,7 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType return uint32(std::max(tmpDamage, 0.0f)); } -uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackType attType, SpellInfo const *spellProto) +uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackType attType, SpellInfo const* spellProto) { if (pdamage == 0) return 0; From e144b8e3bef87a55791188f6578e176e28e9bdd7 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 13 May 2012 20:30:11 -0230 Subject: [PATCH 0739/1149] DB/creature_text: Added creature text for Boss Sara. --- .../world/2012_05_13_01_world_creature_text.sql | 14 ++++++++++++++ .../Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp | 14 ++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 sql/updates/world/2012_05_13_01_world_creature_text.sql diff --git a/sql/updates/world/2012_05_13_01_world_creature_text.sql b/sql/updates/world/2012_05_13_01_world_creature_text.sql new file mode 100644 index 00000000000..8e983fd9a73 --- /dev/null +++ b/sql/updates/world/2012_05_13_01_world_creature_text.sql @@ -0,0 +1,14 @@ +-- NPC talk text insert for Sara +DELETE FROM `creature_text` WHERE `entry`=33134; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(33134,0,0, 'Help me! Please get them off me!',14,0,100,0,0,15771, 'Sara YELL_PREFIGHT'), +(33134,0,1, 'What do you want from me? Leave me alone!',14,0,100,0,0,15772, 'Sara YELL_PREFIGHT'), +(33134,1,0, 'Yes! YES! Show them no mercy! Give no pause to your attacks!',14,0,100,0,0,15773, 'Sara YELL_COMBAT_PHASE_1'), +(33134,1,1, 'Let hatred and rage guide your blows!',14,0,100,0,0,15774, 'Sara YELL_COMBAT_PHASE_1'), +(33134,1,2, 'The time to strike at the head of the beast will soon be upon us! Focus your anger and hatred on his minions!',14,0,100,457,0,15775, 'Sara YELL_COMBAT_PHASE_1'), +(33134,2,0, 'Suffocate upon your own hate!',14,0,100,0,0,15776, 'Sara YELL_COMBAT_PHASE_2'), +(33134,2,1, 'Tremble, mortals, before the coming of the end!',14,0,100,0,0,15777, 'Sara YELL_COMBAT_PHASE_2'), +(33134,3,0, 'Powerless to act...',14,0,100,0,0,15778, 'Sara YELL_SLAY'), +(33134,3,1, 'Could they have been saved?',14,0,100,0,0,15779, 'YELL SAY_SLAY'); +-- remove script text +DELETE FROM script_texts WHERE entry BETWEEN -1603319 AND -1603310; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp index 3f01f21b189..585967ebdcc 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp @@ -20,16 +20,10 @@ enum Sara_Yells { - SAY_SARA_PREFIGHT_1 = -1603310, - SAY_SARA_PREFIGHT_2 = -1603311, - SAY_SARA_AGGRO_1 = -1603312, - SAY_SARA_AGGRO_2 = -1603313, - SAY_SARA_AGGRO_3 = -1603314, - SAY_SARA_SLAY_1 = -1603315, - SAY_SARA_SLAY_2 = -1603316, - WHISP_SARA_INSANITY = -1603317, - SAY_SARA_PHASE2_1 = -1603318, - SAY_SARA_PHASE2_2 = -1603319, + YELL_SARA_PREFIGHT = 0, + YELL_COMBAT_PHASE_1 = 1, + YELL_COMBAT_PHASE_2 = 2, + YELL_SLAY = 3, }; enum YoggSaron_Yells From 72d00c476ca6b6e2d48f5fdfaae48bf383e44ef0 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 13 May 2012 21:43:37 -0230 Subject: [PATCH 0740/1149] Core/scripts: Add spell enums for boss sara. --- .../Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp index 585967ebdcc..948ca58e446 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp @@ -18,12 +18,27 @@ #include "ScriptMgr.h" #include "ulduar.h" -enum Sara_Yells +enum Sara { + // text YELL_SARA_PREFIGHT = 0, YELL_COMBAT_PHASE_1 = 1, YELL_COMBAT_PHASE_2 = 2, YELL_SLAY = 3, + + // Phase 1 spells + SPELL_SARAS_BLESSING = 63745, // Target Self + SPELL_SARAS_ANGER = 63147, // Target Entry 33136 + SPELL_SARAS_ANGER = 63744, // Target Entry 33136 + SPELL_SARAS_FEVOR = 63138, // Target Player + SPELL_SARAS_FEVOR = 63747, // Target Player + SPELL_SARAS_BLESSING = 63134, // Target Player + + // Phase 2 spells + SPELL_PHYCHOSIS = 63795, // Target Self + SPELL_MALADY_OF_THE_MIND = 63830, // Target Self + SPELL_DEATH_RAY = 63891, // Target Self + SPELL_BRAIN_LINK = 63802, // Target Self }; enum YoggSaron_Yells From 1a06e197fd7d908ff62b801176cc3797306b07cd Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 13 May 2012 19:39:06 -0500 Subject: [PATCH 0741/1149] Core/Spells: Proc the spells that have DEST target when there is no other target info Closes #6443 Closes #6277 Closes #6331 Signed-off-by: Subv --- src/server/game/Spells/Spell.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 28b089f91cd..48aa40a0e51 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3427,6 +3427,20 @@ void Spell::_handle_immediate_phase() // process items for (std::list::iterator ihit= m_UniqueItemInfo.begin(); ihit != m_UniqueItemInfo.end(); ++ihit) DoAllEffectOnTarget(&(*ihit)); + + if (!m_originalCaster) + return; + // Handle procs on cast + // TODO: finish new proc system:P + if (m_UniqueTargetInfo.empty() && m_targets.HasDst()) + { + uint32 procAttacker = m_procAttacker; + if (!procAttacker) + procAttacker |= PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS; + + // Proc the spells that have DEST target + m_originalCaster->ProcDamageAndSpell(NULL, procAttacker, 0, m_procEx | PROC_EX_NORMAL_HIT, 0, BASE_ATTACK, m_spellInfo, m_triggeredByAuraSpell); + } } void Spell::_handle_finish_phase() From 25f1c5a51da26f30fe251e326e68168985102b6f Mon Sep 17 00:00:00 2001 From: Xanvial Date: Mon, 14 May 2012 12:15:57 +0700 Subject: [PATCH 0742/1149] Core/Spell : Glyph of Totem of Wrath Spell bonus granted by glyph should calculated based from summoned totem, not from player's aura --- src/server/game/Entities/Unit/Unit.cpp | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f79adb2b232..90c8ffaae63 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7366,30 +7366,16 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere if (procSpell->SpellIconID != 2019) return false; - AuraEffect* aurEffA = NULL; - AuraEffectList const& auras = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE); - for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i) + if (Creature* totem = GetMap()->GetCreature(m_SummonSlot[1])) // Fire totem summon slot { - SpellInfo const* spell = (*i)->GetSpellInfo(); - if (spell->SpellFamilyName == uint32(SPELLFAMILY_SHAMAN) && spell->SpellFamilyFlags.HasFlag(0, 0x02000000, 0)) + if (SpellInfo const* totemSpell = sSpellMgr->GetSpellInfo(totem->m_spells[0])) { - if ((*i)->GetCasterGUID() != GetGUID()) - continue; - if (spell->Id == 63283) - continue; - aurEffA = (*i); - break; + int32 bp0 = CalculatePctN(totemSpell->Effects[EFFECT_0].CalcValue(), triggerAmount); + int32 bp1 = CalculatePctN(totemSpell->Effects[EFFECT_1].CalcValue(), triggerAmount); + CastCustomSpell(this, 63283, &bp0, &bp1, NULL, true); + return true; } } - if (aurEffA) - { - int32 bp0 = 0, bp1 = 0; - bp0 = CalculatePctN(triggerAmount, aurEffA->GetAmount()); - if (AuraEffect* aurEffB = aurEffA->GetBase()->GetEffect(EFFECT_1)) - bp1 = CalculatePctN(triggerAmount, aurEffB->GetAmount()); - CastCustomSpell(this, 63283, &bp0, &bp1, NULL, true, NULL, triggeredByAura); - return true; - } return false; } break; From 06c4917568a43cd85a40b07eb82f273af2053050 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 14 May 2012 07:18:06 -0230 Subject: [PATCH 0743/1149] Cote/Scripts: Fix build for boss_yoggsaron --- .../Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp index 948ca58e446..58ba125b994 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp @@ -27,12 +27,12 @@ enum Sara YELL_SLAY = 3, // Phase 1 spells - SPELL_SARAS_BLESSING = 63745, // Target Self - SPELL_SARAS_ANGER = 63147, // Target Entry 33136 - SPELL_SARAS_ANGER = 63744, // Target Entry 33136 - SPELL_SARAS_FEVOR = 63138, // Target Player - SPELL_SARAS_FEVOR = 63747, // Target Player - SPELL_SARAS_BLESSING = 63134, // Target Player + SPELL_SARAS_ANGER_1 = 63147, // Target Entry 33136 + SPELL_SARAS_ANGER_2 = 63744, // Target Entry 33136 + SPELL_SARAS_FEVOR_1 = 63138, // Target Player + SPELL_SARAS_FEVOR_2 = 63747, // Target Player + SPELL_SARAS_BLESSING_1 = 63134, // Target Player + SPELL_SARAS_BLESSING_2 = 63745, // Target Self // Phase 2 spells SPELL_PHYCHOSIS = 63795, // Target Self From 548ac10879701b5eda9d8d369e9fbd470418ce8d Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 14 May 2012 14:11:02 -0400 Subject: [PATCH 0744/1149] Core/Entities: fix calculations for damage taken/done with negative values (should go into effect) and correctly implement SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS. small cleanup --- src/server/game/Entities/Unit/Unit.cpp | 74 +++++++++++++------------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5b0a3820b0e..359e2145112 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10407,20 +10407,24 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin if (GetTypeId() == TYPEID_UNIT && !ToCreature()->isPet()) DoneTotalMod *= ToCreature()->GetSpellDamageMod(ToCreature()->GetCreatureTemplate()->rank); - AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); - for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i) + // Some spells don't benefit from pct done mods + if (!spellProto->AttributesEx6 & SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS) { - if (spellProto->EquippedItemClass == -1 && (*i)->GetSpellInfo()->EquippedItemClass != -1) //prevent apply mods from weapon specific case to non weapon specific spells (Example: thunder clap and two-handed weapon specialization) - continue; - - if ((*i)->GetMiscValue() & spellProto->GetSchoolMask()) + AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); + for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i) { - if ((*i)->GetSpellInfo()->EquippedItemClass == -1) - AddPctN(DoneTotalMod, (*i)->GetAmount()); - else if (!((*i)->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK) && ((*i)->GetSpellInfo()->EquippedItemSubClassMask == 0)) - AddPctN(DoneTotalMod, (*i)->GetAmount()); - else if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellInfo())) - AddPctN(DoneTotalMod, (*i)->GetAmount()); + if (spellProto->EquippedItemClass == -1 && (*i)->GetSpellInfo()->EquippedItemClass != -1) //prevent apply mods from weapon specific case to non weapon specific spells (Example: thunder clap and two-handed weapon specialization) + continue; + + if ((*i)->GetMiscValue() & spellProto->GetSchoolMask()) + { + if ((*i)->GetSpellInfo()->EquippedItemClass == -1) + AddPctN(DoneTotalMod, (*i)->GetAmount()); + else if (!((*i)->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK) && ((*i)->GetSpellInfo()->EquippedItemSubClassMask == 0)) + AddPctN(DoneTotalMod, (*i)->GetAmount()); + else if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellInfo())) + AddPctN(DoneTotalMod, (*i)->GetAmount()); + } } } @@ -10792,12 +10796,6 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin DoneTotalMod = 1.0f; } - // Some spells don't benefit from pct done mods - // maybe should be implemented like SPELL_ATTR3_NO_DONE_BONUS, - // but then it may break spell power coeffs work on spell 31117 - if (spellProto->AttributesEx6 & SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS) - DoneTotalMod = 1.0f; - float tmpDamage = (int32(pdamage) + DoneTotal) * DoneTotalMod; // apply spellmod to Done damage (flat and pct) if (Player* modOwner = GetSpellModOwner()) @@ -10918,7 +10916,7 @@ int32 Unit::SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) DoneAdvertisedBenefit += int32(CalculatePctN(GetTotalAttackPowerValue(BASE_ATTACK), (*i)->GetAmount())); } - return DoneAdvertisedBenefit > 0 ? DoneAdvertisedBenefit : 0; + return DoneAdvertisedBenefit; } int32 Unit::SpellBaseDamageBonusTaken(SpellSchoolMask schoolMask) @@ -10930,7 +10928,7 @@ int32 Unit::SpellBaseDamageBonusTaken(SpellSchoolMask schoolMask) if (((*i)->GetMiscValue() & schoolMask) != 0) TakenAdvertisedBenefit += (*i)->GetAmount(); - return TakenAdvertisedBenefit > 0 ? TakenAdvertisedBenefit : 0; + return TakenAdvertisedBenefit; } bool Unit::isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType) const @@ -11197,7 +11195,7 @@ uint32 Unit::SpellCriticalHealingBonus(SpellInfo const* spellProto, uint32 damag uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack) { // For totems get healing bonus from owner (statue isn't totem in fact) - if (GetTypeId() == TYPEID_UNIT && ToCreature()->isTotem()) + if (GetTypeId() == TYPEID_UNIT && isTotem()) if (Unit* owner = GetOwner()) return owner->SpellHealingBonusDone(victim, spellProto, healamount, damagetype, stack); @@ -11297,7 +11295,7 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui { // No bonus healing for SPELL_DAMAGE_CLASS_NONE class spells by default if (spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE) - return healamount < 0 ? 0 : healamount; + return healamount; } // Default calculation @@ -11413,7 +11411,7 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, u if (spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE) { healamount = int32(healamount * TakenTotalMod); - return healamount < 0 ? 0 : healamount; + return healamount; } } @@ -11648,10 +11646,7 @@ bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) cons uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType attType, SpellInfo const* spellProto) { - if (!victim) - return 0; - - if (pdamage == 0) + if (!victim || pdamage == 0) return 0; uint32 creatureTypeMask = victim->GetCreatureTypeMask(); @@ -11708,20 +11703,23 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType // Done total percent damage auras float DoneTotalMod = 1.0f; - // ..done - AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); - for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i) + // Some spells don't benefit from pct done mods + if (!spellProto->AttributesEx6 & SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS) { - if (spellProto) + AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); + for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i) { - if ((*i)->GetMiscValue() & spellProto->GetSchoolMask() && !(spellProto->GetSchoolMask() & SPELL_SCHOOL_MASK_NORMAL)) + if (spellProto) { - if ((*i)->GetSpellInfo()->EquippedItemClass == -1) - AddPctN(DoneTotalMod, (*i)->GetAmount()); - else if (!((*i)->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK) && ((*i)->GetSpellInfo()->EquippedItemSubClassMask == 0)) - AddPctN(DoneTotalMod, (*i)->GetAmount()); - else if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellInfo())) - AddPctN(DoneTotalMod, (*i)->GetAmount()); + if ((*i)->GetMiscValue() & spellProto->GetSchoolMask() && !(spellProto->GetSchoolMask() & SPELL_SCHOOL_MASK_NORMAL)) + { + if ((*i)->GetSpellInfo()->EquippedItemClass == -1) + AddPctN(DoneTotalMod, (*i)->GetAmount()); + else if (!((*i)->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK) && ((*i)->GetSpellInfo()->EquippedItemSubClassMask == 0)) + AddPctN(DoneTotalMod, (*i)->GetAmount()); + else if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellInfo())) + AddPctN(DoneTotalMod, (*i)->GetAmount()); + } } } } From 06e019b72225e824711fc41b6f4d0443b715b8cc Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 14 May 2012 14:23:21 -0400 Subject: [PATCH 0745/1149] Core/Entities: move spellproto check to the outside of the forloop to not has crashes --- src/server/game/Entities/Unit/Unit.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 359e2145112..3c10243e6b1 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11704,12 +11704,11 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType float DoneTotalMod = 1.0f; // Some spells don't benefit from pct done mods - if (!spellProto->AttributesEx6 & SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS) - { - AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); - for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i) + if (spellProto) + if (!spellProto->AttributesEx6 & SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS) { - if (spellProto) + AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); + for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i) { if ((*i)->GetMiscValue() & spellProto->GetSchoolMask() && !(spellProto->GetSchoolMask() & SPELL_SCHOOL_MASK_NORMAL)) { @@ -11722,7 +11721,6 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType } } } - } AuraEffectList const& mDamageDoneVersus = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE_VERSUS); for (AuraEffectList::const_iterator i = mDamageDoneVersus.begin(); i != mDamageDoneVersus.end(); ++i) From cd06bb93773b9e788067e1a73bbd75ad01937c64 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 14 May 2012 15:14:40 -0400 Subject: [PATCH 0746/1149] Core/Spells: fix possible crash from not having any effect and trying to check if immune. fixes non effect spell mechanic checking for spells with both spell mechanics and effect mechanics --- src/server/game/Entities/Unit/Unit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3c10243e6b1..bf4911223b8 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11569,7 +11569,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) } // Spells that don't have effectMechanics. - if (!spellInfo->HasAnyEffectMechanic() && spellInfo->Mechanic) + if (spellInfo->Mechanic) { SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC]; for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr) @@ -11609,7 +11609,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const { - if (!spellInfo) + if (!spellInfo || !spellInfo->Effects[index]) return false; // If m_immuneToEffect type contain this effect type, IMMUNE effect. uint32 effect = spellInfo->Effects[index].Effect; From 124c65ad80af46c73541dcad9066e3314155f1a8 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 14 May 2012 15:28:31 -0400 Subject: [PATCH 0747/1149] fix compile warnings from 548ac10 --- src/server/game/Entities/Unit/Unit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index bf4911223b8..5f448567b16 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10408,7 +10408,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin DoneTotalMod *= ToCreature()->GetSpellDamageMod(ToCreature()->GetCreatureTemplate()->rank); // Some spells don't benefit from pct done mods - if (!spellProto->AttributesEx6 & SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS) + if (!(spellProto->AttributesEx6 & SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS)) { AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i) @@ -11705,7 +11705,7 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType // Some spells don't benefit from pct done mods if (spellProto) - if (!spellProto->AttributesEx6 & SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS) + if (!(spellProto->AttributesEx6 & SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS)) { AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i) From b72c690905d6dc650b6322c0054cd3faa85c80ea Mon Sep 17 00:00:00 2001 From: kaelima Date: Tue, 15 May 2012 00:03:18 +0200 Subject: [PATCH 0748/1149] Fixed compile --- src/server/game/Entities/Unit/Unit.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5f448567b16..f80175b74d2 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11528,7 +11528,7 @@ bool Unit::IsImmunedToDamage(SpellInfo const* spellInfo) return false; uint32 shoolMask = spellInfo->GetSchoolMask(); - if (spellInfo->Id != 42292 && spellInfo->Id !=59752) + if (spellInfo->Id != 42292 && spellInfo->Id != 59752) { // If m_immuneToSchool type contain this school type, IMMUNE damage. SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; @@ -11588,10 +11588,11 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) break; } } + if (immuneToAllEffects) //Return immune only if the target is immune to all spell effects. return true; - if (spellInfo->Id != 42292 && spellInfo->Id !=59752) + if (spellInfo->Id != 42292 && spellInfo->Id != 59752) { SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr) @@ -11609,8 +11610,9 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const { - if (!spellInfo || !spellInfo->Effects[index]) + if (!spellInfo || !spellInfo->Effects[index].IsEffect()) return false; + // If m_immuneToEffect type contain this effect type, IMMUNE effect. uint32 effect = spellInfo->Effects[index].Effect; SpellImmuneList const& effectList = m_spellImmune[IMMUNITY_EFFECT]; From 648321e1212c3e2a002df0b4509f2b097a330153 Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 15 May 2012 13:26:15 -0400 Subject: [PATCH 0749/1149] Core/Spelld: fix target selection for ground based aoe spells. use the center of the cast (dynamic object) instead of the caster for checking los --- src/server/game/Entities/Unit/Unit.cpp | 6 +++--- src/server/game/Entities/Unit/Unit.h | 2 +- src/server/game/Grids/Notifiers/GridNotifiers.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f80175b74d2..14184b1606d 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12254,7 +12254,7 @@ bool Unit::IsValidAttackTarget(Unit const* target) const } // function based on function Unit::CanAttack from 13850 client -bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) const +bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, WorldObject const* obj) const { ASSERT(target); @@ -12272,8 +12272,8 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) co if (IsOnVehicle(target) || m_vehicle->GetBase()->IsOnVehicle(target)) return false; - // can't attack invisible (ignore stealth for aoe spells) - if ((!bySpell || !(bySpell->AttributesEx6 & SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && !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. + if ((!bySpell || !(bySpell->AttributesEx6 & SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && (obj ? !obj->canSeeOrDetect(target, bySpell && bySpell->IsAffectingArea()) : !canSeeOrDetect(target, bySpell && bySpell->IsAffectingArea()))) return false; // can't attack dead diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 2d6c5b1a86e..f246f595dec 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1573,7 +1573,7 @@ class Unit : public WorldObject bool isTargetableForAttack(bool checkFakeDeath = true) const; bool IsValidAttackTarget(Unit const* target) const; - bool _IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) const; + bool _IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, WorldObject const* obj = NULL) const; bool IsValidAssistTarget(Unit const* target) const; bool _IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) const; diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 6ca31b22e37..7bb4492f99c 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -943,7 +943,7 @@ namespace Trinity if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->isTotem()) return false; - if (i_funit->_IsValidAttackTarget(u, _spellInfo) && i_obj->IsWithinDistInMap(u, i_range)) + if (i_funit->_IsValidAttackTarget(u, _spellInfo,i_obj->GetTypeId() == TYPEID_DYNAMICOBJECT ? i_obj : NULL) && i_obj->IsWithinDistInMap(u, i_range)) return true; return false; From c05c16a8dee97a485e0d6a4e73c750e1d140f227 Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 15 May 2012 15:07:53 -0400 Subject: [PATCH 0750/1149] Core/Spells: more immunities fixes! mechanics are supposed to be checked for finding out if immune to the entire spell. --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 14184b1606d..f1e5f05bd35 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11582,7 +11582,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) { // State/effect immunities applied by aura expect full spell immunity // Ignore effects with mechanic, they are supposed to be checked separately - if (spellInfo->Effects[i].Mechanic || !IsImmunedToSpellEffect(spellInfo, i)) + if (!IsImmunedToSpellEffect(spellInfo, i)) { immuneToAllEffects = false; break; From b90cb5878de2afc621c0b9ebc86066c2b827f428 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Tue, 15 May 2012 23:14:47 +0200 Subject: [PATCH 0751/1149] Core/Spell: Fix SpellDamageBonusTaken calculation for negative value --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f1e5f05bd35..aaba0102f55 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10875,7 +10875,7 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui TakenTotal+= int32(TakenAdvertisedBenefit * coeff * factorMod); } - float tmpDamage = (pdamage + TakenTotal) * TakenTotalMod; + float tmpDamage = (int32(pdamage) + TakenTotal) * TakenTotalMod; return uint32(std::max(tmpDamage, 0.0f)); } From c70792df02858a93c156ac00b4a1fdd366c994ec Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 16 May 2012 08:47:43 -0400 Subject: [PATCH 0752/1149] Core/Scripting: add the ability to access loot/go state changed events for gameobjects from cpp scripting. (malcrom's idea) --- .../game/Entities/GameObject/GameObject.cpp | 2 ++ src/server/game/Scripting/ScriptMgr.cpp | 16 ++++++++++++++++ src/server/game/Scripting/ScriptMgr.h | 8 ++++++++ 3 files changed, 26 insertions(+) diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index e871f99b38c..10136c5fbd7 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -1910,6 +1910,7 @@ void GameObject::SetLootState(LootState state, Unit* unit) { m_lootState = state; AI()->OnStateChanged(state, unit); + sScriptMgr->OnGameObjectLootStateChanged(this, state, unit); if (m_model) { // startOpen determines whether we are going to add or remove the LoS on activation @@ -1929,6 +1930,7 @@ void GameObject::SetLootState(LootState state, Unit* unit) void GameObject::SetGoState(GOState state) { SetByteValue(GAMEOBJECT_BYTES_1, 0, state); + sScriptMgr->OnGameObjectStateChanged(this, state); if (m_model) { if (!IsInWorld()) diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 01d56cf8060..23d18e12097 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -937,6 +937,22 @@ void ScriptMgr::OnGameObjectDamaged(GameObject* go, Player* player) tmpscript->OnDamaged(go, player); } +void ScriptMgr::OnGameObjectLootStateChanged(GameObject* go, uint32 state, Unit* unit) +{ + ASSERT(go); + + GET_SCRIPT(GameObjectScript, go->GetScriptId(), tmpscript); + tmpscript->OnLootStateChanged(go, state, unit); +} + +void ScriptMgr::OnGameObjectStateChanged(GameObject* go, uint32 state) +{ + ASSERT(go); + + GET_SCRIPT(GameObjectScript, go->GetScriptId(), tmpscript); + tmpscript->OnGameObjectStateChanged(go, state); +} + void ScriptMgr::OnGameObjectUpdate(GameObject* go, uint32 diff) { ASSERT(go); diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 6fe058d336a..b3d445af0c6 100755 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -473,6 +473,12 @@ class GameObjectScript : public ScriptObject, public UpdatableScript // Called when the game object is damaged (destructible buildings only). virtual void OnDamaged(GameObject* /*go*/, Player* /*player*/) { } + // Called when the game object loot state is changed. + virtual void OnLootStateChanged(GameObject* /*go*/, uint32 /*state*/, Unit* /*unit*/) { } + + // Called when the game object state is changed. + virtual void OnGameObjectStateChanged(GameObject* /*go*/, uint32 /*state*/) { } + // Called when a GameObjectAI object is needed for the gameobject. virtual GameObjectAI* GetAI(GameObject* /*go*/) const { return NULL; } }; @@ -914,6 +920,8 @@ class ScriptMgr uint32 GetDialogStatus(Player* player, GameObject* go); void OnGameObjectDestroyed(GameObject* go, Player* player); void OnGameObjectDamaged(GameObject* go, Player* player); + void OnGameObjectLootStateChanged(GameObject* go, uint32 state, Unit* unit); + void OnGameObjectStateChanged(GameObject* go, uint32 state); void OnGameObjectUpdate(GameObject* go, uint32 diff); GameObjectAI* GetGameObjectAI(GameObject* go); From ac844f99537dc9867242269f63c3cd58be96e1b2 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 16 May 2012 12:30:37 -0230 Subject: [PATCH 0753/1149] Core/Scripts: Scripting of Dragonspire Hall Runes "UBRS" Additional work to do. --- .../world/2012_05_16_00_world_scripts.sql | 2 ++ .../BlackrockSpire/blackrock_spire.h | 1 + .../instance_blackrock_spire.cpp | 23 +++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 sql/updates/world/2012_05_16_00_world_scripts.sql diff --git a/sql/updates/world/2012_05_16_00_world_scripts.sql b/sql/updates/world/2012_05_16_00_world_scripts.sql new file mode 100644 index 00000000000..9997c09bd8d --- /dev/null +++ b/sql/updates/world/2012_05_16_00_world_scripts.sql @@ -0,0 +1,2 @@ +-- Add script to Dragonspire Hall Runes "UBRS" +UPDATE `gameobject_template` SET `ScriptName`= 'go_dragonspire_hall_rune' WHERE `entry` BETWEEN 175194 AND 175200; diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h index cef08375c13..beef71ea857 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h @@ -57,6 +57,7 @@ enum AdditionalData { SPELL_SUMMON_ROOKERY_WHELP = 15745, MAX_ENCOUNTER = 14, + MAX_DRAGONSPIRE_HALL_RUNES = 7, }; enum GameObjects diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp index ff97984fa09..b5b1b34a593 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp @@ -247,7 +247,30 @@ public: }; +uint8 ActivatedRunes = 0; + +class go_dragonspire_hall_rune : public GameObjectScript +{ +public: + go_dragonspire_hall_rune() : GameObjectScript("go_dragonspire_hall_rune") { } + + void OnGameObjectStateChanged(GameObject* go, uint32 state) + { + if (state == GO_STATE_READY) + { + if (++ActivatedRunes == MAX_DRAGONSPIRE_HALL_RUNES) + { + if (GameObject* door1 = GetClosestGameObjectWithEntry(go, GO_EMBERSEER_IN, 150.0f)) + door1->SetGoState(GO_STATE_ACTIVE); + if (GameObject* door2 = GetClosestGameObjectWithEntry(go, GO_DOORS, 150.0f)) + door2->SetGoState(GO_STATE_ACTIVE); + } + } + } +}; + void AddSC_instance_blackrock_spire() { new instance_blackrock_spire(); + new go_dragonspire_hall_rune; } From ea4815b52806aa41ad015b314c8caff9ff2e2a6f Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 16 May 2012 11:05:11 -0400 Subject: [PATCH 0754/1149] Core/Spells: change spell bonus damage taken pdamage to float to match melee damage bonus taken --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index aaba0102f55..9438d9f7860 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10875,7 +10875,7 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui TakenTotal+= int32(TakenAdvertisedBenefit * coeff * factorMod); } - float tmpDamage = (int32(pdamage) + TakenTotal) * TakenTotalMod; + float tmpDamage = (float(pdamage) + TakenTotal) * TakenTotalMod; return uint32(std::max(tmpDamage, 0.0f)); } From 609002067dc3a7f646c0a1444bdd0e91387b14c3 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 17 May 2012 07:35:55 -0230 Subject: [PATCH 0755/1149] DB/creature_text: Text for Pyroguard Embeeseer. --- sql/updates/world/2012_05_17_00_world_creature_text.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/2012_05_17_00_world_creature_text.sql diff --git a/sql/updates/world/2012_05_17_00_world_creature_text.sql b/sql/updates/world/2012_05_17_00_world_creature_text.sql new file mode 100644 index 00000000000..d7df0f94c0b --- /dev/null +++ b/sql/updates/world/2012_05_17_00_world_creature_text.sql @@ -0,0 +1,7 @@ +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry`=9816; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(9816,0,0, '%s begins to regain its strength!',16,0,100,0,0,0, 'Pyroguard Emberseer'), +(9816,1,0, '%s is nearly at full strength!',16,0,100,0,0,0, 'Pyroguard Emberseer'), +(9816,2,0, '%s regains its power and breaks free of its bonds!',16,0,100,0,0,0, 'Pyroguard Emberseer'), +(9816,3,0, 'Ha! Ha! Ha! Thank you for freeing me, fools. Now let me repay you by charring the flesh from your bones.',14,0,100,0,0,0, 'Pyroguard Emberseer'); From 619fdd185b2b59d886697d1cdbf71ac843982f66 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 17 May 2012 09:40:44 -0400 Subject: [PATCH 0756/1149] Core/Spells: fix deep wounds damage. thanks warpten. --- src/server/scripts/Spells/spell_warrior.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 194753d6e90..3d348a41e76 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -180,9 +180,6 @@ class spell_warr_deep_wounds : public SpellScriptLoader if (Unit* target = GetHitUnit()) if (Unit* caster = GetCaster()) { - // apply percent damage mods - damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); - ApplyPctN(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id)); SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_PERIODIC); @@ -194,8 +191,6 @@ class spell_warr_deep_wounds : public SpellScriptLoader damage = damage / ticks; - damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); - caster->CastCustomSpell(target, SPELL_DEEP_WOUNDS_RANK_PERIODIC, &damage, NULL, NULL, true); } } From c6aa41cc1050bf637669c633024cd82270bd64a7 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 17 May 2012 10:29:36 -0400 Subject: [PATCH 0757/1149] Core/Spells: Revert previous commit. add exception for deep wounds in pct done aura modifiers. clean up heal bonus code to use the correct numerical types. --- src/server/game/Entities/Unit/Unit.cpp | 10 ++++---- src/server/scripts/Spells/spell_warrior.cpp | 27 ++++++++++++--------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 9438d9f7860..6622e3b1e31 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10408,7 +10408,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin DoneTotalMod *= ToCreature()->GetSpellDamageMod(ToCreature()->GetCreatureTemplate()->rank); // Some spells don't benefit from pct done mods - if (!(spellProto->AttributesEx6 & SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS)) + if (!(spellProto->AttributesEx6 & SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS) && !spellProto->IsRankOf(sSpellMgr->GetSpellInfo(12162))) { AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i) @@ -11347,7 +11347,7 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui } // use float as more appropriate for negative values and percent applying - float heal = (int32(healamount) + DoneTotal) * DoneTotalMod; + float heal = float(int32(healamount) + DoneTotal) * DoneTotalMod; // apply spellmod to Done amount if (Player* modOwner = GetSpellModOwner()) modOwner->ApplySpellMod(spellProto->Id, damagetype == DOT ? SPELLMOD_DOT : SPELLMOD_DAMAGE, heal); @@ -11410,7 +11410,7 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, u // No bonus healing for SPELL_DAMAGE_CLASS_NONE class spells by default if (spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE) { - healamount = int32(healamount * TakenTotalMod); + healamount = uint32(std::max((float(healamount) * TakenTotalMod), 0.0f)); return healamount; } } @@ -11455,7 +11455,7 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, u TakenTotal = 0; } - float heal = (int32(healamount) + TakenTotal) * TakenTotalMod; + float heal = float(int32(healamount) + TakenTotal) * TakenTotalMod; return uint32(std::max(heal, 0.0f)); } @@ -11707,7 +11707,7 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType // Some spells don't benefit from pct done mods if (spellProto) - if (!(spellProto->AttributesEx6 & SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS)) + if (!(spellProto->AttributesEx6 & SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS) && !spellProto->IsRankOf(sSpellMgr->GetSpellInfo(12162))) { AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i) diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 3d348a41e76..08583f51c21 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -177,22 +177,27 @@ class spell_warr_deep_wounds : public SpellScriptLoader void HandleDummy(SpellEffIndex /* effIndex */) { int32 damage = GetEffectValue(); + Unit* caster = GetCaster(); if (Unit* target = GetHitUnit()) - if (Unit* caster = GetCaster()) - { - ApplyPctN(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id)); + { + // apply percent damage mods + damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_PERIODIC); - uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude; + ApplyPctN(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id)); - // Add remaining ticks to damage done - if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_DEEP_WOUNDS_RANK_PERIODIC, EFFECT_0, caster->GetGUID())) - damage += aurEff->GetAmount() * (ticks - aurEff->GetTickNumber()); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_PERIODIC); + uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude; - damage = damage / ticks; + // Add remaining ticks to damage done + if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_DEEP_WOUNDS_RANK_PERIODIC, EFFECT_0, caster->GetGUID())) + damage += aurEff->GetAmount() * (ticks - aurEff->GetTickNumber()); - caster->CastCustomSpell(target, SPELL_DEEP_WOUNDS_RANK_PERIODIC, &damage, NULL, NULL, true); - } + damage = damage / ticks; + + damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); + + caster->CastCustomSpell(target, SPELL_DEEP_WOUNDS_RANK_PERIODIC, &damage, NULL, NULL, true); + } } void Register() From 63010fe77b4eea4461c01ffd8a3f2a0841bdd220 Mon Sep 17 00:00:00 2001 From: kandera Date: Thu, 17 May 2012 14:04:57 -0300 Subject: [PATCH 0758/1149] Core/Spells: calculate damagebonustaken for target before adding the damage left from the previous aura. thx @zwerg --- src/server/scripts/Spells/spell_warrior.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 08583f51c21..0ba5c866d63 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -184,7 +184,9 @@ class spell_warr_deep_wounds : public SpellScriptLoader damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); ApplyPctN(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id)); - + + damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_PERIODIC); uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude; @@ -194,8 +196,6 @@ class spell_warr_deep_wounds : public SpellScriptLoader damage = damage / ticks; - damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); - caster->CastCustomSpell(target, SPELL_DEEP_WOUNDS_RANK_PERIODIC, &damage, NULL, NULL, true); } } From 9e6a5593bdab8ab9d301ec5373cd639025f4a790 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 18 May 2012 10:25:14 -0400 Subject: [PATCH 0759/1149] Core/Spells: if doneadvertisedbenefit is 0 gift of the naaru will never get the ap bonus. moved outside the check to fix. --- src/server/game/Entities/Unit/Unit.cpp | 30 ++++++++++++-------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 6622e3b1e31..a4d02ee5ea1 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11313,23 +11313,21 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui coeff /= 100.0f; } - // Gift of the Naaru - if (spellProto->SpellFamilyFlags[2] & 0x80000000 && spellProto->SpellIconID == 329) - { - int32 apBonus = int32(std::max(GetTotalAttackPowerValue(BASE_ATTACK), GetTotalAttackPowerValue(RANGED_ATTACK))); - if (apBonus > DoneAdvertisedBenefit) - DoneTotal += int32(apBonus * 0.22f); // 22% of AP per tick - else - DoneTotal += int32(DoneAdvertisedBenefit * 0.377f); // 37.7% of BH per tick - } - else - { - // Earthliving - 0.45% of normal hot coeff - if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags[1] & 0x80000) - factorMod *= 0.45f; + // Earthliving - 0.45% of normal hot coeff + if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags[1] & 0x80000) + factorMod *= 0.45f; - DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod); - } + DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod); + } + + // Gift of the Naaru + if (spellProto->SpellFamilyFlags[2] & 0x80000000 && spellProto->SpellIconID == 329) + { + int32 apBonus = int32(std::max(GetTotalAttackPowerValue(BASE_ATTACK), GetTotalAttackPowerValue(RANGED_ATTACK))); + if (apBonus > DoneAdvertisedBenefit) + DoneTotal += int32(apBonus * 0.22f); // 22% of AP per tick + else + DoneTotal += int32(DoneAdvertisedBenefit * 0.377f); // 37.7% of BH per tick } for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) From 7688c7609f6686c2a045860c10d9502b3af5f055 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 18 May 2012 11:44:38 -0400 Subject: [PATCH 0760/1149] Core/Spells: remove holy shock and death coil (dk) from checkcast and add them to the checkcast of the spell script. also check if unit is in front for damage spell of death coil (dk) Closes #6027 --- src/server/game/Spells/Spell.cpp | 17 ++--------------- src/server/scripts/Spells/spell_dk.cpp | 17 +++++++++++++++++ src/server/scripts/Spells/spell_paladin.cpp | 14 ++++++++++++-- 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 48aa40a0e51..aef0a8ad3b3 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3427,7 +3427,7 @@ void Spell::_handle_immediate_phase() // process items for (std::list::iterator ihit= m_UniqueItemInfo.begin(); ihit != m_UniqueItemInfo.end(); ++ihit) DoAllEffectOnTarget(&(*ihit)); - + if (!m_originalCaster) return; // Handle procs on cast @@ -3437,7 +3437,7 @@ void Spell::_handle_immediate_phase() uint32 procAttacker = m_procAttacker; if (!procAttacker) procAttacker |= PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS; - + // Proc the spells that have DEST target m_originalCaster->ProcDamageAndSpell(NULL, procAttacker, 0, m_procEx | PROC_EX_NORMAL_HIT, 0, BASE_ATTACK, m_spellInfo, m_triggeredByAuraSpell); } @@ -4991,19 +4991,6 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_caster->IsInWater()) return SPELL_FAILED_ONLY_ABOVEWATER; } - else if (m_spellInfo->SpellIconID == 156) // Holy Shock - { - // spell different for friends and enemies - // hurt version required facing - if (m_targets.GetUnitTarget() && !m_caster->IsFriendlyTo(m_targets.GetUnitTarget()) && !m_caster->HasInArc(static_cast(M_PI), m_targets.GetUnitTarget())) - return SPELL_FAILED_UNIT_NOT_INFRONT; - } - else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && m_spellInfo->SpellFamilyFlags[0] == 0x2000) // Death Coil (DeathKnight) - { - Unit* target = m_targets.GetUnitTarget(); - if (!target || (target->IsFriendlyTo(m_caster) && target->GetCreatureType() != CREATURE_TYPE_UNDEAD)) - return SPELL_FAILED_BAD_TARGETS; - } else if (m_spellInfo->Id == 19938) // Awaken Peon { Unit* unit = m_targets.GetUnitTarget(); diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 13190ed013f..8f0ef118e71 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -750,6 +750,23 @@ class spell_dk_death_coil : public SpellScriptLoader } } + SpellCastResult CheckCast() + { + Unit* caster = GetCaster(); + if (Unit* target = GetExplTargetUnit()) + { + if (!caster->IsFriendlyTo(target) && !caster->isInFront(target)) + return SPELL_FAILED_UNIT_NOT_INFRONT; + + if (target->IsFriendlyTo(caster) && target->GetCreatureType() != CREATURE_TYPE_UNDEAD) + return SPELL_FAILED_BAD_TARGETS; + } + else + return SPELL_FAILED_BAD_TARGETS; + + return SPELL_CAST_OK; + } + void Register() { OnEffectHitTarget += SpellEffectFn(spell_dk_death_coil_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index cf8cae68c58..4baa1eb3735 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -289,8 +289,18 @@ class spell_pal_holy_shock : public SpellScriptLoader { Player* caster = GetCaster()->ToPlayer(); if (Unit* target = GetExplTargetUnit()) - if (!caster->IsFriendlyTo(target) && !caster->IsValidAttackTarget(target)) - return SPELL_FAILED_BAD_TARGETS; + { + if (!caster->IsFriendlyTo(target)) + { + if (!caster->IsValidAttackTarget(target)) + return SPELL_FAILED_BAD_TARGETS; + + if (!caster->isInFront(target)) + return SPELL_FAILED_UNIT_NOT_INFRONT; + } + } + else + return SPELL_FAILED_BAD_TARGETS; return SPELL_CAST_OK; } From edf1de6d936b531b05d3384f156b8cc15448313f Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 18 May 2012 11:56:23 -0400 Subject: [PATCH 0761/1149] Core/Spells: move rocket boots spell cast check to spell script. add event for checkcast for deathcoil (dk) heh i forgot it >.< --- src/server/game/Spells/Spell.cpp | 7 +------ src/server/scripts/Spells/spell_dk.cpp | 1 + src/server/scripts/Spells/spell_item.cpp | 8 ++++++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index aef0a8ad3b3..b27326fce59 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4986,12 +4986,7 @@ SpellCastResult Spell::CheckCast(bool strict) { case SPELL_EFFECT_DUMMY: { - if (m_spellInfo->Id == 51582) // Rocket Boots Engaged - { - if (m_caster->IsInWater()) - return SPELL_FAILED_ONLY_ABOVEWATER; - } - else if (m_spellInfo->Id == 19938) // Awaken Peon + if (m_spellInfo->Id == 19938) // Awaken Peon { Unit* unit = m_targets.GetUnitTarget(); if (!unit || !unit->HasAura(17743)) diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 8f0ef118e71..36dcb53ad00 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -769,6 +769,7 @@ class spell_dk_death_coil : public SpellScriptLoader void Register() { + OnCheckCast += SpellCheckCastFn(spell_dk_death_coil_SpellScript::CheckCast); OnEffectHitTarget += SpellEffectFn(spell_dk_death_coil_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 045ae5a6f9a..33e266e1326 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1748,8 +1748,16 @@ class spell_item_rocket_boots : public SpellScriptLoader caster->CastSpell(caster, SPELL_ROCKET_BOOTS_PROC, true, NULL); } + SpellCastResult CheckCast() + { + if (GetCaster()->IsInWater()) + return SPELL_FAILED_ONLY_ABOVEWATER; + return SPELL_CAST_OK; + } + void Register() { + OnCheckCast += SpellCheckCastFn(spell_item_rocket_boots_SpellScript::CheckCast); OnEffectHitTarget += SpellEffectFn(spell_item_rocket_boots_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; From 01b2bf80575d1a115f88928bf7c4e17ba573c890 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 18 May 2012 12:09:35 -0400 Subject: [PATCH 0762/1149] Core/Spells, DB/Conditions: convert checkcast cpp to conditions for spell 52264 (deliver stolen horse) --- sql/updates/world/2012_05_18_00_world_conditions.sql | 3 +++ src/server/game/Spells/Spell.cpp | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) create mode 100644 sql/updates/world/2012_05_18_00_world_conditions.sql diff --git a/sql/updates/world/2012_05_18_00_world_conditions.sql b/sql/updates/world/2012_05_18_00_world_conditions.sql new file mode 100644 index 00000000000..a1de19ced35 --- /dev/null +++ b/sql/updates/world/2012_05_18_00_world_conditions.sql @@ -0,0 +1,3 @@ +DELETE FROM `conditions` WHERE `SourceEntry` = 52264; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,0,52264,0,0,29,0,28653,5,0,0,97,NULL,"Creature conditions for spell 52264 (Deliver stolen horse)"); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index b27326fce59..ae9f68f594c 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4992,11 +4992,6 @@ SpellCastResult Spell::CheckCast(bool strict) if (!unit || !unit->HasAura(17743)) return SPELL_FAILED_BAD_TARGETS; } - else if (m_spellInfo->Id == 52264) // Deliver Stolen Horse - { - if (!m_caster->FindNearestCreature(28653, 5)) - return SPELL_FAILED_OUT_OF_RANGE; - } else if (m_spellInfo->Id == 31789) // Righteous Defense { if (m_caster->GetTypeId() != TYPEID_PLAYER) From e59d7a33404f3a401a54258ca59e55cd420de0e3 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 18 May 2012 12:15:34 -0400 Subject: [PATCH 0763/1149] DB/Conditions: fix sql error from previous commit. --- sql/updates/world/2012_05_18_00_world_conditions.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/updates/world/2012_05_18_00_world_conditions.sql b/sql/updates/world/2012_05_18_00_world_conditions.sql index a1de19ced35..ad18a6c65ef 100644 --- a/sql/updates/world/2012_05_18_00_world_conditions.sql +++ b/sql/updates/world/2012_05_18_00_world_conditions.sql @@ -1,3 +1,3 @@ DELETE FROM `conditions` WHERE `SourceEntry` = 52264; INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(13,0,52264,0,0,29,0,28653,5,0,0,97,NULL,"Creature conditions for spell 52264 (Deliver stolen horse)"); +(13,0,52264,0,0,29,0,28653,5,0,0,97,"","Creature conditions for spell 52264 (Deliver stolen horse)"); From e897bb59f74178c60ce24153e35d1ad4eb230ad9 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 18 May 2012 12:25:13 -0400 Subject: [PATCH 0764/1149] Core/SpellEffects: successful dispel effects on hostile targets should put you in combat. Closes #656 Closes #678 --- src/server/game/Spells/SpellEffects.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index c306da9d43b..51f37ec5920 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2610,6 +2610,9 @@ void Spell::EffectDispel(SpellEffIndex effIndex) } m_caster->SendMessageToSet(&dataSuccess, true); + if (m_caster->IsValidAttackTarget(unitTarget) && !m_caster->isInCombat()) + m_caster->CombatStart(unitTarget); + // On success dispel // Devour Magic if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->Category == SPELLCATEGORY_DEVOUR_MAGIC) @@ -3539,7 +3542,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) // Add melee damage bonuses (also check for negative) uint32 damage = m_caster->MeleeDamageBonusDone(unitTarget, eff_damage, m_attackType, m_spellInfo); - + m_damage += unitTarget->MeleeDamageBonusTaken(m_caster, damage, m_attackType, m_spellInfo); } From 1037f96e4f9a788cc450fd429ce5f2b0fcc29790 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 18 May 2012 12:31:13 -0400 Subject: [PATCH 0765/1149] Core/Spells: Damage should be dealt AFTER m_damage has been set. possibly fixes scourge strike damage calculations. --- src/server/game/Spells/Spell.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index ae9f68f594c..758769b36a4 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2475,15 +2475,16 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) caster->ToPlayer()->CastItemCombatSpell(unitTarget, m_attackType, procVictim, procEx); } - caster->DealSpellDamage(&damageInfo, true); - // Haunt if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->SpellFamilyFlags[1] & 0x40000 && m_spellAura && m_spellAura->GetEffect(1)) { AuraEffect* aurEff = m_spellAura->GetEffect(1); aurEff->SetAmount(CalculatePctU(aurEff->GetAmount(), damageInfo.damage)); } + m_damage = damageInfo.damage; + + caster->DealSpellDamage(&damageInfo, true); } // Passive spell hits/misses or active spells only misses (only triggers) else From 7b8bece5788339a9da91f845d1ebf2399c360460 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 18 May 2012 13:44:30 -0400 Subject: [PATCH 0766/1149] DB/SpellTargeting: use correct spell target position data from sniffs for all teleport to dalaran spells. --- .../world/2012_05_18_01_world_spell_target_position.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sql/updates/world/2012_05_18_01_world_spell_target_position.sql diff --git a/sql/updates/world/2012_05_18_01_world_spell_target_position.sql b/sql/updates/world/2012_05_18_01_world_spell_target_position.sql new file mode 100644 index 00000000000..72ebc409d9d --- /dev/null +++ b/sql/updates/world/2012_05_18_01_world_spell_target_position.sql @@ -0,0 +1,9 @@ +DELETE FROM `spell_target_position` WHERE `id` IN (30719,53140,53141,53360,54406,68328,71512); +INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES +(30719,571,5807.75,588.347,661.505,1.663), +(53140,571,5807.75,588.347,661.505,1.663), +(53141,571,5807.75,588.347,661.505,1.663), +(53360,571,5807.75,588.347,661.505,1.663), +(54406,571,5807.75,588.347,661.505,1.663), +(68328,571,5807.75,588.347,661.505,1.663), +(71512,571,5807.75,588.347,661.505,1.663); From d1e0dc3fe0c95f78ef261d19c956faf8d3f70a35 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 18 May 2012 13:49:59 -0400 Subject: [PATCH 0767/1149] Core/Spells: fix dispel aggro in a less hacky way! --- src/server/game/Spells/Spell.cpp | 2 +- src/server/game/Spells/SpellEffects.cpp | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 758769b36a4..de432229e2c 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2505,7 +2505,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) } } - if (missInfo != SPELL_MISS_EVADE && m_caster && !m_caster->IsFriendlyTo(unit) && !m_spellInfo->IsPositive()) + if (missInfo != SPELL_MISS_EVADE && m_caster && !m_caster->IsFriendlyTo(unit) && (!m_spellInfo->IsPositive() || m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL))) { m_caster->CombatStart(unit, !(m_spellInfo->AttributesEx3 & SPELL_ATTR3_NO_INITIAL_AGGRO)); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 51f37ec5920..07bea5f980c 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2610,9 +2610,6 @@ void Spell::EffectDispel(SpellEffIndex effIndex) } m_caster->SendMessageToSet(&dataSuccess, true); - if (m_caster->IsValidAttackTarget(unitTarget) && !m_caster->isInCombat()) - m_caster->CombatStart(unitTarget); - // On success dispel // Devour Magic if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->Category == SPELLCATEGORY_DEVOUR_MAGIC) From 7e62c34b247d886d89aea8bd5e8e9241d8cefa44 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 18 May 2012 14:08:05 -0400 Subject: [PATCH 0768/1149] DB/Misc: use correct nextquestid for quests 936,3784,3762 Closes #3820. fix blood presence to NOT proc on positive spells (causes issues with healing spells making you heal) Closes #6009. fix dk t10 4peice bonus Closes #6449. --- sql/updates/world/2012_05_18_01_world_misc.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/2012_05_18_01_world_misc.sql diff --git a/sql/updates/world/2012_05_18_01_world_misc.sql b/sql/updates/world/2012_05_18_01_world_misc.sql new file mode 100644 index 00000000000..bded6fae447 --- /dev/null +++ b/sql/updates/world/2012_05_18_01_world_misc.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_proc_event` WHERE `entry` = 70656; + +UPDATE `quest_template` SET `NextQuestId` = 3761 WHERE `id` IN (936,3784,3762); + +DELETE FROM `spell_proc_event` WHERE `entry` = 63611; +INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`procFlags`,`procEx`,`ppmRate`,`CustomChance`,`Cooldown`) VALUES +(63611,0,0,0,0,0,51154,0,0,0,0); From 881138553b1a85fda62cc131dc6487195e49a2d1 Mon Sep 17 00:00:00 2001 From: Elron103 Date: Fri, 18 May 2012 21:23:07 +0200 Subject: [PATCH 0769/1149] Core/Spells: Fix immunity checking for creatures (i.e. Mind Control) --- src/server/game/Entities/Creature/Creature.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index d120713636d..6506a113ae1 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1668,8 +1668,8 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo) if (!spellInfo) return false; - // Spells that don't have effectMechanics. - if (!spellInfo->HasAnyEffectMechanic() && GetCreatureTemplate()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1))) + // Creature is immune to main mechanic of the spell + if (GetCreatureTemplate()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1))) return true; // This check must be done instead of 'if (GetCreatureTemplate()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))' for not break From d078ef9b4885de4228c9533af14416b6f545c972 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sat, 19 May 2012 10:15:40 +0200 Subject: [PATCH 0770/1149] DB/Quest: Remove autocomplete from Body and Heart Fixes #6139 --- sql/updates/world/2012_05_19_00_world_quest_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_05_19_00_world_quest_template.sql diff --git a/sql/updates/world/2012_05_19_00_world_quest_template.sql b/sql/updates/world/2012_05_19_00_world_quest_template.sql new file mode 100644 index 00000000000..f18172ed836 --- /dev/null +++ b/sql/updates/world/2012_05_19_00_world_quest_template.sql @@ -0,0 +1,2 @@ +-- Change Flags for the Body and Heart Quest +UPDATE `quest_template` SET `Flags`=`Flags`&~2, `SpecialFlags`=`SpecialFlags`|2 WHERE `id` IN (6001,6002); From fc0950dbf33e6a4a9797be46bfe2e7dd2366d9e1 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 19 May 2012 11:48:41 +0100 Subject: [PATCH 0771/1149] SQLS: Correct comments for 2012_02_16_00_world_conditions.sql (Core/Opcs: Use Handle_NULL for an unused opcode) Closes #6517 (pr) --- sql/updates/world/2012_02_16_00_world_conditions.sql | 10 +++++----- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sql/updates/world/2012_02_16_00_world_conditions.sql b/sql/updates/world/2012_02_16_00_world_conditions.sql index a01792ef838..5bef38fc485 100644 --- a/sql/updates/world/2012_02_16_00_world_conditions.sql +++ b/sql/updates/world/2012_02_16_00_world_conditions.sql @@ -4,8 +4,8 @@ CREATE TABLE `temp_convert_spells` PRIMARY KEY (`id`) ); -# spells with EffectImplicitTarget In (6,21, 25) + spells having Targets & 1115534 -# those spells are the ones which require explicit unit target to cast +-- spells with EffectImplicitTarget In (6,21, 25) + spells having Targets & 1115534 +-- those spells are the ones which require explicit unit target to cast INSERT INTO `temp_convert_spells` VALUES (5), (11), @@ -12783,13 +12783,13 @@ INSERT IGNORE INTO `temp_item_spell` SELECT `entry`, `spellid_5` FROM `item_temp INSERT INTO `temp_cond_vals` (`spellId`, `entry`, `dead`, `errorTextId`, `comment`) SELECT DISTINCT (SELECT `spellId` FROM `temp_item_spell` WHERE `itemId` = `SourceEntry`), `ConditionValue2`, (`ConditionValue1` - 1), `ErrorTextId`, `Comment` FROM `conditions` WHERE `SourceTypeOrReferenceId` = 18; -#use CONDITION_OBJECT_ENTRY instead of CONDITION_ITEM_TARGET +-- use CONDITION_OBJECT_ENTRY instead of CONDITION_ITEM_TARGET INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `Comment`) SELECT DISTINCT 17, 0, `spellId`, 0, `elseGroup` - 1, 31, 1, 3, `entry`, 0, 0, `errorTextId`, `comment` FROM `temp_cond_vals`; -#for CONDITION_ITEM_TARGET with ConditionValue1 = DEAD we're adding !CONDITION_ALIVE as a second requirement +-- for CONDITION_ITEM_TARGET with ConditionValue1 = DEAD we're adding !CONDITION_ALIVE as a second requirement INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `Comment`) SELECT DISTINCT 17, 0, `spellId`, 0, `elseGroup` - 1, 36, 1, 0, 0, 0, 1, `errorTextId`, `comment` FROM `temp_cond_vals` WHERE `dead`; -#remove entries which could be converted by this sql +-- remove entries which could be converted by this sql DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 18 AND `SourceEntry` IN (SELECT `itemId` FROM `temp_item_spell`); DROP TABLE `temp_convert_spells`; DROP TABLE `temp_cond_vals`; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index aa6013fae3d..63ee2369ce3 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -491,7 +491,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x1CE*/ { "CMSG_QUERY_TIME", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode }, /*0x1CF*/ { "SMSG_QUERY_TIME_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x1D0*/ { "SMSG_LOG_XPGAIN", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1D1*/ { "SMSG_AURACASTLOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, + /*0x1D1*/ { "SMSG_AURACASTLOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x1D2*/ { "CMSG_RECLAIM_CORPSE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReclaimCorpseOpcode }, /*0x1D3*/ { "CMSG_WRAP_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode }, /*0x1D4*/ { "SMSG_LEVELUP_INFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, From c3287fee0636e9beee460bdb9d3ddbaa34631504 Mon Sep 17 00:00:00 2001 From: kaelima Date: Sat, 19 May 2012 13:04:58 +0200 Subject: [PATCH 0772/1149] Core/SmartAI: - Improve an error msg in ProcessAction - Allow dist/angle to be 0.0f and set default if negative when using SMART_ACTION_FOLLOW - Some minor cleanup in Opcodes.cpp, all smsg's should have Handle_ServerSide --- src/server/game/AI/SmartScripts/SmartAI.cpp | 6 +++--- src/server/game/AI/SmartScripts/SmartScript.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 10 +++++----- src/server/game/Server/WorldSession.h | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 2a412bffb22..08f1b18ffad 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -804,12 +804,12 @@ void SmartAI::SetFollow(Unit* target, float dist, float angle, uint32 credit, ui return; SetRun(mRun); mFollowGuid = target->GetGUID(); - mFollowDist = dist ? dist : PET_FOLLOW_DIST; - mFollowAngle = angle ? angle : me->GetFollowAngle(); + mFollowDist = dist >= 0.0f ? dist : PET_FOLLOW_DIST; + mFollowAngle = angle >= 0.0f ? angle : me->GetFollowAngle(); mFollowArrivedTimer = 1000; mFollowCredit = credit; mFollowArrivedEntry = end; - me->GetMotionMaster()->MoveFollow(target, dist, angle); + me->GetMotionMaster()->MoveFollow(target, mFollowDist, mFollowAngle); mFollowCreditType = creditType; } diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 893c8f4580e..85b117ccd8c 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1925,7 +1925,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; } default: - sLog->outErrorDb("SmartScript::ProcessAction: Unhandled Action type %u", e.GetActionType()); + sLog->outErrorDb("SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); break; } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 63ee2369ce3..517935acbd2 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -270,8 +270,8 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x0F1*/ { "MSG_MOVE_KNOCK_BACK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x0F2*/ { "SMSG_MOVE_FEATHER_FALL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x0F3*/ { "SMSG_MOVE_NORMAL_FALL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0F4*/ { "SMSG_MOVE_SET_HOVER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0F5*/ { "SMSG_MOVE_UNSET_HOVER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, + /*0x0F4*/ { "SMSG_MOVE_SET_HOVER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, + /*0x0F5*/ { "SMSG_MOVE_UNSET_HOVER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x0F6*/ { "CMSG_MOVE_HOVER_ACK", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveHoverAck }, /*0x0F7*/ { "MSG_MOVE_HOVER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x0F8*/ { "CMSG_TRIGGER_CINEMATIC_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, @@ -491,7 +491,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x1CE*/ { "CMSG_QUERY_TIME", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode }, /*0x1CF*/ { "SMSG_QUERY_TIME_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x1D0*/ { "SMSG_LOG_XPGAIN", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1D1*/ { "SMSG_AURACASTLOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, + /*0x1D1*/ { "SMSG_AURACASTLOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x1D2*/ { "CMSG_RECLAIM_CORPSE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReclaimCorpseOpcode }, /*0x1D3*/ { "CMSG_WRAP_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode }, /*0x1D4*/ { "SMSG_LEVELUP_INFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, @@ -970,7 +970,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x3AD*/ { "MSG_MOVE_UPDATE_CAN_FLY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x3AE*/ { "MSG_RAID_READY_CHECK_CONFIRM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x3AF*/ { "CMSG_VOICE_SESSION_ENABLE", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleVoiceSessionEnableOpcode }, - /*0x3B0*/ { "SMSG_VOICE_SESSION_ENABLE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, + /*0x3B0*/ { "SMSG_VOICE_SESSION_ENABLE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x3B1*/ { "SMSG_VOICE_PARENTAL_CONTROLS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x3B2*/ { "CMSG_GM_WHISPER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x3B3*/ { "SMSG_GM_MESSAGECHAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, @@ -1023,7 +1023,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x3E2*/ { "SMSG_COMSAT_CONNECT_FAIL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x3E3*/ { "SMSG_VOICE_CHAT_STATUS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x3E4*/ { "CMSG_REPORT_PVP_AFK", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK }, - /*0x3E5*/ { "SMSG_REPORT_PVP_AFK_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, + /*0x3E5*/ { "SMSG_REPORT_PVP_AFK_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x3E6*/ { "CMSG_GUILD_BANKER_ACTIVATE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate }, /*0x3E7*/ { "CMSG_GUILD_BANK_QUERY_TAB", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankQueryTab }, /*0x3E8*/ { "SMSG_GUILD_BANK_LIST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 0fce0a372ff..bb54a0ae19e 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -395,7 +395,7 @@ class WorldSession public: // opcodes handlers void Handle_NULL(WorldPacket& recvPacket); // not used - void Handle_EarlyProccess(WorldPacket& recvPacket);// just mark packets processed in WorldSocket::OnRead + void Handle_EarlyProccess(WorldPacket& recvPacket); // just mark packets processed in WorldSocket::OnRead void Handle_ServerSide(WorldPacket& recvPacket); // sever side only, can't be accepted from client void Handle_Deprecated(WorldPacket& recvPacket); // never used anymore by client From 064b30b0cd4c4321dabc2611dd26b25a30267773 Mon Sep 17 00:00:00 2001 From: nelegalno Date: Sat, 19 May 2012 12:00:57 +0100 Subject: [PATCH 0773/1149] SQLS: Correct comments for 2012_02_20_02_world_conditons.sql Ref #6517 (pr) --- .../world/2012_02_20_02_world_conditons.sql | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sql/updates/world/2012_02_20_02_world_conditons.sql b/sql/updates/world/2012_02_20_02_world_conditons.sql index 832d8dbdae5..f87a95fb1c9 100644 --- a/sql/updates/world/2012_02_20_02_world_conditons.sql +++ b/sql/updates/world/2012_02_20_02_world_conditons.sql @@ -1,9 +1,10 @@ -# Update a typo in original data entry +-- Update a typo in original data entry UPDATE `npc_spellclick_spells` SET `quest_end`=11999 WHERE `npc_entry`=26477 AND `spell_id`=61832 AND `quest_start`=11999; -# Delete redundant data with invalid condition type + +-- Delete redundant data with invalid condition type DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18; -# Static Data +-- Static Data INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`, `ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`Comment`) VALUES (18,24752,44363,0,8,0,11460,0,0,1,'Forbidden rewarded quest for spellclick'), @@ -167,9 +168,10 @@ INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`, (18,40176,74905,0,8,0,25444,0,0,1,'Forbidden rewarded quest for spellclick'), (18,40176,74905,0,9,0,25444,0,0,0,'Required quest active for spellclick'); -# Below is a procedure to dynamically convert custom content to conditions table. -# However this procedure only works for MySQL server versions >= 5.6 due to -# a bug / missing feature in older MySQL versions. +-- Below is a procedure to dynamically convert custom content to conditions table. +-- However this procedure only works for MySQL server versions >= 5.6 due to +-- a bug / missing feature in older MySQL versions. + /* DROP PROCEDURE IF EXISTS ConvertSpellClickConditions; @@ -185,7 +187,7 @@ BEGIN DECLARE quest INT DEFAULT 0; DECLARE quest2 INT DEFAULT 0; DECLARE questStartCanActive INT DEFAULT 0; - DECLARE maxElseGroupId INT DEFAULT 14; # Change this for custom content + DECLARE maxElseGroupId INT DEFAULT 14; -- Change this for custom content SELECT COUNT(*) INTO recordCount FROM `npc_spellclick_spells` WHERE `aura_required` !=0; WHILE counter < recordCount DO SELECT `npc_entry`, `spell_id`, `aura_required` @@ -228,12 +230,12 @@ BEGIN `ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`NegativeCondition`,`Comment`) VALUES (18,npcEntry,spellId,maxElseGroupId+1,8,0,quest,0,0,'Required quest rewarded for spellclick'); SET maxElseGroupId = maxElseGroupId+1; - # ELSE IF quest2 != 0 is handled in next loop (forbidden rewarded quest) + -- ELSE IF quest2 != 0 is handled in next loop (forbidden rewarded quest) ELSEIF questStartCanActive = 1 && quest2 = quest THEN INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`, `ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`NegativeCondition`,`Comment`) VALUES (18,npcEntry,spellId,9,0,quest,0,0,'Required quest active for spellclick'); - # ^Adds the required active quest condition. Prohibit quest reward is done in next loop + -- ^Adds the required active quest condition. Prohibit quest reward is done in next loop ELSEIF questStartCanActive = 0 THEN INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`, `ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`NegativeCondition`,`Comment`) From 7972b6977b6fd95873c6c6cad2753bee50a38211 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 19 May 2012 12:15:19 +0100 Subject: [PATCH 0774/1149] DB/Quests|SAI: Fix the first 5 quests of Ring of Blood Closes #6334 Last quest still needs to be fixed. --- sql/updates/world/2012_05_19_01_world_smart_scripts.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/2012_05_19_01_world_smart_scripts.sql diff --git a/sql/updates/world/2012_05_19_01_world_smart_scripts.sql b/sql/updates/world/2012_05_19_01_world_smart_scripts.sql new file mode 100644 index 00000000000..06169d8610a --- /dev/null +++ b/sql/updates/world/2012_05_19_01_world_smart_scripts.sql @@ -0,0 +1,7 @@ +-- Fix Quest 9962,9967,9970,9972,9973 +UPDATE `smart_scripts` SET `target_type`=16 WHERE `entryorguid`=18398 AND `id`=1; -- Brokentoe +UPDATE `smart_scripts` SET `target_type`=16 WHERE `entryorguid`=18399 AND `id`=4; -- Murkblood Twin +UPDATE `smart_scripts` SET `target_type`=16 WHERE `entryorguid`=18400 AND `id`=5; -- Rokdar the Sundered Lord +UPDATE `smart_scripts` SET `target_type`=16 WHERE `entryorguid`=18401 AND `id`=3; -- Skra'gath +UPDATE `smart_scripts` SET `id`=5,`link`=6,`target_type`=16 WHERE `entryorguid`=18402 AND `action_type`=15; -- Warmaul Champion +UPDATE `smart_scripts` SET `id`=6 WHERE `entryorguid`=18402 AND `action_type`=45; -- Warmaul Champion From 484223e1293654fcbed1e46a5dedbd2fee84ec6b Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 19 May 2012 13:32:29 +0100 Subject: [PATCH 0775/1149] SQLS: Fix two startup DB errors and add proper file endings for various sqls --- .../world/2012_02_14_00_world_achievement_criteria_data.sql | 2 +- sql/updates/world/2012_02_18_02_world_gossip.sql | 2 +- sql/updates/world/2012_02_21_01_world_conditions.sql | 2 +- sql/updates/world/2012_02_22_01_world_creature_text.sql | 2 +- .../world/2012_02_28_00_world_wintergrasp_spawns.sql | 2 +- sql/updates/world/2012_03_07_00_world_trinity_string.sql | 2 +- .../world/2012_04_25_01_world_spell_script_names.sql | 2 +- .../world/2012_04_25_02_world_spell_script_names.sql | 2 +- .../world/2012_04_28_00_world_reference_loot_template.sql | 2 +- sql/updates/world/2012_05_19_02_world_misc.sql | 6 ++++++ 10 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 sql/updates/world/2012_05_19_02_world_misc.sql diff --git a/sql/updates/world/2012_02_14_00_world_achievement_criteria_data.sql b/sql/updates/world/2012_02_14_00_world_achievement_criteria_data.sql index 4361f33cf38..e7993726132 100644 --- a/sql/updates/world/2012_02_14_00_world_achievement_criteria_data.sql +++ b/sql/updates/world/2012_02_14_00_world_achievement_criteria_data.sql @@ -4,4 +4,4 @@ INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`, (13013, 12, 1, 0, ""), -- heroic (13012, 12, 1, 0, ""), -- heroic (13011, 12, 0, 0, ""), -- normal -(12780, 12, 0, 0, ""); -- normal \ No newline at end of file +(12780, 12, 0, 0, ""); -- normal diff --git a/sql/updates/world/2012_02_18_02_world_gossip.sql b/sql/updates/world/2012_02_18_02_world_gossip.sql index c72532e3f21..47882d4eb36 100644 --- a/sql/updates/world/2012_02_18_02_world_gossip.sql +++ b/sql/updates/world/2012_02_18_02_world_gossip.sql @@ -49,4 +49,4 @@ INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,` (573,0,0,'These dwarves are the same ones today, yes? Do dwarves maintain any other links to the Earthen?',1,1,574,0,0,0,''), (574,0,0,'Who are the Creators?',1,1,575,0,0,0,''), (575,0,0,'This is a lot to think about.',1,1,576,0,0,0,''), -(576,0,0,'I will access the discs now.',1,1,0,0,0,0,''); \ No newline at end of file +(576,0,0,'I will access the discs now.',1,1,0,0,0,0,''); diff --git a/sql/updates/world/2012_02_21_01_world_conditions.sql b/sql/updates/world/2012_02_21_01_world_conditions.sql index 54685868186..95c32703ea4 100644 --- a/sql/updates/world/2012_02_21_01_world_conditions.sql +++ b/sql/updates/world/2012_02_21_01_world_conditions.sql @@ -3589,4 +3589,4 @@ UPDATE `conditions` SET `ConditionTypeOrReference` = 32, `ConditionValue1` = 0x9 UPDATE `conditions` SET `ConditionTypeOrReference` = 31, `ConditionValue1` = 5 WHERE `ConditionTypeOrReference` = 18 AND `ConditionValue1` = 0; DROP TABLE `temp_convert_spells`; -DROP TABLE `temp_cond_vals`; \ No newline at end of file +DROP TABLE `temp_cond_vals`; diff --git a/sql/updates/world/2012_02_22_01_world_creature_text.sql b/sql/updates/world/2012_02_22_01_world_creature_text.sql index 035962e11c3..8b7761e48a0 100644 --- a/sql/updates/world/2012_02_22_01_world_creature_text.sql +++ b/sql/updates/world/2012_02_22_01_world_creature_text.sql @@ -31,4 +31,4 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr (15214,27,0, 'The Horde has defended Wintergrasp Fortress!',41,0,100,0,0,0, 'Invisible Stalker'), (15214,28,0, 'The Horde has captured Wintergrasp Fortress!',41,0,100,0,0,0, 'Invisible Stalker'), (15214,29,0, 'The Alliance has defended Wintergrasp Fortress!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,30,0, 'The Alliance has captured Wintergrasp Fortress!',41,0,100,0,0,0, 'Invisible Stalker'); \ No newline at end of file +(15214,30,0, 'The Alliance has captured Wintergrasp Fortress!',41,0,100,0,0,0, 'Invisible Stalker'); diff --git a/sql/updates/world/2012_02_28_00_world_wintergrasp_spawns.sql b/sql/updates/world/2012_02_28_00_world_wintergrasp_spawns.sql index 99c2444f20b..9c07709246f 100644 --- a/sql/updates/world/2012_02_28_00_world_wintergrasp_spawns.sql +++ b/sql/updates/world/2012_02_28_00_world_wintergrasp_spawns.sql @@ -363,4 +363,4 @@ INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x` (@OGUID+16,192400,571,1,32,5041.650879,3294.318604,381.919952,-1.605702,0,0,0,1,180,0,1), (@OGUID+17,192401,571,1,32,4855.444336,3297.600830,376.495758,-3.115388,0,0,0,1,180,0,1), (@OGUID+18,192281,571,1,32,4857.971191,3335.415771,369.291901,-2.888511,0,0,0,1,180,0,1), -(@OGUID+19,192282,571,1,32,5006.322754,3280.362061,371.242249,2.242746,0,0,0,1,180,0,1); \ No newline at end of file +(@OGUID+19,192282,571,1,32,5006.322754,3280.362061,371.242249,2.242746,0,0,0,1,180,0,1); diff --git a/sql/updates/world/2012_03_07_00_world_trinity_string.sql b/sql/updates/world/2012_03_07_00_world_trinity_string.sql index 96344520236..df5afea5d4f 100644 --- a/sql/updates/world/2012_03_07_00_world_trinity_string.sql +++ b/sql/updates/world/2012_03_07_00_world_trinity_string.sql @@ -1,3 +1,3 @@ DELETE FROM `trinity_string` WHERE `entry`=175; INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES -(175, 'Liquid level: %f, ground: %f, type: %u, flags %u, status: %d.'); \ No newline at end of file +(175, 'Liquid level: %f, ground: %f, type: %u, flags %u, status: %d.'); diff --git a/sql/updates/world/2012_04_25_01_world_spell_script_names.sql b/sql/updates/world/2012_04_25_01_world_spell_script_names.sql index e42f1979229..7b7135860ab 100644 --- a/sql/updates/world/2012_04_25_01_world_spell_script_names.sql +++ b/sql/updates/world/2012_04_25_01_world_spell_script_names.sql @@ -1,3 +1,3 @@ DELETE FROM `spell_script_names` WHERE `spell_id` = 33110; INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES -(33110,'spell_pri_prayer_of_mending_heal'); \ No newline at end of file +(33110,'spell_pri_prayer_of_mending_heal'); diff --git a/sql/updates/world/2012_04_25_02_world_spell_script_names.sql b/sql/updates/world/2012_04_25_02_world_spell_script_names.sql index ea6b95559c6..ad63bc87837 100644 --- a/sql/updates/world/2012_04_25_02_world_spell_script_names.sql +++ b/sql/updates/world/2012_04_25_02_world_spell_script_names.sql @@ -8,4 +8,4 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES (51592, 'spell_gen_despawn_self'), (51910, 'spell_gen_despawn_self'), (52267, 'spell_gen_despawn_self'), -(54420, 'spell_gen_despawn_self'); \ No newline at end of file +(54420, 'spell_gen_despawn_self'); diff --git a/sql/updates/world/2012_04_28_00_world_reference_loot_template.sql b/sql/updates/world/2012_04_28_00_world_reference_loot_template.sql index b59ba90fdbc..07c53a8f7c9 100644 --- a/sql/updates/world/2012_04_28_00_world_reference_loot_template.sql +++ b/sql/updates/world/2012_04_28_00_world_reference_loot_template.sql @@ -155,4 +155,4 @@ INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`loot (@Yogg25,45693,100,16,0,1,1); -- Mimiron's Head -- Cleanups -DELETE FROM `conditions` WHERE `SourceEntry`=45897 AND `SourceGroup`=33955; \ No newline at end of file +DELETE FROM `conditions` WHERE `SourceEntry`=45897 AND `SourceGroup`=33955; diff --git a/sql/updates/world/2012_05_19_02_world_misc.sql b/sql/updates/world/2012_05_19_02_world_misc.sql new file mode 100644 index 00000000000..1dd946b5a18 --- /dev/null +++ b/sql/updates/world/2012_05_19_02_world_misc.sql @@ -0,0 +1,6 @@ +-- 2012-05-19 12:48:24 SourceEntry 52264 in `condition` table, has incorrect SourceGroup 0 (spell effectMask) set , ignoring. +UPDATE `conditions` SET `SourceId`=1 WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=0 AND `SourceEntry`=52264 AND `SourceId`=0 AND `ElseGroup`=0 AND `ConditionTypeOrReference`=29 AND `ConditionTarget`=0 AND `ConditionValue1`=28653 AND `ConditionValue2`=5 AND `ConditionValue3`=0; + +-- 2012-05-19 12:48:18 Quest 384 has `ZoneOrSort` = -304 but `RequiredSkillId` does not have a corresponding value (185). +-- It is not clear if cooking was required on 3.3.5, so reverting it to its original state (however we are sure it is not required in Cata) +UPDATE `quest_template` SET `RequiredSkillId`=185, `RequiredSkillPoints`=1 WHERE `Id`=384; From 9474902479bf627874b66c41c8fcb138cfb85b48 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 19 May 2012 14:27:24 +0100 Subject: [PATCH 0776/1149] TDB 335.11.47 - 2012/05/19 --- .../world => old/3.3.5a}/2012_02_13_00_world_version.sql | 0 .../3.3.5a}/2012_02_14_00_world_achievement_criteria_data.sql | 0 .../world => old/3.3.5a}/2012_02_15_00_world_quest_template.sql | 0 .../3.3.5a}/2012_02_15_01_world_areatrigger_tavern.sql | 0 .../world => old/3.3.5a}/2012_02_15_02_world_item_template.sql | 0 .../world => old/3.3.5a}/2012_02_15_03_world_quest_template.sql | 0 .../world => old/3.3.5a}/2012_02_15_04_world_quest_template.sql | 0 .../3.3.5a}/2012_02_15_06_world_creature_involvedrelation.sql | 0 .../world => old/3.3.5a}/2012_02_15_07_00_world_creature.sql | 0 .../3.3.5a}/2012_02_15_07_01_world_waypoint_data.sql | 0 .../world => old/3.3.5a}/2012_02_15_07_02_world_misc.sql | 0 sql/{updates/world => old/3.3.5a}/2012_02_15_08_world_sai.sql | 0 .../3.3.5a}/2012_02_15_09_world_spell_proc_event.sql | 0 .../world => old/3.3.5a}/2012_02_16_00_world_conditions.sql | 0 .../world => old/3.3.5a}/2012_02_16_01_world_conditions.sql | 0 .../world => old/3.3.5a}/2012_02_17_00_world_waypoints.sql | 0 .../3.3.5a}/2012_02_18_00_world_spell_script_names.sql | 0 .../world => old/3.3.5a}/2012_02_18_01_world_spell_dbc.sql | 0 .../world => old/3.3.5a}/2012_02_18_02_world_gossip.sql | 0 .../world => old/3.3.5a}/2012_02_18_03_world_gossip.sql | 0 .../3.3.5a}/2012_02_18_04_world_spell_script_names.sql | 0 .../world => old/3.3.5a}/2012_02_18_05_world_creatures.sql | 0 .../world => old/3.3.5a}/2012_02_18_06_world_gossip.sql | 0 .../world => old/3.3.5a}/2012_02_18_07_world_gossip.sql | 0 .../world => old/3.3.5a}/2012_02_18_08_world_gossip.sql | 0 sql/{updates/auth => old/3.3.5a}/2012_02_19_00_auth_account.sql | 0 .../3.3.5a}/2012_02_19_00_characters_warden_action.sql | 0 .../world => old/3.3.5a}/2012_02_19_00_world_quest_template.sql | 0 .../world => old/3.3.5a}/2012_02_19_01_world_quest_template.sql | 0 .../world => old/3.3.5a}/2012_02_19_02_world_gameobject.sql | 0 .../world => old/3.3.5a}/2012_02_19_03_world_warden_checks.sql | 0 .../3.3.5a}/2012_02_19_04_world_misc_db_updates.sql | 0 .../world => old/3.3.5a}/2012_02_19_05_world_creature_text.sql | 0 .../world => old/3.3.5a}/2012_02_19_06_world_creature_text.sql | 0 sql/{updates/world => old/3.3.5a}/2012_02_20_00_world_sai.sql | 0 .../world => old/3.3.5a}/2012_02_20_01_world_gossip.sql | 0 .../world => old/3.3.5a}/2012_02_20_02_world_conditons.sql | 0 .../3.3.5a}/2012_02_21_00_world_creature_loot_template.sql | 0 .../world => old/3.3.5a}/2012_02_21_01_world_conditions.sql | 0 .../3.3.5a}/2012_02_21_02_world_creature_loot_template.sql | 0 .../3.3.5a}/2012_02_21_03_world_creature_loot_template.sql | 0 .../3.3.5a}/2012_02_21_04_world_creature_loot_template.sql | 0 .../world => old/3.3.5a}/2012_02_21_05_world_gossip.sql | 0 .../world => old/3.3.5a}/2012_02_21_06_world_Gossip.sql | 0 .../3.3.5a/2012_02_22_00_world_sai.sql} | 0 .../world => old/3.3.5a}/2012_02_22_01_world_creature_text.sql | 0 sql/{updates/world => old/3.3.5a}/2012_02_22_02_world_misc.sql | 0 .../world => old/3.3.5a}/2012_02_22_03_world_conditions.sql | 0 .../3.3.5a}/2012_02_23_00_world_spell_script_names.sql | 0 .../3.3.5a}/2012_02_24_00_world_gameobject_loot_template.sql | 0 sql/{updates/world => old/3.3.5a}/2012_02_24_01_world_sai.sql | 0 .../3.3.5a}/2012_02_25_00_world_spell_script_names.sql | 0 .../world => old/3.3.5a}/2012_02_25_01_world_command.sql | 0 sql/{updates/world => old/3.3.5a}/2012_02_25_01_world_misc.sql | 0 sql/{updates/world => old/3.3.5a}/2012_02_25_02_world_sai.sql | 0 sql/{updates/world => old/3.3.5a}/2012_02_26_00_world_misc.sql | 0 .../3.3.5a}/2012_02_26_01_world_spell_script_names.sql | 0 .../3.3.5a}/2012_02_27_00_world_creature_template.sql | 0 .../3.3.5a}/2012_02_28_00_world_wintergrasp_spawns.sql | 0 .../3.3.5a}/2012_02_29_00_world_conditions_misc.sql | 0 .../world => old/3.3.5a}/2012_02_29_01_world_conditions.sql | 0 .../world => old/3.3.5a}/2012_02_29_02_world_conditions.sql | 0 .../world => old/3.3.5a}/2012_02_29_03_world_creature_text.sql | 0 .../world => old/3.3.5a}/2012_02_29_04_world_creature_text.sql | 0 .../world => old/3.3.5a}/2012_02_29_05_world_creature_text.sql | 0 .../world => old/3.3.5a}/2012_03_01_00_world_conditions.sql | 0 .../world => old/3.3.5a}/2012_03_01_01_world_creature_text.sql | 0 .../3.3.5a}/2012_03_01_02_world_locales_creature_text.sql | 0 .../world => old/3.3.5a}/2012_03_03_00_world_command.sql | 0 sql/{updates/world => old/3.3.5a}/2012_03_04_00_world_misc.sql | 0 .../3.3.5a}/2012_03_04_01_world_areatrigger_scripts.sql | 0 .../world => old/3.3.5a}/2012_03_06_00_world_commands.sql | 0 sql/{updates/world => old/3.3.5a}/2012_03_06_01_world_misc.sql | 0 .../3.3.5a}/2012_03_06_02_world_queststatus_seasonal.sql | 0 .../world => old/3.3.5a}/2012_03_06_03_world_smart_scripts.sql | 0 .../world => old/3.3.5a}/2012_03_06_04_world_creature_text.sql | 0 .../world => old/3.3.5a}/2012_03_07_00_world_trinity_string.sql | 0 .../world => old/3.3.5a}/2012_03_10_00_world_creature.sql | 0 .../world => old/3.3.5a}/2012_03_10_00_world_smart_scripts.sql | 0 .../world => old/3.3.5a}/2012_03_10_00_world_waypoint_data.sql | 0 sql/{updates/world => old/3.3.5a}/2012_03_11_00_world_sai.sql | 0 .../3.3.5a}/2012_03_12_00_world_creature_template.sql | 0 .../world => old/3.3.5a}/2012_03_12_01_world_conditions.sql | 0 .../world => old/3.3.5a}/2012_03_12_01_world_gameobject.sql | 0 .../3.3.5a}/2012_03_12_01_world_spell_script_names.sql | 0 .../world => old/3.3.5a}/2012_03_14_00_world_creature_addon.sql | 0 .../world => old/3.3.5a}/2012_03_19_00_world_smart_scripts.sql | 0 .../world => old/3.3.5a}/2012_03_20_00_world_gossip.sql | 0 .../world => old/3.3.5a}/2012_03_21_00_world_creature.sql | 0 .../3.3.5a}/2012_03_22_00_world_creature_template.sql | 0 .../world => old/3.3.5a}/2012_03_22_01_world_conditions.sql | 0 .../world => old/3.3.5a}/2012_03_23_00_world_ip2nation.sql | 0 sql/{updates/world => old/3.3.5a}/2012_03_24_00_world_misc.sql | 0 .../3.3.5a}/2012_03_24_01_world_creature_loot_template.sql | 0 .../3.3.5a}/2012_03_24_02_world_creature_loot_template.sql | 0 sql/{updates/auth => old/3.3.5a}/2012_03_25_00_auth_misc.sql | 0 .../world => old/3.3.5a}/2012_03_25_00_world_game_event.sql | 0 .../auth => old/3.3.5a}/2012_03_26_00_auth_realmlist.sql | 0 .../3.3.5a}/2012_03_26_00_world_creature_template.sql | 0 .../3.3.5a}/2012_03_26_01_world_spell_script_names.sql | 0 sql/{updates/world => old/3.3.5a}/2012_03_27_00_world_misc.sql | 0 sql/{updates/world => old/3.3.5a}/2012_03_27_01_world_misc.sql | 0 sql/{updates/world => old/3.3.5a}/2012_03_27_02_world_misc.sql | 0 sql/{updates/world => old/3.3.5a}/2012_03_27_03_world_misc.sql | 0 sql/{updates/world => old/3.3.5a}/2012_03_27_04_world_misc.sql | 0 sql/{updates/auth => old/3.3.5a}/2012_03_28_00_auth_account.sql | 0 .../auth => old/3.3.5a}/2012_03_28_01_auth_account_access.sql | 0 .../3.3.5a}/2012_03_28_01_world_spell_bonus_data.sql | 0 .../auth => old/3.3.5a}/2012_03_28_02_auth_account_banned.sql | 0 .../auth => old/3.3.5a}/2012_03_28_03_auth_ip_banned.sql | 0 sql/{updates/auth => old/3.3.5a}/2012_03_28_04_auth_logs.sql | 0 .../auth => old/3.3.5a}/2012_03_28_05_auth_realmcharacters.sql | 0 .../auth => old/3.3.5a}/2012_03_28_06_auth_realmlist.sql | 0 sql/{updates/auth => old/3.3.5a}/2012_03_28_07_auth_uptime.sql | 0 .../world => old/3.3.5a}/2012_03_30_00_world_smart_scripts.sql | 0 .../3.3.5a}/2012_03_31_00_world_creature_loot_template.sql | 0 .../auth => old/3.3.5a}/2012_04_01_00_auth_realmlist.sql | 0 .../world => old/3.3.5a}/2012_04_01_00_world_creature.sql | 0 .../3.3.5a}/2012_04_01_00_world_spell_script_names.sql | 0 .../world => old/3.3.5a}/2012_04_01_01_world_creature.sql | 0 .../3.3.5a}/2012_04_01_02_world_spell_group_stack_rules.sql | 0 .../world => old/3.3.5a}/2012_04_01_03_world_trainers.sql | 0 .../world => old/3.3.5a}/2012_04_01_04_world_conditions.sql | 0 .../3.3.5a}/2012_04_01_05_world_creature_template.sql | 0 sql/{updates/world => old/3.3.5a}/2012_04_01_06_world_sai.sql | 0 sql/{updates/world => old/3.3.5a}/2012_04_01_07_world_misc.sql | 0 .../3.3.5a}/2012_04_03_00_world_spell_script_names.sql | 0 .../auth => old/3.3.5a}/2012_04_04_00_auth_realmlist.sql | 0 .../world => old/3.3.5a}/2012_04_04_00_world_conditions.sql | 0 .../world => old/3.3.5a}/2012_04_04_01_world_spell_dbc.sql | 0 .../3.3.5a}/2012_04_05_00_world_gameobject_template.sql | 0 .../3.3.5a}/2012_04_05_00_world_spell_script_names.sql | 0 .../3.3.5a}/2012_04_05_01_world_spell_proc_event.sql | 0 .../3.3.5a}/2012_04_06_00_world_spell_proc_event.sql | 0 .../world => old/3.3.5a}/2012_04_06_01_world_spell_dbc.sql | 0 .../3.3.5a}/2012_04_06_02_world_gameobject_template.sql | 0 .../world => old/3.3.5a}/2012_04_06_03_world_spell_dbc.sql | 0 .../world => old/3.3.5a}/2012_04_06_04_world_page_text.sql | 0 .../3.3.5a}/2012_04_07_00_characters_lag_reports.sql | 0 .../world => old/3.3.5a}/2012_04_07_00_world_gameobject.sql | 0 .../world => old/3.3.5a}/2012_04_07_01_world_game_event.sql | 0 .../3.3.5a}/2012_04_07_02_world_spell_proc_event.sql | 0 .../3.3.5a}/2012_04_08_00_world_spell_script_names.sql | 0 .../3.3.5a}/2012_04_08_01_world_creature_template.sql | 0 .../world => old/3.3.5a}/2012_04_08_02_world_spell_dbc.sql | 0 .../3.3.5a}/2012_04_08_02_world_spell_script_names.sql | 0 .../3.3.5a}/2012_04_08_03_world_spell_script_names.sql | 0 .../3.3.5a}/2012_04_12_00_world_creature_template.sql | 0 .../3.3.5a}/2012_04_12_01_world_creature_template.sql | 0 .../3.3.5a}/2012_04_12_02_world_spell_bonus_data.sql | 0 .../3.3.5a}/2012_04_12_03_world_spell_bonus_data.sql | 0 .../3.3.5a}/2012_04_12_04_world_creature_template.sql | 0 .../world => old/3.3.5a}/2012_04_12_05_world_command.sql | 0 sql/{updates/world => old/3.3.5a}/2012_04_13_00_world_sai.sql | 0 sql/{updates/world => old/3.3.5a}/2012_04_13_01_world_misc.sql | 0 sql/{updates/world => old/3.3.5a}/2012_04_13_02_world_misc.sql | 0 .../world => old/3.3.5a}/2012_04_13_03_world_bg_template.sql | 0 .../3.3.5a}/2012_04_13_04_world_spell_proc_event.sql | 0 .../3.3.5a}/2012_04_14_00_world_gameobject_loot_template.sql | 0 .../3.3.5a}/2012_04_14_01_world_gameobject_loot_template.sql | 0 .../3.3.5a}/2012_04_14_02_world_creature_template_addon.sql | 0 .../3.3.5a}/2012_04_14_03_world_spell_bonus_data.sql | 0 .../3.3.5a}/2012_04_14_04_world_spell_proc_event.sql | 0 .../3.3.5a}/2012_04_14_05_world_spell_proc_event.sql | 0 .../world => old/3.3.5a}/2012_04_16_00_world_game_event.sql | 0 .../world => old/3.3.5a}/2012_04_17_00_world_creature.sql | 0 .../3.3.5a}/2012_04_18_00_world_npc_spellclick_spells.sql | 0 .../world => old/3.3.5a}/2012_04_18_01_world_creature.sql | 0 .../3.3.5a}/2012_04_18_02_world_reference_loot_template.sql | 0 .../3.3.5a}/2012_04_18_03_world_creature_loot_template.sql | 0 .../3.3.5a}/2012_04_18_04_world_pickpocketing_loot_template.sql | 0 .../world => old/3.3.5a}/2012_04_18_05_world_conditions.sql | 0 .../3.3.5a}/2012_04_18_06_world_creature_template.sql | 0 .../3.3.5a}/2012_04_18_07_world_fishing_loot_template.sql | 0 .../3.3.5a}/2012_04_18_08_world_creature_loot_template.sql | 0 .../3.3.5a}/2012_04_19_00_world_creature_template.sql | 0 .../3.3.5a}/2012_04_19_01_world_pickpocketing_loot_template.sql | 0 .../3.3.5a}/2012_04_19_02_world_creature_loot_template.sql | 0 .../3.3.5a}/2012_04_19_03_world_instance_ulduar.sql | 0 .../3.3.5a}/2012_04_20_00_world_gameobject_loot_template.sql | 0 .../3.3.5a}/2012_04_20_01_world_item_loot_template.sql | 0 .../3.3.5a}/2012_04_20_02_world_creature_loot_template.sql | 0 .../3.3.5a}/2012_04_20_03_world_creature_loot_template.sql | 0 .../3.3.5a}/2012_04_20_04_world_creature_loot_template.sql | 0 .../world => old/3.3.5a}/2012_04_20_05_gameobject_template.sql | 0 .../3.3.5a}/2012_04_21_00_world_spell_script_names.sql | 0 sql/{updates/world => old/3.3.5a}/2012_04_22_00_world_sai.sql | 0 .../world => old/3.3.5a}/2012_04_23_00_world_creatures.sql | 0 .../world => old/3.3.5a}/2012_04_23_01_world_conditions.sql | 0 .../3.3.5a}/2012_04_23_02_world_prospecting_loot_template.sql | 0 .../3.3.5a}/2012_04_23_03_world_skinning_loot_template.sql | 0 .../3.3.5a}/2012_04_23_04_world_creature_loot_template.sql | 0 .../3.3.5a}/2012_04_23_05_world_creature_loot_template.sql | 0 .../world => old/3.3.5a}/2012_04_24_00_world_command.sql | 0 .../3.3.5a}/2012_04_24_01_world_spell_proc_event.sql | 0 .../world => old/3.3.5a}/2012_04_24_02_world_warden_checks.sql | 0 .../3.3.5a}/2012_04_24_03_world_spell_script_names.sql | 0 .../3.3.5a}/2012_04_24_04_world_spell_proc_event.sql | 0 .../3.3.5a}/2012_04_24_05_world_creature_loot_template.sql | 0 sql/{updates/world => old/3.3.5a}/2012_04_24_06_world_misc.sql | 0 sql/{updates/world => old/3.3.5a}/2012_04_25_00_world_misc.sql | 0 .../3.3.5a}/2012_04_25_01_world_spell_script_names.sql | 0 .../3.3.5a}/2012_04_25_02_world_spell_script_names.sql | 0 .../world => old/3.3.5a}/2012_04_25_03_world_spell_group.sql | 0 .../world => old/3.3.5a}/2012_04_26_00_world_conditions.sql | 0 .../world => old/3.3.5a}/2012_04_26_01_world_smart_scripts.sql | 0 .../world => old/3.3.5a}/2012_04_27_00_world_instance_icc.sql | 0 .../3.3.5a}/2012_04_28_00_world_reference_loot_template.sql | 0 .../3.3.5a}/2012_04_28_01_world_reference_loot_template.sql | 0 .../world => old/3.3.5a}/2012_05_01_00_world_creature.sql | 0 .../3.3.5a}/2012_05_02_00_world_creature_loot_template.sql | 0 .../world => old/3.3.5a}/2012_05_03_00_world_creature.sql | 0 .../world => old/3.3.5a}/2012_05_03_01_world_cos_misc.sql | 0 .../world => old/3.3.5a}/2012_05_03_02_world_quest_template.sql | 0 .../3.3.5a}/2012_05_03_03_world_creature_questrelation.sql | 0 .../3.3.5a}/2012_05_03_04_world_game_event_creature_quest.sql | 0 .../world => old/3.3.5a}/2012_05_04_00_world_waypoints.sql | 0 sql/{updates/world => old/3.3.5a}/2012_05_04_01_world_sai.sql | 0 sql/{updates/world => old/3.3.5a}/2012_05_05_00_world_sai.sql | 0 .../3.3.5a}/2012_05_05_01_world_creature_template.sql | 0 .../world => old/3.3.5a}/2012_05_05_02_world_gameobject.sql | 0 sql/{updates/world => old/3.3.5a}/2012_05_05_03_world_sai.sql | 0 .../3.3.5a}/2012_05_05_04_world_creature_template.sql | 0 .../3.3.5a}/2012_05_05_05_world_creature_template.sql | 0 sql/{updates/world => old/3.3.5a}/2012_05_05_06_world_sai.sql | 0 .../3.3.5a}/2012_05_06_00_world_creature_template.sql | 0 .../3.3.5a}/2012_05_06_01_world_creature_template.sql | 0 .../world => old/3.3.5a}/2012_05_07_00_world_waypoints.sql | 0 sql/{updates/world => old/3.3.5a}/2012_05_07_01_world_sai.sql | 0 sql/{updates/world => old/3.3.5a}/2012_05_08_00_world_sai.sql | 0 .../world => old/3.3.5a}/2012_05_08_01_world_gameobject.sql | 0 sql/{updates/world => old/3.3.5a}/2012_05_08_01_world_misc.sql | 0 .../3.3.5a}/2012_05_09_00_world_spell_target_position.sql | 0 .../world => old/3.3.5a}/2012_05_09_01_world_commands.sql | 0 sql/{updates/world => old/3.3.5a}/2012_05_09_02_world_sai.sql | 0 sql/{updates/world => old/3.3.5a}/2012_05_09_03_world_misc.sql | 0 sql/{updates/world => old/3.3.5a}/2012_05_10_00_world_sai.sql | 0 sql/{updates/world => old/3.3.5a}/2012_05_10_01_world_misc.sql | 0 .../3.3.5a}/2012_05_10_02_world_creature_template.sql | 0 sql/{updates/world => old/3.3.5a}/2012_05_10_03_world_misc.sql | 0 .../world => old/3.3.5a}/2012_05_10_04_world_ceature_sai.sql | 0 .../world => old/3.3.5a}/2012_05_10_05_world_waypoints.sql | 0 .../world => old/3.3.5a}/2012_05_10_06_world_waypoints.sql | 0 .../world => old/3.3.5a}/2012_05_11_00_world_waypoints.sql | 0 .../3.3.5a}/2012_05_11_01_world_gameobject_template.sql | 0 .../world => old/3.3.5a}/2012_05_11_02_world_conditions.sql | 0 .../3.3.5a}/2012_05_12_00_world_gameobject_template.sql | 0 .../3.3.5a}/2012_05_12_01_world_item_loot_template.sql | 0 .../3.3.5a}/2012_05_12_02_world_gameobject_loot_template.sql | 0 .../world => old/3.3.5a}/2012_05_13_00_world_creature_text.sql | 0 .../world => old/3.3.5a}/2012_05_13_01_world_creature_text.sql | 0 .../world => old/3.3.5a}/2012_05_16_00_world_scripts.sql | 0 .../world => old/3.3.5a}/2012_05_17_00_world_creature_text.sql | 0 .../world => old/3.3.5a}/2012_05_18_00_world_conditions.sql | 0 sql/{updates/world => old/3.3.5a}/2012_05_18_01_world_misc.sql | 0 .../3.3.5a}/2012_05_18_01_world_spell_target_position.sql | 0 .../world => old/3.3.5a}/2012_05_19_00_world_quest_template.sql | 0 .../world => old/3.3.5a}/2012_05_19_01_world_smart_scripts.sql | 0 sql/{updates/world => old/3.3.5a}/2012_05_19_02_world_misc.sql | 2 +- sql/updates/world/2012_02_19_03_world_version.sql | 1 + 260 files changed, 2 insertions(+), 1 deletion(-) rename sql/{updates/world => old/3.3.5a}/2012_02_13_00_world_version.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_14_00_world_achievement_criteria_data.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_15_00_world_quest_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_15_01_world_areatrigger_tavern.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_15_02_world_item_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_15_03_world_quest_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_15_04_world_quest_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_15_06_world_creature_involvedrelation.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_15_07_00_world_creature.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_15_07_01_world_waypoint_data.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_15_07_02_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_15_08_world_sai.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_15_09_world_spell_proc_event.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_16_00_world_conditions.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_16_01_world_conditions.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_17_00_world_waypoints.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_18_00_world_spell_script_names.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_18_01_world_spell_dbc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_18_02_world_gossip.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_18_03_world_gossip.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_18_04_world_spell_script_names.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_18_05_world_creatures.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_18_06_world_gossip.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_18_07_world_gossip.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_18_08_world_gossip.sql (100%) rename sql/{updates/auth => old/3.3.5a}/2012_02_19_00_auth_account.sql (100%) rename sql/{updates/characters => old/3.3.5a}/2012_02_19_00_characters_warden_action.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_19_00_world_quest_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_19_01_world_quest_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_19_02_world_gameobject.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_19_03_world_warden_checks.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_19_04_world_misc_db_updates.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_19_05_world_creature_text.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_19_06_world_creature_text.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_20_00_world_sai.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_20_01_world_gossip.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_20_02_world_conditons.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_21_00_world_creature_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_21_01_world_conditions.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_21_02_world_creature_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_21_03_world_creature_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_21_04_world_creature_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_21_05_world_gossip.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_21_06_world_Gossip.sql (100%) rename sql/{updates/world/2012_02_22_00_world_SAI.sql => old/3.3.5a/2012_02_22_00_world_sai.sql} (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_22_01_world_creature_text.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_22_02_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_22_03_world_conditions.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_23_00_world_spell_script_names.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_24_00_world_gameobject_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_24_01_world_sai.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_25_00_world_spell_script_names.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_25_01_world_command.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_25_01_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_25_02_world_sai.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_26_00_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_26_01_world_spell_script_names.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_27_00_world_creature_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_28_00_world_wintergrasp_spawns.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_29_00_world_conditions_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_29_01_world_conditions.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_29_02_world_conditions.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_29_03_world_creature_text.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_29_04_world_creature_text.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_02_29_05_world_creature_text.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_01_00_world_conditions.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_01_01_world_creature_text.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_01_02_world_locales_creature_text.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_03_00_world_command.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_04_00_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_04_01_world_areatrigger_scripts.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_06_00_world_commands.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_06_01_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_06_02_world_queststatus_seasonal.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_06_03_world_smart_scripts.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_06_04_world_creature_text.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_07_00_world_trinity_string.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_10_00_world_creature.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_10_00_world_smart_scripts.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_10_00_world_waypoint_data.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_11_00_world_sai.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_12_00_world_creature_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_12_01_world_conditions.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_12_01_world_gameobject.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_12_01_world_spell_script_names.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_14_00_world_creature_addon.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_19_00_world_smart_scripts.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_20_00_world_gossip.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_21_00_world_creature.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_22_00_world_creature_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_22_01_world_conditions.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_23_00_world_ip2nation.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_24_00_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_24_01_world_creature_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_24_02_world_creature_loot_template.sql (100%) rename sql/{updates/auth => old/3.3.5a}/2012_03_25_00_auth_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_25_00_world_game_event.sql (100%) rename sql/{updates/auth => old/3.3.5a}/2012_03_26_00_auth_realmlist.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_26_00_world_creature_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_26_01_world_spell_script_names.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_27_00_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_27_01_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_27_02_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_27_03_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_27_04_world_misc.sql (100%) rename sql/{updates/auth => old/3.3.5a}/2012_03_28_00_auth_account.sql (100%) rename sql/{updates/auth => old/3.3.5a}/2012_03_28_01_auth_account_access.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_28_01_world_spell_bonus_data.sql (100%) rename sql/{updates/auth => old/3.3.5a}/2012_03_28_02_auth_account_banned.sql (100%) rename sql/{updates/auth => old/3.3.5a}/2012_03_28_03_auth_ip_banned.sql (100%) rename sql/{updates/auth => old/3.3.5a}/2012_03_28_04_auth_logs.sql (100%) rename sql/{updates/auth => old/3.3.5a}/2012_03_28_05_auth_realmcharacters.sql (100%) rename sql/{updates/auth => old/3.3.5a}/2012_03_28_06_auth_realmlist.sql (100%) rename sql/{updates/auth => old/3.3.5a}/2012_03_28_07_auth_uptime.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_30_00_world_smart_scripts.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_03_31_00_world_creature_loot_template.sql (100%) rename sql/{updates/auth => old/3.3.5a}/2012_04_01_00_auth_realmlist.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_01_00_world_creature.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_01_00_world_spell_script_names.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_01_01_world_creature.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_01_02_world_spell_group_stack_rules.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_01_03_world_trainers.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_01_04_world_conditions.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_01_05_world_creature_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_01_06_world_sai.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_01_07_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_03_00_world_spell_script_names.sql (100%) rename sql/{updates/auth => old/3.3.5a}/2012_04_04_00_auth_realmlist.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_04_00_world_conditions.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_04_01_world_spell_dbc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_05_00_world_gameobject_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_05_00_world_spell_script_names.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_05_01_world_spell_proc_event.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_06_00_world_spell_proc_event.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_06_01_world_spell_dbc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_06_02_world_gameobject_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_06_03_world_spell_dbc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_06_04_world_page_text.sql (100%) rename sql/{updates/characters => old/3.3.5a}/2012_04_07_00_characters_lag_reports.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_07_00_world_gameobject.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_07_01_world_game_event.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_07_02_world_spell_proc_event.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_08_00_world_spell_script_names.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_08_01_world_creature_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_08_02_world_spell_dbc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_08_02_world_spell_script_names.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_08_03_world_spell_script_names.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_12_00_world_creature_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_12_01_world_creature_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_12_02_world_spell_bonus_data.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_12_03_world_spell_bonus_data.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_12_04_world_creature_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_12_05_world_command.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_13_00_world_sai.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_13_01_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_13_02_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_13_03_world_bg_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_13_04_world_spell_proc_event.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_14_00_world_gameobject_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_14_01_world_gameobject_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_14_02_world_creature_template_addon.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_14_03_world_spell_bonus_data.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_14_04_world_spell_proc_event.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_14_05_world_spell_proc_event.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_16_00_world_game_event.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_17_00_world_creature.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_18_00_world_npc_spellclick_spells.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_18_01_world_creature.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_18_02_world_reference_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_18_03_world_creature_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_18_04_world_pickpocketing_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_18_05_world_conditions.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_18_06_world_creature_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_18_07_world_fishing_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_18_08_world_creature_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_19_00_world_creature_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_19_01_world_pickpocketing_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_19_02_world_creature_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_19_03_world_instance_ulduar.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_20_00_world_gameobject_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_20_01_world_item_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_20_02_world_creature_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_20_03_world_creature_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_20_04_world_creature_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_20_05_gameobject_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_21_00_world_spell_script_names.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_22_00_world_sai.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_23_00_world_creatures.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_23_01_world_conditions.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_23_02_world_prospecting_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_23_03_world_skinning_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_23_04_world_creature_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_23_05_world_creature_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_24_00_world_command.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_24_01_world_spell_proc_event.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_24_02_world_warden_checks.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_24_03_world_spell_script_names.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_24_04_world_spell_proc_event.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_24_05_world_creature_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_24_06_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_25_00_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_25_01_world_spell_script_names.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_25_02_world_spell_script_names.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_25_03_world_spell_group.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_26_00_world_conditions.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_26_01_world_smart_scripts.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_27_00_world_instance_icc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_28_00_world_reference_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_04_28_01_world_reference_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_01_00_world_creature.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_02_00_world_creature_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_03_00_world_creature.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_03_01_world_cos_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_03_02_world_quest_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_03_03_world_creature_questrelation.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_03_04_world_game_event_creature_quest.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_04_00_world_waypoints.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_04_01_world_sai.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_05_00_world_sai.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_05_01_world_creature_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_05_02_world_gameobject.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_05_03_world_sai.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_05_04_world_creature_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_05_05_world_creature_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_05_06_world_sai.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_06_00_world_creature_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_06_01_world_creature_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_07_00_world_waypoints.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_07_01_world_sai.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_08_00_world_sai.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_08_01_world_gameobject.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_08_01_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_09_00_world_spell_target_position.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_09_01_world_commands.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_09_02_world_sai.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_09_03_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_10_00_world_sai.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_10_01_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_10_02_world_creature_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_10_03_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_10_04_world_ceature_sai.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_10_05_world_waypoints.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_10_06_world_waypoints.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_11_00_world_waypoints.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_11_01_world_gameobject_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_11_02_world_conditions.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_12_00_world_gameobject_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_12_01_world_item_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_12_02_world_gameobject_loot_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_13_00_world_creature_text.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_13_01_world_creature_text.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_16_00_world_scripts.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_17_00_world_creature_text.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_18_00_world_conditions.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_18_01_world_misc.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_18_01_world_spell_target_position.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_19_00_world_quest_template.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_19_01_world_smart_scripts.sql (100%) rename sql/{updates/world => old/3.3.5a}/2012_05_19_02_world_misc.sql (62%) create mode 100644 sql/updates/world/2012_02_19_03_world_version.sql diff --git a/sql/updates/world/2012_02_13_00_world_version.sql b/sql/old/3.3.5a/2012_02_13_00_world_version.sql similarity index 100% rename from sql/updates/world/2012_02_13_00_world_version.sql rename to sql/old/3.3.5a/2012_02_13_00_world_version.sql diff --git a/sql/updates/world/2012_02_14_00_world_achievement_criteria_data.sql b/sql/old/3.3.5a/2012_02_14_00_world_achievement_criteria_data.sql similarity index 100% rename from sql/updates/world/2012_02_14_00_world_achievement_criteria_data.sql rename to sql/old/3.3.5a/2012_02_14_00_world_achievement_criteria_data.sql diff --git a/sql/updates/world/2012_02_15_00_world_quest_template.sql b/sql/old/3.3.5a/2012_02_15_00_world_quest_template.sql similarity index 100% rename from sql/updates/world/2012_02_15_00_world_quest_template.sql rename to sql/old/3.3.5a/2012_02_15_00_world_quest_template.sql diff --git a/sql/updates/world/2012_02_15_01_world_areatrigger_tavern.sql b/sql/old/3.3.5a/2012_02_15_01_world_areatrigger_tavern.sql similarity index 100% rename from sql/updates/world/2012_02_15_01_world_areatrigger_tavern.sql rename to sql/old/3.3.5a/2012_02_15_01_world_areatrigger_tavern.sql diff --git a/sql/updates/world/2012_02_15_02_world_item_template.sql b/sql/old/3.3.5a/2012_02_15_02_world_item_template.sql similarity index 100% rename from sql/updates/world/2012_02_15_02_world_item_template.sql rename to sql/old/3.3.5a/2012_02_15_02_world_item_template.sql diff --git a/sql/updates/world/2012_02_15_03_world_quest_template.sql b/sql/old/3.3.5a/2012_02_15_03_world_quest_template.sql similarity index 100% rename from sql/updates/world/2012_02_15_03_world_quest_template.sql rename to sql/old/3.3.5a/2012_02_15_03_world_quest_template.sql diff --git a/sql/updates/world/2012_02_15_04_world_quest_template.sql b/sql/old/3.3.5a/2012_02_15_04_world_quest_template.sql similarity index 100% rename from sql/updates/world/2012_02_15_04_world_quest_template.sql rename to sql/old/3.3.5a/2012_02_15_04_world_quest_template.sql diff --git a/sql/updates/world/2012_02_15_06_world_creature_involvedrelation.sql b/sql/old/3.3.5a/2012_02_15_06_world_creature_involvedrelation.sql similarity index 100% rename from sql/updates/world/2012_02_15_06_world_creature_involvedrelation.sql rename to sql/old/3.3.5a/2012_02_15_06_world_creature_involvedrelation.sql diff --git a/sql/updates/world/2012_02_15_07_00_world_creature.sql b/sql/old/3.3.5a/2012_02_15_07_00_world_creature.sql similarity index 100% rename from sql/updates/world/2012_02_15_07_00_world_creature.sql rename to sql/old/3.3.5a/2012_02_15_07_00_world_creature.sql diff --git a/sql/updates/world/2012_02_15_07_01_world_waypoint_data.sql b/sql/old/3.3.5a/2012_02_15_07_01_world_waypoint_data.sql similarity index 100% rename from sql/updates/world/2012_02_15_07_01_world_waypoint_data.sql rename to sql/old/3.3.5a/2012_02_15_07_01_world_waypoint_data.sql diff --git a/sql/updates/world/2012_02_15_07_02_world_misc.sql b/sql/old/3.3.5a/2012_02_15_07_02_world_misc.sql similarity index 100% rename from sql/updates/world/2012_02_15_07_02_world_misc.sql rename to sql/old/3.3.5a/2012_02_15_07_02_world_misc.sql diff --git a/sql/updates/world/2012_02_15_08_world_sai.sql b/sql/old/3.3.5a/2012_02_15_08_world_sai.sql similarity index 100% rename from sql/updates/world/2012_02_15_08_world_sai.sql rename to sql/old/3.3.5a/2012_02_15_08_world_sai.sql diff --git a/sql/updates/world/2012_02_15_09_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_02_15_09_world_spell_proc_event.sql similarity index 100% rename from sql/updates/world/2012_02_15_09_world_spell_proc_event.sql rename to sql/old/3.3.5a/2012_02_15_09_world_spell_proc_event.sql diff --git a/sql/updates/world/2012_02_16_00_world_conditions.sql b/sql/old/3.3.5a/2012_02_16_00_world_conditions.sql similarity index 100% rename from sql/updates/world/2012_02_16_00_world_conditions.sql rename to sql/old/3.3.5a/2012_02_16_00_world_conditions.sql diff --git a/sql/updates/world/2012_02_16_01_world_conditions.sql b/sql/old/3.3.5a/2012_02_16_01_world_conditions.sql similarity index 100% rename from sql/updates/world/2012_02_16_01_world_conditions.sql rename to sql/old/3.3.5a/2012_02_16_01_world_conditions.sql diff --git a/sql/updates/world/2012_02_17_00_world_waypoints.sql b/sql/old/3.3.5a/2012_02_17_00_world_waypoints.sql similarity index 100% rename from sql/updates/world/2012_02_17_00_world_waypoints.sql rename to sql/old/3.3.5a/2012_02_17_00_world_waypoints.sql diff --git a/sql/updates/world/2012_02_18_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_02_18_00_world_spell_script_names.sql similarity index 100% rename from sql/updates/world/2012_02_18_00_world_spell_script_names.sql rename to sql/old/3.3.5a/2012_02_18_00_world_spell_script_names.sql diff --git a/sql/updates/world/2012_02_18_01_world_spell_dbc.sql b/sql/old/3.3.5a/2012_02_18_01_world_spell_dbc.sql similarity index 100% rename from sql/updates/world/2012_02_18_01_world_spell_dbc.sql rename to sql/old/3.3.5a/2012_02_18_01_world_spell_dbc.sql diff --git a/sql/updates/world/2012_02_18_02_world_gossip.sql b/sql/old/3.3.5a/2012_02_18_02_world_gossip.sql similarity index 100% rename from sql/updates/world/2012_02_18_02_world_gossip.sql rename to sql/old/3.3.5a/2012_02_18_02_world_gossip.sql diff --git a/sql/updates/world/2012_02_18_03_world_gossip.sql b/sql/old/3.3.5a/2012_02_18_03_world_gossip.sql similarity index 100% rename from sql/updates/world/2012_02_18_03_world_gossip.sql rename to sql/old/3.3.5a/2012_02_18_03_world_gossip.sql diff --git a/sql/updates/world/2012_02_18_04_world_spell_script_names.sql b/sql/old/3.3.5a/2012_02_18_04_world_spell_script_names.sql similarity index 100% rename from sql/updates/world/2012_02_18_04_world_spell_script_names.sql rename to sql/old/3.3.5a/2012_02_18_04_world_spell_script_names.sql diff --git a/sql/updates/world/2012_02_18_05_world_creatures.sql b/sql/old/3.3.5a/2012_02_18_05_world_creatures.sql similarity index 100% rename from sql/updates/world/2012_02_18_05_world_creatures.sql rename to sql/old/3.3.5a/2012_02_18_05_world_creatures.sql diff --git a/sql/updates/world/2012_02_18_06_world_gossip.sql b/sql/old/3.3.5a/2012_02_18_06_world_gossip.sql similarity index 100% rename from sql/updates/world/2012_02_18_06_world_gossip.sql rename to sql/old/3.3.5a/2012_02_18_06_world_gossip.sql diff --git a/sql/updates/world/2012_02_18_07_world_gossip.sql b/sql/old/3.3.5a/2012_02_18_07_world_gossip.sql similarity index 100% rename from sql/updates/world/2012_02_18_07_world_gossip.sql rename to sql/old/3.3.5a/2012_02_18_07_world_gossip.sql diff --git a/sql/updates/world/2012_02_18_08_world_gossip.sql b/sql/old/3.3.5a/2012_02_18_08_world_gossip.sql similarity index 100% rename from sql/updates/world/2012_02_18_08_world_gossip.sql rename to sql/old/3.3.5a/2012_02_18_08_world_gossip.sql diff --git a/sql/updates/auth/2012_02_19_00_auth_account.sql b/sql/old/3.3.5a/2012_02_19_00_auth_account.sql similarity index 100% rename from sql/updates/auth/2012_02_19_00_auth_account.sql rename to sql/old/3.3.5a/2012_02_19_00_auth_account.sql diff --git a/sql/updates/characters/2012_02_19_00_characters_warden_action.sql b/sql/old/3.3.5a/2012_02_19_00_characters_warden_action.sql similarity index 100% rename from sql/updates/characters/2012_02_19_00_characters_warden_action.sql rename to sql/old/3.3.5a/2012_02_19_00_characters_warden_action.sql diff --git a/sql/updates/world/2012_02_19_00_world_quest_template.sql b/sql/old/3.3.5a/2012_02_19_00_world_quest_template.sql similarity index 100% rename from sql/updates/world/2012_02_19_00_world_quest_template.sql rename to sql/old/3.3.5a/2012_02_19_00_world_quest_template.sql diff --git a/sql/updates/world/2012_02_19_01_world_quest_template.sql b/sql/old/3.3.5a/2012_02_19_01_world_quest_template.sql similarity index 100% rename from sql/updates/world/2012_02_19_01_world_quest_template.sql rename to sql/old/3.3.5a/2012_02_19_01_world_quest_template.sql diff --git a/sql/updates/world/2012_02_19_02_world_gameobject.sql b/sql/old/3.3.5a/2012_02_19_02_world_gameobject.sql similarity index 100% rename from sql/updates/world/2012_02_19_02_world_gameobject.sql rename to sql/old/3.3.5a/2012_02_19_02_world_gameobject.sql diff --git a/sql/updates/world/2012_02_19_03_world_warden_checks.sql b/sql/old/3.3.5a/2012_02_19_03_world_warden_checks.sql similarity index 100% rename from sql/updates/world/2012_02_19_03_world_warden_checks.sql rename to sql/old/3.3.5a/2012_02_19_03_world_warden_checks.sql diff --git a/sql/updates/world/2012_02_19_04_world_misc_db_updates.sql b/sql/old/3.3.5a/2012_02_19_04_world_misc_db_updates.sql similarity index 100% rename from sql/updates/world/2012_02_19_04_world_misc_db_updates.sql rename to sql/old/3.3.5a/2012_02_19_04_world_misc_db_updates.sql diff --git a/sql/updates/world/2012_02_19_05_world_creature_text.sql b/sql/old/3.3.5a/2012_02_19_05_world_creature_text.sql similarity index 100% rename from sql/updates/world/2012_02_19_05_world_creature_text.sql rename to sql/old/3.3.5a/2012_02_19_05_world_creature_text.sql diff --git a/sql/updates/world/2012_02_19_06_world_creature_text.sql b/sql/old/3.3.5a/2012_02_19_06_world_creature_text.sql similarity index 100% rename from sql/updates/world/2012_02_19_06_world_creature_text.sql rename to sql/old/3.3.5a/2012_02_19_06_world_creature_text.sql diff --git a/sql/updates/world/2012_02_20_00_world_sai.sql b/sql/old/3.3.5a/2012_02_20_00_world_sai.sql similarity index 100% rename from sql/updates/world/2012_02_20_00_world_sai.sql rename to sql/old/3.3.5a/2012_02_20_00_world_sai.sql diff --git a/sql/updates/world/2012_02_20_01_world_gossip.sql b/sql/old/3.3.5a/2012_02_20_01_world_gossip.sql similarity index 100% rename from sql/updates/world/2012_02_20_01_world_gossip.sql rename to sql/old/3.3.5a/2012_02_20_01_world_gossip.sql diff --git a/sql/updates/world/2012_02_20_02_world_conditons.sql b/sql/old/3.3.5a/2012_02_20_02_world_conditons.sql similarity index 100% rename from sql/updates/world/2012_02_20_02_world_conditons.sql rename to sql/old/3.3.5a/2012_02_20_02_world_conditons.sql diff --git a/sql/updates/world/2012_02_21_00_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_02_21_00_world_creature_loot_template.sql similarity index 100% rename from sql/updates/world/2012_02_21_00_world_creature_loot_template.sql rename to sql/old/3.3.5a/2012_02_21_00_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_02_21_01_world_conditions.sql b/sql/old/3.3.5a/2012_02_21_01_world_conditions.sql similarity index 100% rename from sql/updates/world/2012_02_21_01_world_conditions.sql rename to sql/old/3.3.5a/2012_02_21_01_world_conditions.sql diff --git a/sql/updates/world/2012_02_21_02_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_02_21_02_world_creature_loot_template.sql similarity index 100% rename from sql/updates/world/2012_02_21_02_world_creature_loot_template.sql rename to sql/old/3.3.5a/2012_02_21_02_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_02_21_03_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_02_21_03_world_creature_loot_template.sql similarity index 100% rename from sql/updates/world/2012_02_21_03_world_creature_loot_template.sql rename to sql/old/3.3.5a/2012_02_21_03_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_02_21_04_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_02_21_04_world_creature_loot_template.sql similarity index 100% rename from sql/updates/world/2012_02_21_04_world_creature_loot_template.sql rename to sql/old/3.3.5a/2012_02_21_04_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_02_21_05_world_gossip.sql b/sql/old/3.3.5a/2012_02_21_05_world_gossip.sql similarity index 100% rename from sql/updates/world/2012_02_21_05_world_gossip.sql rename to sql/old/3.3.5a/2012_02_21_05_world_gossip.sql diff --git a/sql/updates/world/2012_02_21_06_world_Gossip.sql b/sql/old/3.3.5a/2012_02_21_06_world_Gossip.sql similarity index 100% rename from sql/updates/world/2012_02_21_06_world_Gossip.sql rename to sql/old/3.3.5a/2012_02_21_06_world_Gossip.sql diff --git a/sql/updates/world/2012_02_22_00_world_SAI.sql b/sql/old/3.3.5a/2012_02_22_00_world_sai.sql similarity index 100% rename from sql/updates/world/2012_02_22_00_world_SAI.sql rename to sql/old/3.3.5a/2012_02_22_00_world_sai.sql diff --git a/sql/updates/world/2012_02_22_01_world_creature_text.sql b/sql/old/3.3.5a/2012_02_22_01_world_creature_text.sql similarity index 100% rename from sql/updates/world/2012_02_22_01_world_creature_text.sql rename to sql/old/3.3.5a/2012_02_22_01_world_creature_text.sql diff --git a/sql/updates/world/2012_02_22_02_world_misc.sql b/sql/old/3.3.5a/2012_02_22_02_world_misc.sql similarity index 100% rename from sql/updates/world/2012_02_22_02_world_misc.sql rename to sql/old/3.3.5a/2012_02_22_02_world_misc.sql diff --git a/sql/updates/world/2012_02_22_03_world_conditions.sql b/sql/old/3.3.5a/2012_02_22_03_world_conditions.sql similarity index 100% rename from sql/updates/world/2012_02_22_03_world_conditions.sql rename to sql/old/3.3.5a/2012_02_22_03_world_conditions.sql diff --git a/sql/updates/world/2012_02_23_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_02_23_00_world_spell_script_names.sql similarity index 100% rename from sql/updates/world/2012_02_23_00_world_spell_script_names.sql rename to sql/old/3.3.5a/2012_02_23_00_world_spell_script_names.sql diff --git a/sql/updates/world/2012_02_24_00_world_gameobject_loot_template.sql b/sql/old/3.3.5a/2012_02_24_00_world_gameobject_loot_template.sql similarity index 100% rename from sql/updates/world/2012_02_24_00_world_gameobject_loot_template.sql rename to sql/old/3.3.5a/2012_02_24_00_world_gameobject_loot_template.sql diff --git a/sql/updates/world/2012_02_24_01_world_sai.sql b/sql/old/3.3.5a/2012_02_24_01_world_sai.sql similarity index 100% rename from sql/updates/world/2012_02_24_01_world_sai.sql rename to sql/old/3.3.5a/2012_02_24_01_world_sai.sql diff --git a/sql/updates/world/2012_02_25_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_02_25_00_world_spell_script_names.sql similarity index 100% rename from sql/updates/world/2012_02_25_00_world_spell_script_names.sql rename to sql/old/3.3.5a/2012_02_25_00_world_spell_script_names.sql diff --git a/sql/updates/world/2012_02_25_01_world_command.sql b/sql/old/3.3.5a/2012_02_25_01_world_command.sql similarity index 100% rename from sql/updates/world/2012_02_25_01_world_command.sql rename to sql/old/3.3.5a/2012_02_25_01_world_command.sql diff --git a/sql/updates/world/2012_02_25_01_world_misc.sql b/sql/old/3.3.5a/2012_02_25_01_world_misc.sql similarity index 100% rename from sql/updates/world/2012_02_25_01_world_misc.sql rename to sql/old/3.3.5a/2012_02_25_01_world_misc.sql diff --git a/sql/updates/world/2012_02_25_02_world_sai.sql b/sql/old/3.3.5a/2012_02_25_02_world_sai.sql similarity index 100% rename from sql/updates/world/2012_02_25_02_world_sai.sql rename to sql/old/3.3.5a/2012_02_25_02_world_sai.sql diff --git a/sql/updates/world/2012_02_26_00_world_misc.sql b/sql/old/3.3.5a/2012_02_26_00_world_misc.sql similarity index 100% rename from sql/updates/world/2012_02_26_00_world_misc.sql rename to sql/old/3.3.5a/2012_02_26_00_world_misc.sql diff --git a/sql/updates/world/2012_02_26_01_world_spell_script_names.sql b/sql/old/3.3.5a/2012_02_26_01_world_spell_script_names.sql similarity index 100% rename from sql/updates/world/2012_02_26_01_world_spell_script_names.sql rename to sql/old/3.3.5a/2012_02_26_01_world_spell_script_names.sql diff --git a/sql/updates/world/2012_02_27_00_world_creature_template.sql b/sql/old/3.3.5a/2012_02_27_00_world_creature_template.sql similarity index 100% rename from sql/updates/world/2012_02_27_00_world_creature_template.sql rename to sql/old/3.3.5a/2012_02_27_00_world_creature_template.sql diff --git a/sql/updates/world/2012_02_28_00_world_wintergrasp_spawns.sql b/sql/old/3.3.5a/2012_02_28_00_world_wintergrasp_spawns.sql similarity index 100% rename from sql/updates/world/2012_02_28_00_world_wintergrasp_spawns.sql rename to sql/old/3.3.5a/2012_02_28_00_world_wintergrasp_spawns.sql diff --git a/sql/updates/world/2012_02_29_00_world_conditions_misc.sql b/sql/old/3.3.5a/2012_02_29_00_world_conditions_misc.sql similarity index 100% rename from sql/updates/world/2012_02_29_00_world_conditions_misc.sql rename to sql/old/3.3.5a/2012_02_29_00_world_conditions_misc.sql diff --git a/sql/updates/world/2012_02_29_01_world_conditions.sql b/sql/old/3.3.5a/2012_02_29_01_world_conditions.sql similarity index 100% rename from sql/updates/world/2012_02_29_01_world_conditions.sql rename to sql/old/3.3.5a/2012_02_29_01_world_conditions.sql diff --git a/sql/updates/world/2012_02_29_02_world_conditions.sql b/sql/old/3.3.5a/2012_02_29_02_world_conditions.sql similarity index 100% rename from sql/updates/world/2012_02_29_02_world_conditions.sql rename to sql/old/3.3.5a/2012_02_29_02_world_conditions.sql diff --git a/sql/updates/world/2012_02_29_03_world_creature_text.sql b/sql/old/3.3.5a/2012_02_29_03_world_creature_text.sql similarity index 100% rename from sql/updates/world/2012_02_29_03_world_creature_text.sql rename to sql/old/3.3.5a/2012_02_29_03_world_creature_text.sql diff --git a/sql/updates/world/2012_02_29_04_world_creature_text.sql b/sql/old/3.3.5a/2012_02_29_04_world_creature_text.sql similarity index 100% rename from sql/updates/world/2012_02_29_04_world_creature_text.sql rename to sql/old/3.3.5a/2012_02_29_04_world_creature_text.sql diff --git a/sql/updates/world/2012_02_29_05_world_creature_text.sql b/sql/old/3.3.5a/2012_02_29_05_world_creature_text.sql similarity index 100% rename from sql/updates/world/2012_02_29_05_world_creature_text.sql rename to sql/old/3.3.5a/2012_02_29_05_world_creature_text.sql diff --git a/sql/updates/world/2012_03_01_00_world_conditions.sql b/sql/old/3.3.5a/2012_03_01_00_world_conditions.sql similarity index 100% rename from sql/updates/world/2012_03_01_00_world_conditions.sql rename to sql/old/3.3.5a/2012_03_01_00_world_conditions.sql diff --git a/sql/updates/world/2012_03_01_01_world_creature_text.sql b/sql/old/3.3.5a/2012_03_01_01_world_creature_text.sql similarity index 100% rename from sql/updates/world/2012_03_01_01_world_creature_text.sql rename to sql/old/3.3.5a/2012_03_01_01_world_creature_text.sql diff --git a/sql/updates/world/2012_03_01_02_world_locales_creature_text.sql b/sql/old/3.3.5a/2012_03_01_02_world_locales_creature_text.sql similarity index 100% rename from sql/updates/world/2012_03_01_02_world_locales_creature_text.sql rename to sql/old/3.3.5a/2012_03_01_02_world_locales_creature_text.sql diff --git a/sql/updates/world/2012_03_03_00_world_command.sql b/sql/old/3.3.5a/2012_03_03_00_world_command.sql similarity index 100% rename from sql/updates/world/2012_03_03_00_world_command.sql rename to sql/old/3.3.5a/2012_03_03_00_world_command.sql diff --git a/sql/updates/world/2012_03_04_00_world_misc.sql b/sql/old/3.3.5a/2012_03_04_00_world_misc.sql similarity index 100% rename from sql/updates/world/2012_03_04_00_world_misc.sql rename to sql/old/3.3.5a/2012_03_04_00_world_misc.sql diff --git a/sql/updates/world/2012_03_04_01_world_areatrigger_scripts.sql b/sql/old/3.3.5a/2012_03_04_01_world_areatrigger_scripts.sql similarity index 100% rename from sql/updates/world/2012_03_04_01_world_areatrigger_scripts.sql rename to sql/old/3.3.5a/2012_03_04_01_world_areatrigger_scripts.sql diff --git a/sql/updates/world/2012_03_06_00_world_commands.sql b/sql/old/3.3.5a/2012_03_06_00_world_commands.sql similarity index 100% rename from sql/updates/world/2012_03_06_00_world_commands.sql rename to sql/old/3.3.5a/2012_03_06_00_world_commands.sql diff --git a/sql/updates/world/2012_03_06_01_world_misc.sql b/sql/old/3.3.5a/2012_03_06_01_world_misc.sql similarity index 100% rename from sql/updates/world/2012_03_06_01_world_misc.sql rename to sql/old/3.3.5a/2012_03_06_01_world_misc.sql diff --git a/sql/updates/world/2012_03_06_02_world_queststatus_seasonal.sql b/sql/old/3.3.5a/2012_03_06_02_world_queststatus_seasonal.sql similarity index 100% rename from sql/updates/world/2012_03_06_02_world_queststatus_seasonal.sql rename to sql/old/3.3.5a/2012_03_06_02_world_queststatus_seasonal.sql diff --git a/sql/updates/world/2012_03_06_03_world_smart_scripts.sql b/sql/old/3.3.5a/2012_03_06_03_world_smart_scripts.sql similarity index 100% rename from sql/updates/world/2012_03_06_03_world_smart_scripts.sql rename to sql/old/3.3.5a/2012_03_06_03_world_smart_scripts.sql diff --git a/sql/updates/world/2012_03_06_04_world_creature_text.sql b/sql/old/3.3.5a/2012_03_06_04_world_creature_text.sql similarity index 100% rename from sql/updates/world/2012_03_06_04_world_creature_text.sql rename to sql/old/3.3.5a/2012_03_06_04_world_creature_text.sql diff --git a/sql/updates/world/2012_03_07_00_world_trinity_string.sql b/sql/old/3.3.5a/2012_03_07_00_world_trinity_string.sql similarity index 100% rename from sql/updates/world/2012_03_07_00_world_trinity_string.sql rename to sql/old/3.3.5a/2012_03_07_00_world_trinity_string.sql diff --git a/sql/updates/world/2012_03_10_00_world_creature.sql b/sql/old/3.3.5a/2012_03_10_00_world_creature.sql similarity index 100% rename from sql/updates/world/2012_03_10_00_world_creature.sql rename to sql/old/3.3.5a/2012_03_10_00_world_creature.sql diff --git a/sql/updates/world/2012_03_10_00_world_smart_scripts.sql b/sql/old/3.3.5a/2012_03_10_00_world_smart_scripts.sql similarity index 100% rename from sql/updates/world/2012_03_10_00_world_smart_scripts.sql rename to sql/old/3.3.5a/2012_03_10_00_world_smart_scripts.sql diff --git a/sql/updates/world/2012_03_10_00_world_waypoint_data.sql b/sql/old/3.3.5a/2012_03_10_00_world_waypoint_data.sql similarity index 100% rename from sql/updates/world/2012_03_10_00_world_waypoint_data.sql rename to sql/old/3.3.5a/2012_03_10_00_world_waypoint_data.sql diff --git a/sql/updates/world/2012_03_11_00_world_sai.sql b/sql/old/3.3.5a/2012_03_11_00_world_sai.sql similarity index 100% rename from sql/updates/world/2012_03_11_00_world_sai.sql rename to sql/old/3.3.5a/2012_03_11_00_world_sai.sql diff --git a/sql/updates/world/2012_03_12_00_world_creature_template.sql b/sql/old/3.3.5a/2012_03_12_00_world_creature_template.sql similarity index 100% rename from sql/updates/world/2012_03_12_00_world_creature_template.sql rename to sql/old/3.3.5a/2012_03_12_00_world_creature_template.sql diff --git a/sql/updates/world/2012_03_12_01_world_conditions.sql b/sql/old/3.3.5a/2012_03_12_01_world_conditions.sql similarity index 100% rename from sql/updates/world/2012_03_12_01_world_conditions.sql rename to sql/old/3.3.5a/2012_03_12_01_world_conditions.sql diff --git a/sql/updates/world/2012_03_12_01_world_gameobject.sql b/sql/old/3.3.5a/2012_03_12_01_world_gameobject.sql similarity index 100% rename from sql/updates/world/2012_03_12_01_world_gameobject.sql rename to sql/old/3.3.5a/2012_03_12_01_world_gameobject.sql diff --git a/sql/updates/world/2012_03_12_01_world_spell_script_names.sql b/sql/old/3.3.5a/2012_03_12_01_world_spell_script_names.sql similarity index 100% rename from sql/updates/world/2012_03_12_01_world_spell_script_names.sql rename to sql/old/3.3.5a/2012_03_12_01_world_spell_script_names.sql diff --git a/sql/updates/world/2012_03_14_00_world_creature_addon.sql b/sql/old/3.3.5a/2012_03_14_00_world_creature_addon.sql similarity index 100% rename from sql/updates/world/2012_03_14_00_world_creature_addon.sql rename to sql/old/3.3.5a/2012_03_14_00_world_creature_addon.sql diff --git a/sql/updates/world/2012_03_19_00_world_smart_scripts.sql b/sql/old/3.3.5a/2012_03_19_00_world_smart_scripts.sql similarity index 100% rename from sql/updates/world/2012_03_19_00_world_smart_scripts.sql rename to sql/old/3.3.5a/2012_03_19_00_world_smart_scripts.sql diff --git a/sql/updates/world/2012_03_20_00_world_gossip.sql b/sql/old/3.3.5a/2012_03_20_00_world_gossip.sql similarity index 100% rename from sql/updates/world/2012_03_20_00_world_gossip.sql rename to sql/old/3.3.5a/2012_03_20_00_world_gossip.sql diff --git a/sql/updates/world/2012_03_21_00_world_creature.sql b/sql/old/3.3.5a/2012_03_21_00_world_creature.sql similarity index 100% rename from sql/updates/world/2012_03_21_00_world_creature.sql rename to sql/old/3.3.5a/2012_03_21_00_world_creature.sql diff --git a/sql/updates/world/2012_03_22_00_world_creature_template.sql b/sql/old/3.3.5a/2012_03_22_00_world_creature_template.sql similarity index 100% rename from sql/updates/world/2012_03_22_00_world_creature_template.sql rename to sql/old/3.3.5a/2012_03_22_00_world_creature_template.sql diff --git a/sql/updates/world/2012_03_22_01_world_conditions.sql b/sql/old/3.3.5a/2012_03_22_01_world_conditions.sql similarity index 100% rename from sql/updates/world/2012_03_22_01_world_conditions.sql rename to sql/old/3.3.5a/2012_03_22_01_world_conditions.sql diff --git a/sql/updates/world/2012_03_23_00_world_ip2nation.sql b/sql/old/3.3.5a/2012_03_23_00_world_ip2nation.sql similarity index 100% rename from sql/updates/world/2012_03_23_00_world_ip2nation.sql rename to sql/old/3.3.5a/2012_03_23_00_world_ip2nation.sql diff --git a/sql/updates/world/2012_03_24_00_world_misc.sql b/sql/old/3.3.5a/2012_03_24_00_world_misc.sql similarity index 100% rename from sql/updates/world/2012_03_24_00_world_misc.sql rename to sql/old/3.3.5a/2012_03_24_00_world_misc.sql diff --git a/sql/updates/world/2012_03_24_01_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_03_24_01_world_creature_loot_template.sql similarity index 100% rename from sql/updates/world/2012_03_24_01_world_creature_loot_template.sql rename to sql/old/3.3.5a/2012_03_24_01_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_03_24_02_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_03_24_02_world_creature_loot_template.sql similarity index 100% rename from sql/updates/world/2012_03_24_02_world_creature_loot_template.sql rename to sql/old/3.3.5a/2012_03_24_02_world_creature_loot_template.sql diff --git a/sql/updates/auth/2012_03_25_00_auth_misc.sql b/sql/old/3.3.5a/2012_03_25_00_auth_misc.sql similarity index 100% rename from sql/updates/auth/2012_03_25_00_auth_misc.sql rename to sql/old/3.3.5a/2012_03_25_00_auth_misc.sql diff --git a/sql/updates/world/2012_03_25_00_world_game_event.sql b/sql/old/3.3.5a/2012_03_25_00_world_game_event.sql similarity index 100% rename from sql/updates/world/2012_03_25_00_world_game_event.sql rename to sql/old/3.3.5a/2012_03_25_00_world_game_event.sql diff --git a/sql/updates/auth/2012_03_26_00_auth_realmlist.sql b/sql/old/3.3.5a/2012_03_26_00_auth_realmlist.sql similarity index 100% rename from sql/updates/auth/2012_03_26_00_auth_realmlist.sql rename to sql/old/3.3.5a/2012_03_26_00_auth_realmlist.sql diff --git a/sql/updates/world/2012_03_26_00_world_creature_template.sql b/sql/old/3.3.5a/2012_03_26_00_world_creature_template.sql similarity index 100% rename from sql/updates/world/2012_03_26_00_world_creature_template.sql rename to sql/old/3.3.5a/2012_03_26_00_world_creature_template.sql diff --git a/sql/updates/world/2012_03_26_01_world_spell_script_names.sql b/sql/old/3.3.5a/2012_03_26_01_world_spell_script_names.sql similarity index 100% rename from sql/updates/world/2012_03_26_01_world_spell_script_names.sql rename to sql/old/3.3.5a/2012_03_26_01_world_spell_script_names.sql diff --git a/sql/updates/world/2012_03_27_00_world_misc.sql b/sql/old/3.3.5a/2012_03_27_00_world_misc.sql similarity index 100% rename from sql/updates/world/2012_03_27_00_world_misc.sql rename to sql/old/3.3.5a/2012_03_27_00_world_misc.sql diff --git a/sql/updates/world/2012_03_27_01_world_misc.sql b/sql/old/3.3.5a/2012_03_27_01_world_misc.sql similarity index 100% rename from sql/updates/world/2012_03_27_01_world_misc.sql rename to sql/old/3.3.5a/2012_03_27_01_world_misc.sql diff --git a/sql/updates/world/2012_03_27_02_world_misc.sql b/sql/old/3.3.5a/2012_03_27_02_world_misc.sql similarity index 100% rename from sql/updates/world/2012_03_27_02_world_misc.sql rename to sql/old/3.3.5a/2012_03_27_02_world_misc.sql diff --git a/sql/updates/world/2012_03_27_03_world_misc.sql b/sql/old/3.3.5a/2012_03_27_03_world_misc.sql similarity index 100% rename from sql/updates/world/2012_03_27_03_world_misc.sql rename to sql/old/3.3.5a/2012_03_27_03_world_misc.sql diff --git a/sql/updates/world/2012_03_27_04_world_misc.sql b/sql/old/3.3.5a/2012_03_27_04_world_misc.sql similarity index 100% rename from sql/updates/world/2012_03_27_04_world_misc.sql rename to sql/old/3.3.5a/2012_03_27_04_world_misc.sql diff --git a/sql/updates/auth/2012_03_28_00_auth_account.sql b/sql/old/3.3.5a/2012_03_28_00_auth_account.sql similarity index 100% rename from sql/updates/auth/2012_03_28_00_auth_account.sql rename to sql/old/3.3.5a/2012_03_28_00_auth_account.sql diff --git a/sql/updates/auth/2012_03_28_01_auth_account_access.sql b/sql/old/3.3.5a/2012_03_28_01_auth_account_access.sql similarity index 100% rename from sql/updates/auth/2012_03_28_01_auth_account_access.sql rename to sql/old/3.3.5a/2012_03_28_01_auth_account_access.sql diff --git a/sql/updates/world/2012_03_28_01_world_spell_bonus_data.sql b/sql/old/3.3.5a/2012_03_28_01_world_spell_bonus_data.sql similarity index 100% rename from sql/updates/world/2012_03_28_01_world_spell_bonus_data.sql rename to sql/old/3.3.5a/2012_03_28_01_world_spell_bonus_data.sql diff --git a/sql/updates/auth/2012_03_28_02_auth_account_banned.sql b/sql/old/3.3.5a/2012_03_28_02_auth_account_banned.sql similarity index 100% rename from sql/updates/auth/2012_03_28_02_auth_account_banned.sql rename to sql/old/3.3.5a/2012_03_28_02_auth_account_banned.sql diff --git a/sql/updates/auth/2012_03_28_03_auth_ip_banned.sql b/sql/old/3.3.5a/2012_03_28_03_auth_ip_banned.sql similarity index 100% rename from sql/updates/auth/2012_03_28_03_auth_ip_banned.sql rename to sql/old/3.3.5a/2012_03_28_03_auth_ip_banned.sql diff --git a/sql/updates/auth/2012_03_28_04_auth_logs.sql b/sql/old/3.3.5a/2012_03_28_04_auth_logs.sql similarity index 100% rename from sql/updates/auth/2012_03_28_04_auth_logs.sql rename to sql/old/3.3.5a/2012_03_28_04_auth_logs.sql diff --git a/sql/updates/auth/2012_03_28_05_auth_realmcharacters.sql b/sql/old/3.3.5a/2012_03_28_05_auth_realmcharacters.sql similarity index 100% rename from sql/updates/auth/2012_03_28_05_auth_realmcharacters.sql rename to sql/old/3.3.5a/2012_03_28_05_auth_realmcharacters.sql diff --git a/sql/updates/auth/2012_03_28_06_auth_realmlist.sql b/sql/old/3.3.5a/2012_03_28_06_auth_realmlist.sql similarity index 100% rename from sql/updates/auth/2012_03_28_06_auth_realmlist.sql rename to sql/old/3.3.5a/2012_03_28_06_auth_realmlist.sql diff --git a/sql/updates/auth/2012_03_28_07_auth_uptime.sql b/sql/old/3.3.5a/2012_03_28_07_auth_uptime.sql similarity index 100% rename from sql/updates/auth/2012_03_28_07_auth_uptime.sql rename to sql/old/3.3.5a/2012_03_28_07_auth_uptime.sql diff --git a/sql/updates/world/2012_03_30_00_world_smart_scripts.sql b/sql/old/3.3.5a/2012_03_30_00_world_smart_scripts.sql similarity index 100% rename from sql/updates/world/2012_03_30_00_world_smart_scripts.sql rename to sql/old/3.3.5a/2012_03_30_00_world_smart_scripts.sql diff --git a/sql/updates/world/2012_03_31_00_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_03_31_00_world_creature_loot_template.sql similarity index 100% rename from sql/updates/world/2012_03_31_00_world_creature_loot_template.sql rename to sql/old/3.3.5a/2012_03_31_00_world_creature_loot_template.sql diff --git a/sql/updates/auth/2012_04_01_00_auth_realmlist.sql b/sql/old/3.3.5a/2012_04_01_00_auth_realmlist.sql similarity index 100% rename from sql/updates/auth/2012_04_01_00_auth_realmlist.sql rename to sql/old/3.3.5a/2012_04_01_00_auth_realmlist.sql diff --git a/sql/updates/world/2012_04_01_00_world_creature.sql b/sql/old/3.3.5a/2012_04_01_00_world_creature.sql similarity index 100% rename from sql/updates/world/2012_04_01_00_world_creature.sql rename to sql/old/3.3.5a/2012_04_01_00_world_creature.sql diff --git a/sql/updates/world/2012_04_01_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_04_01_00_world_spell_script_names.sql similarity index 100% rename from sql/updates/world/2012_04_01_00_world_spell_script_names.sql rename to sql/old/3.3.5a/2012_04_01_00_world_spell_script_names.sql diff --git a/sql/updates/world/2012_04_01_01_world_creature.sql b/sql/old/3.3.5a/2012_04_01_01_world_creature.sql similarity index 100% rename from sql/updates/world/2012_04_01_01_world_creature.sql rename to sql/old/3.3.5a/2012_04_01_01_world_creature.sql diff --git a/sql/updates/world/2012_04_01_02_world_spell_group_stack_rules.sql b/sql/old/3.3.5a/2012_04_01_02_world_spell_group_stack_rules.sql similarity index 100% rename from sql/updates/world/2012_04_01_02_world_spell_group_stack_rules.sql rename to sql/old/3.3.5a/2012_04_01_02_world_spell_group_stack_rules.sql diff --git a/sql/updates/world/2012_04_01_03_world_trainers.sql b/sql/old/3.3.5a/2012_04_01_03_world_trainers.sql similarity index 100% rename from sql/updates/world/2012_04_01_03_world_trainers.sql rename to sql/old/3.3.5a/2012_04_01_03_world_trainers.sql diff --git a/sql/updates/world/2012_04_01_04_world_conditions.sql b/sql/old/3.3.5a/2012_04_01_04_world_conditions.sql similarity index 100% rename from sql/updates/world/2012_04_01_04_world_conditions.sql rename to sql/old/3.3.5a/2012_04_01_04_world_conditions.sql diff --git a/sql/updates/world/2012_04_01_05_world_creature_template.sql b/sql/old/3.3.5a/2012_04_01_05_world_creature_template.sql similarity index 100% rename from sql/updates/world/2012_04_01_05_world_creature_template.sql rename to sql/old/3.3.5a/2012_04_01_05_world_creature_template.sql diff --git a/sql/updates/world/2012_04_01_06_world_sai.sql b/sql/old/3.3.5a/2012_04_01_06_world_sai.sql similarity index 100% rename from sql/updates/world/2012_04_01_06_world_sai.sql rename to sql/old/3.3.5a/2012_04_01_06_world_sai.sql diff --git a/sql/updates/world/2012_04_01_07_world_misc.sql b/sql/old/3.3.5a/2012_04_01_07_world_misc.sql similarity index 100% rename from sql/updates/world/2012_04_01_07_world_misc.sql rename to sql/old/3.3.5a/2012_04_01_07_world_misc.sql diff --git a/sql/updates/world/2012_04_03_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_04_03_00_world_spell_script_names.sql similarity index 100% rename from sql/updates/world/2012_04_03_00_world_spell_script_names.sql rename to sql/old/3.3.5a/2012_04_03_00_world_spell_script_names.sql diff --git a/sql/updates/auth/2012_04_04_00_auth_realmlist.sql b/sql/old/3.3.5a/2012_04_04_00_auth_realmlist.sql similarity index 100% rename from sql/updates/auth/2012_04_04_00_auth_realmlist.sql rename to sql/old/3.3.5a/2012_04_04_00_auth_realmlist.sql diff --git a/sql/updates/world/2012_04_04_00_world_conditions.sql b/sql/old/3.3.5a/2012_04_04_00_world_conditions.sql similarity index 100% rename from sql/updates/world/2012_04_04_00_world_conditions.sql rename to sql/old/3.3.5a/2012_04_04_00_world_conditions.sql diff --git a/sql/updates/world/2012_04_04_01_world_spell_dbc.sql b/sql/old/3.3.5a/2012_04_04_01_world_spell_dbc.sql similarity index 100% rename from sql/updates/world/2012_04_04_01_world_spell_dbc.sql rename to sql/old/3.3.5a/2012_04_04_01_world_spell_dbc.sql diff --git a/sql/updates/world/2012_04_05_00_world_gameobject_template.sql b/sql/old/3.3.5a/2012_04_05_00_world_gameobject_template.sql similarity index 100% rename from sql/updates/world/2012_04_05_00_world_gameobject_template.sql rename to sql/old/3.3.5a/2012_04_05_00_world_gameobject_template.sql diff --git a/sql/updates/world/2012_04_05_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_04_05_00_world_spell_script_names.sql similarity index 100% rename from sql/updates/world/2012_04_05_00_world_spell_script_names.sql rename to sql/old/3.3.5a/2012_04_05_00_world_spell_script_names.sql diff --git a/sql/updates/world/2012_04_05_01_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_04_05_01_world_spell_proc_event.sql similarity index 100% rename from sql/updates/world/2012_04_05_01_world_spell_proc_event.sql rename to sql/old/3.3.5a/2012_04_05_01_world_spell_proc_event.sql diff --git a/sql/updates/world/2012_04_06_00_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_04_06_00_world_spell_proc_event.sql similarity index 100% rename from sql/updates/world/2012_04_06_00_world_spell_proc_event.sql rename to sql/old/3.3.5a/2012_04_06_00_world_spell_proc_event.sql diff --git a/sql/updates/world/2012_04_06_01_world_spell_dbc.sql b/sql/old/3.3.5a/2012_04_06_01_world_spell_dbc.sql similarity index 100% rename from sql/updates/world/2012_04_06_01_world_spell_dbc.sql rename to sql/old/3.3.5a/2012_04_06_01_world_spell_dbc.sql diff --git a/sql/updates/world/2012_04_06_02_world_gameobject_template.sql b/sql/old/3.3.5a/2012_04_06_02_world_gameobject_template.sql similarity index 100% rename from sql/updates/world/2012_04_06_02_world_gameobject_template.sql rename to sql/old/3.3.5a/2012_04_06_02_world_gameobject_template.sql diff --git a/sql/updates/world/2012_04_06_03_world_spell_dbc.sql b/sql/old/3.3.5a/2012_04_06_03_world_spell_dbc.sql similarity index 100% rename from sql/updates/world/2012_04_06_03_world_spell_dbc.sql rename to sql/old/3.3.5a/2012_04_06_03_world_spell_dbc.sql diff --git a/sql/updates/world/2012_04_06_04_world_page_text.sql b/sql/old/3.3.5a/2012_04_06_04_world_page_text.sql similarity index 100% rename from sql/updates/world/2012_04_06_04_world_page_text.sql rename to sql/old/3.3.5a/2012_04_06_04_world_page_text.sql diff --git a/sql/updates/characters/2012_04_07_00_characters_lag_reports.sql b/sql/old/3.3.5a/2012_04_07_00_characters_lag_reports.sql similarity index 100% rename from sql/updates/characters/2012_04_07_00_characters_lag_reports.sql rename to sql/old/3.3.5a/2012_04_07_00_characters_lag_reports.sql diff --git a/sql/updates/world/2012_04_07_00_world_gameobject.sql b/sql/old/3.3.5a/2012_04_07_00_world_gameobject.sql similarity index 100% rename from sql/updates/world/2012_04_07_00_world_gameobject.sql rename to sql/old/3.3.5a/2012_04_07_00_world_gameobject.sql diff --git a/sql/updates/world/2012_04_07_01_world_game_event.sql b/sql/old/3.3.5a/2012_04_07_01_world_game_event.sql similarity index 100% rename from sql/updates/world/2012_04_07_01_world_game_event.sql rename to sql/old/3.3.5a/2012_04_07_01_world_game_event.sql diff --git a/sql/updates/world/2012_04_07_02_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_04_07_02_world_spell_proc_event.sql similarity index 100% rename from sql/updates/world/2012_04_07_02_world_spell_proc_event.sql rename to sql/old/3.3.5a/2012_04_07_02_world_spell_proc_event.sql diff --git a/sql/updates/world/2012_04_08_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_04_08_00_world_spell_script_names.sql similarity index 100% rename from sql/updates/world/2012_04_08_00_world_spell_script_names.sql rename to sql/old/3.3.5a/2012_04_08_00_world_spell_script_names.sql diff --git a/sql/updates/world/2012_04_08_01_world_creature_template.sql b/sql/old/3.3.5a/2012_04_08_01_world_creature_template.sql similarity index 100% rename from sql/updates/world/2012_04_08_01_world_creature_template.sql rename to sql/old/3.3.5a/2012_04_08_01_world_creature_template.sql diff --git a/sql/updates/world/2012_04_08_02_world_spell_dbc.sql b/sql/old/3.3.5a/2012_04_08_02_world_spell_dbc.sql similarity index 100% rename from sql/updates/world/2012_04_08_02_world_spell_dbc.sql rename to sql/old/3.3.5a/2012_04_08_02_world_spell_dbc.sql diff --git a/sql/updates/world/2012_04_08_02_world_spell_script_names.sql b/sql/old/3.3.5a/2012_04_08_02_world_spell_script_names.sql similarity index 100% rename from sql/updates/world/2012_04_08_02_world_spell_script_names.sql rename to sql/old/3.3.5a/2012_04_08_02_world_spell_script_names.sql diff --git a/sql/updates/world/2012_04_08_03_world_spell_script_names.sql b/sql/old/3.3.5a/2012_04_08_03_world_spell_script_names.sql similarity index 100% rename from sql/updates/world/2012_04_08_03_world_spell_script_names.sql rename to sql/old/3.3.5a/2012_04_08_03_world_spell_script_names.sql diff --git a/sql/updates/world/2012_04_12_00_world_creature_template.sql b/sql/old/3.3.5a/2012_04_12_00_world_creature_template.sql similarity index 100% rename from sql/updates/world/2012_04_12_00_world_creature_template.sql rename to sql/old/3.3.5a/2012_04_12_00_world_creature_template.sql diff --git a/sql/updates/world/2012_04_12_01_world_creature_template.sql b/sql/old/3.3.5a/2012_04_12_01_world_creature_template.sql similarity index 100% rename from sql/updates/world/2012_04_12_01_world_creature_template.sql rename to sql/old/3.3.5a/2012_04_12_01_world_creature_template.sql diff --git a/sql/updates/world/2012_04_12_02_world_spell_bonus_data.sql b/sql/old/3.3.5a/2012_04_12_02_world_spell_bonus_data.sql similarity index 100% rename from sql/updates/world/2012_04_12_02_world_spell_bonus_data.sql rename to sql/old/3.3.5a/2012_04_12_02_world_spell_bonus_data.sql diff --git a/sql/updates/world/2012_04_12_03_world_spell_bonus_data.sql b/sql/old/3.3.5a/2012_04_12_03_world_spell_bonus_data.sql similarity index 100% rename from sql/updates/world/2012_04_12_03_world_spell_bonus_data.sql rename to sql/old/3.3.5a/2012_04_12_03_world_spell_bonus_data.sql diff --git a/sql/updates/world/2012_04_12_04_world_creature_template.sql b/sql/old/3.3.5a/2012_04_12_04_world_creature_template.sql similarity index 100% rename from sql/updates/world/2012_04_12_04_world_creature_template.sql rename to sql/old/3.3.5a/2012_04_12_04_world_creature_template.sql diff --git a/sql/updates/world/2012_04_12_05_world_command.sql b/sql/old/3.3.5a/2012_04_12_05_world_command.sql similarity index 100% rename from sql/updates/world/2012_04_12_05_world_command.sql rename to sql/old/3.3.5a/2012_04_12_05_world_command.sql diff --git a/sql/updates/world/2012_04_13_00_world_sai.sql b/sql/old/3.3.5a/2012_04_13_00_world_sai.sql similarity index 100% rename from sql/updates/world/2012_04_13_00_world_sai.sql rename to sql/old/3.3.5a/2012_04_13_00_world_sai.sql diff --git a/sql/updates/world/2012_04_13_01_world_misc.sql b/sql/old/3.3.5a/2012_04_13_01_world_misc.sql similarity index 100% rename from sql/updates/world/2012_04_13_01_world_misc.sql rename to sql/old/3.3.5a/2012_04_13_01_world_misc.sql diff --git a/sql/updates/world/2012_04_13_02_world_misc.sql b/sql/old/3.3.5a/2012_04_13_02_world_misc.sql similarity index 100% rename from sql/updates/world/2012_04_13_02_world_misc.sql rename to sql/old/3.3.5a/2012_04_13_02_world_misc.sql diff --git a/sql/updates/world/2012_04_13_03_world_bg_template.sql b/sql/old/3.3.5a/2012_04_13_03_world_bg_template.sql similarity index 100% rename from sql/updates/world/2012_04_13_03_world_bg_template.sql rename to sql/old/3.3.5a/2012_04_13_03_world_bg_template.sql diff --git a/sql/updates/world/2012_04_13_04_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_04_13_04_world_spell_proc_event.sql similarity index 100% rename from sql/updates/world/2012_04_13_04_world_spell_proc_event.sql rename to sql/old/3.3.5a/2012_04_13_04_world_spell_proc_event.sql diff --git a/sql/updates/world/2012_04_14_00_world_gameobject_loot_template.sql b/sql/old/3.3.5a/2012_04_14_00_world_gameobject_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_14_00_world_gameobject_loot_template.sql rename to sql/old/3.3.5a/2012_04_14_00_world_gameobject_loot_template.sql diff --git a/sql/updates/world/2012_04_14_01_world_gameobject_loot_template.sql b/sql/old/3.3.5a/2012_04_14_01_world_gameobject_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_14_01_world_gameobject_loot_template.sql rename to sql/old/3.3.5a/2012_04_14_01_world_gameobject_loot_template.sql diff --git a/sql/updates/world/2012_04_14_02_world_creature_template_addon.sql b/sql/old/3.3.5a/2012_04_14_02_world_creature_template_addon.sql similarity index 100% rename from sql/updates/world/2012_04_14_02_world_creature_template_addon.sql rename to sql/old/3.3.5a/2012_04_14_02_world_creature_template_addon.sql diff --git a/sql/updates/world/2012_04_14_03_world_spell_bonus_data.sql b/sql/old/3.3.5a/2012_04_14_03_world_spell_bonus_data.sql similarity index 100% rename from sql/updates/world/2012_04_14_03_world_spell_bonus_data.sql rename to sql/old/3.3.5a/2012_04_14_03_world_spell_bonus_data.sql diff --git a/sql/updates/world/2012_04_14_04_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_04_14_04_world_spell_proc_event.sql similarity index 100% rename from sql/updates/world/2012_04_14_04_world_spell_proc_event.sql rename to sql/old/3.3.5a/2012_04_14_04_world_spell_proc_event.sql diff --git a/sql/updates/world/2012_04_14_05_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_04_14_05_world_spell_proc_event.sql similarity index 100% rename from sql/updates/world/2012_04_14_05_world_spell_proc_event.sql rename to sql/old/3.3.5a/2012_04_14_05_world_spell_proc_event.sql diff --git a/sql/updates/world/2012_04_16_00_world_game_event.sql b/sql/old/3.3.5a/2012_04_16_00_world_game_event.sql similarity index 100% rename from sql/updates/world/2012_04_16_00_world_game_event.sql rename to sql/old/3.3.5a/2012_04_16_00_world_game_event.sql diff --git a/sql/updates/world/2012_04_17_00_world_creature.sql b/sql/old/3.3.5a/2012_04_17_00_world_creature.sql similarity index 100% rename from sql/updates/world/2012_04_17_00_world_creature.sql rename to sql/old/3.3.5a/2012_04_17_00_world_creature.sql diff --git a/sql/updates/world/2012_04_18_00_world_npc_spellclick_spells.sql b/sql/old/3.3.5a/2012_04_18_00_world_npc_spellclick_spells.sql similarity index 100% rename from sql/updates/world/2012_04_18_00_world_npc_spellclick_spells.sql rename to sql/old/3.3.5a/2012_04_18_00_world_npc_spellclick_spells.sql diff --git a/sql/updates/world/2012_04_18_01_world_creature.sql b/sql/old/3.3.5a/2012_04_18_01_world_creature.sql similarity index 100% rename from sql/updates/world/2012_04_18_01_world_creature.sql rename to sql/old/3.3.5a/2012_04_18_01_world_creature.sql diff --git a/sql/updates/world/2012_04_18_02_world_reference_loot_template.sql b/sql/old/3.3.5a/2012_04_18_02_world_reference_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_18_02_world_reference_loot_template.sql rename to sql/old/3.3.5a/2012_04_18_02_world_reference_loot_template.sql diff --git a/sql/updates/world/2012_04_18_03_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_04_18_03_world_creature_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_18_03_world_creature_loot_template.sql rename to sql/old/3.3.5a/2012_04_18_03_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_04_18_04_world_pickpocketing_loot_template.sql b/sql/old/3.3.5a/2012_04_18_04_world_pickpocketing_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_18_04_world_pickpocketing_loot_template.sql rename to sql/old/3.3.5a/2012_04_18_04_world_pickpocketing_loot_template.sql diff --git a/sql/updates/world/2012_04_18_05_world_conditions.sql b/sql/old/3.3.5a/2012_04_18_05_world_conditions.sql similarity index 100% rename from sql/updates/world/2012_04_18_05_world_conditions.sql rename to sql/old/3.3.5a/2012_04_18_05_world_conditions.sql diff --git a/sql/updates/world/2012_04_18_06_world_creature_template.sql b/sql/old/3.3.5a/2012_04_18_06_world_creature_template.sql similarity index 100% rename from sql/updates/world/2012_04_18_06_world_creature_template.sql rename to sql/old/3.3.5a/2012_04_18_06_world_creature_template.sql diff --git a/sql/updates/world/2012_04_18_07_world_fishing_loot_template.sql b/sql/old/3.3.5a/2012_04_18_07_world_fishing_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_18_07_world_fishing_loot_template.sql rename to sql/old/3.3.5a/2012_04_18_07_world_fishing_loot_template.sql diff --git a/sql/updates/world/2012_04_18_08_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_04_18_08_world_creature_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_18_08_world_creature_loot_template.sql rename to sql/old/3.3.5a/2012_04_18_08_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_04_19_00_world_creature_template.sql b/sql/old/3.3.5a/2012_04_19_00_world_creature_template.sql similarity index 100% rename from sql/updates/world/2012_04_19_00_world_creature_template.sql rename to sql/old/3.3.5a/2012_04_19_00_world_creature_template.sql diff --git a/sql/updates/world/2012_04_19_01_world_pickpocketing_loot_template.sql b/sql/old/3.3.5a/2012_04_19_01_world_pickpocketing_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_19_01_world_pickpocketing_loot_template.sql rename to sql/old/3.3.5a/2012_04_19_01_world_pickpocketing_loot_template.sql diff --git a/sql/updates/world/2012_04_19_02_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_04_19_02_world_creature_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_19_02_world_creature_loot_template.sql rename to sql/old/3.3.5a/2012_04_19_02_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_04_19_03_world_instance_ulduar.sql b/sql/old/3.3.5a/2012_04_19_03_world_instance_ulduar.sql similarity index 100% rename from sql/updates/world/2012_04_19_03_world_instance_ulduar.sql rename to sql/old/3.3.5a/2012_04_19_03_world_instance_ulduar.sql diff --git a/sql/updates/world/2012_04_20_00_world_gameobject_loot_template.sql b/sql/old/3.3.5a/2012_04_20_00_world_gameobject_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_20_00_world_gameobject_loot_template.sql rename to sql/old/3.3.5a/2012_04_20_00_world_gameobject_loot_template.sql diff --git a/sql/updates/world/2012_04_20_01_world_item_loot_template.sql b/sql/old/3.3.5a/2012_04_20_01_world_item_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_20_01_world_item_loot_template.sql rename to sql/old/3.3.5a/2012_04_20_01_world_item_loot_template.sql diff --git a/sql/updates/world/2012_04_20_02_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_04_20_02_world_creature_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_20_02_world_creature_loot_template.sql rename to sql/old/3.3.5a/2012_04_20_02_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_04_20_03_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_04_20_03_world_creature_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_20_03_world_creature_loot_template.sql rename to sql/old/3.3.5a/2012_04_20_03_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_04_20_04_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_04_20_04_world_creature_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_20_04_world_creature_loot_template.sql rename to sql/old/3.3.5a/2012_04_20_04_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_04_20_05_gameobject_template.sql b/sql/old/3.3.5a/2012_04_20_05_gameobject_template.sql similarity index 100% rename from sql/updates/world/2012_04_20_05_gameobject_template.sql rename to sql/old/3.3.5a/2012_04_20_05_gameobject_template.sql diff --git a/sql/updates/world/2012_04_21_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_04_21_00_world_spell_script_names.sql similarity index 100% rename from sql/updates/world/2012_04_21_00_world_spell_script_names.sql rename to sql/old/3.3.5a/2012_04_21_00_world_spell_script_names.sql diff --git a/sql/updates/world/2012_04_22_00_world_sai.sql b/sql/old/3.3.5a/2012_04_22_00_world_sai.sql similarity index 100% rename from sql/updates/world/2012_04_22_00_world_sai.sql rename to sql/old/3.3.5a/2012_04_22_00_world_sai.sql diff --git a/sql/updates/world/2012_04_23_00_world_creatures.sql b/sql/old/3.3.5a/2012_04_23_00_world_creatures.sql similarity index 100% rename from sql/updates/world/2012_04_23_00_world_creatures.sql rename to sql/old/3.3.5a/2012_04_23_00_world_creatures.sql diff --git a/sql/updates/world/2012_04_23_01_world_conditions.sql b/sql/old/3.3.5a/2012_04_23_01_world_conditions.sql similarity index 100% rename from sql/updates/world/2012_04_23_01_world_conditions.sql rename to sql/old/3.3.5a/2012_04_23_01_world_conditions.sql diff --git a/sql/updates/world/2012_04_23_02_world_prospecting_loot_template.sql b/sql/old/3.3.5a/2012_04_23_02_world_prospecting_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_23_02_world_prospecting_loot_template.sql rename to sql/old/3.3.5a/2012_04_23_02_world_prospecting_loot_template.sql diff --git a/sql/updates/world/2012_04_23_03_world_skinning_loot_template.sql b/sql/old/3.3.5a/2012_04_23_03_world_skinning_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_23_03_world_skinning_loot_template.sql rename to sql/old/3.3.5a/2012_04_23_03_world_skinning_loot_template.sql diff --git a/sql/updates/world/2012_04_23_04_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_04_23_04_world_creature_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_23_04_world_creature_loot_template.sql rename to sql/old/3.3.5a/2012_04_23_04_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_04_23_05_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_04_23_05_world_creature_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_23_05_world_creature_loot_template.sql rename to sql/old/3.3.5a/2012_04_23_05_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_04_24_00_world_command.sql b/sql/old/3.3.5a/2012_04_24_00_world_command.sql similarity index 100% rename from sql/updates/world/2012_04_24_00_world_command.sql rename to sql/old/3.3.5a/2012_04_24_00_world_command.sql diff --git a/sql/updates/world/2012_04_24_01_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_04_24_01_world_spell_proc_event.sql similarity index 100% rename from sql/updates/world/2012_04_24_01_world_spell_proc_event.sql rename to sql/old/3.3.5a/2012_04_24_01_world_spell_proc_event.sql diff --git a/sql/updates/world/2012_04_24_02_world_warden_checks.sql b/sql/old/3.3.5a/2012_04_24_02_world_warden_checks.sql similarity index 100% rename from sql/updates/world/2012_04_24_02_world_warden_checks.sql rename to sql/old/3.3.5a/2012_04_24_02_world_warden_checks.sql diff --git a/sql/updates/world/2012_04_24_03_world_spell_script_names.sql b/sql/old/3.3.5a/2012_04_24_03_world_spell_script_names.sql similarity index 100% rename from sql/updates/world/2012_04_24_03_world_spell_script_names.sql rename to sql/old/3.3.5a/2012_04_24_03_world_spell_script_names.sql diff --git a/sql/updates/world/2012_04_24_04_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_04_24_04_world_spell_proc_event.sql similarity index 100% rename from sql/updates/world/2012_04_24_04_world_spell_proc_event.sql rename to sql/old/3.3.5a/2012_04_24_04_world_spell_proc_event.sql diff --git a/sql/updates/world/2012_04_24_05_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_04_24_05_world_creature_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_24_05_world_creature_loot_template.sql rename to sql/old/3.3.5a/2012_04_24_05_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_04_24_06_world_misc.sql b/sql/old/3.3.5a/2012_04_24_06_world_misc.sql similarity index 100% rename from sql/updates/world/2012_04_24_06_world_misc.sql rename to sql/old/3.3.5a/2012_04_24_06_world_misc.sql diff --git a/sql/updates/world/2012_04_25_00_world_misc.sql b/sql/old/3.3.5a/2012_04_25_00_world_misc.sql similarity index 100% rename from sql/updates/world/2012_04_25_00_world_misc.sql rename to sql/old/3.3.5a/2012_04_25_00_world_misc.sql diff --git a/sql/updates/world/2012_04_25_01_world_spell_script_names.sql b/sql/old/3.3.5a/2012_04_25_01_world_spell_script_names.sql similarity index 100% rename from sql/updates/world/2012_04_25_01_world_spell_script_names.sql rename to sql/old/3.3.5a/2012_04_25_01_world_spell_script_names.sql diff --git a/sql/updates/world/2012_04_25_02_world_spell_script_names.sql b/sql/old/3.3.5a/2012_04_25_02_world_spell_script_names.sql similarity index 100% rename from sql/updates/world/2012_04_25_02_world_spell_script_names.sql rename to sql/old/3.3.5a/2012_04_25_02_world_spell_script_names.sql diff --git a/sql/updates/world/2012_04_25_03_world_spell_group.sql b/sql/old/3.3.5a/2012_04_25_03_world_spell_group.sql similarity index 100% rename from sql/updates/world/2012_04_25_03_world_spell_group.sql rename to sql/old/3.3.5a/2012_04_25_03_world_spell_group.sql diff --git a/sql/updates/world/2012_04_26_00_world_conditions.sql b/sql/old/3.3.5a/2012_04_26_00_world_conditions.sql similarity index 100% rename from sql/updates/world/2012_04_26_00_world_conditions.sql rename to sql/old/3.3.5a/2012_04_26_00_world_conditions.sql diff --git a/sql/updates/world/2012_04_26_01_world_smart_scripts.sql b/sql/old/3.3.5a/2012_04_26_01_world_smart_scripts.sql similarity index 100% rename from sql/updates/world/2012_04_26_01_world_smart_scripts.sql rename to sql/old/3.3.5a/2012_04_26_01_world_smart_scripts.sql diff --git a/sql/updates/world/2012_04_27_00_world_instance_icc.sql b/sql/old/3.3.5a/2012_04_27_00_world_instance_icc.sql similarity index 100% rename from sql/updates/world/2012_04_27_00_world_instance_icc.sql rename to sql/old/3.3.5a/2012_04_27_00_world_instance_icc.sql diff --git a/sql/updates/world/2012_04_28_00_world_reference_loot_template.sql b/sql/old/3.3.5a/2012_04_28_00_world_reference_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_28_00_world_reference_loot_template.sql rename to sql/old/3.3.5a/2012_04_28_00_world_reference_loot_template.sql diff --git a/sql/updates/world/2012_04_28_01_world_reference_loot_template.sql b/sql/old/3.3.5a/2012_04_28_01_world_reference_loot_template.sql similarity index 100% rename from sql/updates/world/2012_04_28_01_world_reference_loot_template.sql rename to sql/old/3.3.5a/2012_04_28_01_world_reference_loot_template.sql diff --git a/sql/updates/world/2012_05_01_00_world_creature.sql b/sql/old/3.3.5a/2012_05_01_00_world_creature.sql similarity index 100% rename from sql/updates/world/2012_05_01_00_world_creature.sql rename to sql/old/3.3.5a/2012_05_01_00_world_creature.sql diff --git a/sql/updates/world/2012_05_02_00_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_05_02_00_world_creature_loot_template.sql similarity index 100% rename from sql/updates/world/2012_05_02_00_world_creature_loot_template.sql rename to sql/old/3.3.5a/2012_05_02_00_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_05_03_00_world_creature.sql b/sql/old/3.3.5a/2012_05_03_00_world_creature.sql similarity index 100% rename from sql/updates/world/2012_05_03_00_world_creature.sql rename to sql/old/3.3.5a/2012_05_03_00_world_creature.sql diff --git a/sql/updates/world/2012_05_03_01_world_cos_misc.sql b/sql/old/3.3.5a/2012_05_03_01_world_cos_misc.sql similarity index 100% rename from sql/updates/world/2012_05_03_01_world_cos_misc.sql rename to sql/old/3.3.5a/2012_05_03_01_world_cos_misc.sql diff --git a/sql/updates/world/2012_05_03_02_world_quest_template.sql b/sql/old/3.3.5a/2012_05_03_02_world_quest_template.sql similarity index 100% rename from sql/updates/world/2012_05_03_02_world_quest_template.sql rename to sql/old/3.3.5a/2012_05_03_02_world_quest_template.sql diff --git a/sql/updates/world/2012_05_03_03_world_creature_questrelation.sql b/sql/old/3.3.5a/2012_05_03_03_world_creature_questrelation.sql similarity index 100% rename from sql/updates/world/2012_05_03_03_world_creature_questrelation.sql rename to sql/old/3.3.5a/2012_05_03_03_world_creature_questrelation.sql diff --git a/sql/updates/world/2012_05_03_04_world_game_event_creature_quest.sql b/sql/old/3.3.5a/2012_05_03_04_world_game_event_creature_quest.sql similarity index 100% rename from sql/updates/world/2012_05_03_04_world_game_event_creature_quest.sql rename to sql/old/3.3.5a/2012_05_03_04_world_game_event_creature_quest.sql diff --git a/sql/updates/world/2012_05_04_00_world_waypoints.sql b/sql/old/3.3.5a/2012_05_04_00_world_waypoints.sql similarity index 100% rename from sql/updates/world/2012_05_04_00_world_waypoints.sql rename to sql/old/3.3.5a/2012_05_04_00_world_waypoints.sql diff --git a/sql/updates/world/2012_05_04_01_world_sai.sql b/sql/old/3.3.5a/2012_05_04_01_world_sai.sql similarity index 100% rename from sql/updates/world/2012_05_04_01_world_sai.sql rename to sql/old/3.3.5a/2012_05_04_01_world_sai.sql diff --git a/sql/updates/world/2012_05_05_00_world_sai.sql b/sql/old/3.3.5a/2012_05_05_00_world_sai.sql similarity index 100% rename from sql/updates/world/2012_05_05_00_world_sai.sql rename to sql/old/3.3.5a/2012_05_05_00_world_sai.sql diff --git a/sql/updates/world/2012_05_05_01_world_creature_template.sql b/sql/old/3.3.5a/2012_05_05_01_world_creature_template.sql similarity index 100% rename from sql/updates/world/2012_05_05_01_world_creature_template.sql rename to sql/old/3.3.5a/2012_05_05_01_world_creature_template.sql diff --git a/sql/updates/world/2012_05_05_02_world_gameobject.sql b/sql/old/3.3.5a/2012_05_05_02_world_gameobject.sql similarity index 100% rename from sql/updates/world/2012_05_05_02_world_gameobject.sql rename to sql/old/3.3.5a/2012_05_05_02_world_gameobject.sql diff --git a/sql/updates/world/2012_05_05_03_world_sai.sql b/sql/old/3.3.5a/2012_05_05_03_world_sai.sql similarity index 100% rename from sql/updates/world/2012_05_05_03_world_sai.sql rename to sql/old/3.3.5a/2012_05_05_03_world_sai.sql diff --git a/sql/updates/world/2012_05_05_04_world_creature_template.sql b/sql/old/3.3.5a/2012_05_05_04_world_creature_template.sql similarity index 100% rename from sql/updates/world/2012_05_05_04_world_creature_template.sql rename to sql/old/3.3.5a/2012_05_05_04_world_creature_template.sql diff --git a/sql/updates/world/2012_05_05_05_world_creature_template.sql b/sql/old/3.3.5a/2012_05_05_05_world_creature_template.sql similarity index 100% rename from sql/updates/world/2012_05_05_05_world_creature_template.sql rename to sql/old/3.3.5a/2012_05_05_05_world_creature_template.sql diff --git a/sql/updates/world/2012_05_05_06_world_sai.sql b/sql/old/3.3.5a/2012_05_05_06_world_sai.sql similarity index 100% rename from sql/updates/world/2012_05_05_06_world_sai.sql rename to sql/old/3.3.5a/2012_05_05_06_world_sai.sql diff --git a/sql/updates/world/2012_05_06_00_world_creature_template.sql b/sql/old/3.3.5a/2012_05_06_00_world_creature_template.sql similarity index 100% rename from sql/updates/world/2012_05_06_00_world_creature_template.sql rename to sql/old/3.3.5a/2012_05_06_00_world_creature_template.sql diff --git a/sql/updates/world/2012_05_06_01_world_creature_template.sql b/sql/old/3.3.5a/2012_05_06_01_world_creature_template.sql similarity index 100% rename from sql/updates/world/2012_05_06_01_world_creature_template.sql rename to sql/old/3.3.5a/2012_05_06_01_world_creature_template.sql diff --git a/sql/updates/world/2012_05_07_00_world_waypoints.sql b/sql/old/3.3.5a/2012_05_07_00_world_waypoints.sql similarity index 100% rename from sql/updates/world/2012_05_07_00_world_waypoints.sql rename to sql/old/3.3.5a/2012_05_07_00_world_waypoints.sql diff --git a/sql/updates/world/2012_05_07_01_world_sai.sql b/sql/old/3.3.5a/2012_05_07_01_world_sai.sql similarity index 100% rename from sql/updates/world/2012_05_07_01_world_sai.sql rename to sql/old/3.3.5a/2012_05_07_01_world_sai.sql diff --git a/sql/updates/world/2012_05_08_00_world_sai.sql b/sql/old/3.3.5a/2012_05_08_00_world_sai.sql similarity index 100% rename from sql/updates/world/2012_05_08_00_world_sai.sql rename to sql/old/3.3.5a/2012_05_08_00_world_sai.sql diff --git a/sql/updates/world/2012_05_08_01_world_gameobject.sql b/sql/old/3.3.5a/2012_05_08_01_world_gameobject.sql similarity index 100% rename from sql/updates/world/2012_05_08_01_world_gameobject.sql rename to sql/old/3.3.5a/2012_05_08_01_world_gameobject.sql diff --git a/sql/updates/world/2012_05_08_01_world_misc.sql b/sql/old/3.3.5a/2012_05_08_01_world_misc.sql similarity index 100% rename from sql/updates/world/2012_05_08_01_world_misc.sql rename to sql/old/3.3.5a/2012_05_08_01_world_misc.sql diff --git a/sql/updates/world/2012_05_09_00_world_spell_target_position.sql b/sql/old/3.3.5a/2012_05_09_00_world_spell_target_position.sql similarity index 100% rename from sql/updates/world/2012_05_09_00_world_spell_target_position.sql rename to sql/old/3.3.5a/2012_05_09_00_world_spell_target_position.sql diff --git a/sql/updates/world/2012_05_09_01_world_commands.sql b/sql/old/3.3.5a/2012_05_09_01_world_commands.sql similarity index 100% rename from sql/updates/world/2012_05_09_01_world_commands.sql rename to sql/old/3.3.5a/2012_05_09_01_world_commands.sql diff --git a/sql/updates/world/2012_05_09_02_world_sai.sql b/sql/old/3.3.5a/2012_05_09_02_world_sai.sql similarity index 100% rename from sql/updates/world/2012_05_09_02_world_sai.sql rename to sql/old/3.3.5a/2012_05_09_02_world_sai.sql diff --git a/sql/updates/world/2012_05_09_03_world_misc.sql b/sql/old/3.3.5a/2012_05_09_03_world_misc.sql similarity index 100% rename from sql/updates/world/2012_05_09_03_world_misc.sql rename to sql/old/3.3.5a/2012_05_09_03_world_misc.sql diff --git a/sql/updates/world/2012_05_10_00_world_sai.sql b/sql/old/3.3.5a/2012_05_10_00_world_sai.sql similarity index 100% rename from sql/updates/world/2012_05_10_00_world_sai.sql rename to sql/old/3.3.5a/2012_05_10_00_world_sai.sql diff --git a/sql/updates/world/2012_05_10_01_world_misc.sql b/sql/old/3.3.5a/2012_05_10_01_world_misc.sql similarity index 100% rename from sql/updates/world/2012_05_10_01_world_misc.sql rename to sql/old/3.3.5a/2012_05_10_01_world_misc.sql diff --git a/sql/updates/world/2012_05_10_02_world_creature_template.sql b/sql/old/3.3.5a/2012_05_10_02_world_creature_template.sql similarity index 100% rename from sql/updates/world/2012_05_10_02_world_creature_template.sql rename to sql/old/3.3.5a/2012_05_10_02_world_creature_template.sql diff --git a/sql/updates/world/2012_05_10_03_world_misc.sql b/sql/old/3.3.5a/2012_05_10_03_world_misc.sql similarity index 100% rename from sql/updates/world/2012_05_10_03_world_misc.sql rename to sql/old/3.3.5a/2012_05_10_03_world_misc.sql diff --git a/sql/updates/world/2012_05_10_04_world_ceature_sai.sql b/sql/old/3.3.5a/2012_05_10_04_world_ceature_sai.sql similarity index 100% rename from sql/updates/world/2012_05_10_04_world_ceature_sai.sql rename to sql/old/3.3.5a/2012_05_10_04_world_ceature_sai.sql diff --git a/sql/updates/world/2012_05_10_05_world_waypoints.sql b/sql/old/3.3.5a/2012_05_10_05_world_waypoints.sql similarity index 100% rename from sql/updates/world/2012_05_10_05_world_waypoints.sql rename to sql/old/3.3.5a/2012_05_10_05_world_waypoints.sql diff --git a/sql/updates/world/2012_05_10_06_world_waypoints.sql b/sql/old/3.3.5a/2012_05_10_06_world_waypoints.sql similarity index 100% rename from sql/updates/world/2012_05_10_06_world_waypoints.sql rename to sql/old/3.3.5a/2012_05_10_06_world_waypoints.sql diff --git a/sql/updates/world/2012_05_11_00_world_waypoints.sql b/sql/old/3.3.5a/2012_05_11_00_world_waypoints.sql similarity index 100% rename from sql/updates/world/2012_05_11_00_world_waypoints.sql rename to sql/old/3.3.5a/2012_05_11_00_world_waypoints.sql diff --git a/sql/updates/world/2012_05_11_01_world_gameobject_template.sql b/sql/old/3.3.5a/2012_05_11_01_world_gameobject_template.sql similarity index 100% rename from sql/updates/world/2012_05_11_01_world_gameobject_template.sql rename to sql/old/3.3.5a/2012_05_11_01_world_gameobject_template.sql diff --git a/sql/updates/world/2012_05_11_02_world_conditions.sql b/sql/old/3.3.5a/2012_05_11_02_world_conditions.sql similarity index 100% rename from sql/updates/world/2012_05_11_02_world_conditions.sql rename to sql/old/3.3.5a/2012_05_11_02_world_conditions.sql diff --git a/sql/updates/world/2012_05_12_00_world_gameobject_template.sql b/sql/old/3.3.5a/2012_05_12_00_world_gameobject_template.sql similarity index 100% rename from sql/updates/world/2012_05_12_00_world_gameobject_template.sql rename to sql/old/3.3.5a/2012_05_12_00_world_gameobject_template.sql diff --git a/sql/updates/world/2012_05_12_01_world_item_loot_template.sql b/sql/old/3.3.5a/2012_05_12_01_world_item_loot_template.sql similarity index 100% rename from sql/updates/world/2012_05_12_01_world_item_loot_template.sql rename to sql/old/3.3.5a/2012_05_12_01_world_item_loot_template.sql diff --git a/sql/updates/world/2012_05_12_02_world_gameobject_loot_template.sql b/sql/old/3.3.5a/2012_05_12_02_world_gameobject_loot_template.sql similarity index 100% rename from sql/updates/world/2012_05_12_02_world_gameobject_loot_template.sql rename to sql/old/3.3.5a/2012_05_12_02_world_gameobject_loot_template.sql diff --git a/sql/updates/world/2012_05_13_00_world_creature_text.sql b/sql/old/3.3.5a/2012_05_13_00_world_creature_text.sql similarity index 100% rename from sql/updates/world/2012_05_13_00_world_creature_text.sql rename to sql/old/3.3.5a/2012_05_13_00_world_creature_text.sql diff --git a/sql/updates/world/2012_05_13_01_world_creature_text.sql b/sql/old/3.3.5a/2012_05_13_01_world_creature_text.sql similarity index 100% rename from sql/updates/world/2012_05_13_01_world_creature_text.sql rename to sql/old/3.3.5a/2012_05_13_01_world_creature_text.sql diff --git a/sql/updates/world/2012_05_16_00_world_scripts.sql b/sql/old/3.3.5a/2012_05_16_00_world_scripts.sql similarity index 100% rename from sql/updates/world/2012_05_16_00_world_scripts.sql rename to sql/old/3.3.5a/2012_05_16_00_world_scripts.sql diff --git a/sql/updates/world/2012_05_17_00_world_creature_text.sql b/sql/old/3.3.5a/2012_05_17_00_world_creature_text.sql similarity index 100% rename from sql/updates/world/2012_05_17_00_world_creature_text.sql rename to sql/old/3.3.5a/2012_05_17_00_world_creature_text.sql diff --git a/sql/updates/world/2012_05_18_00_world_conditions.sql b/sql/old/3.3.5a/2012_05_18_00_world_conditions.sql similarity index 100% rename from sql/updates/world/2012_05_18_00_world_conditions.sql rename to sql/old/3.3.5a/2012_05_18_00_world_conditions.sql diff --git a/sql/updates/world/2012_05_18_01_world_misc.sql b/sql/old/3.3.5a/2012_05_18_01_world_misc.sql similarity index 100% rename from sql/updates/world/2012_05_18_01_world_misc.sql rename to sql/old/3.3.5a/2012_05_18_01_world_misc.sql diff --git a/sql/updates/world/2012_05_18_01_world_spell_target_position.sql b/sql/old/3.3.5a/2012_05_18_01_world_spell_target_position.sql similarity index 100% rename from sql/updates/world/2012_05_18_01_world_spell_target_position.sql rename to sql/old/3.3.5a/2012_05_18_01_world_spell_target_position.sql diff --git a/sql/updates/world/2012_05_19_00_world_quest_template.sql b/sql/old/3.3.5a/2012_05_19_00_world_quest_template.sql similarity index 100% rename from sql/updates/world/2012_05_19_00_world_quest_template.sql rename to sql/old/3.3.5a/2012_05_19_00_world_quest_template.sql diff --git a/sql/updates/world/2012_05_19_01_world_smart_scripts.sql b/sql/old/3.3.5a/2012_05_19_01_world_smart_scripts.sql similarity index 100% rename from sql/updates/world/2012_05_19_01_world_smart_scripts.sql rename to sql/old/3.3.5a/2012_05_19_01_world_smart_scripts.sql diff --git a/sql/updates/world/2012_05_19_02_world_misc.sql b/sql/old/3.3.5a/2012_05_19_02_world_misc.sql similarity index 62% rename from sql/updates/world/2012_05_19_02_world_misc.sql rename to sql/old/3.3.5a/2012_05_19_02_world_misc.sql index 1dd946b5a18..97a77ac0ab3 100644 --- a/sql/updates/world/2012_05_19_02_world_misc.sql +++ b/sql/old/3.3.5a/2012_05_19_02_world_misc.sql @@ -1,5 +1,5 @@ -- 2012-05-19 12:48:24 SourceEntry 52264 in `condition` table, has incorrect SourceGroup 0 (spell effectMask) set , ignoring. -UPDATE `conditions` SET `SourceId`=1 WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=0 AND `SourceEntry`=52264 AND `SourceId`=0 AND `ElseGroup`=0 AND `ConditionTypeOrReference`=29 AND `ConditionTarget`=0 AND `ConditionValue1`=28653 AND `ConditionValue2`=5 AND `ConditionValue3`=0; +UPDATE `conditions` SET `SourceGroup`=1 WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=0 AND `SourceEntry`=52264 AND `SourceId`=0 AND `ElseGroup`=0 AND `ConditionTypeOrReference`=29 AND `ConditionTarget`=0 AND `ConditionValue1`=28653 AND `ConditionValue2`=5 AND `ConditionValue3`=0; -- 2012-05-19 12:48:18 Quest 384 has `ZoneOrSort` = -304 but `RequiredSkillId` does not have a corresponding value (185). -- It is not clear if cooking was required on 3.3.5, so reverting it to its original state (however we are sure it is not required in Cata) diff --git a/sql/updates/world/2012_02_19_03_world_version.sql b/sql/updates/world/2012_02_19_03_world_version.sql new file mode 100644 index 00000000000..53c6821be69 --- /dev/null +++ b/sql/updates/world/2012_02_19_03_world_version.sql @@ -0,0 +1 @@ +UPDATE `version` SET `db_version`='TDB 335.11.47' LIMIT 1; From 524e30e57b4a743f1ebd964f06657487d437d0f4 Mon Sep 17 00:00:00 2001 From: 4m1g0 Date: Sat, 19 May 2012 15:09:23 +0100 Subject: [PATCH 0777/1149] Scripts/kalimdor: Use proper headers to optimize compile, code style and general cleanup. Closes #6419 (pr) --- .../scripts/EasternKingdoms/undercity.cpp | 6 +- src/server/scripts/Kalimdor/ashenvale.cpp | 196 +++++------ src/server/scripts/Kalimdor/azshara.cpp | 225 +++++++------ .../scripts/Kalimdor/azuremyst_isle.cpp | 186 +++++------ .../scripts/Kalimdor/bloodmyst_isle.cpp | 16 +- src/server/scripts/Kalimdor/boss_azuregos.cpp | 119 +++---- src/server/scripts/Kalimdor/darkshore.cpp | 135 ++++---- src/server/scripts/Kalimdor/desolace.cpp | 27 +- src/server/scripts/Kalimdor/durotar.cpp | 20 +- .../scripts/Kalimdor/dustwallow_marsh.cpp | 61 ++-- src/server/scripts/Kalimdor/felwood.cpp | 25 +- src/server/scripts/Kalimdor/feralas.cpp | 6 +- src/server/scripts/Kalimdor/moonglade.cpp | 208 ++++++------ src/server/scripts/Kalimdor/mulgore.cpp | 171 +++++----- src/server/scripts/Kalimdor/orgrimmar.cpp | 53 +-- src/server/scripts/Kalimdor/silithus.cpp | 32 +- .../scripts/Kalimdor/stonetalon_mountains.cpp | 6 +- src/server/scripts/Kalimdor/tanaris.cpp | 306 +++++++++--------- src/server/scripts/Kalimdor/teldrassil.cpp | 17 +- src/server/scripts/Kalimdor/the_barrens.cpp | 100 +++--- .../scripts/Kalimdor/thousand_needles.cpp | 85 +++-- src/server/scripts/Kalimdor/thunder_bluff.cpp | 67 ++-- src/server/scripts/Kalimdor/ungoro_crater.cpp | 117 ++++--- src/server/scripts/Kalimdor/winterspring.cpp | 4 +- .../Ulduar/boss_algalon_the_observer.cpp | 2 +- src/server/scripts/Spells/spell_item.cpp | 2 +- src/server/scripts/Spells/spell_shaman.cpp | 2 +- 27 files changed, 1114 insertions(+), 1080 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/undercity.cpp b/src/server/scripts/EasternKingdoms/undercity.cpp index d5896812007..a9b627ded34 100644 --- a/src/server/scripts/EasternKingdoms/undercity.cpp +++ b/src/server/scripts/EasternKingdoms/undercity.cpp @@ -184,7 +184,7 @@ public: { if (Unit* victim = me->getVictim()) { - DoCast(me->getVictim(), SPELL_BLACK_ARROW); + DoCast(victim, SPELL_BLACK_ARROW); BlackArrowTimer = 15000 + rand()%5000; } } else BlackArrowTimer -= diff; @@ -193,7 +193,7 @@ public: { if (Unit* victim = me->getVictim()) { - DoCast(me->getVictim(), SPELL_SHOT); + DoCast(victim, SPELL_SHOT); ShotTimer = 8000 + rand()%2000; } } else ShotTimer -= diff; @@ -202,7 +202,7 @@ public: { if (Unit* victim = me->getVictim()) { - DoCast(me->getVictim(), SPELL_MULTI_SHOT); + DoCast(victim, SPELL_MULTI_SHOT); MultiShotTimer = 10000 + rand()%3000; } } else MultiShotTimer -= diff; diff --git a/src/server/scripts/Kalimdor/ashenvale.cpp b/src/server/scripts/Kalimdor/ashenvale.cpp index cec5e42aee5..e28665c038e 100644 --- a/src/server/scripts/Kalimdor/ashenvale.cpp +++ b/src/server/scripts/Kalimdor/ashenvale.cpp @@ -28,7 +28,8 @@ npc_torek npc_ruul_snowhoof EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "ScriptedEscortAI.h" /*#### @@ -78,32 +79,31 @@ class npc_torek : public CreatureScript void WaypointReached(uint32 waypointId) { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) + if (Player* player = GetPlayerForEscort()) { - case 1: - Talk(SAY_MOVE, player->GetGUID()); - break; - case 8: - Talk(SAY_PREPARE, player->GetGUID()); - break; - case 19: - //TODO: verify location and creatures amount. - me->SummonCreature(ENTRY_DURIEL, 1776.73f, -2049.06f, 109.83f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - me->SummonCreature(ENTRY_SILVERWING_SENTINEL, 1774.64f, -2049.41f, 109.83f, 1.40f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - me->SummonCreature(ENTRY_SILVERWING_WARRIOR, 1778.73f, -2049.50f, 109.83f, 1.67f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 20: - DoScriptText(SAY_WIN, me, player); - Completed = true; - player->GroupEventHappens(QUEST_TOREK_ASSULT, me); - break; - case 21: - Talk(SAY_END, player->GetGUID()); - break; + switch (waypointId) + { + case 1: + Talk(SAY_MOVE, player->GetGUID()); + break; + case 8: + Talk(SAY_PREPARE, player->GetGUID()); + break; + case 19: + //TODO: verify location and creatures amount. + me->SummonCreature(ENTRY_DURIEL, 1776.73f, -2049.06f, 109.83f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(ENTRY_SILVERWING_SENTINEL, 1774.64f, -2049.41f, 109.83f, 1.40f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(ENTRY_SILVERWING_WARRIOR, 1778.73f, -2049.50f, 109.83f, 1.67f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 20: + DoScriptText(SAY_WIN, me, player); + Completed = true; + player->GroupEventHappens(QUEST_TOREK_ASSULT, me); + break; + case 21: + Talk(SAY_END, player->GetGUID()); + break; + } } } @@ -169,8 +169,26 @@ class npc_torek : public CreatureScript # npc_ruul_snowhoof ####*/ -#define QUEST_FREEDOM_TO_RUUL 6482 -#define GO_CAGE 178147 +enum RuulSnowhoof +{ + NPC_THISTLEFUR_URSA = 3921, + NPC_THISTLEFUR_TOTEMIC = 3922, + NPC_THISTLEFUR_PATHFINDER = 3926, + + QUEST_FREEDOM_TO_RUUL = 6482, + + GO_CAGE = 178147 +}; + +Position const RuulSnowhoofSummonsCoord[6] = +{ + {3449.218018f, -587.825073f, 174.978867f, 4.714445f}, + {3446.384521f, -587.830872f, 175.186279f, 4.714445f}, + {3444.218994f, -587.835327f, 175.380600f, 4.714445f}, + {3508.344482f, -492.024261f, 186.929031f, 4.145029f}, + {3506.265625f, -490.531006f, 186.740128f, 4.239277f}, + {3503.682373f, -489.393799f, 186.629684f, 4.349232f} +}; class npc_ruul_snowhoof : public CreatureScript { @@ -195,14 +213,14 @@ class npc_ruul_snowhoof : public CreatureScript Cage->SetGoState(GO_STATE_ACTIVE); break; case 13: - me->SummonCreature(3922, 3449.218018f, -587.825073f, 174.978867f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); - me->SummonCreature(3921, 3446.384521f, -587.830872f, 175.186279f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); - me->SummonCreature(3926, 3444.218994f, -587.835327f, 175.380600f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); + me->SummonCreature(NPC_THISTLEFUR_TOTEMIC, RuulSnowhoofSummonsCoord[0], TEMPSUMMON_DEAD_DESPAWN, 60000); + me->SummonCreature(NPC_THISTLEFUR_URSA, RuulSnowhoofSummonsCoord[1], TEMPSUMMON_DEAD_DESPAWN, 60000); + me->SummonCreature(NPC_THISTLEFUR_PATHFINDER, RuulSnowhoofSummonsCoord[2], TEMPSUMMON_DEAD_DESPAWN, 60000); break; case 19: - me->SummonCreature(3922, 3508.344482f, -492.024261f, 186.929031f, 4.145029f, TEMPSUMMON_DEAD_DESPAWN, 60000); - me->SummonCreature(3921, 3506.265625f, -490.531006f, 186.740128f, 4.239277f, TEMPSUMMON_DEAD_DESPAWN, 60000); - me->SummonCreature(3926, 3503.682373f, -489.393799f, 186.629684f, 4.349232f, TEMPSUMMON_DEAD_DESPAWN, 60000); + me->SummonCreature(NPC_THISTLEFUR_TOTEMIC, RuulSnowhoofSummonsCoord[3], TEMPSUMMON_DEAD_DESPAWN, 60000); + me->SummonCreature(NPC_THISTLEFUR_URSA, RuulSnowhoofSummonsCoord[4], TEMPSUMMON_DEAD_DESPAWN, 60000); + me->SummonCreature(NPC_THISTLEFUR_PATHFINDER, RuulSnowhoofSummonsCoord[5], TEMPSUMMON_DEAD_DESPAWN, 60000); break; case 21: player->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, me); @@ -214,8 +232,7 @@ class npc_ruul_snowhoof : public CreatureScript void Reset() { - GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20); - if (Cage) + if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) Cage->SetGoState(GO_STATE_READY); } @@ -249,7 +266,7 @@ class npc_ruul_snowhoof : public CreatureScript } }; -enum eEnums +enum Muglash { SAY_MUG_START1 = -1800054, SAY_MUG_START2 = -1800055, @@ -278,21 +295,21 @@ enum eEnums NPC_MUGLASH = 12717 }; -static float m_afFirstNagaCoord[3][3]= +Position const FirstNagaCoord[3] = { - {3603.504150f, 1122.631104f, 1.635f}, // rider - {3589.293945f, 1148.664063f, 5.565f}, // sorceress - {3609.925537f, 1168.759521f, -1.168f} // razortail + {3603.504150f, 1122.631104f, 1.635f, 0.0f}, // rider + {3589.293945f, 1148.664063f, 5.565f, 0.0f}, // sorceress + {3609.925537f, 1168.759521f, -1.168f, 0.0f} // razortail }; -static float m_afSecondNagaCoord[3][3]= +Position const SecondNagaCoord[3] = { - {3609.925537f, 1168.759521f, -1.168f}, // witch - {3645.652100f, 1139.425415f, 1.322f}, // priest - {3583.602051f, 1128.405762f, 2.347f} // myrmidon + {3609.925537f, 1168.759521f, -1.168f, 0.0f}, // witch + {3645.652100f, 1139.425415f, 1.322f, 0.0f}, // priest + {3583.602051f, 1128.405762f, 2.347f, 0.0f} // myrmidon }; -static float m_fVorshaCoord[]={3633.056885f, 1172.924072f, -5.388f}; +Position const VorshaCoord = {3633.056885f, 1172.924072f, -5.388f, 0.0f}; class npc_muglash : public CreatureScript { @@ -303,9 +320,9 @@ class npc_muglash : public CreatureScript { npc_muglashAI(Creature* creature) : npc_escortAI(creature) { } - uint32 m_uiWaveId; - uint32 m_uiEventTimer; - bool m_bIsBrazierExtinguished; + uint8 WaveId; + uint32 EventTimer; + bool IsBrazierExtinguished; void JustSummoned(Creature* summoned) { @@ -314,34 +331,33 @@ class npc_muglash : public CreatureScript void WaypointReached(uint32 waypointId) { - Player* player = GetPlayerForEscort(); - - switch (waypointId) + if (Player* player = GetPlayerForEscort()) { - case 0: - if (player) + switch (waypointId) + { + case 0: DoScriptText(SAY_MUG_START2, me, player); - break; - case 24: - if (player) + break; + case 24: DoScriptText(SAY_MUG_BRAZIER, me, player); - if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_NAGA_BRAZIER, INTERACTION_DISTANCE*2)) - { - go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - SetEscortPaused(true); - } - break; - case 25: - DoScriptText(SAY_MUG_GRATITUDE, me); - player->GroupEventHappens(QUEST_VORSHA, me); - break; - case 26: - DoScriptText(SAY_MUG_PATROL, me); - break; - case 27: - DoScriptText(SAY_MUG_RETURN, me); - break; + if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_NAGA_BRAZIER, INTERACTION_DISTANCE*2)) + { + go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + SetEscortPaused(true); + } + break; + case 25: + DoScriptText(SAY_MUG_GRATITUDE, me); + player->GroupEventHappens(QUEST_VORSHA, me); + break; + case 26: + DoScriptText(SAY_MUG_PATROL, me); + break; + case 27: + DoScriptText(SAY_MUG_RETURN, me); + break; + } } } @@ -358,9 +374,9 @@ class npc_muglash : public CreatureScript void Reset() { - m_uiEventTimer = 10000; - m_uiWaveId = 0; - m_bIsBrazierExtinguished = false; + EventTimer = 10000; + WaveId = 0; + IsBrazierExtinguished = false; } void JustDied(Unit* /*killer*/) @@ -372,20 +388,20 @@ class npc_muglash : public CreatureScript void DoWaveSummon() { - switch (m_uiWaveId) + switch (WaveId) { case 1: - me->SummonCreature(NPC_WRATH_RIDER, m_afFirstNagaCoord[0][0], m_afFirstNagaCoord[0][1], m_afFirstNagaCoord[0][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - me->SummonCreature(NPC_WRATH_SORCERESS, m_afFirstNagaCoord[1][0], m_afFirstNagaCoord[1][1], m_afFirstNagaCoord[1][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - me->SummonCreature(NPC_WRATH_RAZORTAIL, m_afFirstNagaCoord[2][0], m_afFirstNagaCoord[2][1], m_afFirstNagaCoord[2][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_WRATH_RIDER, FirstNagaCoord[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_WRATH_SORCERESS, FirstNagaCoord[1], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_WRATH_RAZORTAIL, FirstNagaCoord[2], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 2: - me->SummonCreature(NPC_WRATH_PRIESTESS, m_afSecondNagaCoord[0][0], m_afSecondNagaCoord[0][1], m_afSecondNagaCoord[0][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - me->SummonCreature(NPC_WRATH_MYRMIDON, m_afSecondNagaCoord[1][0], m_afSecondNagaCoord[1][1], m_afSecondNagaCoord[1][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - me->SummonCreature(NPC_WRATH_SEAWITCH, m_afSecondNagaCoord[2][0], m_afSecondNagaCoord[2][1], m_afSecondNagaCoord[2][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_WRATH_PRIESTESS, SecondNagaCoord[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_WRATH_MYRMIDON, SecondNagaCoord[1], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_WRATH_SEAWITCH, SecondNagaCoord[2], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 3: - me->SummonCreature(NPC_VORSHA, m_fVorshaCoord[0], m_fVorshaCoord[1], m_fVorshaCoord[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_VORSHA, VorshaCoord, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 4: SetEscortPaused(false); @@ -400,16 +416,16 @@ class npc_muglash : public CreatureScript if (!me->getVictim()) { - if (HasEscortState(STATE_ESCORT_PAUSED) && m_bIsBrazierExtinguished) + if (HasEscortState(STATE_ESCORT_PAUSED) && IsBrazierExtinguished) { - if (m_uiEventTimer < uiDiff) + if (EventTimer < uiDiff) { - ++m_uiWaveId; + ++WaveId; DoWaveSummon(); - m_uiEventTimer = 10000; + EventTimer = 10000; } else - m_uiEventTimer -= uiDiff; + EventTimer -= uiDiff; } return; } @@ -451,7 +467,7 @@ class go_naga_brazier : public GameObjectScript { DoScriptText(SAY_MUG_BRAZIER_WAIT, creature); - pEscortAI->m_bIsBrazierExtinguished = true; + pEscortAI->IsBrazierExtinguished = true; return false; } } diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp index 2e7b0a684c1..eae5baa8db2 100644 --- a/src/server/scripts/Kalimdor/azshara.cpp +++ b/src/server/scripts/Kalimdor/azshara.cpp @@ -30,9 +30,9 @@ mob_rizzle_sprysprocket mob_depth_charge EndContentData */ -#include "ScriptPCH.h" -#include "World.h" -#include "WorldPacket.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" /*###### ## mobs_spitelashes @@ -179,9 +179,12 @@ public: # mob_rizzle_sprysprocket ####*/ -enum eRizzleSprysprocketData +enum RizzleSprysprocketData { + QUEST_CHASING_THE_MOONSTONE = 10994, + MOB_DEPTH_CHARGE = 23025, + SPELL_RIZZLE_BLACKJACK = 39865, SPELL_RIZZLE_ESCAPE = 39871, SPELL_RIZZLE_FROST_GRENADE = 40525, @@ -199,67 +202,66 @@ enum eRizzleSprysprocketData #define GOSSIP_GET_MOONSTONE "Hand over the Southfury moonstone and I'll let you go." -float WPs[58][4] = +Position const WPs[58] = { -//pos_x pos_y pos_z orien -{3691.97f, -3962.41f, 35.9118f, 3.67f}, -{3675.02f, -3960.49f, 35.9118f, 3.67f}, -{3653.19f, -3958.33f, 33.9118f, 3.59f}, -{3621.12f, -3958.51f, 29.9118f, 3.48f}, -{3604.86f, -3963, 29.9118f, 3.48f}, -{3569.94f, -3970.25f, 29.9118f, 3.44f}, -{3541.03f, -3975.64f, 29.9118f, 3.41f}, -{3510.84f, -3978.71f, 29.9118f, 3.41f}, -{3472.7f, -3997.07f, 29.9118f, 3.35f}, -{3439.15f, -4014.55f, 29.9118f, 3.29f}, -{3412.8f, -4025.87f, 29.9118f, 3.25f}, -{3384.95f, -4038.04f, 29.9118f, 3.24f}, -{3346.77f, -4052.93f, 29.9118f, 3.22f}, -{3299.56f, -4071.59f, 29.9118f, 3.20f}, -{3261.22f, -4080.38f, 30.9118f, 3.19f}, -{3220.68f, -4083.09f, 31.9118f, 3.18f}, -{3187.11f, -4070.45f, 33.9118f, 3.16f}, -{3162.78f, -4062.75f, 33.9118f, 3.15f}, -{3136.09f, -4050.32f, 33.9118f, 3.07f}, -{3119.47f, -4044.51f, 36.0363f, 3.07f}, -{3098.95f, -4019.8f, 33.9118f, 3.07f}, -{3073.07f, -4011.42f, 33.9118f, 3.07f}, -{3051.71f, -3993.37f, 33.9118f, 3.02f}, -{3027.52f, -3978.6f, 33.9118f, 3.00f}, -{3003.78f, -3960.14f, 33.9118f, 2.98f}, -{2977.99f, -3941.98f, 31.9118f, 2.96f}, -{2964.57f, -3932.07f, 30.9118f, 2.96f}, -{2947.9f, -3921.31f, 29.9118f, 2.96f}, -{2924.91f, -3910.8f, 29.9118f, 2.94f}, -{2903.04f, -3896.42f, 29.9118f, 2.93f}, -{2884.75f, -3874.03f, 29.9118f, 2.90f}, -{2868.19f, -3851.48f, 29.9118f, 2.82f}, -{2854.62f, -3819.72f, 29.9118f, 2.80f}, -{2825.53f, -3790.4f, 29.9118f, 2.744f}, -{2804.31f, -3773.05f, 29.9118f, 2.71f}, -{2769.78f, -3763.57f, 29.9118f, 2.70f}, -{2727.23f, -3745.92f, 30.9118f, 2.69f}, -{2680.12f, -3737.49f, 30.9118f, 2.67f}, -{2647.62f, -3739.94f, 30.9118f, 2.66f}, -{2616.6f, -3745.75f, 30.9118f, 2.64f}, -{2589.38f, -3731.97f, 30.9118f, 2.61f}, -{2562.94f, -3722.35f, 31.9118f, 2.56f}, -{2521.05f, -3716.6f, 31.9118f, 2.55f}, -{2485.26f, -3706.67f, 31.9118f, 2.51f}, -{2458.93f, -3696.67f, 31.9118f, 2.51f}, -{2432, -3692.03f, 31.9118f, 2.46f}, -{2399.59f, -3681.97f, 31.9118f, 2.45f}, -{2357.75f, -3666.6f, 31.9118f, 2.44f}, -{2311.99f, -3656.88f, 31.9118f, 2.94f}, -{2263.41f, -3649.55f, 31.9118f, 3.02f}, -{2209.05f, -3641.76f, 31.9118f, 2.99f}, -{2164.83f, -3637.64f, 31.9118f, 3.15f}, -{2122.42f, -3639, 31.9118f, 3.21f}, -{2075.73f, -3643.59f, 31.9118f, 3.22f}, -{2033.59f, -3649.52f, 31.9118f, 3.42f}, -{1985.22f, -3662.99f, 31.9118f, 3.42f}, -{1927.09f, -3679.56f, 33.9118f, 3.42f}, -{1873.57f, -3695.32f, 33.9118f, 3.44f} + {3691.97f, -3962.41f, 35.9118f, 3.67f}, + {3675.02f, -3960.49f, 35.9118f, 3.67f}, + {3653.19f, -3958.33f, 33.9118f, 3.59f}, + {3621.12f, -3958.51f, 29.9118f, 3.48f}, + {3604.86f, -3963, 29.9118f, 3.48f}, + {3569.94f, -3970.25f, 29.9118f, 3.44f}, + {3541.03f, -3975.64f, 29.9118f, 3.41f}, + {3510.84f, -3978.71f, 29.9118f, 3.41f}, + {3472.7f, -3997.07f, 29.9118f, 3.35f}, + {3439.15f, -4014.55f, 29.9118f, 3.29f}, + {3412.8f, -4025.87f, 29.9118f, 3.25f}, + {3384.95f, -4038.04f, 29.9118f, 3.24f}, + {3346.77f, -4052.93f, 29.9118f, 3.22f}, + {3299.56f, -4071.59f, 29.9118f, 3.20f}, + {3261.22f, -4080.38f, 30.9118f, 3.19f}, + {3220.68f, -4083.09f, 31.9118f, 3.18f}, + {3187.11f, -4070.45f, 33.9118f, 3.16f}, + {3162.78f, -4062.75f, 33.9118f, 3.15f}, + {3136.09f, -4050.32f, 33.9118f, 3.07f}, + {3119.47f, -4044.51f, 36.0363f, 3.07f}, + {3098.95f, -4019.8f, 33.9118f, 3.07f}, + {3073.07f, -4011.42f, 33.9118f, 3.07f}, + {3051.71f, -3993.37f, 33.9118f, 3.02f}, + {3027.52f, -3978.6f, 33.9118f, 3.00f}, + {3003.78f, -3960.14f, 33.9118f, 2.98f}, + {2977.99f, -3941.98f, 31.9118f, 2.96f}, + {2964.57f, -3932.07f, 30.9118f, 2.96f}, + {2947.9f, -3921.31f, 29.9118f, 2.96f}, + {2924.91f, -3910.8f, 29.9118f, 2.94f}, + {2903.04f, -3896.42f, 29.9118f, 2.93f}, + {2884.75f, -3874.03f, 29.9118f, 2.90f}, + {2868.19f, -3851.48f, 29.9118f, 2.82f}, + {2854.62f, -3819.72f, 29.9118f, 2.80f}, + {2825.53f, -3790.4f, 29.9118f, 2.744f}, + {2804.31f, -3773.05f, 29.9118f, 2.71f}, + {2769.78f, -3763.57f, 29.9118f, 2.70f}, + {2727.23f, -3745.92f, 30.9118f, 2.69f}, + {2680.12f, -3737.49f, 30.9118f, 2.67f}, + {2647.62f, -3739.94f, 30.9118f, 2.66f}, + {2616.6f, -3745.75f, 30.9118f, 2.64f}, + {2589.38f, -3731.97f, 30.9118f, 2.61f}, + {2562.94f, -3722.35f, 31.9118f, 2.56f}, + {2521.05f, -3716.6f, 31.9118f, 2.55f}, + {2485.26f, -3706.67f, 31.9118f, 2.51f}, + {2458.93f, -3696.67f, 31.9118f, 2.51f}, + {2432, -3692.03f, 31.9118f, 2.46f}, + {2399.59f, -3681.97f, 31.9118f, 2.45f}, + {2357.75f, -3666.6f, 31.9118f, 2.44f}, + {2311.99f, -3656.88f, 31.9118f, 2.94f}, + {2263.41f, -3649.55f, 31.9118f, 3.02f}, + {2209.05f, -3641.76f, 31.9118f, 2.99f}, + {2164.83f, -3637.64f, 31.9118f, 3.15f}, + {2122.42f, -3639, 31.9118f, 3.21f}, + {2075.73f, -3643.59f, 31.9118f, 3.22f}, + {2033.59f, -3649.52f, 31.9118f, 3.42f}, + {1985.22f, -3662.99f, 31.9118f, 3.42f}, + {1927.09f, -3679.56f, 33.9118f, 3.42f}, + {1873.57f, -3695.32f, 33.9118f, 3.44f} }; class mob_rizzle_sprysprocket : public CreatureScript @@ -270,19 +272,19 @@ public: bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF + 1 && player->GetQuestStatus(10994) == QUEST_STATUS_INCOMPLETE) + if (action == GOSSIP_ACTION_INFO_DEF + 1 && player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, SPELL_GIVE_SOUTHFURY_MOONSTONE, true); - CAST_AI(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->Must_Die_Timer = 3000; - CAST_AI(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->Must_Die = true; + CAST_AI(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->MustDieTimer = 3000; + CAST_AI(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->MustDie = true; } return true; } bool OnGossipHello(Player* player, Creature* creature) { - if (player->GetQuestStatus(10994) != QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) != QUEST_STATUS_INCOMPLETE) return true; player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_GET_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); player->SEND_GOSSIP_MENU(10811, creature->GetGUID()); @@ -298,32 +300,32 @@ public: { mob_rizzle_sprysprocketAI(Creature* creature) : ScriptedAI(creature) {} - uint32 spellEscape_Timer; - uint32 Teleport_Timer; - uint32 Check_Timer; - uint32 Grenade_Timer; - uint32 Must_Die_Timer; + uint32 SpellEscapeTimer; + uint32 TeleportTimer; + uint32 CheckTimer; + uint32 GrenadeTimer; + uint32 MustDieTimer; uint32 CurrWP; uint64 PlayerGUID; - bool Must_Die; + bool MustDie; bool Escape; bool ContinueWP; bool Reached; void Reset() { - spellEscape_Timer = 1300; - Teleport_Timer = 3500; - Check_Timer = 10000; - Grenade_Timer = 30000; - Must_Die_Timer = 3000; + SpellEscapeTimer = 1300; + TeleportTimer = 3500; + CheckTimer = 10000; + GrenadeTimer = 30000; + MustDieTimer = 3000; CurrWP = 0; PlayerGUID = 0; - Must_Die = false; + MustDie = false; Escape = false; ContinueWP = false; Reached = false; @@ -331,13 +333,13 @@ public: void UpdateAI(const uint32 diff) { - if (Must_Die) + if (MustDie) { - if (Must_Die_Timer <= diff) + if (MustDieTimer <= diff) { me->DespawnOrUnsummon(); return; - } else Must_Die_Timer -= diff; + } else MustDieTimer -= diff; } if (!Escape) @@ -345,17 +347,16 @@ public: if (!PlayerGUID) return; - if (spellEscape_Timer <= diff) + if (SpellEscapeTimer <= diff) { DoCast(me, SPELL_RIZZLE_ESCAPE, false); - spellEscape_Timer = 10000; - } else spellEscape_Timer -= diff; + SpellEscapeTimer = 10000; + } else SpellEscapeTimer -= diff; - if (Teleport_Timer <= diff) + if (TeleportTimer <= diff) { //temp solution - unit can't be teleported by core using spelleffect 5, only players - Map* map = me->GetMap(); - if (map) + if (me->GetMap()) { me->SetPosition(3706.39f, -3969.15f, 35.9118f, 0); me->AI_SendMoveToPacket(3706.39f, -3969.15f, 35.9118f, 0, 0, 0); @@ -367,20 +368,20 @@ public: me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING); me->SetSpeed(MOVE_RUN, 0.85f, true); me->GetMotionMaster()->MovementExpired(); - me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]); + me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP]); Escape = true; - } else Teleport_Timer -= diff; + } else TeleportTimer -= diff; return; } if (ContinueWP) { - me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]); + me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP]); ContinueWP = false; } - if (Grenade_Timer <= diff) + if (GrenadeTimer <= diff) { Player* player = Unit::GetPlayer(*me, PlayerGUID); if (player) @@ -388,10 +389,10 @@ public: DoScriptText(SAY_RIZZLE_GRENADE, me, player); DoCast(player, SPELL_RIZZLE_FROST_GRENADE, true); } - Grenade_Timer = 30000; - } else Grenade_Timer -= diff; + GrenadeTimer = 30000; + } else GrenadeTimer -= diff; - if (Check_Timer <= diff) + if (CheckTimer <= diff) { Player* player = Unit::GetPlayer(*me, PlayerGUID); if (!player) @@ -410,8 +411,8 @@ public: Reached = true; } - Check_Timer = 1000; - } else Check_Timer -= diff; + CheckTimer = 1000; + } else CheckTimer -= diff; } @@ -427,7 +428,7 @@ public: if (!who || PlayerGUID) return; - if (who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->GetQuestStatus(10994) == QUEST_STATUS_INCOMPLETE) + if (who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE) { PlayerGUID = who->GetGUID(); DoScriptText(SAY_RIZZLE_START, me); @@ -472,25 +473,25 @@ public: { mob_depth_chargeAI(Creature* creature) : ScriptedAI(creature) {} - bool we_must_die; - uint32 must_die_timer; + bool WeMustDie; + uint32 WeMustDieTimer; void Reset() { me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - we_must_die = false; - must_die_timer = 1000; + WeMustDie = false; + WeMustDieTimer = 1000; } void UpdateAI(const uint32 diff) { - if (we_must_die) + if (WeMustDie) { - if (must_die_timer <= diff) - { + if (WeMustDieTimer <= diff) me->DespawnOrUnsummon(); - } else must_die_timer -= diff; + else + WeMustDieTimer -= diff; } return; } @@ -503,18 +504,14 @@ public: if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 5)) { DoCast(who, SPELL_DEPTH_CHARGE_TRAP); - we_must_die = true; + WeMustDie = true; return; } } - void AttackStart(Unit* /*who*/) - { - } + void AttackStart(Unit* /*who*/) {} - void EnterCombat(Unit* /*who*/) - { - } + void EnterCombat(Unit* /*who*/) {} }; }; diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp index dfb1f3b0bdf..608117ca9af 100644 --- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/azuremyst_isle.cpp @@ -33,15 +33,19 @@ go_ravager_cage npc_death_ravager EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "ScriptedEscortAI.h" -#include +#include "ScriptedGossip.h" +#include "Cell.h" +#include "CellImpl.h" +#include "GridNotifiers.h" /*###### ## npc_draenei_survivor ######*/ -enum eEnums +enum draeneiSurvivor { SAY_HEAL1 = -1000176, SAY_HEAL2 = -1000177, @@ -175,7 +179,7 @@ public: ## npc_engineer_spark_overgrind ######*/ -enum eOvergrind +enum Overgrind { SAY_TEXT = -1000184, SAY_EMOTE = -1000185, @@ -235,15 +239,15 @@ public: uint32 NormFaction; uint32 NpcFlags; - uint32 Dynamite_Timer; - uint32 Emote_Timer; + uint32 DynamiteTimer; + uint32 EmoteTimer; bool IsTreeEvent; void Reset() { - Dynamite_Timer = 8000; - Emote_Timer = urand(120000, 150000); + DynamiteTimer = 8000; + EmoteTimer = urand(120000, 150000); me->setFaction(NormFaction); me->SetUInt32Value(UNIT_NPC_FLAGS, NpcFlags); @@ -260,12 +264,12 @@ public: { if (!me->isInCombat() && !IsTreeEvent) { - if (Emote_Timer <= diff) + if (EmoteTimer <= diff) { DoScriptText(SAY_TEXT, me); DoScriptText(SAY_EMOTE, me); - Emote_Timer = urand(120000, 150000); - } else Emote_Timer -= diff; + EmoteTimer = urand(120000, 150000); + } else EmoteTimer -= diff; } else if (IsTreeEvent) return; @@ -273,11 +277,11 @@ public: if (!UpdateVictim()) return; - if (Dynamite_Timer <= diff) + if (DynamiteTimer <= diff) { DoCast(me->getVictim(), SPELL_DYNAMITE); - Dynamite_Timer = 8000; - } else Dynamite_Timer -= diff; + DynamiteTimer = 8000; + } else DynamiteTimer -= diff; DoMeleeAttackIfReady(); } @@ -307,7 +311,7 @@ public: { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); me->SetHealth(me->CountPctFromMaxHealth(15)); - switch (rand()%2) + switch (urand(0, 1)) { case 0: me->SetStandState(UNIT_STAND_STATE_SIT); @@ -321,14 +325,9 @@ public: void EnterCombat(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) - { - } - - void UpdateAI(const uint32 /*diff*/) - { - } + void MoveInLineOfSight(Unit* /*who*/) {} + void UpdateAI(const uint32 /*diff*/) {} }; }; @@ -337,7 +336,7 @@ public: ## npc_magwin ######*/ -enum eMagwin +enum Magwin { SAY_START = -1000111, SAY_AGGRO = -1000112, @@ -376,26 +375,25 @@ public: void WaypointReached(uint32 waypointId) { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) + if (Player* player = GetPlayerForEscort()) { - case 0: - DoScriptText(SAY_START, me, player); - break; - case 17: - DoScriptText(SAY_PROGRESS, me, player); - break; - case 28: - DoScriptText(SAY_END1, me, player); - break; - case 29: - DoScriptText(EMOTE_HUG, me, player); - DoScriptText(SAY_END2, me, player); - player->GroupEventHappens(QUEST_A_CRY_FOR_SAY_HELP, me); - break; + switch (waypointId) + { + case 0: + DoScriptText(SAY_START, me, player); + break; + case 17: + DoScriptText(SAY_PROGRESS, me, player); + break; + case 28: + DoScriptText(SAY_END1, me, player); + break; + case 29: + DoScriptText(EMOTE_HUG, me, player); + DoScriptText(SAY_END2, me, player); + player->GroupEventHappens(QUEST_A_CRY_FOR_SAY_HELP, me); + break; + } } } @@ -404,7 +402,7 @@ public: DoScriptText(SAY_AGGRO, me, who); } - void Reset() { } + void Reset() {} }; }; @@ -413,7 +411,7 @@ public: ## npc_geezle ######*/ -enum eGeezle +enum Geezle { QUEST_TREES_COMPANY = 9531, @@ -433,7 +431,7 @@ enum eGeezle GO_NAGA_FLAG = 181694 }; -static float SparkPos[3] = {-5029.91f, -11291.79f, 8.096f}; +Position const SparkPos = {-5029.91f, -11291.79f, 8.096f, 0.0f}; class npc_geezle : public CreatureScript { @@ -451,7 +449,7 @@ public: uint64 SparkGUID; - uint32 Step; + uint8 Step; uint32 SayTimer; bool EventStarted; @@ -469,8 +467,7 @@ public: { Step = 0; EventStarted = true; - Creature* Spark = me->SummonCreature(MOB_SPARK, SparkPos[0], SparkPos[1], SparkPos[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000); - if (Spark) + if (Creature* Spark = me->SummonCreature(MOB_SPARK, SparkPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000)) { SparkGUID = Spark->GetGUID(); Spark->setActive(true); @@ -479,47 +476,47 @@ public: SayTimer = 8000; } - uint32 NextStep(uint32 Step) + uint32 NextStep(uint8 Step) { Creature* Spark = Unit::GetCreature(*me, SparkGUID); switch (Step) { - case 0: - if (Spark) - Spark->GetMotionMaster()->MovePoint(0, -5080.70f, -11253.61f, 0.56f); - me->GetMotionMaster()->MovePoint(0, -5092.26f, -11252, 0.71f); - return 9000; // NPCs are walking up to fire - case 1: - DespawnNagaFlag(true); - DoScriptText(EMOTE_SPARK, Spark); - return 1000; - case 2: - DoScriptText(GEEZLE_SAY_1, me, Spark); - if (Spark) - { - Spark->SetInFront(me); - me->SetInFront(Spark); - } - return 5000; - case 3: DoScriptText(SPARK_SAY_2, Spark); return 7000; - case 4: DoScriptText(SPARK_SAY_3, Spark); return 8000; - case 5: DoScriptText(GEEZLE_SAY_4, me, Spark); return 8000; - case 6: DoScriptText(SPARK_SAY_5, Spark); return 9000; - case 7: DoScriptText(SPARK_SAY_6, Spark); return 8000; - case 8: DoScriptText(GEEZLE_SAY_7, me, Spark); return 2000; - case 9: - me->GetMotionMaster()->MoveTargetedHome(); - if (Spark) - Spark->GetMotionMaster()->MovePoint(0, SparkPos[0], SparkPos[1], SparkPos[2]); - CompleteQuest(); - return 9000; - case 10: - if (Spark) - Spark->DisappearAndDie(); - DespawnNagaFlag(false); - me->DisappearAndDie(); - default: return 99999999; + case 0: + if (Spark) + Spark->GetMotionMaster()->MovePoint(0, -5080.70f, -11253.61f, 0.56f); + me->GetMotionMaster()->MovePoint(0, -5092.26f, -11252, 0.71f); + return 9000; // NPCs are walking up to fire + case 1: + DespawnNagaFlag(true); + DoScriptText(EMOTE_SPARK, Spark); + return 1000; + case 2: + DoScriptText(GEEZLE_SAY_1, me, Spark); + if (Spark) + { + Spark->SetInFront(me); + me->SetInFront(Spark); + } + return 5000; + case 3: DoScriptText(SPARK_SAY_2, Spark); return 7000; + case 4: DoScriptText(SPARK_SAY_3, Spark); return 8000; + case 5: DoScriptText(GEEZLE_SAY_4, me, Spark); return 8000; + case 6: DoScriptText(SPARK_SAY_5, Spark); return 9000; + case 7: DoScriptText(SPARK_SAY_6, Spark); return 8000; + case 8: DoScriptText(GEEZLE_SAY_7, me, Spark); return 2000; + case 9: + me->GetMotionMaster()->MoveTargetedHome(); + if (Spark) + Spark->GetMotionMaster()->MovePoint(0, SparkPos); + CompleteQuest(); + return 9000; + case 10: + if (Spark) + Spark->DisappearAndDie(); + DespawnNagaFlag(false); + me->DisappearAndDie(); + default: return 99999999; } } @@ -533,13 +530,8 @@ public: me->VisitNearbyWorldObject(radius, searcher); for (std::list::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if ((*itr)->GetQuestStatus(QUEST_TREES_COMPANY) == QUEST_STATUS_INCOMPLETE - &&(*itr)->HasAura(SPELL_TREE_DISGUISE)) - { + if ((*itr)->GetQuestStatus(QUEST_TREES_COMPANY) == QUEST_STATUS_INCOMPLETE && (*itr)->HasAura(SPELL_TREE_DISGUISE)) (*itr)->KilledMonsterCredit(MOB_SPARK, 0); - } - } } void DespawnNagaFlag(bool despawn) @@ -552,13 +544,13 @@ public: for (std::list::const_iterator itr = FlagList.begin(); itr != FlagList.end(); ++itr) { if (despawn) - { (*itr)->SetLootState(GO_JUST_DEACTIVATED); - } else (*itr)->Respawn(); } - } else sLog->outError("SD2 ERROR: FlagList is empty!"); + } + else + sLog->outError("SD2 ERROR: FlagList is empty!"); } void UpdateAI(const uint32 diff) @@ -566,16 +558,16 @@ public: if (SayTimer <= diff) { if (EventStarted) - { SayTimer = NextStep(Step++); - } - } else SayTimer -= diff; + } + else + SayTimer -= diff; } }; }; -enum eRavegerCage +enum RavegerCage { NPC_DEATH_RAVAGER = 17556, diff --git a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp index 6c692a6738b..3883b740d02 100644 --- a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp +++ b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp @@ -28,14 +28,16 @@ mob_webbed_creature npc_captured_sunhawk_agent EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" /*###### ## mob_webbed_creature ######*/ //possible creatures to be spawned -const uint32 possibleSpawns[32] = {17322, 17661, 17496, 17522, 17340, 17352, 17333, 17524, 17654, 17348, 17339, 17345, 17359, 17353, 17336, 17550, 17330, 17701, 17321, 17680, 17325, 17320, 17683, 17342, 17715, 17334, 17341, 17338, 17337, 17346, 17344, 17327}; +uint32 const possibleSpawns[32] = {17322, 17661, 17496, 17522, 17340, 17352, 17333, 17524, 17654, 17348, 17339, 17345, 17359, 17353, 17336, 17550, 17330, 17701, 17321, 17680, 17325, 17320, 17683, 17342, 17715, 17334, 17341, 17338, 17337, 17346, 17344, 17327}; class mob_webbed_creature : public CreatureScript { @@ -51,13 +53,9 @@ public: { mob_webbed_creatureAI(Creature* creature) : ScriptedAI(creature) {} - void Reset() - { - } + void Reset() {} - void EnterCombat(Unit* /*who*/) - { - } + void EnterCombat(Unit* /*who*/) {} void JustDied(Unit* killer) { @@ -153,7 +151,7 @@ public: ## Quest 9667: Saving Princess Stillpine ######*/ -enum eStillpine +enum Stillpine { QUEST_SAVING_PRINCESS_STILLPINE = 9667, NPC_PRINCESS_STILLPINE = 17682, diff --git a/src/server/scripts/Kalimdor/boss_azuregos.cpp b/src/server/scripts/Kalimdor/boss_azuregos.cpp index c344de8cb51..ec098951c03 100644 --- a/src/server/scripts/Kalimdor/boss_azuregos.cpp +++ b/src/server/scripts/Kalimdor/boss_azuregos.cpp @@ -23,17 +23,24 @@ SDComment: Teleport not included, spell reflect not effecting dots (Core problem SDCategory: Azshara EndScriptData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" -#define SAY_TELEPORT -1000100 +enum Say +{ + SAY_TELEPORT = -1000100 +}; -#define SPELL_MARKOFFROST 23182 -#define SPELL_MANASTORM 21097 -#define SPELL_CHILL 21098 -#define SPELL_FROSTBREATH 21099 -#define SPELL_REFLECT 22067 -#define SPELL_CLEAVE 8255 //Perhaps not right ID -#define SPELL_ENRAGE 23537 +enum Spells +{ + SPELL_MARKOFFROST = 23182, + SPELL_MANASTORM = 21097, + SPELL_CHILL = 21098, + SPELL_FROSTBREATH = 21099, + SPELL_REFLECT = 22067, + SPELL_CLEAVE = 8255, //Perhaps not right ID + SPELL_ENRAGE = 23537 +}; class boss_azuregos : public CreatureScript { @@ -49,26 +56,26 @@ public: { boss_azuregosAI(Creature* creature) : ScriptedAI(creature) {} - uint32 MarkOfFrost_Timer; - uint32 ManaStorm_Timer; - uint32 Chill_Timer; - uint32 Breath_Timer; - uint32 Teleport_Timer; - uint32 Reflect_Timer; - uint32 Cleave_Timer; - uint32 Enrage_Timer; + uint32 MarkOfFrostTimer; + uint32 ManaStormTimer; + uint32 ChillTimer; + uint32 BreathTimer; + uint32 TeleportTimer; + uint32 ReflectTimer; + uint32 CleaveTimer; + uint32 EnrageTimer; bool Enraged; void Reset() { - MarkOfFrost_Timer = 35000; - ManaStorm_Timer = urand(5000, 17000); - Chill_Timer = urand(10000, 30000); - Breath_Timer = urand(2000, 8000); - Teleport_Timer = 30000; - Reflect_Timer = urand(15000, 30000); - Cleave_Timer = 7000; - Enrage_Timer = 0; + MarkOfFrostTimer = 35000; + ManaStormTimer = urand(5000, 17000); + ChillTimer = urand(10000, 30000); + BreathTimer = urand(2000, 8000); + TeleportTimer = 30000; + ReflectTimer = urand(15000, 30000); + CleaveTimer = 7000; + EnrageTimer = 0; Enraged = false; } @@ -80,12 +87,12 @@ public: if (!UpdateVictim()) return; - if (Teleport_Timer <= diff) + if (TeleportTimer <= diff) { DoScriptText(SAY_TELEPORT, me); - std::list& m_threatlist = me->getThreatManager().getThreatList(); - std::list::const_iterator i = m_threatlist.begin(); - for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) + std::list& threatlist = me->getThreatManager().getThreatList(); + std::list::const_iterator i = threatlist.begin(); + for (i = threatlist.begin(); i!= threatlist.end(); ++i) { Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) @@ -95,53 +102,53 @@ public: } DoResetThreat(); - Teleport_Timer = 30000; - } else Teleport_Timer -= diff; + TeleportTimer = 30000; + } else TeleportTimer -= diff; - // //MarkOfFrost_Timer - // if (MarkOfFrost_Timer <= diff) + // //MarkOfFrostTimer + // if (MarkOfFrostTimer <= diff) // { // DoCast(me->getVictim(), SPELL_MARKOFFROST); - // MarkOfFrost_Timer = 25000; - // } else MarkOfFrost_Timer -= diff; + // MarkOfFrostTimer = 25000; + // } else MarkOfFrostTimer -= diff; - //Chill_Timer - if (Chill_Timer <= diff) + //ChillTimer + if (ChillTimer <= diff) { DoCast(me->getVictim(), SPELL_CHILL); - Chill_Timer = urand(13000, 25000); - } else Chill_Timer -= diff; + ChillTimer = urand(13000, 25000); + } else ChillTimer -= diff; - //Breath_Timer - if (Breath_Timer <= diff) + //BreathTimer + if (BreathTimer <= diff) { DoCast(me->getVictim(), SPELL_FROSTBREATH); - Breath_Timer = urand(10000, 15000); - } else Breath_Timer -= diff; + BreathTimer = urand(10000, 15000); + } else BreathTimer -= diff; - //ManaStorm_Timer - if (ManaStorm_Timer <= diff) + //ManaStormTimer + if (ManaStormTimer <= diff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_MANASTORM); - ManaStorm_Timer = urand(7500, 12500); - } else ManaStorm_Timer -= diff; + ManaStormTimer = urand(7500, 12500); + } else ManaStormTimer -= diff; - //Reflect_Timer - if (Reflect_Timer <= diff) + //ReflectTimer + if (ReflectTimer <= diff) { DoCast(me, SPELL_REFLECT); - Reflect_Timer = urand(20000, 35000); - } else Reflect_Timer -= diff; + ReflectTimer = urand(20000, 35000); + } else ReflectTimer -= diff; - //Cleave_Timer - if (Cleave_Timer <= diff) + //CleaveTimer + if (CleaveTimer <= diff) { DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 7000; - } else Cleave_Timer -= diff; + CleaveTimer = 7000; + } else CleaveTimer -= diff; - //Enrage_Timer + //EnrageTimer if (HealthBelowPct(26) && !Enraged) { DoCast(me, SPELL_ENRAGE); diff --git a/src/server/scripts/Kalimdor/darkshore.cpp b/src/server/scripts/Kalimdor/darkshore.cpp index 1de04db61c4..0e02a77169e 100644 --- a/src/server/scripts/Kalimdor/darkshore.cpp +++ b/src/server/scripts/Kalimdor/darkshore.cpp @@ -29,7 +29,9 @@ npc_prospector_remtravel npc_threshwackonator EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" #include "ScriptedEscortAI.h" #include "ScriptedFollowerAI.h" @@ -37,7 +39,7 @@ EndContentData */ # npc_kerlonian ####*/ -enum eKerlonian +enum Kerlonian { SAY_KER_START = -1000434, @@ -94,11 +96,11 @@ public: { npc_kerlonianAI(Creature* creature) : FollowerAI(creature) { } - uint32 m_uiFallAsleepTimer; + uint32 FallAsleepTimer; void Reset() { - m_uiFallAsleepTimer = urand(10000, 45000); + FallAsleepTimer = urand(10000, 45000); } void MoveInLineOfSight(Unit* who) @@ -150,7 +152,7 @@ public: SetFollowPaused(false); } - void UpdateFollowerAI(const uint32 uiDiff) + void UpdateFollowerAI(const uint32 Diff) { if (!UpdateVictim()) { @@ -159,13 +161,13 @@ public: if (!HasFollowState(STATE_FOLLOW_PAUSED)) { - if (m_uiFallAsleepTimer <= uiDiff) + if (FallAsleepTimer <= Diff) { SetSleeping(); - m_uiFallAsleepTimer = urand(25000, 90000); + FallAsleepTimer = urand(25000, 90000); } else - m_uiFallAsleepTimer -= uiDiff; + FallAsleepTimer -= Diff; } return; @@ -181,7 +183,7 @@ public: # npc_prospector_remtravel ####*/ -enum eRemtravel +enum Remtravel { SAY_REM_START = -1000327, SAY_REM_AGGRO = -1000328, @@ -233,63 +235,62 @@ public: void WaypointReached(uint32 waypointId) { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) + if (Player* player = GetPlayerForEscort()) { - case 0: - DoScriptText(SAY_REM_START, me, player); - break; - case 5: - DoScriptText(SAY_REM_RAMP1_1, me, player); - break; - case 6: - DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 9: - DoScriptText(SAY_REM_RAMP1_2, me, player); - break; - case 14: - //depend quest rewarded? - DoScriptText(SAY_REM_BOOK, me, player); - break; - case 15: - DoScriptText(SAY_REM_TENT1_1, me, player); - break; - case 16: - DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 17: - DoScriptText(SAY_REM_TENT1_2, me, player); - break; - case 26: - DoScriptText(SAY_REM_MOSS, me, player); - break; - case 27: - DoScriptText(EMOTE_REM_MOSS, me, player); - break; - case 28: - DoScriptText(SAY_REM_MOSS_PROGRESS, me, player); - break; - case 29: - DoSpawnCreature(NPC_GRAVEL_SCOUT, -15.0f, 3.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_BONE, -15.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_GEO, -15.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 31: - DoScriptText(SAY_REM_PROGRESS, me, player); - break; - case 41: - DoScriptText(SAY_REM_REMEMBER, me, player); - break; - case 42: - DoScriptText(EMOTE_REM_END, me, player); - player->GroupEventHappens(QUEST_ABSENT_MINDED_PT2, me); - break; + switch (waypointId) + { + case 0: + DoScriptText(SAY_REM_START, me, player); + break; + case 5: + DoScriptText(SAY_REM_RAMP1_1, me, player); + break; + case 6: + DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 9: + DoScriptText(SAY_REM_RAMP1_2, me, player); + break; + case 14: + //depend quest rewarded? + DoScriptText(SAY_REM_BOOK, me, player); + break; + case 15: + DoScriptText(SAY_REM_TENT1_1, me, player); + break; + case 16: + DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 17: + DoScriptText(SAY_REM_TENT1_2, me, player); + break; + case 26: + DoScriptText(SAY_REM_MOSS, me, player); + break; + case 27: + DoScriptText(EMOTE_REM_MOSS, me, player); + break; + case 28: + DoScriptText(SAY_REM_MOSS_PROGRESS, me, player); + break; + case 29: + DoSpawnCreature(NPC_GRAVEL_SCOUT, -15.0f, 3.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_GRAVEL_BONE, -15.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_GRAVEL_GEO, -15.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 31: + DoScriptText(SAY_REM_PROGRESS, me, player); + break; + case 41: + DoScriptText(SAY_REM_REMEMBER, me, player); + break; + case 42: + DoScriptText(EMOTE_REM_END, me, player); + player->GroupEventHappens(QUEST_ABSENT_MINDED_PT2, me); + break; + } } } @@ -297,7 +298,7 @@ public: void EnterCombat(Unit* who) { - if (rand()%2) + if (urand(0, 1)) DoScriptText(SAY_REM_AGGRO, me, who); } @@ -314,7 +315,7 @@ public: # npc_threshwackonator ####*/ -enum eThreshwackonator +enum Threshwackonator { EMOTE_START = -1000325, //signed for 4966 SAY_AT_CLOSE = -1000326, //signed for 4966 diff --git a/src/server/scripts/Kalimdor/desolace.cpp b/src/server/scripts/Kalimdor/desolace.cpp index f295d7626ac..e196c71f681 100644 --- a/src/server/scripts/Kalimdor/desolace.cpp +++ b/src/server/scripts/Kalimdor/desolace.cpp @@ -30,10 +30,12 @@ npc_dalinda_malem go_demon_portal EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" #include "ScriptedEscortAI.h" -enum eDyingKodo +enum DyingKodo { // signed for 9999 SAY_SMEED_HOME_1 = -1000348, @@ -114,11 +116,11 @@ public: { npc_aged_dying_ancient_kodoAI(Creature* creature) : ScriptedAI(creature) { Reset(); } - uint32 m_uiDespawnTimer; + uint32 DespawnTimer; void Reset() { - m_uiDespawnTimer = 0; + DespawnTimer = 0; } void MoveInLineOfSight(Unit* who) @@ -143,14 +145,14 @@ public: if (pSpell->Id == SPELL_KODO_KOMBO_GOSSIP) { me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - m_uiDespawnTimer = 60000; + DespawnTimer = 60000; } } void UpdateAI(const uint32 diff) { //timer should always be == 0 unless we already updated entry of creature. Then not expect this updated to ever be in combat. - if (m_uiDespawnTimer && m_uiDespawnTimer <= diff) + if (DespawnTimer && DespawnTimer <= diff) { if (!me->getVictim() && me->isAlive()) { @@ -159,7 +161,7 @@ public: me->Respawn(); return; } - } else m_uiDespawnTimer -= diff; + } else DespawnTimer -= diff; if (!UpdateVictim()) return; @@ -175,7 +177,7 @@ public: ## Hand of Iruxos ######*/ -enum +enum Iruxos { QUEST_HAND_IRUXOS = 5381, NPC_DEMON_SPIRIT = 11876, @@ -199,7 +201,10 @@ class go_iruxos : public GameObjectScript ## npc_dalinda_malem. Quest 1440 ######*/ -#define QUEST_RETURN_TO_VAHLARRIEL 1440 +enum Dalinda +{ + QUEST_RETURN_TO_VAHLARRIEL = 1440 +}; class npc_dalinda : public CreatureScript { @@ -255,9 +260,9 @@ public: return; } - void UpdateAI(const uint32 uiDiff) + void UpdateAI(const uint32 Diff) { - npc_escortAI::UpdateAI(uiDiff); + npc_escortAI::UpdateAI(Diff); if (!UpdateVictim()) return; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Kalimdor/durotar.cpp b/src/server/scripts/Kalimdor/durotar.cpp index fe5bedf4c98..ec06a542b6f 100644 --- a/src/server/scripts/Kalimdor/durotar.cpp +++ b/src/server/scripts/Kalimdor/durotar.cpp @@ -15,8 +15,10 @@ * with this program. If not, see . */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "Vehicle.h" +#include "SpellScript.h" /*###### ##Quest 5441: Lazy Peons @@ -50,15 +52,15 @@ public: { npc_lazy_peonAI(Creature* creature) : ScriptedAI(creature) {} - uint64 uiPlayerGUID; + uint64 PlayerGUID; - uint32 m_uiRebuffTimer; + uint32 RebuffTimer; bool work; void Reset() { - uiPlayerGUID = 0; - m_uiRebuffTimer = 0; + PlayerGUID = 0; + RebuffTimer = 0; work = false; } @@ -81,17 +83,17 @@ public: } } - void UpdateAI(const uint32 uiDiff) + void UpdateAI(const uint32 Diff) { if (work == true) me->HandleEmoteCommand(EMOTE_ONESHOT_WORK_CHOPWOOD); - if (m_uiRebuffTimer <= uiDiff) + if (RebuffTimer <= Diff) { DoCast(me, SPELL_BUFF_SLEEP); - m_uiRebuffTimer = 300000; //Rebuff agian in 5 minutes + RebuffTimer = 300000; //Rebuff agian in 5 minutes } else - m_uiRebuffTimer -= uiDiff; + RebuffTimer -= Diff; if (!UpdateVictim()) return; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp index e4ed3793385..45e1c1808c1 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp @@ -32,8 +32,11 @@ npc_private_hendel npc_cassa_crimsonwing - handled by npc_taxi EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "ScriptedEscortAI.h" +#include "ScriptedGossip.h" +#include "SpellScript.h" /*###### ## mobs_risen_husk_spirit @@ -132,7 +135,7 @@ class mobs_risen_husk_spirit : public CreatureScript ## npc_deserter_agitator ######*/ -enum eDeserter +enum Deserter { QUEST_TRAITORS_AMONG_US = 11126, NPC_THERAMORE_DESERTER = 23602, @@ -203,12 +206,12 @@ public: me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); } - void MovementInform(uint32 uiType, uint32 uiId) + void MovementInform(uint32 Type, uint32 Id) { - if (uiType != POINT_MOTION_TYPE) + if (Type != POINT_MOTION_TYPE) return; - if (uiId == 1) + if (Id == 1) me->DisappearAndDie(); } }; @@ -218,7 +221,7 @@ public: ## npc_deserter_agitator ######*/ -enum eTheramoreGuard +enum TheramoreGuard { SAY_QUEST1 = -1000641, SAY_QUEST2 = -1000642, @@ -266,7 +269,7 @@ public: DoScriptText(SAY_QUEST1, creature); creature->CastSpell(creature, SPELL_DOCTORED_LEAFLET, false); creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->uiYellTimer = 4000; + CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->YellTimer = 4000; CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->bYellTimer = true; } @@ -282,40 +285,40 @@ public: { npc_theramore_guardAI(Creature* creature) : ScriptedAI(creature) { } - uint32 uiYellTimer; - uint32 uiStep; + uint32 YellTimer; + uint32 Step; bool bYellTimer; void Reset() { bYellTimer = false; - uiStep = 0; + Step = 0; } - void UpdateAI(const uint32 uiDiff) + void UpdateAI(const uint32 Diff) { if (!me->HasAura(SPELL_PROPAGANDIZED)) me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - if (bYellTimer && uiYellTimer <= uiDiff) + if (bYellTimer && YellTimer <= Diff) { - switch (uiStep) + switch (Step) { case 0: DoScriptText(RAND(SAY_QUEST2, SAY_QUEST3, SAY_QUEST4, SAY_QUEST5, SAY_QUEST6), me); - uiYellTimer = 3000; - ++uiStep; + YellTimer = 3000; + ++Step; break; case 1: DoScriptText(RAND(SAY_QUEST7, SAY_QUEST8, SAY_QUEST9), me); me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); - uiStep = 0; + Step = 0; bYellTimer = false; break; } } else - uiYellTimer -= uiDiff; + YellTimer -= Diff; } }; }; @@ -324,7 +327,7 @@ public: ## npc_lady_jaina_proudmoore ######*/ -enum eLadyJaina +enum LadyJaina { QUEST_JAINAS_AUTOGRAPH = 558, SPELL_JAINAS_AUTOGRAPH = 23122 @@ -367,7 +370,7 @@ public: ## npc_nat_pagle ######*/ -enum eNatPagle +enum NatPagle { QUEST_NATS_MEASURING_TAPE = 8227 }; @@ -408,7 +411,7 @@ public: ## npc_private_hendel ######*/ -enum eHendel +enum Hendel { // looks like all this text ids are wrong. SAY_PROGRESS_1_TER = -1000411, // signed for 3568 @@ -464,11 +467,11 @@ public: AttackStart(pAttacker); } - void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + void DamageTaken(Unit* pDoneBy, uint32 &Damage) { - if (uiDamage > me->GetHealth() || me->HealthBelowPctDamaged(20, uiDamage)) + if (Damage > me->GetHealth() || me->HealthBelowPctDamaged(20, Damage)) { - uiDamage = 0; + Damage = 0; if (Player* player = pDoneBy->GetCharmerOrOwnerPlayerOrPlayerItself()) player->GroupEventHappens(QUEST_MISSING_DIPLO_PT16, me); @@ -485,9 +488,9 @@ public: ## npc_zelfrax ######*/ -const Position MovePosition = {-2967.030f, -3872.1799f, 35.620f, 0.0f}; +Position const MovePosition = {-2967.030f, -3872.1799f, 35.620f, 0.0f}; -enum eZelfrax +enum Zelfrax { SAY_ZELFRAX = -1000472, SAY_ZELFRAX_2 = -1000473 @@ -525,9 +528,9 @@ public: } } - void MovementInform(uint32 uiType, uint32 /*uiId*/) + void MovementInform(uint32 Type, uint32 /*Id*/) { - if (uiType != POINT_MOTION_TYPE) + if (Type != POINT_MOTION_TYPE) return; me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); @@ -547,7 +550,7 @@ public: DoScriptText(SAY_ZELFRAX_2, me); } - void UpdateAI(uint32 const /*uiDiff*/) + void UpdateAI(uint32 const /*Diff*/) { if (!UpdateVictim()) return; @@ -562,7 +565,7 @@ public: ## npc_stinky ######*/ -enum eStinky +enum Stinky { QUEST_STINKYS_ESCAPE_H = 1270, QUEST_STINKYS_ESCAPE_A = 1222, diff --git a/src/server/scripts/Kalimdor/felwood.cpp b/src/server/scripts/Kalimdor/felwood.cpp index e1f59ec26be..9243ea0017e 100644 --- a/src/server/scripts/Kalimdor/felwood.cpp +++ b/src/server/scripts/Kalimdor/felwood.cpp @@ -27,7 +27,9 @@ EndScriptData */ npcs_riverbreeze_and_silversky EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" /*###### ## npcs_riverbreeze_and_silversky @@ -35,6 +37,17 @@ EndContentData */ #define GOSSIP_ITEM_BEACON "Please make me a Cenarion Beacon" +enum RiverbreezeAndSilversky +{ + SPELL_CENARION_BEACON = 15120, + + NPC_ARATHANDRIS_SILVERSKY = 9528, + NPC_MAYBESS_RIVERBREEZE = 9529, + + QUEST_CLEASING_FELWOOD_A = 4101, + QUEST_CLEASING_FELWOOD_H = 4102 +}; + class npcs_riverbreeze_and_silversky : public CreatureScript { public: @@ -46,7 +59,7 @@ public: if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, 15120, false); + creature->CastSpell(player, SPELL_CENARION_BEACON, false); } return true; } @@ -58,9 +71,9 @@ public: uint32 creatureId = creature->GetEntry(); - if (creatureId == 9528) + if (creatureId == NPC_ARATHANDRIS_SILVERSKY) { - if (player->GetQuestRewardStatus(4101)) + if (player->GetQuestRewardStatus(QUEST_CLEASING_FELWOOD_A)) { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(2848, creature->GetGUID()); @@ -70,9 +83,9 @@ public: player->SEND_GOSSIP_MENU(2844, creature->GetGUID()); } - if (creatureId == 9529) + if (creatureId == NPC_MAYBESS_RIVERBREEZE) { - if (player->GetQuestRewardStatus(4102)) + if (player->GetQuestRewardStatus(QUEST_CLEASING_FELWOOD_H)) { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(2849, creature->GetGUID()); diff --git a/src/server/scripts/Kalimdor/feralas.cpp b/src/server/scripts/Kalimdor/feralas.cpp index 480b94d6767..4fcd20951c9 100644 --- a/src/server/scripts/Kalimdor/feralas.cpp +++ b/src/server/scripts/Kalimdor/feralas.cpp @@ -23,8 +23,10 @@ SDComment: Quest support: 3520, 2767, Special vendor Gregan Brewspewer SDCategory: Feralas EndScriptData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "ScriptedEscortAI.h" +#include "ScriptedGossip.h" /*###### ## npc_gregan_brewspewer @@ -68,7 +70,7 @@ public: ## npc_oox22fe ######*/ -enum eOOX +enum OOX { //signed for 7806 SAY_OOX_START = -1000287, diff --git a/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/moonglade.cpp index 08f5b2aa592..9df208d2578 100644 --- a/src/server/scripts/Kalimdor/moonglade.cpp +++ b/src/server/scripts/Kalimdor/moonglade.cpp @@ -31,14 +31,16 @@ npc_clintar_spirit npc_clintar_dreamwalker EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "ScriptedEscortAI.h" +#include "ScriptedGossip.h" /*###### ## npc_bunthen_plainswind ######*/ -enum eBunthen +enum Bunthen { QUEST_SEA_LION_HORDE = 30, QUEST_SEA_LION_ALLY = 272, @@ -218,70 +220,68 @@ public: ## npc_clintar_spirit ######*/ -float Clintar_spirit_WP[41][5] = +float const Clintar_spirit_WP[41][5] = { - //pos_x pos_y pos_z orien waitTime -{7465.28f, -3115.46f, 439.327f, 0.83f, 4000}, -{7476.49f, -3101, 443.457f, 0.89f, 0}, -{7486.57f, -3085.59f, 439.478f, 1.07f, 0}, -{7472.19f, -3085.06f, 443.142f, 3.07f, 0}, -{7456.92f, -3085.91f, 438.862f, 3.24f, 0}, -{7446.68f, -3083.43f, 438.245f, 2.40f, 0}, -{7446.17f, -3080.21f, 439.826f, 1.10f, 6000}, -{7452.41f, -3085.8f, 438.984f, 5.78f, 0}, -{7469.11f, -3084.94f, 443.048f, 6.25f, 0}, -{7483.79f, -3085.44f, 439.607f, 6.25f, 0}, -{7491.14f, -3090.96f, 439.983f, 5.44f, 0}, -{7497.62f, -3098.22f, 436.854f, 5.44f, 0}, -{7498.72f, -3113.41f, 434.596f, 4.84f, 0}, -{7500.06f, -3122.51f, 434.749f, 5.17f, 0}, -{7504.96f, -3131.53f, 434.475f, 4.74f, 0}, -{7504.31f, -3133.53f, 435.693f, 3.84f, 6000}, -{7504.55f, -3133.27f, 435.476f, 0.68f, 15000}, -{7501.99f, -3126.01f, 434.93f, 1.83f, 0}, -{7490.76f, -3114.97f, 434.431f, 2.51f, 0}, -{7479.64f, -3105.51f, 431.123f, 1.83f, 0}, -{7474.63f, -3086.59f, 428.994f, 1.83f, 2000}, -{7472.96f, -3074.18f, 427.566f, 1.57f, 0}, -{7472.25f, -3063, 428.268f, 1.55f, 0}, -{7473.46f, -3054.22f, 427.588f, 0.36f, 0}, -{7475.08f, -3053.6f, 428.653f, 0.36f, 6000}, -{7474.66f, -3053.56f, 428.433f, 3.19f, 4000}, -{7471.81f, -3058.84f, 427.073f, 4.29f, 0}, -{7472.16f, -3064.91f, 427.772f, 4.95f, 0}, -{7471.56f, -3085.36f, 428.924f, 4.72f, 0}, -{7473.56f, -3093.48f, 429.294f, 5.04f, 0}, -{7478.94f, -3104.29f, 430.638f, 5.23f, 0}, -{7484.46f, -3109.61f, 432.769f, 5.79f, 0}, -{7490.23f, -3111.08f, 434.431f, 0.02f, 0}, -{7496.29f, -3108, 434.783f, 1.15f, 0}, -{7497.46f, -3100.66f, 436.191f, 1.50f, 0}, -{7495.64f, -3093.39f, 438.349f, 2.10f, 0}, -{7492.44f, -3086.01f, 440.267f, 1.38f, 0}, -{7498.26f, -3076.44f, 440.808f, 0.71f, 0}, -{7506.4f, -3067.35f, 443.64f, 0.77f, 0}, -{7518.37f, -3057.42f, 445.584f, 0.74f, 0}, -{7517.51f, -3056.3f, 444.568f, 2.49f, 4500} + //pos_x pos_y pos_z orien waitTime + {7465.28f, -3115.46f, 439.327f, 0.83f, 4000}, + {7476.49f, -3101, 443.457f, 0.89f, 0}, + {7486.57f, -3085.59f, 439.478f, 1.07f, 0}, + {7472.19f, -3085.06f, 443.142f, 3.07f, 0}, + {7456.92f, -3085.91f, 438.862f, 3.24f, 0}, + {7446.68f, -3083.43f, 438.245f, 2.40f, 0}, + {7446.17f, -3080.21f, 439.826f, 1.10f, 6000}, + {7452.41f, -3085.8f, 438.984f, 5.78f, 0}, + {7469.11f, -3084.94f, 443.048f, 6.25f, 0}, + {7483.79f, -3085.44f, 439.607f, 6.25f, 0}, + {7491.14f, -3090.96f, 439.983f, 5.44f, 0}, + {7497.62f, -3098.22f, 436.854f, 5.44f, 0}, + {7498.72f, -3113.41f, 434.596f, 4.84f, 0}, + {7500.06f, -3122.51f, 434.749f, 5.17f, 0}, + {7504.96f, -3131.53f, 434.475f, 4.74f, 0}, + {7504.31f, -3133.53f, 435.693f, 3.84f, 6000}, + {7504.55f, -3133.27f, 435.476f, 0.68f, 15000}, + {7501.99f, -3126.01f, 434.93f, 1.83f, 0}, + {7490.76f, -3114.97f, 434.431f, 2.51f, 0}, + {7479.64f, -3105.51f, 431.123f, 1.83f, 0}, + {7474.63f, -3086.59f, 428.994f, 1.83f, 2000}, + {7472.96f, -3074.18f, 427.566f, 1.57f, 0}, + {7472.25f, -3063, 428.268f, 1.55f, 0}, + {7473.46f, -3054.22f, 427.588f, 0.36f, 0}, + {7475.08f, -3053.6f, 428.653f, 0.36f, 6000}, + {7474.66f, -3053.56f, 428.433f, 3.19f, 4000}, + {7471.81f, -3058.84f, 427.073f, 4.29f, 0}, + {7472.16f, -3064.91f, 427.772f, 4.95f, 0}, + {7471.56f, -3085.36f, 428.924f, 4.72f, 0}, + {7473.56f, -3093.48f, 429.294f, 5.04f, 0}, + {7478.94f, -3104.29f, 430.638f, 5.23f, 0}, + {7484.46f, -3109.61f, 432.769f, 5.79f, 0}, + {7490.23f, -3111.08f, 434.431f, 0.02f, 0}, + {7496.29f, -3108, 434.783f, 1.15f, 0}, + {7497.46f, -3100.66f, 436.191f, 1.50f, 0}, + {7495.64f, -3093.39f, 438.349f, 2.10f, 0}, + {7492.44f, -3086.01f, 440.267f, 1.38f, 0}, + {7498.26f, -3076.44f, 440.808f, 0.71f, 0}, + {7506.4f, -3067.35f, 443.64f, 0.77f, 0}, + {7518.37f, -3057.42f, 445.584f, 0.74f, 0}, + {7517.51f, -3056.3f, 444.568f, 2.49f, 4500} }; -#define ASPECT_RAVEN 22915 +Position const AspectRavenSummon = {7472.96f, -3074.18f, 427.566f, 0.0f}; +Position const ClintarSpiritSummon = {7459.2275f, -3122.5632f, 438.9842f, 0.8594f}; -#define ASPECT_RAVEN_SUMMON_X 7472.96f -#define ASPECT_RAVEN_SUMMON_Y -3074.18f -#define ASPECT_RAVEN_SUMMON_Z 427.566f -#define CLINTAR_SPIRIT_SUMMON_X 7459.2275f -#define CLINTAR_SPIRIT_SUMMON_Y -3122.5632f -#define CLINTAR_SPIRIT_SUMMON_Z 438.9842f -#define CLINTAR_SPIRIT_SUMMON_O 0.8594f +enum ClintarSpirit +{ + ASPECT_RAVEN = 22915, -//from -1000292 to -1000287 are signed for 7806. but all this texts ids wrong. -#define CLINTAR_SPIRIT_SAY_START -1000286 -#define CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1 -1000287 -#define CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2 -1000288 -#define CLINTAR_SPIRIT_SAY_GET_ONE -1000289 -#define CLINTAR_SPIRIT_SAY_GET_TWO -1000290 -#define CLINTAR_SPIRIT_SAY_GET_THREE -1000291 -#define CLINTAR_SPIRIT_SAY_GET_FINAL -1000292 + //from -1000292 to -1000287 are signed for 7806. but all this texts ids wrong. + CLINTAR_SPIRIT_SAY_START = -1000286, + CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1 = -1000287, + CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2 = -1000288, + CLINTAR_SPIRIT_SAY_GET_ONE = -1000289, + CLINTAR_SPIRIT_SAY_GET_TWO = -1000290, + CLINTAR_SPIRIT_SAY_GET_THREE = -1000291, + CLINTAR_SPIRIT_SAY_GET_FINAL = -1000292 +}; class npc_clintar_spirit : public CreatureScript { @@ -298,14 +298,14 @@ public: public: npc_clintar_spiritAI(Creature* creature) : npc_escortAI(creature) {} - uint32 Step; + uint8 Step; uint32 CurrWP; - uint32 Event_Timer; - uint32 checkPlayer_Timer; + uint32 EventTimer; + uint32 checkPlayerTimer; uint64 PlayerGUID; - bool Event_onWait; + bool EventOnWait; void Reset() { @@ -313,10 +313,10 @@ public: { Step = 0; CurrWP = 0; - Event_Timer = 0; + EventTimer = 0; PlayerGUID = 0; - checkPlayer_Timer = 1000; - Event_onWait = false; + checkPlayerTimer = 1000; + EventOnWait = false; } } @@ -347,8 +347,7 @@ public: void EnterCombat(Unit* who) { - uint32 rnd = rand()%2; - switch (rnd) + switch (urand(0, 1)) { case 0: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1, me, who); break; case 1: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2, me, who); break; @@ -357,9 +356,7 @@ public: void StartEvent(Player* player) { - if (!player) - return; - if (player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) + if (player && player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) { for (uint8 i = 0; i < 41; ++i) { @@ -381,18 +378,18 @@ public: return; } - if (!me->isInCombat() && !Event_onWait) + if (!me->isInCombat() && !EventOnWait) { - if (checkPlayer_Timer <= diff) + if (checkPlayerTimer <= diff) { Player* player = Unit::GetPlayer(*me, PlayerGUID); if (player && player->isInCombat() && player->getAttackerForHelper()) AttackStart(player->getAttackerForHelper()); - checkPlayer_Timer = 1000; - } else checkPlayer_Timer -= diff; + checkPlayerTimer = 1000; + } else checkPlayerTimer -= diff; } - if (Event_onWait && Event_Timer <= diff) + if (EventOnWait && EventTimer <= diff) { Player* player = Unit::GetPlayer(*me, PlayerGUID); @@ -409,11 +406,11 @@ public: { case 0: me->Say(CLINTAR_SPIRIT_SAY_START, 0, PlayerGUID); - Event_Timer = 8000; + EventTimer = 8000; Step = 1; break; case 1: - Event_onWait = false; + EventOnWait = false; break; } break; @@ -422,13 +419,13 @@ public: { case 0: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); - Event_Timer = 5000; + EventTimer = 5000; Step = 1; break; case 1: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); DoScriptText(CLINTAR_SPIRIT_SAY_GET_ONE, me, player); - Event_onWait = false; + EventOnWait = false; break; } break; @@ -437,12 +434,12 @@ public: { case 0: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); - Event_Timer = 5000; + EventTimer = 5000; Step = 1; break; case 1: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - Event_onWait = false; + EventOnWait = false; break; } break; @@ -451,11 +448,11 @@ public: { case 0: DoScriptText(CLINTAR_SPIRIT_SAY_GET_TWO, me, player); - Event_Timer = 15000; + EventTimer = 15000; Step = 1; break; case 1: - Event_onWait = false; + EventOnWait = false; break; } break; @@ -463,19 +460,16 @@ public: switch (Step) { case 0: - { - Creature* mob = me->SummonCreature(ASPECT_RAVEN, ASPECT_RAVEN_SUMMON_X, ASPECT_RAVEN_SUMMON_Y, ASPECT_RAVEN_SUMMON_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000); - if (mob) + if (Creature* mob = me->SummonCreature(ASPECT_RAVEN, AspectRavenSummon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000)) { mob->AddThreat(me, 10000.0f); mob->AI()->AttackStart(me); } - Event_Timer = 2000; + EventTimer = 2000; Step = 1; break; - } case 1: - Event_onWait = false; + EventOnWait = false; break; } break; @@ -484,12 +478,12 @@ public: { case 0: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); - Event_Timer = 5000; + EventTimer = 5000; Step = 1; break; case 1: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - Event_onWait = false; + EventOnWait = false; break; } break; @@ -498,11 +492,11 @@ public: { case 0: DoScriptText(CLINTAR_SPIRIT_SAY_GET_THREE, me, player); - Event_Timer = 4000; + EventTimer = 4000; Step = 1; break; case 1: - Event_onWait = false; + EventOnWait = false; break; } break; @@ -513,12 +507,12 @@ public: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 2); DoScriptText(CLINTAR_SPIRIT_SAY_GET_FINAL, me, player); player->CompleteQuest(10965); - Event_Timer = 1500; + EventTimer = 1500; Step = 1; break; case 1: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - Event_Timer = 3000; + EventTimer = 3000; Step = 2; break; case 2: @@ -530,19 +524,19 @@ public: } break; default: - Event_onWait = false; + EventOnWait = false; break; } - } else if (Event_onWait) Event_Timer -= diff; + } else if (EventOnWait) EventTimer -= diff; } void WaypointReached(uint32 waypointId) { CurrWP = waypointId; - Event_Timer = 0; + EventTimer = 0; Step = 0; - Event_onWait = true; + EventOnWait = true; } }; @@ -552,7 +546,10 @@ public: # npc_clintar_dreamwalker ####*/ -#define CLINTAR_SPIRIT 22916 +enum Clintar +{ + CLINTAR_SPIRIT = 22916 +}; class npc_clintar_dreamwalker : public CreatureScript { @@ -562,11 +559,8 @@ public: bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) { if (quest->GetQuestId() == 10965) - { - Creature* clintar_spirit = creature->SummonCreature(CLINTAR_SPIRIT, CLINTAR_SPIRIT_SUMMON_X, CLINTAR_SPIRIT_SUMMON_Y, CLINTAR_SPIRIT_SUMMON_Z, CLINTAR_SPIRIT_SUMMON_O, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 100000); - if (clintar_spirit) + if (Creature* clintar_spirit = creature->SummonCreature(CLINTAR_SPIRIT, ClintarSpiritSummon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 100000)) CAST_AI(npc_clintar_spirit::npc_clintar_spiritAI, clintar_spirit->AI())->StartEvent(player); - } return true; } diff --git a/src/server/scripts/Kalimdor/mulgore.cpp b/src/server/scripts/Kalimdor/mulgore.cpp index bd4cf55b7b2..5b35688c2b8 100644 --- a/src/server/scripts/Kalimdor/mulgore.cpp +++ b/src/server/scripts/Kalimdor/mulgore.cpp @@ -29,8 +29,9 @@ npc_kyle_frenzied npc_plains_vision EndContentData */ -#include "ScriptPCH.h" -#include "ScriptedEscortAI.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" /*###### # npc_skorn_whitecloud @@ -71,7 +72,7 @@ public: # npc_kyle_frenzied ######*/ -enum eKyleFrenzied +enum KyleFrenzied { //emote signed for 7780 but propably thats wrong id. EMOTE_SEE_LUNCH = -1000340, @@ -98,30 +99,30 @@ public: { npc_kyle_frenziedAI(Creature* creature) : ScriptedAI(creature) {} - bool bEvent; - bool m_bIsMovingToLunch; - uint64 uiPlayerGUID; - uint32 uiEventTimer; - uint8 uiEventPhase; + bool EventActive; + bool IsMovingToLunch; + uint64 PlayerGUID; + uint32 EventTimer; + uint8 EventPhase; void Reset() { - bEvent = false; - m_bIsMovingToLunch = false; - uiPlayerGUID = 0; - uiEventTimer = 5000; - uiEventPhase = 0; + EventActive = false; + IsMovingToLunch = false; + PlayerGUID = 0; + EventTimer = 5000; + EventPhase = 0; if (me->GetEntry() == NPC_KYLE_FRIENDLY) me->UpdateEntry(NPC_KYLE_FRENZIED); } - void SpellHit(Unit* pCaster, SpellInfo const* pSpell) + void SpellHit(Unit* Caster, SpellInfo const* Spell) { - if (!me->getVictim() && !bEvent && pSpell->Id == SPELL_LUNCH) + if (!me->getVictim() && !EventActive && Spell->Id == SPELL_LUNCH) { - if (pCaster->GetTypeId() == TYPEID_PLAYER) - uiPlayerGUID = pCaster->GetGUID(); + if (Caster->GetTypeId() == TYPEID_PLAYER) + PlayerGUID = Caster->GetGUID(); if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) { @@ -130,41 +131,41 @@ public: me->StopMoving(); } - bEvent = true; + EventActive = true; DoScriptText(EMOTE_SEE_LUNCH, me); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_CREATURE_SPECIAL); } } - void MovementInform(uint32 uiType, uint32 uiPointId) + void MovementInform(uint32 Type, uint32 PointId) { - if (uiType != POINT_MOTION_TYPE || !bEvent) + if (Type != POINT_MOTION_TYPE || !EventActive) return; - if (uiPointId == POINT_ID) - m_bIsMovingToLunch = false; + if (PointId == POINT_ID) + IsMovingToLunch = false; } void UpdateAI(const uint32 diff) { - if (bEvent) + if (EventActive) { - if (m_bIsMovingToLunch) + if (IsMovingToLunch) return; - if (uiEventTimer <= diff) + if (EventTimer <= diff) { - uiEventTimer = 5000; - ++uiEventPhase; + EventTimer = 5000; + ++EventPhase; - switch (uiEventPhase) + switch (EventPhase) { case 1: - if (Unit* unit = Unit::GetUnit(*me, uiPlayerGUID)) + if (Unit* unit = Unit::GetUnit(*me, PlayerGUID)) { if (GameObject* go = unit->GetGameObject(SPELL_LUNCH)) { - m_bIsMovingToLunch = true; + IsMovingToLunch = true; me->GetMotionMaster()->MovePoint(POINT_ID, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ()); } } @@ -174,13 +175,13 @@ public: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING); break; case 3: - if (Player* unit = Unit::GetPlayer(*me, uiPlayerGUID)) + if (Player* unit = Unit::GetPlayer(*me, PlayerGUID)) unit->TalkedToCreature(me->GetEntry(), me->GetGUID()); me->UpdateEntry(NPC_KYLE_FRIENDLY); break; case 4: - uiEventTimer = 30000; + EventTimer = 30000; DoScriptText(EMOTE_DANCE, me); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DANCESPECIAL); break; @@ -192,7 +193,7 @@ public: } } else - uiEventTimer -= diff; + EventTimer -= diff; } } }; @@ -203,58 +204,58 @@ public: # npc_plains_vision ######*/ -float wp_plain_vision[50][3] = +Position const wpPlainVision[50] = { - {-2226.32f, -408.095f, -9.36235f}, - {-2203.04f, -437.212f, -5.72498f}, - {-2163.91f, -457.851f, -7.09049f}, - {-2123.87f, -448.137f, -9.29591f}, - {-2104.66f, -427.166f, -6.49513f}, - {-2101.48f, -422.826f, -5.3567f}, - {-2097.56f, -417.083f, -7.16716f}, - {-2084.87f, -398.626f, -9.88973f}, - {-2072.71f, -382.324f, -10.2488f}, - {-2054.05f, -356.728f, -6.22468f}, - {-2051.8f, -353.645f, -5.35791f}, - {-2049.08f, -349.912f, -6.15723f}, - {-2030.6f, -310.724f, -9.59302f}, - {-2002.15f, -249.308f, -10.8124f}, - {-1972.85f, -195.811f, -10.6316f}, - {-1940.93f, -147.652f, -11.7055f}, - {-1888.06f, -81.943f, -11.4404f}, - {-1837.05f, -34.0109f, -12.258f}, - {-1796.12f, -14.6462f, -10.3581f}, - {-1732.61f, -4.27746f, -10.0213f}, - {-1688.94f, -0.829945f, -11.7103f}, - {-1681.32f, 13.0313f, -9.48056f}, - {-1677.04f, 36.8349f, -7.10318f}, - {-1675.2f, 68.559f, -8.95384f}, - {-1676.57f, 89.023f, -9.65104f}, - {-1678.16f, 110.939f, -10.1782f}, - {-1677.86f, 128.681f, -5.73869f}, - {-1675.27f, 144.324f, -3.47916f}, - {-1671.7f, 163.169f, -1.23098f}, - {-1666.61f, 181.584f, 5.26145f}, - {-1661.51f, 196.154f, 8.95252f}, - {-1655.47f, 210.811f, 8.38727f}, - {-1647.07f, 226.947f, 5.27755f}, - {-1621.65f, 232.91f, 2.69579f}, - {-1600.23f, 237.641f, 2.98539f}, - {-1576.07f, 242.546f, 4.66541f}, - {-1554.57f, 248.494f, 6.60377f}, - {-1547.53f, 259.302f, 10.6741f}, - {-1541.7f, 269.847f, 16.4418f}, - {-1539.83f, 278.989f, 21.0597f}, - {-1540.16f, 290.219f, 27.8247f}, - {-1538.99f, 298.983f, 34.0032f}, - {-1540.38f, 307.337f, 41.3557f}, - {-1536.61f, 314.884f, 48.0179f}, - {-1532.42f, 323.277f, 55.6667f}, - {-1528.77f, 329.774f, 61.1525f}, - {-1525.65f, 333.18f, 63.2161f}, - {-1517.01f, 350.713f, 62.4286f}, - {-1511.39f, 362.537f, 62.4539f}, - {-1508.68f, 366.822f, 62.733f} + {-2226.32f, -408.095f, -9.36235f, 0.0f}, + {-2203.04f, -437.212f, -5.72498f, 0.0f}, + {-2163.91f, -457.851f, -7.09049f, 0.0f}, + {-2123.87f, -448.137f, -9.29591f, 0.0f}, + {-2104.66f, -427.166f, -6.49513f, 0.0f}, + {-2101.48f, -422.826f, -5.3567f, 0.0f}, + {-2097.56f, -417.083f, -7.16716f, 0.0f}, + {-2084.87f, -398.626f, -9.88973f, 0.0f}, + {-2072.71f, -382.324f, -10.2488f, 0.0f}, + {-2054.05f, -356.728f, -6.22468f, 0.0f}, + {-2051.8f, -353.645f, -5.35791f, 0.0f}, + {-2049.08f, -349.912f, -6.15723f, 0.0f}, + {-2030.6f, -310.724f, -9.59302f, 0.0f}, + {-2002.15f, -249.308f, -10.8124f, 0.0f}, + {-1972.85f, -195.811f, -10.6316f, 0.0f}, + {-1940.93f, -147.652f, -11.7055f, 0.0f}, + {-1888.06f, -81.943f, -11.4404f, 0.0f}, + {-1837.05f, -34.0109f, -12.258f, 0.0f}, + {-1796.12f, -14.6462f, -10.3581f, 0.0f}, + {-1732.61f, -4.27746f, -10.0213f, 0.0f}, + {-1688.94f, -0.829945f, -11.7103f, 0.0f}, + {-1681.32f, 13.0313f, -9.48056f, 0.0f}, + {-1677.04f, 36.8349f, -7.10318f, 0.0f}, + {-1675.2f, 68.559f, -8.95384f, 0.0f}, + {-1676.57f, 89.023f, -9.65104f, 0.0f}, + {-1678.16f, 110.939f, -10.1782f, 0.0f}, + {-1677.86f, 128.681f, -5.73869f, 0.0f}, + {-1675.27f, 144.324f, -3.47916f, 0.0f}, + {-1671.7f, 163.169f, -1.23098f, 0.0f}, + {-1666.61f, 181.584f, 5.26145f, 0.0f}, + {-1661.51f, 196.154f, 8.95252f, 0.0f}, + {-1655.47f, 210.811f, 8.38727f, 0.0f}, + {-1647.07f, 226.947f, 5.27755f, 0.0f}, + {-1621.65f, 232.91f, 2.69579f, 0.0f}, + {-1600.23f, 237.641f, 2.98539f, 0.0f}, + {-1576.07f, 242.546f, 4.66541f, 0.0f}, + {-1554.57f, 248.494f, 6.60377f, 0.0f}, + {-1547.53f, 259.302f, 10.6741f, 0.0f}, + {-1541.7f, 269.847f, 16.4418f, 0.0f}, + {-1539.83f, 278.989f, 21.0597f, 0.0f}, + {-1540.16f, 290.219f, 27.8247f, 0.0f}, + {-1538.99f, 298.983f, 34.0032f, 0.0f}, + {-1540.38f, 307.337f, 41.3557f, 0.0f}, + {-1536.61f, 314.884f, 48.0179f, 0.0f}, + {-1532.42f, 323.277f, 55.6667f, 0.0f}, + {-1528.77f, 329.774f, 61.1525f, 0.0f}, + {-1525.65f, 333.18f, 63.2161f, 0.0f}, + {-1517.01f, 350.713f, 62.4286f, 0.0f}, + {-1511.39f, 362.537f, 62.4539f, 0.0f}, + {-1508.68f, 366.822f, 62.733f, 0.0f} }; class npc_plains_vision : public CreatureScript @@ -305,7 +306,7 @@ public: { if (newWaypoint) { - me->GetMotionMaster()->MovePoint(WayPointId, wp_plain_vision[WayPointId][0], wp_plain_vision[WayPointId][1], wp_plain_vision[WayPointId][2]); + me->GetMotionMaster()->MovePoint(WayPointId, wpPlainVision[WayPointId]); newWaypoint = false; } } diff --git a/src/server/scripts/Kalimdor/orgrimmar.cpp b/src/server/scripts/Kalimdor/orgrimmar.cpp index 2ff2d28768a..fca8d0f5fc5 100644 --- a/src/server/scripts/Kalimdor/orgrimmar.cpp +++ b/src/server/scripts/Kalimdor/orgrimmar.cpp @@ -28,13 +28,15 @@ npc_shenthul npc_thrall_warchief EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" /*###### ## npc_shenthul ######*/ -enum eShenthul +enum Shenthul { QUEST_SHATTERED_SALUTE = 2460 }; @@ -65,16 +67,16 @@ public: bool CanTalk; bool CanEmote; - uint32 Salute_Timer; - uint32 Reset_Timer; + uint32 SaluteTimer; + uint32 ResetTimer; uint64 PlayerGUID; void Reset() { CanTalk = false; CanEmote = false; - Salute_Timer = 6000; - Reset_Timer = 0; + SaluteTimer = 6000; + ResetTimer = 0; PlayerGUID = 0; } @@ -84,7 +86,7 @@ public: { if (CanEmote) { - if (Reset_Timer <= diff) + if (ResetTimer <= diff) { if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) { @@ -92,17 +94,17 @@ public: player->FailQuest(QUEST_SHATTERED_SALUTE); } Reset(); - } else Reset_Timer -= diff; + } else ResetTimer -= diff; } if (CanTalk && !CanEmote) { - if (Salute_Timer <= diff) + if (SaluteTimer <= diff) { me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); CanEmote = true; - Reset_Timer = 60000; - } else Salute_Timer -= diff; + ResetTimer = 60000; + } else SaluteTimer -= diff; } if (!UpdateVictim()) @@ -130,10 +132,13 @@ public: ## npc_thrall_warchief ######*/ -#define QUEST_6566 6566 +enum ThrallWarchief +{ + QUEST_6566 = 6566, -#define SPELL_CHAIN_LIGHTNING 16033 -#define SPELL_SHOCK 16034 + SPELL_CHAIN_LIGHTNING = 16033, + SPELL_SHOCK = 16034 +}; #define GOSSIP_HTW "Please share your wisdom with me, Warchief." #define GOSSIP_STW1 "What discoveries?" @@ -207,13 +212,13 @@ public: { npc_thrall_warchiefAI(Creature* creature) : ScriptedAI(creature) {} - uint32 ChainLightning_Timer; - uint32 Shock_Timer; + uint32 ChainLightningTimer; + uint32 ShockTimer; void Reset() { - ChainLightning_Timer = 2000; - Shock_Timer = 8000; + ChainLightningTimer = 2000; + ShockTimer = 8000; } void EnterCombat(Unit* /*who*/) {} @@ -223,17 +228,17 @@ public: if (!UpdateVictim()) return; - if (ChainLightning_Timer <= diff) + if (ChainLightningTimer <= diff) { DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING); - ChainLightning_Timer = 9000; - } else ChainLightning_Timer -= diff; + ChainLightningTimer = 9000; + } else ChainLightningTimer -= diff; - if (Shock_Timer <= diff) + if (ShockTimer <= diff) { DoCast(me->getVictim(), SPELL_SHOCK); - Shock_Timer = 15000; - } else Shock_Timer -= diff; + ShockTimer = 15000; + } else ShockTimer -= diff; DoMeleeAttackIfReady(); } diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp index 2d91f32fe9d..639de3dc3b2 100644 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ b/src/server/scripts/Kalimdor/silithus.cpp @@ -29,7 +29,9 @@ npcs_rutgar_and_frankal quest_a_pawn_on_the_eternal_pawn EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" #include "Group.h" /*### @@ -125,9 +127,11 @@ public: #define GOSSIP_ITEM14 "I should ask the monkey about this" #define GOSSIP_ITEM15 "Then what..." -//trigger creatures to kill -#define TRIGGER_RUTGAR 15222 -#define TRIGGER_FRANKAL 15221 +enum RutgarAndFrankal //trigger creatures to kill +{ + TRIGGER_FRANKAL = 15221, + TRIGGER_RUTGAR = 15222 +}; class npcs_rutgar_and_frankal : public CreatureScript { @@ -223,7 +227,7 @@ public: /*#### # quest_a_pawn_on_the_eternal_board (Defines) ####*/ -enum eEternalBoard +enum EternalBoard { QUEST_A_PAWN_ON_THE_ETERNAL_BOARD = 8519, @@ -290,7 +294,6 @@ TO DO: get correct spell IDs and timings for spells cast upon dragon transformat TO DO: Dragons should use the HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF) after transformation, but for some unknown reason it doesnt work. EndContentData */ -#define QUEST_A_PAWN_ON_THE_ETERNAL_BOARD 8519 #define EVENT_AREA_RADIUS 65 //65yds #define EVENT_COOLDOWN 500000 //in ms. appear after event completed or failed (should be = Adds despawn time) @@ -373,13 +376,8 @@ static QuestCinematic EventAnim[]= {0, 0, 0} }; -struct Location -{ - float x, y, z, o; -}; - //Cordinates for Spawns -static Location SpawnLocation[]= +Position const SpawnLocation[] = { {-8085.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry {-8080.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry @@ -460,7 +458,7 @@ struct WaveData int32 WaveTextId; }; -static WaveData WavesInfo[] = +static WaveData WavesInfo[5] = { {30, 0, 15423, 0, 0, 24000, 0}, // Kaldorei Soldier { 3, 35, 15424, 0, 0, 24000, 0}, // Anubisath Conqueror @@ -475,7 +473,7 @@ struct SpawnSpells uint32 Timer1, Timer2, SpellId; }; -static SpawnSpells SpawnCast[]=// +static SpawnSpells SpawnCast[4] = { {100000, 2000, 33652}, // Stop Time {38500, 300000, 28528}, // Poison Cloud @@ -977,13 +975,9 @@ public: for (uint8 i = locIndex; i <= count; ++i) { - float x = SpawnLocation[i].x; - float y = SpawnLocation[i].y; - float z = SpawnLocation[i].z; - float o = SpawnLocation[i].o; uint32 desptimer = WavesInfo[WaveCount].DespTimer; - if (Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, x, y, z, o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer)) + if (Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, SpawnLocation[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer)) { if (spawn->GetEntry() == 15423) spawn->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15427+rand()%4); diff --git a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp index 635bb50509e..d38395c7b37 100644 --- a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp +++ b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp @@ -28,7 +28,9 @@ npc_braug_dimspirit npc_kaya_flathoof EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" #include "ScriptedEscortAI.h" /*###### @@ -90,7 +92,7 @@ public: ## npc_kaya_flathoof ######*/ -enum eKaya +enum Kaya { FACTION_ESCORTEE_H = 775, diff --git a/src/server/scripts/Kalimdor/tanaris.cpp b/src/server/scripts/Kalimdor/tanaris.cpp index da0e0e738cf..9b742b495bb 100644 --- a/src/server/scripts/Kalimdor/tanaris.cpp +++ b/src/server/scripts/Kalimdor/tanaris.cpp @@ -33,7 +33,9 @@ npc_OOX17 npc_tooga EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" #include "ScriptedEscortAI.h" #include "ScriptedFollowerAI.h" @@ -41,10 +43,13 @@ EndContentData */ ## mob_aquementas ######*/ -#define AGGRO_YELL_AQUE -1000350 +enum Aquementas +{ + AGGRO_YELL_AQUE = -1000350, -#define SPELL_AQUA_JET 13586 -#define SPELL_FROST_SHOCK 15089 + SPELL_AQUA_JET = 13586, + SPELL_FROST_SHOCK = 15089 +}; class mob_aquementas : public CreatureScript { @@ -60,22 +65,22 @@ public: { mob_aquementasAI(Creature* creature) : ScriptedAI(creature) {} - uint32 SendItem_Timer; - uint32 SwitchFaction_Timer; + uint32 SendItemTimer; + uint32 SwitchFactionTimer; bool isFriendly; - uint32 FrostShock_Timer; - uint32 AquaJet_Timer; + uint32 FrostShockTimer; + uint32 AquaJetTimer; void Reset() { - SendItem_Timer = 0; - SwitchFaction_Timer = 10000; + SendItemTimer = 0; + SwitchFactionTimer = 10000; me->setFaction(35); isFriendly = true; - AquaJet_Timer = 5000; - FrostShock_Timer = 1000; + AquaJetTimer = 5000; + FrostShockTimer = 1000; } void SendItem(Unit* receiver) @@ -101,11 +106,11 @@ public: { if (isFriendly) { - if (SwitchFaction_Timer <= diff) + if (SwitchFactionTimer <= diff) { me->setFaction(91); isFriendly = false; - } else SwitchFaction_Timer -= diff; + } else SwitchFactionTimer -= diff; } if (!UpdateVictim()) @@ -113,25 +118,25 @@ public: if (!isFriendly) { - if (SendItem_Timer <= diff) + if (SendItemTimer <= diff) { if (me->getVictim()->GetTypeId() == TYPEID_PLAYER) SendItem(me->getVictim()); - SendItem_Timer = 5000; - } else SendItem_Timer -= diff; + SendItemTimer = 5000; + } else SendItemTimer -= diff; } - if (FrostShock_Timer <= diff) + if (FrostShockTimer <= diff) { DoCast(me->getVictim(), SPELL_FROST_SHOCK); - FrostShock_Timer = 15000; - } else FrostShock_Timer -= diff; + FrostShockTimer = 15000; + } else FrostShockTimer -= diff; - if (AquaJet_Timer <= diff) + if (AquaJetTimer <= diff) { DoCast(me, SPELL_AQUA_JET); - AquaJet_Timer = 15000; - } else AquaJet_Timer -= diff; + AquaJetTimer = 15000; + } else AquaJetTimer -= diff; DoMeleeAttackIfReady(); } @@ -143,20 +148,23 @@ public: ## npc_custodian_of_time ######*/ -#define WHISPER_CUSTODIAN_1 -1000217 -#define WHISPER_CUSTODIAN_2 -1000218 -#define WHISPER_CUSTODIAN_3 -1000219 -#define WHISPER_CUSTODIAN_4 -1000220 -#define WHISPER_CUSTODIAN_5 -1000221 -#define WHISPER_CUSTODIAN_6 -1000222 -#define WHISPER_CUSTODIAN_7 -1000223 -#define WHISPER_CUSTODIAN_8 -1000224 -#define WHISPER_CUSTODIAN_9 -1000225 -#define WHISPER_CUSTODIAN_10 -1000226 -#define WHISPER_CUSTODIAN_11 -1000227 -#define WHISPER_CUSTODIAN_12 -1000228 -#define WHISPER_CUSTODIAN_13 -1000229 -#define WHISPER_CUSTODIAN_14 -1000230 +enum CustodianOfTime +{ + WHISPER_CUSTODIAN_1 = -1000217, + WHISPER_CUSTODIAN_2 = -1000218, + WHISPER_CUSTODIAN_3 = -1000219, + WHISPER_CUSTODIAN_4 = -1000220, + WHISPER_CUSTODIAN_5 = -1000221, + WHISPER_CUSTODIAN_6 = -1000222, + WHISPER_CUSTODIAN_7 = -1000223, + WHISPER_CUSTODIAN_8 = -1000224, + WHISPER_CUSTODIAN_9 = -1000225, + WHISPER_CUSTODIAN_10 = -1000226, + WHISPER_CUSTODIAN_11 = -1000227, + WHISPER_CUSTODIAN_12 = -1000228, + WHISPER_CUSTODIAN_13 = -1000229, + WHISPER_CUSTODIAN_14 = -1000230 +}; class npc_custodian_of_time : public CreatureScript { @@ -174,69 +182,68 @@ public: void WaypointReached(uint32 waypointId) { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) + if (Player* player = GetPlayerForEscort()) { - case 0: - DoScriptText(WHISPER_CUSTODIAN_1, me, player); - break; - case 1: - DoScriptText(WHISPER_CUSTODIAN_2, me, player); - break; - case 2: - DoScriptText(WHISPER_CUSTODIAN_3, me, player); - break; - case 3: - DoScriptText(WHISPER_CUSTODIAN_4, me, player); - break; - case 5: - DoScriptText(WHISPER_CUSTODIAN_5, me, player); - break; - case 6: - DoScriptText(WHISPER_CUSTODIAN_6, me, player); - break; - case 7: - DoScriptText(WHISPER_CUSTODIAN_7, me, player); - break; - case 8: - DoScriptText(WHISPER_CUSTODIAN_8, me, player); - break; - case 9: - DoScriptText(WHISPER_CUSTODIAN_9, me, player); - break; - case 10: - DoScriptText(WHISPER_CUSTODIAN_4, me, player); - break; - case 13: - DoScriptText(WHISPER_CUSTODIAN_10, me, player); - break; - case 14: - DoScriptText(WHISPER_CUSTODIAN_4, me, player); - break; - case 16: - DoScriptText(WHISPER_CUSTODIAN_11, me, player); - break; - case 17: - DoScriptText(WHISPER_CUSTODIAN_12, me, player); - break; - case 18: - DoScriptText(WHISPER_CUSTODIAN_4, me, player); - break; - case 22: - DoScriptText(WHISPER_CUSTODIAN_13, me, player); - break; - case 23: - DoScriptText(WHISPER_CUSTODIAN_4, me, player); - break; - case 24: - DoScriptText(WHISPER_CUSTODIAN_14, me, player); - DoCast(player, 34883); - // below here is temporary workaround, to be removed when spell works properly - player->AreaExploredOrEventHappens(10277); - break; + switch (waypointId) + { + case 0: + DoScriptText(WHISPER_CUSTODIAN_1, me, player); + break; + case 1: + DoScriptText(WHISPER_CUSTODIAN_2, me, player); + break; + case 2: + DoScriptText(WHISPER_CUSTODIAN_3, me, player); + break; + case 3: + DoScriptText(WHISPER_CUSTODIAN_4, me, player); + break; + case 5: + DoScriptText(WHISPER_CUSTODIAN_5, me, player); + break; + case 6: + DoScriptText(WHISPER_CUSTODIAN_6, me, player); + break; + case 7: + DoScriptText(WHISPER_CUSTODIAN_7, me, player); + break; + case 8: + DoScriptText(WHISPER_CUSTODIAN_8, me, player); + break; + case 9: + DoScriptText(WHISPER_CUSTODIAN_9, me, player); + break; + case 10: + DoScriptText(WHISPER_CUSTODIAN_4, me, player); + break; + case 13: + DoScriptText(WHISPER_CUSTODIAN_10, me, player); + break; + case 14: + DoScriptText(WHISPER_CUSTODIAN_4, me, player); + break; + case 16: + DoScriptText(WHISPER_CUSTODIAN_11, me, player); + break; + case 17: + DoScriptText(WHISPER_CUSTODIAN_12, me, player); + break; + case 18: + DoScriptText(WHISPER_CUSTODIAN_4, me, player); + break; + case 22: + DoScriptText(WHISPER_CUSTODIAN_13, me, player); + break; + case 23: + DoScriptText(WHISPER_CUSTODIAN_4, me, player); + break; + case 24: + DoScriptText(WHISPER_CUSTODIAN_14, me, player); + DoCast(player, 34883); + // below here is temporary workaround, to be removed when spell works properly + player->AreaExploredOrEventHappens(10277); + break; + } } } @@ -259,7 +266,7 @@ public: } void EnterCombat(Unit* /*who*/) {} - void Reset() { } + void Reset() {} void UpdateAI(const uint32 diff) { @@ -416,7 +423,7 @@ public: ## npc_OOX17 ######*/ -enum e00X17 +enum Npc00X17 { //texts are signed for 7806 SAY_OOX_START = -1000287, @@ -464,30 +471,29 @@ public: void WaypointReached(uint32 waypointId) { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) + if (Player* player = GetPlayerForEscort()) { - case 23: - me->SummonCreature(SPAWN_FIRST, -8350.96f, -4445.79f, 10.10f, 6.20f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - me->SummonCreature(SPAWN_FIRST, -8355.96f, -4447.79f, 10.10f, 6.27f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - me->SummonCreature(SPAWN_FIRST, -8353.96f, -4442.79f, 10.10f, 6.08f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_OOX_AMBUSH, me); - break; - case 56: - me->SummonCreature(SPAWN_SECOND_1, -7510.07f, -4795.50f, 9.35f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - me->SummonCreature(SPAWN_SECOND_2, -7515.07f, -4797.50f, 9.35f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - me->SummonCreature(SPAWN_SECOND_2, -7518.07f, -4792.50f, 9.35f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_OOX_AMBUSH, me); - if (Unit* scoff = me->FindNearestCreature(SPAWN_SECOND_2, 30)) - DoScriptText(SAY_OOX17_AMBUSH_REPLY, scoff); - break; - case 86: - DoScriptText(SAY_OOX_END, me); - player->GroupEventHappens(Q_OOX17, me); - break; + switch (waypointId) + { + case 23: + me->SummonCreature(SPAWN_FIRST, -8350.96f, -4445.79f, 10.10f, 6.20f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(SPAWN_FIRST, -8355.96f, -4447.79f, 10.10f, 6.27f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(SPAWN_FIRST, -8353.96f, -4442.79f, 10.10f, 6.08f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + DoScriptText(SAY_OOX_AMBUSH, me); + break; + case 56: + me->SummonCreature(SPAWN_SECOND_1, -7510.07f, -4795.50f, 9.35f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(SPAWN_SECOND_2, -7515.07f, -4797.50f, 9.35f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(SPAWN_SECOND_2, -7518.07f, -4792.50f, 9.35f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + DoScriptText(SAY_OOX_AMBUSH, me); + if (Unit* scoff = me->FindNearestCreature(SPAWN_SECOND_2, 30)) + DoScriptText(SAY_OOX17_AMBUSH_REPLY, scoff); + break; + case 86: + DoScriptText(SAY_OOX_END, me); + player->GroupEventHappens(Q_OOX17, me); + break; + } } } @@ -509,7 +515,7 @@ public: # npc_tooga ####*/ -enum eTooga +enum Tooga { SAY_TOOG_THIRST = -1000391, SAY_TOOG_WORRIED = -1000392, @@ -527,7 +533,7 @@ enum eTooga FACTION_TOOG_ESCORTEE = 113 }; -const float m_afToWaterLoc[] = {-7032.664551f, -4906.199219f, -1.606446f}; +Position const ToWaterLoc = {-7032.664551f, -4906.199219f, -1.606446f, 0.0f}; class npc_tooga : public CreatureScript { @@ -554,17 +560,17 @@ public: { npc_toogaAI(Creature* creature) : FollowerAI(creature) { } - uint32 m_uiCheckSpeechTimer; - uint32 m_uiPostEventTimer; - uint32 m_uiPhasePostEvent; + uint32 CheckSpeechTimer; + uint32 PostEventTimer; + uint32 PhasePostEvent; uint64 TortaGUID; void Reset() { - m_uiCheckSpeechTimer = 2500; - m_uiPostEventTimer = 1000; - m_uiPhasePostEvent = 0; + CheckSpeechTimer = 2500; + PostEventTimer = 1000; + PhasePostEvent = 0; TortaGUID = 0; } @@ -577,11 +583,9 @@ public: { if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE)) { - if (Player* player = GetLeaderForFollower()) - { - if (player->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE) - player->GroupEventHappens(QUEST_TOOGA, me); - } + Player* player = GetLeaderForFollower(); + if (player && player->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE) + player->GroupEventHappens(QUEST_TOOGA, me); TortaGUID = who->GetGUID(); SetFollowComplete(true); @@ -589,27 +593,27 @@ public: } } - void MovementInform(uint32 uiMotionType, uint32 uiPointId) + void MovementInform(uint32 MotionType, uint32 PointId) { - FollowerAI::MovementInform(uiMotionType, uiPointId); + FollowerAI::MovementInform(MotionType, PointId); - if (uiMotionType != POINT_MOTION_TYPE) + if (MotionType != POINT_MOTION_TYPE) return; - if (uiPointId == POINT_ID_TO_WATER) + if (PointId == POINT_ID_TO_WATER) SetFollowComplete(); } - void UpdateFollowerAI(const uint32 uiDiff) + void UpdateFollowerAI(const uint32 Diff) { if (!UpdateVictim()) { //we are doing the post-event, or... if (HasFollowState(STATE_FOLLOW_POSTEVENT)) { - if (m_uiPostEventTimer <= uiDiff) + if (PostEventTimer <= Diff) { - m_uiPostEventTimer = 5000; + PostEventTimer = 5000; Unit* pTorta = Unit::GetUnit(*me, TortaGUID); if (!pTorta || !pTorta->isAlive()) @@ -619,7 +623,7 @@ public: return; } - switch (m_uiPhasePostEvent) + switch (PhasePostEvent) { case 1: DoScriptText(SAY_TOOG_POST_1, me); @@ -638,27 +642,27 @@ public: break; case 6: DoScriptText(SAY_TORT_POST_6, pTorta); - me->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, m_afToWaterLoc[0], m_afToWaterLoc[1], m_afToWaterLoc[2]); + me->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, ToWaterLoc); break; } - ++m_uiPhasePostEvent; + ++PhasePostEvent; } else - m_uiPostEventTimer -= uiDiff; + PostEventTimer -= Diff; } //...we are doing regular speech check else if (HasFollowState(STATE_FOLLOW_INPROGRESS)) { - if (m_uiCheckSpeechTimer <= uiDiff) + if (CheckSpeechTimer <= Diff) { - m_uiCheckSpeechTimer = 5000; + CheckSpeechTimer = 5000; if (urand(0, 9) > 8) DoScriptText(RAND(SAY_TOOG_THIRST, SAY_TOOG_WORRIED), me); } else - m_uiCheckSpeechTimer -= uiDiff; + CheckSpeechTimer -= Diff; } return; diff --git a/src/server/scripts/Kalimdor/teldrassil.cpp b/src/server/scripts/Kalimdor/teldrassil.cpp index d7cac99c374..7f2b2fc7f05 100644 --- a/src/server/scripts/Kalimdor/teldrassil.cpp +++ b/src/server/scripts/Kalimdor/teldrassil.cpp @@ -27,14 +27,15 @@ EndScriptData */ npc_mist EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "ScriptedFollowerAI.h" /*#### # npc_mist ####*/ -enum eMist +enum Mist { SAY_AT_HOME = -1000323, EMOTE_AT_HOME = -1000324, @@ -51,10 +52,8 @@ public: bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) { if (quest->GetQuestId() == QUEST_MIST) - { if (npc_mistAI* pMistAI = CAST_AI(npc_mist::npc_mistAI, creature->AI())) pMistAI->StartFollow(player, FACTION_DARNASSUS, quest); - } return true; } @@ -88,18 +87,16 @@ public: { DoScriptText(EMOTE_AT_HOME, me); - if (Player* player = GetLeaderForFollower()) - { - if (player->GetQuestStatus(QUEST_MIST) == QUEST_STATUS_INCOMPLETE) - player->GroupEventHappens(QUEST_MIST, me); - } + Player* player = GetLeaderForFollower(); + if (player && player->GetQuestStatus(QUEST_MIST) == QUEST_STATUS_INCOMPLETE) + player->GroupEventHappens(QUEST_MIST, me); //The follow is over (and for later development, run off to the woods before really end) SetFollowComplete(); } //call not needed here, no known abilities - /*void UpdateFollowerAI(const uint32 uiDiff) + /*void UpdateFollowerAI(const uint32 Diff) { if (!UpdateVictim()) return; diff --git a/src/server/scripts/Kalimdor/the_barrens.cpp b/src/server/scripts/Kalimdor/the_barrens.cpp index 933ad4de3eb..f4983558b67 100644 --- a/src/server/scripts/Kalimdor/the_barrens.cpp +++ b/src/server/scripts/Kalimdor/the_barrens.cpp @@ -32,7 +32,9 @@ npc_twiggy_flathead npc_wizzlecrank_shredder EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" #include "ScriptedEscortAI.h" /*###### @@ -41,7 +43,7 @@ EndContentData */ #define GOSSIP_CORPSE "Examine corpse in detail..." -enum eQuests +enum BeatenCorpse { QUEST_LOST_IN_BATTLE = 4921 }; @@ -77,7 +79,7 @@ public: # npc_gilthares ######*/ -enum eGilthares +enum Gilthares { SAY_GIL_START = -1000370, SAY_GIL_AT_LAST = -1000371, @@ -214,7 +216,7 @@ public: ## npc_taskmaster_fizzule ######*/ -enum eEnums +enum TaskmasterFizzule { FACTION_FRIENDLY_F = 35, SPELL_FLARE = 10113, @@ -240,13 +242,13 @@ public: uint32 factionNorm; bool IsFriend; - uint32 Reset_Timer; + uint32 ResetTimer; uint8 FlareCount; void Reset() { IsFriend = false; - Reset_Timer = 120000; + ResetTimer = 120000; FlareCount = 0; me->setFaction(factionNorm); } @@ -281,11 +283,11 @@ public: { if (IsFriend) { - if (Reset_Timer <= diff) + if (ResetTimer <= diff) { EnterEvadeMode(); return; - } else Reset_Timer -= diff; + } else ResetTimer -= diff; } if (!UpdateVictim()) @@ -315,7 +317,7 @@ public: ## npc_twiggy_flathead #####*/ -enum eTwiggyFlathead +enum TwiggyFlathead { NPC_BIG_WILL = 6238, NPC_AFFRAY_CHALLENGER = 6240, @@ -327,7 +329,7 @@ enum eTwiggyFlathead SAY_TWIGGY_FLATHEAD_OVER = -1000127, }; -float AffrayChallengerLoc[6][4]= +Position const AffrayChallengerLoc[6] = { {-1683.0f, -4326.0f, 2.79f, 0.0f}, {-1682.0f, -4329.0f, 2.79f, 0.0f}, @@ -354,10 +356,10 @@ public: bool EventInProgress; bool EventGrate; bool EventBigWill; - bool Challenger_down[6]; - uint32 Wave; - uint32 Wave_Timer; - uint32 Challenger_checker; + bool ChallengerDown[6]; + uint8 Wave; + uint32 WaveTimer; + uint32 ChallengerChecker; uint64 PlayerGUID; uint64 AffrayChallenger[6]; uint64 BigWill; @@ -367,15 +369,15 @@ public: EventInProgress = false; EventGrate = false; EventBigWill = false; - Wave_Timer = 600000; - Challenger_checker = 0; + WaveTimer = 600000; + ChallengerChecker = 0; Wave = 0; PlayerGUID = 0; for (uint8 i = 0; i < 6; ++i) { AffrayChallenger[i] = 0; - Challenger_down[i] = false; + ChallengerDown[i] = false; } BigWill = 0; } @@ -441,7 +443,7 @@ public: for (uint8 i = 0; i < 6; ++i) { - Creature* creature = me->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i][0], AffrayChallengerLoc[i][1], AffrayChallengerLoc[i][2], AffrayChallengerLoc[i][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + Creature* creature = me->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); if (!creature) continue; creature->setFaction(35); @@ -450,31 +452,31 @@ public: creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); AffrayChallenger[i] = creature->GetGUID(); } - Wave_Timer = 5000; - Challenger_checker = 1000; + WaveTimer = 5000; + ChallengerChecker = 1000; EventGrate = true; } } else if (EventInProgress) { - if (Challenger_checker <= diff) + if (ChallengerChecker <= diff) { for (uint8 i = 0; i < 6; ++i) { if (AffrayChallenger[i]) { Creature* creature = Unit::GetCreature((*me), AffrayChallenger[i]); - if ((!creature || (!creature->isAlive())) && !Challenger_down[i]) + if ((!creature || (!creature->isAlive())) && !ChallengerDown[i]) { DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, me); - Challenger_down[i] = true; + ChallengerDown[i] = true; } } } - Challenger_checker = 1000; - } else Challenger_checker -= diff; + ChallengerChecker = 1000; + } else ChallengerChecker -= diff; - if (Wave_Timer <= diff) + if (WaveTimer <= diff) { if (Wave < 6 && AffrayChallenger[Wave] && !EventBigWill) { @@ -488,7 +490,7 @@ public: creature->setFaction(14); creature->AI()->AttackStart(pWarrior); ++Wave; - Wave_Timer = 20000; + WaveTimer = 20000; } } else if (Wave >= 6 && !EventBigWill) { @@ -500,7 +502,7 @@ public: creature->GetMotionMaster()->MovePoint(2, -1682, -4329, 2.79f); creature->HandleEmoteCommand(EMOTE_STATE_READY_UNARMED); EventBigWill = true; - Wave_Timer = 1000; + WaveTimer = 1000; } } else if (Wave >= 6 && EventBigWill && BigWill) @@ -512,7 +514,7 @@ public: Reset(); } } - } else Wave_Timer -= diff; + } else WaveTimer -= diff; } } } @@ -524,7 +526,7 @@ public: ## npc_wizzlecrank_shredder #####*/ -enum eEnums_Wizzlecrank +enum Wizzlecrank { SAY_START = -1000298, SAY_STARTUP1 = -1000299, @@ -550,14 +552,14 @@ public: { npc_wizzlecrank_shredderAI(Creature* creature) : npc_escortAI(creature) { - m_bIsPostEvent = false; - m_uiPostEventTimer = 1000; - m_uiPostEventCount = 0; + IsPostEvent = false; + PostEventTimer = 1000; + PostEventCount = 0; } - bool m_bIsPostEvent; - uint32 m_uiPostEventTimer; - uint32 m_uiPostEventCount; + bool IsPostEvent; + uint32 PostEventTimer; + uint32 PostEventCount; void Reset() { @@ -566,9 +568,9 @@ public: if (me->getStandState() == UNIT_STAND_STATE_DEAD) me->SetStandState(UNIT_STAND_STATE_STAND); - m_bIsPostEvent = false; - m_uiPostEventTimer = 1000; - m_uiPostEventCount = 0; + IsPostEvent = false; + PostEventTimer = 1000; + PostEventCount = 0; } } @@ -590,19 +592,19 @@ public: } break; case 24: - m_bIsPostEvent = true; + IsPostEvent = true; break; } } - void WaypointStart(uint32 uiPointId) + void WaypointStart(uint32 PointId) { Player* player = GetPlayerForEscort(); if (!player) return; - switch (uiPointId) + switch (PointId) { case 9: DoScriptText(SAY_STARTUP2, me, player); @@ -623,15 +625,15 @@ public: summoned->AI()->AttackStart(me); } - void UpdateEscortAI(const uint32 uiDiff) + void UpdateEscortAI(const uint32 Diff) { if (!UpdateVictim()) { - if (m_bIsPostEvent) + if (IsPostEvent) { - if (m_uiPostEventTimer <= uiDiff) + if (PostEventTimer <= Diff) { - switch (m_uiPostEventCount) + switch (PostEventCount) { case 0: DoScriptText(SAY_PROGRESS_2, me); @@ -651,11 +653,11 @@ public: break; } - ++m_uiPostEventCount; - m_uiPostEventTimer = 5000; + ++PostEventCount; + PostEventTimer = 5000; } else - m_uiPostEventTimer -= uiDiff; + PostEventTimer -= Diff; } return; diff --git a/src/server/scripts/Kalimdor/thousand_needles.cpp b/src/server/scripts/Kalimdor/thousand_needles.cpp index 5b77b8dc2c0..b9ae356ddf1 100644 --- a/src/server/scripts/Kalimdor/thousand_needles.cpp +++ b/src/server/scripts/Kalimdor/thousand_needles.cpp @@ -32,14 +32,16 @@ npc_enraged_panther go_panther_cage EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" #include "ScriptedEscortAI.h" /*##### # npc_kanati ######*/ -enum eKanati +enum Kanati { SAY_KAN_START = -1000410, @@ -47,7 +49,7 @@ enum eKanati NPC_GALAK_ASS = 10720 }; -const float m_afGalakLoc[]= {-4867.387695f, -1357.353760f, -48.226f }; +Position const GalakLoc = {-4867.387695f, -1357.353760f, -48.226f, 0.0f}; class npc_kanati : public CreatureScript { @@ -57,10 +59,9 @@ public: bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) { if (quest->GetQuestId() == QUEST_PROTECT_KANATI) - { if (npc_kanatiAI* pEscortAI = CAST_AI(npc_kanati::npc_kanatiAI, creature->AI())) pEscortAI->Start(false, false, player->GetGUID(), quest, true); - } + return true; } @@ -73,7 +74,7 @@ public: { npc_kanatiAI(Creature* creature) : npc_escortAI(creature) { } - void Reset() { } + void Reset() {} void WaypointReached(uint32 waypointId) { @@ -93,9 +94,7 @@ public: void DoSpawnGalak() { for (int i = 0; i < 3; ++i) - me->SummonCreature(NPC_GALAK_ASS, - m_afGalakLoc[0], m_afGalakLoc[1], m_afGalakLoc[2], 0.0f, - TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(NPC_GALAK_ASS, GalakLoc, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); } void JustSummoned(Creature* summoned) @@ -110,7 +109,7 @@ public: # npc_lakota_windsong ######*/ -enum eLakota +enum Lakota { SAY_LAKO_START = -1000365, SAY_LAKO_LOOK_OUT = -1000366, @@ -127,14 +126,14 @@ enum eLakota ID_AMBUSH_3 = 4 }; -float m_afBanditLoc[6][6]= +Position const BanditLoc[6] = { - {-4905.479492f, -2062.732666f, 84.352f}, - {-4915.201172f, -2073.528320f, 84.733f}, - {-4878.883301f, -1986.947876f, 91.966f}, - {-4877.503906f, -1966.113403f, 91.859f}, - {-4767.985352f, -1873.169189f, 90.192f}, - {-4788.861328f, -1888.007813f, 89.888f} + {-4905.479492f, -2062.732666f, 84.352f, 0.0f}, + {-4915.201172f, -2073.528320f, 84.733f, 0.0f}, + {-4878.883301f, -1986.947876f, 91.966f, 0.0f}, + {-4877.503906f, -1966.113403f, 91.859f, 0.0f}, + {-4767.985352f, -1873.169189f, 90.192f, 0.0f}, + {-4788.861328f, -1888.007813f, 89.888f, 0.0f} }; class npc_lakota_windsong : public CreatureScript @@ -164,7 +163,7 @@ public: { npc_lakota_windsongAI(Creature* creature) : npc_escortAI(creature) { } - void Reset() { } + void Reset() {} void WaypointReached(uint32 waypointId) { @@ -189,12 +188,10 @@ public: } } - void DoSpawnBandits(int uiAmbushId) + void DoSpawnBandits(int AmbushId) { for (int i = 0; i < 2; ++i) - me->SummonCreature(NPC_GRIM_BANDIT, - m_afBanditLoc[i+uiAmbushId][0], m_afBanditLoc[i+uiAmbushId][1], m_afBanditLoc[i+uiAmbushId][2], 0.0f, - TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); + me->SummonCreature(NPC_GRIM_BANDIT, BanditLoc[i+AmbushId], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); } }; @@ -204,7 +201,7 @@ public: # npc_paoka_swiftmountain ######*/ -enum ePacka +enum Packa { SAY_START = -1000362, SAY_WYVERN = -1000363, @@ -215,11 +212,11 @@ enum ePacka FACTION_ESCORTEE = 232 //guessed }; -float m_afWyvernLoc[3][3]= +Position const WyvernLoc[3] = { - {-4990.606f, -906.057f, -5.343f}, - {-4970.241f, -927.378f, -4.951f}, - {-4985.364f, -952.528f, -5.199f} + {-4990.606f, -906.057f, -5.343f, 0.0f}, + {-4970.241f, -927.378f, -4.951f, 0.0f}, + {-4985.364f, -952.528f, -5.199f, 0.0f} }; class npc_paoka_swiftmountain : public CreatureScript @@ -249,7 +246,7 @@ public: { npc_paoka_swiftmountainAI(Creature* creature) : npc_escortAI(creature) { } - void Reset() { } + void Reset() {} void WaypointReached(uint32 waypointId) { @@ -272,9 +269,7 @@ public: void DoSpawnWyvern() { for (int i = 0; i < 3; ++i) - me->SummonCreature(NPC_WYVERN, - m_afWyvernLoc[i][0], m_afWyvernLoc[i][1], m_afWyvernLoc[i][2], 0.0f, - TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); + me->SummonCreature(NPC_WYVERN, WyvernLoc[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); } }; }; @@ -285,7 +280,7 @@ public: #define GOSSIP_P "Please tell me the Phrase.." -enum ePlucky +enum Plucky { FACTION_FRIENDLY = 35, QUEST_SCOOP = 1950, @@ -328,17 +323,17 @@ public: struct npc_pluckyAI : public ScriptedAI { - npc_pluckyAI(Creature* creature) : ScriptedAI(creature) { m_uiNormFaction = creature->getFaction(); } + npc_pluckyAI(Creature* creature) : ScriptedAI(creature) { NormFaction = creature->getFaction(); } - uint32 m_uiNormFaction; - uint32 m_uiResetTimer; + uint32 NormFaction; + uint32 ResetTimer; void Reset() { - m_uiResetTimer = 120000; + ResetTimer = 120000; - if (me->getFaction() != m_uiNormFaction) - me->setFaction(m_uiNormFaction); + if (me->getFaction() != NormFaction) + me->setFaction(NormFaction); if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); @@ -346,11 +341,11 @@ public: DoCast(me, SPELL_PLUCKY_CHICKEN, false); } - void ReceiveEmote(Player* player, uint32 uiTextEmote) + void ReceiveEmote(Player* player, uint32 TextEmote) { if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) { - if (uiTextEmote == TEXT_EMOTE_BECKON) + if (TextEmote == TEXT_EMOTE_BECKON) { me->setFaction(FACTION_FRIENDLY); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); @@ -358,7 +353,7 @@ public: } } - if (uiTextEmote == TEXT_EMOTE_CHICKEN) + if (TextEmote == TEXT_EMOTE_CHICKEN) { if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) return; @@ -372,11 +367,11 @@ public: } } - void UpdateAI(const uint32 uiDiff) + void UpdateAI(const uint32 Diff) { if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) { - if (m_uiResetTimer <= uiDiff) + if (ResetTimer <= Diff) { if (!me->getVictim()) EnterEvadeMode(); @@ -386,7 +381,7 @@ public: return; } else - m_uiResetTimer -= uiDiff; + ResetTimer -= Diff; } if (!UpdateVictim()) @@ -398,7 +393,7 @@ public: }; -enum ePantherCage +enum PantherCage { ENRAGED_PANTHER = 10992 }; diff --git a/src/server/scripts/Kalimdor/thunder_bluff.cpp b/src/server/scripts/Kalimdor/thunder_bluff.cpp index 5aa55ddea66..b8b05b9692f 100644 --- a/src/server/scripts/Kalimdor/thunder_bluff.cpp +++ b/src/server/scripts/Kalimdor/thunder_bluff.cpp @@ -23,17 +23,22 @@ SDComment: Quest support: 925 SDCategory: Thunder Bluff EndScriptData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" /*##### # npc_cairne_bloodhoof ######*/ -#define SPELL_BERSERKER_CHARGE 16636 -#define SPELL_CLEAVE 16044 -#define SPELL_MORTAL_STRIKE 16856 -#define SPELL_THUNDERCLAP 23931 -#define SPELL_UPPERCUT 22916 +enum CairneBloodhoof +{ + SPELL_BERSERKER_CHARGE = 16636, + SPELL_CLEAVE = 16044, + SPELL_MORTAL_STRIKE = 16856, + SPELL_THUNDERCLAP = 23931, + SPELL_UPPERCUT = 22916 +}; #define GOSSIP_HCB "I know this is rather silly but a young ward who is a bit shy would like your hoofprint." //TODO: verify abilities/timers @@ -75,19 +80,19 @@ public: { npc_cairne_bloodhoofAI(Creature* creature) : ScriptedAI(creature) {} - uint32 BerserkerCharge_Timer; - uint32 Cleave_Timer; - uint32 MortalStrike_Timer; - uint32 Thunderclap_Timer; - uint32 Uppercut_Timer; + uint32 BerserkerChargeTimer; + uint32 CleaveTimer; + uint32 MortalStrikeTimer; + uint32 ThunderclapTimer; + uint32 UppercutTimer; void Reset() { - BerserkerCharge_Timer = 30000; - Cleave_Timer = 5000; - MortalStrike_Timer = 10000; - Thunderclap_Timer = 15000; - Uppercut_Timer = 10000; + BerserkerChargeTimer = 30000; + CleaveTimer = 5000; + MortalStrikeTimer = 10000; + ThunderclapTimer = 15000; + UppercutTimer = 10000; } void EnterCombat(Unit* /*who*/) {} @@ -97,37 +102,37 @@ public: if (!UpdateVictim()) return; - if (BerserkerCharge_Timer <= diff) + if (BerserkerChargeTimer <= diff) { Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); if (target) DoCast(target, SPELL_BERSERKER_CHARGE); - BerserkerCharge_Timer = 25000; - } else BerserkerCharge_Timer -= diff; + BerserkerChargeTimer = 25000; + } else BerserkerChargeTimer -= diff; - if (Uppercut_Timer <= diff) + if (UppercutTimer <= diff) { DoCast(me->getVictim(), SPELL_UPPERCUT); - Uppercut_Timer = 20000; - } else Uppercut_Timer -= diff; + UppercutTimer = 20000; + } else UppercutTimer -= diff; - if (Thunderclap_Timer <= diff) + if (ThunderclapTimer <= diff) { DoCast(me->getVictim(), SPELL_THUNDERCLAP); - Thunderclap_Timer = 15000; - } else Thunderclap_Timer -= diff; + ThunderclapTimer = 15000; + } else ThunderclapTimer -= diff; - if (MortalStrike_Timer <= diff) + if (MortalStrikeTimer <= diff) { DoCast(me->getVictim(), SPELL_MORTAL_STRIKE); - MortalStrike_Timer = 15000; - } else MortalStrike_Timer -= diff; + MortalStrikeTimer = 15000; + } else MortalStrikeTimer -= diff; - if (Cleave_Timer <= diff) + if (CleaveTimer <= diff) { DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 7000; - } else Cleave_Timer -= diff; + CleaveTimer = 7000; + } else CleaveTimer -= diff; DoMeleeAttackIfReady(); } diff --git a/src/server/scripts/Kalimdor/ungoro_crater.cpp b/src/server/scripts/Kalimdor/ungoro_crater.cpp index 232dba404e0..786d2fc0cd3 100644 --- a/src/server/scripts/Kalimdor/ungoro_crater.cpp +++ b/src/server/scripts/Kalimdor/ungoro_crater.cpp @@ -28,11 +28,12 @@ npc_a-me npc_ringo EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "ScriptedEscortAI.h" #include "ScriptedFollowerAI.h" -enum eAMeData +enum AmeData { SAY_READY = -1000517, SAY_AGGRO1 = -1000518, @@ -76,41 +77,40 @@ public: { npc_ameAI(Creature* creature) : npc_escortAI(creature) {} - uint32 DEMORALIZINGSHOUT_Timer; + uint32 DemoralizingShoutTimer; void WaypointReached(uint32 waypointId) { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) + if (Player* player = GetPlayerForEscort()) { - case 19: - me->SummonCreature(ENTRY_STOMPER, -6391.69f, -1730.49f, -272.83f, 4.96f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO1, me, player); - break; - case 28: - DoScriptText(SAY_SEARCH, me, player); - break; - case 38: - me->SummonCreature(ENTRY_TARLORD, -6370.75f, -1382.84f, -270.51f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO2, me, player); - break; - case 49: - me->SummonCreature(ENTRY_TARLORD1, -6324.44f, -1181.05f, -270.17f, 4.34f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO3, me, player); - break; - case 55: - DoScriptText(SAY_FINISH, me, player); - player->GroupEventHappens(QUEST_CHASING_AME, me); - break; + switch (waypointId) + { + case 19: + me->SummonCreature(ENTRY_STOMPER, -6391.69f, -1730.49f, -272.83f, 4.96f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + DoScriptText(SAY_AGGRO1, me, player); + break; + case 28: + DoScriptText(SAY_SEARCH, me, player); + break; + case 38: + me->SummonCreature(ENTRY_TARLORD, -6370.75f, -1382.84f, -270.51f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + DoScriptText(SAY_AGGRO2, me, player); + break; + case 49: + me->SummonCreature(ENTRY_TARLORD1, -6324.44f, -1181.05f, -270.17f, 4.34f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + DoScriptText(SAY_AGGRO3, me, player); + break; + case 55: + DoScriptText(SAY_FINISH, me, player); + player->GroupEventHappens(QUEST_CHASING_AME, me); + break; + } } } void Reset() { - DEMORALIZINGSHOUT_Timer = 5000; + DemoralizingShoutTimer = 5000; } void JustSummoned(Creature* summoned) @@ -130,11 +130,11 @@ public: if (!UpdateVictim()) return; - if (DEMORALIZINGSHOUT_Timer <= diff) + if (DemoralizingShoutTimer <= diff) { DoCast(me->getVictim(), SPELL_DEMORALIZINGSHOUT); - DEMORALIZINGSHOUT_Timer = 70000; - } else DEMORALIZINGSHOUT_Timer -= diff; + DemoralizingShoutTimer = 70000; + } else DemoralizingShoutTimer -= diff; } }; }; @@ -143,7 +143,7 @@ public: # npc_ringo ####*/ -enum eRingo +enum Ringo { SAY_RIN_START_1 = -1000416, SAY_RIN_START_2 = -1000417, @@ -201,17 +201,17 @@ public: { npc_ringoAI(Creature* creature) : FollowerAI(creature) { } - uint32 m_uiFaintTimer; - uint32 m_uiEndEventProgress; - uint32 m_uiEndEventTimer; + uint32 FaintTimer; + uint32 EndEventProgress; + uint32 EndEventTimer; uint64 SpraggleGUID; void Reset() { - m_uiFaintTimer = urand(30000, 60000); - m_uiEndEventProgress = 0; - m_uiEndEventTimer = 1000; + FaintTimer = urand(30000, 60000); + EndEventProgress = 0; + EndEventTimer = 1000; SpraggleGUID = 0; } @@ -266,13 +266,13 @@ public: SetFollowPaused(false); } - void UpdateFollowerAI(const uint32 uiDiff) + void UpdateFollowerAI(const uint32 Diff) { if (!UpdateVictim()) { if (HasFollowState(STATE_FOLLOW_POSTEVENT)) { - if (m_uiEndEventTimer <= uiDiff) + if (EndEventTimer <= Diff) { Unit* pSpraggle = Unit::GetUnit(*me, SpraggleGUID); if (!pSpraggle || !pSpraggle->isAlive()) @@ -281,64 +281,61 @@ public: return; } - switch (m_uiEndEventProgress) + switch (EndEventProgress) { case 1: DoScriptText(SAY_RIN_END_1, me); - m_uiEndEventTimer = 3000; + EndEventTimer = 3000; break; case 2: DoScriptText(SAY_SPR_END_2, pSpraggle); - m_uiEndEventTimer = 5000; + EndEventTimer = 5000; break; case 3: DoScriptText(SAY_RIN_END_3, me); - m_uiEndEventTimer = 1000; + EndEventTimer = 1000; break; case 4: DoScriptText(EMOTE_RIN_END_4, me); SetFaint(); - m_uiEndEventTimer = 9000; + EndEventTimer = 9000; break; case 5: DoScriptText(EMOTE_RIN_END_5, me); ClearFaint(); - m_uiEndEventTimer = 1000; + EndEventTimer = 1000; break; case 6: DoScriptText(SAY_RIN_END_6, me); - m_uiEndEventTimer = 3000; + EndEventTimer = 3000; break; case 7: DoScriptText(SAY_SPR_END_7, pSpraggle); - m_uiEndEventTimer = 10000; + EndEventTimer = 10000; break; case 8: DoScriptText(EMOTE_RIN_END_8, me); - m_uiEndEventTimer = 5000; + EndEventTimer = 5000; break; case 9: SetFollowComplete(); break; } - ++m_uiEndEventProgress; + ++EndEventProgress; } else - m_uiEndEventTimer -= uiDiff; + EndEventTimer -= Diff; } - else if (HasFollowState(STATE_FOLLOW_INPROGRESS)) + else if (HasFollowState(STATE_FOLLOW_INPROGRESS) && !HasFollowState(STATE_FOLLOW_PAUSED)) { - if (!HasFollowState(STATE_FOLLOW_PAUSED)) + if (FaintTimer <= Diff) { - if (m_uiFaintTimer <= uiDiff) - { - SetFaint(); - m_uiFaintTimer = urand(60000, 120000); - } - else - m_uiFaintTimer -= uiDiff; + SetFaint(); + FaintTimer = urand(60000, 120000); } + else + FaintTimer -= Diff; } return; diff --git a/src/server/scripts/Kalimdor/winterspring.cpp b/src/server/scripts/Kalimdor/winterspring.cpp index ab5e4c4023a..a02156ee110 100644 --- a/src/server/scripts/Kalimdor/winterspring.cpp +++ b/src/server/scripts/Kalimdor/winterspring.cpp @@ -29,7 +29,9 @@ npc_rivern_frostwind npc_witch_doctor_mauari EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" /*###### ## npc_lorax diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index 661b3530bb8..2af73389ecb 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -1044,7 +1044,7 @@ class spell_algalon_phase_punch : public SpellScriptLoader { PrepareAuraScript(spell_algalon_phase_punch_AuraScript); - void HandlePeriodic(AuraEffect const* aurEff) + void HandlePeriodic(AuraEffect const* /*aurEff*/) { PreventDefaultAction(); if (GetStackAmount() != 1) diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 33e266e1326..09ff5935b6e 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -2044,7 +2044,7 @@ public: void HandleDummy(SpellEffIndex /*effIndex*/) { - if (Unit* target = GetHitUnit()) + if (GetHitUnit()) GetCaster()->CastSpell(GetCaster(),SPELL_FORCE_CAST_SUMMON_GNOME_SOUL); } diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index f50dbb7773d..c9c036d5329 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -213,7 +213,7 @@ class spell_sha_earthbind_totem : public SpellScriptLoader return true; } - void HandleEffectPeriodic(AuraEffect const* aurEff) + void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) { if (!GetCaster()) return; From da2c39d113176ef3bf835dbc151d1043c7ddee8e Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 19 May 2012 15:56:57 +0100 Subject: [PATCH 0778/1149] DB/Loot: No npc should drop Saronite Ore Thanks Amit --- sql/updates/world/2012_02_19_04_creature_loot_template.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2012_02_19_04_creature_loot_template.sql diff --git a/sql/updates/world/2012_02_19_04_creature_loot_template.sql b/sql/updates/world/2012_02_19_04_creature_loot_template.sql new file mode 100644 index 00000000000..ae996e01956 --- /dev/null +++ b/sql/updates/world/2012_02_19_04_creature_loot_template.sql @@ -0,0 +1 @@ +DELETE FROM `creature_loot_template` WHERE `entry`=31813 AND `item`=36912; -- Saronite Ore From 015162ce5f1ab17e8fa5afc61d965987808a1426 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sat, 19 May 2012 19:38:42 +0200 Subject: [PATCH 0779/1149] DB/Loot: Add Gunship Loot to the respective chests, kills some startup errors Fixes #6248 --- ...2012_02_19_05_gameobject_loot_template.sql | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sql/updates/world/2012_02_19_05_gameobject_loot_template.sql diff --git a/sql/updates/world/2012_02_19_05_gameobject_loot_template.sql b/sql/updates/world/2012_02_19_05_gameobject_loot_template.sql new file mode 100644 index 00000000000..f95cb45efe4 --- /dev/null +++ b/sql/updates/world/2012_02_19_05_gameobject_loot_template.sql @@ -0,0 +1,93 @@ +-- Set Variables +SET @Gunship10N := 28057; -- Data1 for 201872 & 202177 +SET @Gunship10H := 28045; -- Data1 for 201873 & 202178 +SET @Gunship25N := 28072; -- Data1 for 201874 & 202179 +SET @Gunship25H := 28090; -- Data1 for 201875 & 202180 +SET @emblem := 49426; -- Emblem of Frost +SET @SfShard := 50274; -- Shadowfrost Shard +SET @PriSar := 49908; -- Primordial Saronite +-- Dug up the old references i created for UP34: +SET @Ref10J := 34329; +SET @Ref25J := 34251; +SET @RefJ10H := 34263; +SET @RefJ25H := 34275; +-- Gunship_Armory10N_reference +DELETE FROM `reference_loot_template` WHERE `entry` IN (@Ref10J,@Ref25J,@RefJ10H,@RefJ25H); +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@Ref10J,50791,0,1,1,1,1), -- Saronite Gargoyle Cloak +(@Ref10J,50795,0,1,1,1,1), -- Cord of Dark Suffering +(@Ref10J,50794,0,1,1,1,1), -- Neverending Winter +(@Ref10J,50787,0,1,1,1,1), -- Frost Giant's Cleaver +(@Ref10J,50793,0,1,1,1,1), -- Midnight Sun +(@Ref10J,50788,0,1,1,1,1), -- Bone Drake's Enameled Boots +(@Ref10J,50792,0,1,1,1,1), -- Pauldrons of Lost Hope +(@Ref10J,50340,0,1,1,1,1), -- Muradin's Spyglass +(@Ref10J,50797,0,1,1,1,1), -- Ice-Reinforced Vrykul Helm +(@Ref10J,50790,0,1,1,1,1), -- Abomination's Bloody Ring +(@Ref10J,50789,0,1,1,1,1), -- Icecrown Rampart Bracers +(@Ref10J,50796,0,1,1,1,1), -- Bracers of Pale Illumination +-- Gunship_Armory25N_reference +(@Ref25J,50011,0,1,1,1,1), -- Gunship Captain's Mittens +(@Ref25J,50002,0,1,1,1,1), -- Polar Bear Claw Bracers +(@Ref25J,50006,0,1,1,1,1), -- Corp'rethar Ceremonial Crown +(@Ref25J,50010,0,1,1,1,1), -- Waistband of Righteous Fury +(@Ref25J,50003,0,1,1,1,1), -- Boneguard Commander's Pauldrons +(@Ref25J,50000,0,1,1,1,1), -- Scourge Hunter's Vambraces +(@Ref25J,50359,0,1,1,1,1), -- Althor's Abacus +(@Ref25J,50352,0,1,1,1,1), -- Corpse Tongue Coin +(@Ref25J,49999,0,1,1,1,1), -- Skeleton Lord's Circle +(@Ref25J,50009,0,1,1,1,1), -- Boots of Unnatural Growth +(@Ref25J,50008,0,1,1,1,1), -- Ring of Rapid Ascent +(@Ref25J,49998,0,1,1,1,1), -- Shadowvault Slayer's Cloak +(@Ref25J,50005,0,1,1,1,1), -- Amulet of the Silent Eulogy +(@Ref25J,50411,0,1,1,1,1), -- Scourgeborne Waraxe +(@Ref25J,50001,0,1,1,1,1), -- Ikfirus's Sack of Wonder +-- Gunship_Armory10H_reference +(@RefJ10H,51912,0,1,1,1,1), -- Saronite Gargoyle Cloak (heroic) +(@RefJ10H,51908,0,1,1,1,1), -- Cord of Dark Suffering (heroic) +(@RefJ10H,51909,0,1,1,1,1), -- Neverending Winter (heroic) +(@RefJ10H,51916,0,1,1,1,1), -- Frost Giant's Cleaver (heroic) +(@RefJ10H,51910,0,1,1,1,1), -- Midnight Sun (heroic) +(@RefJ10H,51915,0,1,1,1,1), -- Bone Drake's Enameled Boots (heroic) +(@RefJ10H,51911,0,1,1,1,1), -- Pauldrons of Lost Hope (heroic) +(@RefJ10H,50345,0,1,1,1,1), -- Muradin's Spyglass (heroic) +(@RefJ10H,51906,0,1,1,1,1), -- Ice-Reinforced Vrykul Helm (heroic) +(@RefJ10H,51913,0,1,1,1,1), -- Abomination's Bloody Ring (heroic) +(@RefJ10H,51914,0,1,1,1,1), -- Icecrown Rampart Bracers (heroic) +(@RefJ10H,51907,0,1,1,1,1), -- Bracers of Pale Illumination (heroic) +-- Gunship_Armory25H_reference +(@RefJ25H,50663,0,1,1,1,1), -- Gunship Captain's Mittens (heroic) +(@RefJ25H,50659,0,1,1,1,1), -- Polar Bear Claw Bracers (heroic) +(@RefJ25H,50661,0,1,1,1,1), -- Corp'rethar Ceremonial Crown (heroic) +(@RefJ25H,50667,0,1,1,1,1), -- Waistband of Righteous Fury (heroic) +(@RefJ25H,50660,0,1,1,1,1), -- Boneguard Commander's Pauldrons (heroic) +(@RefJ25H,50655,0,1,1,1,1), -- Scourge Hunter's Vambraces (heroic) +(@RefJ25H,50366,0,1,1,1,1), -- Althor's Abacus (heroic) +(@RefJ25H,50349,0,1,1,1,1), -- Corpse Tongue Coin (heroic) +(@RefJ25H,50657,0,1,1,1,1), -- Skeleton Lord's Circle (heroic) +(@RefJ25H,50665,0,1,1,1,1), -- Boots of Unnatural Growth (heroic) +(@RefJ25H,50664,0,1,1,1,1), -- Ring of Rapid Ascent (heroic) +(@RefJ25H,50653,0,1,1,1,1), -- Shadowvault Slayer's Cloak (heroic) +(@RefJ25H,50658,0,1,1,1,1), -- Amulet of the Silent Eulogy (heroic) +(@RefJ25H,50654,0,1,1,1,1), -- Scourgeborne Waraxe (heroic) +(@RefJ25H,50656,0,1,1,1,1); -- Ikfirus's Sack of Wonder (heroic) +-- Bind the refs to the objects +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (@Gunship10N,@Gunship10H,@Gunship25N,@Gunship25H); +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Gunship10N +(@Gunship10N,@emblem,100,1,0,2,2), -- Gunship Armory 2xemblems 10N +(@Gunship10N,1,100,1,0,-@Ref10J,2), -- 2 from reference 10Normal +-- Gunship25N +(@Gunship25N,@emblem,100,1,0,2,2), -- Gunship Armory 2xemblems 25N +(@Gunship25N,1,100,1,0,-@Ref25J,2), -- 3 from reference 25Normal +(@Gunship25N,@SfShard,-35,1,0,1,1), -- Shadowfrost Shard @ 38% chance +(@Gunship25N,@PriSar,38,1,0,1,1), -- Primordial Saronite @ 10% chance +-- Gunship10H +(@Gunship10H,@emblem,100,1,0,2,2), -- Gunship Armory 2xemblems 10H +(@Gunship10H,1,100,1,0,-@RefJ10H,2), -- 2 from reference 10Heroic +(@Gunship10H,@PriSar,38,1,0,1,1), -- Primordial Saronite @ 38% chance +-- Gunship25H +(@Gunship25H,@emblem,100,1,0,2,2), -- Gunship Armory 2xemblems 25H +(@Gunship25H,1,100,1,0,-@RefJ25H,2), -- 3 from reference 25Heroic +(@Gunship25H,@SfShard,-75,1,0,1,1), -- Shadowfrost Shard @ 75% chance +(@Gunship25H,@PriSar,50,1,0,1,1); -- Primordial Saronite @ 50% chance From c4a98cb04129f70e1aaf5c80a7eeb0f16569e5b9 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 19 May 2012 22:01:49 +0100 Subject: [PATCH 0780/1149] SQLS: Correct recent sqls file names --- ...02_19_03_world_version.sql => 2012_05_19_03_world_version.sql} | 0 ...loot_template.sql => 2012_05_19_04_creature_loot_template.sql} | 0 ...ot_template.sql => 2012_05_19_05_gameobject_loot_template.sql} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename sql/updates/world/{2012_02_19_03_world_version.sql => 2012_05_19_03_world_version.sql} (100%) rename sql/updates/world/{2012_02_19_04_creature_loot_template.sql => 2012_05_19_04_creature_loot_template.sql} (100%) rename sql/updates/world/{2012_02_19_05_gameobject_loot_template.sql => 2012_05_19_05_gameobject_loot_template.sql} (100%) diff --git a/sql/updates/world/2012_02_19_03_world_version.sql b/sql/updates/world/2012_05_19_03_world_version.sql similarity index 100% rename from sql/updates/world/2012_02_19_03_world_version.sql rename to sql/updates/world/2012_05_19_03_world_version.sql diff --git a/sql/updates/world/2012_02_19_04_creature_loot_template.sql b/sql/updates/world/2012_05_19_04_creature_loot_template.sql similarity index 100% rename from sql/updates/world/2012_02_19_04_creature_loot_template.sql rename to sql/updates/world/2012_05_19_04_creature_loot_template.sql diff --git a/sql/updates/world/2012_02_19_05_gameobject_loot_template.sql b/sql/updates/world/2012_05_19_05_gameobject_loot_template.sql similarity index 100% rename from sql/updates/world/2012_02_19_05_gameobject_loot_template.sql rename to sql/updates/world/2012_05_19_05_gameobject_loot_template.sql From 0dd97dfcb62d91ed132789532623f5c2f164a608 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sat, 19 May 2012 23:23:16 +0200 Subject: [PATCH 0781/1149] DB/Loot: fix the last startups related to loot. this should be all... --- .../2012_05_19_06_gameobject_loot_template.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 sql/updates/world/2012_05_19_06_gameobject_loot_template.sql diff --git a/sql/updates/world/2012_05_19_06_gameobject_loot_template.sql b/sql/updates/world/2012_05_19_06_gameobject_loot_template.sql new file mode 100644 index 00000000000..f5d496b465b --- /dev/null +++ b/sql/updates/world/2012_05_19_06_gameobject_loot_template.sql @@ -0,0 +1,13 @@ +DELETE FROM `reference_loot_template` WHERE `entry`=34172; +DELETE FROM `creature_loot_template` WHERE `entry`=38013; +DELETE FROM `gameobject_loot_template` WHERE `entry=28683 +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(28683,35498,3,1,0,1,1), -- Formula: Enchant Weapon - Deathfrost +(28683,35557,28,1,0,1,2), -- Huge Snowball +(28683,35720,3,1,0,5,6), -- Lord of Frost's Private Label +(28683,35723,12,1,0,1,1), -- Shards of Ahune +(28683,54801,0,1,1,1,1), -- Icebound Cloak +(28683,54802,0,1,1,1,1), -- The Frost Lord's War Cloak +(28683,54803,0,1,1,1,1), -- The Frost Lord's Battle Shroud +(28683,54804,0,1,1,1,1), -- Shroud of Winter's Chill +(28683,54805,0,1,1,1,1); -- Cloak of the Frigid Winds From 2f1f2044afd9b81e7258248c86075b8d355563bc Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sat, 19 May 2012 23:29:08 +0200 Subject: [PATCH 0782/1149] DB/Commit: bio is an idiot that forgot a ; and a ` dont tell click! --- sql/updates/world/2012_05_19_06_gameobject_loot_template.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/updates/world/2012_05_19_06_gameobject_loot_template.sql b/sql/updates/world/2012_05_19_06_gameobject_loot_template.sql index f5d496b465b..9b2dcbb9363 100644 --- a/sql/updates/world/2012_05_19_06_gameobject_loot_template.sql +++ b/sql/updates/world/2012_05_19_06_gameobject_loot_template.sql @@ -1,6 +1,6 @@ DELETE FROM `reference_loot_template` WHERE `entry`=34172; DELETE FROM `creature_loot_template` WHERE `entry`=38013; -DELETE FROM `gameobject_loot_template` WHERE `entry=28683 +DELETE FROM `gameobject_loot_template` WHERE `entry`=28683; INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES (28683,35498,3,1,0,1,1), -- Formula: Enchant Weapon - Deathfrost (28683,35557,28,1,0,1,2), -- Huge Snowball From 85561f6a3f4b427f5ddcb4d0f2f4f68dbd3928f3 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 20 May 2012 14:26:17 +0100 Subject: [PATCH 0783/1149] DB: Rename .modify rep to .modify reputation (commands table) and fix a possible database startup error with conditions --- sql/updates/world/2012_05_20_00_world_misc.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sql/updates/world/2012_05_20_00_world_misc.sql diff --git a/sql/updates/world/2012_05_20_00_world_misc.sql b/sql/updates/world/2012_05_20_00_world_misc.sql new file mode 100644 index 00000000000..5b96f9881d6 --- /dev/null +++ b/sql/updates/world/2012_05_20_00_world_misc.sql @@ -0,0 +1,16 @@ +-- Update mod rep command name +UPDATE `command` SET + `name` = 'modify reputation', + `help` = 'Syntax: .modify reputation #repId (#repvalue | $rankname [#delta])\nSets the selected players reputation with faction #repId to #repvalue or to $reprank.\nIf the reputation rank name is provided, the resulting reputation will be the lowest reputation for that rank plus the delta amount, if specified.\nYou can use \'.pinfo rep\' to list all known reputation ids, or use \'.lookup faction $name\' to locate a specific faction id.' +WHERE `name` = 'modify rep'; + +-- Fix "2012-05-20 06:46:00 ERROR: SourceEntry 52264 in `condition` table, has incorrect SourceGroup 0 (spell effectMask) set , ignoring." +UPDATE `conditions` SET + `SourceGroup` = 1, + `SourceId` = 0 +WHERE + `SourceTypeOrReferenceId` = 13 AND + `SourceEntry` = 52264 AND + `ConditionTypeOrReference` = 29 AND + `ConditionValue1` = 28653 AND + `ConditionValue2` = 5; From 512b0945a8107ac43a2a50f1af39dee0011f49d4 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 20 May 2012 15:37:13 +0100 Subject: [PATCH 0784/1149] Core/BG: Add map to start zone teleport possible exploit log --- src/server/game/Battlegrounds/Battleground.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 44192a74123..9d5858e1ca4 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -550,7 +550,7 @@ inline void Battleground::_ProcessJoin(uint32 diff) if (dist >= maxDist) { - sLog->outError("BATTLEGROUND: Sending %s back to start location (possible exploit)", plr->GetName()); + sLog->outError("BATTLEGROUND: Sending %s back to start location (map: %u) (possible exploit)", plr->GetName(), GetMapId()); plr->TeleportTo(GetMapId(), x, y, z, o); } } From 7661858ac0a0010e8b9070352218fd534becf774 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 20 May 2012 16:13:52 +0100 Subject: [PATCH 0785/1149] Core/SAI: Few changes to db data validation for actions and event flags --- src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 7 ++++++- src/server/game/AI/SmartScripts/SmartScriptMgr.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index b0f1fcb8ede..a7149f37480 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -324,7 +324,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d, event type %u can not be used for Script type %u", e.entryOrGuid, e.GetEventType(), e.GetScriptType()); return false; } - if (e.action.type >= SMART_ACTION_END) + if (e.action.type <= 0 || e.action.type >= SMART_ACTION_END) { sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has invalid action type (%u), skipped.", e.entryOrGuid, e.event_id, e.GetActionType()); return false; @@ -334,6 +334,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has invalid phase mask (%u), skipped.", e.entryOrGuid, e.event_id, e.event.event_phase_mask); return false; } + if (e.event.event_flags > SMART_EVENT_FLAGS_ALL) + { + sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has invalid event flags (%u), skipped.", e.entryOrGuid, e.event_id, e.event.event_flags); + return false; + } if (e.GetScriptType() == SMART_SCRIPT_TYPE_TIMED_ACTIONLIST) { e.event.type = SMART_EVENT_UPDATE_OOC;//force default OOC, can change when calling the script! diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 8d3686a265d..6bb309c46c2 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -1176,6 +1176,7 @@ enum SmartEventFlags SMART_EVENT_FLAG_DONT_RESET = 0x100, //Event will not reset in SmartScript::OnReset() SMART_EVENT_FLAG_DIFFICULTY_ALL = (SMART_EVENT_FLAG_DIFFICULTY_0|SMART_EVENT_FLAG_DIFFICULTY_1|SMART_EVENT_FLAG_DIFFICULTY_2|SMART_EVENT_FLAG_DIFFICULTY_3) + SMART_EVENT_FLAGS_ALL = (SMART_EVENT_FLAG_NOT_REPEATABLE|SMART_EVENT_FLAG_DIFFICULTY_ALL|SMART_EVENT_FLAG_RESERVED_5|SMART_EVENT_FLAG_RESERVED_6|SMART_EVENT_FLAG_DEBUG_ONLY|SMART_EVENT_FLAG_DONT_RESET) }; enum SmartCastFlags From 66ce5a1148d11cd57f953be04de2b756c6754909 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 20 May 2012 16:36:44 +0100 Subject: [PATCH 0786/1149] And I forgot to Ctrl+S, yay me. --- src/server/game/AI/SmartScripts/SmartScriptMgr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 6bb309c46c2..bde7768f036 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -1175,7 +1175,7 @@ enum SmartEventFlags SMART_EVENT_FLAG_DEBUG_ONLY = 0x080, //Event only occurs in debug build SMART_EVENT_FLAG_DONT_RESET = 0x100, //Event will not reset in SmartScript::OnReset() - SMART_EVENT_FLAG_DIFFICULTY_ALL = (SMART_EVENT_FLAG_DIFFICULTY_0|SMART_EVENT_FLAG_DIFFICULTY_1|SMART_EVENT_FLAG_DIFFICULTY_2|SMART_EVENT_FLAG_DIFFICULTY_3) + SMART_EVENT_FLAG_DIFFICULTY_ALL = (SMART_EVENT_FLAG_DIFFICULTY_0|SMART_EVENT_FLAG_DIFFICULTY_1|SMART_EVENT_FLAG_DIFFICULTY_2|SMART_EVENT_FLAG_DIFFICULTY_3), SMART_EVENT_FLAGS_ALL = (SMART_EVENT_FLAG_NOT_REPEATABLE|SMART_EVENT_FLAG_DIFFICULTY_ALL|SMART_EVENT_FLAG_RESERVED_5|SMART_EVENT_FLAG_RESERVED_6|SMART_EVENT_FLAG_DEBUG_ONLY|SMART_EVENT_FLAG_DONT_RESET) }; From a2d2732c03df73bcd8c8a6c935c099afaae7212c Mon Sep 17 00:00:00 2001 From: faq_ Date: Sun, 20 May 2012 17:16:03 +0100 Subject: [PATCH 0787/1149] DB/Spells: Lay on Hands shouldn't scale with spell power --- sql/updates/world/2012_05_20_01_world_spell_bonus_data.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_05_20_01_world_spell_bonus_data.sql diff --git a/sql/updates/world/2012_05_20_01_world_spell_bonus_data.sql b/sql/updates/world/2012_05_20_01_world_spell_bonus_data.sql new file mode 100644 index 00000000000..7603f7dd938 --- /dev/null +++ b/sql/updates/world/2012_05_20_01_world_spell_bonus_data.sql @@ -0,0 +1,2 @@ +DELETE FROM `spell_bonus_data` WHERE `entry`=633; +INSERT INTO `spell_bonus_data` (`entry`,`comments`) VALUES (633,'Paladin - Lay on Hands'); From e56b2cdd59c5c7673da1aaac5fe8a99d4891e260 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 20 May 2012 17:58:35 +0100 Subject: [PATCH 0788/1149] Core: Fix a few compile warnings --- src/server/game/Conditions/ConditionMgr.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 6 +++--- src/server/game/Maps/Map.cpp | 2 +- src/server/scripts/Spells/spell_generic.cpp | 2 +- src/tools/map_extractor/System.cpp | 18 +++++++++--------- src/tools/map_extractor/adt.cpp | 12 ++++++------ src/tools/map_extractor/loadlib.cpp | 2 +- src/tools/map_extractor/mpq_libmpq04.h | 4 ++-- src/tools/map_extractor/wdt.cpp | 6 +++--- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 96f454fd3e2..4176d9f605b 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -190,7 +190,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) } case CONDITION_OBJECT_ENTRY: { - if (object->GetTypeId() == ConditionValue1) + if (uint32(object->GetTypeId()) == ConditionValue1) condMeets = (!ConditionValue2) || (object->GetEntry() == ConditionValue2); break; } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index d38489ef5a9..f5f336a2402 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -12019,7 +12019,7 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje Map const* map = lootedObject->GetMap(); if (uint32 dungeonId = sLFGMgr->GetDungeon(GetGroup()->GetGUID(), true)) if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId)) - if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == map->GetDifficulty()) + if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == uint32(map->GetDifficulty())) lootedObjectInDungeon = true; if (!lootedObjectInDungeon) @@ -17658,7 +17658,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) } else if (IsBagPos(item->GetPos())) - if (Bag* pBag = item->ToBag()) + if (item->IsBag()) invalidBagMap[item->GetGUIDLow()] = item; } else @@ -17811,7 +17811,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F GameEventMgr::ActiveEvents const& activeEventsList = sGameEventMgr->GetActiveEventList(); for (GameEventMgr::ActiveEvents::const_iterator itr = activeEventsList.begin(); itr != activeEventsList.end(); ++itr) { - if (events[*itr].holiday_id == proto->HolidayId) + if (uint32(events[*itr].holiday_id) == proto->HolidayId) { remove = false; break; diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index a1b3d913c99..162dd12d121 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2470,7 +2470,7 @@ bool InstanceMap::AddPlayerToMap(Player* player) if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true)) if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId)) if (LFGDungeonEntry const* randomDungeon = sLFGDungeonStore.LookupEntry(*(sLFGMgr->GetSelectedDungeons(player->GetGUID()).begin()))) - if (uint32(dungeon->map) == GetId() && dungeon->difficulty == GetDifficulty() && randomDungeon->type == LFG_TYPE_RANDOM) + if (uint32(dungeon->map) == GetId() && dungeon->difficulty == uint32(GetDifficulty()) && randomDungeon->type == uint32(LFG_TYPE_RANDOM)) player->CastSpell(player, LFG_SPELL_LUCK_OF_THE_DRAW, true); } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 501c7c47676..0c879cfb029 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1513,7 +1513,7 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader if (group->isLFGGroup()) if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true)) if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId)) - if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == map->GetDifficulty()) + if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == uint32(map->GetDifficulty())) if (randomDungeon && randomDungeon->type == LFG_TYPE_RANDOM) return; // in correct dungeon diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index cf2f2188a70..3deb9f44dd7 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -221,7 +221,7 @@ uint32 ReadMapDBC() map_ids[x].id = dbc.getRecord(x).getUInt(0); strcpy(map_ids[x].name, dbc.getRecord(x).getString(1)); } - printf("Done! (%u maps loaded)\n", map_count); + printf("Done! (%d maps loaded)\n", map_count); return map_count; } @@ -246,7 +246,7 @@ void ReadAreaTableDBC() maxAreaId = dbc.getMaxId(); - printf("Done! (%u areas loaded)\n", area_count); + printf("Done! (%d areas loaded)\n", area_count); } void ReadLiquidTypeTableDBC() @@ -259,15 +259,15 @@ void ReadLiquidTypeTableDBC() exit(1); } - size_t LiqType_count = dbc.getRecordCount(); - size_t LiqType_maxid = dbc.getMaxId(); - LiqType = new uint16[LiqType_maxid + 1]; - memset(LiqType, 0xff, (LiqType_maxid + 1) * sizeof(uint16)); + size_t liqTypeCount = dbc.getRecordCount(); + size_t liqTypeMaxId = dbc.getMaxId(); + LiqType = new uint16[liqTypeMaxId + 1]; + memset(LiqType, 0xff, (liqTypeMaxId + 1) * sizeof(uint16)); - for(uint32 x = 0; x < LiqType_count; ++x) + for(uint32 x = 0; x < liqTypeCount; ++x) LiqType[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3); - printf("Done! (%u LiqTypes loaded)\n", LiqType_count); + printf("Done! (%d LiqTypes loaded)\n", liqTypeCount); } // @@ -364,7 +364,7 @@ uint8 liquid_flags[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID]; bool liquid_show[ADT_GRID_SIZE][ADT_GRID_SIZE]; float liquid_height[ADT_GRID_SIZE+1][ADT_GRID_SIZE+1]; -bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32 build) +bool ConvertADT(char *filename, char *filename2, int /*cell_y*/, /*int cell_x*/, uint32 build) { ADT_file adt; diff --git a/src/tools/map_extractor/adt.cpp b/src/tools/map_extractor/adt.cpp index fde70681113..66134180cb0 100644 --- a/src/tools/map_extractor/adt.cpp +++ b/src/tools/map_extractor/adt.cpp @@ -53,7 +53,7 @@ bool ADT_file::prepareLoadedData() bool adt_MHDR::prepareLoadedData() { - if (fcc != 'MHDR') + if (fcc != "MHDR") return false; if (size!=sizeof(adt_MHDR)-8) @@ -72,7 +72,7 @@ bool adt_MHDR::prepareLoadedData() bool adt_MCIN::prepareLoadedData() { - if (fcc != 'MCIN') + if (fcc != "MCIN") return false; // Check cells data @@ -86,7 +86,7 @@ bool adt_MCIN::prepareLoadedData() bool adt_MH2O::prepareLoadedData() { - if (fcc != 'MH2O') + if (fcc != "MH2O") return false; // Check liquid data @@ -98,7 +98,7 @@ bool adt_MH2O::prepareLoadedData() bool adt_MCNK::prepareLoadedData() { - if (fcc != 'MCNK') + if (fcc != "MCNK") return false; // Check height map @@ -113,7 +113,7 @@ bool adt_MCNK::prepareLoadedData() bool adt_MCVT::prepareLoadedData() { - if (fcc != 'MCVT') + if (fcc != "MCVT") return false; if (size != sizeof(adt_MCVT)-8) @@ -124,7 +124,7 @@ bool adt_MCVT::prepareLoadedData() bool adt_MCLQ::prepareLoadedData() { - if (fcc != 'MCLQ') + if (fcc != "MCLQ") return false; return true; diff --git a/src/tools/map_extractor/loadlib.cpp b/src/tools/map_extractor/loadlib.cpp index 465eb04083f..77dca04d4c8 100644 --- a/src/tools/map_extractor/loadlib.cpp +++ b/src/tools/map_extractor/loadlib.cpp @@ -49,7 +49,7 @@ bool FileLoader::prepareLoadedData() { // Check version version = (file_MVER *) data; - if (version->fcc != 'MVER') + if (version->fcc != "MVER") return false; if (version->ver != FILE_FORMAT_VERSION) return false; diff --git a/src/tools/map_extractor/mpq_libmpq04.h b/src/tools/map_extractor/mpq_libmpq04.h index 1f3b259bbfc..89f715e9e87 100644 --- a/src/tools/map_extractor/mpq_libmpq04.h +++ b/src/tools/map_extractor/mpq_libmpq04.h @@ -60,8 +60,8 @@ class MPQFile libmpq__off_t pointer,size; // disable copying - MPQFile(const MPQFile &f) {} - void operator=(const MPQFile &f) {} + MPQFile(const MPQFile& /*f*/) {} + void operator=(const MPQFile& /*f*/) {} public: MPQFile(const char* filename); // filenames are not case sensitive diff --git a/src/tools/map_extractor/wdt.cpp b/src/tools/map_extractor/wdt.cpp index dedefbb64e5..d9ad0f4c7d3 100644 --- a/src/tools/map_extractor/wdt.cpp +++ b/src/tools/map_extractor/wdt.cpp @@ -4,21 +4,21 @@ bool wdt_MWMO::prepareLoadedData() { - if (fcc != 'MWMO') + if (fcc != "MWMO") return false; return true; } bool wdt_MPHD::prepareLoadedData() { - if (fcc != 'MPHD') + if (fcc != "MPHD") return false; return true; } bool wdt_MAIN::prepareLoadedData() { - if (fcc != 'MAIN') + if (fcc != "MAIN") return false; return true; } From 23be8c4fd719bb67e6a2dc9bc4114766bd62507f Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 20 May 2012 18:22:34 +0100 Subject: [PATCH 0789/1149] Scripts/VH: Add an 1 minute pause after each boss fight (instead of 5 seconds) Revert one of the warning fixes (non standard C++) --- src/server/game/Spells/SpellInfo.cpp | 2 +- .../Northrend/VioletHold/instance_violet_hold.cpp | 3 ++- src/tools/map_extractor/adt.cpp | 12 ++++++------ src/tools/map_extractor/loadlib.cpp | 2 +- src/tools/map_extractor/wdt.cpp | 6 +++--- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index e9e1b0eee8d..a931f759163 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -351,7 +351,7 @@ bool SpellEffectInfo::IsEffect() const bool SpellEffectInfo::IsEffect(SpellEffects effectName) const { - return Effect == effectName; + return Effect == uint32(effectName); } bool SpellEffectInfo::IsAura() const diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp index 79c54880430..37a13388b5f 100644 --- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp @@ -690,7 +690,8 @@ public: { AddWave(); bActive = false; - uiActivationTimer = 5000; + // 1 minute waiting time after each boss fight + uiActivationTimer = (uiWaveCount == 6 || uiWaveCount == 12) ? 60000 : 5000; } else uiActivationTimer -= diff; } diff --git a/src/tools/map_extractor/adt.cpp b/src/tools/map_extractor/adt.cpp index 66134180cb0..fde70681113 100644 --- a/src/tools/map_extractor/adt.cpp +++ b/src/tools/map_extractor/adt.cpp @@ -53,7 +53,7 @@ bool ADT_file::prepareLoadedData() bool adt_MHDR::prepareLoadedData() { - if (fcc != "MHDR") + if (fcc != 'MHDR') return false; if (size!=sizeof(adt_MHDR)-8) @@ -72,7 +72,7 @@ bool adt_MHDR::prepareLoadedData() bool adt_MCIN::prepareLoadedData() { - if (fcc != "MCIN") + if (fcc != 'MCIN') return false; // Check cells data @@ -86,7 +86,7 @@ bool adt_MCIN::prepareLoadedData() bool adt_MH2O::prepareLoadedData() { - if (fcc != "MH2O") + if (fcc != 'MH2O') return false; // Check liquid data @@ -98,7 +98,7 @@ bool adt_MH2O::prepareLoadedData() bool adt_MCNK::prepareLoadedData() { - if (fcc != "MCNK") + if (fcc != 'MCNK') return false; // Check height map @@ -113,7 +113,7 @@ bool adt_MCNK::prepareLoadedData() bool adt_MCVT::prepareLoadedData() { - if (fcc != "MCVT") + if (fcc != 'MCVT') return false; if (size != sizeof(adt_MCVT)-8) @@ -124,7 +124,7 @@ bool adt_MCVT::prepareLoadedData() bool adt_MCLQ::prepareLoadedData() { - if (fcc != "MCLQ") + if (fcc != 'MCLQ') return false; return true; diff --git a/src/tools/map_extractor/loadlib.cpp b/src/tools/map_extractor/loadlib.cpp index 77dca04d4c8..465eb04083f 100644 --- a/src/tools/map_extractor/loadlib.cpp +++ b/src/tools/map_extractor/loadlib.cpp @@ -49,7 +49,7 @@ bool FileLoader::prepareLoadedData() { // Check version version = (file_MVER *) data; - if (version->fcc != "MVER") + if (version->fcc != 'MVER') return false; if (version->ver != FILE_FORMAT_VERSION) return false; diff --git a/src/tools/map_extractor/wdt.cpp b/src/tools/map_extractor/wdt.cpp index d9ad0f4c7d3..dedefbb64e5 100644 --- a/src/tools/map_extractor/wdt.cpp +++ b/src/tools/map_extractor/wdt.cpp @@ -4,21 +4,21 @@ bool wdt_MWMO::prepareLoadedData() { - if (fcc != "MWMO") + if (fcc != 'MWMO') return false; return true; } bool wdt_MPHD::prepareLoadedData() { - if (fcc != "MPHD") + if (fcc != 'MPHD') return false; return true; } bool wdt_MAIN::prepareLoadedData() { - if (fcc != "MAIN") + if (fcc != 'MAIN') return false; return true; } From 36ea485f9a62bedf7b1114f0536322f241fed2e1 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 20 May 2012 18:37:10 +0100 Subject: [PATCH 0790/1149] Tools: Fix a typo and printf formats (there's no standard format for size_t) --- src/tools/map_extractor/System.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 3deb9f44dd7..1505f2c2cee 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -221,7 +221,7 @@ uint32 ReadMapDBC() map_ids[x].id = dbc.getRecord(x).getUInt(0); strcpy(map_ids[x].name, dbc.getRecord(x).getString(1)); } - printf("Done! (%d maps loaded)\n", map_count); + printf("Done! (%u maps loaded)\n", map_count); return map_count; } @@ -246,7 +246,7 @@ void ReadAreaTableDBC() maxAreaId = dbc.getMaxId(); - printf("Done! (%d areas loaded)\n", area_count); + printf("Done! (%u areas loaded)\n", area_count); } void ReadLiquidTypeTableDBC() @@ -267,7 +267,7 @@ void ReadLiquidTypeTableDBC() for(uint32 x = 0; x < liqTypeCount; ++x) LiqType[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3); - printf("Done! (%d LiqTypes loaded)\n", liqTypeCount); + printf("Done! (%u LiqTypes loaded)\n", liqTypeCount); } // @@ -364,7 +364,7 @@ uint8 liquid_flags[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID]; bool liquid_show[ADT_GRID_SIZE][ADT_GRID_SIZE]; float liquid_height[ADT_GRID_SIZE+1][ADT_GRID_SIZE+1]; -bool ConvertADT(char *filename, char *filename2, int /*cell_y*/, /*int cell_x*/, uint32 build) +bool ConvertADT(char *filename, char *filename2, int /*cell_y*/, int /*cell_x*/, uint32 build) { ADT_file adt; From 868e38ebcbac5b94b6d2810730114b64b3cbea27 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 20 May 2012 20:33:49 +0100 Subject: [PATCH 0791/1149] Core/BG: Move the log "ArenaTeam x does not have any members or ..." from DB error to debug level --- src/server/game/Battlegrounds/ArenaTeam.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index 73e24e5a3c3..89151b6395c 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -267,7 +267,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult result) if (Empty() || !captainPresentInTeam) { // Arena team is empty or captain is not in team, delete from db - sLog->outErrorDb("ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", TeamId); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", TeamId); return false; } From 388250961f24cbe2ba955da6d7446965d058f97d Mon Sep 17 00:00:00 2001 From: Mik43l Date: Sun, 20 May 2012 22:09:12 +0200 Subject: [PATCH 0792/1149] [Core/Spell]: Fix Blessing of Ancient Kings (Val'anyr, Hammer of Ancient Kings) closes #6521 --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a4d02ee5ea1..ba481176d23 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5870,7 +5870,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere if (AuraEffect* aurEff = victim->GetAuraEffect(64413, 0, GetGUID())) { // The shield can grow to a maximum size of 20, 000 damage absorbtion - aurEff->SetAmount(std::max(aurEff->GetAmount() + basepoints0, 20000)); + aurEff->SetAmount(std::min(aurEff->GetAmount() + basepoints0, 20000)); // Refresh and return to prevent replacing the aura aurEff->GetBase()->RefreshDuration(); From 6b8d4ce123a40d66968a8fcb56e14364355fdb5d Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Mon, 21 May 2012 00:03:43 +0200 Subject: [PATCH 0793/1149] Core/Spell: Fix spell effect SPELL_EFFECT_HEAL_MAX_HEALTH calculation --- src/server/game/Spells/SpellEffects.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 07bea5f980c..17e79501d16 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3565,7 +3565,7 @@ void Spell::EffectHealMaxHealth(SpellEffIndex /*effIndex*/) if (!unitTarget || !unitTarget->isAlive()) return; - int32 addhealth; + int32 addhealth = 0; if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN) // Lay on Hands { if (m_caster->GetGUID() == unitTarget->GetGUID()) @@ -3582,11 +3582,7 @@ void Spell::EffectHealMaxHealth(SpellEffIndex /*effIndex*/) else addhealth = unitTarget->GetMaxHealth() - unitTarget->GetHealth(); - if (m_originalCaster) - { - uint32 heal = m_originalCaster->SpellHealingBonusDone(unitTarget, m_spellInfo, addhealth, HEAL); - m_healing += unitTarget->SpellHealingBonusTaken(m_originalCaster, m_spellInfo, heal, HEAL); - } + m_healing += addhealth; } void Spell::EffectInterruptCast(SpellEffIndex effIndex) From 4e9de61e97050dfcfa402f8fe16cd820f2938aa9 Mon Sep 17 00:00:00 2001 From: Chaplain Date: Mon, 21 May 2012 13:28:37 +0300 Subject: [PATCH 0794/1149] Core/MapManager: Fix logic in SetMapUpdateInterval() --- src/server/game/Maps/MapManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Maps/MapManager.h b/src/server/game/Maps/MapManager.h index 1049325237a..106c2189c65 100755 --- a/src/server/game/Maps/MapManager.h +++ b/src/server/game/Maps/MapManager.h @@ -71,7 +71,7 @@ class MapManager void SetMapUpdateInterval(uint32 t) { - if (t > MIN_MAP_UPDATE_DELAY) + if (t < MIN_MAP_UPDATE_DELAY) t = MIN_MAP_UPDATE_DELAY; i_timer.SetInterval(t); From 5a154ac27249b6584cba15063698584b165f2038 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Mon, 21 May 2012 00:22:58 +0200 Subject: [PATCH 0795/1149] Core/Spell: DK T10 Melee 4P is SPELL_AURA_PROC_TRIGGER_SPELL proc --- src/server/game/Entities/Unit/Unit.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index ba481176d23..9689a0c6402 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7786,17 +7786,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } } } - // Item - Death Knight T10 Melee 4P Bonus - if (dummySpell->Id == 70656) - { - Player* player = ToPlayer(); - if (!player) - return false; - - for (uint32 i = 0; i < MAX_RUNES; ++i) - if (player->GetRuneCooldown(i) == 0) - return false; - } break; } case SPELLFAMILY_POTION: @@ -8724,6 +8713,16 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg trigger_spell_id = 50475; basepoints0 = CalculatePctN(int32(damage), triggerAmount); } + // Item - Death Knight T10 Melee 4P Bonus + else if (auraSpellInfo->Id == 70656) + { + if (GetTypeId() != TYPEID_PLAYER || getClass() != CLASS_DEATH_KNIGHT) + return false; + + for (uint8 i = 0; i < MAX_RUNES; ++i) + if (ToPlayer()->GetRuneCooldown(i) == 0) + return false; + } break; } case SPELLFAMILY_ROGUE: From 4943eb4391a8314efd58e2966f48f476a1e0ac12 Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 22 May 2012 09:18:35 -0400 Subject: [PATCH 0796/1149] DB/Spells: fixes proc flags for blood presence. sorry :[ Closes #6564 --- sql/updates/world/2012_05_22_00_world_spell_proc_event.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2012_05_22_00_world_spell_proc_event.sql diff --git a/sql/updates/world/2012_05_22_00_world_spell_proc_event.sql b/sql/updates/world/2012_05_22_00_world_spell_proc_event.sql new file mode 100644 index 00000000000..ba2ea83f643 --- /dev/null +++ b/sql/updates/world/2012_05_22_00_world_spell_proc_event.sql @@ -0,0 +1 @@ +UPDATE `spell_proc_event` SET `procFlags` = 332116 WHERE `entry` = 63611; From 99040237c7d9f5e1ffcca0416b6b7fef8ea8cd1a Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 22 May 2012 12:32:53 -0400 Subject: [PATCH 0797/1149] Core/Items: correctly cast spells on item store. Closes #4208 --- src/server/game/Entities/Player/Player.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f5f336a2402..3a5bfa6c8c1 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -12180,11 +12180,6 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update pItem->SetItemRandomProperties(randomPropertyId); pItem = StoreItem(dest, pItem, update); - const ItemTemplate* proto = pItem->GetTemplate(); - for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) - if (proto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE && proto->Spells[i].SpellId > 0) // On obtain trigger - CastSpell(this, proto->Spells[i].SpellId, true, pItem); - if (allowedLooters.size() > 1 && pItem->GetTemplate()->GetMaxStackSize() == 1 && pItem->IsSoulBound()) { pItem->SetSoulboundTradeable(allowedLooters); @@ -12290,6 +12285,14 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool AddEnchantmentDurations(pItem); AddItemDurations(pItem); + + const ItemTemplate* proto = pItem->GetTemplate(); + for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) + if (proto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE && proto->Spells[i].SpellId > 0) // On obtain trigger + if (bag == INVENTORY_SLOT_BAG_0 || (bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END)) + if (HasAura(proto->Spells[i].SpellId)) + CastSpell(this, proto->Spells[i].SpellId, true, pItem); + return pItem; } else @@ -12326,6 +12329,13 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool pItem2->SetState(ITEM_CHANGED, this); + const ItemTemplate* proto = pItem2->GetTemplate(); + for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) + if (proto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE && proto->Spells[i].SpellId > 0) // On obtain trigger + if (bag == INVENTORY_SLOT_BAG_0 || (bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END)) + if (HasAura(proto->Spells[i].SpellId)) + CastSpell(this, proto->Spells[i].SpellId, true, pItem2); + return pItem2; } } From 83c8c974de0807c732a92f6bc33bcdeae610b5a6 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Tue, 22 May 2012 19:13:38 +0200 Subject: [PATCH 0798/1149] DB/Loot: make Formula: Enchant Boots - Surefooted a garanteed drop Closes #6579 --- .../world/2012_05_22_01_world_creature_loot_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_05_22_01_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_05_22_01_world_creature_loot_template.sql b/sql/updates/world/2012_05_22_01_world_creature_loot_template.sql new file mode 100644 index 00000000000..bcae5be9ae1 --- /dev/null +++ b/sql/updates/world/2012_05_22_01_world_creature_loot_template.sql @@ -0,0 +1,2 @@ +-- As of patch 3.1.0, the drop rate of Formula: Enchant Boots - Surefooted has been increased to Guaranteed (100%). +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=100 WHERE `entry`=16472 and `item`=22545; From df9791f1aa09b33e061133047b679951ba656357 Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 22 May 2012 14:05:53 -0400 Subject: [PATCH 0799/1149] Core/Items: fix typo from previous commit (thx vincentmichael) --- src/server/game/Entities/Player/Player.cpp | 6 +++--- src/server/game/Entities/Unit/Unit.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 3a5bfa6c8c1..2448f4a3199 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -12290,7 +12290,7 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) if (proto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE && proto->Spells[i].SpellId > 0) // On obtain trigger if (bag == INVENTORY_SLOT_BAG_0 || (bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END)) - if (HasAura(proto->Spells[i].SpellId)) + if (!HasAura(proto->Spells[i].SpellId)) CastSpell(this, proto->Spells[i].SpellId, true, pItem); return pItem; @@ -12333,7 +12333,7 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) if (proto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE && proto->Spells[i].SpellId > 0) // On obtain trigger if (bag == INVENTORY_SLOT_BAG_0 || (bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END)) - if (HasAura(proto->Spells[i].SpellId)) + if (!HasAura(proto->Spells[i].SpellId)) CastSpell(this, proto->Spells[i].SpellId, true, pItem2); return pItem2; @@ -16385,7 +16385,7 @@ void Player::ReputationChanged2(FactionEntry const* factionEntry) } } -bool Player::HasQuestForItem(uint32 itemid) const + bool Player::HasQuestForItem(uint32 itemid) const { for (uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i) { diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index e45f1214f4f..bc4a824d1d7 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -8039,7 +8039,7 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp *handled = true; if (victim && victim->HasAura(53601)) { - int32 bp0 = CalculatePctN(int32(damage / 12), dummySpell->Effects[EFFECT_2]. CalcValue()); + int32 bp0 = CalculatePctN(int32(damage / 12), dummySpell->Effects[EFFECT_2].CalcValue()); // Item - Paladin T9 Holy 4P Bonus if (AuraEffect const* aurEff = GetAuraEffect(67191, 0)) AddPctN(bp0, aurEff->GetAmount()); From c8e00ddfc5cdce68a1d12b227a39da9ea6900810 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Wed, 23 May 2012 09:12:31 +0200 Subject: [PATCH 0800/1149] DB/Creature: Add spawns for Chicken Escapee & set their aura accordingly (sniffs) --- .../world/2012_05_23_00_world_creature.sql | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 sql/updates/world/2012_05_23_00_world_creature.sql diff --git a/sql/updates/world/2012_05_23_00_world_creature.sql b/sql/updates/world/2012_05_23_00_world_creature.sql new file mode 100644 index 00000000000..8a965b7fdfe --- /dev/null +++ b/sql/updates/world/2012_05_23_00_world_creature.sql @@ -0,0 +1,55 @@ +-- Chicken Spawns from sniff: +SET @Chicken := 28161; +SET @CGUID := 88570; +DELETE FROM `creature` WHERE `id`=@Chicken; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`MovementType`) VALUES +(@CGUID,@Chicken,571,1,1,5199.809,4704.83,-128.2989,1.70125,120,0,0), -- Chicken Escapee +(@CGUID+1,@Chicken,571,1,1,5201.715,4702.484,-127.8371,1.53589,120,0,0), -- Chicken Escapee +(@CGUID+2,@Chicken,571,1,1,5198.132,4702.78,-127.5534,1.797689,120,0,0), -- Chicken Escapee +(@CGUID+3,@Chicken,571,1,1,5198.32,4704.375,-127.9992,1.064651,120,0,0), -- Chicken Escapee +(@CGUID+4,@Chicken,571,1,1,5201.744,4704.674,-128.4752,4.555309,120,0,0), -- Chicken Escapee +(@CGUID+5,@Chicken,571,1,1,5251.442,4508.976,-85.30431,4.304774,120,0,0), -- Chicken Escapee +(@CGUID+6,@Chicken,571,1,1,5251.708,4511.778,-85.32935,1.64061,120,0,0), -- Chicken Escapee +(@CGUID+7,@Chicken,571,1,1,5251.118,4509.744,-85.32935,4.886922,120,0,0), -- Chicken Escapee +(@CGUID+8,@Chicken,571,1,1,5252.795,4509.772,-85.32524,0.7853982,120,0,0), -- Chicken Escapee +(@CGUID+9,@Chicken,571,1,1,5253.682,4511.424,-85.32755,2.356194,120,0,0), -- Chicken Escapee +(@CGUID+10,@Chicken,571,1,1,5254.174,4514.632,-84.96572,0.4096795,120,0,0), -- Chicken Escapee +(@CGUID+11,@Chicken,571,1,1,5252.096,4514.868,-85.32635,4.363323,120,0,0), -- Chicken Escapee +(@CGUID+12,@Chicken,571,1,1,5251.637,4513.41,-85.32935,3.490659,120,0,0), -- Chicken Escapee +(@CGUID+13,@Chicken,571,1,1,5253.287,4513.109,-85.32935,3.036873,120,0,0), -- Chicken Escapee +(@CGUID+14,@Chicken,571,1,1,5253.494,4514.764,-85.31329,3.717551,120,0,0), -- Chicken Escapee +(@CGUID+15,@Chicken,571,1,1,5251.158,4518.321,-85.3019,1.592369,120,0,0), -- Chicken Escapee +(@CGUID+16,@Chicken,571,1,1,5250.385,4516.643,-85.3257,5.044002,120,0,0), -- Chicken Escapee +(@CGUID+17,@Chicken,571,1,1,5251.159,4515.294,-85.32935,4.694936,120,0,0), -- Chicken Escapee +(@CGUID+18,@Chicken,571,1,1,5252.267,4516.414,-85.30904,0.5235988,120,0,0), -- Chicken Escapee +(@CGUID+19,@Chicken,571,1,1,5251.693,4517.859,-85.3243,4.590216,120,0,0), -- Chicken Escapee +(@CGUID+20,@Chicken,571,1,1,5262.68,4528.738,-84.4747,4.718389,120,0,0), -- Chicken Escapee +(@CGUID+21,@Chicken,571,1,1,5256.907,4480.617,-84.26879,4.927223,120,0,0), -- Chicken Escapee +(@CGUID+22,@Chicken,571,1,1,5298.603,4489.708,-93.65161,6.16371,120,0,0), -- Chicken Escapee +(@CGUID+23,@Chicken,571,1,1,5192.673,4513.661,-89.12463,1.299241,120,0,0), -- Chicken Escapee +(@CGUID+24,@Chicken,571,1,1,5228.781,4579.799,-96.98647,0.05766594,120,0,0), -- Chicken Escapee +(@CGUID+25,@Chicken,571,1,1,5230.247,4433.143,-96.82567,5.135688,120,0,0), -- Chicken Escapee +(@CGUID+26,@Chicken,571,1,1,5180.035,4541.38,-97.84879,0.2208638,120,0,0), -- Chicken Escapee +(@CGUID+27,@Chicken,571,1,1,5178.563,4538.964,-97.54511,0.9771074,120,0,0), -- Chicken Escapee +(@CGUID+28,@Chicken,571,1,1,5272.981,4417.033,-96.50356,0.9044432,120,0,0), -- Chicken Escapee +(@CGUID+29,@Chicken,571,1,1,5214.513,4416.202,-96.53072,2.862281,120,0,0), -- Chicken Escapee +(@CGUID+30,@Chicken,571,1,1,5160.117,4474.996,-96.96887,4.499754,120,0,0), -- Chicken Escapee +(@CGUID+31,@Chicken,571,1,1,5263.541,4409.121,-95.87889,1.570796,120,0,0), -- Chicken Escapee +(@CGUID+32,@Chicken,571,1,1,5234.166,4404.604,-95.12725,1.031549,120,0,0), -- Chicken Escapee +(@CGUID+33,@Chicken,571,1,1,5297.803,4493.681,-93.65161,5.525303,120,0,0), -- Chicken Escapee +(@CGUID+34,@Chicken,571,1,1,5260.112,4340.577,-97.61092,1.942801,120,0,0), -- Chicken Escapee +(@CGUID+35,@Chicken,571,1,1,5208.492,4379.111,-95.49483,0.6675518,120,0,0), -- Chicken Escapee +(@CGUID+36,@Chicken,571,1,1,5172.742,4368.674,-96.27965,0.8766832,120,0,0), -- Chicken Escapee +(@CGUID+37,@Chicken,571,1,1,5223.491,4467.19,-96.75621,4.723376,120,0,0), -- Chicken Escapee +(@CGUID+38,@Chicken,571,1,1,5220.966,4469.76,-96.75582,5.183968,120,0,0), -- Chicken Escapee +(@CGUID+39,@Chicken,571,1,1,5221.419,4473.14,-96.75536,4.98181,120,0,0), -- Chicken Escapee +(@CGUID+40,@Chicken,571,1,1,5221.419,4473.14,-96.75536,5.49084,120,0,0), -- Chicken Escapee +(@CGUID+41,@Chicken,571,1,1,5221.828,4470.711,-96.57594,5.315169,120,0,0), -- Chicken Escapee +(@CGUID+42,@Chicken,571,1,1,5151.083,4416.434,-96.38642,2.066685,120,0,0), -- Chicken Escapee +(@CGUID+43,@Chicken,571,1,1,5281.582,4425.185,-96.79945,4.45059,120,0,0), -- Chicken Escapee +(@CGUID+44,@Chicken,571,1,1,5257.173,4424.231,-95.62836,3.996804,120,0,0); -- Chicken Escapee + +-- Aura for Chicken Escapee (thx Discovered) +DELETE FROM `creature_template_addon` WHERE `entry`=28161; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(28161,0,0,0,0,'50734'); -- Chicken Escapee - Frenzyheart Chicken: Invisibility From e974cff1e6d755d82f14040b69d717005bbf9740 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Wed, 23 May 2012 09:25:02 +0200 Subject: [PATCH 0801/1149] DB/SAI: add SAI for Elder Harkek & remove the ugly spawning via quest_start_scripts major kudos for Discovered on the SAI part of the fix --- sql/updates/world/2012_05_23_01_world_sai.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 sql/updates/world/2012_05_23_01_world_sai.sql diff --git a/sql/updates/world/2012_05_23_01_world_sai.sql b/sql/updates/world/2012_05_23_01_world_sai.sql new file mode 100644 index 00000000000..af2fd5409d1 --- /dev/null +++ b/sql/updates/world/2012_05_23_01_world_sai.sql @@ -0,0 +1,14 @@ +-- Delete all spawnings of Chicken Escapee via quest_start_scripts +DELETE FROM `quest_start_scripts` WHERE `command`=10 AND `datalong`=28161; + +-- Elder Harkek SAI +SET @ENTRY := 28138; +SET @SPELL_SEE_INVIS_CHICKEN := 50735; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,19,0,100,0,12532,0,0,0,85,@SPELL_SEE_INVIS_CHICKEN,2,0,0,0,0,7,0,0,0,0,0,0,0,"Elder Harkek - On Quest Accept - Invoker Cast Frenzyheart Chicken: See Invisibility"), +(@ENTRY,0,1,0,19,0,100,0,12702,0,0,0,85,@SPELL_SEE_INVIS_CHICKEN,2,0,0,0,0,7,0,0,0,0,0,0,0,"Elder Harkek - On Quest Accept - Invoker Cast Frenzyheart Chicken: See Invisibility"), +(@ENTRY,0,2,0,20,0,100,0,12532,0,0,0,28,@SPELL_SEE_INVIS_CHICKEN,0,0,0,0,0,7,0,0,0,0,0,0,0,"Elder Harkek - On Quest Complete - Remove Aura Frenzyheart Chicken: See Invisibility"), +(@ENTRY,0,3,0,20,0,100,0,12702,0,0,0,28,@SPELL_SEE_INVIS_CHICKEN,0,0,0,0,0,7,0,0,0,0,0,0,0,"Elder Harkek - On Quest Complete - Remove Aura Frenzyheart Chicken: See Invisibility"); From f4c8f6ed7321aadb3ce3372064f63f6f4e51adfa Mon Sep 17 00:00:00 2001 From: Discovered Date: Wed, 23 May 2012 11:28:50 +0200 Subject: [PATCH 0802/1149] DB/SAI: Add SAI for the Chicken Escapee --- sql/updates/world/2012_05_23_02_world_sai.sql | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 sql/updates/world/2012_05_23_02_world_sai.sql diff --git a/sql/updates/world/2012_05_23_02_world_sai.sql b/sql/updates/world/2012_05_23_02_world_sai.sql new file mode 100644 index 00000000000..588f25f1568 --- /dev/null +++ b/sql/updates/world/2012_05_23_02_world_sai.sql @@ -0,0 +1,21 @@ +-- Chicken Escapee SAI +SET @ENTRY := 28161; +SET @SPELL_NET_CHICKEN := 51959; +SET @SPELL_INVIS_CHICKEN := 50734; +SET @SPELL_SCARED_CHICKEN := 51846; +SET @SPELL_CREATE_QUESTITEM := 51037; +UPDATE `creature` SET `MovementType`=0,`spawndist`=0,`spawntimesecs`=5 WHERE `id`=@ENTRY; +UPDATE `creature_template` SET `AIName`='SmartAI',`npcflag`=1 WHERE `entry`=@ENTRY; +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,8,0,100,0,@SPELL_NET_CHICKEN,0,0,0,28,@SPELL_SCARED_CHICKEN,0,0,0,0,0,1,0,0,0,0,0,0,0,"Chicken Escapee - On Spellhit - Remove Aura Scared Chicken"), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,41,4000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Chicken Escapee - On Spellhit - Forced Despawn"), +(@ENTRY,0,2,3,64,0,100,0,0,0,0,0,85,@SPELL_CREATE_QUESTITEM,2,0,0,0,0,7,0,0,0,0,0,0,0,"Chicken Escapee - On Gossip Hello - Invoker Cast Capture Chicken Escapee"), -- Triggered because of cast-time +(@ENTRY,0,3,4,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Chicken Escapee - On Gossip Hello - Close Gossip"), +(@ENTRY,0,4,5,61,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Chicken Escapee - On Gossip Hello - Set Npcflag None"), +(@ENTRY,0,5,6,61,0,100,0,0,0,0,0,28,@SPELL_SCARED_CHICKEN,0,0,0,0,0,1,0,0,0,0,0,0,0,"Chicken Escapee - On Gossip Hello - Remove Aura Scared Chicken"), +(@ENTRY,0,6,0,61,0,100,0,0,0,0,0,41,500,0,0,0,0,0,1,0,0,0,0,0,0,0,"Chicken Escapee - On Gossip Hello - Forced Despawn"), +(@ENTRY,0,7,8,25,0,100,0,0,0,0,0,11,@SPELL_INVIS_CHICKEN,1,0,0,0,0,1,0,0,0,0,0,0,0,"Chicken Escapee - On Reset - Cast Frenzyheart Chicken: Invisibility"), -- Just in case +(@ENTRY,0,8,0,61,0,100,0,0,0,0,0,11,@SPELL_SCARED_CHICKEN,0,0,0,0,0,1,0,0,0,0,0,0,0,"Chicken Escapee - On Reset - Cast Scared Chicken"); From 66d42b4f296fa455bfc96ed6a09e64ed5cc62a9d Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 23 May 2012 14:24:28 +0200 Subject: [PATCH 0803/1149] Core/Protocol: Process CMSG_UPDATE_MISSILE_TRAJECTORY packets --- src/server/game/Handlers/MiscHandler.cpp | 45 +++++++++++++++++++++ src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/WorldSession.h | 1 + 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 35872f8c63f..9abd39f90ec 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -51,6 +51,7 @@ #include "GameObjectAI.h" #include "Group.h" #include "AccountMgr.h" +#include "Spell.h" void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data) { @@ -1714,3 +1715,47 @@ void WorldSession::HandleInstanceLockResponse(WorldPacket& recvPacket) _player->SetPendingBind(0, 0); } + +void WorldSession::HandleUpdateMissileTrajectory(WorldPacket& recvPacket) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_UPDATE_MISSILE_TRAJECTORY"); + + uint64 guid; + uint32 spellId; + float elevation, speed; + float curX, curY, curZ; + float targetX, targetY, targetZ; + uint8 moveStop; + + recvPacket >> guid >> spellId >> elevation >> speed; + recvPacket >> curX >> curY >> curZ; + recvPacket >> targetX >> targetY >> targetZ; + recvPacket >> moveStop; + + Unit* caster = ObjectAccessor::GetUnit(*_player, guid); + Spell* spell = caster ? caster->GetCurrentSpell(CURRENT_CHANNELED_SPELL) : NULL; + if (!spell || spell->m_spellInfo->Id != spellId || !spell->m_targets.HasDst()) + { + recvPacket.rfinish(); + return; + } + + Position pos = *spell->m_targets.GetSrcPos(); + pos.Relocate(curX, curY, curZ); + spell->m_targets.ModSrc(pos); + + pos = *spell->m_targets.GetDstPos(); + pos.Relocate(targetX, targetY, targetZ); + spell->m_targets.ModDst(pos); + + spell->m_targets.SetElevation(elevation); + spell->m_targets.SetSpeed(speed); + + if (moveStop) + { + uint32 opcode; + recvPacket >> opcode; + recvPacket.SetOpcode(opcode); + HandleMovementOpcodes(recvPacket); + } +} diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 517935acbd2..bd9c75c251d 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1148,7 +1148,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x45F*/ { "CMSG_CALENDAR_EVENT_INVITE_NOTES", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x460*/ { "SMSG_CALENDAR_EVENT_INVITE_NOTES", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x461*/ { "SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x462*/ { "CMSG_UPDATE_MISSILE_TRAJECTORY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, + /*0x462*/ { "CMSG_UPDATE_MISSILE_TRAJECTORY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateMissileTrajectory }, /*0x463*/ { "SMSG_UPDATE_ACCOUNT_DATA_COMPLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x464*/ { "SMSG_TRIGGER_MOVIE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x465*/ { "CMSG_COMPLETE_MOVIE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index bb54a0ae19e..6d8a9e3ff38 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -785,6 +785,7 @@ class WorldSession void HandleResetInstancesOpcode(WorldPacket& recv_data); void HandleHearthAndResurrect(WorldPacket& recv_data); void HandleInstanceLockResponse(WorldPacket& recvPacket); + void HandleUpdateMissileTrajectory(WorldPacket& recvPacket); // Looking for Dungeon/Raid void HandleLfgSetCommentOpcode(WorldPacket& recv_data); From f424052f82c8fc0172e78170bd70722ec76c1368 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 23 May 2012 14:28:38 +0200 Subject: [PATCH 0804/1149] Core/Spells: Make spellclick spells non triggered --- src/server/game/Entities/Unit/Unit.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index bc4a824d1d7..71977bf469c 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10191,7 +10191,7 @@ Unit* Unit::GetFirstControlled() const // Sequence: charmed, pet, other guardians Unit* unit = GetCharm(); if (!unit) - if (uint64 guid = GetUInt64Value(UNIT_FIELD_SUMMON)) + if (uint64 guid = GetMinionGUID()) unit = ObjectAccessor::GetUnit(*this, guid); return unit; @@ -17018,7 +17018,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId) } if (IsInMap(caster)) - caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId+1, target, true, NULL, NULL, origCasterGUID); + caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId+1, target, false, NULL, NULL, origCasterGUID); else // This can happen during Player::_LoadAuras { int32 bp0 = seatId; @@ -17028,7 +17028,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId) else { if (IsInMap(caster)) - caster->CastSpell(target, spellEntry, true, NULL, NULL, origCasterGUID); + caster->CastSpell(target, spellEntry, false, NULL, NULL, origCasterGUID); else Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, NULL, NULL, origCasterGUID); } From 23641d8c7a9d5065d3a3c5ee0e6e4624bc8905fd Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Wed, 23 May 2012 14:38:28 +0200 Subject: [PATCH 0805/1149] DB/Loot: Add loot for Reinforced Fel Iron Chest (heroic) (thx xanvial for initial work) Closes #5675 --- ...5_23_03_world_gameobject_loot_template.sql | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sql/updates/world/2012_05_23_03_world_gameobject_loot_template.sql diff --git a/sql/updates/world/2012_05_23_03_world_gameobject_loot_template.sql b/sql/updates/world/2012_05_23_03_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..22ecebcae31 --- /dev/null +++ b/sql/updates/world/2012_05_23_03_world_gameobject_loot_template.sql @@ -0,0 +1,32 @@ +SET @entry := 35093; +SET @epic := 25009; +SET @gem := @entry+1; +-- Create references +DELETE FROM `reference_loot_template` WHERE `entry` IN(@entry,@epic,@gem); +INSERT INTO `reference_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES +(@entry,27452,0,1,1,1,1), -- Light Scribe Bands +(@entry,27453,0,1,1,1,1), -- Averinn's RIng of Slaying +(@entry,27454,0,1,1,1,1), -- Volcanic Pauldrons +(@entry,27455,0,1,1,1,1), -- Irondrake faceguard +(@entry,27456,0,1,1,1,1), -- Raiments of Nature's Breath +(@entry,27457,0,1,1,1,1), -- Life Bearer's Gauntlets +(@entry,27458,0,1,1,1,1), -- Oceansong Kilt +(@entry,27459,0,1,1,1,1), -- Vambraces of Daring +(@entry,27460,0,1,1,1,1), -- Reavers' Ring +(@entry,27461,0,1,1,1,1), -- Chestguard of the Prowler +-- Epics +(@epic,29238,0,1,1,1,1), -- Lion's Heart Girdle +(@epic,29264,0,1,1,1,1), -- Tree-Mender's Belt +(@epic,29346,0,1,1,1,1), -- Feltooth Eviscerator +(@epic,32077,0,1,1,1,1), -- Wrath Infused Gauntlets +-- Gems +(@gem,30592,0,1,1,1,1), -- Steady Chrysoprase +(@gem,30593,0,1,1,1,1), -- Potent Fire Opal +(@gem,30594,0,1,1,1,1); -- Regal Chrysoprase +-- Assign loot to the chest +SET @GOloot := 21764; -- lootid of Reinforced Fel Iron Chest Heroic +DELETE FROM `gameobject_loot_template` WHERE `entry`=@GOloot; +INSERT INTO `gameobject_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES +(@GOloot,1,100,1,0,-@entry, 2), -- one from gear +(@GOloot,2,30,1,0,-@gem,1), -- one gem (30%) +(@GOloot,3,100,1,0,-@epic,1); -- one from epics From 037f37ac653f1c2aa26068f6a03b4e01e7a544c3 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 23 May 2012 14:56:08 +0200 Subject: [PATCH 0806/1149] Core/Protocol: correct SMSG_CALENDAR_RAID_LOCKOUT_UPDATED struct (and SMSG_CALENDAR_SEND_CALENDAR if no invite was found) --- src/server/game/Handlers/CalendarHandler.cpp | 56 +++++++++++--------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index d1277d154cc..298c742fc3a 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -20,7 +20,7 @@ ----- Opcodes Not Used yet ----- SMSG_CALENDAR_CLEAR_PENDING_ACTION SendCalendarClearPendingAction() -SMSG_CALENDAR_RAID_LOCKOUT_UPDATED SendCalendarRaidLockoutUpdated(InstanceSave const* save) <--- Structure unknown, using LOCKOUT_ADDED +SMSG_CALENDAR_RAID_LOCKOUT_UPDATED SendCalendarRaidLockoutUpdated(InstanceSave const* save) ----- Opcodes without Sniffs ----- SMSG_CALENDAR_FILTER_GUILD [ for (... uint32(count) { packguid(???), uint8(???) } ] @@ -74,7 +74,11 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/) else { sLog->outError("SMSG_CALENDAR_SEND_CALENDAR: No Invite found with id [" UI64FMTD "]", *it); - data << uint64(0) << uint64(0) << uint8(0) << uint8(0); + data << uint64(0); + data << uint64(0); + data << uint8(0); + data << uint8(0); + data << uint8(0); data.appendPackGUID(0); } } @@ -96,8 +100,12 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/) else { sLog->outError("SMSG_CALENDAR_SEND_CALENDAR: No Event found with id [" UI64FMTD "]", *it); - data << uint64(0) << uint8(0) << uint32(0) - << uint32(0) << uint32(0) << uint32(0); + data << uint64(0); + data << uint8(0); + data << uint32(0); + data << uint32(0); + data << uint32(0); + data << uint32(0); data.appendPackGUID(0); } } @@ -835,26 +843,6 @@ void WorldSession::SendCalendarClearPendingAction() SendPacket(&data); } -void WorldSession::SendCalendarRaidLockoutUpdated(InstanceSave const* save) -{ - if (!save) - return; - - uint64 guid = _player->GetGUID(); - sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_RAID_LOCKOUT_UPDATED [" UI64FMTD - "] Map: %u, Difficulty %u", guid, save->GetMapId(), save->GetDifficulty()); - - time_t cur_time = time_t(time(NULL)); - - WorldPacket data(SMSG_CALENDAR_RAID_LOCKOUT_UPDATED, 4 + 4 + 4 + 4 + 8); - data << secsToTimeBitFields(cur_time); - data << uint32(save->GetMapId()); - data << uint32(save->GetDifficulty()); - data << uint32(save->GetResetTime() - cur_time); - data << uint64(save->GetInstanceId()); - SendPacket(&data); -} - void WorldSession::SendCalendarCommandResult(CalendarError err, char const* param /*= NULL*/) { uint64 guid = _player->GetGUID(); @@ -898,3 +886,23 @@ void WorldSession::SendCalendarRaidLockout(InstanceSave const* save, bool add) data << uint64(save->GetInstanceId()); SendPacket(&data); } + +void WorldSession::SendCalendarRaidLockoutUpdated(InstanceSave const* save) +{ + if (!save) + return; + + uint64 guid = _player->GetGUID(); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_RAID_LOCKOUT_UPDATED [" UI64FMTD + "] Map: %u, Difficulty %u", guid, save->GetMapId(), save->GetDifficulty()); + + time_t cur_time = time_t(time(NULL)); + + WorldPacket data(SMSG_CALENDAR_RAID_LOCKOUT_UPDATED, 4 + 4 + 4 + 4 + 8); + data << secsToTimeBitFields(cur_time); + data << uint32(save->GetMapId()); + data << uint32(save->GetDifficulty()); + data << uint32(0); // Amount of seconds that has changed to the reset time + data << uint32(save->GetResetTime() - cur_time); + SendPacket(&data); +} From 419d537bc833fb83aac947c3fa3ba0823e5b8c81 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 23 May 2012 15:02:54 +0200 Subject: [PATCH 0807/1149] Core/Global: Cleanup in MovementHandler and some assertions --- .../Battlegrounds/Zones/BattlegroundAB.cpp | 2 +- .../Battlegrounds/Zones/BattlegroundSA.cpp | 11 ++- src/server/game/Globals/ObjectMgr.cpp | 78 +++++++------------ src/server/game/Handlers/MovementHandler.cpp | 68 ++++++++-------- 4 files changed, 70 insertions(+), 89 deletions(-) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index 52d2cdefd65..d28f5ddfe6a 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -290,7 +290,7 @@ int32 BattlegroundAB::_GetNodeNameId(uint8 node) case BG_AB_NODE_LUMBER_MILL:return LANG_BG_AB_NODE_LUMBER_MILL; case BG_AB_NODE_GOLD_MINE: return LANG_BG_AB_NODE_GOLD_MINE; default: - ASSERT(0); + ASSERT(false); } return 0; } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index 977897b8d48..133a0aec560 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -720,8 +720,13 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source) DelCreature(BG_SA_MAXNPC + i); GraveyardStatus[i] = Source->GetTeamId(); - WorldSafeLocsEntry const* sg = NULL; - sg = sWorldSafeLocsStore.LookupEntry(BG_SA_GYEntries[i]); + WorldSafeLocsEntry const* sg = sWorldSafeLocsStore.LookupEntry(BG_SA_GYEntries[i]); + if (!sg) + { + sLog->outError("BattlegroundSA::CaptureGraveyard: non-existant GY entry: %u", BG_SA_GYEntries[i]); + return; + } + AddSpiritGuide(i + BG_SA_MAXNPC, sg->x, sg->y, sg->z, BG_SA_GYOrientation[i], (GraveyardStatus[i] == TEAM_ALLIANCE? ALLIANCE : HORDE)); uint32 npc = 0; uint32 flag = 0; @@ -781,7 +786,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source) SendWarningToAll(LANG_BG_SA_H_GY_SOUTH); break; default: - ASSERT(0); + ASSERT(false); break; }; } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 9dea557f650..1e36b4c732b 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -6247,74 +6247,54 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh) switch (guidhigh) { case HIGHGUID_ITEM: - if (_hiItemGuid >= 0xFFFFFFFE) - { - sLog->outError("Item guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiItemGuid < 0xFFFFFFFE && "Item guid overflow!"); return _hiItemGuid++; + } case HIGHGUID_UNIT: - if (_hiCreatureGuid >= 0x00FFFFFE) - { - sLog->outError("Creature guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiCreatureGuid < 0x00FFFFFE && "Creature guid overflow!"); return _hiCreatureGuid++; + } case HIGHGUID_PET: - if (_hiPetGuid >= 0x00FFFFFE) - { - sLog->outError("Pet guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiPetGuid < 0x00FFFFFE && "Pet guid overflow!"); return _hiPetGuid++; + } case HIGHGUID_VEHICLE: - if (_hiVehicleGuid >= 0x00FFFFFF) - { - sLog->outError("Vehicle guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiVehicleGuid < 0x00FFFFFF && "Vehicle guid overflow!"); return _hiVehicleGuid++; + } case HIGHGUID_PLAYER: - if (_hiCharGuid >= 0xFFFFFFFE) - { - sLog->outError("Players guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiCharGuid < 0xFFFFFFFE && "Player guid overflow!"); return _hiCharGuid++; + } case HIGHGUID_GAMEOBJECT: - if (_hiGoGuid >= 0x00FFFFFE) - { - sLog->outError("Gameobject guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiGoGuid < 0x00FFFFFE && "Gameobject guid overflow!"); return _hiGoGuid++; + } case HIGHGUID_CORPSE: - if (_hiCorpseGuid >= 0xFFFFFFFE) - { - sLog->outError("Corpse guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiCorpseGuid < 0xFFFFFFFE && "Corpse guid overflow!"); return _hiCorpseGuid++; + } case HIGHGUID_DYNAMICOBJECT: - if (_hiDoGuid >= 0xFFFFFFFE) - { - sLog->outError("DynamicObject guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiDoGuid < 0xFFFFFFFE && "DynamicObject guid overflow!"); return _hiDoGuid++; + } case HIGHGUID_MO_TRANSPORT: - if (_hiMoTransGuid >= 0xFFFFFFFE) - { - sLog->outError("MO Transport guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiMoTransGuid < 0xFFFFFFFE && "MO Transport guid overflow!"); return _hiMoTransGuid++; + } default: - ASSERT(0); + ASSERT(false && "ObjectMgr::GenerateLowGuid - Unknown HIGHGUID type"); + return 0; } - - ASSERT(0); - return 0; } void ObjectMgr::LoadGameObjectLocales() diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index b3d663e1850..c271a43462a 100755 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -64,10 +64,9 @@ void WorldSession::HandleMoveWorldportAckOpcode() GetPlayer()->m_InstanceValid = true; Map* oldMap = GetPlayer()->GetMap(); - ASSERT(oldMap); if (GetPlayer()->IsInWorld()) { - sLog->outCrash("Player (Name %s) is still in world when teleported from map %u to new map %u", GetPlayer()->GetName(), oldMap->GetId(), loc.GetMapId()); + sLog->outError("Player (Name %s) is still in world when teleported from map %u to new map %u", GetPlayer()->GetName(), oldMap->GetId(), loc.GetMapId()); oldMap->RemovePlayerFromMap(GetPlayer(), false); } @@ -200,8 +199,7 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data) sLog->outStaticDebug("Guid " UI64FMTD, guid); sLog->outStaticDebug("Flags %u, time %u", flags, time/IN_MILLISECONDS); - Unit* mover = _player->m_mover; - Player* plMover = mover->GetTypeId() == TYPEID_PLAYER ? (Player*)mover : NULL; + Player* plMover = _player->m_mover->ToPlayer(); if (!plMover || !plMover->IsBeingTeleportedNear()) return; @@ -240,33 +238,33 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data) GetPlayer()->ProcessDelayedOperations(); } -void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) +void WorldSession::HandleMovementOpcodes(WorldPacket & recvData) { - uint16 opcode = recv_data.GetOpcode(); + uint16 opcode = recvData.GetOpcode(); Unit* mover = _player->m_mover; - ASSERT(mover != NULL); // there must always be a mover + ASSERT(mover != NULL); // there must always be a mover - Player* plMover = mover->GetTypeId() == TYPEID_PLAYER ? (Player*)mover : NULL; + Player* plrMover = mover->ToPlayer(); // ignore, waiting processing in WorldSession::HandleMoveWorldportAckOpcode and WorldSession::HandleMoveTeleportAck - if (plMover && plMover->IsBeingTeleported()) + if (plrMover && plrMover->IsBeingTeleported()) { - recv_data.rfinish(); // prevent warnings spam + recvData.rfinish(); // prevent warnings spam return; } /* extract packet */ uint64 guid; - recv_data.readPackGUID(guid); + recvData.readPackGUID(guid); MovementInfo movementInfo; movementInfo.guid = guid; - ReadMovementInfo(recv_data, &movementInfo); + ReadMovementInfo(recvData, &movementInfo); - recv_data.rfinish(); // prevent warnings spam + recvData.rfinish(); // prevent warnings spam // prevent tampered movement data if (guid != mover->GetGUID()) @@ -274,7 +272,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) if (!movementInfo.pos.IsPositionValid()) { - recv_data.rfinish(); // prevent warnings spam + recvData.rfinish(); // prevent warnings spam return; } @@ -285,27 +283,27 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) // (also received at zeppelin leave by some reason with t_* as absolute in continent coordinates, can be safely skipped) if (movementInfo.t_pos.GetPositionX() > 50 || movementInfo.t_pos.GetPositionY() > 50 || movementInfo.t_pos.GetPositionZ() > 50) { - recv_data.rfinish(); // prevent warnings spam + recvData.rfinish(); // prevent warnings spam return; } if (!Trinity::IsValidMapCoord(movementInfo.pos.GetPositionX() + movementInfo.t_pos.GetPositionX(), movementInfo.pos.GetPositionY() + movementInfo.t_pos.GetPositionY(), movementInfo.pos.GetPositionZ() + movementInfo.t_pos.GetPositionZ(), movementInfo.pos.GetOrientation() + movementInfo.t_pos.GetOrientation())) { - recv_data.rfinish(); // prevent warnings spam + recvData.rfinish(); // prevent warnings spam return; } // if we boarded a transport, add us to it - if (plMover && !plMover->GetTransport()) + if (plrMover && !plrMover->GetTransport()) { // elevators also cause the client to send MOVEMENTFLAG_ONTRANSPORT - just dismount if the guid can be found in the transport list for (MapManager::TransportSet::const_iterator iter = sMapMgr->m_Transports.begin(); iter != sMapMgr->m_Transports.end(); ++iter) { if ((*iter)->GetGUID() == movementInfo.t_guid) { - plMover->m_transport = (*iter); - (*iter)->AddPassenger(plMover); + plrMover->m_transport = (*iter); + (*iter)->AddPassenger(plrMover); break; } } @@ -318,29 +316,29 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) movementInfo.flags &= ~MOVEMENTFLAG_ONTRANSPORT; } } - else if (plMover && plMover->GetTransport()) // if we were on a transport, leave + else if (plrMover && plrMover->GetTransport()) // if we were on a transport, leave { - plMover->m_transport->RemovePassenger(plMover); - plMover->m_transport = NULL; + plrMover->m_transport->RemovePassenger(plrMover); + plrMover->m_transport = NULL; movementInfo.t_pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f); movementInfo.t_time = 0; movementInfo.t_seat = -1; } // fall damage generation (ignore in flight case that can be triggered also at lags in moment teleportation to another map). - if (opcode == MSG_MOVE_FALL_LAND && plMover && !plMover->isInFlight()) - plMover->HandleFall(movementInfo); + if (opcode == MSG_MOVE_FALL_LAND && plrMover && !plrMover->isInFlight()) + plrMover->HandleFall(movementInfo); - if (plMover && ((movementInfo.flags & MOVEMENTFLAG_SWIMMING) != 0) != plMover->IsInWater()) + if (plrMover && ((movementInfo.flags & MOVEMENTFLAG_SWIMMING) != 0) != plrMover->IsInWater()) { // now client not include swimming flag in case jumping under water - plMover->SetInWater(!plMover->IsInWater() || plMover->GetBaseMap()->IsUnderWater(movementInfo.pos.GetPositionX(), movementInfo.pos.GetPositionY(), movementInfo.pos.GetPositionZ())); + plrMover->SetInWater(!plrMover->IsInWater() || plrMover->GetBaseMap()->IsUnderWater(movementInfo.pos.GetPositionX(), movementInfo.pos.GetPositionY(), movementInfo.pos.GetPositionZ())); } /*----------------------*/ /* process position-change */ - WorldPacket data(opcode, recv_data.size()); + WorldPacket data(opcode, recvData.size()); movementInfo.time = getMSTime(); movementInfo.guid = mover->GetGUID(); WriteMovementInfo(&data, &movementInfo); @@ -357,27 +355,25 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) mover->UpdatePosition(movementInfo.pos); - if (plMover) // nothing is charmed, or player charmed + if (plrMover) // nothing is charmed, or player charmed { - plMover->UpdateFallInformationIfNeed(movementInfo, opcode); + plrMover->UpdateFallInformationIfNeed(movementInfo, opcode); if (movementInfo.pos.GetPositionZ() < -500.0f) { - if (!(plMover->InBattleground() - && plMover->GetBattleground() - && plMover->GetBattleground()->HandlePlayerUnderMap(_player))) + if (!(plrMover->GetBattleground() && plrMover->GetBattleground()->HandlePlayerUnderMap(_player))) { // NOTE: this is actually called many times while falling // even after the player has been teleported away // TODO: discard movement packets after the player is rooted - if (plMover->isAlive()) + if (plrMover->isAlive()) { - plMover->EnvironmentalDamage(DAMAGE_FALL_TO_VOID, GetPlayer()->GetMaxHealth()); + plrMover->EnvironmentalDamage(DAMAGE_FALL_TO_VOID, GetPlayer()->GetMaxHealth()); // player can be alive if GM/etc // change the death state to CORPSE to prevent the death timer from // starting in the next player update - if (!plMover->isAlive()) - plMover->KillPlayer(); + if (!plrMover->isAlive()) + plrMover->KillPlayer(); } } } From dbe8034ec277c660d1eeacbd9ac39b6783ad37dd Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 23 May 2012 16:37:22 +0200 Subject: [PATCH 0808/1149] Core/Calendar: Fix crash when deleting an event on the calendar. Should also stop the error message from appearing. Thanks elecyb Closes #6570 - Corrected some code from 66d42b4f296fa455bfc96ed6a09e64ed5cc62a9d --- src/server/game/Calendar/CalendarMgr.cpp | 24 +++++++++++------------- src/server/game/Handlers/MiscHandler.cpp | 4 ++-- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index cef68891890..62bc0ab3205 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -95,9 +95,9 @@ CalendarEventIdList const& CalendarMgr::GetPlayerEvents(uint64 guid) CalendarInvite* CalendarMgr::GetInvite(uint64 inviteId) { - CalendarInviteMap::iterator it = _invites.find(inviteId); - if (it != _invites.end()) - return &(it->second); + CalendarInviteMap::iterator itr = _invites.find(inviteId); + if (itr != _invites.end()) + return &(itr->second); sLog->outError("CalendarMgr::GetInvite: [" UI64FMTD "] not found!", inviteId); return NULL; @@ -105,9 +105,9 @@ CalendarInvite* CalendarMgr::GetInvite(uint64 inviteId) CalendarEvent* CalendarMgr::GetEvent(uint64 eventId) { - CalendarEventMap::iterator it = _events.find(eventId); - if (it != _events.end()) - return &(it->second); + CalendarEventMap::iterator itr = _events.find(eventId); + if (itr != _events.end()) + return &(itr->second); sLog->outError("CalendarMgr::GetEvent: [" UI64FMTD "] not found!", eventId); return NULL; @@ -316,11 +316,6 @@ void CalendarMgr::AddAction(CalendarAction const& action) if (!calendarEvent) return; - CalendarInviteIdList const& inviteIds = calendarEvent->GetInviteIdList(); - for (CalendarInviteIdList::const_iterator it = inviteIds.begin(); it != inviteIds.end(); ++it) - if (uint64 invitee = RemoveInvite(*it)) - SendCalendarEventRemovedAlert(invitee, *calendarEvent); - RemoveEvent(eventId); break; } @@ -464,8 +459,6 @@ bool CalendarMgr::RemoveEvent(uint64 eventId) return false; } - _events.erase(itr); - bool val = true; CalendarInviteIdList const& invites = itr->second.GetInviteIdList(); @@ -474,8 +467,13 @@ bool CalendarMgr::RemoveEvent(uint64 eventId) CalendarInvite* invite = GetInvite(*itrInvites); if (!invite || !RemovePlayerEvent(invite->GetInvitee(), eventId)) val = false; + + if (uint64 invitee = RemoveInvite(*itrInvites)) + SendCalendarEventRemovedAlert(invitee, itr->second); } + _events.erase(itr); + return val; } diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 9abd39f90ec..a280bc30b7c 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1733,8 +1733,8 @@ void WorldSession::HandleUpdateMissileTrajectory(WorldPacket& recvPacket) recvPacket >> moveStop; Unit* caster = ObjectAccessor::GetUnit(*_player, guid); - Spell* spell = caster ? caster->GetCurrentSpell(CURRENT_CHANNELED_SPELL) : NULL; - if (!spell || spell->m_spellInfo->Id != spellId || !spell->m_targets.HasDst()) + Spell* spell = caster ? caster->GetCurrentSpell(CURRENT_GENERIC_SPELL) : NULL; + if (!spell || spell->m_spellInfo->Id != spellId || !spell->m_targets.HasDst() || !spell->m_targets.HasSrc()) { recvPacket.rfinish(); return; From 2ae0cfc8b6c0c5c41550f81a8fdb768714456b00 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 23 May 2012 16:40:44 +0200 Subject: [PATCH 0809/1149] Core/GuardAI: General cleanup and removed some unnecessary code. --- src/server/game/AI/CoreAI/GuardAI.cpp | 87 +++------------------------ src/server/game/AI/CoreAI/GuardAI.h | 23 ++----- 2 files changed, 11 insertions(+), 99 deletions(-) diff --git a/src/server/game/AI/CoreAI/GuardAI.cpp b/src/server/game/AI/CoreAI/GuardAI.cpp index 252bcbabca5..6e2326ca9d5 100755 --- a/src/server/game/AI/CoreAI/GuardAI.cpp +++ b/src/server/game/AI/CoreAI/GuardAI.cpp @@ -23,7 +23,7 @@ #include "World.h" #include "CreatureAIImpl.h" -int GuardAI::Permissible(const Creature* creature) +int GuardAI::Permissible(Creature const* creature) { if (creature->isGuard()) return PERMIT_BASE_SPECIAL; @@ -31,7 +31,7 @@ int GuardAI::Permissible(const Creature* creature) return PERMIT_BASE_NO; } -GuardAI::GuardAI(Creature* creature) : ScriptedAI(creature), i_victimGuid(0), i_state(STATE_NORMAL), i_tracker(TIME_INTERVAL_LOOK) +GuardAI::GuardAI(Creature* creature) : ScriptedAI(creature) { } @@ -40,108 +40,35 @@ bool GuardAI::CanSeeAlways(WorldObject const* obj) if (!obj->isType(TYPEMASK_UNIT)) return false; - std::list t_list = me->getThreatManager().getThreatList(); - for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - if (Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid())) - if (unit == obj) - return true; - } + std::list threatList = me->getThreatManager().getThreatList(); + for (std::list::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr) + if ((*itr)->getUnitGuid() == obj->GetGUID()) + return true; return false; } -void GuardAI::MoveInLineOfSight(Unit* unit) -{ - // Ignore Z for flying creatures - if (!me->CanFly() && me->GetDistanceZ(unit) > CREATURE_Z_ATTACK_RANGE) - return; - - if (!me->getVictim() && me->IsValidAttackTarget(unit) && - (unit->IsHostileToPlayers() || me->IsHostileTo(unit)) && - unit->isInAccessiblePlaceFor(me)) - { - float attackRadius = me->GetAttackDistance(unit); - if (me->IsWithinDistInMap(unit, attackRadius)) - { - //Need add code to let guard support player - AttackStart(unit); - //u->RemoveAurasByType(SPELL_AURA_MOD_STEALTH); - } - } -} - void GuardAI::EnterEvadeMode() { if (!me->isAlive()) { - sLog->outStaticDebug("Creature stopped attacking because he is dead [guid=%u]", me->GetGUIDLow()); me->GetMotionMaster()->MoveIdle(); - - i_state = STATE_NORMAL; - - i_victimGuid = 0; me->CombatStop(true); me->DeleteThreatList(); return; } - Unit* victim = ObjectAccessor::GetUnit(*me, i_victimGuid); - - if (!victim) - { - sLog->outStaticDebug("Creature stopped attacking because victim does not exist [guid=%u]", me->GetGUIDLow()); - } - else if (!victim->isAlive()) - { - sLog->outStaticDebug("Creature stopped attacking because victim is dead [guid=%u]", me->GetGUIDLow()); - } - else if (victim->HasStealthAura()) - { - sLog->outStaticDebug("Creature stopped attacking because victim is using stealth [guid=%u]", me->GetGUIDLow()); - } - else if (victim->isInFlight()) - { - sLog->outStaticDebug("Creature stopped attacking because victim is flying away [guid=%u]", me->GetGUIDLow()); - } - else - { - sLog->outStaticDebug("Creature stopped attacking because victim outran him [guid=%u]", me->GetGUIDLow()); - } + sLog->outDebug(LOG_FILTER_UNITS, "Guard entry: %u enters evade mode.", me->GetEntry()); me->RemoveAllAuras(); me->DeleteThreatList(); - i_victimGuid = 0; me->CombatStop(true); - i_state = STATE_NORMAL; // Remove ChaseMovementGenerator from MotionMaster stack list, and add HomeMovementGenerator instead if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) me->GetMotionMaster()->MoveTargetedHome(); } -void GuardAI::UpdateAI(const uint32 /*diff*/) -{ - // update i_victimGuid if me->getVictim() !=0 and changed - if (!UpdateVictim()) - return; - - Unit* const victim = me->getVictim(); - if (!victim) - return; - - i_victimGuid = victim->GetGUID(); - - if (me->isAttackReady()) - { - if (me->IsWithinMeleeRange(victim)) - { - me->AttackerStateUpdate(victim); - me->resetAttackTimer(); - } - } -} - void GuardAI::JustDied(Unit* killer) { if (Player* player = killer->GetCharmerOrOwnerPlayerOrPlayerItself()) diff --git a/src/server/game/AI/CoreAI/GuardAI.h b/src/server/game/AI/CoreAI/GuardAI.h index c80c5a6c343..c8dd9d54921 100755 --- a/src/server/game/AI/CoreAI/GuardAI.h +++ b/src/server/game/AI/CoreAI/GuardAI.h @@ -20,34 +20,19 @@ #define TRINITY_GUARDAI_H #include "ScriptedCreature.h" -#include "Timer.h" class Creature; class GuardAI : public ScriptedAI { - enum GuardState - { - STATE_NORMAL = 1, - STATE_LOOK_AT_VICTIM = 2 - }; - public: + explicit GuardAI(Creature* creature); - explicit GuardAI(Creature* c); - - void MoveInLineOfSight(Unit*); - void EnterEvadeMode(); - void JustDied(Unit*); + static int Permissible(Creature const* creature); bool CanSeeAlways(WorldObject const* obj); - void UpdateAI(const uint32); - static int Permissible(const Creature*); - - private: - uint64 i_victimGuid; - GuardState i_state; - TimeTracker i_tracker; + void EnterEvadeMode(); + void JustDied(Unit* killer); }; #endif From 05ddeb5c387eca3bf71eb1d650a16b0c6d6eda2e Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 23 May 2012 22:01:45 +0200 Subject: [PATCH 0810/1149] DB/Gameobject: Add spawn for Scarlet Onslaught Daily Orders: Beach Closes #1958 --- sql/updates/world/2012_05_23_04_world_gameobject.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2012_05_23_04_world_gameobject.sql diff --git a/sql/updates/world/2012_05_23_04_world_gameobject.sql b/sql/updates/world/2012_05_23_04_world_gameobject.sql new file mode 100644 index 00000000000..afcb1e89317 --- /dev/null +++ b/sql/updates/world/2012_05_23_04_world_gameobject.sql @@ -0,0 +1,3 @@ +DELETE FROM `gameobject` WHERE `id`=188677; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(318,188677,571,1,1,2567.449,-388.7118,3.573463,-2.879789,0,0,0.639778,0.76856,1200,100,1); From 741f3ac0e0742715a3abe96b5f18d8e2865a77a7 Mon Sep 17 00:00:00 2001 From: Svannon Date: Wed, 23 May 2012 22:06:53 +0200 Subject: [PATCH 0811/1149] DB/Creature: add spawn for Aponi Brightmane Closes #2383 --- sql/updates/world/2012_05_23_05_world_creature.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 sql/updates/world/2012_05_23_05_world_creature.sql diff --git a/sql/updates/world/2012_05_23_05_world_creature.sql b/sql/updates/world/2012_05_23_05_world_creature.sql new file mode 100644 index 00000000000..bb162f927bd --- /dev/null +++ b/sql/updates/world/2012_05_23_05_world_creature.sql @@ -0,0 +1,12 @@ +-- Spawn from Sniff +DELETE FROM `creature` WHERE `id`=34526; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(42161,34526,1,1,1,0,0,-1050.052,-286.7274,159.1137,5.951573,120,0,0,1,0,0,0,0,0); +-- Template updates +UPDATE `creature_template` SET `faction_A`=104,`faction_H`=104,`baseattacktime`=2000,`npcflag`=`npcflag`|3,`unit_flags`=`unit_flags`|512 WHERE `entry`=34526; -- Aponi Brightmane +-- Model data +UPDATE `creature_model_info` SET `bounding_radius`=1.003375,`combat_reach`=4.3125,`gender`=1 WHERE `modelid`=29249; -- Aponi Brightmane +-- Addon data +DELETE FROM `creature_template_addon` WHERE `entry`=34526; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(34526,0,1,256,0,NULL); -- Aponi Brightmane From b1179d8f49d0dcab4b99365309e3eaadd5dbe218 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 23 May 2012 21:25:50 +0100 Subject: [PATCH 0812/1149] Core/Bags: Do not allow multiple unique bags in bank bag slots Existing multiple bags will be removed and items mailed Kudos to micha Closes #2786 --- src/server/game/Entities/Player/Player.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 2448f4a3199..371662921f5 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -10157,7 +10157,8 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const if (inBankAlso) { - for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) + // checking every item from 39 to 74 (including bank bags) + for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_BAG_END; ++i) if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) if (pItem != skipItem && pItem->GetEntry() == item) count += pItem->GetCount(); From 3ea75c50d019f1b29145bc974ae51039544beb16 Mon Sep 17 00:00:00 2001 From: MrSmite Date: Mon, 7 May 2012 17:41:58 -0400 Subject: [PATCH 0813/1149] Fixes broken autocast spells such as Furious Howl and Leap to cast when on autocast and "attack" is clicked. Fixes wrong check for spell cooldown and removes check for duration (some spells with duration such as poison are stackable) --- src/server/game/AI/CoreAI/PetAI.cpp | 58 +++++++++++++++++++---------- 1 file changed, 39 insertions(+), 19 deletions(-) diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index bcec8d273b9..14306c8861f 100755 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -153,40 +153,60 @@ void PetAI::UpdateAI(const uint32 diff) if (spellInfo->IsPositive()) { - // non combat spells allowed - // only pet spells have IsNonCombatSpell and not fit this reqs: - // Consume Shadows, Lesser Invisibility, so ignore checks for its if (spellInfo->CanBeUsedInCombat()) { - // allow only spell without spell cost or with spell cost but not duration limit - int32 duration = spellInfo->GetDuration(); - if ((spellInfo->ManaCost || spellInfo->ManaCostPercentage || spellInfo->ManaPerSecond) && duration > 0) + // check spell cooldown + if (me->HasSpellCooldown(spellInfo->Id)) continue; - // allow only spell without cooldown > duration - int32 cooldown = spellInfo->GetRecoveryTime(); - if (cooldown >= 0 && duration >= 0 && cooldown > duration) + // Check if we're in combat or commanded to attack + if (!me->isInCombat() && !me->GetCharmInfo()->IsCommandAttack()) continue; } Spell* spell = new Spell(me, spellInfo, TRIGGERED_NONE, 0); - bool spellUsed = false; - for (std::set::const_iterator tar = m_AllySet.begin(); tar != m_AllySet.end(); ++tar) + + // Some spells can target enemy or friendly (DK Ghoul's Leap) + // Check for enemy first (pet then owner) + if (Unit* target = me->getAttackerForHelper()) { - Unit* target = ObjectAccessor::GetUnit(*me, *tar); - - //only buff targets that are in combat, unless the spell can only be cast while out of combat - if (!target) - continue; - - if (spell->CanAutoCast(target)) + if (CanAttack(target) && spell->CanAutoCast(target)) { targetSpellStore.push_back(std::make_pair(target, spell)); spellUsed = true; - break; } } + else if (Unit* target = me->GetCharmerOrOwner()->getAttackerForHelper()) + { + if (CanAttack(target) && spell->CanAutoCast(target)) + { + targetSpellStore.push_back(std::make_pair(target, spell)); + spellUsed = true; + } + } + + // No enemy, check friendly + if (!spellUsed) + { + for (std::set::const_iterator tar = m_AllySet.begin(); tar != m_AllySet.end(); ++tar) + { + Unit* target = ObjectAccessor::GetUnit(*me, *tar); + + //only buff targets that are in combat, unless the spell can only be cast while out of combat + if (!target) + continue; + + if (spell->CanAutoCast(target)) + { + targetSpellStore.push_back(std::make_pair(target, spell)); + spellUsed = true; + break; + } + } + } + + // No valid targets at all if (!spellUsed) delete spell; } From 4bdc5573822fd8c2d4ed0422abb2bd29e772e6de Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 24 May 2012 09:51:57 -0400 Subject: [PATCH 0814/1149] Core/Bags: cleanup random tab. check for item in bag slots for getitembyguid and getitemcountwithlimitcategory --- src/server/game/Entities/Player/Player.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 371662921f5..41c95ac3d04 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -10198,7 +10198,7 @@ uint32 Player::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipIte if (Bag* pBag = GetBagByPos(i)) count += pBag->GetItemCountWithLimitCategory(limitCategory, skipItem); - for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) + for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_BAG_END; ++i) if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) if (pItem != skipItem) if (ItemTemplate const* pProto = pItem->GetTemplate()) @@ -10224,7 +10224,7 @@ Item* Player::GetItemByGuid(uint64 guid) const if (pItem->GetGUID() == guid) return pItem; - for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) + for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_BAG_END; ++i) if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) if (pItem->GetGUID() == guid) return pItem; @@ -16386,7 +16386,7 @@ void Player::ReputationChanged2(FactionEntry const* factionEntry) } } - bool Player::HasQuestForItem(uint32 itemid) const +bool Player::HasQuestForItem(uint32 itemid) const { for (uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i) { From 84b420160dacd5b9a9c6cf77ecc9e5cfc1b4afae Mon Sep 17 00:00:00 2001 From: kaelima Date: Thu, 24 May 2012 16:29:43 +0200 Subject: [PATCH 0815/1149] Core/Pets: Some minor corrections to 3ea75c50d019f1b29145bc974ae51039544beb16 --- src/server/game/AI/CoreAI/PetAI.cpp | 22 +++++++++------------- src/server/game/DataStores/DBCEnums.h | 4 ++-- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 14306c8861f..160b406a6ea 100755 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -169,15 +169,11 @@ void PetAI::UpdateAI(const uint32 diff) // Some spells can target enemy or friendly (DK Ghoul's Leap) // Check for enemy first (pet then owner) - if (Unit* target = me->getAttackerForHelper()) - { - if (CanAttack(target) && spell->CanAutoCast(target)) - { - targetSpellStore.push_back(std::make_pair(target, spell)); - spellUsed = true; - } - } - else if (Unit* target = me->GetCharmerOrOwner()->getAttackerForHelper()) + Unit* target = me->getAttackerForHelper(); + if (!target && owner) + target = owner->getAttackerForHelper(); + + if (target) { if (CanAttack(target) && spell->CanAutoCast(target)) { @@ -191,15 +187,15 @@ void PetAI::UpdateAI(const uint32 diff) { for (std::set::const_iterator tar = m_AllySet.begin(); tar != m_AllySet.end(); ++tar) { - Unit* target = ObjectAccessor::GetUnit(*me, *tar); + Unit* ally = ObjectAccessor::GetUnit(*me, *tar); //only buff targets that are in combat, unless the spell can only be cast while out of combat - if (!target) + if (!ally) continue; - if (spell->CanAutoCast(target)) + if (spell->CanAutoCast(ally)) { - targetSpellStore.push_back(std::make_pair(target, spell)); + targetSpellStore.push_back(std::make_pair(ally, spell)); spellUsed = true; break; } diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index 80949effa0c..23578a55816 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -245,7 +245,7 @@ enum AreaFlags AREA_FLAG_CITY = 0x00000200, // only for one zone named "City" (where it located?) AREA_FLAG_OUTLAND = 0x00000400, // expansion zones? (only Eye of the Storm not have this flag, but have 0x00004000 flag) AREA_FLAG_SANCTUARY = 0x00000800, // sanctuary area (PvP disabled) - AREA_FLAG_NEED_FLY = 0x00001000, // Unknown + AREA_FLAG_NEED_FLY = 0x00001000, // Respawn alive at the graveyard without corpse AREA_FLAG_UNUSED1 = 0x00002000, // Unused in 3.3.5a AREA_FLAG_OUTLAND2 = 0x00004000, // expansion zones? (only Circle of Blood Arena not have this flag, but have 0x00000400 flag) AREA_FLAG_OUTDOOR_PVP = 0x00008000, // pvp objective area? (Death's Door also has this flag although it's no pvp object area) @@ -260,7 +260,7 @@ enum AreaFlags AREA_FLAG_WINTERGRASP = 0x01000000, // Wintergrasp and it's subzones AREA_FLAG_INSIDE = 0x02000000, // used for determinating spell related inside/outside questions in Map::IsOutdoors AREA_FLAG_OUTSIDE = 0x04000000, // used for determinating spell related inside/outside questions in Map::IsOutdoors - AREA_FLAG_WINTERGRASP_2 = 0x08000000, // Same as AREA_FLAG_WINTERGRASP except for The Sunken Ring and Western Bridge. + AREA_FLAG_WINTERGRASP_2 = 0x08000000, // Can Hearth And Resurrect From Area AREA_FLAG_NO_FLY_ZONE = 0x20000000 // Marks zones where you cannot fly }; From b114f3be1b7ca71e8b81ba48fde48823fc5f5259 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 24 May 2012 10:33:30 -0400 Subject: [PATCH 0816/1149] DB/Misc: fix update sql file name. --- ...ld_creature_misc.sql => 2012_05_24_00_world_creature_misc.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sql/updates/world/{2012_04_05_00_world_creature_misc.sql => 2012_05_24_00_world_creature_misc.sql} (100%) diff --git a/sql/updates/world/2012_04_05_00_world_creature_misc.sql b/sql/updates/world/2012_05_24_00_world_creature_misc.sql similarity index 100% rename from sql/updates/world/2012_04_05_00_world_creature_misc.sql rename to sql/updates/world/2012_05_24_00_world_creature_misc.sql From 8e4b6934c3d7736be4ea6517ed7830cdde163545 Mon Sep 17 00:00:00 2001 From: Svannon Date: Thu, 24 May 2012 17:33:47 +0200 Subject: [PATCH 0817/1149] DB/Gameobject: Spawn Book The Betrayer Ascendant Closes #2517 --- sql/updates/world/2012_05_24_01_world_gameobject.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2012_05_24_01_world_gameobject.sql diff --git a/sql/updates/world/2012_05_24_01_world_gameobject.sql b/sql/updates/world/2012_05_24_01_world_gameobject.sql new file mode 100644 index 00000000000..32bbc15494f --- /dev/null +++ b/sql/updates/world/2012_05_24_01_world_gameobject.sql @@ -0,0 +1,3 @@ +DELETE FROM `gameobject` WHERE `id`=175759 AND `guid`=219; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(219,175759,530,1,1,9636.439,-7231.265,16.73347,-2.82743,0,0,-0.9876881,0.1564362,900,100,1); From d54d536f6fb996c2fb729c3f2ee5bf7c44945096 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 24 May 2012 17:06:06 +0100 Subject: [PATCH 0818/1149] Core/Arena: Fix Hotter Streak achiev, thanks to Horn Ref #6590 Closes #6335 --- src/server/game/Battlegrounds/Battleground.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 9d5858e1ca4..c589edcee7a 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -850,9 +850,12 @@ void Battleground::EndBattleground(uint32 winner) if (team == winner) { // update achievement BEFORE personal rating update - ArenaTeamMember* member = winner_arena_team->GetMember(player->GetGUID()); - if (member) - player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, 1); + if (ArenaTeamMember* member = winner_arena_team->GetMember(player->GetGUID())) + { + uint32 rating = player->GetArenaPersonalRating(winner_arena_team->GetSlot()); + player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, + rating ? rating : 1); + } winner_arena_team->MemberWon(player, loser_matchmaker_rating, winner_matchmaker_change); } From 2849f21d20d53461813c0a2f66a5401f71adcbc9 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 24 May 2012 15:33:08 -0400 Subject: [PATCH 0819/1149] Core/Spells: correctly calculate Replenishment aura. x * 20 / 10000 != x * .2 --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index d28ba9e1e19..38ad27b0ad2 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -662,10 +662,10 @@ int32 AuraEffect::CalculateAmount(Unit* caster) case SPELL_AURA_PERIODIC_ENERGIZE: if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_GENERIC) { - // Replenishment (0.25% from max) + // Replenishment (0.2% from max) // Infinite Replenishment if (m_spellInfo->SpellIconID == 3184 && m_spellInfo->SpellVisual[0] == 12495) - amount = GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA) * 25 / 10000; + amount = GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.2f; } // Innervate else if (m_spellInfo->Id == 29166) From aa341353954b77e55bbca420f1eb757433e2db9e Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 24 May 2012 15:55:55 -0400 Subject: [PATCH 0820/1149] Core/Spells: fix issue with previous commit. i cant do math. --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 38ad27b0ad2..b49cad74244 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -665,7 +665,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) // Replenishment (0.2% from max) // Infinite Replenishment if (m_spellInfo->SpellIconID == 3184 && m_spellInfo->SpellVisual[0] == 12495) - amount = GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.2f; + amount = GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.002f; } // Innervate else if (m_spellInfo->Id == 29166) From b7573a1bc70eede743bfb7cdeb2f29b45758347a Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 24 May 2012 16:58:09 -0400 Subject: [PATCH 0821/1149] Core/Auras: change from if to switch and fix calculation for inifinite replenishment. --- .../game/Spells/Auras/SpellAuraEffects.cpp | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index b49cad74244..0d0931e481b 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -660,19 +660,25 @@ int32 AuraEffect::CalculateAmount(Unit* caster) } break; case SPELL_AURA_PERIODIC_ENERGIZE: - if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_GENERIC) + switch (m_spellInfo->Id) { - // Replenishment (0.2% from max) - // Infinite Replenishment + case 57669: // Replenishment (0.2% from max) if (m_spellInfo->SpellIconID == 3184 && m_spellInfo->SpellVisual[0] == 12495) amount = GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.002f; - } - // Innervate - else if (m_spellInfo->Id == 29166) + break; + case 61782: // Infinite Replenishment + if (m_spellInfo->SpellIconID == 3184 && m_spellInfo->SpellVisual[0] == 12495) + amount = GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.0025f; + break; + case 29166: // Innervate ApplyPctF(amount, float(GetBase()->GetUnitOwner()->GetCreatePowers(POWER_MANA)) / GetTotalTicks()); - // Owlkin Frenzy - else if (m_spellInfo->Id == 48391) + break; + case 48391: // Owlkin Frenzy ApplyPctU(amount, GetBase()->GetUnitOwner()->GetCreatePowers(POWER_MANA)); + break; + default: + break; + } break; case SPELL_AURA_PERIODIC_HEAL: if (!caster) From 51388c49345158fa39bcd3259544a6279477038d Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 24 May 2012 17:10:12 -0400 Subject: [PATCH 0822/1149] Core/Auras: one more for good measure. thanks vincent-michael --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 0d0931e481b..5a29e6b325d 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -663,12 +663,10 @@ int32 AuraEffect::CalculateAmount(Unit* caster) switch (m_spellInfo->Id) { case 57669: // Replenishment (0.2% from max) - if (m_spellInfo->SpellIconID == 3184 && m_spellInfo->SpellVisual[0] == 12495) - amount = GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.002f; + amount = GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.002f; break; case 61782: // Infinite Replenishment - if (m_spellInfo->SpellIconID == 3184 && m_spellInfo->SpellVisual[0] == 12495) - amount = GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.0025f; + amount = GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.0025f; break; case 29166: // Innervate ApplyPctF(amount, float(GetBase()->GetUnitOwner()->GetCreatePowers(POWER_MANA)) / GetTotalTicks()); From d98f36194bc271c3bd3adc6532e84bd3645127c8 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 24 May 2012 17:34:51 -0400 Subject: [PATCH 0823/1149] Core/Spells: attempt to correct issue with triggered spells happening before the spell actually hits the target. reply with any bugs that this causes please! --- src/server/game/Spells/SpellEffects.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 07bea5f980c..9470d6edef9 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -849,15 +849,15 @@ void Spell::EffectDummy(SpellEffIndex effIndex) void Spell::EffectTriggerSpell(SpellEffIndex effIndex) { - if (effectHandleMode != SPELL_EFFECT_HANDLE_LAUNCH_TARGET - && effectHandleMode != SPELL_EFFECT_HANDLE_LAUNCH) + if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET + && effectHandleMode != SPELL_EFFECT_HANDLE_HIT) return; uint32 triggered_spell_id = m_spellInfo->Effects[effIndex].TriggerSpell; // todo: move those to spell scripts if (m_spellInfo->Effects[effIndex].Effect == SPELL_EFFECT_TRIGGER_SPELL - && effectHandleMode == SPELL_EFFECT_HANDLE_LAUNCH_TARGET) + && effectHandleMode == SPELL_EFFECT_HANDLE_HIT_TARGET) { // special cases switch (triggered_spell_id) @@ -970,13 +970,13 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex) } SpellCastTargets targets; - if (effectHandleMode == SPELL_EFFECT_HANDLE_LAUNCH_TARGET) + if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT_TARGET) { if (!spellInfo->NeedsToBeTriggeredByCaster()) return; targets.SetUnitTarget(unitTarget); } - else //if (effectHandleMode == SPELL_EFFECT_HANDLE_LAUNCH) + else //if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT) { if (spellInfo->NeedsToBeTriggeredByCaster() && (m_spellInfo->Effects[effIndex].GetProvidedTargetMask() & TARGET_FLAG_UNIT_MASK)) return; From 929e7c0f0c8f008519b5d168af4fda165c62547e Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 25 May 2012 08:56:02 -0400 Subject: [PATCH 0824/1149] Core/Spells: revert previous commit to find a better solution. --- src/server/game/Spells/SpellEffects.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 9470d6edef9..07bea5f980c 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -849,15 +849,15 @@ void Spell::EffectDummy(SpellEffIndex effIndex) void Spell::EffectTriggerSpell(SpellEffIndex effIndex) { - if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET - && effectHandleMode != SPELL_EFFECT_HANDLE_HIT) + if (effectHandleMode != SPELL_EFFECT_HANDLE_LAUNCH_TARGET + && effectHandleMode != SPELL_EFFECT_HANDLE_LAUNCH) return; uint32 triggered_spell_id = m_spellInfo->Effects[effIndex].TriggerSpell; // todo: move those to spell scripts if (m_spellInfo->Effects[effIndex].Effect == SPELL_EFFECT_TRIGGER_SPELL - && effectHandleMode == SPELL_EFFECT_HANDLE_HIT_TARGET) + && effectHandleMode == SPELL_EFFECT_HANDLE_LAUNCH_TARGET) { // special cases switch (triggered_spell_id) @@ -970,13 +970,13 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex) } SpellCastTargets targets; - if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT_TARGET) + if (effectHandleMode == SPELL_EFFECT_HANDLE_LAUNCH_TARGET) { if (!spellInfo->NeedsToBeTriggeredByCaster()) return; targets.SetUnitTarget(unitTarget); } - else //if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT) + else //if (effectHandleMode == SPELL_EFFECT_HANDLE_LAUNCH) { if (spellInfo->NeedsToBeTriggeredByCaster() && (m_spellInfo->Effects[effIndex].GetProvidedTargetMask() & TARGET_FLAG_UNIT_MASK)) return; From c40d86f05f5857b73015f09eb68b7dfdd7224a1f Mon Sep 17 00:00:00 2001 From: kaelima Date: Fri, 25 May 2012 16:44:34 +0200 Subject: [PATCH 0825/1149] Core/Protocol: Fix struct and make use of CMSG_UPDATE_PROJECTILE_POSITION. --- src/server/game/Handlers/SpellHandler.cpp | 11 ++++++++++- src/server/game/Server/Protocol/Opcodes.h | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index b2d52c85467..1affdf0aff7 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -650,13 +650,22 @@ void WorldSession::HandleUpdateProjectilePosition(WorldPacket& recvPacket) uint8 castCount; float x, y, z; // Position of missile hit - recvPacket.readPackGUID(casterGuid); + recvPacket >> casterGuid; recvPacket >> spellId; recvPacket >> castCount; recvPacket >> x; recvPacket >> y; recvPacket >> z; + Unit* caster = ObjectAccessor::GetUnit(*_player, casterGuid); + Spell* spell = caster ? caster->FindCurrentSpellBySpellId(spellId) : NULL; + if (spell && spell->m_targets.HasDst()) + { + Position pos = *spell->m_targets.GetDstPos(); + pos.Relocate(x, y, z); + spell->m_targets.ModDst(pos); + } + WorldPacket data(SMSG_SET_PROJECTILE_POSITION, 21); data << uint64(casterGuid); data << uint8(castCount); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 3c77ced6741..d76a0ab8dd4 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1248,8 +1248,8 @@ enum Opcodes SMSG_CALENDAR_CLEAR_PENDING_ACTION = 0x4BB, SMSG_EQUIPMENT_SET_LIST = 0x4BC, // equipment manager list? CMSG_EQUIPMENT_SET_SAVE = 0x4BD, - CMSG_UPDATE_PROJECTILE_POSITION = 0x4BE, // uint64 caster, uint32 spellId, uint8 castId, vector3 position - SMSG_SET_PROJECTILE_POSITION = 0x4BF, // uint64 caster, uint8 castId, vector3 position + CMSG_UPDATE_PROJECTILE_POSITION = 0x4BE, + SMSG_SET_PROJECTILE_POSITION = 0x4BF, SMSG_TALENTS_INFO = 0x4C0, CMSG_LEARN_PREVIEW_TALENTS = 0x4C1, CMSG_LEARN_PREVIEW_TALENTS_PET = 0x4C2, From eb08c4d4b4a35a178f6368ed4a4388f74d3cc04e Mon Sep 17 00:00:00 2001 From: Malcrom Date: Fri, 25 May 2012 23:25:47 -0230 Subject: [PATCH 0826/1149] DB/SAI: Visual addition to Pit of Saron --- sql/updates/world/2012_05_25_00_world_sai.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sql/updates/world/2012_05_25_00_world_sai.sql diff --git a/sql/updates/world/2012_05_25_00_world_sai.sql b/sql/updates/world/2012_05_25_00_world_sai.sql new file mode 100644 index 00000000000..fa5682db02f --- /dev/null +++ b/sql/updates/world/2012_05_25_00_world_sai.sql @@ -0,0 +1,6 @@ +-- Eye of the Lich King SAI +SET @ENTRY := 36913; -- NPC entry +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,6,0,0,1000,1000,66,0,0,0,0,0,0,21,150,0,0,0,0,0,0, 'Eye of the Lich King - OOC - face closest player'); From 60a164578b2f75a54d68759d1859fb1f9eedfd11 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Fri, 25 May 2012 23:34:58 -0230 Subject: [PATCH 0827/1149] DB/Waypoints: Some waypoint additions for Outlands/Blades edge --- .../world/2012_05_25_01_world_waypoints.sql | 149 ++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 sql/updates/world/2012_05_25_01_world_waypoints.sql diff --git a/sql/updates/world/2012_05_25_01_world_waypoints.sql b/sql/updates/world/2012_05_25_01_world_waypoints.sql new file mode 100644 index 00000000000..0d2c04bc6bc --- /dev/null +++ b/sql/updates/world/2012_05_25_01_world_waypoints.sql @@ -0,0 +1,149 @@ +-- Bladewing Bloodletter InhabitType fix +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=21033; + +-- Bladewing Bloodletter +SET @NPC := 73849; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=1987.838,`position_y`=6153.995,`position_z`=146.4068,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,1987.838,6153.995,146.4068,0,0,0,100,0), +(@PATH,2,1981.592,6150.557,146.4068,0,0,0,100,0), +(@PATH,3,1966.573,6153.941,146.4068,0,0,0,100,0), +(@PATH,4,1953.747,6155.154,146.4068,0,0,0,100,0), +(@PATH,5,1941.287,6159.015,146.4068,0,0,0,100,0), +(@PATH,6,1937.986,6166.096,146.4068,0,0,0,100,0), +(@PATH,7,1948.558,6175.274,145.1566,0,0,0,100,0), +(@PATH,8,1959.44,6173.246,145.6567,0,0,0,100,0), +(@PATH,9,1971.408,6169.729,145.7679,0,0,0,100,0), +(@PATH,10,1986.747,6168.348,144.8511,0,0,0,100,0), +(@PATH,11,1998.881,6168.547,144.4066,0,0,0,100,0), +(@PATH,12,2008.877,6170.33,143.7955,0,0,0,100,0), +(@PATH,13,2021.965,6166.769,143.657,0,0,0,100,0), +(@PATH,14,2027.152,6158.083,145.4344,0,0,0,100,0), +(@PATH,15,2025.352,6149.427,146.4068,0,0,0,100,0), +(@PATH,16,2011.869,6150.37,146.4068,0,0,0,100,0), +(@PATH,17,1999.44,6155.886,146.4068,0,0,0,100,0); + +-- Bladewing Bloodletter +SET @NPC := 73850; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=2099.588,`position_y`=6126.344,`position_z`=148.8029,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,2099.588,6126.344,148.8029,0,0,0,100,0), +(@PATH,2,2094.131,6133.031,148.303,0,0,0,100,0), +(@PATH,3,2085.703,6143.32,148.303,0,0,0,100,0), +(@PATH,4,2077.25,6154.094,148.5252,0,0,0,100,0), +(@PATH,5,2062.893,6175.25,146.414,0,0,0,100,0), +(@PATH,6,2056.135,6184.647,144.8307,0,0,0,100,0), +(@PATH,7,2050.784,6189.019,141.9417,0,0,0,100,0), +(@PATH,8,2044,6181.015,142.6362,0,0,0,100,0), +(@PATH,9,2044.303,6175.524,143.3028,0,0,0,100,0), +(@PATH,10,2053.432,6161.702,145.8306,0,0,0,100,0), +(@PATH,11,2064.378,6145.299,146.7471,0,0,0,100,0), +(@PATH,12,2064.748,6135.614,147.7195,0,0,0,100,0), +(@PATH,13,2067.337,6117.838,149.0529,0,0,0,100,0), +(@PATH,14,2073.338,6100.975,149.664,0,0,0,100,0), +(@PATH,15,2089.383,6099.217,149.3585,0,0,0,100,0), +(@PATH,16,2099.147,6111.964,149.1641,0,0,0,100,0); + +-- Bladewing Bloodletter +SET @NPC := 73852; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=2180.795,`position_y`=6149.398,`position_z`=145.9554,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,2180.795,6149.398,145.9554,0,0,0,100,0), +(@PATH,2,2185.298,6157.3,146.8721,0,0,0,100,0), +(@PATH,3,2191.635,6164.935,146.6221,0,0,0,100,0), +(@PATH,4,2203.45,6168.873,146.2055,0,0,0,100,0), +(@PATH,5,2217.238,6165.062,145.6221,0,0,0,100,0), +(@PATH,6,2225.425,6159.092,145.1501,0,0,0,100,0), +(@PATH,7,2228.766,6146.569,145.3166,0,0,0,100,0), +(@PATH,8,2225.81,6129.76,143.9,0,0,0,100,0), +(@PATH,9,2203.906,6114.964,145.0111,0,0,0,100,0), +(@PATH,10,2184.713,6115.808,145.7333,0,0,0,100,0), +(@PATH,11,2173.165,6123,146.8721,0,0,0,100,0), +(@PATH,12,2175.542,6139.301,146.8721,0,0,0,100,0); + +-- Bladewing Bloodletter +SET @NPC := 73853; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=2153.506,`position_y`=6119.981,`position_z`=148.0267,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,2153.506,6119.981,148.0267,0,0,0,100,0), +(@PATH,2,2144.238,6124.169,148.0267,0,0,0,100,0), +(@PATH,3,2133.341,6127.807,148.0267,0,0,0,100,0), +(@PATH,4,2120.865,6126.57,148.0267,0,0,0,100,0), +(@PATH,5,2110.276,6122.198,148.0267,0,0,0,100,0), +(@PATH,6,2108.702,6111.856,148.0267,0,0,0,100,0), +(@PATH,7,2113.887,6104.159,148.0267,0,0,0,100,0), +(@PATH,8,2123.298,6095.088,148.0267,0,0,0,100,0), +(@PATH,9,2136.37,6099.125,148.0267,0,0,0,100,0), +(@PATH,10,2146.343,6107.208,148.0267,0,0,0,100,0), +(@PATH,11,2150.752,6118.491,148.0267,0,0,0,100,0), +(@PATH,12,2158.115,6126.979,148.0267,0,0,0,100,0), +(@PATH,13,2168.949,6133.578,148.0267,0,0,0,100,0), +(@PATH,14,2180.009,6134.229,148.0267,0,0,0,100,0), +(@PATH,15,2189.201,6129.583,148.0267,0,0,0,100,0), +(@PATH,16,2192.429,6119.862,148.0267,0,0,0,100,0), +(@PATH,17,2187.044,6112.755,148.0267,0,0,0,100,0), +(@PATH,18,2176.445,6111.443,148.0267,0,0,0,100,0), +(@PATH,19,2166.243,6114.129,148.0267,0,0,0,100,0); + +-- Bladewing Bloodletter +SET @NPC := 73858; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=2128.704,`position_y`=6018.743,`position_z`=141.9579,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,2128.704,6018.743,141.9579,0,0,0,100,0), +(@PATH,2,2118.804,6016.506,141.9433,0,0,0,100,0), +(@PATH,3,2100.692,6019.814,141.9433,0,0,0,100,0), +(@PATH,4,2080.599,6017.728,144.3877,0,0,0,100,0), +(@PATH,5,2070.564,6003.17,144.1802,0,0,0,100,0), +(@PATH,6,2079.148,5988.599,143.5968,0,0,0,100,0), +(@PATH,7,2088.214,5974.081,142.9579,0,0,0,100,0), +(@PATH,8,2102.427,5966.812,142.208,0,0,0,100,0), +(@PATH,9,2117.762,5969.647,141.9579,0,0,0,100,0), +(@PATH,10,2130.632,5977.25,141.9579,0,0,0,100,0), +(@PATH,11,2135.56,5993.264,141.9579,0,0,0,100,0), +(@PATH,12,2148.631,6003.11,141.1247,0,0,0,100,0), +(@PATH,13,2144.206,6017.48,141.9579,0,0,0,100,0); + +-- Bladewing Bloodletter +SET @NPC := 73860; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=1951.455,`position_y`=5919.516,`position_z`=140.4673,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,1951.455,5919.516,140.4673,0,0,0,100,0), +(@PATH,2,1953.539,5912.287,140.4179,0,0,0,100,0), +(@PATH,3,1955.967,5902.248,140.4179,0,0,0,100,0), +(@PATH,4,1947.568,5889.415,140.4179,0,0,0,100,0), +(@PATH,5,1938.332,5877.63,140.4179,0,0,0,100,0), +(@PATH,6,1946.422,5859.488,140.4179,0,0,0,100,0), +(@PATH,7,1958.004,5850.275,140.4179,0,0,0,100,0), +(@PATH,8,1967.889,5861.601,140.4673,0,0,0,100,0), +(@PATH,9,1967.766,5874.843,140.4673,0,0,0,100,0), +(@PATH,10,1962.739,5881.181,140.4673,0,0,0,100,0), +(@PATH,11,1965.367,5889.64,140.4673,0,0,0,100,0), +(@PATH,12,1977.617,5904.389,140.4673,0,0,0,100,0), +(@PATH,13,1979.003,5918.971,140.4673,0,0,0,100,0), +(@PATH,14,1969.612,5933.128,140.4673,0,0,0,100,0), +(@PATH,15,1958.879,5940.208,140.4673,0,0,0,100,0), +(@PATH,16,1952.594,5927.489,140.4673,0,0,0,100,0); From e56ce7394fbc953b5ad1036fc41594a46ff91548 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Fri, 25 May 2012 23:39:55 -0230 Subject: [PATCH 0828/1149] db/creature_template: fix inhabittype for Floating Flavor Eye --- sql/updates/world/2012_05_25_02_world_creature_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_05_25_02_world_creature_template.sql diff --git a/sql/updates/world/2012_05_25_02_world_creature_template.sql b/sql/updates/world/2012_05_25_02_world_creature_template.sql new file mode 100644 index 00000000000..fd4c1743f07 --- /dev/null +++ b/sql/updates/world/2012_05_25_02_world_creature_template.sql @@ -0,0 +1,2 @@ +-- Floating Flavor Eye InhabitType fix +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=21659; From 39a609ce5c3c926384273c7c1676d3f72a672d09 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Fri, 25 May 2012 23:53:33 -0230 Subject: [PATCH 0829/1149] Core/DB: Some updates for UBRS from sniff --- .../world/2012_05_25_03_world_template.sql | 8 ++ .../BlackrockSpire/blackrock_spire.h | 9 +- .../boss_pyroguard_emberseer.cpp | 40 ++++++- .../instance_blackrock_spire.cpp | 100 +++++++++++++----- 4 files changed, 129 insertions(+), 28 deletions(-) create mode 100644 sql/updates/world/2012_05_25_03_world_template.sql diff --git a/sql/updates/world/2012_05_25_03_world_template.sql b/sql/updates/world/2012_05_25_03_world_template.sql new file mode 100644 index 00000000000..6ef112f342f --- /dev/null +++ b/sql/updates/world/2012_05_25_03_world_template.sql @@ -0,0 +1,8 @@ +-- Fix unit flags for Blackhand Incarcerator +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|768 WHERE `entry`=10316; +-- Fix unit flags for Pyroguard Emberseer +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|33554688 WHERE `entry`=9816; +-- Remove hack event script +DELETE FROM `event_scripts` WHERE `id`=4884; +-- Remove script to Dragonspire Hall Runes "UBRS" +UPDATE `gameobject_template` SET `ScriptName`= '' WHERE `entry` BETWEEN 175194 AND 175200; diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h index beef71ea857..0af2af948d3 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h @@ -33,7 +33,8 @@ enum Data DATA_WARCHIEF_REND_BLACKHAND, DATA_GYTH, DATA_THE_BEAST, - DATA_GENERAL_DRAKKISATH + DATA_GENERAL_DRAKKISATH, + DATA_DRAGONSPIRE_ROOM, }; enum Npc { @@ -51,6 +52,9 @@ enum Npc NPC_GYTH = 10339, NPC_THE_BEAST = 10430, NPC_GENERAL_DRAKKISATH = 10363, + NPC_BLACKHAND_DREADWEAVER = 9817, + NPC_BLACKHAND_SUMMONER = 9818, + NPC_BLACKHAND_VETERAN = 9819, }; enum AdditionalData @@ -58,6 +62,9 @@ enum AdditionalData SPELL_SUMMON_ROOKERY_WHELP = 15745, MAX_ENCOUNTER = 14, MAX_DRAGONSPIRE_HALL_RUNES = 7, + EVENT_PYROGUARD_EMBERSEER = 4884, + AREATRIGGER_ENTER_UBRS = 2046, + AREATRIGGER_STADIUM = 2026, }; enum GameObjects diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp index 411b800cd03..f84fcefd40b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp @@ -20,11 +20,24 @@ #include "ScriptedCreature.h" #include "blackrock_spire.h" +enum Text +{ + EMOTE_ONE_STACK = 0, + EMOTE_TEN_STACK = 1, + EMOTE_FREE_OF_BONDS = 2, + YELL_FREE_OF_BONDS = 3, +}; + enum Spells { - SPELL_FIRENOVA = 23462, - SPELL_FLAMEBUFFET = 23341, - SPELL_PYROBLAST = 17274, + SPELL_ENCAGED_EMBERSEER = 15282, // Self on spawn + SPELL_FIRE_SHIELD_TRIGGER = 13377, // Self on spawn missing from 335 dbc + SPELL_FREEZE_ANIM = 16245, // Self on event start + SPELL_EMBERSEER_GROWING = 16048, // Self on event start + SPELL_EMBERSEER_FULL_STRENGTH = 16047, // Emberseer Full Strength + SPELL_FIRENOVA = 23462, // Combat + SPELL_FLAMEBUFFET = 23341, // Combat + SPELL_PYROBLAST = 17274, // Combat }; enum Events @@ -51,12 +64,19 @@ public: void Reset() { + if(instance->GetBossState(DATA_PYROGAURD_EMBERSEER) == IN_PROGRESS) + OpenDoors(FALSE); + instance->SetBossState(DATA_PYROGAURD_EMBERSEER,NOT_STARTED); + // respawn any dead Blackhand Incarcerators + DoCast(me, SPELL_ENCAGED_EMBERSEER); + //DoCast(me, SPELL_FIRE_SHIELD_TRIGGER); _Reset(); } void EnterCombat(Unit* /*who*/) { _EnterCombat(); + // activate all runes in room events.ScheduleEvent(EVENT_FIRENOVA, 6 * IN_MILLISECONDS); events.ScheduleEvent(EVENT_FLAMEBUFFET, 3 * IN_MILLISECONDS); events.ScheduleEvent(EVENT_PYROBLAST, 14 * IN_MILLISECONDS); @@ -64,12 +84,26 @@ public: void JustDied(Unit* /*killer*/) { + instance->SetBossState(DATA_PYROGAURD_EMBERSEER,DONE); + OpenDoors(TRUE); _JustDied(); } + void OpenDoors(bool Boss_Killed) + { + if (GameObject* door1 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_IN))) + door1->SetGoState(GO_STATE_ACTIVE); + if (GameObject* door2 = me->GetMap()->GetGameObject(instance->GetData64(GO_DOORS))) + door2->SetGoState(GO_STATE_ACTIVE); + if (Boss_Killed) + if (GameObject* door3 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_OUT))) + door3->SetGoState(GO_STATE_ACTIVE); + } + void UpdateAI(uint32 const diff) { if (!UpdateVictim()) + return; events.Update(diff); diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp index b5b1b34a593..fdb73fe1196 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp @@ -49,6 +49,12 @@ public: uint64 Gyth; uint64 TheBeast; uint64 GeneralDrakkisath; + uint64 go_emberseerin; + uint64 go_doors; + uint64 go_emberseerout; + uint64 go_roomrunes[MAX_DRAGONSPIRE_HALL_RUNES]; + uint8 Runemaxprotectors[MAX_DRAGONSPIRE_HALL_RUNES]; + uint8 Runeprotectorsdead[MAX_DRAGONSPIRE_HALL_RUNES]; void Initialize() { @@ -67,6 +73,9 @@ public: Gyth = 0; TheBeast = 0; GeneralDrakkisath = 0; + go_emberseerin = 0; + go_doors = 0; + go_emberseerout = 0; } bool IsEncounterInProgress() const @@ -125,7 +134,11 @@ public: case NPC_GENERAL_DRAKKISATH: GeneralDrakkisath = creature->GetGUID(); break; - } + case NPC_BLACKHAND_DREADWEAVER: + case NPC_BLACKHAND_SUMMONER: + case NPC_BLACKHAND_VETERAN: + break; + } } void OnGameObjectCreate(GameObject* go) @@ -135,6 +148,36 @@ public: case GO_WHELP_SPAWNER: go->CastSpell(NULL, SPELL_SUMMON_ROOKERY_WHELP); break; + case GO_EMBERSEER_IN: + go_emberseerin = go->GetGUID(); + break; + case GO_DOORS: + go_doors = go->GetGUID(); + break; + case GO_EMBERSEER_OUT: + go_emberseerout = go->GetGUID(); + break; + case GO_ROOM_1_RUNE: + go_roomrunes[0] = go->GetGUID(); + break; + case GO_ROOM_2_RUNE: + go_roomrunes[1] = go->GetGUID(); + break; + case GO_ROOM_3_RUNE: + go_roomrunes[2] = go->GetGUID(); + break; + case GO_ROOM_4_RUNE: + go_roomrunes[3] = go->GetGUID(); + break; + case GO_ROOM_5_RUNE: + go_roomrunes[4] = go->GetGUID(); + break; + case GO_ROOM_6_RUNE: + go_roomrunes[5] = go->GetGUID(); + break; + case GO_ROOM_7_RUNE: + go_roomrunes[6] = go->GetGUID(); + break; } } @@ -167,6 +210,18 @@ public: return true; } + void ProcessEvent(WorldObject* /*gameObject*/, uint32 eventId) + { + switch (eventId) + { + case EVENT_PYROGUARD_EMBERSEER: + SetBossState(DATA_PYROGAURD_EMBERSEER,IN_PROGRESS); + break; + default: + break; + } + } + uint64 GetData64(uint32 type) { switch (type) @@ -199,6 +254,26 @@ public: return TheBeast; case DATA_GENERAL_DRAKKISATH: return GeneralDrakkisath; + case GO_EMBERSEER_IN: + return go_emberseerin; + case GO_DOORS: + return go_doors; + case GO_EMBERSEER_OUT: + return go_emberseerout; + case GO_ROOM_1_RUNE: + return go_roomrunes[0]; + case GO_ROOM_2_RUNE: + return go_roomrunes[1]; + case GO_ROOM_3_RUNE: + return go_roomrunes[2]; + case GO_ROOM_4_RUNE: + return go_roomrunes[3]; + case GO_ROOM_5_RUNE: + return go_roomrunes[4]; + case GO_ROOM_6_RUNE: + return go_roomrunes[5]; + case GO_ROOM_7_RUNE: + return go_roomrunes[6]; } return 0; @@ -247,30 +322,7 @@ public: }; -uint8 ActivatedRunes = 0; - -class go_dragonspire_hall_rune : public GameObjectScript -{ -public: - go_dragonspire_hall_rune() : GameObjectScript("go_dragonspire_hall_rune") { } - - void OnGameObjectStateChanged(GameObject* go, uint32 state) - { - if (state == GO_STATE_READY) - { - if (++ActivatedRunes == MAX_DRAGONSPIRE_HALL_RUNES) - { - if (GameObject* door1 = GetClosestGameObjectWithEntry(go, GO_EMBERSEER_IN, 150.0f)) - door1->SetGoState(GO_STATE_ACTIVE); - if (GameObject* door2 = GetClosestGameObjectWithEntry(go, GO_DOORS, 150.0f)) - door2->SetGoState(GO_STATE_ACTIVE); - } - } - } -}; - void AddSC_instance_blackrock_spire() { new instance_blackrock_spire(); - new go_dragonspire_hall_rune; } From 83f74263a200f8c63a24939c12db9f580252b358 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 26 May 2012 00:27:10 -0230 Subject: [PATCH 0830/1149] core: fix ubrs script --- .../EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp index f84fcefd40b..97069fbef74 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp @@ -65,7 +65,7 @@ public: void Reset() { if(instance->GetBossState(DATA_PYROGAURD_EMBERSEER) == IN_PROGRESS) - OpenDoors(FALSE); + OpenDoors(false); instance->SetBossState(DATA_PYROGAURD_EMBERSEER,NOT_STARTED); // respawn any dead Blackhand Incarcerators DoCast(me, SPELL_ENCAGED_EMBERSEER); From 74da8dc41004adcea6167a4587bded4efa025387 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 26 May 2012 00:38:53 -0230 Subject: [PATCH 0831/1149] Core: another update cause case matters! --- .../BlackrockSpire/boss_pyroguard_emberseer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp index 97069fbef74..0279f3e2834 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp @@ -76,7 +76,6 @@ public: void EnterCombat(Unit* /*who*/) { _EnterCombat(); - // activate all runes in room events.ScheduleEvent(EVENT_FIRENOVA, 6 * IN_MILLISECONDS); events.ScheduleEvent(EVENT_FLAMEBUFFET, 3 * IN_MILLISECONDS); events.ScheduleEvent(EVENT_PYROBLAST, 14 * IN_MILLISECONDS); @@ -85,7 +84,7 @@ public: void JustDied(Unit* /*killer*/) { instance->SetBossState(DATA_PYROGAURD_EMBERSEER,DONE); - OpenDoors(TRUE); + OpenDoors(true); _JustDied(); } From a0028fca55cce5cebeb2d6ab5449ce2eeeabdf51 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 26 May 2012 15:03:30 +0100 Subject: [PATCH 0832/1149] DB/Misc: EAI: Fix unkillable Obsidian Nullifier in AQ Closes #2977 SAI: Use correct action_type for two SAI scripts (was 0) Closes #6569 and fixes DB startup errors --- .../world/2012_05_26_00_world_scripts.sql | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 sql/updates/world/2012_05_26_00_world_scripts.sql diff --git a/sql/updates/world/2012_05_26_00_world_scripts.sql b/sql/updates/world/2012_05_26_00_world_scripts.sql new file mode 100644 index 00000000000..18b0fa2f6b2 --- /dev/null +++ b/sql/updates/world/2012_05_26_00_world_scripts.sql @@ -0,0 +1,20 @@ +-- Correction for Obsidian Nullifier EAI +UPDATE `creature_ai_scripts` SET + `action1_param1` = 23 +WHERE `id` = 1531201; + +-- Correction for Wildspawn Felsworn and Wildspawn Hellcaller SAI +UPDATE `smart_scripts` SET + `event_phase_mask` = 2, + `action_type` = 22, + `action_param1` = 1, + `target_type` = 1 +WHERE + (`entryorguid` = 11457 AND + `source_type` = 0 AND + `id` = 10 AND + `link` = 0) OR + (`entryorguid` = 11455 AND + `source_type` = 0 AND + `id` = 11 AND + `link` = 0); From 61e006e4e99968db609675676d63f2c25b7cd834 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 26 May 2012 15:40:52 +0100 Subject: [PATCH 0833/1149] DB/Spells: Add Fire shield (spell id 13377) to spell_dbc Will be used in an upcoming script by Malcrom --- sql/updates/world/2012_05_26_01_world_spell_dbc.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2012_05_26_01_world_spell_dbc.sql diff --git a/sql/updates/world/2012_05_26_01_world_spell_dbc.sql b/sql/updates/world/2012_05_26_01_world_spell_dbc.sql new file mode 100644 index 00000000000..7efebc37489 --- /dev/null +++ b/sql/updates/world/2012_05_26_01_world_spell_dbc.sql @@ -0,0 +1,4 @@ +-- Fire Shield from 2.0.12 dbc +DELETE FROM `spell_dbc` WHERE `Id`=13377; +INSERT INTO `spell_dbc` (`Id`, `Dispel`, `Mechanic`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `AttributesEx4`, `AttributesEx5`, `AttributesEx6`, `AttributesEx7`, `Stances`, `StancesNot`, `Targets`, `CastingTimeIndex`, `AuraInterruptFlags`, `ProcFlags`, `ProcChance`, `ProcCharges`, `MaxLevel`, `BaseLevel`, `SpellLevel`, `DurationIndex`, `RangeIndex`, `StackAmount`, `EquippedItemClass`, `EquippedItemSubClassMask`, `EquippedItemInventoryTypeMask`, `Effect1`, `Effect2`, `Effect3`, `EffectDieSides1`, `EffectDieSides2`, `EffectDieSides3`, `EffectRealPointsPerLevel1`, `EffectRealPointsPerLevel2`, `EffectRealPointsPerLevel3`, `EffectBasePoints1`, `EffectBasePoints2`, `EffectBasePoints3`, `EffectMechanic1`, `EffectMechanic2`, `EffectMechanic3`, `EffectImplicitTargetA1`, `EffectImplicitTargetA2`, `EffectImplicitTargetA3`, `EffectImplicitTargetB1`, `EffectImplicitTargetB2`, `EffectImplicitTargetB3`, `EffectRadiusIndex1`, `EffectRadiusIndex2`, `EffectRadiusIndex3`, `EffectApplyAuraName1`, `EffectApplyAuraName2`, `EffectApplyAuraName3`, `EffectAmplitude1`, `EffectAmplitude2`, `EffectAmplitude3`, `EffectMultipleValue1`, `EffectMultipleValue2`, `EffectMultipleValue3`, `EffectMiscValue1`, `EffectMiscValue2`, `EffectMiscValue3`, `EffectMiscValueB1`, `EffectMiscValueB2`, `EffectMiscValueB3`, `EffectTriggerSpell1`, `EffectTriggerSpell2`, `EffectTriggerSpell3`, `EffectSpellClassMaskA1`, `EffectSpellClassMaskA2`, `EffectSpellClassMaskA3`, `EffectSpellClassMaskB1`, `EffectSpellClassMaskB2`, `EffectSpellClassMaskB3`, `EffectSpellClassMaskC1`, `EffectSpellClassMaskC2`, `EffectSpellClassMaskC3`, `MaxTargetLevel`, `SpellFamilyName`, `SpellFamilyFlags1`, `SpellFamilyFlags2`, `SpellFamilyFlags3`, `MaxAffectedTargets`, `DmgClass`, `PreventionType`, `DmgMultiplier1`, `DmgMultiplier2`, `DmgMultiplier3`, `AreaGroupId`, `SchoolMask`, `Comment`) VALUES +(13377, 1, 0, 2512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 101, 0, 0, 40, 40, 21, 1, 0, -1, -1, 0, 6, 0, 0, 1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 3000, 0, 0, '0', '0', '0', 0, 0, 0, 0, 0, 0, 13376, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 2, 'Fire Shield'); From e7845f780e2a9cb588c1848c4feda3ce0a535346 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 26 May 2012 16:39:37 +0100 Subject: [PATCH 0834/1149] DB/NPC: Use the same flags_extra (no skill gain) and immunities (grip and bleed) to all the training dummies. Closes #1853 --- sql/updates/world/2012_05_26_02_world_creature_template.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/2012_05_26_02_world_creature_template.sql diff --git a/sql/updates/world/2012_05_26_02_world_creature_template.sql b/sql/updates/world/2012_05_26_02_world_creature_template.sql new file mode 100644 index 00000000000..e51567390b7 --- /dev/null +++ b/sql/updates/world/2012_05_26_02_world_creature_template.sql @@ -0,0 +1,5 @@ +-- Training dummies +UPDATE `creature_template` SET + `flags_extra`=0x40000, /* NO_SKILLGAIN */ + `mechanic_immune_mask`=0x20|0x4000 /* GRIP|BLEED */ /* two of the templates already had bleed immunity, is that correct? */ +WHERE `ScriptName`='npc_training_dummy'; From 5956eb9ae2e8466629a4b4d024b13be49dcba3ca Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 26 May 2012 17:10:27 +0100 Subject: [PATCH 0835/1149] DB/PageText: Add a missing page text Closes #6592 Unknown author --- sql/updates/world/2012_05_26_03_world_page_text.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2012_05_26_03_world_page_text.sql diff --git a/sql/updates/world/2012_05_26_03_world_page_text.sql b/sql/updates/world/2012_05_26_03_world_page_text.sql new file mode 100644 index 00000000000..9dc285cd99d --- /dev/null +++ b/sql/updates/world/2012_05_26_03_world_page_text.sql @@ -0,0 +1,4 @@ +-- First page of A Steamy Romance Novel: Northern Exposure +DELETE FROM `page_text` WHERE `entry`=3562; +INSERT INTO `page_text` (`entry`, `text`, `next_page`) VALUES +(3562, 'The tiny gnome peered over the railing into the secluded Dalaran courtyard.$B$B"The view from the balcony is amazing. You have to come see!"$B$BArmor legplates creaked as Marcus walked over, taking in a deep breath as he absently scratched his scruffy chin.$B$B"The Hero''s Welcome is no slouch. And there''s something in the room that might interest you."$B$BTavi bounded into the room, pausing only a moment before jumping onto the massive bed. She turned to gaze at Marcus with her huge saucer-like eyes, narrowing them playfully and replacing her glowing smile with a diabolical grin.', 3563); From 624aab7d77c9f0a395611012d17e5c5114992f79 Mon Sep 17 00:00:00 2001 From: kaelima Date: Sat, 26 May 2012 18:14:50 +0200 Subject: [PATCH 0836/1149] Core/Session: Fixed error "received unexpected opcode CMSG_CANCEL_TRADE" when a player is logging out. --- src/server/game/Handlers/TradeHandler.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 2 +- src/server/game/Server/WorldSession.cpp | 35 +++++++++++------------ src/server/game/Server/WorldSession.h | 1 + 4 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index dc26aaa42ca..9d7fa7da396 100755 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -531,7 +531,7 @@ void WorldSession::HandleBeginTradeOpcode(WorldPacket& /*recvPacket*/) void WorldSession::SendCancelTrade() { - if (m_playerRecentlyLogout) + if (PlayerRecentlyLoggedOut() || PlayerLogout()) return; SendTradeStatus(TRADE_STATUS_TRADE_CANCELED); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index d76a0ab8dd4..65e7b3597ce 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1354,7 +1354,7 @@ enum SessionStatus STATUS_AUTHED = 0, // Player authenticated (_player == NULL, m_playerRecentlyLogout = false or will be reset before handler call, m_GUID have garbage) STATUS_LOGGEDIN, // Player in game (_player != NULL, m_GUID == _player->GetGUID(), inWorld()) STATUS_TRANSFER, // Player transferring to another map (_player != NULL, m_GUID == _player->GetGUID(), !inWorld()) - STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, // _player!= NULL or _player == NULL && m_playerRecentlyLogout, m_GUID store last _player guid) + STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, // _player != NULL or _player == NULL && m_playerRecentlyLogout && m_playerLogout, m_GUID store last _player guid) STATUS_NEVER, // Opcode not accepted from client (deprecated or server side only) STATUS_UNHANDLED, // Opcode not handled yet }; diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 88248b7bc55..98bb0123896 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -290,7 +290,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) // lag can cause STATUS_LOGGEDIN opcodes to arrive after the player started a transfer break; case STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT: - if (!_player && !m_playerRecentlyLogout) + if (!_player && !m_playerRecentlyLogout && !m_playerLogout) // There's a short delay between _player = null and m_playerRecentlyLogout = true during logout LogUnexpectedOpcode(packet, "STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT", "the player has not logged in yet and not recently logout"); else @@ -404,7 +404,7 @@ void WorldSession::LogoutPlayer(bool Save) if (_player) { - if (uint64 lguid = GetPlayer()->GetLootGUID()) + if (uint64 lguid = _player->GetLootGUID()) DoLootRelease(lguid); ///- If the player just died before logging out, make him appear as a ghost @@ -518,21 +518,21 @@ void WorldSession::LogoutPlayer(bool Save) if (_player->GetGroup() && !_player->GetGroup()->isRaidGroup() && m_Socket) _player->RemoveFromGroup(); - ///- Send update to group and reset stored max enchanting level + //! Send update to group and reset stored max enchanting level if (_player->GetGroup()) { _player->GetGroup()->SendUpdate(); _player->GetGroup()->ResetMaxEnchantingLevel(); } - ///- Broadcast a logout message to the player's friends + //! Broadcast a logout message to the player's friends sSocialMgr->SendFriendStatus(_player, FRIEND_OFFLINE, _player->GetGUIDLow(), true); sSocialMgr->RemovePlayerSocial(_player->GetGUIDLow()); - // Call script hook before deletion - sScriptMgr->OnPlayerLogout(GetPlayer()); + //! Call script hook before deletion + sScriptMgr->OnPlayerLogout(_player); - ///- Remove the player from the world + //! Remove the player from the world // the player may not be in the world when logging out // e.g if he got disconnected during a transfer to another map // calls to GetMap in this case may cause crashes @@ -540,22 +540,19 @@ void WorldSession::LogoutPlayer(bool Save) sLog->outChar("Account: %d (IP: %s) Logout Character:[%s] (GUID: %u) Level: %d", GetAccountId(), GetRemoteAddress().c_str(), _player->GetName(), _player->GetGUIDLow(), _player->getLevel()); if (Map* _map = _player->FindMap()) _map->RemovePlayerFromMap(_player, true); - SetPlayer(NULL); // deleted in Remove call - ///- Send the 'logout complete' packet to the client + SetPlayer(NULL); //! Pointer already deleted during RemovePlayerFromMap + + //! Send the 'logout complete' packet to the client + //! Client will respond by sending 3x CMSG_CANCEL_TRADE, which we currently dont handle WorldPacket data(SMSG_LOGOUT_COMPLETE, 0); SendPacket(&data); - - ///- Since each account can only have one online character at any given time, ensure all characters for active account are marked as offline - //No SQL injection as AccountId is uint32 - - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ACCOUNT_ONLINE); - - stmt->setUInt32(0, GetAccountId()); - - CharacterDatabase.Execute(stmt); - sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION: Sent SMSG_LOGOUT_COMPLETE Message"); + + //! Since each account can only have one online character at any given time, ensure all characters for active account are marked as offline + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ACCOUNT_ONLINE); + stmt->setUInt32(0, GetAccountId()); + CharacterDatabase.Execute(stmt); } m_playerLogout = false; diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 6d8a9e3ff38..00d5a8b5a86 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -221,6 +221,7 @@ class WorldSession bool PlayerLoading() const { return m_playerLoading; } bool PlayerLogout() const { return m_playerLogout; } bool PlayerLogoutWithSave() const { return m_playerLogout && m_playerSave; } + bool PlayerRecentlyLoggedOut() const { return m_playerRecentlyLogout; } void SizeError(WorldPacket const& packet, uint32 size) const; From a6adce0e3f86896324b6cdc6e31ef4227621b189 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 26 May 2012 19:35:36 +0100 Subject: [PATCH 0837/1149] DB/NPCs: Remove bleed immunity from all training dummies Ref e7845f780e2a9cb --- sql/updates/world/2012_05_26_04_world_creature_template.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2012_05_26_04_world_creature_template.sql diff --git a/sql/updates/world/2012_05_26_04_world_creature_template.sql b/sql/updates/world/2012_05_26_04_world_creature_template.sql new file mode 100644 index 00000000000..911cd45ef8c --- /dev/null +++ b/sql/updates/world/2012_05_26_04_world_creature_template.sql @@ -0,0 +1,4 @@ +-- Training dummies +UPDATE `creature_template` SET + `mechanic_immune_mask` = `mechanic_immune_mask` &~ 0x4000 /* BLEED */ +WHERE `ScriptName`='npc_training_dummy'; From 593774f9c5adcf0bc6f6eb5a4e580dd8d630d34c Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 26 May 2012 16:23:34 -0230 Subject: [PATCH 0838/1149] DB/Creature_template: Some trigger flag fixes --- .../world/2012_05_26_05_world_creature_template.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 sql/updates/world/2012_05_26_05_world_creature_template.sql diff --git a/sql/updates/world/2012_05_26_05_world_creature_template.sql b/sql/updates/world/2012_05_26_05_world_creature_template.sql new file mode 100644 index 00000000000..59d69b3fbe1 --- /dev/null +++ b/sql/updates/world/2012_05_26_05_world_creature_template.sql @@ -0,0 +1,8 @@ +-- Blade's Edge - Legion - Invis Bunny +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128 WHERE `entry`=20736; +-- Death's Door Warp-Gate Explosion Bunny +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128 WHERE `entry`=22502; +-- Death's Door North Warp-Gate +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128 WHERE `entry`=22471; +-- Death's Door South Warp-Gate +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128 WHERE `entry`=22472; From 1593a53086538cce6ae6252a9bc9779b02a5b1b8 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 26 May 2012 18:30:44 -0230 Subject: [PATCH 0839/1149] DB/Smart Scripts: Some EAI to SAI conversions for UBRS --- .../2012_05_26_06_world_smart_scripts.sql | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 sql/updates/world/2012_05_26_06_world_smart_scripts.sql diff --git a/sql/updates/world/2012_05_26_06_world_smart_scripts.sql b/sql/updates/world/2012_05_26_06_world_smart_scripts.sql new file mode 100644 index 00000000000..397a5ad517a --- /dev/null +++ b/sql/updates/world/2012_05_26_06_world_smart_scripts.sql @@ -0,0 +1,143 @@ +-- Blackhand Dreadweaver SAI +SET @ENTRY := 9817; -- NPC entry +SET @SPELL1 := 12739; -- Shadow Bolt +SET @SPELL2 := 7068; -- Veil of Shadow +SET @SPELL3 := 12380; -- Shadow Channeling +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,11,0,100,2,0,0,0,0,58,1,@SPELL1,3600,6300,25,30,1,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - On Reset - Load caster template Cast Shadow Bolt'), +(@ENTRY,0,1,0,25,0,100,0,0,0,0,0,11,@SPELL3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - On Reset - Aura Shadow Channeling'), +(@ENTRY,0,2,3,4,0,100,2,0,0,0,0,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - On Aggro - Cast Shadow Bolt'), +(@ENTRY,0,3,0,61,0,100,2,0,0,0,0,39,10,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - On Aggro - Call for help'), +(@ENTRY,0,4,0,0,0,100,2,9400,21400,22000,28800,11,@SPELL2,3,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - Combat - Cast Veil of Shadow'), +(@ENTRY,0,5,0,2,0,100,3,0,15,0,0,25,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - HP@15% - Flee for help'), +(@ENTRY,0,6,7,1,0,100,2,0,8000,12000,14000,92,0,0,1,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - OOC - interupt channeling'), +(@ENTRY,0,7,0,61,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - OOC - set phase 1'), +(@ENTRY,0,8,0,1,1,100,2,0,0,0,0,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - OOC - emote (phase 1)'), +(@ENTRY,0,9,10,1,1,100,2,4000,4000,4000,4000,11,@SPELL3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - OOC - Aura Shadow Channeling (phase 1)'), +(@ENTRY,0,10,0,61,1,100,0,0,0,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - OOC - set phase 0 (phase 1)'); + +-- Blackhand Summoner SAI +SET @ENTRY := 9818; -- NPC entry +SET @SPELL1 := 12466; -- Fireball +SET @SPELL2 := 15532; -- Frost Nova +SET @SPELL3 := 15792; -- Summon Blackhand Veteran +SET @SPELL4 := 15794; -- Summon Blackhand Dreadweaver +SET @SPELL5 := 12380; -- Shadow Channeling +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,11,0,100,2,0,0,0,0,58,1,@SPELL1,3600,6300,25,30,1,0,0,0,0,0,0,0, 'Blackhand Summoner - On Reset - Load caster template Cast Fireball'), +(@ENTRY,0,1,0,25,0,100,0,0,0,0,0,11,@SPELL5,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Summoner - On Reset - Aura Shadow Channeling'), +(@ENTRY,0,2,3,4,0,100,2,0,0,0,0,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Blackhand Summoner - On Aggro - Cast Shadow Bolt'), +(@ENTRY,0,3,0,61,0,100,2,0,0,0,0,39,10,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Summoner - On Aggro - Call for help'), +(@ENTRY,0,4,0,0,0,100,2,11400,11400,12700,16700,11,@SPELL2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Summoner - Combat - Cast Frost Nova'), +(@ENTRY,0,5,6,0,0,100,3,30000,35000,0,0,11,@SPELL3,1,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Summoner - Combat - Cast Summon Blackhand Veteran'), +(@ENTRY,0,6,0,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Summoner - Combat - say 0'), +(@ENTRY,0,7,8,0,0,100,3,40000,45000,0,0,11,@SPELL4,1,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Summoner - Combat - Cast Summon Blackhand Dreadweaver'), +(@ENTRY,0,8,0,61,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Summoner - Combat - say 1'), +(@ENTRY,0,9,0,2,0,100,3,0,15,0,0,25,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Summoner - HP@15% - Flee for help'), +(@ENTRY,0,10,0,1,0,100,2,0,8000,12000,14000,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Summoner - OOC - emote'); +-- NPC talk text insert +DELETE FROM `creature_text` WHERE `entry`=9818; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(9818,0,0,'%s begins to summon in a Blackhand Veteran!',16,0,100,0,0,0,'Blackhand Summoner'), +(9818,1,0,'%s begins to summon in a Blackhand Dreadweaver!',16,0,100,0,0,0,'Blackhand Summoner'); + +-- Blackhand Veteran SAI +SET @ENTRY := 9819; -- NPC entry +SET @SPELL1 := 15749; -- Shield Charge +SET @SPELL2 := 14516; -- Strike +SET @SPELL3 := 11972; -- Shield Bash +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,4,0,100,2,0,0,0,0,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Blackhand Veteran - On Aggro - Cast Shield Charge'), +(@ENTRY,0,1,0,61,0,100,2,0,0,0,0,39,10,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Veteran - On Aggro - Call for help'), +(@ENTRY,0,2,0,0,0,100,2,7800,15800,13800,22900,11,@SPELL2,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Blackhand Veteran - Combat - Cast Veil of Shadow'), +(@ENTRY,0,3,0,0,0,100,2,10000,20000,6000,12000,11,@SPELL3,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Blackhand Veteran - Combat - Cast Veil of Shadow'), +(@ENTRY,0,4,0,2,0,100,3,0,15,0,0,25,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Veteran - HP@15% - Flee for help'), +(@ENTRY,0,5,0,1,0,100,2,0,8000,12000,14000,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Veteran - OOC - emote'); + +-- Rage Talon Dragonspawn SAI +SET @ENTRY := 9096; -- NPC entry +SET @SPELL1 := 15580; -- Strike +SET @SPELL2 := 12021; -- Fixate +SET @SPELL3 := 15572; -- Sunder Armor +SET @SPELL4 := 3391; -- Thrash +SET @SPELL5 := 8269; -- Frenzy +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,2,4000,13200,6600,14400,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Rage Talon Dragonspawn - Combat - Cast Strike'), +(@ENTRY,0,1,0,0,0,100,2,7700,17100,20300,34200,11,@SPELL2,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Rage Talon Dragonspawn - Combat - Cast Fixate'), +(@ENTRY,0,2,0,0,0,100,2,1400,12300,7100,11700,11,@SPELL3,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Rage Talon Dragonspawn - Combat - Cast Sunder Armor'), +(@ENTRY,0,3,0,0,0,100,2,8200,17100,5600,18100,11,@SPELL4,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Rage Talon Dragonspawn - Combat - Cast Thrash'), +(@ENTRY,0,4,5,2,0,100,2,0,30,120000,120000,11,@SPELL5,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Rage Talon Dragonspawn - HP@30% - Cast Frenzy'), +(@ENTRY,0,5,0,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Summoner - HP@30% - say 0'); +-- NPC talk text insert +DELETE FROM `creature_text` WHERE `entry`=9096; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(9096,0,0,'%s goes into a frenzy!',16,0,100,0,0,0,'Rage Talon Dragonspawn'); + + -- Scarshield Legionnaire SAI +SET @ENTRY := 9097; -- NPC entry +SET @SPELL1 := 15496; -- Cleave +SET @SPELL2 := 11972; -- Shield Bash +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,4,0,100,2,0,0,0,0,39,10,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Scarshield Legionnaire - On Aggro - Call for help'), +(@ENTRY,0,1,0,0,0,100,2,7800,11500,8000,22100,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Scarshield Legionnaire - Combat - Cast Cleave'), +(@ENTRY,0,2,0,0,0,100,2,4000,10000,14000,20000,11,@SPELL2,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Scarshield Legionnaire - Combat - Cast Shield Bash'); + +-- Scarshield Acolyte SAI +SET @ENTRY := 9045; -- NPC entry +SET @SPELL1 := 14032; -- Shadow Word: Pain +SET @SPELL2 := 12039; -- Heal +SET @SPELL3 := 8362; -- Renew +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,4,0,100,2,0,0,0,0,39,10,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Scarshield Acolyte - On Aggro - Call for help'), +(@ENTRY,0,1,0,0,0,100,2,7700,15700,21900,33500,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Scarshield Acolyte - Combat - Cast Shadow Word: Pain'), +(@ENTRY,0,2,0,2,0,100,3,0,75,0,0,11,@SPELL2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Scarshield Acolyte - HP@75% - Cast Heal'), +(@ENTRY,0,3,0,14,0,100,2,35,8,5000,6000,11,@SPELL3,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Scarshield Acolyte - Friendly hp@35 - Cast Renew on friendly unit'); + +-- Scarshield Spellbinder SAI +SET @ENTRY := 9098; -- NPC entry +SET @SPELL1 := 13748; -- Arcane Bolt +SET @SPELL2 := 15123; -- Resist Fire +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,11,0,100,2,0,0,0,0,58,1,@SPELL1,1100,3000,30,30,1,0,0,0,0,0,0,0, 'Scarshield Spellbinder - On Reset - Load caster template Cast Arcane Bolt'), +(@ENTRY,0,1,0,4,0,100,2,0,0,0,0,39,10,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Scarshield Spellbinder - On Aggro - Call for help'), +(@ENTRY,0,2,0,16,0,100,2,@SPELL2,30,3000,6000,11,@SPELL2,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Blackhand Summoner - Combat - Cast Resist Fire'); + +-- Blackhand Incarcerator SAI +SET @ENTRY := 10316; -- NPC entry +SET @SPELL1 := 15281; -- Encage Emberseer +SET @SPELL2 := 12039; -- Heal +SET @SPELL3 := 8362; -- Renew +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,3,1000,1000,1000,1000,11,@SPELL1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Incarcerator - OOC - Cast Encage Emberseer'), +(@ENTRY,0,1,2,38,0,100,2,0,1,0,0,92,0,@SPELL1,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Incarcerator - On data set - Stop Casting Encage Emberseer'), +(@ENTRY,0,2,4,61,0,100,0,0,0,0,0,19,768,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Incarcerator - On data set - Remove unit flags'), +(@ENTRY,0,3,4,4,0,100,2,0,0,0,0,9,0,0,0,0,0,0,15,175244,100,0,0,0,0,0, 'Blackhand Incarcerator - On aggro - close emberseer in door'), +(@ENTRY,0,4,0,61,0,100,0,0,0,0,0,9,0,0,0,0,0,0,15,175705,100,0,0,0,0,0, 'Blackhand Incarcerator - On aggro - close doors'), +(@ENTRY,0,5,0,0,0,100,2,7800,15800,13800,22900,11,@SPELL2,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Blackhand Incarcerator - Combat - Cast Strike'), +(@ENTRY,0,6,0,0,0,100,2,10000,20000,6000,12000,11,@SPELL3,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Blackhand Incarcerator - Combat - Cast Encage'), +(@ENTRY,0,7,0,2,0,100,3,0,15,0,0,25,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Incarcerator - HP@15% - Flee for help'), +(@ENTRY,0,8,0,6,0,100,0,0,0,0,0,41,10000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Incarcerator - On death - Despawn after 10 sec'); From ab77e597b179c864c6c2f992dfd1486245df0090 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 26 May 2012 23:00:54 +0200 Subject: [PATCH 0840/1149] Add function for SetObjectScale Author: NoFantasy Source: Mangos --- src/server/game/Entities/Corpse/Corpse.cpp | 2 +- src/server/game/Entities/Creature/Creature.cpp | 2 +- src/server/game/Entities/DynamicObject/DynamicObject.cpp | 2 +- src/server/game/Entities/GameObject/GameObject.cpp | 2 +- src/server/game/Entities/Item/Container/Bag.cpp | 2 +- src/server/game/Entities/Item/Item.cpp | 4 ++-- src/server/game/Entities/Object/Object.h | 2 ++ src/server/game/Entities/Pet/Pet.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Entities/Transport/Transport.cpp | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- src/server/scripts/Commands/cs_modify.cpp | 2 +- src/server/scripts/Commands/cs_wp.cpp | 6 +++--- .../scripts/EasternKingdoms/Karazhan/boss_midnight.cpp | 2 +- .../scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp | 2 +- .../scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp | 2 +- .../AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp | 2 +- .../TrialOfTheCrusader/boss_anubarak_trial.cpp | 2 +- .../TrialOfTheCrusader/trial_of_the_crusader.cpp | 4 ++-- src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp | 8 ++++---- .../SerpentShrine/boss_fathomlord_karathress.cpp | 2 +- src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp | 2 +- .../scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp | 6 +++--- src/server/scripts/Outland/blades_edge_mountains.cpp | 2 +- 24 files changed, 34 insertions(+), 32 deletions(-) diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp index 5b7c40e5494..4613a3554db 100755 --- a/src/server/game/Entities/Corpse/Corpse.cpp +++ b/src/server/game/Entities/Corpse/Corpse.cpp @@ -89,7 +89,7 @@ bool Corpse::Create(uint32 guidlow, Player* owner) WorldObject::_Create(guidlow, HIGHGUID_CORPSE, owner->GetPhaseMask()); - SetFloatValue(OBJECT_FIELD_SCALE_X, 1); + SetObjectScale(1); SetUInt64Value(CORPSE_FIELD_OWNER, owner->GetGUID()); _gridCoord = Trinity::ComputeGridCoord(GetPositionX(), GetPositionY()); diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 6506a113ae1..e8ec686daf5 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -333,7 +333,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data SetSpeed(MOVE_SWIM, 1.0f); // using 1.0 rate SetSpeed(MOVE_FLIGHT, 1.0f); // using 1.0 rate - SetFloatValue(OBJECT_FIELD_SCALE_X, cinfo->scale); + SetObjectScale(cinfo->scale); SetFloatValue(UNIT_FIELD_HOVERHEIGHT, cinfo->HoverHeight); diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp index abeae0656ee..76d4cb6624b 100755 --- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp +++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp @@ -92,7 +92,7 @@ bool DynamicObject::CreateDynamicObject(uint32 guidlow, Unit* caster, uint32 spe WorldObject::_Create(guidlow, HIGHGUID_DYNAMICOBJECT, caster->GetPhaseMask()); SetEntry(spellId); - SetFloatValue(OBJECT_FIELD_SCALE_X, 1); + SetObjectScale(1); SetUInt64Value(DYNAMICOBJECT_CASTER, caster->GetGUID()); // The lower word of DYNAMICOBJECT_BYTES must be 0x0001. This value means that the visual radius will be overriden diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 10136c5fbd7..2f6c15ff829 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -206,7 +206,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa UpdateRotationFields(rotation2, rotation3); // GAMEOBJECT_FACING, GAMEOBJECT_ROTATION, GAMEOBJECT_PARENTROTATION+2/3 - SetFloatValue(OBJECT_FIELD_SCALE_X, goinfo->size); + SetObjectScale(goinfo->size); SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction); SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags); diff --git a/src/server/game/Entities/Item/Container/Bag.cpp b/src/server/game/Entities/Item/Container/Bag.cpp index 4eede93bd37..c4d4adeb6f2 100755 --- a/src/server/game/Entities/Item/Container/Bag.cpp +++ b/src/server/game/Entities/Item/Container/Bag.cpp @@ -78,7 +78,7 @@ bool Bag::Create(uint32 guidlow, uint32 itemid, Player const* owner) Object::_Create(guidlow, 0, HIGHGUID_CONTAINER); SetEntry(itemid); - SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); + SetObjectScale(1.0f); SetUInt64Value(ITEM_FIELD_OWNER, owner ? owner->GetGUID() : 0); SetUInt64Value(ITEM_FIELD_CONTAINED, owner ? owner->GetGUID() : 0); diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index f2b893896dc..af867dad76a 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -258,7 +258,7 @@ bool Item::Create(uint32 guidlow, uint32 itemid, Player const* owner) Object::_Create(guidlow, 0, HIGHGUID_ITEM); SetEntry(itemid); - SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); + SetObjectScale(1.0f); SetUInt64Value(ITEM_FIELD_OWNER, owner ? owner->GetGUID() : 0); SetUInt64Value(ITEM_FIELD_CONTAINED, owner ? owner->GetGUID() : 0); @@ -400,7 +400,7 @@ bool Item::LoadFromDB(uint32 guid, uint64 owner_guid, Field* fields, uint32 entr // Set entry, MUST be before proto check SetEntry(entry); - SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); + SetObjectScale(1.0f); ItemTemplate const* proto = GetTemplate(); if (!proto) diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 3693f683b24..64b780bb6c3 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -137,6 +137,8 @@ class Object uint32 GetEntry() const { return GetUInt32Value(OBJECT_FIELD_ENTRY); } void SetEntry(uint32 entry) { SetUInt32Value(OBJECT_FIELD_ENTRY, entry); } + void SetObjectScale(float scale) { SetFloatValue(OBJECT_FIELD_SCALE_X, scale); } + TypeID GetTypeId() const { return m_objectTypeId; } bool isType(uint16 mask) const { return (mask & m_objectType); } diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index f3a736daceb..75deb8b4216 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -870,7 +870,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) else scale = cFamily->minScale + float(getLevel() - cFamily->minScaleLevel) / cFamily->maxScaleLevel * (cFamily->maxScale - cFamily->minScale); - SetFloatValue(OBJECT_FIELD_SCALE_X, scale); + SetObjectScale(scale); } // Resistance diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 41c95ac3d04..d5e2d8ba956 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3153,7 +3153,7 @@ void Player::InitStatsForLevel(bool reapplyMods) SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); // reset size before reapply auras - SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); + SetObjectScale(1.0f); // save base values (bonuses already included in stored stats for (uint8 i = STAT_STRENGTH; i < MAX_STATS; ++i) diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 9578605ac6f..4f5d5ade7ec 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -214,7 +214,7 @@ bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, floa m_goInfo = goinfo; - SetFloatValue(OBJECT_FIELD_SCALE_X, goinfo->size); + SetObjectScale(goinfo->size); SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction); SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 5a29e6b325d..05114c8bc07 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2425,7 +2425,7 @@ void AuraEffect::HandleAuraCloneCaster(AuraApplication const* aurApp, uint8 mode // What must be cloned? at least display and scale target->SetDisplayId(caster->GetDisplayId()); - //target->SetFloatValue(OBJECT_FIELD_SCALE_X, caster->GetFloatValue(OBJECT_FIELD_SCALE_X)); // we need retail info about how scaling is handled (aura maybe?) + //target->SetObjectScale(caster->GetFloatValue(OBJECT_FIELD_SCALE_X)); // we need retail info about how scaling is handled (aura maybe?) target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_MIRROR_IMAGE); } else diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index b6feccc10c6..3e04cb48af4 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -718,7 +718,7 @@ public: (ChatHandler(player)).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, handler->GetNameLink().c_str(), Scale); } - target->SetFloatValue(OBJECT_FIELD_SCALE_X, Scale); + target->SetObjectScale(Scale); return true; } diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index f29dd8a5069..99ec263b8f9 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -949,7 +949,7 @@ public: if (target) { wpCreature->SetDisplayId(target->GetDisplayId()); - wpCreature->SetFloatValue(OBJECT_FIELD_SCALE_X, 0.5f); + wpCreature->SetObjectScale(0.5f); wpCreature->SetLevel(point > STRONG_MAX_LEVEL ? STRONG_MAX_LEVEL : point); } } @@ -1003,7 +1003,7 @@ public: if (target) { creature->SetDisplayId(target->GetDisplayId()); - creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 0.5f); + creature->SetObjectScale(0.5f); } return true; @@ -1052,7 +1052,7 @@ public: if (target) { creature->SetDisplayId(target->GetDisplayId()); - creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 0.5f); + creature->SetObjectScale(0.5f); } return true; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp index 783ac6baad1..2bba875ad1f 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp @@ -185,7 +185,7 @@ public: pAttumen->GetMotionMaster()->MoveChase(pAttumen->getVictim()); pAttumen->SetTarget(pAttumen->getVictim()->GetGUID()); } - pAttumen->SetFloatValue(OBJECT_FIELD_SCALE_X, 1); + pAttumen->SetObjectScale(1); } } else Mount_Timer -= diff; } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index 9a9f37d165f..a715dbfce9d 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -332,7 +332,7 @@ class boss_akilzon : public CreatureScript CloudGUID = Cloud->GetGUID(); Cloud->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); Cloud->StopMoving(); - Cloud->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); + Cloud->SetObjectScale(1.0f); Cloud->setFaction(35); Cloud->SetMaxHealth(9999999); Cloud->SetHealth(9999999); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index ce6b3b37ef8..3da74d16dc3 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -197,7 +197,7 @@ class boss_thekal : public CreatureScript if (Resurrect_Timer <= diff) { DoCast(me, SPELL_TIGER_FORM); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f); + me->SetObjectScale(2.00f); me->SetStandState(UNIT_STAND_STATE_STAND); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFullHealth(); diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp index 328d1ab1cd4..cf3c4274e48 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp @@ -354,7 +354,7 @@ public: //! HACK: Creature's can't have MOVEMENTFLAG_FLYING me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING); me->setFaction(16); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); + me->SetObjectScale(1.0f); DoCast(me, SPELL_FLAME_SPHERE_VISUAL); DoCast(me, SPELL_FLAME_SPHERE_SPAWN_EFFECT); DoCast(me, SPELL_FLAME_SPHERE_PERIODIC); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index f329b940e1f..1fe7a7da569 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -615,7 +615,7 @@ class mob_frost_sphere : public CreatureScript me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); DoCast(SPELL_PERMAFROST_VISUAL); DoCast(SPELL_PERMAFROST); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.0f); + me->SetObjectScale(2.0f); break; } } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp index 1d4961eb8b4..2643b8d60c7 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -439,7 +439,7 @@ class npc_fizzlebang_toc : public CreatureScript if (Unit* pTrigger = me->SummonCreature(NPC_TRIGGER, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 4.69494f, TEMPSUMMON_MANUAL_DESPAWN)) { m_uiTriggerGUID = pTrigger->GetGUID(); - pTrigger->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.0f); + pTrigger->SetObjectScale(2.0f); pTrigger->SetDisplayId(22862); pTrigger->CastSpell(pTrigger, SPELL_WILFRED_PORTAL, false); } @@ -456,7 +456,7 @@ class npc_fizzlebang_toc : public CreatureScript if (Creature* pPortal = me->SummonCreature(NPC_WILFRED_PORTAL, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 4.71239f, TEMPSUMMON_MANUAL_DESPAWN)) { pPortal->SetReactState(REACT_PASSIVE); - pPortal->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.0f); + pPortal->SetObjectScale(2.0f); pPortal->CastSpell(pPortal, SPELL_WILFRED_PORTAL, false); m_uiPortalGUID = pPortal->GetGUID(); } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index 4d6bfc578ff..0a4fdec7222 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -299,7 +299,7 @@ public: for (itr = chained.begin(); itr != chained.end(); ++itr) { if (Player* charmed = Unit::GetPlayer(*me, (*itr).first)) - charmed->SetFloatValue(OBJECT_FIELD_SCALE_X, (*itr).second); + charmed->SetObjectScale((*itr).second); } chained.clear(); @@ -347,7 +347,7 @@ public: for (itr = chained.begin(); itr != chained.end(); ++itr) { if (Player* player = Unit::GetPlayer(*me, (*itr).first)) - player->SetFloatValue(OBJECT_FIELD_SCALE_X, (*itr).second); + player->SetObjectScale((*itr).second); } chained.clear(); } @@ -512,7 +512,7 @@ public: DoCast(target, SPELL_CHAINS_OF_KELTHUZAD); float scale = target->GetFloatValue(OBJECT_FIELD_SCALE_X); chained.insert(std::make_pair(target->GetGUID(), scale)); - target->SetFloatValue(OBJECT_FIELD_SCALE_X, scale * 2); + target->SetObjectScale(scale * 2); events.ScheduleEvent(EVENT_CHAINED_SPELL, 2000); //core has 2000ms to set unit flag charm } } @@ -530,7 +530,7 @@ public: { if (!player->isCharmed()) { - player->SetFloatValue(OBJECT_FIELD_SCALE_X, (*itr).second); + player->SetObjectScale((*itr).second); std::map::iterator next = itr; ++next; chained.erase(itr); diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp index 206ba3d9455..3937b213e7e 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -691,7 +691,7 @@ public: Creature* Cyclone = me->SummonCreature(CREATURE_CYCLONE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), float(rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000); if (Cyclone) { - CAST_CRE(Cyclone)->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f); + CAST_CRE(Cyclone)->SetObjectScale(3.0f); Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Cyclone->setFaction(me->getFaction()); Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index 77c07f5fe4d..25207073708 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -409,7 +409,7 @@ class boss_alar : public CreatureScript if (Summoned) { Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Summoned->SetFloatValue(OBJECT_FIELD_SCALE_X, Summoned->GetFloatValue(OBJECT_FIELD_SCALE_X)*2.5f); + Summoned->SetObjectScale(Summoned->GetFloatValue(OBJECT_FIELD_SCALE_X)*2.5f); Summoned->SetDisplayId(11686); Summoned->setFaction(me->getFaction()); Summoned->SetLevel(me->getLevel()); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp index c0203150789..d202fdd2f44 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp @@ -140,7 +140,7 @@ class boss_high_astromancer_solarian : public CreatureScript me->SetArmor(defaultarmor); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetVisible(true); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize); + me->SetObjectScale(defaultsize); me->SetDisplayId(MODEL_HUMAN); Summons.DespawnAll(); @@ -153,7 +153,7 @@ class boss_high_astromancer_solarian : public CreatureScript void JustDied(Unit* /*killer*/) { - me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize); + me->SetObjectScale(defaultsize); me->SetDisplayId(MODEL_HUMAN); DoScriptText(SAY_DEATH, me); if (instance) @@ -397,7 +397,7 @@ class boss_high_astromancer_solarian : public CreatureScript DoScriptText(SAY_VOIDB, me); me->SetArmor(WV_ARMOR); me->SetDisplayId(MODEL_VOIDWALKER); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize*2.5f); + me->SetObjectScale(defaultsize*2.5f); } DoMeleeAttackIfReady(); } diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index cf0955ed89c..4ec1d04b6ad 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -774,7 +774,7 @@ class npc_simon_bunny : public CreatureScript colorSequence.clear(); playableSequence.clear(); playerSequence.clear(); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, large ? 2.0f : 1.0f); + me->SetObjectScale(large ? 2.0f : 1.0f); std::list ClusterList; Trinity::AllWorldObjectsInRange objects(me, searchDistance); From b78d6c2c2b426a13e36d24eec7776afe5fdcfaf5 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sun, 27 May 2012 13:17:00 +0200 Subject: [PATCH 0841/1149] DB/Gameobject: Quenched Illidari-Bane Blade added to the object Closes #6446,#6604 --- .../world/2012_05_27_00_world_gameobject_template.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/2012_05_27_00_world_gameobject_template.sql diff --git a/sql/updates/world/2012_05_27_00_world_gameobject_template.sql b/sql/updates/world/2012_05_27_00_world_gameobject_template.sql new file mode 100644 index 00000000000..5fa3c15a505 --- /dev/null +++ b/sql/updates/world/2012_05_27_00_world_gameobject_template.sql @@ -0,0 +1,7 @@ +-- Gameobject updates based on sniffs +UPDATE `gameobject_template` SET `size` =2.5,`questItem1`=30876,`data0`=57,`data1`=21583 WHERE `entry`=185032; +UPDATE `gameobject` SET `position_x`=-3420.991,`position_y`=1373.175,`position_z`=257.5233,`orientation`=3.141593 WHERE `id`=185032; +-- Gameobject loot template +DELETE FROM `gameobject_loot_template` WHERE `entry`=21583; +INSERT INTO `gameobject_loot_template` VALUES +(21583,30876,100,1,0,1,1); -- Quenched Illidari-Bane Blade From dff7c70a38756d9d964f0beb79bb71278351772e Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 27 May 2012 11:12:46 -0230 Subject: [PATCH 0842/1149] DB/waypoints: Fix some waypoint errors. --- sql/updates/world/2012_05_27_01_world_waypoints.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/2012_05_27_01_world_waypoints.sql diff --git a/sql/updates/world/2012_05_27_01_world_waypoints.sql b/sql/updates/world/2012_05_27_01_world_waypoints.sql new file mode 100644 index 00000000000..3685b58a629 --- /dev/null +++ b/sql/updates/world/2012_05_27_01_world_waypoints.sql @@ -0,0 +1,7 @@ +-- RE FIX Reanimated Frost Wyrm +DELETE FROM `creature` WHERE `guid` IN (116670,116671,116672,116681,116683,116684,116685,116686,116687,116696,116697,116699,116700,116701); +UPDATE `creature` SET `MovementType`=2 WHERE `guid` BETWEEN 40497 AND 40505; +UPDATE `creature_addon` SET `bytes1`=50331648,`bytes2`=1 WHERE `guid` BETWEEN 40497 AND 40505; +-- Fix Wildhammer Scout +UPDATE `creature` SET `MovementType`=0 WHERE guid IN (69122,69123,69124,69125,69126,69127); +UPDATE `creature_addon` SET `path_id`=0 WHERE guid IN (69122,69123,69124,69125,69126,69127); From ae98cd9d8adfeab99c2cfb190469caf7ba47a23a Mon Sep 17 00:00:00 2001 From: zxbiohazardzx Date: Sun, 27 May 2012 16:57:47 +0200 Subject: [PATCH 0843/1149] DB/Creature: Add Missing spawn for Queen Angerboda Closes #4842 --- sql/updates/world/2012_05_27_02_world_creature.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2012_05_27_02_world_creature.sql diff --git a/sql/updates/world/2012_05_27_02_world_creature.sql b/sql/updates/world/2012_05_27_02_world_creature.sql new file mode 100644 index 00000000000..8ca3ee75c94 --- /dev/null +++ b/sql/updates/world/2012_05_27_02_world_creature.sql @@ -0,0 +1,4 @@ +-- Add Missing spawn for Queen Angerboda +DELETE FROM `creature` WHERE `id`=24023; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(42162,24023,571,1,1,0,0,2855.372,-3869.662,248.6132,2.181662,150,0,0,9291,3231,0,0,0,0); From abbdeb199e8df880f4a5c8b36c405bdf32a12222 Mon Sep 17 00:00:00 2001 From: gecko32 Date: Sun, 27 May 2012 17:01:34 +0200 Subject: [PATCH 0844/1149] DB/Creature: Remove Compact Harvest Reaver Spawn Closes #5207 --- sql/updates/world/2012_05_27_03_world_creature.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_05_27_03_world_creature.sql diff --git a/sql/updates/world/2012_05_27_03_world_creature.sql b/sql/updates/world/2012_05_27_03_world_creature.sql new file mode 100644 index 00000000000..097f40581a7 --- /dev/null +++ b/sql/updates/world/2012_05_27_03_world_creature.sql @@ -0,0 +1,2 @@ +-- Remove Spawns for Compact Harvest Reaper, it should be spawned via script +DELETE FROM `creature` WHERE `id`=2676; From 310249423356c500878224bb325c0c28a4e1efeb Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 27 May 2012 12:47:45 -0230 Subject: [PATCH 0845/1149] DB/SAI: Fixed spawning, added SAI & pathing, for Reconstructed Wyrm --- .../2012_05_27_04_world_smart_scripts.sql | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 sql/updates/world/2012_05_27_04_world_smart_scripts.sql diff --git a/sql/updates/world/2012_05_27_04_world_smart_scripts.sql b/sql/updates/world/2012_05_27_04_world_smart_scripts.sql new file mode 100644 index 00000000000..1f7cfa3d19c --- /dev/null +++ b/sql/updates/world/2012_05_27_04_world_smart_scripts.sql @@ -0,0 +1,24 @@ +-- Reconstructed Wyrm SAI +SET @ENTRY := 27693; +SET @SPELL1 := 49386; -- Not in dbc +SET @SPELL2 := 49343; -- Frost Breath Strafe +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,11,0,100,0,0,0,0,0,11,@SPELL2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Reconstructed Wyrm - On spawn - cast aura'), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,53,0,@ENTRY,0,0,0,0,1,0,0,0,0,0,0,0,'Reconstructed Wyrm - On spawn - Load Path'); +-- waypoints for Reconstructed Wyrm +DELETE FROM `waypoints` WHERE `entry` IN (@ENTRY); +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,4685.845,1130.759,150.1177, 'Reconstructed Wyrm'), +(@ENTRY,2,4686.284,1131.658,150.1177, 'Reconstructed Wyrm'), +(@ENTRY,3,4688.699,1166.089,161.2737, 'Reconstructed Wyrm'), +(@ENTRY,4,4702.308,1212.668,161.2737, 'Reconstructed Wyrm'), +(@ENTRY,5,4733.535,1260.209,169.6348, 'Reconstructed Wyrm'), +(@ENTRY,6,4751.818,1293.699,175.9404, 'Reconstructed Wyrm'), +(@ENTRY,7,4794.479,1345.154,199.5372, 'Reconstructed Wyrm'), +(@ENTRY,8,4812.264,1373.523,219.8613, 'Reconstructed Wyrm'); +-- Fix spawns +UPDATE `creature` SET `position_x`=4685.845,`position_y`=1130.759,`position_z`=150.1177,`spawntimesecs`=120,`spawndist`=0,`MovementType`=0 WHERE `guid`=100211; +DELETE FROM `creature` WHERE `guid` IN (100256,133240,133241); +DELETE FROM `creature_addon` WHERE `guid` IN (100256,133240,133241); From 0f81aad346dfbfaf02cbe23ab7c436abfcd50022 Mon Sep 17 00:00:00 2001 From: Valcorb Date: Sun, 27 May 2012 19:25:14 +0200 Subject: [PATCH 0846/1149] DB/Quest: solve issues with Attunement to Dalaran killcredit Closes #4747 --- .../world/2012_05_27_05_world_gameobject.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 sql/updates/world/2012_05_27_05_world_gameobject.sql diff --git a/sql/updates/world/2012_05_27_05_world_gameobject.sql b/sql/updates/world/2012_05_27_05_world_gameobject.sql new file mode 100644 index 00000000000..66fbfd0afca --- /dev/null +++ b/sql/updates/world/2012_05_27_05_world_gameobject.sql @@ -0,0 +1,13 @@ +-- [QUEST] Attunement to Dalaran +SET @GUID := 320; +-- Adds the gameobject to recognize the zone +DELETE FROM `gameobject` WHERE `id`=300193; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) +VALUES +(@GUID,300193,571,1,1,3343.8,2502.85,-15.1381,5.74342,0,0,0.266617,-0.963802,300,0,1); +-- [SAI] NPC Attunement To Dalaran Kill Credit Bunny 27135 +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=27135; +DELETE FROM `smart_scripts` WHERE `entryorguid`=27135 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) +VALUES +(27135,0,0,0,8,0,100,1,48021,1,0,0,33,27135,0,0,0,0,0,7,0,0,0,0,0,0,0, 'On spellhit - give kill credit - Attunement to Dalaran Kill Credit Bunny'); From 2724a4ece8ec2e9f3593c96cefbb2e03fff722aa Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sun, 27 May 2012 19:47:21 +0200 Subject: [PATCH 0847/1149] DB/Creature: Add SAI to some rares and set (temp) factions, Special thanks to : Shlomi1515 for the work and Gecko32 for the SAI Closes #3849 --- .../world/2012_05_27_06_world_creature.sql | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 sql/updates/world/2012_05_27_06_world_creature.sql diff --git a/sql/updates/world/2012_05_27_06_world_creature.sql b/sql/updates/world/2012_05_27_06_world_creature.sql new file mode 100644 index 00000000000..1074465a0be --- /dev/null +++ b/sql/updates/world/2012_05_27_06_world_creature.sql @@ -0,0 +1,113 @@ +-- Tukemuth +DELETE FROM `smart_scripts` WHERE `entryorguid`=32400; +INSERT INTO `smart_scripts` VALUES +(32400,0,0,0,9,0,100,0,0,5,9000,13000,11,50410,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Tukemuth - Cast Tusk Strike'), +(32400,0,1,0,0,0,100,0,9000,17000,15000,22000,11,57066,0,0,0,0,0,0,0,0,0,0,0,0,0, 'Tukemuth - Cast Trample'); +UPDATE `creature_template` SET faction_A=7,faction_H=7,mindmg=2926.0,maxdmg=3542.0,skinloot=70209,spell1=50410,spell2=57066,attackpower=3384,dmg_multiplier=1.0,AIName= 'SmartAI',mechanic_immune_mask=2147483647 where entry=32400; + +-- Fumblub Gearwind +DELETE FROM `smart_scripts` WHERE `entryorguid`=32358; +INSERT INTO `smart_scripts` VALUES +(32358,0,0,0,0,0,100,0,4000,6000,12000,15000,11,60906,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Fumblub Gearwind - Cast Machine Gun'); +UPDATE `creature_template` SET faction_A=14,faction_H=14,mindmg=2792,maxdmg=3376,spell1=60906,attackpower=3384,dmg_multiplier=1.0,AIName= 'SmartAI',mechanic_immune_mask=2147483647,type_flags=2048,InhabitType=4 where entry=32358; +UPDATE `creature_addon` SET mount=22719,bytes1=33554432 where guid=151938; + +-- Old Crystalbark +DELETE FROM `smart_scripts` WHERE `entryorguid`=32357; +INSERT INTO `smart_scripts` VALUES +(32357,0,0,0,0,0,100,0,3700,16200,19200,28000,11,50506,0,0,0,0,0,0,0,0,0,0,0,0,0, 'Old Crystalbark - Cast Mark of Detonation'), +(32357,0,1,0,0,0,100,0,1625,8100,9600,14000,11,60903,0,0,0,0,0,0,0,0,0,0,0,0,0, 'Old Crystalbark - Cast Arcane Breath'); +UPDATE `creature_template` SET faction_A=14,faction_H=14,mindmg=3231.0,maxdmg=3309.0,spell1=60903,spell2=50506,attackpower=3214,dmg_multiplier=1.0,AIName= 'SmartAI',mechanic_immune_mask=2147483647 where entry=32357; + +-- Terror Spinner - Tameable +DELETE FROM `smart_scripts` WHERE `entryorguid`=32475; +INSERT INTO `smart_scripts` VALUES +(32475,0,0,0,0,0,100,0,4000,6000,12000,15000,11,36839,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Terror Spinner - Cast Impairing Poison'), +(32475,0,1,0,0,0,100,0,1625,8100,9600,14000,11,28428,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Terror Spinner - Cast Instant Poison'); +UPDATE `creature_template` SET faction_A=14,faction_H=14,mindmg=3625.0,maxdmg=4301.0,spell1=32475,spell2=28428,attackpower=3963,dmg_multiplier=1.0,AIName= 'SmartAI',mechanic_immune_mask=66624,name= 'Terror Spinner' where entry=32475; + +-- Hildana Deathstealer +DELETE FROM `smart_scripts` WHERE `entryorguid`=32495; +INSERT INTO `smart_scripts` VALUES +(32495,0,0,0,0,0,100,1,0,0,0,0,22,1,0,0,0,0,0,0,0,0,0,0,0,0,0, 'Hildana Deathstealer - Enter phase 1'), +(32495,0,1,2,0,1,100,0,3000,6000,4000,6000,11,60991,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Hildana Deathstealer - Cast Lash'), +(32495,0,2,0,61,1,100,0,0,0,0,0,22,2,0,0,0,0,0,0,0,0,0,0,0,0,0, 'Hildana Deathstealer - Enter phase 2'), +(32495,0,3,0,0,2,100,0,3000,5000,9000,11000,11,57547,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Hildana Deathstealer - Cast Touch of the Valkyr'), +(32495,0,4,0,0,2,100,0,12000,13000,13000,15000,22,1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Hildana Deathstealer - timer back to phase 1'); +UPDATE `creature_template` SET faction_A=14,faction_H=14,mindmg=4715,maxdmg=5474,attackpower=5094,dmg_multiplier=1.0,AIName= 'SmartAI',mechanic_immune_mask=2147483647 where entry=32495; + +-- Syreian the Bonecarver +UPDATE `creature_template` SET faction_A=14,faction_H=14,mindmg=2926,maxdmg=3542,spell1=38952,spell2=47168,spell3=50092,attackpower=3234,dmg_multiplier=1.0,mechanic_immune_mask=2147483647 where entry=32438; + +-- Icehorn - Tameable +DELETE FROM `smart_scripts` WHERE `entryorguid`=32361; +INSERT INTO `smart_scripts` VALUES +(32361,0,0,0,0,0,100,0,4500,6750,6750,9750,11,57468,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Icehorn - Cast Romp'); +UPDATE `creature_template` SET type_flags= '1',faction_A=14,faction_H=14,mindmg=2792,maxdmg=3376,spell1=57468,attackpower=3084,dmg_multiplier=1.0,AIName= 'SmartAI',mechanic_immune_mask=66624,skinloot=70211 where entry=32361; + +-- King Ping +DELETE FROM `smart_scripts` WHERE `entryorguid`=32398; +INSERT INTO `smart_scripts` VALUES +(32398,0,0,0,0,0,100,0,1600,8000,12400,13000,11,61115,0,0,0,0,0,2,0,0,0,0,0,0,0, 'King Ping - Cast Belly Flop'), +(32398,0,1,0,0,0,100,0,800,2600,4200,6800,11,50169,0,0,0,0,0,2,0,0,0,0,0,0,0, 'King Ping - Cast Flipper Thwack'); +UPDATE `creature_template` SET faction_A=14,faction_H=14,mindmg=2792,maxdmg=3376,spell1=61115,spell2=50169,attackpower=3234,dmg_multiplier=1.0,AIName= 'SmartAI',mechanic_immune_mask=2147483647 WHERE entry=32398; + +-- High Thane Jorfus +DELETE FROM `smart_scripts` WHERE `entryorguid`=32501; +INSERT INTO `smart_scripts` VALUES +(32501,0,0,0,0,0,100,0,1600,3200,6400,12800,11,60950,0,0,0,0,0,2,0,0,0,0,0,0,0, 'High Thane Jorfus - Cast Blood Plague'), +(32501,0,1,0,0,0,100,2,10000,20000,10000,20000,11,60945,0,0,0,0,0,2,0,0,0,0,0,0,0, 'High Thane Jorfus - Cast Blood Strike'), +(32501,0,2,0,0,0,100,0,8000,13000,16000,21000,11,60953,1,0,0,0,0,5,0,0,0,0,0,0,0, 'High Thane Jorfus - Cast Death and Decaye'), +(32501,0,3,0,0,0,100,4,1000,1400,8500,20500,11,60949,0,0,0,0,0,5,0,0,0,0,0,0,0, 'High Thane Jorfus - Cast Death Coil'), +(32501,0,4,0,0,0,100,2,5000,9000,15000,22000,11,60951,0,0,0,0,0,2,0,0,0,0,0,0,0, 'High Thane Jorfus - Cast Frost Strike'); +UPDATE `creature_template` set faction_A=14,faction_H=14,mindmg=4894,maxdmg=5649,spell1=60950,spell2=60945,spell3=60953,spell4=60949,spell5=60951,attackpower=5271,dmg_multiplier=1.0,AIName= 'SmartAI',mechanic_immune_mask=2147483647 WHERE entry=32501; + +-- Perobas the Bloodthirster +DELETE FROM `smart_scripts` WHERE `entryorguid`=32377; +INSERT INTO `smart_scripts` VALUES +(32377,0,0,0,0,0,100,0,5000,8000,12000,15000,11,50046,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Perobas the Bloodthirster - Cast Gnaw Bone'), +(32377,0,1,0,2,0,100,0,0,50,10000,13000,11,50271,1,0,0,0,0,1,0,0,0,0,0,0,0, 'Perobas the Bloodthirster - Cast Killing Rage'); +UPDATE `creature_template` set faction_A=14,faction_H=14,mindmg=2792,maxdmg=3376,spell1=50046,spell2=52071,attackpower=3084,dmg_multiplier=1.0,AIName= 'SmartAI',mechanic_immune_mask=66624,skinloot=70209 where entry=32377; + +-- Aotona - Tameable +UPDATE `creature` SET curhealth=15952 where id=32481; +UPDATE `creature_template` SET exp=2,armor_mod=1.0,minlevel=75,maxlevel=75,faction_A=14,faction_H=14,mindmg=3376,maxdmg=4034,spell1=49865,spell2=51144,attackpower=3705,dmg_multiplier=1.0,mechanic_immune_mask=66624 where entry=32481; + +-- Griegen +DELETE FROM `smart_scripts` WHERE `entryorguid`=32471; +INSERT INTO `smart_scripts` VALUES +(32471,0,0,0,0,0,100,0,5000,8000,9000,12000,11,51334,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Griegen - Cast Smash'); +UPDATE `creature` set curhealth=15952 where id=32471; +UPDATE `creature_template` set exp=2,armor_mod=1.0,minlevel=75,maxlevel=75,faction_A=14,faction_H=14,mindmg=3376,maxdmg=4034,spell1=51334,attackpower=3705,dmg_multiplier=1.0,AIName= 'SmartAI',mechanic_immune_mask=2147483647 where entry=32471; + +-- Seething Hate +UPDATE `creature_template` SET mindmg=2926,maxdmg=3542,attackpower=3234,dmg_multiplier=1.0,mechanic_immune_mask=66624 WHERE entry=32429; + +-- Vigdis the War Maiden +DELETE FROM `creature_template_addon` WHERE entry=32386; +INSERT INTO `creature_template_addon` VALUES +(32386,0,28040,0,0,0,NULL); +UPDATE `creature` SET spawndist=20.0,MovementType=1 WHERE id=32386; +UPDATE `creature_template` SET faction_A=14,faction_H=14,mindmg=2792,maxdmg=3376,attackpower=3084,dmg_multiplier=1.0,mechanic_immune_mask=2147483647,InhabitType=1 where entry=32386; + +-- King Krush - Tameable +UPDATE `creature_template` SET faction_A=14,faction_H=14,mechanic_immune_mask=66624 WHERE entry=32485; + +-- Scarlet Highlord Daion +UPDATE `creature_template` SET faction_A=14,faction_H=14,mindmg=2926,maxdmg=3542,attackpower=3234,dmg_multiplier=1.0,mechanic_immune_mask=66624 WHERE entry=32417; + +-- Crazed Indu'le Survivor +UPDATE `creature_template` SET mindmg=2926,maxdmg=3542,attackpower=3234,dmg_multiplier=1.0,mechanic_immune_mask=66624 WHERE entry=32409; + +-- Grocklar +UPDATE `creature_template` SET mindmg=3137,maxdmg=3777,attackpower=3457,dmg_multiplier=1.0,mechanic_immune_mask=66624 WHERE entry=32422; + +-- Loque'nahak - Tameable +UPDATE `creature_template` SET type_flags= '1',mechanic_immune_mask=66624 WHERE entry=32422; + +-- Zuldrak Sentinel +DELETE FROM `smart_scripts` WHERE `entryorguid`=32447; +INSERT INTO `smart_scripts` VALUES +(32447,0,0,0,0,0,100,0,0,5,9000,13000,11,55196,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Zuldrak Sentinel - Cast Stomp'), +(32447,0,1,0,0,0,100,0,15000,20000,21000,35000,11,54565,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Zuldrak Sentinel - Cast Whammy'); +UPDATE `creature_template` SET mindmg= '3905',maxdmg= '4600',attackpower= '4252',dmg_multiplier= '1.0',mechanic_immune_mask= '66624',spell1= '54565',spell2= '55196',AIName= 'SmartAI' WHERE entry= '32447'; From f1e6601032ba4077e1d1c6070c4cb20812289f7a Mon Sep 17 00:00:00 2001 From: kaelima Date: Sun, 27 May 2012 19:57:31 +0200 Subject: [PATCH 0848/1149] Core/Protocol: - Allow CMSG_LOGOUT_CANCEL to be recieved during serverside logout process (ignore it however, it's too late to abort) - Fix STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT opcodes because of m_playerRecentlyLogout being set false too early in some cases --- src/server/game/Handlers/MiscHandler.cpp | 4 ++++ src/server/game/Server/Protocol/Opcodes.cpp | 4 ++-- src/server/game/Server/WorldSession.cpp | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index a280bc30b7c..8484ac52d27 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -430,6 +430,10 @@ void WorldSession::HandleLogoutCancelOpcode(WorldPacket & /*recv_data*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LOGOUT_CANCEL Message"); + // Player have already logged out serverside, too late to cancel + if (!GetPlayer()) + return; + LogoutRequest(0); WorldPacket data(SMSG_LOGOUT_CANCEL_ACK, 0); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index bd9c75c251d..8fb8ea0298b 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -104,7 +104,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x04B*/ { "CMSG_LOGOUT_REQUEST", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutRequestOpcode }, /*0x04C*/ { "SMSG_LOGOUT_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x04D*/ { "SMSG_LOGOUT_COMPLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x04E*/ { "CMSG_LOGOUT_CANCEL", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode }, + /*0x04E*/ { "CMSG_LOGOUT_CANCEL", STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode }, /*0x04F*/ { "SMSG_LOGOUT_CANCEL_ACK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x050*/ { "CMSG_NAME_QUERY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode }, /*0x051*/ { "SMSG_NAME_QUERY_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, @@ -310,7 +310,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x119*/ { "CMSG_IGNORE_TRADE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleIgnoreTradeOpcode }, /*0x11A*/ { "CMSG_ACCEPT_TRADE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptTradeOpcode }, /*0x11B*/ { "CMSG_UNACCEPT_TRADE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnacceptTradeOpcode }, - /*0x11C*/ { "CMSG_CANCEL_TRADE", STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTradeOpcode}, + /*0x11C*/ { "CMSG_CANCEL_TRADE", STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTradeOpcode }, /*0x11D*/ { "CMSG_SET_TRADE_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeItemOpcode }, /*0x11E*/ { "CMSG_CLEAR_TRADE_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleClearTradeItemOpcode }, /*0x11F*/ { "CMSG_SET_TRADE_GOLD", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeGoldOpcode }, diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 98bb0123896..7756e686388 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -323,9 +323,9 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) break; } - // single from authed time opcodes send in to after logout time - // and before other STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT opcodes. - if (packet->GetOpcode() != CMSG_SET_ACTIVE_VOICE_CHANNEL) + // some auth opcodes can be recieved before STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT opcodes + // however when we recieve CMSG_CHAR_ENUM we are surely no longer during the logout process. + if (packet->GetOpcode() == CMSG_CHAR_ENUM) m_playerRecentlyLogout = false; sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); From 25717c3faf89a2de5f3cc016a745109fb51094c2 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 27 May 2012 17:08:21 -0230 Subject: [PATCH 0849/1149] DB/Waypoints: Trying to fix errors in db. --- sql/updates/world/2012_05_27_07_world_waypoints.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 sql/updates/world/2012_05_27_07_world_waypoints.sql diff --git a/sql/updates/world/2012_05_27_07_world_waypoints.sql b/sql/updates/world/2012_05_27_07_world_waypoints.sql new file mode 100644 index 00000000000..bd6aa2d0fc1 --- /dev/null +++ b/sql/updates/world/2012_05_27_07_world_waypoints.sql @@ -0,0 +1,8 @@ +-- Fix pathing for Thiassi the Lightning Bringer +DELETE FROM `creature_addon` WHERE `guid`=106554; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (106554,1065540,1); + +-- bio's screwed up movement for rares. Fix for some +UPDATE `creature` SET `spawndist`=10,`MovementType`=1 WHERE `id` IN (32400,32417,32422,32429); +UPDATE `creature_addon` SET `path_id`=2026020 WHERE `guid`=202602; +UPDATE `waypoint_data` SET `id`=2026020 WHERE `id`=2500060; From 52719aa8159d41cef6be0290933216335ebe68f1 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sun, 27 May 2012 22:03:39 +0200 Subject: [PATCH 0850/1149] DB/GameEvents: update starting dates for events Closes #6611 --- sql/updates/world/2012_05_27_07_world_game_event.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 sql/updates/world/2012_05_27_07_world_game_event.sql diff --git a/sql/updates/world/2012_05_27_07_world_game_event.sql b/sql/updates/world/2012_05_27_07_world_game_event.sql new file mode 100644 index 00000000000..eff4a9e7652 --- /dev/null +++ b/sql/updates/world/2012_05_27_07_world_game_event.sql @@ -0,0 +1,8 @@ +UPDATE `game_event` SET `start_time` ='2012-06-21 00:01:00' WHERE `eventEntry`=1; -- Midsummer Fire Festival +UPDATE `game_event` SET `start_time` ='2012-09-19 00:01:00' WHERE `eventEntry`=50; -- Pirates' Day +UPDATE `game_event` SET `start_time` ='2012-09-20 00:01:00' WHERE `eventEntry`=24; -- Brewfest +UPDATE `game_event` SET `start_time` ='2012-09-24 00:01:00' WHERE `eventEntry`=11; -- Harvest Festival +UPDATE `game_event` SET `start_time` ='2012-09-18 01:00:00' WHERE `eventEntry`=11; -- Hallow's End +UPDATE `game_event` SET `start_time` ='2012-11-01 01:00:00' WHERE `eventEntry`=51; -- Day of the Dead +UPDATE `game_event` SET `start_time` ='2012-11-18 01:00:00' WHERE `eventEntry`=26; -- Pilgrim's Bounty +UPDATE `game_event` SET `start_time` ='2012-12-15 06:00:00' WHERE `eventEntry`=2; -- Winter Veil From b549cd2543c57908ee870be3a4085fdf579021b4 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 27 May 2012 22:26:49 +0200 Subject: [PATCH 0851/1149] Scripts/Icecrown Citadel: Remove encounter specific auras when Blood-Queen Lana'thel fight ends (prevents exploits with Essence of the Blood Queen Closes #6610 --- .../boss_blood_queen_lana_thel.cpp | 27 ++++++++++++------- .../boss_deathbringer_saurfang.cpp | 8 ++---- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index f086e8dc9cf..ee966256e2b 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -149,7 +149,7 @@ class boss_blood_queen_lana_thel : public CreatureScript events.ScheduleEvent(EVENT_SWARMING_SHADOWS, 30500, EVENT_GROUP_NORMAL); events.ScheduleEvent(EVENT_TWILIGHT_BLOODBOLT, urand(20000, 25000), EVENT_GROUP_NORMAL); events.ScheduleEvent(EVENT_AIR_PHASE, 124000 + uint32(Is25ManRaid() ? 3000 : 0)); - instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_UNCONTROLLABLE_FRENZY); + CleanAuras(); me->SetSpeed(MOVE_FLIGHT, 0.642857f, true); _offtank = NULL; _vampires.clear(); @@ -170,6 +170,7 @@ class boss_blood_queen_lana_thel : public CreatureScript DoZoneInCombat(); Talk(SAY_AGGRO); instance->SetBossState(DATA_BLOOD_QUEEN_LANA_THEL, IN_PROGRESS); + CleanAuras(); DoCast(me, SPELL_SHROUD_OF_SORROW, true); DoCast(me, SPELL_FRENZIED_BLOODTHIRST_VISUAL, true); @@ -180,15 +181,7 @@ class boss_blood_queen_lana_thel : public CreatureScript { _JustDied(); Talk(SAY_DEATH); - instance->DoRemoveAurasDueToSpellOnPlayers(ESSENCE_OF_BLOOD_QUEEN); - instance->DoRemoveAurasDueToSpellOnPlayers(ESSENCE_OF_BLOOD_QUEEN_PLR); - instance->DoRemoveAurasDueToSpellOnPlayers(FRENZIED_BLOODTHIRST); - instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_UNCONTROLLABLE_FRENZY); - instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_BLOOD_MIRROR_DAMAGE); - instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_BLOOD_MIRROR_VISUAL); - instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_BLOOD_MIRROR_DUMMY); - instance->DoRemoveAurasDueToSpellOnPlayers(DELIRIOUS_SLASH); - instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_PACT_OF_THE_DARKFALLEN); + CleanAuras(); // Blah, credit the quest if (_creditBloodQuickening) { @@ -207,6 +200,19 @@ class boss_blood_queen_lana_thel : public CreatureScript } } + void CleanAuras() + { + instance->DoRemoveAurasDueToSpellOnPlayers(ESSENCE_OF_BLOOD_QUEEN); + instance->DoRemoveAurasDueToSpellOnPlayers(ESSENCE_OF_BLOOD_QUEEN_PLR); + instance->DoRemoveAurasDueToSpellOnPlayers(FRENZIED_BLOODTHIRST); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_UNCONTROLLABLE_FRENZY); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_BLOOD_MIRROR_DAMAGE); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_BLOOD_MIRROR_VISUAL); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_BLOOD_MIRROR_DUMMY); + instance->DoRemoveAurasDueToSpellOnPlayers(DELIRIOUS_SLASH); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_PACT_OF_THE_DARKFALLEN); + } + void DoAction(int32 const action) { if (action != ACTION_KILL_MINCHAR) @@ -227,6 +233,7 @@ class boss_blood_queen_lana_thel : public CreatureScript void EnterEvadeMode() { _EnterEvadeMode(); + CleanAuras(); if (_killMinchar) { _killMinchar = false; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index afc7c503bee..494be259baa 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -631,9 +631,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript _events.ScheduleEvent(EVENT_OUTRO_HORDE_4, 24000); // cast _events.ScheduleEvent(EVENT_OUTRO_HORDE_5, 30000); // move me->SetDisableGravity(false); - me->SendMovementFlagUpdate(); - me->Relocate(me->GetPositionX(), me->GetPositionY(), 539.2917f); - me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 0.0f); + me->GetMotionMaster()->MoveFall(); for (std::list::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr) (*itr)->AI()->DoAction(ACTION_DESPAWN); break; @@ -838,9 +836,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript me->RemoveAurasDueToSpell(SPELL_GRIP_OF_AGONY); Talk(SAY_OUTRO_ALLIANCE_1); me->SetDisableGravity(false); - me->SendMovementFlagUpdate(); - me->Relocate(me->GetPositionX(), me->GetPositionY(), 539.2917f); - me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 0.0f); + me->GetMotionMaster()->MoveFall(); for (std::list::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr) (*itr)->AI()->DoAction(ACTION_DESPAWN); From 2dbbd535ef7292ab5dd2e2dca64dcdbaf4534184 Mon Sep 17 00:00:00 2001 From: Valcorb Date: Mon, 28 May 2012 02:43:41 +0200 Subject: [PATCH 0852/1149] DB\Errors: Fix DB errors from previous commit(s) --- sql/updates/world/2012_05_28_world_creature_ai_scripts.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2012_05_28_world_creature_ai_scripts.sql diff --git a/sql/updates/world/2012_05_28_world_creature_ai_scripts.sql b/sql/updates/world/2012_05_28_world_creature_ai_scripts.sql new file mode 100644 index 00000000000..94035eb9e08 --- /dev/null +++ b/sql/updates/world/2012_05_28_world_creature_ai_scripts.sql @@ -0,0 +1,3 @@ +-- Fix recent DB errors +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=27135; -- Attunement To Dalaran Kill Credit +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=32400; -- Tukemuth From 50d2f9f939c856864c3122e383a4bc503d4027cc Mon Sep 17 00:00:00 2001 From: Valcorb Date: Mon, 28 May 2012 02:48:30 +0200 Subject: [PATCH 0853/1149] DB\Errors: Fix recent DB errors (credits to Vincent-Michael) --- sql/updates/world/2012_05_28_world_creature_ai_scripts.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sql/updates/world/2012_05_28_world_creature_ai_scripts.sql b/sql/updates/world/2012_05_28_world_creature_ai_scripts.sql index 94035eb9e08..aef4e4c6f67 100644 --- a/sql/updates/world/2012_05_28_world_creature_ai_scripts.sql +++ b/sql/updates/world/2012_05_28_world_creature_ai_scripts.sql @@ -1,3 +1,9 @@ -- Fix recent DB errors DELETE FROM `creature_ai_scripts` WHERE `creature_id`=27135; -- Attunement To Dalaran Kill Credit DELETE FROM `creature_ai_scripts` WHERE `creature_id`=32400; -- Tukemuth + +-- Fix recent DB errors (credits to Vincent-Michael) +DELETE FROM `creature_addon` WHERE `guid` = 2593; +DELETE FROM `creature_template_addon` WHERE `entry` = 2676; +INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(2676,0,0,0,4097,0,NULL); From ca07f30d0359bf5a6eecba8b9cc68702eca4071b Mon Sep 17 00:00:00 2001 From: joschiwald Date: Mon, 28 May 2012 04:07:51 +0200 Subject: [PATCH 0854/1149] Core/Spells: convert some spell effects to SpellScripts --- .../world/2012_05_28_00_world_spell_ranks.sql | 5 + ...2012_05_28_01_world_spell_script_names.sql | 38 +++++ ...012_05_28_02_world_spelldifficulty_dbc.sql | 5 + .../world/2012_05_28_03_world_conditions.sql | 7 + src/server/game/Entities/Unit/Unit.cpp | 81 ----------- .../game/Spells/Auras/SpellAuraEffects.cpp | 135 +----------------- src/server/game/Spells/Spell.cpp | 104 +++----------- src/server/game/Spells/SpellEffects.cpp | 31 ---- src/server/game/Spells/SpellMgr.cpp | 19 +-- .../ShadowfangKeep/shadowfang_keep.cpp | 46 +++++- .../EasternKingdoms/ZulAman/boss_hexlord.cpp | 124 ++++++++++------ .../boss_faction_champions.cpp | 62 ++++++-- .../Naxxramas/boss_four_horsemen.cpp | 66 ++++++++- .../Northrend/Naxxramas/boss_gothik.cpp | 37 ++++- .../Northrend/Naxxramas/boss_kelthuzad.cpp | 42 ++++++ .../Ulduar/HallsOfLightning/boss_loken.cpp | 80 +++++------ .../Ulduar/Ulduar/boss_general_vezax.cpp | 42 ++++++ src/server/scripts/Spells/spell_dk.cpp | 16 ++- src/server/scripts/Spells/spell_druid.cpp | 125 +++++++++++++++- src/server/scripts/Spells/spell_generic.cpp | 120 ++++++++++++++++ src/server/scripts/Spells/spell_hunter.cpp | 29 ++++ src/server/scripts/Spells/spell_mage.cpp | 47 +++++- src/server/scripts/Spells/spell_paladin.cpp | 92 +++++++++++- src/server/scripts/Spells/spell_priest.cpp | 46 ++++++ src/server/scripts/Spells/spell_shaman.cpp | 51 +++++++ src/server/scripts/Spells/spell_warlock.cpp | 104 ++++++++++++++ 26 files changed, 1099 insertions(+), 455 deletions(-) create mode 100644 sql/updates/world/2012_05_28_00_world_spell_ranks.sql create mode 100644 sql/updates/world/2012_05_28_01_world_spell_script_names.sql create mode 100644 sql/updates/world/2012_05_28_02_world_spelldifficulty_dbc.sql create mode 100644 sql/updates/world/2012_05_28_03_world_conditions.sql diff --git a/sql/updates/world/2012_05_28_00_world_spell_ranks.sql b/sql/updates/world/2012_05_28_00_world_spell_ranks.sql new file mode 100644 index 00000000000..f6641f2f095 --- /dev/null +++ b/sql/updates/world/2012_05_28_00_world_spell_ranks.sql @@ -0,0 +1,5 @@ +DELETE FROM `spell_ranks` WHERE `first_spell_id`=64694; +INSERT INTO `spell_ranks` (`first_spell_id`,`spell_id`,`rank`) VALUES +(64694,64694,1), +(64694,65263,2), +(64694,65264,3); diff --git a/sql/updates/world/2012_05_28_01_world_spell_script_names.sql b/sql/updates/world/2012_05_28_01_world_spell_script_names.sql new file mode 100644 index 00000000000..78054aa1555 --- /dev/null +++ b/sql/updates/world/2012_05_28_01_world_spell_script_names.sql @@ -0,0 +1,38 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (-633,781,-746,-8050,-34914,-44457,-48181,-30108,34438,34439,35183,43522,65812,68154,68155,68156,-33763,43421,52551,53608,57762,59990,66093,67957,67958,67959,7057,28832,28833,28834,28835,27831,55638,52942,59837,63322); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(-633, 'spell_pal_lay_on_hands'), +(781, 'spell_hun_disengage'), +(-746, 'spell_gen_bandage'), +(-8050, 'spell_sha_flame_shock'), +(-34914,'spell_pri_vampiric_touch'), +(-44457,'spell_mage_living_bomb'), +(-48181,'spell_warl_haunt'), +(-30108,'spell_warl_unstable_affliction'), +(34438, 'spell_warl_unstable_affliction'), -- using class spell script for generic spell because it uses class spell effect +(34439, 'spell_warl_unstable_affliction'), +(35183, 'spell_warl_unstable_affliction'), +(43522, 'spell_hexlord_unstable_affliction'), +(65812, 'spell_faction_champion_warl_unstable_affliction'), +(68154, 'spell_faction_champion_warl_unstable_affliction'), +(68155, 'spell_faction_champion_warl_unstable_affliction'), +(68156, 'spell_faction_champion_warl_unstable_affliction'), +(-33763,'spell_dru_lifebloom'), +(43421, 'spell_hexlord_lifebloom'), +(52551, 'spell_tur_ragepaw_lifebloom'), +(53608, 'spell_cenarion_scout_lifebloom'), +(57762, 'spell_twisted_visage_lifebloom'), +(59990, 'spell_twisted_visage_lifebloom'), +(66093, 'spell_faction_champion_dru_lifebloom'), +(67957, 'spell_faction_champion_dru_lifebloom'), +(67958, 'spell_faction_champion_dru_lifebloom'), +(67959, 'spell_faction_champion_dru_lifebloom'), +(7057, 'spell_shadowfang_keep_haunting_spirits'), +(28832, 'spell_four_horsemen_mark'), +(28833, 'spell_four_horsemen_mark'), +(28834, 'spell_four_horsemen_mark'), +(28835, 'spell_four_horsemen_mark'), +(27831, 'spell_gothic_shadow_bolt_volley'), +(55638, 'spell_gothic_shadow_bolt_volley'), +(52942, 'spell_loken_pulsing_shockwave'), +(59837, 'spell_loken_pulsing_shockwave'), +(63322, 'spell_general_vezax_saronite_vapors'); diff --git a/sql/updates/world/2012_05_28_02_world_spelldifficulty_dbc.sql b/sql/updates/world/2012_05_28_02_world_spelldifficulty_dbc.sql new file mode 100644 index 00000000000..93749c9c5cd --- /dev/null +++ b/sql/updates/world/2012_05_28_02_world_spelldifficulty_dbc.sql @@ -0,0 +1,5 @@ +SET @DIFF := xxxx; -- set by TDB team +DELETE FROM `spelldifficulty_dbc` WHERE `id` IN (@DIFF+0,@DIFF+1); +INSERT INTO `spelldifficulty_dbc` (`id`,`spelld0`,`spellid1`,`spelld2`,`spellid3`) VALUES +(@DIFF+0,57762,57763,0,0), +(@DIFF+1,59990,61489,0,0); diff --git a/sql/updates/world/2012_05_28_03_world_conditions.sql b/sql/updates/world/2012_05_28_03_world_conditions.sql new file mode 100644 index 00000000000..8369352481b --- /dev/null +++ b/sql/updates/world/2012_05_28_03_world_conditions.sql @@ -0,0 +1,7 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry` IN (19938,30877); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(17,0,19938,0,0,1,1,17743,0,0,0,0,'','Awaken Peon'), +(17,0,30877,0,0,31,1,3,17326,0,0,0,'','Tag Murloc'); + +-- Lifebinder's Gift +UPDATE `conditions` SET `SourceGroup`=7 WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (62584,64185); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a04e2ac0e48..8e2738783dc 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3629,87 +3629,6 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId // Call AfterDispel hook on AuraScript aura->CallScriptAfterDispel(&dispelInfo); - switch (aura->GetSpellInfo()->SpellFamilyName) - { - case SPELLFAMILY_WARLOCK: - { - // Unstable Affliction (crash if before removeaura?) - if (aura->GetSpellInfo()->SpellFamilyFlags[1] & 0x0100) - { - Unit* caster = aura->GetCaster(); - if (!caster) - break; - if (AuraEffect const* aurEff = aura->GetEffect(EFFECT_0)) - { - int32 damage = aurEff->GetAmount() * 9; - // backfire damage and silence - caster->CastCustomSpell(dispeller, 31117, &damage, NULL, NULL, true, NULL, aurEff); - } - } - break; - } - case SPELLFAMILY_DRUID: - { - // Lifebloom - if (aura->GetSpellInfo()->SpellFamilyFlags[1] & 0x10) - { - if (AuraEffect const* aurEff = aura->GetEffect(EFFECT_1)) - { - // final heal - int32 healAmount = aurEff->GetAmount(); - if (Unit* caster = aura->GetCaster()) - { - healAmount = caster->SpellHealingBonusDone(this, aura->GetSpellInfo(), healAmount, HEAL, dispelInfo.GetRemovedCharges()); - healAmount = this->SpellHealingBonusTaken(aura->GetSpellInfo(), healAmount, HEAL, dispelInfo.GetRemovedCharges()); - } - CastCustomSpell(this, 33778, &healAmount, NULL, NULL, true, NULL, NULL, aura->GetCasterGUID()); - - // mana - if (Unit* caster = aura->GetCaster()) - { - int32 mana = CalculatePctU(caster->GetCreateMana(), aura->GetSpellInfo()->ManaCostPercentage) * chargesRemoved / 2; - caster->CastCustomSpell(caster, 64372, &mana, NULL, NULL, true, NULL, NULL, aura->GetCasterGUID()); - } - } - } - break; - } - case SPELLFAMILY_SHAMAN: - { - // Flame Shock - if (aura->GetSpellInfo()->SpellFamilyFlags[0] & 0x10000000) - { - if (Unit* caster = aura->GetCaster()) - { - uint32 triggeredSpellId = 0; - // Lava Flows - if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 3087, 0)) - { - switch (aurEff->GetId()) - { - case 51482: // Rank 3 - triggeredSpellId = 65264; - break; - case 51481: // Rank 2 - triggeredSpellId = 65263; - break; - case 51480: // Rank 1 - triggeredSpellId = 64694; - break; - default: - sLog->outError("Unit::RemoveAurasDueToSpellByDispel: Unknown rank of Lava Flows (%d) found", aurEff->GetId()); - } - } - - if (triggeredSpellId) - caster->CastSpell(caster, triggeredSpellId, true); - } - } - break; - } - default: - break; - } return; } else diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index e3d220d744f..c7eb4e83be8 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -777,33 +777,18 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool create, bool load) m_amplitude = 1 * IN_MILLISECONDS; case SPELL_AURA_PERIODIC_DAMAGE: case SPELL_AURA_PERIODIC_HEAL: - case SPELL_AURA_PERIODIC_ENERGIZE: case SPELL_AURA_OBS_MOD_HEALTH: + case SPELL_AURA_PERIODIC_TRIGGER_SPELL: + case SPELL_AURA_PERIODIC_ENERGIZE: case SPELL_AURA_PERIODIC_LEECH: case SPELL_AURA_PERIODIC_HEALTH_FUNNEL: case SPELL_AURA_PERIODIC_MANA_LEECH: case SPELL_AURA_PERIODIC_DAMAGE_PERCENT: case SPELL_AURA_POWER_BURN: - m_isPeriodic = true; - break; - case SPELL_AURA_PERIODIC_TRIGGER_SPELL: - if (GetId() == 51912) - m_amplitude = 3000; - m_isPeriodic = true; - break; - case SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE: case SPELL_AURA_PERIODIC_DUMMY: + case SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE: m_isPeriodic = true; break; - case SPELL_AURA_DUMMY: - // Haunting Spirits - perdiodic trigger demon - if (GetId() == 7057) - { - m_isPeriodic = true; - m_amplitude = irand (0, 60) + 30; - m_amplitude *= IN_MILLISECONDS; - } - break; default: break; } @@ -1099,14 +1084,6 @@ void AuraEffect::UpdatePeriodic(Unit* caster) { switch (GetAuraType()) { - case SPELL_AURA_DUMMY: - // Haunting Spirits - if (GetId() == 7057) - { - m_amplitude = irand (0, 60) + 30; - m_amplitude *= IN_MILLISECONDS; - } - break; case SPELL_AURA_PERIODIC_DUMMY: switch (GetSpellInfo()->SpellFamilyName) { @@ -1308,11 +1285,6 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit* caster) case SPELL_AURA_POWER_BURN: HandlePeriodicPowerBurnAuraTick(target, caster); break; - case SPELL_AURA_DUMMY: - // Haunting Spirits - if (GetId() == 7057) - target->CastSpell((Unit*)NULL, GetAmount(), true); - break; default: break; } @@ -4804,38 +4776,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool if (Unit* spellTarget = ObjectAccessor::GetUnit(*target, target->ToPlayer()->GetComboTarget())) target->CastSpell(spellTarget, 51699, true); break; - case 28832: // Mark of Korth'azz - case 28833: // Mark of Blaumeux - case 28834: // Mark of Rivendare - case 28835: // Mark of Zeliek - if (caster) // actually we can also use cast(this, originalcasterguid) - { - int32 damage; - switch (GetBase()->GetStackAmount()) - { - case 1: damage = 0; break; - case 2: damage = 500; break; - case 3: damage = 1000; break; - case 4: damage = 1500; break; - case 5: damage = 4000; break; - case 6: damage = 12000; break; - default:damage = 20000 + 1000 * (GetBase()->GetStackAmount() - 7); break; - } - if (damage) - caster->CastCustomSpell(28836, SPELLVALUE_BASE_POINT0, damage, target); - } - break; - case 63322: // Saronite Vapors - { - if (caster) - { - int32 mana = int32(GetAmount() * pow(2.0f, GetBase()->GetStackAmount())); // mana restore - bp * 2^stackamount - int32 damage = mana * 2; // damage - caster->CastCustomSpell(target, 63337, &mana, NULL, NULL, true); - caster->CastCustomSpell(target, 63338, &damage, NULL, NULL, true); - } - break; - } case 71563: if (Aura* newAura = target->AddAura(71564, target)) newAura->SetStackAmount(newAura->GetSpellInfo()->StackAmount); @@ -4929,57 +4869,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool break; } break; - case SPELLFAMILY_MAGE: - // Living Bomb - if (m_spellInfo->SpellFamilyFlags[1] & 0x20000) - { - AuraRemoveMode removeMode = aurApp->GetRemoveMode(); - if (caster && (removeMode == AURA_REMOVE_BY_ENEMY_SPELL || removeMode == AURA_REMOVE_BY_EXPIRE)) - caster->CastSpell(target, GetAmount(), true); - } - break; - case SPELLFAMILY_PRIEST: - // Vampiric Touch - if (m_spellInfo->SpellFamilyFlags[1] & 0x0400 && aurApp->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL && GetEffIndex() == 0) - if (AuraEffect const* aurEff = GetBase()->GetEffect(1)) - { - int32 damage = aurEff->GetAmount() * 8; - // backfire damage - target->CastCustomSpell(target, 64085, &damage, NULL, NULL, true, NULL, NULL, GetCasterGUID()); - } - break; - case SPELLFAMILY_WARLOCK: - // Haunt - if (m_spellInfo->SpellFamilyFlags[1] & 0x40000) - if (caster) - target->CastCustomSpell(caster, 48210, &m_amount, 0, 0, true, NULL, this, GetCasterGUID()); - break; - case SPELLFAMILY_DRUID: - // Lifebloom - if (GetSpellInfo()->SpellFamilyFlags[1] & 0x10) - { - // Final heal only on duration end - if (aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) - return; - - // final heal - int32 stack = GetBase()->GetStackAmount(); - int32 heal = m_amount; - if (caster) - { - heal = caster->SpellHealingBonusDone(target, GetSpellInfo(), heal, HEAL, stack); - heal = target->SpellHealingBonusTaken(GetSpellInfo(), heal, HEAL, stack); - } - target->CastCustomSpell(target, 33778, &heal, &stack, NULL, true, NULL, this, GetCasterGUID()); - - // restore mana - if (caster) - { - int32 returnmana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * stack / 2; - caster->CastCustomSpell(caster, 64372, &returnmana, NULL, NULL, true, NULL, this, GetCasterGUID()); - } - } - break; case SPELLFAMILY_DEATHKNIGHT: // Summon Gargoyle (Dismiss Gargoyle at remove) if (GetId() == 61777) @@ -5087,16 +4976,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool } break; } - case 57723: // Exhaustion - case 57724: // Sated - { - switch (GetId()) - { - case 57723: target->ApplySpellImmune(GetId(), IMMUNITY_ID, 32182, apply); break; // Heroism - case 57724: target->ApplySpellImmune(GetId(), IMMUNITY_ID, 2825, apply); break; // Bloodlust - } - break; - } case 57819: // Argent Champion case 57820: // Ebon Champion case 57821: // Champion of the Kirin Tor @@ -5884,14 +5763,6 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster) if (caster) caster->CastCustomSpell(29879, SPELLVALUE_BASE_POINT0, int32(target->CountPctFromMaxHealth(21)), target, true, NULL, this); return; - // Detonate Mana - case 27819: - if (int32 mana = (int32)(target->GetMaxPower(POWER_MANA) / 10)) - { - mana = target->ModifyPower(POWER_MANA, -mana); - target->CastCustomSpell(27820, SPELLVALUE_BASE_POINT0, -mana*10, target, true, NULL, this); - } - return; // Inoculate Nestlewood Owlkin case 29528: if (target->GetTypeId() != TYPEID_UNIT) // prevent error reports in case ignored player target diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 28b089f91cd..7c4cc47b886 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1288,18 +1288,6 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge maxSize = m_caster->HasAura(62970) ? 6 : 5; // Glyph of Wild Growth power = POWER_HEALTH; } - else if (m_spellInfo->SpellFamilyFlags[2] == 0x0100) // Starfall - { - // Remove targets not in LoS or in stealth - for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end();) - { - if ((*itr)->HasStealthAura() || (*itr)->HasInvisibilityAura() || !(*itr)->IsWithinLOSInMap(m_caster)) - itr = unitTargets.erase(itr); - else - ++itr; - } - break; - } else break; @@ -1340,6 +1328,11 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge } } + // todo: move to scripts, but we must call it before resize list by MaxAffectedTargets + // Intimidating Shout + if (m_spellInfo->Id == 5246 && effIndex != EFFECT_0) + unitTargets.remove(m_targets.GetUnitTarget()); + // Other special target selection goes here if (uint32 maxTargets = m_spellValue->MaxAffectedTargets) { @@ -1348,8 +1341,6 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge if ((*j)->IsAffectedOnSpell(m_spellInfo)) maxTargets += (*j)->GetAmount(); - if (m_spellInfo->Id == 5246) //Intimidating Shout - unitTargets.remove(m_targets.GetUnitTarget()); Trinity::Containers::RandomResizeList(unitTargets, maxTargets); } @@ -2477,12 +2468,6 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) caster->DealSpellDamage(&damageInfo, true); - // Haunt - if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->SpellFamilyFlags[1] & 0x40000 && m_spellAura && m_spellAura->GetEffect(1)) - { - AuraEffect* aurEff = m_spellAura->GetEffect(1); - aurEff->SetAmount(CalculatePctU(aurEff->GetAmount(), damageInfo.damage)); - } m_damage = damageInfo.damage; } // Passive spell hits/misses or active spells only misses (only triggers) @@ -4825,19 +4810,9 @@ SpellCastResult Spell::CheckCast(bool strict) if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target)) return SPELL_FAILED_LINE_OF_SIGHT; } - else - { - if (m_caster->GetTypeId() == TYPEID_PLAYER) // Target - is player caster - { - // Lay on Hands - cannot be self-cast on paladin with Forbearance or after using Avenging Wrath - if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && m_spellInfo->SpellFamilyFlags[0] & 0x0008000) - if (target->HasAura(61988)) // Immunity shield marker - return SPELL_FAILED_TARGET_AURASTATE; - } - } } - //Check for line of sight for spells with dest + // Check for line of sight for spells with dest if (m_targets.HasDst()) { float x, y, z; @@ -4936,7 +4911,8 @@ SpellCastResult Spell::CheckCast(bool strict) bool hasDispellableAura = false; bool hasNonDispelEffect = false; - for (int i = 0; i < MAX_SPELL_EFFECTS; i++) + uint32 dispelMask = 0; + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_DISPEL) { if (m_spellInfo->Effects[i].IsTargetingArea() || m_spellInfo->AttributesEx & SPELL_ATTR1_MELEE_COMBAT_START) @@ -4944,17 +4920,8 @@ SpellCastResult Spell::CheckCast(bool strict) hasDispellableAura = true; break; } - if (Unit* target = m_targets.GetUnitTarget()) - { - DispelChargesList dispelList; - uint32 dispelMask = SpellInfo::GetDispelMask(DispelType(m_spellInfo->Effects[i].MiscValue)); - target->GetDispellableAuraList(m_caster, dispelMask, dispelList); - if (!dispelList.empty()) - { - hasDispellableAura = true; - break; - } - } + + dispelMask |= SpellInfo::GetDispelMask(DispelType(m_spellInfo->Effects[i].MiscValue)); } else if (m_spellInfo->Effects[i].IsEffect()) { @@ -4962,10 +4929,18 @@ SpellCastResult Spell::CheckCast(bool strict) break; } - if (!hasNonDispelEffect && !hasDispellableAura && m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL) && !IsTriggered()) - return SPELL_FAILED_NOTHING_TO_DISPEL; + if (!hasNonDispelEffect && !hasDispellableAura && dispelMask && !IsTriggered()) + { + if (Unit* target = m_targets.GetUnitTarget()) + { + DispelChargesList dispelList; + target->GetDispellableAuraList(m_caster, dispelMask, dispelList); + if (dispelList.empty()) + return SPELL_FAILED_NOTHING_TO_DISPEL; + } + } - for (int i = 0; i < MAX_SPELL_EFFECTS; i++) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { // for effects of spells that have only one target switch (m_spellInfo->Effects[i].Effect) @@ -4977,25 +4952,6 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_caster->IsInWater()) return SPELL_FAILED_ONLY_ABOVEWATER; } - else if (m_spellInfo->SpellIconID == 156) // Holy Shock - { - // spell different for friends and enemies - // hurt version required facing - if (m_targets.GetUnitTarget() && !m_caster->IsFriendlyTo(m_targets.GetUnitTarget()) && !m_caster->HasInArc(static_cast(M_PI), m_targets.GetUnitTarget())) - return SPELL_FAILED_UNIT_NOT_INFRONT; - } - else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && m_spellInfo->SpellFamilyFlags[0] == 0x2000) // Death Coil (DeathKnight) - { - Unit* target = m_targets.GetUnitTarget(); - if (!target || (target->IsFriendlyTo(m_caster) && target->GetCreatureType() != CREATURE_TYPE_UNDEAD)) - return SPELL_FAILED_BAD_TARGETS; - } - else if (m_spellInfo->Id == 19938) // Awaken Peon - { - Unit* unit = m_targets.GetUnitTarget(); - if (!unit || !unit->HasAura(17743)) - return SPELL_FAILED_BAD_TARGETS; - } else if (m_spellInfo->Id == 52264) // Deliver Stolen Horse { if (!m_caster->FindNearestCreature(28653, 5)) @@ -5329,10 +5285,6 @@ SpellCastResult Spell::CheckCast(bool strict) } case SPELL_EFFECT_LEAP_BACK: { - // Spell 781 (Disengage) requires player to be in combat - if (m_caster->GetTypeId() == TYPEID_PLAYER && m_spellInfo->Id == 781 && !m_caster->isInCombat()) - return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; - if (m_caster->HasUnitState(UNIT_STATE_ROOT)) { if (m_caster->GetTypeId() == TYPEID_PLAYER) @@ -5363,14 +5315,6 @@ SpellCastResult Spell::CheckCast(bool strict) //custom check switch (m_spellInfo->Id) { - // Tag Murloc - case 30877: - { - Unit* target = m_targets.GetUnitTarget(); - if (!target || target->GetEntry() != 17326) - return SPELL_FAILED_BAD_TARGETS; - break; - } case 61336: if (m_caster->GetTypeId() != TYPEID_PLAYER || !m_caster->ToPlayer()->IsInFeralForm()) return SPELL_FAILED_ONLY_SHAPESHIFT; @@ -7173,12 +7117,6 @@ void Spell::PrepareTriggersExecutedOnHit() // todo: move this to scripts switch (m_spellInfo->SpellFamilyName) { - case SPELLFAMILY_GENERIC: - { - if (m_spellInfo->Mechanic == MECHANIC_BANDAGE) // Bandages - m_preCastSpell = 11196; // Recently Bandaged - break; - } case SPELLFAMILY_MAGE: { // Permafrost diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 06493dd070a..4df34e1a62d 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -368,28 +368,6 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) damage = (distance > radius) ? 0 : int32(m_spellInfo->Effects[EFFECT_0].CalcValue(m_caster) * ((radius - distance)/radius)); break; } - // Loken Pulsing Shockwave - case 59837: - case 52942: - { - // don't damage self and only players - if (unitTarget->GetGUID() == m_caster->GetGUID() || unitTarget->GetTypeId() != TYPEID_PLAYER) - return; - - float radius = m_spellInfo->Effects[EFFECT_0].CalcRadius(m_caster); - if (!radius) - return; - float distance = m_caster->GetDistance2d(unitTarget); - damage = (distance > radius) ? 0 : int32(m_spellInfo->Effects[EFFECT_0].CalcValue(m_caster) * distance); - break; - } - // TODO: add spell specific target requirement hook for spells - // Shadowbolts only affects targets with Shadow Mark (Gothik) - case 27831: - case 55638: - if (!unitTarget->HasAura(27825)) - return; - break; // Gargoyle Strike case 51963: { @@ -3569,15 +3547,6 @@ void Spell::EffectHealMaxHealth(SpellEffIndex /*effIndex*/) return; int32 addhealth; - if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN) // Lay on Hands - { - if (m_caster->GetGUID() == unitTarget->GetGUID()) - { - m_caster->CastSpell(m_caster, 25771, true); // Forbearance - m_caster->CastSpell(m_caster, 61988, true); // Immune shield marker (serverside) - m_caster->CastSpell(m_caster, 61987, true); // Avenging Wrath marker - } - } // damage == 0 - heal for caster max health if (damage == 0) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 06e4978eb58..87373321a36 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2960,8 +2960,10 @@ void SpellMgr::LoadDbcDataCorrections() switch (spellInfo->Id) { - case 40244: case 40245: // Simon Game Visual - case 40246: case 40247: // Simon Game Visual + case 40244: // Simon Game Visual + case 40245: // Simon Game Visual + case 40246: // Simon Game Visual + case 40247: // Simon Game Visual case 42835: // Spout, remove damage effect, only anim is needed spellInfo->Effect[0] = 0; break; @@ -3125,6 +3127,9 @@ void SpellMgr::LoadDbcDataCorrections() case 51852: // The Eye of Acherus (no spawn in phase 2 in db) spellInfo->EffectMiscValue[0] |= 1; break; + case 51912: // Crafty's Ultra-Advanced Proto-Typical Shortening Blaster + spellInfo->EffectAmplitude[0] = 3000; + break; case 29809: // Desecration Arm - 36 instead of 37 - typo? :/ spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_7_YARDS; break; @@ -3293,11 +3298,6 @@ void SpellMgr::LoadDbcDataCorrections() // that will be clear if we get more spells with problem like this spellInfo->AttributesEx |= SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY; break; - case 62584: // Lifebinder's Gift - case 64185: // Lifebinder's Gift - spellInfo->EffectImplicitTargetB[1] = TARGET_UNIT_NEARBY_ENTRY; - spellInfo->EffectImplicitTargetB[2] = TARGET_UNIT_NEARBY_ENTRY; - break; case 62301: // Cosmic Smash (Algalon the Observer) spellInfo->MaxAffectedTargets = 1; break; @@ -3539,11 +3539,6 @@ void SpellMgr::LoadDbcDataCorrections() switch (spellInfo->SpellFamilyName) { - case SPELLFAMILY_DRUID: - // Starfall Target Selection - if (spellInfo->SpellFamilyFlags[2] & 0x100) - spellInfo->MaxAffectedTargets = 2; - break; case SPELLFAMILY_PALADIN: // Seals of the Pure should affect Seal of Righteousness if (spellInfo->SpellIconID == 25 && spellInfo->Attributes & SPELL_ATTR0_PASSIVE) diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp index 63e753a18ba..676cd7be4f0 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp @@ -27,7 +27,11 @@ EndScriptData */ npc_shadowfang_prisoner EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" #include "ScriptedEscortAI.h" #include "shadowfang_keep.h" @@ -193,8 +197,48 @@ public: }; +class spell_shadowfang_keep_haunting_spirits : public SpellScriptLoader +{ + public: + spell_shadowfang_keep_haunting_spirits() : SpellScriptLoader("spell_shadowfang_keep_haunting_spirits") { } + + class spell_shadowfang_keep_haunting_spirits_AuraScript : public AuraScript + { + PrepareAuraScript(spell_shadowfang_keep_haunting_spirits_AuraScript); + + void CalcPeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& amplitude) + { + isPeriodic = true; + amplitude = (irand(0, 60) + 30) * IN_MILLISECONDS; + } + + void HandleDummyTick(AuraEffect const* aurEff) + { + GetTarget()->CastSpell((Unit*)NULL, aurEff->GetAmount(), true); + } + + void HandleUpdatePeriodic(AuraEffect* aurEff) + { + aurEff->CalculatePeriodic(GetCaster()); + } + + void Register() + { + DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_DUMMY); + OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::HandleUpdatePeriodic, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_shadowfang_keep_haunting_spirits_AuraScript(); + } +}; + void AddSC_shadowfang_keep() { new npc_shadowfang_prisoner(); new npc_arugal_voidwalker(); + new spell_shadowfang_keep_haunting_spirits(); } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp index b5698d851f8..4fcfa8a046e 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp @@ -23,7 +23,10 @@ SDComment: SDCategory: Zul'Aman EndScriptData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" #include "zulaman.h" #define YELL_AGGRO "Da shadow gonna fall on you... " @@ -47,54 +50,58 @@ EndScriptData */ //Defines for various powers he uses after using soul drain -//Druid -#define SPELL_DR_LIFEBLOOM 43421 -#define SPELL_DR_THORNS 43420 -#define SPELL_DR_MOONFIRE 43545 +enum Spells +{ + // Druid + SPELL_DR_THORNS = 43420, + SPELL_DR_LIFEBLOOM = 43421, + SPELL_DR_MOONFIRE = 43545, -//Hunter -#define SPELL_HU_EXPLOSIVE_TRAP 43444 -#define SPELL_HU_FREEZING_TRAP 43447 -#define SPELL_HU_SNAKE_TRAP 43449 + // Hunter + SPELL_HU_EXPLOSIVE_TRAP = 43444, + SPELL_HU_FREEZING_TRAP = 43447, + SPELL_HU_SNAKE_TRAP = 43449, -//Mage -#define SPELL_MG_FIREBALL 41383 -#define SPELL_MG_FROSTBOLT 43428 -#define SPELL_MG_FROST_NOVA 43426 -#define SPELL_MG_ICE_LANCE 43427 + // Mage + SPELL_MG_FIREBALL = 41383, + SPELL_MG_FROST_NOVA = 43426, + SPELL_MG_ICE_LANCE = 43427, + SPELL_MG_FROSTBOLT = 43428, -//Paladin -#define SPELL_PA_CONSECRATION 43429 -#define SPELL_PA_HOLY_LIGHT 43451 -#define SPELL_PA_AVENGING_WRATH 43430 + // Paladin + SPELL_PA_CONSECRATION = 43429, + SPELL_PA_AVENGING_WRATH = 43430, + SPELL_PA_HOLY_LIGHT = 43451, -//Priest -#define SPELL_PR_HEAL 41372 -#define SPELL_PR_MIND_CONTROL 43550 -#define SPELL_PR_MIND_BLAST 41374 -#define SPELL_PR_SW_DEATH 41375 -#define SPELL_PR_PSYCHIC_SCREAM 43432 -#define SPELL_PR_PAIN_SUPP 44416 + // Priest + SPELL_PR_HEAL = 41372, + SPELL_PR_MIND_BLAST = 41374, + SPELL_PR_SW_DEATH = 41375, + SPELL_PR_PSYCHIC_SCREAM = 43432, + SPELL_PR_MIND_CONTROL = 43550, + SPELL_PR_PAIN_SUPP = 44416, -//Rogue -#define SPELL_RO_BLIND 43433 -#define SPELL_RO_SLICE_DICE 43457 -#define SPELL_RO_WOUND_POISON 39665 + // Rogue + SPELL_RO_BLIND = 43433, + SPELL_RO_SLICE_DICE = 43457, + SPELL_RO_WOUND_POISON = 43461, -//Shaman -#define SPELL_SH_FIRE_NOVA 43436 -#define SPELL_SH_HEALING_WAVE 43548 -#define SPELL_SH_CHAIN_LIGHT 43435 + // Shaman + SPELL_SH_CHAIN_LIGHT = 43435, + SPELL_SH_FIRE_NOVA = 43436, + SPELL_SH_HEALING_WAVE = 43548, -//Warlock -#define SPELL_WL_CURSE_OF_DOOM 43439 -#define SPELL_WL_RAIN_OF_FIRE 43440 -#define SPELL_WL_UNSTABLE_AFFL 35183 + // Warlock + SPELL_WL_CURSE_OF_DOOM = 43439, + SPELL_WL_RAIN_OF_FIRE = 43440, + SPELL_WL_UNSTABLE_AFFL = 43522, + SPELL_WL_UNSTABLE_AFFL_DISPEL = 43523, -//Warrior -#define SPELL_WR_SPELL_REFLECT 43443 -#define SPELL_WR_WHIRLWIND 43442 -#define SPELL_WR_MORTAL_STRIKE 43441 + // Warrior + SPELL_WR_MORTAL_STRIKE = 43441, + SPELL_WR_WHIRLWIND = 43442, + SPELL_WR_SPELL_REFLECT = 43443 +}; #define ORIENT 1.5696f #define POS_Y 921.2795f @@ -936,6 +943,40 @@ class boss_koragg : public CreatureScript } }; +class spell_hexlord_unstable_affliction : public SpellScriptLoader +{ + public: + spell_hexlord_unstable_affliction() : SpellScriptLoader("spell_hexlord_unstable_affliction") { } + + class spell_hexlord_unstable_affliction_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hexlord_unstable_affliction_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_WL_UNSTABLE_AFFL_DISPEL)) + return false; + return true; + } + + void HandleDispel(DispelInfo* dispelInfo) + { + if (Unit* caster = GetCaster()) + caster->CastSpell(dispelInfo->GetDispeller(), SPELL_WL_UNSTABLE_AFFL_DISPEL, true, NULL, GetEffect(EFFECT_0)); + } + + void Register() + { + AfterDispel += AuraDispelFn(spell_hexlord_unstable_affliction_AuraScript::HandleDispel); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_hexlord_unstable_affliction_AuraScript(); + } +}; + void AddSC_boss_hex_lord_malacrass() { new boss_hexlord_malacrass(); @@ -947,5 +988,6 @@ void AddSC_boss_hex_lord_malacrass() new boss_fenstalker(); new boss_koragg(); new boss_alyson_antille(); + new spell_hexlord_unstable_affliction(); } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp index 79bbb470edf..3b0aeb958cb 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp @@ -27,7 +27,10 @@ EndScriptData */ // All - untested // Pets aren't being summoned by their masters -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" #include "trial_of_the_crusader.h" enum eYell @@ -945,18 +948,18 @@ public: }; -enum eWarlockSpells +enum WarlockSpells { - SPELL_HELLFIRE = 65816, - SPELL_CORRUPTION = 65810, - SPELL_CURSE_OF_AGONY = 65814, - SPELL_CURSE_OF_EXHAUSTION = 65815, - SPELL_FEAR = 65809, //8s - SPELL_SEARING_PAIN = 65819, - SPELL_SHADOW_BOLT = 65821, - SPELL_UNSTABLE_AFFLICTION = 65812, - SPELL_SUMMON_FELHUNTER = 67514, - H_SPELL_UNSTABLE_AFFLICTION = 68155, //15s + SPELL_HELLFIRE = 65816, + SPELL_CORRUPTION = 65810, + SPELL_CURSE_OF_AGONY = 65814, + SPELL_CURSE_OF_EXHAUSTION = 65815, + SPELL_FEAR = 65809, // 8s + SPELL_SEARING_PAIN = 65819, + SPELL_SHADOW_BOLT = 65821, + SPELL_UNSTABLE_AFFLICTION = 65812, // 15s + SPELL_UNSTABLE_AFFLICTION_DISPEL = 65813, + SPELL_SUMMON_FELHUNTER = 67514, }; class mob_toc_warlock : public CreatureScript @@ -2030,6 +2033,40 @@ public: }; }; +class spell_faction_champion_warl_unstable_affliction : public SpellScriptLoader +{ + public: + spell_faction_champion_warl_unstable_affliction() : SpellScriptLoader("spell_faction_champion_warl_unstable_affliction") { } + + class spell_faction_champion_warl_unstable_affliction_AuraScript : public AuraScript + { + PrepareAuraScript(spell_faction_champion_warl_unstable_affliction_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_UNSTABLE_AFFLICTION_DISPEL)) + return false; + return true; + } + + void HandleDispel(DispelInfo* dispelInfo) + { + if (Unit* caster = GetCaster()) + caster->CastSpell(dispelInfo->GetDispeller(), SPELL_UNSTABLE_AFFLICTION_DISPEL, true, NULL, GetEffect(EFFECT_0)); + } + + void Register() + { + AfterDispel += AuraDispelFn(spell_faction_champion_warl_unstable_affliction_AuraScript::HandleDispel); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_faction_champion_warl_unstable_affliction_AuraScript(); + } +}; + void AddSC_boss_faction_champions() { new boss_toc_champion_controller(); @@ -2049,4 +2086,5 @@ void AddSC_boss_faction_champions() new mob_toc_retro_paladin(); new mob_toc_pet_warlock(); new mob_toc_pet_hunter(); + new spell_faction_champion_warl_unstable_affliction(); } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp index 17ed6a79c76..f81ddbf6bf8 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp @@ -15,7 +15,10 @@ * with this program. If not, see . */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" #include "naxxramas.h" enum Horsemen @@ -26,6 +29,11 @@ enum Horsemen HORSEMEN_SIR, }; +enum Spells +{ + SPELL_MARK_DAMAGE = 28836 +}; + enum Events { EVENT_NONE, @@ -395,7 +403,63 @@ public: }; +class spell_four_horsemen_mark : public SpellScriptLoader +{ + public: + spell_four_horsemen_mark() : SpellScriptLoader("spell_four_horsemen_mark") { } + + class spell_four_horsemen_mark_AuraScript : public AuraScript + { + PrepareAuraScript(spell_four_horsemen_mark_AuraScript); + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + { + int32 damage; + switch (GetStackAmount()) + { + case 1: + damage = 0; + break; + case 2: + damage = 500; + break; + case 3: + damage = 1000; + break; + case 4: + damage = 1500; + break; + case 5: + damage = 4000; + break; + case 6: + damage = 12000; + break; + default: + damage = 20000 + 1000 * (GetStackAmount() - 7); + break; + } + if (damage) + caster->CastCustomSpell(SPELL_MARK_DAMAGE, SPELLVALUE_BASE_POINT0, damage, GetTarget()); + } + } + + void Register() + { + AfterEffectApply += AuraEffectApplyFn(spell_four_horsemen_mark_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_four_horsemen_mark_AuraScript(); + } +}; + void AddSC_boss_four_horsemen() { new boss_four_horsemen(); + new spell_four_horsemen_mark(); } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index 8d23de5427c..227dfaada9c 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -15,7 +15,9 @@ * with this program. If not, see . */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellScript.h" #include "naxxramas.h" enum Yells @@ -25,6 +27,7 @@ enum Yells SAY_DEATH = -1533042, SAY_TELEPORT = -1533043 }; + //Gothik enum Spells { @@ -36,8 +39,11 @@ enum Spells SPELL_INFORM_LIVE_RIDER = 27935, SPELL_INFORM_DEAD_TRAINEE = 27915, SPELL_INFORM_DEAD_KNIGHT = 27931, - SPELL_INFORM_DEAD_RIDER = 27937 + SPELL_INFORM_DEAD_RIDER = 27937, + + SPELL_SHADOW_MARK = 27825 }; + enum Creatures { MOB_LIVE_TRAINEE = 16124, @@ -585,8 +591,35 @@ class mob_gothik_minion : public CreatureScript } }; +class spell_gothic_shadow_bolt_volley : public SpellScriptLoader +{ + public: + spell_gothic_shadow_bolt_volley() : SpellScriptLoader("spell_gothic_shadow_bolt_volley") { } + + class spell_gothic_shadow_bolt_volley_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gothic_shadow_bolt_volley_SpellScript); + + void FilterTargets(std::list& unitList) + { + unitList.remove_if(Trinity::UnitAuraCheck(false, SPELL_SHADOW_MARK)); + } + + void Register() + { + OnUnitTargetSelect += SpellUnitTargetFn(spell_gothic_shadow_bolt_volley_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gothic_shadow_bolt_volley_SpellScript(); + } +}; + void AddSC_boss_gothik() { new boss_gothik(); new mob_gothik_minion(); + new spell_gothic_shadow_bolt_volley(); } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index 4d6bfc578ff..f6c65f9c67d 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -86,6 +86,7 @@ enum Spells SPELL_SHADOW_FISURE = 27810, SPELL_VOID_BLAST = 27812, SPELL_MANA_DETONATION = 27819, + SPELL_MANA_DETONATION_DAMAGE = 27820, SPELL_FROST_BLAST = 27808, SPELL_CHAINS_OF_KELTHUZAD = 28410, //28408 script effect SPELL_KELTHUZAD_CHANNEL = 29423, @@ -773,6 +774,46 @@ class npc_kelthuzad_abomination : public CreatureScript } }; +class spell_kelthuzad_detonate_mana : public SpellScriptLoader +{ + public: + spell_kelthuzad_detonate_mana() : SpellScriptLoader("spell_kelthuzad_detonate_mana") { } + + class spell_kelthuzad_detonate_mana_AuraScript : public AuraScript + { + PrepareAuraScript(spell_kelthuzad_detonate_mana_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MANA_DETONATION_DAMAGE)) + return false; + return true; + } + + void HandleScript(AuraEffect const* aurEff) + { + PreventDefaultAction(); + + Unit* target = GetTarget(); + if (int32 mana = int32(target->GetMaxPower(POWER_MANA) / 10)) + { + mana = target->ModifyPower(POWER_MANA, -mana); + target->CastCustomSpell(SPELL_MANA_DETONATION_DAMAGE, SPELLVALUE_BASE_POINT0, -mana * 10, target, true, NULL, aurEff); + } + } + + void Register() + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_kelthuzad_detonate_mana_AuraScript::HandleScript, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_kelthuzad_detonate_mana_AuraScript(); + } +}; + class achievement_just_cant_get_enough : public AchievementCriteriaScript { public: @@ -796,5 +837,6 @@ void AddSC_boss_kelthuzad() new boss_kelthuzad(); new at_kelthuzad_center(); new npc_kelthuzad_abomination(); + new spell_kelthuzad_detonate_mana(); new achievement_just_cant_get_enough(); } diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp index 2e2744baa3c..0034747c6c2 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp @@ -19,11 +19,13 @@ /* ScriptData SDName: Boss Loken SD%Complete: 60% -SDComment: Missing intro. Remove hack of Pulsing Shockwave when core supports. Aura is not working (59414) +SDComment: Missing intro. Aura is not working (59414) SDCategory: Halls of Lightning EndScriptData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellScript.h" #include "halls_of_lightning.h" enum eEnums @@ -73,22 +75,16 @@ public: InstanceScript* instance; - bool m_bIsAura; - uint32 m_uiArcLightning_Timer; uint32 m_uiLightningNova_Timer; - uint32 m_uiPulsingShockwave_Timer; uint32 m_uiResumePulsingShockwave_Timer; uint32 m_uiHealthAmountModifier; void Reset() { - m_bIsAura = false; - m_uiArcLightning_Timer = 15000; m_uiLightningNova_Timer = 20000; - m_uiPulsingShockwave_Timer = 2000; m_uiResumePulsingShockwave_Timer = 15000; m_uiHealthAmountModifier = 1; @@ -130,44 +126,14 @@ public: if (!UpdateVictim()) return; - if (m_bIsAura) - { - // workaround for PULSING_SHOCKWAVE - if (m_uiPulsingShockwave_Timer <= uiDiff) - { - Map* map = me->GetMap(); - if (map->IsDungeon()) - { - Map::PlayerList const &PlayerList = map->GetPlayers(); - - if (PlayerList.isEmpty()) - return; - - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if (i->getSource() && i->getSource()->isAlive() && i->getSource()->isTargetableForAttack()) - { - int32 dmg; - float m_fDist = me->GetExactDist(i->getSource()->GetPositionX(), i->getSource()->GetPositionY(), i->getSource()->GetPositionZ()); - - dmg = DUNGEON_MODE(100, 150); // need to correct damage - if (m_fDist > 1.0f) // Further from 1 yard - dmg = int32(dmg*m_fDist); - - me->CastCustomSpell(i->getSource(), DUNGEON_MODE(52942, 59837), &dmg, 0, 0, false); - } - } - m_uiPulsingShockwave_Timer = 2000; - } else m_uiPulsingShockwave_Timer -= uiDiff; - } - else + if (m_uiResumePulsingShockwave_Timer) { if (m_uiResumePulsingShockwave_Timer <= uiDiff) { //breaks at movement, can we assume when it's time, this spell is casted and also must stop movement? DoCast(me, SPELL_PULSING_SHOCKWAVE_AURA, true); - DoCast(me, SPELL_PULSING_SHOCKWAVE_N); // need core support - m_bIsAura = true; + DoCast(me, SPELL_PULSING_SHOCKWAVE_N, true); m_uiResumePulsingShockwave_Timer = 0; } else @@ -190,7 +156,7 @@ public: Talk(EMOTE_NOVA); DoCast(me, SPELL_LIGHTNING_NOVA_N); - m_bIsAura = false; + me->RemoveAurasDueToSpell(DUNGEON_MODE(SPELL_PULSING_SHOCKWAVE_N, SPELL_PULSING_SHOCKWAVE_H)); m_uiResumePulsingShockwave_Timer = DUNGEON_MODE(5000, 4000); // Pause Pulsing Shockwave aura m_uiLightningNova_Timer = urand(20000, 21000); } @@ -216,7 +182,39 @@ public: }; +class spell_loken_pulsing_shockwave : public SpellScriptLoader +{ + public: + spell_loken_pulsing_shockwave() : SpellScriptLoader("spell_loken_pulsing_shockwave") { } + + class spell_loken_pulsing_shockwave_SpellScript : public SpellScript + { + PrepareSpellScript(spell_loken_pulsing_shockwave_SpellScript); + + void CalculateDamage() + { + if (!GetHitUnit()) + return; + + float distance = GetCaster()->GetDistance2d(GetHitUnit()); + if (distance > 1.0f) + SetHitDamage(int32(GetHitDamage() * distance)); + } + + void Register() + { + OnHit += SpellHitFn(spell_loken_pulsing_shockwave_SpellScript::CalculateDamage); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_loken_pulsing_shockwave_SpellScript(); + } +}; + void AddSC_boss_loken() { new boss_loken(); + new spell_loken_pulsing_shockwave(); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp index 3556bf188de..8090b9e8a3e 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp @@ -51,6 +51,8 @@ enum VezaxSpells SPELL_SHADOW_CRASH_HIT = 62659, SPELL_SURGE_OF_DARKNESS = 62662, SPELL_SARONITE_VAPORS = 63323, + SPELL_SARONITE_VAPORS_ENERGIZE = 63337, + SPELL_SARONITE_VAPORS_DAMAGE = 63338, SPELL_SUMMON_SARONITE_VAPORS = 63081, SPELL_BERSERK = 26662, @@ -463,6 +465,45 @@ class spell_mark_of_the_faceless : public SpellScriptLoader } }; +class spell_general_vezax_saronite_vapors : public SpellScriptLoader +{ + public: + spell_general_vezax_saronite_vapors() : SpellScriptLoader("spell_general_vezax_saronite_vapors") { } + + class spell_general_vezax_saronite_vapors_AuraScript : public AuraScript + { + PrepareAuraScript(spell_general_vezax_saronite_vapors_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_SARONITE_VAPORS_ENERGIZE) || !sSpellMgr->GetSpellInfo(SPELL_SARONITE_VAPORS_DAMAGE)) + return false; + return true; + } + + void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + { + int32 mana = int32(aurEff->GetAmount() * pow(2.0f, GetStackAmount())); // mana restore - bp * 2^stackamount + int32 damage = mana * 2; + caster->CastCustomSpell(GetTarget(), SPELL_SARONITE_VAPORS_ENERGIZE, &mana, NULL, NULL, true); + caster->CastCustomSpell(GetTarget(), SPELL_SARONITE_VAPORS_DAMAGE, &damage, NULL, NULL, true); + } + } + + void Register() + { + AfterEffectApply += AuraEffectApplyFn(spell_general_vezax_saronite_vapors_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_general_vezax_saronite_vapors_AuraScript(); + } +}; + class achievement_shadowdodger : public AchievementCriteriaScript { public: @@ -509,6 +550,7 @@ void AddSC_boss_general_vezax() new boss_saronite_animus(); new npc_saronite_vapors(); new spell_mark_of_the_faceless(); + new spell_general_vezax_saronite_vapors(); new achievement_shadowdodger(); new achievement_smell_saronite(); } diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 13190ed013f..2f778336433 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -723,14 +723,25 @@ class spell_dk_death_coil : public SpellScriptLoader { PrepareSpellScript(spell_dk_death_coil_SpellScript); - bool Validate(SpellInfo const* /*SpellEntry*/) + bool Validate(SpellInfo const* /*spell*/) { if (!sSpellMgr->GetSpellInfo(SPELL_DEATH_COIL_DAMAGE) || !sSpellMgr->GetSpellInfo(SPELL_DEATH_COIL_HEAL)) return false; return true; } - void HandleDummy(SpellEffIndex /* effIndex */) + SpellCastResult CheckCast() + { + Unit* caster = GetCaster(); + if (Unit* target = GetExplTargetUnit()) + { + if (target->IsFriendlyTo(caster) && target->GetCreatureType() != CREATURE_TYPE_UNDEAD) + return SPELL_FAILED_BAD_TARGETS; + } + return SPELL_CAST_OK; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) { int32 damage = GetEffectValue(); Unit* caster = GetCaster(); @@ -752,6 +763,7 @@ class spell_dk_death_coil : public SpellScriptLoader void Register() { + OnCheckCast += SpellCheckCastFn(spell_dk_death_coil_SpellScript::CheckCast); OnEffectHitTarget += SpellEffectFn(spell_dk_death_coil_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 898350dbd71..7fe7c769a33 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -28,7 +28,9 @@ enum DruidSpells { DRUID_INCREASED_MOONFIRE_DURATION = 38414, - DRUID_NATURES_SPLENDOR = 57865 + DRUID_NATURES_SPLENDOR = 57865, + DRUID_LIFEBLOOM_FINAL_HEAL = 33778, + DRUID_LIFEBLOOM_ENERGIZE = 64372 }; // 54846 Glyph of Starfire @@ -154,7 +156,7 @@ class spell_dru_primal_tenacity : public SpellScriptLoader void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount) { // reduces all damage taken while Stunned in Cat Form - if (GetTarget()->GetShapeshiftForm() == FORM_CAT && GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<GetShapeshiftForm() == FORM_CAT && GetTarget()->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<HasStealthAura() || target->HasInvisibilityAura()) + return true; + + if (!target->IsWithinLOSInMap(_caster)) + return true; + + return false; + } + + private: + Unit* _caster; +}; + class spell_dru_starfall_dummy : public SpellScriptLoader { public: @@ -337,7 +359,14 @@ class spell_dru_starfall_dummy : public SpellScriptLoader { PrepareSpellScript(spell_dru_starfall_dummy_SpellScript); - void HandleDummy(SpellEffIndex /* effIndex */) + void FilterTargets(std::list& unitList) + { + // Remove targets not in LoS or in stealth + unitList.remove_if(StarfallDummyTargetFilter(GetCaster())); + Trinity::Containers::RandomResizeList(unitList, 2); + } + + void HandleDummy(SpellEffIndex /*effIndex*/) { Unit* caster = GetCaster(); // Shapeshifting into an animal form or mounting cancels the effect @@ -348,15 +377,16 @@ class spell_dru_starfall_dummy : public SpellScriptLoader return; } - //Any effect which causes you to lose control of your character will supress the starfall effect. + // Any effect which causes you to lose control of your character will supress the starfall effect. if (caster->HasUnitState(UNIT_STATE_CONTROLLED)) return; - caster->CastSpell(GetHitUnit(), GetEffectValue(), true); + caster->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true); } void Register() { + OnUnitTargetSelect += SpellUnitTargetFn(spell_dru_starfall_dummy_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_dru_starfall_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; @@ -367,6 +397,90 @@ class spell_dru_starfall_dummy : public SpellScriptLoader } }; +class spell_dru_lifebloom : public SpellScriptLoader +{ + public: + spell_dru_lifebloom() : SpellScriptLoader("spell_dru_lifebloom") { } + + class spell_dru_lifebloom_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dru_lifebloom_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(DRUID_LIFEBLOOM_FINAL_HEAL)) + return false; + if (!sSpellMgr->GetSpellInfo(DRUID_LIFEBLOOM_ENERGIZE)) + return false; + return true; + } + + void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + // Final heal only on duration end + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) + return; + + // final heal + int32 stack = GetStackAmount(); + int32 healAmount = aurEff->GetAmount(); + Unit* caster = GetCaster(); + if (caster) + { + healAmount = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), healAmount, HEAL, stack); + healAmount = GetTarget()->SpellHealingBonusTaken(GetSpellInfo(), healAmount, HEAL, stack); + } + + GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); + + // restore mana + if (caster) + { + int32 returnMana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * stack / 2; + caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); + } + } + + void HandleDispel(DispelInfo* dispelInfo) + { + if (Unit* target = GetUnitOwner()) + { + if (AuraEffect const* aurEff = GetEffect(EFFECT_1)) + { + // final heal + int32 healAmount = aurEff->GetAmount(); + Unit* caster = GetCaster(); + if (caster) + { + healAmount = caster->SpellHealingBonusDone(target, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges()); + healAmount = target->SpellHealingBonusTaken(GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges()); + } + + target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID()); + + // restore mana + if (caster) + { + int32 returnMana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * dispelInfo->GetRemovedCharges() / 2; + caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID()); + } + } + } + } + + void Register() + { + AfterEffectRemove += AuraEffectRemoveFn(spell_dru_lifebloom_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + AfterDispel += AuraDispelFn(spell_dru_lifebloom_AuraScript::HandleDispel); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_dru_lifebloom_AuraScript(); + } +}; + void AddSC_druid_spell_scripts() { new spell_dru_glyph_of_starfire(); @@ -377,4 +491,5 @@ void AddSC_druid_spell_scripts() new spell_dru_starfall_aoe(); new spell_dru_swift_flight_passive(); new spell_dru_starfall_dummy(); + new spell_dru_lifebloom(); } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 501c7c47676..bd8f6e3b387 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2688,6 +2688,120 @@ public: } }; +enum GenericBandage +{ + SPELL_RECENTLY_BANDAGED = 11196, +}; + +class spell_gen_bandage : public SpellScriptLoader +{ + public: + spell_gen_bandage() : SpellScriptLoader("spell_gen_bandage") { } + + class spell_gen_bandage_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_bandage_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_RECENTLY_BANDAGED)) + return false; + return true; + } + + SpellCastResult CheckCast() + { + if (Unit* target = GetExplTargetUnit()) + { + if (target->HasAura(SPELL_RECENTLY_BANDAGED)) + return SPELL_FAILED_TARGET_AURASTATE; + } + return SPELL_CAST_OK; + } + + void HandleScript() + { + if (Unit* target = GetHitUnit()) + GetCaster()->CastSpell(target, SPELL_RECENTLY_BANDAGED, true); + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_gen_bandage_SpellScript::CheckCast); + AfterHit += SpellHitFn(spell_gen_bandage_SpellScript::HandleScript); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_bandage_SpellScript(); + } +}; + +enum GenericLifebloom +{ + SPELL_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL = 43422, + SPELL_TUR_RAGEPAW_LIFEBLOOM_FINAL_HEAL = 52552, + SPELL_CENARION_SCOUT_LIFEBLOOM_FINAL_HEAL = 53692, + SPELL_TWISTED_VISAGE_LIFEBLOOM_FINAL_HEAL = 57763, + SPELL_FACTION_CHAMPIONS_DRU_LIFEBLOOM_FINAL_HEAL = 66094, +}; + +class spell_gen_lifebloom : public SpellScriptLoader +{ + public: + spell_gen_lifebloom(const char* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { } + + class spell_gen_lifebloom_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_lifebloom_AuraScript); + + public: + spell_gen_lifebloom_AuraScript(uint32 spellId) : AuraScript(), _spellId(spellId) { } + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(_spellId)) + return false; + return true; + } + + void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + // Final heal only on duration end + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) + return; + + // final heal + GetTarget()->CastSpell(GetTarget(), _spellId, true, NULL, aurEff, GetCasterGUID()); + } + + void HandleDispel(DispelInfo* /*dispelInfo*/) + { + // final heal + if (Unit* target = GetUnitOwner()) + target->CastSpell(target, _spellId, true, NULL, GetEffect(EFFECT_0), GetCasterGUID()); + } + + void Register() + { + AfterEffectRemove += AuraEffectRemoveFn(spell_gen_lifebloom_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL); + AfterDispel += AuraDispelFn(spell_gen_lifebloom_AuraScript::HandleDispel); + } + + private: + uint32 _spellId; + }; + + AuraScript* GetAuraScript() const + { + return new spell_gen_lifebloom_AuraScript(_spellId); + } + + private: + uint32 _spellId; +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -2742,4 +2856,10 @@ void AddSC_generic_spell_scripts() new spell_gen_count_pct_from_max_hp("spell_gen_default_count_pct_from_max_hp"); new spell_gen_count_pct_from_max_hp("spell_gen_50pct_count_pct_from_max_hp", 50); new spell_gen_despawn_self(); + new spell_gen_bandage(); + new spell_gen_lifebloom("spell_hexlord_lifebloom", SPELL_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL); + new spell_gen_lifebloom("spell_tur_ragepaw_lifebloom", SPELL_TUR_RAGEPAW_LIFEBLOOM_FINAL_HEAL); + new spell_gen_lifebloom("spell_cenarion_scout_lifebloom", SPELL_CENARION_SCOUT_LIFEBLOOM_FINAL_HEAL); + new spell_gen_lifebloom("spell_twisted_visage_lifebloom", SPELL_TWISTED_VISAGE_LIFEBLOOM_FINAL_HEAL); + new spell_gen_lifebloom("spell_faction_champion_dru_lifebloom", SPELL_FACTION_CHAMPIONS_DRU_LIFEBLOOM_FINAL_HEAL); } diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 53a78e42c3c..e2272e0cdb4 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -618,6 +618,34 @@ class spell_hun_misdirection_proc : public SpellScriptLoader } }; +class spell_hun_disengage : public SpellScriptLoader +{ + public: + spell_hun_disengage() : SpellScriptLoader("spell_hun_disengage") { } + + class spell_hun_disengage_SpellScript : public SpellScript + { + PrepareSpellScript(spell_hun_disengage_SpellScript); + + SpellCastResult CheckCast() + { + if (GetCaster()->GetTypeId() == TYPEID_PLAYER && !GetCaster()->isInCombat()) + return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; + + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_hun_disengage_SpellScript::CheckCast); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_hun_disengage_SpellScript(); + } +}; void AddSC_hunter_spell_scripts() { @@ -633,4 +661,5 @@ void AddSC_hunter_spell_scripts() new spell_hun_pet_carrion_feeder(); new spell_hun_misdirection(); new spell_hun_misdirection_proc(); + new spell_hun_disengage(); } diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 050741ffaba..0edfbaee437 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -342,13 +342,52 @@ public: } }; +class spell_mage_living_bomb : public SpellScriptLoader +{ + public: + spell_mage_living_bomb() : SpellScriptLoader("spell_mage_living_bomb") { } + + class spell_mage_living_bomb_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mage_living_bomb_AuraScript); + + bool Validate(SpellInfo const* spell) + { + if (!sSpellMgr->GetSpellInfo(uint32(spell->Effects[EFFECT_1].CalcValue()))) + return false; + return true; + } + + void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode(); + if (removeMode != AURA_REMOVE_BY_ENEMY_SPELL && removeMode != AURA_REMOVE_BY_EXPIRE) + return; + + if (Unit* caster = GetCaster()) + caster->CastSpell(GetTarget(), uint32(aurEff->GetAmount()), true, NULL, aurEff); + } + + void Register() + { + AfterEffectRemove += AuraEffectRemoveFn(spell_mage_living_bomb_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_mage_living_bomb_AuraScript(); + } +}; + void AddSC_mage_spell_scripts() { - new spell_mage_blast_wave; - new spell_mage_cold_snap; + new spell_mage_blast_wave(); + new spell_mage_cold_snap(); new spell_mage_frost_warding_trigger(); new spell_mage_incanters_absorbtion_absorb(); new spell_mage_incanters_absorbtion_manashield(); - new spell_mage_polymorph_cast_visual; - new spell_mage_summon_water_elemental; + new spell_mage_polymorph_cast_visual(); + new spell_mage_summon_water_elemental(); + new spell_mage_living_bomb(); } diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index cf8cae68c58..95bb1429dc3 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -43,6 +43,10 @@ enum PaladinSpells SPELL_DIVINE_STORM = 53385, SPELL_DIVINE_STORM_DUMMY = 54171, SPELL_DIVINE_STORM_HEAL = 54172, + + SPELL_FORBEARANCE = 25771, + SPELL_AVENGING_WRATH_MARKER = 61987, + SPELL_IMMUNE_SHIELD_MARKER = 61988, }; // 31850 - Ardent Defender @@ -255,17 +259,18 @@ class spell_pal_holy_shock : public SpellScriptLoader class spell_pal_holy_shock_SpellScript : public SpellScript { - PrepareSpellScript(spell_pal_holy_shock_SpellScript) - bool Validate(SpellInfo const* spellEntry) + PrepareSpellScript(spell_pal_holy_shock_SpellScript); + + bool Validate(SpellInfo const* spell) { if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_HOLY_SHOCK_R1)) return false; // can't use other spell than holy shock due to spell_ranks dependency - if (sSpellMgr->GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id)) + if (sSpellMgr->GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spell->Id)) return false; - uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id); + uint8 rank = sSpellMgr->GetSpellRank(spell->Id); if (!sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank, true) || !sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank, true)) return false; @@ -287,10 +292,18 @@ class spell_pal_holy_shock : public SpellScriptLoader SpellCastResult CheckCast() { - Player* caster = GetCaster()->ToPlayer(); + Unit* caster = GetCaster(); if (Unit* target = GetExplTargetUnit()) - if (!caster->IsFriendlyTo(target) && !caster->IsValidAttackTarget(target)) - return SPELL_FAILED_BAD_TARGETS; + { + if (!caster->IsFriendlyTo(target)) + { + if (!caster->HasInArc(static_cast(M_PI), target)) + return SPELL_FAILED_UNIT_NOT_INFRONT; + + if (!caster->IsValidAttackTarget(target)) + return SPELL_FAILED_BAD_TARGETS; + } + } return SPELL_CAST_OK; } @@ -423,6 +436,70 @@ class spell_pal_divine_storm_dummy : public SpellScriptLoader } }; +class spell_pal_lay_on_hands : public SpellScriptLoader +{ + public: + spell_pal_lay_on_hands() : SpellScriptLoader("spell_pal_lay_on_hands") { } + + class spell_pal_lay_on_hands_SpellScript : public SpellScript + { + PrepareSpellScript(spell_pal_lay_on_hands_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_FORBEARANCE)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_AVENGING_WRATH_MARKER)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_IMMUNE_SHIELD_MARKER)) + return false; + return true; + } + + SpellCastResult CheckCast() + { + Unit* caster = GetCaster(); + if (Unit* target = GetExplTargetUnit()) + { + if (caster == target) + { + if (target->HasAura(SPELL_FORBEARANCE)) + return SPELL_FAILED_TARGET_AURASTATE; + + if (target->HasAura(SPELL_AVENGING_WRATH_MARKER)) + return SPELL_FAILED_TARGET_AURASTATE; + + if (target->HasAura(SPELL_IMMUNE_SHIELD_MARKER)) + return SPELL_FAILED_TARGET_AURASTATE; + } + } + return SPELL_CAST_OK; + } + + void HandleScript() + { + Unit* caster = GetCaster(); + if (caster == GetHitUnit()) + { + caster->CastSpell(caster, SPELL_FORBEARANCE, true); + caster->CastSpell(caster, SPELL_AVENGING_WRATH_MARKER, true); + caster->CastSpell(caster, SPELL_IMMUNE_SHIELD_MARKER, true); + } + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_pal_lay_on_hands_SpellScript::CheckCast); + AfterHit += SpellHitFn(spell_pal_lay_on_hands_SpellScript::HandleScript); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_pal_lay_on_hands_SpellScript(); + } +}; + void AddSC_paladin_spell_scripts() { new spell_pal_ardent_defender(); @@ -433,4 +510,5 @@ void AddSC_paladin_spell_scripts() new spell_pal_judgement_of_command(); new spell_pal_divine_storm(); new spell_pal_divine_storm_dummy(); + new spell_pal_lay_on_hands(); } diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 8088004c9d1..a20534effaf 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -34,6 +34,7 @@ enum PriestSpells PRIEST_SPELL_PENANCE_R1_HEAL = 47757, PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED = 33619, PRIEST_SPELL_REFLECTIVE_SHIELD_R1 = 33201, + PRIEST_SPELL_VAMPIRIC_TOUCH_DISPEL = 64085, }; // Guardian Spirit @@ -330,6 +331,50 @@ public: } }; +class spell_pri_vampiric_touch : public SpellScriptLoader +{ + public: + spell_pri_vampiric_touch() : SpellScriptLoader("spell_pri_vampiric_touch") { } + + class spell_pri_vampiric_touch_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pri_vampiric_touch_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(PRIEST_SPELL_VAMPIRIC_TOUCH_DISPEL)) + return false; + return true; + } + + void HandleDispel(DispelInfo* /*dispelInfo*/) + { + if (Unit* caster = GetCaster()) + { + if (Unit* target = GetUnitOwner()) + { + if (AuraEffect const* aurEff = GetEffect(EFFECT_1)) + { + int32 damage = aurEff->GetAmount() * 8; + // backfire damage + caster->CastCustomSpell(target, PRIEST_SPELL_VAMPIRIC_TOUCH_DISPEL, &damage, NULL, NULL, true, NULL, aurEff); + } + } + } + } + + void Register() + { + AfterDispel += AuraDispelFn(spell_pri_vampiric_touch_AuraScript::HandleDispel); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_pri_vampiric_touch_AuraScript(); + } +}; + void AddSC_priest_spell_scripts() { new spell_pri_guardian_spirit(); @@ -339,4 +384,5 @@ void AddSC_priest_spell_scripts() new spell_pri_reflective_shield_trigger(); new spell_pri_mind_sear(); new spell_pri_prayer_of_mending_heal(); + new spell_pri_vampiric_touch(); } diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 7e2756f28a5..4cb3818cdb8 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -42,6 +42,10 @@ enum ShamanSpells // For Earthen Power SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM = 6474, SHAMAN_TOTEM_SPELL_EARTHEN_POWER = 59566, + + ICON_ID_SHAMAN_LAVA_FLOW = 3087, + SHAMAN_LAVA_FLOWS_R1 = 51480, + SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 64694, }; // 51474 - Astral shift @@ -652,6 +656,52 @@ class spell_sha_chain_heal : public SpellScriptLoader } }; +class spell_sha_flame_shock : public SpellScriptLoader +{ + public: + spell_sha_flame_shock() : SpellScriptLoader("spell_sha_flame_shock") { } + + class spell_sha_flame_shock_AuraScript : public AuraScript + { + PrepareAuraScript(spell_sha_flame_shock_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SHAMAN_LAVA_FLOWS_R1)) + return false; + if (!sSpellMgr->GetSpellInfo(SHAMAN_LAVA_FLOWS_TRIGGERED_R1)) + return false; + return true; + } + + void HandleDispel(DispelInfo* /*dispelInfo*/) + { + if (Unit* caster = GetCaster()) + { + // Lava Flows + if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, ICON_ID_SHAMAN_LAVA_FLOW, 0)) + { + if (sSpellMgr->GetFirstSpellInChain(SHAMAN_LAVA_FLOWS_R1) != sSpellMgr->GetFirstSpellInChain(aurEff->GetId())) + return; + + uint8 rank = sSpellMgr->GetSpellRank(aurEff->GetId()); + caster->CastSpell(caster, sSpellMgr->GetSpellWithRank(SHAMAN_LAVA_FLOWS_TRIGGERED_R1, rank), true); + } + } + } + + void Register() + { + AfterDispel += AuraDispelFn(spell_sha_flame_shock_AuraScript::HandleDispel); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_sha_flame_shock_AuraScript(); + } +}; + void AddSC_shaman_spell_scripts() { new spell_sha_astral_shift(); @@ -667,4 +717,5 @@ void AddSC_shaman_spell_scripts() new spell_sha_mana_spring_totem(); new spell_sha_lava_lash(); new spell_sha_chain_heal(); + new spell_sha_flame_shock(); } diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 838b9e4f932..1b24a9ec09f 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -37,6 +37,8 @@ enum WarlockSpells WARLOCK_DEMONIC_CIRCLE_SUMMON = 48018, WARLOCK_DEMONIC_CIRCLE_TELEPORT = 48020, WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388, + WARLOCK_HAUNT_HEAL = 48210, + WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117, }; class spell_warl_banish : public SpellScriptLoader @@ -523,6 +525,106 @@ class spell_warl_demonic_circle_teleport : public SpellScriptLoader } }; +class spell_warl_haunt : public SpellScriptLoader +{ + public: + spell_warl_haunt() : SpellScriptLoader("spell_warl_haunt") { } + + class spell_warl_haunt_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warl_haunt_SpellScript); + + void HandleOnHit() + { + if (Aura* aura = GetHitAura()) + if (AuraEffect* aurEff = aura->GetEffect(EFFECT_1)) + aurEff->SetAmount(CalculatePctN(aurEff->GetAmount(), GetHitDamage())); + } + + void Register() + { + OnHit += SpellHitFn(spell_warl_haunt_SpellScript::HandleOnHit); + } + }; + + class spell_warl_haunt_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_haunt_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(WARLOCK_HAUNT_HEAL)) + return false; + return true; + } + + void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + { + int32 amount = aurEff->GetAmount(); + GetTarget()->CastCustomSpell(caster, WARLOCK_HAUNT_HEAL, &amount, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); + } + } + + void Register() + { + OnEffectRemove += AuraEffectApplyFn(spell_warl_haunt_AuraScript::HandleRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warl_haunt_SpellScript(); + } + + AuraScript* GetAuraScript() const + { + return new spell_warl_haunt_AuraScript(); + } +}; + +class spell_warl_unstable_affliction : public SpellScriptLoader +{ + public: + spell_warl_unstable_affliction() : SpellScriptLoader("spell_warl_unstable_affliction") { } + + class spell_warl_unstable_affliction_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_unstable_affliction_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(WARLOCK_UNSTABLE_AFFLICTION_DISPEL)) + return false; + return true; + } + + void HandleDispel(DispelInfo* dispelInfo) + { + if (Unit* caster = GetCaster()) + { + if (AuraEffect const* aurEff = GetEffect(EFFECT_0)) + { + int32 damage = aurEff->GetAmount() * 9; + // backfire damage and silence + caster->CastCustomSpell(dispelInfo->GetDispeller(), WARLOCK_UNSTABLE_AFFLICTION_DISPEL, &damage, NULL, NULL, true, NULL, aurEff); + } + } + } + + void Register() + { + AfterDispel += AuraDispelFn(spell_warl_unstable_affliction_AuraScript::HandleDispel); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_warl_unstable_affliction_AuraScript(); + } +}; + void AddSC_warlock_spell_scripts() { new spell_warl_banish(); @@ -535,4 +637,6 @@ void AddSC_warlock_spell_scripts() new spell_warl_life_tap(); new spell_warl_demonic_circle_summon(); new spell_warl_demonic_circle_teleport(); + new spell_warl_haunt(); + new spell_warl_unstable_affliction(); } From 1bfd6605af4cf32cb7bbc136665c2bee54fb8d6f Mon Sep 17 00:00:00 2001 From: joschiwald Date: Mon, 28 May 2012 04:29:59 +0200 Subject: [PATCH 0855/1149] fix compile --- src/server/scripts/Spells/spell_druid.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 7fe7c769a33..1d152e6f208 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -428,7 +428,7 @@ class spell_dru_lifebloom : public SpellScriptLoader if (caster) { healAmount = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), healAmount, HEAL, stack); - healAmount = GetTarget()->SpellHealingBonusTaken(GetSpellInfo(), healAmount, HEAL, stack); + healAmount = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, stack); } GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); @@ -453,7 +453,7 @@ class spell_dru_lifebloom : public SpellScriptLoader if (caster) { healAmount = caster->SpellHealingBonusDone(target, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges()); - healAmount = target->SpellHealingBonusTaken(GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges()); + healAmount = target->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges()); } target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID()); From 423d7814f001f8f222b8e3e701c2afce4855ad73 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Mon, 28 May 2012 10:30:34 +0200 Subject: [PATCH 0856/1149] DB/Creature: Spawn Deadmire & Add pathing Closes #1705 Commit: fix filenaming --- ...012_05_28_00_world_creature_ai_scripts.sql} | 0 .../world/2012_05_28_01_world_creature.sql | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+) rename sql/updates/world/{2012_05_28_world_creature_ai_scripts.sql => 2012_05_28_00_world_creature_ai_scripts.sql} (100%) create mode 100644 sql/updates/world/2012_05_28_01_world_creature.sql diff --git a/sql/updates/world/2012_05_28_world_creature_ai_scripts.sql b/sql/updates/world/2012_05_28_00_world_creature_ai_scripts.sql similarity index 100% rename from sql/updates/world/2012_05_28_world_creature_ai_scripts.sql rename to sql/updates/world/2012_05_28_00_world_creature_ai_scripts.sql diff --git a/sql/updates/world/2012_05_28_01_world_creature.sql b/sql/updates/world/2012_05_28_01_world_creature.sql new file mode 100644 index 00000000000..d39aa7230b5 --- /dev/null +++ b/sql/updates/world/2012_05_28_01_world_creature.sql @@ -0,0 +1,18 @@ +-- Spawn Deadmire +SET @GUID := 33909; +SET @NPC := @GUID*10; +DELETE FROM `creature` WHERE `id`=4841; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(@GUID,4841,1,1,1,0,0,-3949.688,-3471.041,29.15445,4.288023,360,0,0,1902,0,0,0,0,0); -- respawn Deadmire on old guid +-- Set movement info +UPDATE `creature_addon` SET `path_id`=@NPC WHERE `guid`=@GUID; +UPDATE `creature_template` SET `MovementType`=2 WHERE `entry`=4841; +-- Add Waypoint Data +DELETE FROM `waypoint_data` WHERE `id`=@NPC; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@NPC,1,-3942.966,-3455.51,28.89743,0,0,0,0,0,0), +(@NPC,2,-3943.117,-3456.498,28.89743,0,0,0,0,0,0), +(@NPC,3,-3948.063,-3467.443,29.64743,0,0,0,0,0,0), +(@NPC,4,-3950.123,-3472.004,29.02243,0,0,0,0,0,0), +(@NPC,5,-3953.303,-3479.054,28.64743,0,0,0,0,0,0), +(@NPC,6,-3953.303,-3479.054,28.64743,0,0,0,0,0,0); From 380c046892ecdc189bf7ced007b1b06a3cbe9b87 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Mon, 28 May 2012 10:46:12 +0200 Subject: [PATCH 0857/1149] DB/Creature: add waypoints for Vyragosa --- .../world/2012_05_28_02_world_creature.sql | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 sql/updates/world/2012_05_28_02_world_creature.sql diff --git a/sql/updates/world/2012_05_28_02_world_creature.sql b/sql/updates/world/2012_05_28_02_world_creature.sql new file mode 100644 index 00000000000..77da626d89e --- /dev/null +++ b/sql/updates/world/2012_05_28_02_world_creature.sql @@ -0,0 +1,26 @@ +-- Spawn Deadmire +SET @GUID := 202606; +SET @NPC := @GUID*10; +-- Set movement info +UPDATE `creature_addon` SET `path_id`=@NPC WHERE `guid`=@GUID; +UPDATE `creature_template` SET `MovementType`=2 WHERE `entry`=32630; +-- Add Waypoint Data +DELETE FROM `waypoint_data` WHERE `id`=@NPC; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@NPC,1,7024.75,-1625.538,957.3694,0,0,0,0,0,0), +(@NPC,2,7025.494,-1624.87,957.3694,0,0,0,0,0,0), +(@NPC,3,7167.578,-1501.694,962.5693,0,0,0,0,0,0), +(@NPC,4,7440.402,-1295.861,997.2911,0,0,0,0,0,0), +(@NPC,5,7210.958,-1046.892,1006.18,0,0,0,0,0,0), +(@NPC,6,6998.465,-1076.847,1024.819,0,0,0,0,0,0), +(@NPC,7,6874.249,-1097.382,927.736,0,0,0,0,0,0), +(@NPC,8,6614.792,-875.7547,812.7645,0,0,0,0,0,0), +(@NPC,9,6563.275,-811.7673,749.8757,0,0,0,0,0,0), +(@NPC,10,6299.502,-797.577,529.1257,0,0,0,0,0,0), +(@NPC,11,6194.549,-1013.144,501.5424,0,0,0,0,0,0), +(@NPC,12,6319.254,-1251.661,468.6258,0,0,0,0,0,0), +(@NPC,13,6309.161,-1537.857,615.0423,0,0,0,0,0,0), +(@NPC,14,6748.211,-1664.307,919.3118,0,0,0,0,0,0), +(@NPC,15,6913.308,-1725.261,954.7917,0,0,0,0,0,0), +(@NPC,16,7167.578,-1501.694,962.5693,0,0,0,0,0,0), +(@NPC,17,7440.402,-1295.861,997.2911,0,0,0,0,0,0); From ed9ad370722217b12f3a77576cd8a7885481c76c Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Mon, 28 May 2012 11:00:00 +0200 Subject: [PATCH 0858/1149] DB/Waypoint: correct id to guid*10 --- sql/updates/world/2012_05_28_03_waypoint_data.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2012_05_28_03_waypoint_data.sql diff --git a/sql/updates/world/2012_05_28_03_waypoint_data.sql b/sql/updates/world/2012_05_28_03_waypoint_data.sql new file mode 100644 index 00000000000..aa0e0ddd5ef --- /dev/null +++ b/sql/updates/world/2012_05_28_03_waypoint_data.sql @@ -0,0 +1,3 @@ +-- correct waypointid to guid*10 +UPDATE `waypoint_data` SET `id`=2026020 WHERE `id`=2026060; +UPDATE `creature_addon` SET `path_id`=2026020 WHERE `guid`=202602; From 2a7e701f69b093bdaa22e66052de781b215a7c1d Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Mon, 28 May 2012 13:13:45 +0200 Subject: [PATCH 0859/1149] DB/Creature: set MovementType in Creature, not _template --- sql/updates/world/2012_05_28_04_world_creature_template.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2012_05_28_04_world_creature_template.sql diff --git a/sql/updates/world/2012_05_28_04_world_creature_template.sql b/sql/updates/world/2012_05_28_04_world_creature_template.sql new file mode 100644 index 00000000000..d8c9a15e412 --- /dev/null +++ b/sql/updates/world/2012_05_28_04_world_creature_template.sql @@ -0,0 +1,3 @@ +-- malcroms request +UPDATE `creature_template` SET `MovementType`=0 WHERE `entry`=32630; +UPDATE `creature` SET `MovementType`=2 WHERE `id`=32630; From 5957a2b10d571ac924db0488de96b5f6f877fd06 Mon Sep 17 00:00:00 2001 From: qaywsx Date: Mon, 28 May 2012 13:16:25 +0200 Subject: [PATCH 0860/1149] DB/Creature: Add phasing for Crusader's Pinnacle all credits for qaywsx who worked on this --- .../world/2012_05_28_05_world_creature.sql | 216 ++++++++++++++++++ 1 file changed, 216 insertions(+) create mode 100644 sql/updates/world/2012_05_28_05_world_creature.sql diff --git a/sql/updates/world/2012_05_28_05_world_creature.sql b/sql/updates/world/2012_05_28_05_world_creature.sql new file mode 100644 index 00000000000..c7d4af5b494 --- /dev/null +++ b/sql/updates/world/2012_05_28_05_world_creature.sql @@ -0,0 +1,216 @@ +-- Guid for inserts +SET @NEXT := 134704; -- need 129 +-- Correct Phasing/Quest relation for the Argent Vanguard,Crusader's Pinnacle,Scourgeholme,The Breach,Valley of Echoes and Pit of Fiends (I didn't use Phase IV spell id: 57675 since it sets phase to one,I don't see the point since that's the default phase) +-- The spells are Argent Vanguard Chapter I (id: 57673),Argent Vanguard Chapter II (id: 57569) and Argent Vanguard Chapter III (id: 57674) +DELETE FROM `spell_area` WHERE `spell` IN (57673,57569,57674); +INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`) VALUES +(57673,4501,0,0,13070,0,0,2,1), +(57673,4504,0,0,13070,0,0,2,1), +(57673,4505,0,0,13086,0,0,2,1), +(57673,4506,0,0,13086,0,0,2,1), +(57673,4580,0,0,13086,0,0,2,1), +(57673,4593,0,0,13086,0,0,2,1), +(57569,4501,13070,0,13086,0,0,2,1), +(57569,4504,13070,0,13086,0,0,2,1), +(57674,4501,13086,0,13141,0,0,2,1), +(57674,4504,13086,0,13141,0,0,2,1), +(57674,4505,13086,0,13141,0,0,2,1), +(57674,4506,13086,0,13141,0,0,2,1), +(57674,4593,13086,0,13141,0,0,2,1), +(57674,4580,13086,0,13141,0,0,2,1); +-- Phase for objects in Crusader's Pinnacle (Scourge controlled) +UPDATE `gameobject` SET `phaseMask`=194 WHERE `id` IN (192936,192938,192953,192954,192955,192956,192957,192982,192995,193003,192958,192959,192960,192961,192962,192963,192964,192965,192966,192967,192968,192969,192970,192971,192972,192973,192974,192975,192976,192977,192978,192979,192980,192981,192983,192985,192986,192987,192988,192989,192990,192991,192994,192934,192935,192992,192993,193002,192997,192996,192999,193000,193001,192936,192937); +-- Phase for a few objects in Scourgeholme +UPDATE `gameobject` SET `phaseMask`=195 WHERE `id` IN (192576,192577,192575,192579,192578); +-- Misc Objects in Argent Vanguard to be visible in all phases +UPDATE `gameobject` SET `phaseMask`=195 WHERE `guid` IN (62021,62027,62356,62359,62353,62071,62061); +-- Duplicates of the objects in Argent Vanguard,no need to have 2 of each if they have no special interaction with a particular phase +DELETE FROM `gameobject` WHERE `guid` IN (100101,100484,100097,100433,100098,100432,100104,100485); +-- Phase for the walls and towers for all phases except during "The last line of defense" +UPDATE `gameobject` SET `phaseMask`=131 WHERE `guid` IN (61089,61066,61027,61056,61004,60999,60996,60976); +-- Phase for walls during "The last line of defense",they need a separate object here because they interact directly with the phase +UPDATE `gameobject` SET `phaseMask`=64 WHERE `guid` IN (100441,100440,100438,100439,100437,100436,100435,100434); +-- Phase for objects in The Breach after "The last line of defense" +UPDATE `gameobject` SET `phaseMask`=129 WHERE `id` IN (192797,192798,192799,192800,192801,192802,192803,192804,192805); +-- Phase for objects in The Breach before "The last line of defense" +UPDATE `gameobject` SET `phaseMask`=66 WHERE `id` IN (192161,192162,192166,192806,192807,192808,192809,192810,192811,192812,192813,192814,192815,192816,192817); +-- Phase for NPCs in Argent Vanguard that should be in all phases (except during "The last line of defense) +UPDATE `creature` SET `phaseMask`=131 WHERE `guid` IN (121664,124618,124483,121684,121671,121696,121668,121693,121669,121677,121697,121666,121662,121678,121670,121680,121685,121683,121665,121682,121686,121663,121695,124527,124491,124661,123618,124497,124323,124340,124332,207301,207298,207296,207297,207299,207300,124442); +-- Same as with the objects,delete duplicate creatures that have no direct interaction with a particular phase,a single creature can fulfill that role. +DELETE FROM `creature` WHERE `guid` IN (207239,207264,207260,207251,207245,207256,207242,207254,207243,207246,207257,207241,207237,207247,207244,207248,207252,207250,207240,207249,207253,207238,207255,207263,207261,207265,207258,207262,207259); +-- Phase for NPCs only present until "The last line of defense" +UPDATE `creature` SET `phaseMask`=2 WHERE `guid` IN (207229,207228,207234,207233,207232,207235,207236,207227,207222,207230,207231,207223,202409,207225,207226); +-- Phase for Siegemaster Fezzik (He is the only one present up until and during "the last line of defense") +UPDATE `creature` SET `phaseMask`=66 WHERE `guid`=207224; +-- Phase for NPCs in the Valley of Echoes before "The last line of defense" +UPDATE `creature` SET `phaseMask`=2 WHERE `guid` IN (207290,207289,207288,207294,207293,207295,207284,207282,207286,207285,207287,207291,207283,207281,207292,207280); +-- Phase for Creatures on the Valley of Echoes before "The last line of defense" +UPDATE `creature` SET `phaseMask`=2 WHERE `id` IN (30206,30273); +-- Phase for mobs and NPCs in the Valley of Echoes and The breach after "The last line of defense" +UPDATE `creature` SET `phaseMask`=129 WHERE `guid` IN (124320,124302,124297,124317,124338,124333,124329,124341,124301,124307,124319,124339,124337,124324,124298,124308,124303,124302,124320,124330,124326,124309,124335,124318,124299,124311,124310,124325,124327,124300,124315,124314,124313,124312,124321,124336,124334,124331,124328,121679,121667,121681,121694,121700,121692,203393,121698,121672); +-- Set correct faction for Crusade Architect Silas +UPDATE `creature_template` SET `faction_H`=2070,`faction_A`=2070 WHERE `entry`=30686; +-- Mount for Highlord Tirion Fordring in Argent Vanguard after "the last line of defense" +DELETE FROM `creature_template_addon` WHERE `entry`=30677; +INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(30677,0,2325,0,0,0,NULL); +-- Phase for Father Gustav in Valley of Echoes after "the last line of defense" +UPDATE `creature` SET `phaseMask`=128 WHERE `id`=30683; +-- Lich King flag,non attackable unless he engages first +UPDATE `creature_template` SET `unit_flags`=256 WHERE `entry`=30443; +-- Set right exp value and level for Underking Talonox +UPDATE `creature_template` SET `exp`=2,`minlevel`=79,`maxlevel`=79 WHERE `entry`=30830; +-- Set the right phase for the already existing creatures (Including Captured crusaders) +UPDATE `creature` SET `phaseMask`=1 WHERE `id` IN (31037,31039,31043,31040); +UPDATE `creature` SET `phaseMask`=2 WHERE `id` IN (30544,30407); +-- Set flag extra to 64 for creatures in Scourgeholme during the first phase,they should not give XP. +UPDATE `creature_template` SET `flags_extra`=64 WHERE `entry` IN (30544,30407); +-- Set right inhabit type for the second phase version of Wrathstrike Gargoyle (They should be able to fly) +UPDATE `creature_template` SET `InhabitType`=7 WHERE `entry`=30482; +-- Set right faction for previously not spawned creatures +UPDATE `creature_template` SET `faction_H`=2068,`faction_A`=2068 WHERE `entry` IN (30541,30203,30543,30202,30482,30830,30831,30829,30443); +-- ---------------- +-- -- Spawnfixes -- +-- ---------------- +-- Add the right mobs for each phase,they have a different id for each phase. Some mobs are only on 2 phases,not all 3 (Reanimated crusader and Gargoyles). They have the exact same points as their already spawned counterparts which belong to the final phase. +-- NOTE: The ones with a currentwaypoint set have it simply because that's the waypoint the of their already spawned counterpart. I use it simply as a guideline for me to create the paths for all these new ones and its changed back to 0 after I set the new paths with creature_addon later in this SQL. +DELETE FROM `creature` WHERE `id` IN (30596,30686,30714,30677,30443,30829,30830,30831,30203,30543,30202,30541,30482,30333,30205); +DELETE FROM `creature` WHERE `guid` BETWEEN @NEXT+83 and @NEXT+89 AND `id`=30544; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`MovementType`) VALUES +-- Add missing creatures (Highlord Tirion Fordring in Argent Vanguard after "the last line of defense",The Ebon Watcher,Crusade Architect Silas and Crusade Engineer Spitzpatrick in Valley of Echoes after "the last line of defense") +(@NEXT,30596,571,1,128,6376.657227,239.053055,396.047028,4.8044,300,0,0,0), +(@NEXT+1,30686,571,1,128,6370.632324,232.238022,396.046051,1.352186,300,0,0,0), +(@NEXT+2,30714,571,1,128,6371.689941,239.699265,396.899902,4.792617,300,0,0,0), +(@NEXT+3,30677,571,1,128,6259.583496,50.420799,388.508667,0.846391,300,0,0,0), +-- Add missing unique creatures in Scorugeholme (The Lich king,Salranax the Flesh Render,High Priest Yath'amon and Underking Talonox -- One for each phase they are in,since they are hostile mobs) +(@NEXT+4,30443,571,1,2,6697.528809,583.609131,428.332916,4.108414,300,0,0,0), +(@NEXT+5,30829,571,1,2,6838.717285,594.347046,426.230652,4.020655,300,0,0,0), +(@NEXT+6,30831,571,1,2,6869.587891,422.763397,470.783386,1.087875,300,0,0,0), +(@NEXT+7,30830,571,1,2,7211.243652,667.650146,488.187103,2.689305,300,0,0,0), +(@NEXT+8,30829,571,1,128,6838.717285,594.347046,426.230652,4.020655,300,0,0,0), +(@NEXT+9,30831,571,1,128,6869.587891,422.763397,470.783386,1.087875,300,0,0,0), +(@NEXT+10,30830,571,1,128,7211.243652,667.650146,488.187103,2.689305,300,0,0,0), +-- Forgotten Depths High Priest +(@NEXT+11,30203,571,1,2,6879.92,493.899,467.957,1.67552,300,0,0,0), +(@NEXT+12,30203,571,1,2,6916.07,467.629,468.799,0.977384,300,0,0,0), +(@NEXT+13,30203,571,1,2,6858.02,453.902,471.767,4.7822,300,0,0,0), +(@NEXT+14,30203,571,1,2,6835.59,414.643,471.77,0.802851,300,0,0,0), +(@NEXT+15,30203,571,1,2,6903.22,430.778,471.764,3.56047,300,0,0,0), +(@NEXT+16,30203,571,1,2,6881.51,391.672,471.771,1.93731,300,0,0,0), +(@NEXT+17,30203,571,1,2,6877.89,665.768,425.523,1.29154,300,0,0,0), +(@NEXT+18,30203,571,1,2,6553.27,579.069,419.185,3.90954,300,0,0,0), +(@NEXT+19,30203,571,1,2,6560.22,584.094,419.185,0.645772,300,0,0,0), +(@NEXT+20,30203,571,1,2,6747.13,456.848,419.284,1.39626,300,0,0,0), +(@NEXT+21,30203,571,1,2,7062.78,521.156,526.362,5.75959,300,0,0,0), +(@NEXT+22,30203,571,1,2,7068.11,477.927,530.313,0.558505,300,0,0,0), +(@NEXT+23,30203,571,1,2,6689.02,570.998,424.525,3.9968,300,0,0,0), +(@NEXT+24,30203,571,1,2,6745.99,449.016,419.284,4.4855,300,0,0,0), +(@NEXT+25,30203,571,1,2,6809.11,843.341,381.335,3.23154,300,0,1217160,2), +(@NEXT+26,30203,571,1,2,6901.58,727.055,420.546,3.24233,300,0,1217170,2), +(@NEXT+27,30203,571,1,2,7002.27,602.799,476.138,5.93303,300,0,1217200,2), +(@NEXT+28,30543,571,1,128,6879.92,493.899,467.957,1.67552,300,0,0,0), +(@NEXT+29,30543,571,1,128,6916.07,467.629,468.799,0.977384,300,0,0,0), +(@NEXT+30,30543,571,1,128,6858.02,453.902,471.767,4.7822,300,0,0,0), +(@NEXT+31,30543,571,1,128,6835.59,414.643,471.77,0.802851,300,0,0,0), +(@NEXT+32,30543,571,1,128,6903.22,430.778,471.764,3.56047,300,0,0,0), +(@NEXT+33,30543,571,1,128,6881.51,391.672,471.771,1.93731,300,0,0,0), +(@NEXT+34,30543,571,1,128,6877.89,665.768,425.523,1.29154,300,0,0,0), +(@NEXT+35,30543,571,1,128,6553.27,579.069,419.185,3.90954,300,0,0,0), +(@NEXT+36,30543,571,1,128,6560.22,584.094,419.185,0.645772,300,0,0,0), +(@NEXT+37,30543,571,1,128,6747.13,456.848,419.284,1.39626,300,0,0,0), +(@NEXT+38,30543,571,1,128,7062.78,521.156,526.362,5.75959,300,0,0,0), +(@NEXT+39,30543,571,1,128,7068.11,477.927,530.313,0.558505,300,0,0,0), +(@NEXT+40,30543,571,1,128,6689.02,570.998,424.525,3.9968,300,0,0,0), +(@NEXT+41,30543,571,1,128,6745.99,449.016,419.284,4.4855,300,0,0,0), +(@NEXT+42,30543,571,1,128,6809.11,843.341,381.335,3.23154,300,0,1217160,2), +(@NEXT+43,30543,571,1,128,6901.58,727.055,420.546,3.24233,300,0,1217170,2), +(@NEXT+44,30543,571,1,128,7002.27,602.799,476.138,5.93303,300,0,1217200,2), +-- Reanimated Crusader +(@NEXT+45,30202,571,1,128,6770.55,386.311,421.153,2.7317,300,5,0,1), +(@NEXT+46,30202,571,1,128,6655.04,328.894,442.276,0.929563,300,5,0,1), +(@NEXT+47,30202,571,1,128,6448.62,618.154,432.265,2.1122,300,5,0,1), +(@NEXT+48,30202,571,1,128,6471.01,562.99,438.4,3.5549,300,5,0,1), +(@NEXT+49,30202,571,1,128,6448.03,608.829,433.982,1.32629,300,5,0,1), +(@NEXT+50,30202,571,1,128,6526.88,512.588,412.274,2.77181,300,5,0,1), +(@NEXT+51,30202,571,1,128,6513.35,523.34,415.136,0.501217,300,5,0,1), +(@NEXT+52,30202,571,1,128,6556.12,636.946,408.191,1.22528,300,5,0,1), +(@NEXT+53,30202,571,1,128,6697.52,476.907,401.588,2.99677,300,5,0,1), +(@NEXT+54,30202,571,1,128,6704.82,441.489,406.499,3.35221,300,5,0,1), +(@NEXT+55,30202,571,1,128,6723.74,417.997,412.953,4.18409,300,5,0,1), +(@NEXT+56,30202,571,1,128,6644.93,422.78,401.853,3.19711,300,5,0,1), +(@NEXT+57,30202,571,1,128,6654.72,492.468,398.206,2.81552,300,5,0,1), +(@NEXT+58,30202,571,1,128,6630.65,458.047,398.995,5.84132,300,5,0,1), +(@NEXT+59,30202,571,1,128,6661.41,584.323,408.676,0.785398,300,5,0,1), +(@NEXT+60,30202,571,1,128,6518.07,616.422,410.051,2.1325,300,5,0,1), +(@NEXT+61,30202,571,1,128,6514.78,664.2,399.383,0.291176,300,5,0,1), +(@NEXT+62,30202,571,1,128,6563.32,539.29,404.559,0.919091,300,5,0,1), +(@NEXT+63,30202,571,1,128,6617.92,519.797,396.795,1.55615,300,5,0,1), +(@NEXT+64,30202,571,1,128,6643.92,633.926,404.904,1.84373,300,5,0,1), +(@NEXT+65,30202,571,1,128,6592.97,620.213,408.135,1.80125,300,5,0,1), +(@NEXT+66,30202,571,1,128,6707.83,535.834,405.493,5.84095,300,5,0,1), +(@NEXT+67,30202,571,1,128,6758.07,512.831,410.903,2.78648,300,5,0,1), +(@NEXT+68,30202,571,1,128,6764.6,535.115,415.201,3.48219,300,5,0,1), +(@NEXT+69,30202,571,1,128,6669.68,527.603,401.525,5.13205,300,5,0,1), +(@NEXT+70,30202,571,1,128,6613,590.876,403.789,2.88047,300,5,0,1), +(@NEXT+71,30202,571,1,128,6545.45,535.57,407.359,1.50529,300,5,0,1), +(@NEXT+72,30202,571,1,128,6623.12,684.658,405.968,4.4761,300,5,0,1), +(@NEXT+73,30202,571,1,128,6584.43,679.969,406.644,2.11574,300,5,0,1), +(@NEXT+74,30202,571,1,128,6576.55,460.06,408.104,0.763302,300,5,0,1), +(@NEXT+75,30202,571,1,128,6606.58,489.339,398.158,5.60417,300,5,0,1), +(@NEXT+76,30202,571,1,128,6563.66,505.381,403.489,0.430917,300,5,0,1), +(@NEXT+77,30202,571,1,128,6579.71,401.572,416.112,6.10437,300,5,0,1), +(@NEXT+78,30202,571,1,128,6632.51,382.456,412.855,5.91518,300,5,0,1), +(@NEXT+79,30202,571,1,128,6721.48,346.299,424.582,5.91108,300,5,0,1), +(@NEXT+80,30202,571,1,128,6657.63,385.761,411.832,2.05191,300,5,0,1), +(@NEXT+81,30202,571,1,128,6709.57,384.33,414.698,3.57468,300,5,0,1), +(@NEXT+82,30202,571,1,128,6722.58,492.852,405.603,5.6035,300,5,0,1), +-- Forgotten Depths Underking +(@NEXT+83,30544,571,1,2,6962.62,734.955,445.296,4.4855,300,0,0,0), +(@NEXT+84,30544,571,1,2,7056.29,572.491,497.073,2.23402,300,0,0,0), +(@NEXT+85,30544,571,1,2,7005.75,714.752,468.614,3.07178,300,0,0,0), +(@NEXT+86,30544,571,1,2,6809.11,843.341,381.335,5.7554,300,0,1217280,0), +(@NEXT+87,30544,571,1,2,6437.59,604.262,439.155,0.369627,300,0,1217310,2), +(@NEXT+89,30544,571,1,2,7002.27,602.799,476.138,5.7192,300,0,1217350,0), +(@NEXT+90,30541,571,1,128,6962.62,734.955,445.296,4.4855,300,0,0,0), +(@NEXT+91,30541,571,1,128,7056.29,572.491,497.073,2.23402,300,0,0,0), +(@NEXT+92,30541,571,1,128,7005.75,714.752,468.614,3.07178,300,0,0,0), +(@NEXT+93,30541,571,1,128,6760.42,515.039,411.837,3.66099,300,0,1217270,2), +(@NEXT+94,30541,571,1,128,6809.11,843.341,381.335,5.7554,300,0,1217280,0), +(@NEXT+95,30541,571,1,128,7002.27,602.799,476.138,5.7192,300,0,1217350,0), +(@NEXT+96,30541,571,1,128,6769.89,628.623,425.97,-1.65443,300,0,1217290,2), +(@NEXT+97,30541,571,1,128,6697.87,429.598,406.569,1.77104,300,0,1217300,2), +(@NEXT+98,30541,571,1,128,6437.59,604.262,439.155,0.369627,300,0,1217310,2), +(@NEXT+99,30541,571,1,128,6622.62,585.661,402.875,5.61246,300,0,1217320,2), +(@NEXT+100,30541,571,1,128,6710.23,685.938,408.296,3.24837,300,0,1217330,2), +(@NEXT+101,30541,571,1,128,6575.6,465.094,407.446,2.69257,300,0,1217360,2), +(@NEXT+102,30541,571,1,128,6641.92,396.595,408.673,2.55359,300,0,1217370,2), +-- Wrathstrike Gargoyle +(@NEXT+103,30482,571,1,128,7059.52,455.611,581.574,3.35148,300,0,1217550,2), +(@NEXT+104,30482,571,1,128,7009.05,544.408,610.468,3.23607,300,0,1217540,2), +(@NEXT+105,30482,571,1,128,6804.5,702.568,436.191,0.0303077,300,0,1217530,2), +(@NEXT+106,30482,571,1,128,6799.31,642.302,459.819,3.88908,300,0,1217520,2), +(@NEXT+107,30482,571,1,128,6753.66,410.408,446.625,3.19529,300,0,1217510,2), +(@NEXT+108,30482,571,1,128,6597.14,566.743,445.037,1.40898,300,0,1217500,2), +(@NEXT+109,30482,571,1,128,6596.2,564.031,445.111,4.27718,300,0,1217490,2), +(@NEXT+110,30482,571,1,128,6559.29,413.281,462.263,6.13325,300,0,1217480,2), +-- Add missing mobs in the Valley of Echoes during the first phase. The DB has no spawn info on these ones so I added them in a logical number and places,feel free to skip this part if its not "correct" enough. (If anyone has actual sniffs for the location of these mobs feel free to share) +-- Forgotten Depths Slayer for first phase (id:30333,not the same one that should appear during "The last line of defense) +(@NEXT+111,30333,571,1,2,6150.518066,147.111313,372.771057,0.197990,300,7,0,1), +(@NEXT+112,30333,571,1,2,6212.446777,130.204849,377.827118,0.657450,300,7,0,1), +(@NEXT+113,30333,571,1,2,6110.951660,83.364746,371.154419,1.230786,300,7,0,1), +(@NEXT+114,30333,571,1,2,6047.241699,178.537430,353.744293,5.322711,300,7,0,1), +(@NEXT+115,30333,571,1,2,6182.750000,199.942261,380.134705,4.996765,300,7,0,1), +(@NEXT+116,30333,571,1,2,6219.042480,236.113785,388.062317,5.134206,300,7,0,1), +(@NEXT+117,30333,571,1,2,6421.106445,188.232880,395.621826,2.247868,300,7,0,1), +(@NEXT+118,30333,571,1,2,6351.036621,91.049683,392.077698,1.969049,300,7,0,1), +(@NEXT+119,30333,571,1,2,6264.502930,147.837006,383.335876,2.346035,300,7,0,1), +-- Forgotten Depths Acolyte +(@NEXT+120,30205,571,1,2,6278.386230,199.642899,385.989258,5.377527,300,0,0,0), +(@NEXT+121,30205,571,1,2,6229.345703,133.398743,379.961639,3.759608,300,0,0,0), +(@NEXT+122,30205,571,1,2,6087.062012,136.313293,367.117310,4.827752,300,0,0,0), +(@NEXT+123,30205,571,1,2,6127.606445,172.50610,370.652832,6.190416,300,0,0,0), +(@NEXT+124,30205,571,1,2,6149.881836,220.209808,379.919403,5.361032,300,0,0,0), +(@NEXT+125,30205,571,1,2,6422.211426,148.303436,395.890137,1.964183,300,0,0,0), +(@NEXT+126,30205,571,1,2,6375.815918,81.636124,394.968140,2.337249,300,0,0,0), +(@NEXT+127,30205,571,1,2,6333.330566,29.062647,389.581329,1.508653,300,0,0,0), +(@NEXT+128,30205,571,1,2,6130.472656,172.082047,370.962646,5.695776,300,0,0,0); From a8f2c7ccab633e86e74d2e2bf957ed0b04f0dc7b Mon Sep 17 00:00:00 2001 From: qaywsx Date: Mon, 28 May 2012 13:51:17 +0200 Subject: [PATCH 0861/1149] DB/Creatures: Add pathings for the phased creatures in previous commit --- .../2012_05_28_06_world_waypoint_data.sql | 524 ++++++++++++++++++ 1 file changed, 524 insertions(+) create mode 100644 sql/updates/world/2012_05_28_06_world_waypoint_data.sql diff --git a/sql/updates/world/2012_05_28_06_world_waypoint_data.sql b/sql/updates/world/2012_05_28_06_world_waypoint_data.sql new file mode 100644 index 00000000000..1c738cacdc9 --- /dev/null +++ b/sql/updates/world/2012_05_28_06_world_waypoint_data.sql @@ -0,0 +1,524 @@ +-- The following are the paths for the newly added mobs that have the same spawn spot as a mob (different phase and id) that already had a path. The paths are exactly the same as their already spawned counterparts. +-- Pathing for newly added Wrathstrike Gargoyles +-- ----------------------------------------------------------------------------------------------------------- +SET @NEXT := 134704; +-- Wrathstrike Gargoyle 1 +SET @NPC = @NEXT+103; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7060.05,455.727,581.492,0,0,0,100,0), +(@PATH,2,6982.99,465.858,581.492,0,0,0,100,0), +(@PATH,3,6963.94,516.342,581.492,0,0,0,100,0), +(@PATH,4,7012.51,555.944,581.492,0,0,0,100,0), +(@PATH,5,7062.92,517.784,566.464,0,0,0,100,0), +(@PATH,6,7074.5,487.171,566.464,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30482 AND `currentwaypoint`=1217550; +-- ----------------------------------------------------------------------------------------------------------- +-- Wrathstrike Gargoyle 2 +SET @NPC = @NEXT+104; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6975.12,457.238,608.122,0,0,0,100,0), +(@PATH,2,6994.13,442.679,608.122,0,0,0,100,0), +(@PATH,3,7024.58,437.239,608.122,0,0,0,100,0), +(@PATH,4,7055.78,456.622,580.705,0,0,0,100,0), +(@PATH,5,7069.78,488.277,580.705,0,0,0,100,0), +(@PATH,6,7057.18,540.235,608.205,0,0,0,100,0), +(@PATH,7,6978.62,537.405,608.205,0,0,0,100,0), +(@PATH,8,6960.95,489.864,595.233,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30482 AND `currentwaypoint`=1217540; +-- ----------------------------------------------------------------------------------------------------------- +-- Wrathstrike Gargoyle 3 +SET @NPC = @NEXT+105; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6817.71,701.731,436.81,0,0,0,100,0), +(@PATH,2,6839.81,671.33,438.476,0,0,0,100,0), +(@PATH,3,6771.48,625.298,444.032,0,0,0,100,0), +(@PATH,4,6729.31,607.063,451.504,0,0,0,100,0), +(@PATH,5,6689.26,569.483,444.032,0,0,0,100,0), +(@PATH,6,6664.17,580.683,449.976,0,0,0,100,0), +(@PATH,7,6657.52,638.465,440.893,0,0,0,100,0), +(@PATH,8,6664.19,665.048,444.032,0,0,0,100,0), +(@PATH,9,6735.33,692.836,433.938,0,0,0,100,0), +(@PATH,10,6741.25,694.33,433.56,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30482 AND `currentwaypoint`=1217530; +-- ----------------------------------------------------------------------------------------------------------- +-- Wrathstrike Gargoyle 4 +SET @NPC = @NEXT+106; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6808.92,649.929,459.327,0,0,0,100,0), +(@PATH,2,6779.63,606.717,465.077,0,0,0,100,0), +(@PATH,3,6799.14,541.206,474.66,0,0,0,100,0), +(@PATH,4,6863.37,520.467,465.077,0,0,0,100,0), +(@PATH,5,6900.8,554.799,459.216,0,0,0,100,0), +(@PATH,6,6904.96,624.433,471.549,0,0,0,100,0), +(@PATH,7,6860.9,661.477,465.077,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30482 AND `currentwaypoint`=1217520; +-- ----------------------------------------------------------------------------------------------------------- +-- Wrathstrike Gargoyle 5 +SET @NPC = @NEXT+107; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6764.29,413.94,446.625,0,0,0,100,0), +(@PATH,2,6727.13,417.659,446.625,0,0,0,100,0), +(@PATH,3,6709.2,445.43,446.625,0,0,0,100,0), +(@PATH,4,6714.21,476.942,446.625,0,0,0,100,0), +(@PATH,5,6760.44,491.312,446.625,0,0,0,100,0), +(@PATH,6,6786.47,463.163,446.625,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30482 AND `currentwaypoint`=1217510; +-- ----------------------------------------------------------------------------------------------------------- +-- Wrathstrike Gargoyle 6 +SET @NPC = @NEXT+108; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6589.56,608.719,445.037,0,0,0,100,0), +(@PATH,2,6536.49,613.397,445.037,0,0,0,100,0), +(@PATH,3,6515.31,571.263,445.037,0,0,0,100,0), +(@PATH,4,6540.83,538.391,445.037,0,0,0,100,0), +(@PATH,5,6561.1,543.055,445.037,0,0,0,100,0), +(@PATH,6,6595.09,559.099,445.037,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30482 AND `currentwaypoint`=1217500; +-- ----------------------------------------------------------------------------------------------------------- +-- Wrathstrike Gargoyle 7 +SET @NPC = @NEXT+109; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6661.58,545.496,432.795,0,0,0,100,0), +(@PATH,2,6659.48,589.326,447.184,0,0,0,100,0), +(@PATH,3,6628.78,594.459,446.434,0,0,0,100,0), +(@PATH,4,6613.69,584.967,446.434,0,0,0,100,0), +(@PATH,5,6595.45,562.222,444.795,0,0,0,100,0), +(@PATH,6,6595.77,535.16,436.934,0,0,0,100,0), +(@PATH,7,6631,528.616,450.823,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30482 AND `currentwaypoint`=1217490; +-- ----------------------------------------------------------------------------------------------------------- +-- Wrathstrike Gargoyle 8 +SET @NPC = @NEXT+110; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6585.6,408.848,446.514,0,0,0,100,0), +(@PATH,2,6607.57,400.701,444.745,0,0,0,100,0), +(@PATH,3,6647.89,401.573,444.745,0,0,0,100,0), +(@PATH,4,6667.63,414.847,433.912,0,0,0,100,0), +(@PATH,5,6648.87,462.506,444.745,0,0,0,100,0), +(@PATH,6,6592.11,478.371,444.745,0,0,0,100,0), +(@PATH,7,6501.26,474.703,444.745,0,0,0,100,0), +(@PATH,8,6484.09,430.145,485.097,0,0,0,100,0), +(@PATH,9,6519.88,419.711,485.097,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30482 AND `currentwaypoint`=1217480; +-- ----------------------------------------------------------------------------------------------------------- +-- Pathing for newly added Forgotten Depths Underkings +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths Underking 1 +SET @NPC = @NEXT+96; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6788.09,633.101,426.095,0,0,0,100,0), +(@PATH,2,6789.98,619.743,423.47,0,0,0,100,0), +(@PATH,3,6766.65,606.497,423.42,0,0,0,100,0), +(@PATH,4,6740.19,597.458,425.39,0,0,0,100,0), +(@PATH,5,6725.25,595.632,423.432,0,0,0,100,0), +(@PATH,6,6713.96,602.526,423.595,0,0,0,100,0), +(@PATH,7,6720.27,613.862,423.47,0,0,0,100,0), +(@PATH,8,6736.25,614.921,423.545,0,0,0,100,0), +(@PATH,9,6769.89,628.623,425.97,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30541 AND `currentwaypoint`=1217290; +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths Underking 2 +SET @NPC = @NEXT+97; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6698.5,458.598,404.586,0,0,0,100,0), +(@PATH,2,6695.69,473.044,401.838,0,0,0,100,0), +(@PATH,3,6665,494.007,397.863,0,0,0,100,0), +(@PATH,4,6621.27,520.385,397.423,0,0,0,100,0), +(@PATH,5,6601.79,552.183,399.092,0,0,0,100,0), +(@PATH,6,6579.75,536.627,401.438,0,0,0,100,0), +(@PATH,7,6599.6,508.629,398.578,0,0,0,100,0), +(@PATH,8,6627.41,480.195,397.408,0,0,0,100,0), +(@PATH,9,6643.31,442.918,399.225,0,0,0,100,0), +(@PATH,10,6674.23,416.566,405.944,0,0,0,100,0), +(@PATH,11,6697.87,429.598,406.569,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30541 AND `currentwaypoint`=1217300; +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths Underking 3-A +SET @NPC = @NEXT+98; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6395.82,618.184,452.633,0,0,0,100,0), +(@PATH,2,6358.26,637.18,462.167,0,0,0,100,0), +(@PATH,3,6370.71,666.535,453.289,0,0,0,100,0), +(@PATH,4,6375.45,676.189,445.42,0,0,0,100,0), +(@PATH,5,6407.42,688.589,434.416,0,0,0,100,0), +(@PATH,6,6429.66,650.562,435.434,0,0,0,100,0), +(@PATH,7,6461.86,627.093,426.405,0,0,0,100,0), +(@PATH,8,6482.61,623.854,419.051,0,0,0,100,0), +(@PATH,9,6486.97,594.615,420.488,0,0,0,100,0), +(@PATH,10,6457.97,595.352,432.948,0,0,0,100,0), +(@PATH,11,6437.59,604.262,439.155,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30541 AND `currentwaypoint`=1217310; +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths Underking 3-B +SET @NPC = @Next+87; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6395.82,618.184,452.633,0,0,0,100,0), +(@PATH,2,6358.26,637.18,462.167,0,0,0,100,0), +(@PATH,3,6370.71,666.535,453.289,0,0,0,100,0), +(@PATH,4,6375.45,676.189,445.42,0,0,0,100,0), +(@PATH,5,6407.42,688.589,434.416,0,0,0,100,0), +(@PATH,6,6429.66,650.562,435.434,0,0,0,100,0), +(@PATH,7,6461.86,627.093,426.405,0,0,0,100,0), +(@PATH,8,6482.61,623.854,419.051,0,0,0,100,0), +(@PATH,9,6486.97,594.615,420.488,0,0,0,100,0), +(@PATH,10,6457.97,595.352,432.948,0,0,0,100,0), +(@PATH,11,6437.59,604.262,439.155,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30544 AND `currentwaypoint`=1217310; +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths Underking 4 +SET @NPC = @NEXT+99; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6618.91,606.085,403.839,0,0,0,100,0), +(@PATH,2,6608.22,599.539,403.875,0,0,0,100,0), +(@PATH,3,6613.37,574.047,401.125,0,0,0,100,0), +(@PATH,4,6638.76,543.87,399.563,0,0,0,100,0), +(@PATH,5,6667.59,521.002,401.025,0,0,0,100,0), +(@PATH,6,6697.97,501.482,400.775,0,0,0,100,0), +(@PATH,7,6711.98,522.746,404.353,0,0,0,100,0), +(@PATH,8,6702.31,534.57,405.75,0,0,0,100,0), +(@PATH,9,6679.62,541.533,402.209,0,0,0,100,0), +(@PATH,10,6660.61,557.771,404.938,0,0,0,100,0), +(@PATH,11,6639.28,577.426,402.927,0,0,0,100,0), +(@PATH,12,6622.62,585.661,402.875,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30541 AND `currentwaypoint`=1217320; +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths Underking 5 +SET @NPC = @NEXT+100; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6746.43,700.445,407.534,0,0,0,100,0), +(@PATH,2,6767.77,702.447,407.514,0,0,0,100,0), +(@PATH,3,6780.88,716.948,410.264,0,0,0,100,0), +(@PATH,4,6761.32,729.055,407.659,0,0,0,100,0), +(@PATH,5,6723.36,725.67,406.194,0,0,0,100,0), +(@PATH,6,6706.1,712.006,411.069,0,0,0,100,0), +(@PATH,7,6687.8,701.721,412.302,0,0,0,100,0), +(@PATH,8,6668.08,685.327,409.231,0,0,0,100,0), +(@PATH,9,6660.25,674.05,407.891,0,0,0,100,0), +(@PATH,10,6667.72,662.234,407.017,0,0,0,100,0), +(@PATH,11,6710.23,685.938,408.296,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30541 AND `currentwaypoint`=1217330; +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths Underking 6 +SET @NPC = @NEXT+101; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6552.96,457.401,412.93,0,0,0,100,0), +(@PATH,2,6551.69,432.508,416.436,0,0,0,100,0), +(@PATH,3,6568.85,415.311,415.444,0,0,0,100,0), +(@PATH,4,6572.9,410.44,415.694,0,0,0,100,0), +(@PATH,5,6577.95,406.559,415.694,0,0,0,100,0), +(@PATH,6,6591.15,393.959,416.312,0,0,0,100,0), +(@PATH,7,6624.85,389.377,412.855,0,0,0,100,0), +(@PATH,8,6642.71,398.137,408.048,0,0,0,100,0), +(@PATH,9,6642.51,414.137,403.978,0,0,0,100,0), +(@PATH,10,6613.73,435.694,403.495,0,0,0,100,0), +(@PATH,11,6598.72,453.969,403.196,0,0,0,100,0), +(@PATH,12,6575.6,465.094,407.446,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30541 AND `currentwaypoint`=1217360; +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths Underking 7 +SET @NPC = @NEXT+102; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6665.69,385.118,411.923,0,0,0,100,0), +(@PATH,2,6688.12,372.121,414.309,0,0,0,100,0), +(@PATH,3,6681.71,337.864,421.782,0,0,0,100,0), +(@PATH,4,6711.15,330.663,422.912,0,0,0,100,0), +(@PATH,5,6729,353.407,426.957,0,0,0,100,0), +(@PATH,6,6759.39,371.963,426.169,0,0,0,100,0), +(@PATH,7,6742.83,378.436,419.544,0,0,0,100,0), +(@PATH,8,6710.78,380.507,415.679,0,0,0,100,0), +(@PATH,9,6685.82,397.148,408.809,0,0,0,100,0), +(@PATH,10,6655.42,406.866,405.478,0,0,0,100,0), +(@PATH,11,6641.92,396.595,408.673,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30541 AND `currentwaypoint`=1217370; +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths Underking 8 +SET @NPC = @NEXT+93; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6751.58,521.709,409.087,0,0,0,100,0), +(@PATH,2,6775.59,535.639,418.22,0,0,0,100,0), +(@PATH,3,6790.69,546.924,424.095,0,0,0,100,0), +(@PATH,4,6797.82,545.099,424.47,0,0,0,100,0), +(@PATH,5,6787.22,530.424,421.059,0,0,0,100,0), +(@PATH,6,6760.42,515.039,411.837,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30541 AND `currentwaypoint`=1217270; +-- ----------------------------------------------------------------------------------------------------------- +-- Pathing for newly added Forgotten Depths High Priests. There are A and B versions because only the ones from the last phase were already spawned in DB and had their pathing. This didn't occur with the Forgotten Depths Underkings because their first phase counterpats were already spawned (at least the ones with paths,the rest weren't). 2 of them don't get the current waypoint removed yet because its used for a guideline for creature_formations later. +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths High Priest 1-A +SET @NPC = @NEXT+25; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6845.23,827.966,390.654,0,0,0,100,0), +(@PATH,2,6869.87,814.437,394.231,0,0,0,100,0), +(@PATH,3,6885.91,795.247,398.76,0,0,0,100,0), +(@PATH,4,6889.42,776.747,410.135,0,0,0,100,0), +(@PATH,5,6887.17,765.483,417.106,0,0,0,100,0), +(@PATH,6,6916.54,751.385,415.552,0,0,0,100,0), +(@PATH,7,6922.71,770.234,412.379,0,0,0,100,0), +(@PATH,8,6936.68,795.657,409.292,0,0,0,100,0), +(@PATH,9,6946.95,821.291,405.551,0,0,0,100,0), +(@PATH,10,6940.67,819.911,406.551,0,0,0,100,0), +(@PATH,11,6918.09,776.126,411.879,0,0,0,100,0), +(@PATH,12,6903.68,745.868,416.802,0,0,0,100,0), +(@PATH,13,6892.57,727.713,418.396,0,0,0,100,0), +(@PATH,14,6855.19,723.309,414.328,0,0,0,100,0), +(@PATH,15,6810.95,714.736,409.567,0,0,0,100,0), +(@PATH,16,6778.23,711.31,408.139,0,0,0,100,0), +(@PATH,17,6749.77,708.742,407.159,0,0,0,100,0), +(@PATH,18,6724.11,709.65,409.563,0,0,0,100,0), +(@PATH,19,6720.02,695.631,407.296,0,0,0,100,0), +(@PATH,20,6730.44,731.649,404.319,0,0,0,100,0), +(@PATH,21,6727.1,774.371,385.328,0,0,0,100,0), +(@PATH,22,6722.82,816.964,376.654,0,0,0,100,0), +(@PATH,23,6733.84,849.984,376.012,0,0,0,100,0), +(@PATH,24,6753.25,867.14,376.46,0,0,0,100,0), +(@PATH,25,6786.71,850.127,379.337,0,0,0,100,0), +(@PATH,26,6817.16,840.912,382.21,0,0,0,100,0); +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths High Priest 1-B +SET @NPC = @NEXT+42; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6845.23,827.966,390.654,0,0,0,100,0), +(@PATH,2,6869.87,814.437,394.231,0,0,0,100,0), +(@PATH,3,6885.91,795.247,398.76,0,0,0,100,0), +(@PATH,4,6889.42,776.747,410.135,0,0,0,100,0), +(@PATH,5,6887.17,765.483,417.106,0,0,0,100,0), +(@PATH,6,6916.54,751.385,415.552,0,0,0,100,0), +(@PATH,7,6922.71,770.234,412.379,0,0,0,100,0), +(@PATH,8,6936.68,795.657,409.292,0,0,0,100,0), +(@PATH,9,6946.95,821.291,405.551,0,0,0,100,0), +(@PATH,10,6940.67,819.911,406.551,0,0,0,100,0), +(@PATH,11,6918.09,776.126,411.879,0,0,0,100,0), +(@PATH,12,6903.68,745.868,416.802,0,0,0,100,0), +(@PATH,13,6892.57,727.713,418.396,0,0,0,100,0), +(@PATH,14,6855.19,723.309,414.328,0,0,0,100,0), +(@PATH,15,6810.95,714.736,409.567,0,0,0,100,0), +(@PATH,16,6778.23,711.31,408.139,0,0,0,100,0), +(@PATH,17,6749.77,708.742,407.159,0,0,0,100,0), +(@PATH,18,6724.11,709.65,409.563,0,0,0,100,0), +(@PATH,19,6720.02,695.631,407.296,0,0,0,100,0), +(@PATH,20,6730.44,731.649,404.319,0,0,0,100,0), +(@PATH,21,6727.1,774.371,385.328,0,0,0,100,0), +(@PATH,22,6722.82,816.964,376.654,0,0,0,100,0), +(@PATH,23,6733.84,849.984,376.012,0,0,0,100,0), +(@PATH,24,6753.25,867.14,376.46,0,0,0,100,0), +(@PATH,25,6786.71,850.127,379.337,0,0,0,100,0), +(@PATH,26,6817.16,840.912,382.21,0,0,0,100,0); +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths High Priest 2-A +SET @NPC = @NEXT+26; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6877.06,727.294,415.646,0,0,0,100,0), +(@PATH,2,6840.86,720.367,413.578,0,0,0,100,0), +(@PATH,3,6804.06,715.519,409.067,0,0,0,100,0), +(@PATH,4,6775.7,711.378,408.139,0,0,0,100,0), +(@PATH,5,6775.7,706.114,408.014,0,0,0,100,0), +(@PATH,6,6806.69,710.446,409.317,0,0,0,100,0), +(@PATH,7,6840.86,715.128,414.078,0,0,0,100,0), +(@PATH,8,6885.64,719.654,417.771,0,0,0,100,0), +(@PATH,9,6901.58,727.055,420.546,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30203 AND `currentwaypoint`=1217170; +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths High Priest 2-B +SET @NPC = @NEXT+43; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6877.06,727.294,415.646,0,0,0,100,0), +(@PATH,2,6840.86,720.367,413.578,0,0,0,100,0), +(@PATH,3,6804.06,715.519,409.067,0,0,0,100,0), +(@PATH,4,6775.7,711.378,408.139,0,0,0,100,0), +(@PATH,5,6775.7,706.114,408.014,0,0,0,100,0), +(@PATH,6,6806.69,710.446,409.317,0,0,0,100,0), +(@PATH,7,6840.86,715.128,414.078,0,0,0,100,0), +(@PATH,8,6885.64,719.654,417.771,0,0,0,100,0), +(@PATH,9,6901.58,727.055,420.546,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30543 AND `currentwaypoint`=1217170; +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths High Priest 3-A +SET @NPC = @NEXT+27; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7028.06,593.528,484.848,0,0,0,100,0), +(@PATH,2,7050.86,587.232,490.487,0,0,0,100,0), +(@PATH,3,7088.02,583.536,496.767,0,0,0,100,0), +(@PATH,4,7135.53,587.626,498.11,0,0,0,100,0), +(@PATH,5,7174.15,581.088,498.373,0,0,0,100,0), +(@PATH,6,7200,579.166,498.248,0,0,0,100,0), +(@PATH,7,7217.31,586.021,496.983,0,0,0,100,0), +(@PATH,8,7203.83,615.728,490.388,0,0,0,100,0), +(@PATH,9,7164.62,625.286,496.707,0,0,0,100,0), +(@PATH,10,7126.29,619.13,497.944,0,0,0,100,0), +(@PATH,11,7094.89,587.951,498.017,0,0,0,100,0), +(@PATH,12,7050.28,590.763,490.362,0,0,0,100,0), +(@PATH,13,7013.81,602.295,479.513,0,0,0,100,0), +(@PATH,14,6987.71,624.076,465.805,0,0,0,100,0), +(@PATH,15,6964.91,625.148,460.924,0,0,0,100,0), +(@PATH,16,6944.73,587.153,467.576,0,0,0,100,0), +(@PATH,17,6927.86,556.953,466.828,0,0,0,100,0), +(@PATH,18,6919.79,527.804,467.056,0,0,0,100,0), +(@PATH,19,6907.68,497.326,466.719,0,0,0,100,0), +(@PATH,20,6914.34,512.11,466.681,0,0,0,100,0), +(@PATH,21,6926.01,537.956,466.578,0,0,0,100,0), +(@PATH,22,6938.29,577.003,466.951,0,0,0,100,0), +(@PATH,23,6952.16,594.699,466.951,0,0,0,100,0), +(@PATH,24,6969.78,616.559,463.68,0,0,0,100,0), +(@PATH,25,6985.14,615.594,467.305,0,0,0,100,0), +(@PATH,26,7002.27,602.799,476.138,0,0,0,100,0); +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths High Priest 3-B +SET @NPC = @NEXT+44; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7028.06,593.528,484.848,0,0,0,100,0), +(@PATH,2,7050.86,587.232,490.487,0,0,0,100,0), +(@PATH,3,7088.02,583.536,496.767,0,0,0,100,0), +(@PATH,4,7135.53,587.626,498.11,0,0,0,100,0), +(@PATH,5,7174.15,581.088,498.373,0,0,0,100,0), +(@PATH,6,7200,579.166,498.248,0,0,0,100,0), +(@PATH,7,7217.31,586.021,496.983,0,0,0,100,0), +(@PATH,8,7203.83,615.728,490.388,0,0,0,100,0), +(@PATH,9,7164.62,625.286,496.707,0,0,0,100,0), +(@PATH,10,7126.29,619.13,497.944,0,0,0,100,0), +(@PATH,11,7094.89,587.951,498.017,0,0,0,100,0), +(@PATH,12,7050.28,590.763,490.362,0,0,0,100,0), +(@PATH,13,7013.81,602.295,479.513,0,0,0,100,0), +(@PATH,14,6987.71,624.076,465.805,0,0,0,100,0), +(@PATH,15,6964.91,625.148,460.924,0,0,0,100,0), +(@PATH,16,6944.73,587.153,467.576,0,0,0,100,0), +(@PATH,17,6927.86,556.953,466.828,0,0,0,100,0), +(@PATH,18,6919.79,527.804,467.056,0,0,0,100,0), +(@PATH,19,6907.68,497.326,466.719,0,0,0,100,0), +(@PATH,20,6914.34,512.11,466.681,0,0,0,100,0), +(@PATH,21,6926.01,537.956,466.578,0,0,0,100,0), +(@PATH,22,6938.29,577.003,466.951,0,0,0,100,0), +(@PATH,23,6952.16,594.699,466.951,0,0,0,100,0), +(@PATH,24,6969.78,616.559,463.68,0,0,0,100,0), +(@PATH,25,6985.14,615.594,467.305,0,0,0,100,0), +(@PATH,26,7002.27,602.799,476.138,0,0,0,100,0); +-- -------------------------------------------------------------------------------------------------- +-- Create creature formations based on already existing ones. Also remove the final current waypoints. +-- Creature Formation 1-A +-- -------------------------------------------------------------------------------------------------- +SET @LEADER = @NEXT+27; +SET @NPC = @NEXT+89; +DELETE FROM `creature_formations` WHERE `leaderGUID`=@LEADER; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(@LEADER,@LEADER,0,0,2), +(@LEADER,@NPC,3,0,2); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30203 AND `currentwaypoint`=1217200; +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30544 AND `currentwaypoint`=1217350; +-- Creature Formation 1-B +SET @LEADER = @NEXT+44; +SET @NPC = @NEXT+95; +DELETE FROM `creature_formations` WHERE `leaderGUID`=@LEADER; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(@LEADER,@LEADER,0,0,2), +(@LEADER,@NPC,3,0,2); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30543 AND `currentwaypoint`=1217200; +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30541 AND `currentwaypoint`=1217350; +-- Creature Formation 2-A +SET @LEADER = @NEXT+25; +SET @NPC = @NEXT+86; +DELETE FROM `creature_formations` WHERE `leaderGUID`=@LEADER; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(@LEADER,@LEADER,0,0,2), +(@LEADER,@NPC,3,0,2); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30203 AND `currentwaypoint`=1217160; +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30544 AND `currentwaypoint`=1217280; +-- Creature Formation 2-B +SET @LEADER = @NEXT+42; +SET @NPC = @NEXT+94; +DELETE FROM `creature_formations` WHERE `leaderGUID`=@LEADER; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(@LEADER,@LEADER,0,0,2), +(@LEADER,@NPC,3,0,2); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30543 AND `currentwaypoint`=1217160; +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30541 AND `currentwaypoint`=1217280; From 34a1dd763b5978cde86bbb2d9b34ae11540a14ab Mon Sep 17 00:00:00 2001 From: AliveShiro Date: Mon, 28 May 2012 19:18:03 +0200 Subject: [PATCH 0862/1149] Core/Scripts: Fix Anub'arak spikes in Trial of the Crusader now they only attack players. Thanks to Warpten who brought the Idea and thanks to Nayd :) --- .../TrialOfTheCrusader/boss_anubarak_trial.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index f329b940e1f..1934efa1cbf 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -659,6 +659,11 @@ public: m_uiTargetGUID = 0; } + bool CanAIAttack(Unit const* victim) const + { + return victim->GetTypeId() == TYPEID_PLAYER; + } + void EnterCombat(Unit* who) { m_uiTargetGUID = who->GetGUID(); From 3fff4c9e96eb0114254612aa13f1734e33cebf21 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 28 May 2012 19:21:07 +0100 Subject: [PATCH 0863/1149] DB/NPC: Delete forgotten data from creature_addon Closes #6619 --- sql/updates/world/2012_05_28_06_world_creature_addon.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_05_28_06_world_creature_addon.sql diff --git a/sql/updates/world/2012_05_28_06_world_creature_addon.sql b/sql/updates/world/2012_05_28_06_world_creature_addon.sql new file mode 100644 index 00000000000..a2b573da10a --- /dev/null +++ b/sql/updates/world/2012_05_28_06_world_creature_addon.sql @@ -0,0 +1,2 @@ +-- Delete forgotten data from creature_addon +DELETE FROM `creature_addon` WHERE `guid` IN (207262,207257,207254,207251,207246,207243,207241,207237); From 642cf04776784b98c7a4c4a18433b7d642199062 Mon Sep 17 00:00:00 2001 From: qaywsx Date: Mon, 28 May 2012 21:42:32 +0200 Subject: [PATCH 0864/1149] DB/Quest: Correct Quest chaining and requirements up until the quest "Crusader's Pinnacle" thx to thesensei for DK additions --- .../2012_05_28_07_world_quest_template.sql | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 sql/updates/world/2012_05_28_07_world_quest_template.sql diff --git a/sql/updates/world/2012_05_28_07_world_quest_template.sql b/sql/updates/world/2012_05_28_07_world_quest_template.sql new file mode 100644 index 00000000000..3cdf1895a9d --- /dev/null +++ b/sql/updates/world/2012_05_28_07_world_quest_template.sql @@ -0,0 +1,20 @@ +-- Correct Quest chaining and requirements up until the quest "Crusader's Pinnacle", when the Argent Base in the pinnacle phases in +UPDATE `quest_template` SET `PrevQuestId`=13036, `NextQuestId`=13044, `ExclusiveGroup`=-13008 WHERE `id`=13008; -- Scourge Tactics +UPDATE `quest_template` SET `PrevQuestId`=13036, `NextQuestId`=13044, `ExclusiveGroup`=-13008 WHERE `id`=13039; -- Defending The Vanguard +UPDATE `quest_template` SET `PrevQuestId`=13036, `NextQuestId`=13044, `ExclusiveGroup`=-13008 WHERE `id`=13040; -- Curing The Incurable +UPDATE `quest_template` SET `PrevQuestId`=0, `NextQuestId`=13045, `ExclusiveGroup`=0, `NextQuestIdChain`=13045 WHERE `id`=13044; -- If There Are Survivors +UPDATE `quest_template` SET `PrevQuestId`=13044, `NextQuestId`=13070, `ExclusiveGroup`=0, `NextQuestIdChain`=13070 WHERE `id`=13045; -- Into The Wild Green Yonder +UPDATE `quest_template` SET `Method`=0, `PrevQuestId`=13045, `NextQuestId`=13086, `ExclusiveGroup`=0, `NextQuestIdChain`=13086 WHERE `id`=13070; -- A Cold Front Approaches +UPDATE `quest_template` SET `PrevQuestId`=13070, `NextQuestId`=0, `ExclusiveGroup`=0, `NextQuestidChain`=0 WHERE `id`=13086; -- The Last Line Of Defense +-- Fix restrictions for DK and all rest classes without DK +UPDATE `quest_template` SET `PrevQuestId`=13086, `RequiredClasses`=32,`NextQuestId`=0, `ExclusiveGroup`=0, `NextQuestIdChain`=0 WHERE `id`=13104; -- Once More Unto The Breach, Hero /Death Knight's Special/ +UPDATE `quest_template` SET `PrevQuestId`=13086, `RequiredClasses`=1502,`NextQuestId`=0, `ExclusiveGroup`=0, `NextQuestIdChain`=0 WHERE `id`=13105; -- Once More Unto The Breach, Hero +UPDATE `quest_template` SET `PrevQuestId`=13104, `NextQuestId`=13139, `ExclusiveGroup`=-13122, `NextQuestIdChain`=0 WHERE `id`=13122; -- The Scourgestone +UPDATE `quest_template` SET `PrevQuestId`=13104, `NextQuestId`=13139, `ExclusiveGroup`=-13122, `NextQuestIdChain`=0 WHERE `id`=13118; -- The Purging of Scourgeholme +UPDATE `quest_template` SET `PrevQuestId`=13104, `NextQuestId`=13139, `ExclusiveGroup`=-13122, `NextQuestIdChain`=0 WHERE `id`=13110; -- The Restless Dead +UPDATE `quest_template` SET `PrevQuestId`=13104, `NextQuestId`=13139, `ExclusiveGroup`=-13122, `NextQuestIdChain`=0 WHERE `id`=13125; -- The Air Stands Still +UPDATE `quest_template` SET `PrevQuestId`=13104, `NextQuestId`=13139, `ExclusiveGroup`=-13122, `NextQuestIdChain`=0 WHERE `id`=13130; -- The Stone That Started a Revolution +UPDATE `quest_template` SET `PrevQuestId`=13104, `NextQuestId`=13139, `ExclusiveGroup`=-13122, `NextQuestIdChain`=0 WHERE `id`=13135; -- It Could Kill Us All +UPDATE `quest_template` SET `PrevQuestId`=0, `NextQuestId`=13141, `ExclusiveGroup`=0, `NextQuestIdChain`=13141 WHERE `id`=13139; -- Into The Cold Heart Of Northrend +UPDATE `quest_template` SET `PrevQuestId`=13139, `NextQuestId`=13157, `ExclusiveGroup`=0, `NextQuestIdChain`=13157 WHERE `id`=13141; -- The Battle For Crusader`s Pinnacle +UPDATE `quest_template` SET `PrevQuestId`=13141, `NextQuestId`=0, `ExclusiveGroup`=0, `NextQuestIdChain`=0 WHERE `id`=13135; -- The Crusader's Pinnacle From e83f913fc501a84d57bb96b308a747e4fce468cb Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 28 May 2012 22:16:47 +0100 Subject: [PATCH 0865/1149] Core/Spells: Ignore LoS when spells are cast/triggered by gameobjects ... and this is why you shouldn't use the so called hacks. You will just keep adding sh*t on top of more sh*t (like this). Currently, GO spell casts spawn an invisible WORLD_TRIGGER (npc 12999) inside of the gameobject (for certain forms of gameobjects) (and this is why the LoS check was failing). It shouldn't be like that. GOs should be able to cast the spells without having to spawn an auxiliary creature. Fixes "Eye of Acherus" and others --- src/server/game/Entities/GameObject/GameObject.cpp | 2 +- src/server/game/Spells/Spell.cpp | 7 +++---- src/server/game/Spells/SpellMgr.h | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 10136c5fbd7..eb10a1f54b1 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -1674,7 +1674,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId) else { trigger->setFaction(14); - // Set owner guid for target if no owner avalible - needed by trigger auras + // Set owner guid for target if no owner available - needed by trigger auras // - trigger gets despawned and there's no caster avalible (see AuraEffect::TriggerSpell()) trigger->CastSpell(target ? target : trigger, spellInfo, true, 0, 0, target ? target->GetGUID() : 0); } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index de432229e2c..58a89f75fd3 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -585,9 +585,7 @@ m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharme CleanupEffectExecuteData(); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - { m_destTargets[i] = SpellDestination(*m_caster); - } } Spell::~Spell() @@ -4837,8 +4835,9 @@ SpellCastResult Spell::CheckCast(bool strict) if ((m_spellInfo->AttributesCu & SPELL_ATTR0_CU_REQ_TARGET_FACING_CASTER) && !target->HasInArc(static_cast(M_PI), m_caster)) return SPELL_FAILED_NOT_INFRONT; - if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target)) - return SPELL_FAILED_LINE_OF_SIGHT; + if (m_caster->GetEntry() != WORLD_TRIGGER) // Ignore LOS for gameobjects casts (wrongly casted by a trigger) + if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target)) + return SPELL_FAILED_LINE_OF_SIGHT; } else { diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 521070f7879..dcf3c38fe4f 100755 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -605,7 +605,7 @@ class SpellMgr // Accessors (const or static functions) public: - // Spell correctess for client using + // Spell correctness for client using static bool IsSpellValid(SpellInfo const* spellInfo, Player* player = NULL, bool msg = true); // Spell difficulty From 013fe44b9229469e142bd152b43e80841dc9cb0e Mon Sep 17 00:00:00 2001 From: Discover- Date: Tue, 29 May 2012 12:19:46 +0200 Subject: [PATCH 0866/1149] Core/SAI: Implement SMART_ACTION_SET_RANGED_MOVEMENT (79) and SMART_ACTION_SET_STAND_STATE (101). Updated wiki accordingly. These were required in order to properly be able to convert EventAI to SmartAI. --- src/server/game/AI/SmartScripts/SmartAI.h | 2 +- .../game/AI/SmartScripts/SmartScript.cpp | 27 +++++++++++++++++++ .../game/AI/SmartScripts/SmartScriptMgr.h | 16 +++++++++-- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h index bfd1c7b9d41..435aa176d4d 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.h +++ b/src/server/game/AI/SmartScripts/SmartAI.h @@ -62,6 +62,7 @@ class SmartAI : public CreatureAI void RemoveEscortState(uint32 uiEscortState) { mEscortState &= ~uiEscortState; } void SetAutoAttack(bool on) { mCanAutoAttack = on; } void SetCombatMove(bool on); + bool CanCombatMove() { return mCanCombatMove; } void SetFollow(Unit* target, float dist = 0.0f, float angle = 0.0f, uint32 credit = 0, uint32 end = 0, uint32 creditType = 0); void SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker); @@ -224,7 +225,6 @@ class SmartAI : public CreatureAI bool mCanCombatMove; bool mForcedPaused; uint32 mInvincibilityHpLevel; - bool AssistPlayerInCombat(Unit* who); uint32 mDespawnTime; diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 85b117ccd8c..bb5b54829b8 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1534,6 +1534,15 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_CALL_SCRIPT_RESET: OnReset(); break; + case SMART_ACTION_SET_RANGED_MOVEMENT: + { + float attackDistance = (float)e.action.setRangedMovement.distance; + float attackAngle = e.action.setRangedMovement.angle / 180.0f * M_PI; + + if (CAST_AI(SmartAI, me->AI())->CanCombatMove()) + me->GetMotionMaster()->MoveChase(me->getVictim(), attackDistance, attackAngle); + break; + } case SMART_ACTION_CALL_TIMED_ACTIONLIST: { if (e.GetTargetType() == SMART_TARGET_NONE) @@ -1924,6 +1933,24 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u delete targets; break; } + case SMART_ACTION_SET_STAND_STATE: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsUnit(*itr)) + { + (*itr)->ToUnit()->SetStandState(e.action.setStandState.standState); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_EMOTE_STATE. Unit %u set standstate to %u", (*itr)->GetGUIDLow(), e.action.emote.emote); + } + } + + delete targets; + break; + } default: sLog->outErrorDb("SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); break; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index bde7768f036..7efc137205e 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -451,7 +451,7 @@ enum SMART_ACTION SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT = 76, // WARNING: CAN CRASH CORE, do not use if you dont know what you are doing SMART_ACTION_RESET_SCRIPT_BASE_OBJECT = 77, // none SMART_ACTION_CALL_SCRIPT_RESET = 78, // none - // Unused = 79, + SMART_ACTION_SET_RANGED_MOVEMENT = 79, // Distance, angle SMART_ACTION_CALL_TIMED_ACTIONLIST = 80, // ID (overwrites already running actionlist), stop after combat?(0/1), timer update type(0-OOC, 1-IC, 2-ALWAYS) SMART_ACTION_SET_NPC_FLAG = 81, // Flags SMART_ACTION_ADD_NPC_FLAG = 82, // Flags @@ -473,8 +473,9 @@ enum SMART_ACTION SMART_ACTION_SEND_GOSSIP_MENU = 98, // menuId, optionId SMART_ACTION_GO_SET_LOOT_STATE = 99, // state SMART_ACTION_SEND_TARGET_TO_TARGET = 100, // id + SMART_ACTION_SET_STAND_STATE = 101, // standState - SMART_ACTION_END = 101, + SMART_ACTION_END = 102, }; struct SmartAction @@ -893,6 +894,17 @@ struct SmartAction uint32 id; } sendTargetToTarget; + struct + { + uint32 standState; + } setStandState; + + struct + { + float distance; + float angle; + } setRangedMovement; + struct { uint32 param1; From 154a030a68672ab8ec22a78f2a91d63ef3607b32 Mon Sep 17 00:00:00 2001 From: Discover- Date: Tue, 29 May 2012 12:29:10 +0200 Subject: [PATCH 0867/1149] Core/SAI: Fix previous commit. Thanks Shauren for notifying. --- src/server/game/AI/SmartScripts/SmartScript.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index bb5b54829b8..9a562e3f6c4 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1536,11 +1536,23 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; case SMART_ACTION_SET_RANGED_MOVEMENT: { + if (!IsSmart()) + break; + float attackDistance = (float)e.action.setRangedMovement.distance; float attackAngle = e.action.setRangedMovement.angle / 180.0f * M_PI; - if (CAST_AI(SmartAI, me->AI())->CanCombatMove()) - me->GetMotionMaster()->MoveChase(me->getVictim(), attackDistance, attackAngle); + ObjectList* targets = GetTargets(e, unit); + if (targets) + { + for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (Creature* target = (*itr)->ToCreature()) + if (IsSmart(target) && target->getVictim()) + if (CAST_AI(SmartAI, target->AI())->CanCombatMove()) + target->GetMotionMaster()->MoveChase(target->getVictim(), attackDistance, attackAngle); + + delete targets; + } break; } case SMART_ACTION_CALL_TIMED_ACTIONLIST: From 1b77fd45fa5f3eb34ef8c6c462bfcbe2e7d8a9a1 Mon Sep 17 00:00:00 2001 From: Discover- Date: Wed, 30 May 2012 01:00:55 +0200 Subject: [PATCH 0868/1149] Core/SAI: Revert SMART_ACTION_SET_STAND_STATE from 013fe44b9229469e142bd152b43e80841dc9cb0e, can be done with SMART_ACTION_SET_UNIT_FIELD_BYTES_1. --- .../game/AI/SmartScripts/SmartScript.cpp | 18 ------------------ .../game/AI/SmartScripts/SmartScriptMgr.h | 8 +------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 9a562e3f6c4..01a9b777358 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1945,24 +1945,6 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u delete targets; break; } - case SMART_ACTION_SET_STAND_STATE: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsUnit(*itr)) - { - (*itr)->ToUnit()->SetStandState(e.action.setStandState.standState); - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_EMOTE_STATE. Unit %u set standstate to %u", (*itr)->GetGUIDLow(), e.action.emote.emote); - } - } - - delete targets; - break; - } default: sLog->outErrorDb("SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); break; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 7efc137205e..c23e288f66d 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -473,9 +473,8 @@ enum SMART_ACTION SMART_ACTION_SEND_GOSSIP_MENU = 98, // menuId, optionId SMART_ACTION_GO_SET_LOOT_STATE = 99, // state SMART_ACTION_SEND_TARGET_TO_TARGET = 100, // id - SMART_ACTION_SET_STAND_STATE = 101, // standState - SMART_ACTION_END = 102, + SMART_ACTION_END = 101, }; struct SmartAction @@ -894,11 +893,6 @@ struct SmartAction uint32 id; } sendTargetToTarget; - struct - { - uint32 standState; - } setStandState; - struct { float distance; From 3f4fbf7c9bfa449607a4c7444095c5a52d6bd2f4 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Wed, 30 May 2012 23:11:51 +0200 Subject: [PATCH 0869/1149] DB/Loot: re-assign Gunship 10N reference Closes #6648 --- ...05_30_00_world_reference_loot_template.sql | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 sql/updates/world/2012_05_30_00_world_reference_loot_template.sql diff --git a/sql/updates/world/2012_05_30_00_world_reference_loot_template.sql b/sql/updates/world/2012_05_30_00_world_reference_loot_template.sql new file mode 100644 index 00000000000..7c6dfa1e11f --- /dev/null +++ b/sql/updates/world/2012_05_30_00_world_reference_loot_template.sql @@ -0,0 +1,36 @@ +SET @Twins := 34329; +DELETE FROM `reference_loot_template` WHERE `entry`=@Twins; +INSERT INTO `reference_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES +(@Twins,47296,0,1,1,1,1), -- Greaves of Ruthless Judgment +(@Twins,47297,0,1,1,1,1), -- The Executioner's Vice +(@Twins,47298,0,1,1,1,1), -- Armguards of the Shieldmaiden +(@Twins,47299,0,1,1,1,1), -- Belt of the Pitiless Killer +(@Twins,47300,0,1,1,1,1), -- Gouge of the Frigid Heart +(@Twins,47301,0,1,1,1,1), -- Skyweaver Vestments +(@Twins,47302,0,1,1,1,1), -- Twin's Pact +(@Twins,47303,0,1,1,1,1), -- Death's Choice +(@Twins,47304,0,1,1,1,1), -- Legplates of Ascension +(@Twins,47305,0,1,1,1,1); -- Legionnaire's Gorget +SET @Gunship10N := 28057; -- Data1 for 201872 & 202177 +SET @Ref10J := 12036; +-- Gunship_Armory10N_reference +DELETE FROM `reference_loot_template` WHERE `entry`=@Ref10J; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@Ref10J,50791,0,1,1,1,1), -- Saronite Gargoyle Cloak +(@Ref10J,50795,0,1,1,1,1), -- Cord of Dark Suffering +(@Ref10J,50794,0,1,1,1,1), -- Neverending Winter +(@Ref10J,50787,0,1,1,1,1), -- Frost Giant's Cleaver +(@Ref10J,50793,0,1,1,1,1), -- Midnight Sun +(@Ref10J,50788,0,1,1,1,1), -- Bone Drake's Enameled Boots +(@Ref10J,50792,0,1,1,1,1), -- Pauldrons of Lost Hope +(@Ref10J,50340,0,1,1,1,1), -- Muradin's Spyglass +(@Ref10J,50797,0,1,1,1,1), -- Ice-Reinforced Vrykul Helm +(@Ref10J,50790,0,1,1,1,1), -- Abomination's Bloody Ring +(@Ref10J,50789,0,1,1,1,1), -- Icecrown Rampart Bracers +(@Ref10J,50796,0,1,1,1,1); -- Bracers of Pale Illumination +-- Bind the refs to the objects +DELETE FROM `gameobject_loot_template` WHERE `entry`=@Gunship10N; +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Gunship10N +(@Gunship10N,@emblem,100,1,0,2,2), -- Gunship Armory 2xemblems 10N +(@Gunship10N,1,100,1,0,-@Ref10J,2); -- 2 from reference 10Normal From 3967d57004db3fee1a000ff45da1399561aa4a5f Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Wed, 30 May 2012 23:14:49 +0200 Subject: [PATCH 0870/1149] DB/Creature: Add some VehicleId info from sniffs&UDB thx Faq for the comparison with UDB, PitCrawler for the additional sniffs Closes #6196 --- .../2012_05_30_01_world_creature_template.sql | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sql/updates/world/2012_05_30_01_world_creature_template.sql diff --git a/sql/updates/world/2012_05_30_01_world_creature_template.sql b/sql/updates/world/2012_05_30_01_world_creature_template.sql new file mode 100644 index 00000000000..4b469a13891 --- /dev/null +++ b/sql/updates/world/2012_05_30_01_world_creature_template.sql @@ -0,0 +1,76 @@ +-- Missing Vehicle_Id's from UDB +UPDATE `creature_template` SET `VehicleId`=22 WHERE `entry`=24806; +UPDATE `creature_template` SET `VehicleId`=22 WHERE `entry`=24821; +UPDATE `creature_template` SET `VehicleId`=22 WHERE `entry`=24823; +UPDATE `creature_template` SET `VehicleId`=22 WHERE `entry`=24825; +UPDATE `creature_template` SET `VehicleId`=35 WHERE `entry`=26586; +UPDATE `creature_template` SET `VehicleId`=35 WHERE `entry`=26590; +UPDATE `creature_template` SET `VehicleId`=42 WHERE `entry`=27061; +UPDATE `creature_template` SET `VehicleId`=80 WHERE `entry`=27886; +UPDATE `creature_template` SET `VehicleId`=88 WHERE `entry`=27923; +UPDATE `creature_template` SET `VehicleId`=90 WHERE `entry`=27932; +UPDATE `creature_template` SET `VehicleId`=134 WHERE `entry`=28115; +UPDATE `creature_template` SET `VehicleId`=152 WHERE `entry`=28182; +UPDATE `creature_template` SET `VehicleId`=118 WHERE `entry`=28399; +UPDATE `creature_template` SET `VehicleId`=121 WHERE `entry`=28468; +UPDATE `creature_template` SET `VehicleId`=126 WHERE `entry`=28665; +UPDATE `creature_template` SET `VehicleId`=138 WHERE `entry`=28817; +UPDATE `creature_template` SET `VehicleId`=146 WHERE `entry`=28875; +UPDATE `creature_template` SET `VehicleId`=148 WHERE `entry`=28985; +UPDATE `creature_template` SET `VehicleId`=148 WHERE `entry`=28999; +UPDATE `creature_template` SET `VehicleId`=149 WHERE `entry`=29005; +UPDATE `creature_template` SET `VehicleId`=179 WHERE `entry`=29579; +UPDATE `creature_template` SET `VehicleId`=186 WHERE `entry`=29677; +UPDATE `creature_template` SET `VehicleId`=197 WHERE `entry`=29754; +UPDATE `creature_template` SET `VehicleId`=203 WHERE `entry`=29863; +UPDATE `creature_template` SET `VehicleId`=216 WHERE `entry`=30108; +UPDATE `creature_template` SET `VehicleId`=231 WHERE `entry`=30331; +UPDATE `creature_template` SET `VehicleId`=240 WHERE `entry`=30487; +UPDATE `creature_template` SET `VehicleId`=257 WHERE `entry`=30895; +UPDATE `creature_template` SET `VehicleId`=258 WHERE `entry`=31050; +UPDATE `creature_template` SET `VehicleId`=259 WHERE `entry`=31110; +UPDATE `creature_template` SET `VehicleId`=262 WHERE `entry`=31125; +UPDATE `creature_template` SET `VehicleId`=264 WHERE `entry`=31157; +UPDATE `creature_template` SET `VehicleId`=287 WHERE `entry`=31838; +UPDATE `creature_template` SET `VehicleId`=315 WHERE `entry`=31857; +UPDATE `creature_template` SET `VehicleId`=315 WHERE `entry`=31858; +UPDATE `creature_template` SET `VehicleId`=315 WHERE `entry`=31861; +UPDATE `creature_template` SET `VehicleId`=315 WHERE `entry`=31862; +UPDATE `creature_template` SET `VehicleId`=296 WHERE `entry`=32198; +UPDATE `creature_template` SET `VehicleId`=296 WHERE `entry`=32208; +UPDATE `creature_template` SET `VehicleId`=302 WHERE `entry`=32348; +UPDATE `creature_template` SET `VehicleId`=305 WHERE `entry`=32483; +UPDATE `creature_template` SET `VehicleId`=295 WHERE `entry`=32511; +UPDATE `creature_template` SET `VehicleId`=287 WHERE `entry`=32513; +UPDATE `creature_template` SET `VehicleId`=308 WHERE `entry`=32535; +UPDATE `creature_template` SET `VehicleId`=313 WHERE `entry`=32640; +UPDATE `creature_template` SET `VehicleId`=90 WHERE `entry`=32682; +UPDATE `creature_template` SET `VehicleId`=347 WHERE `entry`=33108; +UPDATE `creature_template` SET `VehicleId`=356 WHERE `entry`=33364; +UPDATE `creature_template` SET `VehicleId`=357 WHERE `entry`=33366; +UPDATE `creature_template` SET `VehicleId`=358 WHERE `entry`=33369; +UPDATE `creature_template` SET `VehicleId`=370 WHERE `entry`=33432; +UPDATE `creature_template` SET `VehicleId`=371 WHERE `entry`=33651; +UPDATE `creature_template` SET `VehicleId`=373 WHERE `entry`=33670; +UPDATE `creature_template` SET `VehicleId`=392 WHERE `entry`=34146; +UPDATE `creature_template` SET `VehicleId`=395 WHERE `entry`=34150; +UPDATE `creature_template` SET `VehicleId`=396 WHERE `entry`=34151; +UPDATE `creature_template` SET `VehicleId`=399 WHERE `entry`=34183; +UPDATE `creature_template` SET `VehicleId`=435 WHERE `entry`=34776; +UPDATE `creature_template` SET `VehicleId`=514 WHERE `entry`=35069; +UPDATE `creature_template` SET `VehicleId`=548 WHERE `entry`=36812; +UPDATE `creature_template` SET `VehicleId`=615 WHERE `entry`=37980; +UPDATE `creature_template` SET `VehicleId`=647 WHERE `entry`=38711; +UPDATE `creature_template` SET `VehicleId`=648 WHERE `entry`=38712; +UPDATE `creature_template` SET `VehicleId`=700 WHERE `entry`=39682; +UPDATE `creature_template` SET `VehicleId`=753 WHERE `entry`=39759; +UPDATE `creature_template` SET `VehicleId`=763 WHERE `entry`=39819; +UPDATE `creature_template` SET `VehicleId`=711 WHERE `entry`=39860; +UPDATE `creature_template` SET `VehicleId`=747 WHERE `entry`=40479; +UPDATE `creature_template` SET `VehicleId`=604 WHERE `entry`=37827; +UPDATE `creature_template` SET `VehicleId`=610 WHERE `entry`=37952; +-- From PitCrawler +UPDATE `creature_template` SET `vehicleId`=202 WHERE `entry`=29903; -- Frostbite +UPDATE `creature_template` SET `vehicleId`=241 WHERE `entry`=30388; -- Stormhoof +UPDATE `creature_template` SET `vehicleId`=25 WHERE `entry`=25194; -- Kor'kron Riding Wolf +UPDATE `creature_template` SET `vehicleId`=108 WHERE `entry`=28639; -- Heb'Jin's Bat From 10314f913ae29728b4e1e6568608dc23cb9a86c7 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 30 May 2012 20:08:28 -0230 Subject: [PATCH 0871/1149] DB/quest_template: Fixing Required Races on Quests 8553 and 8554 to allow for Alliance completion. By warriorpoetex Closes Issue #6629 --- sql/updates/world/2012_05_30_02_world_quest_template.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/2012_05_30_02_world_quest_template.sql diff --git a/sql/updates/world/2012_05_30_02_world_quest_template.sql b/sql/updates/world/2012_05_30_02_world_quest_template.sql new file mode 100644 index 00000000000..2b829aa0875 --- /dev/null +++ b/sql/updates/world/2012_05_30_02_world_quest_template.sql @@ -0,0 +1,5 @@ +-- Fixing Required Races on Quests 8553 and 8554 to allow for Alliance completion +UPDATE `quest_template` SET `RequiredRaces`=0 WHERE `id`=8554; +UPDATE `quest_template` SET `RequiredRaces`=0 WHERE `id`=8553; +-- Fixing Next Quest for Quest 8552 +UPDATE `quest_template` SET `NextQuestIDChain`=8553 WHERE `id`=8552; From 1c73fa3649322a85e7f2aacb051c25527fb7a390 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 30 May 2012 20:12:58 -0230 Subject: [PATCH 0872/1149] DB/creature_formations: Set Fel Steed Formation/Group Combat Assistance Fix by warriorpoetex. Closes issue #6629 --- .../world/2012_05_30_03_world_creature_formation.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sql/updates/world/2012_05_30_03_world_creature_formation.sql diff --git a/sql/updates/world/2012_05_30_03_world_creature_formation.sql b/sql/updates/world/2012_05_30_03_world_creature_formation.sql new file mode 100644 index 00000000000..2964415e85b --- /dev/null +++ b/sql/updates/world/2012_05_30_03_world_creature_formation.sql @@ -0,0 +1,6 @@ +-- Set Fel Steed Formation/Group Combat Assistance +DELETE FROM `creature_formations` WHERE `leaderGUID`=16441; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(16441,16441,0,0,2), +(16441,16442,10,225,2), +(16441,16440,10,120,2); From e2302d2cc78319dac9fa200acb61dbec1d403f94 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 30 May 2012 20:15:56 -0230 Subject: [PATCH 0873/1149] DB/gossip: Add missing gossip for Book "Soothsaying for Dummies" Closes Issue #6652 --- sql/updates/world/2012_05_30_04_world_gossip.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2012_05_30_04_world_gossip.sql diff --git a/sql/updates/world/2012_05_30_04_world_gossip.sql b/sql/updates/world/2012_05_30_04_world_gossip.sql new file mode 100644 index 00000000000..0abbea7b964 --- /dev/null +++ b/sql/updates/world/2012_05_30_04_world_gossip.sql @@ -0,0 +1,3 @@ +-- Add missing gossip for Book "Soothsaying for Dummies" +DELETE FROM `gossip_menu` WHERE `entry`=7058; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (7058,8321); From 7d4d296e2f60b2d42fe51b92b666238d4513bbd1 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 30 May 2012 22:55:30 -0230 Subject: [PATCH 0874/1149] DB?Gossip: Bladesedge Mountains gossips By Pitcrawler the awesome --- .../world/2012_05_30_05_world_gossip.sql | 429 ++++++++++++++++++ 1 file changed, 429 insertions(+) create mode 100644 sql/updates/world/2012_05_30_05_world_gossip.sql diff --git a/sql/updates/world/2012_05_30_05_world_gossip.sql b/sql/updates/world/2012_05_30_05_world_gossip.sql new file mode 100644 index 00000000000..37c7586cd60 --- /dev/null +++ b/sql/updates/world/2012_05_30_05_world_gossip.sql @@ -0,0 +1,429 @@ +-- Creature Gossip_menu_id Update from sniff +UPDATE `creature_template` SET `gossip_menu_id`=8388 WHERE `entry`=21118; -- Razak Ironsides +UPDATE `creature_template` SET `gossip_menu_id`=8306 WHERE `entry`=21494; -- Smiles O'Byron +UPDATE `creature_template` SET `gossip_menu_id`=8385 WHERE `entry`=21824; -- Dizzy Dina +UPDATE `creature_template` SET `gossip_menu_id`=8303 WHERE `entry`=21460; -- Tally Zapnabber +UPDATE `creature_template` SET `gossip_menu_id`=8304 WHERE `entry`=21461; -- Rally Zapnabber +UPDATE `creature_template` SET `gossip_menu_id`=8351 WHERE `entry`=21690; -- R-3D0 +UPDATE `creature_template` SET `gossip_menu_id`=8370 WHERE `entry`=21755; -- Nickwinkle the Metro-Gnome +UPDATE `creature_template` SET `gossip_menu_id`=8429 WHERE `entry`=21981; -- Overseer Nuaar +UPDATE `creature_template` SET `gossip_menu_id`=8432 WHERE `entry`=21983; -- Samia Inkling +UPDATE `creature_template` SET `gossip_menu_id`=8431 WHERE `entry`=22007; -- Tree Warden Chawn +UPDATE `creature_template` SET `gossip_menu_id`=8436 WHERE `entry`=22019; -- Kolphis Darkscale +UPDATE `creature_template` SET `gossip_menu_id`=8447 WHERE `entry`=22020; -- O'Mally Zapnabber +UPDATE `creature_template` SET `gossip_menu_id`=8508 WHERE `entry`=22053; -- Mosswood the Ancient +UPDATE `creature_template` SET `gossip_menu_id`=8490 WHERE `entry`=22099; -- Wyrmcult Provisioner +UPDATE `creature_template` SET `gossip_menu_id`=8491 WHERE `entry`=22103; -- Baron Sablemane +UPDATE `creature_template` SET `gossip_menu_id`=8523 WHERE `entry`=22127; -- Wildlord Antelarion +UPDATE `creature_template` SET `gossip_menu_id`=8496 WHERE `entry`=22149; -- Commander Haephus Stonewall +UPDATE `creature_template` SET `gossip_menu_id`=8506 WHERE `entry`=22215; -- Treebole +UPDATE `creature_template` SET `gossip_menu_id`=8723 WHERE `entry`=22264; -- Ogri'la Steelshaper +UPDATE `creature_template` SET `gossip_menu_id`=8717, `npcflag`=`npcflag`|1 WHERE `entry`=22266; -- Food Vendor +UPDATE `creature_template` SET `gossip_menu_id`=8716, `npcflag`=`npcflag`|1 WHERE `entry`=22270; -- Ogri'la Merchant +UPDATE `creature_template` SET `gossip_menu_id`=8722, `npcflag`=`npcflag`|1 WHERE `entry`=22271; -- Ogri'la Trader +UPDATE `creature_template` SET `gossip_menu_id`=8529 WHERE `entry`=22386; -- Watcher Moonshade +UPDATE `creature_template` SET `gossip_menu_id`=8615 WHERE `entry`=22924; -- Arthorn Windsong +UPDATE `creature_template` SET `gossip_menu_id`=8620 WHERE `entry`=22941; -- Mog'dorg the Wizened +UPDATE `creature_template` SET `gossip_menu_id`=8657 WHERE `entry`=22995; -- Chort +UPDATE `creature_template` SET `gossip_menu_id`=8753 WHERE `entry`=23038; -- Sky Commander Adaris +UPDATE `creature_template` SET `gossip_menu_id`=8630 WHERE `entry`=23048; -- Sky Sergeant Doryn +UPDATE `creature_template` SET `gossip_menu_id`=8640, `npcflag`=`npcflag`|1 WHERE `entry`=23052; -- Bloodmaul Supplicant +UPDATE `creature_template` SET `gossip_menu_id`=8640, `npcflag`=`npcflag`|1 WHERE `entry`=23053; -- Bladespire Supplicant +UPDATE `creature_template` SET `gossip_menu_id`=8721, `npcflag`=`npcflag`|1 WHERE `entry`=23110; -- Ogri'la Keg King +UPDATE `creature_template` SET `gossip_menu_id`=8724 WHERE `entry`=23112; -- Mingo +UPDATE `creature_template` SET `gossip_menu_id`=8642, `npcflag`=`npcflag`|1 WHERE `entry`=23120; -- Sky Sergeant Vanderlip +UPDATE `creature_template` SET `gossip_menu_id`=8737 WHERE `entry`=23208; -- Skyguard Pyrotechnician +UPDATE `creature_template` SET `gossip_menu_id`=8679 WHERE `entry`=23253; -- Kronk +UPDATE `creature_template` SET `gossip_menu_id`=8667 WHERE `entry`=23306; -- Hazzik +UPDATE `creature_template` SET `gossip_menu_id`=8670 WHERE `entry`=23335; -- Skyguard Khatie +UPDATE `creature_template` SET `gossip_menu_id`=8683 WHERE `entry`=23363; -- Sahaak +UPDATE `creature_template` SET `gossip_menu_id`=8718 WHERE `entry`=23413; -- Skyguard Handler Irena +UPDATE `creature_template` SET `gossip_menu_id`=8719 WHERE `entry`=23415; -- Skyguard Handler Deesak +UPDATE `creature_template` SET `gossip_menu_id`=8726 WHERE `entry`=23428; -- Jho'nass +UPDATE `creature_template` SET `gossip_menu_id`=8736 WHERE `entry`=23473; -- Aether-tech Apprentice + +-- Gossip Menu insert from sniff +DELETE FROM `gossip_menu` WHERE `entry`=8303 AND `text_id` IN (10359,10569); +DELETE FROM `gossip_menu` WHERE `entry`=8304 AND `text_id` IN (10360,10537); +DELETE FROM `gossip_menu` WHERE `entry`=8306 AND `text_id`=10410; +DELETE FROM `gossip_menu` WHERE `entry`=8343 AND `text_id`=10363; +DELETE FROM `gossip_menu` WHERE `entry`=8351 AND `text_id`=10422; +DELETE FROM `gossip_menu` WHERE `entry`=8370 AND `text_id`=10444; +DELETE FROM `gossip_menu` WHERE `entry`=8385 AND `text_id`=10466; +DELETE FROM `gossip_menu` WHERE `entry`=8388 AND `text_id`=10469; +DELETE FROM `gossip_menu` WHERE `entry`=8429 AND `text_id`=10532; +DELETE FROM `gossip_menu` WHERE `entry`=8430 AND `text_id`=10533; +DELETE FROM `gossip_menu` WHERE `entry`=8431 AND `text_id`=10534; +DELETE FROM `gossip_menu` WHERE `entry`=8432 AND `text_id`=10538; +DELETE FROM `gossip_menu` WHERE `entry`=8435 AND `text_id`=10541; +DELETE FROM `gossip_menu` WHERE `entry`=8436 AND `text_id`=10539; +DELETE FROM `gossip_menu` WHERE `entry`=8437 AND `text_id`=10542; +DELETE FROM `gossip_menu` WHERE `entry`=8438 AND `text_id`=10543; +DELETE FROM `gossip_menu` WHERE `entry`=8439 AND `text_id`=10544; +DELETE FROM `gossip_menu` WHERE `entry`=8440 AND `text_id`=10545; +DELETE FROM `gossip_menu` WHERE `entry`=8447 AND `text_id`=10554; +DELETE FROM `gossip_menu` WHERE `entry`=8454 AND `text_id`=10561; +DELETE FROM `gossip_menu` WHERE `entry`=8455 AND `text_id`=10562; +DELETE FROM `gossip_menu` WHERE `entry`=8490 AND `text_id`=10602; +DELETE FROM `gossip_menu` WHERE `entry`=8491 AND `text_id`=10603; +DELETE FROM `gossip_menu` WHERE `entry`=8496 AND `text_id`=10612; +DELETE FROM `gossip_menu` WHERE `entry`=8506 AND `text_id`=10637; +DELETE FROM `gossip_menu` WHERE `entry`=8508 AND `text_id`=10640; +DELETE FROM `gossip_menu` WHERE `entry`=8523 AND `text_id`=10657; +DELETE FROM `gossip_menu` WHERE `entry`=8529 AND `text_id`=10667; +DELETE FROM `gossip_menu` WHERE `entry`=8615 AND `text_id`=10793; +DELETE FROM `gossip_menu` WHERE `entry`=8620 AND `text_id` IN (10800,10860); +DELETE FROM `gossip_menu` WHERE `entry`=8630 AND `text_id`=10819; +DELETE FROM `gossip_menu` WHERE `entry`=8640 AND `text_id`=10838; +DELETE FROM `gossip_menu` WHERE `entry`=8642 AND `text_id` IN (10841,10992,10994,10995); +DELETE FROM `gossip_menu` WHERE `entry`=8657 AND `text_id` IN (10877,10878); +DELETE FROM `gossip_menu` WHERE `entry`=8660 AND `text_id` IN (10888,11057); +DELETE FROM `gossip_menu` WHERE `entry`=8667 AND `text_id`=10903; +DELETE FROM `gossip_menu` WHERE `entry`=8669 AND `text_id` IN (10906,10938,10988,10989,10990,10991); +DELETE FROM `gossip_menu` WHERE `entry`=8670 AND `text_id` IN (10907,10997,11001,11002,11004); +DELETE FROM `gossip_menu` WHERE `entry`=8671 AND `text_id` IN (10909,10951); +DELETE FROM `gossip_menu` WHERE `entry`=8672 AND `text_id` IN (10910,10922); +DELETE FROM `gossip_menu` WHERE `entry`=8674 AND `text_id`=10912; +DELETE FROM `gossip_menu` WHERE `entry`=8675 AND `text_id`=10915; +DELETE FROM `gossip_menu` WHERE `entry`=8678 AND `text_id` IN (10916,10917,10918,11013,11015,11018); +DELETE FROM `gossip_menu` WHERE `entry`=8679 AND `text_id` IN (10919,10920,11027,11028); +DELETE FROM `gossip_menu` WHERE `entry`=8680 AND `text_id` IN (10923,10924,10925,11019,11020,11021); +DELETE FROM `gossip_menu` WHERE `entry`=8681 AND `text_id` IN (10926,10927,11007,11009,11010,11011); +DELETE FROM `gossip_menu` WHERE `entry`=8683 AND `text_id`=10953; +DELETE FROM `gossip_menu` WHERE `entry`=8685 AND `text_id` IN (10931,10932); +DELETE FROM `gossip_menu` WHERE `entry`=8687 AND `text_id`=11058; +DELETE FROM `gossip_menu` WHERE `entry`=8689 AND `text_id` IN (10931,10932); +DELETE FROM `gossip_menu` WHERE `entry`=8690 AND `text_id` IN (10931,10932); +DELETE FROM `gossip_menu` WHERE `entry`=8691 AND `text_id` IN (10931,10932); +DELETE FROM `gossip_menu` WHERE `entry`=8716 AND `text_id` IN (10965,10966,10967,10968,10969); +DELETE FROM `gossip_menu` WHERE `entry`=8717 AND `text_id` IN (10972,10973,10974,10975,10976); +DELETE FROM `gossip_menu` WHERE `entry`=8718 AND `text_id` IN (10977,10978); +DELETE FROM `gossip_menu` WHERE `entry`=8719 AND `text_id` IN (10979,10980); +DELETE FROM `gossip_menu` WHERE `entry`=8721 AND `text_id` IN (10983,10984,10985,10986,10987); +DELETE FROM `gossip_menu` WHERE `entry`=8722 AND `text_id` IN (10993,10996,10998,10999,11000); +DELETE FROM `gossip_menu` WHERE `entry`=8723 AND `text_id` IN (11008,11012,11014,11016,11017); +DELETE FROM `gossip_menu` WHERE `entry`=8724 AND `text_id` IN (11022,11023,11024,11025,11026); +DELETE FROM `gossip_menu` WHERE `entry`=8726 AND `text_id` IN (11029,11036,11037,11038); +DELETE FROM `gossip_menu` WHERE `entry`=8736 AND `text_id`=11066; +DELETE FROM `gossip_menu` WHERE `entry`=8737 AND `text_id` IN (11059,11060,11061,11063); +DELETE FROM `gossip_menu` WHERE `entry`=8753 AND `text_id`=11089; +DELETE FROM `gossip_menu` WHERE `entry`=8757 AND `text_id` IN (11094,11095); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(8303,10359),(8303,10569), +(8304,10537),(8304,10360), +(8306,10410), +(8343,10363), +(8351,10422), +(8370,10444), +(8385,10466), +(8388,10469), +(8429,10532), +(8430,10533), +(8431,10534), +(8435,10541), +(8436,10539), +(8437,10542), +(8438,10543), +(8439,10544), +(8440,10545), +(8447,10554), +(8454,10561), +(8455,10562), +(8490,10602), +(8491,10603), +(8496,10612), +(8506,10637), +(8508,10640), +(8523,10657), +(8529,10667), +(8615,10793), +(8620,10800),(8620,10860), +(8630,10819), +(8640,10838), +(8642,10841),(8642,10992),(8642,10994),(8642,10995), +(8657,10877),(8657,10878), +(8660,10888),(8660,11057), +(8667,10903), +(8669,10906),(8669,10938),(8669,10988),(8669,10989),(8669,10990),(8669,10991), +(8670,10907),(8670,10997),(8670,11001),(8670,11002),(8670,11004), +(8671,10909),(8671,10951), +(8672,10910),(8672,10922), +(8674,10912), +(8675,10915), +(8678,10916),(8678,10917),(8678,10918),(8678,11013),(8678,11015),(8678,11018), +(8679,10919),(8679,10920),(8679,11027),(8679,11028), +(8680,10923),(8680,10924),(8680,10925),(8680,11019),(8680,11020),(8680,11021), +(8681,10926),(8681,10927),(8681,11007),(8681,11009),(8681,11010),(8681,11011), +(8683,10953), +(8685,10931),(8685,10932), +(8687,11058), +(8689,10931),(8689,10932), +(8690,10931),(8690,10932), +(8691,10931),(8691,10932), +(8716,10965),(8716,10966),(8716,10967),(8716,10968),(8716,10969), +(8717,10976),(8717,10975),(8717,10974),(8717,10973),(8717,10972), +(8718,10977),(8718,10978), +(8719,10979),(8719,10980), +(8721,10983),(8721,10984),(8721,10985),(8721,10986),(8721,10987), +(8722,10993),(8722,10996),(8722,10998),(8722,10999),(8722,11000), +(8723,11008),(8723,11012),(8723,11014),(8723,11016),(8723,11017), +(8724,11022),(8724,11023),(8724,11024),(8724,11025),(8724,11026), +(8726,11029),(8726,11036),(8726,11037),(8726,11038), +(8736,11066), +(8737,11059),(8737,11060),(8737,11061),(8737,11063), +(8753,11089), +(8757,11094),(8757,11095); + +-- Creature Gossip_menu_option insert from sniff +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (8429,8435,8436,8437,8438,8439,8454,8490,8660,8661,8671,8672,8673,8674,8675,8676,8677,8679,8683,8685,8687,8689,8690,8691,8716,8717,8718,8719,8721,8722,8723,8724,8726,8737) AND `id`=0; +DELETE FROM `gossip_menu_option` WHERE `menu_id`=8304 AND `id` IN (0,1,2,3,4,5); +DELETE FROM `gossip_menu_option` WHERE `menu_id`=8306 AND `id` IN (0,1); +DELETE FROM `gossip_menu_option` WHERE `menu_id`=8455 AND `id` IN (0,1,2,3,4); +DELETE FROM `gossip_menu_option` WHERE `menu_id`=8660 AND `id` IN (0,1,2,3); +DELETE FROM `gossip_menu_option` WHERE `menu_id`=8679 AND `id` IN (0,1); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(8303,0,0,'I need another waiver!',1,1,0,0,0,0,''), -- Spellcast 38255 +(8304,0,0,'I''m ready for my test flight!',1,1,0,0,0,0,''), +(8304,1,0,'Take me to Singing Ridge.',1,1,8454,0,0,0,''), +(8304,2,0,'Send me to Razaan''s Landing!',1,1,0,0,0,0,''), +(8304,3,0,'Take me to Ruuan.',1,1,0,0,0,0,''), +(8304,4,0,'Send me to Raven''s Wood!',1,1,0,0,0,0,''), +(8304,5,0,'I want to fly to an old location!',1,1,8455,0,0,0,''), +(8306,1,0,'Why are you so far from Toshley''s Station?',1,1,8343,0,0,0,''), +(8429,0,0,'Overseer, I am here to negotiate on behalf of the Cenarion Expedition.',1,1,8430,0,0,0,''), +(8435,0,0,'Oh, it''s not my fault, I can assure you.',1,1,8437,0,0,0,''), +(8436,0,0,'I''m fine, thank you. You asked for me?',1,1,8435,0,0,0,''), +(8437,0,0,'Um, no... no, I don''t want that at all.',1,1,8438,0,0,0,''), +(8438,0,0,'Impressive. When do we attack?',1,1,8439,0,0,0,''), +(8439,0,0,'Absolutely!',1,1,8440,0,0,0,''), +(8454,0,0,'I have the signed waiver! Fire me into the Singing Ridge!',1,1,0,0,0,0,''), +(8455,0,0,'Send me back to the Jagged Ridge.',1,1,0,0,0,0,''), +(8455,1,0,'Send me back to the Singing Ridge.',1,1,0,0,0,0,''), +(8455,2,0,'Send me back to Razaan''s Landing.',1,1,0,0,0,0,''), +(8455,3,0,'Send me back to Ruuan.',1,1,0,0,0,0,''), +(8455,4,0,'Send me back to Raven''s Wood.',1,1,0,0,0,0,''), +(8490,0,1,'Very well, let me see what you''ve got.',3,128,0,0,0,0,''), +(8660,0,0,'',1,1,0,0,0,0,''), +(8660,1,0,'',1,1,0,0,0,0,''), +(8660,2,0,'',1,1,0,0,0,0,''), +(8660,3,0,'',1,1,0,0,0,0,''), +(8661,0,1,'Show me your assortment of, err... things.',3,128,0,0,0,0,''), +(8671,0,0,'Place 35 Apexis Shards into the prism.',1,1,0,0,0,0,''), +(8672,0,0,'Purchase 1 Unstable Flask of the Beast for the cost of 10 Apexis Shards',1,1,8673,0,0,0,''), +(8672,1,0,'Purchase 5 Unstable Flasks of the Beast for the cost of 50 Apexis Shards',1,1,8674,0,0,0,''), +(8673,0,0,'Use the fel crystalforge to make another purchase.',1,1,8672,0,0,0,''), +(8674,0,0,'Use the fel crystalforge to make another purchase.',1,1,8672,0,0,0,''), +(8675,0,0,'Use the Bash''ir crystalforge to make another purchase.',1,1,8677,0,0,0,''), +(8676,0,0,'Use the Bash''ir crystalforge to make another purchase.',1,1,8677,0,0,0,''), +(8677,0,0,'Purchase 1 Unstable Flask of the Sorcerer for the cost of 10 Apexis Shards',1,1,8676,0,0,0,''), +(8677,1,0,'Purchase 5 Unstable Flasks of the Sorcerer for the cost of 50 Apexis Shards',1,1,8675,0,0,0,''), +(8679,0,0,'Kronk, tell me about the charged crystal foci.',1,1,8757,0,0,0,''), +(8683,0,1,'Skwak!',3,128,0,0,0,0,''), +(8685,0,0,'Place 35 Apexis Shards near the dragon egg to crack it open.',1,1,0,0,0,0,''), +(8687,0,0,'',1,1,0,0,0,0,''), +(8689,0,0,'Place 35 Apexis Shards near the dragon egg to crack it open.',1,1,0,0,0,0,''), +(8690,0,0,'Place 35 Apexis Shards near the dragon egg to crack it open.',1,1,0,0,0,0,''), +(8691,0,0,'Place 35 Apexis Shards near the dragon egg to crack it open.',1,1,0,0,0,0,''), +(8716,0,1,'Let me browse your goods.',3,128,0,0,0,0,''), +(8717,0,1,'Let me browse your goods.',3,128,0,0,0,0,''), +(8718,1,0,'Yes, I''d love a ride to Blackwind Landing.',1,1,0,0,0,0,''), +(8719,1,0,'Absolutely! Send me to the Skyguard Outpost.',1,1,0,0,0,0,''), +(8721,0,1,'Let me browse your goods.',3,128,0,0,0,0,''), +(8722,0,1,'Let me browse your goods.',3,128,0,0,0,0,''), +(8723,0,1,'Let me browse your goods.',3,128,0,0,0,0,''), +(8724,0,1,'Let me browse your goods.',3,128,0,0,0,0,''), +(8726,0,1,'Jho''nass, let me see what you have to offer.',3,128,0,0,0,0,''), +(8737,0,1,'Let me browse your goods.',3,128,0,0,0,0,''); + +-- Insert npc_text from sniff +DELETE FROM `npc_text` WHERE `ID` IN (10838,10878,10909,10915,10918,10968,10977,10984,10985,10986,10987,10990,10991,10993,10996,10998,10999,11012,11013,11014,11015,11020,11022,11023,11024,11037,11063); +INSERT INTO `npc_text` (`ID`,`text0_0`,`text0_1`,`lang0`,`prob0`,`em0_0`,`em0_1`,`em0_2`,`em0_3`,`em0_4`,`em0_5`,`text1_0`,`text1_1`,`lang1`,`prob1`,`em1_0`,`em1_1`,`em1_2`,`em1_3`,`em1_4`,`em1_5`,`text2_0`,`text2_1`,`lang2`,`prob2`,`em2_0`,`em2_1`,`em2_2`,`em2_3`,`em2_4`,`em2_5`,`text3_0`,`text3_1`,`lang3`,`prob3`,`em3_0`,`em3_1`,`em3_2`,`em3_3`,`em3_4`,`em3_5`,`text4_0`,`text4_1`,`lang4`,`prob4`,`em4_0`,`em4_1`,`em4_2`,`em4_3`,`em4_4`,`em4_5`,`text5_0`,`text5_1`,`lang5`,`prob5`,`em5_0`,`em5_1`,`em5_2`,`em5_3`,`em5_4`,`em5_5`,`text6_0`,`text6_1`,`lang6`,`prob6`,`em6_0`,`em6_1`,`em6_2`,`em6_3`,`em6_4`,`em6_5`,`text7_0`,`text7_1`,`lang7`,`prob7`,`em7_0`,`em7_1`,`em7_2`,`em7_3`,`em7_4`,`em7_5`,`WDBVerified`) VALUES +(10838,'Yes, $g king : queen;?','',0,1,0,1,0,0,0,0,'You kill gronn! Now you fight things from sky?','',0,1,0,15,0,0,0,0,'Me life for $N!','',0,1,0,15,0,0,0,0,'Dis drink good!','',0,1,0,1,0,0,0,0,'If $G King : Queen; $N dance, me dance!','',0,1,0,1,0,0,0,0,'$G King : Queen; not angry with me?','',0,1,0,1,0,0,0,0,'Why you look at me like dat? You not gonna kiss me, right!?','',0,1,0,1,0,0,0,0,'Now all Sons of Gruul dead! Now new $g king : queen; lead all ogres to Ogri''la!','',0,1,0,15,0,0,0,0,12340), +(10878,'Da $g king : queen;! Chort ready to serve.','',0,1,0,2,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(10909,'Burning eyes within the prism fill your mind with a sense of dread...','',0,1,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(10915,'','',0,1,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(10918,'The boy''s too stupid still to say it -- not enough crystal exposure yet -- but, he''s thankful for what you did in getting him those flasks.$B$BNow, only nine more sons to go. Gah!$B$B$B$BWant to take one of them off of our hands? We''ll sell him to you cheap.','',0,1,0,1,0,5,0,6,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(10968,'Mighty one! How can we serve you?','',0,1,1,396,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(10977,'','Hey, comrade. If you get yourself in good with the Skyguard, I can offer you a direct flight to our base, Blackwind Landing, in the Skethyl Mountains.$B$BDo you like my beautiful nether ray? It is lovely.',0,1,0,1,0,6,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(10984,'Everyone''s gotta drink. What can we get for you?','',0,1,1,396,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(10985,'Greetings $G brother:sister;, how can we help?','',0,1,1,396,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(10986,'Our drinks should quench even the mightiest of thirsts.','',0,1,1,396,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(10987,'Drink or be gone!','',0,1,1,396,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(10990,'Yer gettin'' ta be something of a revered figure ''round here, $g boy : girl;! If''n I didn''t know better, I''d say ye were gunnin'' fer me job!!!$B$BAll the same, if ye keep up the way ye have been, ye''ll deserve it!','',0,1,0,5,0,396,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(10991,'What can I say, $N? Yer the finest o'' the Sha''tari Skyguard!$B$BJust don''t be lettin'' that go ta yer head. I can still teach ya a thing or two, $g lad : lass;!$B$B','',0,1,0,2,0,11,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(10993,'How can we be of service, exalted one?','',0,1,1,16,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(10996,'We are happy to provide you with supplies.','',0,1,1,1,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(10998,'Honored $G brother:sister;, how can we help?','',0,1,1,1,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(10999,'Friend! It''s been too long. What can we get for you?','',0,1,1,1,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(11013,'It''s an honor to have a $r such as yourself aiding us ogres. You''re keeping our hope of a better future alive.$B$BNow if we could just get rid of these headaches. Are you sure you don''t want one of our sons?','',0,1,0,1,0,6,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(11012,'There are few things you can trust in life. Steel, you can trust.','',0,1,1,396,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(11014,'What is steel compared to the hand that shapes it?','',0,1,1,396,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(11015,'It''s amazing how much you''ve helped us out. We dare say that if it weren''t for you, we''d already have been overrun by the demons, or fried to a crisp by the Black Dragonflight!$B$BOn a side note, we did mention that we''d sell you one of our sons, cheap, right? No, not interested?','',0,1,0,1,0,6,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(11020,'Gahk like little, $r $N. Yous kill da big demon; make all da little demons scared!$B$B','',0,1,0,1,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(11022,'What can we get for you, our exalted $G brother:sister;?','',0,1,1,16,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(11023,'How might we be of assistance?','',0,1,1,1,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(11024,'Honored $G brother:sister;, how may we help?','',0,1,1,396,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(11037,'You''re like something of a revered figure around here, $g man : kitten;. Seems like everyone''s talking about you. That''s cool.$B$BLet''s see if there''s something in stock that you''re interested in. We have a lot of nice stuff.','',0,1,0,25,0,1,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(11063,'You can never be too prepared.','',0,1,1,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340); + +-- Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8303 AND `SourceEntry`=10569; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8304 AND `SourceEntry`=10537; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8620 AND `SourceEntry`=10860; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8642 AND `SourceEntry` IN (10992,10994,10995); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8657 AND `SourceEntry`=10878; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8660 AND `SourceEntry`=11057; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8669 AND `SourceEntry` IN (10938,10988,10989,10990,10991); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8670 AND `SourceEntry` IN (10997,11001,11002,11004); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8671 AND `SourceEntry`=10951; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8672 AND `SourceEntry`=10922; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8677 AND `SourceEntry`=10913; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8678 AND `SourceEntry` IN (10917,10918,11013,11015,11018); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8679 AND `SourceEntry` IN (10920,11027,11028); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8680 AND `SourceEntry` IN (10923,10924,10925,11019,11020,11021); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8681 AND `SourceEntry` IN (10926,10927,11007,11009,11010,11011); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup` IN (8685,8689,8690,8691) AND `SourceEntry`=10932; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8716 AND `SourceEntry` IN (10965,10966,10968,10969); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8717 AND `SourceEntry` IN (10972,10973,10974,10975,10976); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8718 AND `SourceEntry`=10978; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8719 AND `SourceEntry`=10979; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8721 AND `SourceEntry` IN (10983,10984,10985,10986,10987); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8722 AND `SourceEntry` IN (10993,10996,10998,10999,11000); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8723 AND `SourceEntry` IN (11008,11012,11014,11016,11017); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8724 AND `SourceEntry` IN (11022,11023,11024,11025,11026); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8726 AND `SourceEntry` IN (11036,11037,11038); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8737 AND `SourceEntry` IN (11060,11061,11063); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8757 AND `SourceEntry`=11095; + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8304 AND `SourceEntry` IN (0,1,2,3,4,5); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8429 AND `SourceEntry`=0; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8454 AND `SourceEntry`=0; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8455 AND `SourceEntry` IN (0,1,2,3,4); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8660 AND `SourceEntry` IN (0,1,2,3); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8671 AND `SourceEntry`=0; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8672 AND `SourceEntry` IN (0,1); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8677 AND `SourceEntry` IN (0,1); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8685 AND `SourceEntry`=0; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8687 AND `SourceEntry`=0; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8689 AND `SourceEntry`=0; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8690 AND `SourceEntry`=0; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8691 AND `SourceEntry`=0; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8718 AND `SourceEntry`=1; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8719 AND `SourceEntry`=1; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,8303,10569,0,0,8,10557,0,0,0,0,'','Tally Zapnabber - Show different gossip if player has completed quest 10557'), +(14,8304,10537,0,0,1,37108,0,0,0,0,'','Rally Zapnabber - Show different gossip if player is affected by aura 37108'), +(14,8620,10860,0,0,8,11000,0,0,0,0,'','Mog''dorg the Wizened - Show different gossip if player has rewarded quest 11000'), +(14,8642,10992,0,0,5,1031,32,0,0,0,'','Sky Sergeant Vanderlip - Show different gossip if player is honored with Sha''tari Skyguards'), +(14,8642,10994,0,0,5,1031,64,0,0,0,'','Sky Sergeant Vanderlip - Show different gossip if player is revered with Sha''tari Skyguards'), +(14,8642,10995,0,0,5,1031,128,0,0,0,'','Sky Sergeant Vanderlip - Show different gossip if player is exalted with Sha''tari Skyguards'), +(14,8657,10878,0,0,8,11000,0,0,0,0,'','Chort - Show different gossip if player has rewarded quest 11000'), +(14,8660,11057,0,0,2,32620,1,0,0,0,'','Skull Pile - Show different gossip if player has item 32620'), +(14,8669,10938,0,0,8,11065,0,0,0,0,'','Sky Commander Keller - Show different gossip if player has rewarded quest 11065'), +(14,8669,10938,0,0,8,11010,0,0,0,0,'','Sky Commander Keller - Show different gossip if player has rewarded quest 11010'), +(14,8669,10988,0,0,8,11062,0,0,0,0,'','Sky Commander Keller - Show different gossip if player has rewarded quest 11062'), +(14,8669,10989,0,0,5,1031,32,0,0,0,'','Sky Commander Keller - Show different gossip if player is honored with Sha''tari Skyguards'), +(14,8669,10990,0,0,5,1031,64,0,0,0,'','Sky Commander Keller - Show different gossip if player is revered with Sha''tari Skyguards'), +(14,8669,10991,0,0,5,1031,128,0,0,0,'','Sky Commander Keller - Show different gossip if player is exalted with Sha''tari Skyguards'), +(14,8670,10997,0,0,8,11065,0,0,0,0,'','Skyguard Khatie - Show different gossip if player has rewarded quest 11065'), +(14,8670,11001,0,0,5,1031,32,0,0,0,'','Skyguard Khatie - Show different gossip if player is honored with Sha''tari Skyguards'), +(14,8670,11002,0,0,5,1031,64,0,0,0,'','Skyguard Khatie - Show different gossip if player is revered with Sha''tari Skyguards'), +(14,8670,11004,0,0,5,1031,128,0,0,0,'','Skyguard Khatie - Show different gossip if player is exalted with Sha''tari Skyguards'), +(14,8671,10951,0,0,2,32569,35,0,1,0,'','Fel Crystal Prism - Show different gossip if player does not have 35 of item 32569'), +(14,8672,10922,0,0,2,32569,10,0,1,0,'','Fel Crystalforge - Show different gossip if player has 10 of item 32569'), +(14,8677,10913,0,0,2,32569,10,0,0,0,'','Bash''ir Crystalforge - Show different gossip if player has 10 of item 32569'), +(14,8678,10917,0,0,8,11030,0,0,0,0,'','Torkus - Show different gossip if player has rewarded quest 11030'), +(14,8678,10918,0,0,8,11061,0,0,0,0,'','Torkus - Show different gossip if player has rewarded quest 11061'), +(14,8678,11013,0,0,5,1038,32,0,0,0,'','Torkus - Show different gossip if player is honored with Ogri''la'), +(14,8678,11015,0,0,5,1038,64,0,0,0,'','Torkus - Show different gossip if player is revered with Ogri''la'), +(14,8678,11018,0,0,5,1038,128,0,0,0,'','Torkus - Show different gossip if player is exalted with Ogri''la'), +(14,8679,10920,0,0,8,11026,0,0,0,0,'','Kronk - Show different gossip if player has rewarded quest 11026'), +(14,8679,11027,0,0,5,1038,64,0,0,0,'','Kronk - Show different gossip if player is revered with Ogri''la'), +(14,8679,11028,0,0,5,1038,128,0,0,0,'','Kronk - Show different gossip if player is exalted with Ogri''la'), +(14,8680,10923,0,0,5,1038,32+16+8,0,0,0,'','Gahk - Show different gossip if player is neutral, friendly or honored with Ogri''la'), +(14,8680,10924,0,0,8,11026,0,0,0,0,'','Gahk - Show different gossip if player has rewarded quest 11026'), +(14,8680,10925,0,0,8,11060,0,0,0,0,'','Gahk - Show different gossip if player has rewarded quest 11060'), +(14,8680,11019,0,0,5,1038,64,0,0,0,'','Gahk - Show different gossip if player is revered with Ogri''la'), +(14,8680,11020,0,0,8,11079,0,0,0,0,'','Gahk - Show different gossip if player has rewarded quest 11079'), +(14,8680,11021,0,0,5,1038,128,0,0,0,'','Gahk - Show different gossip if player is exalted with Ogri''la'), +(14,8681,10926,0,0,5,1038,16+8,0,0,0,'','Chu''a''lor - Show different gossip if player is neutral or friendly with Ogri''la'), +(14,8681,10927,0,0,8,11025,0,0,0,0,'','Chu''a''lor - Show different gossip if player has rewarded quest 11025'), +(14,8681,11007,0,0,8,11058,0,0,0,0,'','Chu''a''lor - Show different gossip if player has rewarded quest 11058'), +(14,8681,11009,0,0,5,1038,32,0,0,0,'','Chu''a''lor - Show different gossip if player is honored with Ogri''la'), +(14,8681,11010,0,0,5,1038,64,0,0,0,'','Chu''a''lor - Show different gossip if player is revered with Ogri''la'), +(14,8681,11011,0,0,5,1038,128,0,0,0,'','Chu''a''lor - Show different gossip if player is exalted with Ogri''la'), +(14,8685,10932,0,0,2,32569,35,0,1,0,'','Show different gossip if player has 35 of item 32569'), +(14,8689,10932,0,0,2,32569,35,0,1,0,'','Show different gossip if player has 35 of item 32569'), +(14,8690,10932,0,0,2,32569,35,0,1,0,'','Show different gossip if player has 35 of item 32569'), +(14,8691,10932,0,0,2,32569,35,0,1,0,'','Show different gossip if player has 35 of item 32569'), +(14,8716,10965,0,0,5,1038,16,0,0,0,'','Ogri''la Merchant - Show different gossip if player is friendly with Ogri''la'), +(14,8716,10966,0,0,5,1038,32,0,0,0,'','Ogri''la Merchant - Show different gossip if player is honored with Ogri''la'), +(14,8716,10968,0,0,5,1038,64,0,0,0,'','Ogri''la Merchant - Show different gossip if player is revered with Ogri''la'), +(14,8716,10969,0,0,5,1038,128,0,0,0,'','Ogri''la Merchant - Show different gossip if player is exalted with Ogri''la'), +(14,8717,10972,0,0,5,1038,128,0,0,0,'','Food Vendor - Show different gossip if player is exalted with Ogri''la'), +(14,8717,10973,0,0,5,1038,64,0,0,0,'','Food Vendor - Show different gossip if player is revered with Ogri''la'), +(14,8717,10974,0,0,5,1038,32,0,0,0,'','Food Vendor - Show different gossip if player is honored with Ogri''la'), +(14,8717,10975,0,0,5,1038,16,0,0,0,'','Food Vendor - Show different gossip if player is friendly with Ogri''la'), +(14,8717,10976,0,0,5,1038,8,0,0,0,'','Food Vendor - Show different gossip if player is neutral with Ogri''la'), +(14,8718,10978,0,0,5,1031,224,0,0,0,'','Skyguard Handler Irena - Show different gossip if player is honored, revered or exalted with Sha''tari Skyguards'), +(14,8719,10979,0,0,5,1031,224,0,0,0,'','Skyguard Handler Deesak - Show different gossip if player is honored, revered or exalted with Sha''tari Skyguards'), +(14,8721,10983,0,0,5,1038,128,0,0,0,'','Ogri''la Keg King - Show different gossip if player is exalted with Ogri''la'), +(14,8721,10984,0,0,5,1038,64,0,0,0,'','Ogri''la Keg King - Show different gossip if player is revered with Ogri''la'), +(14,8721,10985,0,0,5,1038,32,0,0,0,'','Ogri''la Keg King - Show different gossip if player is honored with Ogri''la'), +(14,8721,10986,0,0,5,1038,16,0,0,0,'','Ogri''la Keg King - Show different gossip if player is friendly with Ogri''la'), +(14,8721,10987,0,0,5,1038,8,0,0,0,'','Ogri''la Keg King - Show different gossip if player is neutral with Ogri''la'), +(14,8722,10993,0,0,5,1038,128,0,0,0,'','Ogri''la Trader - Show different gossip if player is exalted with Ogri''la'), +(14,8722,10996,0,0,5,1038,64,0,0,0,'','Ogri''la Trader - Show different gossip if player is revered with Ogri''la'), +(14,8722,10998,0,0,5,1038,32,0,0,0,'','Ogri''la Trader - Show different gossip if player is honored with Ogri''la'), +(14,8722,10999,0,0,5,1038,16,0,0,0,'','Ogri''la Trader - Show different gossip if player is friendly with Ogri''la'), +(14,8722,11000,0,0,5,1038,8,0,0,0,'','Ogri''la Trader - Show different gossip if player is neutral with Ogri''la'), +(14,8723,11008,0,0,5,1038,128,0,0,0,'','Ogri''la Steelshaper - Show different gossip if player is exalted with Ogri''la'), +(14,8723,11012,0,0,5,1038,64,0,0,0,'','Ogri''la Steelshaper - Show different gossip if player is revered with Ogri''la'), +(14,8723,11014,0,0,5,1038,32,0,0,0,'','Ogri''la Steelshaper - Show different gossip if player is honored with Ogri''la'), +(14,8723,11016,0,0,5,1038,16,0,0,0,'','Ogri''la Steelshaper - Show different gossip if player is friendly with Ogri''la'), +(14,8723,11017,0,0,5,1038,8,0,0,0,'','Ogri''la Steelshaper - Show different gossip if player is neutral with Ogri''la'), +(14,8724,11022,0,0,5,1038,128,0,0,0,'','Mingo - Show different gossip if player is exalted with Ogri''la'), +(14,8724,11023,0,0,5,1038,64,0,0,0,'','Mingo - Show different gossip if player is revered with Ogri''la'), +(14,8724,11024,0,0,5,1038,32,0,0,0,'','Mingo - Show different gossip if player is honored with Ogri''la'), +(14,8724,11025,0,0,5,1038,16,0,0,0,'','Mingo - Show different gossip if player is friendly with Ogri''la'), +(14,8724,11026,0,0,5,1038,8,0,0,0,'','Mingo - Show different gossip if player is neutral with Ogri''la'), +(14,8726,11036,0,0,5,1038,32,0,0,0,'','Jho''nass - Show different gossip if player is honored with Ogri''la'), +(14,8726,11037,0,0,5,1038,64,0,0,0,'','Jho''nass - Show different gossip if player is revered with Ogri''la'), +(14,8726,11038,0,0,5,1038,128,0,0,0,'','Jho''nass - Show different gossip if player is exalted with Ogri''la'), +(14,8737,11063,0,0,5,1031,32,0,0,0,'','Skyguard Pyrotechnician - Show different gossip if player is honored with Sha''tari Skyguards'), +(14,8737,11061,0,0,5,1031,64,0,0,0,'','Skyguard Pyrotechnician - Show different gossip if player is revered with Sha''tari Skyguards'), +(14,8737,11060,0,0,5,1031,128,0,0,0,'','Skyguard Pyrotechnician - Show different gossip if player is exalted with Sha''tari Skyguards'), +(14,8757,11095,0,0,5,1038,224,0,0,0,'','Kronk - Show different gossip if player is honored, revered or exalted with Ogri''la'), + +(15,8304,0,0,0,9,10557,0,0,0,0,'','Rally Zapnabber - Show gossip option only if player has taken quest 10557'), +(15,8304,1,0,0,9,10710,0,0,0,0,'','Rally Zapnabber - Show gossip option only if player has taken quest 10710'), +(15,8304,2,0,0,9,10711,0,0,0,0,'','Rally Zapnabber - Show gossip option only if player has taken quest 10711'), +(15,8304,3,0,0,9,10712,0,0,0,0,'','Rally Zapnabber - Show gossip option only if player has taken quest 10712'), +(15,8304,4,0,0,9,10716,0,0,0,0,'','Rally Zapnabber - Show gossip option only if player has taken quest 10716'), +(15,8304,5,0,0,8,10557,0,0,0,0,'','Rally Zapnabber - Show gossip option only if player has taken quest 10557'), +(15,8429,0,0,0,9,10682,0,0,0,0,'','Overseer Nuaar - Show gossip option only if player has taken quest 10682'), +(15,8454,0,0,0,2,30539,1,0,0,0,'','Rally Zapnabber - Show gossip option only if player has item 30539'), +(15,8455,1,0,0,8,10710,0,0,0,0,'','Rally Zapnabber - Show gossip option only if player has completed quest 10710'), +(15,8455,2,0,0,8,10711,0,0,0,0,'','Rally Zapnabber - Show gossip option only if player has completed quest 10711'), +(15,8455,3,0,0,8,10712,0,0,0,0,'','Rally Zapnabber - Show gossip option only if player has completed quest 10712'), +(15,8455,4,0,0,8,10716,0,0,0,0,'','Rally Zapnabber - Show gossip option only if player has completed quest 10716'), +(15,8660,0,0,0,9,11885,0,0,0,0,'','Skull Pile - Show gossip option only if player has taken quest 11885'), +(15,8660,1,0,0,9,11885,0,0,0,0,'','Skull Pile - Show gossip option only if player has taken quest 11885'), +(15,8660,2,0,0,9,11885,0,0,0,0,'','Skull Pile - Show gossip option only if player has taken quest 11885'), +(15,8660,3,0,0,9,11885,0,0,0,0,'','Skull Pile - Show gossip option only if player has taken quest 11885'), +(15,8660,0,0,1,9,11074,0,0,0,0,'','Skull Pile - Show gossip option only if player has taken quest 11074'), +(15,8660,1,0,1,9,11074,0,0,0,0,'','Skull Pile - Show gossip option only if player has taken quest 11074'), +(15,8660,2,0,1,9,11074,0,0,0,0,'','Skull Pile - Show gossip option only if player has taken quest 11074'), +(15,8660,3,0,1,9,11074,0,0,0,0,'','Skull Pile - Show gossip option only if player has taken quest 11074'), +(15,8671,0,0,0,2,32569,35,0,0,0,'','Fel Crystal Prism - Show gossip option only if player has 35 of item 32569'), +(15,8672,0,0,0,2,32569,10,0,0,0,'','Fel Crystalforge - Show gossip option only if player has 10 of item 32569'), +(15,8672,1,0,0,2,32569,50,0,0,0,'','Fel Crystalforge - Show gossip option only if player has 50 of item 32569'), +(15,8677,0,0,0,2,32569,10,0,0,0,'','Bash''ir Crystalforge - Show gossip option only if player has 10 of item 32569'), +(15,8677,1,0,0,2,32569,50,0,0,0,'','Bash''ir Crystalforge - Show gossip option only if player has 50 of item 32569'), +(15,8685,0,0,0,2,32569,35,0,0,0,'','Show gossip option only if player has 35 of item 32569'), +(15,8687,0,0,0,2,32720,1,0,0,0,'','Ancient Skull Pile - Show gossip option only if player has 1 of item 32720'), +(15,8689,0,0,0,2,32569,35,0,0,0,'','Show gossip option only if player has 35 of item 32569'), +(15,8690,0,0,0,2,32569,35,0,0,0,'','Show gossip option only if player has 35 of item 32569'), +(15,8691,0,0,0,2,32569,35,0,0,0,'','Show gossip option only if player has 35 of item 32569'), +(15,8718,1,0,0,5,1031,224,0,0,0,'','Skyguard Handler Irena - Show gossip option only if player is honored, revered or exalted with Sha''tari Skyguards'), +(15,8719,1,0,0,5,1031,224,0,0,0,'','Skyguard Handler Deesak - Show gossip option only if player is honored, revered or exalted with Sha''tari Skyguards'); From b5443af772f54800321a30cc789cfa6ae85c5188 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Thu, 31 May 2012 11:44:41 +0200 Subject: [PATCH 0875/1149] DB/Loot: Reassign a reference, fix an error in previous commit with missing @variable --- .../world/2012_05_30_00_world_reference_loot_template.sql | 1 + .../world/2012_05_31_00_world_reference_loot_template.sql | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 sql/updates/world/2012_05_31_00_world_reference_loot_template.sql diff --git a/sql/updates/world/2012_05_30_00_world_reference_loot_template.sql b/sql/updates/world/2012_05_30_00_world_reference_loot_template.sql index 7c6dfa1e11f..c2cab663d4a 100644 --- a/sql/updates/world/2012_05_30_00_world_reference_loot_template.sql +++ b/sql/updates/world/2012_05_30_00_world_reference_loot_template.sql @@ -1,4 +1,5 @@ SET @Twins := 34329; +SET @emblem := 49426; DELETE FROM `reference_loot_template` WHERE `entry`=@Twins; INSERT INTO `reference_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (@Twins,47296,0,1,1,1,1), -- Greaves of Ruthless Judgment diff --git a/sql/updates/world/2012_05_31_00_world_reference_loot_template.sql b/sql/updates/world/2012_05_31_00_world_reference_loot_template.sql new file mode 100644 index 00000000000..03723c82536 --- /dev/null +++ b/sql/updates/world/2012_05_31_00_world_reference_loot_template.sql @@ -0,0 +1,2 @@ +UPDATE `reference_loot_template` SET `entry`=14011 WHERE `entry`=3014; +UPDATE `creature_loot_template` SET `mincountOrRef`=-14011 WHERE `mincountOrRef`=-3014; From 5eee40249c51b35719a18907da94d64d98f89258 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 31 May 2012 15:39:18 +0200 Subject: [PATCH 0876/1149] Core/Items: Added custom flags field to item_template, currently 2 flag values are available * ITEM_FLAGS_CU_DURATION_REAL_TIME determines item duration counts even if offline (replaced ugly negative duration workaround, easy to lose data when importing fresh wdb) * ITEM_FLAGS_CU_IGNORE_QUEST_STATUS quest status will not affect this item appearing in loot, currently needed for Arena Master trinket --- .../world/2012_05_31_01_world_item_template.sql | 4 ++++ src/server/game/Entities/Item/Item.cpp | 4 ++-- src/server/game/Entities/Item/ItemPrototype.h | 9 ++++++++- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Globals/ObjectMgr.cpp | 15 +++++++++++---- src/server/game/Handlers/ItemHandler.cpp | 2 +- src/server/game/Loot/LootMgr.cpp | 15 +++------------ 7 files changed, 30 insertions(+), 21 deletions(-) create mode 100644 sql/updates/world/2012_05_31_01_world_item_template.sql diff --git a/sql/updates/world/2012_05_31_01_world_item_template.sql b/sql/updates/world/2012_05_31_01_world_item_template.sql new file mode 100644 index 00000000000..144ee6715a9 --- /dev/null +++ b/sql/updates/world/2012_05_31_01_world_item_template.sql @@ -0,0 +1,4 @@ +ALTER TABLE `item_template` ADD `flagsCustom` INT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `maxMoneyLoot`; +UPDATE `item_template` SET `flagsCustom`=`flagsCustom`|0x1 WHERE `Duration`<0; +UPDATE `item_template` SET `duration`=ABS(`duration`); +ALTER TABLE `item_template` CHANGE `Duration` `duration` INT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `ArmorDamageModifier`; diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index af867dad76a..209fdae8ce6 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -274,7 +274,7 @@ bool Item::Create(uint32 guidlow, uint32 itemid, Player const* owner) for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) SetSpellCharges(i, itemProto->Spells[i].SpellCharges); - SetUInt32Value(ITEM_FIELD_DURATION, abs(itemProto->Duration)); + SetUInt32Value(ITEM_FIELD_DURATION, itemProto->Duration); SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, 0); return true; } @@ -420,7 +420,7 @@ bool Item::LoadFromDB(uint32 guid, uint64 owner_guid, Field* fields, uint32 entr // update duration if need, and remove if not need if ((proto->Duration == 0) != (duration == 0)) { - SetUInt32Value(ITEM_FIELD_DURATION, abs(proto->Duration)); + SetUInt32Value(ITEM_FIELD_DURATION, proto->Duration); need_save = true; } diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index 2eae7234229..1b5eec7fbaf 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -192,6 +192,12 @@ enum ItemFlagsExtra ITEM_FLAGS_EXTRA_NEED_ROLL_DISABLED = 0x00000100 }; +enum ItemFlagsCustom +{ + ITEM_FLAGS_CU_DURATION_REAL_TIME = 0x0001, // Item duration will tick even if player is offline + ITEM_FLAGS_CU_IGNORE_QUEST_STATUS = 0x0002, // No quest status will be checked when this item drops +}; + enum BAG_FAMILY_MASK { BAG_FAMILY_MASK_NONE = 0x00000000, @@ -644,7 +650,7 @@ struct ItemTemplate uint32 GemProperties; // id from GemProperties.dbc uint32 RequiredDisenchantSkill; float ArmorDamageModifier; - int32 Duration; // negative = realtime, positive = ingame time + uint32 Duration; uint32 ItemLimitCategory; // id from ItemLimitCategory.dbc uint32 HolidayId; // id from Holidays.dbc uint32 ScriptId; @@ -652,6 +658,7 @@ struct ItemTemplate uint32 FoodType; uint32 MinMoneyLoot; uint32 MaxMoneyLoot; + uint32 FlagsCu; // helpers bool CanChangeEquipStateInCombat() const diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index d5e2d8ba956..4cf6d4ad979 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -13665,7 +13665,7 @@ void Player::UpdateItemDuration(uint32 time, bool realtimeonly) Item* item = *itr; ++itr; // current element can be erased in UpdateDuration - if ((realtimeonly && item->GetTemplate()->Duration < 0) || !realtimeonly) + if (!realtimeonly || item->GetTemplate()->FlagsCu & ITEM_FLAGS_CU_DURATION_REAL_TIME) item->UpdateDuration(this, time); } } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 1e36b4c732b..df6018faf39 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2111,9 +2111,9 @@ void ObjectMgr::LoadItemTemplates() // 118 119 120 121 122 123 124 125 "TotemCategory, socketColor_1, socketContent_1, socketColor_2, socketContent_2, socketColor_3, socketContent_3, socketBonus, " // 126 127 128 129 130 131 132 133 - "GemProperties, RequiredDisenchantSkill, ArmorDamageModifier, Duration, ItemLimitCategory, HolidayId, ScriptName, DisenchantID, " + "GemProperties, RequiredDisenchantSkill, ArmorDamageModifier, duration, ItemLimitCategory, HolidayId, ScriptName, DisenchantID, " // 134 135 136 - "FoodType, minMoneyLoot, maxMoneyLoot FROM item_template"); + "FoodType, minMoneyLoot, maxMoneyLoot, flagsCustom FROM item_template"); if (!result) { @@ -2230,7 +2230,7 @@ void ObjectMgr::LoadItemTemplates() itemTemplate.GemProperties = fields[126].GetUInt32(); itemTemplate.RequiredDisenchantSkill = uint32(fields[127].GetInt16()); itemTemplate.ArmorDamageModifier = fields[128].GetFloat(); - itemTemplate.Duration = fields[129].GetInt32(); + itemTemplate.Duration = fields[129].GetUInt32(); itemTemplate.ItemLimitCategory = uint32(fields[130].GetInt16()); itemTemplate.HolidayId = fields[131].GetUInt32(); itemTemplate.ScriptId = sObjectMgr->GetScriptId(fields[132].GetCString()); @@ -2238,6 +2238,7 @@ void ObjectMgr::LoadItemTemplates() itemTemplate.FoodType = uint32(fields[134].GetUInt8()); itemTemplate.MinMoneyLoot = fields[135].GetUInt32(); itemTemplate.MaxMoneyLoot = fields[136].GetUInt32(); + itemTemplate.FlagsCu = fields[137].GetUInt32(); // Checks @@ -2645,6 +2646,12 @@ void ObjectMgr::LoadItemTemplates() itemTemplate.HolidayId = 0; } + if (itemTemplate.FlagsCu & ITEM_FLAGS_CU_DURATION_REAL_TIME && !itemTemplate.Duration) + { + sLog->outErrorDb("Item (Entry %u) has flag ITEM_FLAGS_CU_DURATION_REAL_TIME but it does not have duration limit", entry); + itemTemplate.FlagsCu &= ~ITEM_FLAGS_CU_DURATION_REAL_TIME; + } + ++count; } while (result->NextRow()); @@ -2731,7 +2738,7 @@ void ObjectMgr::LoadItemSetNames() if (setEntry->itemId[i]) itemSetItems.insert(setEntry->itemId[i]); } - + // 0 1 2 QueryResult result = WorldDatabase.Query("SELECT `entry`, `name`, `InventoryType` FROM `item_set_names`"); diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index d537fc5b4aa..a569c914be0 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -423,7 +423,7 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data) data << pProto->GemProperties; data << pProto->RequiredDisenchantSkill; data << pProto->ArmorDamageModifier; - data << uint32(abs(pProto->Duration)); // added in 2.4.2.8209, duration (seconds) + data << pProto->Duration; // added in 2.4.2.8209, duration (seconds) data << pProto->ItemLimitCategory; // WotLK, ItemLimitCategory data << pProto->HolidayId; // Holiday.dbc? SendPacket(&data); diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 75065158ef6..a5ad46c9ec4 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -356,18 +356,9 @@ bool LootItem::AllowedForPlayer(Player const* player) const if ((pProto->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) && player->GetTeam() != ALLIANCE) return false; - if (needs_quest) - { - // Checking quests for quest-only drop (check only quests requirements in this case) - if (!player->HasQuestForItem(itemid)) - return false; - } - else - { - // Not quest only drop (check quest starting items for already accepted non-repeatable quests) - if (pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE && !player->HasQuestForItem(itemid)) - return false; - } + // check quest requirements + if (!(pProto->FlagsCu & ITEM_FLAGS_CU_IGNORE_QUEST_STATUS) && ((needs_quest || (pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE)) && !player->HasQuestForItem(itemid))) + return false; return true; } From d1856cfb0a339f15657590c44f9f034a2b2e1a4a Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 31 May 2012 16:09:07 +0100 Subject: [PATCH 0877/1149] DB/SAI: Fix quest Questioning Reethe - Closes #129 --- sql/updates/world/2012_05_31_01_world_sai.sql | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 sql/updates/world/2012_05_31_01_world_sai.sql diff --git a/sql/updates/world/2012_05_31_01_world_sai.sql b/sql/updates/world/2012_05_31_01_world_sai.sql new file mode 100644 index 00000000000..3055e98f167 --- /dev/null +++ b/sql/updates/world/2012_05_31_01_world_sai.sql @@ -0,0 +1,139 @@ +-- http://www.youtube.com/watch?v=G89A9ITuTfs +-- Missing combat spell entries; Cata spells: 70316 (Cleave),84419 (Challenging Shout) + +-- Paval should also attack --- faction 35 to 232 ---- +-- Couldn't fix Ogron evading when entering combat + +-- [Q] Questioning Reethe +SET @ENTRY_OGRON := 4983; -- Ogron +SET @ENTRY_PAVAL := 4980; -- Paval Reethe +SET @ENTRY_CALDWELL := 5046; -- Lieutenant Caldwell +SET @ENTRY_SKIRM := 5044; -- Theramore Skirmisher +SET @ENTRY_HALAN := 5045; -- Private Hallan +SET @SPELL_FAKE_SHOT := 7105; + +-- Quest completable by external event +UPDATE `quest_template` SET `SpecialFlags`=`SpecialFlags`|2 WHERE `Id`=1273; -- Questioning Reethe + +-- Set SAI AIName +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@ENTRY_OGRON,@ENTRY_PAVAL,@ENTRY_CALDWELL,@ENTRY_SKIRM,@ENTRY_HALAN); + +-- Template updates +UPDATE `creature` SET `spawntimesecs`=120 WHERE `id`=@ENTRY_PAVAL; +UPDATE `creature_template` SET `faction_A`=35,`faction_H`=35 WHERE `entry` IN (@ENTRY_CALDWELL,@ENTRY_SKIRM,@ENTRY_HALAN); -- Script changes faction to 151 later +UPDATE `creature_template` SET `equipment_id`=189 WHERE `entry`=@ENTRY_HALAN; +UPDATE `creature_model_info` SET `bounding_radius`=1.29485,`combat_reach`=2.175,`gender`=0 WHERE `modelid`=10704; -- Ogron +DELETE FROM `creature_template_addon` WHERE `entry` IN (@ENTRY_OGRON,@ENTRY_PAVAL); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(@ENTRY_OGRON,0,0,257,0,NULL),-- Ogron +(@ENTRY_PAVAL,0,0,1,0,NULL); -- Paval Reethe + +-- Waypoints +DELETE FROM `waypoints` WHERE `entry`=@ENTRY_OGRON; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY_OGRON,1,-3349.78,-3134.81,28.5267,'Ogron'), +(@ENTRY_OGRON,2,-3366.01,-3144.31,35.2659,'Ogron'), +(@ENTRY_OGRON,3,-3367.34,-3164.10,35.9618,'Ogron'), +(@ENTRY_OGRON,4,-3372.77,-3174.81,35.8517,'Ogron'), +(@ENTRY_OGRON,5,-3378.53,-3191.64,35.7204,'Ogron'), +(@ENTRY_OGRON,6,-3370.92,-3190.48,34.1671,'Ogron'), +(@ENTRY_OGRON,7,-3366.86,-3209.47,33.9713,'Ogron'); +-- (@ENTRY_OGRON,8,-3365.56,-3209.19,34.0187,'Ogron'); + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY_OGRON,@ENTRY_HALAN,@ENTRY_SKIRM,@ENTRY_CALDWELL,@ENTRY_PAVAL) AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY_OGRON*100,@ENTRY_OGRON*100+1,@ENTRY_CALDWELL*100,@ENTRY_HALAN*100,@ENTRY_PAVAL*100,@ENTRY_CALDWELL*100+1,@ENTRY_PAVAL*100+1,@ENTRY_OGRON*100+2) AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY_OGRON,0,0,0,6,0,100,0,0,0,0,0,6,1273,0,0,0,0,0,7,0,0,0,0,0,0,0,'Ogron - On Death - Fail Quest'), +(@ENTRY_OGRON,0,1,0,19,0,100,0,1273,0,0,0,80,@ENTRY_OGRON*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ogron - On Quest Accept - Script'), +(@ENTRY_OGRON*100,9,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'Ogron - On Script - Say "I noticed some fire.."'), +(@ENTRY_OGRON*100,9,1,0,0,0,100,0,0,0,0,0,53,0,@ENTRY_OGRON,0,0,0,2,1,0,0,0,0,0,0,0,'Ogron - On Script - Start WP'), +(@ENTRY_OGRON,0,2,0,40,0,100,0,5,@ENTRY_OGRON,0,0,54,3000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ogron - On WP 5 - Pause Path'), +(@ENTRY_OGRON,0,3,4,55,0,100,0,5,@ENTRY_OGRON,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ogron - On WP 5 - Say "That''s Reethe..."'), -- Link to 4 +(@ENTRY_OGRON,0,4,0,61,0,100,0,0,0,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,6.281,'Ogron - On Link (WP 5) - Set Orientation'), +(@ENTRY_OGRON,0,5,0,58,0,100,0,7,@ENTRY_OGRON,0,0,80,@ENTRY_OGRON*100+1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ogron - On WP 7 - Run Second Script'), +(@ENTRY_OGRON*100+1,9,0,0,0,0,100,0,0,0,0,0,54,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Paval - On Script - Pause WP'), +(@ENTRY_OGRON*100+1,9,1,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,9,@ENTRY_PAVAL,0,15,0,0,0,0,'Paval - On Script - Say "W-what do you..."'), +(@ENTRY_OGRON*100+1,9,2,0,0,0,100,0,4000,4000,0,0,1,1,0,0,0,0,0,9,@ENTRY_PAVAL,0,15,0,0,0,0,'Paval - On Script - Say "I swear, I didn''t..."'), +(@ENTRY_OGRON*100+1,9,3,0,0,0,100,0,4000,4000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ogron - On Script - Say "Just tell us..."'), +(@ENTRY_OGRON*100+1,9,4,0,0,0,100,0,3500,3500,0,0,1,2,0,0,0,0,0,9,@ENTRY_PAVAL,0,15,0,0,0,0,'Paval - On Script - Say "I... Well, I may..."'), +(@ENTRY_OGRON*100+1,9,5,0,0,0,100,0,3500,3500,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ogron - On Script - Say "Look here,if you..."'), +(@ENTRY_OGRON*100+1,9,6,0,0,0,100,0,2000,2000,0,0,1,3,0,0,0,0,0,9,@ENTRY_PAVAL,0,15,0,0,0,0,'Paval - On Script - Say "Not one step closer..."'), +(@ENTRY_OGRON*100+1,9,7,0,0,0,100,0,3000,3000,0,0,1,4,0,0,0,0,0,9,@ENTRY_PAVAL,0,15,0,0,0,0,'Paval - On Script - Say "And I don''t know..."'), +(@ENTRY_OGRON*100+1,9,8,0,0,0,100,0,3500,3500,0,0,1,5,0,0,0,0,0,9,@ENTRY_PAVAL,0,15,0,0,0,0,'Paval - On Script - Say "What was that? Did..."'), +(@ENTRY_OGRON*100+1,9,9,0,0,0,100,0,0,0,0,0,12,@ENTRY_HALAN,2,5*60*1000,0,0,0,8,0,0,0,-3384.600098,-3211.340088,34.868,0,'Ogron - On Script - Summon Private Hallan'), +(@ENTRY_OGRON*100+1,9,10,0,0,0,100,0,0,0,0,0,12,@ENTRY_SKIRM,2,5*60*1000,0,0,0,8,0,0,0,-3384.443604,-3208.477539,34.849,0,'Ogron - On Script - Summon Theramore Skirmisher'), +(@ENTRY_OGRON*100+1,9,11,0,0,0,100,0,0,0,0,0,12,@ENTRY_SKIRM,2,5*60*1000,0,0,0,8,0,0,0,-3385.615234,-3209.867432,34.904,0,'Ogron - On Script - Summon Theramore Skirmisher'), +(@ENTRY_OGRON*100+1,9,12,0,0,0,100,0,0,0,0,0,12,@ENTRY_CALDWELL,2,5*60*1000,0,0,0,8,0,0,0,-3381.498535,-3209.195068,35.037,0,'Ogron - On Script - Summon Lieutenant Caldwell'), +(@ENTRY_OGRON*100+1,9,13,0,0,0,100,0,0,0,0,0,8,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ogron - On Script - Set react state aggresive'), + +(@ENTRY_HALAN,0,0,0,11,0,100,0,0,0,0,0,46,5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Hallan - On Spawn - Move forward'), +(@ENTRY_SKIRM,0,0,0,11,0,100,0,0,0,0,0,46,4.5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Skirmisher - On Spawn - Move forward'), +(@ENTRY_HALAN,0,1,0,11,0,100,0,0,0,0,0,59,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Hallan - On Spawn - Set Run 0'), +(@ENTRY_SKIRM,0,1,0,11,0,100,0,0,0,0,0,59,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Skirmisher - On Spawn - Set Run 0'), + +(@ENTRY_CALDWELL,0,0,0,11,0,100,0,0,0,0,0,80,@ENTRY_CALDWELL*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Caldwell - On spawn - Script'), +(@ENTRY_CALDWELL*100,9,0,0,0,0,100,0,0,0,0,0,69,0,0,0,0,0,0,8,0,0,0,-3373.983398,-3210.881104,34.711,0,'Caldwell - On Script - Move'), +(@ENTRY_CALDWELL*100,9,1,0,0,0,100,0,2000,2000,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'Caldwell - On Script - Say "Paval Reethe! Found..."'), +(@ENTRY_CALDWELL*100,9,2,0,0,0,100,0,4000,4000,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,'Caldwell - On Script - Say "Private, show Lieutenant..."'), +(@ENTRY_CALDWELL*100,9,3,0,0,0,100,0,500,500,0,0,45,1,1,0,0,0,0,11,@ENTRY_HALAN,20,0,0,0,0,0,'Caldwell - On Script - Set Data Hallan'), + +(@ENTRY_HALAN,0,2,0,38,0,100,0,1,1,0,0,80,@ENTRY_HALAN*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Hallan - On Data Set - Run Script'), +(@ENTRY_HALAN*100,9,0,0,0,0,100,0,1000,1000,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'Hallan - On Script - Say "Gladly, sir."'), +(@ENTRY_HALAN*100,9,1,0,0,0,100,0,0,0,0,0,11,@SPELL_FAKE_SHOT,0,0,0,0,0,11,@ENTRY_PAVAL,60,0,0,0,0,0,'Hallan - On Script - Cast Fake Shot'), + +(@ENTRY_PAVAL,0,0,0,8,0,100,0,@SPELL_FAKE_SHOT,0,0,0,80,@ENTRY_PAVAL*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Paval - On Spellhit - Run Script'), +(@ENTRY_PAVAL*100,9,0,0,0,0,100,0,0,0,0,0,1,6,0,0,0,0,0,9,@ENTRY_PAVAL,0,15,0,0,0,0,'Paval - On Script - Say "Paval staggers back..."'), +(@ENTRY_PAVAL*100,9,1,0,0,0,100,0,2000,2000,0,0,1,7,0,0,0,0,0,9,@ENTRY_PAVAL,0,15,0,0,0,0,'Paval - On Script - Say "Ugh... Hallan..."'), +(@ENTRY_PAVAL*100,9,2,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,2.771,'Paval - On Script - Face Caldwell'), +(@ENTRY_PAVAL*100,9,3,0,0,0,100,0,2000,2000,0,0,1,2,0,0,0,0,0,9,@ENTRY_CALDWELL,0,15,0,0,0,0,'Caldwell - On Script - Say "Now let''s..."'), +(@ENTRY_PAVAL*100,9,4,0,0,0,100,0,1000,1000,0,0,1,4,0,0,0,0,0,9,@ENTRY_OGRON,0,15,0,0,0,0,'Ogron - On Script - Say "Damn it! You..."'), +(@ENTRY_PAVAL*100,9,5,0,0,0,100,0,0,0,0,0,2,16,0,0,0,0,0,9,@ENTRY_HALAN,0,15,0,0,0,0,'Paval - On Script - Set faction 151 on Hallan'), +(@ENTRY_PAVAL*100,9,6,0,0,0,100,0,0,0,0,0,2,16,0,0,0,0,0,9,@ENTRY_SKIRM,0,15,0,0,0,0,'Paval - On Script - Set faction 151 on Skirm'), +(@ENTRY_PAVAL*100,9,7,0,0,0,100,0,0,0,0,0,2,16,0,0,0,0,0,9,@ENTRY_CALDWELL,0,15,0,0,0,0,'Paval - On Script - Set faction 151 on Caldwell'), + +(@ENTRY_CALDWELL,0,1,0,6,0,100,0,0,0,0,0,45,1,1,0,0,0,0,11,@ENTRY_PAVAL,20,0,0,0,0,0,'Caldwell - On Death - Set data to Paval'), +(@ENTRY_CALDWELL,0,2,0,6,0,100,0,0,0,0,0,45,1,1,0,0,0,0,11,@ENTRY_OGRON,20,0,0,0,0,0,'Caldwell - On Death - Set data to Ogron'), +(@ENTRY_OGRON,0,7,0,38,0,100,0,1,1,0,0,69,0,0,0,0,0,0,8,0,0,0,-3366.86,-3209.47,33.9713,0,'Ogron - On Data set - Move to pos'), +(@ENTRY_PAVAL,0,6,0,38,0,100,0,1,1,0,0,80,@ENTRY_PAVAL*100+1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Paval - On Data Set - Run second timed action list'), +(@ENTRY_PAVAL*100+1,9,0,0,0,0,100,0,0,0,0,0,15,1273,0,0,0,0,0,17,0,15,0,0,0,0,0,'Paval - On Script - Quest Credit'), +(@ENTRY_PAVAL*100+1,9,1,0,0,0,100,0,2000,2000,0,0,84,5,0,0,0,0,0,9,@ENTRY_OGRON,0,15,0,0,0,0,'Ogron - On Script - Say "Still with us..."'), +(@ENTRY_PAVAL*100+1,9,2,0,0,0,100,0,2000,2000,0,0,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Paval - On Script - Say "Must be your lucky day..."'), +(@ENTRY_PAVAL*100+1,9,3,0,0,0,100,0,0,0,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Paval - On Script - Die'), +(@ENTRY_PAVAL*100+1,9,4,0,0,0,100,0,1000,1000,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Paval - On Script - Despawn'), +(@ENTRY_PAVAL*100+1,9,5,0,0,0,100,0,1000,1000,0,0,84,6,0,0,0,0,0,9,@ENTRY_OGRON,0,15,0,0,0,0,'Ogron - On Script - Say "Looks dead to me..."'), +(@ENTRY_PAVAL*100+1,9,6,0,0,0,100,0,3500,3500,0,0,84,7,0,0,0,0,0,9,@ENTRY_OGRON,0,15,0,0,0,0,'Ogron - On Script - Say "By the way..."'), +(@ENTRY_PAVAL*100+1,9,7,0,0,0,100,0,0,0,0,0,45,4,4,0,0,0,0,9,@ENTRY_OGRON,0,15,0,0,0,0,'Paval - On Script - Set Data Ogron'), + +(@ENTRY_OGRON,0,8,0,0,0,100,1,500,1500,0,0,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ogron - In combat say "Me smash.." or "I''ll crush you!"'); + +-- Texts +DELETE FROM `creature_text` WHERE `entry` IN (@ENTRY_OGRON,@ENTRY_PAVAL,@ENTRY_CALDWELL,@ENTRY_HALAN); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY_OGRON,0,0,'I noticed some fire on that island over there. A human, too. Let''s go check it out, $N.',12,0,0,0,0,0,'Ogron'), +(@ENTRY_OGRON,1,0,'That''s Reethe alright. Let''s go see what he has to say, yeah?',12,0,0,0,0,0,'Ogron'), + +(@ENTRY_PAVAL,0,0,'W-what do you want? Just leave me alone...',12,0,0,0,0,0,'Paval'), +(@ENTRY_PAVAL,1,0,'I swear, I didn''t steal anything from you! Here, take some of my supplies, just go away!',12,0,0,0,0,0,'Paval'), +(@ENTRY_OGRON,2,0,'Just tell us what you know about the Shady Rest Inn, and I won''t bash your skull in.',12,0,0,0,0,0,'Ogron'), +(@ENTRY_PAVAL,2,0,'I... Well, I may of taken a little thing or two from the inn... but what would an ogre care about that?',12,0,0,0,0,0,'Paval'), +(@ENTRY_OGRON,3,0,'Look here, if you don''t tell me about the fire--',12,0,0,0,0,0,'Ogron'), +(@ENTRY_PAVAL,3,0,'Not one step closer, ogre!',12,0,0,0,0,0,'Paval'), +(@ENTRY_PAVAL,4,0,'And I don''t know anything about this fire of yours...',12,0,0,0,0,0,'Paval'), +(@ENTRY_PAVAL,5,0,'What was that? Did you hear something?',12,0,0,0,0,0,'Paval'), + +(@ENTRY_CALDWELL,0,0,'Paval Reethe! Found you at last. And consorting with ogres now? No fear, even deserters and traitors are afforded some mercy.',12,0,0,0,0,0,'Caldwell'), +(@ENTRY_CALDWELL,1,0,'Private, show Lieutenant Reethe some mercy.',12,0,0,0,0,0,'Caldwell'), +(@ENTRY_HALAN,0,0,'Gladly, sir.',12,0,0,0,0,0,'Hallan'), +(@ENTRY_PAVAL,6,0,'%s staggers back as the arrow lodges itself deeply in his chest.',16,0,0,0,0,0,'Paval'), +(@ENTRY_PAVAL,7,0,'Ugh... Hallan, didn''t think you had it in you...',12,0,0,16,0,0,'Paval'), +(@ENTRY_CALDWELL,2,0,'Now, let''s clean up the rest of the trash, men!',12,0,0,0,0,0,'Caldwell'), +(@ENTRY_OGRON,4,0,'Damn it! You''d better not die on me, human!',12,0,0,0,0,0,'Ogron'), +-- QC +(@ENTRY_OGRON,5,0,'Still with us, Reethe?',12,0,0,0,0,0,'Ogron'), +(@ENTRY_PAVAL,8,0,'Must be your lucky day. Alright, I''ll talk. Just leave me alone. Look, you''re not going to believe me, but it wa... oh, Light, looks like the girl could shoot...',12,0,0,0,0,0,'Paval'), +-- Paval dies & despawns +(@ENTRY_OGRON,6,0,'Looks dead to me. Not much use to us like this. You''d better go back and tell Krog what happened.',12,0,0,0,0,0,'Ogron'), +(@ENTRY_OGRON,7,0,'By the way, thanks for watching my back.',12,0,0,0,0,0,'Ogron'), + +(@ENTRY_OGRON,8,0,'Me smash! You die!',12,0,0,0,0,0,'Ogron'), +(@ENTRY_OGRON,8,1,'I''ll crush you!',12,0,0,0,0,0,'Ogron'); From 7824b84e3af4eb2bca8d22d5b1a0b18a2b9452be Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 31 May 2012 16:55:51 +0100 Subject: [PATCH 0878/1149] DB/NPCs: Grunt Ounda should only have a female model --- sql/updates/world/2012_05_31_02_world_creature_model_info.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2012_05_31_02_world_creature_model_info.sql diff --git a/sql/updates/world/2012_05_31_02_world_creature_model_info.sql b/sql/updates/world/2012_05_31_02_world_creature_model_info.sql new file mode 100644 index 00000000000..a1aa1155aa6 --- /dev/null +++ b/sql/updates/world/2012_05_31_02_world_creature_model_info.sql @@ -0,0 +1,4 @@ +-- Grunt Ounda should only have a female model +UPDATE `creature_model_info` SET + `modelid_other_gender` = 0 +WHERE `modelid` = 4260; From 851f43b0a618fa1977197d53ab005c8d0da91327 Mon Sep 17 00:00:00 2001 From: gecko32 Date: Thu, 31 May 2012 18:40:34 +0100 Subject: [PATCH 0879/1149] DB/Loot: Update drop chance of Ensorcelled Parchment from 0.2% to 100% Change respawn time of that chest from 2 secs to 3 minutes Closes #6445 --- .../world/2012_05_31_03_world_gameobject_loot_template.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2012_05_31_03_world_gameobject_loot_template.sql diff --git a/sql/updates/world/2012_05_31_03_world_gameobject_loot_template.sql b/sql/updates/world/2012_05_31_03_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..5dcedaaf342 --- /dev/null +++ b/sql/updates/world/2012_05_31_03_world_gameobject_loot_template.sql @@ -0,0 +1,4 @@ +-- Update drop chance of Ensorcelled Parchment from 0.2% to 100% +UPDATE `gameobject_loot_template` SET `ChanceOrQuestChance`=100 WHERE `entry`=1570 AND `item`=3706; +-- Change spawntime from 2 secs to 3 minutes +UPDATE `gameobject` SET `spawntimesecs`=180 WHERE `id`=1765; From 425eeb828048e7506acc974540ca8ab8c99047b0 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 31 May 2012 19:45:11 +0200 Subject: [PATCH 0880/1149] Core/Movement * Implemented creature movement on transports * Set minimum speed for creature allowed to start movement (too low speed leads to overflows in movement time calculations which in turn leads to crashes) --- src/server/game/Entities/Creature/Creature.h | 6 ++ .../game/Entities/Transport/Transport.cpp | 33 +++++++-- .../game/Entities/Transport/Transport.h | 2 + src/server/game/Entities/Unit/Unit.cpp | 32 ++++++--- src/server/game/Movement/MotionMaster.cpp | 6 +- src/server/game/Movement/MotionMaster.h | 4 +- .../game/Movement/Spline/MoveSpline.cpp | 2 +- .../game/Movement/Spline/MoveSplineInit.cpp | 67 ++++++++++++++++--- .../game/Movement/Spline/MoveSplineInit.h | 23 ++++--- .../game/Movement/Spline/MoveSplineInitArgs.h | 3 +- .../Movement/Spline/MovementPacketBuilder.cpp | 14 +--- .../IcecrownCitadel/boss_sindragosa.cpp | 6 +- .../IcecrownCitadel/icecrown_citadel.cpp | 2 +- .../UtgardePinnacle/boss_svala.cpp | 4 +- 14 files changed, 146 insertions(+), 58 deletions(-) diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index f6021a7d7ec..c8ebf1aa13b 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -677,6 +677,11 @@ class Creature : public Unit, public GridObject, public MapCreature void GetHomePosition(float &x, float &y, float &z, float &ori) { m_homePosition.GetPosition(x, y, z, ori); } Position GetHomePosition() { return m_homePosition; } + void SetTransportHomePosition(float x, float y, float z, float o) { m_transportHomePosition.Relocate(x, y, z, o); } + void SetTransportHomePosition(const Position &pos) { m_transportHomePosition.Relocate(pos); } + void GetTransportHomePosition(float &x, float &y, float &z, float &ori) { m_transportHomePosition.GetPosition(x, y, z, ori); } + Position GetTransportHomePosition() { return m_transportHomePosition; } + uint32 GetWaypointPath(){return m_path_id;} void LoadPath(uint32 pathid) { m_path_id = pathid; } @@ -750,6 +755,7 @@ class Creature : public Unit, public GridObject, public MapCreature uint32 m_originalEntry; Position m_homePosition; + Position m_transportHomePosition; bool DisableReputationGain; diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 4f5d5ade7ec..95c6d308626 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -656,6 +656,7 @@ uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y, o + GetOrientation()); creature->SetHomePosition(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), creature->GetOrientation()); + creature->SetTransportHomePosition(creature->m_movementInfo.t_pos); if (!creature->IsPositionValid()) { @@ -698,11 +699,33 @@ void Transport::UpdateNPCPositions() Creature* npc = *itr; float x, y, z, o; - o = GetOrientation() + npc->m_movementInfo.t_pos.m_orientation; - x = GetPositionX() + (npc->m_movementInfo.t_pos.m_positionX * cos(GetOrientation()) + npc->m_movementInfo.t_pos.m_positionY * sin(GetOrientation() + M_PI)); - y = GetPositionY() + (npc->m_movementInfo.t_pos.m_positionY * cos(GetOrientation()) + npc->m_movementInfo.t_pos.m_positionX * sin(GetOrientation())); - z = GetPositionZ() + npc->m_movementInfo.t_pos.m_positionZ; - npc->SetHomePosition(x, y, z, o); + npc->m_movementInfo.t_pos.GetPosition(x, y, z, o); + CalculatePassengerPosition(x, y, z, o); GetMap()->CreatureRelocation(npc, x, y, z, o, false); + npc->GetTransportHomePosition(x, y, z, o); + CalculatePassengerPosition(x, y, z, o); + npc->SetHomePosition(x, y, z, o); } } + +//! This method transforms supplied transport offsets into global coordinates +void Transport::CalculatePassengerPosition(float& x, float& y, float& z, float& o) +{ + float inx = x, iny = y, inz = z, ino = o; + o = GetOrientation() + ino; + x = GetPositionX() + (inx * cos(GetOrientation()) + iny * sin(GetOrientation() + M_PI)); + y = GetPositionY() + (iny * cos(GetOrientation()) + inx * sin(GetOrientation())); + z = GetPositionZ() + inz; +} + +//! This method transforms supplied global coordinates into local offsets +void Transport::CalculatePassengerOffset(float& x, float& y, float& z, float& o) +{ + o -= GetOrientation(); + z -= GetPositionZ(); + y -= GetPositionY(); // y = searchedY * cos(o) + searchedX * sin(o) + x -= GetPositionX(); // x = searchedX * cos(o) + searchedY * sin(o + pi) + float inx = x, iny = y; + y = (iny - inx * tan(GetOrientation())) / (cos(GetOrientation()) - sin(GetOrientation() + M_PI) * tan(GetOrientation())); + x = (inx - iny * sin(GetOrientation() + M_PI) / cos(GetOrientation())) / (cos(GetOrientation()) - tan(GetOrientation()) * sin(GetOrientation() + M_PI)); +} diff --git a/src/server/game/Entities/Transport/Transport.h b/src/server/game/Entities/Transport/Transport.h index 518dcf6359d..4b0c42c9071 100755 --- a/src/server/game/Entities/Transport/Transport.h +++ b/src/server/game/Entities/Transport/Transport.h @@ -47,6 +47,8 @@ class Transport : public GameObject uint32 AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y, float z, float o, uint32 anim=0); void UpdatePosition(MovementInfo* mi); void UpdateNPCPositions(); + void CalculatePassengerPosition(float& x, float& y, float& z, float& o); + void CalculatePassengerOffset(float& x, float& y, float& z, float& o); void BuildStartMovePacket(Map const* targetMap); void BuildStopMovePacket(Map const* targetMap); uint32 GetScriptId() const { return ScriptId; } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 71977bf469c..1ff7b9f4d4b 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -396,10 +396,25 @@ void Unit::UpdateSplineMovement(uint32 t_diff) m_movesplineTimer.Reset(POSITION_UPDATE_DELAY); Movement::Location loc = movespline->ComputePosition(); - if (GetTypeId() == TYPEID_PLAYER) - ((Player*)this)->UpdatePosition(loc.x,loc.y,loc.z,loc.orientation); - else - GetMap()->CreatureRelocation((Creature*)this,loc.x,loc.y,loc.z,loc.orientation); + if (HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + { + Position& pos = m_movementInfo.t_pos; + pos.m_positionX = loc.x; + pos.m_positionY = loc.y; + pos.m_positionZ = loc.z; + pos.m_orientation = loc.orientation; + if (Unit* vehicle = GetVehicleBase()) + { + loc.x += vehicle->GetPositionX(); + loc.y += vehicle->GetPositionY(); + loc.z += vehicle->GetPositionZMinusOffset(); + loc.orientation = vehicle->GetOrientation(); + } + else if (Transport* trans = GetTransport()) + trans->CalculatePassengerPosition(loc.x, loc.y, loc.z, loc.orientation); + } + + UpdatePosition(loc.x, loc.y, loc.z, loc.orientation); } } @@ -414,7 +429,7 @@ void Unit::SendMonsterMoveExitVehicle(Position const* newPos) WorldPacket data(SMSG_MONSTER_MOVE, 1+12+4+1+4+4+4+12+GetPackGUID().size()); data.append(GetPackGUID()); - data << uint8(GetTypeId() == TYPEID_PLAYER ? 1 : 0); // new in 3.1, bool + data << uint8(GetTypeId() == TYPEID_PLAYER ? 1 : 0); // sets/unsets MOVEMENTFLAG2_UNK7 (0x40) data << GetPositionX() << GetPositionY() << GetPositionZ(); data << getMSTime(); @@ -437,7 +452,7 @@ void Unit::SendMonsterMoveTransport(Unit* vehicleOwner) data.append(GetPackGUID()); data.append(vehicleOwner->GetPackGUID()); data << int8(GetTransSeat()); - data << uint8(0); + data << uint8(0); // sets/unsets MOVEMENTFLAG2_UNK7 (0x40) data << GetPositionX() - vehicleOwner->GetPositionX(); data << GetPositionY() - vehicleOwner->GetPositionY(); data << GetPositionZ() - vehicleOwner->GetPositionZ(); @@ -12662,7 +12677,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced) { // Set creature speed rate from CreatureInfo if (GetTypeId() == TYPEID_UNIT) - speed *= ToCreature()->GetCreatureTemplate()->speed_walk; + speed *= ToCreature()->GetCreatureTemplate()->speed_run; // at this point, MOVE_WALK is never reached // Normalize speed by 191 aura SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED if need // TODO: possible affect only on MOVE_RUN @@ -12982,8 +12997,7 @@ void Unit::TauntFadeOut(Unit* taunter) return; } - //m_ThreatManager.tauntFadeOut(taunter); - target = m_ThreatManager.getHostilTarget(); + target = creature->SelectVictim(); // might have more taunt auras remaining if (target && target != taunter) { diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index c0e1eb842ae..bc0570bb73b 100755 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -298,7 +298,7 @@ void MotionMaster::MovePoint(uint32 id, float x, float y, float z) } } -void MotionMaster::MoveLand(uint32 id, Position const& pos, float speed) +void MotionMaster::MoveLand(uint32 id, Position const& pos) { float x, y, z; pos.GetPosition(x, y, z); @@ -307,13 +307,12 @@ void MotionMaster::MoveLand(uint32 id, Position const& pos, float speed) Movement::MoveSplineInit init(*_owner); init.MoveTo(x,y,z); - init.SetVelocity(speed); init.SetAnimation(Movement::ToGround); init.Launch(); Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE); } -void MotionMaster::MoveTakeoff(uint32 id, Position const& pos, float speed) +void MotionMaster::MoveTakeoff(uint32 id, Position const& pos) { float x, y, z; pos.GetPosition(x, y, z); @@ -322,7 +321,6 @@ void MotionMaster::MoveTakeoff(uint32 id, Position const& pos, float speed) Movement::MoveSplineInit init(*_owner); init.MoveTo(x,y,z); - init.SetVelocity(speed); init.SetAnimation(Movement::ToFly); init.Launch(); Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE); diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h index d6144bfcc3a..727f626cdea 100755 --- a/src/server/game/Movement/MotionMaster.h +++ b/src/server/game/Movement/MotionMaster.h @@ -157,8 +157,8 @@ class MotionMaster //: private std::stack void MovePoint(uint32 id, float x, float y, float z); // These two movement types should only be used with creatures having landing/takeoff animations - void MoveLand(uint32 id, Position const& pos, float speed); - void MoveTakeoff(uint32 id, Position const& pos, float speed); + void MoveLand(uint32 id, Position const& pos); + void MoveTakeoff(uint32 id, Position const& pos); void MoveCharge(float x, float y, float z, float speed = SPEED_CHARGE, uint32 id = EVENT_CHARGE); void MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ); diff --git a/src/server/game/Movement/Spline/MoveSpline.cpp b/src/server/game/Movement/Spline/MoveSpline.cpp index 91b4ff08250..b1c25aedfd7 100644 --- a/src/server/game/Movement/Spline/MoveSpline.cpp +++ b/src/server/game/Movement/Spline/MoveSpline.cpp @@ -203,7 +203,7 @@ bool MoveSplineInitArgs::Validate() const return false;\ } CHECK(path.size() > 1); - CHECK(velocity > 0.f); + CHECK(velocity > 0.1f); CHECK(time_perc >= 0.f && time_perc <= 1.f); //CHECK(_checkPathBounds()); return true; diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index e586cb4f4f9..b8440e06076 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -20,6 +20,8 @@ #include "MoveSpline.h" #include "MovementPacketBuilder.h" #include "Unit.h" +#include "Transport.h" +#include "Vehicle.h" namespace Movement { @@ -58,17 +60,25 @@ namespace Movement { MoveSpline& move_spline = *unit.movespline; - Location real_position(unit.GetPositionX(),unit.GetPositionY(),unit.GetPositionZMinusOffset(),unit.GetOrientation()); - // there is a big chane that current position is unknown if current state is not finalized, need compute it + bool transport = false; + Location real_position(unit.GetPositionX(), unit.GetPositionY(), unit.GetPositionZMinusOffset(), unit.GetOrientation()); + if (unit.HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + { + transport = true; + real_position.x = unit.GetTransOffsetX(); + real_position.y = unit.GetTransOffsetY(); + real_position.z = unit.GetTransOffsetZ(); + real_position.orientation = unit.GetTransOffsetO(); + } + + // there is a big chance that current position is unknown if current state is not finalized, need compute it // this also allows calculate spline position and update map position in much greater intervals if (!move_spline.Finalized()) real_position = move_spline.ComputePosition(); + // should i do the things that user should do? - no. if (args.path.empty()) - { - // should i do the things that user should do? - MoveTo(real_position); - } + return; // corrent first vertex args.path[0] = real_position; @@ -82,7 +92,7 @@ namespace Movement moveFlags |= (MOVEMENTFLAG_SPLINE_ENABLED|MOVEMENTFLAG_FORWARD); - if (args.velocity == 0.f) + if (!args.HasVelocity) args.velocity = unit.GetSpeed(SelectSpeedType(moveFlags)); if (!args.Validate()) @@ -94,8 +104,20 @@ namespace Movement unit.m_movementInfo.SetMovementFlags((MovementFlags)moveFlags); move_spline.Initialize(args); - WorldPacket data(SMSG_MONSTER_MOVE, 64); + WorldPacket data(!transport ? SMSG_MONSTER_MOVE : SMSG_MONSTER_MOVE_TRANSPORT, 64); data.append(unit.GetPackGUID()); + if (transport) + { + if (unit.GetVehicle()) + data.appendPackGUID(unit.GetVehicleBase()->GetGUID()); + else if (unit.GetTransport()) + data.appendPackGUID(unit.GetTransGUID()); + else + data << uint8(0); + + data << int8(unit.GetTransSeat()); + } + PacketBuilder::WriteMonsterMove(move_spline, data); unit.SendMessageToSet(&data,true); } @@ -119,4 +141,33 @@ namespace Movement args.facing.angle = G3D::wrap(angle, 0.f, (float)G3D::twoPi()); args.flags.EnableFacingAngle(); } + + void MoveSplineInit::MoveTo(Vector3 const& dest) + { + args.path_Idx_offset = 0; + args.path.resize(2); + TransportPathTransform transform(unit); + args.path[1] = transform(dest); + } + + Vector3 TransportPathTransform::operator()(Vector3 input) + { + if (_owner.HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + { + if (Unit* vehicle = _owner.GetVehicleBase()) + { + input.x -= vehicle->GetPositionX(); + input.y -= vehicle->GetPositionY(); + input.z -= vehicle->GetPositionZMinusOffset(); + } + else if (Transport* transport = _owner.GetTransport()) + { + float unused = 0.0f; + transport->CalculatePassengerOffset(input.x, input.y, input.z, unused); + } + } + + return input; + } + } diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h index 7ef6cd7a120..b1b08d97cfa 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.h +++ b/src/server/game/Movement/Spline/MoveSplineInit.h @@ -33,6 +33,17 @@ namespace Movement FlyToGround = 3, // 463 = FlyToGround }; + // Transforms coordinates from global to transport offsets + class TransportPathTransform + { + public: + TransportPathTransform(Unit& owner) : _owner(owner) { } + Vector3 operator()(Vector3 input); + + private: + Unit& _owner; + }; + /* Initializes and launches spline movement */ class MoveSplineInit @@ -123,14 +134,15 @@ namespace Movement inline void MoveSplineInit::SetSmooth() { args.flags.EnableCatmullRom();} inline void MoveSplineInit::SetCyclic() { args.flags.cyclic = true;} inline void MoveSplineInit::SetFall() { args.flags.EnableFalling();} - inline void MoveSplineInit::SetVelocity(float vel){ args.velocity = vel;} + inline void MoveSplineInit::SetVelocity(float vel) { args.velocity = vel; args.HasVelocity = true; } inline void MoveSplineInit::SetOrientationInversed() { args.flags.orientationInversed = true;} inline void MoveSplineInit::SetOrientationFixed(bool enable) { args.flags.orientationFixed = enable;} inline void MoveSplineInit::MovebyPath(const PointsArray& controls, int32 path_offset) { args.path_Idx_offset = path_offset; - args.path.assign(controls.begin(),controls.end()); + args.path.resize(controls.size()); + std::transform(controls.begin(), controls.end(), args.path.begin(), TransportPathTransform(unit)); } inline void MoveSplineInit::MoveTo(float x, float y, float z) @@ -139,13 +151,6 @@ namespace Movement MoveTo(v); } - inline void MoveSplineInit::MoveTo(const Vector3& dest) - { - args.path_Idx_offset = 0; - args.path.resize(2); - args.path[1] = dest; - } - inline void MoveSplineInit::SetParabolic(float amplitude, float time_shift) { args.time_perc = time_shift; diff --git a/src/server/game/Movement/Spline/MoveSplineInitArgs.h b/src/server/game/Movement/Spline/MoveSplineInitArgs.h index 26fbbdd0fcc..74409c9562b 100644 --- a/src/server/game/Movement/Spline/MoveSplineInitArgs.h +++ b/src/server/game/Movement/Spline/MoveSplineInitArgs.h @@ -42,7 +42,7 @@ namespace Movement struct MoveSplineInitArgs { MoveSplineInitArgs(size_t path_capacity = 16) : path_Idx_offset(0), - velocity(0.f), parabolic_amplitude(0.f), time_perc(0.f), splineId(0), initialOrientation(0.f) + velocity(0.f), parabolic_amplitude(0.f), time_perc(0.f), splineId(0), initialOrientation(0.f), HasVelocity(false) { path.reserve(path_capacity); } @@ -56,6 +56,7 @@ namespace Movement float time_perc; uint32 splineId; float initialOrientation; + bool HasVelocity; /** Returns true to show that the arguments were configured correctly and MoveSpline initialization will succeed. */ bool Validate() const; diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp index 0260767dbe2..16f06a25058 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp @@ -44,20 +44,8 @@ namespace Movement void PacketBuilder::WriteCommonMonsterMovePart(const MoveSpline& move_spline, WorldPacket& data) { MoveSplineFlag splineflags = move_spline.splineflags; - /*if (unit->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) - { - data.SetOpcode(SMSG_MONSTER_MOVE_TRANSPORT); - if (unit->GetVehicle()) - data << unit->GetVehicle()->GetBase()->GetPackGUID(); - else if (unit->GetTransport()) - data << unit->GetTransport()->GetPackGUID(); - else - data << uint64(0); - data << int8(unit->GetTransSeat()); - }*/ - - data << uint8(0); + data << uint8(0); // sets/unsets MOVEMENTFLAG2_UNK7 (0x40) data << move_spline.spline.getPoint(move_spline.spline.first()); data << move_spline.GetId(); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 6039ace44ab..734639a8b51 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -167,7 +167,7 @@ class FrostwyrmLandEvent : public BasicEvent bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) { - _owner.GetMotionMaster()->MoveLand(POINT_FROSTWYRM_LAND, _dest, 8.247422f); + _owner.GetMotionMaster()->MoveLand(POINT_FROSTWYRM_LAND, _dest); return true; } @@ -481,7 +481,7 @@ class boss_sindragosa : public CreatureScript Position pos; pos.Relocate(me); pos.m_positionZ += 17.0f; - me->GetMotionMaster()->MoveTakeoff(POINT_TAKEOFF, pos, 8.30078125f); + me->GetMotionMaster()->MoveTakeoff(POINT_TAKEOFF, pos); events.CancelEventGroup(EVENT_GROUP_LAND_PHASE); events.ScheduleEvent(EVENT_AIR_PHASE, 110000); break; @@ -523,7 +523,7 @@ class boss_sindragosa : public CreatureScript events.ScheduleEvent(EVENT_FROST_BREATH, urand(10000, 15000), EVENT_GROUP_LAND_PHASE); events.ScheduleEvent(EVENT_UNCHAINED_MAGIC, urand(12000, 17000), EVENT_GROUP_LAND_PHASE); events.ScheduleEvent(EVENT_ICY_GRIP, urand(35000, 40000), EVENT_GROUP_LAND_PHASE); - me->GetMotionMaster()->MoveLand(POINT_LAND_GROUND, SindragosaLandPos, 0.0f); + me->GetMotionMaster()->MoveLand(POINT_LAND_GROUND, SindragosaLandPos); break; case EVENT_THIRD_PHASE_CHECK: { diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index fab9a5f0740..6fd3cd2a294 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -1926,7 +1926,7 @@ class spell_svalna_revive_champion : public SpellScriptLoader //pos.m_positionZ = caster->GetBaseMap()->GetHeight(caster->GetPhaseMask(), pos.GetPositionX(), pos.GetPositionY(), caster->GetPositionZ(), true, 50.0f); //pos.m_positionZ += 0.05f; caster->SetHomePosition(pos); - caster->GetMotionMaster()->MoveLand(POINT_LAND, pos, caster->GetSpeed(MOVE_FLIGHT)); + caster->GetMotionMaster()->MoveLand(POINT_LAND, pos); } void Register() diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index 29b8f2e7f48..44cd1184098 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -276,7 +276,7 @@ public: arthas->CastSpell(me, SPELL_TRANSFORMING_CHANNEL, false); pos.Relocate(me); pos.m_positionZ += 8.0f; - me->GetMotionMaster()->MoveTakeoff(0, pos, 3.30078125f); + me->GetMotionMaster()->MoveTakeoff(0, pos); // spectators flee event if (instance) { @@ -333,7 +333,7 @@ public: pos.m_positionX = me->GetHomePosition().GetPositionX(); pos.m_positionY = me->GetHomePosition().GetPositionY(); pos.m_positionZ = 90.6065f; - me->GetMotionMaster()->MoveLand(0, pos, 6.247422f); + me->GetMotionMaster()->MoveLand(0, pos); me->SetDisableGravity(false, true); me->SetHover(true); ++introPhase; From 2172705b998003e7ea276c9efce00ad6a6c26128 Mon Sep 17 00:00:00 2001 From: warriorpoetex Date: Thu, 31 May 2012 20:50:35 +0100 Subject: [PATCH 0881/1149] DB/SAI: Ragefire Chasm Boss SAI Fix/Addition - Converted some EAI to SAI as well as added SAI to Taragaman the Hungerer. Closes #6661 --- sql/updates/world/2012_05_31_05_world_sai.sql | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 sql/updates/world/2012_05_31_05_world_sai.sql diff --git a/sql/updates/world/2012_05_31_05_world_sai.sql b/sql/updates/world/2012_05_31_05_world_sai.sql new file mode 100644 index 00000000000..aa95c93aae1 --- /dev/null +++ b/sql/updates/world/2012_05_31_05_world_sai.sql @@ -0,0 +1,30 @@ +-- Ai and Script Update/Addition for Taragaman the Hungerer +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=11520; +DELETE FROM `smart_scripts` WHERE `entryorguid`=11520; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=11520; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(11520, 0, 0, 0, 0, 0, 85, 2, 5000, 5000, 15000, 20000, 11, 18072, 1, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Taragaman the Hungerer - Cast Uppercut'), +(11520, 0, 1, 0, 0, 0, 75, 2, 8000, 8000, 20000, 25000, 11, 11970, 1, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 'Taragaman the Hungerer - Cast Fire Nova'); + +-- Ai and Script Update/Addition for Jergosh the Invoker +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=11518; +DELETE FROM `smart_scripts` WHERE `entryorguid`=11518; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=11518; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(11518, 0, 1, 0, 0, 0, 75, 2, 12000, 12000, 30000, 30000, 11, 20800, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Jergosh the Invoker - Cast Immolat'), +(11518, 0, 0, 0, 0, 0, 85, 2, 30000, 30000, 120000, 120000, 11, 11980, 1, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Jergosh the Invoker - Cast Curse of Weakness'); + +-- Ai and Script Update/Addition for Bazzalan +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=11519; +DELETE FROM `smart_scripts` WHERE `entryorguid`=11519; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=11519; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(11519, 0, 1, 0, 0, 0, 75, 2, 3000, 5000, 12000, 15000, 11, 2818, 1, 32, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Bazzalan - Cast Poison'), +(11519, 0, 0, 0, 0, 0, 85, 2, 8000, 8000, 16000, 17000, 11, 14873, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Bazzalan - Cast Sinister Strike'); + +-- Ai and Script Update/Addition for Oggleflint +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=11517; +DELETE FROM `smart_scripts` WHERE `entryorguid`=11517; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=11517; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(11517, 0, 0, 0, 0, 0, 70, 2, 8000, 8000, 15000, 15000, 11, 40505, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Oggleflint - Cast Cleave'); From 2f557f507d075c55c3f913cba51bd2ae4f795172 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 31 May 2012 17:48:30 -0230 Subject: [PATCH 0882/1149] DB/gameobject: Add Missing Draconic for Dummies Objects --- sql/updates/world/2012_05_31_06_world_gameobject.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/2012_05_31_06_world_gameobject.sql diff --git a/sql/updates/world/2012_05_31_06_world_gameobject.sql b/sql/updates/world/2012_05_31_06_world_gameobject.sql new file mode 100644 index 00000000000..1db1d6fbd76 --- /dev/null +++ b/sql/updates/world/2012_05_31_06_world_gameobject.sql @@ -0,0 +1,7 @@ +-- Add Missing Draconic for Dummies Objects +SET @GUID := 4595; +DELETE FROM `gameobject` WHERE `guid` BETWEEN @GUID AND @GUID+2; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(@GUID,180665,0,1,1,-8340.196,413.7499,124.489677,2.82742977,0,0,0.987688,0.156436,180,255,1), +(@GUID+1,180666,0,1,1,1628.83984,133.9376,-60.96726,-0.401424885,0,0,-0.199368,0.979925,180,255,1), +(@GUID+2,180667,469,1,1,-7526.57,-924.776,458.826,0.558504,0,0,0.275637,0.961262,180,255,1); From a696860236eb529272af03b5db6b7e75b0b9a5ef Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 31 May 2012 18:11:55 -0230 Subject: [PATCH 0883/1149] DB/gossip: Add missing gossip for Draconic for Dummies objects --- sql/updates/world/2012_05_31_07_world_gossip.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2012_05_31_07_world_gossip.sql diff --git a/sql/updates/world/2012_05_31_07_world_gossip.sql b/sql/updates/world/2012_05_31_07_world_gossip.sql new file mode 100644 index 00000000000..9b82f333a4c --- /dev/null +++ b/sql/updates/world/2012_05_31_07_world_gossip.sql @@ -0,0 +1,4 @@ +-- Add missing gossip for Draconic for Dummies objects +DELETE FROM `gossip_menu` WHERE `entry` IN (6668,6669,6670); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(6668,7937),(6669,7937),(6670,7937); From 34735a1ea4cb7c85839880e09b7460302710421d Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 31 May 2012 18:14:24 -0230 Subject: [PATCH 0884/1149] DB/gameobject template: Fix faction for Draconic for Dummies objects --- sql/updates/world/2012_05_31_08_world_gameobject_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_05_31_08_world_gameobject_template.sql diff --git a/sql/updates/world/2012_05_31_08_world_gameobject_template.sql b/sql/updates/world/2012_05_31_08_world_gameobject_template.sql new file mode 100644 index 00000000000..41527e22919 --- /dev/null +++ b/sql/updates/world/2012_05_31_08_world_gameobject_template.sql @@ -0,0 +1,2 @@ +-- Fix faction for Draconic for Dummies objects +UPDATE `gameobject_template` SET `faction`=35 WHERE `entry` IN (180665,180667); From 7cb1935010d91232d103b602e1db7af1d59a4af0 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 31 May 2012 18:31:22 -0230 Subject: [PATCH 0885/1149] DB/SAI: Some Ragefire Trash Mob EAI to SAI Conversions By; Ragefire Trash Mob EAI to SAI Conversions Closes Issue 6662 --- sql/updates/world/2012_05_31_09_world_sai.sql | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 sql/updates/world/2012_05_31_09_world_sai.sql diff --git a/sql/updates/world/2012_05_31_09_world_sai.sql b/sql/updates/world/2012_05_31_09_world_sai.sql new file mode 100644 index 00000000000..a7eb1248905 --- /dev/null +++ b/sql/updates/world/2012_05_31_09_world_sai.sql @@ -0,0 +1,27 @@ + -- EAI to SAI Convert Ragefire Trogg +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=11318; +DELETE FROM `smart_scripts` WHERE `entryorguid`=11318; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=11318; +INSERT INTO smart_scripts (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) +VALUES (11318, 0, 0, 0, 9, 0, 100, 2, 0, 5, 5000, 8000, 11, 11976, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Ragefire Trogg - Cast Strike'); + +-- EAI to SAI Convert Earthborer +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=11320; +DELETE FROM `smart_scripts` WHERE `entryorguid`=11320; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=11320; +INSERT INTO smart_scripts (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) +VALUES (11320, 0, 0, 0, 0, 0, 70, 2, 6000, 6000, 10000, 10000, 11, 18070, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Earthborer - Cast Earthborer Acid'); + +-- EAI to SAI Convert Searing Blade Cultist +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=11322; +DELETE FROM `smart_scripts` WHERE `entryorguid`=11322; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=11322; +INSERT INTO smart_scripts (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) +VALUES (11322, 0, 0, 0, 0, 0, 85, 2, 12000, 12000, 30000, 30000, 11, 18266, 1, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Searing Blade Cultist - Cast Curse of Agony'); + +-- EAI to SAI Convert Searing Blade Enforcer +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=11323; +DELETE FROM `smart_scripts` WHERE `entryorguid`=11323; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=11323; +INSERT INTO smart_scripts (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) +VALUES (11323, 0, 0, 0, 0, 0, 75, 2, 8000, 8000, 10000, 10000, 11, 8242, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Searing Blade Enforcer - Cast Shield Slam'); From f5ab1a3a5ccda29a5a67c4fcbdfd7a61e78ddb43 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 31 May 2012 23:04:09 +0200 Subject: [PATCH 0886/1149] Core/Movement: Fixed Unit::StopMoving() --- src/server/game/Entities/Unit/Unit.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 1ff7b9f4d4b..c90b86f2349 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -14795,6 +14795,7 @@ void Unit::StopMoving() return; Movement::MoveSplineInit init(*this); + init.MoveTo(GetPositionX(), GetPositionY(), GetPositionZMinusOffset()); init.SetFacing(GetOrientation()); init.Launch(); } From faaf22d628b538511478a579ef1d95eb61251176 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Thu, 31 May 2012 23:10:44 +0200 Subject: [PATCH 0887/1149] DB/Loot: bump Draconic for Dummies to 100% if on quest Closes #6653 --- sql/updates/world/2012_05_31_10_world_creature_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_05_31_10_world_creature_template.sql diff --git a/sql/updates/world/2012_05_31_10_world_creature_template.sql b/sql/updates/world/2012_05_31_10_world_creature_template.sql new file mode 100644 index 00000000000..5499d26b0e3 --- /dev/null +++ b/sql/updates/world/2012_05_31_10_world_creature_template.sql @@ -0,0 +1,2 @@ +-- update the book to always drop of ragnaros +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=-100 WHERE `entry`=11502 AND `item`=21110; From 189e32cab99bc5a2cc8987298089b90dafa8c222 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 31 May 2012 22:24:44 -0230 Subject: [PATCH 0888/1149] DB/creature: Add a couple more Domesticated Felboar Spawns --- sql/updates/world/2012_05_31_11_world_creature.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sql/updates/world/2012_05_31_11_world_creature.sql diff --git a/sql/updates/world/2012_05_31_11_world_creature.sql b/sql/updates/world/2012_05_31_11_world_creature.sql new file mode 100644 index 00000000000..177c6230964 --- /dev/null +++ b/sql/updates/world/2012_05_31_11_world_creature.sql @@ -0,0 +1,6 @@ +-- Add a couple more Domesticated Felboar Spawns +SET @GUID := 42567; +DELETE FROM `creature` WHERE `guid` IN (@GUID,@GUID+1); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@GUID,21195,530,1,1,0,0,-2678.16016,1477.65625,26.9172077,4.86340427,300,5,0,1,0,1), +(@GUID+1,21195,530,1,1,0,0,-2691.666,1525,21.3857346,0.3155697,300,5,0,1,0,1); From 2b3b8f6dde22c645d4288a8402feabb2bde825f7 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 31 May 2012 23:35:05 -0230 Subject: [PATCH 0889/1149] DB/creature: Add missing 7th Legion Chain Gun spawns for quest "The Chain Gun and You" --- sql/updates/world/2012_05_31_12_world_creature.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sql/updates/world/2012_05_31_12_world_creature.sql diff --git a/sql/updates/world/2012_05_31_12_world_creature.sql b/sql/updates/world/2012_05_31_12_world_creature.sql new file mode 100644 index 00000000000..cad0364d021 --- /dev/null +++ b/sql/updates/world/2012_05_31_12_world_creature.sql @@ -0,0 +1,9 @@ +-- Add missing 7th Legion Chain Gun spawns +DELETE FROM `creature` WHERE `guid` IN (42569,42570,42663,42664); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(42569,27714,571,1,1,25331,0,3665.613,-1209.412,102.4201,4.206244,120,0,0,1,0,0), +(42570,27714,571,1,1,25331,0,3660.56,-1207.094,102.4201,4.29351,120,0,0,1,0,0), +(42663,27714,571,1,1,25331,0,3677.009,-1174.462,102.3367,1.169371,120,0,0,1,0,0), +(42664,27714,571,1,1,25331,0,3682.874,-1177.179,102.4757,1.169371,120,0,0,1,0,0); +-- Add Spells for 7th Legion Chain Gun +UPDATE `creature_template` SET `spell1`=49190,`spell2`=49550 WHERE `entry`=27714; From 980e0f73e8c132160deaf3d0324f72c8012a3692 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 1 Jun 2012 15:18:33 +0100 Subject: [PATCH 0890/1149] Misc/Docs: Some updates to UnixInstall.txt and remove EventAI.txt We really don't want people to use EAI. --- doc/EventAI.txt | 873 -------------------------------------------- doc/UnixInstall.txt | 14 +- 2 files changed, 7 insertions(+), 880 deletions(-) delete mode 100644 doc/EventAI.txt diff --git a/doc/EventAI.txt b/doc/EventAI.txt deleted file mode 100644 index c1db7dc6bf1..00000000000 --- a/doc/EventAI.txt +++ /dev/null @@ -1,873 +0,0 @@ -===================================================== -EventAI documentation: (last changed August 16, 2010) -===================================================== - -EventAI allows users to create new creature scripts entirely within the database. - -For the AI to be used, you must first make sure to set AIname for each creature that should use this AI. -UPDATE creature_template SET AIName = 'EventAI' WHERE entry IN (...); - -========================================================= -WARNING: THIS DOCUMENTATION IS NOT ALWAYS UP TO DATE. -FOR MORE UP-TO-DATE INFORMATION, CHECK THE TRINITY WIKI. -========================================================= - -========================================= -Basic structure of EventAI -========================================= - -EventAI follows a basic if (Event) then do (Action) format. -Below is the list of current fields of the creature_ai_scripts table. - -(Field_Name) (Description) -id This value is merely an incrementing counter of the current Event number. Required for sql queries. -creature_id Creature id which should trigger this event. - -event_type The type of event (see "Event types" below) -event_inverse_phase_mask Mask with phases this event should NOT trigger in* -event_chance Percentage chance of triggering the event (1 - 100) -event_flags Event flags (repeatable, ... (see below)) -event_param1 Variables for the event (depends on event_type) -event_param2 -event_param3 -event_param4 - -action1_type An action to take when the event occurs (see "Action types" below) -action1_param1 Variables used by Action1 (depends on action_type) -action1_param2 -action1_param3 - -action2_type -action2_param1 -action2_param2 -action2_param3 - -action3_type -action3_param1 -action3_param2 -action3_param3 - -All params are signed 32-bit values (+/- 2147483647). Time values are always in milliseconds. -In case of a percentage value, use value/100 (ie. param = 500 then that means 500%, -50 = -50%) - -[*] Phase mask is a bitmask of phases which shouldn't trigger this event. (ie. Phase mask of value 12 (binary 1100) results in triggering this event in phases 0, 1 and all others with exception for phases 2 and 3 (counting from 0). - - -========================================= -Event types -========================================= - -A list of event types EventAI is able to handle. -Each event type has its own specific interpretation of the params that accompany it. -Params are always read in the ascending order (from Param1 to Param3). -Events will not repeat until the creature exits combat or unless EFLAG_REPEATABLE is set. -Some events such as EVENT_T_AGGRO, EVENT_T_DEATH, EVENT_T_SPAWNED, and EVENT_T_EVADE cannot repeat. - -# Internal name Param usage Description -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -0 EVENT_T_TIMER InitialMin, InitialMax, RepeatMin, RepeatMax Expires at first between (Param1) and (Param2) and then between every (Param3) and (Param4), but only in combat. -1 EVENT_T_TIMER_OOC InitialMin, InitialMax, RepeatMin, RepeatMax Expires at first between (Param1) and (Param2) and then between every (Param3) and (Param4), but only out of combat. -2 EVENT_T_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). -3 EVENT_T_MANA ManaMax%,ManaMin% RepeatMin, RepeatMax Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). -4 EVENT_T_AGGRO NONE Expires upon initial aggro (does not repeat). -5 EVENT_T_KILL RepeatMin, RepeatMax Expires upon killing a player. Will repeat between (Param1) and (Param2). -6 EVENT_T_DEATH NONE Expires upon creature death. -7 EVENT_T_EVADE NONE Expires upon creature EnterEvadeMode(). -8 EVENT_T_SPELLHIT SpellID, Schoolmask, RepeatMin, RepeatMax Expires upon a spell hit. When (param1) is set, it will be used as a trigger. With (param2) specified, the expiration is limited to specific spell schools (-1 for all). Will repeat every (Param3) and (Param4). -9 EVENT_T_RANGE MinDist, MaxDist, RepeatMin, RepeatMax Expires when the highest threat target distance is greater than (Param1) and less than (Param2). Will repeat every (Param3) and (Param4). -10 EVENT_T_OOC_LOS Hostile-or-Not, MaxAllowedRange, RepeatMin, RepeatMax Expires when a unit moves within distance (MaxAllowedRange) of a creature. If (Param1) is zero it will expire only when unit is hostile, friendly otherwise (Param1 = 1), depends generally on faction. Will repeat every (Param3) and (Param4). Does not expire when the creature is in combat. -11 EVENT_T_SPAWNED NONE Expires on initial spawn and on creature respawn (useful for setting ranged movement type). -12 EVENT_T_TARGET_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when current target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). -13 EVENT_T_TARGET_CASTING RepeatMin, RepeatatMax Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2). -14 EVENT_T_FRIENDLY_HP HPDeficit, Radius, RepeatMin, RepeatMax Expires when a friendly unit in radius has at least (Param1) HP missing. Will repeat every (Param3) and (Param4). -15 EVENT_T_FRIENDLY_IS_CC DispelType, Radius, RepeatMin, RepeatMax Expires when a friendly unit is crowd controlled within the given radius (Param2). Will repeat every (Param3) and (Param4). -16 EVENT_T_MISSING_BUFF SpellId, Radius, RepeatMin, RepeatMax Expires when a friendly unit is missing aura(s) given by a spell (Param1) within radius (Param2). Will repeat every (Param3) and (Param4). -17 EVENT_T_SUMMONED_UNIT CreatureId, RepeatMin, RepeatMax Expires after creature with entry = (Param1) is spawned (Param1 = 0 means all spawns). Will repeat every (Param2) and (Param3). -18 EVENT_T_TARGET_MANA ManaMax%, ManaMin%, RepeatMin, RepeatMax -21 EVENT_T_REACHED_HOME NONE Expires when a creature reach it's home(spawn) location after evade. -22 EVENT_T_RECEIVE_EMOTE EmoteId, Condition, CondValue1, CondValue2 Expires when a creature receives an emote with emote text id (enum TextEmotes) in (Param1). Conditions can be defined (Param2) with optional values (Param3,Param4), see enum ConditionType. -23 EVENT_T_BUFFED SpellID, AmmountInStack, RepeatMin, RepeatMax Expires when a creature has spell (Param1) auras applied in a stack greater or equal to value provided in (Param2). Will repeat every (Param3) and (Param4). -24 EVENT_T_TARGET_BUFFED SpellID, AmmountInStack, RepeatMin, RepeatMax Expires when a target unit has spell (Param1) auras applied in a stack greater or equal to value provided in (Param2). Will repeat every (Param3) and (Param4). -35 EVENT_T_RESET NONE Expires when creature leaves combat, spawns or respawns. - -========================================= -Action Types -========================================= - -A list of action types that EventAI can handle. -Each event type has its own specific interpretation of it's params, like every event type. - -# Internal name Param usage Description -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -0 ACTION_T_NONE No Action Does nothing. -1 ACTION_T_TEXT -TextId1, -TextId2, -TextId3 Simply displays the specified -TextId. When -TextId2 and -TextId3 are specified, the selection will be randomized. Text types are defined, along with other options for the text, in a table below. All values needs to be negative. -2 ACTION_T_SET_FACTION FactionId Changes faction for a creature. When param1 is zero, creature will revert to it's default faction. -3 ACTION_T_MORPH_TO_ENTRY_OR_MODEL CreatureEntry, ModelId Set either model from creature_template.entry (Param1) OR explicit modelId (Param2). If (Param1) AND (Param2) are both 0, demorph and revert to the default model. -4 ACTION_T_SOUND SoundId Plays a sound -5 ACTION_T_EMOTE EmoteId Does an emote -6 ACTION_T_RANDOM_SAY UNUSED -7 ACTION_T_RANDOM_YELL UNUSED -8 ACTION_T_RANDOM_TEXTEMOTE UNUSED -9 ACTION_T_RANDOM_SOUND SoundId1, SoundId2, SoundId3 Plays a random sound * -10 ACTION_T_RANDOM_EMOTE EmoteId1, EmoteId2, EmoteId3 Emotes a random emote -11 ACTION_T_CAST SpellId, Target, CastFlags Casts spell (Param1) on a target (Param2) using cast flags (specified below). -12 ACTION_T_SUMMON CreatureID, Target, Duration Summons a creature (Param1) for (Param3) duration and orders it to attach (Param2) target. Spawns on top of current creature. -13 ACTION_T_THREAT_SINGLE_PCT Threat%, Target Modifies a threat by (Param1) percent on a target (Param2). -14 ACTION_T_THREAT_ALL_PCT Threat% Modifies a threat by (Param1) on all targets in the threat list (using -100% here will result in full aggro dump). -15 ACTION_T_QUEST_EVENT QuestID, Target Calls AreaExploredOrEventHappens with (Param1) for a target in (Param2). -16 ACTION_T_QUEST_CASTCREATUREGO CreatureID, SpellId, Target Sends CastCreatureOrGo for a creature specified by CreatureId (Param1) with provided spell id (Param2) for a target in (Param3). -17 ACTION_T_SET_UNIT_FIELD Field_Number, Value, Target Sets a unit field (Param1) to provided value (Param2) on a target in (Param3). -18 ACTION_T_SET_UNIT_FLAG Flags, Target Sets flag (flags can be used together to modify multiple flags at once) on a target (Param2). -19 ACTION_T_REMOVE_UNIT_FLAG Flags, Target Removes flag on a target (Param2). -20 ACTION_T_AUTO_ATTACK AllowAutoAttack Stop melee attack when (Param1) is zero, otherwise continue attacking / allow melee attack. -21 ACTION_T_COMBAT_MOVEMENT AllowCombatMovement Stop combat based movement when (Param1) is zero, otherwise continue/allow combat based movement (targeted movement generator). -22 ACTION_T_SET_PHASE Phase Sets the current phase to (Param1). -23 ACTION_T_INC_PHASE Value Increments the phase by (Param1). May be negative to decrement, but should not be zero. -24 ACTION_T_EVADE No Params Forces the creature to evade, wiping all threat and dropping combat. -25 ACTION_T_FLEE_FOR_ASSIST No Params Causes the creature to flee for assistence (often at low health). -26 ACTION_T_QUEST_EVENT_ALL QuestId Calls GroupEventHappens with (Param1). Only used if it's _expected_ event should call quest completion for all players in a current party. -27 ACTION_T_CASTCREATUREGO_ALL QuestId, SpellId Calls CastedCreatureOrGo for all players on the threat list with quest id specified in (Param1) and spell id in (Param2). -28 ACTION_T_REMOVEAURASFROMSPELL Target, Spellid Removes all auras on a target (Param1) caused by a spell (Param2). -29 ACTION_T_RANGED_MOVEMENT Distance, Angle Changes the movement generator to a ranged type. (note: default melee type can still be set by using 0 as angle and 0 as distance). -30 ACTION_T_RANDOM_PHASE PhaseId1, PhaseId2, PhaseId3 Sets a phase to a specified id(s)* -31 ACTION_T_RANDOM_PHASE_RANGE PhaseMin, PhaseMax Sets a phase to a random id (Phase = PhaseMin + rnd % PhaseMin-PhaseMax). PhaseMax must be greater than PhaseMin. -32 ACTION_T_SUMMON CreatureID, Target, SummonID Summons a creature (Param1) to attack target (Param2) at location specified by EventAI_Summons (Param3). -33 ACTION_T_KILLED_MONSTER CreatureID, Target Calls KilledMonster (Param1) for a target (Param2). -34 ACTION_T_SET_INST_DATA Field, Data Calls ScriptedInstance::SetData with field (Param1) and data (Param2). -35 ACTION_T_SET_INST_DATA64 Field, Target Calls ScriptedInstance::SetData64 with field (Param1) and target's GUID (Param2). -36 ACTION_T_UPDATE_TEMPLATE TemplateId, Team Changes a creature's template to (Param1) with team = Alliance or Horde when (Param2) is either false or true respectively. -37 ACTION_T_DIE No Params Kills the creature -38 ACTION_T_ZONE_COMBAT_PULSE No Params Puts all players within an instance into combat with the creature. Only works when a creature is already in combat. Doesn't work outside instances. -39 ACTION_T_CALL_FOR_HELP Radius Call any friendly out-of-combat creatures in a radius (Param1) to attack current creature's target. -40 ACTION_T_SET_SHEATH Sheath Sets sheath state for a creature (0 = no weapon, 1 = melee weapon, 2 = ranged weapon). -41 ACTION_T_FORCE_DESPAWN No Params Despawns the creature -42 ACTION_T_SET_INVINCIBILITY_HP_LEVEL hp_level, is_percent Set min. health level for creature that can be set at damage as flat value or percent from max health -43 ACTION_T_MOUNT_TO_ENTRY_OR_MODEL CreatureEntry, ModelId Set mount model from creature_template.entry (Param1) OR explicit modelId (Param2). If (Param1) AND (Param2) are both 0, unmount. - -* = Use -1 where the param is expected to do nothing. Random constant is generated for each event, so if you have a random yell and a random sound, they will be linked up with each other (ie. param2 with param2). - - -========================================= -Event Types -========================================= -Note: -COMBAT ONLY - Means that this event will only trigger durring combat. -OUT OF COMBAT ONLY - Means that this event will only trigger while out of combat. -BOTH - This event can trigger both in and out of combat. - -Events that do not have lables on them are events that are directly involved with the in and out of combat state. - ------------------- -0 = EVENT_T_TIMER: ------------------- -Parameter 1: InitialMin - Minumum Time used to calculate Random Initial Expire -Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Expire -Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire -Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire - -COMBAT ONLY! - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on. -This is commonly used for spells that repeat cast during combat (Simulate Spell Cooldown). - ----------------------- -1 = EVENT_T_TIMER_OOC: ----------------------- -Parameter 1: InitialMin - Minumum Time used to calculate Random Initial Expire -Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Expire -Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire -Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire - -OUT OF COMBAT ONLY! - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on. -This is commonly used for events that occur and repeat outside of combat. - ---------------- -2 = EVENT_T_HP: ---------------- -Parameter 1: HPMax% - Maximum HP% That this Event will Expire -Parameter 2: HPMin% - Minimum HP% That this Event will Expire -Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire -Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire - -BOTH - Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). -This is commonly used for events that trigger at a specific HP% (Such as Heal/Enrage Spells or NPC's that Flee). - ------------------ -3 = EVENT_T_MANA: ------------------ -Parameter 1: ManaMax% - Maximum Mana% That this Event will Expire -Parameter 2: ManaMin% - Minimum Mana% That this Event will Expire -Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire -Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire - -BOTH - Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). -This is commonly used for events where an NPC low on Mana will do something (Such as stop casting spells and switch to melee). - ------------------- -4 = EVENT_T_AGGRO: ------------------- -This Event Expires upon initial aggro (does not repeat). - ------------------ -5 = EVENT_T_KILL: ------------------ -Parameter 1: RepeatMin - Minimum Time used to calculate Random Repeat Expire -Parameter 2: RepeatMax - Maximum Time used to calculate Random Repeat Expire - -COMBAT ONLY! - Expires upon killing a player. Will repeat every (Param1) and (Param2). -This Event Expires upon killing a player. It is commonly used for NPC's who yell or do something after killing a player. - ------------------- -6 = EVENT_T_DEATH: ------------------- -This Event Expires upon Death of the Scripted NPC. -This is commonly used for NPC's who have a yell on death or cast some kind if summon spell when they die. - ------------------- -7 = EVENT_T_EVADE: ------------------- -This Event Expires upon the creature EnterEvadeMode(). -This is commonly used for NPC's who use phases, allows you to reset their phase to 0 upon evade to prevent possible strange behavior. - ---------------------- -8 = EVENT_T_SPELLHIT: ---------------------- -Parameter 1: SpellID - The Spell ID that will trigger the event to occur (NOTE: If you use Spell School as the trigger set this value to 0) -Parameter 2: School - Spell School to trigger the event (NOTE: If you use a SpellID then set this value to -1) - *See Below for Spell School Bitmask Values* -Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire -Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire - -BOTH - Expires upon Spell hit. If (param1) is set will only expire on that spell OR If (param2) is set it will only expire on spells of that school. Will repeat every (Param3) and (Param4). -This Event is commonly used for NPC's who can do special things when you cast a spell (Or specific spell) on them. - -(name, school, schoolmask) -SPELL_SCHOOL_NORMAL = 0, ==> 1 -SPELL_SCHOOL_HOLY = 1, ==> 2 -SPELL_SCHOOL_FIRE = 2, ==> 4 -SPELL_SCHOOL_NATURE = 3, ==> 8 -SPELL_SCHOOL_FROST = 4, ==> 16 -SPELL_SCHOOL_SHADOW = 5, ==> 32 -SPELL_SCHOOL_ARCANE = 6, ==> 64 -Use These Values For Schoolmask (Param2) or Any Combinations Of These Schoolmasks for Multiple Schools. - ------------------- -9 = EVENT_T_RANGE: ------------------- -Parameter 1: MinDist - This Distance is the Minimum Distance between the NPC and it's target to allow this Event to Expire -Parameter 2: MaxDist - This Distance is the Maximum Distance between the NPC and it's target to allow this Event to Expire -Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire -Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire - -COMBAT ONLY! - Expires when the highest threat target distance is greater than (Param1) and less than (Param2). Will repeat every (Param3) and (Param4). -This Event is commonly used for NPC's who have Ranged Combat and will Throw/Shoot between a certian distance. - ---------------------- -10 = EVENT_T_OOC_LOS: ---------------------- -Parameter 1: Hostile-or-Not - This will expire if Unit are hostile. If Param1=1 it will only expire if Unit are not Hostile(generally determined by faction) -Parameter 2: MaxAllowedRange - Expires when a Unit moves within this distance to creature -Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire -Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire - -OUT OF COMBAT! -This Event is commonly used for NPC's who do something or say something to you when you walk past them Out of Combat. - ---------------------- -11 = EVENT_T_SPAWNED: ---------------------- -Expires at initial spawn and at creature respawn. -This Event is commonly used for setting ranged movement type or Summoning a Pet on Spawn -Parameter 1: 0: works always, 1: works on map in Parameter 2, 2: works on zone/subzone in Parameter 2 -Parameter 2: depends on Parameter 1: for 1 it is map ID, for 2 it is area ID to check - ------------------------ -12 = EVENT_T_TARGET_HP: ------------------------ -Parameter 1: HPMax% - Maximum HP% That this Event will Expire -Parameter 2: HPMin% - Minimum HP% That this Event will Expire -Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire -Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire - -COMBAT ONLY! - Expires when Current NPC's Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). -This Event is commonly used for NPC's who have a special ability (Like Execute) that only casts when a Player HP is low. - ----------------------------- -13 = EVENT_T_TARGET_CASTING: ----------------------------- -Parameter 1: RepeatMin - Minimum Time used to calculate Random Repeat Expire -Parameter 2: RepeatMax - Maximum Time used to calculate Random Repeat Expire - -COMBAT ONLY! - Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2). -This event is commonly used for NPC's who will cast a counter spell when their target starts to cast a spell. - -------------------------- -14 = EVENT_T_FRIENDLY_HP: -------------------------- -Parameter 1: HPDeficit - This is the Amount of HP Missing from Full HP to trigger this event (You would need to calculate the amount of HP the event happens and subtract that from Full HP Value to get this number) -Parameter 2: Radius - This is the Range in Yards the NPC will scan for nearby Friendlies (Faction is Friendly To) for the missing amount of HP in Param1. -Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire -Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire - -COMBAT ONLY! - Expires when a friendly unit in radius(param2) has at least (param1) hp missing. Will repeat every (Param3) and (Param4). -This is commonly used when an NPC in Combat will heal a nearby Friendly NPC in Combat with a Heal/Renew Spell. - ----------------------------- -15 = EVENT_T_FRIENDLY_IS_CC: ----------------------------- -Parameter 1: DispelType - Dispel Type to trigger the event - *See Below for Dispel Bitmask Values* -Parameter 2: Radius - This is the Range in Yards the NPC will scan for nearby Friendlies being Crowd Controlled -Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire -Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire - -COMBAT ONLY! - Expires when a friendly unit is Crowd controlled within the given radius (param2). Will repeat every (Param3) and (Param4). -This is commonly used for NPC's who can come to the resule of other Friendly NPC's if being Crowd Controlled - --------------------------- -16 = EVENT_T_MISSING_BUFF: --------------------------- -Parameter 1: SpellId - This is the SpellID That the Aura Check will look for (If it is missing this Aura) -Parameter 2: Radius - This is the Range in Yards the NPC will scan for nearby Friendlies (Faction is Friendly To) for the missing Aura. -Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire -Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire - -BOTH - Expires when a friendly unit is missing aura's given by spell (param1) within radius (param2). Will repeat every (Param3) and (Param4). -This is commonly used for NPC's who watch friendly units for a debuff to end so they can recast it on them again. - ---------------------------- -17 = EVENT_T_SUMMONED_UNIT: ---------------------------- -Parameter 1: CreatureId - The CreatureID that the NPC is watching to spawn to trigger this event -Parameter 2: RepeatMin - Minimum Time used to calculate Random Repeat Expire -Parameter 3: RepeatMax - Maximum Time used to calculate Random Repeat Expire - -BOTH - Expires after creature with entry(Param1) is spawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3) . -This is commonly used for NPC's who will do something special once another NPC is summoned. Usually used is Complex Scripts or Special Events. - ---------------------------- -21 = EVENT_T_REACHED_HOME: ---------------------------- -Expires only when creature has returned to it's home location after Evade. Out of combat event. -Most commonly used to cast spells that can not be casted in EVENT_T_EVADE and other effects that does not fit in while still running back to spawn/home location. - ---------------------------- -22 = EVENT_T_RECEIVE_EMOTE: ---------------------------- -Expires only when creature receive emote from player. Valid text emote id's are in Mangos source (enum TextEmotes) -Event does not require any conditions to process, however many are ecpected to have condition. - ---------------------------- -23 = EVENT_T_BUFFED : ---------------------------- -Parameter 1: SpellId - This is the SpellID That the Aura Check will look for -Parameter 2: Amount - This is the amount of SpellID's auras at creature required for event expire. -Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire -Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire - ---------------------------- -24 = EVENT_T_TARGET_BUFFED: ---------------------------- -Parameter 1: SpellId - This is the SpellID That the Aura Check will look for -Parameter 2: Amount - This is the amount of SpellID's auras at target unit required for event expire. -Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire -Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire - -EventAI use conditions from available in Mangos (enum ConditionType) -Current implemented conditions: -CONDITION_NONE (0) 0 0 -CONDITION_AURA (1) spell_id effindex -CONDITION_ITEM (2) item_id count -CONDITION_ITEM_EQUIPPED (3) item_id count -CONDITION_ZONEID (4) zone_id 0 -CONDITION_REPUTATION_RANK (5) faction_id min_rank -CONDITION_TEAM (6) player_team 0 (469-Alliance / 67-Horde) -CONDITION_SKILL (7) skill_id min_skill_value -CONDITION_QUESTREWARDED (8) quest_id 0, if quest are rewarded -CONDITION_QUESTTAKEN (9) quest_id 0, while quest active(incomplete) -CONDITION_ACTIVE_EVENT (12) event_id 0, note this is id from dbc, also defined in Mangos source(enum HolidayIds) NOT id of game_event in database - -========================================= -Action Types -========================================= - ------------------ -1 = ACTION_T_TEXT: ------------------ -Parameter 1: The entry of the text that the NPC should use from eventai_texts table. Optionally a entry from other tables can be used (such as custom_texts). - Entry are required to be negative and exist in a *_texts-table. The type text to be displayed are defined in the texts-table itself (Say, Yell, Whisper, Emote Text, Boss Whisper, Boss Emote) - Other options are also to be defined in the texts-table, such as a sound to be heard with the text and the language used in output (common, dwarvish, etc). - In case this entry has a localized version of the text, the localized text will be displayed in client that support this locale. - -Parameter 2: Optional. TextId can be defined in addition. The same apply to this as explained above, however eventAI will randomize between the two. -Parameter 3: Optional, if Parameter 2 exist. In this case, eventAI will randomize between three. - -Read at bottom for documentation of creature_ai_texts-table. - ------------------- -2 = ACTION_T_SET_FACTION: ------------------- -Parameter 1: FactionId from Faction.dbc OR 0. Changes faction for creature. If 0, creature will revert to it's default faction if previously changed. - ------------------------ -3 = ACTION_T_MORPH_TO_ENTRY_OR_MODEL: ------------------------ -Parameter 1: Creature entry from creature_template. Action will then change to the model this creature are using. -Parameter 2: If parameter 1 is 0, then this modelId will be used (in case parameter 1 exist, parameter 2 will not be used) - -If both parameter 1 and 2 is 0, the creature will DeMorph, and use it's default model. - -------------------- -4 = ACTION_T_SOUND: -------------------- -Parameter 1: The Sound ID to be played. (Sound IDs are contained in the DBC files.) - -The creature will play the specified sound. -This is commonly used for Bosses who Yell and then also have a Voice for the same thing. - -------------------- -5 = ACTION_T_EMOTE: -------------------- -Parameter 1: The Emote ID that the creature should perform. (Emote IDs are also contained in the DBC but they can be found in the mangos source as well). - -The creature will perform a visual emote. Unlike a text emote, a visual emote is one where the creature will actually move or perform a gesture. -This is commonly used for NPC's who may perform a special action (Salute, Roar, ect...). Not all player emotes work for creature models. - ------------------------- -6 = ACTION_T_RANDOM_SAY: ------------------------- -UNUSED Can be reused to create new action type - -------------------------- -7 = ACTION_T_RANDOM_YELL: -------------------------- -UNUSED Can be reused to create new action type - ------------------------------- -8 = ACTION_T_RANDOM_TEXTEMOTE: ------------------------------- -UNUSED Can be reused to create new action type - --------------------------- -9 = ACTION_T_RANDOM_SOUND: --------------------------- -Parameter 1: The Sound ID to be played as Random Choice #1. -Parameter 2: The Sound ID to be played as Random Choice #2. -Parameter 3: The Sound ID to be played as Random Choice #3. - -Similar to the ACTION_T_SOUND action, it will choose at random a sound to play. - ---------------------------- -10 = ACTION_T_RANDOM_EMOTE: ---------------------------- -Parameter 1: The Emote ID to be played as Random Choice #1. -Parameter 2: The Emote ID to be played as Random Choice #2. -Parameter 3: The Emote ID to be played as Random Choice #3. - -Similar to the ACTION_T_EMOTE action, it will choose at random an Emote to Visually Perform. - -------------------- -11 = ACTION_T_CAST: -------------------- -Parameter 1: SpellId - The Spell ID to use for the NPC to cast. The value used in this field needs to be a valid Spell ID. -Parameter 2: Target - The Target Type defining who the creature should cast the spell at. The value in this field needs to be a valid Target Type as specified in the reference tables below. -Parameter 3: CastFlags - See Table Below for Cast Flag Bitmask Values. If you are unsure what to set this value at leave it at 0. - -The creature will cast a spell specified by a spell ID on a target specified by the target type. -This is commonly used for NPC's who cast spells. - ---------------------- -12 = ACTION_T_SUMMON: ---------------------- -Parameter 1: CreatureID - The Creature Template ID to be Summoned. The value here needs to be a valid Creature Template ID. -Parameter 2: Target - The Target Type defining who the Summoned creature will attack once spawned. The value in this field needs to be a valid Target Type as specified in the reference tables below. -Parameter 3: Duration - The duration until the summoned creature should be unsummoned AFTER Combat ends. The value in this field is in milliseconds or 0. - -The NPC will Summon another creature at the same spot as itself that will attack the specified target. -NOTE: Almost all Creature Summons have proper Summon Spells that should be used when possible. This Action is a powerful last resort option only to be used if nothing else works. -NOTE: Using Target Type 0 will cause the Summoned creature to not attack anyone. -NOTE: If Duration is set at 0, then the summoned creature will not despawn until it has died. -This is used as a manual way to force an NPC to Summon. --------------------------------- -13 = ACTION_T_THREAT_SINGLE_PCT: --------------------------------- -Parameter 1: Threat% - Threat percent that should be modified. The value in this field can range from -100 to +100. If it is negative, threat will be taken away and if positive, threat will be added. -Parameter 2: Target - The Target Type defining on whom the threat change should occur. The value in this field needs to be a valid target type as specified in the reference tables below. - -This action will modify the threat of a target in the creature's threat list by the specified percent. -This is commonly used to allow an NPC to adjust the Threat to a single player. - ------------------------------ -14 = ACTION_T_THREAT_ALL_PCT: ------------------------------ -Parameter 1: Threat% - The percent that should be used in modifying everyone's threat in the creature's threat list. The value here can range from -100 to +100. - -This action will modify the threat for everyone in the creature's threat list by the specified percent. -NOTE: Using -100 will cause the creature to reset everyone's threat to 0 so that everyone has the same amount of threat. It will NOT remove anyone from the threat list. -This is commonly used to allow an NPC to drop threat for all players to zero. - --------------------------- -15 = ACTION_T_QUEST_EVENT: --------------------------- -Parameter 1: QuestID - The Quest Template ID. The value here must be a valid quest template ID. Furthermore, the quest should have SpecialFlags | 2 as it would need to be completed by an external event which is the activation of this action. -Parameter 2: Target - The Target Type defining whom the quest should be completed for. The value in this field needs to be a valid target type as specified in the reference tables below. - -This action will satisfy the external completion requirement for the quest for the specified target defined by the target type. -NOTE: This action can only be used with player targets so it must be ensured that the target type will point to a player. -This is commonly used for Quests where only ONE player will gain credit for the quest. - ------------------------------ -16 = ACTION_T_CASTCREATUREGO: ------------------------------ -Parameter 1: CreatureID - The Creature Template ID to be Summoned. The value here needs to be a valid Creature Template ID. -Parameter 2: SpellId - The Spell ID to use to simulate the cast. The value used in this field needs to be a valid Spell ID. -Parameter 3: Target - The Target Type defining whom the quest credit should be given to. The value in this field needs to be a valid target type as specified in the reference tables below. - -This action will call CastedCreatureOrGO() function for the player. It can be used to give quest credit for casting a spell on the creature. -This is commonly used for NPC's who have a special requirement to have a Spell cast on them to complete a quest. - ------------------------------ -17 = ACTION_T_SET_UNIT_FIELD: ------------------------------ -Parameter 1: Field_Number - The index of the Field Number to be changed. Use (http://wiki.udbforums.org/index.php/Character_data) for a list of indeces and what they control. Creatures only contain the OBJECT_FIELD_* and UNIT_FIELD_* fields. They do not contain the PLAYER_FIELD_* fields. -Parameter 2: Value - The new value to be put in the field. -Parameter 3: Target - The Target Type defining for whom the unit field should be changed. The value in this field needs to be a valid target type as specified in the reference tables below. - -When activated, this action can change the target's unit field values. More information on the field value indeces can be found at (http://wiki.udbforums.org/index.php/Character_data) - ----------------------------- -18 = ACTION_T_SET_UNIT_FLAG: ----------------------------- -Parameter 1: Flags - The flag(s) to be set. Multiple flags can be set by using bitwise-OR on them (adding them together). -Parameter 2: Target - The Target Type defining for whom the flags should be changed. The value in this field needs to be a valid Target Type as specified in the reference tables below. - -When activated, this action changes the target's flags by adding (turning on) more flags. For example, this action can make the creature unattackable/unselectable if the right flags are used. - -------------------------------- -19 = ACTION_T_REMOVE_UNIT_FLAG: -------------------------------- -Parameter 1: Flags - The flag(s) to be removed. Multiple flags can be set by using bitwise-OR on them (adding them together). -Parameter 2: Target - The target type defining for whom the flags should be changed. The value in this field needs to be a valid Target Type as specified in the reference tables below. - -When activated, this action changes the target's flags by removing (turning off) flags. For example, this action can make the creature normal after it was unattackable/unselectable if the right flags are used. - --------------------------- -20 = ACTION_T_AUTO_ATTACK: --------------------------- -Parameter 1: AllowAutoAttack - If zero, then the creature will stop its melee attacks. If non-zero, then the creature will either continue its melee attacks (the action would then have no effect) or it will start its melee attacks on the target with the top threat if its melee attacks were previously stopped. - -This action controls whether or not the creature should stop or start the auto melee attack. -NOTE: The ACID Dev Team has conformed to using either 0 or 1 for the Param values (0 = Stop Melee, 1 = Start Melee). -This is commonly used in combination with EVENT_T_RANGE and ACTION_T_COMBAT_MOVEMENT for Ranged Combat for Mages and Spell Casters. - ------------------------------- -21 = ACTION_T_COMBAT_MOVEMENT: ------------------------------- -Parameter 1: If zero, then the creature will stop moving towards its victim (if its victim gets out of melee range) and will be stationary. If non-zero, then the creature will either continue to follow its victim (the action would have no effect) or it will start to follow the target with the top threat if its movement was disabled before. -Parameter 2: If non-zero, then stop melee combat state (if param1=0) or start melee combat state (if param1!=0) and creature in combat with selected target. - -This action controls whether or not the creature will always move towards its target. -NOTE: The ACID Dev Team has conformed to using either 0 or 1 for the Param values. (0 = Stop Movement, 1 = Start Movement) -This is commonly used with EVENT_T_RANGE and ACTION_T_AUTO_ATTACK for NPC's who engage in Ranged Comabt (Either Spells or Ranged Attacks) -Parameter 2 specialy used for ranged combat proper client side visual show ranged weapon in proper state. - ------------------------- -22 = ACTION_T_SET_PHASE: ------------------------- -Parameter 1: The new phase to set the creature in. This number must be an integer between 0 and 31. Numbers outside of that range will result in an error. - -When activated, this action sets the creature's event to the specified value. -NOTE: The creature's current Phase is NOT reset at creature evade. You must manually set the phase back to 0 at EVENT_T_RESET. -NOTE: The value used for the Param is the actual Phase Number (Not The Event_Inverse_Phase_Mask) -This is commonly used for complex scripts with several phases and you need to switch to a different phase. - ------------------------- -23 = ACTION_T_INC_PHASE: ------------------------- -Parameter 1: Value - The number of phases to increase or decrease. Use negative values to decrease the current phase. - -When activated, this action will increase (or decrease) the current creature's phase. -NOTE: After increasing or decreasing the phase by this action, the current phase must NOT be lower than 0 or exceed 31. -This can be used instead of ACTION_T_SET_PHASE to change phases in scripts. Just a user friendly option for changing phases. - --------------------- -24 = ACTION_T_EVADE: --------------------- -When activated, the creature will immediately exit out of combat, clear its threat list, and move back to its spawn point. Basically, this action will reset the whole encounter. -NOTE: All Param Values Are 0 for this Action. - -------------------- -25 = ACTION_T_FLEE: -------------------- -When activated, the creature will try to flee from combat. Currently this is done by it casting a fear-like spell on itself called "Run Away". -A Better Flee system is in Development. -NOTE: All Param Values Are 0 for this Action. - ------------------------------- -26 = ACTION_T_QUEST_EVENT_ALL: ------------------------------- -Parameter 1: QuestId - The quest ID to finish for everyone. - -This action does the same thing as the ACTION_T_QUEST_EVENT does but it does it for all players in the creature's threat list. -NOTE: If a player is not in the NPC's threat list for whatever reason, he/she won't get the quest completed. - ---------------------------------- -27 = ACTION_T_CASTCREATUREGO_ALL: ---------------------------------- -Parameter 1: QuestId - The quest template ID. -Parameter 2: SpellId - The spell ID used to simulate the cast. - -This action does the same thing as the ACTION_T_CASTCREATUREGO does but it does it for all players in the creature's threat list. -NOTE: If a player is not in its threat list for whatever reason, he/she won't receive the cast emulation. - ------------------------------------ -28 = ACTION_T_REMOVEAURASFROMSPELL: ------------------------------------ -Parameter 1: Target - The target type defining for whom the unit field should be changed. The value in this field needs to be a valid target type as specified in the reference tables below. -Parameter 2: SpellId - The spell ID whose auras will be removed. - -This action will remove all auras from a specific spell from the target. -This is commonly used for NPC's who have an OOC Aura that is removed at combat start or a similar idea (Like Stealth or Shape Shift) - ------------------------------- -29 = ACTION_T_RANGED_MOVEMENT: ------------------------------- -Parameter 1: Distance - The distance the mob should keep between it and its target. -Parameter 2: Angle - The angle the mob should use. - -This action changes the movement type generator to ranged type using the specified values for angle and distance. -NOTE: Specifying zero angle and distance will make it just melee instead. -This is commonly used for NPC's who always attack at range and you can specify the distance they will maintain from the target. - ---------------------------- -30 = ACTION_T_RANDOM_PHASE: ---------------------------- -Parameter 1: PhaseId1 - A possible random phase choice. -Parameter 2: PhaseId2 - A possible random phase choice. -Parameter 3: PhaseId3 - A possible random phase choice. - -Randomly sets the phase to one from the three parameter choices. -NOTE: Use -1 to specify that if this param is picked to do nothing. Random is constant between actions within an event. So if you have a random Yell and a random Sound they will match up (ex: param2 with param2) -NOTE 2: PLEASE NOTE THAT EACH OF THE PARAM VALUES ARE ACTUAL PHASE NUMBERS NOT THE INVERSE PHASE MASK VALUE. -This is commonly used for Spellcasting NPC's who on Aggro may select at random a school of spells to use for the fight. Use this if you have up to 3 phases used, otherwise use Action 31 for more then 3 phases. - ---------------------------------- -31 = ACTION_T_RANDOM_PHASE_RANGE: ---------------------------------- -Parameter 1: PhaseMin - The minimum of the phase range. -Parameter 2: PhaseMax - The maximum of the phase range. The number here must be greater than PhaseMin. - -Randomly sets the phase between a range of phases controlled by the parameters. Sets the phase to a random id (Phase = PhaseMin + rnd % PhaseMin-PhaseMax). -NOTE: PhaseMax must be greater than PhaseMin. -NOTE 2: PLEASE NOTE THAT EACH OF THE PARAM VALUES ARE ACTUAL PHASE NUMBERS NOT THE INVERSE PHASE MASK VALUE. -This is commonly used for Spellcasting NPC's who on Aggro may select at random a school of spells to use for the fight. Use this if you have MORE then 3 phases used, otherwise use Action 30. - ---------------------- -32 = ACTION_T_SUMMON: ---------------------- -Parameter 1: CreatureID - The creature template ID to be summoned. The value here needs to be a valid creature template ID. -Parameter 2: Target - The target type defining who the summoned creature will attack. The value in this field needs to be a valid target type as specified in the reference tables below. NOTE: Using target type 0 will cause the summoned creature to not attack anyone. -Parameter 3: SummonID - The summon ID from the creature_ai_summons table controlling the position (and spawntime) where the summoned mob should be spawned at. - -Summons creature (param1) to attack target (param2) at location specified by creature_ai_summons (param3). -NOTE: Param3 Value is the ID Value used for the entry used in creature_ai_summons for this action. You MUST have an creature_ai_summons entry to use this action. -This is commonly used for NPC's who need to Summon a creature at a specific location. (Normally used for complex events) - ------------------------------ -33 = ACTION_T_KILLED_MONSTER: ------------------------------ -Parameter 1: CreatureID - The creature template ID. The value here must be a valid creature template ID. -Parameter 2: Target - The target type defining whom the quest kill count should be given to. The value in this field needs to be a valid target type as specified in the reference tables below. - -When activated, this action will call KilledMonster() function for the player. It can be used to give creature credit for killing a creature. In general if the quest is set to be accompished on different creatures (e.g. "Credit" templates). -NOTE: It can be ANY creature including certain quest specific triggers -This is commonly used for giving the player Quest Credits for NPC kills (Many NPC's may use the same CreatureID for the Kill Credit) - ----------------------------- -34 = ACTION_T_SET_INST_DATA: ----------------------------- -Parameter 1: Field - The field to change in the instance script. Again, this field needs to be a valid field that has been already defined in the instance's script. -Parameter 2: Data - The value to put at that field index. - -Sets data for the instance. Note that this will only work when the creature is inside an instantiable zone that has a valid script (ScriptedInstance) assigned. -This is commonly used to link an EventAI script with a existing Script Library C++ Script. You make make things happen like opening doors on specific events that happen. - ------------------------------- -35 = ACTION_T_SET_INST_DATA64: ------------------------------- -Parameter 1: Field - The field to change in the instance script. Again, this field needs to be a valid field that has been already defined in the instance's script. -Parameter 2: Target - The target type to use to get the GUID that will be stored at the field index. The value in this field needs to be a valid target type as specified in the reference tables below. - -Sets GUID (64 bits) data for the instance based on the target. Note that this will only work when the creature is inside an instantiable zone that has a valid script (ScriptedInstance) assigned. -Calls ScriptedInstance::SetData64 with field (param1) and data (param2) target's GUID. - ------------------------------- -36 = ACTION_T_UPDATE_TEMPLATE: ------------------------------- -Parameter 1: TemplateId - The creature template ID. The value here must be a valid creature template ID. -Parameter 2: Team - Use model_id from team : Alliance(0) or Horde (1). - -This function temporarily changes creature entry to new entry, display is changed, loot is changed, but AI is not changed. At respawn creature will be reverted to original entry. -Changes the creature to a new creature template of (param1) with team = Alliance if (param2) = false or Horde if (param2) = true - ------------------- -37 = ACTION_T_DIE: ------------------- -Kills the creature -This is commonly used if you need to Instakill the creature for one reason or another. - --------------------------------- -38 = ACTION_T_ZONE_COMBAT_PULSE: --------------------------------- -Places all players within the instance into combat with the creature. Only works in combat and only works inside of instances. - ----------------------------- -39 = ACTION_T_CALL_FOR_HELP: ----------------------------- -Parameter 1: Radius - All friendly (not only same faction) creatures will go to help - -Call any friendly creatures (if its not in combat/etc) in radius attack creature target. -Mostly used when call to help more wide that normal aggro radius or auto-used call for assistance, and need apply at some event. - -------------------------- -40 ACTION_T_SET_SHEATH: -------------------------- -Parameter 1: Sheath state -0 SHEATH_STATE_UNARMED not prepared weapon show (not used mostly by creatures) -1 SHEATH_STATE_MELEE melee weapon prepared show -2 SHEATH_STATE_RANGED ranged weapon prepared show - -Let set sheath state for creature. -Note: SHEATH_STATE_RANGED case work in combat state only if combat not start as melee commands. -This possible setup by set ar event AI start (single used EVENT_T_TIMER_OOC set ACTION_T_COMBAT_MOVEMENT 0 for creature that prefered ranged attack) - -------------------------- -41 ACTION_T_FORCE_DESPAWN -------------------------- -Despawns the creature (in or out of combat) -No parameters - -------------------------- -42 ACTION_T_SET_INVINCIBILITY_HP_LEVEL -------------------------- -Parameter 1: min. health level for creature that can be set at damage, 0 used as absent min. health value for apply damage. -Parameter 2: format of paramater 1 value -0 paramater 1 used as flat value -1 paramater 1 used as percent (0..100) from creature max health - -========================================= -Target Types -========================================= -Below is the list of current Target types that EventAI can handle. -Target types are used by certain actions and may effect actions differently - -(# Internal Name Discription) -0 TARGET_T_SELF Self cast -1 TARGET_T_HOSTILE Our current target (ie: highest aggro) -2 TARGET_T_HOSTILE_SECOND_AGGRO Second highest aggro (generaly used for cleaves and some special attacks) -3 TARGET_T_HOSTILE_LAST_AGGRO Dead last on aggro (no idea what this could be used for) -4 TARGET_T_HOSTILE_RANDOM Just any random target on our threat list -5 TARGET_T_HOSTILE_RANDOM_NOT_TOP Any random target except top threat -6 TARGET_T_ACTION_INVOKER Unit who caused this Event to occur (only works for EVENT_T_AGGRO, EVENT_T_KILL, EVENT_T_DEATH, EVENT_T_SPELLHIT, EVENT_T_OOC_LOS, EVENT_T_FRIENDLY_HP) - -========================================= -Cast Flags -========================================= -Below is the list of current Cast Flags that EventAI's spell casting can handle. -Cast flags are handled bitwise. Bit 0 is Interrupt Previous, bit 1 is triggered, etc. -So for example the number "3" (11 in Binary, selecting first 2 options) would mean that this cast has both CAST_INTURRUPT_PREVIOUS and CAST_TRIGGERED. -Another example: the number "5" (101 in Binary, selecting first and third options) would mean that this cast has CAST_INTURRUPT_PREVIOUS and CAST_FORCE_CAST. - -(bit# Decimal Internal Name Discription) -0 1 CAST_INTURRUPT_PREVIOUS Interrupts any previous spell casting (basicaly makes sure that this spell goes off) -1 2 CAST_TRIGGERED Forces the spell to be instant cast and require no mana/reagents. -2 4 CAST_FORCE_CAST Forces spell to cast even if the target is possibly out of range or the creature is possibly out of mana -3 8 CAST_NO_MELEE_IF_OOM Prevents creature from entering melee if out of mana or out of range -4 16 CAST_FORCE_TARGET_SELF Forces the target to cast this spell on itself -5 32 CAST_AURA_NOT_PRESENT Only casts the spell on the target if the target does not have the aura from that spell on itself already. - -NOTE: You can add the numbers in the decimal column to combine flags. - For example if you wanted to use CAST_NO_MELEE_IF_OOM(8) and CAST_TRIGGERED(2) you would simply use 10 in the cast flags field (8 + 2 = 10). - -========================================= -Event Flags -========================================= -Below is the list of current Event Flags that EventAI can handle. Event flags are handled bitwise. - -(bit# Decimal Internal Name Discription) -0 1 EFLAG_REPEATABLE Event repeats (Does not repeat if this flag is not set) -1 2 EFLAG_NORMAL Event occurs in Normal instance difficulty (will not occur in Normal if not set) -2 4 EFLAG_HEROIC Event occurs in Heroic instance difficulty (will not occur in Heroic if not set) -3 8 -4 16 -5 32 -6 64 -7 128 EFLAG_DEBUG_ONLY Prevents events from occuring on Release builds. Useful for testing new features. - -NOTE: You can add the numbers in the decimal column to combine flags. - - -========================================= -Basic Structure of creature_ai_texts -========================================= -Below is a the list of current fields within the texts tables. - -Field_Name Description ------------------------------------------------------------ -entry This value is mearly an NEGATIVE identifier of the current text number. Required for sql queries. Valid range are -1 to -999999 -content_default This is the actual text presented in the default language (English). - -content_loc1 This is the actual text presented in the Localization #1 Clients (Korean) -content_loc2 This is the actual text presented in the Localization #2 Clients (French) -content_loc3 This is the actual text presented in the Localization #3 Clients (German) -content_loc4 This is the actual text presented in the Localization #4 Clients (Chinese) -content_loc5 This is the actual text presented in the Localization #5 Clients (Taiwanese) -content_loc6 This is the actual text presented in the Localization #6 Clients (Spanish) -content_loc7 This is the actual text presented in the Localization #7 Clients (Spanish Mexico) -content_loc8 This is the actual text presented in the Localization #8 Clients (Russian) - -sound This value is the Sound ID that corresponds to the actual text used. -type Variables used to define type of text (Say/Yell/Textemote/Whisper). -language This value is the Language that the text is native in. -emote Value from enum Emote. Only source of text will play this emote (not target, if target are defined in DoScriptText) -comment This is a comment regarding the text entry - -Note: Fields `content_loc1` to `content_loc8` are NULL values by default and are normally handled by seperate localization projects. - -========================================= -Text Types (type) -========================================= -Below is the list of current Text types that texts tables can handle. These were previously seperate Actions in ACID. - -# Internal Name Description ------------------------------------------------------------ -0 CHAT_TYPE_SAY This type sets the text to be displayed as a Say (Speech Bubble). -1 CHAT_TYPE_YELL This type sets the text to be displayed as a Yell (Red Speech Bubble) and usually has a matching Sound ID. -2 CHAT_TYPE_TEXT_EMOTE This type sets the text to be displayed as a text emote in orange in the chat log. -3 CHAT_TYPE_BOSS_EMOTE This type sets the text to be displayed as a text emote in orange in the chat log (Used only for specific Bosses). -4 CHAT_TYPE_WHISPER This type sets the text to be displayed as a whisper to the player in the chat log. -5 CHAT_TYPE_BOSS_WHISPER This type sets the text to be displayed as a whisper to the player in the chat log (Used only for specific Bosses). -6 CHAT_TYPE_ZONE_YELL Same as CHAT_TYPE_YELL but will display to all players in current zone. - -========================================= -Language Types (language) -========================================= -Below is the list of current Language types that are allowed. -This is the Race Language that the text is native to (So it will display properly) - -# Internal Name Description ------------------------------------------------------------ -0 UNIVERSAL Text in this language is understood by ALL Races. -1 ORCISH Text in this language is understood ONLY by Horde Races. -2 DARNASSIAN Text in this language is understood ONLY by the Night Elf Race. -3 TAURAHE Text in this language is understood ONLY by the Tauren Race. -6 DWARVISH Text in this language is understood ONLY by the Dwarf Race. -7 COMMON Text in this language is understood ONLY by Alliance Races. -8 DEMONIC Text in this language is understood ONLY by the Demon Race (Not Implimented). -9 TITAN This language was used by Sargeras to speak with other Titians (Not Implemented). -10 THALASSIAN Text in this language is understood ONLY by the Blood Elf Race. -11 DRACONIC Text in this language is understood ONLY by the Dragon Race. -12 KALIMAG Text will display as Kalimag (not readable by players, language of all elementals) -13 GNOMISH Text in this language is understood ONLY by the Gnome Race. -14 TROLL Text in this language is understood ONLY by the Troll Race. -33 GUTTERSPEAK Text in this language is understood ONLY by the Undead Race. -35 DRAENEI Text in this language is understood ONLY by the Draenai Race. -36 ZOMBIE (not currently used?) -37 GNOMISH BINARY Binary language used by Alliance when drinking Binary Brew -38 GOBLIN BINARY Binary language used by Horce when drinking Binary Brew diff --git a/doc/UnixInstall.txt b/doc/UnixInstall.txt index 71ee4282a7c..6f3e55cdac6 100644 --- a/doc/UnixInstall.txt +++ b/doc/UnixInstall.txt @@ -6,7 +6,10 @@ WARNING: THIS DOCUMENTATION IS NOT ALWAYS UP TO DATE. FOR MORE UP-TO-DATE INFORMATION, CHECK THE TRINITY WIKI. ========================================================= -CHECK http://www.trinitycore.org/w/How-to:Linux FOR FURTHER HELP +CHECK http://www.trinitycore.info/How-to:Linux FOR FURTHER HELP + +These are instructions for installation in a Linux environment, if you are +using Windows refer to http://www.trinitycore.info/How-to:Win Installing TrinityCore is fairly simple on a Linux machine, assuming you have all required applications @@ -14,11 +17,11 @@ have all required applications The most important ones are: g++ - gcc + gcc version 4.3.x or greater make cmake version 2.6.x or greater libmysql++-dev - mercurial (for checking out the core and database) + git (for checking out the core and database) openssl libssl-dev zlib1g-dev @@ -51,12 +54,9 @@ flags like TOOLS Build map/vmap extraction/assembler tools USE_SCRIPTPCH Use precompiled headers when compiling scripts USE_COREPCH Use precompiled headers when compiling servers - USE_SFMT Use SFMT as random numbergenerator WITH_WARNINGS Show all warnings during compile WITH_COREDEBUG Include additional debug-code in core - PREFIX Set installation directory - CONF_DIR Set configuration directory - LIBSDIR Set library directory + CMAKE_INSTALL_PREFIX Set installation directory CMAKE_C_FLAGS Set C_FLAGS for compile (advanced users only) CMAKE_CXX_FLAGS Set CXX_FLAGS for compile (advanced users only) From 99b23429db65adf4d4e7463f74ba5278d930e196 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 1 Jun 2012 10:43:36 -0400 Subject: [PATCH 0891/1149] Core/Spells: fix damage from touch the nightmare for the caster and fix damage and healing for dream funnel. closes #6669 closes #6676 --- ...2012_06_01_00_world_spell_script_names.sql | 4 + src/server/scripts/Spells/spell_generic.cpp | 93 +++++++++++++++---- 2 files changed, 80 insertions(+), 17 deletions(-) create mode 100644 sql/updates/world/2012_06_01_00_world_spell_script_names.sql diff --git a/sql/updates/world/2012_06_01_00_world_spell_script_names.sql b/sql/updates/world/2012_06_01_00_world_spell_script_names.sql new file mode 100644 index 00000000000..cc024fe71cb --- /dev/null +++ b/sql/updates/world/2012_06_01_00_world_spell_script_names.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (50341,50344); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(50341, 'spell_gen_touch_the_nightmare'), +(50344, 'spell_gen_dream_funnel'); diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 0c879cfb029..e23e21cf2cd 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2052,9 +2052,9 @@ class spell_gen_defend : public SpellScriptLoader public: spell_gen_defend() : SpellScriptLoader("spell_gen_defend") { } - class spell_gen_defendAuraScript : public AuraScript + class spell_gen_defend_AuraScript : public AuraScript { - PrepareAuraScript(spell_gen_defendAuraScript); + PrepareAuraScript(spell_gen_defend_AuraScript); bool Validate(SpellInfo const* /*spellEntry*/) { @@ -2103,26 +2103,26 @@ class spell_gen_defend : public SpellScriptLoader // Defend spells casted by NPCs (add visuals) if (spell->Effects[EFFECT_0].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN) { - AfterEffectApply += AuraEffectApplyFn(spell_gen_defendAuraScript::RefreshVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); - OnEffectRemove += AuraEffectRemoveFn(spell_gen_defendAuraScript::RemoveVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + AfterEffectApply += AuraEffectApplyFn(spell_gen_defend_AuraScript::RefreshVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend_AuraScript::RemoveVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); } // Remove Defend spell from player when he dismounts if (spell->Effects[EFFECT_2].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN) - OnEffectRemove += AuraEffectRemoveFn(spell_gen_defendAuraScript::RemoveDummyFromDriver, EFFECT_2, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL); + OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend_AuraScript::RemoveDummyFromDriver, EFFECT_2, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL); // Defend spells casted by players (add/remove visuals) if (spell->Effects[EFFECT_1].ApplyAuraName == SPELL_AURA_DUMMY) { - AfterEffectApply += AuraEffectApplyFn(spell_gen_defendAuraScript::RefreshVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); - OnEffectRemove += AuraEffectRemoveFn(spell_gen_defendAuraScript::RemoveVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + AfterEffectApply += AuraEffectApplyFn(spell_gen_defend_AuraScript::RefreshVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend_AuraScript::RemoveVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); } } }; AuraScript* GetAuraScript() const { - return new spell_gen_defendAuraScript(); + return new spell_gen_defend_AuraScript(); } }; @@ -2326,9 +2326,9 @@ class spell_gen_on_tournament_mount : public SpellScriptLoader public: spell_gen_on_tournament_mount() : SpellScriptLoader("spell_gen_on_tournament_mount") { } - class spell_gen_on_tournament_mountAuraScript : public AuraScript + class spell_gen_on_tournament_mount_AuraScript : public AuraScript { - PrepareAuraScript(spell_gen_on_tournament_mountAuraScript); + PrepareAuraScript(spell_gen_on_tournament_mount_AuraScript); uint32 _pennantSpellId; @@ -2468,14 +2468,14 @@ class spell_gen_on_tournament_mount : public SpellScriptLoader void Register() { - AfterEffectApply += AuraEffectApplyFn(spell_gen_on_tournament_mountAuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); - OnEffectRemove += AuraEffectRemoveFn(spell_gen_on_tournament_mountAuraScript::HandleRemoveEffect, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + AfterEffectApply += AuraEffectApplyFn(spell_gen_on_tournament_mount_AuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectRemove += AuraEffectRemoveFn(spell_gen_on_tournament_mount_AuraScript::HandleRemoveEffect, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); } }; AuraScript* GetAuraScript() const { - return new spell_gen_on_tournament_mountAuraScript(); + return new spell_gen_on_tournament_mount_AuraScript(); } }; @@ -2484,9 +2484,9 @@ class spell_gen_tournament_pennant : public SpellScriptLoader public: spell_gen_tournament_pennant() : SpellScriptLoader("spell_gen_tournament_pennant") { } - class spell_gen_tournament_pennantAuraScript : public AuraScript + class spell_gen_tournament_pennant_AuraScript : public AuraScript { - PrepareAuraScript(spell_gen_tournament_pennantAuraScript); + PrepareAuraScript(spell_gen_tournament_pennant_AuraScript); bool Load() { @@ -2502,13 +2502,13 @@ class spell_gen_tournament_pennant : public SpellScriptLoader void Register() { - OnEffectApply += AuraEffectApplyFn(spell_gen_tournament_pennantAuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectApply += AuraEffectApplyFn(spell_gen_tournament_pennant_AuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); } }; AuraScript* GetAuraScript() const { - return new spell_gen_tournament_pennantAuraScript(); + return new spell_gen_tournament_pennant_AuraScript(); } }; @@ -2688,6 +2688,63 @@ public: } }; +class spell_gen_touch_the_nightmare : public SpellScriptLoader +{ +public: + spell_gen_touch_the_nightmare() : SpellScriptLoader("spell_gen_touch_the_nightmare") { } + + class spell_gen_touch_the_nightmare_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_touch_the_nightmare_SpellScript); + + void HandleDamageCalc(SpellEffIndex effIndex) + { + uint32 bp = GetCaster()->GetMaxHealth() * 0.3f; + SetHitDamage(bp); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_touch_the_nightmare_SpellScript::HandleDamageCalc, EFFECT_2, SPELL_EFFECT_SCHOOL_DAMAGE); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_touch_the_nightmare_SpellScript(); + } +}; + +class spell_gen_dream_funnel: public SpellScriptLoader +{ +public: + spell_gen_dream_funnel() : SpellScriptLoader("spell_gen_dream_funnel") { } + + class spell_gen_dream_funnel_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_dream_funnel_AuraScript); + + void HandleEffectCalcAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated) + { + if (GetCaster()) + amount = GetCaster()->GetMaxHealth() * 0.05f; + + canBeRecalculated = false; + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_dream_funnel_AuraScript::HandleEffectCalcAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_dream_funnel_AuraScript::HandleEffectCalcAmount, EFFECT_2, SPELL_AURA_PERIODIC_DAMAGE); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_gen_dream_funnel_AuraScript(); + } +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -2742,4 +2799,6 @@ void AddSC_generic_spell_scripts() new spell_gen_count_pct_from_max_hp("spell_gen_default_count_pct_from_max_hp"); new spell_gen_count_pct_from_max_hp("spell_gen_50pct_count_pct_from_max_hp", 50); new spell_gen_despawn_self(); + new spell_gen_touch_the_nightmare(); + new spell_gen_dream_funnel(); } From dfbd7a820b6f577d7a38bc88e6152903571b3dd1 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Fri, 1 Jun 2012 12:23:55 -0230 Subject: [PATCH 0892/1149] Core/scripts: Add generic script to prevent cannon movement. --- .../2012_06_01_01_world_creature_script.sql | 2 ++ src/server/scripts/World/npcs_special.cpp | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 sql/updates/world/2012_06_01_01_world_creature_script.sql diff --git a/sql/updates/world/2012_06_01_01_world_creature_script.sql b/sql/updates/world/2012_06_01_01_world_creature_script.sql new file mode 100644 index 00000000000..d90800bd1af --- /dev/null +++ b/sql/updates/world/2012_06_01_01_world_creature_script.sql @@ -0,0 +1,2 @@ +-- Add Generic Harpoon gun script to prevent movement +UPDATE `creature_template` SET `ScriptName`= 'npc_generic_harpoon_cannon' WHERE `entry` IN (27714,30066,30337); diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index ecd1a439a58..bfe4ac07bdc 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -2988,6 +2988,32 @@ public: }; }; +/*###### +## npc_generic_harpoon_cannon +######*/ + +class npc_generic_harpoon_cannon : public CreatureScript +{ +public: + npc_generic_harpoon_cannon() : CreatureScript("npc_generic_harpoon_cannon") { } + + struct npc_generic_harpoon_cannonAI : public ScriptedAI + { + npc_generic_harpoon_cannonAI(Creature* creature) : ScriptedAI(creature) {} + + void Reset() + { + me->SetUnitMovementFlags(MOVEMENTFLAG_ROOT); + me->SetExtraUnitMovementFlags(MOVEMENTFLAG2_NO_STRAFE | MOVEMENTFLAG2_NO_JUMPING | MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_generic_harpoon_cannonAI(creature); + } +}; + void AddSC_npcs_special() { new npc_air_force_bots(); @@ -3020,4 +3046,5 @@ void AddSC_npcs_special() new npc_earth_elemental(); new npc_firework(); new npc_spring_rabbit(); + new npc_generic_harpoon_cannon(); } From 8cc19196a653194a765738a02daa287714ab0dd3 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Fri, 1 Jun 2012 12:34:08 -0230 Subject: [PATCH 0893/1149] Core/script: Informed by Kaelima this line is handled by dbc and not required. --- src/server/scripts/World/npcs_special.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index bfe4ac07bdc..c9aeea07382 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -3004,7 +3004,6 @@ public: void Reset() { me->SetUnitMovementFlags(MOVEMENTFLAG_ROOT); - me->SetExtraUnitMovementFlags(MOVEMENTFLAG2_NO_STRAFE | MOVEMENTFLAG2_NO_JUMPING | MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING); } }; From 925657cc9885c2c2b1cd6b379bfdd72555af49ea Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 1 Jun 2012 19:48:43 +0100 Subject: [PATCH 0894/1149] Scripts/Sholazar: Fix quest Kick, What Kick? - Closes #370 --- .../world/2012_06_01_02_world_misc.sql | 70 ++++++++++ .../scripts/Northrend/sholazar_basin.cpp | 122 ++++++++++++++++++ 2 files changed, 192 insertions(+) create mode 100644 sql/updates/world/2012_06_01_02_world_misc.sql diff --git a/sql/updates/world/2012_06_01_02_world_misc.sql b/sql/updates/world/2012_06_01_02_world_misc.sql new file mode 100644 index 00000000000..23663ef9270 --- /dev/null +++ b/sql/updates/world/2012_06_01_02_world_misc.sql @@ -0,0 +1,70 @@ +/* Quest: Kick, What Kick? - 12589 by Nay */ + +-- Lucky Wilhelm: 0xF150006D960041CB +-- Drostan: 0xF130006EA80041CA +-- Apple: 0xF130006D950041C8 + +-- Remove old conditions, now done in cpp +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=51330; + +-- Spells conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (51331,51332,51366); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 51331, 0, 0, 31, 0, 3, 28053, 0, 0, 0, '', 'Hit Apple - Apple - Q: Kick, What Kick?'), +(13, 1, 51332, 0, 0, 31, 0, 3, 28054, 0, 0, 0, '', 'Miss Apple - Wilhelm - Q: Kick, What Kick?'), +(13, 1, 51366, 0, 0, 31, 0, 3, 28093, 0, 0, 0, '', 'Miss Apple, Hit Bird - Sholazar Tickbird - Q: Kick, What Kick?'); + +-- Assign script to spell +DELETE FROM `spell_script_names` WHERE `spell_id`=51330; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(51330, 'spell_q12589_shoot_rjr'); + +-- Spellclick spell for Wilhelm +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=28054; +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`,`user_type`) VALUES +(28054,50556,1,0); + +-- Addon data +DELETE FROM `creature_template_addon` WHERE `entry` IN (28053,28328,30737,28346); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(28053,0,0,1,0, NULL), -- Apple +(28328,0,0,257,0, NULL), -- Drostan +(30737,0,0,256,0, NULL), -- Nesingwary Game Warden +(28346,0,0,1,0, NULL); -- Crunchy + +-- Put Apple in Wilhelm's head +DELETE FROM `vehicle_template_accessory` WHERE `entry`=28054 AND `accessory_entry`=28053; +INSERT INTO `vehicle_template_accessory` (`entry`,`accessory_entry`, `seat_id`, `minion`, `description`, `summontype`, `summontimer`) VALUES +(28054, 28053, -1, 0, 'Lucky Wilhelm - Apple', 6, 10000); + +-- Says and yells +DELETE FROM `creature_text` WHERE `entry`=28328 OR (`entry`=28054 AND `groupid` IN (0,1)); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(28328, 0, 0, 'The only thing hurt is your pride, lad. Buck up!', 12, 0, 100, 11, 0, 0, 'Drostan to Lucky Wilhelm'), +(28328, 0, 1, 'Stop whining. You''ve still got your luck.', 12, 0, 100, 11, 0, 0, 'Drostan to Lucky Wilhelm'), +(28328, 0, 2, 'Bah, it''s an improvement.', 12, 0, 100, 0, 0, 0, 'Drostan to Lucky Wilhelm'), +(28328, 0, 3, 'Calm down lad, it''s just a birdshot!', 12, 0, 100, 0, 0, 0, 'Drostan to Lucky Wilhelm'), +(28054, 0, 0, 'Not the ''stache! Now I''m asymmetrical!', 12, 0, 100, 5, 0, 0, 'Lucky Wilhelm'), +(28054, 0, 1, 'Ouch! That''s it, I quit the target business!', 12, 0, 100, 0, 0, 0, 'Lucky Wilhelm'), +(28054, 0, 2, 'My ear! You grazed my ear!', 12, 0, 100, 0, 0, 0, 'Lucky Wilhelm'), +(28054, 1, 0, 'Good shot!', 12, 0, 100, 4, 0, 0, 'Lucky Wilhelm'); + +/* * Hit: */ +/* player casts Shoot RJR on Lucky */ +/* apple gets hit by 51331 (Hit Apple) by player */ +/* after that apple casts 51371 (Apple Falls to ground) on self */ +/* Wilhelm says Good shot! */ +/* reward killcredit 28053 */ + +/* * Miss: */ +/* player casts Shoot RJR on Lucky */ +/* lucky gets hit by 51332 (Miss Apple) by player */ +/* lucky says random text */ +/* drostan says random text */ + +/* * Miss, Hit Bird - guessed */ +/* player casts Shoot RJR on Lucky */ +/* bird gets hit by 51366 (Miss Apple, Hit Bird and dies) */ +/* bird gets hit by 51369 (Tickbird Signal to Fall) */ +/* lucky says random text */ +/* drostan says random text */ diff --git a/src/server/scripts/Northrend/sholazar_basin.cpp b/src/server/scripts/Northrend/sholazar_basin.cpp index 93d0182ea08..2a03e44d5b2 100644 --- a/src/server/scripts/Northrend/sholazar_basin.cpp +++ b/src/server/scripts/Northrend/sholazar_basin.cpp @@ -746,6 +746,127 @@ public: } }; +/*###### +## Quest Kick, What Kick? (12589) +######*/ + +enum KickWhatKick +{ + NPC_LUCKY_WILHELM = 28054, + NPC_APPLE = 28053, + NPC_DROSTAN = 28328, + NPC_CRUNCHY = 28346, + NPC_THICKBIRD = 28093, + + SPELL_HIT_APPLE = 51331, + SPELL_MISS_APPLE = 51332, + SPELL_MISS_BIRD_APPLE = 51366, + SPELL_APPLE_FALL = 51371, + SPELL_BIRD_FALL = 51369, + + EVENT_MISS = 0, + EVENT_HIT = 1, + EVENT_MISS_BIRD = 2, + + SAY_WILHELM_MISS = 0, + SAY_WILHELM_HIT = 1, + SAY_DROSTAN_REPLY_MISS = 0, +}; + +class spell_q12589_shoot_rjr : public SpellScriptLoader +{ +public: + spell_q12589_shoot_rjr() : SpellScriptLoader("spell_q12589_shoot_rjr") { } + + class spell_q12589_shoot_rjr_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q12589_shoot_rjr_SpellScript); + + SpellCastResult CheckCast() + { + if (Unit* target = GetExplTargetUnit()) + if (target->GetEntry() == NPC_LUCKY_WILHELM) + return SPELL_CAST_OK; + + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_TARGET_WILHELM); + return SPELL_FAILED_CUSTOM_ERROR; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + uint32 roll = urand(1, 100); + + uint8 ev; + if (roll <= 50) + ev = EVENT_MISS; + else if (roll <= 83) + ev = EVENT_HIT; + else + ev = EVENT_MISS_BIRD; + + Unit* shooter = GetCaster(); + Creature* wilhelm = GetHitUnit()->ToCreature(); + Creature* apple = shooter->FindNearestCreature(NPC_APPLE, 30); + Creature* bird = shooter->FindNearestCreature(NPC_THICKBIRD, 30); + Creature* drostan = shooter->FindNearestCreature(NPC_DROSTAN, 30); + Creature* crunchy = shooter->FindNearestCreature(NPC_CRUNCHY, 30); + + if (!wilhelm || !apple || !drostan) + return; + + switch (ev) + { + case EVENT_MISS_BIRD: + { + if (!bird || !crunchy) + ; // fall to EVENT_MISS + else + { + shooter->CastSpell(bird, SPELL_MISS_BIRD_APPLE); + shooter->CastSpell(bird, SPELL_BIRD_FALL); + wilhelm->AI()->Talk(SAY_WILHELM_MISS); + drostan->AI()->Talk(SAY_DROSTAN_REPLY_MISS); + + bird->Kill(bird); + crunchy->GetMotionMaster()->MovePoint(0, bird->GetPositionX(), bird->GetPositionY(), + bird->GetMap()->GetWaterOrGroundLevel(bird->GetPositionX(), bird->GetPositionY(), bird->GetPositionZ())); + // TODO: Make crunchy perform emote eat when he reaches the bird + } + } + case EVENT_MISS: + { + shooter->CastSpell(wilhelm, SPELL_MISS_APPLE); + wilhelm->AI()->Talk(SAY_WILHELM_MISS); + drostan->AI()->Talk(SAY_DROSTAN_REPLY_MISS); + break; + } + case EVENT_HIT: + { + shooter->CastSpell(apple, SPELL_HIT_APPLE); + apple->CastSpell(apple, SPELL_APPLE_FALL); + wilhelm->AI()->Talk(SAY_WILHELM_HIT); + if (Player* player = shooter->ToPlayer()) + player->KilledMonsterCredit(NPC_APPLE, 0); + apple->DespawnOrUnsummon(); + + break; + } + } + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_q12589_shoot_rjr_SpellScript::CheckCast); + OnEffectHitTarget += SpellEffectFn(spell_q12589_shoot_rjr_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_q12589_shoot_rjr_SpellScript(); + } +}; + void AddSC_sholazar_basin() { new npc_injured_rainspeaker_oracle(); @@ -756,4 +877,5 @@ void AddSC_sholazar_basin() new npc_adventurous_dwarf(); new npc_jungle_punch_target(); new spell_q12620_the_lifewarden_wrath(); + new spell_q12589_shoot_rjr(); } From f89ef6da5b6d59e9d758059549d95759711d0cf9 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 1 Jun 2012 19:59:44 +0100 Subject: [PATCH 0895/1149] DB/Misc: Fix DB startup errors - Closes #6666 Also add a missing break; to previous commit --- .../world/2012_06_01_03_world_creature_template.sql | 2 ++ src/server/scripts/Northrend/sholazar_basin.cpp | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 sql/updates/world/2012_06_01_03_world_creature_template.sql diff --git a/sql/updates/world/2012_06_01_03_world_creature_template.sql b/sql/updates/world/2012_06_01_03_world_creature_template.sql new file mode 100644 index 00000000000..fb20691ad69 --- /dev/null +++ b/sql/updates/world/2012_06_01_03_world_creature_template.sql @@ -0,0 +1,2 @@ +-- Set same flag for diff_entry_1 +UPDATE `creature_template` SET `npcflag`=129 WHERE `entry`=30796; diff --git a/src/server/scripts/Northrend/sholazar_basin.cpp b/src/server/scripts/Northrend/sholazar_basin.cpp index 2a03e44d5b2..afab9b90a4a 100644 --- a/src/server/scripts/Northrend/sholazar_basin.cpp +++ b/src/server/scripts/Northrend/sholazar_basin.cpp @@ -807,9 +807,7 @@ public: Unit* shooter = GetCaster(); Creature* wilhelm = GetHitUnit()->ToCreature(); Creature* apple = shooter->FindNearestCreature(NPC_APPLE, 30); - Creature* bird = shooter->FindNearestCreature(NPC_THICKBIRD, 30); Creature* drostan = shooter->FindNearestCreature(NPC_DROSTAN, 30); - Creature* crunchy = shooter->FindNearestCreature(NPC_CRUNCHY, 30); if (!wilhelm || !apple || !drostan) return; @@ -818,12 +816,15 @@ public: { case EVENT_MISS_BIRD: { + Creature* crunchy = shooter->FindNearestCreature(NPC_CRUNCHY, 30); + Creature* bird = shooter->FindNearestCreature(NPC_THICKBIRD, 30); + if (!bird || !crunchy) ; // fall to EVENT_MISS else { shooter->CastSpell(bird, SPELL_MISS_BIRD_APPLE); - shooter->CastSpell(bird, SPELL_BIRD_FALL); + bird->CastSpell(bird, SPELL_BIRD_FALL); wilhelm->AI()->Talk(SAY_WILHELM_MISS); drostan->AI()->Talk(SAY_DROSTAN_REPLY_MISS); @@ -831,6 +832,8 @@ public: crunchy->GetMotionMaster()->MovePoint(0, bird->GetPositionX(), bird->GetPositionY(), bird->GetMap()->GetWaterOrGroundLevel(bird->GetPositionX(), bird->GetPositionY(), bird->GetPositionZ())); // TODO: Make crunchy perform emote eat when he reaches the bird + + break; } } case EVENT_MISS: From f89da81406c919d24ebd373979f54a8cb90d45c5 Mon Sep 17 00:00:00 2001 From: hexa- Date: Fri, 1 Jun 2012 21:22:58 +0200 Subject: [PATCH 0896/1149] Core/Battlegrounds: Introduce Arena.RatedUpdateTimer to configure time between checks for rated arena matches. --- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 12 ++++++------ src/server/game/Battlegrounds/BattlegroundMgr.h | 2 +- src/server/game/World/World.cpp | 1 + src/server/game/World/World.h | 1 + src/server/worldserver/worldserver.conf.dist | 7 +++++++ 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index a106f11ae82..2b2265dad84 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -55,7 +55,7 @@ BattlegroundMgr::BattlegroundMgr() : m_AutoDistributionTimeChecker(0), m_ArenaTe { for (uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; i++) m_Battlegrounds[i].clear(); - m_NextRatingDiscardUpdate = sWorld->getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER); + m_NextRatedArenaUpdate = sWorld->getIntConfig(CONFIG_ARENA_RATED_UPDATE_TIMER); m_Testing=false; } @@ -143,10 +143,10 @@ void BattlegroundMgr::Update(uint32 diff) } // if rating difference counts, maybe force-update queues - if (sWorld->getIntConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE) && sWorld->getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER)) + if (sWorld->getIntConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE) && sWorld->getIntConfig(CONFIG_ARENA_RATED_UPDATE_TIMER)) { // it's time to force update - if (m_NextRatingDiscardUpdate < diff) + if (m_NextRatedArenaUpdate < diff) { // forced update for rated arenas (scan all, but skipped non rated) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BattlegroundMgr: UPDATING ARENA QUEUES"); @@ -156,10 +156,10 @@ void BattlegroundMgr::Update(uint32 diff) BATTLEGROUND_AA, BattlegroundBracketId(bracket), BattlegroundMgr::BGArenaType(BattlegroundQueueTypeId(qtype)), true, 0); - m_NextRatingDiscardUpdate = sWorld->getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER); + m_NextRatedArenaUpdate = sWorld->getIntConfig(CONFIG_ARENA_RATED_UPDATE_TIMER); } else - m_NextRatingDiscardUpdate -= diff; + m_NextRatedArenaUpdate -= diff; } if (sWorld->getBoolConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS)) { @@ -1137,4 +1137,4 @@ BattlegroundTypeId BattlegroundMgr::WeekendHolidayIdToBGType(HolidayIds holiday) bool BattlegroundMgr::IsBGWeekend(BattlegroundTypeId bgTypeId) { return IsHolidayActive(BGTypeToWeekendHolidayId(bgTypeId)); -} \ No newline at end of file +} diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.h b/src/server/game/Battlegrounds/BattlegroundMgr.h index 7afb83da0a6..10a49408c06 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.h +++ b/src/server/game/Battlegrounds/BattlegroundMgr.h @@ -141,7 +141,7 @@ class BattlegroundMgr BattlegroundSelectionWeightMap m_BGSelectionWeights; std::vector m_QueueUpdateScheduler; std::set m_ClientBattlegroundIds[MAX_BATTLEGROUND_TYPE_ID][MAX_BATTLEGROUND_BRACKETS]; //the instanceids just visible for the client - uint32 m_NextRatingDiscardUpdate; + uint32 m_NextRatedArenaUpdate; time_t m_NextAutoDistributionTime; uint32 m_AutoDistributionTimeChecker; bool m_ArenaTesting; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 6e32d33a7bb..fa4943ce625 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1022,6 +1022,7 @@ void World::LoadConfigSettings(bool reload) m_bool_configs[CONFIG_BG_XP_FOR_KILL] = ConfigMgr::GetBoolDefault("Battleground.GiveXPForKills", false); m_int_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = ConfigMgr::GetIntDefault ("Arena.MaxRatingDifference", 150); m_int_configs[CONFIG_ARENA_RATING_DISCARD_TIMER] = ConfigMgr::GetIntDefault ("Arena.RatingDiscardTimer", 10 * MINUTE * IN_MILLISECONDS); + m_int_configs[CONFIG_ARENA_RATED_UPDATE_TIMER] = ConfigMgr::GetIntDefault ("Arena.RatedUpdateTimer", 5 * IN_MILLISECONDS); m_bool_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS] = ConfigMgr::GetBoolDefault("Arena.AutoDistributePoints", false); m_int_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS] = ConfigMgr::GetIntDefault ("Arena.AutoDistributeInterval", 7); m_bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE] = ConfigMgr::GetBoolDefault("Arena.QueueAnnouncer.Enable", false); diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 95e9fbda8ca..f0dbc3c84ad 100755 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -279,6 +279,7 @@ enum WorldIntConfigs CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH, CONFIG_ARENA_MAX_RATING_DIFFERENCE, CONFIG_ARENA_RATING_DISCARD_TIMER, + CONFIG_ARENA_RATED_UPDATE_TIMER, CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS, CONFIG_ARENA_SEASON_ID, CONFIG_ARENA_START_RATING, diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 5d837100b0e..db167fb86fb 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -2513,6 +2513,13 @@ Arena.MaxRatingDifference = 150 Arena.RatingDiscardTimer = 600000 +# +# Arena.RatedUpdateTimer +# Description: Time (in milliseconds) between checks for matchups in rated arena +# Default: 5000 - (5 seconds) + +Arena.RatedUpdateTimer = 5000 + # # Arena.AutoDistributePoints # Description: Automatically distribute arena points. From d75ea8837b4ede12a8f37f1123ae835228683fc7 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 1 Jun 2012 23:03:57 +0100 Subject: [PATCH 0897/1149] Scripts/Dragonblight: Fix quest Strengthen the Ancients - Closes #2043 --- .../world/2012_06_01_04_world_misc.sql | 41 ++++++++ src/server/scripts/Northrend/dragonblight.cpp | 99 +++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 sql/updates/world/2012_06_01_04_world_misc.sql diff --git a/sql/updates/world/2012_06_01_04_world_misc.sql b/sql/updates/world/2012_06_01_04_world_misc.sql new file mode 100644 index 00000000000..d5273cec233 --- /dev/null +++ b/sql/updates/world/2012_06_01_04_world_misc.sql @@ -0,0 +1,41 @@ +-- Creature addon +DELETE FROM `creature_template_addon` WHERE `entry` IN (26421,26321,26333); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(26421,0,0,1,0, NULL), -- Woodlands Walker +(26321,0,0,1,64, '47044'), -- Lothalor Ancient (Cosmetic - Confused State Visual (Big)) +(26333,0,0,1,0, '32566 46967'); -- Corrupted Lothalor Ancient (Purple Banish State, Purple Banish State - Breath) + +-- Woodlands Walker already has spellclick spell: 47575 (Strengthen the Ancients: On Interact Dummy to Woodlands Walker) + +-- Monster emotes +DELETE FROM `creature_text` WHERE `entry` IN (26421,26321); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(26421, 0, 0, 'Breaking off a piece of its bark, the %s hands it to you before departing.', 16, 0, 100, 0, 0, 0, 'Woodlands Walker'), +(26421, 1, 0, 'The %s is angered by your request and attacks!', 16, 0, 100, 0, 0, 0, 'Woodlands Walker'), +(26321, 0, 0, 'The %s gives you its thanks.', 16, 0, 100, 0, 0, 1525, 'Lothalor Ancient'); + +-- Assign scripts to spells +DELETE FROM `spell_script_names` WHERE `spell_id` IN (47575,47530); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(47575, 'spell_q12096_q12092_dummy'), +(47530, 'spell_q12096_q12092_bark'); + +/* +- player spellclicks Woodlands Walker, casts 47575 on the tree Woodlands Walker: two outcomes: + +- - tree turns enemy: +* say The %s is angered by your request and attacks! +* change faction to 14 +* start attack + +- - tree stays friendly: +* cast 47550 (Create Bark of the Walkers)on player +* say Breaking off a piece of its bark, the %s hands it to you before departing. +* despawn + + +- player uses item on Lothalor Ancient (47530 (Bark of the Walkers)): +* tree says The %s gives you its thanks. +* aura 47044 (Cosmetic - Confused State Visual (Big)) is removed +* despawns after 4 secs +*/ diff --git a/src/server/scripts/Northrend/dragonblight.cpp b/src/server/scripts/Northrend/dragonblight.cpp index 4cbe280a9f2..1b339b24549 100644 --- a/src/server/scripts/Northrend/dragonblight.cpp +++ b/src/server/scripts/Northrend/dragonblight.cpp @@ -69,7 +69,106 @@ public: } }; +/*###### +## Quest Strengthen the Ancients (12096|12092) +######*/ + +enum StrengthenAncientsMisc +{ + SAY_WALKER_FRIENDLY = 0, + SAY_WALKER_ENEMY = 1, + SAY_LOTHALOR = 0, + + SPELL_CREATE_ITEM_BARK = 47550, + SPELL_CONFUSED = 47044, + + NPC_LOTHALOR = 26321, + + FACTION_WALKER_ENEMY = 14, +}; + +class spell_q12096_q12092_dummy : public SpellScriptLoader // Strengthen the Ancients: On Interact Dummy to Woodlands Walker +{ +public: + spell_q12096_q12092_dummy() : SpellScriptLoader("spell_q12096_q12092_dummy") { } + + class spell_q12096_q12092_dummy_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q12096_q12092_dummy_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + uint32 roll = rand() % 2; + + Creature* tree = GetHitCreature(); + Player* player = GetCaster()->ToPlayer(); + + if (!tree || !player) + return; + + tree->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); + + if (roll == 1) // friendly version + { + tree->CastSpell(player, SPELL_CREATE_ITEM_BARK); + tree->AI()->Talk(SAY_WALKER_FRIENDLY, player->GetGUID()); + tree->DespawnOrUnsummon(1000); + } + else if (roll == 0) // enemy version + { + tree->AI()->Talk(SAY_WALKER_ENEMY, player->GetGUID()); + tree->setFaction(FACTION_WALKER_ENEMY); + tree->Attack(player, true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_q12096_q12092_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_q12096_q12092_dummy_SpellScript(); + } +}; + +class spell_q12096_q12092_bark : public SpellScriptLoader // Bark of the Walkers +{ +public: + spell_q12096_q12092_bark() : SpellScriptLoader("spell_q12096_q12092_bark") { } + + class spell_q12096_q12092_bark_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q12096_q12092_bark_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Creature* lothalor = GetHitCreature(); + if (!lothalor || lothalor->GetEntry() != NPC_LOTHALOR) + return; + + lothalor->AI()->Talk(SAY_LOTHALOR); + lothalor->RemoveAura(SPELL_CONFUSED); + lothalor->DespawnOrUnsummon(4000); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_q12096_q12092_bark_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_q12096_q12092_bark_SpellScript(); + } +}; + void AddSC_dragonblight() { new npc_alexstrasza_wr_gate; + new spell_q12096_q12092_dummy; + new spell_q12096_q12092_bark; } From 5e6daadcd08f5a3d05182a4c48877c2c9a0c7526 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 2 Jun 2012 09:45:37 -0230 Subject: [PATCH 0898/1149] DB/SAI: Fixes for Quest 9738 "Lost in Action". One NPC left to script --- sql/updates/world/2012_06_02_00_world_sai.sql | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 sql/updates/world/2012_06_02_00_world_sai.sql diff --git a/sql/updates/world/2012_06_02_00_world_sai.sql b/sql/updates/world/2012_06_02_00_world_sai.sql new file mode 100644 index 00000000000..af0b12be244 --- /dev/null +++ b/sql/updates/world/2012_06_02_00_world_sai.sql @@ -0,0 +1,118 @@ +-- Add missing gossip for quest 9738 "Lost in Action" +DELETE FROM `gossip_menu` WHERE `entry` IN (7521,7520,7540,7519,7525); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(7521,9121),(7520,9119),(7540,9144),(7519,9118),(7525,9125); +-- Add Gossip Options +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7520,7540); +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES +(7520,0,0,"Alright, Bite, I'll let you out.",1,1,0,0,0,0,''), +(7540,0,0,"Naturalist, please grant me your boon.",1,1,0,0,0,0,''); +-- Conditions for the gossip options +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (15) AND `SourceGroup` IN (7520,7540); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`comment`) VALUES +(15,7520,0,0,9,9738,'Gossip option 0 requires quest 9738 active'), +(15,7540,0,0,9,9738,'Gossip option 0 requires quest 9738 active'); -- cast 34906 on player +-- Add gossip to creature +UPDATE `creature_template` SET `gossip_menu_id`=7521 WHERE `entry`=17885; +UPDATE `creature_template` SET `gossip_menu_id`=7520 WHERE `entry`=17893; +UPDATE `creature_template` SET `gossip_menu_id`=7519 WHERE `entry`=17890; +UPDATE `creature_template` SET `gossip_menu_id`=7525 WHERE `entry`=17827; +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry` IN (17893,17957); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(17893,0,0, 'Over here! Yeah, over here... I''m in this cage!!!',14,0,100,0,0,0, 'Naturalist Bite'), +(17893,1,0, 'Uh oh! It would appear that all of the noise you''ve been making has attracted some unwanted attention!',12,0,100,0,0,0, 'Naturalist Bite'), +(17957,0,0, 'Intrudersss with the prisssoner! Kill them!!!',14,0,100,0,0,0, 'Coilfang Champion'); +-- Earthbinder Rayge SAI +SET @ENTRY := 17885; +UPDATE `creature` SET `position_x`=296.6974,`position_y`=-362.373,`position_z`=50.15062,`orientation`=5.5676 WHERE `guid`=86372; +UPDATE `creature_template` SET `unit_flags`=512,`AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +UPDATE `creature_template_addon` SET `bytes2`=257,`auras`= '31526' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,64,0,100,6,0,0,0,0,33,@ENTRY,0,0,0,0,0,7,0,0,0,0,0,0,0,'Earthbinder Rayge - On Gossip Hello - Give Kill Credit'); +-- Weeder Greenthumb SAI +SET @ENTRY := 17890; +UPDATE `creature_template` SET `unit_flags`=512,`AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +UPDATE `creature_template_addon` SET `bytes1`=0,`bytes2`=257,`auras`= '29266' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,64,0,100,6,0,0,0,0,33,@ENTRY,0,0,0,0,0,7,0,0,0,0,0,0,0,'Weeder Greenthumb - On Gossip Hello - Give Kill Credit'); +-- Claw SAI +SET @ENTRY := 17827; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@ENTRY*100; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,6,7400,7400,20000,20000,11,39435,0,0,0,0,0,5,0,0,0,0,0,0,0,'Claw - Combat - Cast Feral Charge'), +(@ENTRY,0,1,0,0,0,100,6,2400,2400,10600,21200,11,31429,0,0,0,0,0,1,0,0,0,0,0,0,0,'Claw - Combat - Cast Echoing Roar'), +(@ENTRY,0,2,0,0,0,100,6,5000,5000,30500,30500,11,34971,0,0,0,0,0,1,0,0,0,0,0,0,0,'Claw - Combat - Cast Frenzy'), +(@ENTRY,0,3,0,0,0,100,6,5300,5300,11100,21500,11,34298,0,0,0,0,0,2,0,0,0,0,0,0,0,'Claw - Combat - Cast Maul'), +(@ENTRY,0,4,0,2,1,100,7,0,20,0,0,80,@ENTRY*100,2,0,0,0,0,1,0,0,0,0,0,0,0,'Claw - HP@20% - Run Script'), +(@ENTRY,0,5,0,64,0,100,6,0,0,0,0,33,17894,0,0,0,0,0,7,0,0,0,0,0,0,0,'Claw - On Gossip Hello - Give Kill Credit'), +(@ENTRY,0,6,0,6,0,100,6,0,0,0,0,45,0,1,0,0,0,0,19,17826,100,0,0,0,0,0,'Claw - On Death - Set Data on Swamplord Musel''ek'), +(@ENTRY,0,7,0,38,0,100,6,0,1,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Swamplord Musel''ek - On dataset - Set Phase 1'), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,28,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Claw - Script - Remove all auras'), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Claw - Script - Set Run on'), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,69,0,0,0,0,0,0,8,0,0,0,289.2553,-129.7001,29.82101,2.495821,'Claw - Script - move to'), +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,2,1660,0,0,0,0,0,1,0,0,0,0,0,0,0,'Claw - Script - Set faction'), +(@ENTRY*100,9,4,0,0,0,100,0,0,0,0,0,18,525072,0,0,0,0,0,1,0,0,0,0,0,0,0,'Claw - Script - Set unitflags'), +(@ENTRY*100,9,5,0,0,0,100,0,0,0,0,0,3,0,2289,0,0,0,0,1,0,0,0,0,0,0,0,'Claw - Script - Set displayid'), +(@ENTRY*100,9,6,0,0,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Claw - Script - Set npcflags'), +(@ENTRY*100,9,7,0,0,0,100,0,4000,4000,4000,4000,69,0,0,0,0,0,0,8,0,0,0,290.5323,-125.3524,29.69708,1.824913,'Claw - Script - move to'), +(@ENTRY*100,9,8,0,0,0,100,0,0,0,0,0,3,17894,0,0,0,0,0,1,0,0,0,0,0,0,0,'Claw - Script - Set entry'), +(@ENTRY*100,9,9,0,0,0,100,0,0,0,0,0,18,557824,0,0,0,0,0,1,0,0,0,0,0,0,0,'Claw - Script - Set unitflags'), +(@ENTRY*100,9,10,0,0,0,100,0,0,0,0,0,90,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Claw - Script - Set bytes1'), +(@ENTRY*100,9,11,0,0,0,100,0,500,500,500,500,81,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Claw - Script - Set npcflags'); +-- Swamplord Musel'ek SAI +SET @ENTRY := 17826; +SET @SPELL1 := 18813; -- Knock Away +SET @SPELL2 := 22907; -- Shoot +SET @SPELL3 := 31615; -- Hunter's Mark +SET @SPELL4 := 31946; -- Throw Freezing Trap +SET @SPELL5 := 31623; -- Aimed Shot +SET @SPELL6 := 34974; -- Multi-Shot +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,1,0,0,0,100,6,35000,38000,30000,40000,11,@SPELL1,1,0,0,0,0,2,0,0,0,0,0,0,0,'Swamplord Musel''ek - Combat - Cast Knock Away'), +(@ENTRY,0,2,0,0,0,100,6,500,1000,2300,3900,11,@SPELL2,1,0,0,0,0,2,0,0,0,0,0,0,0,'Swamplord Musel''ek - Combat - Cast Knock Away'), +(@ENTRY,0,3,0,0,0,100,6,4000,8000,12000,16000,11,@SPELL3,0,0,0,0,0,6,0,0,0,0,0,0,0,'Swamplord Musel''ek - Combat - Cast Hunter''s Mark'), +(@ENTRY,0,4,0,0,0,100,6,4000,8000,12000,16000,11,@SPELL4,0,0,0,0,0,5,0,0,0,0,0,0,0,'Swamplord Musel''ek - Combat - Cast Throw Freezing Trap'), +(@ENTRY,0,5,6,0,0,100,6,12500,21500,20000,30000,11,@SPELL5,0,0,0,0,0,2,0,0,0,0,0,0,0,'Swamplord Musel''ek - Combat - Cast Aimed Shot'), +(@ENTRY,0,6,0,61,0,100,0,0,0,0,0,40,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Swamplord Musel''ek - Combat - Set ranged weapon'), +(@ENTRY,0,7,8,0,0,100,6,12500,21500,20000,30000,11,@SPELL6,0,0,0,0,0,2,0,0,0,0,0,0,0,'Swamplord Musel''ek - Combat - Cast Multi-Shot'), +(@ENTRY,0,8,0,61,0,100,0,0,0,0,0,40,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Swamplord Musel''ek - Combat - Set ranged weapon'), +(@ENTRY,0,9,0,4,0,100,6,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Swamplord Musel''ek - On Aggro - Say 1'), +(@ENTRY,0,10,0,5,0,100,6,5,5000,5000,1,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Swamplord Musel''ek - On Kill - Say 2'), +(@ENTRY,0,11,12,6,0,100,6,0,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Swamplord Musel''ek - On Death - Say 3'), +(@ENTRY,0,12,0,61,0,100,0,0,0,0,0,45,0,1,0,0,0,0,19,17827,100,0,0,0,0,0,'Swamplord Musel''ek - On Death - Set Data on Claw'), +(@ENTRY,0,13,14,38,0,100,6,0,1,0,0,70,0,0,0,0,0,0,19,17827,100,1,0,0,0,0,'Swamplord Musel''ek - On dataset - Respawn dead claw'), +(@ENTRY,0,14,0,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Swamplord Musel''ek - Combat - Say 0'); +-- NPC talk text insert from sniff +DELETE FROM `creature_ai_texts` WHERE `entry` BETWEEN -468 AND -463; +DELETE FROM `creature_text` WHERE `entry`=17826; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(17826,0,0, 'Beast! Obey me! Kill them at once!',14,0,100,0,0,10383, 'Swamplord Musel''ek bear'), +(17826,1,0, 'We fight to the death!',14,0,100,0,0,10384, 'Swamplord Musel''ek Aggro'), +(17826,1,1, 'I will end this quickly...',14,0,100,0,0,10385, 'Swamplord Musel''ek Aggro'), +(17826,1,2, 'Acalah pek ecta!',14,0,100,0,0,10386, 'Swamplord Musel''ek Aggro'), +(17826,2,0, 'Krypta!',14,0,100,0,0,10387, 'Swamplord Musel''ek Slay'), +(17826,2,1, 'It is finished.',14,0,100,0,0,10388, 'Swamplord Musel''ek Slay'), +(17826,3,0, 'Well... done...',14,0,100,0,0,10389, 'Swamplord Musel''ek Death'); +-- Swamplord Musel'ek +SET @NPC := 56551; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=288.5823,`position_y`=-121.8309,`position_z`=29.70329,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,288.5823,-121.8309,29.70329,0,0,0,100,0), +(@PATH,2,281.5271,-120.3684,29.75141,0,0,0,100,0), +(@PATH,3,274.0677,-122.0538,29.80962,0,0,0,100,0), +(@PATH,4,281.5271,-120.3684,29.75141,0,0,0,100,0); From 09c497bce2e5a924d85ff524f14bdf98fb793f38 Mon Sep 17 00:00:00 2001 From: click Date: Sat, 2 Jun 2012 14:43:07 +0200 Subject: [PATCH 0899/1149] Core/AI: Remove "enforced override"-check in the EventAI-manager in case of AI not being set to EventAI. --- src/server/game/AI/EventAI/CreatureEventAIMgr.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp index 517e55af457..f95645611f1 100755 --- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp @@ -740,10 +740,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() if (CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(itr->first)) { if (cInfo->AIName != "EventAI") - { - sLog->outErrorDb("Creature entry %u has EventAI scripts, but its AIName is not 'EventAI', changing to EventAI", itr->first); - const_cast(cInfo)->AIName = "EventAI"; - } + sLog->outErrorDb("Creature entry %u has EventAI scripts, but its AIName is not 'EventAI' - possible AI-mismatch?", itr->first); } } From adcd4e0a5d871910a23c52b2aaf726313df6300f Mon Sep 17 00:00:00 2001 From: click Date: Sat, 2 Jun 2012 14:53:41 +0200 Subject: [PATCH 0900/1149] Docs: Re-add descriptions for the PREFIX, CONF_DIR and LIBSDIR cmake parameters to the Unix installation instructions --- doc/UnixInstall.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/doc/UnixInstall.txt b/doc/UnixInstall.txt index 6f3e55cdac6..6293a4305c2 100644 --- a/doc/UnixInstall.txt +++ b/doc/UnixInstall.txt @@ -40,7 +40,7 @@ you created a dir named build ad want to have your finalcompiled product installed in /home/trinity/server, an example sequence of commands can be : - cmake ../ -DPREFIX=/home/trinity/server + cmake ../ -DPREFIX=/home/trinity/server -DTOOLS=1 -DWITH_WARNINGS=1 make make install @@ -56,16 +56,18 @@ flags like USE_COREPCH Use precompiled headers when compiling servers WITH_WARNINGS Show all warnings during compile WITH_COREDEBUG Include additional debug-code in core - CMAKE_INSTALL_PREFIX Set installation directory + PREFIX Set installation directory + NOJEM Do not build with jemalloc (advanced users only) + CONF_DIR Set path as default configuration directory + LIBSDIR Set path as default library directory CMAKE_C_FLAGS Set C_FLAGS for compile (advanced users only) CMAKE_CXX_FLAGS Set CXX_FLAGS for compile (advanced users only) - CMAKE_BUILD_TYPE Set buildtype - the supported modes are : Release, MinSizeRel, RelWithDebInfo, Debug -Of course, replace the paths in prefix, conf_dir with the directories -you wish to install TrinityCore to. The datadir is where maps, DBCs, and -SQLs are stored. The sysconfdir is where configuration files are stored. +Of course, replace the paths in PREFIX, CONF_DIR and LIBSDIR with the +directories you wish to install TrinityCore to. The datadir is where maps, +DBCs, and SQLs are stored. The sysconfdir is where configuration files are stored. Once TrinityCore is installed you will need to apply database updates where necessary. Furthermore, you must configure your installation by From cffcf633c3e89e2152d7f6d008ae42b88ed928c0 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 2 Jun 2012 14:28:24 +0100 Subject: [PATCH 0901/1149] Core/SAI: If spell id in SMART_ACTION_REMOVEAURASFROMSPELL is 0, remove all auras instead Signed-off-by: Nay --- src/server/game/AI/SmartScripts/SmartScript.cpp | 6 +++++- src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 2 +- src/server/game/AI/SmartScripts/SmartScriptMgr.h | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 01a9b777358..21dc92b25d1 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -789,7 +789,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (!IsUnit((*itr))) continue; - (*itr)->ToUnit()->RemoveAurasDueToSpell(e.action.removeAura.spell); + if (e.action.removeAura.spell == 0) + (*itr)->ToUnit()->RemoveAllAuras(); + else + (*itr)->ToUnit()->RemoveAurasDueToSpell(e.action.removeAura.spell); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_REMOVEAURASFROMSPELL: Unit %u, spell %u", (*itr)->GetGUIDLow(), e.action.removeAura.spell); } diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index a7149f37480..d529479d9dd 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -709,7 +709,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) return false; break; case SMART_ACTION_REMOVEAURASFROMSPELL: - if (!IsSpellValid(e, e.action.removeAura.spell)) + if (e.action.removeAura.spell != 0 && !IsSpellValid(e, e.action.removeAura.spell)) return false; break; case SMART_ACTION_RANDOM_PHASE: diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index c23e288f66d..5b54a4d3048 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -398,7 +398,7 @@ enum SMART_ACTION SMART_ACTION_FLEE_FOR_ASSIST = 25, // With Emote SMART_ACTION_CALL_GROUPEVENTHAPPENS = 26, // QuestID SMART_ACTION_CALL_CASTEDCREATUREORGO = 27, // CreatureId, SpellId - SMART_ACTION_REMOVEAURASFROMSPELL = 28, // Spellid + SMART_ACTION_REMOVEAURASFROMSPELL = 28, // Spellid, 0 removes all auras SMART_ACTION_FOLLOW = 29, // Distance (0 = default), Angle (0 = default), EndCreatureEntry, credit, creditType (0monsterkill, 1event) SMART_ACTION_RANDOM_PHASE = 30, // PhaseId1, PhaseId2, PhaseId3... SMART_ACTION_RANDOM_PHASE_RANGE = 31, // PhaseMin, PhaseMax From 9bb1dc63619e1aca85d28617d85b0d0e96dd3bc7 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 2 Jun 2012 11:18:51 -0230 Subject: [PATCH 0902/1149] DB/waypoints: Add a few missing paths --- .../world/2012_06_02_01_world_waypoimts.sql | 187 ++++++++++++++++++ 1 file changed, 187 insertions(+) create mode 100644 sql/updates/world/2012_06_02_01_world_waypoimts.sql diff --git a/sql/updates/world/2012_06_02_01_world_waypoimts.sql b/sql/updates/world/2012_06_02_01_world_waypoimts.sql new file mode 100644 index 00000000000..c50436bba8d --- /dev/null +++ b/sql/updates/world/2012_06_02_01_world_waypoimts.sql @@ -0,0 +1,187 @@ +-- Ebon Blade Gargoyle +SET @NPC := 124428; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=8487.13,`position_y`=2648.587,`position_z`=661.3248,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,8487.13,2648.587,661.3248,0,0,0,100,0), +(@PATH,2,8489.394,2639.188,661.9919,0,0,0,100,0), +(@PATH,3,8498.239,2633.008,661.9919,0,0,0,100,0), +(@PATH,4,8514.016,2626.775,661.9919,0,0,0,100,0), +(@PATH,5,8529.975,2622.438,661.9919,0,0,0,100,0), +(@PATH,6,8556.946,2621.273,661.9919,0,0,0,100,0), +(@PATH,7,8576.765,2620.136,661.9919,0,0,0,100,0), +(@PATH,8,8584.989,2627.947,663.3527,0,0,0,100,0), +(@PATH,9,8590.352,2637.264,664.2969,0,0,0,100,0), +(@PATH,10,8597.313,2651.073,666.0464,0,0,0,100,0), +(@PATH,11,8590.045,2668.078,668.6855,0,0,0,100,0), +(@PATH,12,8577.563,2672.175,668.6855,0,0,0,100,0), +(@PATH,13,8567.869,2653.686,668.6855,0,0,0,100,0), +(@PATH,14,8559.406,2635.763,668.6855,0,0,0,100,0), +(@PATH,15,8550.115,2624.132,664.6028,0,0,0,100,0), +(@PATH,16,8538.325,2625.415,664.6028,0,0,0,100,0), +(@PATH,17,8531.294,2636.344,664.6028,0,0,0,100,0), +(@PATH,18,8536.005,2650.634,664.6028,0,0,0,100,0), +(@PATH,19,8536.659,2661.533,667.5744,0,0,0,100,0), +(@PATH,20,8528.161,2665.466,668.5468,0,0,0,100,0), +(@PATH,21,8521.834,2666.234,668.9914,0,0,0,100,0), +(@PATH,22,8506.145,2657.156,666.1024,0,0,0,100,0); + +-- Ebon Blade Gargoyle +SET @NPC := 124429; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=8553.722,`position_y`=2732.757,`position_z`=672.1373,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,8553.722,2732.757,672.1373,0,0,0,100,0), +(@PATH,2,8545.085,2736.81,677.1306,0,0,0,100,0), +(@PATH,3,8538.377,2724.997,676.7698,0,0,0,100,0), +(@PATH,4,8527.725,2701.114,677.464,0,0,0,100,0), +(@PATH,5,8515.729,2672.526,676.4364,0,0,0,100,0), +(@PATH,6,8501.882,2638.781,674.6306,0,0,0,100,0), +(@PATH,7,8492.601,2619.312,672.9641,0,0,0,100,0), +(@PATH,8,8501.216,2604.361,672.7973,0,0,0,100,0), +(@PATH,9,8509.95,2597.643,672.464,0,0,0,100,0), +(@PATH,10,8516.437,2603.336,670.7147,0,0,0,100,0), +(@PATH,11,8526.045,2624.93,675.242,0,0,0,100,0), +(@PATH,12,8538.438,2654.096,677.4644,0,0,0,100,0), +(@PATH,13,8552.567,2688.411,676.0737,0,0,0,100,0), +(@PATH,14,8561.252,2709.44,676.1867,0,0,0,100,0), +(@PATH,15,8564.74,2718.366,676.9643,0,0,0,100,0), +(@PATH,16,8586.875,2713.758,677.4359,0,0,0,100,0), +(@PATH,17,8588.923,2702.79,676.2701,0,0,0,100,0), +(@PATH,18,8580.09,2682.738,673.3813,0,0,0,100,0), +(@PATH,19,8572.153,2664.409,674.4087,0,0,0,100,0), +(@PATH,20,8559.122,2635.23,674.5473,0,0,0,100,0), +(@PATH,21,8547.672,2610.971,677.3528,0,0,0,100,0), +(@PATH,22,8547.112,2593.927,677.77,0,0,0,100,0), +(@PATH,23,8556.546,2591.858,678.7695,0,0,0,100,0), +(@PATH,24,8566.203,2601.376,677.2705,0,0,0,100,0), +(@PATH,25,8576.512,2615.707,675.7764,0,0,0,100,0), +(@PATH,26,8585.419,2632.535,673.7208,0,0,0,100,0), +(@PATH,27,8596.079,2656.51,673.0544,0,0,0,100,0), +(@PATH,28,8594.222,2669.849,673.4442,0,0,0,100,0), +(@PATH,29,8595.935,2690.9,673.4711,0,0,0,100,0), +(@PATH,30,8592.354,2705.919,675.5258,0,0,0,100,0), +(@PATH,31,8571.288,2721.3,668.0258,0,0,0,100,0); + +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=32472; + +-- Vargul Plaguetalon +SET @NPC := 97634; +SET @PATH := @NPC*10; +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=29453; +UPDATE `creature` SET `position_x`=5736.421,`position_y`=-1453.626,`position_z`=267.5013,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`) VALUES (@NPC,@PATH,50331648,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,5736.421,-1453.626,267.5013,0,0,0,100,0), +(@PATH,2,5700.896,-1467.002,263.9736,0,0,0,100,0), +(@PATH,3,5665.086,-1462.814,266.2513,0,0,0,100,0), +(@PATH,4,5623.596,-1446.303,258.3903,0,0,0,100,0), +(@PATH,5,5612.131,-1390.983,269.9736,0,0,0,100,0), +(@PATH,6,5630.01,-1325.786,252.9459,0,0,0,100,0), +(@PATH,7,5684.276,-1301.843,263.9736,0,0,0,100,0), +(@PATH,8,5717.019,-1325.604,263.9736,0,0,0,100,0), +(@PATH,9,5730.931,-1363.826,254.0014,0,0,0,100,0), +(@PATH,10,5737.854,-1429.533,273.2791,0,0,0,100,0); + +-- Scourgebeak Fleshripper +SET @NPC := 121011; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=6805.096,`position_y`=3548.115,`position_z`=785.0337,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`) VALUES (@NPC,@PATH,50331648,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,6805.096,3548.115,785.0337,0,0,0,100,0), +(@PATH,2,6797.807,3599.297,776.1726,0,0,0,100,0), +(@PATH,3,6840.798,3607.1,769.2557,0,0,0,100,0), +(@PATH,4,6880.369,3577.403,779.5615,0,0,0,100,0); + +-- Scourgebeak Fleshripper +SET @NPC := 121023; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=6490.46,`position_y`=3498.933,`position_z`=621.7417,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`) VALUES (@NPC,@PATH,50331648,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,6490.46,3498.933,621.7417,0,0,0,100,0), +(@PATH,2,6645.542,3512.415,678.8528,0,0,0,100,0), +(@PATH,3,6650.367,3555.357,680.6584,0,0,0,100,0), +(@PATH,4,6602.724,3563.045,661.1863,0,0,0,100,0), +(@PATH,5,6549.287,3554.462,642.825,0,0,0,100,0); + +-- Scourgebeak Fleshripper +SET @NPC := 121019; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=6653.509,`position_y`=3526.14,`position_z`=693.2337,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`) VALUES (@NPC,@PATH,50331648,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,6653.509,3526.14,693.2337,0,0,0,100,0), +(@PATH,2,6696.053,3579.272,700.4001,0,0,0,100,0), +(@PATH,3,6744.93,3562.146,704.2611,0,0,0,100,0), +(@PATH,4,6738.125,3521.812,692.5392,0,0,0,100,0); + +-- Scourgebeak Fleshripper +SET @NPC := 121017; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=6653.104,`position_y`=3415.26,`position_z`=672.1595,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`) VALUES (@NPC,@PATH,50331648,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,6653.104,3415.26,672.1595,0,0,0,100,0), +(@PATH,2,6717.518,3468.886,684.6567,0,0,0,100,0), +(@PATH,3,6771.674,3492.333,692.0456,0,0,0,100,0), +(@PATH,4,6728.592,3518.536,683.6566,0,0,0,100,0), +(@PATH,5,6627.954,3487.869,642.6566,0,0,0,100,0), +(@PATH,6,6571.027,3439.741,634.3512,0,0,0,100,0); + +-- Scourgebeak Fleshripper +SET @NPC := 121014; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=6641.402,`position_y`=3330.479,`position_z`=724.3008,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`) VALUES (@NPC,@PATH,50331648,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,6641.402,3330.479,724.3008,0,0,0,100,0), +(@PATH,2,6637.165,3426.095,701.4395,0,0,0,100,0), +(@PATH,3,6701.476,3449.434,708.6896,0,0,0,100,0), +(@PATH,4,6746.966,3410.158,735.9395,0,0,0,100,0), +(@PATH,5,6697.637,3352.607,725.0784,0,0,0,100,0); + +-- Scourgebeak Fleshripper +SET @NPC := 121025; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=6590.307,`position_y`=3325.47,`position_z`=699.1288,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`) VALUES (@NPC,@PATH,50331648,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,6590.307,3325.47,699.1288,0,0,0,100,0), +(@PATH,2,6543.557,3237.147,706.6288,0,0,0,100,0), +(@PATH,3,6518.691,3250.313,687.6565,0,0,0,100,0), +(@PATH,4,6512.266,3334.911,685.3231,0,0,0,100,0); + +-- Scourgebeak Fleshripper +SET @NPC := 121007; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=6459.715,`position_y`=3049.952,`position_z`=701.608,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`) VALUES (@NPC,@PATH,50331648,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,6459.715,3049.952,701.608,0,0,0,100,0), +(@PATH,2,6485.836,3103.517,681.247,0,0,0,100,0), +(@PATH,3,6445.593,3154.588,677.886,0,0,0,100,0), +(@PATH,4,6392.533,3078.925,694.2471,0,0,0,100,0); From a80ee1379e3473a14c995af5f70a9227fe416659 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 2 Jun 2012 13:09:27 -0230 Subject: [PATCH 0903/1149] DB/creature_text: Add text for Drill Sergeant Steamcrank --- .../2012_06_02_02_world_creature_text.sql | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 sql/updates/world/2012_06_02_02_world_creature_text.sql diff --git a/sql/updates/world/2012_06_02_02_world_creature_text.sql b/sql/updates/world/2012_06_02_02_world_creature_text.sql new file mode 100644 index 00000000000..c38e413617d --- /dev/null +++ b/sql/updates/world/2012_06_02_02_world_creature_text.sql @@ -0,0 +1,22 @@ +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry`=39368; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(39368,0,0, 'All right, you twisted mess of broken gears, let''s get to work!',12,0,100,1,0,0, 'Drill Sergeant Steamcrank'), +(39368,1,0, 'I am going to teach you all what it takes to be a proper soldier!',12,0,100,5,0,0, 'Drill Sergeant Steamcrank'), +(39368,2,0, 'The first thing you need to learn is proper discipline.',12,0,100,1,0,0, 'Drill Sergeant Steamcrank'), +(39368,3,0, 'Show me that discipline with a proper salute when I say so!',12,0,100,5,0,0, 'Drill Sergeant Steamcrank'), +(39368,4,0, 'Okay, recruits, salute!',12,0,100,66,0,0, 'Drill Sergeant Steamcrank'), +(39368,5,0, 'Nice job!',12,0,100,273,0,0, 'Drill Sergeant Steamcrank'), +(39368,6,0, 'When you go into combat, it is important that you know how to intimidate the enemy with a deafening battle roar!',12,0,100,396,0,0, 'Drill Sergeant Steamcrank'), +(39368,7,0, 'When I give the signal,let loose your greatest roar!',12,0,100,1,0,0, 'Drill Sergeant Steamcrank'), +(39368,8,0, 'Let me hear that battle roar!',12,0,100,5,0,0, 'Drill Sergeant Steamcrank'), +(39368,9,0, 'Wow, nice and scary!',12,0,100,0,0,0, 'Drill Sergeant Steamcrank'), +(39368,10,0, 'Remember though, a key factor in winning any battle is positive reinforcement.',12,0,100,5,0,0, 'Drill Sergeant Steamcrank'), +(39368,11,0, 'Reward your fellow soldiers in battle with a resounding cheer. Now, cheer at me when I tell you to!',12,0,100,1,0,0, 'Drill Sergeant Steamcrank'), +(39368,12,0, 'Everyone, cheer!',12,0,100,0,0,0, 'Drill Sergeant Steamcrank'), +(39368,13,0, 'Fantastic!',12,0,100,273,0,0, 'Drill Sergeant Steamcrank'), +(39368,14,0, 'However, the most important part of battle is how you celebrate a good hard earned victory!',12,0,100,396,0,0, 'Drill Sergeant Steamcrank'), +(39368,15,0, 'Show me your best victory dance when I give the signal!',12,0,100,5,0,0, 'Drill Sergeant Steamcrank'), +(39368,16,0, 'Now, dance!',12,0,100,0,0,0, 'Drill Sergeant Steamcrank'), +(39368,17,0, 'Superb!',12,0,100,273,0,0, 'Drill Sergeant Steamcrank'), +(39368,18,0, 'You might be the best set of recruits I''ve ever seen! Let''s go through all of that again!',12,0,100,396,0,0, 'Drill Sergeant Steamcrank'); From b14b9cd6a349cbe5bb6f78829c56867ea78667a8 Mon Sep 17 00:00:00 2001 From: 4m1g0 Date: Sat, 2 Jun 2012 17:58:05 +0200 Subject: [PATCH 0904/1149] Core/Scripts: Use proper headers, code style and cleanup (Blackfathom Deeps, Maraudon and Onyxias Lair) --- .../BlackfathomDeeps/blackfathom_deeps.cpp | 23 +- .../BlackfathomDeeps/boss_aku_mai.cpp | 11 +- .../BlackfathomDeeps/boss_gelihast.cpp | 3 +- .../Kalimdor/BlackfathomDeeps/boss_kelris.cpp | 3 +- .../instance_blackfathom_deeps.cpp | 3 +- .../Maraudon/boss_celebras_the_cursed.cpp | 39 ++- .../Kalimdor/Maraudon/boss_landslide.cpp | 39 +-- .../Kalimdor/Maraudon/boss_noxxion.cpp | 58 ++-- .../Maraudon/boss_princess_theradras.cpp | 57 ++-- .../Kalimdor/OnyxiasLair/boss_onyxia.cpp | 279 +++++++++--------- .../OnyxiasLair/instance_onyxias_lair.cpp | 107 +++---- .../Kalimdor/OnyxiasLair/onyxias_lair.h | 12 +- 12 files changed, 323 insertions(+), 311 deletions(-) diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp index a86b2b8b17a..a70d05fa0ef 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp @@ -15,11 +15,13 @@ * with this program. If not, see . */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" #include "blackfathom_deeps.h" #include "ScriptedEscortAI.h" -enum eSpells +enum Spells { SPELL_BLESSING_OF_BLACKFATHOM = 8733, SPELL_RAVAGE = 8391, @@ -94,11 +96,11 @@ public: uint32 frostNovaTimer; uint32 frostBoltVolleyTimer; - bool bFlee; + bool Flee; void Reset() { - bFlee = false; + Flee = false; ravageTimer = urand(5000, 8000); frostNovaTimer = urand(9000, 12000); @@ -140,7 +142,7 @@ public: { if (ravageTimer <= diff) { - DoCast(me->getVictim(), SPELL_RAVAGE); + DoCastVictim(SPELL_RAVAGE); ravageTimer = urand(9000, 14000); } else ravageTimer -= diff; break; @@ -148,9 +150,9 @@ public: case NPC_MURKSHALLOW_SOFTSHELL: case NPC_BARBED_CRUSTACEAN: { - if (!bFlee && HealthBelowPct(15)) + if (!Flee && HealthBelowPct(15)) { - bFlee = true; + Flee = true; me->DoFleeToGetAssistance(); } break; @@ -160,10 +162,7 @@ public: if (frostBoltVolleyTimer <= diff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - { - if (target) - DoCast(target, SPELL_FROST_BOLT_VOLLEY); - } + DoCast(target, SPELL_FROST_BOLT_VOLLEY); frostBoltVolleyTimer = urand(5000, 8000); } else frostBoltVolleyTimer -= diff; @@ -190,7 +189,7 @@ public: }; }; -enum eMorridune +enum Morridune { SAY_MORRIDUNE_1 = -1048003, SAY_MORRIDUNE_2 = -1048004 diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp index 32a6bcbde77..7071395812e 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp @@ -15,7 +15,8 @@ * with this program. If not, see . */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "blackfathom_deeps.h" enum Spells @@ -42,14 +43,14 @@ public: } uint32 poisonCloudTimer; - bool bIsEnraged; + bool IsEnraged; InstanceScript* instance; void Reset() { poisonCloudTimer = urand(5000, 9000); - bIsEnraged = false; + IsEnraged = false; if (instance) instance->SetData(TYPE_AKU_MAI, NOT_STARTED); } @@ -77,10 +78,10 @@ public: poisonCloudTimer = urand(25000, 50000); } else poisonCloudTimer -= diff; - if (!bIsEnraged && HealthBelowPct(30)) + if (!IsEnraged && HealthBelowPct(30)) { DoCast(me, SPELL_FRENZIED_RAGE); - bIsEnraged = true; + IsEnraged = true; } DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp index 5a60a849b75..1488772dc8a 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp @@ -15,7 +15,8 @@ * with this program. If not, see . */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "blackfathom_deeps.h" enum Spells diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp index 7ee17172102..1c754b78672 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp @@ -15,7 +15,8 @@ * with this program. If not, see . */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "blackfathom_deeps.h" enum Spells diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp index ea33499a960..236c7b1ba69 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp @@ -23,7 +23,8 @@ SDComment: SDCategory: Blackfathom Deeps EndScriptData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "InstanceScript.h" #include "blackfathom_deeps.h" #define MAX_ENCOUNTER 4 diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp index d7043965271..b23d15cd1b5 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp @@ -23,7 +23,8 @@ SDComment: SDCategory: Maraudon EndScriptData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" enum Spells { @@ -46,15 +47,15 @@ public: { celebras_the_cursedAI(Creature* creature) : ScriptedAI(creature) {} - uint32 Wrath_Timer; - uint32 EntanglingRoots_Timer; - uint32 CorruptForces_Timer; + uint32 WrathTimer; + uint32 EntanglingRootsTimer; + uint32 CorruptForcesTimer; void Reset() { - Wrath_Timer = 8000; - EntanglingRoots_Timer = 2000; - CorruptForces_Timer = 30000; + WrathTimer = 8000; + EntanglingRootsTimer = 2000; + CorruptForcesTimer = 30000; } void EnterCombat(Unit* /*who*/) { } @@ -70,32 +71,30 @@ public: return; //Wrath - if (Wrath_Timer <= diff) + if (WrathTimer <= diff) { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_WRATH); - Wrath_Timer = 8000; + WrathTimer = 8000; } - else Wrath_Timer -= diff; + else WrathTimer -= diff; //EntanglingRoots - if (EntanglingRoots_Timer <= diff) + if (EntanglingRootsTimer <= diff) { - DoCast(me->getVictim(), SPELL_ENTANGLINGROOTS); - EntanglingRoots_Timer = 20000; + DoCastVictim(SPELL_ENTANGLINGROOTS); + EntanglingRootsTimer = 20000; } - else EntanglingRoots_Timer -= diff; + else EntanglingRootsTimer -= diff; //CorruptForces - if (CorruptForces_Timer <= diff) + if (CorruptForcesTimer <= diff) { me->InterruptNonMeleeSpells(false); DoCast(me, SPELL_CORRUPT_FORCES); - CorruptForces_Timer = 20000; + CorruptForcesTimer = 20000; } - else CorruptForces_Timer -= diff; + else CorruptForcesTimer -= diff; DoMeleeAttackIfReady(); } diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp index ea419793ae8..b4128ea80ee 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp @@ -23,7 +23,8 @@ SDComment: SDCategory: Maraudon EndScriptData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" enum Spells { @@ -46,15 +47,15 @@ public: { boss_landslideAI(Creature* creature) : ScriptedAI(creature) {} - uint32 KnockAway_Timer; - uint32 Trample_Timer; - uint32 Landslide_Timer; + uint32 KnockAwayTimer; + uint32 TrampleTimer; + uint32 LandslideTimer; void Reset() { - KnockAway_Timer = 8000; - Trample_Timer = 2000; - Landslide_Timer = 0; + KnockAwayTimer = 8000; + TrampleTimer = 2000; + LandslideTimer = 0; } void EnterCombat(Unit* /*who*/) @@ -66,32 +67,32 @@ public: if (!UpdateVictim()) return; - //KnockAway_Timer - if (KnockAway_Timer <= diff) + //KnockAwayTimer + if (KnockAwayTimer <= diff) { - DoCast(me->getVictim(), SPELL_KNOCKAWAY); - KnockAway_Timer = 15000; + DoCastVictim(SPELL_KNOCKAWAY); + KnockAwayTimer = 15000; } - else KnockAway_Timer -= diff; + else KnockAwayTimer -= diff; - //Trample_Timer - if (Trample_Timer <= diff) + //TrampleTimer + if (TrampleTimer <= diff) { DoCast(me, SPELL_TRAMPLE); - Trample_Timer = 8000; + TrampleTimer = 8000; } - else Trample_Timer -= diff; + else TrampleTimer -= diff; //Landslide if (HealthBelowPct(50)) { - if (Landslide_Timer <= diff) + if (LandslideTimer <= diff) { me->InterruptNonMeleeSpells(false); DoCast(me, SPELL_LANDSLIDE); - Landslide_Timer = 60000; + LandslideTimer = 60000; } - else Landslide_Timer -= diff; + else LandslideTimer -= diff; } DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp index 18ce7be0f0a..ece3ff83776 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp @@ -23,7 +23,9 @@ SDComment: SDCategory: Maraudon EndScriptData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" + enum Spells { SPELL_TOXICVOLLEY = 21687, @@ -44,24 +46,22 @@ public: { boss_noxxionAI(Creature* creature) : ScriptedAI(creature) {} - uint32 ToxicVolley_Timer; - uint32 Uppercut_Timer; - uint32 Adds_Timer; - uint32 Invisible_Timer; + uint32 ToxicVolleyTimer; + uint32 UppercutTimer; + uint32 AddsTimer; + uint32 InvisibleTimer; bool Invisible; void Reset() { - ToxicVolley_Timer = 7000; - Uppercut_Timer = 16000; - Adds_Timer = 19000; - Invisible_Timer = 15000; //Too much too low? + ToxicVolleyTimer = 7000; + UppercutTimer = 16000; + AddsTimer = 19000; + InvisibleTimer = 15000; //Too much too low? Invisible = false; } - void EnterCombat(Unit* /*who*/) - { - } + void EnterCombat(Unit* /*who*/) {} void SummonAdds(Unit* victim) { @@ -71,7 +71,7 @@ public: void UpdateAI(const uint32 diff) { - if (Invisible && Invisible_Timer <= diff) + if (Invisible && InvisibleTimer <= diff) { //Become visible again me->setFaction(14); @@ -83,7 +83,7 @@ public: } else if (Invisible) { - Invisible_Timer -= diff; + InvisibleTimer -= diff; //Do nothing while invisible return; } @@ -92,24 +92,24 @@ public: if (!UpdateVictim()) return; - //ToxicVolley_Timer - if (ToxicVolley_Timer <= diff) + //ToxicVolleyTimer + if (ToxicVolleyTimer <= diff) { - DoCast(me->getVictim(), SPELL_TOXICVOLLEY); - ToxicVolley_Timer = 9000; + DoCastVictim(SPELL_TOXICVOLLEY); + ToxicVolleyTimer = 9000; } - else ToxicVolley_Timer -= diff; + else ToxicVolleyTimer -= diff; - //Uppercut_Timer - if (Uppercut_Timer <= diff) + //UppercutTimer + if (UppercutTimer <= diff) { - DoCast(me->getVictim(), SPELL_UPPERCUT); - Uppercut_Timer = 12000; + DoCastVictim(SPELL_UPPERCUT); + UppercutTimer = 12000; } - else Uppercut_Timer -= diff; + else UppercutTimer -= diff; - //Adds_Timer - if (!Invisible && Adds_Timer <= diff) + //AddsTimer + if (!Invisible && AddsTimer <= diff) { //Interrupt any spell casting //me->m_canMove = true; @@ -124,11 +124,11 @@ public: SummonAdds(me->getVictim()); SummonAdds(me->getVictim()); Invisible = true; - Invisible_Timer = 15000; + InvisibleTimer = 15000; - Adds_Timer = 40000; + AddsTimer = 40000; } - else Adds_Timer -= diff; + else AddsTimer -= diff; DoMeleeAttackIfReady(); } diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp index 039d30071d2..1f887d7ce64 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp @@ -23,7 +23,8 @@ SDComment: SDCategory: Maraudon EndScriptData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" enum Spells { @@ -47,17 +48,17 @@ public: { boss_ptheradrasAI(Creature* creature) : ScriptedAI(creature) {} - uint32 Dustfield_Timer; - uint32 Boulder_Timer; - uint32 Thrash_Timer; - uint32 RepulsiveGaze_Timer; + uint32 DustfieldTimer; + uint32 BoulderTimer; + uint32 ThrashTimer; + uint32 RepulsiveGazeTimer; void Reset() { - Dustfield_Timer = 8000; - Boulder_Timer = 2000; - Thrash_Timer = 5000; - RepulsiveGaze_Timer = 23000; + DustfieldTimer = 8000; + BoulderTimer = 2000; + ThrashTimer = 5000; + RepulsiveGazeTimer = 23000; } void EnterCombat(Unit* /*who*/) {} @@ -72,40 +73,38 @@ public: if (!UpdateVictim()) return; - //Dustfield_Timer - if (Dustfield_Timer <= diff) + //DustfieldTimer + if (DustfieldTimer <= diff) { DoCast(me, SPELL_DUSTFIELD); - Dustfield_Timer = 14000; + DustfieldTimer = 14000; } - else Dustfield_Timer -= diff; + else DustfieldTimer -= diff; - //Boulder_Timer - if (Boulder_Timer <= diff) + //BoulderTimer + if (BoulderTimer <= diff) { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_BOULDER); - Boulder_Timer = 10000; + BoulderTimer = 10000; } - else Boulder_Timer -= diff; + else BoulderTimer -= diff; - //RepulsiveGaze_Timer - if (RepulsiveGaze_Timer <= diff) + //RepulsiveGazeTimer + if (RepulsiveGazeTimer <= diff) { - DoCast(me->getVictim(), SPELL_REPULSIVEGAZE); - RepulsiveGaze_Timer = 20000; + DoCastVictim(SPELL_REPULSIVEGAZE); + RepulsiveGazeTimer = 20000; } - else RepulsiveGaze_Timer -= diff; + else RepulsiveGazeTimer -= diff; - //Thrash_Timer - if (Thrash_Timer <= diff) + //ThrashTimer + if (ThrashTimer <= diff) { DoCast(me, SPELL_THRASH); - Thrash_Timer = 18000; + ThrashTimer = 18000; } - else Thrash_Timer -= diff; + else ThrashTimer -= diff; DoMeleeAttackIfReady(); } diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index 6e6e089ba02..1fdf941d75c 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -25,10 +25,15 @@ SDComment: SDCategory: Onyxia's Lair EndScriptData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "Cell.h" +#include "CellImpl.h" +#include "GridNotifiers.h" +#include "GridNotifiersImpl.h" #include "onyxias_lair.h" -enum eYells +enum Yells { SAY_AGGRO = -1249000, SAY_KILL = -1249001, @@ -37,7 +42,7 @@ enum eYells EMOTE_BREATH = -1249004, }; -enum eSpells +enum Spells { // Phase 1 spells SPELL_WING_BUFFET = 18500, @@ -67,15 +72,15 @@ enum eSpells SPELL_BELLOWING_ROAR = 18431, }; -struct sOnyxMove +struct OnyxMove { - uint32 uiLocId; - uint32 uiLocIdEnd; - uint32 uiSpellId; + uint8 LocId; + uint8 LocIdEnd; + uint32 SpellId; float fX, fY, fZ; }; -static sOnyxMove aMoveData[]= +static OnyxMove MoveData[8]= { {0, 1, SPELL_BREATH_WEST_TO_EAST, -33.5561f, -182.682f, -56.9457f}, //west {1, 0, SPELL_BREATH_EAST_TO_WEST, -31.4963f, -250.123f, -55.1278f}, //east @@ -87,11 +92,11 @@ static sOnyxMove aMoveData[]= {7, 6, SPELL_BREATH_NORTH_TO_SOUTH, 22.8763f, -217.152f, -55.0548f}, //north }; -const Position MiddleRoomLocation = {-23.6155f, -215.357f, -55.7344f, 0.0f}; +Position const MiddleRoomLocation = {-23.6155f, -215.357f, -55.7344f, 0.0f}; -const Position Phase2Location = {-80.924f, -214.299f, -82.942f, 0.0f}; +Position const Phase2Location = {-80.924f, -214.299f, -82.942f, 0.0f}; -static Position aSpawnLocations[3]= +Position const SpawnLocations[3]= { //Whelps {-30.127f, -254.463f, -89.440f, 0.0f}, @@ -121,58 +126,58 @@ public: InstanceScript* instance; SummonList Summons; - uint32 m_uiPhase; + uint32 Phase; - uint32 m_uiFlameBreathTimer; - uint32 m_uiCleaveTimer; - uint32 m_uiTailSweepTimer; - uint32 m_uiWingBuffetTimer; + uint32 FlameBreathTimer; + uint32 CleaveTimer; + uint32 TailSweepTimer; + uint32 WingBuffetTimer; - uint32 m_uiMovePoint; - uint32 m_uiMovementTimer; - sOnyxMove* m_pPointData; + uint8 MovePoint; + uint32 MovementTimer; + OnyxMove* PointData; - uint32 m_uiFireballTimer; - uint32 m_uiWhelpTimer; - uint32 m_uiLairGuardTimer; - uint32 m_uiDeepBreathTimer; + uint32 FireballTimer; + uint32 WhelpTimer; + uint32 LairGuardTimer; + uint32 DeepBreathTimer; - uint32 m_uiBellowingRoarTimer; + uint32 BellowingRoarTimer; - uint8 m_uiSummonWhelpCount; - bool m_bIsMoving; + uint8 SummonWhelpCount; + bool IsMoving; void Reset() { if (!IsCombatMovementAllowed()) SetCombatMovement(true); - m_uiPhase = PHASE_START; + Phase = PHASE_START; - m_uiFlameBreathTimer = urand(10000, 20000); - m_uiTailSweepTimer = urand(15000, 20000); - m_uiCleaveTimer = urand(2000, 5000); - m_uiWingBuffetTimer = urand(10000, 20000); + FlameBreathTimer = urand(10000, 20000); + TailSweepTimer = urand(15000, 20000); + CleaveTimer = urand(2000, 5000); + WingBuffetTimer = urand(10000, 20000); - m_uiMovePoint = urand(0, 5); - m_uiMovementTimer = 14000; - m_pPointData = GetMoveData(); + MovePoint = urand(0, 5); + MovementTimer = 14000; + PointData = GetMoveData(); - m_uiFireballTimer = 15000; - m_uiWhelpTimer = 60000; - m_uiLairGuardTimer = 60000; - m_uiDeepBreathTimer = 85000; + FireballTimer = 15000; + WhelpTimer = 60000; + LairGuardTimer = 60000; + DeepBreathTimer = 85000; - m_uiBellowingRoarTimer = 30000; + BellowingRoarTimer = 30000; Summons.DespawnAll(); - m_uiSummonWhelpCount = 0; - m_bIsMoving = false; + SummonWhelpCount = 0; + IsMoving = false; if (instance) { instance->SetData(DATA_ONYXIA, NOT_STARTED); - instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase); + instance->SetData(DATA_ONYXIA_PHASE, Phase); instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } } @@ -206,7 +211,7 @@ public: switch (summoned->GetEntry()) { case NPC_WHELP: - ++m_uiSummonWhelpCount; + ++SummonWhelpCount; break; case NPC_LAIRGUARD: summoned->setActive(true); @@ -225,17 +230,17 @@ public: DoScriptText(SAY_KILL, me); } - void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell) + void SpellHit(Unit* /*pCaster*/, const SpellInfo* Spell) { - if (pSpell->Id == SPELL_BREATH_EAST_TO_WEST || - pSpell->Id == SPELL_BREATH_WEST_TO_EAST || - pSpell->Id == SPELL_BREATH_SE_TO_NW || - pSpell->Id == SPELL_BREATH_NW_TO_SE || - pSpell->Id == SPELL_BREATH_SW_TO_NE || - pSpell->Id == SPELL_BREATH_NE_TO_SW) + if (Spell->Id == SPELL_BREATH_EAST_TO_WEST || + Spell->Id == SPELL_BREATH_WEST_TO_EAST || + Spell->Id == SPELL_BREATH_SE_TO_NW || + Spell->Id == SPELL_BREATH_NW_TO_SE || + Spell->Id == SPELL_BREATH_SW_TO_NE || + Spell->Id == SPELL_BREATH_NE_TO_SW) { - m_pPointData = GetMoveData(); - m_uiMovePoint = m_pPointData->uiLocIdEnd; + PointData = GetMoveData(); + MovePoint = PointData->LocIdEnd; me->SetSpeed(MOVE_FLIGHT, 1.5f); me->GetMotionMaster()->MovePoint(8, MiddleRoomLocation); @@ -249,16 +254,16 @@ public: switch (id) { case 8: - m_pPointData = GetMoveData(); - if (m_pPointData) + PointData = GetMoveData(); + if (PointData) { me->SetSpeed(MOVE_FLIGHT, 1.0f); - me->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ); + me->GetMotionMaster()->MovePoint(PointData->LocId, PointData->fX, PointData->fY, PointData->fZ); } break; case 9: me->GetMotionMaster()->MoveChase(me->getVictim()); - m_uiBellowingRoarTimer = 1000; + BellowingRoarTimer = 1000; break; case 10: me->SetCanFly(true); @@ -266,39 +271,39 @@ public: me->SetSpeed(MOVE_FLIGHT, 1.0f); DoScriptText(SAY_PHASE_2_TRANS, me); if (instance) - instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase); - m_uiWhelpTimer = 5000; - m_uiLairGuardTimer = 15000; + instance->SetData(DATA_ONYXIA_PHASE, Phase); + WhelpTimer = 5000; + LairGuardTimer = 15000; break; case 11: - if (m_pPointData) - me->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ); + if (PointData) + me->GetMotionMaster()->MovePoint(PointData->LocId, PointData->fX, PointData->fY, PointData->fZ); me->GetMotionMaster()->Clear(false); me->GetMotionMaster()->MoveIdle(); break; default: - m_bIsMoving = false; + IsMoving = false; break; } } } - void SpellHitTarget(Unit* target, const SpellInfo* pSpell) + void SpellHitTarget(Unit* target, const SpellInfo* Spell) { //Workaround - Couldn't find a way to group this spells (All Eruption) - if (((pSpell->Id >= 17086 && pSpell->Id <= 17095) || - (pSpell->Id == 17097) || - (pSpell->Id >= 18351 && pSpell->Id <= 18361) || - (pSpell->Id >= 18564 && pSpell->Id <= 18576) || - (pSpell->Id >= 18578 && pSpell->Id <= 18607) || - (pSpell->Id == 18609) || - (pSpell->Id >= 18611 && pSpell->Id <= 18628) || - (pSpell->Id >= 21132 && pSpell->Id <= 21133) || - (pSpell->Id >= 21135 && pSpell->Id <= 21139) || - (pSpell->Id >= 22191 && pSpell->Id <= 22202) || - (pSpell->Id >= 22267 && pSpell->Id <= 22268)) && + if (((Spell->Id >= 17086 && Spell->Id <= 17095) || + (Spell->Id == 17097) || + (Spell->Id >= 18351 && Spell->Id <= 18361) || + (Spell->Id >= 18564 && Spell->Id <= 18576) || + (Spell->Id >= 18578 && Spell->Id <= 18607) || + (Spell->Id == 18609) || + (Spell->Id >= 18611 && Spell->Id <= 18628) || + (Spell->Id >= 21132 && Spell->Id <= 21133) || + (Spell->Id >= 21135 && Spell->Id <= 21139) || + (Spell->Id >= 22191 && Spell->Id <= 22202) || + (Spell->Id >= 22267 && Spell->Id <= 22268)) && (target->GetTypeId() == TYPEID_PLAYER)) { if (instance) @@ -308,14 +313,14 @@ public: } } - sOnyxMove* GetMoveData() + OnyxMove* GetMoveData() { - uint32 uiMaxCount = sizeof(aMoveData)/sizeof(sOnyxMove); + uint8 MaxCount = sizeof(MoveData)/sizeof(OnyxMove); - for (uint32 i = 0; i < uiMaxCount; ++i) + for (uint8 i = 0; i < MaxCount; ++i) { - if (aMoveData[i].uiLocId == m_uiMovePoint) - return &aMoveData[i]; + if (MoveData[i].LocId == MovePoint) + return &MoveData[i]; } return NULL; @@ -323,84 +328,84 @@ public: void SetNextRandomPoint() { - uint32 uiMaxCount = sizeof(aMoveData)/sizeof(sOnyxMove); + uint8 MaxCount = sizeof(MoveData)/sizeof(OnyxMove); - uint32 iTemp = rand()%(uiMaxCount-1); + uint8 iTemp = urand(0, MaxCount-1); - if (iTemp >= m_uiMovePoint) + if (iTemp >= MovePoint) ++iTemp; - m_uiMovePoint = iTemp; + MovePoint = iTemp; } - void UpdateAI(const uint32 uiDiff) + void UpdateAI(const uint32 Diff) { if (!UpdateVictim()) return; //Common to PHASE_START && PHASE_END - if (m_uiPhase == PHASE_START || m_uiPhase == PHASE_END) + if (Phase == PHASE_START || Phase == PHASE_END) { //Specific to PHASE_START || PHASE_END - if (m_uiPhase == PHASE_START) + if (Phase == PHASE_START) { if (HealthBelowPct(60)) { SetCombatMovement(false); - m_uiPhase = PHASE_BREATH; + Phase = PHASE_BREATH; me->GetMotionMaster()->MovePoint(10, Phase2Location); return; } } else { - if (m_uiBellowingRoarTimer <= uiDiff) + if (BellowingRoarTimer <= Diff) { DoCastVictim(SPELL_BELLOWING_ROAR); // Eruption - GameObject* pFloor = NULL; + GameObject* Floor = NULL; Trinity::GameObjectInRangeCheck check(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 15); - Trinity::GameObjectLastSearcher searcher(me, pFloor, check); + Trinity::GameObjectLastSearcher searcher(me, Floor, check); me->VisitNearbyGridObject(30, searcher); - if (instance && pFloor) - instance->SetData64(DATA_FLOOR_ERUPTION_GUID, pFloor->GetGUID()); - m_uiBellowingRoarTimer = 30000; + if (instance && Floor) + instance->SetData64(DATA_FLOOR_ERUPTION_GUID, Floor->GetGUID()); + BellowingRoarTimer = 30000; } else - m_uiBellowingRoarTimer -= uiDiff; + BellowingRoarTimer -= Diff; } - if (m_uiFlameBreathTimer <= uiDiff) + if (FlameBreathTimer <= Diff) { DoCastVictim(SPELL_FLAME_BREATH); - m_uiFlameBreathTimer = urand(10000, 20000); + FlameBreathTimer = urand(10000, 20000); } else - m_uiFlameBreathTimer -= uiDiff; + FlameBreathTimer -= Diff; - if (m_uiTailSweepTimer <= uiDiff) + if (TailSweepTimer <= Diff) { DoCastAOE(SPELL_TAIL_SWEEP); - m_uiTailSweepTimer = urand(15000, 20000); + TailSweepTimer = urand(15000, 20000); } else - m_uiTailSweepTimer -= uiDiff; + TailSweepTimer -= Diff; - if (m_uiCleaveTimer <= uiDiff) + if (CleaveTimer <= Diff) { DoCastVictim(SPELL_CLEAVE); - m_uiCleaveTimer = urand(2000, 5000); + CleaveTimer = urand(2000, 5000); } else - m_uiCleaveTimer -= uiDiff; + CleaveTimer -= Diff; - if (m_uiWingBuffetTimer <= uiDiff) + if (WingBuffetTimer <= Diff) { DoCastVictim(SPELL_WING_BUFFET); - m_uiWingBuffetTimer = urand(15000, 30000); + WingBuffetTimer = urand(15000, 30000); } else - m_uiWingBuffetTimer -= uiDiff; + WingBuffetTimer -= Diff; DoMeleeAttackIfReady(); } @@ -408,86 +413,86 @@ public: { if (HealthBelowPct(40)) { - m_uiPhase = PHASE_END; + Phase = PHASE_END; if (instance) - instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase); + instance->SetData(DATA_ONYXIA_PHASE, Phase); DoScriptText(SAY_PHASE_3_TRANS, me); SetCombatMovement(true); me->SetCanFly(false); - m_bIsMoving = false; + IsMoving = false; me->GetMotionMaster()->MovePoint(9, me->GetHomePosition()); return; } - if (m_uiDeepBreathTimer <= uiDiff) + if (DeepBreathTimer <= Diff) { - if (!m_bIsMoving) + if (!IsMoving) { if (me->IsNonMeleeSpellCasted(false)) me->InterruptNonMeleeSpells(false); DoScriptText(EMOTE_BREATH, me); - DoCast(me, m_pPointData->uiSpellId); - m_uiDeepBreathTimer = 70000; + DoCast(me, PointData->SpellId); + DeepBreathTimer = 70000; } } else - m_uiDeepBreathTimer -= uiDiff; + DeepBreathTimer -= Diff; - if (m_uiMovementTimer <= uiDiff) + if (MovementTimer <= Diff) { - if (!m_bIsMoving) + if (!IsMoving) { SetNextRandomPoint(); - m_pPointData = GetMoveData(); + PointData = GetMoveData(); - if (!m_pPointData) + if (!PointData) return; - me->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ); - m_bIsMoving = true; - m_uiMovementTimer = 25000; + me->GetMotionMaster()->MovePoint(PointData->LocId, PointData->fX, PointData->fY, PointData->fZ); + IsMoving = true; + MovementTimer = 25000; } } else - m_uiMovementTimer -= uiDiff; + MovementTimer -= Diff; - if (m_uiFireballTimer <= uiDiff) + if (FireballTimer <= Diff) { if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_FIREBALL); - m_uiFireballTimer = 8000; + FireballTimer = 8000; } } else - m_uiFireballTimer -= uiDiff; + FireballTimer -= Diff; - if (m_uiLairGuardTimer <= uiDiff) + if (LairGuardTimer <= Diff) { - me->SummonCreature(NPC_LAIRGUARD, aSpawnLocations[2].GetPositionX(), aSpawnLocations[2].GetPositionY(), aSpawnLocations[2].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); - m_uiLairGuardTimer = 30000; + me->SummonCreature(NPC_LAIRGUARD, SpawnLocations[2], TEMPSUMMON_CORPSE_DESPAWN); + LairGuardTimer = 30000; } else - m_uiLairGuardTimer -= uiDiff; + LairGuardTimer -= Diff; - if (m_uiWhelpTimer <= uiDiff) + if (WhelpTimer <= Diff) { - me->SummonCreature(NPC_WHELP, aSpawnLocations[0].GetPositionX(), aSpawnLocations[0].GetPositionY(), aSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); - me->SummonCreature(NPC_WHELP, aSpawnLocations[1].GetPositionX(), aSpawnLocations[1].GetPositionY(), aSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN); - if (m_uiSummonWhelpCount >= RAID_MODE(20, 40)) + me->SummonCreature(NPC_WHELP, SpawnLocations[0], TEMPSUMMON_CORPSE_DESPAWN); + me->SummonCreature(NPC_WHELP, SpawnLocations[1], TEMPSUMMON_CORPSE_DESPAWN); + if (SummonWhelpCount >= RAID_MODE(20, 40)) { - m_uiSummonWhelpCount = 0; - m_uiWhelpTimer = 90000; + SummonWhelpCount = 0; + WhelpTimer = 90000; } else - m_uiWhelpTimer = 500; + WhelpTimer = 500; } else - m_uiWhelpTimer -= uiDiff; + WhelpTimer -= Diff; } } }; diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp index 1c599ce7c6f..0689a8872bb 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp @@ -22,7 +22,12 @@ SDComment: SDCategory: Onyxia's Lair EndScriptData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "InstanceScript.h" +#include "Cell.h" +#include "CellImpl.h" +#include "GridNotifiers.h" +#include "GridNotifiersImpl.h" #include "onyxias_lair.h" class instance_onyxias_lair : public InstanceMapScript @@ -44,27 +49,27 @@ public: std::map FloorEruptionGUID[2]; std::queue FloorEruptionGUIDQueue; - uint64 m_uiOnyxiasGUID; - uint32 m_uiOnyxiaLiftoffTimer; - uint32 m_uiManyWhelpsCounter; - uint32 m_uiEruptTimer; + uint64 OnyxiasGUID; + uint32 OnyxiaLiftoffTimer; + uint32 ManyWhelpsCounter; + uint32 EruptTimer; - uint8 m_auiEncounter[MAX_ENCOUNTER]; + uint8 Encounter[MAX_ENCOUNTER]; - bool m_bAchievManyWhelpsHandleIt; - bool m_bAchievSheDeepBreathMore; + bool AchievManyWhelpsHandleIt; + bool AchievSheDeepBreathMore; void Initialize() { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + memset(&Encounter, 0, sizeof(Encounter)); - m_uiOnyxiasGUID = 0; - m_uiOnyxiaLiftoffTimer = 0; - m_uiManyWhelpsCounter = 0; - m_bAchievManyWhelpsHandleIt = false; - m_bAchievSheDeepBreathMore = true; + OnyxiasGUID = 0; + OnyxiaLiftoffTimer = 0; + ManyWhelpsCounter = 0; + AchievManyWhelpsHandleIt = false; + AchievSheDeepBreathMore = true; - m_uiEruptTimer = 0; + EruptTimer = 0; } void OnCreatureCreate(Creature* creature) @@ -72,7 +77,7 @@ public: switch (creature->GetEntry()) { case NPC_ONYXIA: - m_uiOnyxiasGUID = creature->GetGUID(); + OnyxiasGUID = creature->GetGUID(); break; } } @@ -93,7 +98,7 @@ public: if (Creature* temp = go->SummonCreature(NPC_WHELP, goPos, TEMPSUMMON_CORPSE_DESPAWN)) { temp->SetInCombatWithZone(); - ++m_uiManyWhelpsCounter; + ++ManyWhelpsCounter; } break; } @@ -139,88 +144,88 @@ public: FloorEruptionGUID[1].erase(floorEruptedGUID); } - void SetData(uint32 uiType, uint32 uiData) + void SetData(uint32 Type, uint32 Data) { - switch (uiType) + switch (Type) { case DATA_ONYXIA: - m_auiEncounter[0] = uiData; - if (uiData == IN_PROGRESS) + Encounter[0] = Data; + if (Data == IN_PROGRESS) SetData(DATA_SHE_DEEP_BREATH_MORE, IN_PROGRESS); break; case DATA_ONYXIA_PHASE: - if (uiData == PHASE_BREATH) //Used to mark the liftoff phase + if (Data == PHASE_BREATH) //Used to mark the liftoff phase { - m_bAchievManyWhelpsHandleIt = false; - m_uiManyWhelpsCounter = 0; - m_uiOnyxiaLiftoffTimer = 10*IN_MILLISECONDS; + AchievManyWhelpsHandleIt = false; + ManyWhelpsCounter = 0; + OnyxiaLiftoffTimer = 10*IN_MILLISECONDS; } break; case DATA_SHE_DEEP_BREATH_MORE: - if (uiData == IN_PROGRESS) + if (Data == IN_PROGRESS) { - m_bAchievSheDeepBreathMore = true; + AchievSheDeepBreathMore = true; } - else if (uiData == FAIL) + else if (Data == FAIL) { - m_bAchievSheDeepBreathMore = false; + AchievSheDeepBreathMore = false; } break; } - if (uiType < MAX_ENCOUNTER && uiData == DONE) + if (Type < MAX_ENCOUNTER && Data == DONE) SaveToDB(); } - void SetData64(uint32 uiType, uint64 uiData) + void SetData64(uint32 Type, uint64 Data) { - switch (uiType) + switch (Type) { case DATA_FLOOR_ERUPTION_GUID: FloorEruptionGUID[1] = FloorEruptionGUID[0]; - FloorEruptionGUIDQueue.push(uiData); - m_uiEruptTimer = 2500; + FloorEruptionGUIDQueue.push(Data); + EruptTimer = 2500; break; } } - uint32 GetData(uint32 uiType) + uint32 GetData(uint32 Type) { - switch (uiType) + switch (Type) { case DATA_ONYXIA: - return m_auiEncounter[0]; + return Encounter[0]; } return 0; } - uint64 GetData64(uint32 uiData) + uint64 GetData64(uint32 Data) { - switch (uiData) + switch (Data) { case DATA_ONYXIA_GUID: - return m_uiOnyxiasGUID; + return OnyxiasGUID; } return 0; } - void Update(uint32 uiDiff) + void Update(uint32 Diff) { if (GetData(DATA_ONYXIA) == IN_PROGRESS) { - if (m_uiOnyxiaLiftoffTimer && m_uiOnyxiaLiftoffTimer <= uiDiff) + if (OnyxiaLiftoffTimer && OnyxiaLiftoffTimer <= Diff) { - m_uiOnyxiaLiftoffTimer = 0; - if (m_uiManyWhelpsCounter >= 50) - m_bAchievManyWhelpsHandleIt = true; - } else m_uiOnyxiaLiftoffTimer -= uiDiff; + OnyxiaLiftoffTimer = 0; + if (ManyWhelpsCounter >= 50) + AchievManyWhelpsHandleIt = true; + } else OnyxiaLiftoffTimer -= Diff; } if (!FloorEruptionGUIDQueue.empty()) { - if (m_uiEruptTimer <= uiDiff) + if (EruptTimer <= Diff) { uint32 treeHeight = 0; do @@ -229,10 +234,10 @@ public: FloorEruption(FloorEruptionGUIDQueue.front()); FloorEruptionGUIDQueue.pop(); } while (!FloorEruptionGUIDQueue.empty() && (*FloorEruptionGUID[1].find(FloorEruptionGUIDQueue.front())).second == treeHeight); - m_uiEruptTimer = 1000; + EruptTimer = 1000; } else - m_uiEruptTimer -= uiDiff; + EruptTimer -= Diff; } } @@ -242,10 +247,10 @@ public: { case ACHIEV_CRITERIA_MANY_WHELPS_10_PLAYER: // Criteria for achievement 4403: Many Whelps! Handle It! (10 player) Hatch 50 eggs in 10s case ACHIEV_CRITERIA_MANY_WHELPS_25_PLAYER: // Criteria for achievement 4406: Many Whelps! Handle It! (25 player) Hatch 50 eggs in 10s - return m_bAchievManyWhelpsHandleIt; + return AchievManyWhelpsHandleIt; case ACHIEV_CRITERIA_DEEP_BREATH_10_PLAYER: // Criteria for achievement 4404: She Deep Breaths More (10 player) Everybody evade Deep Breath case ACHIEV_CRITERIA_DEEP_BREATH_25_PLAYER: // Criteria for achievement 4407: She Deep Breaths More (25 player) Everybody evade Deep Breath - return m_bAchievSheDeepBreathMore; + return AchievSheDeepBreathMore; } return false; } diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h b/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h index eaf6cac43af..26fd9284ea2 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h +++ b/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h @@ -18,13 +18,13 @@ #ifndef DEF_ONYXIAS_LAIR_H #define DEF_ONYXIAS_LAIR_H -enum eData64 +enum Data64 { DATA_ONYXIA_GUID, DATA_FLOOR_ERUPTION_GUID }; -enum eInstanceData +enum InstanceData { DATA_ONYXIA, MAX_ENCOUNTER, @@ -34,7 +34,7 @@ enum eInstanceData DATA_MANY_WHELPS_COUNT }; -enum eCreatures +enum Creatures { NPC_WHELP = 11262, NPC_LAIRGUARD = 36561, @@ -42,20 +42,20 @@ enum eCreatures NPC_ONYXIA = 10184 }; -enum eOnyxiaPhases +enum OnyxiaPhases { PHASE_START = 1, PHASE_BREATH = 2, PHASE_END = 3 }; -enum eGameObjects +enum GameObjects { GO_WHELP_SPAWNER = 176510, GO_WHELP_EGG = 176511 }; -enum eAchievementData +enum AchievementData { ACHIEV_CRITERIA_MANY_WHELPS_10_PLAYER = 12565, // Criteria for achievement 4403: Many Whelps! Handle It! (10 player) Hatch 50 eggs in 10s ACHIEV_CRITERIA_MANY_WHELPS_25_PLAYER = 12568, // Criteria for achievement 4406: Many Whelps! Handle It! (25 player) Hatch 50 eggs in 10s From b90050a528f685865fdc5a7430c2631548ac42f7 Mon Sep 17 00:00:00 2001 From: zori Date: Sat, 2 Jun 2012 18:38:02 +0200 Subject: [PATCH 0905/1149] Core/Movement: Properly handle cases when jumping from one transport directly to another --- src/server/game/Handlers/MovementHandler.cpp | 40 ++++++++++++++++---- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index c271a43462a..ff9030f04d5 100755 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -295,16 +295,42 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recvData) } // if we boarded a transport, add us to it - if (plrMover && !plrMover->GetTransport()) + if (plrMover) { - // elevators also cause the client to send MOVEMENTFLAG_ONTRANSPORT - just dismount if the guid can be found in the transport list - for (MapManager::TransportSet::const_iterator iter = sMapMgr->m_Transports.begin(); iter != sMapMgr->m_Transports.end(); ++iter) + if (!plrMover->GetTransport()) { - if ((*iter)->GetGUID() == movementInfo.t_guid) + // elevators also cause the client to send MOVEMENTFLAG_ONTRANSPORT - just dismount if the guid can be found in the transport list + for (MapManager::TransportSet::const_iterator iter = sMapMgr->m_Transports.begin(); iter != sMapMgr->m_Transports.end(); ++iter) { - plrMover->m_transport = (*iter); - (*iter)->AddPassenger(plrMover); - break; + if ((*iter)->GetGUID() == movementInfo.t_guid) + { + plrMover->m_transport = *iter; + (*iter)->AddPassenger(plrMover); + break; + } + } + } + else if (plrMover->GetTransport()->GetGUID() != movementInfo.t_guid) + { + bool foundNewTransport = false; + plrMover->m_transport->RemovePassenger(plrMover); + for (MapManager::TransportSet::const_iterator iter = sMapMgr->m_Transports.begin(); iter != sMapMgr->m_Transports.end(); ++iter) + { + if ((*iter)->GetGUID() == movementInfo.t_guid) + { + foundNewTransport = true; + plrMover->m_transport = *iter; + (*iter)->AddPassenger(plrMover); + break; + } + } + + if (!foundNewTransport) + { + plrMover->m_transport = NULL; + movementInfo.t_pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f); + movementInfo.t_time = 0; + movementInfo.t_seat = -1; } } } From 79e00cfcbe13c22e8d2f56ec0c8e217452a46cd2 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 2 Jun 2012 16:14:36 +0200 Subject: [PATCH 0906/1149] Core/Movement: Add missing SplineFlags / SplineTypes to enums --- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/game/Entities/Unit/Unit.h | 43 +++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index c90b86f2349..bb2d057bfaa 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -435,7 +435,7 @@ void Unit::SendMonsterMoveExitVehicle(Position const* newPos) data << uint8(SPLINETYPE_FACING_ANGLE); data << float(GetOrientation()); // guess - data << uint32(SPLINEFLAG_EXIT_VEHICLE); + data << uint32(SPLINEFLAG_TRANSPORT_EXIT); data << uint32(0); // Time in between points data << uint32(1); // 1 single waypoint data << newPos->GetPositionX(); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index f246f595dec..65a165b40d2 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -737,15 +737,48 @@ enum MovementFlags2 enum SplineFlags { - SPLINEFLAG_WALKMODE = 0x00001000, - SPLINEFLAG_FLYING = 0x00002000, - SPLINEFLAG_TRANSPORT = 0x00800000, - SPLINEFLAG_EXIT_VEHICLE = 0x01000000, + SPLINEFLAG_NONE = 0x00000000, + SPLINEFLAG_FORWARD = 0x00000001, + SPLINEFLAG_BACKWARD = 0x00000002, + SPLINEFLAG_STRAFE_LEFT = 0x00000004, + SPLINEFLAG_STRAFE_RIGHT = 0x00000008, + SPLINEFLAG_TURN_LEFT = 0x00000010, + SPLINEFLAG_TURN_RIGHT = 0x00000020, + SPLINEFLAG_PITCH_UP = 0x00000040, + SPLINEFLAG_PITCH_DOWN = 0x00000080, + SPLINEFLAG_DONE = 0x00000100, + SPLINEFLAG_FALLING = 0x00000200, + SPLINEFLAG_NO_SPLINE = 0x00000400, + SPLINEFLAG_TRAJECTORY = 0x00000800, + SPLINEFLAG_WALK_MODE = 0x00001000, + SPLINEFLAG_FLYING = 0x00002000, + SPLINEFLAG_KNOCKBACK = 0x00004000, + SPLINEFLAG_FINAL_POINT = 0x00008000, + SPLINEFLAG_FINAL_TARGET = 0x00010000, + SPLINEFLAG_FINAL_FACING = 0x00020000, + SPLINEFLAG_CATMULL_ROM = 0x00040000, + SPLINEFLAG_CYCLIC = 0x00080000, + SPLINEFLAG_ENTER_CYCLE = 0x00100000, + SPLINEFLAG_ANIMATION_TIER = 0x00200000, + SPLINEFLAG_FROZEN = 0x00400000, + SPLINEFLAG_TRANSPORT = 0x00800000, + SPLINEFLAG_TRANSPORT_EXIT = 0x01000000, + SPLINEFLAG_UNKNOWN7 = 0x02000000, + SPLINEFLAG_UNKNOWN8 = 0x04000000, + SPLINEFLAG_ORIENTATION_INVERTED = 0x08000000, + SPLINEFLAG_USE_PATH_SMOOTHING = 0x10000000, + SPLINEFLAG_ANIMATION = 0x20000000, + SPLINEFLAG_UNCOMPRESSED_PATH = 0x40000000, + SPLINEFLAG_UNKNOWN10 = 0x80000000, }; enum SplineType { - SPLINETYPE_FACING_ANGLE = 4, + SPLINETYPE_NORMAL = 0, + SPLINETYPE_STOP = 1, + SPLINETYPE_FACING_SPOT = 2, + SPLINETYPE_FACING_TARGET = 3, + SPLINETYPE_FACING_ANGLE = 4, }; enum UnitTypeMask From 250565fae5381da54707459a6800b6ce755006fb Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sat, 2 Jun 2012 19:28:36 +0200 Subject: [PATCH 0907/1149] DB/Loot: 100% Rework of all loots in Hellfire Peninsula and Zangermarsh Closes #2161 --- ...012_06_02_03_creature_loot_template_hp.sql | 1132 +++++++++++++++++ ...012_06_02_03_creature_loot_template_zm.sql | 902 +++++++++++++ .../2012_06_02_03_reference_loot_template.sql | 791 ++++++++++++ 3 files changed, 2825 insertions(+) create mode 100644 sql/updates/world/2012_06_02_03_creature_loot_template_hp.sql create mode 100644 sql/updates/world/2012_06_02_03_creature_loot_template_zm.sql create mode 100644 sql/updates/world/2012_06_02_03_reference_loot_template.sql diff --git a/sql/updates/world/2012_06_02_03_creature_loot_template_hp.sql b/sql/updates/world/2012_06_02_03_creature_loot_template_hp.sql new file mode 100644 index 00000000000..8a0496d88f6 --- /dev/null +++ b/sql/updates/world/2012_06_02_03_creature_loot_template_hp.sql @@ -0,0 +1,1132 @@ +SET @RefDLK := 26043; +SET @HFP := 6000; +SET @HFP1 := @HFP+1; +SET @HFP2 := @HFP+2; +SET @Scrolls := @HFP+3; +-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +DELETE FROM `reference_loot_template` WHERE `entry` IN (@RefDLK,@HFP,@HFP1,@HFP2,@Scrolls); +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +-- Generic Lowlevel Ref1 +(@HFP,1,20,1,0,-4000,1), -- Grey level 61 +(@HFP,2,5,1,0,-4001,1), -- Grey level 64 +(@HFP,3,2,1,0,-4100,1), -- Green level 57 +(@HFP,4,2,1,0,-4101,1), -- Green level 58 +(@HFP,5,2,1,0,-4102,1), -- Green level 59 +(@HFP,6,2,1,0,-4103,1), -- Green level 60 +(@HFP,7,2,1,0,-4104,1), -- Green level 61 +(@HFP,8,2,1,0,-4105,1), -- Green level 62 +(@HFP,9,0.5,1,0,-4200,1), -- Blue level 60 +(@HFP,10,0.5,1,0,-4201,1), -- Blue level 61 +(@HFP,11,0.5,1,0,-4202,1), -- Blue level 62 +(@HFP,12,0.5,1,0,-4203,1), -- Blue level 63 +(@HFP,13,0.5,1,0,-4204,1), -- Blue level 64 +(@HFP,4500,0.1,1,0,1,1), -- Traveler's Backpack +(@HFP,3914,0.05,1,0,1,1), -- Journeyman's Backpack +-- Generic Lowlevel Ref2 +(@HFP1,1,20,1,0,-4000,1), -- Grey level 61 +(@HFP1,2,5,1,0,-4001,1), -- Grey level 64 +(@HFP1,3,2,1,0,-4103,1), -- Green level 60 +(@HFP1,4,2,1,0,-4104,1), -- Green level 61 +(@HFP1,5,2,1,0,-4105,1), -- Green level 62 +(@HFP1,6,0.5,1,0,-4200,1), -- Blue level 60 +(@HFP1,7,0.5,1,0,-4201,1), -- Blue level 61 +(@HFP1,8,0.5,1,0,-4202,1), -- Blue level 62 +(@HFP1,9,0.5,1,0,-4203,1), -- Blue level 63 +(@HFP1,10,0.5,1,0,-4204,1), -- Blue level 64 +-- High level Ref +(@HFP2,1,30,1,1,-4002,1), -- Grey level 64 items (ilvl 69) +(@HFP2,2,30,1,1,-4002,1), -- Grey level 67 items (ilvl 72) +(@HFP2,3,2,1,2,-4110,1), -- Green level 67 items (ilvl 111) +(@HFP2,4,2,1,2,-4111,1), -- Green level 68 items (ilvl 114) +(@HFP2,5,2,1,2,-4112,1), -- Green level 69 items (ilvl 117) +(@HFP2,6,0.5,1,3,-4208,1), -- Blue level 68 items (ilvl 115) +(@HFP2,7,0.5,1,3,-4209,1), -- Blue level 69 items (ilvl 115) +(@HFP2,8,0.5,1,3,-4210,1), -- Blue level 70 items (ilvl 115) +-- TBC Scrolls +(@Scrolls,33459,0,1,1,1,1), -- Scroll of Protection VI +(@Scrolls,33457,0,1,1,1,1), -- Scroll of Agility VI +(@Scrolls,33458,0,1,1,1,1), -- Scroll of Intellect VI +(@Scrolls,33460,0,1,1,1,1), -- Scroll of Spirit VI +(@Scrolls,33461,0,1,1,1,1), -- Scroll of Stamina VI +(@Scrolls,33462,0,1,1,1,1), -- Scroll of Strength VI +-- Doom Lord Kazzak +(@RefDLK,30732,0,1,1,1,1), -- Exodar Life-Staff +(@RefDLK,30733,0,1,1,1,1), -- Hope Ender +(@RefDLK,30734,0,1,1,1,1), -- Leggings of the Seventh Circle +(@RefDLK,30735,0,1,1,1,1), -- Ancient Spellcloak of the Highborne +(@RefDLK,30736,0,1,1,1,1), -- Ring of Flowing Light +(@RefDLK,30737,0,1,1,1,1), -- Gold-Leaf Wildboots +(@RefDLK,30738,0,1,1,1,1), -- Ring of Reciprocity +(@RefDLK,30739,0,1,1,1,1), -- Scaled Greaves of the Marksman +(@RefDLK,30740,0,1,1,1,1), -- Ripfiend Shoulderplates +(@RefDLK,30741,0,1,1,1,1); -- Topaz-Studded Battlegrips +-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +DELETE FROM `creature_loot_template` WHERE `entry` IN (18728,187281,19191,16977,19354,17084,17057,16873,16871,19422,16907,19424,19423,16903,16901,19701,16876,16925,18952,16972,16973,17014,16844,19299,16847,16863,18981,16959,19434,16938,16937,19312,22461,19190,18733,24918,18977,17034,19459,19136,19264,16954,18678,18827,16947,16845,19457,16967,16966,22374,18978,16880,17058,22323,19261,17035,17053,16978,16846,16912,16911,19408,17039,16857,18677,19192,16946,16950,16934,19189,19188,16932,16933,20798,19458,16974,19415,16878,16870,19295,16867,19414,19413,19410,19411,16960,16879,16929,16928,16927,19282,19335,19443,16951,19349,19350,16968,26222,26223,16975,20145,16904,16906,16905,19527,16939,18679,19263,19298,16964,19442,24919,18975); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +-- Doom Lord Kazzak, NPC 18728 +-- --------------------------------------------------- +(18728,1,100,1,0,-@RefDLK,2), -- Two from Doom Loor Kazzak Reference +(18728,2,5,1,0,-4113,1), -- Level 70 TBC Green Reference +-- --------------------------------------------------- +-- Arazzius the Cruel, NPC 19191 +-- --------------------------------------------------- +(19191,21877,50,1,0,1,3), -- Netherweave Cloth +(19191,27854,5,1,0,1,1), -- Smoked Talbuk Venison +(19191,28399,5,1,0,1,1), -- Filtered Draenic Water +(19191,13446,1.5,1,0,1,1), -- Major Healing Potion +(19191,13444,1.5,1,0,1,1), -- Major Mana Potion +(19191,1,15,1,0,-4000,1), -- Grey itemlevel 66 (level 61 items) +(19191,2,5,1,0,-4001,1), -- Grey itemlevel 69 (lvl 64 items) +(19191,3,7.5,1,0,-4103,1), -- Green itemlevel 90 +(19191,4,5,1,0,-4104,1), -- Green itemlevel 93 +(19191,5,2.5,1,0,-4105,1), -- Green itemlevel 96 +(19191,6,0.5,1,0,-4201,1), -- Blues level 61 +(19191,7,0.5,1,0,-4202,1), -- Blues level 62 +(19191,8,0.5,1,0,-4203,1), -- Blues level 63 +(19191,9,0.5,1,0,-4204,1), -- Blues level 64 +-- --------------------------------------------------- +-- Arch Mage Xintor, NPC 16977 +-- --------------------------------------------------- +(16977,21877,55,1,0,1,1), -- Netherweave Cloth +(16977,14047,15,1,0,1,3), -- Runecloth +(16977,27859,10,1,0,1,1), -- Zanger Caps +(16977,28399,5,1,0,1,1), -- Filtered Draenic Water +(16977,13446,2,1,0,1,1), -- Major Healing Potion +(16977,1,90,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 +-- --------------------------------------------------- +-- Arzeth the Merciless, NPC 19354 +-- --------------------------------------------------- +(19354,21877,70,1,0,1,1), -- Netherweave Cloth +(19354,27854,7,1,0,1,1), -- Smoked Talbuk Venison +(19354,28399,3,1,0,1,1), -- Filtered Draenic Water +(19354,13446,3,1,0,1,1), -- Major Healing Potion +(19354,13444,1,1,0,1,1), -- Major Healing Potion +(19354,5760,1,1,0,1,1), -- Eternium Lockbox +(19354,1,90,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 +-- --------------------------------------------------- +-- Avruu, NPC 17084 +-- --------------------------------------------------- +(17084,23580,80,1,0,1,1), -- Avruu's Orb +(17084,21877,45,1,0,1,3), -- Netherweave Cloth +(17084,17056,30,1,0,1,1), -- Light Feather +(17084,23483,-10,1,0,1,1), -- QItem: Haal'eshi Scroll +(17084,27854,5,1,0,1,1), -- Smoked Talbuk Venison +(17084,28399,3,1,0,1,1), -- Filtered Draenic Water +(17084,13446,3,1,0,1,1), -- Major Healing Potion +(17084,13444,1,1,0,1,1), -- Major Healing Potion +(17084,1,90,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 +-- --------------------------------------------------- +-- Blacktalon teh Savage, NPC 17057 +-- --------------------------------------------------- +(17057,23687,-100,1,0,1,1), -- QItem: Blacktalon's Claws +(17057,24516,75,1,0,1,1), -- Damaged Rock Flayer Talon +(17057,21877,40,1,0,1,1), -- Netherweave Cloth +(17057,24517,20,1,0,1,1), -- Blood Soaked Tail +(17057,27854,3,1,0,1,1), -- Smoked Talbuk Venison +(17057,28399,2,1,0,1,1), -- Filtered Draenic Water +(17057,13446,1.5,1,0,1,1), -- Major Healing Potion +(17057,13444,0.75,1,0,1,1), -- Major Healing Potion +(17057,1,90,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 +-- --------------------------------------------------- +-- Bleeding Hollow Dark Shaman, NPC 16873 +-- --------------------------------------------------- +(16873,30157,-25,1,0,1,1), -- QItem: Cursed Talisman +(16873,30425,-17,1,0,1,1), -- QItem: Bleeding Hollow Blood +(16873,28399,3,1,0,1,1), -- Filtered Draenic Water +(16873,13446,2,1,0,1,1), -- Major Healing Potion +(16873,5760,0.1,1,0,1,1), -- Eternium Lockbox +(16873,1,2,1,0,-6003,1), -- Scroll of * Reference +(16873,2,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Bleeding Hollow Grunt, NPC 16871 +-- --------------------------------------------------- +(16871,30157,-25,1,0,1,1), -- QItem: Cursed Talisman +(16871,30425,-17,1,0,1,1), -- QItem: Bleeding Hollow Blood +(16871,28399,3,1,0,1,1), -- Filtered Draenic Water +(16871,13446,2,1,0,1,1), -- Major Healing Potion +(16871,5760,0.1,1,0,1,1), -- Eternium Lockbox +(16871,1,2,1,0,-6003,1), -- Scroll of * Reference +(16871,2,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Bleeding Hollow Necrolyte, NPC 19422 +-- --------------------------------------------------- +(19422,30157,-25,1,0,1,1), -- QItem: Cursed Talisman +(19422,30425,-17,1,0,1,1), -- QItem: Bleeding Hollow Blood +(19422,28399,3,1,0,1,1), -- Filtered Draenic Water +(19422,13446,2,1,0,1,1), -- Major Healing Potion +(19422,5760,0.1,1,0,1,1), -- Eternium Lockbox +(19422,1,2,1,0,-6003,1), -- Scroll of * Reference +(19422,2,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Bleeding Hollow Peon, NPC 16907 +-- --------------------------------------------------- +(16907,30157,-25,1,0,1,1), -- QItem: Cursed Talisman +(16907,30425,-17,1,0,1,1), -- QItem: Bleeding Hollow Blood +(16907,28399,3,1,0,1,1), -- Filtered Draenic Water +(16907,13446,2,1,0,1,1), -- Major Healing Potion +(16907,5760,0.1,1,0,1,1), -- Eternium Lockbox +(16907,1,2,1,0,-6003,1), -- Scroll of * Reference +(16907,2,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Bleeding Hollow Tormentor, NPC 19424 +-- --------------------------------------------------- +(19424,30157,-25,1,0,1,1), -- QItem: Cursed Talisman +(19424,30425,-17,1,0,1,1), -- QItem: Bleeding Hollow Blood +(19424,28399,3,1,0,1,1), -- Filtered Draenic Water +(19424,13446,2,1,0,1,1), -- Major Healing Potion +(19424,5760,0.1,1,0,1,1), -- Eternium Lockbox +(19424,1,2,1,0,-6003,1), -- Scroll of * Reference +(19424,2,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Bleeding Hollow Worg, NPC 19423 +-- --------------------------------------------------- +(19423,3299,70,1,0,1,1), -- Fractured Canine +(19423,33547,25,1,0,1,1), -- Hardened Claw +(19423,4583,1,1,0,1,1), -- Thick Furry Mane +(19423,4584,1,1,0,1,1), -- Large Trophy Paw +(19423,5759,0.2,1,0,1,1), -- Thorium Lockbox +(19423,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Blistering Oozeling, NPC 16903 +-- --------------------------------------------------- +(16903,25444,100,1,0,1,1), -- Corrosive Ichor +(16903,23339,-25,1,0,1,1), -- QItem: Arelion's Journal +(16903,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Blistering Rot, NPC 16901 +-- --------------------------------------------------- +(16901,25444,80,1,1,1,1), -- Corrosive Ichor +(16901,25446,20,1,1,1,1), -- Brittle Skull +(16901,5760,0.2,1,0,1,1), -- Eternium Lockbox +(16901,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Bonechewer Evoker, NPC 19701 +-- --------------------------------------------------- +(19701,21877,55,1,0,1,1), -- Netherweave Cloth +(19701,30327,-30,1,0,1,1), -- QItem: Bonechewer Blood +(19701,14047,20,1,0,1,3), -- Runecloth +(19701,27854,7,1,0,1,1), -- Smoked Talbuk Venison +(19701,28399,3,1,0,1,1), -- Filtered Draenic Water +(19701,13446,3,1,0,1,1), -- Major Healing Potion +(19701,13444,1,1,0,1,1), -- Major Healing Potion +(19701,5759,0.2,1,0,1,1), -- Thorium Lockbox +(19701,1,2,1,0,-6003,1), -- Scroll of * Reference +(19701,2,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Bonechewer Mutant, NPC 16876 +-- --------------------------------------------------- +(16876,21877,55,1,0,1,1), -- Netherweave Cloth +(16876,30327,-30,1,0,1,1), -- QItem: Bonechewer Blood +(16876,14047,20,1,0,1,3), -- Runecloth +(16876,27854,7,1,0,1,1), -- Smoked Talbuk Venison +(16876,28399,3,1,0,1,1), -- Filtered Draenic Water +(16876,13446,3,1,0,1,1), -- Major Healing Potion +(16876,13444,1,1,0,1,1), -- Major Healing Potion +(16876,5759,0.2,1,0,1,1), -- Thorium Lockbox +(16876,1,2,1,0,-6003,1), -- Scroll of * Reference +(16876,2,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Bonechewer Raider, NPC 16925 +-- --------------------------------------------------- +(16925,21877,55,1,0,1,1), -- Netherweave Cloth +(16925,30327,-30,1,0,1,1), -- QItem: Bonechewer Blood +(16925,14047,20,1,0,1,3), -- Runecloth +(16925,27859,7,1,0,1,1), -- Zanger Caps +(16925,28399,3,1,0,1,1), -- Filtered Draenic Water +(16925,13446,3,1,0,1,1), -- Major Healing Potion +(16925,13444,1,1,0,1,1), -- Major Healing Potion +(16925,5759,0.2,1,0,1,1), -- Thorium Lockbox +(16925,1,2,1,0,-6003,1), -- Scroll of * Reference +(16925,2,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Bonechewer Scavenger, NPC 18952 +-- --------------------------------------------------- +(18952,21877,55,1,0,1,1), -- Netherweave Cloth +(18952,30327,-30,1,0,1,1), -- QItem: Bonechewer Blood +(18952,14047,20,1,0,1,3), -- Runecloth +(18952,27854,7,1,0,1,1), -- Smoked Talbuk Venison +(18952,28399,3,1,0,1,1), -- Filtered Draenic Water +(18952,13446,3,1,0,1,1), -- Major Healing Potion +(18952,13444,1,1,0,1,1), -- Major Healing Potion +(18952,5759,0.2,1,0,1,1), -- Thorium Lockbox +(18952,1,2,1,0,-6003,1), -- Scroll of * Reference +(18952,2,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Bonestripper Buzzard, NPC 16972 +-- --------------------------------------------------- +(16972,25425,80,1,0,1,1), -- Molted Feather +(16972,27671,50,1,0,1,1), -- Buzzard Meat +(16972,23239,-10,1,0,1,1), -- Plump Buzzard Wing +(16972,17056,30,1,0,1,1), -- Light Feather +(16972,25427,19,1,0,1,1), -- Beaten Talon +(16972,5759,0.2,1,0,1,1), -- Thorium Lockbox +(16972,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Bonestripper Vulture, NPC 16973 +-- --------------------------------------------------- +(16973,25425,80,1,0,1,1), -- Molted Feather +(16973,27671,50,1,0,1,1), -- Buzzard Meat +(16973,23387,-40,1,0,1,1), -- Bonestripper Tail Feather +(16973,25427,19,1,0,1,1), -- Beaten Talon +(16973,5760,0.2,1,0,1,1), -- Eternium Lockbox +(16973,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Collapsing Voidwalker, NPC 17014 +-- --------------------------------------------------- +(17014,29161,-100,1,0,1,3), -- Void Ridge Soul Shard +(17014,22577,20,1,0,1,2), -- Mote of Shadow +(17014,1,50,1,1,-6000,1), -- Generic HellfirePeninsula Loot +(17014,2,50,1,1,-6001,1), -- Generic HellfirePeninsula Loot1 +-- --------------------------------------------------- +-- Crust Burster, NPC 16844 +-- --------------------------------------------------- +(16844,25434,80,1,0,1,1), -- Fractured Carapace +(16844,25436,20,1,0,1,1), -- Twitching Leg +(16844,1,80,1,1,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Deathwhisperer, NPC 19299 +-- --------------------------------------------------- +(19299,21877,10,1,0,2,3), -- Netherweave Cloth +(19299,27854,2,1,0,1,1), -- Smoked Talbuk Venison +(19299,28399,2,1,0,1,1), -- Filtered Draenic Water +(19299,13444,1,1,0,1,1), -- Major Mana Potion +(19299,1,90,1,1,-6000,1), -- Generic HellfirePeninsula Loot +(19299,31902,0.05,1,0,1,1), -- Eight of Furies +(19299,31911,0.05,1,0,1,1), -- Eight of Lunacy +-- --------------------------------------------------- +-- Debilitated Mag'har Grunt, NPC 16847 +-- --------------------------------------------------- +(16847,23589,-50,1,0,1,1), -- QItem: Mag'har Ancestral Beads +(16847,21877,50,1,0,1,1), -- Netherweave Cloth +(16847,14047,15,1,0,1,3), -- Runecloth +(16847,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(16847,28399,3,1,0,1,1), -- Filtered Draenic Water +(16847,13446,2,1,0,1,1), -- Major Healing Potion +(16847,13444,1,1,0,1,1), -- Major Healing Potion +(16847,5759,0.15,1,0,1,1), -- Thorium Lockbox +(16847,1,2,1,0,-6003,1), -- Scroll of * Reference +(16847,2,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Deranged Helboar, NPC 16863 +-- --------------------------------------------------- +(16863,23270,-40,1,0,1,1), -- QItem: Tainted Helboar Meat +(16863,3403,40,1,1,1,1), -- Ivory Boar Tusk +(16863,2295,40,1,1,1,1), -- Large Boar Tusk +(16863,44754,15,1,1,1,1), -- Severed Boar Tusk +(16863,25440,1.5,1,1,1,1), -- Cracked Boar Tusk +(16863,25442,0.5,1,0,1,1), -- Mangled Snout +(16863,1,2,1,0,-6003,1), -- Scroll of * Reference +(16863,2,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Doomwhisperer, NPC 18981 +-- --------------------------------------------------- +(18981,28513,-50,1,0,1,1), -- QItem: Demonic Rune Stone +(18981,21877,50,1,0,1,1), -- Netherweave Cloth +(18981,14047,15,1,0,1,3), -- Runecloth +(18981,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(18981,28399,3,1,0,1,1), -- Filtered Draenic Water +(18981,13446,2,1,0,1,1), -- Major Healing Potion +(18981,13444,1,1,0,1,1), -- Major Healing Potion +(18981,5759,0.15,1,0,1,1), -- Thorium Lockbox +(18981,1,2,1,0,-6003,1), -- Scroll of * Reference +(18981,2,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Dread Tactician, NPC 16959 +-- --------------------------------------------------- +(16959,21877,13,1,0,1,1), -- Netherweave Cloth +(16959,14047,15,1,0,1,3), -- Runecloth +(16959,27854,2,1,0,1,1), -- Smoked Talbuk Venison +(16959,27860,3,1,0,1,1), -- Purified Draenic Water +(16959,22829,0.5,1,0,1,1), -- Super Healing Potion +(16959,22832,0.25,1,0,1,1), -- Super Mana Potion +(16959,1,80,1,0,-6002,1), -- Generic HellfirePeninsula Loot2 +-- --------------------------------------------------- +-- Dreadcaller, NPC 19434 +-- --------------------------------------------------- +(19434,21877,60,1,0,1,1), -- Netherweave Cloth +(19434,14047,15,1,0,1,3), -- Runecloth +(19434,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(19434,28399,3,1,0,1,1), -- Filtered Draenic Water +(19434,13446,2,1,0,1,1), -- Major Healing Potion +(19434,13444,1,1,0,1,1), -- Major Healing Potion +(19434,5759,0.2,1,0,1,1), -- Thorium Lockbox +(19434,1,2,1,0,-6003,1), -- Scroll of * Reference +(19434,2,85,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Dreghood Brute, NPC 16938 +-- --------------------------------------------------- +(16938,21877,70,1,0,1,1), -- Netherweave Cloth +(16938,27854,11,1,0,1,1), -- Mag'har Grainbread +(16938,28399,3,1,0,1,1), -- Filtered Draenic Water +(16938,13446,2,1,0,1,1), -- Major Healing Potion +(16938,13444,1,1,0,1,1), -- Major Healing Potion +(16938,1,2,1,0,-6003,1), -- Scroll of * Reference +-- --------------------------------------------------- +-- Dreghood Geomancer, NPC 16937 +-- --------------------------------------------------- +(16937,21877,70,1,0,1,1), -- Netherweave Cloth +(16937,27854,11,1,0,1,1), -- Mag'har Grainbread +(16937,28399,3,1,0,1,1), -- Filtered Draenic Water +(16937,13446,2,1,0,1,1), -- Major Healing Potion +(16937,13444,1,1,0,1,1), -- Major Healing Potion +-- --------------------------------------------------- +-- Drillmaster Zurok, NPC 19312 +-- --------------------------------------------------- +(19312,21877,60,1,0,1,1), -- Netherweave Cloth +(19312,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(19312,28399,3,1,0,1,1), -- Filtered Draenic Water +(19312,13446,2,1,0,1,1), -- Major Healing Potion +(19312,13444,1,1,0,1,1), -- Major Healing Potion +(19312,5760,0.2,1,0,1,1), -- Eternium Lockbox +(19312,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Fel Canon MKI, NPC 22461 +-- --------------------------------------------------- +(22461,31944,80,1,1,1,1), -- Demonic Capacitor +(22461,31945,20,1,1,1,1), -- Shadow Circuit +-- --------------------------------------------------- +-- Fel Handler, NPC 19190 +-- --------------------------------------------------- +(19190,28513,-50,1,0,1,1), -- QItem: Demonic Rune Stone +(19190,27854,10,1,0,1,1), -- Smoked Talbuk Venison +(19190,28399,5,1,0,1,1), -- Filtered Draenic Water +(19190,13446,3,1,0,1,1), -- Major Healing Potion +(19190,13444,1.5,1,0,1,1), -- Major Mana Potion +(19190,5759,0.2,1,0,1,1), -- Thorium Lockbox +(19190,1,2,1,0,-6003,1), -- Scroll of * Reference +(19190,2,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Fel Reaver, NPC 18733 +-- --------------------------------------------------- +(18733,1,100,1,0,-6002,1), -- Generic HellfirePeninsula Loot2 +-- --------------------------------------------------- +-- Felblood Initiate, NPC 24918 +-- --------------------------------------------------- +(24918,21877,75,1,0,1,3), -- Netherweave Cloth +(24918,27857,8,1,0,1,1), -- Garadar Sharp +(24918,27860,5,1,0,1,1), -- Filtered Draenic Water +(24918,22829,3,1,0,1,1), -- Super Healing Potion +(24918,22832,1.5,1,0,1,1), -- Super Healing Potion +(24918,31952,0.2,1,0,1,1), -- Khorium Lockbox +(24918,31888,0.01,1,0,1,1), -- Three of Blessings +(24918,31908,0.01,1,0,1,1), -- Three of Furies +(24918,1,80,1,0,-6002,1), -- Generic HellfirePeninsula Loot2 +-- --------------------------------------------------- +-- Felguard Destroyer, NPC 18977 +-- --------------------------------------------------- +(18977,21877,40,1,0,1,3), -- Netherweave Cloth +(18977,27854,5,1,0,1,1), -- Smoked Talbuk Venison +(18977,28399,4,1,0,1,1), -- Filtered Draenic Water +(18977,13446,2,1,0,1,1), -- Major Healing Potion +(18977,13444,1,1,0,1,1), -- Major Mana Potion +(18977,5759,0.3,1,0,1,1), -- Thorium Lockbox +(18977,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Female Kaliri Hatchling, NPC 17034 +-- --------------------------------------------------- +(17034,23588,-40,1,0,1,1), -- QItem: Kaliri Feather +(17034,25425,81,1,1,1,1), -- Molted Feather +(17034,25427,19,1,1,1,1), -- Beaten Talon +(17034,5760,0.2,1,0,1,1), -- Eternium Lockbox +(17034,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Feng, NPC 19459 +-- --------------------------------------------------- +(19459,3299,70,1,0,1,1), -- Fractured Canine +(19459,33547,30,1,0,1,1), -- Hardened Claw +(19459,5759,0.3,1,0,1,1), -- Thorium Lockbox +(19459,4583,0.3,1,0,1,1), -- Thick Furry Mane +(19459,4584,0.2,1,0,1,1), -- Large Trophy Paw +(19459,1,70,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Flamewalker Imp, NPC 19136 +-- --------------------------------------------------- +(19136,21877,92,1,0,1,1), -- Netherweave Cloth +(19136,22785,0.05,1,0,1,3), -- Felweed +-- --------------------------------------------------- +-- Force-Commander Gorax, NPC 19264 +-- --------------------------------------------------- +(19264,21877,80,1,0,1,3), -- Netherweave Cloth +(19264,27854,10,1,0,1,1), -- Smoked Talbuk Venison +(19264,28399,5,1,0,1,1), -- Filtered Draenic Water +(19264,13446,3,1,0,1,1), -- Major Healing Potion +(19264,13444,1.5,1,0,1,1), -- Major Mana Potion +(19264,5760,0.3,1,0,1,1), -- Eternium Lockbox +(19264,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Forge-Camp Legionnaire, NPC 16954 +-- --------------------------------------------------- +(16954,21877,80,1,0,1,3), -- Netherweave Cloth +(16954,27854,8,1,0,1,1), -- Smoked Talbuk Venison +(16954,28399,4,1,0,1,1), -- Filtered Draenic Water +(16954,13446,2,1,0,1,1), -- Major Healing Potion +(16954,13444,1,1,0,1,1), -- Major Mana Potion +(16954,5759,0.3,1,0,1,1), -- Thorium Lockbox +(16954,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot +(16954,2,2,1,0,-6003,1), -- Scroll of * Reference +-- --------------------------------------------------- +-- Fulgorge, NPC 18678 +-- --------------------------------------------------- +(18678,31176,0,1,1,1,1), -- Rockwurm Plate Handguards +(18678,31177,0,1,1,1,1), -- Rockwurm Scale Gauntlets +(18678,31179,0,1,1,1,1), -- Rockwurm Hide Gloves +(18678,31181,0,1,1,1,1), -- Rockwurm Hide Handwraps +(18678,25434,1,1,0,1,3), -- Fractured Carapace +(18678,25436,0.2,1,0,2,4), -- Twitching Leg +-- --------------------------------------------------- +-- Gan'arg Sapper, NPC 18827 +-- --------------------------------------------------- +(18827,21877,83,1,0,1,3), -- Netherweave Cloth +(18827,27854,8,1,0,1,1), -- Smoked Talbuk Venison +(18827,28399,4,1,0,1,1), -- Filtered Draenic Water +(18827,13446,3,1,0,1,1), -- Major Healing Potion +(18827,13444,1.5,1,0,1,1), -- Major Mana Potion +(18827,5759,0.2,1,0,1,1), -- Thorium Lockbox +(18827,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot +(18827,2,3,1,0,-6003,1), -- Scroll of * Reference +-- --------------------------------------------------- +-- Gan'arg Servant, NPC 16947 +-- --------------------------------------------------- +(16947,21877,83,1,0,1,3), -- Netherweave Cloth +(16947,27854,8,1,0,1,1), -- Smoked Talbuk Venison +(16947,28399,4,1,0,1,1), -- Filtered Draenic Water +(16947,13446,3,1,0,1,1), -- Major Healing Potion +(16947,13444,1.5,1,0,1,1), -- Major Mana Potion +(16947,5759,0.1,1,0,1,1), -- Thorium Lockbox +(16947,1,95,1,0,-6000,1), -- Generic HellfirePeninsula Loot +(16947,2,3,1,0,-6003,1), -- Scroll of * Reference +-- --------------------------------------------------- +-- Gorkan Bloodfist, NPC 16845 +-- --------------------------------------------------- +(16845,21877,3,1,0,2,3), -- Netherweave Cloth +(16845,27854,1,1,0,1,1), -- Smoked Talbuk Venison +(16845,22829,0.5,1,0,1,1), -- Super Healing Potion +(16845,1,2,1,0,-4110,1), -- Level 67 Green Items (ilvl 111) +-- --------------------------------------------------- +-- Grillok "Darkeye", NPC 19457 +-- --------------------------------------------------- +(19457,31529,-100,1,0,1,1), -- QItem: Grillok's Eyepatch +(19457,21877,45,1,0,1,3), -- Netherweave Cloth +(19457,30157,-5,1,0,1,1), -- QItem: Cursed Talisman +(19457,30425,-10,1,0,1,1), -- QItem: Bleeding Hollow Blood +(19457,27854,4,1,0,1,1), -- Smoked Talbuk Venison +(19457,28399,2,1,0,1,1), -- Filtered Draenic Water +(19457,13446,2,1,0,1,1), -- Major Healing Potion +(19457,13444,1,1,0,1,1), -- Major Mana Potion +(19457,5760,0.1,1,0,1,1), -- Eternium Lockbox +(19457,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Haal'eshi Talonguard, NPC 16967 +-- --------------------------------------------------- +(16967,21877,60,1,0,1,3), -- Netherweave Cloth +(16967,17056,42,1,0,1,1), -- Light Feather +(16967,23483,-15,1,0,1,1), -- QItem: Haal'eshi Scroll +(16967,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(16967,28399,3,1,0,1,1), -- Filtered Draenic Water +(16967,13446,2,1,0,1,1), -- Major Healing Potion +(16967,13444,1,1,0,1,1), -- Major Mana Potion +(16967,5760,0.1,1,0,1,1), -- Eternium Lockbox +(16967,1,85,1,0,-6000,1), -- Generic HellfirePeninsula Loot +(16967,2,3,1,0,-6003,1), -- Scroll of * Reference +-- --------------------------------------------------- +-- Haal'eshi Windwalker, NPC 16966 +-- --------------------------------------------------- +(16966,21877,60,1,0,1,3), -- Netherweave Cloth +(16966,17056,42,1,0,1,1), -- Light Feather +(16966,23483,-15,1,0,1,1), -- QItem: Haal'eshi Scroll +(16966,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(16966,28399,3,1,0,1,1), -- Filtered Draenic Water +(16966,13446,2,1,0,1,1), -- Major Healing Potion +(16966,13444,1,1,0,1,1), -- Major Mana Potion +(16966,5760,0.1,1,0,1,1), -- Eternium Lockbox +(16966,1,85,1,0,-6000,1), -- Generic HellfirePeninsula Loot +(16966,2,3,1,0,-6003,1), -- Scroll of * Reference +-- --------------------------------------------------- +-- Hand of Kargath, NPC 22374 +-- --------------------------------------------------- +(22374,31706,-100,1,0,1,1), -- QItem: The Head of the Hand of Kargath +(22374,21877,40,1,0,1,3), -- Netherweave Cloth +(22374,27854,4,1,0,1,1), -- Smoked Talbuk Venison +(22374,28399,2,1,0,1,1), -- Filtered Draenic Water +(22374,13446,1,1,0,1,1), -- Major Healing Potion +(22374,13444,0.5,1,0,1,1), -- Major Mana Potion +(22374,5760,0.1,1,0,1,1), -- Eternium Lockbox +(22374,1,80,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 +-- --------------------------------------------------- +-- Heckling Fel Sprite, NPC 18978 +-- --------------------------------------------------- +(18978,21877,95,1,0,1,1), -- Netherweave Cloth +-- --------------------------------------------------- +-- Hulking Helboar, NPC 16880 +-- --------------------------------------------------- +(16880,23336,-30,1,0,1,1), -- QItem: Helboar Blood Sample +(16880,23270,-5,1,0,1,1), -- QItem: Tainted Hellboar Meat +(16880,3403,82,1,1,1,1), -- Ivory Boar Tusk +(16880,25440,1.5,1,1,1,1), -- Cracked Boar Tusk +(16880,25442,0.3,1,2,1,1), -- Mangled Snout +(16880,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Illidari Taskmaster, NPC 17058 +-- --------------------------------------------------- +(17058,29113,-50,1,0,1,1), -- QItem: Demonic Essence +(17058,21877,60,1,0,1,3), -- Netherweave Cloth +(17058,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(17058,28399,3,1,0,1,1), -- Filtered Draenic Water +(17058,13446,2,1,0,1,1), -- Major Healing Potion +(17058,13444,1,1,0,1,1), -- Major Mana Potion +(17058,5760,0.2,1,0,1,1), -- Eternium Lockbox +(17058,1,90,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 +(17058,2,2,1,0,-6003,1), -- Scroll of * Reference +-- --------------------------------------------------- +-- Incandescent Fel Spark, NPC 22323 +-- --------------------------------------------------- +(22323,24508,80,1,1,1,1), -- Elemental Fragment +(22323,24511,20,1,1,1,1), -- Primordial Essence +(22323,22574,35,1,0,1,2), -- Mote of Fire +(22323,1,90,1,0,-6002,1), -- Generic HellfirePeninsula Loot2 +-- --------------------------------------------------- +-- Infernal Warbringer, NPC 19261 +-- --------------------------------------------------- +(19261,1,70,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Kaliri Matriarch, NPC 17035 +-- --------------------------------------------------- +(17035,23588,-27,1,0,1,1), -- QItem: Kaliri Feather +(17035,25425,81,1,1,1,1), -- Molted Feather +(17035,25427,19,1,1,1,1), -- Beaten Talon +(17035,5760,0.07,1,0,1,1), -- Eternium Lockbox +(17035,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Kaliri Swooper, NPC 17053 +-- --------------------------------------------------- +(17053,23588,-25,1,0,1,1), -- QItem: Kaliri Feather +(17053,25425,81,1,1,1,1), -- Molted Feather +(17053,25427,19,1,1,1,1), -- Beaten Talon +(17053,5760,0.05,1,0,1,1), -- Eternium Lockbox +(17053,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Lieutenant Commander Thalvos, NPC 16978 +-- --------------------------------------------------- +(16978,28562,-100,1,0,1,1), -- QItem: Unyielding Battle Horn +(16978,21877,55,1,0,1,1), -- Netherweave Cloth +(16978,27859,5,1,0,1,1), -- Zanger Caps +(16978,28399,2.5,1,0,1,1), -- Filtered Draenic Water +(16978,13446,2,1,0,1,1), -- Major Healing Potion +(16978,13444,2,1,0,1,1), -- Major Mana Potion +(16978,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Mag'har Grunt, NPC 16846 +-- --------------------------------------------------- +(16846,23589,-50,1,0,1,1), -- QItem: Mag'har Ancestral Beads +(16846,21877,60,1,0,1,1), -- Netherweave Cloth +(16846,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(16846,28399,3,1,0,1,1), -- Filtered Draenic Water +(16846,13446,2,1,0,1,1), -- Major Healing Potion +(16846,13444,1,1,0,1,1), -- Major Healing Potion +(16846,5759,0.15,1,0,1,1), -- Eternium Lockbox +(16846,1,2,1,0,-6003,1), -- Scroll of * Reference +(16846,2,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Mag'har Hunter, NPC 16912 +-- --------------------------------------------------- +(16912,21877,60,1,0,1,1), -- Netherweave Cloth +(16912,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(16912,28399,3,1,0,1,1), -- Filtered Draenic Water +(16912,13446,2,1,0,1,1), -- Major Healing Potion +(16912,13444,1,1,0,1,1), -- Major Healing Potion +(16912,5759,0.15,1,0,1,1), -- Eternium Lockbox +(16912,1,2,1,0,-6003,1), -- Scroll of * Reference +(16912,2,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Mag'har Watcher, NPC 16911 +-- --------------------------------------------------- +(16911,21877,60,1,0,1,1), -- Netherweave Cloth +(16911,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(16911,28399,3,1,0,1,1), -- Filtered Draenic Water +(16911,13446,2,1,0,1,1), -- Major Healing Potion +(16911,13444,1,1,0,1,1), -- Major Healing Potion +(16911,5759,0.15,1,0,1,1), -- Eternium Lockbox +(16911,1,2,1,0,-6003,1), -- Scroll of * Reference +(16911,2,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Maiden of Pain, NPC 19408 +-- --------------------------------------------------- +(19408,14047,15,1,0,1,3), -- Runecloth +(19408,27854,9,1,0,1,1), -- Smoked Talbuk Venison +(19408,28399,4,1,0,1,1), -- Filtered Draenic Water +(19408,13446,3,1,0,1,1), -- Major Healing Potion +(19408,13444,1.5,1,0,1,1), -- Major Healing Potion +(19408,5760,0.15,1,0,1,1), -- Eternium Lockbox +(19408,1,2,1,0,-6003,1), -- Scroll of * Reference +(19408,2,85,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Male Kaliri Hatchling, NPC 17039 +-- --------------------------------------------------- +(17039,23588,-25,1,0,1,1), -- QItem: Kaliri Feather +(17039,25425,81,1,1,1,1), -- Molted Feather +(17039,25427,19,1,1,1,1), -- Beaten Talon +(17039,5760,0.2,1,0,1,1), -- Eternium Lockbox +(17039,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Marauding Crust Burster, NPC 16857 +-- --------------------------------------------------- +(16857,23338,7,1,0,1,1), -- Eroded Leather Case +(16857,25434,80,1,0,1,1), -- Fractured Carapace +(16857,25436,20,1,0,1,1), -- Twitching Leg +(16857,5759,0.1,1,0,1,1), -- Thorium Lockbox +(16857,1,80,1,1,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Mekthorg the Wild, NPC 18677 +-- --------------------------------------------------- +(18677,31168,0,1,1,1,1), -- Demon-Forged Chestguard +(18677,31170,0,1,1,1,1), -- Demon-Forged Hauberk +(18677,31172,0,1,1,1,1), -- Demon-Cured Tunic +(18677,31174,0,1,1,1,1), -- Demonweave Raiment +(18677,21877,40,1,0,1,3), -- Netherweave Cloth +(18677,27854,4,1,0,1,1), -- Smoked Talbuk Venison +(18677,28399,2,1,0,1,3), -- Netherweave Cloth +-- --------------------------------------------------- +-- Mistress of Doom, NPC 19192 +-- --------------------------------------------------- +(19192,21877,80,1,0,1,3), -- Netherweave Cloth +(19192,27854,8,1,0,1,1), -- Smoked Talbuk Venison +(19192,28399,5,1,0,1,1), -- Filtered Draenic Water +(19192,13446,3,1,0,1,1), -- Major Healing Potion +(19192,13444,1.5,1,0,1,1), -- Major Healing Potion +(19192,5759,0.15,1,0,1,1), -- Eternium Lockbox +(19192,1,90,1,0,-6001,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Mo'arg Forgefiend, NPC 16946 +-- --------------------------------------------------- +(16946,21877,80,1,0,1,3), -- Netherweave Cloth +(16946,27854,9,1,0,1,1), -- Smoked Talbuk Venison +(16946,28399,4,1,0,1,1), -- Filtered Draenic Water +(16946,13446,3,1,0,1,1), -- Major Healing Potion +(16946,13444,1.5,1,0,1,1), -- Major Healing Potion +(16946,5760,0.15,1,0,1,1), -- Eternium Lockbox +(16946,1,2,1,0,-6003,1), -- Scroll of * Reference +(16946,2,85,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Netherhound, NPC 16950 +-- --------------------------------------------------- +(16950,28513,-60,1,0,1,1), -- QItem: Demonic Rune Stone +(16950,3299,43,1,0,1,1), -- Fractured Canine +(16950,33547,17,1,0,1,1), -- Hardened Claw +(16950,4583,0.5,1,0,1,1), -- Thick Furry Mane +(16950,4584,0.2,1,0,1,1), -- Large Trophy Paw +(16950,5759,0.05,1,0,1,1), -- Thorium Lockbox +(16950,1,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Quillfang Ravager, NPC 16934 +-- --------------------------------------------------- +(16934,27674,50,1,0,1,1), -- Ravager Flesh +(16934,23965,81,1,1,1,1), -- Chipped Ravager Claw +(16934,23979,19,1,1,1,1), -- Chipped Ravager Carapace +(16934,1,85,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 +-- --------------------------------------------------- +-- Quillfang Skitterer, NPC 19189 +-- --------------------------------------------------- +(19189,27674,50,1,0,1,1), -- Ravager Flesh +(19189,23217,-4,1,0,1,1), -- QItem: Ravager Egg +(19189,23965,81,1,1,1,1), -- Chipped Ravager Claw +(19189,23979,19,1,1,1,1), -- Chipped Ravager Carapace +(19189,1,85,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 +-- --------------------------------------------------- +-- Raging Colossus, NPC 19188 +-- --------------------------------------------------- +(19188,29579,80,1,0,2,4), -- Crystalized Stone Chips +(19188,29476,19,1,0,1,1), -- Crimson Crystal Shard +(19188,29578,19,1,0,2,4), -- Crystalized Stone +(19188,1,90,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 +-- --------------------------------------------------- +-- Razorfang Hatchling, NPC 16932 +-- --------------------------------------------------- +(16932,23217,-1,1,0,1,1), -- QItem: Ravager Egg +(16932,27674,50,1,0,1,1), -- Ravager Flesh +(16932,23976,0,1,1,1,1), -- Gnarled Ravager Carapace +(16932,23977,0,1,1,1,1), -- Gnarled Ravager Fang +(16932,23978,0,1,1,1,1), -- Gnarled Ravager Claw +(16932,1,85,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 +-- --------------------------------------------------- +-- Razorfang Ravager, NPC 16933 +-- --------------------------------------------------- +(16933,23965,81,1,1,1,1), -- Chipped Ravager Claw +(16933,23979,19,1,1,1,1), -- Chipped Ravager Carapace +(16933,27674,50,1,0,1,1), -- Ravager Flesh +(16933,23217,-20,1,0,1,1), -- QItem: Ravager Egg +(16933,1,85,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 +-- --------------------------------------------------- +-- Razorsaw, NPC 20798 +-- --------------------------------------------------- +(20798,29590,55,1,0,1,1), -- Burning Legion Missive +(20798,29586,-100,1,0,1,1), -- QItem: Head of Forgefiend Razorsaw +(20798,21877,50,1,0,1,3), -- Netherweave Cloth +(20798,27854,5,1,0,1,1), -- Smoked Talbuk Venison +(20798,28399,2.5,1,0,1,1), -- Filtered Draenic Water +(20798,13446,1.5,1,0,1,1), -- Major Healing Potion +(20798,13444,0.75,1,0,1,1), -- Major Mana Potion +(20798,5760,0.15,1,0,1,1), -- Eternium Lockbox +(20798,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Ripp, NPC 19458 +-- --------------------------------------------------- +(19458,3299,70,1,0,1,1), -- Fractured Canine +(19458,33547,25,1,0,1,1), -- Hardened Claw +(19458,4583,1,1,0,1,1), -- Thick Furry Mane +(19458,4584,1,1,0,1,1), -- Large Trophy Paw +(19458,5759,0.2,1,0,1,1), -- Thorium Lockbox +(19458,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Rogue Voidwalker, NPC 16974 +-- --------------------------------------------------- +(16974,23218,-85,1,0,1,1), -- Condensed Voidwalker Essence +(16974,22577,20,1,0,1,1), -- Mote of Shadow +(16974,1,90,1,0,-6000,1), -- Generic HellfirePeninsule Loot +-- --------------------------------------------------- +-- Shattered Hand Acolyte, NPC 19415 +-- --------------------------------------------------- +(19415,21877,70,1,0,1,3), -- Netherweave Cloth +(19415,27854,9,1,0,1,1), -- Smoked Talbuk Venison +(19415,28399,4,1,0,1,1), -- Filtered Draenic Water +(19415,13446,2,1,0,1,1), -- Major Healing Potion +(19415,13444,1,1,0,1,1), -- Major Healing Potion +(19415,5760,0.2,1,0,1,1), -- Eternium Lockbox +(19415,1,2,1,0,-6003,1), -- Scroll of * Reference +(19415,2,85,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Shattered Hand Berserker, NPC 16878 +-- --------------------------------------------------- +(16878,21877,82,1,0,1,3), -- Netherweave Cloth +(16878,27854,8,1,0,1,1), -- Smoked Talbuk Venison +(16878,28399,4,1,0,1,1), -- Filtered Draenic Water +(16878,13446,3,1,0,1,1), -- Major Healing Potion +(16878,13444,1.5,1,0,1,1), -- Major Healing Potion +(16878,5760,0.2,1,0,1,1), -- Eternium Lockbox +(16878,1,2,1,0,-6003,1), -- Scroll of * Reference +(16878,2,85,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Shattered Hand Captain, NPC 16870 +-- --------------------------------------------------- +(16870,21877,80,1,0,1,3), -- Netherweave Cloth +(16870,27854,8,1,0,1,1), -- Smoked Talbuk Venison +(16870,28399,4,1,0,1,1), -- Filtered Draenic Water +(16870,13446,2,1,0,1,1), -- Major Healing Potion +(16870,13444,1,1,0,1,1), -- Major Healing Potion +(16870,5760,0.2,1,0,1,1), -- Eternium Lockbox +(16870,1,2,1,0,-6003,1), -- Scroll of * Reference +(16870,2,85,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Shattered Hand Grenadier, NPC 19295 +-- --------------------------------------------------- +(19295,21877,85,1,0,1,3), -- Netherweave Cloth +(19295,27854,9,1,0,1,1), -- Smoked Talbuk Venison +(19295,28399,4,1,0,1,1), -- Filtered Draenic Water +(19295,13446,2,1,0,1,1), -- Major Healing Potion +(19295,13444,1,1,0,1,1), -- Major Healing Potion +(19295,1,75,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Shattered Hand Grunt, NPC 16867 +-- --------------------------------------------------- +(16867,21877,80,1,0,1,3), -- Netherweave Cloth +(16867,27854,8,1,0,1,1), -- Smoked Talbuk Venison +(16867,28399,4,1,0,1,1), -- Filtered Draenic Water +(16867,13446,2,1,0,1,1), -- Major Healing Potion +(16867,13444,1,1,0,1,1), -- Major Healing Potion +(16867,5760,0.18,1,0,1,1), -- Eternium Lockbox +(16867,1,2,1,0,-6003,1), -- Scroll of * Reference +(16867,2,85,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Shattered Hand Guard, NPC 19414 +-- --------------------------------------------------- +(19414,21877,80,1,0,1,3), -- Netherweave Cloth +(19414,27854,8,1,0,1,1), -- Smoked Talbuk Venison +(19414,28399,4,1,0,1,1), -- Filtered Draenic Water +(19414,13446,3,1,0,1,1), -- Major Healing Potion +(19414,13444,1.5,1,0,1,1), -- Major Healing Potion +(19414,5760,0.18,1,0,1,1), -- Eternium Lockbox +(19414,1,2,1,0,-6003,1), -- Scroll of * Reference +(19414,2,85,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Shattered Hand Mage, NPC 19413 +-- --------------------------------------------------- +(19413,21877,60,1,0,1,3), -- Netherweave Cloth +(19413,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(19413,28399,3,1,0,1,1), -- Filtered Draenic Water +(19413,13446,2,1,0,1,1), -- Major Healing Potion +(19413,13444,1,1,0,1,1), -- Major Healing Potion +(19413,1,2,1,0,-6003,1), -- Scroll of * Reference +(19413,2,85,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Shattered Hand Neophyte, NPC 19410 +-- --------------------------------------------------- +(19410,21877,80,1,0,1,3), -- Netherweave Cloth +(19410,27854,8,1,0,1,1), -- Smoked Talbuk Venison +(19410,28399,4,1,0,1,1), -- Filtered Draenic Water +(19410,13446,2,1,0,1,1), -- Major Healing Potion +(19410,13444,1,1,0,1,1), -- Major Healing Potion +(19410,5760,0.18,1,0,1,1), -- Eternium Lockbox +(19410,1,85,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Shattered Hand Warlock, NPC 19411 +-- --------------------------------------------------- +(19411,21877,80,1,0,1,3), -- Netherweave Cloth +(19411,27854,9,1,0,1,1), -- Smoked Talbuk Venison +(19411,28399,4,1,0,1,1), -- Filtered Draenic Water +(19411,13446,2,1,0,1,1), -- Major Healing Potion +(19411,13444,1,1,0,1,1), -- Major Healing Potion +(19411,5760,0.18,1,0,1,1), -- Eternium Lockbox +(19411,1,85,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Sister of Grief, NPC 16960 +-- --------------------------------------------------- +(16960,21877,80,1,0,1,3), -- Netherweave Cloth +(16960,27854,8,1,0,1,1), -- Smoked Talbuk Venison +(16960,28399,4,1,0,1,1), -- Filtered Draenic Water +(16960,13446,2,1,0,1,1), -- Major Healing Potion +(16960,13444,1,1,0,1,1), -- Major Healing Potion +(16960,1,85,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Starving Helboar, NPC 16879 +-- --------------------------------------------------- +(16879,23270,-5,1,0,1,1), -- QItem: Tainted Helboar Meat +(16879,2295,74,1,1,1,1), -- Large Boar Tusk +(16879,44754,24,1,1,1,1), -- Severed Boar Tusk +(16879,25440,2,1,1,1,1), -- Cracked Boar Tusk +(16879,25442,0.5,1,0,1,1), -- Mangled Snout +(16879,2,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Stonescythe Alpha, NPC 16929 +-- --------------------------------------------------- +(16929,24516,81,1,1,1,1), -- Damaged Rock Flayer Talon +(16929,24517,19,1,1,1,1), -- Blood Soaked Tail +(16929,27854,4,1,0,1,1), -- Smoked Talbuk Venison +(16929,28399,2,1,0,1,1), -- Filtered Draenic Water +(16929,13446,1.2,1,0,1,1), -- Major Healing Potion +(16929,13444,0.6,1,0,1,1), -- Major Healing Potion +(16929,1,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +(16929,2,2,1,0,-6003,1), -- Scroll of * Reference +-- --------------------------------------------------- +-- Stonescythe Ambusher, NPC 16928 +-- --------------------------------------------------- +(16928,24516,81,1,1,1,1), -- Damaged Rock Flayer Talon +(16928,24517,19,1,1,1,1), -- Blood Soaked Tail +(16928,1,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Stonescythe Whelp, NPC 16927 +-- --------------------------------------------------- +(16927,24516,81,1,1,1,1), -- Damaged Rock Flayer Talon +(16927,24517,19,1,1,1,1), -- Blood Soaked Tail +(16927,27854,4,1,0,1,1), -- Smoked Talbuk Venison +(16927,28399,2,1,0,1,1), -- Filtered Draenic Water +(16927,13446,1.2,1,0,1,1), -- Major Healing Potion +(16927,13444,0.6,1,0,1,1), -- Major Healing Potion +(16927,1,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +(16927,2,2,1,0,-6003,1), -- Scroll of * Reference +-- --------------------------------------------------- +-- Subjugator Shi'aziv, NPC 19282 +-- --------------------------------------------------- +(19282,28513,-25,1,0,1,1), -- QItem: Demonic Rune Stone +(19282,27854,3,1,0,1,1), -- Smoked Talbuk Venison +(19282,28399,1.5,1,0,1,1), -- Filtered Draenic Water +(19282,13446,1,1,0,1,1), -- Major Healing Potion +(19282,13444,0.5,1,0,1,1), -- Major Healing Potion +(19282,2,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Subjugator Yalqiz, NPC 19335 +-- --------------------------------------------------- +(19335,27854,1.2,1,0,1,1), -- Smoked Talbuk Venison +(19335,28399,0.6,1,0,1,1), -- Filtered Draenic Water +(19335,1,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Tagar Spinebreaker, NPC 19443 +-- --------------------------------------------------- +(19443,21877,33,1,0,1,3), -- Netherweave Cloth +(19443,27854,4,1,0,1,1), -- Smoked Talbuk Venison +(19443,28399,2,1,0,1,1), -- Filtered Draenic Water +(19443,13446,1,1,0,1,1), -- Major Healing Potion +(19443,13444,0.5,1,0,1,1), -- Major Healing Potion +(19443,1,70,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Terrorfiend, NPC 16951 +-- --------------------------------------------------- +(16951,21877,70,1,0,1,3), -- Netherweave Cloth +(16951,23269,-25,1,0,1,1), -- Felblood Sample +(16951,27854,7,1,0,1,1), -- Smoked Talbuk Venison +(16951,28399,3.5,1,0,1,1), -- Filtered Draenic Water +(16951,13446,2,1,0,1,1), -- Major Healing Potion +(16951,13444,1,1,0,1,1), -- Major Healing Potion +(16951,1,90,1,0,-6001,1), -- Generic HellfirePeninsula Loot +(16951,2,2,1,0,-6003,1), -- Scroll of * Reference +-- --------------------------------------------------- +-- Thornfang Ravager, NPC 19349 +-- --------------------------------------------------- +(19349,27674,50,1,0,1,1), -- Ravager Flesh +(19349,23965,81,1,1,1,1), -- Chipped Ravager Claw +(19349,23979,19,1,1,1,1), -- Chipped Ravager Carapace +(19349,5760,0.1,1,0,1,1), -- Eternium Lockbox +(19349,1,85,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 +-- --------------------------------------------------- +-- Thornfang Venomspitter, NPC 19350 +-- --------------------------------------------------- +(19350,23965,81,1,1,1,1), -- Chipped Ravager Claw +(19350,23979,19,1,1,1,1), -- Chipped Ravager Carapace +(19350,1,85,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 +-- --------------------------------------------------- +-- Tunneler, NPC 16968 +-- --------------------------------------------------- +(16968,23338,5,1,0,1,1), -- Eroded Leather Case +(16968,25434,81,1,1,1,1), -- Fractured Carapace +(16968,25436,19,1,1,1,1), -- Twitching Leg +(16968,5760,0.1,1,0,1,1), -- Eternium Lockbox +(16968,1,80,1,1,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Twilight Cryomancer, NPC 26222 +-- --------------------------------------------------- +(26222,14047,85,1,0,1,2), -- Runecloth +(26222,8952,9,1,0,1,2), -- Roasted Quail +(26222,8766,4.5,1,0,1,2), -- Morning Glory Dew +(26222,13446,6,1,0,1,2), -- Major Healing Potion +(26222,13444,3,1,0,1,2), -- Major Mana Potion +(26222,1,10,1,0,-1052,1), -- Level 52 Grey reference +(26222,2,10,1,0,-1053,1), -- Level 53 Grey reference +-- --------------------------------------------------- +-- Twilight Frostblade, NPC 26223 +-- --------------------------------------------------- +(26223,14047,85,1,0,1,2), -- Runecloth +(26223,8952,9,1,0,1,2), -- Roasted Quail +(26223,8766,4.5,1,0,1,2), -- Morning Glory Dew +(26223,13446,6,1,0,1,2), -- Major Healing Potion +(26223,13444,3,1,0,1,2), -- Major Mana Potion +(26223,1,10,1,0,-1052,1), -- Level 52 Grey reference +(26223,2,10,1,0,-1053,1), -- Level 53 Grey reference +-- --------------------------------------------------- +-- Uncontrolled Voidwalker, NPC 16975 +-- --------------------------------------------------- +(16975,23218,-80,1,0,1,1), -- Condensed Voidwalker Essence +(16975,22577,20,1,0,1,1), -- Mote of Shadow +(16975,1,90,1,0,-6000,1), -- Generic HellfirePeninsule Loot +-- --------------------------------------------------- +-- Unstable Voidwalker, NPC 20145 +-- --------------------------------------------------- +(20145,29051,-100,1,0,1,1), -- QItem: Warp Nether +-- --------------------------------------------------- +-- Unyielding Footman, NPC 16904 +-- --------------------------------------------------- +(16904,21877,60,1,0,1,1), -- Netherweave Cloth +(16904,14047,20,1,0,1,3), -- Runecloth +(16904,27859,8,1,0,1,1), -- Zanger Caps +(16904,28399,4,1,0,1,1), -- Filtered Draenic Water +(16904,13446,2,1,0,1,1), -- Major Healing Potion +(16904,13444,1,1,0,1,1), -- Major Mana Potion +(16904,1,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Unyielding Knight, NPC 16906 +-- --------------------------------------------------- +(16906,28552,15,1,0,1,1), -- A Mysterious Tome +(16906,21877,60,1,0,1,1), -- Netherweave Cloth +(16906,14047,20,1,0,1,3), -- Runecloth +(16906,27859,8,1,0,1,1), -- Zanger Caps +(16906,28399,4,1,0,1,1), -- Filtered Draenic Water +(16906,13446,2,1,0,1,1), -- Major Healing Potion +(16906,13444,1,1,0,1,1), -- Major Mana Potion +(16906,1,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +(16906,2,2,1,0,-6003,1), -- Scroll of * Reference +-- --------------------------------------------------- +-- Unyielding Sorcerer, NPC 16905 +-- --------------------------------------------------- +(16905,21877,60,1,0,1,1), -- Netherweave Cloth +(16905,14047,20,1,0,1,3), -- Runecloth +(16905,27859,8,1,0,1,1), -- Zanger Caps +(16905,28399,4,1,0,1,1), -- Filtered Draenic Water +(16905,13446,2,1,0,1,1), -- Major Healing Potion +(16905,13444,1,1,0,1,1), -- Major Mana Potion +(16905,1,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +(16905,2,2,1,0,-6003,1), -- Scroll of * Reference +-- --------------------------------------------------- +-- Vacillating Voidcaller, NPC 19527 +-- --------------------------------------------------- +(19527,29161,-100,1,0,1,3), -- Void Ridge Soul Shard +(19527,22577,20,1,0,1,2), -- Mote of Shadow +(19527,1,50,1,1,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Void Baron Galaxis, NPC 16939 +-- --------------------------------------------------- +(16939,29162,-100,1,0,1,1), -- Galaxis Soul Shard +-- --------------------------------------------------- +-- Vorakem Doomspeaker, NPC 18679 +-- --------------------------------------------------- +(18679,31182,0,1,1,1,1), -- Legion Helm +(18679,31183,0,1,1,1,1), -- Legion Coif +(18679,31184,0,1,1,1,1), -- Legion Headguard +(18679,31185,0,1,1,1,1), -- Legion Crown +(18679,21877,40,1,0,1,3), -- Netherweave Cloth +(18679,27854,4,1,0,1,1), -- Smoked Talbuk Venison +(18679,28399,2.5,1,0,1,1), -- Filtered Draenic Water +(18679,13446,1,1,0,1,1), -- Major Healing Potion +(18679,13444,0.5,1,0,1,1), -- Major Healing Potion +-- --------------------------------------------------- +-- Warboss Nekrogg, NPC 19263 +-- --------------------------------------------------- +(19263,21877,90,1,0,1,1), -- Netherweave Cloth +(19263,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Warbringer Arix'Amal, NPC 19298 +-- --------------------------------------------------- +(19298,29795,-85,1,0,1,1), -- QItem: Burning Legion Gate Key +(19298,29588,50,1,0,1,1), -- Burning Legion Gate Key +(19298,21877,46,1,0,1,3), -- Netherweave Cloth +(19298,27854,5,1,0,1,1), -- Smoked Talbuk Venison +(19298,28399,2.5,1,0,1,1), -- Filtered Draenic Water +(19298,13446,1.4,1,0,1,1), -- Major Healing Potion +(19298,13444,0.7,1,0,1,1), -- Major Healing Potion +(19298,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Warlord Morkh, NPC 16964 +-- --------------------------------------------------- +(16964,30158,-100,1,0,1,1), -- QItem: Morkh's Shattered Armor +(16964,21877,35,1,0,1,1), -- Netherweave Cloth +(16964,14047,10,1,0,1,3), -- Runecloth +(16964,27854,4,1,0,1,1), -- Smoked Talbuk Venison +(16964,28399,2,1,0,1,1), -- Filtered Draenic Water +(16964,13446,1,1,0,1,1), -- Major Healing Potion +(16964,13444,0.5,1,0,1,1), -- Major Healing Potion +(16964,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Worg Master Kruush, NPC 19442 +-- --------------------------------------------------- +(19442,31374,-100,1,0,1,1), -- QItem: Worg Master's Head +(19442,30425,-25,1,0,1,1), -- QItem: Bleeding Hollow Blood +(19442,30157,-10,1,0,1,1), -- QItem: Cursed Talisman +(19442,21877,45,1,0,1,3), -- Netherweave Cloth +(19442,27854,4,1,0,1,1), -- Smoked Talbuk Venison +(19442,28399,2,1,0,1,1), -- Filtered Draenic Water +(19442,13446,1,1,0,1,1), -- Major Healing Potion +(19442,13444,0.5,1,0,1,1), -- Major Mana Potion +(19442,5759,0.1,1,0,1,1), -- Thorium Lockbox +(19442,1,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot +-- --------------------------------------------------- +-- Wrath Herald, NPC 24919 +-- --------------------------------------------------- +(24919,34259,-100,1,0,1,1), -- Demonic Blood +(24919,21877,45,1,0,1,3), -- Netherweave Cloth +(24919,27854,4,1,0,1,1), -- Smoked Talbuk Venison +(24919,27860,2,1,0,1,1), -- Purified Draenic Water +(24919,22829,1.6,1,0,1,1), -- Super Healing Potion +(24919,22832,0.8,1,0,1,1), -- Super Mana Potion +(24919,1,100,1,0,-6002,1), -- Generic HellfirePeninsula Loot2 +-- --------------------------------------------------- +-- Wrathguard, NPC 18975 +-- --------------------------------------------------- +(18975,28513,-85,1,0,1,1), -- QItem: Demonic Rune Stone +(18975,27854,8,1,0,1,1), -- Smoked Talbuk Venison +(18975,28399,4,1,0,1,1), -- Filtered Draenic Water +(18975,13446,3,1,0,1,1), -- Major Healing Potion +(18975,13444,1.5,1,0,1,1), -- Major Healing Potion +(18975,5759,0.15,1,0,1,1), -- Thorium Lockbox +(18975,1,2,1,0,-6003,1), -- Scroll of * Reference +(18975,2,90,1,0,-6000,1); -- Generic HellfirePeninsula Loot + +UPDATE `creature_template` SET `lootid`=`entry` WHERE `entry` IN (26222,26223); +DELETE FROM `reference_loot_template` WHERE `entry`=34081; \ No newline at end of file diff --git a/sql/updates/world/2012_06_02_03_creature_loot_template_zm.sql b/sql/updates/world/2012_06_02_03_creature_loot_template_zm.sql new file mode 100644 index 00000000000..d5130caf8cb --- /dev/null +++ b/sql/updates/world/2012_06_02_03_creature_loot_template_zm.sql @@ -0,0 +1,902 @@ +SET @ZM1:=6010; +-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +DELETE FROM `reference_loot_template` WHERE `entry`=@ZM1; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +(@ZM1,1,30,1,0,-4000,1), -- Grey Items level 61 (ilvl 66) +(@ZM1,2,30,1,0,-4001,1), -- Grey Items level 64 (ilvl 69) +(@ZM1,3,2,1,0,-4103,1), -- Green Items level 60 (ilvl 90) +(@ZM1,4,2,1,0,-4104,1), -- Green Items level 61 (ilvl 93) +(@ZM1,5,2,1,0,-4105,1), -- Green Items level 62 (ilvl 96) +(@ZM1,6,2,1,0,-4106,1), -- Green Items level 63 (ilvl 99) +(@ZM1,7,0.5,1,0,-4203,1), -- Blue items level 63 (ilvl 94) +(@ZM1,8,0.5,1,0,-4204,1), -- Blue items level 64 (ilvl 97) +(@ZM1,9,0.5,1,0,-4205,1), -- Blue items level 65 (ilvl 97) +(@ZM1,5760,0.5,1,0,1,1); -- Eternium Lockbox +-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +DELETE FROM `creature_loot_template` WHERE `entry` IN (18285,18119,18120,18117,20443,20444,18118,18121,19732,18283,20792,18088,20088,20090,18089,20089,20196,18127,18682,20197,18281,20293,20295,20294,18159,20442,18992,19174,18681,18116,18115,19733,20079,18087,19946,19947,18086,18122,18134,18214,20198,20270,18113,18114,19734,18129,19730,19729,18080,20290,20291,18282,20445,20292,18137,18136,18135,18130,18131,18133,20283,19706,18680,18213,18286,18212,18160,20324,20279,20280,18046,18044,18128,18280,18154,19519,18125,18340,20477,18138,18077,18079,20115,18132,19402,18124,18123,20387); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +-- "Count" Ungula, NPC 18285 +-- --------------------------------------------------- +(18285,25459,-100,1,0,1,1), -- QItem: "Count" Ungula's Mandible +(18285,25434,80,1,1,1,1), -- Fractured Carapace +(18285,25436,20,1,1,1,1), -- Twitsching Leg +(18285,24493,-10,1,0,1,1), -- QItem: Marshfang Slicer Blade +(18285,1,100,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Ango'rosh Brute, NPC 18119 +-- --------------------------------------------------- +(18119,21877,10,1,0,1,3), -- Netherweave Cloth +(18119,27854,1.2,1,0,1,1), -- Smoked Talbuk Venison +(18119,28399,0.6,1,0,1,1), -- Filtered Draenic Water +(18119,1,80,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Ango'rosh Mauler, NPC 18120 +-- --------------------------------------------------- +(18120,24240,-50,1,0,1,1), -- QItem: Box of Mushrooms +(18120,21877,70,1,0,1,3), -- Netherweave Cloth +(18120,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(18120,28399,3,1,0,1,1), -- Filtered Draenic Water +(18120,13446,2,1,0,1,1), -- Major Healing Potion +(18120,13444,1,1,0,1,1), -- Major Mana Potion +(18120,1,2,1,0,-6003,1), -- Scroll of * VI Reference +(18120,2,85,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Ango'rosh Ogre, NPC 18117 +-- --------------------------------------------------- +(18117,24238,-50,1,0,1,1), -- QItem: Mushroom Sample +(18117,21877,62,1,0,1,3), -- Netherweave Cloth +(18117,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(18117,28399,3,1,0,1,1), -- Filtered Draenic Water +(18117,13446,2,1,0,1,1), -- Major Healing Potion +(18117,13444,1,1,0,1,1), -- Major Mana Potion +(18117,1,2,1,0,-6003,1), -- Scroll of * VI Reference +(18117,2,90,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Ango'rosh Sentry, NPC 20443 +-- --------------------------------------------------- +(20443,24238,-50,1,0,1,1), -- QItem: Mushroom Sample +(20443,21877,44,1,0,1,3), -- Netherweave Cloth +(20443,27854,4,1,0,1,1), -- Smoked Talbuk Venison +(20443,28399,2,1,0,1,1), -- Filtered Draenic Water +(20443,13446,1.5,1,0,1,1), -- Major Healing Potion +(20443,13444,0.75,1,0,1,1), -- Major Mana Potion +(20443,1,80,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Ango'rosh Shadowmage, NPC 20444 +-- --------------------------------------------------- +(20444,24240,-40,1,0,1,1), -- QItem: Box of Mushrooms +(20444,21877,70,1,0,1,3), -- Netherweave Cloth +(20444,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(20444,28399,3,1,0,1,1), -- Filtered Draenic Water +(20444,13446,2,1,0,1,1), -- Major Healing Potion +(20444,13444,1,1,0,1,1), -- Major Mana Potion +(20444,2,85,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Ango'rosh Shaman, NPC 18118 +-- --------------------------------------------------- +(18118,24238,-45,1,0,1,1), -- QItem: Mushroom Sample +(18118,21877,60,1,0,1,3), -- Netherweave Cloth +(18118,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(18118,28399,3,1,0,1,1), -- Filtered Draenic Water +(18118,13446,2,1,0,1,1), -- Major Healing Potion +(18118,13444,1,1,0,1,1), -- Major Mana Potion +(18118,2,2,1,0,-6003,1), -- Scroll of * VI Reference +(18118,1,80,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Ango'rosh Souleater, NPC 18121 +-- --------------------------------------------------- +(18121,24240,-35,1,0,1,1), -- QItem: Box of Mushrooms +(18121,21877,70,1,0,1,3), -- Netherweave Cloth +(18121,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(18121,28399,3,1,0,1,1), -- Filtered Draenic Water +(18121,13446,2,1,0,1,1), -- Major Healing Potion +(18121,13444,1,1,0,1,1), -- Major Mana Potion +(18121,1,2,1,0,-6003,1), -- Scroll of * VI Reference +(18121,2,90,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Ango'rosh Warlock, NPC 19732 +-- --------------------------------------------------- +(19732,21877,82,1,0,1,3), -- Netherweave Cloth +(19732,27854,8,1,0,1,1), -- Smoked Talbuk Venison +(19732,28399,4,1,0,1,1), -- Filtered Draenic Water +(19732,13446,3,1,0,1,1), -- Major Healing Potion +(19732,13444,1.5,1,0,1,1), -- Major Mana Potion +(19732,1,100,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Blacksting, NPC 18283 +-- --------------------------------------------------- +(18283,25448,-100,1,0,1,1), -- QItem: Blacksting's Stinger +(18283,25434,80,1,1,1,1), -- Fractured Carapace +(18283,25436,18,1,1,1,1), -- Twitching Leg +(18283,24372,-10,1,0,1,1), -- QItem: Diaphanous Wing +(18283,1,100,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Bloodscale Elemental, NPC 20792 +-- --------------------------------------------------- +(20792,24507,81,1,1,1,1), -- Elemental Shard +(20792,24510,19,1,1,1,1), -- Primordial Core +(20792,22578,19,1,0,1,2), -- Mote of Water +(20792,7080,1,1,0,1,2), -- Essence of Water +(20792,1,95,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Bloodscale Enchantress, NPC 18088 +-- --------------------------------------------------- +(18088,24401,35,1,0,1,1), -- Unidentified Plant Parts +(18088,17057,33,1,0,1,1), -- Shiny Fish Scales +(18088,17058,30,1,0,1,1), -- Fish Oil +(18088,24476,19,1,0,1,1), -- Jaggal Clam +(18088,24280,-10,1,0,1,1), -- QItem: Naga Claws +(18088,24330,-1,1,0,1,1), -- QItem: Drain Schematics +(18088,27858,4,1,0,1,3), -- Sunspring Carp +(18088,28399,2,1,0,1,1), -- Filtered Draenic Water +(18088,13446,1.5,1,0,1,1), -- Major Healing Potion +(18088,13444,0.75,1,0,1,1), -- Major Mana Potion +(18088,1,2,1,0,-6003,1), -- Scroll of * VI Reference +(18088,2,90,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Bloodscale Overseer, NPC 20088 +-- --------------------------------------------------- +(20088,24280,-80,1,0,1,1), -- QItem: Naga Claws +(20088,24401,30,1,0,1,1), -- Unidentified Plant Parts +(20088,17057,25,1,0,1,1), -- Shiny Fish Scales +(20088,17058,20,1,0,1,1), -- Fish Oil +(20088,24476,15,1,0,1,1), -- Jaggal Clam +(20088,24330,-2,1,0,1,1), -- QItem: Drain Schematics +(20088,27858,4,1,0,1,3), -- Sunspring Carp +(20088,28399,2,1,0,1,1), -- Filtered Draenic Water +(20088,13446,1,1,0,1,1), -- Major Healing Potion +(20088,13444,0.5,1,0,1,1), -- Major Mana Potion +(20088,1,2,1,0,-6003,1), -- Scroll of * VI Reference +(20088,2,90,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Bloodscale Sentry, NPC 20090 +-- --------------------------------------------------- +(20090,24507,68,1,1,1,1), -- Elemental Shard +(20090,24510,17,1,1,1,1), -- Primordial Core +(20090,22578,15,1,0,1,2), -- Mote of Water +(20090,7080,1,1,0,1,2), -- Essence of Water +(20090,1,95,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Bloodscale Slavedriver, NPC 18089 +-- --------------------------------------------------- +(18089,24401,35,1,0,1,1), -- Unidentified Plant Parts +(18089,17057,33,1,0,1,1), -- Shiny Fish Scales +(18089,17058,30,1,0,1,1), -- Fish Oil +(18089,24476,19,1,0,1,1), -- Jaggal Clam +(18089,24280,-5,1,0,1,1), -- QItem: Naga Claws +(18089,24330,-0.5,1,0,1,1), -- QItem: Drain Schematics +(18089,27858,4,1,0,1,3), -- Sunspring Carp +(18089,28399,2,1,0,1,1), -- Filtered Draenic Water +(18089,13446,1.5,1,0,1,1), -- Major Healing Potion +(18089,13444,0.75,1,0,1,1), -- Major Mana Potion +(18089,1,1,1,0,-6003,1), -- Scroll of * VI Reference +(18089,2,90,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Bloodscale Wavecaller, NPC 20089 +-- --------------------------------------------------- +(20089,24280,-80,1,0,1,1), -- QItem: Naga Claws +(20089,24401,30,1,0,1,1), -- Unidentified Plant Parts +(20089,17057,25,1,0,1,1), -- Shiny Fish Scales +(20089,17058,20,1,0,1,1), -- Fish Oil +(20089,24476,15,1,0,1,1), -- Jaggal Clam +(20089,24330,-2,1,0,1,1), -- QItem: Drain Schematics +(20089,27858,4,1,0,1,3), -- Sunspring Carp +(20089,28399,2,1,0,1,1), -- Filtered Draenic Water +(20089,13446,1,1,0,1,1), -- Major Healing Potion +(20089,13444,0.5,1,0,1,1), -- Major Mana Potion +(20089,1,2,1,0,-6003,1), -- Scroll of * VI Reference +(20089,2,90,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Bloodthirsty Marshfang, NPC 20196 +-- --------------------------------------------------- +(20196,28058,81,1,1,1,1), -- Shredded Wyrm Wing +(20196,28059,19,1,1,1,1), -- Iridescent Eye +(20196,22578,19,1,0,1,1), -- Mote of Water +(20196,7080,1,1,0,1,1), -- Essence of Water +(20196,1,95,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Bog Lord, NPC 18127 +-- --------------------------------------------------- +(18127,25450,82,1,0,1,1), -- Creeping Moss +(18127,25452,18,1,1,1,1), -- Blighted Fungus +(18127,24291,-35,1,0,1,1), -- QItem: Bog Lord Tendril +(18127,24401,25,1,0,1,1), -- Unidentified Plant Parts +(18127,22575,19,1,0,1,1), -- Mote of Life +(18127,1,100,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Bog Lurker, NPC 18682 +-- --------------------------------------------------- +(18682,31247,0,1,1,1,1), -- Bog Pauldrons +(18682,31248,0,1,1,1,1), -- Bog Epaulets +(18682,31249,0,1,1,1,1), -- Bog Spaulders +(18682,31250,0,1,1,1,1), -- Bog Mantle +(18682,25456,80,1,2,1,1), -- Glowing Spores +(18682,25454,20,1,2,1,1), -- Luminescent Globe +-- --------------------------------------------------- +-- Bogflare Needler, NPC 20197 +-- --------------------------------------------------- +(20197,25434,81,1,1,1,1), -- Fractured Carapace +(20197,25436,19,1,1,1,1), -- Twitching Leg +(20197,24372,-2,1,0,1,1), -- QItem: Diaphanous Wing +(20197,29960,0.05,1,0,1,1), -- Captured Firefly +(20197,1,100,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Boglash, NPC 18281 +-- --------------------------------------------------- +(18281,25434,80,1,1,1,1), -- Fractured Carapace +(18281,25436,18,1,1,1,1), -- Twitching Leg +(18281,27676,50,1,0,1,1), -- Strange Spores +(18281,24449,-35,1,0,1,1), -- QItem: Fertile Spores +(18281,1,100,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Bogstrok Clacker, NPC 20293 +-- --------------------------------------------------- +(20293,24401,40,1,0,1,1), -- Unidentified Plant Parts +(20293,17057,33,1,0,1,1), -- Shiny Fish Scales +(20293,17058,30,1,0,1,1), -- Fish Oil +(20293,24476,20,1,0,1,1), -- Jaggal Clam +(20293,27858,4,1,0,1,3), -- Sunspring Carp +(20293,28399,2,1,0,1,1), -- Filtered Draenic Water +(20293,13446,1.5,1,0,1,1), -- Major Healing Potion +(20293,13444,0.75,1,0,1,1), -- Major Mana Potion +(20293,1,100,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Bogstrok Crusher, NPC 20295 +-- --------------------------------------------------- +(20295,24401,40,1,0,1,1), -- Unidentified Plant Parts +(20295,17057,33,1,0,1,1), -- Shiny Fish Scales +(20295,17058,30,1,0,1,1), -- Fish Oil +(20295,24476,20,1,0,1,1), -- Jaggal Clam +(20295,27858,4,1,0,1,3), -- Sunspring Carp +(20295,28399,2,1,0,1,1), -- Filtered Draenic Water +(20295,13446,1.5,1,0,1,1), -- Major Healing Potion +(20295,13444,0.75,1,0,1,1), -- Major Mana Potion +(20295,1,100,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Bogstrok Razorclaw, NPC 20294 +-- --------------------------------------------------- +(20294,24401,40,1,0,1,1), -- Unidentified Plant Parts +(20294,17057,33,1,0,1,1), -- Shiny Fish Scales +(20294,17058,30,1,0,1,1), -- Fish Oil +(20294,24476,20,1,0,1,1), -- Jaggal Clam +(20294,27858,4,1,0,1,3), -- Sunspring Carp +(20294,28399,2,1,0,1,1), -- Filtered Draenic Water +(20294,13446,1.5,1,0,1,1), -- Major Healing Potion +(20294,13444,0.75,1,0,1,1), -- Major Mana Potion +(20294,1,100,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Boss Grog'ak, NPC 18159 +-- --------------------------------------------------- +(18159,24472,-100,1,0,1,1), -- QItem: Boss Grog'ak's Head +(18159,24238,-100,1,0,1,1), -- QItem: Mushroom Sample +(18159,21877,45,1,0,1,3), -- Netherweave Cloth +(18159,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(18159,28399,3,1,0,1,1), -- Filtered Draenic Water +(18159,13446,2,1,0,1,1), -- Major Healing Potion +(18159,13444,1,1,0,1,1), -- Major Mana Potion +(18159,1,90,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Captain Bo'kar, NPC 20442 +-- --------------------------------------------------- +(20442,24240,-50,1,0,1,1), -- QItem: Box of Mushrooms +(20442,21877,80,1,0,1,3), -- Netherweave Cloth +(20442,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(20442,28399,3,1,0,1,1), -- Filtered Draenic Water +(20442,13446,2,1,0,1,1), -- Major Healing Potion +(20442,13444,1,1,0,1,1), -- Major Mana Potion +(20442,1,90,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Captain Krosh, NPC 18992 +-- --------------------------------------------------- +(18992,24240,-5,1,0,1,1), -- QItem: Box of Mushrooms +(18992,21877,25,1,0,1,3), -- Netherweave Cloth +(18992,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(18992,28399,3,1,0,1,1), -- Filtered Draenic Water +(18992,13446,2,1,0,1,1), -- Major Healing Potion +(18992,13444,1,1,0,1,1), -- Major Mana Potion +(18992,1,90,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Chieftain Mummaki, NPC 19174 +-- --------------------------------------------------- +(19174,27943,-100,1,0,1,1), -- QItem: Chieftain Mummaki's Totem +(19174,21877,25,1,0,1,3), -- Netherweave Cloth +(19174,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(19174,28399,3,1,0,1,1), -- Filtered Draenic Water +(19174,13446,2,1,0,1,1), -- Major Healing Potion +(19174,13444,1,1,0,1,1), -- Major Mana Potion +(19174,1,90,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Coilfang Emissary, NPC 18681 +-- --------------------------------------------------- +(18681,31242,0,1,1,1,1), -- Nagascale Legplates +(18681,31243,0,1,1,1,1), -- Nagascale Legguard +(18681,31244,0,1,1,1,1), -- Nagahide Pants +(18681,31245,0,1,1,1,1), -- Nagahide Leggings +(18681,17057,40,1,0,1,2), -- Shiny Fish Scales +(18681,21877,40,1,0,1,3), -- Netherweave Cloth +(18681,17058,25,1,0,1,1), -- Fish Oil +-- --------------------------------------------------- +-- Daggerfen Assassin, NPC 18116 +-- --------------------------------------------------- +(18116,21877,75,1,0,1,3), -- Netherweave Cloth +(18116,27854,8,1,0,1,1), -- Smoked Talbuk Venison +(18116,28399,4,1,0,1,1), -- Filtered Draenic Water +(18116,13446,2,1,0,1,1), -- Major Healing Potion +(18116,13444,1,1,0,1,1), -- Major Mana Potion +(18116,1,90,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Daggerfen Muckdweller, NPC 18115 +-- --------------------------------------------------- +(18115,21877,75,1,0,1,3), -- Netherweave Cloth +(18115,27854,8,1,0,1,1), -- Smoked Talbuk Venison +(18115,28399,4,1,0,1,1), -- Filtered Draenic Water +(18115,13446,2,1,0,1,1), -- Major Healing Potion +(18115,13444,1,1,0,1,1), -- Major Mana Potion +(18115,1,80,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Daggerfen Servant, NPC 19733 +-- --------------------------------------------------- +(19733,17057,33,1,0,1,1), -- Shiny Fish Scales +(19733,17058,30,1,0,1,1), -- Fish Oil +(19733,24476,20,1,0,1,1), -- Jaggal Clam +(19733,27858,4,1,0,1,3), -- Sunspring Carp +(19733,28399,2,1,0,1,1), -- Filtered Draenic Water +(19733,13446,1.5,1,0,1,1), -- Major Healing Potion +(19733,13444,0.75,1,0,1,1), -- Major Mana Potion +(19733,1,100,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Darkcrest Sentry, NPC 20079 +-- --------------------------------------------------- +(20079,24507,70,1,1,1,1), -- Elemental Shard +(20079,24510,15,1,1,1,1), -- Primordial Core +(20079,22578,15,1,0,1,2), -- Mote of Water +(20079,7080,1,1,0,1,2), -- Essence of Water +(20079,1,95,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Darkcrest Siren, NPC 18087 +-- --------------------------------------------------- +(18087,24280,-80,1,0,1,1), -- QItem: Naga Claws +(18087,24401,30,1,0,1,1), -- Unidentified Plant Parts +(18087,17057,25,1,0,1,1), -- Shiny Fish Scales +(18087,17058,20,1,0,1,1), -- Fish Oil +(18087,24476,15,1,0,1,1), -- Jaggal Clam +(18087,27858,3,1,0,1,3), -- Sunspring Carp +(18087,28399,1.5,1,0,1,1), -- Filtered Draenic Water +(18087,13446,1,1,0,1,1), -- Major Healing Potion +(18087,13444,0.5,1,0,1,1), -- Major Mana Potion +(18087,1,90,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Darkcrest Slaver, NPC 19946 +-- --------------------------------------------------- +(19946,24280,-95,1,0,1,1), -- QItem: Naga Claws +(19946,24401,30,1,0,1,1), -- Unidentified Plant Parts +(19946,17057,25,1,0,1,1), -- Shiny Fish Scales +(19946,17058,20,1,0,1,1), -- Fish Oil +(19946,24476,15,1,0,1,1), -- Jaggal Clam +(19946,27858,3,1,0,1,3), -- Sunspring Carp +(19946,28399,1.5,1,0,1,1), -- Filtered Draenic Water +(19946,13446,1,1,0,1,1), -- Major Healing Potion +(19946,13444,0.5,1,0,1,1), -- Major Mana Potion +(19946,1,2,1,0,-6003,1), -- Scroll of * VI Reference +(19946,2,90,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Darkcrest Sorceress, NPC 19947 +-- --------------------------------------------------- +(19947,24280,-95,1,0,1,1), -- QItem: Naga Claws +(19947,24401,30,1,0,1,1), -- Unidentified Plant Parts +(19947,17057,25,1,0,1,1), -- Shiny Fish Scales +(19947,17058,20,1,0,1,1), -- Fish Oil +(19947,24476,15,1,0,1,1), -- Jaggal Clam +(19947,27858,3,1,0,1,3), -- Sunspring Carp +(19947,28399,1.5,1,0,1,1), -- Filtered Draenic Water +(19947,13446,1,1,0,1,1), -- Major Healing Potion +(19947,13444,0.5,1,0,1,1), -- Major Mana Potion +(19947,1,2,1,0,-6003,1), -- Scroll of * VI Reference +(19947,2,90,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Darkcrest Taskmaster, NPC 18086 +-- --------------------------------------------------- +(18086,24280,-80,1,0,1,1), -- QItem: Naga Claws +(18086,24401,30,1,0,1,1), -- Unidentified Plant Parts +(18086,17057,25,1,0,1,1), -- Shiny Fish Scales +(18086,17058,20,1,0,1,1), -- Fish Oil +(18086,24476,15,1,0,1,1), -- Jaggal Clam +(18086,27858,3,1,0,1,3), -- Sunspring Carp +(18086,28399,1.5,1,0,1,1), -- Filtered Draenic Water +(18086,13446,1,1,0,1,1), -- Major Healing Potion +(18086,13444,0.5,1,0,1,1), -- Major Mana Potion +(18086,1,2,1,0,-6003,1), -- Scroll of * VI Reference +(18086,2,90,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Dreghood Drudge, NPC 18122 +-- --------------------------------------------------- +(18122,21877,60,1,0,1,3), -- Netherweave Cloth +(18122,24401,35,1,0,1,1), -- Unidentified Plant Parts +(18122,27854,3,1,0,1,1), -- Smoked Talbuk Venison +(18122,28399,1.5,1,0,1,1), -- Filtered Draenic Water +(18122,13446,1,1,0,1,1), -- Major Healing Potion +(18122,13444,0.5,1,0,1,1), -- Major Mana Potion +(18122,2,90,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Fen Strider, NPC 18134 +-- --------------------------------------------------- +(18134,25434,81,1,1,1,1), -- Fractured Carapace +(18134,25436,19,1,1,1,1), -- Twitching Leg +(18134,27676,50,1,0,1,1), -- Strange Spores +(18134,24449,-35,1,0,1,1), -- QItem: Fertile Spores +(18134,24427,20,1,0,1,1), -- QItem: Fen Strider Tentacle +(18134,1,100,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Fenclaw Thrasher, NPC 18214 +-- --------------------------------------------------- +(18214,25429,81,1,1,1,1), -- Grime-Encrusted Scale +(18214,25431,19,1,1,1,1), -- Ripped Fin +(18214,24486,-50,1,0,1,1), -- QItem: Fenclaw Hide +(18214,24401,25,1,0,1,1), -- Unidentified Plant Parts +(18214,24476,15,1,0,1,1), -- Jaggal Clam +(18214,24375,-15,1,0,1,1), -- QItem: Thick Hydra Scale +(18214,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Fenglow Stinger, NPC 20198 +-- --------------------------------------------------- +(20198,25434,80,1,1,1,1), -- Fractured Carapace +(20198,25436,20,1,1,1,1), -- Twitching Leg +(20198,24372,-10,1,0,1,1), -- QItem: Diaphanous Wing +(20198,24401,25,1,0,1,1), -- Unidentified Plant Parts +(20198,24485,-30,1,0,1,1), -- QItem: Marshlight Bleeder Venom +(20198,1,100,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Feralfen Druid, NPC 20270 +-- --------------------------------------------------- +(20270,24497,-25,1,0,1,1), -- QItem: Feralfen Protection Totem +(20270,21877,60,1,0,1,3), -- Netherweave Cloth +(20270,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(20270,28399,3,1,0,1,1), -- Filtered Draenic Water +(20270,13446,2,1,0,1,1), -- Major Healing Potion +(20270,13444,1,1,0,1,1), -- Major Mana Potion +(20270,1,80,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +(20270,2,2,1,0,-6003,1), -- Scroll of * VI Reference +-- --------------------------------------------------- +-- Feralfen Hunter, NPC 18113 +-- --------------------------------------------------- +(18113,24497,-10,1,0,1,1), -- QItem: Feralfen Protection Totem +(18113,21877,60,1,0,1,3), -- Netherweave Cloth +(18113,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(18113,28399,3,1,0,1,1), -- Filtered Draenic Water +(18113,13446,2,1,0,1,1), -- Major Healing Potion +(18113,13444,1,1,0,1,1), -- Major Mana Potion +(18113,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +(18113,2,2,1,0,-6003,1), -- Scroll of * VI Reference +-- --------------------------------------------------- +-- Feralfen Mystic, NPC 18114 +-- --------------------------------------------------- +(18114,24497,-40,1,0,1,1), -- QItem: Feralfen Protection Totem +(18114,21877,60,1,0,1,3), -- Netherweave Cloth +(18114,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(18114,28399,3,1,0,1,1), -- Filtered Draenic Water +(18114,13446,2,1,0,1,1), -- Major Healing Potion +(18114,13444,1,1,0,1,1), -- Major Mana Potion +(18114,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +(18114,2,2,1,0,-6003,1), -- Scroll of * VI Reference +-- --------------------------------------------------- +-- Fungal Giant, NPC 19734 +-- --------------------------------------------------- +(19734,25450,81,1,0,1,1), -- Creeping Moss +(19734,25452,19,1,1,1,1), -- Blighted Fungus +(19734,24401,25,1,0,1,1), -- Unidentified Plant Parts +(19734,22575,19,1,0,1,3), -- Mote of Life +(19734,12803,1,1,0,1,1), -- Living Essence +(19734,1,100,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Greater Sporebat, NPC 18129 +-- --------------------------------------------------- +(18129,25456,81,1,1,1,1), -- Glowing Spores +(18129,25454,19,1,1,1,1), -- Luminescent Globe +(18129,27676,50,1,0,1,1), -- Strange Spores +(18129,24449,-35,1,0,1,1), -- QItem: Fertile Spores +(18129,24401,26,1,0,1,1), -- Unidentified Plant Parts +(18129,1,95,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Ironspine Gazer, NPC 19730 +-- --------------------------------------------------- +(19730,1701,80,1,1,1,1), -- Curved Basilisk Claw +(19730,11389,17,1,1,1,1), -- Shimmering Basilisk Sking +(19730,29553,2,1,1,1,1), -- Basilisk Guts +(19730,29554,1,1,1,1,1), -- Encrusted Basilisk Skin +(19730,27677,45,1,0,1,1), -- Chunk O'Basilisk +(19730,1,100,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Ironspine Threshalisk, NPC 19729 +-- --------------------------------------------------- +(19729,1701,80,1,1,1,1), -- Curved Basilisk Claw +(19729,11389,17,1,1,1,1), -- Shimmering Basilisk Sking +(19729,29553,2,1,1,1,1), -- Basilisk Guts +(19729,29554,1,1,1,1,1), -- Encrusted Basilisk Skin +(19729,1,100,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Kataru, NPC 18080 +-- --------------------------------------------------- +(18080,21877,60,1,0,1,3), -- Netherweave Cloth +(18080,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(18080,28399,3,1,0,1,1), -- Filtered Draenic Water +(18080,13446,2,1,0,1,1), -- Major Healing Potion +(18080,13444,1,1,0,1,1), -- Major Mana Potion +(18080,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Lagoon Eel, NPC 20290 +-- --------------------------------------------------- +(20290,28058,81,1,1,1,1), -- Shredded Wyrm Wing +(20290,28059,19,1,1,1,1), -- Iridescent Eye +(20290,22578,19,1,0,1,1), -- Mote of Water +(20290,7080,1,1,0,1,1), -- Essence of Water +(20290,1,85,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Lagoon Walker, NPC 20291 +-- --------------------------------------------------- +(20291,25450,82,1,0,1,1), -- Creeping Moss +(20291,25452,18,1,1,1,1), -- Blighted Fungus +(20291,24401,25,1,0,1,1), -- Unidentified Plant Parts +(20291,22575,19,1,0,1,2), -- Mote of Life +(20291,12803,1.5,1,0,1,2), -- Living Essence +(20291,1,100,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Lord Klaq, NPC 18282 +-- --------------------------------------------------- +(18282,24401,30,1,0,1,1), -- Unidentified Plant Parts +(18282,17057,30,1,0,1,1), -- Shiny Fish Scales +(18282,17058,25,1,0,1,1), -- Fish Oil +(18282,24476,15,1,0,1,1), -- Jaggal Clam +(18282,27858,4,1,0,1,3), -- Sunspring Carp +(18282,28399,2,1,0,1,1), -- Filtered Draenic Water +(18282,13446,1,1,0,1,1), -- Major Healing Potion +(18282,13444,0.5,1,0,1,1), -- Major Mana Potion +(18282,1,90,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Mal'druk the Soulrender, NPC 20445 +-- --------------------------------------------------- +(20445,21877,72,1,0,1,3), -- Netherweave Cloth +(20445,27854,8,1,0,1,1), -- Smoked Talbuk Venison +(20445,28399,8,1,0,1,1), -- Filtered Draenic Water +(20445,13446,2,1,0,1,1), -- Major Healing Potion +(20445,13444,1,1,0,1,1), -- Major Mana Potion +(20445,1,100,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Marsh Baron Brok, NPC 20292 +-- --------------------------------------------------- +(20292,25450,80,1,0,1,1), -- Creeping Moss +(20292,25452,20,1,1,1,1), -- Blighted Fungus +(20292,24401,25,1,0,1,1), -- Unidentified Plant Parts +(20292,22575,19,1,0,1,2), -- Mote of Life +(20292,12803,1,1,0,1,2), -- Living Essence +(20292,1,100,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Marsh Dredger, NPC 18137 +-- --------------------------------------------------- +(18137,24401,35,1,0,1,1), -- Unidentified Plant Parts +(18137,17057,33,1,0,1,1), -- Shiny Fish Scales +(18137,17058,30,1,0,1,1), -- Fish Oil +(18137,24476,20,1,0,1,1), -- Jaggal Clam +(18137,27858,4,1,0,1,3), -- Sunspring Carp +(18137,28399,2,1,0,1,1), -- Filtered Draenic Water +(18137,13446,1,1,0,1,1), -- Major Healing Potion +(18137,13444,0.5,1,0,1,1), -- Major Mana Potion +(18137,1,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +(18137,2,2,1,0,-6003,1), -- Scroll of * VI Reference +-- --------------------------------------------------- +-- Marsh Lurker, NPC 18136 +-- --------------------------------------------------- +(18136,24401,35,1,0,1,1), -- Unidentified Plant Parts +(18136,17057,33,1,0,1,1), -- Shiny Fish Scales +(18136,17058,30,1,0,1,1), -- Fish Oil +(18136,24476,20,1,0,1,1), -- Jaggal Clam +(18136,27858,4,1,0,1,3), -- Sunspring Carp +(18136,28399,2,1,0,1,1), -- Filtered Draenic Water +(18136,13446,1,1,0,1,1), -- Major Healing Potion +(18136,13444,0.5,1,0,1,1), -- Major Mana Potion +(18136,1,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +(18136,2,2,1,0,-6003,1), -- Scroll of * VI Reference +-- --------------------------------------------------- +-- Marsh Walker, NPC 18135 +-- --------------------------------------------------- +(18135,25434,81,1,1,1,1), -- Fractured Carapace +(18135,25436,19,1,1,1,1), -- Twitching Leg +(18135,27676,50,1,0,1,1), -- Strange Spores +(18135,24449,-35,1,0,1,1), -- QItem: Fertile Spores +(18135,1,100,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Marshfang Ripper, NPC 18130 +-- --------------------------------------------------- +(18130,25434,81,1,1,1,1), -- Fractured Carapace +(18130,25436,19,1,1,1,1), -- Twitching Leg +(18130,24401,25,1,0,1,1), -- Unidentified Plant Parts +(18130,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Marshfang Slicer, NPC 18131 +-- --------------------------------------------------- +(18131,24493,-100,1,0,1,1), -- QItem: Marshfang Slicer Blade +(18131,25434,81,1,1,1,1), -- Fractured Carapace +(18131,25436,19,1,1,1,1), -- Twitching Leg +(18131,24401,25,1,0,1,1), -- Unidentified Plant Parts +(18131,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Marshlight Bleeder, NPC 18133 +-- --------------------------------------------------- +(18133,25434,80,1,1,1,1), -- Fractured Carapace +(18133,25436,20,1,1,1,1), -- Twitching Leg +(18133,24401,25,1,0,1,1), -- Unidentified Plant Parts +(18133,24372,-10,1,0,1,1), -- QItem: Diaphanous Wing +(18133,24485,-30,1,0,1,1), -- QItem: Marshlight Bleeder Venom +(18133,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Marshrock Stomper, NPC 20283 +-- --------------------------------------------------- +(20283,1701,80,1,1,1,1), -- Curved Basilisk Claw +(20283,11389,17,1,1,1,1), -- Shimmering Basilisk Sking +(20283,29553,2,1,1,1,1), -- Basilisk Guts +(20283,29554,1,1,1,1,1), -- Encrusted Basilisk Skin +(20283,27677,45,1,0,1,1), -- Chunk O'Basilisk +(20283,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Marshrock Threshalisk, NPC 19706 +-- --------------------------------------------------- +(19706,1701,81,1,1,1,1), -- Curved Basilisk Claw +(19706,11389,18,1,1,1,1), -- Shimmering Basilisk Sking +(19706,29553,1,1,1,1,1), -- Basilisk Guts +(19706,27677,50,1,0,1,1), -- Chunk O'Basilisk +(19706,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Marticar, NPC 18680 +-- --------------------------------------------------- +(18680,31254,100,1,0,1,1), -- Striderhide Cloak +(18680,25456,80,1,1,2,4), -- Glowing Spores +(18680,25454,20,1,1,2,4), -- Luminescent Glove +-- --------------------------------------------------- +-- Mire Hydra, NPC 18213 +-- --------------------------------------------------- +(18213,25429,81,1,1,1,1), -- Grime-Encrusted Scale +(18213,25431,19,1,1,1,1), -- Ripped Fin +(18213,24375,-100,1,0,1,1), -- QItem: Thick Hydra Scale +(18213,24401,25,1,0,1,1), -- Unidentified Plant Parts +(18213,24476,15,1,0,1,1), -- Jaggal Clam +(18213,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Mragesh, NPC 18286 +-- --------------------------------------------------- +(18286,25429,81,1,1,1,1), -- Grime-Encrusted Scale +(18286,25431,19,1,1,1,1), -- Ripped Fin +(18286,24401,25,1,0,1,1), -- Unidentified Plant Parts +(18286,24476,15,1,0,1,1), -- Jaggal Clam +(18286,1,100,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Mudfin Frenzy, NPC 18212 +-- --------------------------------------------------- +(18212,25429,80,1,1,1,1), -- Grime-Encrusted Scale +(18212,25431,20,1,1,1,1), -- Ripped Fin +(18212,24401,25,1,0,1,1), -- Unidentified Plant Parts +(18212,1,10,1,0,-4000,1), -- Grey lvl 61 Item +(18212,2,10,1,0,-4001,1), -- Grey lvl 64 Item +-- --------------------------------------------------- +-- Overlord Gorefist, NPC 18160 +-- --------------------------------------------------- +(18160,24240,-20,1,0,1,1), -- QItem: Box of Mushrooms +(18160,21877,55,1,0,1,3), -- Netherweave Cloth +(18160,27854,6,1,0,1,1), -- Smoked Talbuk Venison +(18160,28399,3,1,0,1,1), -- Filtered Draenic Water +(18160,13446,2,1,0,1,1), -- Major Healing Potion +(18160,13444,1,1,0,1,1), -- Major Mana Potion +(18160,2,85,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Parched Hydra, NPC 20324 +-- --------------------------------------------------- +(20324,25429,81,1,1,1,1), -- Grime-Encrusted Scale +(20324,25431,19,1,1,1,1), -- Ripped Fin +(20324,24401,25,1,0,1,1), -- Unidentified Plant Parts +(20324,24375,-100,1,0,1,1), -- QItem: Thick Hydra Scale +(20324,24476,15,1,0,1,1), -- Jaggal Clam +(20324,29480,-15,1,0,1,1), -- QItem: Parched Hydra Sample +(20324,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Ragestone Threshalisk, NPC 20279 +-- --------------------------------------------------- +(20279,1701,80,1,1,1,1), -- Curved Basilisk Claw +(20279,11389,17,1,1,1,1), -- Shimmering Basilisk Sking +(20279,29553,2,1,1,1,1), -- Basilisk Guts +(20279,29554,1,1,1,1,1), -- Encrusted Basilisk Skin +(20279,27677,45,1,0,1,1), -- Chunk O'Basilisk +(20279,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Ragestone Trampler, NPC 20280 +-- --------------------------------------------------- +(20280,1701,80,1,1,1,1), -- Curved Basilisk Claw +(20280,11389,17,1,1,1,1), -- Shimmering Basilisk Sking +(20280,29553,2,1,1,1,1), -- Basilisk Guts +(20280,29554,1,1,1,1,1), -- Encrusted Basilisk Skin +(20280,27677,45,1,0,1,1), -- Chunk O'Basilisk +(20280,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Rajah Haghazed, NPC 18046 +-- --------------------------------------------------- +(18046,24280,-65,1,0,1,1), -- QItem: Naga Claws +(18046,24476,26,1,0,1,1), -- Jaggal Clam +(18046,17057,25,1,0,1,1), -- Shiny Fish Scales +(18046,17058,20,1,0,1,1), -- Fish Oil +(18046,27858,4,1,0,1,3), -- Sunspring Carp +(18046,28399,2,1,0,1,1), -- Filtered Draenic Water +(18046,13446,1,1,0,1,1), -- Major Healing Potion +(18046,13444,0.5,1,0,1,1), -- Major Mana Potion +(18046,2,90,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Rajis Fyashe, NPC 18044 +-- --------------------------------------------------- +(18044,24280,-65,1,0,1,1), -- QItem: Naga Claws +(18044,24476,26,1,0,1,1), -- Jaggal Clam +(18044,17057,25,1,0,1,1), -- Shiny Fish Scales +(18044,17058,20,1,0,1,1), -- Fish Oil +(18044,27858,4,1,0,1,3), -- Sunspring Carp +(18044,28399,2,1,0,1,1), -- Filtered Draenic Water +(18044,13446,1,1,0,1,1), -- Major Healing Potion +(18044,13444,0.5,1,0,1,1), -- Major Mana Potion +(18044,2,90,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Sporebat, NPC 18128 +-- --------------------------------------------------- +(18128,25456,80,1,1,1,1), -- Glowing Spores +(18128,25454,20,1,1,1,1), -- Luminescent Globe +(18128,27676,50,1,0,1,1), -- Strange Spores +(18128,24449,-35,1,0,1,1), -- QItem: Fertile Spores +(18128,24401,26,1,0,1,1), -- Unidentified Plant Parts +(18128,24426,-20,1,0,1,1), -- QItem: Sporebat Eye +(18128,1,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Sporewing, NPC 18280 +-- --------------------------------------------------- +(18280,25456,80,1,1,1,1), -- Glowing Spores +(18280,25454,20,1,1,1,1), -- Luminescent Globe +(18280,27676,50,1,0,1,1), -- Strange Spores +(18280,24449,-35,1,0,1,1), -- QItem: Fertile Spores +(18280,24401,26,1,0,1,1), -- Unidentified Plant Parts +(18280,1,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Ssslith, NPC 18154 +-- --------------------------------------------------- +(18154,24476,30,1,0,1,1), -- Jaggal Clam +(18154,17057,25,1,0,1,1), -- Shiny Fish Scales +(18154,17058,20,1,0,1,1), -- Fish Oil +(18154,27858,4,1,0,1,3), -- Sunspring Carp +(18154,28399,2,1,0,1,1), -- Filtered Draenic Water +(18154,1,100,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Starving Bog Lord, NPC 19519 +-- --------------------------------------------------- +(19519,25450,80,1,0,1,1), -- Creeping Moss +(19519,25452,20,1,1,1,1), -- Blighted Fungus +(19519,24291,-20,1,0,1,1), -- QItem: Bog Lord Tendril +(19519,24401,25,1,0,1,1), -- Unidentified Plant Parts +(19519,22575,19,1,0,1,1), -- Mote of Life +(19519,12803,1,1,0,1,1), -- Living Essence +(19519,1,100,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Starving Fungal Giant, NPC 18125 +-- --------------------------------------------------- +(18125,25450,80,1,0,1,1), -- Creeping Moss +(18125,25452,20,1,1,1,1), -- Blighted Fungus +(18125,24291,-20,1,0,1,1), -- QItem: Bog Lord Tendril +(18125,24401,25,1,0,1,1), -- Unidentified Plant Parts +(18125,22575,19,1,0,1,1), -- Mote of Life +(18125,12803,1,1,0,1,1), -- Living Essence +(18125,1,100,1,0,-6010,1), -- Generic Zangermarsh Loot +-- --------------------------------------------------- +-- Steam Pump Overseer, NPC 18340 +-- --------------------------------------------------- +(18340,24280,-45,1,0,1,1), -- QItem: Naga Claws +(18340,24401,35,1,0,1,1), -- Unidentified Plant Parts +(18340,17057,30,1,0,1,1), -- Shiny Fish Scales +(18340,17058,25,1,0,1,1), -- Fish Oil +(18340,24476,15,1,0,1,1), -- Jaggal Clam +(18340,24330,-40,1,0,1,1), -- QItem: Drain Schematics +(18340,27858,4,1,0,1,3), -- Sunspring Carp +(18340,28399,2,1,0,1,1), -- Filtered Draenic Water +(18340,13446,1.5,1,0,1,1), -- Major Healing Potion +(18340,13444,0.75,1,0,1,1), -- Major Mana Potion +(18340,1,2,1,0,-6003,1), -- Scroll of * VI Reference +(18340,2,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Terrorclaw, NPC 20477 +-- --------------------------------------------------- +(20477,17057,34,1,0,1,1), -- Shiny Fish Scales +(20477,24401,34,1,0,1,1), -- Unidentified Plant Parts +(20477,17058,30,1,0,1,1), -- Fish Oil +(20477,24476,20,1,0,1,1), -- Jaggal Clam +(20477,27858,4,1,0,1,3), -- Sunspring Carp +(20477,28399,2,1,0,1,1), -- Filtered Draenic Water +(20477,13446,1.5,1,0,1,1), -- Major Healing Potion +(20477,13444,0.75,1,0,1,1), -- Major Mana Potion +(20477,1,90,1,0,-6001,1), -- Generic HellfirePeninsula Loot1 (YES FOR ZM) +-- --------------------------------------------------- +-- Umbrafen Eel, NPC 18138 +-- --------------------------------------------------- +(18138,25429,80,1,1,1,1), -- Grime-Encrusted Scale +(18138,25431,20,1,1,1,1), -- Ripped Fin +(18138,24374,-40,1,0,1,1), -- QItem: Eel Filet +(18138,1,90,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Umbrafen Oracle, NPC 18077 +-- --------------------------------------------------- +(18077,21877,80,1,0,1,3), -- Netherweave Cloth +(18077,27854,8,1,0,1,1), -- Smoked Talbuk Venison +(18077,28399,4,1,0,1,1), -- Filtered Draenic Water +(18077,13446,2,1,0,1,1), -- Major Healing Potion +(18077,13444,1,1,0,1,1), -- Major Mana Potion +(18077,2,2,1,0,-6003,1), -- Scroll of * VI Reference +(18077,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Umbrafen Seer, NPC 18079 +-- --------------------------------------------------- +(18079,21877,80,1,0,1,3), -- Netherweave Cloth +(18079,27854,8,1,0,1,1), -- Smoked Talbuk Venison +(18079,28399,4,1,0,1,1), -- Filtered Draenic Water +(18079,13446,2,1,0,1,1), -- Major Healing Potion +(18079,13444,1,1,0,1,1), -- Major Mana Potion +(18079,2,2,1,0,-6003,1), -- Scroll of * VI Reference +(18079,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Umbrafen Witchdoctor, NPC 20115 +-- --------------------------------------------------- +(20115,21877,80,1,0,1,3), -- Netherweave Cloth +(20115,27854,8,1,0,1,1), -- Smoked Talbuk Venison +(20115,28399,4,1,0,1,1), -- Filtered Draenic Water +(20115,13446,2,1,0,1,1), -- Major Healing Potion +(20115,13444,1,1,0,1,1), -- Major Mana Potion +(20115,2,2,1,0,-6003,1), -- Scroll of * VI Reference +(20115,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Umbraglow Stinger, NPC 18132 +-- --------------------------------------------------- +(18132,25434,80,1,1,1,1), -- Fractured Carapace +(18132,25436,20,1,1,1,1), -- Twitching Leg +(18132,24372,-40,1,0,1,1), -- QItem: Diaphanous Wing +(18132,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Withered Bog Lord, NPC 19402 +-- --------------------------------------------------- +(19402,25450,80,1,0,1,1), -- Creeping Moss +(19402,25452,20,1,1,1,1), -- Blighted Fungus +(19402,24291,-30,1,0,1,1), -- QItem: Bog Lord Tendril +(19402,24401,25,1,0,1,1), -- Unidentified Plant Parts +(19402,22575,19,1,0,1,1), -- Mote of Life +(19402,29481,-15,1,0,1,1), -- QItem: Withered Bog Lord Sample +(19402,12803,1,1,0,1,1), -- Living Essence +(19402,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Withered Giant, NPC 18124 +-- --------------------------------------------------- +(18124,25450,80,1,0,1,1), -- Creeping Moss +(18124,25452,20,1,1,1,1), -- Blighted Fungus +(18124,24401,25,1,0,1,1), -- Unidentified Plant Parts +(18124,24291,-20,1,0,1,1), -- QItem: Bog Lord Tendril +(18124,22575,19,1,0,1,1), -- Mote of Life +(18124,24373,-5,1,0,1,1), -- QItem: Scout Jyoba's Report +(18124,24483,2,1,0,1,1), -- Withered Basidium Ally +(18124,24484,2,1,0,1,1), -- Withered Basidium Horde +(18124,12803,1,1,0,1,1), -- Living Essence +(18124,1,100,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Wrekt Slave, NPC 18123 +-- --------------------------------------------------- +(18123,21877,75,1,0,1,3), -- Netherweave Cloth +(18123,27854,8,1,0,1,1), -- Smoked Talbuk Venison +(18123,28399,4,1,0,1,1), -- Filtered Draenic Water +(18123,13446,2,1,0,1,1), -- Major Healing Potion +(18123,13444,1,1,0,1,1), -- Major Mana Potion +(18123,2,2,1,0,-6003,1), -- Scroll of * VI Reference +(18123,1,80,1,0,-6000,1), -- Generic HellfirePeninsula Loot (YES FOR ZM) +-- --------------------------------------------------- +-- Young Sporebat, NPC 20387 +-- --------------------------------------------------- +(20387,25456,80,1,1,1,1), -- Glowing Spores +(20387,25454,20,1,1,1,1), -- Luminescent Globe +(20387,27676,50,1,0,1,1), -- Strange Spores +(20387,24401,26,1,0,1,1), -- Unidentified Plant Parts +(20387,1,90,1,0,-6000,1); -- Generic HellfirePeninsula Loot (YES FOR ZM) \ No newline at end of file diff --git a/sql/updates/world/2012_06_02_03_reference_loot_template.sql b/sql/updates/world/2012_06_02_03_reference_loot_template.sql new file mode 100644 index 00000000000..c712cbe18bd --- /dev/null +++ b/sql/updates/world/2012_06_02_03_reference_loot_template.sql @@ -0,0 +1,791 @@ +SET @Grey := 1001; -- reference starting value TDB Field +DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN @Grey AND @Grey+53; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- level 52 Grey Items ilvl 57 +(@Grey+51,3951,0,1,1,1,1), -- Twill Vest +(@Grey+51,3976,0,1,1,1,1), -- Smooth Leather Armor +(@Grey+51,3995,0,1,1,1,1), -- Laminated Scale Cloak +(@Grey+51,8081,0,1,1,1,1), -- Light Plate Belt +(@Grey+51,8753,0,1,1,1,1), -- Smooth Leather Helmet +(@Grey+51,9186,0,1,1,1,1), -- Mind-numbing Poison III +(@Grey+51,13821,0,1,1,1,1), -- Bulky Maul +(@Grey+51,13825,0,1,1,1,1), -- Primed Musket +-- level 53 Grey Items ilvl 58 +(@Grey+52,3948,0,1,1,1,1), -- Twill Gloves +(@Grey+52,3973,0,1,1,1,1), -- Smooth Leather Gloves +(@Grey+52,3994,0,1,1,1,1), -- Laminated Scale Bracers +(@Grey+52,8080,0,1,1,1,1), -- Light Plate Chestpiece +(@Grey+52,13817,0,1,1,1,1); -- Tapered Greatsword +-- -------------------------------------------------------- +-- TBC_Greys_References +-- -------------------------------------------------------- +SET @GreyTBC := 4000; -- reference starting value TDB Field +DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN @GreyTBC AND @GreyTBC+2; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- level 61 Greys, ilvl 66 (32 items) +(@GreyTBC,24576,0,1,1,1,1), -- Loosely Threaded Belt +(@GreyTBC,24577,0,1,1,1,1), -- Loosely Threaded Boots +(@GreyTBC,24578,0,1,1,1,1), -- Loosely Threaded Bracers +(@GreyTBC,24580,0,1,1,1,1), -- Loosely Threaded Hat +(@GreyTBC,24782,0,1,1,1,1), -- Loosely Threaded Gloves +(@GreyTBC,25338,0,1,1,1,1), -- Loosely Threaded Pants +(@GreyTBC,25339,0,1,1,1,1), -- Loosely Threaded Shoulderpads +(@GreyTBC,25340,0,1,1,1,1), -- Loosely Threaded Vest +(@GreyTBC,25349,0,1,1,1,1), -- Moldy Leather Armor +(@GreyTBC,25350,0,1,1,1,1), -- Moldy Leather Belt +(@GreyTBC,25351,0,1,1,1,1), -- Moldy Leather Boots +(@GreyTBC,25352,0,1,1,1,1), -- Moldy Leather Bracers +(@GreyTBC,25353,0,1,1,1,1), -- Moldy Leather Gloves +(@GreyTBC,25354,0,1,1,1,1), -- Moldy Leather Helmet +(@GreyTBC,25355,0,1,1,1,1), -- Moldy Leather Pants +(@GreyTBC,25356,0,1,1,1,1), -- Moldy Leather Shoulderpads +(@GreyTBC,25365,0,1,1,1,1), -- Eroded Mail Armor +(@GreyTBC,25366,0,1,1,1,1), -- Eroded Mail Belt +(@GreyTBC,25367,0,1,1,1,1), -- Eroded Mail Boots +(@GreyTBC,25368,0,1,1,1,1), -- Eroded Mail Bracers +(@GreyTBC,25369,0,1,1,1,1), -- Eroded Mail Circlet +(@GreyTBC,25370,0,1,1,1,1), -- Eroded Mail Gloves +(@GreyTBC,25371,0,1,1,1,1), -- Eroded Mail Pants +(@GreyTBC,25372,0,1,1,1,1), -- Eroded Mail Shoulderpads +(@GreyTBC,25381,0,1,1,1,1), -- Tarnished Plate Belt +(@GreyTBC,25382,0,1,1,1,1), -- Tarnished Plate Boots +(@GreyTBC,25383,0,1,1,1,1), -- Tarnished Plate Bracers +(@GreyTBC,25384,0,1,1,1,1), -- Tarnished Plate Chestpiece +(@GreyTBC,25385,0,1,1,1,1), -- Tarnished Plate Gloves +(@GreyTBC,25386,0,1,1,1,1), -- Tarnished Plate Helmet +(@GreyTBC,25387,0,1,1,1,1), -- Tarnished Plate Pants +(@GreyTBC,25388,0,1,1,1,1), -- Tarnished Plate Shoulderpads +-- level 64 Greys, ilvl 69 (10 items) +(@GreyTBC+1,25397,0,1,1,1,1), -- Eroded Axe +(@GreyTBC+1,25398,0,1,1,1,1), -- Stone Reaper +(@GreyTBC+1,25399,0,1,1,1,1), -- Deteriorating Blade +(@GreyTBC+1,25400,0,1,1,1,1), -- Tarnished Claymore +(@GreyTBC+1,25401,0,1,1,1,1), -- Corroded Mace +(@GreyTBC+1,25402,0,1,1,1,1), -- The Stoppable Force +(@GreyTBC+1,25403,0,1,1,1,1), -- Sharpened Stilleto +(@GreyTBC+1,25404,0,1,1,1,1), -- Dense War Staff +(@GreyTBC+1,25405,0,1,1,1,1), -- Rusted Musket +(@GreyTBC+1,25406,0,1,1,1,1), -- Broken Longbow +-- lvl 67 Greys, ilvl 72 (32 items) +(@GreyTBC+2,25341,0,1,1,1,1), -- Dilapidated Cloth Belt +(@GreyTBC+2,25342,0,1,1,1,1), -- Dilapidated Cloth Boots +(@GreyTBC+2,25343,0,1,1,1,1), -- Dilapidated Cloth Bracers +(@GreyTBC+2,25344,0,1,1,1,1), -- Dilapidated Cloth Gloves +(@GreyTBC+2,25345,0,1,1,1,1), -- Dilapidated Cloth Hat +(@GreyTBC+2,25346,0,1,1,1,1), -- Dilapidated Cloth Pants +(@GreyTBC+2,25347,0,1,1,1,1), -- Dilapidated Cloth Shoulderpads +(@GreyTBC+2,25348,0,1,1,1,1), -- Dilapidated Cloth Vest +(@GreyTBC+2,25357,0,1,1,1,1), -- Decaying Leather Armor +(@GreyTBC+2,25358,0,1,1,1,1), -- Decaying Leather Belt +(@GreyTBC+2,25359,0,1,1,1,1), -- Decaying Leather Boots +(@GreyTBC+2,25360,0,1,1,1,1), -- Decaying Leather Bracers +(@GreyTBC+2,25361,0,1,1,1,1), -- Decaying Leather Gloves +(@GreyTBC+2,25362,0,1,1,1,1), -- Decaying Leather Helmet +(@GreyTBC+2,25363,0,1,1,1,1), -- Decaying Leather Pants +(@GreyTBC+2,25364,0,1,1,1,1), -- Decaying Leather Shoulderpads +(@GreyTBC+2,25373,0,1,1,1,1), -- Corroded Mail Armor +(@GreyTBC+2,25374,0,1,1,1,1), -- Corroded Mail Belt +(@GreyTBC+2,25375,0,1,1,1,1), -- Corroded Mail Boots +(@GreyTBC+2,25376,0,1,1,1,1), -- Corroded Mail Bracers +(@GreyTBC+2,25377,0,1,1,1,1), -- Corroded Mail Circlet +(@GreyTBC+2,25378,0,1,1,1,1), -- Corroded Mail Gloves +(@GreyTBC+2,25379,0,1,1,1,1), -- Corroded Mail Pants +(@GreyTBC+2,25380,0,1,1,1,1), -- Corroded Mail Shoulderpads +(@GreyTBC+2,25389,0,1,1,1,1), -- Deteriorating Plate Belt +(@GreyTBC+2,25390,0,1,1,1,1), -- Deteriorating Plate Boots +(@GreyTBC+2,25391,0,1,1,1,1), -- Deteriorating Plate Bracers +(@GreyTBC+2,25392,0,1,1,1,1), -- Deteriorating Plate Chestpiece +(@GreyTBC+2,25393,0,1,1,1,1), -- Deteriorating Plate Gloves +(@GreyTBC+2,25394,0,1,1,1,1), -- Deteriorating Plate Helmet +(@GreyTBC+2,25395,0,1,1,1,1), -- Deteriorating Plate Pants +(@GreyTBC+2,25396,0,1,1,1,1); -- Deteriorating Plate Shoulderpads +-- -------------------------------------------------------- +-- TBC_Greens_References +-- -------------------------------------------------------- +SET @GreenTBC := 4100; -- reference starting value TDB Field +DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN @GreenTBC AND @GreenTBC+13; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- lvl 57 ilvl 81 greens (55 items) TBC +(@GreenTBC,25296,0,1,1,1,1), -- Absorption Dagger +(@GreenTBC,25324,0,1,1,1,1), -- Angerstaff +(@GreenTBC,25058,0,1,1,1,1), -- Anglesite Choker +(@GreenTBC,25240,0,1,1,1,1), -- Azerothian Longbow +(@GreenTBC,28531,0,1,1,1,1), -- Barbed Shrike +(@GreenTBC,24700,0,1,1,1,1), -- Bonechewer Bands +(@GreenTBC,24695,0,1,1,1,1), -- Bonechewer Chestpiece +(@GreenTBC,24693,0,1,1,1,1), -- Bonechewer Pelt-Girdle +(@GreenTBC,24698,0,1,1,1,1), -- Bonechewer Ripleggings +(@GreenTBC,24699,0,1,1,1,1), -- Bonechewer Shoulderguards +(@GreenTBC,24694,0,1,1,1,1), -- Bonechewer Shredboots +(@GreenTBC,24697,0,1,1,1,1), -- Bonechewer Skincloak +(@GreenTBC,24696,0,1,1,1,1), -- Bonechewer Spikegloves +(@GreenTBC,25114,0,1,1,1,1), -- Doomsayer's Mace +(@GreenTBC,25086,0,1,1,1,1), -- Dreamseeker Dandelion +(@GreenTBC,24920,0,1,1,1,1), -- Grimscale Armor +(@GreenTBC,24918,0,1,1,1,1), -- Grimscale Belt +(@GreenTBC,24921,0,1,1,1,1), -- Grimscale Gauntlets +(@GreenTBC,24922,0,1,1,1,1), -- Grimscale Helm +(@GreenTBC,24923,0,1,1,1,1), -- Grimscale Legguards +(@GreenTBC,24924,0,1,1,1,1), -- Grimscale Pauldrons +(@GreenTBC,24919,0,1,1,1,1), -- Grimscale Sabatons +(@GreenTBC,24925,0,1,1,1,1), -- Grimscale Vambraces +(@GreenTBC,25198,0,1,1,1,1), -- Karaborian Battle Axe +(@GreenTBC,25268,0,1,1,1,1), -- Lead-Slug Shotgun +(@GreenTBC,25100,0,1,1,1,1), -- Liege Blade +(@GreenTBC,25212,0,1,1,1,1), -- Lucky Strike Axe +(@GreenTBC,25282,0,1,1,1,1), -- Mahogany Wand +(@GreenTBC,25310,0,1,1,1,1), -- Naaru Lightmace +(@GreenTBC,25072,0,1,1,1,1), -- Northman's Shield +(@GreenTBC,24582,0,1,1,1,1), -- Outlander's Boots +(@GreenTBC,24588,0,1,1,1,1), -- Outlander's Bracers +(@GreenTBC,24585,0,1,1,1,1), -- Outlander's Facewrap +(@GreenTBC,24575,0,1,1,1,1), -- Outlander's Girdle +(@GreenTBC,24584,0,1,1,1,1), -- Outlander's Gloves +(@GreenTBC,24586,0,1,1,1,1), -- Outlander's Leggings +(@GreenTBC,24587,0,1,1,1,1), -- Outlander's Pauldrons +(@GreenTBC,24583,0,1,1,1,1), -- Outlander's Tunic +(@GreenTBC,25170,0,1,1,1,1), -- Rattan Bo Staff +(@GreenTBC,25184,0,1,1,1,1), -- Ravager Claws +(@GreenTBC,25156,0,1,1,1,1), -- Royal Crusader Sword +(@GreenTBC,25044,0,1,1,1,1), -- Rubellite Ring +(@GreenTBC,25128,0,1,1,1,1), -- Shining Mace +(@GreenTBC,25030,0,1,1,1,1), -- Silky Velvet Cloak +(@GreenTBC,25142,0,1,1,1,1), -- Telaari Longblade +(@GreenTBC,25254,0,1,1,1,1), -- Tower Crossbow +(@GreenTBC,24813,0,1,1,1,1), -- Unyielding Bindings +(@GreenTBC,24808,0,1,1,1,1), -- Unyielding Chain Vest +(@GreenTBC,24809,0,1,1,1,1), -- Unyielding Fists +(@GreenTBC,24807,0,1,1,1,1), -- Unyielding Footwraps +(@GreenTBC,24810,0,1,1,1,1), -- Unyielding Helm +(@GreenTBC,24811,0,1,1,1,1), -- Unyielding Leggings +(@GreenTBC,24812,0,1,1,1,1), -- Unyielding Spaulders +(@GreenTBC,24806,0,1,1,1,1), -- Unyielding Waistband +(@GreenTBC,25226,0,1,1,1,1), -- War Scythe +-- lvl 58 ilvl 84 greens (55 items) TBC +(@GreenTBC+1,24926,0,1,1,1,1), -- Ango'rosh Belt +(@GreenTBC+1,24928,0,1,1,1,1), -- Ango'rosh Breastplate +(@GreenTBC+1,24929,0,1,1,1,1), -- Ango'rosh Gauntlets +(@GreenTBC+1,24930,0,1,1,1,1), -- Ango'rosh Helm +(@GreenTBC+1,24931,0,1,1,1,1), -- Ango'rosh Legguards +(@GreenTBC+1,24932,0,1,1,1,1), -- Ango'rosh Pauldrons +(@GreenTBC+1,24927,0,1,1,1,1), -- Ango'rosh Sabatons +(@GreenTBC+1,24933,0,1,1,1,1), -- Ango'rosh Vambraces +(@GreenTBC+1,25241,0,1,1,1,1), -- Ashenvale Longbow +(@GreenTBC+1,25045,0,1,1,1,1), -- Azurite Ring +(@GreenTBC+1,25087,0,1,1,1,1), -- Bleeding Eye +(@GreenTBC+1,25325,0,1,1,1,1), -- Brutal Scar-Limb +(@GreenTBC+1,25101,0,1,1,1,1), -- Cross Pommel Dagger +(@GreenTBC+1,25283,0,1,1,1,1), -- Crystallized Ebony Wand +(@GreenTBC+1,25073,0,1,1,1,1), -- Emperor Shield +(@GreenTBC+1,24821,0,1,1,1,1), -- Felstone Bindings +(@GreenTBC+1,24816,0,1,1,1,1), -- Felstone Chain Vest +(@GreenTBC+1,24817,0,1,1,1,1), -- Felstone Gauntlets +(@GreenTBC+1,24815,0,1,1,1,1), -- Felstone Greaves +(@GreenTBC+1,24818,0,1,1,1,1), -- Felstone Helm +(@GreenTBC+1,24819,0,1,1,1,1), -- Felstone Leggings +(@GreenTBC+1,24820,0,1,1,1,1), -- Felstone Spaulders +(@GreenTBC+1,24814,0,1,1,1,1), -- Felstone Waistband +(@GreenTBC+1,25213,0,1,1,1,1), -- Fel-Touched Axe +(@GreenTBC+1,25059,0,1,1,1,1), -- Fire Opal Collar +(@GreenTBC+1,24590,0,1,1,1,1), -- Fireheart Boots +(@GreenTBC+1,24596,0,1,1,1,1), -- Fireheart Bracers +(@GreenTBC+1,24591,0,1,1,1,1), -- Fireheart Chestpiece +(@GreenTBC+1,24589,0,1,1,1,1), -- Fireheart Girdle +(@GreenTBC+1,24592,0,1,1,1,1), -- Fireheart Gloves +(@GreenTBC+1,24594,0,1,1,1,1), -- Fireheart Leggings +(@GreenTBC+1,24595,0,1,1,1,1), -- Fireheart Shoulderpads +(@GreenTBC+1,24593,0,1,1,1,1), -- Fireheart Skullcap +(@GreenTBC+1,25129,0,1,1,1,1), -- Giant's Leg Bone +(@GreenTBC+1,24708,0,1,1,1,1), -- Haal'eshi Bindings +(@GreenTBC+1,24702,0,1,1,1,1), -- Haal'eshi Boots +(@GreenTBC+1,24701,0,1,1,1,1), -- Haal'eshi Cord +(@GreenTBC+1,24704,0,1,1,1,1), -- Haal'eshi Gloves +(@GreenTBC+1,24705,0,1,1,1,1), -- Haal'eshi Hat +(@GreenTBC+1,24703,0,1,1,1,1), -- Haal'eshi Jerkin +(@GreenTBC+1,24706,0,1,1,1,1), -- Haal'eshi Leggings +(@GreenTBC+1,24707,0,1,1,1,1), -- Haal'eshi Pauldrons +(@GreenTBC+1,25199,0,1,1,1,1), -- Knight's War Axe +(@GreenTBC+1,25269,0,1,1,1,1), -- Longbeard Rifle +(@GreenTBC+1,25255,0,1,1,1,1), -- Ram's Head Crossbow +(@GreenTBC+1,25311,0,1,1,1,1), -- Revitalizing Hammer +(@GreenTBC+1,25115,0,1,1,1,1), -- Riversong Mace +(@GreenTBC+1,25157,0,1,1,1,1), -- Serpentlord Claymore +(@GreenTBC+1,25227,0,1,1,1,1), -- Sha'tari Longspear +(@GreenTBC+1,25143,0,1,1,1,1), -- Silver Hand Blade +(@GreenTBC+1,28532,0,1,1,1,1), -- Silver Throwing Knives +(@GreenTBC+1,25031,0,1,1,1,1), -- Silvermoon Royal Cloak +(@GreenTBC+1,25171,0,1,1,1,1), -- Straight Hardwood Staff +(@GreenTBC+1,25185,0,1,1,1,1), -- Thrasher Blades +(@GreenTBC+1,25297,0,1,1,1,1), -- Tuning Knife +-- lvl 59 ilvl 87 greens (55 items) TBC +(@GreenTBC+2,25298,0,1,1,1,1), -- Combustion Dagger +(@GreenTBC+2,24934,0,1,1,1,1), -- Darkcrest Belt +(@GreenTBC+2,24941,0,1,1,1,1), -- Darkcrest Bracers +(@GreenTBC+2,24936,0,1,1,1,1), -- Darkcrest Breastplate +(@GreenTBC+2,24937,0,1,1,1,1), -- Darkcrest Gauntlets +(@GreenTBC+2,24938,0,1,1,1,1), -- Darkcrest Helm +(@GreenTBC+2,24939,0,1,1,1,1), -- Darkcrest Legguards +(@GreenTBC+2,24940,0,1,1,1,1), -- Darkcrest Pauldrons +(@GreenTBC+2,24935,0,1,1,1,1), -- Darkcrest Sabatons +(@GreenTBC+2,25312,0,1,1,1,1), -- Glorious Scepter +(@GreenTBC+2,25270,0,1,1,1,1), -- Gnomish Assault Rifle +(@GreenTBC+2,25130,0,1,1,1,1), -- Gronn-Bone Club +(@GreenTBC+2,25228,0,1,1,1,1), -- Halberd Polearm +(@GreenTBC+2,25032,0,1,1,1,1), -- Hellfire Cloak +(@GreenTBC+2,25102,0,1,1,1,1), -- Jaedenis Dagger +(@GreenTBC+2,25200,0,1,1,1,1), -- Jagged Broadaxe +(@GreenTBC+2,25172,0,1,1,1,1), -- Jinbali Warp-Staff +(@GreenTBC+2,25088,0,1,1,1,1), -- Laughing Skull Orb +(@GreenTBC+2,25214,0,1,1,1,1), -- Mok'Nathal Battleaxe +(@GreenTBC+2,24824,0,1,1,1,1), -- Netherstalker Armor +(@GreenTBC+2,24822,0,1,1,1,1), -- Netherstalker Belt +(@GreenTBC+2,24829,0,1,1,1,1), -- Netherstalker Bracer +(@GreenTBC+2,24825,0,1,1,1,1), -- Netherstalker Gloves +(@GreenTBC+2,24823,0,1,1,1,1), -- Netherstalker Greaves +(@GreenTBC+2,24826,0,1,1,1,1), -- Netherstalker Helmet +(@GreenTBC+2,24827,0,1,1,1,1), -- Netherstalker Legguards +(@GreenTBC+2,24828,0,1,1,1,1), -- Netherstalker Mantle +(@GreenTBC+2,25116,0,1,1,1,1), -- Pneumatic War Hammer +(@GreenTBC+2,25326,0,1,1,1,1), -- Primal Lore-Staff +(@GreenTBC+2,25284,0,1,1,1,1), -- Purpleheart Wand +(@GreenTBC+2,25158,0,1,1,1,1), -- Skeletal Broadsword +(@GreenTBC+2,25144,0,1,1,1,1), -- Skettis Curved Blade +(@GreenTBC+2,25046,0,1,1,1,1), -- Spined Ring +(@GreenTBC+2,24601,0,1,1,1,1), -- Starfire Circlet +(@GreenTBC+2,24600,0,1,1,1,1), -- Starfire Gloves +(@GreenTBC+2,24603,0,1,1,1,1), -- Starfire Mantle +(@GreenTBC+2,24598,0,1,1,1,1), -- Starfire Sandals +(@GreenTBC+2,24597,0,1,1,1,1), -- Starfire Sash +(@GreenTBC+2,24602,0,1,1,1,1), -- Starfire Trousers +(@GreenTBC+2,24599,0,1,1,1,1), -- Starfire Vest +(@GreenTBC+2,24604,0,1,1,1,1), -- Starfire Wristwraps +(@GreenTBC+2,25256,0,1,1,1,1), -- Stronghold Crossbow +(@GreenTBC+2,25060,0,1,1,1,1), -- Sunstone Necklace +(@GreenTBC+2,25242,0,1,1,1,1), -- Telaari Longbow +(@GreenTBC+2,25074,0,1,1,1,1), -- Telaari Shield +(@GreenTBC+2,25186,0,1,1,1,1), -- Vampiric Handscythes +(@GreenTBC+2,24716,0,1,1,1,1), -- Vengeance Bands +(@GreenTBC+2,24709,0,1,1,1,1), -- Vengeance Belt +(@GreenTBC+2,24710,0,1,1,1,1), -- Vengeance Boots +(@GreenTBC+2,24711,0,1,1,1,1), -- Vengeance Chestpiece +(@GreenTBC+2,24712,0,1,1,1,1), -- Vengeance Gloves +(@GreenTBC+2,24713,0,1,1,1,1), -- Vengeance Helm +(@GreenTBC+2,24714,0,1,1,1,1), -- Vengeance Legguards +(@GreenTBC+2,24715,0,1,1,1,1), -- Vengeance Pauldrons +(@GreenTBC+2,28533,0,1,1,1,1), -- Wooden Boomerang +-- lvl 60 ilvl 90 greens (51 items) TBC +(@GreenTBC+3,24605,0,1,1,1,1), -- Laughing Skull Waistguard +(@GreenTBC+3,24606,0,1,1,1,1), -- Laughing Skull Boot +(@GreenTBC+3,24607,0,1,1,1,1), -- Laughing Skull Tunic +(@GreenTBC+3,24608,0,1,1,1,1), -- Laughing Skull Gloves +(@GreenTBC+3,24609,0,1,1,1,1), -- Laughing Skull Cap +(@GreenTBC+3,24610,0,1,1,1,1), -- Laughing Skull Pants +(@GreenTBC+3,24611,0,1,1,1,1), -- Laughing Skull Shoulderpads +(@GreenTBC+3,24612,0,1,1,1,1), -- Laughing Skull Bracelets +(@GreenTBC+3,24717,0,1,1,1,1), -- Dreghood Belt +(@GreenTBC+3,24718,0,1,1,1,1), -- Dreghood Boots +(@GreenTBC+3,24719,0,1,1,1,1), -- Dreghood Chestpiece +(@GreenTBC+3,24720,0,1,1,1,1), -- Dreghood Gloves +(@GreenTBC+3,24721,0,1,1,1,1), -- Dreghood Cowl +(@GreenTBC+3,24722,0,1,1,1,1), -- Dreghood Trousers +(@GreenTBC+3,24723,0,1,1,1,1), -- Dreghood Pauldrons +(@GreenTBC+3,24724,0,1,1,1,1), -- Dreghood Bands +(@GreenTBC+3,24830,0,1,1,1,1), -- Nexus-Strider Belt +(@GreenTBC+3,24831,0,1,1,1,1), -- Nexus-Strider Greaves +(@GreenTBC+3,24832,0,1,1,1,1), -- Nexus-Strider Breastplate +(@GreenTBC+3,24833,0,1,1,1,1), -- Nexus-Strider Gloves +(@GreenTBC+3,24834,0,1,1,1,1), -- Nexus-Strider Helmet +(@GreenTBC+3,24835,0,1,1,1,1), -- Nexus-Strider Legwraps +(@GreenTBC+3,24836,0,1,1,1,1), -- Nexus-Strider Mantle +(@GreenTBC+3,24837,0,1,1,1,1), -- Nexus-Strider Bracer +(@GreenTBC+3,24942,0,1,1,1,1), -- Bloodscale Belt +(@GreenTBC+3,24943,0,1,1,1,1), -- Bloodscale Sabatons +(@GreenTBC+3,24944,0,1,1,1,1), -- Bloodscale Breastplate +(@GreenTBC+3,24945,0,1,1,1,1), -- Bloodscale Gauntlets +(@GreenTBC+3,24946,0,1,1,1,1), -- Bloodscale Helm +(@GreenTBC+3,24947,0,1,1,1,1), -- Bloodscale Legguards +(@GreenTBC+3,24948,0,1,1,1,1), -- Bloodscale Pauldrons +(@GreenTBC+3,24949,0,1,1,1,1), -- Bloodscale Bracers +(@GreenTBC+3,25033,0,1,1,1,1), -- Scavenger's Cloak +(@GreenTBC+3,25047,0,1,1,1,1), -- Tourmaline Loop +(@GreenTBC+3,25061,0,1,1,1,1), -- Hiddenite Necklace +(@GreenTBC+3,25075,0,1,1,1,1), -- Hardened Steel Shield +(@GreenTBC+3,25089,0,1,1,1,1), -- Supplicant's Rod +(@GreenTBC+3,25103,0,1,1,1,1), -- Nightstalker Dagger +(@GreenTBC+3,25117,0,1,1,1,1), -- Flanged Battle Mace +(@GreenTBC+3,25131,0,1,1,1,1), -- Hateful Bludgeon +(@GreenTBC+3,25187,0,1,1,1,1), -- Shekketh Talons +(@GreenTBC+3,25201,0,1,1,1,1), -- Reaver's Sickle +(@GreenTBC+3,25215,0,1,1,1,1), -- Spiked Battle Axe +(@GreenTBC+3,25229,0,1,1,1,1), -- Partisan Polearm +(@GreenTBC+3,25243,0,1,1,1,1), -- Windtalker Bow +(@GreenTBC+3,25257,0,1,1,1,1), -- Citadel Crossbow +(@GreenTBC+3,25271,0,1,1,1,1), -- Croc-Hunter's Rifle +(@GreenTBC+3,25299,0,1,1,1,1), -- Siphoning Dagger +(@GreenTBC+3,25313,0,1,1,1,1), -- Cold-Iron Scepter +(@GreenTBC+3,25327,0,1,1,1,1), -- Frenzied Staff +(@GreenTBC+3,28534,0,1,1,1,1), -- Fel Tipped Dart +-- lvl 61 ilvl 93 greens (55 items) TBC +(@GreenTBC+4,24613,0,1,1,1,1), -- Vindicator Belt +(@GreenTBC+4,24614,0,1,1,1,1), -- Vindicator Boots +(@GreenTBC+4,24615,0,1,1,1,1), -- Vindicator Tunic +(@GreenTBC+4,24616,0,1,1,1,1), -- Vindicator Gloves +(@GreenTBC+4,24617,0,1,1,1,1), -- Vindicator Cap +(@GreenTBC+4,24618,0,1,1,1,1), -- Vindicator Pants +(@GreenTBC+4,24619,0,1,1,1,1), -- Vindicator Shoulderpads +(@GreenTBC+4,24620,0,1,1,1,1), -- Vindicator Bracers +(@GreenTBC+4,24725,0,1,1,1,1), -- Dementia Cord +(@GreenTBC+4,24726,0,1,1,1,1), -- Dementia Boots +(@GreenTBC+4,24727,0,1,1,1,1), -- Dementia Vest +(@GreenTBC+4,24728,0,1,1,1,1), -- Dementia Gloves +(@GreenTBC+4,24729,0,1,1,1,1), -- Dementia Hood +(@GreenTBC+4,24730,0,1,1,1,1), -- Dementia Trousers +(@GreenTBC+4,24731,0,1,1,1,1), -- Dementia Shoulderguards +(@GreenTBC+4,24732,0,1,1,1,1), -- Dementia Armguards +(@GreenTBC+4,24838,0,1,1,1,1), -- Wrathfin Waistband +(@GreenTBC+4,24839,0,1,1,1,1), -- Wrathfin Greaves +(@GreenTBC+4,24840,0,1,1,1,1), -- Wrathfin Armor +(@GreenTBC+4,24841,0,1,1,1,1), -- Wrathfin Gloves +(@GreenTBC+4,24842,0,1,1,1,1), -- Wrathfin Helmet +(@GreenTBC+4,24843,0,1,1,1,1), -- Wrathfin Legguards +(@GreenTBC+4,24844,0,1,1,1,1), -- Wrathfin Mantle +(@GreenTBC+4,24845,0,1,1,1,1), -- Wrathfin Bindings +(@GreenTBC+4,24950,0,1,1,1,1), -- Bogslayer Belt +(@GreenTBC+4,24951,0,1,1,1,1), -- Bogslayer Sabatons +(@GreenTBC+4,24952,0,1,1,1,1), -- Bogslayer Breastplate +(@GreenTBC+4,24953,0,1,1,1,1), -- Bogslayer Gauntlets +(@GreenTBC+4,24954,0,1,1,1,1), -- Bogslayer Helm +(@GreenTBC+4,24955,0,1,1,1,1), -- Bogslayer Legplates +(@GreenTBC+4,24956,0,1,1,1,1), -- Bogslayer Pauldrons +(@GreenTBC+4,24957,0,1,1,1,1), -- Bogslayer Bracers +(@GreenTBC+4,25034,0,1,1,1,1), -- Elementalist Cloak +(@GreenTBC+4,25048,0,1,1,1,1), -- Smoky Quartz Ring +(@GreenTBC+4,25062,0,1,1,1,1), -- Zircon Amulet +(@GreenTBC+4,25076,0,1,1,1,1), -- Screaming Shield +(@GreenTBC+4,25090,0,1,1,1,1), -- Slavehandler Rod +(@GreenTBC+4,25104,0,1,1,1,1), -- Anzac Dagger +(@GreenTBC+4,25118,0,1,1,1,1), -- Battle Star +(@GreenTBC+4,25132,0,1,1,1,1), -- Thrallmar War Hammer +(@GreenTBC+4,25146,0,1,1,1,1), -- Light-Etched Longsword +(@GreenTBC+4,25160,0,1,1,1,1), -- Vengeance Blade +(@GreenTBC+4,25174,0,1,1,1,1), -- Hanbo Staff +(@GreenTBC+4,25188,0,1,1,1,1), -- Spleenripper Claws +(@GreenTBC+4,25202,0,1,1,1,1), -- Kingly Axe +(@GreenTBC+4,25216,0,1,1,1,1), -- Ogre Splitting Axe +(@GreenTBC+4,25230,0,1,1,1,1), -- Voulge Blade +(@GreenTBC+4,25244,0,1,1,1,1), -- Viper Bow +(@GreenTBC+4,25258,0,1,1,1,1), -- Repeater Crossbow +(@GreenTBC+4,25272,0,1,1,1,1), -- PC-54 Shotgun +(@GreenTBC+4,25286,0,1,1,1,1), -- Yew Wand +(@GreenTBC+4,25300,0,1,1,1,1), -- Lightning Dagger +(@GreenTBC+4,25314,0,1,1,1,1), -- Ceremonial Hammer +(@GreenTBC+4,25328,0,1,1,1,1), -- Faerie-Kind Staff +(@GreenTBC+4,28535,0,1,1,1,1), -- Amani Throwing Axe +-- lvl 62 ilvl 96 greens (55 items) TBC +(@GreenTBC+5,24621,0,1,1,1,1), -- Slavehandler Belt +(@GreenTBC+5,24622,0,1,1,1,1), -- Slavehandler Footpads +(@GreenTBC+5,24623,0,1,1,1,1), -- Slavehandler Jerkin +(@GreenTBC+5,24624,0,1,1,1,1), -- Slavehandler Handwraps +(@GreenTBC+5,24625,0,1,1,1,1), -- Slavehandler Cap +(@GreenTBC+5,24626,0,1,1,1,1), -- Slavehandler Pants +(@GreenTBC+5,24627,0,1,1,1,1), -- Slavehandler Amice +(@GreenTBC+5,24628,0,1,1,1,1), -- Slavehandler Wristguards +(@GreenTBC+5,24733,0,1,1,1,1), -- Sunroc Waistband +(@GreenTBC+5,24734,0,1,1,1,1), -- Sunroc Boots +(@GreenTBC+5,24735,0,1,1,1,1), -- Sunroc Chestpiece +(@GreenTBC+5,24736,0,1,1,1,1), -- Sunroc Gloves +(@GreenTBC+5,24737,0,1,1,1,1), -- Sunroc Mask +(@GreenTBC+5,24738,0,1,1,1,1), -- Sunroc Pants +(@GreenTBC+5,24739,0,1,1,1,1), -- Sunroc Shoulderguards +(@GreenTBC+5,24740,0,1,1,1,1), -- Sunroc Armguards +(@GreenTBC+5,24846,0,1,1,1,1), -- Fenclaw Waistband +(@GreenTBC+5,24847,0,1,1,1,1), -- Fenclaw Footwraps +(@GreenTBC+5,24848,0,1,1,1,1), -- Fenclaw Armor +(@GreenTBC+5,24849,0,1,1,1,1), -- Fenclaw Fists +(@GreenTBC+5,24850,0,1,1,1,1), -- Fenclaw Helm +(@GreenTBC+5,24851,0,1,1,1,1), -- Fenclaw Legguards +(@GreenTBC+5,24852,0,1,1,1,1), -- Fenclaw Mantle +(@GreenTBC+5,24853,0,1,1,1,1), -- Fenclaw Bindings +(@GreenTBC+5,24958,0,1,1,1,1), -- Khan'aish Girdle +(@GreenTBC+5,24959,0,1,1,1,1), -- Khan'aish Greaves +(@GreenTBC+5,24960,0,1,1,1,1), -- Khan'aish Breastplate +(@GreenTBC+5,24961,0,1,1,1,1), -- Khan'aish Gloves +(@GreenTBC+5,24962,0,1,1,1,1), -- Khan'aish Helmet +(@GreenTBC+5,24963,0,1,1,1,1), -- Khan'aish Legplates +(@GreenTBC+5,24964,0,1,1,1,1), -- Khan'aish Epaulets +(@GreenTBC+5,24965,0,1,1,1,1), -- Khan'aish Bracers +(@GreenTBC+5,25035,0,1,1,1,1), -- Silver-Lined Cloak +(@GreenTBC+5,25049,0,1,1,1,1), -- Scheelite Ring +(@GreenTBC+5,25063,0,1,1,1,1), -- Multi-Colored Beads +(@GreenTBC+5,25077,0,1,1,1,1), -- Modani War-Shield +(@GreenTBC+5,25091,0,1,1,1,1), -- Mistyreed Torch +(@GreenTBC+5,25105,0,1,1,1,1), -- Arachnid Dagger +(@GreenTBC+5,25119,0,1,1,1,1), -- Silvermoon War-Mace +(@GreenTBC+5,25133,0,1,1,1,1), -- Stormwind Maul +(@GreenTBC+5,25147,0,1,1,1,1), -- Skystrider Katana +(@GreenTBC+5,25161,0,1,1,1,1), -- Dragon Wing Blade +(@GreenTBC+5,25175,0,1,1,1,1), -- Demoniac Longstaff +(@GreenTBC+5,25189,0,1,1,1,1), -- Ironspine Point +(@GreenTBC+5,25203,0,1,1,1,1), -- Chipped Woodchopper +(@GreenTBC+5,25217,0,1,1,1,1), -- Sundering Axe +(@GreenTBC+5,25231,0,1,1,1,1), -- Fel-Wrought Halberd +(@GreenTBC+5,25245,0,1,1,1,1), -- Razorsong Bow +(@GreenTBC+5,25259,0,1,1,1,1), -- Collapsible Crossbow +(@GreenTBC+5,25273,0,1,1,1,1), -- Sawed-Off Shotgun +(@GreenTBC+5,25287,0,1,1,1,1), -- Magician's Wand +(@GreenTBC+5,25301,0,1,1,1,1), -- Shattering Dagger +(@GreenTBC+5,25315,0,1,1,1,1), -- Restorative Mace +(@GreenTBC+5,25329,0,1,1,1,1), -- Tranquility Staff +(@GreenTBC+5,28536,0,1,1,1,1), -- Jagged Guillotine +-- lvl 63 ilvl 99 greens (55 items) TBC +(@GreenTBC+6,24629,0,1,1,1,1), -- Feralfen Sash +(@GreenTBC+6,24630,0,1,1,1,1), -- Feralfen Sandals +(@GreenTBC+6,24631,0,1,1,1,1), -- Feralfen Jerkin +(@GreenTBC+6,24632,0,1,1,1,1), -- Feralfen Hand +(@GreenTBC+6,24633,0,1,1,1,1), -- Feralfen Hood +(@GreenTBC+6,24634,0,1,1,1,1), -- Feralfen Pants +(@GreenTBC+6,24635,0,1,1,1,1), -- Feralfen Amice +(@GreenTBC+6,24636,0,1,1,1,1), -- Feralfen Cuffs +(@GreenTBC+6,24741,0,1,1,1,1), -- Ranger Belt +(@GreenTBC+6,24742,0,1,1,1,1), -- Ranger Boots +(@GreenTBC+6,24743,0,1,1,1,1), -- Ranger Jerkin +(@GreenTBC+6,24744,0,1,1,1,1), -- Ranger Gloves +(@GreenTBC+6,24745,0,1,1,1,1), -- Ranger Hat +(@GreenTBC+6,24746,0,1,1,1,1), -- Ranger Pants +(@GreenTBC+6,24747,0,1,1,1,1), -- Ranger Pauldrons +(@GreenTBC+6,24748,0,1,1,1,1), -- Ranger Armguards +(@GreenTBC+6,24854,0,1,1,1,1), -- Marshcreeper Belt +(@GreenTBC+6,24855,0,1,1,1,1), -- Marshcreeper Sludgeboots +(@GreenTBC+6,24856,0,1,1,1,1), -- Marshcreeper Fen-Vest +(@GreenTBC+6,24857,0,1,1,1,1), -- Marshcreeper Gloves +(@GreenTBC+6,24858,0,1,1,1,1), -- Marshcreeper Helm +(@GreenTBC+6,24859,0,1,1,1,1), -- Marshcreeper Leggings +(@GreenTBC+6,24860,0,1,1,1,1), -- Marshcreeper Mantle +(@GreenTBC+6,24861,0,1,1,1,1), -- Marshcreeper Bracelets +(@GreenTBC+6,24966,0,1,1,1,1), -- Talonguard Girdle +(@GreenTBC+6,24967,0,1,1,1,1), -- Talonguard Greaves +(@GreenTBC+6,24968,0,1,1,1,1), -- Talonguard Armor +(@GreenTBC+6,24969,0,1,1,1,1), -- Talonguard Gloves +(@GreenTBC+6,24970,0,1,1,1,1), -- Talonguard Helmet +(@GreenTBC+6,24971,0,1,1,1,1), -- Talonguard Legplates +(@GreenTBC+6,24972,0,1,1,1,1), -- Talonguard Epaulets +(@GreenTBC+6,24973,0,1,1,1,1), -- Talonguard Bracers +(@GreenTBC+6,25036,0,1,1,1,1), -- Boulderfist Cloak +(@GreenTBC+6,25050,0,1,1,1,1), -- Moldavite Ring +(@GreenTBC+6,25064,0,1,1,1,1), -- Amethyst Pendant +(@GreenTBC+6,25078,0,1,1,1,1), -- Zangari Shield +(@GreenTBC+6,25092,0,1,1,1,1), -- Consortium Crystal +(@GreenTBC+6,25106,0,1,1,1,1), -- Cobra Shortblade +(@GreenTBC+6,25120,0,1,1,1,1), -- Rockshard Club +(@GreenTBC+6,25134,0,1,1,1,1), -- Highmountain Hammer +(@GreenTBC+6,25148,0,1,1,1,1), -- Bone Collector Sword +(@GreenTBC+6,25162,0,1,1,1,1), -- Darkened Broadsword +(@GreenTBC+6,25176,0,1,1,1,1), -- Taiji Quarterstaff +(@GreenTBC+6,25190,0,1,1,1,1), -- Wight's Claws +(@GreenTBC+6,25204,0,1,1,1,1), -- Colossal War Axe +(@GreenTBC+6,25218,0,1,1,1,1), -- Silver-Edged Axe +(@GreenTBC+6,25232,0,1,1,1,1), -- War Glaive +(@GreenTBC+6,25246,0,1,1,1,1), -- Thalassian Compound Bow +(@GreenTBC+6,25260,0,1,1,1,1), -- Archer's Crossbow +(@GreenTBC+6,25274,0,1,1,1,1), -- Cliffjumper Shotgun +(@GreenTBC+6,25288,0,1,1,1,1), -- Conjurer's Wand +(@GreenTBC+6,25302,0,1,1,1,1), -- Soul-Drain Dagger +(@GreenTBC+6,25316,0,1,1,1,1), -- Spirit-Clad Mace +(@GreenTBC+6,25330,0,1,1,1,1), -- Starshine Staff +(@GreenTBC+6,28537,0,1,1,1,1), -- Wildhammer Throwing Axe +-- lvl 67 ilvl 111 greens (55 items) TBC +(@GreenTBC+10,24661,0,1,1,1,1), -- Shadow Council Chain +(@GreenTBC+10,24662,0,1,1,1,1), -- Shadow Council Boots +(@GreenTBC+10,24663,0,1,1,1,1), -- Shadow Council Tunic +(@GreenTBC+10,24664,0,1,1,1,1), -- Shadow Council Gloves +(@GreenTBC+10,24665,0,1,1,1,1), -- Shadow Council Cowl +(@GreenTBC+10,24666,0,1,1,1,1), -- Shadow Council Pants +(@GreenTBC+10,24667,0,1,1,1,1), -- Shadow Council Mantle +(@GreenTBC+10,24668,0,1,1,1,1), -- Shadow Council Bracer +(@GreenTBC+10,24773,0,1,1,1,1), -- Boneshredder Belt +(@GreenTBC+10,24774,0,1,1,1,1), -- Boneshredder Boots +(@GreenTBC+10,24775,0,1,1,1,1), -- Boneshredder Jerkin +(@GreenTBC+10,24776,0,1,1,1,1), -- Boneshredder Gloves +(@GreenTBC+10,24777,0,1,1,1,1), -- Boneshredder Skullcap +(@GreenTBC+10,24778,0,1,1,1,1), -- Boneshredder Britches +(@GreenTBC+10,24779,0,1,1,1,1), -- Boneshredder Shoulderguards +(@GreenTBC+10,24780,0,1,1,1,1), -- Boneshredder Wristguards +(@GreenTBC+10,24886,0,1,1,1,1), -- Skettis Belt +(@GreenTBC+10,24887,0,1,1,1,1), -- Skettis Footwraps +(@GreenTBC+10,24888,0,1,1,1,1), -- Skettis Chestpiece +(@GreenTBC+10,24889,0,1,1,1,1), -- Skettis Gauntlets +(@GreenTBC+10,24890,0,1,1,1,1), -- Skettis Helmet +(@GreenTBC+10,24891,0,1,1,1,1), -- Skettis Legguards +(@GreenTBC+10,24892,0,1,1,1,1), -- Skettis Spaulders +(@GreenTBC+10,24893,0,1,1,1,1), -- Skettis Bracer +(@GreenTBC+10,24998,0,1,1,1,1), -- Bloodfist Girdle +(@GreenTBC+10,24999,0,1,1,1,1), -- Bloodfist Greaves +(@GreenTBC+10,25000,0,1,1,1,1), -- Bloodfist Breastplate +(@GreenTBC+10,25001,0,1,1,1,1), -- Bloodfist Gloves +(@GreenTBC+10,25002,0,1,1,1,1), -- Bloodfist Helmet +(@GreenTBC+10,25003,0,1,1,1,1), -- Bloodfist Legplates +(@GreenTBC+10,25004,0,1,1,1,1), -- Bloodfist Epaulets +(@GreenTBC+10,25005,0,1,1,1,1), -- Bloodfist Vambraces +(@GreenTBC+10,25040,0,1,1,1,1), -- Murkblood Cape +(@GreenTBC+10,25054,0,1,1,1,1), -- Sodalite Band +(@GreenTBC+10,25068,0,1,1,1,1), -- Kunzite Necklace +(@GreenTBC+10,25082,0,1,1,1,1), -- Fel-Iron Shield +(@GreenTBC+10,25096,0,1,1,1,1), -- Elementalist Star +(@GreenTBC+10,25110,0,1,1,1,1), -- Sharp Bowie Knife +(@GreenTBC+10,25124,0,1,1,1,1), -- Footman Mace +(@GreenTBC+10,25138,0,1,1,1,1), -- Blood Knight Maul +(@GreenTBC+10,25152,0,1,1,1,1), -- Howling Sword +(@GreenTBC+10,25166,0,1,1,1,1), -- Mok'Nathal Warblade +(@GreenTBC+10,25180,0,1,1,1,1), -- Calenda Fighting Stick +(@GreenTBC+10,25194,0,1,1,1,1), -- Serpent's Fangs +(@GreenTBC+10,25208,0,1,1,1,1), -- Bladespire Broadaxe +(@GreenTBC+10,25222,0,1,1,1,1), -- Ceremonial Slayer's Axe +(@GreenTBC+10,25236,0,1,1,1,1), -- Grim Scythe +(@GreenTBC+10,25250,0,1,1,1,1), -- Rocslayer Longbow +(@GreenTBC+10,25264,0,1,1,1,1), -- Pocket Ballista +(@GreenTBC+10,25278,0,1,1,1,1), -- Nesingwary Longrifle +(@GreenTBC+10,25292,0,1,1,1,1), -- Mechano-Wand +(@GreenTBC+10,25306,0,1,1,1,1), -- Permafrost Dagger +(@GreenTBC+10,25320,0,1,1,1,1), -- Queen's Insignia +(@GreenTBC+10,25334,0,1,1,1,1), -- Intimidating Greatstaff +(@GreenTBC+10,28541,0,1,1,1,1), -- Sawshrike +(@GreenTBC+10,30520,0,1,1,1,1), -- Gold-Trimmed Cuffs +(@GreenTBC+10,30986,0,1,1,1,1), -- Bloodforged Guard +-- lvl 68 ilvl 114 greens (55 items) TBC +(@GreenTBC+11,25055,0,1,1,1,1), -- Alexandrite Ring +(@GreenTBC+11,25139,0,1,1,1,1), -- Algaz Battle Hammer +(@GreenTBC+11,25209,0,1,1,1,1), -- Amani Tomahawk +(@GreenTBC+11,25041,0,1,1,1,1), -- Ambusher's Cloak +(@GreenTBC+11,25097,0,1,1,1,1), -- Astralaan Orb +(@GreenTBC+11,25265,0,1,1,1,1), -- Barreled Crossbow +(@GreenTBC+11,25008,0,1,1,1,1), -- Conqueror's Breastplate +(@GreenTBC+11,25012,0,1,1,1,1), -- Conqueror's Epaulets +(@GreenTBC+11,25009,0,1,1,1,1), -- Conqueror's Gauntlets +(@GreenTBC+11,25006,0,1,1,1,1), -- Conqueror's Girdle +(@GreenTBC+11,25007,0,1,1,1,1), -- Conqueror's Greaves +(@GreenTBC+11,25010,0,1,1,1,1), -- Conqueror's Helmet +(@GreenTBC+11,25011,0,1,1,1,1), -- Conqueror's Legplates +(@GreenTBC+11,25013,0,1,1,1,1), -- Conqueror's Vambraces +(@GreenTBC+11,25195,0,1,1,1,1), -- Diamond Tipped Claws +(@GreenTBC+11,25321,0,1,1,1,1), -- Divine Hammer +(@GreenTBC+11,25293,0,1,1,1,1), -- Draenethyst Wand +(@GreenTBC+11,24669,0,1,1,1,1), -- Eldr'naan Belt +(@GreenTBC+11,24670,0,1,1,1,1), -- Eldr'naan Boots +(@GreenTBC+11,24676,0,1,1,1,1), -- Eldr'naan Bracelets +(@GreenTBC+11,24672,0,1,1,1,1), -- Eldr'naan Gloves +(@GreenTBC+11,24673,0,1,1,1,1), -- Eldr'naan Hood +(@GreenTBC+11,24671,0,1,1,1,1), -- Eldr'naan Jerkin +(@GreenTBC+11,24674,0,1,1,1,1), -- Eldr'naan Pants +(@GreenTBC+11,24675,0,1,1,1,1), -- Eldr'naan Shoulderpads +(@GreenTBC+11,25069,0,1,1,1,1), -- Epidote Stone Necklace +(@GreenTBC+11,25335,0,1,1,1,1), -- Feral Warp-Staff +(@GreenTBC+11,25153,0,1,1,1,1), -- Gladiator Greatblade +(@GreenTBC+11,28542,0,1,1,1,1), -- Heartseeker Knives +(@GreenTBC+11,25111,0,1,1,1,1), -- Lionhead Dagger +(@GreenTBC+11,24781,0,1,1,1,1), -- Murkblood Belt +(@GreenTBC+11,24783,0,1,1,1,1), -- Murkblood Boots +(@GreenTBC+11,24789,0,1,1,1,1), -- Murkblood Bracers +(@GreenTBC+11,24784,0,1,1,1,1), -- Murkblood Chestpiece +(@GreenTBC+11,24786,0,1,1,1,1), -- Murkblood Cover +(@GreenTBC+11,24785,0,1,1,1,1), -- Murkblood Gloves +(@GreenTBC+11,24787,0,1,1,1,1), -- Murkblood Pants +(@GreenTBC+11,24788,0,1,1,1,1), -- Murkblood Shoulderguards +(@GreenTBC+11,25237,0,1,1,1,1), -- Nether Trident +(@GreenTBC+11,25167,0,1,1,1,1), -- Nethersteel Claymore +(@GreenTBC+11,25251,0,1,1,1,1), -- Orc Flatbow +(@GreenTBC+11,25125,0,1,1,1,1), -- Retro-Spike Club +(@GreenTBC+11,25279,0,1,1,1,1), -- Sen'jin Longrifle +(@GreenTBC+11,25307,0,1,1,1,1), -- Shadow Dagger +(@GreenTBC+11,25083,0,1,1,1,1), -- Smouldering Shield +(@GreenTBC+11,24896,0,1,1,1,1), -- Sundered Chestpiece +(@GreenTBC+11,24895,0,1,1,1,1), -- Sundered Footwraps +(@GreenTBC+11,24897,0,1,1,1,1), -- Sundered Gauntlets +(@GreenTBC+11,24898,0,1,1,1,1), -- Sundered Helmet +(@GreenTBC+11,24899,0,1,1,1,1), -- Sundered Legguards +(@GreenTBC+11,24900,0,1,1,1,1), -- Sundered Spaulders +(@GreenTBC+11,24894,0,1,1,1,1), -- Sundered Waistband +(@GreenTBC+11,25181,0,1,1,1,1), -- Tapered Staff +(@GreenTBC+11,24901,0,1,1,1,1), -- Tortured Bracer +(@GreenTBC+11,25223,0,1,1,1,1), -- Windcaller Hatchet +-- lvl 69 ilvl 117 greens (55 items) TBC +(@GreenTBC+12,25056,0,1,1,1,1), -- Almandine Ring +(@GreenTBC+12,25126,0,1,1,1,1), -- Anvilmar Hammer +(@GreenTBC+12,24677,0,1,1,1,1), -- Archmage Belt +(@GreenTBC+12,24684,0,1,1,1,1), -- Archmage Bracelets +(@GreenTBC+12,24680,0,1,1,1,1), -- Archmage Gloves +(@GreenTBC+12,24681,0,1,1,1,1), -- Archmage Headpiece +(@GreenTBC+12,24683,0,1,1,1,1), -- Archmage Mantle +(@GreenTBC+12,24682,0,1,1,1,1), -- Archmage Pants +(@GreenTBC+12,24679,0,1,1,1,1), -- Archmage Robe +(@GreenTBC+12,24678,0,1,1,1,1), -- Archmage Slippers +(@GreenTBC+12,25154,0,1,1,1,1), -- Blood Groove Blade +(@GreenTBC+12,25196,0,1,1,1,1), -- Boneshredder Claws +(@GreenTBC+12,25140,0,1,1,1,1), -- Commanding Mallet +(@GreenTBC+12,25070,0,1,1,1,1), -- Coral Beads +(@GreenTBC+12,25182,0,1,1,1,1), -- Crystal-Etched Warstaff +(@GreenTBC+12,25210,0,1,1,1,1), -- Double-Bladed Axe +(@GreenTBC+12,25294,0,1,1,1,1), -- Dragonscale Wand +(@GreenTBC+12,25252,0,1,1,1,1), -- Dream Catcher Bow +(@GreenTBC+12,28543,0,1,1,1,1), -- Dreghood Throwing Axe +(@GreenTBC+12,24791,0,1,1,1,1), -- Expedition Boots +(@GreenTBC+12,24797,0,1,1,1,1), -- Expedition Bracers +(@GreenTBC+12,24790,0,1,1,1,1), -- Expedition Girdle +(@GreenTBC+12,24793,0,1,1,1,1), -- Expedition Gloves +(@GreenTBC+12,24794,0,1,1,1,1), -- Expedition Hood +(@GreenTBC+12,24795,0,1,1,1,1), -- Expedition Pants +(@GreenTBC+12,24796,0,1,1,1,1), -- Expedition Shoulderguards +(@GreenTBC+12,24792,0,1,1,1,1), -- Expedition Tunic +(@GreenTBC+12,25112,0,1,1,1,1), -- Fel Ripper +(@GreenTBC+12,25280,0,1,1,1,1), -- Game Hunter Musket +(@GreenTBC+12,25238,0,1,1,1,1), -- Hellfire War Spear +(@GreenTBC+12,25322,0,1,1,1,1), -- Lordly Scepter +(@GreenTBC+12,25042,0,1,1,1,1), -- Nether Cloak +(@GreenTBC+12,25168,0,1,1,1,1), -- Sha'tari Longsword +(@GreenTBC+12,25014,0,1,1,1,1), -- Shattered Hand Belt +(@GreenTBC+12,25016,0,1,1,1,1), -- Shattered Hand Breastplate +(@GreenTBC+12,25020,0,1,1,1,1), -- Shattered Hand Epaulets +(@GreenTBC+12,25017,0,1,1,1,1), -- Shattered Hand Gauntlets +(@GreenTBC+12,25018,0,1,1,1,1), -- Shattered Hand Helmet +(@GreenTBC+12,25019,0,1,1,1,1), -- Shattered Hand Legplates +(@GreenTBC+12,25015,0,1,1,1,1), -- Shattered Hand Sabatons +(@GreenTBC+12,25021,0,1,1,1,1), -- Shattered Hand Vambraces +(@GreenTBC+12,25224,0,1,1,1,1), -- Slavemaster Axe +(@GreenTBC+12,25336,0,1,1,1,1), -- Splintering Greatstaff +(@GreenTBC+12,24904,0,1,1,1,1), -- Talhide Chestpiece +(@GreenTBC+12,24906,0,1,1,1,1), -- Talhide Helmet +(@GreenTBC+12,24903,0,1,1,1,1), -- Talhide Lined-Boots +(@GreenTBC+12,24909,0,1,1,1,1), -- Talhide Lined-Bracers +(@GreenTBC+12,24905,0,1,1,1,1), -- Talhide Lined-Gloves +(@GreenTBC+12,24907,0,1,1,1,1), -- Talhide Lined-Leggings +(@GreenTBC+12,24908,0,1,1,1,1), -- Talhide Shoulderguards +(@GreenTBC+12,24902,0,1,1,1,1), -- Talhide Stitched-Belt +(@GreenTBC+12,25308,0,1,1,1,1), -- Thunder Spike +(@GreenTBC+12,25098,0,1,1,1,1), -- Tuurik Torch +(@GreenTBC+12,25266,0,1,1,1,1), -- Well-Balanced Crossbow +(@GreenTBC+12,25084,0,1,1,1,1), -- Zeth'Gor Shield +-- lvl 70 ilvl 120 greens (55 items) TBC +(@GreenTBC+13,25057,0,1,1,1,1), -- Amber Band +(@GreenTBC+13,25043,0,1,1,1,1), -- Amber Cape +(@GreenTBC+13,25323,0,1,1,1,1), -- Ascendant's Scepter +(@GreenTBC+13,28544,0,1,1,1,1), -- Assassin's Shuriken +(@GreenTBC+13,25281,0,1,1,1,1), -- Big-Boar Battle Rifle +(@GreenTBC+13,25225,0,1,1,1,1), -- Deepforge Broadaxe +(@GreenTBC+13,25099,0,1,1,1,1), -- Draenei Crystal Rod +(@GreenTBC+13,24805,0,1,1,1,1), -- Dragonhawk Bands +(@GreenTBC+13,24798,0,1,1,1,1), -- Dragonhawk Belt +(@GreenTBC+13,24799,0,1,1,1,1), -- Dragonhawk Boots +(@GreenTBC+13,24801,0,1,1,1,1), -- Dragonhawk Gloves +(@GreenTBC+13,24802,0,1,1,1,1), -- Dragonhawk Hat +(@GreenTBC+13,24803,0,1,1,1,1), -- Dragonhawk Pants +(@GreenTBC+13,24804,0,1,1,1,1), -- Dragonhawk Shoulderguards +(@GreenTBC+13,24800,0,1,1,1,1), -- Dragonhawk Tunic +(@GreenTBC+13,25085,0,1,1,1,1), -- Dragonscale Shield +(@GreenTBC+13,24685,0,1,1,1,1), -- Elementalist Belt +(@GreenTBC+13,24686,0,1,1,1,1), -- Elementalist Boots +(@GreenTBC+13,24692,0,1,1,1,1), -- Elementalist Bracelets +(@GreenTBC+13,24688,0,1,1,1,1), -- Elementalist Gloves +(@GreenTBC+13,24690,0,1,1,1,1), -- Elementalist Leggings +(@GreenTBC+13,24691,0,1,1,1,1), -- Elementalist Mantle +(@GreenTBC+13,24689,0,1,1,1,1), -- Elementalist Skullcap +(@GreenTBC+13,24687,0,1,1,1,1), -- Elementalist Tunic +(@GreenTBC+13,25169,0,1,1,1,1), -- Fel Orc Brute Sword +(@GreenTBC+13,25295,0,1,1,1,1), -- Flawless Wand +(@GreenTBC+13,25141,0,1,1,1,1), -- Halaani Hammer +(@GreenTBC+13,25155,0,1,1,1,1), -- Iron Skull Sword +(@GreenTBC+13,25127,0,1,1,1,1), -- Knight's War Hammer +(@GreenTBC+13,25239,0,1,1,1,1), -- Legend's Glaive +(@GreenTBC+13,24910,0,1,1,1,1), -- Netherstorm Belt +(@GreenTBC+13,24917,0,1,1,1,1), -- Netherstorm Bracer +(@GreenTBC+13,24912,0,1,1,1,1), -- Netherstorm Chestpiece +(@GreenTBC+13,24913,0,1,1,1,1), -- Netherstorm Gauntlets +(@GreenTBC+13,24911,0,1,1,1,1), -- Netherstorm Greaves +(@GreenTBC+13,24914,0,1,1,1,1), -- Netherstorm Helm +(@GreenTBC+13,24915,0,1,1,1,1), -- Netherstorm Legguards +(@GreenTBC+13,24916,0,1,1,1,1), -- Netherstorm Shoulderguards +(@GreenTBC+13,25113,0,1,1,1,1), -- Phantom Dagger +(@GreenTBC+13,25267,0,1,1,1,1), -- Rampant Crossbow +(@GreenTBC+13,25197,0,1,1,1,1), -- Razor Scythes +(@GreenTBC+13,25211,0,1,1,1,1), -- Rockbiter Cutter +(@GreenTBC+13,25337,0,1,1,1,1), -- Swarming Sting-Staff +(@GreenTBC+13,25071,0,1,1,1,1), -- Tanzanite Pendant +(@GreenTBC+13,25183,0,1,1,1,1), -- Voodoo Hex-Staff +(@GreenTBC+13,25024,0,1,1,1,1), -- Warlord's Iron-Breastplate +(@GreenTBC+13,25028,0,1,1,1,1), -- Warlord's Iron-Epaulets +(@GreenTBC+13,25025,0,1,1,1,1), -- Warlord's Iron-Gauntlets +(@GreenTBC+13,25022,0,1,1,1,1), -- Warlord's Iron-Girdle +(@GreenTBC+13,25026,0,1,1,1,1), -- Warlord's Iron-Helm +(@GreenTBC+13,25027,0,1,1,1,1), -- Warlord's Iron-Legplates +(@GreenTBC+13,25029,0,1,1,1,1), -- Warlord's Iron-Vambraces +(@GreenTBC+13,25023,0,1,1,1,1), -- Warlord's Sabatons +(@GreenTBC+13,25309,0,1,1,1,1), -- Warpdagger +(@GreenTBC+13,25253,0,1,1,1,1); -- Windspear Longbow +-- -------------------------------------------------------- +-- TBC_Blues_References +-- -------------------------------------------------------- +SET @BlueTBC := 4200; -- reference starting value TDB Field +DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN @BlueTBC AND @BlueTBC+10; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- lvl 60 blues ilvl 85((6 items) +(@BlueTBC,31125,0,1,1,1,1), -- Boots of the Decimator +(@BlueTBC,31126,0,1,1,1,1), -- Gloves of Ferocity +(@BlueTBC,31127,0,1,1,1,1), -- Hauberk of Totemic Rage +(@BlueTBC,31131,0,1,1,1,1), -- Sash of Silent Blades +(@BlueTBC,31133,0,1,1,1,1), -- Leggings of Concentrated Darkness +(@BlueTBC,31134,0,1,1,1,1), -- Blade of Misfortune +-- lvl 61 blues ilvl 88 (6 items) +(@BlueTBC+1,31136,0,1,1,1,1), -- Breastplate of Blade Turning +(@BlueTBC+1,31137,0,1,1,1,1), -- Gauntlets of Purification +(@BlueTBC+1,31138,0,1,1,1,1), -- Storm Lord's Girdle +(@BlueTBC+1,31139,0,1,1,1,1), -- Fist of Reckoning +(@BlueTBC+1,31140,0,1,1,1,1), -- Cloak of Entropy +(@BlueTBC+1,31142,0,1,1,1,1), -- Blade of Trapped Knowledge +-- lvl 62 blues ilvl 91 (6 items) +(@BlueTBC+2,31143,0,1,1,1,1), -- Shroud of Frenzy +(@BlueTBC+2,31145,0,1,1,1,1), -- Headdress of the Sleeper +(@BlueTBC+2,31147,0,1,1,1,1), -- Pendant of Cunning +(@BlueTBC+2,31148,0,1,1,1,1), -- Demon Hide Spaulders +(@BlueTBC+2,31149,0,1,1,1,1), -- Gloves of Pandemonium +(@BlueTBC+2,31150,0,1,1,1,1), -- Gloves of Piety +-- lvl 63 blues ilvl 94 (6 items) +(@BlueTBC+3,31151,0,1,1,1,1), -- Girdle of Siege +(@BlueTBC+3,31152,0,1,1,1,1), -- Girdle of SiegeChestguard of Illumination +(@BlueTBC+3,31153,0,1,1,1,1), -- Girdle of SiegeAxe of the Legion +(@BlueTBC+3,31173,0,1,1,1,1), -- Girdle of SiegeBoots of Savagery +(@BlueTBC+3,31175,0,1,1,1,1), -- Girdle of SiegeBlade Dancer's Wristguards +(@BlueTBC+3,31178,0,1,1,1,1), -- Girdle of SiegeAmulet of Unstable Power +-- lvl 64 blues ilvl 97 (6 items) +(@BlueTBC+4,31180,0,1,1,1,1), -- Gauntlets of the Skullsplitter +(@BlueTBC+4,31186,0,1,1,1,1), -- Braxxis' Staff of Slumber +(@BlueTBC+4,31187,0,1,1,1,1), -- Boots of the Pathfinder +(@BlueTBC+4,31190,0,1,1,1,1), -- The Dreamer's Shoulderpads +(@BlueTBC+4,31193,0,1,1,1,1), -- Blade of Unquenched Thirst +(@BlueTBC+4,31196,0,1,1,1,1), -- Amulet of Sanctification +-- lvl 65 blues ilvl 100 (6 items) +(@BlueTBC+5,31200,0,1,1,1,1), -- Shield of the Wayward Footman +(@BlueTBC+5,31202,0,1,1,1,1), -- Girdle of Divine Blessing +(@BlueTBC+5,31204,0,1,1,1,1), -- The Gunblade +(@BlueTBC+5,31222,0,1,1,1,1), -- Headdress of Inner Rage +(@BlueTBC+5,31226,0,1,1,1,1), -- Leggings of the Sly +(@BlueTBC+5,31230,0,1,1,1,1), -- Abyss Walker's Boots +-- lvl 68 blues ilvl 109 (6 items) +(@BlueTBC+8,31284,0,1,1,1,1), -- Bracers of Recklessness +(@BlueTBC+8,31285,0,1,1,1,1), -- Chestguard of the Talon +(@BlueTBC+8,31286,0,1,1,1,1), -- Breastplate of Rapid Striking +(@BlueTBC+8,31287,0,1,1,1,1), -- Draenei Honor Guard Shield +(@BlueTBC+8,31288,0,1,1,1,1), -- The Master's Treads +(@BlueTBC+8,31289,0,1,1,1,1), -- Staff of Divine Infusion +-- lvl 69 blues ilvl 112 (6 items) +(@BlueTBC+9,31291,0,1,1,1,1), -- Crystalforged War Axe +(@BlueTBC+9,31292,0,1,1,1,1), -- Crystal Pulse Shield +(@BlueTBC+9,31293,0,1,1,1,1), -- Girdle of Gale Force +(@BlueTBC+9,31294,0,1,1,1,1), -- Pauldrons of Surging Mana +(@BlueTBC+9,31295,0,1,1,1,1), -- Chestguard of the Dark Stalker +(@BlueTBC+9,31297,0,1,1,1,1), -- Robe of the Crimson Order +-- lvl 70 blues ilvl 115 (7 items) +(@BlueTBC+10,31298,0,1,1,1,1), -- Legguards of the Shattered Hand +(@BlueTBC+10,31299,0,1,1,1,1), -- The Oathkeeper +(@BlueTBC+10,31303,0,1,1,1,1), -- Valanos' Longbow +(@BlueTBC+10,31304,0,1,1,1,1), -- The Essence Focuser +(@BlueTBC+10,31305,0,1,1,1,1), -- Ced's Carver +(@BlueTBC+10,31306,0,1,1,1,1), -- Leggings of the Sacred Crest +(@BlueTBC+10,31308,0,1,1,1,1); -- The Bringer of Death From 3b87f1d29bd9c5a613f3bd96c75d88781c5782fe Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sat, 2 Jun 2012 19:50:39 +0200 Subject: [PATCH 0908/1149] Commit: Add newlines to end of files --- sql/updates/world/2012_06_02_03_creature_loot_template_hp.sql | 2 +- sql/updates/world/2012_06_02_03_creature_loot_template_zm.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/updates/world/2012_06_02_03_creature_loot_template_hp.sql b/sql/updates/world/2012_06_02_03_creature_loot_template_hp.sql index 8a0496d88f6..cd6015929b1 100644 --- a/sql/updates/world/2012_06_02_03_creature_loot_template_hp.sql +++ b/sql/updates/world/2012_06_02_03_creature_loot_template_hp.sql @@ -1129,4 +1129,4 @@ INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`loot (18975,2,90,1,0,-6000,1); -- Generic HellfirePeninsula Loot UPDATE `creature_template` SET `lootid`=`entry` WHERE `entry` IN (26222,26223); -DELETE FROM `reference_loot_template` WHERE `entry`=34081; \ No newline at end of file +DELETE FROM `reference_loot_template` WHERE `entry`=34081; diff --git a/sql/updates/world/2012_06_02_03_creature_loot_template_zm.sql b/sql/updates/world/2012_06_02_03_creature_loot_template_zm.sql index d5130caf8cb..e739f81407b 100644 --- a/sql/updates/world/2012_06_02_03_creature_loot_template_zm.sql +++ b/sql/updates/world/2012_06_02_03_creature_loot_template_zm.sql @@ -899,4 +899,4 @@ INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`loot (20387,25454,20,1,1,1,1), -- Luminescent Globe (20387,27676,50,1,0,1,1), -- Strange Spores (20387,24401,26,1,0,1,1), -- Unidentified Plant Parts -(20387,1,90,1,0,-6000,1); -- Generic HellfirePeninsula Loot (YES FOR ZM) \ No newline at end of file +(20387,1,90,1,0,-6000,1); -- Generic HellfirePeninsula Loot (YES FOR ZM) From beb91af01192600db9510eb24a95146a374bb027 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sat, 2 Jun 2012 20:03:12 +0200 Subject: [PATCH 0909/1149] DB/Loot: Fix WOTLK items dropping off level 20 mobs Closes #6692 --- .../world/2012_06_02_04_reference_loot_template.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 sql/updates/world/2012_06_02_04_reference_loot_template.sql diff --git a/sql/updates/world/2012_06_02_04_reference_loot_template.sql b/sql/updates/world/2012_06_02_04_reference_loot_template.sql new file mode 100644 index 00000000000..57be9083048 --- /dev/null +++ b/sql/updates/world/2012_06_02_04_reference_loot_template.sql @@ -0,0 +1,11 @@ +DELETE FROM `reference_loot_template` WHERE `entry` IN (14011,14012); +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(14011,37759,0,1,1,1,1), -- Rhie-ay's Clutching Gauntlets +(14011,37768,0,1,1,1,1), -- Leggings of Violent Exsanguination +(14011,37790,0,1,1,1,1), -- Belt of Crystalline Tears +(14011,37806,0,1,1,1,1), -- Zabra's Misplaced Staff +(14011,37808,0,1,1,1,1), -- Dragonjaw Mauler +(14011,37809,0,1,1,1,1), -- Roc-Feather Longbow +(14012,3014,-70,1,0,1,1), -- Battleworn Axe +(14012,7906,-8,1,0,1,1); -- Horns of Nez'ra +UPDATE `creature_loot_template` SET `mincountOrRef`=14012 WHERE `mincountOrRef`=14011 AND `entry` IN (4464,436,437,440,485,615,4064,4065,4462,4463,435); From c729aa5d5a2f9bb635f194cbda88f5b3e9e5171d Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sat, 2 Jun 2012 20:15:42 +0200 Subject: [PATCH 0910/1149] DB/Commit: reference values are negative, im jumping a cliff, bye --- sql/updates/world/2012_06_02_05_reference_loot_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_06_02_05_reference_loot_template.sql diff --git a/sql/updates/world/2012_06_02_05_reference_loot_template.sql b/sql/updates/world/2012_06_02_05_reference_loot_template.sql new file mode 100644 index 00000000000..51dee84ad9b --- /dev/null +++ b/sql/updates/world/2012_06_02_05_reference_loot_template.sql @@ -0,0 +1,2 @@ +-- freaking -, im jumping from a cliff now... +UPDATE `creature_loot_template` SET `mincountOrRef`=-14012 WHERE `mincountOrRef`=-14011 AND `entry` IN (4464,436,437,440,485,615,4064,4065,4462,4463,435); From 9899ba7a9ef7b344b5c4d60ab5a951eeef986be8 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 2 Jun 2012 21:04:29 -0230 Subject: [PATCH 0911/1149] DB/waypoints: Fix up Dragons around Wymrest temple --- .../world/2012_06_02_06_world_waypoints.sql | 1343 +++++++++++++++++ 1 file changed, 1343 insertions(+) create mode 100644 sql/updates/world/2012_06_02_06_world_waypoints.sql diff --git a/sql/updates/world/2012_06_02_06_world_waypoints.sql b/sql/updates/world/2012_06_02_06_world_waypoints.sql new file mode 100644 index 00000000000..65d5d43bad2 --- /dev/null +++ b/sql/updates/world/2012_06_02_06_world_waypoints.sql @@ -0,0 +1,1343 @@ +-- Azure Drake +-- Delete old spawns +DELETE FROM `creature` WHERE `id` IN (27682,27608); +UPDATE `creature_template` SET `speed_walk`=9/2,`speed_run`=17/7,`InhabitType`=4 WHERE `entry`=26838; + +SET @NPC := 99078; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27682,571,1,1,24743,0,3433.348,274.121,192.7347,1.91463,120,0,0,38440,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3441.997,218.066,169.347,0,0,0,100,0), +(@PATH,2,3495.446,178.1635,169.347,0,0,0,100,0), +(@PATH,3,3562.124,172.6228,169.347,0,0,0,100,0), +(@PATH,4,3645.859,193.9786,169.347,0,0,0,100,0), +(@PATH,5,3689.068,295.8872,169.347,0,0,0,100,0), +(@PATH,6,3624.446,375.1689,169.347,0,0,0,100,0), +(@PATH,7,3510.095,372.0045,169.347,0,0,0,100,0), +(@PATH,8,3446.488,300.4381,169.347,0,0,0,100,0), +(@PATH,9,3420.008,195.1058,169.347,0,0,0,100,0), +(@PATH,10,3474.376,103.4208,169.347,0,0,0,100,0), +(@PATH,11,3587.787,78.41341,169.347,0,0,0,100,0), +(@PATH,12,3680.552,168.1343,169.347,0,0,0,100,0), +(@PATH,13,3682.222,340.8562,169.347,0,0,0,100,0), +(@PATH,14,3563.545,458.4753,169.347,0,0,0,100,0), +(@PATH,15,3452.104,480.9653,169.347,0,0,0,100,0), +(@PATH,16,3344.437,382.5979,169.347,0,0,0,100,0), +(@PATH,17,3232.114,340.6778,169.347,0,0,0,100,0), +(@PATH,18,3127.326,347.8484,169.347,0,0,0,100,0), +(@PATH,19,3027.017,384.9972,169.347,0,0,0,100,0), +(@PATH,20,2989.474,458.5701,169.347,0,0,0,100,0), +(@PATH,21,3013.37,539.2202,169.347,0,0,0,100,0), +(@PATH,22,3066.603,566.7353,169.347,0,0,0,100,0), +(@PATH,23,3134.078,551.7691,169.347,0,0,0,100,0), +(@PATH,24,3244.26,486.8306,169.347,0,0,0,100,0), +(@PATH,25,3327.64,383.2903,169.347,0,0,0,100,0), +(@PATH,26,3382.149,279.6307,169.347,0,0,0,100,0); + +SET @NPC := 99079; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27682,571,1,1,24743,0,3434.632,268.5218,212.5722,1.91463,120,0,0,38440,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3449.962,350.2704,185.3083,0,0,0,100,0), +(@PATH,2,3546.571,399.454,185.3083,0,0,0,100,0), +(@PATH,3,3649.095,344.2626,185.3083,0,0,0,100,0), +(@PATH,4,3648.6,203.3825,185.3083,0,0,0,100,0), +(@PATH,5,3557.447,156.6613,185.3083,0,0,0,100,0), +(@PATH,6,3438.763,197.2433,185.3083,0,0,0,100,0), +(@PATH,7,3364.301,251.3537,185.3083,0,0,0,100,0), +(@PATH,8,3245.05,295.2606,185.3083,0,0,0,100,0), +(@PATH,9,3127.677,330.6631,185.3083,0,0,0,100,0), +(@PATH,10,3045.42,426.6257,185.3083,0,0,0,100,0), +(@PATH,11,3033.423,500.1823,185.3083,0,0,0,100,0), +(@PATH,12,3074.555,584.5701,185.3083,0,0,0,100,0), +(@PATH,13,3167.413,579.3245,185.3083,0,0,0,100,0), +(@PATH,14,3254.766,477.3121,185.3083,0,0,0,100,0), +(@PATH,15,3328.997,355.7176,185.3083,0,0,0,100,0), +(@PATH,16,3403.051,340.1719,185.3083,0,0,0,100,0), +(@PATH,17,3446.086,384.896,185.3083,0,0,0,100,0), +(@PATH,18,3503.323,407.0888,185.3083,0,0,0,100,0), +(@PATH,19,3593.65,392.4026,185.3083,0,0,0,100,0), +(@PATH,20,3658.26,283.8229,185.3083,0,0,0,100,0), +(@PATH,21,3604.809,176.3996,185.3083,0,0,0,100,0), +(@PATH,22,3500.686,159.6379,185.3083,0,0,0,100,0), +(@PATH,23,3441.441,249.5543,185.3083,0,0,0,100,0); + +SET @NPC := 99083; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27682,571,1,1,24743,0,3639.789,321.911,195.744,1.91463,120,0,0,38440,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3654.995,228.2284,204.7075,0,0,0,100,0), +(@PATH,2,3750.065,190.3719,204.7075,0,0,0,100,0), +(@PATH,3,3793.781,239.5784,204.7075,0,0,0,100,0), +(@PATH,4,3793.007,322.9862,204.7075,0,0,0,100,0), +(@PATH,5,3712.435,337.7213,204.7075,0,0,0,100,0), +(@PATH,6,3649.212,273.7653,204.7075,0,0,0,100,0), +(@PATH,7,3627.809,181.2728,204.7075,0,0,0,100,0), +(@PATH,8,3575.202,116.1518,204.7075,0,0,0,100,0), +(@PATH,9,3452.9,157.833,204.7075,0,0,0,100,0), +(@PATH,10,3395.156,279.1096,204.7075,0,0,0,100,0), +(@PATH,11,3459.034,403.4866,204.7075,0,0,0,100,0), +(@PATH,12,3610.543,437.9186,204.7075,0,0,0,100,0), +(@PATH,13,3715.638,355.6098,204.7075,0,0,0,100,0), +(@PATH,14,3721.246,203.5534,204.7075,0,0,0,100,0), +(@PATH,15,3583.16,147.8227,204.7075,0,0,0,100,0), +(@PATH,16,3467.958,184.451,204.7075,0,0,0,100,0), +(@PATH,17,3341.041,241.3563,204.7075,0,0,0,100,0), +(@PATH,18,3259.652,326.3573,204.7075,0,0,0,100,0), +(@PATH,19,3325.962,453.1619,204.7075,0,0,0,100,0), +(@PATH,20,3430.271,470.1731,204.7075,0,0,0,100,0), +(@PATH,21,3474.818,389.2108,204.7075,0,0,0,100,0), +(@PATH,22,3422.128,277.9353,204.7075,0,0,0,100,0), +(@PATH,23,3278.513,235.3488,204.7075,0,0,0,100,0), +(@PATH,24,3139.333,309.1593,204.7075,0,0,0,100,0), +(@PATH,25,3124.315,442.8726,204.7075,0,0,0,100,0), +(@PATH,26,3166.636,500.1602,204.7075,0,0,0,100,0), +(@PATH,27,3252.777,537.1607,204.7075,0,0,0,100,0), +(@PATH,28,3365.404,500.6408,204.7075,0,0,0,100,0), +(@PATH,29,3497.347,437.8124,204.7075,0,0,0,100,0), +(@PATH,30,3610.069,345.1742,204.7075,0,0,0,100,0); + +SET @NPC := 99084; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27682,571,1,1,24743,0,3419.562,219.4669,185.8007,1.91463,120,0,0,38440,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3476.15,177.9767,151.9461,0,0,0,100,0), +(@PATH,2,3545.193,113.4851,151.9461,0,0,0,100,0), +(@PATH,3,3639.261,157.7231,151.9461,0,0,0,100,0), +(@PATH,4,3676.142,330.9362,151.9461,0,0,0,100,0), +(@PATH,5,3568.025,452.4464,151.9461,0,0,0,100,0), +(@PATH,6,3440.924,381.5191,151.9461,0,0,0,100,0), +(@PATH,7,3406.76,247.0661,151.9461,0,0,0,100,0), +(@PATH,8,3489.703,142.3122,151.9461,0,0,0,100,0), +(@PATH,9,3573.337,130.2329,151.9461,0,0,0,100,0), +(@PATH,10,3668.767,202.5275,151.9461,0,0,0,100,0), +(@PATH,11,3660.667,365.0258,151.9461,0,0,0,100,0), +(@PATH,12,3546.228,441.4885,151.9461,0,0,0,100,0), +(@PATH,13,3414.354,479.1683,151.9461,0,0,0,100,0), +(@PATH,14,3298.711,513.6075,151.9461,0,0,0,100,0), +(@PATH,15,3152.929,563.3295,151.9461,0,0,0,100,0), +(@PATH,16,3061.01,598.1893,151.9461,0,0,0,100,0), +(@PATH,17,3028.564,548.2512,151.9461,0,0,0,100,0), +(@PATH,18,3066.851,499.9897,151.9461,0,0,0,100,0), +(@PATH,19,3126.102,457.3964,151.9461,0,0,0,100,0), +(@PATH,20,3209.258,379.5157,151.9461,0,0,0,100,0), +(@PATH,21,3290.067,313.6936,151.9461,0,0,0,100,0), +(@PATH,22,3381.995,245.4414,151.9461,0,0,0,100,0); + +SET @NPC := 99085; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27682,571,1,1,24743,0,3431.814,203.5959,199.4538,1.91463,120,0,0,38440,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3469.755,211.1012,252.1057,0,0,0,100,0), +(@PATH,2,3543.436,184.6182,282.9112,0,0,0,100,0), +(@PATH,3,3605.144,211.1016,313.2445,0,0,0,100,0), +(@PATH,4,3629.088,281.4026,342.355,0,0,0,100,0), +(@PATH,5,3586.889,335.8259,342.355,0,0,0,100,0), +(@PATH,6,3534.959,340.7828,342.355,0,0,0,100,0), +(@PATH,7,3488.181,299.2897,342.355,0,0,0,100,0), +(@PATH,8,3490.962,242.9244,342.355,0,0,0,100,0), +(@PATH,9,3544.176,216.1916,342.355,0,0,0,100,0), +(@PATH,10,3607.393,238.2059,342.355,0,0,0,100,0), +(@PATH,11,3606.415,315.159,342.355,0,0,0,100,0), +(@PATH,12,3529.92,347.5442,342.355,0,0,0,100,0), +(@PATH,13,3442.581,379.9305,309.9662,0,0,0,100,0), +(@PATH,14,3363.314,409.6005,272.7996,0,0,0,100,0), +(@PATH,15,3271.624,451.7768,231.7996,0,0,0,100,0), +(@PATH,16,3222.875,508.5536,210.5774,0,0,0,100,0), +(@PATH,17,3178.339,552.9731,195.4663,0,0,0,100,0), +(@PATH,18,3119.579,592.5015,182.2996,0,0,0,100,0), +(@PATH,19,3079.527,558.9856,175.383,0,0,0,100,0), +(@PATH,20,3110.969,495.2063,173.9941,0,0,0,100,0), +(@PATH,21,3133.366,466.6834,176.5779,0,0,0,100,0), +(@PATH,22,3236.847,383.9943,176.5779,0,0,0,100,0), +(@PATH,23,3382.743,269.2179,222.0501,0,0,0,100,0); + +SET @NPC := 99086; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27682,571,1,1,24743,0,3408.915,276.3928,180.561,1.91463,120,0,0,38440,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3451.428,175.6206,154.7629,0,0,0,100,0), +(@PATH,2,3461.289,67.8521,154.7629,0,0,0,100,0), +(@PATH,3,3401.216,31.08062,154.7629,0,0,0,100,0), +(@PATH,4,3348.744,62.37424,154.7629,0,0,0,100,0), +(@PATH,5,3352.888,148.2122,154.7629,0,0,0,100,0), +(@PATH,6,3405.2,335.0623,154.7629,0,0,0,100,0), +(@PATH,7,3399.393,397.5138,154.7629,0,0,0,100,0), +(@PATH,8,3346.986,426.0631,154.7629,0,0,0,100,0), +(@PATH,9,3262.085,383.6502,154.7629,0,0,0,100,0), +(@PATH,10,3156.926,352.7438,154.7629,0,0,0,100,0), +(@PATH,11,3057.544,393.0464,154.7629,0,0,0,100,0), +(@PATH,12,3000.647,466.7132,154.7629,0,0,0,100,0), +(@PATH,13,2989.147,516.5572,154.7629,0,0,0,100,0), +(@PATH,14,3049.945,587.7933,154.7629,0,0,0,100,0), +(@PATH,15,3160.802,556.4007,154.7629,0,0,0,100,0), +(@PATH,16,3268.329,422.1047,154.7629,0,0,0,100,0); + +SET @NPC := 99087; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27682,571,1,1,24743,0,3748.954,236.7544,178.6408,1.91463,120,0,0,38440,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3712.221,418.183,178.6408,0,0,0,100,0), +(@PATH,2,3540.502,499.2345,178.6408,0,0,0,100,0), +(@PATH,3,3358.373,445.1452,178.6408,0,0,0,100,0), +(@PATH,4,3200.13,472.7363,178.6408,0,0,0,100,0), +(@PATH,5,3101.38,584.3835,178.6408,0,0,0,100,0), +(@PATH,6,3040.255,596.7429,178.6408,0,0,0,100,0), +(@PATH,7,2997.37,550.3453,178.6408,0,0,0,100,0), +(@PATH,8,2999.847,500.0373,178.6408,0,0,0,100,0), +(@PATH,9,3048.254,460.723,178.6408,0,0,0,100,0), +(@PATH,10,3140.818,390.9225,178.6408,0,0,0,100,0), +(@PATH,11,3219.294,333.4928,178.6408,0,0,0,100,0), +(@PATH,12,3318.04,264.8529,178.6408,0,0,0,100,0), +(@PATH,13,3436.765,193.0778,178.6408,0,0,0,100,0), +(@PATH,14,3552.843,154.3912,178.6408,0,0,0,100,0), +(@PATH,15,3668.381,197.8079,178.6408,0,0,0,100,0), +(@PATH,16,3711.96,284.6768,178.6408,0,0,0,100,0), +(@PATH,17,3627.375,410.4442,178.6408,0,0,0,100,0), +(@PATH,18,3466.029,404.0347,178.6408,0,0,0,100,0), +(@PATH,19,3375.764,293.2045,178.6408,0,0,0,100,0), +(@PATH,20,3426.16,142.911,178.6408,0,0,0,100,0), +(@PATH,21,3611.036,90.26421,178.6408,0,0,0,100,0), +(@PATH,22,3748.954,236.7544,178.6408,0,0,0,100,0); + + +SET @NPC := 99088; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27682,571,1,1,24743,0,3412.463,216.0972,212.123,1.91463,120,0,0,38440,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3412.65,215.8015,241.2928,0,0,0,100,0), +(@PATH,2,3544.712,83.40093,241.2928,0,0,0,100,0), +(@PATH,3,3729.527,148.4322,241.2928,0,0,0,100,0), +(@PATH,4,3770.91,456.7697,241.2928,0,0,0,100,0), +(@PATH,5,3592.973,601.0773,241.2928,0,0,0,100,0), +(@PATH,6,3431.349,566.7643,241.2928,0,0,0,100,0), +(@PATH,7,3298.04,548.691,241.2928,0,0,0,100,0), +(@PATH,8,3180.431,663.6898,241.2928,0,0,0,100,0), +(@PATH,9,3069.867,677.9128,241.2928,0,0,0,100,0), +(@PATH,10,2984.272,605.6987,241.2928,0,0,0,100,0), +(@PATH,11,3000.096,533.4483,241.2928,0,0,0,100,0), +(@PATH,12,3144.4,405.446,241.2928,0,0,0,100,0), +(@PATH,13,3301.554,308.331,241.2928,0,0,0,100,0); + +SET @NPC := 99089; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27682,571,1,1,24743,0,3100.95,567.1441,118.4118,1.91463,120,0,0,38440,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3100.912,567.1385,122.3331,0,0,0,100,0), +(@PATH,2,3214.064,524.5076,122.3331,0,0,0,100,0), +(@PATH,3,3307.77,498.1685,122.3331,0,0,0,100,0), +(@PATH,4,3399.335,473.5195,122.3331,0,0,0,100,0), +(@PATH,5,3545.675,446.1954,122.3331,0,0,0,100,0), +(@PATH,6,3631.807,357.087,122.3331,0,0,0,100,0), +(@PATH,7,3640.708,229.0423,122.3331,0,0,0,100,0), +(@PATH,8,3616.36,137.7545,122.3331,0,0,0,100,0), +(@PATH,9,3558.458,113.3069,122.3331,0,0,0,100,0), +(@PATH,10,3457.288,142.8311,122.3331,0,0,0,100,0), +(@PATH,11,3387.124,248.1035,122.3331,0,0,0,100,0), +(@PATH,12,3419.464,398.1638,122.3331,0,0,0,100,0), +(@PATH,13,3366.308,507.4259,122.3331,0,0,0,100,0), +(@PATH,14,3243.456,494.2254,122.3331,0,0,0,100,0), +(@PATH,15,3121.018,428.1757,122.3331,0,0,0,100,0), +(@PATH,16,3003.428,487.8239,122.3331,0,0,0,100,0), +(@PATH,17,3001.53,566.4896,122.3331,0,0,0,100,0), +(@PATH,18,3059.883,577.261,122.3331,0,0,0,100,0); + +-- static +DELETE FROM `creature` WHERE `guid` IN (99090,99091); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(99090,27682,571,1,1,24743,0,2954.845,625.8646,146.2928,2.094395,120,0,0,38440,0,0), +(99091,27682,571,1,1,24743,0,3256.357,585.8403,136.8419,0.4363323,120,0,0,38440,0,0); + +-- waypoints +SET @NPC := 99092; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27682,571,1,1,24743,0,3017.465,301.0079,204.943,1.91463,120,0,0,38440,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3014.38,371.552,204.943,0,0,0,100,0), +(@PATH,2,3066.132,433.5229,204.943,0,0,0,100,0), +(@PATH,3,3168.017,532.116,204.943,0,0,0,100,0), +(@PATH,4,3341.228,644.3932,204.943,0,0,0,100,0), +(@PATH,5,3480.533,600.2273,204.943,0,0,0,100,0), +(@PATH,6,3485.514,465.1431,204.943,0,0,0,100,0), +(@PATH,7,3362.191,369.4394,204.943,0,0,0,100,0), +(@PATH,8,3193.452,330.4968,204.943,0,0,0,100,0), +(@PATH,9,3117.152,256.1553,204.943,0,0,0,100,0), +(@PATH,10,3017.465,301.0079,204.943,0,0,0,100,0); + +SET @NPC := 99094; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27682,571,1,1,24743,0,3138.133,520.6823,53.44044,1.91463,120,0,0,38440,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3120.694,487.4651,73.32948,0,0,0,100,0), +(@PATH,2,3094.569,488.8283,89.30162,0,0,0,100,0), +(@PATH,3,3076.394,504.3694,101.9128,0,0,0,100,0), +(@PATH,4,3073.121,536.1434,118.3021,0,0,0,100,0), +(@PATH,5,3100.686,550.8791,135.0522,0,0,0,100,0), +(@PATH,6,3133.567,533.2503,156.4133,0,0,0,100,0), +(@PATH,7,3128.940,498.2000,185.3022,0,0,0,100,0), +(@PATH,8,3104.875,485.1591,211.9410,0,0,0,100,0), +(@PATH,9,3078.965,493.2044,233.2187,0,0,0,100,0), +(@PATH,10,3077.378,529.8601,246.1916,0,0,0,100,0), +(@PATH,11,3104.640,532.739,246.1916,0,0,0,100,0), +(@PATH,12,3124.398,511.3354,246.1916,0,0,0,100,0), +(@PATH,13,3106.461,485.7477,246.1916,0,0,0,100,0), +(@PATH,14,3074.75,501.1113,246.1916,0,0,0,100,0), +(@PATH,15,3080.605,533.5042,222.6366,0,0,0,100,0), +(@PATH,16,3108.456,548.174,194.8869,0,0,0,100,0), +(@PATH,17,3138.865,510.0685,159.4426,0,0,0,100,0), +(@PATH,18,3107.084,484.058,121.3038,0,0,0,100,0), +(@PATH,19,3066.059,511.5332,94.97042,0,0,0,100,0), +(@PATH,20,3084.679,555.8902,74.52598,0,0,0,100,0), +(@PATH,21,3128.865,543.4575,51.55369,0,0,0,100,0), +(@PATH,22,3132.671,497.0408,51.55369,0,0,0,100,0), +(@PATH,23,3083.713,484.3025,51.55369,0,0,0,100,0), +(@PATH,24,3062.465,530.1815,51.55369,0,0,0,100,0), +(@PATH,25,3100.407,561.9063,51.55369,0,0,0,100,0), +(@PATH,26,3138.133,520.6823,53.44044,0,0,0,100,0); + +SET @NPC := 99095; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27682,571,1,1,24743,0,3199.019,490.8836,212.5729,1.91463,120,0,0,38440,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3131.874,451.6094,212.5729,0,0,0,100,0), +(@PATH,2,3066.175,466.9917,212.5729,0,0,0,100,0), +(@PATH,3,3015.529,515.9183,212.5729,0,0,0,100,0), +(@PATH,4,3032.398,624.4706,212.5729,0,0,0,100,0), +(@PATH,5,3123.448,648.5508,212.5729,0,0,0,100,0), +(@PATH,6,3201.826,572.715,212.5729,0,0,0,100,0), +(@PATH,7,3199.019,490.8836,212.5729,0,0,0,100,0); + +SET @NPC := 99096; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27682,571,1,1,24743,0,3214.422,579.9131,196.0033,1.91463,120,0,0,38440,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3133.856,625.1009,196.0033,0,0,0,100,0), +(@PATH,2,3066.991,599.8026,196.0033,0,0,0,100,0), +(@PATH,3,3045.829,536.076,196.0033,0,0,0,100,0), +(@PATH,4,3064.8,436.205,196.0033,0,0,0,100,0), +(@PATH,5,3149.34,424.2586,196.0033,0,0,0,100,0), +(@PATH,6,3217.921,481.3083,196.0033,0,0,0,100,0), +(@PATH,7,3214.422,579.9131,196.0033,0,0,0,100,0); + +SET @NPC := 99097; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27682,571,1,1,24743,0,3106.429,348.3322,212.4711,1.91463,120,0,0,38440,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3184.002,431.2766,212.4711,0,0,0,100,0), +(@PATH,2,3166.134,532.8875,212.4711,0,0,0,100,0), +(@PATH,3,3080.641,574.7059,212.4711,0,0,0,100,0), +(@PATH,4,2963.504,564.834,212.4711,0,0,0,100,0), +(@PATH,5,2918.588,502.0504,212.4711,0,0,0,100,0), +(@PATH,6,2949.235,405.6514,212.4711,0,0,0,100,0), +(@PATH,7,3106.429,348.3322,212.4711,0,0,0,100,0); + +SET @NPC := 99098; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27682,571,1,1,24743,0,3129.027,582.4556,247.3863,1.91463,120,0,0,38440,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3188.686,528.622,247.3863,0,0,0,100,0), +(@PATH,2,3166.479,466.4643,247.3863,0,0,0,100,0), +(@PATH,3,3107.782,429.4197,247.3863,0,0,0,100,0), +(@PATH,4,3030.916,459.3344,247.3863,0,0,0,100,0), +(@PATH,5,3014.312,531.3731,247.3863,0,0,0,100,0), +(@PATH,6,3058.55,581.8262,247.3863,0,0,0,100,0), +(@PATH,7,3129.027,582.4556,247.3863,0,0,0,100,0); + +SET @NPC := 99099; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27682,571,1,1,24743,0,3691.676,352.0933,342.2254,1.91463,120,0,0,38440,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3662.692,328.2304,338.4197,0,0,0,100,0), +(@PATH,2,3648.806,293.8063,321.0587,0,0,0,100,0), +(@PATH,3,3677.441,213.8859,320.1976,0,0,0,100,0), +(@PATH,4,3615.31,209.5691,324.1698,0,0,0,100,0), +(@PATH,5,3637.643,254.0089,332.7251,0,0,0,100,0), +(@PATH,6,3699.886,260.6509,327.8641,0,0,0,100,0), +(@PATH,7,3720.373,308.941,337.7808,0,0,0,100,0), +(@PATH,8,3691.676,352.0933,342.2254,0,0,0,100,0); + +SET @NPC := 99093; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27682,571,1,1,24743,0,3036.494,602.2036,179.671,1.91463,120,0,0,38440,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3100.145,600.0773,179.671,0,0,0,100,0), +(@PATH,2,3230.972,531.9783,179.671,0,0,0,100,0), +(@PATH,3,3261.28,445.4492,179.671,0,0,0,100,0), +(@PATH,4,3185.334,349.6381,179.671,0,0,0,100,0), +(@PATH,5,3031.361,375.153,179.671,0,0,0,100,0), +(@PATH,6,2951.565,490.5297,179.671,0,0,0,100,0), +(@PATH,7,3006.273,602.823,179.671,0,0,0,100,0), +(@PATH,8,3140.882,604.8052,179.671,0,0,0,100,0), +(@PATH,9,3279.177,536.7864,179.671,0,0,0,100,0), +(@PATH,10,3342.035,451.1805,179.671,0,0,0,100,0), +(@PATH,11,3373.871,409.5802,179.671,0,0,0,100,0), +(@PATH,12,3418.399,323.2935,179.671,0,0,0,100,0), +(@PATH,13,3432.266,253.5685,179.671,0,0,0,100,0), +(@PATH,14,3376.006,177.8496,179.671,0,0,0,100,0), +(@PATH,15,3328.437,226.3789,179.671,0,0,0,100,0), +(@PATH,16,3336.244,307.4113,179.671,0,0,0,100,0), +(@PATH,17,3381.182,333.7066,179.671,0,0,0,100,0), +(@PATH,18,3478.52,398.1222,179.671,0,0,0,100,0), +(@PATH,19,3574.011,383.5956,179.671,0,0,0,100,0), +(@PATH,20,3661.792,400.2125,179.671,0,0,0,100,0), +(@PATH,21,3700.764,494.1714,179.671,0,0,0,100,0), +(@PATH,22,3602.784,552.9866,179.671,0,0,0,100,0), +(@PATH,23,3539.342,521.9033,179.671,0,0,0,100,0), +(@PATH,24,3523.356,456.0128,179.671,0,0,0,100,0), +(@PATH,25,3618.041,362.6289,179.671,0,0,0,100,0), +(@PATH,26,3723.684,327.7586,179.671,0,0,0,100,0), +(@PATH,27,3773.446,249.6754,179.671,0,0,0,100,0), +(@PATH,28,3749.611,152.5128,179.671,0,0,0,100,0), +(@PATH,29,3695.312,141.0493,179.671,0,0,0,100,0), +(@PATH,30,3651.431,217.0924,179.671,0,0,0,100,0), +(@PATH,31,3683.438,319.0038,179.671,0,0,0,100,0), +(@PATH,32,3748.601,338.1269,179.671,0,0,0,100,0), +(@PATH,33,3792.042,245.4839,179.671,0,0,0,100,0), +(@PATH,34,3735.548,180.4323,179.671,0,0,0,100,0), +(@PATH,35,3618.281,171.1228,179.671,0,0,0,100,0), +(@PATH,36,3474.684,137.1242,179.671,0,0,0,100,0), +(@PATH,37,3479.782,49.90799,179.671,0,0,0,100,0), +(@PATH,38,3558.278,30.76975,179.671,0,0,0,100,0), +(@PATH,39,3629.689,60.77876,179.671,0,0,0,100,0), +(@PATH,40,3630.145,127.0798,179.671,0,0,0,100,0), +(@PATH,41,3490.695,175.1472,179.671,0,0,0,100,0), +(@PATH,42,3366.718,224.9415,179.671,0,0,0,100,0), +(@PATH,43,3212.591,294.8876,179.671,0,0,0,100,0), +(@PATH,44,3076.071,364.5977,179.671,0,0,0,100,0), +(@PATH,45,2990.75,457.3708,179.671,0,0,0,100,0), +(@PATH,46,2984.907,530.0489,179.671,0,0,0,100,0), +(@PATH,47,3036.494,602.2036,179.671,0,0,0,100,0); + +SET @NPC := 99103; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27682,571,1,1,24743,0,3065.57,646.0688,229.7383,1.91463,120,0,0,38440,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3133.651,599.4818,229.7383,0,0,0,100,0), +(@PATH,2,3196.173,510.7455,229.7383,0,0,0,100,0), +(@PATH,3,3310.401,346.2189,229.7383,0,0,0,100,0), +(@PATH,4,3407.27,144.2138,229.7383,0,0,0,100,0), +(@PATH,5,3526.717,72.89225,229.7383,0,0,0,100,0), +(@PATH,6,3672.079,141.219,229.7383,0,0,0,100,0), +(@PATH,7,3713.506,314.0188,229.7383,0,0,0,100,0), +(@PATH,8,3602.6,431.6985,229.7383,0,0,0,100,0), +(@PATH,9,3408.532,364.4567,229.7383,0,0,0,100,0), +(@PATH,10,3217.656,309.1964,229.7383,0,0,0,100,0), +(@PATH,11,3061.193,324.0175,229.7383,0,0,0,100,0), +(@PATH,12,2959.836,412.4154,229.7383,0,0,0,100,0), +(@PATH,13,2945.925,545.2357,229.7383,0,0,0,100,0), +(@PATH,14,3065.57,646.0688,229.7383,0,0,0,100,0); + +SET @NPC := 99104; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27682,571,1,1,24743,0,3112.661,560.2861,197.5214,1.91463,120,0,0,38440,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3166.947,533.783,197.5214,0,0,0,100,0), +(@PATH,2,3204.218,503.2988,197.5214,0,0,0,100,0), +(@PATH,3,3258.251,466.3165,197.5214,0,0,0,100,0), +(@PATH,4,3367.959,364.4092,197.5214,0,0,0,100,0), +(@PATH,5,3407.955,305.4363,197.5214,0,0,0,100,0), +(@PATH,6,3451.267,201.594,197.5214,0,0,0,100,0), +(@PATH,7,3508.874,166.8426,197.5214,0,0,0,100,0), +(@PATH,8,3633.496,151.127,197.5214,0,0,0,100,0), +(@PATH,9,3678.77,73.99848,197.5214,0,0,0,100,0), +(@PATH,10,3653.132,23.86263,197.5214,0,0,0,100,0), +(@PATH,11,3582.038,62.69965,197.5214,0,0,0,100,0), +(@PATH,12,3586.156,134.1242,197.5214,0,0,0,100,0), +(@PATH,13,3645.95,187.412,197.5214,0,0,0,100,0), +(@PATH,14,3699.768,345.5867,197.5214,0,0,0,100,0), +(@PATH,15,3755.733,466.6079,197.5214,0,0,0,100,0), +(@PATH,16,3695.944,599.8013,197.5214,0,0,0,100,0), +(@PATH,17,3631.838,570.2178,197.5214,0,0,0,100,0), +(@PATH,18,3620.732,470.3869,197.5214,0,0,0,100,0), +(@PATH,19,3653.033,441.836,197.5214,0,0,0,100,0), +(@PATH,20,3726.417,408.7439,197.5214,0,0,0,100,0), +(@PATH,21,3768.67,340.4243,197.5214,0,0,0,100,0), +(@PATH,22,3734.631,281.2856,197.5214,0,0,0,100,0), +(@PATH,23,3670.002,288.5108,197.5214,0,0,0,100,0), +(@PATH,24,3637.37,399.2112,197.5214,0,0,0,100,0), +(@PATH,25,3572.382,439.8372,197.5214,0,0,0,100,0), +(@PATH,26,3485.629,383.2211,197.5214,0,0,0,100,0), +(@PATH,27,3408.692,361.6136,197.5214,0,0,0,100,0), +(@PATH,28,3363.01,438.3368,197.5214,0,0,0,100,0), +(@PATH,29,3435.608,478.5367,197.5214,0,0,0,100,0), +(@PATH,30,3498.484,443.0669,197.5214,0,0,0,100,0), +(@PATH,31,3470.396,344.2875,197.5214,0,0,0,100,0), +(@PATH,32,3372.963,191.8817,197.5214,0,0,0,100,0), +(@PATH,33,3290.335,164.9094,197.5214,0,0,0,100,0), +(@PATH,34,3226.219,218.6132,197.5214,0,0,0,100,0), +(@PATH,35,3232.448,290.6222,197.5214,0,0,0,100,0), +(@PATH,36,3304.077,350.0902,197.5214,0,0,0,100,0), +(@PATH,37,3418.385,307.068,197.5214,0,0,0,100,0), +(@PATH,38,3440.642,196.0552,197.5214,0,0,0,100,0), +(@PATH,39,3388.76,137.5194,197.5214,0,0,0,100,0), +(@PATH,40,3299.691,166.3526,197.5214,0,0,0,100,0), +(@PATH,41,3197.989,286.0815,197.5214,0,0,0,100,0), +(@PATH,42,3124.057,342.0608,197.5214,0,0,0,100,0), +(@PATH,43,3029.794,412.821,197.5214,0,0,0,100,0), +(@PATH,44,3027.204,518.2308,197.5214,0,0,0,100,0), +(@PATH,45,3112.661,560.2861,197.5214,0,0,0,100,0); + +SET @NPC := 99105; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27682,571,1,1,24743,0,3040.376,545.7573,223.7107,1.91463,120,0,0,38440,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3066.4,533.701,223.7107,0,0,0,100,0), +(@PATH,2,3184.873,458.7727,223.7107,0,0,0,100,0), +(@PATH,3,3308.346,361.982,223.7107,0,0,0,100,0), +(@PATH,4,3472.517,346.546,223.7107,0,0,0,100,0), +(@PATH,5,3580.564,383.8688,223.7107,0,0,0,100,0), +(@PATH,6,3656.45,349.4831,223.7107,0,0,0,100,0), +(@PATH,7,3671.57,291.0071,223.7107,0,0,0,100,0), +(@PATH,8,3637.499,197.3902,223.7107,0,0,0,100,0), +(@PATH,9,3527.828,157.279,223.7107,0,0,0,100,0), +(@PATH,10,3449.215,208.4113,223.7107,0,0,0,100,0), +(@PATH,11,3406.054,178.4773,223.7107,0,0,0,100,0), +(@PATH,12,3456.503,129.8825,223.7107,0,0,0,100,0), +(@PATH,13,3570.421,124.2369,223.7107,0,0,0,100,0), +(@PATH,14,3636.482,214.1168,223.7107,0,0,0,100,0), +(@PATH,15,3649.198,312.7206,223.7107,0,0,0,100,0), +(@PATH,16,3584.864,367.9254,223.7107,0,0,0,100,0), +(@PATH,17,3498.865,377.1867,223.7107,0,0,0,100,0), +(@PATH,18,3446.663,323.5181,223.7107,0,0,0,100,0), +(@PATH,19,3418.987,266.998,223.7107,0,0,0,100,0), +(@PATH,20,3325.219,278.7927,223.7107,0,0,0,100,0), +(@PATH,21,3246.293,325.4047,223.7107,0,0,0,100,0), +(@PATH,22,3136.991,394.2709,223.7107,0,0,0,100,0), +(@PATH,23,3057.987,457.7468,223.7107,0,0,0,100,0), +(@PATH,24,3007.479,511.7082,223.7107,0,0,0,100,0), +(@PATH,25,3012.345,538.7167,223.7107,0,0,0,100,0), +(@PATH,26,3040.376,545.7573,223.7107,0,0,0,100,0); + +-- Azure Dragon +UPDATE `creature_template` SET `speed_walk`=7/2,`speed_run`=15/7,`InhabitType`=4 WHERE `entry`=27608; + +SET @NPC := 99105; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27608,571,1,1,24140,0,3177.857,623.9463,234.0692,1.91463,120,0,0,92538,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3062.52,435.5133,234.0692,0,0,0,100,0), +(@PATH,2,3125.572,288.5948,234.0692,0,0,0,100,0), +(@PATH,3,3411.13,158.2311,234.0692,0,0,0,100,0), +(@PATH,4,3681.013,161.0803,234.0692,0,0,0,100,0), +(@PATH,5,3815.275,311.0847,234.0692,0,0,0,100,0), +(@PATH,6,3773.807,472.041,234.0692,0,0,0,100,0), +(@PATH,7,3576.037,531.0521,234.0692,0,0,0,100,0), +(@PATH,8,3435.667,344.3725,234.0692,0,0,0,100,0), +(@PATH,9,3480.011,109.5501,234.0692,0,0,0,100,0), +(@PATH,10,3702.724,-30.66547,234.0692,0,0,0,100,0), +(@PATH,11,3889.816,54.52344,234.0692,0,0,0,100,0), +(@PATH,12,3914.841,319.0804,234.0692,0,0,0,100,0), +(@PATH,13,3695.273,610.4755,234.0692,0,0,0,100,0), +(@PATH,14,3389.431,691.5984,234.0692,0,0,0,100,0), +(@PATH,15,3177.857,623.9463,234.0692,0,0,0,100,0); + +SET @NPC := 99106; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27608,571,1,1,24140,0,2980.341,629.1049,218.5251,1.91463,120,0,0,92538,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3128.300,641.3470,218.5251,0,0,0,100,0), +(@PATH,2,3231.236,534.2712,218.5251,0,0,0,100,0), +(@PATH,3,3229.198,417.0781,218.5251,0,0,0,100,0), +(@PATH,4,3131.435,332.9997,218.5251,0,0,0,100,0), +(@PATH,5,2990.912,336.3741,206.4763,0,0,0,100,0), +(@PATH,6,2871.583,422.1004,206.4763,0,0,0,100,0), +(@PATH,7,2881.663,578.8079,206.4763,0,0,0,100,0), +(@PATH,8,2980.341,629.1049,218.5251,0,0,0,100,0); + +SET @NPC := 99107; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27608,571,1,1,24140,0,3488.651,-5.619141,169.4104,1.91463,120,0,0,92538,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3338.837,206.9924,169.4104,0,0,0,100,0), +(@PATH,2,3077.402,282.2865,169.4104,0,0,0,100,0), +(@PATH,3,2799.517,249.9982,169.4104,0,0,0,100,0), +(@PATH,4,2641.98,389.0734,169.4104,0,0,0,100,0), +(@PATH,5,2739.034,565.4708,169.4104,0,0,0,100,0), +(@PATH,6,3044.569,485.4482,169.4104,0,0,0,100,0), +(@PATH,7,3169.199,460.6385,169.4104,0,0,0,100,0), +(@PATH,8,3336.106,465.7545,169.4104,0,0,0,100,0), +(@PATH,9,3630.246,386.4513,169.4104,0,0,0,100,0), +(@PATH,10,3803.202,250.7272,169.4104,0,0,0,100,0), +(@PATH,11,3770.406,24.9643,169.4104,0,0,0,100,0), +(@PATH,12,3488.651,-5.619141,169.4104,0,0,0,100,0); + +SET @NPC := 99108; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27608,571,1,1,24140,0,3542.247,134.1484,169.6936,1.91463,120,0,0,92538,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3506.288,141.7649,169.6936,0,0,0,100,0), +(@PATH,2,3378.177,251.381,169.6936,0,0,0,100,0), +(@PATH,3,3448.559,417.0887,169.6936,0,0,0,100,0), +(@PATH,4,3659.633,429.129,169.6936,0,0,0,100,0), +(@PATH,5,3726.806,236.8274,169.6936,0,0,0,100,0), +(@PATH,6,3554.261,69.58746,169.6936,0,0,0,100,0), +(@PATH,7,3337.373,175.2911,169.6936,0,0,0,100,0), +(@PATH,8,3292.872,421.84,169.6936,0,0,0,100,0), +(@PATH,9,3355.351,609.4697,169.6936,0,0,0,100,0), +(@PATH,10,3233.689,777.6954,207.249,0,0,0,100,0), +(@PATH,11,3049.014,721.6703,224.4991,0,0,0,100,0), +(@PATH,12,3044.268,566.5984,169.6936,0,0,0,100,0), +(@PATH,13,3142.397,481.2142,169.6936,0,0,0,100,0), +(@PATH,14,3328.336,435.8111,169.6936,0,0,0,100,0), +(@PATH,15,3583.232,539.7742,169.6936,0,0,0,100,0), +(@PATH,16,3799.81,460.638,169.6936,0,0,0,100,0), +(@PATH,17,3717.946,244.38,169.6936,0,0,0,100,0), +(@PATH,18,3542.247,134.1484,169.6936,0,0,0,100,0); + +SET @NPC := 99109; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27608,571,1,1,24140,0,3590.88,69.88932,149.1064,1.91463,120,0,0,92538,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3349.674,233.3671,149.1064,0,0,0,100,0), +(@PATH,2,3050.534,331.2801,149.1064,0,0,0,100,0), +(@PATH,3,2982.76,530.9803,149.1064,0,0,0,100,0), +(@PATH,4,3091.488,621.5792,149.1064,0,0,0,100,0), +(@PATH,5,3227.927,595.5925,149.1064,0,0,0,100,0), +(@PATH,6,3467.181,481.7014,149.1064,0,0,0,100,0), +(@PATH,7,3708.623,396.748,149.1064,0,0,0,100,0), +(@PATH,8,3763.585,194.9491,149.1064,0,0,0,100,0), +(@PATH,9,3590.88,69.88932,149.1064,0,0,0,100,0); + +SET @NPC := 99110; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27608,571,1,1,24140,0,3424.549,257.6351,132.4231,1.91463,120,0,0,92538,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3523.625,148.6501,132.4231,0,0,0,100,0), +(@PATH,2,3671.965,176.3331,132.4231,0,0,0,100,0), +(@PATH,3,3721.304,302.0294,132.4231,0,0,0,100,0), +(@PATH,4,3586.378,436.0151,132.4231,0,0,0,100,0), +(@PATH,5,3398.783,363.715,132.4231,0,0,0,100,0), +(@PATH,6,3201.002,184.2853,132.4231,0,0,0,100,0), +(@PATH,7,3033.273,261.4108,132.4231,0,0,0,100,0), +(@PATH,8,3020.73,417.366,132.4231,0,0,0,100,0), +(@PATH,9,3134.54,559.4572,132.4231,0,0,0,100,0), +(@PATH,10,3286.472,590.3685,132.4231,0,0,0,100,0), +(@PATH,11,3370.537,476.4369,132.4231,0,0,0,100,0), +(@PATH,12,3424.549,257.6351,132.4231,0,0,0,100,0); + +SET @NPC := 99111; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27608,571,1,1,24140,0,3485.543,172.4427,356.9669,1.91463,120,0,0,92538,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3617.296,247.1156,357.3557,0,0,0,100,0), +(@PATH,2,3589.83,487.236,356.9669,0,0,0,100,0), +(@PATH,3,3417.021,598.9542,356.9669,0,0,0,100,0), +(@PATH,4,3230.356,615.1475,346.9949,0,0,0,100,0), +(@PATH,5,3061.912,567.3838,332.8835,0,0,0,100,0), +(@PATH,6,2990.214,429.7983,332.8835,0,0,0,100,0), +(@PATH,7,3203.85,198.3223,332.8835,0,0,0,100,0), +(@PATH,8,3485.543,172.4427,356.9669,0,0,0,100,0); + +SET @NPC := 99112; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27608,571,1,1,24140,0,3037.007,696.7842,221.9052,1.91463,120,0,0,92538,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3232.783,646.5775,221.9052,0,0,0,100,0), +(@PATH,2,3397.601,486.7037,221.9052,0,0,0,100,0), +(@PATH,3,3619.899,375.7408,221.9052,0,0,0,100,0), +(@PATH,4,3828.234,403.8529,221.9052,0,0,0,100,0), +(@PATH,5,3950.75,272.4162,221.9052,0,0,0,100,0), +(@PATH,6,3930.549,80.84885,221.9052,0,0,0,100,0), +(@PATH,7,3731.407,15.2053,221.9052,0,0,0,100,0), +(@PATH,8,3520.57,124.0501,221.9052,0,0,0,100,0), +(@PATH,9,3319.81,205.5578,221.9052,0,0,0,100,0), +(@PATH,10,3141.857,364.067,221.9052,0,0,0,100,0), +(@PATH,11,3020.412,487.4164,211.0165,0,0,0,100,0), +(@PATH,12,2956.715,583.454,211.0165,0,0,0,100,0), +(@PATH,13,3037.007,696.7842,221.9052,0,0,0,100,0); + +SET @NPC := 99113; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27608,571,1,1,24140,0,3723.934,203.8074,149.416,1.91463,120,0,0,92538,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3679.447,16.12554,149.416,0,0,0,100,0), +(@PATH,2,3507.391,-64.8457,149.416,0,0,0,100,0), +(@PATH,3,3313.535,24.35514,149.416,0,0,0,100,0), +(@PATH,4,3106.862,208.8542,149.416,0,0,0,100,0), +(@PATH,5,2972.297,312.9027,149.416,0,0,0,100,0), +(@PATH,6,2980.743,486.7836,149.416,0,0,0,100,0), +(@PATH,7,3066.302,566.5879,149.416,0,0,0,100,0), +(@PATH,8,3202.917,598.3837,149.416,0,0,0,100,0), +(@PATH,9,3404.993,515.3446,149.416,0,0,0,100,0), +(@PATH,10,3425.663,255.2629,149.416,0,0,0,100,0), +(@PATH,11,3211.951,114.9269,149.416,0,0,0,100,0), +(@PATH,12,3000.342,217.3278,149.416,0,0,0,100,0), +(@PATH,13,2963.022,422.1858,149.416,0,0,0,100,0), +(@PATH,14,3166.04,544.8924,149.416,0,0,0,100,0), +(@PATH,15,3358.634,487.4157,149.416,0,0,0,100,0), +(@PATH,16,3582.295,398.5222,149.416,0,0,0,100,0), +(@PATH,17,3723.934,203.8074,149.416,0,0,0,100,0); + +SET @NPC := 99114; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27608,571,1,1,24140,0,3737.246,441.4471,163.1518,1.91463,120,0,0,92538,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3681.252,275.5609,163.1518,0,0,0,100,0), +(@PATH,2,3715.161,150.0893,163.1518,0,0,0,100,0), +(@PATH,3,3533.266,-10.55339,163.1518,0,0,0,100,0), +(@PATH,4,3173.073,184.9491,151.4297,0,0,0,100,0), +(@PATH,5,2936.554,340.61,144.8464,0,0,0,100,0), +(@PATH,6,2956.506,455.4837,133.5686,0,0,0,100,0), +(@PATH,7,3032.773,515.5552,122.4019,0,0,0,100,0), +(@PATH,8,3178.638,523.1923,126.2074,0,0,0,100,0), +(@PATH,9,3413.29,470.1859,126.2074,0,0,0,100,0), +(@PATH,10,3572.062,487.1479,144.1519,0,0,0,100,0), +(@PATH,11,3523.323,611.9957,144.1519,0,0,0,100,0), +(@PATH,12,3655.581,727.4493,168.9574,0,0,0,100,0), +(@PATH,13,3772.614,626.3416,163.1518,0,0,0,100,0), +(@PATH,14,3737.246,441.4471,163.1518,0,0,0,100,0); + +SET @NPC := 99115; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27608,571,1,1,24140,0,3490.259,76.95345,197.2588,1.91463,120,0,0,92538,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3733.682,129.7717,197.2588,0,0,0,100,0), +(@PATH,2,3864.96,508.5689,197.2588,0,0,0,100,0), +(@PATH,3,3552.458,522.002,197.2588,0,0,0,100,0), +(@PATH,4,3285.309,616.7151,197.2588,0,0,0,100,0), +(@PATH,5,3036.671,572.0858,197.2588,0,0,0,100,0), +(@PATH,6,2932.137,492.1258,197.2588,0,0,0,100,0), +(@PATH,7,2908.21,365.3067,197.2588,0,0,0,100,0), +(@PATH,8,3001.178,249.2961,197.2588,0,0,0,100,0), +(@PATH,9,3292.851,156.1309,197.2588,0,0,0,100,0), +(@PATH,10,3490.259,76.95345,197.2588,0,0,0,100,0); + +SET @NPC := 99116; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27608,571,1,1,24140,0,3484.9,77.65061,181.4013,1.91463,120,0,0,92538,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3231.553,144.962,181.4013,0,0,0,100,0), +(@PATH,2,3093.218,232.0598,181.4013,0,0,0,100,0), +(@PATH,3,3055.291,416.8134,181.4013,0,0,0,100,0), +(@PATH,4,3167.159,544.8934,181.4013,0,0,0,100,0), +(@PATH,5,3351.382,640.3859,181.4013,0,0,0,100,0), +(@PATH,6,3588.236,561.4211,181.4013,0,0,0,100,0), +(@PATH,7,3702.199,377.5353,181.4013,0,0,0,100,0), +(@PATH,8,3664.586,182.5018,181.4013,0,0,0,100,0), +(@PATH,9,3484.9,77.65061,181.4013,0,0,0,100,0); + +SET @NPC := 99117; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27608,571,1,1,24140,0,2938.209,403.6825,200.0642,1.91463,120,0,0,92538,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3000.396,533.5293,200.0642,0,0,0,100,0), +(@PATH,2,3148.834,635.804,200.0642,0,0,0,100,0), +(@PATH,3,3307.068,630.108,200.0642,0,0,0,100,0), +(@PATH,4,3393.553,425.3046,200.0642,0,0,0,100,0), +(@PATH,5,3413.431,212.6353,200.0642,0,0,0,100,0), +(@PATH,6,3566.631,98.43479,200.0642,0,0,0,100,0), +(@PATH,7,3729.045,218.3996,200.0642,0,0,0,100,0), +(@PATH,8,3698.444,417.5869,200.0642,0,0,0,100,0), +(@PATH,9,3524.363,494.4065,200.0642,0,0,0,100,0), +(@PATH,10,3335.302,374.7052,200.0642,0,0,0,100,0), +(@PATH,11,3255.138,189.5002,200.0642,0,0,0,100,0), +(@PATH,12,3111.794,148.6386,200.0642,0,0,0,100,0), +(@PATH,13,2979.718,214.2472,200.0642,0,0,0,100,0), +(@PATH,14,2938.209,403.6825,200.0642,0,0,0,100,0); + +SET @NPC := 99118; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,27608,571,1,1,24140,0,3756.611,216.3398,142.0742,1.91463,120,0,0,92538,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3746.663,468.0216,142.0742,0,0,0,100,0), +(@PATH,2,3489.741,512.316,142.0742,0,0,0,100,0), +(@PATH,3,3277.682,558.9236,142.0742,0,0,0,100,0), +(@PATH,4,3152.218,477.8159,142.0742,0,0,0,100,0), +(@PATH,5,3082.888,432.7688,142.0742,0,0,0,100,0), +(@PATH,6,3016.838,481.925,142.0742,0,0,0,100,0), +(@PATH,7,3033.647,560.426,142.0742,0,0,0,100,0), +(@PATH,8,3162.152,562.8186,142.0742,0,0,0,100,0), +(@PATH,9,3240.709,468.0213,142.0742,0,0,0,100,0), +(@PATH,10,3371.026,259.9583,142.0742,0,0,0,100,0), +(@PATH,11,3535.323,122.4076,142.0742,0,0,0,100,0), +(@PATH,12,3756.611,216.3398,142.0742,0,0,0,100,0); + +-- Wyrmrest Temple Drake + +DELETE FROM `creature` WHERE `guid` IN (100170,100206,100207,100208,100209,100210,100213,100215,100216,100226,130999,131000,131001,131002,131003,131006,131004,131005,131007,131008,131009); + +UPDATE `creature_template` SET `speed_walk`=9/2,`speed_run`=17/7,`InhabitType`=4 WHERE `entry`=26925; + +SET @NPC := 100170; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,26925,571,1,1,6376,0,3423.212,279.9993,128.0342,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3423.212,279.9993,128.0342,0,0,0,100,0), +(@PATH,2,3452.103,334.373,128.0342,0,0,0,100,0), +(@PATH,3,3463.885,390.2345,128.0342,0,0,0,100,0), +(@PATH,4,3459.316,448.6561,128.0342,0,0,0,100,0), +(@PATH,5,3390.542,472.8465,128.0342,0,0,0,100,0), +(@PATH,6,3343.515,429.0621,128.0342,0,0,0,100,0), +(@PATH,7,3319.781,350.6016,128.0342,0,0,0,100,0), +(@PATH,8,3342.761,276.0052,128.0342,0,0,0,100,0), +(@PATH,9,3381.065,257.5826,128.0342,0,0,0,100,0); + +SET @NPC := 100206; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,26925,571,1,1,6376,0,3662.692,328.2304,338.4197,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3662.692,328.2304,338.4197,0,0,0,100,0), +(@PATH,2,3648.806,293.8063,321.0587,0,0,0,100,0), +(@PATH,3,3677.441,213.8859,320.1976,0,0,0,100,0), +(@PATH,4,3615.31,209.5691,324.1698,0,0,0,100,0), +(@PATH,5,3637.643,254.0089,332.7251,0,0,0,100,0), +(@PATH,6,3699.886,260.6509,327.8641,0,0,0,100,0), +(@PATH,7,3720.373,308.941,337.7808,0,0,0,100,0), +(@PATH,8,3691.676,352.0933,342.2254,0,0,0,100,0); + +SET @NPC := 100207; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,26925,571,1,1,6376,0,3657.962,213.0957,169.3146,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3657.962,213.0957,169.3146,0,0,0,100,0), +(@PATH,2,3667.34,194.262,169.3146,0,0,0,100,0), +(@PATH,3,3675.021,149.4151,169.3146,0,0,0,100,0), +(@PATH,4,3676.687,103.2968,169.3146,0,0,0,100,0), +(@PATH,5,3657.863,59.17426,169.3146,0,0,0,100,0), +(@PATH,6,3622.093,33.20833,169.3146,0,0,0,100,0), +(@PATH,7,3595.094,36.79308,169.3146,0,0,0,100,0), +(@PATH,8,3578.594,58.34657,169.3146,0,0,0,100,0), +(@PATH,9,3553.642,84.92133,169.3146,0,0,0,100,0), +(@PATH,10,3558.182,112.2144,169.3146,0,0,0,100,0), +(@PATH,11,3570.514,135.5537,169.3146,0,0,0,100,0), +(@PATH,12,3596.293,162.6956,169.3146,0,0,0,100,0), +(@PATH,13,3618.115,186.3872,169.3146,0,0,0,100,0), +(@PATH,14,3648.757,225.0738,169.3146,0,0,0,100,0); + +SET @NPC := 100208; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,26925,571,1,1,6376,0,3606.596,396.9579,205.5612,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3606.596,396.9579,205.5612,0,0,0,100,0), +(@PATH,2,3633.08,397.3744,205.5612,0,0,0,100,0), +(@PATH,3,3650.996,425.418,205.5612,0,0,0,100,0), +(@PATH,4,3610.396,457.8707,205.5612,0,0,0,100,0), +(@PATH,5,3510.082,450.9809,205.5612,0,0,0,100,0), +(@PATH,6,3435.127,411.1036,205.5612,0,0,0,100,0), +(@PATH,7,3388.161,429.3571,205.5612,0,0,0,100,0), +(@PATH,8,3406.552,481.8189,205.5612,0,0,0,100,0), +(@PATH,9,3518.298,499.1305,205.5612,0,0,0,100,0), +(@PATH,10,3568.027,418.6763,205.5612,0,0,0,100,0); + +SET @NPC := 100209; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,26925,571,1,1,6376,0,3648.806,293.8063,321.0587,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3648.806,293.8063,321.0587,0,0,0,100,0), +(@PATH,2,3677.441,213.8859,320.1976,0,0,0,100,0), +(@PATH,3,3615.31,209.5691,324.1698,0,0,0,100,0), +(@PATH,4,3637.643,254.0089,332.7251,0,0,0,100,0), +(@PATH,5,3699.886,260.6509,327.8641,0,0,0,100,0), +(@PATH,6,3720.373,308.941,337.7808,0,0,0,100,0), +(@PATH,7,3691.676,352.0933,342.2254,0,0,0,100,0), +(@PATH,8,3662.692,328.2304,338.4197,0,0,0,100,0); + +SET @NPC := 100210; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,26925,571,1,1,6376,0,3452.103,334.373,128.0342,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3452.103,334.373,128.0342,0,0,0,100,0), +(@PATH,2,3334.853,530.1229,197.2842,0,0,0,100,0), +(@PATH,3,3325.103,359.123,195.7842,0,0,0,100,0), +(@PATH,4,3499.853,334.623,195.0342,0,0,0,100,0), +(@PATH,5,3263.353,527.8729,197.2842,0,0,0,100,0), +(@PATH,6,3706.853,80.87296,195.7842,0,0,0,100,0), +(@PATH,7,3499.853,334.623,195.0342,0,0,0,100,0), +(@PATH,8,3495.603,493.623,197.2842,0,0,0,100,0), +(@PATH,9,3218.353,177.623,195.7842,0,0,0,100,0); + +SET @NPC := 100213; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,26925,571,1,1,6376,0,3648.806,293.8063,321.0587,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3648.806,293.8063,321.0587,0,0,0,100,0), +(@PATH,2,3588.806,84.30627,390.3087,0,0,0,100,0), +(@PATH,3,3827.556,468.8063,388.3087,0,0,0,100,0), +(@PATH,4,3731.556,38.55627,388.5587,0,0,0,100,0), +(@PATH,5,3454.556,53.30627,390.3087,0,0,0,100,0), +(@PATH,6,3756.306,434.3063,388.3087,0,0,0,100,0), +(@PATH,7,3503.556,54.30627,388.5587,0,0,0,100,0), +(@PATH,8,3795.056,64.55627,390.3087,0,0,0,100,0); + +SET @NPC := 100215; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,26925,571,1,1,6376,0,3606.596,396.9579,205.5612,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3606.596,396.9579,205.5612,0,0,0,100,0), +(@PATH,2,3688.846,165.4579,274.8112,0,0,0,100,0), +(@PATH,3,3601.846,450.2079,273.3112,0,0,0,100,0), +(@PATH,4,3585.346,505.2079,272.8112,0,0,0,100,0), +(@PATH,5,3602.096,174.2079,274.8112,0,0,0,100,0), +(@PATH,6,3446.596,562.4579,273.3112,0,0,0,100,0), +(@PATH,7,3585.346,505.2079,272.8112,0,0,0,100,0), +(@PATH,8,3500.346,153.9579,274.8112,0,0,0,100,0), +(@PATH,9,3571.096,180.2079,273.3112,0,0,0,100,0), +(@PATH,10,3585.346,505.2079,272.8112,0,0,0,100,0); + +SET @NPC := 100216; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,26925,571,1,1,6376,0,3772.475,266.6113,254.1891,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3772.475,266.6113,254.1891,0,0,0,100,0), +(@PATH,2,3887.975,92.86133,323.4391,0,0,0,100,0), +(@PATH,3,3532.475,436.8613,321.6891,0,0,0,100,0), +(@PATH,4,3798.725,252.1113,321.4391,0,0,0,100,0), +(@PATH,5,3886.225,81.11133,323.4391,0,0,0,100,0), +(@PATH,6,3636.975,32.11133,321.6891,0,0,0,100,0), +(@PATH,7,3798.725,252.1113,321.4391,0,0,0,100,0), +(@PATH,8,3747.725,77.61133,323.4391,0,0,0,100,0), +(@PATH,9,3772.475,165.6113,321.6891,0,0,0,100,0), +(@PATH,10,3798.725,252.1113,321.4391,0,0,0,100,0), +(@PATH,11,3899.725,81.86133,323.4391,0,0,0,100,0), +(@PATH,12,3936.975,216.1113,321.6891,0,0,0,100,0), +(@PATH,13,3798.725,252.1113,321.4391,0,0,0,100,0), +(@PATH,14,3755.975,93.86133,323.4391,0,0,0,100,0), +(@PATH,15,3785.475,362.1113,321.9391,0,0,0,100,0), +(@PATH,16,3798.725,252.1113,321.4391,0,0,0,100,0); + +SET @NPC := 100226; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,26925,571,1,1,6376,0,3447.796,171.34,125.7842,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3447.796,171.34,125.7842,0,0,0,100,0), +(@PATH,2,3456.033,100.7345,125.7842,0,0,0,100,0), +(@PATH,3,3388.28,76.85818,125.7842,0,0,0,100,0), +(@PATH,4,3360.649,126.0434,125.7842,0,0,0,100,0), +(@PATH,5,3368.991,199.87,125.7842,0,0,0,100,0), +(@PATH,6,3432.052,296.2538,125.7842,0,0,0,100,0), +(@PATH,7,3465.493,406.8654,125.7842,0,0,0,100,0), +(@PATH,8,3397.028,457.6761,125.7842,0,0,0,100,0), +(@PATH,9,3354.537,408.359,125.7842,0,0,0,100,0), +(@PATH,10,3384.226,319.0551,125.7842,0,0,0,100,0), +(@PATH,11,3433.646,226.0049,125.7842,0,0,0,100,0); + +SET @NPC := 130999; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,26925,571,1,1,6376,0,3750.984,407.8766,254.1891,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3750.984,407.8766,254.1891,0,0,0,100,0), +(@PATH,2,3786.711,439.0684,254.1891,0,0,0,100,0), +(@PATH,3,3830.952,442.1341,254.1891,0,0,0,100,0), +(@PATH,4,3862.503,430.8392,254.1891,0,0,0,100,0), +(@PATH,5,3882.549,422.6376,254.1891,0,0,0,100,0), +(@PATH,6,3890.228,394.8426,254.1891,0,0,0,100,0), +(@PATH,7,3871.091,383.1622,254.1891,0,0,0,100,0), +(@PATH,8,3860.575,369.1732,254.1891,0,0,0,100,0), +(@PATH,9,3840.769,340.5143,257.8279,0,0,0,100,0), +(@PATH,10,3832.232,320.8624,264.8557,0,0,0,100,0), +(@PATH,11,3801.307,290.9948,262.5502,0,0,0,100,0), +(@PATH,12,3775.203,268.874,254.1891,0,0,0,100,0), +(@PATH,13,3772.475,266.6113,254.1891,0,0,0,100,0), +(@PATH,14,3748.613,298.5957,254.1891,0,0,0,100,0), +(@PATH,15,3725.111,325.421,254.1891,0,0,0,100,0), +(@PATH,16,3718.476,358.75,254.1891,0,0,0,100,0), +(@PATH,17,3726.624,371.3951,254.1891,0,0,0,100,0); + +-- Wyrmrest Guardian + +DELETE FROM `creature` WHERE `guid` IN (100823,100824,100825,100826,131035,131036,131037,131038,131039,131040,131041,131042,131043,131044,131045,131046,131047,131048,131049,131050); +UPDATE `creature_template` SET `speed_walk`=7/2,`speed_run`=15/7,`InhabitType`=4 WHERE `entry`=26933; + +SET @NPC := 100823; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,26933,571,1,1,0,0,3791.882,255.4148,152.3366,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3791.882,255.4148,152.3366,0,0,0,100,0), +(@PATH,2,3834.405,230.3203,152.3366,0,0,0,100,0), +(@PATH,3,3876.825,233.7821,152.3366,0,0,0,100,0), +(@PATH,4,3900.443,242.9511,152.3366,0,0,0,100,0), +(@PATH,5,3916.114,280.9176,152.3366,0,0,0,100,0), +(@PATH,6,3906.543,328.6796,152.3366,0,0,0,100,0), +(@PATH,7,3897.018,362.4748,152.3366,0,0,0,100,0), +(@PATH,8,3881.718,402.3574,152.3366,0,0,0,100,0), +(@PATH,9,3858.27,431.4729,152.3366,0,0,0,100,0), +(@PATH,10,3816.65,448.8396,152.3366,0,0,0,100,0), +(@PATH,11,3767.092,457.8965,152.3366,0,0,0,100,0), +(@PATH,12,3720.177,443.4765,152.3366,0,0,0,100,0), +(@PATH,13,3699.901,410.0056,152.3366,0,0,0,100,0), +(@PATH,14,3723.531,374.0899,152.3366,0,0,0,100,0), +(@PATH,15,3739.026,327.0149,152.3366,0,0,0,100,0), +(@PATH,16,3762.99,312.7233,152.3366,0,0,0,100,0), +(@PATH,17,3774.031,299.9361,152.3366,0,0,0,100,0), +(@PATH,18,3786.234,277.9988,152.3366,0,0,0,100,0); + +SET @NPC := 100824; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,26933,571,1,1,0,0,3559.792,412.912,244.8625,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3559.792,412.912,244.8625,0,0,0,100,0), +(@PATH,2,3625.949,456.7731,244.8625,0,0,0,100,0), +(@PATH,3,3683.285,437.189,244.8625,0,0,0,100,0), +(@PATH,4,3727.341,385.3615,244.8625,0,0,0,100,0), +(@PATH,5,3786.656,388.9702,244.8625,0,0,0,100,0), +(@PATH,6,3811.097,463.1342,244.8625,0,0,0,100,0), +(@PATH,7,3769.007,516.1342,244.8625,0,0,0,100,0), +(@PATH,8,3685.209,493.7117,244.8625,0,0,0,100,0), +(@PATH,9,3589.482,475.7777,244.8625,0,0,0,100,0), +(@PATH,10,3491.84,496.9259,244.8625,0,0,0,100,0), +(@PATH,11,3406.895,485.8197,244.8625,0,0,0,100,0), +(@PATH,12,3370.333,427.0351,244.8625,0,0,0,100,0), +(@PATH,13,3411.417,366.7467,244.8625,0,0,0,100,0), +(@PATH,14,3479.214,376.5652,244.8625,0,0,0,100,0); + +SET @NPC := 100825; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,26933,571,1,1,0,0,3424.446,300.7501,194.3189,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3424.446,300.7501,194.3189,0,0,0,100,0), +(@PATH,2,3427.025,177.7048,194.3189,0,0,0,100,0), +(@PATH,3,3508.415,97.62153,194.3189,0,0,0,100,0), +(@PATH,4,3635.289,110.5046,194.3189,0,0,0,100,0), +(@PATH,5,3728.01,244.8104,194.3189,0,0,0,100,0), +(@PATH,6,3655.76,402.0861,194.3189,0,0,0,100,0), +(@PATH,7,3513.567,405.2664,194.3189,0,0,0,100,0); + +SET @NPC := 100826; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,26933,571,1,1,0,0,3457.605,232.8917,280.631,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3457.605,232.8917,280.631,0,0,0,100,0), +(@PATH,2,3414.099,307.4206,280.631,0,0,0,100,0), +(@PATH,3,3470.344,415.2286,280.631,0,0,0,100,0), +(@PATH,4,3607.002,418.6074,280.631,0,0,0,100,0), +(@PATH,5,3711.957,340.5557,280.631,0,0,0,100,0), +(@PATH,6,3720.49,226.3188,280.631,0,0,0,100,0), +(@PATH,7,3642.503,140.184,280.631,0,0,0,100,0), +(@PATH,8,3516.544,159.0889,280.631,0,0,0,100,0); + +SET @NPC := 131035; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,26933,571,1,1,0,0,3559.792,412.912,244.8625,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3559.792,412.912,244.8625,0,0,0,100,0), +(@PATH,2,3625.949,456.7731,244.8625,0,0,0,100,0), +(@PATH,3,3683.285,437.189,244.8625,0,0,0,100,0), +(@PATH,4,3727.341,385.3615,244.8625,0,0,0,100,0), +(@PATH,5,3786.656,388.9702,244.8625,0,0,0,100,0), +(@PATH,6,3811.097,463.1342,244.8625,0,0,0,100,0), +(@PATH,7,3769.007,516.1342,244.8625,0,0,0,100,0), +(@PATH,8,3685.209,493.7117,244.8625,0,0,0,100,0), +(@PATH,9,3589.482,475.7777,244.8625,0,0,0,100,0), +(@PATH,10,3491.84,496.9259,244.8625,0,0,0,100,0), +(@PATH,11,3406.895,485.8197,244.8625,0,0,0,100,0), +(@PATH,12,3370.333,427.0351,244.8625,0,0,0,100,0), +(@PATH,13,3411.417,366.7467,244.8625,0,0,0,100,0), +(@PATH,14,3479.214,376.5652,244.8625,0,0,0,100,0); + +SET @NPC := 131036; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,26933,571,1,1,0,0,3438.608,283.5485,224.3952,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3438.608,283.5485,224.3952,0,0,0,100,0), +(@PATH,2,3422.991,341.0565,224.3952,0,0,0,100,0), +(@PATH,3,3372.117,385.6395,224.3952,0,0,0,100,0), +(@PATH,4,3315.855,342.7029,224.3952,0,0,0,100,0), +(@PATH,5,3294.378,270.6668,224.3952,0,0,0,100,0), +(@PATH,6,3321.572,194.6726,224.3952,0,0,0,100,0), +(@PATH,7,3385.174,162.3308,224.3952,0,0,0,100,0), +(@PATH,8,3437.712,218.1042,224.3952,0,0,0,100,0); + +SET @NPC := 131037; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,26933,571,1,1,0,0,3337.373,175.2911,169.6936,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3337.373,175.2911,169.6936,0,0,0,100,0), +(@PATH,2,3292.872,421.84,169.6936,0,0,0,100,0), +(@PATH,3,3355.351,609.4697,169.6936,0,0,0,100,0), +(@PATH,4,3233.689,777.6954,207.249,0,0,0,100,0), +(@PATH,5,3049.014,721.6703,224.4991,0,0,0,100,0), +(@PATH,6,3044.268,566.5984,169.6936,0,0,0,100,0), +(@PATH,7,3142.397,481.2142,169.6936,0,0,0,100,0), +(@PATH,8,3328.336,435.8111,169.6936,0,0,0,100,0), +(@PATH,9,3583.232,539.7742,169.6936,0,0,0,100,0), +(@PATH,10,3799.81,460.638,169.6936,0,0,0,100,0), +(@PATH,11,3717.946,244.38,169.6936,0,0,0,100,0), +(@PATH,12,3542.247,134.1484,169.6936,0,0,0,100,0), +(@PATH,13,3378.177,251.381,169.6936,0,0,0,100,0), +(@PATH,14,3448.559,417.0887,169.6936,0,0,0,100,0), +(@PATH,15,3659.633,429.129,169.6936,0,0,0,100,0), +(@PATH,16,3726.806,236.8274,169.6936,0,0,0,100,0), +(@PATH,17,3554.261,69.58746,169.6936,0,0,0,100,0); + +SET @NPC := 131038; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,26933,571,1,1,0,0,3738.288,310.6056,206.0655,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3738.288,310.6056,206.0655,0,0,0,100,0), +(@PATH,1,3775.943,320.1521,206.0655,0,0,0,100,0), +(@PATH,1,3791.984,364.0035,206.0655,0,0,0,100,0), +(@PATH,1,3821.821,375.4122,206.0655,0,0,0,100,0), +(@PATH,1,3862.769,402.7154,206.0655,0,0,0,100,0), +(@PATH,1,3833.872,426.7561,206.0655,0,0,0,100,0), +(@PATH,1,3796.899,413.8476,206.0655,0,0,0,100,0), +(@PATH,1,3780.125,433.8598,206.0655,0,0,0,100,0), +(@PATH,1,3736.043,443.3744,206.0655,0,0,0,100,0), +(@PATH,1,3713.603,445.3026,206.0655,0,0,0,100,0), +(@PATH,1,3683.613,406.9387,206.0655,0,0,0,100,0), +(@PATH,1,3706.474,364.4982,206.0655,0,0,0,100,0), +(@PATH,1,3712.073,324.8767,206.0655,0,0,0,100,0); From 4392b499837d5ac2927e422186110a5b160d00fa Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 2 Jun 2012 21:49:58 -0230 Subject: [PATCH 0912/1149] DB/misc: Fix up some flying creatures and remove some creature_addons. --- sql/updates/world/2012_06_02_07_world_Misc.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sql/updates/world/2012_06_02_07_world_Misc.sql diff --git a/sql/updates/world/2012_06_02_07_world_Misc.sql b/sql/updates/world/2012_06_02_07_world_Misc.sql new file mode 100644 index 00000000000..c541819841c --- /dev/null +++ b/sql/updates/world/2012_06_02_07_world_Misc.sql @@ -0,0 +1,6 @@ +-- Fix some Flying Stormpeaks Wyms +UPDATE `creature_addon` SET `bytes1`=50331648 WHERE `guid` IN (101109,101111,101112,101121,101123,101124); +-- Fix some Flying Wild Wyms +UPDATE `creature_addon` SET `bytes1`=50331648 WHERE `guid` IN (202972,202973,202974,202975,202976,202977); +-- remove some bad creature_addon records +DELETE FROM `creature_addon` WHERE `guid` NOT IN (SELECT `guid` FROM `creature`); From 7e454b26ac28250967dbd3519a39ecb5eb6cd014 Mon Sep 17 00:00:00 2001 From: joschiwald Date: Sun, 3 Jun 2012 02:35:00 +0200 Subject: [PATCH 0913/1149] more updates --- ...2012_05_28_01_world_spell_script_names.sql | 28 +- ...012_05_28_02_world_spelldifficulty_dbc.sql | 7 +- .../game/Spells/Auras/SpellAuraEffects.cpp | 122 +------ src/server/game/Spells/Spell.cpp | 43 --- src/server/game/Spells/SpellEffects.cpp | 340 +----------------- .../BattleForMountHyjal/boss_kazrogal.cpp | 102 +++++- .../Ulduar/HallsOfStone/boss_krystallus.cpp | 78 +++- .../scripts/Outland/GruulsLair/boss_gruul.cpp | 89 ++++- .../scripts/Outland/boss_doomlord_kazzak.cpp | 54 ++- src/server/scripts/Spells/spell_dk.cpp | 11 - src/server/scripts/Spells/spell_druid.cpp | 167 ++++++++- src/server/scripts/Spells/spell_generic.cpp | 242 +++++++++++++ src/server/scripts/Spells/spell_hunter.cpp | 55 ++- src/server/scripts/Spells/spell_paladin.cpp | 39 ++ src/server/scripts/Spells/spell_shaman.cpp | 49 +++ 15 files changed, 882 insertions(+), 544 deletions(-) diff --git a/sql/updates/world/2012_05_28_01_world_spell_script_names.sql b/sql/updates/world/2012_05_28_01_world_spell_script_names.sql index 78054aa1555..e1db8fff869 100644 --- a/sql/updates/world/2012_05_28_01_world_spell_script_names.sql +++ b/sql/updates/world/2012_05_28_01_world_spell_script_names.sql @@ -1,9 +1,13 @@ -DELETE FROM `spell_script_names` WHERE `spell_id` IN (-633,781,-746,-8050,-34914,-44457,-48181,-30108,34438,34439,35183,43522,65812,68154,68155,68156,-33763,43421,52551,53608,57762,59990,66093,67957,67958,67959,7057,28832,28833,28834,28835,27831,55638,52942,59837,63322); +DELETE FROM `spell_script_names` WHERE `spell_id` IN (-633,781,-746,1515,6495,-8050,-16972,31789,-34914,-44457,-48181,-30108,34438,34439,35183,43522,65812,68154,68155,68156,52610,61336,-33763,40133,40132,43421,52551,53608,57762,59990,66093,67957,67958,67959,7057,28832,28833,28834,28835,27831,55638,31447,32960,33654,33671,50810,61546,50811,61547,52942,59837,63322,47977,48025,54729,71342,72286,74856,75614,75973); INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES (-633, 'spell_pal_lay_on_hands'), (781, 'spell_hun_disengage'), (-746, 'spell_gen_bandage'), +(1515, 'spell_hun_tame_beast'), +(6495, 'spell_sha_sentry_totem'), (-8050, 'spell_sha_flame_shock'), +(-16972,'spell_dru_predatory_strikes'), +(31789, 'spell_pal_righteous_defense'), (-34914,'spell_pri_vampiric_touch'), (-44457,'spell_mage_living_bomb'), (-48181,'spell_warl_haunt'), @@ -16,7 +20,11 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES (68154, 'spell_faction_champion_warl_unstable_affliction'), (68155, 'spell_faction_champion_warl_unstable_affliction'), (68156, 'spell_faction_champion_warl_unstable_affliction'), +(52610, 'spell_dru_savage_roar'), +(61336, 'spell_dru_survival_instincts'), (-33763,'spell_dru_lifebloom'), +(40133, 'spell_gen_summon_fire_elemental'), +(40132, 'spell_gen_summon_earth_elemental'), (43421, 'spell_hexlord_lifebloom'), (52551, 'spell_tur_ragepaw_lifebloom'), (53608, 'spell_cenarion_scout_lifebloom'), @@ -33,6 +41,22 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES (28835, 'spell_four_horsemen_mark'), (27831, 'spell_gothic_shadow_bolt_volley'), (55638, 'spell_gothic_shadow_bolt_volley'), +(31447, 'spell_mark_of_kazrogal'), +(32960, 'spell_mark_of_kazzak'), +(33654, 'spell_gruul_shatter'), +(33671, 'spell_gruul_shatter_effect'), +(50810, 'spell_krystallus_shatter'), +(61546, 'spell_krystallus_shatter'), +(50811, 'spell_krystallus_shatter_effect'), +(61547, 'spell_krystallus_shatter_effect'), (52942, 'spell_loken_pulsing_shockwave'), (59837, 'spell_loken_pulsing_shockwave'), -(63322, 'spell_general_vezax_saronite_vapors'); +(63322, 'spell_general_vezax_saronite_vapors'), +(47977, 'spell_magic_broom'), +(48025, 'spell_headless_horseman_mount'), +(54729, 'spell_winged_steed_of_the_ebon_blade'), +(71342, 'spell_big_love_rocket'), +(72286, 'spell_invincible'), +(74856, 'spell_blazing_hippogryph'), +(75614, 'spell_celestial_steed'), +(75973, 'spell_x53_touring_rocket'); diff --git a/sql/updates/world/2012_05_28_02_world_spelldifficulty_dbc.sql b/sql/updates/world/2012_05_28_02_world_spelldifficulty_dbc.sql index 93749c9c5cd..8caaf1a6fc7 100644 --- a/sql/updates/world/2012_05_28_02_world_spelldifficulty_dbc.sql +++ b/sql/updates/world/2012_05_28_02_world_spelldifficulty_dbc.sql @@ -1,5 +1,6 @@ SET @DIFF := xxxx; -- set by TDB team -DELETE FROM `spelldifficulty_dbc` WHERE `id` IN (@DIFF+0,@DIFF+1); +DELETE FROM `spelldifficulty_dbc` WHERE `id` BETWEEN @DIFF+0 AND @DIFF+2; INSERT INTO `spelldifficulty_dbc` (`id`,`spelld0`,`spellid1`,`spelld2`,`spellid3`) VALUES -(@DIFF+0,57762,57763,0,0), -(@DIFF+1,59990,61489,0,0); +(@DIFF+0,50811,61547,0,0), +(@DIFF+1,57762,59990,0,0), +(@DIFF+2,57763,61489,0,0); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 84007370a9a..6783efea5f9 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4948,38 +4948,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool target->SetEntry(apply ? 17654 : 17326); break; } - //Summon Fire Elemental - case 40133: - { - if (!caster) - break; - - Unit* owner = caster->GetOwner(); - if (owner && owner->GetTypeId() == TYPEID_PLAYER) - { - if (apply) - owner->CastSpell(owner, 8985, true); - else - owner->ToPlayer()->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true); - } - break; - } - //Summon Earth Elemental - case 40132 : - { - if (!caster) - break; - - Unit* owner = caster->GetOwner(); - if (owner && owner->GetTypeId() == TYPEID_PLAYER) - { - if (apply) - owner->CastSpell(owner, 19704, true); - else - owner->ToPlayer()->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true); - } - break; - } case 57819: // Argent Champion case 57820: // Ebon Champion case 57821: // Champion of the Kirin Tor @@ -5072,69 +5040,14 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool } case SPELLFAMILY_DRUID: { - if (!(mode & AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK)) - break; - switch (GetId()) - { - case 52610: // Savage Roar - { - uint32 spellId = 62071; - if (apply) - { - if (target->GetShapeshiftForm() != FORM_CAT) - break; - - target->CastSpell(target, spellId, true, NULL, NULL, GetCasterGUID()); - break; - } - target->RemoveAurasDueToSpell(spellId); - break; - } - case 61336: // Survival Instincts - { - if (!(mode & AURA_EFFECT_HANDLE_REAL)) - break; - - if (apply) - { - if (!target->IsInFeralForm()) - break; - - int32 bp0 = int32(target->CountPctFromMaxHealth(GetAmount())); - target->CastCustomSpell(target, 50322, &bp0, NULL, NULL, true); - } - else - target->RemoveAurasDueToSpell(50322); - break; - } - } - // Predatory Strikes - if (target->GetTypeId() == TYPEID_PLAYER && GetSpellInfo()->SpellIconID == 1563) - { - target->ToPlayer()->UpdateAttackPowerAndDamage(); - } + //if (!(mode & AURA_EFFECT_HANDLE_REAL)) + //break; break; } case SPELLFAMILY_SHAMAN: { - if (!(mode & AURA_EFFECT_HANDLE_REAL)) - break; - // Sentry Totem - if (GetId() == 6495 && caster && caster->GetTypeId() == TYPEID_PLAYER) - { - if (apply) - { - if (uint64 guid = caster->m_SummonSlot[4]) - { - if (Creature* totem = caster->GetMap()->GetCreature(guid)) - if (totem->isTotem()) - caster->ToPlayer()->CastSpell(totem, 6277, true); - } - } - else - caster->ToPlayer()->StopCastingBindSight(); - return; - } + //if (!(mode & AURA_EFFECT_HANDLE_REAL)) + //break; break; } case SPELLFAMILY_PALADIN: @@ -6428,33 +6341,6 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con target->AddThreat(caster, float(gainedAmount) * 0.5f, GetSpellInfo()->GetSchoolMask(), GetSpellInfo()); } - // spell-specific code - switch (GetId()) - { - case 31447: // Mark of Kaz'rogal - if (target->GetPower(powerType) == 0) - { - target->CastSpell(target, 31463, true, 0, this); - // Remove aura - GetBase()->SetDuration(0); - } - break; - case 32960: // Mark of Kazzak - { - int32 modifier = int32(target->GetPower(powerType) * 0.05f); - target->ModifyPower(powerType, -modifier); - - if (target->GetPower(powerType) == 0) - { - target->CastSpell(target, 32961, true, 0, this); - // Remove aura - GetBase()->SetDuration(0); - } - break; - } - default: - break; - } // Drain Mana if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->SpellFamilyFlags[0] & 0x00000010) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index e2fe6159ac5..8165c8172d7 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4960,20 +4960,6 @@ SpellCastResult Spell::CheckCast(bool strict) // for effects of spells that have only one target switch (m_spellInfo->Effects[i].Effect) { - case SPELL_EFFECT_DUMMY: - { - if (m_spellInfo->Id == 31789) // Righteous Defense - { - if (m_caster->GetTypeId() != TYPEID_PLAYER) - return SPELL_FAILED_DONT_REPORT; - - Unit* target = m_targets.GetUnitTarget(); - if (!target || !target->IsFriendlyTo(m_caster) || target->getAttackers().empty()) - return SPELL_FAILED_BAD_TARGETS; - - } - break; - } case SPELL_EFFECT_LEARN_SPELL: { if (m_caster->GetTypeId() != TYPEID_PLAYER) @@ -5320,35 +5306,6 @@ SpellCastResult Spell::CheckCast(bool strict) //custom check switch (m_spellInfo->Id) { - case 61336: - if (m_caster->GetTypeId() != TYPEID_PLAYER || !m_caster->ToPlayer()->IsInFeralForm()) - return SPELL_FAILED_ONLY_SHAPESHIFT; - break; - case 1515: - { - if (m_caster->GetTypeId() != TYPEID_PLAYER) - return SPELL_FAILED_BAD_TARGETS; - - if (!m_targets.GetUnitTarget() || m_targets.GetUnitTarget()->GetTypeId() == TYPEID_PLAYER) - return SPELL_FAILED_BAD_IMPLICIT_TARGETS; - - Creature* target = m_targets.GetUnitTarget()->ToCreature(); - - if (target->getLevel() > m_caster->getLevel()) - return SPELL_FAILED_HIGHLEVEL; - - // use SMSG_PET_TAME_FAILURE? - if (!target->GetCreatureTemplate()->isTameable (m_caster->ToPlayer()->CanTameExoticPets())) - return SPELL_FAILED_BAD_TARGETS; - - if (m_caster->GetPetGUID()) - return SPELL_FAILED_ALREADY_HAVE_SUMMON; - - if (m_caster->GetCharmGUID()) - return SPELL_FAILED_ALREADY_HAVE_CHARM; - - break; - } case 44795: // Parachute { float x, y, z; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 547a384920a..2f98bbcf7ec 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -353,21 +353,6 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) return; break; } - case 33671: // gruul's shatter - case 50811: // krystallus shatter ( Normal ) - case 61547: // krystallus shatter ( Heroic ) - { - // don't damage self and only players - if (unitTarget->GetGUID() == m_caster->GetGUID() || unitTarget->GetTypeId() != TYPEID_PLAYER) - return; - - float radius = m_spellInfo->Effects[EFFECT_0].CalcRadius(m_caster); - if (!radius) - return; - float distance = m_caster->GetDistance2d(unitTarget); - damage = (distance > radius) ? 0 : int32(m_spellInfo->Effects[EFFECT_0].CalcValue(m_caster) * ((radius - distance)/radius)); - break; - } // Gargoyle Strike case 51963: { @@ -3774,12 +3759,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) if (!itemTarget && m_caster->GetTypeId() != TYPEID_PLAYER) return; - uint32 spell_id = 0; - switch (urand(1, 5)) - { - case 1: spell_id = 8854; break; - default: spell_id = 8855; break; - } + uint32 spell_id = roll_chance_i(20) ? 8854 : 8855; m_caster->CastSpell(m_caster, spell_id, true, NULL); return; @@ -3826,10 +3806,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) unitTarget->HandleEmoteCommand(EMOTE_STATE_DANCE); return; } - // Escape artist - case 20589: - m_caster->RemoveMovementImpairingAuras(); - return; // Decimate case 28374: case 54426: @@ -3860,15 +3836,8 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) DoCreateItem(effIndex, item); break; } - // Improved Sprint - case 30918: - { - // Removes snares and roots. - unitTarget->RemoveMovementImpairingAuras(); - break; - } - // Spirit Walk - case 58876: + case 20589: // Escape artist + case 30918: // Improved Sprint { // Removes snares and roots. unitTarget->RemoveMovementImpairingAuras(); @@ -3886,96 +3855,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) } } break; - case 48025: // Headless Horseman's Mount - { - if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) - return; - - // Prevent stacking of mounts and client crashes upon dismounting - unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED); - - // Triggered spell id dependent on riding skill and zone - bool canFly = true; - uint32 v_map = GetVirtualMapForMapAndZone(unitTarget->GetMapId(), unitTarget->GetZoneId()); - if (v_map != 530 && v_map != 571) - canFly = false; - - if (canFly && v_map == 571 && !unitTarget->ToPlayer()->HasSpell(54197)) - canFly = false; - - float x, y, z; - unitTarget->GetPosition(x, y, z); - uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z); - AreaTableEntry const* pArea = sAreaStore.LookupEntry(areaFlag); - if (!pArea || (canFly && (pArea->flags & AREA_FLAG_NO_FLY_ZONE))) - canFly = false; - - switch (unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING)) - { - case 75: unitTarget->CastSpell(unitTarget, 51621, true); break; - case 150: unitTarget->CastSpell(unitTarget, 48024, true); break; - case 225: - { - if (canFly) - unitTarget->CastSpell(unitTarget, 51617, true); - else - unitTarget->CastSpell(unitTarget, 48024, true); - }break; - case 300: - { - if (canFly) - unitTarget->CastSpell(unitTarget, 48023, true); - else - unitTarget->CastSpell(unitTarget, 48024, true); - }break; - } - return; - } - case 47977: // Magic Broom - { - if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) - return; - - // Prevent stacking of mounts and client crashes upon dismounting - unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED); - - // Triggered spell id dependent on riding skill and zone - bool canFly = true; - uint32 v_map = GetVirtualMapForMapAndZone(unitTarget->GetMapId(), unitTarget->GetZoneId()); - if (v_map != 530 && v_map != 571) - canFly = false; - - if (canFly && v_map == 571 && !unitTarget->ToPlayer()->HasSpell(54197)) - canFly = false; - - float x, y, z; - unitTarget->GetPosition(x, y, z); - uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z); - AreaTableEntry const* pArea = sAreaStore.LookupEntry(areaFlag); - if (!pArea || (canFly && (pArea->flags & AREA_FLAG_NO_FLY_ZONE))) - canFly = false; - - switch (unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING)) - { - case 75: unitTarget->CastSpell(unitTarget, 42680, true); break; - case 150: unitTarget->CastSpell(unitTarget, 42683, true); break; - case 225: - { - if (canFly) - unitTarget->CastSpell(unitTarget, 42667, true); - else - unitTarget->CastSpell(unitTarget, 42683, true); - }break; - case 300: - { - if (canFly) - unitTarget->CastSpell(unitTarget, 42668, true); - else - unitTarget->CastSpell(unitTarget, 42683, true); - }break; - } - return; - } // Mug Transformation case 41931: { @@ -4167,25 +4046,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) if (unitTarget) unitTarget->CastSpell(m_caster, damage, true); return; - // Winged Steed of the Ebon Blade - case 54729: - { - if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) - return; - - // Prevent stacking of mounts and client crashes upon dismounting - unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED); - - // Triggered spell id dependent on riding skill - if (uint16 skillval = unitTarget->ToPlayer()->GetSkillValue(SKILL_RIDING)) - { - if (skillval >= 300) - unitTarget->CastSpell(unitTarget, 54727, true); - else - unitTarget->CastSpell(unitTarget, 54726, true); - } - return; - } case 57347: // Retrieving (Wintergrasp RP-GG pickup spell) { if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT || m_caster->GetTypeId() != TYPEID_PLAYER) @@ -4268,188 +4128,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) m_caster->CastSpell(m_caster, 63919, true); return; } - case 71342: // Big Love Rocket - { - if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) - return; - - // Prevent stacking of mounts and client crashes upon dismounting - unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED); - - // Triggered spell id dependent on riding skill and zone - bool canFly = true; - uint32 v_map = GetVirtualMapForMapAndZone(unitTarget->GetMapId(), unitTarget->GetZoneId()); - if (v_map != 530 && v_map != 571) - canFly = false; - - if (canFly && v_map == 571 && !unitTarget->ToPlayer()->HasSpell(54197)) - canFly = false; - - float x, y, z; - unitTarget->GetPosition(x, y, z); - uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z); - AreaTableEntry const* pArea = sAreaStore.LookupEntry(areaFlag); - if (!pArea || (canFly && (pArea->flags & AREA_FLAG_NO_FLY_ZONE))) - canFly = false; - - switch (unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING)) - { - case 0: unitTarget->CastSpell(unitTarget, 71343, true); break; - case 75: unitTarget->CastSpell(unitTarget, 71344, true); break; - case 150: unitTarget->CastSpell(unitTarget, 71345, true); break; - case 225: - { - if (canFly) - unitTarget->CastSpell(unitTarget, 71346, true); - else - unitTarget->CastSpell(unitTarget, 71345, true); - }break; - case 300: - { - if (canFly) - unitTarget->CastSpell(unitTarget, 71347, true); - else - unitTarget->CastSpell(unitTarget, 71345, true); - }break; - } - return; - } - case 72286: // Invincible - { - if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) - return; - - // Prevent stacking of mounts and client crashes upon dismounting - unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED); - - // Triggered spell id dependent on riding skill and zone - bool canFly = true; - uint32 v_map = GetVirtualMapForMapAndZone(unitTarget->GetMapId(), unitTarget->GetZoneId()); - if (v_map != 530 && v_map != 571) - canFly = false; - - if (canFly && v_map == 571 && !unitTarget->ToPlayer()->HasSpell(54197)) - canFly = false; - - float x, y, z; - unitTarget->GetPosition(x, y, z); - uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z); - AreaTableEntry const* pArea = sAreaStore.LookupEntry(areaFlag); - if (!pArea || (canFly && (pArea->flags & AREA_FLAG_NO_FLY_ZONE))) - canFly = false; - - switch (unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING)) - { - case 75: unitTarget->CastSpell(unitTarget, 72281, true); break; - case 150: unitTarget->CastSpell(unitTarget, 72282, true); break; - case 225: - { - if (canFly) - unitTarget->CastSpell(unitTarget, 72283, true); - else - unitTarget->CastSpell(unitTarget, 72282, true); - }break; - case 300: - { - if (canFly) - unitTarget->CastSpell(unitTarget, 72284, true); - else - unitTarget->CastSpell(unitTarget, 72282, true); - }break; - } - return; - } - case 74856: // Blazing Hippogryph - { - if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) - return; - - // Prevent stacking of mounts and client crashes upon dismounting - unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED); - - // Triggered spell id dependent on riding skill - if (uint16 skillval = unitTarget->ToPlayer()->GetSkillValue(SKILL_RIDING)) - { - if (skillval >= 300) - unitTarget->CastSpell(unitTarget, 74855, true); - else - unitTarget->CastSpell(unitTarget, 74854, true); - } - return; - } - case 75614: // Celestial Steed - { - if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) - return; - - // Prevent stacking of mounts and client crashes upon dismounting - unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED); - - // Triggered spell id dependent on riding skill and zone - bool canFly = true; - uint32 v_map = GetVirtualMapForMapAndZone(unitTarget->GetMapId(), unitTarget->GetZoneId()); - if (v_map != 530 && v_map != 571) - canFly = false; - - if (canFly && v_map == 571 && !unitTarget->ToPlayer()->HasSpell(54197)) - canFly = false; - - float x, y, z; - unitTarget->GetPosition(x, y, z); - uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z); - AreaTableEntry const* pArea = sAreaStore.LookupEntry(areaFlag); - if (!pArea || (canFly && (pArea->flags & AREA_FLAG_NO_FLY_ZONE))) - canFly = false; - - switch (unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING)) - { - case 75: unitTarget->CastSpell(unitTarget, 75619, true); break; - case 150: unitTarget->CastSpell(unitTarget, 75620, true); break; - case 225: - { - if (canFly) - unitTarget->CastSpell(unitTarget, 75617, true); - else - unitTarget->CastSpell(unitTarget, 75620, true); - }break; - case 300: - { - if (canFly) - { - if (unitTarget->ToPlayer()->Has310Flyer(false)) - unitTarget->CastSpell(unitTarget, 76153, true); - else - unitTarget->CastSpell(unitTarget, 75618, true); - } - else - unitTarget->CastSpell(unitTarget, 75620, true); - }break; - } - return; - } - case 75973: // X-53 Touring Rocket - { - if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) - return; - - // Prevent stacking of mounts - unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED); - - // Triggered spell id dependent on riding skill - if (uint16 skillval = unitTarget->ToPlayer()->GetSkillValue(SKILL_RIDING)) - { - if (skillval >= 300) - { - if (unitTarget->ToPlayer()->Has310Flyer(false)) - unitTarget->CastSpell(unitTarget, 76154, true); - else - unitTarget->CastSpell(unitTarget, 75972, true); - } - else - unitTarget->CastSpell(unitTarget, 75957, true); - } - return; - } case 59317: // Teleporting if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) return; @@ -5065,16 +4743,14 @@ void Spell::EffectDisEnchant(SpellEffIndex /*effIndex*/) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; - if (m_caster->GetTypeId() != TYPEID_PLAYER) - return; - - Player* p_caster = (Player*)m_caster; if (!itemTarget || !itemTarget->GetTemplate()->DisenchantID) return; - p_caster->UpdateCraftSkill(m_spellInfo->Id); - - m_caster->ToPlayer()->SendLoot(itemTarget->GetGUID(), LOOT_DISENCHANTING); + if (Player* caster = m_caster->ToPlayer()) + { + caster->UpdateCraftSkill(m_spellInfo->Id); + caster->SendLoot(itemTarget->GetGUID(), LOOT_DISENCHANTING); + } // item will be removed at disenchanting end } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index 407faa19eaa..c1ae04cf4c0 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -15,13 +15,20 @@ * with this program. If not, see . */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellAuraEffects.h" +#include "SpellScript.h" #include "hyjal.h" #include "hyjal_trash.h" -#define SPELL_CLEAVE 31436 -#define SPELL_WARSTOMP 31480 -#define SPELL_MARK 31447 +enum Spells +{ + SPELL_CLEAVE = 31436, + SPELL_WARSTOMP = 31480, + SPELL_MARK = 31447, + SPELL_MARK_DAMAGE = 31463 +}; #define SOUND_ONDEATH 11018 @@ -162,22 +169,10 @@ public: WarStompTimer = 60000; } else WarStompTimer -= diff; - if (me->HasAura(SPELL_MARK)) - me->RemoveAurasDueToSpell(SPELL_MARK); if (MarkTimer <= diff) { - //cast dummy, useful for bos addons - me->CastCustomSpell(me, SPELL_MARK, NULL, NULL, NULL, false, NULL, NULL, me->GetGUID()); + DoCastAOE(SPELL_MARK); - std::list t_list = me->getThreatManager().getThreatList(); - for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid()); - if (target && target->GetTypeId() == TYPEID_PLAYER && target->getPowerType() == POWER_MANA) - { - target->CastSpell(target, SPELL_MARK, true);//only cast on mana users - } - } MarkTimerBase -= 5000; if (MarkTimerBase < 5500) MarkTimerBase = 5500; @@ -201,7 +196,80 @@ public: }; +class MarkTargetFilter +{ + public: + bool operator()(Unit* target) const + { + if (target->getPowerType() != POWER_MANA) + return true; + + return false; + } +}; + +class spell_mark_of_kazrogal : public SpellScriptLoader +{ + public: + spell_mark_of_kazrogal() : SpellScriptLoader("spell_mark_of_kazrogal") { } + + class spell_mark_of_kazrogal_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mark_of_kazrogal_SpellScript); + + void FilterTargets(std::list& unitList) + { + unitList.remove_if(MarkTargetFilter()); + } + + void Register() + { + OnUnitTargetSelect += SpellUnitTargetFn(spell_mark_of_kazrogal_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + } + }; + + class spell_mark_of_kazrogal_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mark_of_kazrogal_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MARK_DAMAGE)) + return false; + return true; + } + + void OnPeriodic(AuraEffect const* aurEff) + { + Unit* target = GetTarget(); + + if (target->GetPower(POWER_MANA) == 0) + { + target->CastSpell(target, SPELL_MARK_DAMAGE, true, NULL, aurEff); + // Remove aura + SetDuration(0); + } + } + + void Register() + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_mark_of_kazrogal_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_MANA_LEECH); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_mark_of_kazrogal_SpellScript(); + } + + AuraScript* GetAuraScript() const + { + return new spell_mark_of_kazrogal_AuraScript(); + } +}; + void AddSC_boss_kazrogal() { new boss_kazrogal(); + new spell_mark_of_kazrogal(); } diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp index bc57ce21a4d..e5e3daede91 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp @@ -23,7 +23,9 @@ SDComment: SDCategory: Script Data End */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellScript.h" #include "halls_of_stone.h" enum Spells @@ -162,12 +164,7 @@ public: //this part should be in the core if (pSpell->Id == SPELL_SHATTER || pSpell->Id == H_SPELL_SHATTER) { - //this spell must have custom handling in the core, dealing damage based on distance - target->CastSpell(target, DUNGEON_MODE(SPELL_SHATTER_EFFECT, H_SPELL_SHATTER_EFFECT), true); - - if (target->HasAura(SPELL_STONED)) - target->RemoveAurasDueToSpell(SPELL_STONED); - + // todo: we need eventmap to kill this stuff //clear this, if we are still performing if (bIsSlam) { @@ -186,7 +183,74 @@ public: }; +class spell_krystallus_shatter : public SpellScriptLoader +{ + public: + spell_krystallus_shatter() : SpellScriptLoader("spell_krystallus_shatter") { } + + class spell_krystallus_shatter_SpellScript : public SpellScript + { + PrepareSpellScript(spell_krystallus_shatter_SpellScript); + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetHitUnit()) + { + target->RemoveAurasDueToSpell(SPELL_STONED); + target->CastSpell((Unit*)NULL, SPELL_SHATTER_EFFECT, true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_krystallus_shatter_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_krystallus_shatter_SpellScript(); + } +}; + +class spell_krystallus_shatter_effect : public SpellScriptLoader +{ + public: + spell_krystallus_shatter_effect() : SpellScriptLoader("spell_krystallus_shatter_effect") { } + + class spell_krystallus_shatter_effect_SpellScript : public SpellScript + { + PrepareSpellScript(spell_krystallus_shatter_effect_SpellScript); + + void CalculateDamage() + { + if (!GetHitUnit()) + return; + + float radius = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster()); + if (!radius) + return; + + float distance = GetCaster()->GetDistance2d(GetHitUnit()); + if (distance > 1.0f) + SetHitDamage(int32(GetHitDamage() * ((radius - distance) / radius))); + } + + void Register() + { + OnHit += SpellHitFn(spell_krystallus_shatter_effect_SpellScript::CalculateDamage); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_krystallus_shatter_effect_SpellScript(); + } +}; + void AddSC_boss_krystallus() { new boss_krystallus(); + new spell_krystallus_shatter(); + new spell_krystallus_shatter_effect(); } diff --git a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp index 0e654ade995..3443103fa70 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp @@ -19,11 +19,13 @@ /* ScriptData SDName: Boss_Gruul SD%Complete: 60 -SDComment: Ground Slam need further development (knock back effect and shatter effect must be added to the core) +SDComment: Ground Slam need further development (knock back effect must be added to the core) SDCategory: Gruul's Lair EndScriptData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellScript.h" #include "gruuls_lair.h" enum eEnums @@ -144,12 +146,7 @@ public: //this part should be in the core if (pSpell->Id == SPELL_SHATTER) { - //this spell must have custom handling in the core, dealing damage based on distance - target->CastSpell(target, SPELL_SHATTER_EFFECT, true); - - if (target->HasAura(SPELL_STONED)) - target->RemoveAurasDueToSpell(SPELL_STONED); - + // todo: use eventmap to kill this stuff //clear this, if we are still performing if (m_bPerformingGroundSlam) { @@ -258,7 +255,83 @@ public: }; +class spell_gruul_shatter : public SpellScriptLoader +{ + public: + spell_gruul_shatter() : SpellScriptLoader("spell_gruul_shatter") { } + + class spell_gruul_shatter_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gruul_shatter_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_STONED)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_SHATTER_EFFECT)) + return false; + return true; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetHitUnit()) + { + target->RemoveAurasDueToSpell(SPELL_STONED); + target->CastSpell((Unit*)NULL, SPELL_SHATTER_EFFECT, true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gruul_shatter_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gruul_shatter_SpellScript(); + } +}; + +class spell_gruul_shatter_effect : public SpellScriptLoader +{ + public: + spell_gruul_shatter_effect() : SpellScriptLoader("spell_gruul_shatter_effect") { } + + class spell_gruul_shatter_effect_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gruul_shatter_effect_SpellScript); + + void CalculateDamage() + { + if (!GetHitUnit()) + return; + + float radius = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster()); + if (!radius) + return; + + float distance = GetCaster()->GetDistance2d(GetHitUnit()); + if (distance > 1.0f) + SetHitDamage(int32(GetHitDamage() * ((radius - distance) / radius))); + } + + void Register() + { + OnHit += SpellHitFn(spell_gruul_shatter_effect_SpellScript::CalculateDamage); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gruul_shatter_effect_SpellScript(); + } +}; + void AddSC_boss_gruul() { new boss_gruul(); + new spell_gruul_shatter(); + new spell_gruul_shatter_effect(); } diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp index a213713ae1a..ab568249027 100644 --- a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp +++ b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp @@ -16,7 +16,10 @@ * with this program. If not, see . */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellAuraEffects.h" +#include "SpellScript.h" enum Texts { @@ -36,6 +39,7 @@ enum Spells SPELL_THUNDERCLAP = 36706, SPELL_VOID_BOLT = 39329, SPELL_MARK_OF_KAZZAK = 32960, + SPELL_MARK_OF_KAZZAK_DAMAGE = 32961, SPELL_ENRAGE = 32964, SPELL_CAPTURE_SOUL = 32966, SPELL_TWISTED_REFLECTION = 21063, @@ -171,7 +175,55 @@ class boss_doomlord_kazzak : public CreatureScript } }; +class spell_mark_of_kazzak : public SpellScriptLoader +{ + public: + spell_mark_of_kazzak() : SpellScriptLoader("spell_mark_of_kazzak") { } + + class spell_mark_of_kazzak_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mark_of_kazzak_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MARK_OF_KAZZAK_DAMAGE)) + return false; + return true; + } + + void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* owner = GetUnitOwner()) + amount = CalculatePctU(owner->GetPower(POWER_MANA), 5); + } + + void OnPeriodic(AuraEffect const* aurEff) + { + Unit* target = GetTarget(); + + if (target->GetPower(POWER_MANA) == 0) + { + target->CastSpell(target, SPELL_MARK_OF_KAZZAK_DAMAGE, true, NULL, aurEff); + // Remove aura + SetDuration(0); + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mark_of_kazzak_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_MANA_LEECH); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_mark_of_kazzak_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_MANA_LEECH); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_mark_of_kazzak_AuraScript(); + } +}; + void AddSC_boss_doomlordkazzak() { new boss_doomlord_kazzak(); + new spell_mark_of_kazzak(); } diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 4593d955566..b31ee0a7d3e 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -730,17 +730,6 @@ class spell_dk_death_coil : public SpellScriptLoader return true; } - SpellCastResult CheckCast() - { - Unit* caster = GetCaster(); - if (Unit* target = GetExplTargetUnit()) - { - if (target->IsFriendlyTo(caster) && target->GetCreatureType() != CREATURE_TYPE_UNDEAD) - return SPELL_FAILED_BAD_TARGETS; - } - return SPELL_CAST_OK; - } - void HandleDummy(SpellEffIndex /*effIndex*/) { int32 damage = GetEffectValue(); diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 1d152e6f208..f759efbee83 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -30,7 +30,9 @@ enum DruidSpells DRUID_INCREASED_MOONFIRE_DURATION = 38414, DRUID_NATURES_SPLENDOR = 57865, DRUID_LIFEBLOOM_FINAL_HEAL = 33778, - DRUID_LIFEBLOOM_ENERGIZE = 64372 + DRUID_LIFEBLOOM_ENERGIZE = 64372, + DRUID_SURVIVAL_INSTINCTS = 50322, + DRUID_SAVAGE_ROAR = 62071 }; // 54846 Glyph of Starfire @@ -481,6 +483,166 @@ class spell_dru_lifebloom : public SpellScriptLoader } }; +class spell_dru_predatory_strikes : public SpellScriptLoader +{ + public: + spell_dru_predatory_strikes() : SpellScriptLoader("spell_dru_predatory_strikes") { } + + class spell_dru_predatory_strikes_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dru_predatory_strikes_AuraScript); + + void UpdateAmount(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Player* target = GetTarget()->ToPlayer()) + target->UpdateAttackPowerAndDamage(); + } + + void Register() + { + AfterEffectApply += AuraEffectApplyFn(spell_dru_predatory_strikes_AuraScript::UpdateAmount, EFFECT_ALL, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + AfterEffectRemove += AuraEffectRemoveFn(spell_dru_predatory_strikes_AuraScript::UpdateAmount, EFFECT_ALL, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_dru_predatory_strikes_AuraScript(); + } +}; + +class spell_dru_savage_roar : public SpellScriptLoader +{ + public: + spell_dru_savage_roar() : SpellScriptLoader("spell_dru_savage_roar") { } + + class spell_dru_savage_roar_SpellScript : public SpellScript + { + PrepareSpellScript(spell_dru_savage_roar_SpellScript); + + SpellCastResult CheckCast() + { + Unit* caster = GetCaster(); + if (caster->GetShapeshiftForm() != FORM_CAT) + return SPELL_FAILED_ONLY_SHAPESHIFT; + + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_dru_savage_roar_SpellScript::CheckCast); + } + }; + + class spell_dru_savage_roar_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dru_savage_roar_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(DRUID_SAVAGE_ROAR)) + return false; + return true; + } + + void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + int32 bp0 = aurEff->GetAmount(); // todo: check if needed + target->CastCustomSpell(target, DRUID_SAVAGE_ROAR, &bp0, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); + } + + void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetTarget()->RemoveAurasDueToSpell(DRUID_SAVAGE_ROAR); + } + + void Register() + { + // todo: check AuraEffectHandleModes + AfterEffectApply += AuraEffectApplyFn(spell_dru_savage_roar_AuraScript::AfterApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + AfterEffectRemove += AuraEffectRemoveFn(spell_dru_savage_roar_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_dru_savage_roar_SpellScript(); + } + + AuraScript* GetAuraScript() const + { + return new spell_dru_savage_roar_AuraScript(); + } +}; + +class spell_dru_survival_instincts : public SpellScriptLoader +{ + public: + spell_dru_survival_instincts() : SpellScriptLoader("spell_dru_survival_instincts") { } + + class spell_dru_survival_instincts_SpellScript : public SpellScript + { + PrepareSpellScript(spell_dru_survival_instincts_SpellScript); + + SpellCastResult CheckCast() + { + Unit* caster = GetCaster(); + if (!caster->IsInFeralForm()) + return SPELL_FAILED_ONLY_SHAPESHIFT; + + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_dru_survival_instincts_SpellScript::CheckCast); + } + }; + + class spell_dru_survival_instincts_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dru_survival_instincts_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(DRUID_SURVIVAL_INSTINCTS)) + return false; + return true; + } + + void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + int32 bp0 = target->CountPctFromMaxHealth(aurEff->GetAmount()); + target->CastCustomSpell(target, DRUID_SURVIVAL_INSTINCTS, &bp0, NULL, NULL, true); + } + + void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetTarget()->RemoveAurasDueToSpell(DRUID_SURVIVAL_INSTINCTS); + } + + void Register() + { + // todo: check AuraEffectHandleModes + AfterEffectApply += AuraEffectApplyFn(spell_dru_survival_instincts_AuraScript::AfterApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + AfterEffectRemove += AuraEffectRemoveFn(spell_dru_survival_instincts_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_dru_survival_instincts_SpellScript(); + } + + AuraScript* GetAuraScript() const + { + return new spell_dru_survival_instincts_AuraScript(); + } +}; + void AddSC_druid_spell_scripts() { new spell_dru_glyph_of_starfire(); @@ -492,4 +654,7 @@ void AddSC_druid_spell_scripts() new spell_dru_swift_flight_passive(); new spell_dru_starfall_dummy(); new spell_dru_lifebloom(); + new spell_dru_predatory_strikes(); + new spell_dru_savage_roar(); + new spell_dru_survival_instincts(); } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index f61bad8db9b..b619dd9ac6f 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2802,6 +2802,238 @@ class spell_gen_lifebloom : public SpellScriptLoader uint32 _spellId; }; +enum SummonElemental +{ + SPELL_SUMMON_FIRE_ELEMENTAL = 8985, + SPELL_SUMMON_EARTH_ELEMENTAL = 19704 +}; + +class spell_gen_summon_elemental : public SpellScriptLoader +{ + public: + spell_gen_summon_elemental(const char* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { } + + class spell_gen_summon_elemental_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_summon_elemental_AuraScript); + + public: + spell_gen_summon_elemental_AuraScript(uint32 spellId) : AuraScript(), _spellId(spellId) { } + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(_spellId)) + return false; + return true; + } + + void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (GetCaster()) + if (Unit* owner = GetCaster()->GetOwner()) + if (owner->GetTypeId() == TYPEID_PLAYER) // todo: this check is maybe wrong + owner->CastSpell(owner, _spellId, true); + } + + void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (GetCaster()) + if (Unit* owner = GetCaster()->GetOwner()) + if (owner->GetTypeId() == TYPEID_PLAYER) // todo: this check is maybe wrong + owner->ToPlayer()->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true); + } + + void Register() + { + AfterEffectApply += AuraEffectApplyFn(spell_gen_summon_elemental_AuraScript::AfterApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_gen_summon_elemental_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + + private: + uint32 _spellId; + }; + + AuraScript* GetAuraScript() const + { + return new spell_gen_summon_elemental_AuraScript(_spellId); + } + + private: + uint32 _spellId; +}; + +enum Mounts +{ + // Magic Broom + SPELL_MAGIC_BROOM_60 = 42680, + SPELL_MAGIC_BROOM_100 = 42683, + SPELL_MAGIC_BROOM_150 = 42667, + SPELL_MAGIC_BROOM_280 = 42668, + + // Headless Horseman's Mount + SPELL_HEADLESS_HORSEMAN_MOUNT_60 = 51621, + SPELL_HEADLESS_HORSEMAN_MOUNT_100 = 48024, + SPELL_HEADLESS_HORSEMAN_MOUNT_150 = 51617, + SPELL_HEADLESS_HORSEMAN_MOUNT_280 = 48023, + + // Winged Steed of the Ebon Blade + SPELL_WINGED_STEED_150 = 54726, + SPELL_WINGED_STEED_280 = 54727, + + // Big Love Rocket + SPELL_BIG_LOVE_ROCKET_0 = 71343, + SPELL_BIG_LOVE_ROCKET_60 = 71344, + SPELL_BIG_LOVE_ROCKET_100 = 71345, + SPELL_BIG_LOVE_ROCKET_150 = 71346, + SPELL_BIG_LOVE_ROCKET_310 = 71347, + + // Invincible + SPELL_INVINCIBLE_60 = 72281, + SPELL_INVINCIBLE_100 = 72282, + SPELL_INVINCIBLE_150 = 72283, + SPELL_INVINCIBLE_310 = 72284, + + // Blazing Hippogryph + SPELL_BLAZING_HIPPOGRYPH_150 = 74854, + SPELL_BLAZING_HIPPOGRYPH_280 = 74855, + + // Celestial Steed + SPELL_CELESTIAL_STEED_60 = 75619, + SPELL_CELESTIAL_STEED_100 = 75620, + SPELL_CELESTIAL_STEED_150 = 75617, + SPELL_CELESTIAL_STEED_280 = 75618, + SPELL_CELESTIAL_STEED_310 = 76153, + + // X-53 Touring Rocket + SPELL_X53_TOURING_ROCKET_150 = 75957, + SPELL_X53_TOURING_ROCKET_280 = 75972, + SPELL_X53_TOURING_ROCKET_310 = 76154, +}; + +class spell_gen_mount : public SpellScriptLoader +{ + public: + spell_gen_mount(const char* name, uint32 mount0 = 0, uint32 mount60 = 0, uint32 mount100 = 0, uint32 mount150 = 0, uint32 mount280 = 0, uint32 mount310 = 0) : SpellScriptLoader(name), + _mount0(mount0), _mount60(mount60), _mount100(mount100), _mount150(mount150), _mount280(mount280), _mount310(mount310) { } + + class spell_gen_mount_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_mount_SpellScript); + + public: + spell_gen_mount_SpellScript(uint32 mount0, uint32 mount60, uint32 mount100, uint32 mount150, uint32 mount280, uint32 mount310) : SpellScript(), + _mount0(mount0), _mount60(mount60), _mount100(mount100), _mount150(mount150), _mount280(mount280), _mount310(mount310) { } + + bool Validate(SpellInfo const* /*spell*/) + { + if (_mount0 && !sSpellMgr->GetSpellInfo(_mount0)) + return false; + if (_mount60 && !sSpellMgr->GetSpellInfo(_mount60)) + return false; + if (_mount100 && !sSpellMgr->GetSpellInfo(_mount100)) + return false; + if (_mount150 && !sSpellMgr->GetSpellInfo(_mount150)) + return false; + if (_mount280 && !sSpellMgr->GetSpellInfo(_mount280)) + return false; + if (_mount310 && !sSpellMgr->GetSpellInfo(_mount310)) + return false; + return true; + } + + void HandleMount(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + + if (Player* target = GetHitPlayer()) + { + // Prevent stacking of mounts and client crashes upon dismounting + target->RemoveAurasByType(SPELL_AURA_MOUNTED, 0, GetHitAura()); + + // Triggered spell id dependent on riding skill and zone + bool canFly = false; + uint32 vmap = GetVirtualMapForMapAndZone(target->GetMapId(), target->GetZoneId()); + if (vmap == 530 || (vmap == 571 && target->HasSpell(54197))) + canFly = true; + + float x, y, z; + target->GetPosition(x, y, z); + uint32 areaFlag = target->GetBaseMap()->GetAreaFlag(x, y, z); + AreaTableEntry const* area = sAreaStore.LookupEntry(areaFlag); + if (!area || (canFly && (area->flags & AREA_FLAG_NO_FLY_ZONE))) + canFly = false; + + uint32 mount = 0; + switch (target->GetBaseSkillValue(SKILL_RIDING)) + { + case 0: + mount = _mount0; + break; + case 75: + mount = _mount60; + break; + case 150: + mount = _mount100; + break; + case 225: + if (canFly) + mount = _mount150; + else + mount = _mount100; + break; + case 300: + if (canFly) + { + if (_mount310 && target->Has310Flyer(false)) + mount = _mount310; + else + mount = _mount280; + } + else + mount = _mount100; + break; + default: + break; + } + + if (mount) + { + // Prevent stacking of mounts and client crashes upon dismounting + //target->RemoveAurasByType(SPELL_AURA_MOUNTED, 0, GetHitAura()); + + target->CastSpell(target, mount, true); + } + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_mount_SpellScript::HandleMount, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT); + } + + private: + uint32 _mount0; + uint32 _mount60; + uint32 _mount100; + uint32 _mount150; + uint32 _mount280; + uint32 _mount310; + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_mount_SpellScript(_mount0, _mount60, _mount100, _mount150, _mount280, _mount310); + } + + private: + uint32 _mount0; + uint32 _mount60; + uint32 _mount100; + uint32 _mount150; + uint32 _mount280; + uint32 _mount310; +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -2862,4 +3094,14 @@ void AddSC_generic_spell_scripts() new spell_gen_lifebloom("spell_cenarion_scout_lifebloom", SPELL_CENARION_SCOUT_LIFEBLOOM_FINAL_HEAL); new spell_gen_lifebloom("spell_twisted_visage_lifebloom", SPELL_TWISTED_VISAGE_LIFEBLOOM_FINAL_HEAL); new spell_gen_lifebloom("spell_faction_champion_dru_lifebloom", SPELL_FACTION_CHAMPIONS_DRU_LIFEBLOOM_FINAL_HEAL); + new spell_gen_summon_elemental("spell_gen_summon_fire_elemental", SPELL_SUMMON_FIRE_ELEMENTAL); + new spell_gen_summon_elemental("spell_gen_summon_earth_elemental", SPELL_SUMMON_EARTH_ELEMENTAL); + new spell_gen_mount("spell_magic_broom", 0, SPELL_MAGIC_BROOM_60, SPELL_MAGIC_BROOM_100, SPELL_MAGIC_BROOM_150, SPELL_MAGIC_BROOM_280); + new spell_gen_mount("spell_headless_horseman_mount", 0, SPELL_HEADLESS_HORSEMAN_MOUNT_60, SPELL_HEADLESS_HORSEMAN_MOUNT_100, SPELL_HEADLESS_HORSEMAN_MOUNT_150, SPELL_HEADLESS_HORSEMAN_MOUNT_280); + new spell_gen_mount("spell_winged_steed_of_the_ebon_blade", 0, 0, 0, SPELL_WINGED_STEED_150, SPELL_WINGED_STEED_280); + new spell_gen_mount("spell_big_love_rocket", SPELL_BIG_LOVE_ROCKET_0, SPELL_BIG_LOVE_ROCKET_60, SPELL_BIG_LOVE_ROCKET_100, SPELL_BIG_LOVE_ROCKET_150, SPELL_BIG_LOVE_ROCKET_310); + new spell_gen_mount("spell_invincible", 0, SPELL_INVINCIBLE_60, SPELL_INVINCIBLE_100, SPELL_INVINCIBLE_150, SPELL_INVINCIBLE_310); + new spell_gen_mount("spell_blazing_hippogryph", 0, 0, 0, SPELL_BLAZING_HIPPOGRYPH_150, SPELL_BLAZING_HIPPOGRYPH_280); + new spell_gen_mount("spell_celestial_steed", 0, SPELL_CELESTIAL_STEED_60, SPELL_CELESTIAL_STEED_100, SPELL_CELESTIAL_STEED_150, SPELL_CELESTIAL_STEED_280, SPELL_CELESTIAL_STEED_310); + new spell_gen_mount("spell_x53_touring_rocket", 0, 0, 0, SPELL_X53_TOURING_ROCKET_150, SPELL_X53_TOURING_ROCKET_280, SPELL_X53_TOURING_ROCKET_310); } diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 44bc6b43c96..a2ee6c1c3a3 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -629,7 +629,8 @@ class spell_hun_disengage : public SpellScriptLoader SpellCastResult CheckCast() { - if (GetCaster()->GetTypeId() == TYPEID_PLAYER && !GetCaster()->isInCombat()) + Unit* caster = GetCaster(); + if (caster->GetTypeId() == TYPEID_PLAYER && !caster->isInCombat()) return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; return SPELL_CAST_OK; @@ -647,6 +648,57 @@ class spell_hun_disengage : public SpellScriptLoader } }; +class spell_hun_tame_beast : public SpellScriptLoader +{ + public: + spell_hun_tame_beast() : SpellScriptLoader("spell_hun_tame_beast") { } + + class spell_hun_tame_beast_SpellScript : public SpellScript + { + PrepareSpellScript(spell_hun_tame_beast_SpellScript); + + SpellCastResult CheckCast() + { + Unit* caster = GetCaster(); + if (caster->GetTypeId() != TYPEID_PLAYER) + return SPELL_FAILED_DONT_REPORT; + + if (!GetExplTargetUnit()) + return SPELL_FAILED_BAD_IMPLICIT_TARGETS; + + if (Creature* target = GetExplTargetUnit()->ToCreature()) + { + if (target->getLevel() > caster->getLevel()) + return SPELL_FAILED_HIGHLEVEL; + + // use SMSG_PET_TAME_FAILURE? + if (!target->GetCreatureTemplate()->isTameable(caster->ToPlayer()->CanTameExoticPets())) + return SPELL_FAILED_BAD_TARGETS; + + if (caster->GetPetGUID()) + return SPELL_FAILED_ALREADY_HAVE_SUMMON; + + if (caster->GetCharmGUID()) + return SPELL_FAILED_ALREADY_HAVE_CHARM; + } + else + return SPELL_FAILED_BAD_IMPLICIT_TARGETS; + + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_hun_tame_beast_SpellScript::CheckCast); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_hun_tame_beast_SpellScript(); + } +}; + void AddSC_hunter_spell_scripts() { new spell_hun_aspect_of_the_beast(); @@ -662,4 +714,5 @@ void AddSC_hunter_spell_scripts() new spell_hun_misdirection(); new spell_hun_misdirection_proc(); new spell_hun_disengage(); + new spell_hun_tame_beast(); } diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 1bc8bb20a3e..fe681032c1c 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -502,6 +502,44 @@ class spell_pal_lay_on_hands : public SpellScriptLoader } }; +class spell_pal_righteous_defense : public SpellScriptLoader +{ + public: + spell_pal_righteous_defense() : SpellScriptLoader("spell_pal_righteous_defense") { } + + class spell_pal_righteous_defense_SpellScript : public SpellScript + { + PrepareSpellScript(spell_pal_righteous_defense_SpellScript); + + SpellCastResult CheckCast() + { + Unit* caster = GetCaster(); + if (caster->GetTypeId() != TYPEID_PLAYER) + return SPELL_FAILED_DONT_REPORT; + + if (Unit* target = GetExplTargetUnit()) + { + if (!target->IsFriendlyTo(caster) || target->getAttackers().empty()) + return SPELL_FAILED_BAD_TARGETS; + } + else + return SPELL_FAILED_BAD_TARGETS; + + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_pal_righteous_defense_SpellScript::CheckCast); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_pal_righteous_defense_SpellScript(); + } +}; + void AddSC_paladin_spell_scripts() { new spell_pal_ardent_defender(); @@ -513,4 +551,5 @@ void AddSC_paladin_spell_scripts() new spell_pal_divine_storm(); new spell_pal_divine_storm_dummy(); new spell_pal_lay_on_hands(); + new spell_pal_righteous_defense(); } diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 1fcc9da06c4..a7c196701ad 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -43,6 +43,8 @@ enum ShamanSpells SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM = 6474, SHAMAN_TOTEM_SPELL_EARTHEN_POWER = 59566, + SHAMAN_BIND_SIGHT = 6277, + ICON_ID_SHAMAN_LAVA_FLOW = 3087, SHAMAN_LAVA_FLOWS_R1 = 51480, SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 64694, @@ -702,6 +704,52 @@ class spell_sha_flame_shock : public SpellScriptLoader } }; +class spell_sha_sentry_totem : public SpellScriptLoader +{ + public: + spell_sha_sentry_totem() : SpellScriptLoader("spell_sha_sentry_totem") { } + + class spell_sha_sentry_totem_AuraScript : public AuraScript + { + PrepareAuraScript(spell_sha_sentry_totem_AuraScript); + + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SHAMAN_BIND_SIGHT)) + return false; + return true; + } + + void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + { + if (Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[4])) + if (totem->isTotem()) + caster->CastSpell(totem, SHAMAN_BIND_SIGHT, true); + } + } + + void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (GetCaster) + if (Player* caster = GetCaster()->ToPlayer()) + caster->StopCastingBindSight(); + } + + void Register() + { + AfterEffectApply += AuraEffectApplyFn(spell_sha_sentry_totem_AuraScript::AfterApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_sha_sentry_totem_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_sha_sentry_totem_AuraScript(); + } +}; + void AddSC_shaman_spell_scripts() { new spell_sha_astral_shift(); @@ -718,4 +766,5 @@ void AddSC_shaman_spell_scripts() new spell_sha_lava_lash(); new spell_sha_chain_heal(); new spell_sha_flame_shock(); + new spell_sha_sentry_totem(); } From cddc6a8a597ef3d0f47ac34e344125eaf02c767d Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 2 Jun 2012 23:48:42 -0230 Subject: [PATCH 0914/1149] DB/waypoints: Pathing for Frigid Proto-Drakes --- .../world/2012_06_02_08_world_waypoints.sql | 256 ++++++++++++++++++ 1 file changed, 256 insertions(+) create mode 100644 sql/updates/world/2012_06_02_08_world_waypoints.sql diff --git a/sql/updates/world/2012_06_02_08_world_waypoints.sql b/sql/updates/world/2012_06_02_08_world_waypoints.sql new file mode 100644 index 00000000000..60b936a7f72 --- /dev/null +++ b/sql/updates/world/2012_06_02_08_world_waypoints.sql @@ -0,0 +1,256 @@ +-- Remove Brunnhildar Drakerider Spawns +DELETE FROM `creature` WHERE `guid` IN (97922,97923); +DELETE FROM `creature_addon` WHERE `guid` IN (97922,97923); + +-- Pathing for Frigid Proto-Drake +SET @NPC := 97991; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,29460,571,1,1,0,0,7138.47,-2166.756,798.66,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7138.47,-2166.756,798.66,0,0,0,100,0), +(@PATH,2,7137.982,-2206.665,805.7148,0,0,0,100,0), +(@PATH,3,7161.205,-2258.269,804.6854,0,0,0,100,0), +(@PATH,4,7192.208,-2308.688,803.2413,0,0,0,100,0), +(@PATH,5,7234.745,-2344.972,803.0753,0,0,0,100,0), +(@PATH,6,7274.754,-2385.471,791.2989,0,0,0,100,0), +(@PATH,7,7279.244,-2432.098,788.5766,0,0,0,100,0), +(@PATH,8,7287.073,-2487.045,787.2991,0,0,0,100,0), +(@PATH,9,7313.09,-2514.464,787.2991,0,0,0,100,0), +(@PATH,10,7371.793,-2525.992,787.2991,0,0,0,100,0), +(@PATH,11,7408.351,-2485.411,787.2991,0,0,0,100,0), +(@PATH,12,7420.525,-2414.975,787.2991,0,0,0,100,0), +(@PATH,13,7408.521,-2337.311,787.2991,0,0,0,100,0), +(@PATH,14,7349.138,-2289.91,787.2991,0,0,0,100,0), +(@PATH,15,7279.763,-2277.351,787.2991,0,0,0,100,0), +(@PATH,16,7206.917,-2239.987,787.2991,0,0,0,100,0), +(@PATH,17,7179.584,-2203.606,787.2991,0,0,0,100,0), +(@PATH,18,7160.147,-2169.823,787.2991,0,0,0,100,0), +(@PATH,19,7134.891,-2128.46,787.2991,0,0,0,100,0), +(@PATH,20,7122.673,-2069.597,787.2991,0,0,0,100,0), +(@PATH,21,7104.583,-2041.353,787.2991,0,0,0,100,0), +(@PATH,22,7060.176,-2045.798,787.2991,0,0,0,100,0), +(@PATH,23,7021.334,-2089.535,787.2991,0,0,0,100,0), +(@PATH,24,7021.683,-2123.516,787.2991,0,0,0,100,0), +(@PATH,25,7055.512,-2136.21,787.2991,0,0,0,100,0), +(@PATH,26,7096.39,-2139.124,787.2991,0,0,0,100,0), +(@PATH,27,7118.583,-2150.815,787.2991,0,0,0,100,0); + +SET @NPC := 97992; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,29460,571,1,1,0,0,7368.505,-2205.943,843.7172,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7368.505,-2205.943,843.7172,0,0,0,100,0), +(@PATH,2,7368.349,-2206.931,843.7172,0,0,0,100,0), +(@PATH,3,7370.282,-2210.494,847.4096,0,0,0,100,0), +(@PATH,4,7355.707,-2244.806,829.2711,0,0,0,100,0), +(@PATH,5,7331.636,-2263.269,812.4655,0,0,0,100,0), +(@PATH,6,7302.835,-2255.226,790.5214,0,0,0,100,0); + +SET @NPC := 98025; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,29460,571,1,1,0,0,7139.471,-2158.159,806.128,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7139.471,-2158.159,806.128,0,0,0,100,0), +(@PATH,2,7174.096,-2197.912,799.7397,0,0,0,100,0), +(@PATH,3,7207.944,-2233.231,799.7397,0,0,0,100,0), +(@PATH,4,7270.875,-2270.113,799.7397,0,0,0,100,0), +(@PATH,5,7326.976,-2290.712,799.7397,0,0,0,100,0), +(@PATH,6,7398.354,-2307.759,858.0721,0,0,0,100,0), +(@PATH,7,7492.969,-2338.019,913.3103,0,0,0,100,0), +(@PATH,8,7516.403,-2341.424,929.4471,0,0,0,100,0), +(@PATH,9,7533.13,-2350.423,930.8928,0,0,0,100,0), +(@PATH,10,7542.375,-2369.76,924.0596,0,0,0,100,0), +(@PATH,11,7540.795,-2388.042,900.4768,0,0,0,100,0), +(@PATH,12,7520.372,-2426.235,856.811,0,0,0,100,0), +(@PATH,13,7490.571,-2460.841,825.395,0,0,0,100,0), +(@PATH,14,7433.976,-2476.923,806.3961,0,0,0,100,0), +(@PATH,15,7363.505,-2480.186,799.9239,0,0,0,100,0), +(@PATH,16,7322.222,-2455.095,799.9239,0,0,0,100,0), +(@PATH,17,7296.217,-2406.509,799.9239,0,0,0,100,0), +(@PATH,18,7250.124,-2348.116,796.2858,0,0,0,100,0), +(@PATH,19,7199.447,-2308.098,791.8962,0,0,0,100,0), +(@PATH,20,7165.64,-2260.306,794.3141,0,0,0,100,0), +(@PATH,21,7126.358,-2218.408,792.2291,0,0,0,100,0), +(@PATH,22,7101.756,-2200.451,797.7845,0,0,0,100,0), +(@PATH,23,7071.807,-2185.584,808.8121,0,0,0,100,0), +(@PATH,24,7043.711,-2175.546,825.1454,0,0,0,100,0), +(@PATH,25,7016.538,-2153.01,825.1454,0,0,0,100,0), +(@PATH,26,7010.379,-2118.062,825.1454,0,0,0,100,0), +(@PATH,27,7031.11,-2081.328,825.1454,0,0,0,100,0), +(@PATH,28,7067.889,-2058.581,825.1454,0,0,0,100,0), +(@PATH,29,7109.583,-2060.563,825.1454,0,0,0,100,0), +(@PATH,30,7129.145,-2089.288,825.1454,0,0,0,100,0), +(@PATH,31,7133.573,-2119.781,811.7565,0,0,0,100,0); + +SET @NPC := 98026; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,29460,571,1,1,0,0,7111.189,-2126.364,809.0059,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7111.189,-2126.364,809.0059,0,0,0,100,0), +(@PATH,2,7112.182,-2126.484,809.0059,0,0,0,100,0), +(@PATH,3,7148.073,-2168.365,801.1813,0,0,0,100,0), +(@PATH,4,7179.175,-2226.085,785.2094,0,0,0,100,0), +(@PATH,5,7223.947,-2286.013,782.9871,0,0,0,100,0), +(@PATH,6,7299.682,-2304.846,784.2374,0,0,0,100,0), +(@PATH,7,7379.366,-2316.926,796.4037,0,0,0,100,0), +(@PATH,8,7415.913,-2373.976,798.6256,0,0,0,100,0), +(@PATH,9,7412.545,-2436.63,796.9036,0,0,0,100,0), +(@PATH,10,7357.321,-2469.256,801.1813,0,0,0,100,0), +(@PATH,11,7324.498,-2460.21,801.1813,0,0,0,100,0), +(@PATH,12,7299.582,-2416.601,796.1536,0,0,0,100,0), +(@PATH,13,7311.903,-2374.752,787.5981,0,0,0,100,0), +(@PATH,14,7312.228,-2301.718,778.1539,0,0,0,100,0), +(@PATH,15,7277.36,-2261.898,778.1539,0,0,0,100,0), +(@PATH,16,7223.409,-2240.653,778.1539,0,0,0,100,0), +(@PATH,17,7146.638,-2228.195,778.1539,0,0,0,100,0), +(@PATH,18,7063.594,-2217.223,802.7003,0,0,0,100,0), +(@PATH,19,7018.785,-2211.49,814.2276,0,0,0,100,0), +(@PATH,20,6971.935,-2170.058,834.7831,0,0,0,100,0), +(@PATH,21,6970.746,-2108.841,872.616,0,0,0,100,0), +(@PATH,22,6991.211,-2071.003,882.1439,0,0,0,100,0), +(@PATH,23,7035.753,-2048.345,872.0881,0,0,0,100,0), +(@PATH,24,7091.613,-2053.953,852.9218,0,0,0,100,0), +(@PATH,25,7120.529,-2096.423,830.6169,0,0,0,100,0), +(@PATH,26,7139.663,-2146.639,806.1729,0,0,0,100,0); + +SET @NPC := 98027; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,29460,571,1,1,0,0,7325.084,-2259.102,789.8701,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7325.084,-2259.102,789.8701,0,0,0,100,0), +(@PATH,2,7324.438,-2258.339,789.8701,0,0,0,100,0), +(@PATH,3,7303.33,-2256.314,797.6193,0,0,0,100,0), +(@PATH,4,7267.175,-2247.528,794.2031,0,0,0,100,0), +(@PATH,5,7214.491,-2258.535,801.3693,0,0,0,100,0), +(@PATH,6,7172.046,-2253.232,805.3967,0,0,0,100,0), +(@PATH,7,7131.951,-2229.063,811.4247,0,0,0,100,0), +(@PATH,8,7094.743,-2214.779,814.9513,0,0,0,100,0), +(@PATH,9,7037.284,-2220.873,816.9806,0,0,0,100,0), +(@PATH,10,7001.552,-2206.268,815.3693,0,0,0,100,0), +(@PATH,11,6987.444,-2184.004,809.9804,0,0,0,100,0), +(@PATH,12,6978.424,-2132.038,810.9526,0,0,0,100,0), +(@PATH,13,7004.174,-2094.79,805.2302,0,0,0,100,0), +(@PATH,14,7061.313,-2081.083,794.8694,0,0,0,100,0), +(@PATH,15,7106.668,-2099.052,785.4243,0,0,0,100,0), +(@PATH,16,7138.966,-2157.915,783.5634,0,0,0,100,0), +(@PATH,17,7148.676,-2194.204,790.7584,0,0,0,100,0), +(@PATH,18,7161.454,-2233.868,796.2581,0,0,0,100,0), +(@PATH,19,7177.563,-2267.763,796.2305,0,0,0,100,0), +(@PATH,20,7208.712,-2314.157,792.0358,0,0,0,100,0), +(@PATH,21,7273.909,-2345.979,783.6465,0,0,0,100,0), +(@PATH,22,7368.229,-2329.532,782.4529,0,0,0,100,0), +(@PATH,23,7446.557,-2387.249,792.8419,0,0,0,100,0), +(@PATH,24,7464.88,-2459.651,777.7035,0,0,0,100,0), +(@PATH,25,7426.007,-2508.458,777.7035,0,0,0,100,0), +(@PATH,26,7367.409,-2517.811,777.7035,0,0,0,100,0), +(@PATH,27,7315.153,-2476.871,777.7035,0,0,0,100,0), +(@PATH,28,7324.871,-2419.788,787.8976,0,0,0,100,0), +(@PATH,29,7343.577,-2356.954,789.7312,0,0,0,100,0), +(@PATH,30,7355.857,-2295.399,785.1757,0,0,0,100,0), +(@PATH,31,7324.438,-2258.339,789.8701,0,0,0,100,0); + +SET @NPC := 97995; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,29460,571,1,1,0,0,7303.549,-2258.753,788.369,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7303.549,-2258.753,788.369,0,0,0,100,0), +(@PATH,2,7302.752,-2258.148,788.369,0,0,0,100,0), +(@PATH,3,7289.952,-2257.048,791.1975,0,0,0,100,0), +(@PATH,4,7258.658,-2235.294,791.1975,0,0,0,100,0), +(@PATH,5,7210.906,-2223.988,791.1975,0,0,0,100,0), +(@PATH,6,7167.373,-2232.4,791.1975,0,0,0,100,0), +(@PATH,7,7124.27,-2224.081,791.1975,0,0,0,100,0), +(@PATH,8,7086.96,-2192.181,791.1975,0,0,0,100,0), +(@PATH,9,7087.704,-2145.958,791.1975,0,0,0,100,0), +(@PATH,10,7127.069,-2118.094,791.1975,0,0,0,100,0), +(@PATH,11,7164.674,-2135.464,793.8918,0,0,0,100,0), +(@PATH,12,7182.364,-2192.978,791.1975,0,0,0,100,0), +(@PATH,13,7182.774,-2277.733,805.3915,0,0,0,100,0), +(@PATH,14,7229.842,-2333.471,805.3915,0,0,0,100,0), +(@PATH,15,7308.383,-2345.623,805.3915,0,0,0,100,0), +(@PATH,16,7376.758,-2335.746,805.3915,0,0,0,100,0), +(@PATH,17,7427.352,-2382.805,805.3915,0,0,0,100,0), +(@PATH,18,7432.168,-2464.934,805.3915,0,0,0,100,0), +(@PATH,19,7370.238,-2513.568,805.3915,0,0,0,100,0), +(@PATH,20,7321.452,-2503.377,805.3915,0,0,0,100,0), +(@PATH,21,7291.445,-2456.148,800.0583,0,0,0,100,0), +(@PATH,22,7306.158,-2414.508,794.0861,0,0,0,100,0), +(@PATH,23,7331.817,-2357.911,790.9471,0,0,0,100,0), +(@PATH,24,7331.193,-2296.791,790.9471,0,0,0,100,0), +(@PATH,25,7305.381,-2260.717,790.9471,0,0,0,100,0); + +SET @NPC := 98028; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,29460,571,1,1,0,0,7133.43,-2118.791,811.7565,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES (@NPC,@PATH,50331648); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7133.43,-2118.791,811.7565,0,0,0,100,0), +(@PATH,2,7133.573,-2119.781,811.7565,0,0,0,100,0), +(@PATH,3,7119.039,-2128.233,806.786,0,0,0,100,0), +(@PATH,4,7129.032,-2143.773,806.786,0,0,0,100,0), +(@PATH,5,7131.506,-2163.489,806.786,0,0,0,100,0), +(@PATH,6,7125.905,-2198.75,806.786,0,0,0,100,0), +(@PATH,7,7133.987,-2234.428,806.786,0,0,0,100,0), +(@PATH,8,7170.914,-2282.005,806.786,0,0,0,100,0), +(@PATH,9,7236.963,-2311.655,806.786,0,0,0,100,0), +(@PATH,10,7279.574,-2311.321,806.786,0,0,0,100,0), +(@PATH,11,7320.696,-2339.429,806.786,0,0,0,100,0), +(@PATH,12,7334.366,-2379.159,806.786,0,0,0,100,0), +(@PATH,13,7321.908,-2419.639,819.0636,0,0,0,100,0), +(@PATH,14,7294.696,-2461.332,841.8126,0,0,0,100,0), +(@PATH,15,7277.729,-2494.843,861.1736,0,0,0,100,0), +(@PATH,16,7245.194,-2587.365,911.9794,0,0,0,100,0), +(@PATH,17,7235.221,-2664.447,911.9794,0,0,0,100,0), +(@PATH,18,7267.375,-2723.981,911.9794,0,0,0,100,0), +(@PATH,19,7364.385,-2762.505,956.4234,0,0,0,100,0), +(@PATH,20,7439.538,-2775.097,990.1998,0,0,0,100,0), +(@PATH,21,7538.208,-2706.511,1012.088,0,0,0,100,0), +(@PATH,22,7575.65,-2563.215,985.2554,0,0,0,100,0), +(@PATH,23,7521.32,-2414.249,933.5882,0,0,0,100,0), +(@PATH,24,7438.214,-2348.566,884.2285,0,0,0,100,0), +(@PATH,25,7349.768,-2296.647,830.8118,0,0,0,100,0), +(@PATH,26,7288.613,-2264.192,802.2007,0,0,0,100,0), +(@PATH,27,7231.5,-2246.911,802.2007,0,0,0,100,0), +(@PATH,28,7160.201,-2264.728,829.4783,0,0,0,100,0), +(@PATH,29,7110.628,-2294.354,859.3112,0,0,0,100,0), +(@PATH,30,7061.597,-2313.25,865.6166,0,0,0,100,0), +(@PATH,31,7008.405,-2309.793,865.6166,0,0,0,100,0), +(@PATH,32,6977.473,-2277.743,865.6166,0,0,0,100,0), +(@PATH,33,6976.358,-2204.402,846.9778,0,0,0,100,0), +(@PATH,34,7022.063,-2142,828.7004,0,0,0,100,0), +(@PATH,35,7070.062,-2121.369,822.228,0,0,0,100,0), +(@PATH,36,7112.182,-2126.484,809.0059,0,0,0,100,0); From 0c54d350fd57918761f6decc7f0bc57402915c3d Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 3 Jun 2012 00:22:31 -0230 Subject: [PATCH 0915/1149] DB/creature_transport: remove dupe spawn --- sql/updates/world/2012_06_02_09_world_creature_transport.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_06_02_09_world_creature_transport.sql diff --git a/sql/updates/world/2012_06_02_09_world_creature_transport.sql b/sql/updates/world/2012_06_02_09_world_creature_transport.sql new file mode 100644 index 00000000000..49bbaa58df2 --- /dev/null +++ b/sql/updates/world/2012_06_02_09_world_creature_transport.sql @@ -0,0 +1,2 @@ +-- Remove dupe spawn from transport table +DELETE FROM `creature_transport` WHERE `guid`=35; From 3888760e10b39936ceff3ee25530f04161d4a8fe Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 3 Jun 2012 00:32:03 -0230 Subject: [PATCH 0916/1149] DB/creature_transport: fix --- sql/updates/world/2012_06_02_09_world_creature_transport.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/updates/world/2012_06_02_09_world_creature_transport.sql b/sql/updates/world/2012_06_02_09_world_creature_transport.sql index 49bbaa58df2..9a0b062f9ea 100644 --- a/sql/updates/world/2012_06_02_09_world_creature_transport.sql +++ b/sql/updates/world/2012_06_02_09_world_creature_transport.sql @@ -1,2 +1,2 @@ -- Remove dupe spawn from transport table -DELETE FROM `creature_transport` WHERE `guid`=35; +DELETE FROM `creature_transport` WHERE `guid`=35 AND `npc_entry`=30755; From c9efe057519ef79e4a41c9aae91ee2ef07c69086 Mon Sep 17 00:00:00 2001 From: kaelima Date: Sun, 3 Jun 2012 05:36:27 +0200 Subject: [PATCH 0917/1149] Core/Visibility: Change the default visibility distance for instances and battlegrounds to blizz-like values. --- src/server/game/Entities/Object/Object.h | 8 ++++---- src/server/worldserver/worldserver.conf.dist | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 64b780bb6c3..5a6a5799fee 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -34,11 +34,11 @@ #define CONTACT_DISTANCE 0.5f #define INTERACTION_DISTANCE 5.0f #define ATTACK_DISTANCE 5.0f -#define MAX_VISIBILITY_DISTANCE 500.0f // max distance for visible objects +#define MAX_VISIBILITY_DISTANCE SIZE_OF_GRIDS // max distance for visible objects #define SIGHT_RANGE_UNIT 50.0f -#define DEFAULT_VISIBILITY_DISTANCE 90.0f // default visible distance, 90 yards on continents -#define DEFAULT_VISIBILITY_INSTANCE 120.0f // default visible distance in instances, 120 yards -#define DEFAULT_VISIBILITY_BGARENAS 180.0f // default visible distance in BG/Arenas, 180 yards +#define DEFAULT_VISIBILITY_DISTANCE 90.0f // default visible distance, 90 yards on continents +#define DEFAULT_VISIBILITY_INSTANCE 170.0f // default visible distance in instances, 170 yards +#define DEFAULT_VISIBILITY_BGARENAS 533.0f // default visible distance in BG/Arenas, roughly 533 yards #define DEFAULT_WORLD_OBJECT_SIZE 0.388999998569489f // player size, also currently used (correctly?) for any non Unit world objects #define DEFAULT_COMBAT_REACH 1.5f diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 5d837100b0e..d8a576f4031 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -2024,17 +2024,17 @@ Visibility.GroupMode = 1 # Visibility.Distance.Instances # Visibility.Distance.BGArenas # Description: Visibility distance to see other players or gameobjects. -# Visibility on continents on retail ~90 yards. In BG/Arenas ~180. -# For instances default ~120. -# Max limited by active player zone: ~ 333 +# Visibility on continents on retail ~90 yards. In BG/Arenas ~533. +# For instances default ~170. +# Max limited by grid size: 533.33333 # Min limit is max aggro radius (45) * Rate.Creature.Aggro # Default: 90 - (Visibility.Distance.Continents) -# 120 - (Visibility.Distance.Instances) -# 180 - (Visibility.Distance.BGArenas) +# 170 - (Visibility.Distance.Instances) +# 533 - (Visibility.Distance.BGArenas) Visibility.Distance.Continents = 90 -Visibility.Distance.Instances = 120 -Visibility.Distance.BGArenas = 180 +Visibility.Distance.Instances = 170 +Visibility.Distance.BGArenas = 533 # # Visibility.Notify.Period.OnContinents From a32f4f439b609b368ad2d57408f27ec7a78e8f39 Mon Sep 17 00:00:00 2001 From: kaelima Date: Sun, 3 Jun 2012 05:41:30 +0200 Subject: [PATCH 0918/1149] Core/Protocol: Move some debug messages to their appropriate debug output mask. --- src/server/game/Handlers/AuthHandler.cpp | 2 +- src/server/game/Handlers/MiscHandler.cpp | 38 +++++++++++------------ src/server/game/Handlers/PetHandler.cpp | 6 ++-- src/server/game/Handlers/QueryHandler.cpp | 10 +++--- src/server/game/Handlers/SpellHandler.cpp | 23 ++++++++------ src/server/game/Server/WorldSession.cpp | 6 ++-- 6 files changed, 45 insertions(+), 40 deletions(-) diff --git a/src/server/game/Handlers/AuthHandler.cpp b/src/server/game/Handlers/AuthHandler.cpp index 9a3e756dda3..49027bdf497 100755 --- a/src/server/game/Handlers/AuthHandler.cpp +++ b/src/server/game/Handlers/AuthHandler.cpp @@ -31,7 +31,7 @@ void WorldSession::SendAuthResponse(uint8 code, bool shortForm, uint32 queuePos) if (!shortForm) { packet << uint32(queuePos); // Queue position - packet << uint8(0); // Unk 3.3.0 + packet << uint8(0); // Realm has a free character migration - bool } SendPacket(&packet); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 8484ac52d27..11f0857ca2b 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -494,7 +494,7 @@ void WorldSession::HandleZoneUpdateOpcode(WorldPacket & recv_data) uint32 newZone; recv_data >> newZone; - sLog->outDetail("WORLD: Recvd ZONE_UPDATE: %u", newZone); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd ZONE_UPDATE: %u", newZone); // use server size data uint32 newzone, newarea; @@ -730,7 +730,7 @@ void WorldSession::HandleBugOpcode(WorldPacket & recv_data) void WorldSession::HandleReclaimCorpseOpcode(WorldPacket &recv_data) { - sLog->outDetail("WORLD: Received CMSG_RECLAIM_CORPSE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_RECLAIM_CORPSE"); uint64 guid; recv_data >> guid; @@ -767,7 +767,7 @@ void WorldSession::HandleReclaimCorpseOpcode(WorldPacket &recv_data) void WorldSession::HandleResurrectResponseOpcode(WorldPacket & recv_data) { - sLog->outDetail("WORLD: Received CMSG_RESURRECT_RESPONSE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_RESURRECT_RESPONSE"); uint64 guid; uint8 status; @@ -938,7 +938,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data) { - sLog->outDetail("WORLD: Received CMSG_UPDATE_ACCOUNT_DATA"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_UPDATE_ACCOUNT_DATA"); uint32 type, timestamp, decompressedSize; recv_data >> type >> timestamp >> decompressedSize; @@ -993,7 +993,7 @@ void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data) void WorldSession::HandleRequestAccountData(WorldPacket& recv_data) { - sLog->outDetail("WORLD: Received CMSG_REQUEST_ACCOUNT_DATA"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_REQUEST_ACCOUNT_DATA"); uint32 type; recv_data >> type; @@ -1072,18 +1072,18 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) void WorldSession::HandleCompleteCinematic(WorldPacket & /*recv_data*/) { - sLog->outStaticDebug("WORLD: Player is watching cinema"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_COMPLETE_CINEMATIC"); } void WorldSession::HandleNextCinematicCamera(WorldPacket & /*recv_data*/) { - sLog->outStaticDebug("WORLD: Which movie to play"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_NEXT_CINEMATIC_CAMERA"); } void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recv_data) { /* WorldSession::Update(getMSTime());*/ - sLog->outStaticDebug("WORLD: Time Lag/Synchronization Resent/Update"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_MOVE_TIME_SKIPPED"); uint64 guid; recv_data.readPackGUID(guid); @@ -1105,7 +1105,7 @@ void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recv_data) void WorldSession::HandleFeatherFallAck(WorldPacket &recv_data) { - sLog->outStaticDebug("WORLD: CMSG_MOVE_FEATHER_FALL_ACK"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_MOVE_FEATHER_FALL_ACK"); // no used recv_data.rfinish(); // prevent warnings spam @@ -1193,13 +1193,17 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data) { uint64 guid; recv_data >> guid; - sLog->outStaticDebug("Inspected guid is " UI64FMTD, guid); + + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_INSPECT"); _player->SetSelection(guid); Player* player = ObjectAccessor::FindPlayer(guid); - if (!player) // wrong player + if (!player) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_INSPECT: No player found from GUID: " UI64FMTD, guid); return; + } uint32 talent_points = 0x47; uint32 guid_size = player->GetPackGUID().wpos(); @@ -1230,7 +1234,7 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data) if (!player) { - sLog->outError("InspectHonorStats: WTF, player not found..."); + sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_INSPECT_HONOR_STATS: No player found from GUID: " UI64FMTD, guid); return; } @@ -1246,10 +1250,6 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data) void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data) { - // write in client console: worldport 469 452 6454 2536 180 or /console worldport 469 452 6454 2536 180 - // Received opcode CMSG_WORLD_TELEPORT - // Time is ***, map=469, x=452.000000, y=6454.000000, z=2536.000000, orient=3.141593 - uint32 time; uint32 mapid; float PositionX; @@ -1264,20 +1264,20 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data) recv_data >> PositionZ; recv_data >> Orientation; // o (3.141593 = 180 degrees) - //sLog->outDebug("Received opcode CMSG_WORLD_TELEPORT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_WORLD_TELEPORT"); + if (GetPlayer()->isInFlight()) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) in flight, ignore worldport command.", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow()); return; } - sLog->outStaticDebug("Time %u sec, map=%u, x=%f, y=%f, z=%f, orient=%f", time/1000, mapid, PositionX, PositionY, PositionZ, Orientation); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_WORLD_TELEPORT: Player = %s, Time = %u, map = %u, x = %f, y = %f, z = %f, o = %f", GetPlayer()->GetName(), time, mapid, PositionX, PositionY, PositionZ, Orientation); if (AccountMgr::IsAdminAccount(GetSecurity())) GetPlayer()->TeleportTo(mapid, PositionX, PositionY, PositionZ, Orientation); else SendNotification(LANG_YOU_NOT_HAVE_PERMISSION); - sLog->outDebug(LOG_FILTER_NETWORKIO, "Received worldport command from player %s", GetPlayer()->GetName()); } void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data) diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index e54bee96b8b..321c0ada247 100755 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -339,9 +339,11 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid if (unit_target2->GetTypeId() == TYPEID_PLAYER) pet->SendUpdateToPlayer((Player*)unit_target2); } + if (Unit* powner = pet->GetCharmerOrOwner()) if (powner->GetTypeId() == TYPEID_PLAYER) - pet->SendUpdateToPlayer(powner->ToPlayer()); + pet->SendUpdateToPlayer(powner->ToPlayer()); + result = SPELL_CAST_OK; } @@ -741,7 +743,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket) void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket) { - sLog->outDetail("WORLD: CMSG_PET_CAST_SPELL"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_PET_CAST_SPELL"); uint64 guid; uint8 castCount; diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp index 628cdbbdd5e..4fb90bed10b 100755 --- a/src/server/game/Handlers/QueryHandler.cpp +++ b/src/server/game/Handlers/QueryHandler.cpp @@ -113,7 +113,7 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recv_data) ObjectMgr::GetLocaleString(cl->SubName, loc_idx, SubName); } } - sLog->outDetail("WORLD: CMSG_CREATURE_QUERY '%s' - Entry: %u.", ci->Name.c_str(), entry); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CREATURE_QUERY '%s' - Entry: %u.", ci->Name.c_str(), entry); // guess size WorldPacket data(SMSG_CREATURE_QUERY_RESPONSE, 100); data << uint32(entry); // creature entry @@ -179,7 +179,7 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recv_data) ObjectMgr::GetLocaleString(gl->CastBarCaption, loc_idx, CastBarCaption); } } - sLog->outDetail("WORLD: CMSG_GAMEOBJECT_QUERY '%s' - Entry: %u. ", info->name.c_str(), entry); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GAMEOBJECT_QUERY '%s' - Entry: %u. ", info->name.c_str(), entry); WorldPacket data (SMSG_GAMEOBJECT_QUERY_RESPONSE, 150); data << uint32(entry); data << uint32(info->type); @@ -209,7 +209,7 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recv_data) void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/) { - sLog->outDetail("WORLD: Received MSG_CORPSE_QUERY"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_CORPSE_QUERY"); Corpse* corpse = GetPlayer()->GetCorpse(); @@ -264,7 +264,7 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recv_data) uint64 guid; recv_data >> textID; - sLog->outDetail("WORLD: CMSG_NPC_TEXT_QUERY ID '%u'", textID); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_NPC_TEXT_QUERY ID '%u'", textID); recv_data >> guid; GetPlayer()->SetSelection(guid); @@ -344,7 +344,7 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recv_data) /// Only _static_ data is sent in this packet !!! void WorldSession::HandlePageTextQueryOpcode(WorldPacket & recv_data) { - sLog->outDetail("WORLD: Received CMSG_PAGE_TEXT_QUERY"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PAGE_TEXT_QUERY"); uint32 pageID; recv_data >> pageID; diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 1affdf0aff7..c02bb43a353 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -99,7 +99,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) return; } - sLog->outDetail("WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, castCount: %u, spellId: %u, Item: %u, glyphIndex: %u, data length = %i", bagIndex, slot, castCount, spellId, pItem->GetEntry(), glyphIndex, (uint32)recvPacket.size()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, castCount: %u, spellId: %u, Item: %u, glyphIndex: %u, data length = %i", bagIndex, slot, castCount, spellId, pItem->GetEntry(), glyphIndex, (uint32)recvPacket.size()); ItemTemplate const* proto = pItem->GetTemplate(); if (!proto) @@ -175,7 +175,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) { - sLog->outDetail("WORLD: CMSG_OPEN_ITEM packet, data length = %i", (uint32)recvPacket.size()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_OPEN_ITEM packet, data length = %i", (uint32)recvPacket.size()); Player* pUser = _player; @@ -658,13 +658,16 @@ void WorldSession::HandleUpdateProjectilePosition(WorldPacket& recvPacket) recvPacket >> z; Unit* caster = ObjectAccessor::GetUnit(*_player, casterGuid); - Spell* spell = caster ? caster->FindCurrentSpellBySpellId(spellId) : NULL; - if (spell && spell->m_targets.HasDst()) - { - Position pos = *spell->m_targets.GetDstPos(); - pos.Relocate(x, y, z); - spell->m_targets.ModDst(pos); - } + if (!caster) + return; + + Spell* spell = caster->FindCurrentSpellBySpellId(spellId); + if (!spell || !spell->m_targets.HasDst()) + return; + + Position pos = *spell->m_targets.GetDstPos(); + pos.Relocate(x, y, z); + spell->m_targets.ModDst(pos); WorldPacket data(SMSG_SET_PROJECTILE_POSITION, 21); data << uint64(casterGuid); @@ -672,5 +675,5 @@ void WorldSession::HandleUpdateProjectilePosition(WorldPacket& recvPacket) data << float(x); data << float(y); data << float(z); - SendPacket(&data); + caster->SendMessageToSet(&data, true); } diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 7756e686388..81ec5495421 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -208,7 +208,7 @@ void WorldSession::QueuePacket(WorldPacket* new_packet) /// Logging helper for unexpected opcodes void WorldSession::LogUnexpectedOpcode(WorldPacket* packet, const char* status, const char *reason) { - sLog->outError("SESSION (account: %u, guidlow: %u, char: %s): received unexpected opcode %s (0x%.4X, status: %s) %s", + sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION (account: %u, guidlow: %u, char: %s): received unexpected opcode %s (0x%.4X, status: %s) %s", GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "", LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode(), status, reason); } @@ -216,7 +216,7 @@ void WorldSession::LogUnexpectedOpcode(WorldPacket* packet, const char* status, /// Logging helper for unexpected opcodes void WorldSession::LogUnprocessedTail(WorldPacket* packet) { - sLog->outError("SESSION: opcode %s (0x%.4X) have unprocessed tail data (read stop at %u from %u)", + sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION: opcode %s (0x%.4X) have unprocessed tail data (read stop at %u from %u)", LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode(), uint32(packet->rpos()), uint32(packet->wpos())); packet->print_storage(); } @@ -334,7 +334,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) LogUnprocessedTail(packet); break; case STATUS_NEVER: - sLog->outError("SESSION (account: %u, guidlow: %u, char: %s): received not allowed opcode %s (0x%.4X)", + sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION (account: %u, guidlow: %u, char: %s): received not allowed opcode %s (0x%.4X)", GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "", LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode()); break; From 985e8cdcd33f1bf993527da72e24820ffdd15b30 Mon Sep 17 00:00:00 2001 From: 4m1g0 Date: Sun, 3 Jun 2012 06:13:28 +0200 Subject: [PATCH 0919/1149] Core/Commands: Fixed lookup quest command to show [rewarded] mark on rewarded quests --- src/server/game/Chat/Commands/Level3.cpp | 34 +++++++++++++++--------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 30562bb9662..4b2f1c5e7bb 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -1144,15 +1144,20 @@ bool ChatHandler::HandleLookupQuestCommand(const char *args) { QuestStatus status = target->GetQuestStatus(qinfo->GetQuestId()); - if (status == QUEST_STATUS_COMPLETE) + switch (status) { - if (target->GetQuestRewardStatus(qinfo->GetQuestId())) - statusStr = GetTrinityString(LANG_COMMAND_QUEST_REWARDED); - else + case QUEST_STATUS_COMPLETE: statusStr = GetTrinityString(LANG_COMMAND_QUEST_COMPLETE); + break; + case QUEST_STATUS_INCOMPLETE: + statusStr = GetTrinityString(LANG_COMMAND_QUEST_ACTIVE); + break; + case QUEST_STATUS_REWARDED: + statusStr = GetTrinityString(LANG_COMMAND_QUEST_REWARDED); + break; + default: + break; } - else if (status == QUEST_STATUS_INCOMPLETE) - statusStr = GetTrinityString(LANG_COMMAND_QUEST_ACTIVE); } if (m_session) @@ -1187,15 +1192,20 @@ bool ChatHandler::HandleLookupQuestCommand(const char *args) { QuestStatus status = target->GetQuestStatus(qinfo->GetQuestId()); - if (status == QUEST_STATUS_COMPLETE) + switch (status) { - if (target->GetQuestRewardStatus(qinfo->GetQuestId())) - statusStr = GetTrinityString(LANG_COMMAND_QUEST_REWARDED); - else + case QUEST_STATUS_COMPLETE: statusStr = GetTrinityString(LANG_COMMAND_QUEST_COMPLETE); + break; + case QUEST_STATUS_INCOMPLETE: + statusStr = GetTrinityString(LANG_COMMAND_QUEST_ACTIVE); + break; + case QUEST_STATUS_REWARDED: + statusStr = GetTrinityString(LANG_COMMAND_QUEST_REWARDED); + break; + default: + break; } - else if (status == QUEST_STATUS_INCOMPLETE) - statusStr = GetTrinityString(LANG_COMMAND_QUEST_ACTIVE); } if (m_session) From 3b44401aa66b8f6109a9499a71e40adc015219f4 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 3 Jun 2012 15:31:37 +0200 Subject: [PATCH 0920/1149] Core/Movement: Fixed Facing* splines on transports --- src/server/game/Movement/Spline/MoveSplineInit.cpp | 8 ++++++++ src/server/game/Movement/Spline/MoveSplineInit.h | 8 +++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index b8440e06076..c5f959e2f1d 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -138,6 +138,14 @@ namespace Movement void MoveSplineInit::SetFacing(float angle) { + if (unit.HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + { + if (Unit* vehicle = unit.GetVehicleBase()) + angle -= vehicle->GetOrientation(); + else if (Transport* transport = unit.GetTransport()) + angle -= transport->GetOrientation(); + } + args.facing.angle = G3D::wrap(angle, 0.f, (float)G3D::twoPi()); args.flags.EnableFacingAngle(); } diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h index b1b08d97cfa..786324e3f77 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.h +++ b/src/server/game/Movement/Spline/MoveSplineInit.h @@ -166,9 +166,11 @@ namespace Movement inline void MoveSplineInit::SetFacing(Vector3 const& spot) { - args.facing.f.x = spot.x; - args.facing.f.y = spot.y; - args.facing.f.z = spot.z; + TransportPathTransform transform(unit); + Vector3 finalSpot = transform(spot); + args.facing.f.x = finalSpot.x; + args.facing.f.y = finalSpot.y; + args.facing.f.z = finalSpot.z; args.flags.EnableFacingPoint(); } } From 4e745d2888783e326bda9ac3f0fd940e11411b7f Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 3 Jun 2012 15:10:47 +0100 Subject: [PATCH 0921/1149] Core/Enums: Update vehicle seat flags and vehicle seat b flags (from WPP) --- src/server/game/DataStores/DBCEnums.h | 14 +++++++++++++- src/server/game/Entities/Vehicle/Vehicle.cpp | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index 23578a55816..e73480cb4de 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -416,16 +416,27 @@ enum SummonPropFlags enum VehicleSeatFlags { + VEHICLE_SEAT_FLAG_HAS_LOWER_ANIM_FOR_ENTER = 0x00000001, + VEHICLE_SEAT_FLAG_HAS_LOWER_ANIM_FOR_RIDE = 0x00000002, + VEHICLE_SEAT_FLAG_SHOULD_USE_VEH_SEAT_EXIT_ANIM_ON_VOLUNTARY_EXIT = 0x00000008, VEHICLE_SEAT_FLAG_HIDE_PASSENGER = 0x00000200, // Passenger is hidden - VEHICLE_SEAT_FLAG_UNK1 = 0x00000400, // needed for CGCamera__SyncFreeLookFacing + VEHICLE_SEAT_FLAG_ALLOW_TURNING = 0x00000400, // needed for CGCamera__SyncFreeLookFacing VEHICLE_SEAT_FLAG_CAN_CONTROL = 0x00000800, // Lua_UnitInVehicleControlSeat VEHICLE_SEAT_FLAG_CAN_CAST_MOUNT_SPELL = 0x00001000, // Can cast spells with SPELL_AURA_MOUNTED from seat (possibly 4.x only, 0 seats on 3.3.5a) VEHICLE_SEAT_FLAG_UNCONTROLLED = 0x00002000, // can override !& VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT VEHICLE_SEAT_FLAG_CAN_ATTACK = 0x00004000, // Can attack, cast spells and use items from vehicle + VEHICLE_SEAT_FLAG_SHOULD_USE_VEH_SEAT_EXIT_ANIMN_ON_FORCED_EXIT = 0x00008000, + VEHICLE_SEAT_FLAG_HAS_VEH_EXIT_ANIM_VOLUNTARY_EXIT = 0x00040000, + VEHICLE_SEAT_FLAG_HAS_VEH_EXIT_ANIM_FORCED_EXIT = 0x00080000, + VEHICLE_SEAT_FLAG_REC_HAS_VEHICLE_ENTER_ANIM = 0x00400000, + VEHICLE_SEAT_FLAG_ENABLE_VEHICLE_ZOOM = 0x01000000, VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT = 0x02000000, // Lua_CanExitVehicle - can enter and exit at free will VEHICLE_SEAT_FLAG_CAN_SWITCH = 0x04000000, // Lua_CanSwitchVehicleSeats + VEHICLE_SEAT_FLAG_HAS_START_WARITING_FOR_VEH_TRANSITION_ANIM_ENTER = 0x08000000, + VEHICLE_SEAT_FLAG_HAS_START_WARITING_FOR_VEH_TRANSITION_ANIM_EXIT = 0x10000000, VEHICLE_SEAT_FLAG_CAN_CAST = 0x20000000, // Lua_UnitHasVehicleUI VEHICLE_SEAT_FLAG_UNK2 = 0x40000000, // checked in conjunction with 0x800 in CastSpell2 + VEHICLE_SEAT_FLAG_ALLOWS_INTERACTION = 0x80000000, }; enum VehicleSeatFlagsB @@ -437,6 +448,7 @@ enum VehicleSeatFlagsB VEHICLE_SEAT_FLAG_B_USABLE_FORCED_2 = 0x00000040, VEHICLE_SEAT_FLAG_B_USABLE_FORCED_3 = 0x00000100, VEHICLE_SEAT_FLAG_B_USABLE_FORCED_4 = 0x02000000, + VEHICLE_SEAT_FLAG_B_CAN_SWITCH = 0x04000000, VEHICLE_SEAT_FLAG_B_VEHICLE_PLAYERFRAME_UI = 0x80000000, // Lua_UnitHasVehiclePlayerFrameUI - actually checked for flagsb &~ 0x80000000 }; diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index c297ce1e792..04bcfdcc375 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -338,7 +338,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) } } - if (seat->second.SeatInfo->m_flags && !(seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_UNK1)) + if (seat->second.SeatInfo->m_flags && !(seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_ALLOW_TURNING)) unit->AddUnitState(UNIT_STATE_ONVEHICLE); unit->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); From 820ce262779c05a95649fcaa10e9310f0563c7e2 Mon Sep 17 00:00:00 2001 From: kaelima Date: Sun, 3 Jun 2012 15:12:32 +0100 Subject: [PATCH 0922/1149] DB/Quests: Fix quest Magic Carpet Ride --- sql/updates/world/2012_06_03_00_world_sai.sql | 71 +++++++++++++++++++ src/server/game/Spells/SpellMgr.cpp | 3 + 2 files changed, 74 insertions(+) create mode 100644 sql/updates/world/2012_06_03_00_world_sai.sql diff --git a/sql/updates/world/2012_06_03_00_world_sai.sql b/sql/updates/world/2012_06_03_00_world_sai.sql new file mode 100644 index 00000000000..dec53519ee7 --- /dev/null +++ b/sql/updates/world/2012_06_03_00_world_sai.sql @@ -0,0 +1,71 @@ +SET @YANNI := 25459; +SET @CARPET := 25460; +SET @Q_CarpetRide := 11636; + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@YANNI,@CARPET) AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@CARPET*100,@CARPET*101,@CARPET*100+1) AND `source_type`=9; +INSERT INTO `smart_scripts`(`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`)VALUES +(@YANNI,0,0,0,62,0,100,0,9162,0,0,0,11,45600,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Yanni - Cast Call of the Carpet on player'), +(@YANNI,0,1,0,62,0,100,0,9162,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Yanni - On Gossip option - Close gossip'), + +(@CARPET,0,0,0,25,0,100,0,0,0,0,0,80,@CARPET*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Amazing Carpet - Call actionlist 2546000 on spawn'), +(@CARPET,0,1,0,40,0,100,0,14,0,0,0,80,@CARPET*100+1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Amazing Carpet - On WP reach - Call actionlist 2546001'), + +(@CARPET*100,9,0,0,0,0,100,0,1000,1000,0,0,11,45603,0,0,0,0,0,23,0,0,0,0,0,0,0, 'Amazing Carpet - Cast Ride Carpet on summoner'), +(@CARPET*100,9,1,0,0,0,100,0,100,100,0,0,53,0,@CARPET,0,0,0,0,1,0,0,0,0,0,0,0, 'Amazing Carpet - Load waypath'), + +(@CARPET*100+1,9,0,0,0,0,100,0,0,0,0,0,15,@Q_CarpetRide,0,0,0,0,0,23,0,0,0,0,0,0,0, 'Amazing Carpet - Give quest credit'), +(@CARPET*100+1,9,1,0,0,0,100,0,500,500,0,0,28,45602,0,0,0,0,0,23,0,0,0,0,0,0,0, 'Amazing Carpet - Remove aura 45602'), +(@CARPET*100+1,9,2,0,0,0,100,0,100,100,0,0,28,46598,0,0,0,0,0,23,0,0,0,0,0,0,0, 'Amazing Carpet - Remove aura 46598'), +(@CARPET*100+1,9,3,0,0,0,100,0,200,200,0,0,41,200,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Amazing Carpet - Despawn'); + +DELETE FROM `waypoints` WHERE `entry`=@CARPET; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@CARPET,1,2751.96,6133.514,214.3789, 'Start WP'), +(@CARPET,2,2728.81,6146.472,213.5733, ''), +(@CARPET,3,2634.248,6188.829,185.9068, ''), +(@CARPET,4,2597.958,6255.91,159.7123, ''), +(@CARPET,5,2538.717,6307.643,138.9901, ''), +(@CARPET,6,2393.912,6321.946,85.79566, ''), +(@CARPET,7,2420.326,6461.604,89.3512, ''), +(@CARPET,8,2439.194,6494.39,84.93455, ''), +(@CARPET,9,2496.371,6496.766,78.76788, ''), +(@CARPET,10,2567.008,6550.509,79.90676, ''), +(@CARPET,11,2652.553,6572.071,58.54562, ''), +(@CARPET,12,2725.122,6642.299,41.57339, ''), +(@CARPET,13,2773.236,6694.341,25.49007, ''), +(@CARPET,14,2797.658,6718.523,9.212306, 'Run SmartAI script 2546001'); + +DELETE FROM `creature_template_addon` WHERE `entry` IN (@CARPET,@YANNI); +INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES +(@CARPET,257, '61307'), +(@YANNI,257,NULL); + +-- Update gossip_menu to proper entry from sniff (delete wrong one 21233) +UPDATE `creature_template` SET `gossip_menu_id`=9162,`AiName`= 'SmartAI' WHERE `entry`=@YANNI; +UPDATE `creature_template` SET `exp`=2,`minlevel`=72,`maxlevel`=72,`unit_flags`=`unit_flags`|520,`speed_run`=1.42857,`VehicleId`=317,`AiName`='SmartAI',`InhabitType`=5 WHERE `entry`=@CARPET; + +UPDATE `creature_model_info` SET `bounding_radius`=0.31,`combat_reach`=1,`gender`=2 WHERE `modelid`=28082; -- Amazing Flying Carpet + +DELETE FROM `gossip_menu` WHERE `entry` IN (21233,9162); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(9162,12417); + +UPDATE `quest_template` SET `SpecialFlags`=`SpecialFlags`|2 WHERE `Id`=@Q_CarpetRide; + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=9162; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9162; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`Comment`) VALUES +(15,9162,0,0,9,@Q_CarpetRide,0,0,0,'Show gossip option 9162 if player has quest Carpet Ride'); + +DELETE FROM `spell_target_position` WHERE `id`=45601; +INSERT INTO `spell_target_position` (`id`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`) VALUES +(45601,571,2753.64,6131.41,210.4463,2.892622); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=45602; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13,1,45602,0,0,31,0,3,@CARPET,0,0,0, '', 'Ride Carpet - Target Amazing Flying Carpet'); + +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=@CARPET; +INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`, `user_type`) VALUES +(@CARPET,46598,1,0); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 06e4978eb58..cdaecdcaa20 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3238,6 +3238,9 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->EffectDieSides[0] = 0; // was 1, that should probably mean seat 0, but instead it's treated as spell 1 spellInfo->EffectBasePoints[0] = 52391; // Ride Vehicle (forces seat 0) break; + case 45602: // Ride Carpet + spellInfo->EffectBasePoints[EFFECT_0] = 0; // force seat 0, vehicle doesn't have the required seat flags for "no seat specified (-1)" + break; case 64745: // Item - Death Knight T8 Tank 4P Bonus case 64936: // Item - Warrior T8 Protection 4P Bonus spellInfo->EffectBasePoints[0] = 100; // 100% chance of procc'ing, not -10% (chance calculated in PrepareTriggersExecutedOnHit) From 87cec6b63850d165b59e3053a0ae1c29a0947317 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 3 Jun 2012 14:16:34 -0230 Subject: [PATCH 0923/1149] DB/creature/misc: Add some felboar spawns and update a few creatures. --- .../world/2012_06_03_01_world_creature.sql | 16 ++++++++++++++++ sql/updates/world/2012_06_03_02_world_misc.sql | 6 ++++++ 2 files changed, 22 insertions(+) create mode 100644 sql/updates/world/2012_06_03_01_world_creature.sql create mode 100644 sql/updates/world/2012_06_03_02_world_misc.sql diff --git a/sql/updates/world/2012_06_03_01_world_creature.sql b/sql/updates/world/2012_06_03_01_world_creature.sql new file mode 100644 index 00000000000..68448b31591 --- /dev/null +++ b/sql/updates/world/2012_06_03_01_world_creature.sql @@ -0,0 +1,16 @@ +-- Add more Domesticated Felboar Spawns +SET @GUID := 43456; +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+11; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@GUID,21195,530,1,1,0,0,-2547.195,1426.521,65.57381,1.465101,300,5,0,1,0,1), +(@GUID+1,21195,530,1,1,0,0,-2585.524,1448.067,53.78493,2.973133,300,5,0,1,0,1), +(@GUID+2,21195,530,1,1,0,0,-2513.349,1387.699,66.09725,4.945046,300,5,0,1,0,1), +(@GUID+3,21195,530,1,1,0,0,-2629.757,1453.611,47.29396,4.210276,300,5,0,1,0,1), +(@GUID+4,21195,530,1,1,0,0,-2582.189,1378.531,82.12544,6.054177,300,5,0,1,0,1), +(@GUID+5,21195,530,1,1,0,0,-2478.125,1412.92,25.51498,1.570796,300,5,0,1,0,1), +(@GUID+6,21195,530,1,1,0,0,-2543.231,1349.134,80.78722,5.94909,300,5,0,1,0,1), +(@GUID+7,21195,530,1,1,0,0,-2646.627,1379.277,87.30627,5.863042,300,5,0,1,0,1), +(@GUID+8,21195,530,1,1,0,0,-2611.153,1345.497,84.32706,2.073398,300,5,0,1,0,1), +(@GUID+9,21195,530,1,1,0,0,-2518.199,1318.885,70.41351,1.823595,300,5,0,1,0,1), +(@GUID+10,21195,530,1,1,0,0,-2597.69,1311.426,80.75146,3.249409,300,5,0,1,0,1), +(@GUID+11,21195,530,1,1,0,0,-2545.57,1278.59,82.01826,4.833836,300,5,0,1,0,1); diff --git a/sql/updates/world/2012_06_03_02_world_misc.sql b/sql/updates/world/2012_06_03_02_world_misc.sql new file mode 100644 index 00000000000..69de8eacdf3 --- /dev/null +++ b/sql/updates/world/2012_06_03_02_world_misc.sql @@ -0,0 +1,6 @@ +-- Misc db updates +DELETE FROM `creature_template_addon` WHERE `entry`=30476; +INSERT INTO `creature_template_addon` (`entry`,`auras`) VALUES (30476,'56852'); +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128 WHERE `entry` IN (30476,30599,30640,32193,30343); +-- fix Sholazar Tickbird InhabitType +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=28093; From ee82a71cea46c6585712ee2ea88e790c31bb7d17 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 3 Jun 2012 22:08:10 +0100 Subject: [PATCH 0924/1149] DB/Quests: Update OfferRewardText and RequestItemsText for some quests P.S This introduces less new content than what it appears to be, most updates are simple typo fixes or removing or adding an extra space --- sql/updates/world/2012_06_03_00_world_sai.sql | 2 +- .../2012_06_03_03_world_quest_template.sql | 603 ++++++++++++++++++ 2 files changed, 604 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_06_03_03_world_quest_template.sql diff --git a/sql/updates/world/2012_06_03_00_world_sai.sql b/sql/updates/world/2012_06_03_00_world_sai.sql index dec53519ee7..7a5932e61fc 100644 --- a/sql/updates/world/2012_06_03_00_world_sai.sql +++ b/sql/updates/world/2012_06_03_00_world_sai.sql @@ -3,7 +3,7 @@ SET @CARPET := 25460; SET @Q_CarpetRide := 11636; DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@YANNI,@CARPET) AND `source_type`=0; -DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@CARPET*100,@CARPET*101,@CARPET*100+1) AND `source_type`=9; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@CARPET*100,@CARPET*100+1) AND `source_type`=9; INSERT INTO `smart_scripts`(`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`)VALUES (@YANNI,0,0,0,62,0,100,0,9162,0,0,0,11,45600,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Yanni - Cast Call of the Carpet on player'), (@YANNI,0,1,0,62,0,100,0,9162,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Yanni - On Gossip option - Close gossip'), diff --git a/sql/updates/world/2012_06_03_03_world_quest_template.sql b/sql/updates/world/2012_06_03_03_world_quest_template.sql new file mode 100644 index 00000000000..023182aaf1b --- /dev/null +++ b/sql/updates/world/2012_06_03_03_world_quest_template.sql @@ -0,0 +1,603 @@ +-- OfferRewardText +UPDATE `quest_template` SET `OfferRewardText`='Ah yes, the delivery of herbs from Shadowglen. It is a shame Porthannius could not bring it himself, for we have much to discuss, he and I. But I am glad to get the herbs nonetheless, and I am glad you came.$B$BWhile you are here, please, rest yourself. Heroes must keep their strength and spirits high, and must find rest and solace whenever they may. For to neglect one''s peace of body and mind is a sure path to failure.$B$BSo... rest.' WHERE `Id`=2159; -- Dolanaar Delivery +UPDATE `quest_template` SET `OfferRewardText`='You saved my life up there, buddy. Nice flying!' WHERE `Id`=12671; -- Reconnaissance Flight +UPDATE `quest_template` SET `OfferRewardText`='Wow... S.T.O.U.T. didn''t break... Hmm... Who would have guessed?$b$bI mean, hey, you did it! Your aim is true, or at least true enough to help guard the camp. I think you''re ready now to take on the Dark Irons if they show up again.' WHERE `Id`=12191; -- Chug and Chuck! +UPDATE `quest_template` SET `OfferRewardText`='Not bad for a new overseer. I''ve another task for you if you''re feeling brave today.' WHERE `Id`=12906; -- Discipline +UPDATE `quest_template` SET `OfferRewardText`='If I had any reservations regarding your commitment when you first arrived, I no longer have any. With just a little more effort you could be a permanent member of my operation.' WHERE `Id`=12907; -- Examples to be Made +UPDATE `quest_template` SET `OfferRewardText`='I knew you''d be back! Get me out of these shackles and I''ll help you find the goblin.' WHERE `Id`=12908; -- A Certain Prisoner +UPDATE `quest_template` SET `OfferRewardText`='You''re here -- good. I think I know where your goblin is.' WHERE `Id`=12921; -- A Change of Scenery +UPDATE `quest_template` SET `OfferRewardText`='Well done, young one. It looks like our deal has been satisfied on both our ends.' WHERE `Id`=12969; -- Is That Your Goblin? +UPDATE `quest_template` SET `OfferRewardText`='It''s settled then. You will compete in the Hyldsmeet and with my help you''ll restore great Thorim to his rightful place.' WHERE `Id`=12970; -- The Hyldsmeet +UPDATE `quest_template` SET `OfferRewardText`='Ah, the furs I was expecting. Thank you.$B$BThese came faster than I had expected. They will make good blankets for anyone who wishes to stay here.$B$BPlease feel free to stay as long as you like. My inn is always open and all of our people are welcome here. And don''t underestimate a good night''s rest, it can make a great difference while you''re out traveling.' WHERE `Id`=1656; -- A Task Unfinished +UPDATE `quest_template` SET `OfferRewardText`='Ah, $n! I didn''t think you''d have much trouble finding the place, my directions are excellent, you know...$b$bLet me just finish up my report then.$b$b$b$bThere! Well, haha, now this certainly is funny... I don''t suppose, $n, that you would mind doing one last favor for me?' WHERE `Id`=287; -- Frostmane Hold +UPDATE `quest_template` SET `OfferRewardText`='$B$BI remember these...$B$BLesser men would easily crumble beneath their assault. You have done well in removing their threat.' WHERE `Id`=13339; -- Shatter the Shards +UPDATE `quest_template` SET `OfferRewardText`='You did it! Our boys are back!' WHERE `Id`=12843; -- They Took Our Men! +UPDATE `quest_template` SET `OfferRewardText`='You''re definitely not with the Hyldnir... so what are you here for? Ah... you must be looking for the new prisoner!' WHERE `Id`=12846; -- Leave No Goblin Behind +UPDATE `quest_template` SET `OfferRewardText`='I wasn''t sure you were coming back. I dread to think what will happen to me if I stay here for much longer.' WHERE `Id`=12841; -- The Crone's Bargain +UPDATE `quest_template` SET `OfferRewardText`='I was expecting a replacement for one of my overseers. It''s about time you showed up.$B$BLet''s put you to work.' WHERE `Id`=12905; -- Mildred the Cruel +UPDATE `quest_template` SET `OfferRewardText`='Dahlia was taken by the Scourge? This is a sad day for all of us.$B$BI will look to finding a new keeper once the shrine is retaken. Thank you for your efforts... the Ruby Dragonshrine is a sacred place to us, and the sacrifices your kind have made will not be easily forgotten.$B$BIt is good to know there are still heroes such as you - I will call upon you one day. Until that day comes, may your adventures be fruitful.' WHERE `Id`=12419; -- The Fate of the Ruby Dragonshrine +UPDATE `quest_template` SET `OfferRewardText`='$B$BGood... good! So that you know I am being fair, I will first give you your reward as promised.$B$BAnd then you will willingly hand me the key.' WHERE `Id`=13308; -- Mind Tricks +UPDATE `quest_template` SET `OfferRewardText`='They''re being driven insane? Voices in their heads?$B$BVoices in your head?!$B$BI want you to clear your mind of the taint that has crept into that place, $g boy : girl;.$B$BWe''ll try to get the remainder of them out of there again tomorrow when you''ve had a chance to rest.' WHERE `Id`=13300; -- Slaves to Saronite +UPDATE `quest_template` SET `OfferRewardText`='Well done. Training against the other valiants is one of the best ways to prepare yourself for tournament competition. I know you''ll make Stormwind proud, $N.' WHERE `Id`=13665; -- The Grand Melee +UPDATE `quest_template` SET `OfferRewardText`='Well done, $N! You demonstrated uncanny courage on the battlefield. Our war against the Troggs will be won with efforts such as yours. You have served King Magni well.$b$bIf you fancy yourself well-suited for this kind of adventuring, I suggest you speak with Mountaineer Gravelgaw. The Captain has him assigned to a rough patrol that I am sure he can use some help with. Check with Gravelgaw just inside the tower.' WHERE `Id`=224; -- In Defense of the King's Lands +UPDATE `quest_template` SET `OfferRewardText`='I am quite impressed, $N. You have done the Dwarven race a great favor by defending our lands. King Magni Bronzebeard himself would be proud!' WHERE `Id`=267; -- The Trogg Threat +UPDATE `quest_template` SET `OfferRewardText`='Hey, that wasn''t too bad... are you sure you''re not a dwarf?$b$bSo there''s plenty more racing to be had and it''s not just from me. All over the Brewfest grounds you''ll find people in need of a decent ram racer. So go and make yourself useful.$b$bOh and don''t forget, these rams were legally obtained. I just want to make sure we''re clear.' WHERE `Id`=11409; -- Now This is Ram Racing... Almost. +UPDATE `quest_template` SET `OfferRewardText`='You are a kind and compassionate $r, friend.' WHERE `Id`=10804; -- Kindness +UPDATE `quest_template` SET `OfferRewardText`='My children have told me of your heroic deeds, $r. There is more that you can do.' WHERE `Id`=10811; -- Seek Out Neltharaku +UPDATE `quest_template` SET `OfferRewardText`='I am free! You have saved us, $N!' WHERE `Id`=10872; -- Zuluhed the Whacked +UPDATE `quest_template` SET `OfferRewardText`='You have proven yourself as an ally of the Netherwing. My mother is free and my brothers and sisters are saved!$B$BPerhaps someday, we will call for you again. When that day comes, know that you will be welcomed with open arms - a $g brother:sister; to the Netherwing Dragonflight.' WHERE `Id`=10871; -- Ally of the Netherwing +UPDATE `quest_template` SET `OfferRewardText`='You''ve done it, $N. You''ve bested some of the fiercest fighters the Hyldnir race has to offer.' WHERE `Id`=12971; -- Taking on All Challengers +UPDATE `quest_template` SET `OfferRewardText`='Think we''ll give you your own bear just like that? You''ll have to prove yourself before you get anything from us.$B$BDo not think too highly of yourself just because you bested a few challengers in the Hyldsmeet.' WHERE `Id`=12972; -- You'll Need a Bear +UPDATE `quest_template` SET `OfferRewardText`='You have shown yourself a capable combatant, $N and you will serve as an example to the rest of the aspirants who clamor to compete on behalf of the Alliance.' WHERE `Id`=13671; -- Training In The Field +UPDATE `quest_template` SET `OfferRewardText`='$B$BHad Ragemane since pup. Sad day for Rageclaw. First troll attack Rageclaw, then troll make Ragemane bad. Rageclaw never trade with troll again!' WHERE `Id`=12857; -- Wanted: Ragemane's Flipper +UPDATE `quest_template` SET `OfferRewardText`='You place the egg... distress beacon... inside the chicken... homing robot.$B$BHums and whirs are heard from inside the robot as it struggles to stand up. After the robot comes to life, Oglethorpe''s voice is heard once more, but now from inside the robot:$B$B\"OOX-17/TN is working at least, but it needs major repairs! It is much too heavy for you to carry it... but I think I have an idea. Are you up for watching over it some more?\"' WHERE `Id`=351; -- Find OOX-17/TN! +UPDATE `quest_template` SET `OfferRewardText`='Excellent - the more water pouches we are able to reclaim, the further away from disaster we''ll all be! Keep ''em coming, and I will be sure to reward you for every five water pouches you bring me.' WHERE `Id`=1707; -- Water Pouch Bounty +UPDATE `quest_template` SET `OfferRewardText`='Now that''s what I call efficiency! You''ve helped thin out the nomad''s numbers enough now that we can start to think about how we can win back those water wells.$B$BThe Gadgetzan Water Company thanks you for your help, but we''re far from done in dealing with those foul nomads. Listen close - here''s what we need next...' WHERE `Id`=1690; -- Wastewander Justice +UPDATE `quest_template` SET `OfferRewardText`='Finally - justice is served! You have struck a mighty blow against those vile nomads! With Scorpidsting''s demise, this might be just the thing to finally push those squatters off of Gadgetzan''s water wells!$B$BBy the authority of the Gadgetzan Water Company, I gladly award you with this bounty. You''ve done a great service for us all.' WHERE `Id`=2781; -- WANTED: Caliph Scorpidsting +UPDATE `quest_template` SET `OfferRewardText`='$N! You are the $g man:woman;!!!$B$BI''m sure that the Cartel will ease up on me now that you''ve dealt with those Southsea scum. Let''s see, what can I give you as a reward? How about a little coin and you choose from one of these for your trouble?' WHERE `Id`=8366; -- Southsea Shakedown +UPDATE `quest_template` SET `OfferRewardText`='Ah, Andre''s head. So I guess he''ll make his trial after all!$B$BMuch appreciated, $N. Now if you''ll just sign here, I can issue you payment for services rendered.$B$BDon''t worry about the small print. It''s harmless, and... I don''t think there''s a magnifying glass small enough to read it anyway.' WHERE `Id`=2875; -- WANTED: Andre Firebeard +UPDATE `quest_template` SET `OfferRewardText`='Great, thanks for the shipment! Now MacKinley and I can finally settle our wager.' WHERE `Id`=2873; -- Stoley's Shipment +UPDATE `quest_template` SET `OfferRewardText`='You have my sincere thanks for your efforts, $N. Though much remains to be done, it gladdens me to know we have helped some find their long-deserved rest.' WHERE `Id`=10047; -- The Path of Glory +UPDATE `quest_template` SET `OfferRewardText`='Well, I must say, I am impressed, $N. I didn''t think you had the mettle for this mission. Well done. Well done, indeed. +' WHERE `Id`=10394; -- Disruption - Forge Camp: Mageddon +UPDATE `quest_template` SET `OfferRewardText`='It worked! You got the essence! Well done, $N! Well done!$B$BThis essence will be invaluable in my research. I hope to one day learn how to capture living dragon whelps, or perhaps capture their eggs. If I could find a way to do that, then I would be the envy of dragon scholars around the world!$B$BMy employer would also be happy, and as I said before, he''s someone you want to keep happy...' WHERE `Id`=4726; -- Broodling Essence +UPDATE `quest_template` SET `OfferRewardText`='There is no doubt, this is raw saronite. We''ve seen weapons made from it in the hands of the Lich King''s chosen before, but this is the first time it''s been used to arm anything else. The scale of that mining operation must be huge.' WHERE `Id`=13138; -- I'm Smelting... Smelting! +UPDATE `quest_template` SET `OfferRewardText`='$B$BIt is not the burial they deserved, but it is better than nothing, and better for those who yet live. Thank you, $N.' WHERE `Id`=13211; -- By Fire Be Purged +UPDATE `quest_template` SET `OfferRewardText`='$B$BA fitting end for the ''good'' doctor, wouldn''t you say?' WHERE `Id`=13152; -- A Visit to the Doctor +UPDATE `quest_template` SET `OfferRewardText`='You have proven yourself worthy of the title of champion, $N. You will compete at the tournament''s highest level on behalf of Stormwind, riding in the grand melee with your weapon at the ready and our mighty pennant at your back.' WHERE `Id`=13699; -- The Valiant's Challenge +UPDATE `quest_template` SET `OfferRewardText`='I welcome you as a champion of the tournament, $N. As a champion, you will be able to compete for the grand championship of the tournament. You may also choose to become a valiant with another Alliance city''s delegation and in time, a champion for that city as well.$B$BAll champions must have the assistance of a squire, $N, and you are no exception. Allow me to appoint one of ours to accompany you in battle. He will proudly carry the banner of any city that has named you a champion.' WHERE `Id`=13702; -- A Champion Rises +UPDATE `quest_template` SET `OfferRewardText`='Ah yes, these manes will work great! You show a lot of grit, $C - I wager we''ll see great things from you.' WHERE `Id`=313; -- The Grizzled Den +UPDATE `quest_template` SET `OfferRewardText`='By Magni''s beard, you sure did a lot of hunting!! Thank you, $N.' WHERE `Id`=317; -- Stocking Jetsteam +UPDATE `quest_template` SET `OfferRewardText`='Bellowfiz needs some of my Evershine? Hm...all right.' WHERE `Id`=318; -- Evershine +UPDATE `quest_template` SET `OfferRewardText`='Thank you, $N. It''ll be nice to work our crafts without hearing so many growls and snorts outside the village.' WHERE `Id`=319; -- A Favor for Evershine +UPDATE `quest_template` SET `OfferRewardText`='For me? You''re a true hero, $N!' WHERE `Id`=308; -- Distracting Jarven +UPDATE `quest_template` SET `OfferRewardText`='Yes, this will do just fine. I think I''ll open a bottle right now and have a taste...' WHERE `Id`=320; -- Return to Bellowfiz +UPDATE `quest_template` SET `OfferRewardText`='Not bad, $N! Did you have a hard time getting past their guard?$B$BNo matter - many thanks, and if you''re ever in need of stout with a kick, don''t forget the Barleybrews!' WHERE `Id`=311; -- Return to Marleth +UPDATE `quest_template` SET `OfferRewardText`='Great! I can''t wait to use these in some of my recipes. There''s one in particular I think it''ll work great in...' WHERE `Id`=315; -- The Perfect Stout +UPDATE `quest_template` SET `OfferRewardText`='These Gyromechanic Gears and Restabilization Cogs are in perfect accordance with Ozzie''s schematics for the Recombobulation Device. Once I add some hydrolubricant to the inner combustion pistons, adjust the crank-o-ratchet and increase of the viscosity of the electrogum gel, the gnomish race will be as good as new.' WHERE `Id`=412; -- Operation Recombobulation +UPDATE `quest_template` SET `OfferRewardText`='$B$BOh. Whoa! This stuff really puts a shine in your eyes. I feel like I can see in the dark!' WHERE `Id`=413; -- Shimmer Stout +UPDATE `quest_template` SET `OfferRewardText`='The horns of war will soon echo across this land, waking the dead and calling forth the Scourge war machine. Woe unto those that would stand in our way!$B$BYou and your brethren will lead the charge, $N. When next I look upon the Scarlet lands, my sight will be obscured by the legions of Acherus. The march upon New Avalon begins now.' WHERE `Id`=12657; -- The Might Of The Scourge +UPDATE `quest_template` SET `OfferRewardText`='The war has begun, death knight! I shall place you upon my finest gryphon and deliver you to Death''s Breach. Chaos, death, destruction! You will herald in all of this and more! +' WHERE `Id`=12850; -- Report To Scourge Commander Thalanor +UPDATE `quest_template` SET `OfferRewardText`='Do you smell it?$B$B$B$BFresh meat... The scent of Scarlet Crusader wafts through the air.$B$B$B$BApologies, death knight, I''m sure you''re not interested in my choice of fine cuisine. You are here to work! To lead the charge! Yes... I know. The Lich King has told me all that I need to know about you, $N.$B$BThe time for bloodshed is now. +' WHERE `Id`=12670; -- The Scarlet Harvest +UPDATE `quest_template` SET `OfferRewardText`='Do you feel it, $N? That sensation is raw power coursing through your body. Such a thing cannot exist for mortals.$B$BThe front lines are now dismantled. The geist will finish the job and prepare the grounds for Razuvious. We turn our attention now to more tactical targets. +' WHERE `Id`=12678; -- If Chaos Drives, Let Suffering Hold The Reins +UPDATE `quest_template` SET `OfferRewardText`='To the victor goes the glory, death knight! Well done! The Lich King looks favorably upon you on this day. +' WHERE `Id`=12733; -- Death's Challenge +UPDATE `quest_template` SET `OfferRewardText`='Glad to see the Reclaimers aren''t in short supply of work, or adventurers willing to help out.$B$BI''m Kreldig, $N. You''ve made a smart move helpin'' out the Reclaimers. Everyone needs something these days: they''ve lost a family heirloom, a magic item, a loved one. You never can tell. But with the Reclaimers around, there''s no reason, for the right price, everyone can''t find what they''ve lost. ' WHERE `Id`=1453; -- Reclaimers' Business in Desolace +UPDATE `quest_template` SET `OfferRewardText`='I have entered your name in the rolls, $N. As an aspirant you will train with others who wish to compete in the tournament and hone your mounted combat skills. Once you have proven yourself, you will be allowed to enter the lowest rank of competition on behalf of your capital city.' WHERE `Id`=13667; -- The Argent Tournament +UPDATE `quest_template` SET `OfferRewardText`='Commit Valis''s lesson to memory, $N. It will mean the difference between winning and losing your mounted combat matches.' WHERE `Id`=13835; -- Mastery Of The Shield-Breaker +UPDATE `quest_template` SET `OfferRewardText`='So you''re saying this knight''s story is a sham? Most suspicious. Dishonorable at the least, and murderous at the worst. Still, we can''t confront him until we know for certain whether he was involved in these murders.$B$BDo nothing to arouse his suspicions, $N. Discretion will serve us well as we continue to investigate.' WHERE `Id`=13633; -- The Black Knight of Westfall? +UPDATE `quest_template` SET `OfferRewardText`='So there is some truth to those old tales? It seems they did not lie about the quality of the blade. Well done, $N. The champion who wields it will be a lucky man, indeed.' WHERE `Id`=13666; -- A Blade Fit For A Champion +UPDATE `quest_template` SET `OfferRewardText`='So you say Lorien Sunblaze was done in by poison and Sir Wendell was burnt alive? Dreadful ways to die, both of them. Only Conall was killed by cold steel, and from your description, it was a coward''s strike, not honorable combat that laid him in his grave.$B$BAll three sparred with and were scheduled to fight the Black Knight. This cannot be a coincidence. Now, we must find a way to prove it was the Black Knight''s work.' WHERE `Id`=13643; -- The Stories Dead Men Tell +UPDATE `quest_template` SET `OfferRewardText`='$B$BIt''s all here, $N: the poison that killed Lorien, a collection of knives, torches, and oil. No man has cause to possess these things here and no squire would do so without orders from his knightly master. We''ve found our murderer, $N, but who is he working for?' WHERE `Id`=13654; -- There's Something About the Squire +UPDATE `quest_template` SET `OfferRewardText`='$B$BThis can only mean one thing, $N. The Black Knight is a member of the Cult of the Damned and has been sent by Arthas to disrupt the tournament!$B$BThe Black Knight has proven himself a fearsome combatant, and you will need to be every bit as good if you wish to face him. When you are a champion, return to me and we''ll find a way to ensure his defeat.' WHERE `Id`=13663; -- The Black Knight's Orders +UPDATE `quest_template` SET `OfferRewardText`='Grrr. I knew it! He''s sooooo over-protective! This is just embarassing.$B$BNot that I''m not happy to see you... I am! We all are. We can use your help!' WHERE `Id`=11175; -- My Daughter +UPDATE `quest_template` SET `OfferRewardText`='Good job, though I think ye might be wanting a refresher course in basic piloting.$B$BWell, no matter, one warm body''s as good as another. Here''s yer haul for the day. ' WHERE `Id`=11390; -- I've Got a Flying Machine! +UPDATE `quest_template` SET `OfferRewardText`='$B$BIrena was concerned about me? She gets that from her father you know.' WHERE `Id`=11393; -- Where is Explorer Jaren? +UPDATE `quest_template` SET `OfferRewardText`='Without Thredd to lead them, hopefully the riots will be more controllable. We shall see.$B$BI must say, after a half hour, I hardly expected you to come out, but it seems I misjudged you.$B$BI''d guess, then, that you didn''t get much useful information out of him? But I know a thing or two that might be of interest to you about Thredd''s activities.' WHERE `Id`=391; -- The Stockade Riots +UPDATE `quest_template` SET `OfferRewardText`='So these bandanas -- filthy tokens of corruption -- are what my Mac had to die for? Such a waste. Such a tragic sacrifice. $b$bBut alas, I cannot return to the past. Just know, $N, that you have brought my family justice through your deeds.' WHERE `Id`=388; -- The Color of Blood +UPDATE `quest_template` SET `OfferRewardText`='That''s right. I have a task that I can''t do while I''m guarding. In fact, it''ll take you far from Loch Modan.$B$BYour perfect chance for adventure!' WHERE `Id`=1339; -- Mountaineer Stormpike's Task +UPDATE `quest_template` SET `OfferRewardText`='You accomplished your mission well, $r. The King himself would be proud.$b$bThe reinforcements promised to us never showed, however. Apparently the Alliance front is a sea of crimson from the blood of our fallen brethren. The news of the losses leaves a bitter taste in one''s mouth. But we must not let their deaths go for naught. We must rally in these grim times and bring glory back to the Alliance.$b$bSpeak with Mountaineer Wallbang for reassignment. You''re needed now more than ever.' WHERE `Id`=237; -- In Defense of the King's Lands +UPDATE `quest_template` SET `OfferRewardText`='Congratulations are in order, $N. You have bested your challenger and earned the right to advance to the rank of valiant.' WHERE `Id`=13679; -- The Aspirant's Challenge +UPDATE `quest_template` SET `OfferRewardText`='Welcome aboard then, Valiant $N. The Stormwind delegation is proud to count you among its members.' WHERE `Id`=13684; -- A Valiant Of Stormwind +UPDATE `quest_template` SET `OfferRewardText`='My nephew said you aided him with his research in Dustwallow, and that you helped his associate out of a tight spot. Well, we Sterns stick together and we don''t ignore our friends!$B$BSo wash your hands, $N, because we''re about to throw a party in your honor!' WHERE `Id`=1271; -- Feast at the Blue Recluse +UPDATE `quest_template` SET `OfferRewardText`='Thanks for helping out our miner back there, $n! I should be able to put together an antidote no problem.$B$BIf you stumble into Tore again, tell her that she''s a jerk for me, will ya?' WHERE `Id`=12832; -- Bitter Departure +UPDATE `quest_template` SET `OfferRewardText`='And it''s already well-done! I outdo myself sometimes.$B$BThanks much, friend!' WHERE `Id`=12828; -- Ample Inspiration +UPDATE `quest_template` SET `OfferRewardText`='Ha ha! Good to see you''re up for some dirty work.$B$BMuch appreciated there, pal!' WHERE `Id`=12829; -- Moving In +UPDATE `quest_template` SET `OfferRewardText`='Woo! That''s a ripe stench right there! You had to get hands-on with some of those snobolds, didn''t ya?$B$BI do appreciate it though!' WHERE `Id`=12830; -- Ore Repossession +UPDATE `quest_template` SET `OfferRewardText`='With the death of the Black Knight, the tournament may once again serve its purpose. The champions of the Horde and Alliance may demonstrate their skill at arms and train for the day when Arthas and his minions will no longer threaten us.$B$BYou have the thanks of the Argent Crusade, $N, and that of all who have answered our call.' WHERE `Id`=13664; -- The Black Knight's Fall +UPDATE `quest_template` SET `OfferRewardText`='$B$BDo you think they''ve been planning this? I suppose it doesn''t matter, but I don''t like the implication that we''ve been playing into their hands. Whatever is going on, we have to stop it.' WHERE `Id`=14016; -- The Black Knight's Curse +UPDATE `quest_template` SET `OfferRewardText`='The doctor will not have time to complete his work, but his plan is already in motion. From what you''ve reported, the Lich King''s servants have reanimated and empowered the Black Knight and there''s no telling what the knight''s master has in mind. You have done well in uncovering this plot. I will tell High Crusader Adelard of your findings and together, we will alert the tournament''s participants.' WHERE `Id`=14017; -- The Black Knight's Fate +UPDATE `quest_template` SET `OfferRewardText`='You are a true champion, $N, both inside the ring and on the field. We must all be vigilant against the Scourge and you are a great example to our brethren and your own people.' WHERE `Id`=13789; -- Taking Battle To The Enemy +UPDATE `quest_template` SET `OfferRewardText`='Well done. Training against the other champions is one of the best ways to prepare yourself for tournament competition. I know you''ll make the Alliance proud, $N.' WHERE `Id`=13790; -- Among the Champions +UPDATE `quest_template` SET `OfferRewardText`='It seems things are worse than we initially thought. You still made a valiant effort and saved many of The Wavecrest''s crew''s lives.' WHERE `Id`=14152; -- Rescue at Sea +UPDATE `quest_template` SET `OfferRewardText`='Oh, hello there $N. Marcia said you''d be coming by with that poor man''s missing arm.$b$bShe also gave me this bag to give you as a reward. It smells horrible, and I''m anxious to make the trade if you don''t mind.' WHERE `Id`=13836; -- Disarmed! +UPDATE `quest_template` SET `OfferRewardText`='Just what I wanted to hear! A victory in Lake Wintergrasp - even a temporary one - is crucial to our overall strategy against the Horde.' WHERE `Id`=13181; -- Victory in Wintergrasp +UPDATE `quest_template` SET `OfferRewardText`='How many of them could there possibly be? We''ve killed enough to fill ten graveyards and still they come. The situation looks grim, friend.' WHERE `Id`=13039; -- Defending The Vanguard +UPDATE `quest_template` SET `OfferRewardText`='Thank you, $N. I will begin the tests on these samples immediately. It is my hope that a cure will be found soon.' WHERE `Id`=13040; -- Curing The Incurable +UPDATE `quest_template` SET `OfferRewardText`='There are still many Argent Crusade soldiers out on that field and in Scourgeholme, $N. While your help is appreciated, there is still much left to be done.' WHERE `Id`=13008; -- Scourge Tactics +UPDATE `quest_template` SET `OfferRewardText`='$B$BMy kin will help. Together we will battle the Lich King and his undead legions. +' WHERE `Id`=13044; -- If There Are Survivors... +UPDATE `quest_template` SET `OfferRewardText`='Arthas... He strikes recklessly - without care or caution. We have caught him off guard.$B$B$B$BWe will bolster our defenses and weather the storm.$B$BHow good are you with a cannon, $N?' WHERE `Id`=13045; -- Into The Wild Green Yonder +UPDATE `quest_template` SET `OfferRewardText`='My knowledge of Scourge tactics is without equal.$B$B$B$BBefore the battle for Light''s Hope Chapel, my knights and I served under the Lich King - his icy grasp controlling our every action. The light of dawn changed everything...' WHERE `Id`=13104; -- Once More Unto The Breach, Hero +UPDATE `quest_template` SET `OfferRewardText`='You have done well, $N. Keeping their numbers down will give the Argent Crusade the time that they need to set a foundation.' WHERE `Id`=13118; -- The Purging Of Scourgeholme +UPDATE `quest_template` SET `OfferRewardText`='A hard fought victory, $N! The lieutenants will be replaced, but at least for today the air about Scourgeholme stands still.' WHERE `Id`=13125; -- The Air Stands Still +UPDATE `quest_template` SET `OfferRewardText`='Heartwood by nature is resistant to disease, rot and plague. This heartwood, however, goes so far as to repel such things! The masonry, affected by the fallout of the Unbound Thicket, will work in much the same way.$B$BSoon we will break ground. ' WHERE `Id`=13130; -- The Stone That Started A Revolution +UPDATE `quest_template` SET `OfferRewardText`='Your assistance has been integral in securing the front. The first true victory of this war is close at hand - which is why our next step is the most crucial.$B$BRest assured, $N, the Scourge will not give up without a fight. Your most difficult challenge awaits.' WHERE `Id`=13139; -- Into The Frozen Heart Of Northrend +UPDATE `quest_template` SET `OfferRewardText`='Blessed Light! We have taken the pinnacle! Finally, construction of Justice Keep can begin. Highlord Fordring and the knights are already en route to our new base. You must meet them there, $N!' WHERE `Id`=13141; -- The Battle For Crusaders' Pinnacle +UPDATE `quest_template` SET `OfferRewardText`='A long and arduous journey awaits us as we make our way to the gates of Icecrown Citadel. I, and the soldiers of the Argent Crusade, wish to thank you for all that you have done. We rest easier knowing that you will fight alongside us in this cursed place.$B$B +' WHERE `Id`=13157; -- The Crusaders' Pinnacle +UPDATE `quest_template` SET `OfferRewardText`='Bridenbrad has contracted the plague? I cannot imagine a worse fate for one who has devoted his life to the ways of light, nor can I fathom leaving him to die without lifting a finger to help.$B$BNo, undeath shall not be his fate. We shall find a way to aid this hero.' WHERE `Id`=13072; -- A Hero Remains +UPDATE `quest_template` SET `OfferRewardText`='Hello child.$B$BI understand Tirion''s request and trust in his judgment, we will see what we can do for this Crusader Bridenbrad. What you ask is no simple task - the Scourge are not of this world, and many have failed in attempting to strip their corruption over the years.$B$BIn a being of nobility and light, all is not without hope.' WHERE `Id`=13073; -- The Keeper's Favor +UPDATE `quest_template` SET `OfferRewardText`='Tirion sent you to Remulos? I''m... I''m flattered. One does not call favors in with beings of such power idly, no matter how noble or altruistic they might be. You too are kind to have gone to such lengths on my behalf. You have my thanks.$B$BPlant the seed - I am ready.' WHERE `Id`=13075; -- The Boon of Remulos +UPDATE `quest_template` SET `OfferRewardText`='Greetings to you, $r.$B$BThe concern is clear on your face. Please tell me what troubles you.' WHERE `Id`=13077; -- The Touch of an Aspect +UPDATE `quest_template` SET `OfferRewardText`='The breath of Alexstrasza... you have gone to the dragon-queen herself? I''m extremely grateful.$B$BI understand the risks of such cleansing and I am prepared. Proceed, $c.' WHERE `Id`=13079; -- The Boon of Alexstrasza +UPDATE `quest_template` SET `OfferRewardText`='The Scourge plague is no simple foe to defeat. Alexstrasza''s words suggest that perhaps we can yet save our Bridenbrad from the unimaginable fate of the unliving should he fall, but I will not give him up so easily.$B$BThere is yet one more path of light I would like to pursue. One more being who might avert this horrible fate.' WHERE `Id`=13080; -- Hope Yet Remains +UPDATE `quest_template` SET `OfferRewardText`='$B$BSo the acid worked? Good. We''ll need it when the army goes up against the reavers in force.' WHERE `Id`=13335; -- Before the Gate of Horror +UPDATE `quest_template` SET `OfferRewardText`='I was worried for a while there, $N. When he busted out the seals and penguins... Well, I didn''t know what to think to be honest. It looked pretty damn ridiculous.' WHERE `Id`=12935; -- The Amphitheater of Anguish: Tuskarrmageddon! +UPDATE `quest_template` SET `OfferRewardText`='Damn, I remember Korrak from way back in my younger days when I used to work for the Frostwolf Clan. He would never shut up! I think you just did the world a great service, $N.' WHERE `Id`=12936; -- The Amphitheater of Anguish: Korrak the Bloodrager! +UPDATE `quest_template` SET `OfferRewardText`='You did it, $N! That was the most exciting fight yet! What are you going to do with your winnings? Me? I''m going to Dalaran and blowing it all in the Underbelly. Lot of hot action going on down there!' WHERE `Id`=12948; -- The Champion of Anguish +UPDATE `quest_template` SET `OfferRewardText`='I hope they weren''t too hesitant to share the wealth. We''ve been pretty forgiving with them picking through our leftovers thus far.' WHERE `Id`=12827; -- Reclaimed Rations +UPDATE `quest_template` SET `OfferRewardText`='These will do nicely, thanks!$B$BDid you happen to see Dim out there? I sent him out a long while back and he never came back. I hope he''s alright.$B$BSpeaking of which... I wonder where Janks is...' WHERE `Id`=12818; -- Clean Up +UPDATE `quest_template` SET `OfferRewardText`='Thanks, $N! We''ll see what we can do to salvage these parts!' WHERE `Id`=12844; -- Equipment Recovery +UPDATE `quest_template` SET `OfferRewardText`='I see that Skyhopper finally got around to sending help. And none too soon I might add!$B$BWelcome, $g brother : sister;, we need your help badly!' WHERE `Id`=11707; -- Distress Call +UPDATE `quest_template` SET `OfferRewardText`='Have you heard enough? Are you prepared to act? +' WHERE `Id`=3441; -- Divine Retribution +UPDATE `quest_template` SET `OfferRewardText`='$N, by my eternal soul, it is good to see you! I don''t know why the Exodar crashed. Only those of us that were in this part of the ship remain.$B$BThere''s not much time if we''re to save everyone that we can!' WHERE `Id`=9279; -- You Survived! +UPDATE `quest_template` SET `OfferRewardText`='Regrettable that those creatures had to die so that we might live - indiscriminate killing is not the draenei way. However, the blood you gathered will replenish our healing crystals, so their deaths will not be in vain.' WHERE `Id`=9280; -- Replenishing the Healing Crystals +UPDATE `quest_template` SET `OfferRewardText`='I am Firmanvaar and you are wise to seek me out. It is my calling to provide instruction to shaman, especially those who are just beginning to learn.$B$BShamanism is only now being relearned amongst the draenei, $N. You are brave to follow its path as it is not popular amongst your kind.$B$BI will be here when you feel you are ready for further training.' WHERE `Id`=9421; -- Shaman Training +UPDATE `quest_template` SET `OfferRewardText`='Oh, thank goodness you''ve come. We have much to do.' WHERE `Id`=9371; -- Botanist Taerix +UPDATE `quest_template` SET `OfferRewardText`='You''re finished? That''s good news. Hopefully, we can find a way to avoid the killing of these mutated beasts in the future.$b$bI believe I have formed a plan that might give us an alternative solution to this problem, but I will need your help.' WHERE `Id`=10302; -- Volatile Mutations +UPDATE `quest_template` SET `OfferRewardText`='These look like fine specimens. Thank you for performing the field work. Once I can find the time to analyze these, I should be able to tell what it will take to restore the fields.' WHERE `Id`=9799; -- Botanical Legwork +UPDATE `quest_template` SET `OfferRewardText`='These will do. Thank you, $c!$B$BWhile you were out, I managed to gather some equipment together to make an analysis of the samples. This should only take a moment.' WHERE `Id`=9293; -- What Must Be Done... +UPDATE `quest_template` SET `OfferRewardText`='The Light be praised! You''ve done what only a true $g hero : heroine; could have done, $N! The draenei you saved owes their continued life to your selflessness!$B$BPlease, take this supply pouch. You look like you can use it more than I.' WHERE `Id`=9283; -- Rescue the Survivors! +UPDATE `quest_template` SET `OfferRewardText`='With many of the owlkin now inoculated, we can focus on getting out of here and not have to worry about wiping out the owlkin population in the area.$B$BHere, choose from these. You''ve done good work, and you deserve to be rewarded!' WHERE `Id`=9303; -- Inoculation +UPDATE `quest_template` SET `OfferRewardText`='Let me take a look at those.$B$BYes, I think that these will do nicely; good job, $N. The emitter is rather complex so it may take some time to finish the repairs. I''ll let you know when it''s ready.$b$bIn the meantime, you might see if Vindicator Aldar has anything he could use you for.' WHERE `Id`=9305; -- Spare Parts +UPDATE `quest_template` SET `OfferRewardText`='You are bold to seek my wisdom after what your people have done to these islands, stranger! Still, there is much to be said for your bravery, so I will impart to you some knowledge.$B$BThe earth beneath your feet forms the foundation for all things. The sky, the waters, even great fire - all rest upon its shoulders. While those others often form chaotic tempests, the earth abides. It grants strength and fortitude to the core of your being.$B$BNow you will prove yourself, shaman.' WHERE `Id`=9449; -- Call of Earth +UPDATE `quest_template` SET `OfferRewardText`='You have done well. By thinning out the restless spirits you have helped to heal the imbalance between the elements, which your people inadvertently caused.$B$BThroughout your journey as a shaman you must keep this in mind when calling upon our power. The balance must be preserved.' WHERE `Id`=9450; -- Call of Earth +UPDATE `quest_template` SET `OfferRewardText`='You have done well, $N. In helping to restore the balance of the elements at the grove, you have also created a balance between the earth element of this world and the draenei. Perhaps this will help to bring understanding to those amongst us who do not approve of our ways?$B$BI will create for you a totem through which you will be able to call on the power of earth to do your bidding. And with time, more of the mysteries of earth will be revealed to you.$B$BNow, take your totem, shaman.' WHERE `Id`=9451; -- Call of Earth +UPDATE `quest_template` SET `OfferRewardText`='Help... blood elves! They... ambushed... me. Don''t have... long.' WHERE `Id`=9309; -- The Missing Scout +UPDATE `quest_template` SET `OfferRewardText`='I thank you for dealing with the blood elf surveyor. Surely she was their leader. Rest assured, we will deal with whatever remnant of them is still nearby.$B$BPlease, take one of these weapons as a sign of my gratitude.' WHERE `Id`=9311; -- Blood Elf Spy +UPDATE `quest_template` SET `OfferRewardText`='I got it, I got it! I think I managed to fix the emitter! Here, I''ll just activate this last crystal and that should do it.$B$BTake a look at the emitter, $N. It looks like it''s beginning to work... someone is appearing!' WHERE `Id`=9312; -- The Emitter +UPDATE `quest_template` SET `OfferRewardText`='Ah, good to see you again! I''m glad that we were both able to get our emitters fixed or we might never have found one another. And don''t worry, we''ll see to it that Ammen Vale gets help and supplies.$B$BSpeaking of assistance, now that you''re here, go around and introduce yourself to the others. I know that there''s plenty to do.' WHERE `Id`=9313; -- Travel to Azure Watch +UPDATE `quest_template` SET `OfferRewardText`='Oh, you must be one of the survivors we''ve been hearing about!$b$bI''m glad that you came. Don''t worry, we will send someone to see to Aeun''s injured leg.$B$BI''m most interested in hearing all about your harrowing story of survival. You''re a brave one to have made it all the way here.' WHERE `Id`=9314; -- Word from Azure Watch +UPDATE `quest_template` SET `OfferRewardText`='Well done, $n, well done!$b$bHere, I cooked up some tenderloins while you were gone. Maybe you''d like the recipe, too?' WHERE `Id`=9454; -- The Great Moongraze Hunt +UPDATE `quest_template` SET `OfferRewardText`='Wonderful! You''re turning into quite the hunter, $n.$b$bHow would you like to look more like me? Well here is your chance! While you were out hunting, I fashioned these items out of some buck hides I had laying around. Take your pick!' WHERE `Id`=10324; -- The Great Moongraze Hunt +UPDATE `quest_template` SET `OfferRewardText`='Very good. Your efforts do much to keep the Scourge at bay. A commendation will be sent to my superior, Executor Zygand.' WHERE `Id`=356; -- Rear Guard Patrol +UPDATE `quest_template` SET `OfferRewardText`='Good, I see Ageron managed to find you, $n. Let us waste little time with small talk and pleasantries and focus on your training. There is still much you have to learn.' WHERE `Id`=1478; -- Halgar's Summons +UPDATE `quest_template` SET `OfferRewardText`='Very good, $N. I will study this book and determine the identity of that lich. You have served your Queen well.$B$B$B$BAstonishing! The book you retrieved belongs to no one other than Gunther Arcanus!$B$BGunther was a skilled Necromancer in life; he and I were friends and comrades-in-arms, before the Plague. And judging from his book he has grown even more powerful in death.$B$BHis skills would be a great boon to us.' WHERE `Id`=357; -- The Lich's Identity +UPDATE `quest_template` SET `OfferRewardText`='Well done. Training against the other valiants is one of the best ways to prepare yourself for tournament competition. I know you''ll make us proud, $N.' WHERE `Id`=13750; -- The Grand Melee +UPDATE `quest_template` SET `OfferRewardText`='All of Azeroth is fortunate that Timear foresaw the Eredar lord''s arrival and that you were there in time to slay him.' WHERE `Id`=24589; -- Lord Jaraxxus Must Die! +UPDATE `quest_template` SET `OfferRewardText`='This is in better condition than I thought it''d be. Sure, it''s going to take some time to work off all the rust, the char, and the like, but I''ll not complain.' WHERE `Id`=10055; -- Waste Not, Want Not +UPDATE `quest_template` SET `OfferRewardText`='Very good. I''m sure their loss will be felt in Hellfire Citadel. Although that dark bastion looms over us and seems nigh insurmountable, it is only with bold moves like you have made that we will find victory over the fel orcs!' WHERE `Id`=10482; -- Fel Orc Scavengers +UPDATE `quest_template` SET `OfferRewardText`='You''ve come to help my tribe, $r? How unusual. There aren''t many that care about the fate of the Broken in this land. ' WHERE `Id`=10403; -- Naladu +UPDATE `quest_template` SET `OfferRewardText`='Ah, this is very nice temper indeed! And so much of it! I''ll be at work for days before I use it all!$B$BThank you, $N. Please, take this as payment.' WHERE `Id`=3042; -- Troll Temper +UPDATE `quest_template` SET `OfferRewardText`='You found it! Well done, $N! Did you have to fight Bly for it? I hope you knocked him and his band down good and hard!' WHERE `Id`=2768; -- Divino-matic Rod +UPDATE `quest_template` SET `OfferRewardText`='What the vrykul did to our scouts was a gruesome display of savagery. It was a scare tactic, meant to weaken our resolve... to send us running in fear for our lives.$B$BIt failed.$B$BWe are going to show those monsters what it means to wage war against the Alliance!' WHERE `Id`=11244; -- Rescuing the Rescuers +UPDATE `quest_template` SET `OfferRewardText`='A bit worse for the wear but still functional.$B$B$B$BNow to place them in the fire and inhale!$B$B$B$B$B$BWha... What... It cannot be... I cannot...' WHERE `Id`=11333; -- Into the World of Spirits +UPDATE `quest_template` SET `OfferRewardText`='You''ve found Pulroy. A bit too late it seems.$B$BWhile looking over the corpse you see a journal clenched tightly in Pulroy''s death grip. Upon examining the journal you read what appears to be the scribbling of a dying dwarf.' WHERE `Id`=11273; -- The Human League +UPDATE `quest_template` SET `OfferRewardText`='You''ve found Zedd. You''re no doctor but the prognosis for Zedd is most assuredly negative.$B$BIt looks as if they were preparing to feed him to the worgs. Gruesome...' WHERE `Id`=11274; -- Zedd's Probably Dead +UPDATE `quest_template` SET `OfferRewardText`='About bloody time! Pulroy and Zedd are dead.$B$BAnd Daegarn...$B$B$B$BTaken by the Dragonflayer chieftain into the depths of these catacombs. I overheard that oversized mongrel mention something ''bout a sacrifice to the \"Dread King.\"$B$BThe cipher is hidden away in Daegarn''s grimy beard.$B$BWhat? Dwarves hide things in their beards all the time!' WHERE `Id`=11276; -- And Then There Were Two... +UPDATE `quest_template` SET `OfferRewardText`='You feel compelled to place the sacred blade next to the body of Ares.$B$BUpon doing this you are once again blinded by light.' WHERE `Id`=11288; -- The Shining Light +UPDATE `quest_template` SET `OfferRewardText`='You''ve done well, mate. Now that we''ve secured the tablets we can try and save Daegarn''s life and recover the cipher that will help us decode the meaning behind these ancient relics!$B$BI''ll hold on to these tablets, you rescue Daegarn. + +' WHERE `Id`=11277; -- The Depths of Depravity +UPDATE `quest_template` SET `OfferRewardText`='$B$BOutstanding! By the looks of things, there are many more vrykul villages in the fjord. A different tribe of vrykul is preparing an assault on Westguard Keep. Hell, for all I know it may already be too late. We haven''t heard from Westguard in days. Either way, we must alert Westguard!' WHERE `Id`=11290; -- Dragonflayer Battle Plans +UPDATE `quest_template` SET `OfferRewardText`='$B$BHrm, interesting...$B$BAccording to the manual, the vrykul have a special tool that allows them to control the harpoon guns with deadly accuracy. It looks a bit like the wheel of one of our ships. Furthermore, it''s portable and seems to plug into the harpoon guns like a key. We need to get our hands on one of those!' WHERE `Id`=11420; -- The Path to Payback +UPDATE `quest_template` SET `OfferRewardText`='Many men and women died to recover this blade. Alas, I fear valiant Ares will not be the last.$B$BBut you do the Light''s work, hero. This sacred blade will be wielded by Lord Tirion Fordring himself. Even now the Argent Crusade works toward Icecrown. Lord Fordring has vowed that he will tear down the walls of the cursed place himself! And with the blade, he just might stand a chance against the Lich King.$B$BLord Fordring remains our greatest hope.' WHERE `Id`=11289; -- Guided by Honor +UPDATE `quest_template` SET `OfferRewardText`='Nicely done, $g old chap : m''lady;!' WHERE `Id`=194; -- Raptor Mastery +UPDATE `quest_template` SET `OfferRewardText`='Thank you, $c... thank you!$B$BYou''ve given me the satisfaction of knowing that the coward who made me into this will rot for all eternity as surely as I will.$B$BNow leave before I lose control of myself and cut you down.' WHERE `Id`=13059; -- Revenge for the Vargul +UPDATE `quest_template` SET `OfferRewardText`='You discovered and put an end to the doctor''s machinations.$B$B$B$BThat''s a fine poke in the eye for the Lich King, but I think we can do better.' WHERE `Id`=13043; -- The Sum is Greater than the Parts +UPDATE `quest_template` SET `OfferRewardText`='$N is my bestest little $r!' WHERE `Id`=12992; -- Crush Dem Vrykuls! +UPDATE `quest_template` SET `OfferRewardText`='$B$BYou''re inflicting horrible mental trauma on the Jotunheim vrykul. This is where they were first reawakened. It is a place of significant importance to them, second only to Ymirheim.$B$BYou must keep up the pressure there while I hold the vault from the assault of the Lich King.' WHERE `Id`=13084; -- Vandalizing Jotunheim +UPDATE `quest_template` SET `OfferRewardText`='You got both our foodstuff AND our research equipment back! You''ve not only saved the expedition, you''ve also saved our lives. I and the rest of my team can''t thank you enough; we just might make it here for a while now thanks to you.$B$BWhile we don''t have much, I''m certainly not going to leave you high and dry for the invaluable help you''ve given us. Thank you, $N - you''ve got a friend in Marshal Expeditions! +' WHERE `Id`=3881; -- Expedition Salvation +UPDATE `quest_template` SET `OfferRewardText`='Yes, this will do nicely. You''ve been a great help... I wish I could give you more than this, but being virtually stranded in the middle of a savage land does limit what I can and cannot give. Rest assured though - the research done here would not have been possible without your assistance!' WHERE `Id`=3883; -- Alien Ecology +UPDATE `quest_template` SET `OfferRewardText`='This will do nicely, $N. It seems Lar''korwi eats well these days. Although, I wonder where he found a threshadon in this area. Odd.$B$BRegardless, I will hold onto this until you are ready for your confrontation with the beast. Do not worry for my safety--I am sure you''ve angered Lar''korwi enough that he will not kill me until after he''s tasted your flesh.' WHERE `Id`=4290; -- The Fare of Lar'korwi +UPDATE `quest_template` SET `OfferRewardText`='You did it! You actually found it!$B$BI don''t know... I don''t know how to thank you!' WHERE `Id`=12624; -- It Could Be Anywhere! +UPDATE `quest_template` SET `OfferRewardText`='What a relief to hear that the Venture Company will trouble us no more. You have my thanks, and that of Hemet for dealing with this problem. A game hunter cannot, in good conscience, lift her weapon against another person.' WHERE `Id`=12525; -- Wipe That Grin Off His Face +UPDATE `quest_template` SET `OfferRewardText`='The professor sent you my way? All right.' WHERE `Id`=12696; -- Aerial Surveillance +UPDATE `quest_template` SET `OfferRewardText`='Excellent! ' WHERE `Id`=12699; -- An Embarassing Incident +UPDATE `quest_template` SET `OfferRewardText`='Thank you, this will go far to treat our soldiers'' wounds.' WHERE `Id`=13201; -- Healing with Roses +UPDATE `quest_template` SET `OfferRewardText`='You are a brave one, $N. I hope you didn''t lose any extremities making your fishing spot. If you''ve still got the fishing bug, come back tomorrow and we''ll talk some more.' WHERE `Id`=13833; -- Blood Is Thicker +UPDATE `quest_template` SET `OfferRewardText`='$B$BGood work, $N, and quick thinking. I''m sure the theft of this trinket won''t slow them down for long, but I think you''ve bought us time to warn the leaders of the Horde and Alliance about the impending attacks.' WHERE `Id`=24442; -- Battle Plans Of The Kvaldir +UPDATE `quest_template` SET `OfferRewardText`='Your spirit burns with life, young $c. I accept the homage you pay, and offer in return this token...' WHERE `Id`=8676; -- Wildmane the Elder +UPDATE `quest_template` SET `OfferRewardText`='Wonderful! You found it! And what''s just as important--Velratha no longer has it! Thank you, $N. I am forever in your debt!$B$BAnd if I sounded a little... mean before, pay it no mind. You''ll find me a much nicer person to those who haven''t stolen from me.' WHERE `Id`=2846; -- Tiara of the Deep +UPDATE `quest_template` SET `OfferRewardText`='Ah! Longbeard sent you with a load of helmets! Hooray!$B$BNow maybe we can talk a pilot into driving our car...' WHERE `Id`=1179; -- The Brassbolts Brothers +UPDATE `quest_template` SET `OfferRewardText`='$b$bIt is DONE!$b$b$R! Your name shall be recorded in the history of our people.$b$bI am in your debt....' WHERE `Id`=13167; -- Death to the Traitor King +UPDATE `quest_template` SET `OfferRewardText`='$B$BI know why you have come.' WHERE `Id`=13081; -- The Will of the Naaru +UPDATE `quest_template` SET `OfferRewardText`='$B$BYou have returned to me, $c. I must admit... it is good to see you again... your face renews my hope that this land will be free of Arthas''s grasp one day soon. I''m proud to have met you...$B$B' WHERE `Id`=13082; -- The Boon of A'dal +UPDATE `quest_template` SET `OfferRewardText`='$B$BHe was a damn fine soldier. Damn the Horde and damn the Scourge!' WHERE `Id`=13225; -- The Skybreaker +UPDATE `quest_template` SET `OfferRewardText`='Really, $c?$b$bNothing notable to report?$b$b$b$bI beg to differ...' WHERE `Id`=13287; -- Poke and Prod +UPDATE `quest_template` SET `OfferRewardText`='Yes, yes, yes! A thousand times, hello!' WHERE `Id`=13383; -- Killohertz +UPDATE `quest_template` SET `OfferRewardText`='I could hear your explosions from here, $N. How did the shields work? Did they keep your bomber intact?$B$BI hope they did, because now I have more missions for you....' WHERE `Id`=13380; -- Leading the Charge +UPDATE `quest_template` SET `OfferRewardText`='Welcome to hell, soldier.$B$BMy men are leading the assault on the gate from this position, and we''re dropping some infiltrators in the city via air - we need more people on both fronts. I have a feeling that this attack will be going on for some time.' WHERE `Id`=13341; -- Joining the Assault +UPDATE `quest_template` SET `OfferRewardText`='Hail, $N. Thassarian mentioned you''d be dropping by. Any friend of Thassarian''s is my friend. Well, any living friend of Thassarian, that is... He does keep odd company.' WHERE `Id`=13386; -- Exploiting an Opening +UPDATE `quest_template` SET `OfferRewardText`='You''re as good as Thassarian said. Good job!' WHERE `Id`=13387; -- Securing the Perimeter +UPDATE `quest_template` SET `OfferRewardText`='These bombs look pretty potent. They should at least put a dent in the surrounding structure.' WHERE `Id`=13388; -- Set it Off! +UPDATE `quest_template` SET `OfferRewardText`='This pulsing object is covered in a thick layer of ice. It shimmers strangely beneath the water.' WHERE `Id`=13389; -- A Short Fuse +UPDATE `quest_template` SET `OfferRewardText`='I saw him get rid of it, you know? He threw it all the way down here.$B$BSaid he wouldn''t need it anymore. Said it made him weak.' WHERE `Id`=13390; -- A Voice in the Dark +UPDATE `quest_template` SET `OfferRewardText`='What are you waiting for? You have to rub it on you!$B$BQuick! Or he''ll see you!' WHERE `Id`=13391; -- Time to Hide +UPDATE `quest_template` SET `OfferRewardText`='It''s you, $N! We thought you were a goner.$B$BThat explosion of yours put quite a bit of hurt on the Scourge. Nearly took Captain''s Kendall''s eyebrows off in the process...' WHERE `Id`=13392; -- Return to the Surface +UPDATE `quest_template` SET `OfferRewardText`='The demolisher has seen better days, but the structure hasn''t suffered any permanent damage. The parts you obtained should be enough to get it running again, at least temporarily.' WHERE `Id`=13393; -- Field Repairs +UPDATE `quest_template` SET `OfferRewardText`='You see? You killed your fair share, but for every one you destroyed, another rose from the dirt to take its place.$B$BYou don''t know what you''re up against, $N. Let me show you.' WHERE `Id`=13394; -- Do Your Worst +UPDATE `quest_template` SET `OfferRewardText`='The prince''s true power wasn''t his ability to make armies out of corpses... that was easy.$B$BBut killing his own men, with whom he''d shared many battles... the prince''s true power was his ability to do what had to be done.' WHERE `Id`=13395; -- Army of the Damned +UPDATE `quest_template` SET `OfferRewardText`='Nice shooting, $N. The Scourge never had a chance.$B$BAre you feeling okay? You look like you''ve seen a ghost. Not that it would be an unusual thing around these parts, now that I think about it.' WHERE `Id`=13396; -- Futility +UPDATE `quest_template` SET `OfferRewardText`='Nice job, $N. You make the rest of us look bad!' WHERE `Id`=13397; -- Sindragosa's Fall +UPDATE `quest_template` SET `OfferRewardText`='Nothing to it, eh? Any intelligent being should have little trouble controlling lesser undead. I suspect only the likes of a true necromancer could use these to sieze control of any of the more powerful undead. That won''t be a problem though - I can already think of quite a variety of destruction we can wreak with even the most paltry minions.$B$BShall we have at it then?' WHERE `Id`=13168; -- Parting Gifts +UPDATE `quest_template` SET `OfferRewardText`='Quiet! I''m in a delicate juncture and mustn''t be disturbed!$B$BOne moment...' WHERE `Id`=1947; -- Journey to the Marsh +UPDATE `quest_template` SET `OfferRewardText`='Ah, so you''ve been speaking with MacKinley, have you?$B$BIt''s not what he thinks! I''m not afraid to give him some Steamwheedle Bilge Rum...$B$BI just don''t have any rum to give him!' WHERE `Id`=2872; -- Stoley's Debt +UPDATE `quest_template` SET `OfferRewardText`='Out-frikkin-standing! As of right now $T Civvy : Civvy; $N, you are my favorite person on the sorry remains of this sorry planet!$B$BI''m sure that the eggheads are going to wet themselves when I hand that blood over to them for study. Who knows, maybe we''ll find a new weapon in the fight against those damned fel orcs?' WHERE `Id`=9589; -- The Blood is Life +UPDATE `quest_template` SET `OfferRewardText`='It is good to know the people of this land still pay homage to the olden races. I bid you well, $N, and offer you this token...' WHERE `Id`=8619; -- Morndeep the Elder +UPDATE `quest_template` SET `OfferRewardText`='Wonderful! We thank you for your generous donation, $N!' WHERE `Id`=7807; -- A Donation of Wool +UPDATE `quest_template` SET `OfferRewardText`='Wonderful! We thank you for your generous donation, $N!' WHERE `Id`=7808; -- A Donation of Silk +UPDATE `quest_template` SET `OfferRewardText`='Vanira''s frogs be tellin'' de truth, den? Dis tiger be a druid and an ally? We couldn''t be hopin'' for a better outcome. Dis be a good omen for de coming battle.' WHERE `Id`=25470; -- Lady Of Da Tigers +UPDATE `quest_template` SET `OfferRewardText`='$n, you''d be a mighty warrior and a fierce commrade to da Darkspear trolls. De Echo Isles are OURS now and we couldn''ta done it wit''out ya.$B$BTake dis cloak. Wear it wit pride. You''d be a member of da tribe now!$B$BIn no time, da trolls will have a home again and we have you to thank for dat.' WHERE `Id`=25445; -- Zalazane's Fall +UPDATE `quest_template` SET `OfferRewardText`='15.9 pounds! That may be a new record for blood and gut weight on apparel! Congratulations, $c!' WHERE `Id`=7729; -- JOB OPPORTUNITY: Culling the Competition +UPDATE `quest_template` SET `OfferRewardText`='Ye''re a good $g lad:lass;, ye are. I got ye a lil'' present fer yer troubles.' WHERE `Id`=7723; -- Curse These Fat Fingers +UPDATE `quest_template` SET `OfferRewardText`='I never thunk I''d be lookin'' at thish ugly mug again!$B$BHe acshually looksh better without the resht o'' him attached.$B$BHere''s yer reward *hic*, $r.' WHERE `Id`=7701; -- WANTED: Overseer Maltorius +UPDATE `quest_template` SET `OfferRewardText`='Wonderful! Those sleepy Dark Irons will head back to their homes in the Depths to get some rest, greatly slowing down the productivity of the Slag Pit.' WHERE `Id`=7702; -- Kill 'Em With Sleep Deprivation +UPDATE `quest_template` SET `OfferRewardText`='There is one final task that you must complete. +' WHERE `Id`=3453; -- The Torch of Retribution +UPDATE `quest_template` SET `OfferRewardText`='Are you prepared to make your strike? +' WHERE `Id`=3462; -- Squire Maltrake +UPDATE `quest_template` SET `OfferRewardText`='It is glorious! Is it not glorious master? ' WHERE `Id`=3463; -- Set Them Ablaze! +UPDATE `quest_template` SET `OfferRewardText`='Oh, this is great! Nice feel to it too!$B$BWhat? Oh, yeah... geologists. Got ''em good, did ya? I can''t thank ya enough, $N. That''ll give me some time to finish up in here... Thanks again, $N.' WHERE `Id`=4449; -- Caught! +UPDATE `quest_template` SET `OfferRewardText`='Keep the residue pouring in!' WHERE `Id`=13662; -- Gaining Acceptance +UPDATE `quest_template` SET `OfferRewardText`='You have struck a decisive blow against the Undermarket. Their leaders will think twice before sending more cronies into the gorge.$B$BOh, and I also found nothing of use in the trader''s satchel. You may keep whatever you find inside.' WHERE `Id`=3385; -- The Undermarket +UPDATE `quest_template` SET `OfferRewardText`='Perfect! I just hope the Dalaran Destroyers finally win one!' WHERE `Id`=13107; -- Mustard Dogs! +UPDATE `quest_template` SET `OfferRewardText`='$B$BThat ore... I can''t touch it. It seethes with unnatural energy. No creature of stone can handle it. What do they mean to do with this?' WHERE `Id`=12964; -- The Dark Ore +UPDATE `quest_template` SET `OfferRewardText`='$B$BYou''ve weakened the stormforged considerably, but they''ll keep fighting. Their casualties matter nothing to them, while our defenders continue to fall. Even if it costs them a hundred or a thousand iron corpses, they''ll keep fighting until we''ve been pounded to gravel.' WHERE `Id`=12965; -- The Gifts of Loken +UPDATE `quest_template` SET `OfferRewardText`='Ruined? What d''you mean, the camp''s been ruined?$B$B$B$BThose iron dwarves will pay for this! There''s little we can do now, and we have to focus on finishing the key. But once I get into the halls of Ulduar, the irons and their masters will answer for what they''ve done!' WHERE `Id`=13273; -- Going After the Core +UPDATE `quest_template` SET `OfferRewardText`='$B$BBrann may prove to be just the ally we need to discover what is truly happening in Ulduar. You''ve done well in aiding him. We need all the help we can get against this Loken and his iron dwarf minions.' WHERE `Id`=13285; -- Forging the Keystone +UPDATE `quest_template` SET `OfferRewardText`='The Sons of Hodir accept your tribute, small one. You continue to prove your worth as an ally in more ways than one.' WHERE `Id`=13559; -- Hodir's Tribute +UPDATE `quest_template` SET `OfferRewardText`='Yes... these will do. Let us hope my plan works, $N.$B$BVeranus is a great drake. I''d hate to have to settle for a lesser one.' WHERE `Id`=13050; -- Veranus +UPDATE `quest_template` SET `OfferRewardText`='It''s good to have my old friend back. It appears that my luck is finally starting to change... and it''s all thanks to you, little friend.' WHERE `Id`=13051; -- Territorial Trespass +UPDATE `quest_template` SET `OfferRewardText`='So it is done.$b$bWe have heard the screams of Jormuttar as they echoed from across the valley.$b$bYou have done our people a service this day, little $r.' WHERE `Id`=13011; -- Jormuttar is Soo Fat... +UPDATE `quest_template` SET `OfferRewardText`='We''re here, $N. My brother''s forces will learn the meaning of defeat today.' WHERE `Id`=13057; -- The Terrace of the Makers +UPDATE `quest_template` SET `OfferRewardText`='It''s a good start. But my brother''s forces will not take long to regroup. We must make our victory a decisive one.' WHERE `Id`=13005; -- The Earthen Oath +UPDATE `quest_template` SET `OfferRewardText`='One by one, my brother''s servants have fallen. Loken''s insurrection will soon come to an end.' WHERE `Id`=13035; -- Loken's Lackeys +UPDATE `quest_template` SET `OfferRewardText`='No... it cannot be...$B$BNo one can defeat Thorim in single combat. Not a giant, nor a beast... no one! Especially not that coward of a brother of his.$B$BOn my forefathers'' names, this I swear...$B$BLoken will pay for this!' WHERE `Id`=13047; -- The Reckoning +UPDATE `quest_template` SET `OfferRewardText`='The heavens, in their countless stars, hold answers to earthly mysteries, $N. Might, then, the wise, and the lucky, gaze up and find truth?' WHERE `Id`=8727; -- Farwhisper the Elder +UPDATE `quest_template` SET `OfferRewardText`='Human children born of vrykul? And Ymiron ordered the deaths of all human born offspring?$B$B$B$BAs much as I wish to deny what is so plainly presented to me, I cannot. There is no extinct \"missing link\" to humans as the Explorers'' League proposed. The vrykul are the missing link. They are the progenitors of humanity.' WHERE `Id`=11344; -- Anguish of Nifflevar +UPDATE `quest_template` SET `OfferRewardText`='This is quite a find, $N. I can''t have you selling this to anyone else, so I''m willing to offer generously.' WHERE `Id`=24431; -- Waterlogged Recipe +UPDATE `quest_template` SET `OfferRewardText`='You have rescued the sacred text!$b$bYour journey was long and acquiring the book was undoubtedly no easy task. But the dwarves of Ironforge stand to benefit from your success.$b$bThank you, $n, on behalf of the Explorers'' League.' WHERE `Id`=1050; -- Mythology of the Titans +UPDATE `quest_template` SET `OfferRewardText`='So Stormpike sent you, did he? Good.$B$BI have a big task for you...' WHERE `Id`=707; -- Ironband Wants You! +UPDATE `quest_template` SET `OfferRewardText`='Fantastic, I thought you looked to be the heroic type! We''ve got our work cut out for us $N, I''m not going to lie to you. If we stay focused on the task at hand, we should be able to come out on top.$B$BNow, let me bring you up to speed on what''s been going on...' WHERE `Id`=3523; -- Scourge of the Downs +UPDATE `quest_template` SET `OfferRewardText`='You have my thanks.$B$BThis has been a brutal operation, but we haven''t had any great options otherwise - they''re being equally as unforgiving to our aerial assault. We need to rout these vrykul if we''re going to stand any chance of pressing on in Icecrown.$B$BWe''re likely to need more help later. Please lend yourself to the battle again should the chance present itself.' WHERE `Id`=13284; -- Assault by Ground +UPDATE `quest_template` SET `OfferRewardText`='Let''s see here... what do we have...$B$B$B$BMalykriss! The Vile Hold. It seems Arthas did not take the loss of his death knights so well... I''m not exactly sure what he''s doing with all of that saronite, but I have a feeling he might be overcompensating for something.$B$BThat boy is not used to losing.' WHERE `Id`=13174; -- Amidst the Confusion +UPDATE `quest_template` SET `OfferRewardText`='I''ve chained the wretch to the post over there and I''ll look into getting my hands on more of them.$B$BNow let''s make some use of that eye.' WHERE `Id`=13143; -- New Recruit +UPDATE `quest_template` SET `OfferRewardText`='Excellent work. It seems more death knights remained loyal to Arthas than I initially thought.$B$BHe certainly is sparing nothing in his attempt to replace Acherus. A pure saronite citadel would be hard to destroy indeed. There''s no need to destroy it though... we can halt production and put down these death knight leaders here and now, before they become a real threat.$B$BMost importantly, we need to disrupt them enough to get those death knights away from from the leaders so that we can make our strike.' WHERE `Id`=13145; -- The Vile Hold +UPDATE `quest_template` SET `OfferRewardText`='Yay, yay! $N is best proto-drake stealer.$B$BYou come back tomorrow and we make more fire!!!' WHERE `Id`=13071; -- Vile Like Fire! +UPDATE `quest_template` SET `OfferRewardText`='Well done, $N. Let them see the desecrated corpses of their fallen comrades and think twice about striking at us!$B$BIf you come back tomorrow, I will make certain to have more banners prepared for you.' WHERE `Id`=12995; -- Leave Our Mark +UPDATE `quest_template` SET `OfferRewardText`='You are a true champion for the cause, $N!$B$BWon''t you please come speak to me again tomorrow? I''m certain that there will be more of those nasty proto-drakes to shoot down.' WHERE `Id`=13069; -- Shoot 'Em Up +UPDATE `quest_template` SET `OfferRewardText`='$B$BGood. It''s not much protection, but it''s better than nothing. That gate is still the perfect choke point if the Scourge commanders know what they''re doing. We must gain control of as much of the surrounding area as possible.' WHERE `Id`=13332; -- Raise the Barricades +UPDATE `quest_template` SET `OfferRewardText`='Words cannot describe what I''m feeling at the moment, $N. My revenge is complete and there is naught else for me to do.$B$BIf only I could be there when the Lich King is finally taken down.$B$BDon''t fool yourself though, Jotunheim is far from ''dealt'' with. I will remain in possession of this witch until such time as the vrykul are no longer a threat.$B$BLook around, there are many items of value in this cave. Take your pick.' WHERE `Id`=13142; -- Banshee's Revenge +UPDATE `quest_template` SET `OfferRewardText`='You have bested our finest warriors. Your name is renowned, $N.$B$BPerhaps you think that this concerns me: it does not. If they can fall to you then they are not worthy and should be nothing but lowly vargul!$B$BBut perhaps I can give you and your friends different sport. Valhalas is also a place for combat of all types with many different kinds of foes.$B$BSpeak to me again when you and your friends are ready to proceed. We shall see if you are truly worthy.' WHERE `Id`=13213; -- Battle at Valhalas +UPDATE `quest_template` SET `OfferRewardText`='It''s good to have someone competent running missions, $N. If only we had an army of $cs like you, we could show the Horde what we''re made of. These captured reports will help us to maintain the upper hand in this fight. We may be down, but we''re far from out.' WHERE `Id`=13314; -- Get the Message +UPDATE `quest_template` SET `OfferRewardText`='New blood.$B$B$B$BYou all think that you have what it takes to fight here.$B$BYou are nothing before the might of the vrykul and the Scourge!$B$BStill, you did manage to defeat six incompetent corpses, so you must have some skill in you. Not likely enough for the next challenge though.' WHERE `Id`=13214; -- Battle at Valhalas: Fallen Heroes +UPDATE `quest_template` SET `OfferRewardText`='You want me to be impressed by the fact that you and your friends were able to bring down a lone Nerubian priest?$B$BGet out of my sight before I summon my ghouls upon you!' WHERE `Id`=13215; -- Battle at Valhalas: Khit'rix the Dark Master +UPDATE `quest_template` SET `OfferRewardText`='The defeat of one of the hyldnir is mildly impressive, $r, but you did have the help of your friends.$B$BYou''re lucky that her drake didn''t get involved.' WHERE `Id`=13216; -- Battle at Valhalas: The Return of Sigrid Iceborn +UPDATE `quest_template` SET `OfferRewardText`='I''m starting to respect your prowess in the ring, $N. Now I really don''t like you.$B$BI would much rather have preferred to see you and your friends stuck to the bottom of that flesh giant''s foot!' WHERE `Id`=13217; -- Battle at Valhalas: Carnage! +UPDATE `quest_template` SET `OfferRewardText`='I don''t know what trickery it was that you used to bring down the thane -- I couldn''t see it from this angle -- but I can assure you that you will not survive your next match.$B$BYes, I know who it is. Run, little $r. Flee to the far corners of the world.$B$BOr stay and die. It matters little to me.' WHERE `Id`=13218; -- Battle at Valhalas: Thane Deathblow +UPDATE `quest_template` SET `OfferRewardText`='Your defeat of Prince Sandoval sickens me. An unwashed peasant such as yourself should have willingly given over $g his : her; life simply for the chance to meet him and kneel at his feet.$B$BYou''ve earned your damned reward. Be quick about your choosing.' WHERE `Id`=13219; -- Battle at Valhalas: Final Challenge +UPDATE `quest_template` SET `OfferRewardText`='This will allow us to patch up more of the fallen. Thank you, $N, on behalf of all who defend the refuge.' WHERE `Id`=12930; -- Rare Earth +UPDATE `quest_template` SET `OfferRewardText`='You''ve done well, $N!' WHERE `Id`=192; -- Panther Mastery +UPDATE `quest_template` SET `OfferRewardText`='So the great Bhag''thera is dead! Cheers to you, $N. You are a mighty $c indeed!' WHERE `Id`=193; -- Panther Mastery +UPDATE `quest_template` SET `OfferRewardText`='Ho ho!! We have ourselves a true raptor slayer! Nicely done, $g old chap : fair lady;!' WHERE `Id`=196; -- Raptor Mastery +UPDATE `quest_template` SET `OfferRewardText`='$G Master : Mistress; $N, the raptor slayer!$b$bHas a nice ring to it, eh?' WHERE `Id`=197; -- Raptor Mastery +UPDATE `quest_template` SET `OfferRewardText`='Bloody well done! Right-o! Congratulations, $N, for succeeding where others have failed.$b$bI am honored to count you as a comrade of our great hunting party here. No one will ever doubt your expertise in hunting and tracking!$b$bCheers to you, I say! Cheers!' WHERE `Id`=208; -- Big Game Hunter +UPDATE `quest_template` SET `OfferRewardText`='You''re a good $g man : woman;, $N. We''re fortunate that you happened to stop by.$B$BStick around a while. I''m sure that we have much that a capable $c such as yourself can do.' WHERE `Id`=12740; -- Parachutes for the Argent Crusade +UPDATE `quest_template` SET `OfferRewardText`='$B$BAre those new orders for me, $g mister : miss;?' WHERE `Id`=12505; -- New Orders for Sergeant Stackhammer +UPDATE `quest_template` SET `OfferRewardText`='Perfect! I just hope the Dalaran Destroyers finally win one!' WHERE `Id`=13116; -- Mustard Dogs! +UPDATE `quest_template` SET `OfferRewardText`='Good. $n, I know of you. You''ll be perfect for these tasks.$B$BWe''ve been afforded a rare chance to delve into Icecrown Citadel, but we must move quickly if we''re to avoid Arthas'' notice.' WHERE `Id`=24506; -- Inside the Frozen Citadel +UPDATE `quest_template` SET `OfferRewardText`='Well done, $N. Mounted combat is often hard to pick up for those accustomed to fighting on foot. I have no doubt that you''ll continue to improve with practice, which is more than I can say for some warriors.' WHERE `Id`=13677; -- Learning The Reins +UPDATE `quest_template` SET `OfferRewardText`='You have shown yourself a capable combatant, $N and you will serve as an example to the rest of the aspirants who clamor to compete on behalf of the Horde.' WHERE `Id`=13676; -- Training In The Field +UPDATE `quest_template` SET `OfferRewardText`='So you''re saying this knight''s story is a sham? Most suspicious. Dishonorable at the least, and murderous at the worst. Still, we can''t confront him until we know for certain whether he was involved in these murders.$B$BDo nothing to arouse his suspicions, $N. Discretion will serve us well as we continue to investigate.' WHERE `Id`=13634; -- The Black Knight of Silverpine? +UPDATE `quest_template` SET `OfferRewardText`='Welcome to Orgrim''s Hammer.$B$BFrom here we are laying our groundwork for the assault on Arthas. There''s a lot of preparation to be done, but before we can get into the real meat of it, we want to make sure that the Argent Crusade is adequately reinforced - we''re going to need their help later.$B$BIf you have not already, speak to Brother Keltan on the main deck.' WHERE `Id`=13419; -- Preparations for War +UPDATE `quest_template` SET `OfferRewardText`='Perhaps now we can really get something done. Don''t be fooled though, the Lich King can still ''see'' through his Scourge minions.$B$BThat''s why you''re here.' WHERE `Id`=12892; -- It's All Fun and Games +UPDATE `quest_template` SET `OfferRewardText`='Quickly, hand them to me and stay out of sight!$B$BThe rod, the hook, and the rope are all very self-evident in their usage when combined. I just need to infuse the result with the essences and we''ll be ready to proceed.$B$BIt''s all very mundane in its composition, but extraordinary in its application!' WHERE `Id`=12891; -- I Have an Idea, But First... +UPDATE `quest_template` SET `OfferRewardText`='We will put those three to good use once we finally take the vault.$B$BSpeaking of which....' WHERE `Id`=12893; -- Free Your Mind +UPDATE `quest_template` SET `OfferRewardText`='Careful, now. Keep that plate as far away from me as you can. Even being in its presence is enough to inflict pain.$B$BBut you''re right, $N, these are gigantic armor plates for a war golem of normal size. What would the stormforged be doing with them? There''s only one way to find out.' WHERE `Id`=12979; -- Armor of Darkness +UPDATE `quest_template` SET `OfferRewardText`='There may be hope for victory, $N. We have never been able to sustain an attack on the stormforged, but with your efforts, Valduran may yet fall!' WHERE `Id`=12978; -- Facing the Storm +UPDATE `quest_template` SET `OfferRewardText`='Always more questions than answers, eh, $g lad:lass;? +' WHERE `Id`=13207; -- Halls of Stone +UPDATE `quest_template` SET `OfferRewardText`='So... here I sat, basking in the awesomeness that is me, and in the distance, I hear a pop! Then another! Then a dozen more! And a smile crept onto my face at the thought of all those magnataur and snobolds eagerly rushing to their own deaths.$B$BWas it glorious?' WHERE `Id`=12820; -- A Delicate Touch +UPDATE `quest_template` SET `OfferRewardText`='Excellent!$B$B$B$BLet the destruction begin!' WHERE `Id`=12821; -- Opening the Backdoor +UPDATE `quest_template` SET `OfferRewardText`='I know that we Forsaken appear monstrous to your eyes, but I assure you we mean your people no harm. We are here because of a common enemy: Dar''Khan the traitor! He has returned and now commands the Scourge that are invading this land from his steadfast, Deatholme, to the south.$B$BOur leader, Lady Sylvanas Windrunner, originally hails from these lands, and in fact used to be an elf. She has a history with Dar''Khan and wants him dead as much as your people do.$B$BWe will defeat him together, $c!' WHERE `Id`=9327; -- The Forsaken +UPDATE `quest_template` SET `OfferRewardText`='Oh good, there you are! And just in time... there is much to be done!' WHERE `Id`=9758; -- Return to Arcanist Vandril +UPDATE `quest_template` SET `OfferRewardText`='Very well, these will have to do. No, don''t describe them crawling around, I don''t want to know! I''ll work my magic upon these legs and they''ll turn out quite tasty. A little spice here, a pinch of herb there, and then of course some arcane ingredients, and voila, a meal fit for a queen... or in this case, a dame.$B$BYour service has been adequate, $c. Here, take this recipe and some samples.' WHERE `Id`=9171; -- Culinary Crunch +UPDATE `quest_template` SET `OfferRewardText`='My family... What have I done... What could I have done?$b$bWhy must I be punished so?' WHERE `Id`=10428; -- The Missing Fisherman +UPDATE `quest_template` SET `OfferRewardText`='[Furbolg] The prophecy spoke of one that would rise and deliver us from the oppressive grasp of Bristlelimb -- that the spirits themselves would herald the arrival of this hero.$B$BAnd now, you have come.$B$BI humble myself before you, great one.' WHERE `Id`=9544; -- The Prophecy of Akida +UPDATE `quest_template` SET `OfferRewardText`='You''re a resourceful one! With our navigation gear, we can figure out just how far we''ve veered off course.$b$bBut wait, what''s this? There''s something rolled up in the map. Let me see...$b$bThese are orders from Mogul Razdunk of the Venture Company. According to these plans, they''re here to strip-mine the island of the crystal wreckage, then hijack our ships once they''re finished.$b$bBy Bronzebeard''s bushy brow! This is why they forced us to land? How could they know of our plans?$b$bI smell a traitor...' WHERE `Id`=9506; -- A Small Start +UPDATE `quest_template` SET `OfferRewardText`='Bless yer heart, stranger. This''ll go a long ways in liftin'' the morale o'' the crew. +' WHERE `Id`=9512; -- Cookie's Jumbo Gumbo +UPDATE `quest_template` SET `OfferRewardText`='My pappy would be proud! His boy strikes it big at the first set of night elf ruins he comes across... With your help, of course. Yes, don''t worry, I won''t leave you out of the discovery. Your name is $N, right? They''ll learn all about you in Ironforge. +' WHERE `Id`=9523; -- Precious and Fragile Things Need Special Handling +UPDATE `quest_template` SET `OfferRewardText`='$B$BThis will have to do for now! Hopefully one of the shaman will be able to repair the damage.' WHERE `Id`=9564; -- Gurf's Dignity +UPDATE `quest_template` SET `OfferRewardText`='You place the gem inside the essence font.$B$B\"Thank you mortal, you have - no... this, this cannot be! No! The corruption of this accursed god even taints the sanctity of a Green Dragonflight essence font! No please, I feel my essence ripping from me! THE PAIN! I feel the grip of an eternal nightmare taking hold on me...\"$B$B\"Mortal, I implore you! Find one of the Green Dragonflight to stop this... help me... I am chained in darkness... forever in agony... please do not torture...\"' WHERE `Id`=3373; -- The Essence of Eranikus +UPDATE `quest_template` SET `OfferRewardText`='Well done, $N. I am pleased. You have done a great thing here today.$B$BU''cha was one of the greatest apes I had ever seen. The fact that you have bested his strength speaks well of your own strength... and courage.$B$BIt is only fitting that I give you this as a sign of respect. You have earned it.' WHERE `Id`=4301; -- The Mighty U'cha +UPDATE `quest_template` SET `OfferRewardText`='The Earth Mother be praised! You''ve done it! Fair play to you, $N. You have proven to be a great hunter in your own right. Your spirit is strong. Your bravery unmatched. And your strength has been fortified. I bow down to your skills.$B$BOnly the greatest of my ancestors could have accomplished something so incredible. Congratulations.' WHERE `Id`=4292; -- The Bait for Lar'korwi +UPDATE `quest_template` SET `OfferRewardText`='I''ll need one vial to make sure that this is truly the elixir... Yes... This is the stuff. ' WHERE `Id`=3909; -- The Videre Elixir +UPDATE `quest_template` SET `OfferRewardText`='Thanks so much, $N! Now I can get back to work here.$B$BDid you find anything of interest at the Winterfall camp?' WHERE `Id`=5082; -- Threat of the Winterfall +UPDATE `quest_template` SET `OfferRewardText`='This thing... it is in the shape of a Winterfall Ritual Totem, but it has been twisted by forces I cannot begin to comprehend. Whatever taint that has set the Winterfall against us is surely present in this object.$B$BDivine wisdom has brought both this and you to us, $N. We will study this object intently; perhaps one day, the Winterfall will rage against us no longer.$B$BThank you, friend - please accept these offerings in exchange for your benevolence.' WHERE `Id`=8471; -- Winterfall Ritual Totem +UPDATE `quest_template` SET `OfferRewardText`='Thank you again, $C, for rescuing me from Baltharus''s clutches!$B$BThere is still much work to be done, however....' WHERE `Id`=26013; -- Assault on the Sanctum +UPDATE `quest_template` SET `OfferRewardText`='It''s locked, isn''t it? It looks pretty ordinary.$B$B$B$BNo matter, I suppose. If this gets us the edge we need against the Horde, then I could care less if the cure for the Plague was in there. ' WHERE `Id`=12292; -- Local Support +UPDATE `quest_template` SET `OfferRewardText`='With Malygos defeated, the Nexus War should come to a swift conclusion. You have the gratitude of the Kirin Tor, $N.' WHERE `Id`=24584; -- Malygos Must Die! +UPDATE `quest_template` SET `OfferRewardText`='Shiver me timbers and timber me shivers! Ye found me beautiful eye! Let''s see if she still fits.$b$b$n ho! Blimey, I can see!!' WHERE `Id`=576; -- Keep An Eye Out +UPDATE `quest_template` SET `OfferRewardText`='Good show, $n! And just before I need to ship out too! Can''t thank you enough, old friend.' WHERE `Id`=587; -- Up to Snuff +UPDATE `quest_template` SET `OfferRewardText`='Perfect, $n. Now that we know their plan, it''s just a matter of time.$b$bAnd to think the fools have dropped anchor just off the cape....' WHERE `Id`=604; -- The Bloodsail Buccaneers +UPDATE `quest_template` SET `OfferRewardText`='Witch Doctor Unbagwa like Gorilla Fangs! For you I talk to spirits. Make Mokk the Savage come.$b$bYou protect Witch Doctor Unbagwa from other Gorilla-beast though or no Mokk for you!' WHERE `Id`=349; -- Stranglethorn Fever +UPDATE `quest_template` SET `OfferRewardText`='Ack! Where''d you get these? No, don''t tell me. I don''t want to know!$B$BWho sent you? Sea Wolf?' WHERE `Id`=606; -- Scaring Shaky +UPDATE `quest_template` SET `OfferRewardText`='Ah, very good! Here is your pay.$B$BAnd here is a little something extra... for your discretion.' WHERE `Id`=621; -- Zanzil's Secret +UPDATE `quest_template` SET `OfferRewardText`='Ah, what a great day for the Blackwater Raiders! Three cheers to you, $n!' WHERE `Id`=608; -- The Bloodsail Buccaneers +UPDATE `quest_template` SET `OfferRewardText`='Heh heh, well done! And when you showed Shaky those giblets, how hard did he shake?$B$BHah! He''s so easy to read, when I play cards with him I can''t help but win!$B$BThanks for your help, $N. Now it''s your turn to get paid...' WHERE `Id`=607; -- Return to MacKinley +UPDATE `quest_template` SET `OfferRewardText`='...feel strength returning....$b$bWhere might be? Booty Bay? Oh my! I had the strangest dream...$b$b...the weakness has not completely left me....' WHERE `Id`=348; -- Stranglethorn Fever +UPDATE `quest_template` SET `OfferRewardText`='What?! I got a lot better things to do then talk to the likes of you, $c. Make it worth my while or get outta my face.$B$BHuh? Bloads sent ya, huh? Well, whaddaya got for me?$B$B$B$BNot bad, not bad at all. Another bundle will make my client quite happy.$B$BI suppose yer next question''s gonna be about money, huh, $c? Of course it is!$B$BHere, take this coin and some advice: get off my docks.' WHERE `Id`=623; -- Akiris by the Bundle +UPDATE `quest_template` SET `OfferRewardText`='James Hyal, James Hyal... Why does that name sound so familiar?$b$bOf course! The Shady Rest Inn incident. If you have any information about what happened there, I would urge you to speak with Captain Vimes about it. He''s handling the investigation.' WHERE `Id`=1302; -- James Hyal +UPDATE `quest_template` SET `OfferRewardText`='What''s this? Ah! It smells like Dark Iron Ale! Drink has blurred my sight, but I can tell that you, $gsir:my lady;, are a real friend!' WHERE `Id`=4295; -- Rocknot's Ale +UPDATE `quest_template` SET `OfferRewardText`='You have the heart! Amazing! It is even more beautiful than I imagined!$B$BPlease, $N, take this as payment!' WHERE `Id`=4123; -- The Heart of the Mountain +UPDATE `quest_template` SET `OfferRewardText`='Ah, you found the tablet! And your transcription is superb! Are you sure you''re a $c and not a scribe?$B$BHere you are, $N. Here is the payment I promised.' WHERE `Id`=4296; -- Tablet of the Seven +UPDATE `quest_template` SET `OfferRewardText`='Oh my goodness, you made it! I was uncertain.$B$BYou flickered in and out of the time stream there for a moment during the fight! I thought for sure that we''d lost you!$B$BBut here you are safe and sound, with your past self rescued, on the other side of the time loop you were in.$B$BYou''re quite the temporal $g hero : heroine;, $N!' WHERE `Id`=13343; -- Mystery of the Infinite, Redux +UPDATE `quest_template` SET `OfferRewardText`='$B$BTh... They say these Vargul are the... the ones that weren''t found worthy by the Lich King. Can... Can you im... imagine it? Just th... think how powerful the... the... worthy must be...$B$BI''ll say a prayer for you in the hereafter, hero... May you never have to face them in number.' WHERE `Id`=12904; -- Light Won't Grant Me Vengeance +UPDATE `quest_template` SET `OfferRewardText`='A... A storm giant? I don''t know about this, $N. That sounds risky. On the other hand, I don''t think we have too many other options.$B$BIf I do this you have to promise me that you will get your giant friend to help us deal with Navarius and his cronies.' WHERE `Id`=12912; -- A Great Storm Approaches +UPDATE `quest_template` SET `OfferRewardText`='Excellent work, $n. The tremors have already begun to subside.$b$bWith any luck, your efforts have granted us sufficient time to find a way to thwart Malygos'' efforts.' WHERE `Id`=11905; -- Postponing the Inevitable +UPDATE `quest_template` SET `OfferRewardText`='Ah, that''s the spice! Now here''s some swampy good stew.' WHERE `Id`=1218; -- Marsh Frog Legs +UPDATE `quest_template` SET `OfferRewardText`='A report from an orc spy! How did you find this? No matter -- let''s see what it says...' WHERE `Id`=1220; -- Captain Vimes +UPDATE `quest_template` SET `OfferRewardText`='The freed captives have already begun returning from Blackhoof Village. The information the captain is receiving from the prisoners will give us an advantage in our next battle against the Grimtotems.$B$BYou have my thanks and that of the men. ' WHERE `Id`=11145; -- Prisoners of the Grimtotems +UPDATE `quest_template` SET `OfferRewardText`='Hm, I''m no expert with the construction of arms and armor. Their use, yes, but not their making.$b$bThis shield seems as ordinary as any, excepting the damage from the fire that engulfed the inn.' WHERE `Id`=1253; -- The Black Shield +UPDATE `quest_template` SET `OfferRewardText`='Hoofprints, eh? It is true that there is an extraordinary amount of centaur activity in the lands near the Dustwallow Marsh. In brief excursions into the Barrens, we found their camps and holdings dotting the area.$b$bI''ll send out Falgran Hastil, one of our trackers, to see if he can find where the tracks lead.' WHERE `Id`=1284; -- Suspicious Hoofprints +UPDATE `quest_template` SET `OfferRewardText`='It''s never good news when a guard''s badge is brought to me.$b$bSometimes it''s a man or woman who''s fallen in battle, and I''m left to bring the news to the grieving family. Other times we never find out what happened to them. And other times it''s even worse than that.' WHERE `Id`=1252; -- Lieutenant Paval Reethe +UPDATE `quest_template` SET `OfferRewardText`='Hello, $n. You''d like information about a specific member of the Theramore guard? Reethe, was it?$b$bJust give me a moment to find the right book.' WHERE `Id`=1259; -- Lieutenant Paval Reethe +UPDATE `quest_template` SET `OfferRewardText`='Missing? That would be Tesoran''s kind way of saying traitor.$b$bNo doubt he''s one of those fools so blindly loyal to Admiral Daelin that he turned traitor. Isn''t that a delicious irony? The deserters accuse us of betraying the Alliance.' WHERE `Id`=1285; -- Daelin's Men +UPDATE `quest_template` SET `OfferRewardText`='Mr. Ignatz was just here with the bogbean leaves, and he told me you helped him out of some real trouble.$B$BThank you, $N. I will ask my uncle to treat you to a feast the next time you visit the Blue Recluse in Stormwind.' WHERE `Id`=1222; -- Stinky's Escape +UPDATE `quest_template` SET `OfferRewardText`='You and Renn have done excellent work in bringing this information to light and reporting it immediately. Now, we must confirm your findings. The implications are too great if we are wrong.' WHERE `Id`=11141; -- Jaina Must Know +UPDATE `quest_template` SET `OfferRewardText`='$B$BA rune circle, dragonkin? The Defias have allied themselves with HER? The traitor?$B$B' WHERE `Id`=11142; -- Survey Alcaz Island +UPDATE `quest_template` SET `OfferRewardText`='Excellent news, $c! If our tactical deployments continue to be this successful, the Horde will be in full retreat before long.' WHERE `Id`=24220; -- Call to Arms: Arathi Basin +UPDATE `quest_template` SET `OfferRewardText`='You''ve done well! That''s less Templars for me to worry about.$B$BHere you go, $N. Hope there''s something useful in there for you.' WHERE `Id`=8362; -- Abyssal Crests +UPDATE `quest_template` SET `OfferRewardText`='What Huum says is true. I believe I know how to summon a lord of the Abyssal Council! Listen on, and I will explain...' WHERE `Id`=8343; -- Goldleaf's Discovery +UPDATE `quest_template` SET `OfferRewardText`='This wine is quite amazing! I must know where it''s from.' WHERE `Id`=13115; -- Cheese for Glowergold +UPDATE `quest_template` SET `OfferRewardText`='I never cease to be amazed by the horrors that can be created through the use of technology.' WHERE `Id`=24585; -- Flame Leviathan Must Die! +UPDATE `quest_template` SET `OfferRewardText`='$B$BIt looks familiar... The Might of Kalimdor trampled a thousand bugs like this one in the desert of Silithus.$B$BThis is a different place - a different environment - but the result will be the same.$B$B$B$BYou will bring pride and honor to the Horde in Northrend, $N.$B$B' WHERE `Id`=11632; -- What the Cold Wind Brings... +UPDATE `quest_template` SET `OfferRewardText`='$B$BWHAT! This can''t be right. I''ve known some of these orcs for years!$B$BLeave me, $N. I have much work to do and many traitors to execute.$B$BTake one of these items for your trouble. You''ve done a great service for the Horde this day.' WHERE `Id`=12136; -- The Translated Tome +UPDATE `quest_template` SET `OfferRewardText`='Icefist, eh? I''ve heard his name before. Dat''s some good work, mon. Hopefully we Darkspear can turn our attention back to dat dragon menace now. ' WHERE `Id`=12145; -- Canyon Chase +UPDATE `quest_template` SET `OfferRewardText`='There is risk in dispelling the evil from a scourgestone, for it attracts the attention of undead for countless miles. But you are strong in the Light, $n, and I do not fear for you...' WHERE `Id`=8414; -- Dispelling Evil +UPDATE `quest_template` SET `OfferRewardText`='You have done as I asked without question, $n.$b$bTrust is achieved, it seems. Perhaps I can reveal our plan in more detail to you now.' WHERE `Id`=8416; -- Inert Scourgestones +UPDATE `quest_template` SET `OfferRewardText`='It''s good to see fresh troops here, $N, but with a little luck you''ll get into some action and won''t be fresh for long!$B$BSpeak with me again. I have tasks I must discuss with you....' WHERE `Id`=7121; -- The Quartermaster +UPDATE `quest_template` SET `OfferRewardText`='$B$BExcellent. Their loss is my... our gain!$B$BYou didn''t have trouble with any of these along the way? Some of them look rather unstable. I may be undead, but I value my existence!' WHERE `Id`=12230; -- Stealing from the Siegesmiths +UPDATE `quest_template` SET `OfferRewardText`='Excellent work, $g sir : ma''am;!$B$BI''ll see to it that the commander is apprised of your mission results.' WHERE `Id`=12562; -- The Drakkari Do Not Need Water Elementals! +UPDATE `quest_template` SET `OfferRewardText`='$B$BOld news. The Argent Crusade is - once again - late to the party. We''ve been tracking Drakuru since Grizzly Hills. He is slated for eradication. +' WHERE `Id`=12884; -- The Ebon Watch +UPDATE `quest_template` SET `OfferRewardText`='Saved them all, did you? Outstanding!$b$bMaybe you''d consider sticking around the post here? We could sure use someone like you....' WHERE `Id`=12512; -- Leave No One Behind +UPDATE `quest_template` SET `OfferRewardText`='Fine specimens, $n.$b$bOn behalf of my soldiers, I thank you for your efforts today.$b$bCaptain Rupert is likely the next stop on your patrol. He''s stationed at the wall just east of here.' WHERE `Id`=12564; -- Troll Patrol: Something for the Pain +UPDATE `quest_template` SET `OfferRewardText`='It is good to know the people of this land still pay homage to the olden races. I bid you well, $N, and offer you this token...' WHERE `Id`=13017; -- Jarten the Elder +UPDATE `quest_template` SET `OfferRewardText`='Just what I wanted to hear! A victory in Alterac Valley - even a temporary one - is crucial to our overall strategy against the Horde.' WHERE `Id`=11336; -- Call to Arms: Alterac Valley +UPDATE `quest_template` SET `OfferRewardText`='The heavens, in their countless stars, hold answers to earthly mysteries, $N. Might, then, the wise, and the lucky, gaze up and find truth?' WHERE `Id`=8715; -- Bladeleaf the Elder +UPDATE `quest_template` SET `OfferRewardText`='Your spirit burns with life, young $c. I accept the homage you pay, and offer in return this token...' WHERE `Id`=8680; -- Windtotem the Elder +UPDATE `quest_template` SET `OfferRewardText`='Thank you for heeding Rhonin''s call, brave adventurer.$B$BLet me share with you what we know regarding recent events, and any assistance you might offer would be greatly appreciated.' WHERE `Id`=26012; -- Trouble at Wyrmrest +UPDATE `quest_template` SET `OfferRewardText`='To atone for the sins I committed as one of the Lich King''s Death Knights, I''ve dedicated myself to creating rings of great power for our brothers and sisters to use in the struggle.$B$BYou''ve proven yourself as a valuable ally in the fight against the Scourge, $N. As your dedication continues I can improve on the ring''s original design.$B$BChoose your path carefully. A change of heart will come at a price.' WHERE `Id`=24815; -- Choose Your Path +UPDATE `quest_template` SET `OfferRewardText`='You have seen the Chamber of Khaz''mul? Amazing! Baelog was sure it existed, but I must admit that I had my doubts.$B$BThank you, $N. With luck your finding will incite our leaders to renew their efforts to retake Uldaman. And if it is ever again under Ironforge control, then the secrets of the Chamber of Khaz''mul will be ours!' WHERE `Id`=2240; -- The Hidden Chamber +UPDATE `quest_template` SET `OfferRewardText`='Well done, $N. Your actions in the field are instrumental in our battle for Hellfire Peninsula.' WHERE `Id`=13408; -- Hellfire Fortifications +UPDATE `quest_template` SET `OfferRewardText`='I have to hand it to you, $N, you''re a fighter born! Those Horde yokels may never know how close they came to the end. It takes real character to step in harm''s way on behalf of your enemies. That''s the kind of honor and commitment that holds the Alliance together! $B$B +' WHERE `Id`=10396; -- Enemy of my Enemy... +UPDATE `quest_template` SET `OfferRewardText`='It is fortuitous that you intercepted this missive when you did, $N. Though it will take me some time to decipher, I can already sense the hatred and urgency woven into this scroll. I fear the Legion''s true motives in this land will soon be made evident...$B$BGive me a moment to decipher this script. $B$B +' WHERE `Id`=10395; -- The Dark Missive +UPDATE `quest_template` SET `OfferRewardText`='Are you certain of your choice, $N? The Aldor will welcome you as an ally, but the Scryers will not easily forgive your decision.' WHERE `Id`=10551; -- Allegiance to the Aldor +UPDATE `quest_template` SET `OfferRewardText`='Welcome back from your exercises, $N. I''m confident that you will make us proud when the competition starts.' WHERE `Id`=13749; -- A Valiant's Field Training +UPDATE `quest_template` SET `OfferRewardText`='It is good to know the people of this land still pay homage to the olden races. I bid you well, $N, and offer you this token...' WHERE `Id`=8654; -- Primestone the Elder +UPDATE `quest_template` SET `OfferRewardText`='Your spirit burns with life, young $c. I accept the homage you pay, and offer in return this token...' WHERE `Id`=8681; -- Thunderhorn the Elder +UPDATE `quest_template` SET `OfferRewardText`='Your spirit burns with life, young $c. I accept the homage you pay, and offer in return this token...' WHERE `Id`=8671; -- Ragetotem the Elder +UPDATE `quest_template` SET `OfferRewardText`='$N, you and your allies have spared the tournament from a devastating attack. Though our skytalon riders are brave, they have their hands full keeping the peace on the tournament grounds and would be hard-pressed to defend the skies against the cult''s attack. You have the thanks of the Argent Crusade and all who have gathered here to compete.' WHERE `Id`=13682; -- Threat From Above +UPDATE `quest_template` SET `OfferRewardText`='It is good to know the people of this land still pay homage to the olden races. I bid you well, $N, and offer you this token...' WHERE `Id`=13015; -- Fargal the Elder +UPDATE `quest_template` SET `OfferRewardText`='Your spirit burns with life, young $c. I accept the homage you pay, and offer in return this token...' WHERE `Id`=13028; -- Graymane the Elder +UPDATE `quest_template` SET `OfferRewardText`='It is good to know the people of this land still pay homage to the olden races. I bid you well, $N, and offer you this token...' WHERE `Id`=13020; -- Stonebeard the Elder +UPDATE `quest_template` SET `OfferRewardText`='Your spirit burns with life, young $c. I accept the homage you pay, and offer in return this token...' WHERE `Id`=13032; -- Muraco the Elder +UPDATE `quest_template` SET `OfferRewardText`='Your spirit burns with life, young $c. I accept the homage you pay, and offer in return this token...' WHERE `Id`=13027; -- Tauros the Elder +UPDATE `quest_template` SET `OfferRewardText`='It is good to know the people of this land still pay homage to the olden races. I bid you well, $N, and offer you this token...' WHERE `Id`=13013; -- Beldak the Elder +UPDATE `quest_template` SET `OfferRewardText`='Your spirit burns with life, young $c. I accept the homage you pay, and offer in return this token...' WHERE `Id`=13025; -- Lunaro the Elder +UPDATE `quest_template` SET `OfferRewardText`='Your spirit burns with life, young $c. I accept the homage you pay, and offer in return this token...' WHERE `Id`=13030; -- Whurain the Elder +UPDATE `quest_template` SET `OfferRewardText`='It is good to know the people of this land still pay homage to the olden races. I bid you well, $N, and offer you this token...' WHERE `Id`=13019; -- Thoim the Elder +UPDATE `quest_template` SET `OfferRewardText`='It is good to know the people of this land still pay homage to the olden races. I bid you well, $N, and offer you this token...' WHERE `Id`=13014; -- Morthie the Elder +UPDATE `quest_template` SET `OfferRewardText`='Your spirit burns with life, young $c. I accept the homage you pay, and offer in return this token...' WHERE `Id`=13031; -- Skywarden the Elder +UPDATE `quest_template` SET `OfferRewardText`='It is good to know the people of this land still pay homage to the olden races. I bid you well, $N, and offer you this token...' WHERE `Id`=13012; -- Sardis the Elder +UPDATE `quest_template` SET `OfferRewardText`='Your spirit burns with life, young $c. I accept the homage you pay, and offer in return this token...' WHERE `Id`=13033; -- Arp the Elder +UPDATE `quest_template` SET `OfferRewardText`='Your spirit burns with life, young $c. I accept the homage you pay, and offer in return this token...' WHERE `Id`=13029; -- Pamuya the Elder +UPDATE `quest_template` SET `OfferRewardText`='It is good to know the people of this land still pay homage to the olden races. I bid you well, $N, and offer you this token...' WHERE `Id`=13016; -- Northal the Elder +UPDATE `quest_template` SET `OfferRewardText`='It is good to know the people of this land still pay homage to the olden races. I bid you well, $N, and offer you this token...' WHERE `Id`=13018; -- Sandrene the Elder +UPDATE `quest_template` SET `OfferRewardText`='Your spirit burns with life, young $c. I accept the homage you pay, and offer in return this token...' WHERE `Id`=13024; -- Wanikaya the Elder +UPDATE `quest_template` SET `OfferRewardText`='Here is your Dalaran Jewelcrafter''s Token as promised. Come back tomorrow and I am sure I will have another item I need from you!' WHERE `Id`=12961; -- Shipment: Intricate Bone Figurine +UPDATE `quest_template` SET `OfferRewardText`='Your spirit burns with life, young $c. I accept the homage you pay, and offer in return this token...' WHERE `Id`=8684; -- Dreamseer the Elder +UPDATE `quest_template` SET `OfferRewardText`='You did it! $N, you are the champion of Zul''Drak!$B$BWe will never be able to repay the debt that we owe to you, but the Zandalari have given into my trust a number of objects they believe you might have an interest in.$B$BPlease, I want you to have a token of our appreciation, but hurry. I sense another issue of urgency!' WHERE `Id`=12730; -- Convocation at Zol'Heb +UPDATE `quest_template` SET `OfferRewardText`='Ay, mon. I been expectin'' you.$B$B$B$BTake a peek. Across dat tundra be death, mon... death.' WHERE `Id`=11634; -- Wind Master To'bor +UPDATE `quest_template` SET `OfferRewardText`='NO MERCY FOR THE DEAD!$B$BNone of ''em had the guts to stay behind to defend our glorious tanks after Hellscream deemed the coast ''condemned.'' It''s mostly quiet here, seein'' as how the Scourge are formin'' up ranks to assault Warsong Hold. Sometimes I get a stray zombie or ghoul, but they don''t last very long.$B$B$B$B''Course, there''s the mist...$B$B +' WHERE `Id`=11636; -- Magic Carpet Ride +UPDATE `quest_template` SET `OfferRewardText`='You''re the new tank driver, buddy? Fine by me! We just need to get these things up and running again. Yea, you try to go out into the Plains of Nasam without a tank and you''re as good as dead.' WHERE `Id`=11642; -- Tank Ain't Gonna Fix Itself +UPDATE `quest_template` SET `OfferRewardText`='Great work, buddy! Now where''d I put that pneumatic tank transjigamarig. +' WHERE `Id`=11644; -- Super Strong Metal Plates! +UPDATE `quest_template` SET `OfferRewardText`='$B$BRuin... That is all they leave in their wake. They must be taught a lesson.' WHERE `Id`=11655; -- Into the Mist +UPDATE `quest_template` SET `OfferRewardText`='Great work, buddy! Now where''d I put those spare parts...' WHERE `Id`=11643; -- Mobu's Pneumatic Tank Transjigamarig +UPDATE `quest_template` SET `OfferRewardText`='It seems that the loss of their lieutenant has only stirred the nest. They are more angry and aggressive than before!$B$B$B$BYou''ve done what you can here, friend. At the very least you deserve some form of compensation for thinning their numbers. +' WHERE `Id`=11661; -- Orabus the Helmsman +UPDATE `quest_template` SET `OfferRewardText`='This is it? Hellscream sent a single $r $g boy:girl;?$B$BIf I still had a jaw it would be on the floor right now.' WHERE `Id`=11618; -- Reinforcements Incoming... +UPDATE `quest_template` SET `OfferRewardText`='Most of them made it back. The ones smart enough to know that we''re inside the gigantic metal and stone building, anyway...$B$BRegardless, a job well done. I hear you sprung more than a couple peons loose.$B$BOh yes, you''re the talk of the... um... fortress.' WHERE `Id`=11611; -- Taken by the Scourge +UPDATE `quest_template` SET `OfferRewardText`='Kel''Thuzad? So it''s true - Naxxramas returns...$B$BPerhaps I underestimated you, $N. You''ve done the Horde a great service. The Warchief would be proud!$B$B$B$BIf Kel''Thuzad is controlling these Scourge, there''s no telling what else the Lich King has in store for us... I''ll need time to think through this new information, $N. You are dismissed.' WHERE `Id`=11652; -- The Plains of Nasam +UPDATE `quest_template` SET `OfferRewardText`='You are foolish to come here, little $r.$B$BWhat is it that you seek?' WHERE `Id`=11624; -- The Sky Will Know +UPDATE `quest_template` SET `OfferRewardText`='I am pleased, though no doubt they will still continue to quarrel a bit longer.$B$BHowever, there is something else that you will need to accomplish before you can return to your spirit talker.' WHERE `Id`=11627; -- Boiling Point +UPDATE `quest_template` SET `OfferRewardText`='I regret the loss of those tempests, but my word is my bond... even to a mortal such as yourself.$B$BNow, let us see if we can fashion something of use to you.' WHERE `Id`=11649; -- Motes of the Enraged +UPDATE `quest_template` SET `OfferRewardText`='Imperean gave you a primal essence of herself? I can hear its howling winds!$B$BI know a ritual we can make use of it in. We must hurry before her primal rips itself apart!' WHERE `Id`=11629; -- Return to the Spirit Talker +UPDATE `quest_template` SET `OfferRewardText`='They''ve shackled his spirit. $N, we have to put an end to his torture!$B$BYou must descend into the bowels of Magmoth and find a way to free him!' WHERE `Id`=11631; -- Vision of Air +UPDATE `quest_template` SET `OfferRewardText`='These are for me? Is this some sort of $r trick? No?$B$BWell then, thank you! Come back any time that you have more clams, and we''ll do business!' WHERE `Id`=11559; -- Winterfin Commerce +UPDATE `quest_template` SET `OfferRewardText`='It does not surprise me that the orc chieftain does not have time to hear of our troubles. The ambassador''s efforts will likely be like so much mist blowing in the wind.$B$BBut you are here now. We shall see if he chose well in sending you.' WHERE `Id`=11888; -- Ride to Taunka'le Village +UPDATE `quest_template` SET `OfferRewardText`='It is good to know the people of this land still pay homage to the olden races. I bid you well, $N, and offer you this token...' WHERE `Id`=8652; -- Graveborn the Elder +UPDATE `quest_template` SET `OfferRewardText`='May you find what you''re looking for, $g brother:sister;.' WHERE `Id`=24819; -- A Change of Heart +UPDATE `quest_template` SET `OfferRewardText`='At last, we have live specimens to study! You have helped to save countless lives this day, $N.$B$BPlease, take this as a token of thanks for this great deed.' WHERE `Id`=24873; -- Residue Rendezvous +UPDATE `quest_template` SET `OfferRewardText`='You continue to prove yourself, $N. Accept this, not as a gift, but as a tool for the fight against the Scourge.' WHERE `Id`=24823; -- Path of Destruction +UPDATE `quest_template` SET `OfferRewardText`='May you find what you''re looking for, $g brother:sister;.' WHERE `Id`=24840; -- A Change of Heart +UPDATE `quest_template` SET `OfferRewardText`='The giant is dead? Praise the Light!$B$BThe way onward and upward is clear. Take some of these spoils of the battle as a token of our gratitude, and we will drink together in celebration once the Frozen Throne has been ground to dust!' WHERE `Id`=24871; -- Securing the Ramparts +UPDATE `quest_template` SET `OfferRewardText`='I trust that you did not have to face too many of his iron construct assistants?' WHERE `Id`=24587; -- Ignis the Furnace Master Must Die! +UPDATE `quest_template` SET `OfferRewardText`='Now that is what I call dedication! Those traitors might have a new master now, but they''ll never forget their sisters'' parting gift.' WHERE `Id`=12953; -- Valkyrion Must Burn +UPDATE `quest_template` SET `OfferRewardText`='The val''kyr are nothing but the Lich King''s lapdogs. They will be put down like the scum they are. They''ve made their choice, now they have to live with the consequences.' WHERE `Id`=12942; -- Off With Their Black Wings +UPDATE `quest_template` SET `OfferRewardText`='Yulda had it coming. No one gets away with insulting the Hyldsmeet. Not even one of our own.' WHERE `Id`=12968; -- Yulda's Folly +UPDATE `quest_template` SET `OfferRewardText`='You have our thanks, sister. We cannot allow our valiant traditions to be corrupted.' WHERE `Id`=12925; -- Aberrations +UPDATE `quest_template` SET `OfferRewardText`='Your efforts appear to have been successful, sister.$b$bYou have brought glory to the Brunnhildar!' WHERE `Id`=12856; -- Cold Hearted +UPDATE `quest_template` SET `OfferRewardText`='So, sister, you think that completing a few simple chores makes you a heroine?$b$bYou shall learn....' WHERE `Id`=13063; -- Deemed Worthy +UPDATE `quest_template` SET `OfferRewardText`='These will do nicely. I''ll have the harness ready for you in no time.' WHERE `Id`=12900; -- Making a Harness +UPDATE `quest_template` SET `OfferRewardText`='I''m impressed. I never thought I would see an icemaw matriarch again. Especially not one this size.' WHERE `Id`=12983; -- The Last of Her Kind +UPDATE `quest_template` SET `OfferRewardText`='The jormungar are vile creatures. You did well in destroying them.' WHERE `Id`=12989; -- The Slithering Darkness +UPDATE `quest_template` SET `OfferRewardText`='Not bad. I was hoping Kirgaraak would snap your neck so I could keep your bear.$B$BJust joking, sister. Well... half-joking. That''s a really nice bear you''ve got.' WHERE `Id`=12996; -- The Warm-Up +UPDATE `quest_template` SET `OfferRewardText`='You really did it! You made it out with your health. Wish we could say the same for your bear.$B$BIt''s going to take a while for her to recover. Fortunately you won''t need her for a while.' WHERE `Id`=12997; -- Into the Pit +UPDATE `quest_template` SET `OfferRewardText`='You''ve really made it this far. Never would I have thought you''d progress so quickly among the hyldnir.' WHERE `Id`=13061; -- Prepare for Glory +UPDATE `quest_template` SET `OfferRewardText`='Are you ready to ride, sister? There is no coming back.' WHERE `Id`=13062; -- Lok'lira's Parting Gift +UPDATE `quest_template` SET `OfferRewardText`='Your bravery seems boundless, $N.$B$BPlease hand me the heart and the essence, and I will fashion them into that which will compel the prophet to appear before you.' WHERE `Id`=12729; -- The Gods Have Spoken +UPDATE `quest_template` SET `OfferRewardText`='Above the stale, unwashed stench, you catch a whiff of a familiar smell! It appears as if this once-mighty adventurer has a real love for kungaloosh.$b$bPeeking through the bars, you can barely make out the recipe written on his arm....' WHERE `Id`=13571; -- Fletcher's Lost and Found +UPDATE `quest_template` SET `OfferRewardText`='Desecrate the Horde''s Ghostlands bonfire!' WHERE `Id`=11774; -- Desecrate this Fire! +UPDATE `quest_template` SET `OfferRewardText`='Oh, bless ya, $N, bless ya!$B$BJust set ''em down right where yer standin''. I''ll have one o'' the boys come load ''em up soon enough and we can stop worryin'' ''bout runnin'' out o'' balls ta shoot at Skorn.' WHERE `Id`=11190; -- One Size Does Not Fit All +UPDATE `quest_template` SET `OfferRewardText`='This will make a fine meal for the men.$B$B$B$BHere, $g boy : deary;, take some for yourself. You look like you could use some more meat on your bones!' WHERE `Id`=11155; -- Shoveltusk Soup Again? +UPDATE `quest_template` SET `OfferRewardText`='Incredible! What skill!$B$BThought you''d be easy prey, $N. Got me good, you did.$B$BHere''s the coin I promised... not as much as I said it''d be, but that''s on a count o'' me lying to ya in the first place.' WHERE `Id`=590; -- A Rogue's Deal +UPDATE `quest_template` SET `OfferRewardText`='Honor the Tirisfal Glades flame.' WHERE `Id`=11862; -- Honor the Flame +UPDATE `quest_template` SET `OfferRewardText`='Captain Perrine''s death will undoubtedly please The Dark Lady. You have performed your duty well, $c.' WHERE `Id`=370; -- At War With The Scarlet Crusade +UPDATE `quest_template` SET `OfferRewardText`='Varimathras would be proud. You serve your leaders well, $c.' WHERE `Id`=374; -- Proof of Demise +UPDATE `quest_template` SET `OfferRewardText`='It is troubling to hear of the Scourge slipping past the Bulwark. The Lich King and his minions are ceaseless in their assaults.$B$BBut we will not give in. He will not take us again!' WHERE `Id`=360; -- Return to the Magistrate +UPDATE `quest_template` SET `OfferRewardText`='Captain Vachon''s death will slow down the Scarlet Crusade''s advancement in Tirisfal quite a bit. But other threats loom.' WHERE `Id`=371; -- At War With The Scarlet Crusade +UPDATE `quest_template` SET `OfferRewardText`='The ore gave you a strange feeling? Maybe we won''t use that stuff after all.$B$B$B$BThose gems look really nice! I wonder what I can get for them? Of course, there are always repairs, and new stuff to be made.$B$BYou know, I''ve really found working with you to be profitable. Take this... it''s the least that I can do!' WHERE `Id`=11218; -- Danger! Explosives! +UPDATE `quest_template` SET `OfferRewardText`='Well timed, $c!$B$BThe Pit of Saron lies ahead, and if our scouts are correct, past that will be the Halls of Reflection. It is there that Arthas lets his guard down, and it is there that we hope to find a clue to his weakness... and a route to vengeance long overdue.' WHERE `Id`=24511; -- Echoes of Tortured Souls +UPDATE `quest_template` SET `OfferRewardText`='Incapable fools. I begin to wonder if any of these louts from the tournament will be of any use at all. Perhaps you''ll prove me wrong.' WHERE `Id`=24682; -- The Pit of Saron +UPDATE `quest_template` SET `OfferRewardText`='You''ve done well this day. With many of the slaves freed and now with access to the forges, it will not be long before I have a strong force to aid in delivering us from Scourgelord Tyrannus and this foul pit.' WHERE `Id`=24507; -- The Path to the Citadel +UPDATE `quest_template` SET `OfferRewardText`='The Halls of Reflection lie ahead. If what that vile gnome said is to be trusted, Frostmourne should be there, and with it, answers to confronting Arthas.' WHERE `Id`=24712; -- Deliverance from the Pit +UPDATE `quest_template` SET `OfferRewardText`='The Halls of Reflection. Finally.$B$BLet me know when you are ready, $c. I will not be so naive as to think that Arthas left his precious sword entirely unguarded.' WHERE `Id`=24713; -- Frostmourne +UPDATE `quest_template` SET `OfferRewardText`='Yet again, vengeance slips through my grasp. It''s hard to believe how much stronger he''s gotten.$B$BIt was foolish of you to come for me, but it''s good to know that there are still some champions of the Horde that aren''t useless cowards. The information Uther gave us may well be key to finally killing Arthas, though it is becoming more and more clear that the Horde will not be able to accomplish this on their own.$B$BGo, $c. I expect your prowess may be needed again very soon.' WHERE `Id`=24802; -- Wrath of the Lich King +UPDATE `quest_template` SET `OfferRewardText`='Excellent! This will help fuel the flames of war for days to come. ' WHERE `Id`=236; -- Fueling the Demolishers +UPDATE `quest_template` SET `OfferRewardText`='You continue to prove yourself, $N. Accept this, not as a gift, but as a tool for the fight against the Scourge.' WHERE `Id`=24828; -- Path of Destruction +UPDATE `quest_template` SET `OfferRewardText`='Stew looks good. Thanks for your help.' WHERE `Id`=13114; -- Sewer Stew +UPDATE `quest_template` SET `OfferRewardText`='I have never seen such terror in the eyes of a vrykul. They think themselves masters of their world.$B$BYou and I are going to prove them wrong. Very wrong.' WHERE `Id`=13091; -- The Art of Being a Water Terror +UPDATE `quest_template` SET `OfferRewardText`='It''s about damned time! No doubt that Baron Sliver took his sweet time in sending you to me.$B$BI should have that empty space above his shoulders removed!' WHERE `Id`=12806; -- To the Rise with all Due Haste! +UPDATE `quest_template` SET `OfferRewardText`='In their folly, the Argent Crusade has chosen to turn a blind eye upon the presence of the Scarlet Onslaught. We will not.$B$BWe do not care if they might assist in the battle against the Lich King. We do not believe them worthy of existence. We will be their end, once and for all!' WHERE `Id`=12807; -- The Story Thus Far... +UPDATE `quest_template` SET `OfferRewardText`='I thought so! I couldn''t quite make out the destruction from here, but I can imagine how it must have looked. Splendid!$B$BWell done, $n. Thrallmar command will be happy to hear of your success!' WHERE `Id`=10087; -- Burn It Up... For the Horde! +UPDATE `quest_template` SET `OfferRewardText`='Well done, $C, That''s one less forge camp we''ll need to worry about. It''ll take the Legion a while to get that facility back up and running. You''ve just bought us the one thing we''d run out of - time. +' WHERE `Id`=10390; -- Forge Camp: Mageddon +UPDATE `quest_template` SET `OfferRewardText`='Now Veranus can finally rest in peace.' WHERE `Id`=24586; -- Razorscale Must Die! +UPDATE `quest_template` SET `OfferRewardText`='That will keep our recruits fed! Here''s how you cook it.' WHERE `Id`=13088; -- Northern Cooking +UPDATE `quest_template` SET `OfferRewardText`='Honor the Stranglethorn Vale flame.' WHERE `Id`=11832; -- Honor the Flame +UPDATE `quest_template` SET `OfferRewardText`='As a hero of the Stormpike, you may choose one item from these recently plun... er, recovered treasures.' WHERE `Id`=8271; -- Hero of the Stormpike +UPDATE `quest_template` SET `OfferRewardText`='You are brave to have carried this. If even one drop were to touch your skin, you''d have died an agonizing death.$b$bAllow me to pay you for it... I can always use venom of exceptional potency.' WHERE `Id`=13845; -- Sealed Vial of Poison +UPDATE `quest_template` SET `OfferRewardText`='Well done, $N. I''ll take these to the Argent Crusade''s keepers right away. They''ll have no choice but to acknowledge that we''re doing far more than the Sunreavers to keep the coliseum running smoothly.' WHERE `Id`=14076; -- Breakfast Of Champions +UPDATE `quest_template` SET `OfferRewardText`='He''s a fine specimen and will serve us well.$B$BNow, we have to make sure to use him properly to trap Vardmadra!' WHERE `Id`=13133; -- Find the Ancient Hero +UPDATE `quest_template` SET `OfferRewardText`='$B$BThank you. The book was a gift from Confessor Paletress herself. She would be honored to know that you have used it to bring tranquility to the slain.' WHERE `Id`=14077; -- The Light's Mercy +UPDATE `quest_template` SET `OfferRewardText`='At last, we can finally fish in peace! ''Course, by the time we catch anything, the expedition''ll arrive and claim it all for themselves.$B$BYou have our thanks, $N. Don''t be a stranger ''round here.' WHERE `Id`=11410; -- The One That Got Away +UPDATE `quest_template` SET `OfferRewardText`='$B$BIt is good to finally meet you, $N. We have long hoped that you and the other newcomers might send representatives. We don''t often venture beyond the borders of our glades, especially amid the changes the land is going through.' WHERE `Id`=11302; -- The Enigmatic Frost Nymphs +UPDATE `quest_template` SET `OfferRewardText`='$B$BThank you, $N.$B$B$B$BI promise, my friends, I will do all I can to restore you.' WHERE `Id`=11313; -- Spirits of the Ice +UPDATE `quest_template` SET `OfferRewardText`='Thank you for your help, $N. The Vibrant Glade was once a beautiful place, and when we return to it, we shall make it so again.' WHERE `Id`=11315; -- Wild Vines +UPDATE `quest_template` SET `OfferRewardText`='So there is hope for my sisters?$B$B$B$BI feel guilty for not thinking of the pendant sooner. We might have saved even more of the sisters.' WHERE `Id`=11314; -- The Fallen Sisters +UPDATE `quest_template` SET `OfferRewardText`='Thank goodness! This should be enough to finish the order in time. Of course, I won''t sleep until the troops arrive, but that''s far better than risking Captain Adams'' wrath.$B$BI''ve heard the stories they tell about him!' WHERE `Id`=11269; -- Down to the Wire +UPDATE `quest_template` SET `OfferRewardText`='$B$BNicely done. Some of these will fetch a better price than others, but I should have plenty to trade with the locals.' WHERE `Id`=11292; -- Preying Upon the Weak +UPDATE `quest_template` SET `OfferRewardText`='Beaut! Yer a good one you are.$B$BTilt one back wi'' me! Let us celebrae'' this glorious find!' WHERE `Id`=12870; -- Ancient Relics +UPDATE `quest_template` SET `OfferRewardText`='Medical supplies? Thank you! Not exactly sure what to do with them to be honest, but I''m sure they''ll be useful.$B$BIt''s good to meet you... there''s such a colorful variety among your peoples. We''re not used to having visitors up this way very often - it''s good to have some fresh company.' WHERE `Id`=12863; -- Offering Thanks +UPDATE `quest_template` SET `OfferRewardText`='$B$BYou were supposed to come back with Brann, not a piece of paper. What''s going on here?' WHERE `Id`=12854; -- On Brann's Trail +UPDATE `quest_template` SET `OfferRewardText`='When a scout doesn''t come back for this long... that''s about the expected result. The harpies then?$B$BKing Stormheart has us train hard year round... he''s turned us into amazing fighters. At times like this, I understand why it''s necessary. He''s the wisest and strongest leader I''ve yet seen among our people... don''t let his peachy skin fool ya.' WHERE `Id`=12864; -- Missing Scouts +UPDATE `quest_template` SET `OfferRewardText`='Good stuff, $G lad:lass;. You''re making fast friends.$B$BIf you stop back by soon, I''m sure we can find one that will let you ride... they should know that you''re trustworthy now.' WHERE `Id`=12867; -- Baby Stealers +UPDATE `quest_template` SET `OfferRewardText`='It''s done then. Thank you.$B$BI''ve spoken with Fjorlin - he said that his men will take charge of keeping the harpies down a bit. As long as we don''t let up again, they won''t find the courage to think they can attack our people.$B$BI know this wasn''t the most tasteful work - take this as a token of my appreciation.' WHERE `Id`=12868; -- Sirana Iceshriek +UPDATE `quest_template` SET `OfferRewardText`='That''s one less thorn in our side. With Noth destroyed, Scourge research into refining the means of creating the undead will grind to a halt.' WHERE `Id`=24581; -- Noth the Plaguebringer Must Die! +UPDATE `quest_template` SET `OfferRewardText`='I underestimated this Scourgelord, and it''s my men that paid for it. When I think that my guilt over Arthas'' betrayal cannot go any deeper, he proves me wrong yet again.$B$BWe have to press on. We cannot let their sacrifice be meaningless.' WHERE `Id`=24683; -- The Pit of Saron +UPDATE `quest_template` SET `OfferRewardText`='You''ve done well this day. With many of the slaves freed and now with access to the forges, it will not be long before I have a strong force to aid in delivering us from Scourgelord Tyrannus and this foul pit.' WHERE `Id`=24498; -- The Path to the Citadel +UPDATE `quest_template` SET `OfferRewardText`='Such a senseless waste! Arthas goes too far! I can only hope what we find in the Halls of Reflection makes this somehow worth it.$B$BIf what that vile gnome said is to be trusted, Frostmourne should be there, and with it, answers to confronting Arthas.' WHERE `Id`=24710; -- Deliverance from the Pit +UPDATE `quest_template` SET `OfferRewardText`='The Halls of Reflection. Finally.$B$BLet me know when you are ready. Arthas may not be here, but it would be naive to think that he would leave Frostmourne unguarded entirely.' WHERE `Id`=24711; -- Frostmourne +UPDATE `quest_template` SET `OfferRewardText`='$B$BHave you ever ridden one of those? It''s simple, friend. Just hop on and tell it where to go. +' WHERE `Id`=12235; -- Naxxramas and the Fall of Wintergarde +UPDATE `quest_template` SET `OfferRewardText`='$B$BI can barely believe we''re still alive. It was foolish of me to follow him. I''ve made that mistake too many times. And you... it was reckless of you to come after me instead of escaping with the information! But... well... thank you. You truly are a hero.$B$BWith Uther''s guidance, we may stand a chance at defeating Arthas. All the lives lost today were not in vain.' WHERE `Id`=24500; -- Wrath of the Lich King +UPDATE `quest_template` SET `OfferRewardText`='$B$BSo Valduran''s master has given him this sinister metal to construct a giant weapon? That must be what he intends to use for the final strike against us! We need to stop him before he''s able to complete it and unleash this weapon.' WHERE `Id`=12980; -- The Armor's Secrets +UPDATE `quest_template` SET `OfferRewardText`='$B$BI had no idea the irons were capable of this! Our men will have no chance against this behemoth if it''s completed. Fortunately, it looks like they''re still lacking a key part.' WHERE `Id`=12993; -- A Colossal Threat + +-- RequestItemsText +UPDATE `quest_template` SET `RequestItemsText`='How might I be of service to you, young one? Are you here to rest in the inn? Do you require a hearthstone?' WHERE `Id`=2159; -- Dolanaar Delivery +UPDATE `quest_template` SET `RequestItemsText`='Yes, young one? What can Kauth do for you?$B$BThe journey here from the Mesa can be a tremendous burden for some, but a welcome sight for others. Which is it for you, I wonder?' WHERE `Id`=1656; -- A Task Unfinished +UPDATE `quest_template` SET `RequestItemsText`='It takes a lot of work to be the strongest woman alive! My weight set is getting too light and if I''m to stay fit then I''ll need more weights!$B$BDo you think you could bring me some weight stones? If you do, then I''ll give you a Darkmoon Faire ticket.' WHERE `Id`=7889; -- Coarse Weightstone +UPDATE `quest_template` SET `RequestItemsText`='The first lesson in drawing a crowd is: lure them with gadgets and trinkets! Can you help me?$B$BI need small furry paws to use for prizes. You can find those on the cats of the Barrens or Darkshore....$B$BBring me some paws and I''ll trade you a Darkmoon Faire ticket for them.' WHERE `Id`=7899; -- Small Furry Paws +UPDATE `quest_template` SET `RequestItemsText`='Yebb is developing a new attraction for the Zoo Bizarre, one that will drive people crazy with wonder, and delight! But it will take a lot of work, and a lot of materials...$B$BThat includes copper modulators. We need lots of modulators for the mechanical parts of the attraction. Bring me copper modulators and I''ll trade for them with a Darkmoon Faire ticket.' WHERE `Id`=7894; -- Copper Modulator +UPDATE `quest_template` SET `RequestItemsText`='We at the Darkmoon Faire do much walking. We walk from one faire site to another... in fact, you''ll never see us sitting down on the job! So it is no surprise that we wear out quite a lot of boots! We need boots that are both durable and stylish, and embossed leather boots fit that bill rather well.$B$BYou! You''re a leatherworker; make me embossed leather boots and I''ll give you a Darkmoon Faire ticket for the work.' WHERE `Id`=7881; -- Carnival Boots +UPDATE `quest_template` SET `RequestItemsText`='King Varian has placed great importance on learning, and thus has provided funds for making copies of various tomes and writings available to the public. It''s very simple. You bring me a library scrip, and I can give you a copy of one of the available books.' WHERE `Id`=579; -- Stormwind Library +UPDATE `quest_template` SET `RequestItemsText`='My runes, $N? Do you have them?' WHERE `Id`=12841; -- The Crone's Bargain +UPDATE `quest_template` SET `RequestItemsText`='You will be richly rewarded for your service to me.$B$B$B$BYou will not regret unfettering me.' WHERE `Id`=13308; -- Mind Tricks +UPDATE `quest_template` SET `RequestItemsText`='Do you have 8 Trogg Stone Teeth to show me? If not, there is still work to be done, $N.' WHERE `Id`=267; -- The Trogg Threat +UPDATE `quest_template` SET `RequestItemsText`='You appear to have uncovered the wreckage of... a robotic chicken? The voice from within the egg crackles to life again:$B$B\"Yes, excellent work! This is indeed my homing robot, though my sensors indicate that it needs a jump start before it can fly back to Booty Bay for repairs. Go ahead and place the beacon inside the rover. The beacon will take care of the rest!\"' WHERE `Id`=351; -- Find OOX-17/TN! +UPDATE `quest_template` SET `RequestItemsText`='Got the five Wastewander water pouches we need? If you do, then the Gadgetzan Water Company Care Package, Model 103-XB, will be yours!' WHERE `Id`=1707; -- Water Pouch Bounty +UPDATE `quest_template` SET `RequestItemsText`='Yes $c, I am an official of the Gadgetzan Water Company. What can I assist you with?' WHERE `Id`=2781; -- WANTED: Caliph Scorpidsting +UPDATE `quest_template` SET `RequestItemsText`='You look a little dazed. Have you been reading our legal documents?' WHERE `Id`=2875; -- WANTED: Andre Firebeard +UPDATE `quest_template` SET `RequestItemsText`='The cries seem somehow... fainter than they were before. The Light grant it''s more than wishful thinking.' WHERE `Id`=10047; -- The Path of Glory +UPDATE `quest_template` SET `RequestItemsText`='The Legion could start shelling the Horde at any time, $N! You need to destroy those blasted cannons! +' WHERE `Id`=10396; -- Enemy of my Enemy... +UPDATE `quest_template` SET `RequestItemsText`='Do you have the broodling essence, $N? I can''t wait to study it.$B$BAnd besides that... my patron is not the type of person you want to disappoint.' WHERE `Id`=4726; -- Broodling Essence +UPDATE `quest_template` SET `RequestItemsText`='Hey, $N. Been to the Grizzled Den yet? Those Wendigos can be fierce.' WHERE `Id`=313; -- The Grizzled Den +UPDATE `quest_template` SET `RequestItemsText`='Preparations are going well. How goes your hunting?' WHERE `Id`=317; -- Stocking Jetsteam +UPDATE `quest_template` SET `RequestItemsText`='Hmph! There is all this booze down here, but I have strict orders not to touch it. If only I could get a taste of some of our Thunder Ale...that would sharpen my wits, no lying!' WHERE `Id`=308; -- Distracting Jarven +UPDATE `quest_template` SET `RequestItemsText`='Do you have that shimmerweed? I almost have a batch of stout ready to brew, and I want to try throwing the weed in with this mixture.' WHERE `Id`=315; -- The Perfect Stout +UPDATE `quest_template` SET `RequestItemsText`='Hello, $C! And what business takes you all the way out here?$B$BSomething exciting, I hope. I haven''t been in a good fight in days, and this barrel of ale is almost dry...' WHERE `Id`=413; -- Shimmer Stout +UPDATE `quest_template` SET `RequestItemsText`='I see you are back, $c. Have you collected 10 Red Wool Bandanas from those Defias Scum in The Stockade yet?' WHERE `Id`=388; -- The Color of Blood +UPDATE `quest_template` SET `RequestItemsText`='Loch Modan is under siege, $N! We need every able-bodied member of the Alliance to aid our cause. Have you killed 10 Stonesplinter Troggs and 10 Stonesplinter Scouts yet?' WHERE `Id`=224; -- In Defense of the King's Lands +UPDATE `quest_template` SET `RequestItemsText`='I know my plan was brilliant. Don''t even worry about it.$B$BDoes it feel good to be in the presence of greatness? A little tingly maybe?' WHERE `Id`=12828; -- Ample Inspiration +UPDATE `quest_template` SET `RequestItemsText`='If Janks were here, I could have just sent him on this errand. Oh... on second thought... I''m not sure I told him where the safe path is anyway.$B$BGood thing I have you resourceful adventure types around, eh?' WHERE `Id`=12819; -- Just Around the Corner +UPDATE `quest_template` SET `RequestItemsText`='Hi there. Do you have something for me?' WHERE `Id`=13836; -- Disarmed! +UPDATE `quest_template` SET `RequestItemsText`='Stand easy, $N. What have you to report? +' WHERE `Id`=13139; -- Into The Frozen Heart Of Northrend +UPDATE `quest_template` SET `RequestItemsText`='Well met, $c. I knew that you would return, despite my warnings, but I''m pleased that you heeded my desire to not risk anyone else.$B$BWhy have you come back to me?' WHERE `Id`=13075; -- The Boon of Remulos +UPDATE `quest_template` SET `RequestItemsText`='You want to talk about the bounty for Haghazed? Well, is he dead? There isn''t much else to talk about!' WHERE `Id`=9730; -- Leader of the Darkcrest +UPDATE `quest_template` SET `RequestItemsText`='We have to have something we can use to insulate our engines against this cold... think, Jeer, think!$B$BOh hey! Did you get some of that wreckage for me?' WHERE `Id`=12818; -- Clean Up +UPDATE `quest_template` SET `RequestItemsText`='Any luck with our equipment, $N?' WHERE `Id`=12844; -- Equipment Recovery +UPDATE `quest_template` SET `RequestItemsText`='Hello, $c. What have you there? Is it for me?' WHERE `Id`=9409; -- Urgent Delivery! +UPDATE `quest_template` SET `RequestItemsText`='Hello, $c. Do you have those flowers yet?' WHERE `Id`=9799; -- Botanical Legwork +UPDATE `quest_template` SET `RequestItemsText`='I''ll need all of the samples in good condition if we''re to have a chance of cleansing the lake.$B$BWe don''t have much time, $c!' WHERE `Id`=9293; -- What Must Be Done... +UPDATE `quest_template` SET `RequestItemsText`='The more we can do to clear up Nestlewood, the faster Zhanaa can get back to work.' WHERE `Id`=9303; -- Inoculation +UPDATE `quest_template` SET `RequestItemsText`='Together, the Broken and the draenei will regain a deeper understanding of the mysteries that the elements hold.$B$BHave you returned with that which is necessary for the creation of your earth totem?' WHERE `Id`=9451; -- Call of Earth +UPDATE `quest_template` SET `RequestItemsText`='The stag hides are frail which tend to make for tender, succulent flesh.' WHERE `Id`=9454; -- The Great Moongraze Hunt +UPDATE `quest_template` SET `RequestItemsText`='Do not waste time, $g boy:girl;.' WHERE `Id`=9473; -- An Alternative Alternative +UPDATE `quest_template` SET `RequestItemsText`='Have you done what I asked of you, $N?' WHERE `Id`=11913; -- Take No Chances +UPDATE `quest_template` SET `RequestItemsText`='Reporting from Honor Hold, $n? That''s good -- our campaign against the demons and the fel orcs is running thin on able bodies!' WHERE `Id`=10483; -- Ill Omens +UPDATE `quest_template` SET `RequestItemsText`='The ring, $N! Please... tell me you''ve found it!' WHERE `Id`=12624; -- It Could Be Anywhere! +UPDATE `quest_template` SET `RequestItemsText`='You find anything yet, $N?' WHERE `Id`=12699; -- An Embarassing Incident +UPDATE `quest_template` SET `RequestItemsText`='Any luck with the bloodtooth? Don''t forget what I told you about making blood pools.' WHERE `Id`=13833; -- Blood Is Thicker +UPDATE `quest_template` SET `RequestItemsText`='What is it that you''ve found, $N?' WHERE `Id`=24442; -- Battle Plans Of The Kvaldir +UPDATE `quest_template` SET `RequestItemsText`='Watch where you''re stepping! Watch watch watch!! This is delicate stuff you see here, and if we''re to win then it must all work perfectly!' WHERE `Id`=1179; -- The Brassbolts Brothers +UPDATE `quest_template` SET `RequestItemsText`='Tell me, $N, has the deed been done? Has the Legionlord been vanquished? +' WHERE `Id`=10400; -- Overlord +UPDATE `quest_template` SET `RequestItemsText`='We need to get this information to the Alliance! It may well be the key to Arthas'' defeat.' WHERE `Id`=24500; -- Wrath of the Lich King +UPDATE `quest_template` SET `RequestItemsText`='We are currently accepting donations for wool cloth. A donation of sixty pieces of wool cloth will net you full recognition by the Gnomeregan Exiles for your generous actions. Our stores are such on wool that we would only need sixty pieces from you total; we should be able to acquire enough from others in the realm to support our drive.$B$BIf you have the sixty pieces of wool cloth on you and are ready to donate them, I''m able to take them from you now.' WHERE `Id`=7807; -- A Donation of Wool +UPDATE `quest_template` SET `RequestItemsText`='As with most other fabrics, our stocks of silk are at an all-time low. Our stores are such that we''d only need sixty pieces of silk from you total; we should be able to reach our goal with the support of others.$B$BA benevolent gift such as silk, might I add, would certainly increase your local standing in the community! If you have the sixty pieces of silk cloth on you and are ready to donate them, I''m able to take them from you now.' WHERE `Id`=7808; -- A Donation of Silk +UPDATE `quest_template` SET `RequestItemsText`='$B$BDon''t just stand there, grab some oil and a luffa and get to scrubbin'' these bunions.$B$BYe don''t have a luffa? Well then! Perhaps it''s time I sent you out to find a luffa?$B$BHey, where are ye goin''?' WHERE `Id`=7727; -- Incendosaurs? Whateverosaur is More Like It +UPDATE `quest_template` SET `RequestItemsText`='Eight, $N. I need eight! ' WHERE `Id`=3443; -- Forging the Shaft +UPDATE `quest_template` SET `RequestItemsText`='Don''t let the crazy goggles fool you, $N. I''m the smart one here.' WHERE `Id`=7702; -- Kill 'Em With Sleep Deprivation +UPDATE `quest_template` SET `RequestItemsText`='Let''s not waste more of my precious time with jibber jabber, $r. It''s time to focus on replenishing our dwindling fiery flux supply.$B$BWhat I''m gonna need from you is the following:$B$B*Incendosaur scales.$B$B*Heavy Leather.$B$B*Coal.$B$BI''ll take all that you can offer!$B$BAnd you''ll do it fast if you wanna get in good with the Brotherhood. +' WHERE `Id`=8242; -- Restoring Fiery Flux Supplies via Heavy Leather +UPDATE `quest_template` SET `RequestItemsText`='You''ve worked your way up through the Brotherhood''s corporate hierarchy, $r. We have begun to look favorably upon you. Quite an accomplishment!$B$BIf you''re interested in more work and earning more respect amongst us, listen up.$B$BWe can refine the fiery flux by adding a simple Dark Iron residue to the mix. The Dark Iron residue can be found in Blackrock Depths.$B$BBring me all the Dark Iron residue you find!' WHERE `Id`=7737; -- Gaining Even More Acceptance +UPDATE `quest_template` SET `RequestItemsText`='You''ve worked your way up through the Brotherhood''s corporate hierarchy, $r. We have begun to look favorably upon you. Quite an accomplishment!$B$BIf you''re interested in more work and earning more respect amongst us, listen up.$B$BWe can refine the fiery flux by adding a simple Dark Iron residue to the mix. The Dark Iron residue can be found in Blackrock Depths.$B$BBring me all the Dark Iron residue you find!' WHERE `Id`=13662; -- Gaining Acceptance +UPDATE `quest_template` SET `RequestItemsText`='The Thorium Brotherhood sympathizes with your plight, $r. This is why Lokthos has been empowered to bargain.$B$BOffer 1 Lava Core and you shall be granted favor amongst the Brotherhood.' WHERE `Id`=6644; -- Favor Amongst the Brotherhood, Lava Core +UPDATE `quest_template` SET `RequestItemsText`='No ordinary tributes were good enough for the great Hodir when he walked among the frost giants.$B$BHe might not be with us anymore, but we''ve kept the tradition of offering tribute to his strength and wisdom. It would do much for your renown to partake in this tradition, small $c.' WHERE `Id`=13559; -- Hodir's Tribute +UPDATE `quest_template` SET `RequestItemsText`='Did you obtain the eggs, $N?' WHERE `Id`=13050; -- Veranus +UPDATE `quest_template` SET `RequestItemsText`='The power of this chapel gives me the strength to resist the corruption in my heart. If I leave it, I will become a death knight. But there is a medallion, the medallion of faith, that will give me the strength I need to leave.$B$BPlease, $N, retrieve the medallion. It is guarded by Malor the Zealous, a crazed member of the Scarlet Crusade who resides deep in the Scarlet Bastion in western Stratholme.' WHERE `Id`=5122; -- The Medallion of Faith +UPDATE `quest_template` SET `RequestItemsText`='Wine is only as fine as the person drinking it, I always say.' WHERE `Id`=24431; -- Waterlogged Recipe +UPDATE `quest_template` SET `RequestItemsText`='The Monastery was a seminary for Paladins-in-training. Once a stronghold of the Light, it fell into the hands of the crazed zealots of the Scarlet Crusade.$b$bThe Crusade believed their goal a noble one: to purify the land of the undead plague. But insanity tainted their plight and now they stand enemies to all.$b$bBring Mythology of the Titans to me so I can study it and house it here in Ironforge.$b$bThe corrupt halls of the Monastery are no place for such a historical treasure.' WHERE `Id`=1050; -- Mythology of the Titans +UPDATE `quest_template` SET `RequestItemsText`='I''m not one for politics; I care not if your affiliations are for either Horde or Alliance. I am more interested in squelching direct and dire threats to all the races... and we have quite a large one in here.$B$BIf you''re willing to be a true hero for all people, then hand me the oathstone I have given you as a sign of commitment. I''m... not from around these parts; an oathstone is important to people of my kind as a bond of agreement.' WHERE `Id`=3523; -- Scourge of the Downs +UPDATE `quest_template` SET `RequestItemsText`='Ach, $N! It''s good to see you, little one.' WHERE `Id`=13047; -- The Reckoning +UPDATE `quest_template` SET `RequestItemsText`='Bhag''thera can prove to be an elusive beast. How fares the hunt?' WHERE `Id`=193; -- Panther Mastery +UPDATE `quest_template` SET `RequestItemsText`='How goes the hunt for Tethis? Tracked her all the way back to camp, did you?' WHERE `Id`=197; -- Raptor Mastery +UPDATE `quest_template` SET `RequestItemsText`='I see you''re back, $g old bloke : lass;. King Bangalash has caused me to come crawling back to camp many times. Hang in there.' WHERE `Id`=208; -- Big Game Hunter +UPDATE `quest_template` SET `RequestItemsText`='Arrr... Yarr... Shiver me timbers... Er, sorry $g lad:lass;, I gotta practice me pirate lest I forget it...' WHERE `Id`=9512; -- Cookie's Jumbo Gumbo +UPDATE `quest_template` SET `RequestItemsText`='As you near the essence font that Eranikus told you of, his voice once again touches your mind.$B$B\"Yes mortal, this essence font will redeem what untainted element of my psyche remains imbued in this gem. Place the gem inside the font, and let the magic of the Green Dragonflight cleanse the corruption and taint from my being. Only then will I find true release, and only then will the Dragonflight be able to reassert their stewardship over the Atal''ai.\"' WHERE `Id`=3373; -- The Essence of Eranikus +UPDATE `quest_template` SET `RequestItemsText`='Here''s the plan, $n: Go out and collect some bloodpetal sprouts -- you know, the plants that haven''t fully sprouted yet, and bring them here. Then I''ll see what the Atal''ai haze can do.$B$BYou may think I''m vengeful... Actually, you''d be right about that! $B$BTruth is, I know the way out of here, but until Larion will admit that I''m right, I''m staying right here!$B$BSo off with you, find those bloodpetal sprouts and let''s have some fun!' WHERE `Id`=4144; -- Bloodpetal Sprouts +UPDATE `quest_template` SET `RequestItemsText`='Do not let fear overpower you, $N. Fear is the great betrayer... you must remain strong!$B$BTake the meat, place it in the small valley, and then use the gland on it. Only then will death come for you.' WHERE `Id`=4292; -- The Bait for Lar'korwi +UPDATE `quest_template` SET `RequestItemsText`='$C - you approach us in a peaceful manner, but I sense that you are here on matters that are grave and severe... for both furbolg and $r alike. What have you come to tell us?' WHERE `Id`=8471; -- Winterfall Ritual Totem +UPDATE `quest_template` SET `RequestItemsText`='Ahoy, me bucko! Might not be able to see but I can smell ye from halfway across port.$b$bCould really use me eye back. Captain''s going to keelhaul me when he finds out me peeper is in the hands of them dirty Bloodsail Buccaneers.$b$bWhat good is a lookout who can''t see? The crow''s nest used to be me home...without me deadlights I''d be lucky to scrub the bilge.' WHERE `Id`=576; -- Keep An Eye Out +UPDATE `quest_template` SET `RequestItemsText`='Ahoy, $n. What word do you bring of the Bloodsail encampment to the south?' WHERE `Id`=604; -- The Bloodsail Buccaneers +UPDATE `quest_template` SET `RequestItemsText`='Witch Doctor Unbagwa know what Mokk the Savage like. Yes, yes!$b$bMe speak with spirits and make he come, I do.$b$bBut other Gorilla-beast like spirit talkin'' too. You protect Witch Doctor Unbagwa and I make he come to you.$b$bWitch Doctor Unbagwa want something first. You bring a Gorilla Fang and me start spirit talking!' WHERE `Id`=349; -- Stranglethorn Fever +UPDATE `quest_template` SET `RequestItemsText`='Hey! I don''t like the look you''re giving me, $gmister:lady;.' WHERE `Id`=606; -- Scaring Shaky +UPDATE `quest_template` SET `RequestItemsText`='Here here, $N. Did you get Shaky''s payment?' WHERE `Id`=607; -- Return to MacKinley +UPDATE `quest_template` SET `RequestItemsText`='Do you have the writings of the Seven, $N? Have you learned the secrets from their tablet?' WHERE `Id`=4296; -- Tablet of the Seven +UPDATE `quest_template` SET `RequestItemsText`='I really don''t know if this plan will work, $N. Just bring me the scrap metal and I''ll do what I can.' WHERE `Id`=12901; -- Making Something Out Of Nothing +UPDATE `quest_template` SET `RequestItemsText`='Well met, $c. What brings you out here?' WHERE `Id`=11138; -- Renn McGill +UPDATE `quest_template` SET `RequestItemsText`='You''ve proved you can handle yourself in a fight, $N. Let''s keep the pressure up on the Twilight''s Hammer. Go fight some more Abyssal Templars, I''ll reward you with some of the stuff Huum and I have found in battle.' WHERE `Id`=8362; -- Abyssal Crests +UPDATE `quest_template` SET `RequestItemsText`='Have you seen a servant with my wine and cheese platter. I am quite peckish!' WHERE `Id`=13115; -- Cheese for Glowergold +UPDATE `quest_template` SET `RequestItemsText`='Their spirits are low, soldier. After our last failed air strike against the Horde, they refuse to fly! It is up to you to bolster their morale.$B$BReturn to the battlefield and strike at the heart of the Frostwolf''s command. Take down their commanders and guardians. Return to me with as many of their medals as you can stuff in your pack! I promise you, when my gryphons see the bounty and smell the blood of our enemies, they will fly again! Go now!' WHERE `Id`=6943; -- Call of Air - Ichman's Fleet +UPDATE `quest_template` SET `RequestItemsText`='You are the delivery $g boy:girl;?' WHERE `Id`=12182; -- To Venomspite! +UPDATE `quest_template` SET `RequestItemsText`='What''s all this?$B$BBy any chance have you seen my no-good apprentice, Pestlepot?$B$BI sent him on an errand quite some time ago and he has yet to return!' WHERE `Id`=12527; -- Gluttonous Lurkers +UPDATE `quest_template` SET `RequestItemsText`='Have you collected the water-poppies, $n?' WHERE `Id`=12564; -- Troll Patrol: Something for the Pain +UPDATE `quest_template` SET `RequestItemsText`='You seek to change the path you walk, $N?' WHERE `Id`=24819; -- A Change of Heart +UPDATE `quest_template` SET `RequestItemsText`='You close down that war-portal yet, $N? While you''re here shuffling your feet, there are more demons entering Outland! +' WHERE `Id`=10397; -- Invasion Point: Annihilator +UPDATE `quest_template` SET `RequestItemsText`='What is it, $C? I sense you''ve found something that speaks of a coming doom. +' WHERE `Id`=10395; -- The Dark Missive +UPDATE `quest_template` SET `RequestItemsText`='I sense a growing darkness within your heart, $C. Have you faced your fear? Or does it still await you at the Pools of Aggonar? +' WHERE `Id`=10399; -- The Heart of Darkness +UPDATE `quest_template` SET `RequestItemsText`='$N, you have returned. What did you learn?$B$BWhat is that sound?' WHERE `Id`=11629; -- Return to the Spirit Talker +UPDATE `quest_template` SET `RequestItemsText`='What''s this? Who are you?$B$BYou''re one of those $r things! How can you speak our tongue?' WHERE `Id`=11559; -- Winterfin Commerce +UPDATE `quest_template` SET `RequestItemsText`='You seek to continue down the path of destruction?' WHERE `Id`=24823; -- Path of Destruction +UPDATE `quest_template` SET `RequestItemsText`='You seek to change the path you walk, $N?' WHERE `Id`=24840; -- A Change of Heart +UPDATE `quest_template` SET `RequestItemsText`='As you draw near, the forge''s flame seems to burn even more ravenously...' WHERE `Id`=24545; -- The Sacred and the Corrupt +UPDATE `quest_template` SET `RequestItemsText`='Did you find the hides yet? You''ll find yeti in the hills below.' WHERE `Id`=12900; -- Making a Harness +UPDATE `quest_template` SET `RequestItemsText`='Do you have that which is required, $N?' WHERE `Id`=12729; -- The Gods Have Spoken +UPDATE `quest_template` SET `RequestItemsText`='We''re runnin'' dangerously low on rounds ''round here, $c. Our enemies need poundin'', especially Skorn!$B$BYa got more balls fer us?' WHERE `Id`=11190; -- One Size Does Not Fit All +UPDATE `quest_template` SET `RequestItemsText`='Have you collected 10 Scarlet Insignia Rings yet, $c?' WHERE `Id`=374; -- Proof of Demise +UPDATE `quest_template` SET `RequestItemsText`='You seek to continue down the path of destruction?' WHERE `Id`=24828; -- Path of Destruction +UPDATE `quest_template` SET `RequestItemsText`='You seek to change the path you walk, $N?' WHERE `Id`=24836; -- A Change of Heart +UPDATE `quest_template` SET `RequestItemsText`='Have you scouted all of the Blood Furnace yet? What do you have to tell me?' WHERE `Id`=9608; -- Heart of Rage +UPDATE `quest_template` SET `RequestItemsText`='The tears of the Fire Lord are a rare find indeed.$B$BOffer 1 Blood of the Mountain and you shall be granted favor amongst the Brotherhood. +' WHERE `Id`=6646; -- Favor Amongst the Brotherhood, Blood of the Mountain From fa1375b7d66392279cdac94961344e5a3cc0f158 Mon Sep 17 00:00:00 2001 From: kaelima Date: Sun, 3 Jun 2012 23:12:02 +0200 Subject: [PATCH 0925/1149] Script/Shadowfiend: Use PetAI for shadowfiends, fixes shadowcrawl autocasting --- src/server/scripts/World/npcs_special.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index c9aeea07382..57a65423b6f 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -47,6 +47,7 @@ EndContentData */ #include "ObjectMgr.h" #include "ScriptMgr.h" #include "World.h" +#include "PetAI.h" /*######## # npc_air_force_bots @@ -2100,16 +2101,18 @@ class npc_shadowfiend : public CreatureScript public: npc_shadowfiend() : CreatureScript("npc_shadowfiend") { } - struct npc_shadowfiendAI : public ScriptedAI + struct npc_shadowfiendAI : public PetAI { - npc_shadowfiendAI(Creature* creature) : ScriptedAI(creature) {} + npc_shadowfiendAI(Creature* creature) : PetAI(creature) {} - void DamageTaken(Unit* /*killer*/, uint32& damage) + void JustDied(Unit* killer) { if (me->isSummon()) if (Unit* owner = me->ToTempSummon()->GetSummoner()) - if (owner->HasAura(GLYPH_OF_SHADOWFIEND) && damage >= me->GetHealth()) + if (owner->HasAura(GLYPH_OF_SHADOWFIEND)) owner->CastSpell(owner, GLYPH_OF_SHADOWFIEND_MANA, true); + + PetAI::JustDied(killer); } }; From c7cb120449d47bc9da69b8b65fa80272582d4371 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 3 Jun 2012 16:27:25 -0500 Subject: [PATCH 0926/1149] Core/EventAI: Check AIName for EventAI scripts while loading them, avoid iterating again --- src/server/game/AI/EventAI/CreatureEventAIMgr.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp index f95645611f1..448e43db316 100755 --- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp @@ -204,12 +204,16 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() temp.raw.param3 = fields[8].GetInt32(); temp.raw.param4 = fields[9].GetInt32(); + CreatureTemplate* cInfo = sObjectMgr->GetCreatureTemplate(temp.creature_id); //Creature does not exist in database - if (!sObjectMgr->GetCreatureTemplate(temp.creature_id)) + if (!cInfo) { sLog->outErrorDb("CreatureEventAI: Event %u has script for non-existing creature entry (%u), skipping.", i, temp.creature_id); continue; } + + if (cInfo->AIName != "EventAI") + sLog->outErrorDb("Creature entry %u has EventAI scripts, but its AIName is not 'EventAI' - possible AI-mismatch?", temp.creature_id); //No chance of this event occuring if (temp.event_chance == 0) @@ -735,15 +739,6 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() } while (result->NextRow()); - for (CreatureEventAI_Event_Map::const_iterator itr = m_CreatureEventAI_Event_Map.begin(); itr != m_CreatureEventAI_Event_Map.end(); ++itr) - { - if (CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(itr->first)) - { - if (cInfo->AIName != "EventAI") - sLog->outErrorDb("Creature entry %u has EventAI scripts, but its AIName is not 'EventAI' - possible AI-mismatch?", itr->first); - } - } - sLog->outString(">> Loaded %u CreatureEventAI scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } From 1dc6bd69aa58b77b4ff79e72181d214f1eb7192b Mon Sep 17 00:00:00 2001 From: kaelima Date: Sun, 3 Jun 2012 23:34:08 +0200 Subject: [PATCH 0927/1149] Core/Auth: Correct a bad error log during authentication --- src/server/game/Server/WorldSocket.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 64137dfe7c7..98ec517cdac 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -955,6 +955,8 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) sha.UpdateBigNumbers (&k, NULL); sha.Finalize(); + std::string address = GetRemoteAddress(); + if (memcmp (sha.GetDigest(), digest, 20)) { packet.Initialize (SMSG_AUTH_RESPONSE, 1); @@ -962,13 +964,11 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) SendPacket(packet); - sLog->outError("WorldSocket::HandleAuthSession: Sent Auth Response (authentification failed)."); + sLog->outError("WorldSocket::HandleAuthSession: Authentication failed for account: %u ('%s') address: %s", id, account.c_str(), address.c_str()); return -1; } - std::string address = GetRemoteAddress(); - - sLog->outStaticDebug ("WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.", + sLog->outStaticDebug("WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.", account.c_str(), address.c_str()); From a757187d7d74a612f29ea2808302faf8ab12565d Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 3 Jun 2012 16:39:10 -0500 Subject: [PATCH 0928/1149] Fixed build --- src/server/game/AI/EventAI/CreatureEventAIMgr.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp index 448e43db316..a863f2f89cf 100755 --- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp @@ -204,15 +204,16 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() temp.raw.param3 = fields[8].GetInt32(); temp.raw.param4 = fields[9].GetInt32(); - CreatureTemplate* cInfo = sObjectMgr->GetCreatureTemplate(temp.creature_id); + CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(creature_id); //Creature does not exist in database if (!cInfo) { - sLog->outErrorDb("CreatureEventAI: Event %u has script for non-existing creature entry (%u), skipping.", i, temp.creature_id); + sLog->outErrorDb("CreatureEventAI: Event %u has script for non-existing creature entry (%u), skipping.", i, creature_id); continue; } - if (cInfo->AIName != "EventAI") + // Only on the first script + if (cInfo->AIName != "EventAI" && m_CreatureEventAI_Event_Map[creature_id].empty()) sLog->outErrorDb("Creature entry %u has EventAI scripts, but its AIName is not 'EventAI' - possible AI-mismatch?", temp.creature_id); //No chance of this event occuring From 66ac3e6c80b69724c92422ba982a334e4f5d54a7 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 3 Jun 2012 21:44:18 -0230 Subject: [PATCH 0929/1149] DB/misc: Some misc db updates for Shadowmoon Valley --- .../world/2012_06_03_04_world_misc.sql | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sql/updates/world/2012_06_03_04_world_misc.sql diff --git a/sql/updates/world/2012_06_03_04_world_misc.sql b/sql/updates/world/2012_06_03_04_world_misc.sql new file mode 100644 index 00000000000..22621d92cbd --- /dev/null +++ b/sql/updates/world/2012_06_03_04_world_misc.sql @@ -0,0 +1,25 @@ +-- Update Felboar +SET @ENTRY := 21878; +UPDATE `creature` SET `spawndist`=5,`MovementType`=1,`curhealth`=1,`spawntimesecs`=300 WHERE `id`=@ENTRY; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +UPDATE `creature_template_addon` SET `bytes2`=1,`auras`='33908' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,0,100,100,30000,55000,11,35570,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Felboar - Combat - Cast charge'); + +-- Update Dormant Infernal +SET @ENTRY := 21080; +UPDATE `creature_template_addon` SET `bytes2`=1,`auras`='36055' WHERE `entry`=@ENTRY; + +-- Update Kagrosh +SET @ENTRY := 21725; +UPDATE `creature_template_addon` SET `bytes2`=1,`auras`='29266' WHERE `entry`=@ENTRY; +UPDATE `creature` SET `position_x`=-3421.365,`position_y`=2289.388,`position_z`=33.63479,`orientation`=3.874631 WHERE `guid`=86869; +DELETE FROM `creature` WHERE `guid`=86870; + +-- Update Invis Deathforge Caster +SET @ENTRY := 21210; +DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY; +INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES (@ENTRY,1,'36393'); +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128 WHERE `entry`=@ENTRY; From 37cd5081c19a11abad9b4f362cf3cdcead51ceda Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 3 Jun 2012 22:12:04 -0230 Subject: [PATCH 0930/1149] Core/spells: Set max targets for Spell Skartax Purple Beam --- src/server/game/Spells/SpellMgr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index cdaecdcaa20..05566bdf712 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3043,6 +3043,7 @@ void SpellMgr::LoadDbcDataCorrections() case 61588: // Blazing Harpoon case 52479: // Gift of the Harvester case 48246: // Ball of Flame + case 36384: // Skartax Purple Beam spellInfo->MaxAffectedTargets = 1; break; case 41376: // Spite @@ -3084,7 +3085,7 @@ void SpellMgr::LoadDbcDataCorrections() case 50312: // Unholy Frenzy spellInfo->MaxAffectedTargets = 15; break; - case 33711: //Murmur's Touch + case 33711: // Murmur's Touch case 38794: spellInfo->MaxAffectedTargets = 1; spellInfo->EffectTriggerSpell[0] = 33760; From ecf4753a6e3f1119932d0aedb8e02e30bf979bb2 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 3 Jun 2012 23:41:48 -0230 Subject: [PATCH 0931/1149] DB/creature: Fix up Shadowmoon Harbinger --- sql/updates/world/2012_06_03_05_world_creature.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/2012_06_03_05_world_creature.sql diff --git a/sql/updates/world/2012_06_03_05_world_creature.sql b/sql/updates/world/2012_06_03_05_world_creature.sql new file mode 100644 index 00000000000..c5bccdbf33c --- /dev/null +++ b/sql/updates/world/2012_06_03_05_world_creature.sql @@ -0,0 +1,7 @@ +-- Fix up Shadowmoon Harbinger +SET @ENTRY := 21795; +UPDATE `creature` SET `spawndist`=5,`MovementType`=1,`curhealth`=1,`curmana`=0 WHERE `id`=@ENTRY; +UPDATE `creature_template` SET `AIName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY; +INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES (@ENTRY,1,'37467 37509'); From 31a08f5ddcf6dc0e34b7726d8aaaa0741754e5f2 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 4 Jun 2012 00:41:31 -0230 Subject: [PATCH 0932/1149] DB/SAI: Replaced an EAI script in Shadowmoon that was Annoying me :) --- sql/updates/world/2012_06_03_06_world_sai.sql | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 sql/updates/world/2012_06_03_06_world_sai.sql diff --git a/sql/updates/world/2012_06_03_06_world_sai.sql b/sql/updates/world/2012_06_03_06_world_sai.sql new file mode 100644 index 00000000000..32d1995a092 --- /dev/null +++ b/sql/updates/world/2012_06_03_06_world_sai.sql @@ -0,0 +1,39 @@ +-- Bron Goldhammer SAI +SET @ENTRY := 19395; +SET @SPELL := 33822; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +UPDATE `creature_template` SET `AIName`= '' WHERE `entry`=19394; +DELETE FROM `creature_ai_scripts` WHERE `creature_id` IN (@ENTRY,19394); +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@ENTRY*100; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,0,30000,30000,100000,100000,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Bron Goldhammer - OOC - Run Script'), +(@ENTRY*100,9,0,0,0,0,100,0,1000,1000,0,0,1,0,0,0,0,0,0,11,19394,15,0,0,0,0,0, 'Bron Goldhammer - Script - Barimoke Wildbeard Say 0'), +(@ENTRY*100,9,1,0,0,0,100,0,6000,6000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Bron Goldhammer - Script - Bron Goldhammer Say 0'), +(@ENTRY*100,9,2,0,0,0,100,0,3000,3000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Bron Goldhammer - Script - Bron Goldhammer Say 1'), +(@ENTRY*100,9,3,0,0,0,100,0,3000,3000,0,0,1,1,0,0,0,0,0,11,19394,15,0,0,0,0,0, 'Bron Goldhammer - Script - Barimoke Wildbeard Say 1'), +(@ENTRY*100,9,4,0,0,0,100,0,3000,3000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Bron Goldhammer - Script - Bron Goldhammer Say 2'), +(@ENTRY*100,9,5,0,0,0,100,0,2000,2000,0,0,1,2,0,0,0,0,0,11,19394,15,0,0,0,0,0, 'Bron Goldhammer - Script - Barimoke Wildbeard Say 2'), +(@ENTRY*100,9,6,0,0,0,100,0,2500,2500,0,0,11,@SPELL,3,0,0,0,0,11,19394,15,0,0,0,0,0, 'Bron Goldhammer - Script - cast spell'), +(@ENTRY*100,9,7,0,0,0,100,0,1000,1000,0,0,90,7,0,0,0,0,0,11,19394,15,0,0,0,0,0, 'Bron Goldhammer - Script - Barimoke Wildbeard set bytes 1'), +(@ENTRY*100,9,8,0,0,0,100,0,3000,3000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Bron Goldhammer - Script - Bron Goldhammer Say 3'), +(@ENTRY*100,9,9,0,0,0,100,0,2000,2000,0,0,91,7,0,0,0,0,0,11,19394,15,0,0,0,0,0, 'Bron Goldhammer - Script - Barimoke Wildbeard remove bytes 1'), +(@ENTRY*100,9,10,0,0,0,100,0,500,500,0,0,1,3,0,0,0,0,0,11,19394,15,0,0,0,0,0, 'Bron Goldhammer - Script - Barimoke Wildbeard Say 3'); +-- Bron Goldhammer text +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_texts` WHERE `entry` IN (-325,-326,-327,-328); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0, '%s blinks, a perplexed expression crossing his face.',16,0,100,0,0,0, 'Bron Goldhammer'), +(@ENTRY,1,0, 'What, with me fists?',12,0,100,6,0,0, 'Bron Goldhammer'), +(@ENTRY,2,0, 'I''m... not sure that''s a good idea, ''Moke. Ye might get hurt...',12,0,100,1,0,0, 'Bron Goldhammer'), +(@ENTRY,3,0, 'Er... ''Moke?',12,0,100,6,0,0, 'Bron Goldhammer'); +-- Barimoke Wildbeard text +SET @ENTRY := 19394; +UPDATE `creature_template_addon` SET `bytes1`=0 WHERE `entry`=@ENTRY; +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_texts` WHERE `entry` IN (-329,-330,-331,-332); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0, 'Bron! ''Ey Bron! ''Ey Bron! Hit me!',12,0,100,1,0,0, 'Barimoke Wildbeard'), +(@ENTRY,1,0, 'Nae, that''s fer wimps. Hit me with yer hammer!',12,0,100,274,0,0, 'Barimoke Wildbeard'), +(@ENTRY,2,0, 'DO IT, YE PANSEY!',12,0,100,5,0,0, 'Barimoke Wildbeard'), +(@ENTRY,3,0, '...THAT WAS GREAT!',12,0,100,5,0,0, 'Barimoke Wildbeard'); From d86246b86138c3786971b30ce5e411097e7b54ce Mon Sep 17 00:00:00 2001 From: kaelima Date: Mon, 4 Jun 2012 08:51:56 +0200 Subject: [PATCH 0933/1149] Core/Logging: Add optional binary packet logger usable with WowPacketParser, and remove the now useless WorldLog. TODO: Port this to .pkt 3.1 format --- src/server/game/Server/Protocol/PacketLog.cpp | 61 ++++++++++ .../Protocol/{WorldLog.h => PacketLog.h} | 45 +++---- src/server/game/Server/Protocol/WorldLog.cpp | 114 ------------------ src/server/game/Server/WorldSocket.cpp | 46 ++----- src/server/worldserver/worldserver.conf.dist | 9 +- 5 files changed, 89 insertions(+), 186 deletions(-) create mode 100644 src/server/game/Server/Protocol/PacketLog.cpp rename src/server/game/Server/Protocol/{WorldLog.h => PacketLog.h} (51%) mode change 100755 => 100644 delete mode 100755 src/server/game/Server/Protocol/WorldLog.cpp diff --git a/src/server/game/Server/Protocol/PacketLog.cpp b/src/server/game/Server/Protocol/PacketLog.cpp new file mode 100644 index 00000000000..bede48ace87 --- /dev/null +++ b/src/server/game/Server/Protocol/PacketLog.cpp @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include "PacketLog.h" +#include "Config.h" +#include "ByteBuffer.h" + +PacketLog::PacketLog() : _file(NULL) +{ + Initialize(); +} + +PacketLog::~PacketLog() +{ + if (_file) + fclose(_file); + + _file = NULL; +} + +void PacketLog::Initialize() +{ + std::string logsDir = ConfigMgr::GetStringDefault("LogsDir", ""); + + if (!logsDir.empty()) + if ((logsDir.at(logsDir.length()-1) != '/') && (logsDir.at(logsDir.length()-1) != '\\')) + logsDir.push_back('/'); + + std::string logname = ConfigMgr::GetStringDefault("PacketLogFile", ""); + if (!logname.empty()) + _file = fopen((logsDir + logname).c_str(), "wb"); +} + +void PacketLog::LogPacket(WorldPacket const& packet, Direction direction) +{ + ByteBuffer data(4+4+4+1+packet.size()); + data << int32(packet.GetOpcode()); + data << int32(packet.size()); + data << int32(time(NULL)); + data << uint8(direction); + + for (uint32 i = 0; i < packet.size(); i++) + data << const_cast(packet)[i]; + + fwrite(data.contents(), 1, data.size(), _file); + fflush(_file); +} diff --git a/src/server/game/Server/Protocol/WorldLog.h b/src/server/game/Server/Protocol/PacketLog.h old mode 100755 new mode 100644 similarity index 51% rename from src/server/game/Server/Protocol/WorldLog.h rename to src/server/game/Server/Protocol/PacketLog.h index fb344f195de..6efdcfe67f2 --- a/src/server/game/Server/Protocol/WorldLog.h +++ b/src/server/game/Server/Protocol/PacketLog.h @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2005-2009 MaNGOS * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,46 +15,34 @@ * with this program. If not, see . */ -/// \addtogroup u2w -/// @{ -/// \file - -#ifndef TRINITY_WORLDLOG_H -#define TRINITY_WORLDLOG_H +#ifndef TRINITY_PACKETLOG_H +#define TRINITY_PACKETLOG_H #include "Common.h" #include -#include "Errors.h" -#include - -/// %Log packets to a file -class WorldLog +enum Direction { - friend class ACE_Singleton; + CLIENT_TO_SERVER, + SERVER_TO_CLIENT +}; + +class PacketLog +{ + friend class ACE_Singleton; private: - WorldLog(); - ~WorldLog(); - WorldLog(const WorldLog &); - WorldLog& operator=(const WorldLog &); - ACE_Thread_Mutex Lock; + PacketLog(); + ~PacketLog(); public: void Initialize(); - /// Is the world logger active? - bool LogWorld(void) const { return (i_file != NULL); } - /// %Log to the file - void outLog(char const* fmt, ...); - void outTimestampLog(char const* fmt, ...); + bool CanLogPacket() const { return (_file != NULL); } + void LogPacket(WorldPacket const& packet, Direction direction); private: - FILE* i_file; - - bool m_dbWorld; + FILE* _file; }; -#define sWorldLog ACE_Singleton::instance() +#define sPacketLog ACE_Singleton::instance() #endif -/// @} - diff --git a/src/server/game/Server/Protocol/WorldLog.cpp b/src/server/game/Server/Protocol/WorldLog.cpp deleted file mode 100755 index 38b13dff095..00000000000 --- a/src/server/game/Server/Protocol/WorldLog.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2005-2009 MaNGOS - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/** \file - \ingroup u2w -*/ - -#include "WorldLog.h" -#include "Config.h" -#include "Log.h" -#include "DatabaseWorkerPool.h" - -WorldLog::WorldLog() : i_file(NULL) -{ - Initialize(); -} - -WorldLog::~WorldLog() -{ - if (i_file != NULL) - fclose(i_file); - - i_file = NULL; -} - -/// Open the log file (if specified so in the configuration file) -void WorldLog::Initialize() -{ - std::string logsDir = ConfigMgr::GetStringDefault("LogsDir", ""); - - if (!logsDir.empty()) - { - if ((logsDir.at(logsDir.length()-1) != '/') && (logsDir.at(logsDir.length()-1) != '\\')) - logsDir.push_back('/'); - } - - std::string logname = ConfigMgr::GetStringDefault("WorldLogFile", ""); - if (!logname.empty()) - { - i_file = fopen((logsDir+logname).c_str(), "w"); - } - - m_dbWorld = ConfigMgr::GetBoolDefault("LogDB.World", false); // can be VERY heavy if enabled -} - -void WorldLog::outTimestampLog(char const* fmt, ...) -{ - if (LogWorld()) - { - TRINITY_GUARD(ACE_Thread_Mutex, Lock); - ASSERT(i_file); - - Log::outTimestamp(i_file); - va_list args; - va_start(args, fmt); - vfprintf(i_file, fmt, args); - //fprintf(i_file, "\n"); - va_end(args); - - fflush(i_file); - } - - if (sLog->GetLogDB() && m_dbWorld) - { - va_list ap2; - va_start(ap2, fmt); - char nnew_str[MAX_QUERY_LEN]; - vsnprintf(nnew_str, MAX_QUERY_LEN, fmt, ap2); - sLog->outDB(LOG_TYPE_WORLD, nnew_str); - va_end(ap2); - } -} - -void WorldLog::outLog(char const* fmt, ...) -{ - if (LogWorld()) - { - TRINITY_GUARD(ACE_Thread_Mutex, Lock); - ASSERT(i_file); - - va_list args; - va_start(args, fmt); - vfprintf(i_file, fmt, args); - //fprintf(i_file, "\n"); - va_end(args); - - fflush(i_file); - } - - if (sLog->GetLogDB() && m_dbWorld) - { - va_list ap2; - va_start(ap2, fmt); - char nnew_str[MAX_QUERY_LEN]; - vsnprintf(nnew_str, MAX_QUERY_LEN, fmt, ap2); - sLog->outDB(LOG_TYPE_WORLD, nnew_str); - va_end(ap2); - } -} diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 98ec517cdac..74e414a43a9 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -42,7 +42,7 @@ #include "WorldSession.h" #include "WorldSocketMgr.h" #include "Log.h" -#include "WorldLog.h" +#include "PacketLog.h" #include "ScriptMgr.h" #include "AccountMgr.h" @@ -152,7 +152,7 @@ const std::string& WorldSocket::GetRemoteAddress (void) const return m_Address; } -int WorldSocket::SendPacket(const WorldPacket& pct) +int WorldSocket::SendPacket(WorldPacket const& pct) { ACE_GUARD_RETURN (LockType, Guard, m_OutBufferLock, -1); @@ -160,24 +160,8 @@ int WorldSocket::SendPacket(const WorldPacket& pct) return -1; // Dump outgoing packet. - if (sWorldLog->LogWorld()) - { - sWorldLog->outTimestampLog ("SERVER:\nSOCKET: %u\nLENGTH: %u\nOPCODE: %s (0x%.4X)\nDATA:\n", - (uint32) get_handle(), - pct.size(), - LookupOpcodeName (pct.GetOpcode()), - pct.GetOpcode()); - - uint32 p = 0; - while (p < pct.size()) - { - for (uint32 j = 0; j < 16 && p < pct.size(); j++) - sWorldLog->outLog("%.2X ", const_cast(pct)[p++]); - - sWorldLog->outLog("\n"); - } - sWorldLog->outLog("\n"); - } + if (sPacketLog->CanLogPacket()) + sPacketLog->LogPacket(pct, SERVER_TO_CLIENT); // Create a copy of the original packet; this is to avoid issues if a hook modifies it. sScriptMgr->OnPacketSend(this, WorldPacket(pct)); @@ -674,7 +658,7 @@ int WorldSocket::schedule_wakeup_output (GuardType& g) return 0; } -int WorldSocket::ProcessIncoming (WorldPacket* new_pct) +int WorldSocket::ProcessIncoming(WorldPacket* new_pct) { ACE_ASSERT (new_pct); @@ -687,24 +671,8 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) return -1; // Dump received packet. - if (sWorldLog->LogWorld()) - { - sWorldLog->outTimestampLog ("CLIENT:\nSOCKET: %u\nLENGTH: %u\nOPCODE: %s (0x%.4X)\nDATA:\n", - (uint32) get_handle(), - new_pct->size(), - LookupOpcodeName (new_pct->GetOpcode()), - new_pct->GetOpcode()); - - uint32 p = 0; - while (p < new_pct->size()) - { - for (uint32 j = 0; j < 16 && p < new_pct->size(); j++) - sWorldLog->outLog ("%.2X ", (*new_pct)[p++]); - - sWorldLog->outLog ("\n"); - } - sWorldLog->outLog ("\n"); - } + if (sPacketLog->CanLogPacket()) + sPacketLog->LogPacket(*new_pct, CLIENT_TO_SERVER); try { diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index d8a576f4031..b14038c9571 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -483,12 +483,13 @@ LogFileLevel = 0 DebugLogMask = 0 # -# WorldLogFile -# Description: Packet logging file for the world server. -# Example: "World.log" - (Enabled) +# PacketLogFile +# Description: Binary packet logging file for the world server. +# Filename extension must be .bin to be parsable with WowPacketParser. +# Example: "World.bin" - (Enabled) # Default: "" - (Disabled) -WorldLogFile = "" +PacketLogFile = "" # # DBErrorLogFile From d3c45cc3f2b7ad843208e5be37f95e25b7e77826 Mon Sep 17 00:00:00 2001 From: kaelima Date: Mon, 4 Jun 2012 09:14:31 +0200 Subject: [PATCH 0934/1149] Fixed build and removed an unused variable --- src/server/game/Battlegrounds/Battleground.cpp | 8 ++------ src/server/game/Server/Protocol/PacketLog.h | 2 ++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index c589edcee7a..85bbd2f3b89 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -850,12 +850,8 @@ void Battleground::EndBattleground(uint32 winner) if (team == winner) { // update achievement BEFORE personal rating update - if (ArenaTeamMember* member = winner_arena_team->GetMember(player->GetGUID())) - { - uint32 rating = player->GetArenaPersonalRating(winner_arena_team->GetSlot()); - player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, - rating ? rating : 1); - } + uint32 rating = player->GetArenaPersonalRating(winner_arena_team->GetSlot()); + player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, rating ? rating : 1); winner_arena_team->MemberWon(player, loser_matchmaker_rating, winner_matchmaker_change); } diff --git a/src/server/game/Server/Protocol/PacketLog.h b/src/server/game/Server/Protocol/PacketLog.h index 6efdcfe67f2..b899daae198 100644 --- a/src/server/game/Server/Protocol/PacketLog.h +++ b/src/server/game/Server/Protocol/PacketLog.h @@ -27,6 +27,8 @@ enum Direction SERVER_TO_CLIENT }; +class WorldPacket; + class PacketLog { friend class ACE_Singleton; From 19dbfbeb622101267a43ae7a87fc7e5fa2ccd588 Mon Sep 17 00:00:00 2001 From: Discover- Date: Mon, 4 Jun 2012 17:20:40 +0200 Subject: [PATCH 0935/1149] Core/SAI: Fixed a mistake in SMART_TARGET_INVOKER_PARTY which made it add the same player to the targetlist twice if there was a group. --- src/server/game/AI/SmartScripts/SmartScript.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 21dc92b25d1..e4c9e4a3047 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -2123,12 +2123,20 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /* case SMART_TARGET_INVOKER_PARTY: if (trigger) { - l->push_back(trigger); if (Player* player = trigger->ToPlayer()) + { if (Group* group = player->GetGroup()) + { for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next()) if (Player* member = groupRef->getSource()) l->push_back(member); + } + // We still add the player to the list if there is no group. If we do + // this even if there is a group (thus the else-check), it will add the + // same player to the list twice. We don't want that to happen. + else + l->push_back(trigger); + } } break; case SMART_TARGET_CREATURE_RANGE: From 5ed89f27e53522e725ead0f18c892fc6289cff08 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 4 Jun 2012 17:39:43 -0230 Subject: [PATCH 0936/1149] DB/SAI: Convert some EAI to SAI to clean out creature_ai_summons table. --- sql/updates/world/2012_06_04_00_world_sai | 134 ++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 sql/updates/world/2012_06_04_00_world_sai diff --git a/sql/updates/world/2012_06_04_00_world_sai b/sql/updates/world/2012_06_04_00_world_sai new file mode 100644 index 00000000000..9497f73041c --- /dev/null +++ b/sql/updates/world/2012_06_04_00_world_sai @@ -0,0 +1,134 @@ +-- Kolkar Pack Runner SAI +SET @ENTRY := 3274; +SET @SPELL := 9128; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `creature_ai_summons` WHERE `id`=8; +DELETE FROM `creature_ai_texts` WHERE `entry` IN (-769); +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,11,@SPELL,32,0,0,0,0,1,0,0,0,0,0,0,0, 'Kolkar Pack Runner - On Aggro - Cast Battle Shout'), +(@ENTRY,0,1,2,6,0,3,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Kolkar Pack Runner - On Death 3% - Say 0'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,12,3395,4,60000,0,0,0,8,0,0,0,-1209.65,-2738.38,102.646,4.99352, 'Kolkar Pack Runner - On Death 3% - Summon Verog the Dervish'); +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0, 'I am slain! Summon Verog!',14,0,100,0,0,0, 'Kolkar Pack Runner'); + +-- Kolkar Marauder SAI +SET @ENTRY := 3275; +SET @SPELL := 11976; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,80,0,12000,12000,7000,7000,11,@SPELL,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Kolkar Marauder - Combat - Cast Strike'), +(@ENTRY,0,1,2,6,0,3,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Kolkar Marauder - On Death 3% - Say 0'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,12,3395,4,60000,0,0,0,8,0,0,0,-1209.65,-2738.38,102.646,4.99352, 'Kolkar Marauder - On Death 3% - Summon Verog the Dervish'); +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0, 'I am slain! Summon Verog!',14,0,100,0,0,0, 'Kolkar Marauder'); + +-- Kolkar Bloodcharger SAI +SET @ENTRY := 3397; +SET @SPELL1 := 6742; +SET @SPELL2 := 172; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,0,35000,35000,10000,10000,11,@SPELL1,32,0,0,0,0,1,0,0,0,0,0,0,0, 'Kolkar Bloodcharger - Combat - Cast Bollodlust'), +(@ENTRY,0,1,0,0,0,100,0,20000,20000,5000,5000,11,@SPELL2,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Kolkar Bloodcharger - Combat - Cast Corruption'), +(@ENTRY,0,2,3,6,0,3,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Kolkar Bloodcharger - On Death 3% - Say 0'), +(@ENTRY,0,3,0,61,0,100,0,0,0,0,0,12,3395,4,60000,0,0,0,8,0,0,0,-1209.65,-2738.38,102.646,4.99352, 'Kolkar Bloodcharger - On Death 3% - Summon Verog the Dervish'); +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0, 'I am slain! Summon Verog!',14,0,100,0,0,0, 'Kolkar Bloodcharger'); + +-- Clara Charles SAI +SET @ENTRY := 5917; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `creature_ai_summons` WHERE `id` BETWEEN 7 AND 19; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,10,0,100,1,1,15,0,0,12,583,4,60000,0,0,0,8,0,0,0,-9232.11,342.473,74.4399,4.31658, 'Clara Charles - On LOS - Summon Defias Ambusher'); + +-- Defias Dockmaster SAI +SET @ENTRY := 6846; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `creature_ai_texts` WHERE `entry` IN (-232); +DELETE FROM `creature_ai_summons` WHERE `id` IN (4,5,6); +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,4,0,100,1,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Defias Dockmaster - On Aggro - Say 0'), +(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,12,6866,4,60000,0,0,0,8,0,0,0,-9967.55,-135.956,24.5909,0.170326, 'Defias Dockmaster - On Aggro - Summon Defias Bodyguard'), +(@ENTRY,0,2,3,61,0,100,0,0,0,0,0,12,6866,4,60000,0,0,0,8,0,0,0,-9958.49,-140.526,24.2409,4.0015, 'Defias Dockmaster - On Aggro - Summon Defias Bodyguard'), +(@ENTRY,0,3,0,61,0,100,0,0,0,0,0,12,6866,4,60000,0,0,0,8,0,0,0,-9964.59,-140.567,24.5105,0.741307, 'Defias Dockmaster - On Aggro - Summon Defias Bodyguard'); +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0, 'The Brotherhood will not be hampered by insects.',12,0,100,0,0,0, 'Defias Dockmaster'); + +-- Mekgineer Thermaplugg SAI +SET @ENTRY := 7800; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `creature_ai_texts` WHERE `entry` IN (-188,-189,-190,-191); +DELETE FROM `creature_ai_summons` WHERE `id` IN (2,3); +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,4,0,100,3,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Mekgineer Thermaplugg - On Aggro - Say 0'), +(@ENTRY,0,1,0,5,0,100,2,0,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Mekgineer Thermaplugg - On Kill - Say 3'), +(@ENTRY,0,2,0,0,0,100,2,40000,40000,40000,60000,11,11130,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Mekgineer Thermaplugg - Combat - Cast Knock Away'), +(@ENTRY,0,3,0,0,0,100,2,15000,15000,15000,35000,11,10101,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Mekgineer Thermaplugg - Combat - Cast Knock Away'), +(@ENTRY,0,4,5,0,0,100,2,30000,30000,30000,30000,12,7915,4,60000,0,0,0,8,0,0,0,-521.934,693.13,-327.005,2.95, 'Mekgineer Thermaplugg - Combat - Summon Walking Bomb'), +(@ENTRY,0,5,6,61,0,100,0,0,0,0,0,12,7915,4,60000,0,0,0,8,0,0,0,-535.318,649.987,-326.494,2.72, 'Mekgineer Thermaplugg - Combat - Summon Walking Bomb'), +(@ENTRY,0,6,0,61,0,100,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Mekgineer Thermaplugg - Combat - Say 2'), +(@ENTRY,0,7,0,0,0,100,2,20000,20000,40000,65000,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Mekgineer Thermaplugg - Combat - Say 1'); +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0, 'USURPERS!!! GNOMEREGAN IS MINE!!!',14,0,100,0,0,5807, 'Mekgineer Thermaplugg'), +(@ENTRY,1,0, 'My machines are the future! They''ll destroy you all!',14,0,100,0,0,5808, 'Mekgineer Thermaplugg'), +(@ENTRY,2,0, 'Explosions! MORE explosions! I''ve got to have more explosions!',14,0,100,0,0,5809, 'Mekgineer Thermaplugg'), +(@ENTRY,3,0, '...and stay dead! He got served!',14,0,100,0,0,5810, 'Mekgineer Thermaplugg'); + +-- Shy-Rotam SAI +SET @ENTRY := 10737; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `creature_ai_summons` WHERE `id` IN (1); +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,0,5000,5000,5000,10000,11,14100,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Shy-Rotam - Combat - Cast Terrifying Roar'), +(@ENTRY,0,1,0,0,0,100,0,7000,9000,22000,27000,11,13443,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Shy-Rotam - Combat - Cast Rend'), +(@ENTRY,0,2,0,0,0,100,0,2000,3000,15000,20000,11,3604,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Shy-Rotam - Combat - Cast Tendon Rip'), +(@ENTRY,0,3,0,0,0,100,1,0,50,0,0,12,10741,1,180000,0,0,0,8,0,0,0,8074.84,-3840,690.061,4.6, 'Shy-Rotam - @50%HP - Summon Sian-Rotam'); + +-- Jammal'an the Prophet SAI +SET @ENTRY := 5710; +SET @QUEST_SOULGRINDER := 11000; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `creature_ai_texts` WHERE `entry` IN (-821,-822,-823,-824); +DELETE FROM `creature_ai_summons` WHERE `id` IN (20,21); +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,10,0,100,0,0,85,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jammal'an the Prophet - On OOC Los - Say Line 0 (P0)"), +(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jammal'an the Prophet - On OOC Los - Set Phase 1"), +(@ENTRY,0,2,0,0,1,100,0,0,0,31400,76200,1,1,0,0,0,0,0,2,0,0,0,0,0,0,0,"Jammal'an the Prophet - In Combat - Say Line 2"), +(@ENTRY,0,3,0,0,1,100,0,8100,35600,20100,52900,11,12468,0,0,0,0,0,2,0,0,0,0,0,0,0,"Jammal'an the Prophet - In Combat - Cast Flamestrike"), +(@ENTRY,0,4,0,0,1,100,0,6200,16500,26100,36600,11,8376,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jammal'an the Prophet - In Combat - Cast Earthgrab Totem"), +(@ENTRY,0,5,6,1,1,100,0,16300,19900,31400,53500,11,12479,0,0,0,0,0,2,0,0,0,0,0,0,0,"Jammal'an the Prophet - In Combat - Cast Hex of Jammal'an"), +(@ENTRY,0,6,0,61,1,100,0,0,0,0,0,1,2,0,0,0,0,0,2,0,0,0,0,0,0,0,"Jammal'an the Prophet - On Hex of Jammal'an Cast - Say Line 1"), +(@ENTRY,0,7,8,2,1,100,1,0,30,0,0,11,12492,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jammal'an the Prophet - At 30% HP - Cast Healing Wave"), +(@ENTRY,0,8,0,61,1,100,0,0,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jammal'an the Prophet - At 30% HP - Say Line 3"), +(@ENTRY,0,9,0,5,1,100,0,0,0,0,0,4,5863,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jammal'an the Prophet - Killed Unit - Play Sound 5863"), +(@ENTRY,0,10,11,6,1,100,0,0,0,0,0,12,5721,1,300000,0,0,0,8,0,0,0,-472.02,105.823,-94.6299,0.0301925,"Jammal'an the Prophet - On Death - Summon Dreamscyte"), +(@ENTRY,0,11,0,61,1,100,0,0,0,0,0,12,5720,1,300000,0,0,0,8,0,0,0,-467.099,85.2944,-94.7318,3.95326,"Jammal'an the Prophet - On Death - Summon Weaver"); +-- Jammal'an the Prophet text +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"The shield be down! Rise up Atal'ai! Rise up!",14,0,100,0,0,0,"Jammal'an the Prophet"), -- 821 +(@ENTRY,1,0,"Join us!",14,0,100,0,0,0,"Jammal'an the Prophet"), -- 823 +(@ENTRY,2,0,"The Soulflayer comes!",14,0,100,0,0,0,"Jammal'an the Prophet"), -- 822 +(@ENTRY,3,0,"Hakkar shall live again!",14,0,100,0,0,0,"Jammal'an the Prophet"); -- 824 From 5e2296cab109d9e84f63eef7584cd06650ddcc60 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 4 Jun 2012 19:34:32 -0230 Subject: [PATCH 0937/1149] Db/Gossip: Add some missing Winterspring Gossip --- .../world/2012_06_04_01_world_gossip.sql | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 sql/updates/world/2012_06_04_01_world_gossip.sql diff --git a/sql/updates/world/2012_06_04_01_world_gossip.sql b/sql/updates/world/2012_06_04_01_world_gossip.sql new file mode 100644 index 00000000000..f110a917689 --- /dev/null +++ b/sql/updates/world/2012_06_04_01_world_gossip.sql @@ -0,0 +1,23 @@ +-- Add some missing gossip for winterspring +UPDATE `creature_template` SET `gossip_menu_id`=3049 WHERE `entry`=10918; +DELETE FROM `gossip_menu` WHERE `entry`=3049; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (3049,3758); +UPDATE `creature_template` SET `gossip_menu_id`=7046 WHERE `entry`=16015; +DELETE FROM `gossip_menu` WHERE `entry`=7046; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (7046,8292); +DELETE FROM `gossip_menu_option` WHERE `menu_id`=7046 AND `id` IN (0); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`) VALUES +(@GOSSIP,0,1, 'Hey Vi''el, show me your wares!',3,128,0,0,0,0, ''); +UPDATE `creature_template` SET `gossip_menu_id`=9821 WHERE `entry`=11119; +UPDATE `creature_template` SET `gossip_menu_id`=6092 WHERE `entry`=14742; +DELETE FROM `gossip_menu` WHERE `entry`=6092; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (6092,7249); +UPDATE `creature_template` SET `gossip_menu_id`=6091 WHERE `entry`=11193; +DELETE FROM `gossip_menu` WHERE `entry`=6091; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (6091,7247); +UPDATE `creature_template` SET `gossip_menu_id`=6089 WHERE `entry`=11192; +DELETE FROM `gossip_menu` WHERE `entry`=6089; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (6089,7243); +UPDATE `creature_template` SET `gossip_menu_id`=6090 WHERE `entry`=11191; +DELETE FROM `gossip_menu` WHERE `entry`=6090; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (6090,7245); From 210b5e246eaf8242f80cb1fe5c259e7f3f270862 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 4 Jun 2012 20:44:06 -0230 Subject: [PATCH 0938/1149] DB/SAI: missed .sql in a file sorry. --- .../{2012_06_04_00_world_sai => 2012_06_04_00_world_sai.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sql/updates/world/{2012_06_04_00_world_sai => 2012_06_04_00_world_sai.sql} (100%) diff --git a/sql/updates/world/2012_06_04_00_world_sai b/sql/updates/world/2012_06_04_00_world_sai.sql similarity index 100% rename from sql/updates/world/2012_06_04_00_world_sai rename to sql/updates/world/2012_06_04_00_world_sai.sql From 6cf5e9b294336f7979c56067652c1c7a28f98456 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 4 Jun 2012 20:46:56 -0230 Subject: [PATCH 0939/1149] Db/Gossip: I'm having a biohazard moment :) --- sql/updates/world/2012_06_04_01_world_gossip.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/updates/world/2012_06_04_01_world_gossip.sql b/sql/updates/world/2012_06_04_01_world_gossip.sql index f110a917689..f6246967452 100644 --- a/sql/updates/world/2012_06_04_01_world_gossip.sql +++ b/sql/updates/world/2012_06_04_01_world_gossip.sql @@ -7,7 +7,7 @@ DELETE FROM `gossip_menu` WHERE `entry`=7046; INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (7046,8292); DELETE FROM `gossip_menu_option` WHERE `menu_id`=7046 AND `id` IN (0); INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`) VALUES -(@GOSSIP,0,1, 'Hey Vi''el, show me your wares!',3,128,0,0,0,0, ''); +(7046,0,1, 'Hey Vi''el, show me your wares!',3,128,0,0,0,0, ''); UPDATE `creature_template` SET `gossip_menu_id`=9821 WHERE `entry`=11119; UPDATE `creature_template` SET `gossip_menu_id`=6092 WHERE `entry`=14742; DELETE FROM `gossip_menu` WHERE `entry`=6092; From 5651da1119630820e2e3dc6aa778ba5dc3a2e571 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 4 Jun 2012 22:34:54 -0230 Subject: [PATCH 0940/1149] Db/Gossip: Update some old gossip to proper menuid's --- .../world/2012_06_04_02_world_gossip.sql | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 sql/updates/world/2012_06_04_02_world_gossip.sql diff --git a/sql/updates/world/2012_06_04_02_world_gossip.sql b/sql/updates/world/2012_06_04_02_world_gossip.sql new file mode 100644 index 00000000000..0122e9b736e --- /dev/null +++ b/sql/updates/world/2012_06_04_02_world_gossip.sql @@ -0,0 +1,143 @@ +UPDATE `creature_template` SET `gossip_menu_id`=10466 WHERE `entry`=33558; +UPDATE `creature_template` SET `gossip_menu_id`=10471 WHERE `entry`=33561; +UPDATE `creature_template` SET `gossip_menu_id`=10465 WHERE `entry`=33562; + +SET @OLDGOSSIP := 21000; +SET @NEWGOSSIP := 9935; +UPDATE `creature_template` SET `gossip_menu_id`=@NEWGOSSIP WHERE `gossip_menu_id`=@OLDGOSSIP; +UPDATE `gossip_menu` SET `entry`=@NEWGOSSIP WHERE `entry`=@OLDGOSSIP; +UPDATE `gossip_menu_option` SET `menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP; +UPDATE `conditions` SET `SourceGroup`=@NEWGOSSIP WHERE `SourceGroup`=@OLDGOSSIP AND `SourceTypeOrReferenceId`=15; + +SET @OLDGOSSIP := 21007; +SET @NEWGOSSIP := 9941; +UPDATE `creature_template` SET `gossip_menu_id`=@NEWGOSSIP WHERE `gossip_menu_id`=@OLDGOSSIP; +UPDATE `gossip_menu` SET `entry`=@NEWGOSSIP WHERE `entry`=@OLDGOSSIP; +UPDATE `gossip_menu_option` SET `menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP; +UPDATE `conditions` SET `SourceGroup`=@NEWGOSSIP WHERE `SourceGroup`=@OLDGOSSIP AND `SourceTypeOrReferenceId`=15; + +SET @OLDGOSSIP := 21024; +SET @NEWGOSSIP := 9937; +UPDATE `creature_template` SET `gossip_menu_id`=@NEWGOSSIP WHERE `gossip_menu_id`=@OLDGOSSIP; +UPDATE `gossip_menu` SET `entry`=@NEWGOSSIP WHERE `entry`=@OLDGOSSIP; +UPDATE `gossip_menu_option` SET `menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP; +UPDATE `conditions` SET `SourceGroup`=@NEWGOSSIP WHERE `SourceGroup`=@OLDGOSSIP AND `SourceTypeOrReferenceId`=15; + +SET @OLDGOSSIP := 21038; +SET @NEWGOSSIP := 9938; +UPDATE `creature_template` SET `gossip_menu_id`=@NEWGOSSIP WHERE `gossip_menu_id`=@OLDGOSSIP; +UPDATE `gossip_menu` SET `entry`=@NEWGOSSIP WHERE `entry`=@OLDGOSSIP; +UPDATE `gossip_menu_option` SET `menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP; +UPDATE `conditions` SET `SourceGroup`=@NEWGOSSIP WHERE `SourceGroup`=@OLDGOSSIP AND `SourceTypeOrReferenceId`=15; + +SET @OLDGOSSIP := 21049; +SET @NEWGOSSIP := 9931; +UPDATE `creature_template` SET `gossip_menu_id`=@NEWGOSSIP WHERE `gossip_menu_id`=@OLDGOSSIP; +UPDATE `gossip_menu` SET `entry`=@NEWGOSSIP WHERE `entry`=@OLDGOSSIP; +UPDATE `gossip_menu_option` SET `menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP; +UPDATE `conditions` SET `SourceGroup`=@NEWGOSSIP WHERE `SourceGroup`=@OLDGOSSIP AND `SourceTypeOrReferenceId`=15; + +SET @OLDGOSSIP := 21067; +SET @NEWGOSSIP := 9945; +UPDATE `creature_template` SET `gossip_menu_id`=@NEWGOSSIP WHERE `gossip_menu_id`=@OLDGOSSIP; +UPDATE `gossip_menu` SET `entry`=@NEWGOSSIP WHERE `entry`=@OLDGOSSIP; +UPDATE `gossip_menu_option` SET `menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP; +UPDATE `conditions` SET `SourceGroup`=@NEWGOSSIP WHERE `SourceGroup`=@OLDGOSSIP AND `SourceTypeOrReferenceId`=15; + +SET @OLDGOSSIP := 21048; +SET @NEWGOSSIP := 9946; +UPDATE `creature_template` SET `gossip_menu_id`=@NEWGOSSIP WHERE `gossip_menu_id`=@OLDGOSSIP; +UPDATE `gossip_menu` SET `entry`=@NEWGOSSIP WHERE `entry`=@OLDGOSSIP; +UPDATE `gossip_menu_option` SET `menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP; +UPDATE `conditions` SET `SourceGroup`=@NEWGOSSIP WHERE `SourceGroup`=@OLDGOSSIP AND `SourceTypeOrReferenceId`=15; + +SET @OLDGOSSIP := 21039; +SET @NEWGOSSIP := 9948; +UPDATE `creature_template` SET `gossip_menu_id`=@NEWGOSSIP WHERE `gossip_menu_id`=@OLDGOSSIP; +UPDATE `gossip_menu` SET `entry`=@NEWGOSSIP WHERE `entry`=@OLDGOSSIP; +UPDATE `gossip_menu_option` SET `menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP; +UPDATE `conditions` SET `SourceGroup`=@NEWGOSSIP WHERE `SourceGroup`=@OLDGOSSIP AND `SourceTypeOrReferenceId`=15; + +SET @OLDGOSSIP := 21065; +SET @NEWGOSSIP := 9953; +UPDATE `creature_template` SET `gossip_menu_id`=@NEWGOSSIP WHERE `gossip_menu_id`=@OLDGOSSIP; +UPDATE `gossip_menu` SET `entry`=@NEWGOSSIP WHERE `entry`=@OLDGOSSIP; +UPDATE `gossip_menu_option` SET `menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP; +UPDATE `conditions` SET `SourceGroup`=@NEWGOSSIP WHERE `SourceGroup`=@OLDGOSSIP AND `SourceTypeOrReferenceId`=15; + +SET @OLDGOSSIP := 21035; +SET @NEWGOSSIP := 9954; +UPDATE `creature_template` SET `gossip_menu_id`=@NEWGOSSIP WHERE `gossip_menu_id`=@OLDGOSSIP; +UPDATE `gossip_menu` SET `entry`=@NEWGOSSIP WHERE `entry`=@OLDGOSSIP; +UPDATE `gossip_menu_option` SET `menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP; +UPDATE `conditions` SET `SourceGroup`=@NEWGOSSIP WHERE `SourceGroup`=@OLDGOSSIP AND `SourceTypeOrReferenceId`=15; + +SET @OLDGOSSIP := 21010; +SET @NEWGOSSIP := 9959; +UPDATE `creature_template` SET `gossip_menu_id`=@NEWGOSSIP WHERE `gossip_menu_id`=@OLDGOSSIP; +UPDATE `gossip_menu` SET `entry`=@NEWGOSSIP WHERE `entry`=@OLDGOSSIP; +UPDATE `gossip_menu_option` SET `menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP; +UPDATE `conditions` SET `SourceGroup`=@NEWGOSSIP WHERE `SourceGroup`=@OLDGOSSIP AND `SourceTypeOrReferenceId`=15; + +SET @OLDGOSSIP := 21069; +SET @NEWGOSSIP := 9961; +UPDATE `creature_template` SET `gossip_menu_id`=@NEWGOSSIP WHERE `gossip_menu_id`=@OLDGOSSIP; +UPDATE `gossip_menu` SET `entry`=@NEWGOSSIP WHERE `entry`=@OLDGOSSIP; +UPDATE `gossip_menu_option` SET `menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP; +UPDATE `conditions` SET `SourceGroup`=@NEWGOSSIP WHERE `SourceGroup`=@OLDGOSSIP AND `SourceTypeOrReferenceId`=15; + +SET @OLDGOSSIP := 21028; +SET @NEWGOSSIP := 9963; +UPDATE `creature_template` SET `gossip_menu_id`=@NEWGOSSIP WHERE `gossip_menu_id`=@OLDGOSSIP; +UPDATE `gossip_menu` SET `entry`=@NEWGOSSIP WHERE `entry`=@OLDGOSSIP; +UPDATE `gossip_menu_option` SET `menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP; +UPDATE `conditions` SET `SourceGroup`=@NEWGOSSIP WHERE `SourceGroup`=@OLDGOSSIP AND `SourceTypeOrReferenceId`=15; + +SET @OLDGOSSIP := 21001; +SET @NEWGOSSIP := 9964; +UPDATE `creature_template` SET `gossip_menu_id`=@NEWGOSSIP WHERE `gossip_menu_id`=@OLDGOSSIP; +UPDATE `gossip_menu` SET `entry`=@NEWGOSSIP WHERE `entry`=@OLDGOSSIP; +UPDATE `gossip_menu_option` SET `menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP; +UPDATE `conditions` SET `SourceGroup`=@NEWGOSSIP WHERE `SourceGroup`=@OLDGOSSIP AND `SourceTypeOrReferenceId`=15; + +SET @OLDGOSSIP := 21027; +SET @NEWGOSSIP := 9966; +UPDATE `creature_template` SET `gossip_menu_id`=@NEWGOSSIP WHERE `gossip_menu_id`=@OLDGOSSIP; +UPDATE `gossip_menu` SET `entry`=@NEWGOSSIP WHERE `entry`=@OLDGOSSIP; +UPDATE `gossip_menu_option` SET `menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP; +UPDATE `conditions` SET `SourceGroup`=@NEWGOSSIP WHERE `SourceGroup`=@OLDGOSSIP AND `SourceTypeOrReferenceId`=15; + +SET @OLDGOSSIP := 21064; +SET @NEWGOSSIP := 9968; +UPDATE `creature_template` SET `gossip_menu_id`=@NEWGOSSIP WHERE `gossip_menu_id`=@OLDGOSSIP; +UPDATE `gossip_menu` SET `entry`=@NEWGOSSIP WHERE `entry`=@OLDGOSSIP; +UPDATE `gossip_menu_option` SET `menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP; +UPDATE `conditions` SET `SourceGroup`=@NEWGOSSIP WHERE `SourceGroup`=@OLDGOSSIP AND `SourceTypeOrReferenceId`=15; + +SET @OLDGOSSIP := 21041; +SET @NEWGOSSIP := 9971; +UPDATE `creature_template` SET `gossip_menu_id`=@NEWGOSSIP WHERE `gossip_menu_id`=@OLDGOSSIP; +UPDATE `gossip_menu` SET `entry`=@NEWGOSSIP WHERE `entry`=@OLDGOSSIP; +UPDATE `gossip_menu_option` SET `menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP; +UPDATE `conditions` SET `SourceGroup`=@NEWGOSSIP WHERE `SourceGroup`=@OLDGOSSIP AND `SourceTypeOrReferenceId`=15; + +SET @OLDGOSSIP := 21074; +SET @NEWGOSSIP := 9972; +UPDATE `creature_template` SET `gossip_menu_id`=@NEWGOSSIP WHERE `gossip_menu_id`=@OLDGOSSIP; +UPDATE `gossip_menu` SET `entry`=@NEWGOSSIP WHERE `entry`=@OLDGOSSIP; +UPDATE `gossip_menu_option` SET `menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP; +UPDATE `conditions` SET `SourceGroup`=@NEWGOSSIP WHERE `SourceGroup`=@OLDGOSSIP AND `SourceTypeOrReferenceId`=15; + +SET @OLDGOSSIP := 21015; +SET @NEWGOSSIP := 9975; +UPDATE `creature_template` SET `gossip_menu_id`=@NEWGOSSIP WHERE `gossip_menu_id`=@OLDGOSSIP; +UPDATE `gossip_menu` SET `entry`=@NEWGOSSIP WHERE `entry`=@OLDGOSSIP; +UPDATE `gossip_menu_option` SET `menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP; +UPDATE `conditions` SET `SourceGroup`=@NEWGOSSIP WHERE `SourceGroup`=@OLDGOSSIP AND `SourceTypeOrReferenceId`=15; + +SET @OLDGOSSIP := 21019; +SET @NEWGOSSIP := 9980; +UPDATE `creature_template` SET `gossip_menu_id`=@NEWGOSSIP WHERE `gossip_menu_id`=@OLDGOSSIP; +UPDATE `gossip_menu` SET `entry`=@NEWGOSSIP WHERE `entry`=@OLDGOSSIP; +UPDATE `gossip_menu_option` SET `menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP; +UPDATE `conditions` SET `SourceGroup`=@NEWGOSSIP WHERE `SourceGroup`=@OLDGOSSIP AND `SourceTypeOrReferenceId`=15; From 1b00a580f1fd74eb7f1ca8dee54640270300737d Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 4 Jun 2012 22:41:22 -0230 Subject: [PATCH 0941/1149] DB/conditions: Fix Hellfire Fortifications quest by gecko32 Closes Issue #6713 --- sql/updates/world/2012_06_04_03_world_conditions.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sql/updates/world/2012_06_04_03_world_conditions.sql diff --git a/sql/updates/world/2012_06_04_03_world_conditions.sql b/sql/updates/world/2012_06_04_03_world_conditions.sql new file mode 100644 index 00000000000..0eadeb8542e --- /dev/null +++ b/sql/updates/world/2012_06_04_03_world_conditions.sql @@ -0,0 +1,6 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 19 AND `SourceEntry` IN (13408,13409,13410,13411); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(19, 0, 13408, 0, 0, 15, 0, 1503, 0, 0, 0, 0, '', 'Hellfire Fortifications - Alliance -All classes other than dk'), +(19, 0, 13409, 0, 0, 15, 0, 1503, 0, 0, 0, 0, '', 'Hellfire Fortifications - Horde -All classes other than dk'), +(19, 0, 13410, 0, 0, 15, 0, 32, 0, 0, 0, 0, '', 'Hellfire Fortifications - Alliance -Only dk'), +(19, 0, 13411, 0, 0, 15, 0, 32, 0, 0, 0, 0, '', 'Hellfire Fortifications - Horde -Only dk'); From f2a3d4c8d7cb759589ae220562406793a70adf21 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 4 Jun 2012 22:48:55 -0230 Subject: [PATCH 0942/1149] DB/SAI: Convert Hogger to SAI by warriorpoetex Closes Issue #6672 --- sql/updates/world/2012_06_04_04_world_sai.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 sql/updates/world/2012_06_04_04_world_sai.sql diff --git a/sql/updates/world/2012_06_04_04_world_sai.sql b/sql/updates/world/2012_06_04_04_world_sai.sql new file mode 100644 index 00000000000..f38cd1fe63f --- /dev/null +++ b/sql/updates/world/2012_06_04_04_world_sai.sql @@ -0,0 +1,15 @@ +-- Hogger EAI to SAI Conversion +SET @ENTRY := 448; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,4,0,100,0,0,0,0,0,11,6268,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Hogger - On aggro - Cast Rushing Charge'), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Hogger - On Aggro - Random Say'), +(@ENTRY,0,2,0,0,0,100,0,1300,3700,20000,25000,11,6730,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Hogger - Combat - Cast Headbutt'), +(@ENTRY,0,3,0,0,0,100,0,4800,6000,30000,30000,11,6016,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Hogger - Combat - Cast Armor Pierce'); +-- Hogger creature text +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(@ENTRY,0,0, 'More bones to gnaw on...',12,0,100,0,0,0, 'Hogger Agro Say 1'), +(@ENTRY,0,1, 'Grrrr... fresh meat!',12,0,100,0,0,0, 'Hogger Agro Say 2'); From ee485049ddda2600f5da33369cdd6a9ecdb94020 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 4 Jun 2012 23:01:35 -0230 Subject: [PATCH 0943/1149] DB/SAI: Fix error with SAI for Lothos Riftwaker Closes #6556 --- sql/updates/world/2012_06_04_05_world_sai.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2012_06_04_05_world_sai.sql diff --git a/sql/updates/world/2012_06_04_05_world_sai.sql b/sql/updates/world/2012_06_04_05_world_sai.sql new file mode 100644 index 00000000000..51d998c15ab --- /dev/null +++ b/sql/updates/world/2012_06_04_05_world_sai.sql @@ -0,0 +1,3 @@ +-- Fix SAI for Lothos Riftwaker +UPDATE `smart_scripts` SET `event_param1`=5750 WHERE `entryorguid`=14387 AND `id`=0; +UPDATE `smart_scripts` SET `event_param1`=0 WHERE `entryorguid`=14387 AND `id`=1; From 15919f119ab4538b02843d73a9e84a907e1ae355 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 4 Jun 2012 23:09:37 -0230 Subject: [PATCH 0944/1149] DB/SAI: Mok'rash SAI by warriorpoetex Closes #6640 --- sql/updates/world/2012_06_04_06_world_sai.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 sql/updates/world/2012_06_04_06_world_sai.sql diff --git a/sql/updates/world/2012_06_04_06_world_sai.sql b/sql/updates/world/2012_06_04_06_world_sai.sql new file mode 100644 index 00000000000..455246d82b7 --- /dev/null +++ b/sql/updates/world/2012_06_04_06_world_sai.sql @@ -0,0 +1,18 @@ +-- Mok'rash SAI +SET @ENTRY := 1493; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +INSERT INTO smart_scripts (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,0,5000,10000,300000,600000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Mok''Rash - OOC - Random Yell'), +(@ENTRY,0,1,0,0,0,85,0,8000,8000,15000,15000,11,40505,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Mok''Rash - Combat - Cast Cleave'); +-- Mok'rash Text +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO creature_text (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY, 0, 0, 'SMOTTS, I HAVE YOUR LITTLE BELT....COME GET IT!', 14, 0, 100, 0, 0, 0, 'Mok''rash Yell'), +(@ENTRY, 0, 1, 'SMOTTS! HEY, SMOTTS! COME OUT AND PLAY!', 14, 0, 100, 0, 0, 0, 'Mok''rash Yell'), +(@ENTRY, 0, 2, 'DON''T LET THIS STATUE BE MY ONLY COMPANY, COME OUT AND PLAY!', 14, 0, 100, 0, 0, 0, 'Mok''rash Yell'), +(@ENTRY, 0, 3, 'COME OUT TO JANEIRO''S POINT. I''M WAITING FOR YOU, SMOTTS...', 14, 0, 100, 0, 0, 0, 'Mok''rash Yell'), +(@ENTRY, 0, 4, 'I PROMISE I WON''T KILL YOUR CREW THIS TIME. HAH! BUT MY BROTHER MIGHT EAT THEM!', 14, 0, 100, 0, 0, 0, 'Mok''rash Yell'), +(@ENTRY, 0, 5, 'HAVE YOU RUN OUT OF SHIPS TO SEND? WHERE IS YOUR COURAGE?', 14, 0, 100, 0, 0, 0, 'Mok''rash Yell'), +(@ENTRY, 0, 6, 'I HAVE YOUR LITTLE BELT TIED AROUND MY FINGER, SMOTTS. DON''T YOU WANT IT BACK?', 14, 0, 100, 0, 0, 0, 'Mok''rash Yell'); From 332e7d4e52321fa253072e553783a2fa62d9ac53 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 4 Jun 2012 23:51:59 -0230 Subject: [PATCH 0945/1149] DB/misc: Some misc updates --- sql/updates/world/2012_06_04_07_world_misc.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/2012_06_04_07_world_misc.sql diff --git a/sql/updates/world/2012_06_04_07_world_misc.sql b/sql/updates/world/2012_06_04_07_world_misc.sql new file mode 100644 index 00000000000..947ba3b31ee --- /dev/null +++ b/sql/updates/world/2012_06_04_07_world_misc.sql @@ -0,0 +1,7 @@ +-- Add Missing spell to Jotunheim Rapid-Fire Harpoon close 6435 +UPDATE `creature_template` SET `spell1`=56585 WHERE `entry`=30337; +-- Wailing Winds missing aura +UPDATE `creature_template_addon` SET `auras`='56769' WHERE `entry`=30450; +-- Disturbed Taunka Ancestor missing aura +DELETE FROM `creature_template_addon` WHERE `entry`=30458; +INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES (30458,1,43167); From ff77610e1d3fee89507b8469b10bea800f8c0815 Mon Sep 17 00:00:00 2001 From: kaelima Date: Tue, 5 Jun 2012 10:30:44 +0200 Subject: [PATCH 0946/1149] Core/Quests: Fixed auto-accepting chain quests Closes #6475 --- src/server/game/Handlers/QuestHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index 34fed5e9a97..ca5a5c311c5 100755 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -324,7 +324,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data) // Send next quest if (Quest const* nextQuest = _player->GetNextQuest(guid, quest)) { - if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true) && _player->CanTakeQuest(quest, true)) + if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true) && _player->CanTakeQuest(nextQuest, true)) { _player->AddQuest(nextQuest, object); if (_player->CanCompleteQuest(nextQuest->GetQuestId())) From 933fad5183a57c0a40300d5c083a8e563ed72b27 Mon Sep 17 00:00:00 2001 From: kaelima Date: Tue, 5 Jun 2012 13:14:15 +0200 Subject: [PATCH 0947/1149] Core/Loot: Correct some values sent for roll packets --- src/server/game/Groups/Group.cpp | 62 +++++++++++------------ src/server/game/Groups/Group.h | 6 +-- src/server/game/Handlers/GroupHandler.cpp | 14 ++--- src/server/game/Handlers/LootHandler.cpp | 8 +-- 4 files changed, 46 insertions(+), 44 deletions(-) diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index c7648bf1ccc..9a898dbfc4c 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -525,7 +525,7 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV roll->playerVote.erase(itr2); - CountRollVote(guid, roll->itemGUID, GetMembersCount()-1, MAX_ROLL_TYPE); + CountRollVote(guid, roll->itemGUID, MAX_ROLL_TYPE); } // Update subgroups @@ -732,7 +732,7 @@ void Group::SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll &r) WorldPacket data(SMSG_LOOT_START_ROLL, (8+4+4+4+4+4+4+1)); data << uint64(r.itemGUID); // guid of rolled item data << uint32(mapid); // 3.3.3 mapid - data << uint32(r.totalPlayersRolling); // maybe the number of players rolling for it??? + data << uint32(r.itemSlot); // itemslot data << uint32(r.itemid); // the itemEntryId for the item that shall be rolled for data << uint32(r.itemRandomSuffix); // randomSuffix data << uint32(r.itemRandomPropId); // item random property ID @@ -759,7 +759,7 @@ void Group::SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p, WorldPacket data(SMSG_LOOT_START_ROLL, (8 + 4 + 4 + 4 + 4 + 4 + 4 + 1)); data << uint64(r.itemGUID); // guid of rolled item data << uint32(mapId); // 3.3.3 mapid - data << uint32(r.totalPlayersRolling); // maybe the number of players rolling for it??? + data << uint32(r.itemSlot); // itemslot data << uint32(r.itemid); // the itemEntryId for the item that shall be rolled for data << uint32(r.itemRandomSuffix); // randomSuffix data << uint32(r.itemRandomPropId); // item random property ID @@ -773,20 +773,20 @@ void Group::SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p, p->GetSession()->SendPacket(&data); } -void Group::SendLootRoll(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r) +void Group::SendLootRoll(uint64 sourceGuid, uint64 targetGuid, uint8 rollNumber, uint8 rollType, Roll const& roll) { WorldPacket data(SMSG_LOOT_ROLL, (8+4+8+4+4+4+1+1+1)); - data << uint64(SourceGuid); // guid of the item rolled - data << uint32(0); // unknown, maybe amount of players - data << uint64(TargetGuid); - data << uint32(r.itemid); // the itemEntryId for the item that shall be rolled for - data << uint32(r.itemRandomSuffix); // randomSuffix - data << uint32(r.itemRandomPropId); // Item random property ID - data << uint8(RollNumber); // 0: "Need for: [item name]" > 127: "you passed on: [item name]" Roll number - data << uint8(RollType); // 0: "Need for: [item name]" 0: "You have selected need for [item name] 1: need roll 2: greed roll - data << uint8(0); // auto pass on NeedBeforeGreed loot because player cannot use the object + data << uint64(sourceGuid); // guid of the item rolled + data << uint32(roll.itemSlot); // slot + data << uint64(targetGuid); + data << uint32(roll.itemid); // the itemEntryId for the item that shall be rolled for + data << uint32(roll.itemRandomSuffix); // randomSuffix + data << uint32(roll.itemRandomPropId); // Item random property ID + data << uint8(rollNumber); // 0: "Need for: [item name]" > 127: "you passed on: [item name]" Roll number + data << uint8(rollType); // 0: "Need for: [item name]" 0: "You have selected need for [item name] 1: need roll 2: greed roll + data << uint8(0); // 1: "You automatically passed on: %s because you cannot loot that item." - Possibly used in need befor greed - for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr) + for (Roll::PlayerVote::const_iterator itr = roll.playerVote.begin(); itr != roll.playerVote.end(); ++itr) { Player* p = ObjectAccessor::FindPlayer(itr->first); if (!p || !p->GetSession()) @@ -797,19 +797,19 @@ void Group::SendLootRoll(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, } } -void Group::SendLootRollWon(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r) +void Group::SendLootRollWon(uint64 sourceGuid, uint64 targetGuid, uint8 rollNumber, uint8 rollType, Roll const& roll) { WorldPacket data(SMSG_LOOT_ROLL_WON, (8+4+4+4+4+8+1+1)); - data << uint64(SourceGuid); // guid of the item rolled - data << uint32(0); // unknown, maybe amount of players - data << uint32(r.itemid); // the itemEntryId for the item that shall be rolled for - data << uint32(r.itemRandomSuffix); // randomSuffix - data << uint32(r.itemRandomPropId); // Item random property - data << uint64(TargetGuid); // guid of the player who won. - data << uint8(RollNumber); // rollnumber realted to SMSG_LOOT_ROLL - data << uint8(RollType); // Rolltype related to SMSG_LOOT_ROLL + data << uint64(sourceGuid); // guid of the item rolled + data << uint32(roll.itemSlot); // slot + data << uint32(roll.itemid); // the itemEntryId for the item that shall be rolled for + data << uint32(roll.itemRandomSuffix); // randomSuffix + data << uint32(roll.itemRandomPropId); // Item random property + data << uint64(targetGuid); // guid of the player who won. + data << uint8(rollNumber); // rollnumber realted to SMSG_LOOT_ROLL + data << uint8(rollType); // rollType related to SMSG_LOOT_ROLL - for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr) + for (Roll::PlayerVote::const_iterator itr = roll.playerVote.begin(); itr != roll.playerVote.end(); ++itr) { Player* p = ObjectAccessor::FindPlayer(itr->first); if (!p || !p->GetSession()) @@ -820,11 +820,11 @@ void Group::SendLootRollWon(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumb } } -void Group::SendLootAllPassed(uint32 numberOfPlayers, Roll const& roll) +void Group::SendLootAllPassed(Roll const& roll) { WorldPacket data(SMSG_LOOT_ALL_PASSED, (8+4+4+4+4)); data << uint64(roll.itemGUID); // Guid of the item rolled - data << uint32(numberOfPlayers); // The number of players rolling for it + data << uint32(roll.itemSlot); // Item loot slot data << uint32(roll.itemid); // The itemEntryId for the item that shall be rolled for data << uint32(roll.itemRandomPropId); // Item random property ID data << uint32(roll.itemRandomSuffix); // Item random suffix ID @@ -1067,7 +1067,7 @@ void Group::MasterLoot(Loot* /*loot*/, WorldObject* pLootedObject) } } -void Group::CountRollVote(uint64 playerGUID, uint64 Guid, uint32 NumberOfPlayers, uint8 Choice) +void Group::CountRollVote(uint64 playerGUID, uint64 Guid, uint8 Choice) { Rolls::iterator rollI = GetRoll(Guid); if (rollI == RollId.end()) @@ -1108,7 +1108,7 @@ void Group::CountRollVote(uint64 playerGUID, uint64 Guid, uint32 NumberOfPlayers } if (roll->totalPass + roll->totalNeed + roll->totalGreed >= roll->totalPlayersRolling) - CountTheRoll(rollI, NumberOfPlayers); + CountTheRoll(rollI); } //called when roll timer expires @@ -1117,7 +1117,7 @@ void Group::EndRoll(Loot* pLoot) for (Rolls::iterator itr = RollId.begin(); itr != RollId.end();) { if ((*itr)->getLoot() == pLoot) { - CountTheRoll(itr, GetMembersCount()); //i don't have to edit player votes, who didn't vote ... he will pass + CountTheRoll(itr); //i don't have to edit player votes, who didn't vote ... he will pass itr = RollId.begin(); } else @@ -1125,7 +1125,7 @@ void Group::EndRoll(Loot* pLoot) } } -void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers) +void Group::CountTheRoll(Rolls::iterator rollI) { Roll* roll = *rollI; if (!roll->isValid()) // is loot already deleted ? @@ -1248,7 +1248,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers) } else { - SendLootAllPassed(NumberOfPlayers, *roll); + SendLootAllPassed(*roll); // remove is_blocked so that the item is lootable by all players LootItem* item = &(roll->getLoot()->items[roll->itemSlot]); diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index 03f946cd3b6..1f932567319 100755 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -276,14 +276,14 @@ class Group void SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p, bool canNeed, Roll const& r); void SendLootRoll(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r); void SendLootRollWon(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r); - void SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r); + void SendLootAllPassed(Roll const& roll); void SendLooter(Creature* creature, Player* pLooter); void GroupLoot(Loot* loot, WorldObject* pLootedObject); void NeedBeforeGreed(Loot* loot, WorldObject* pLootedObject); void MasterLoot(Loot* loot, WorldObject* pLootedObject); Rolls::iterator GetRoll(uint64 Guid); - void CountTheRoll(Rolls::iterator roll, uint32 NumberOfPlayers); - void CountRollVote(uint64 playerGUID, uint64 Guid, uint32 NumberOfPlayers, uint8 Choise); + void CountTheRoll(Rolls::iterator roll); + void CountRollVote(uint64 playerGUID, uint64 Guid, uint8 Choise); void EndRoll(Loot* loot); // related to disenchant rolls diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index de8dc2b90f6..1dec75628fb 100755 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -429,7 +429,7 @@ void WorldSession::HandleLootMethodOpcode(WorldPacket & recv_data) group->SendUpdate(); } -void WorldSession::HandleLootRoll(WorldPacket &recv_data) +void WorldSession::HandleLootRoll(WorldPacket& recvData) { Group* group = GetPlayer()->GetGroup(); if (!group) @@ -438,15 +438,15 @@ void WorldSession::HandleLootRoll(WorldPacket &recv_data) return; } - uint64 Guid; - uint32 NumberOfPlayers; + uint64 guid; + uint32 itemSlot; uint8 rollType; - recv_data >> Guid; //guid of the item rolled - recv_data >> NumberOfPlayers; - recv_data >> rollType; //0: pass, 1: need, 2: greed + recvData >> guid; // guid of the item rolled + recvData >> itemSlot; + recvData >> rollType; // 0: pass, 1: need, 2: greed // everything's fine, do it - group->CountRollVote(GetPlayer()->GetGUID(), Guid, NumberOfPlayers, rollType); + group->CountRollVote(GetPlayer()->GetGUID(), guid, rollType); switch (rollType) { diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 8e4b41a9be4..339c7a44d9f 100755 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -220,16 +220,18 @@ void WorldSession::HandleLootOpcode(WorldPacket & recv_data) GetPlayer()->InterruptNonMeleeSpells(false); } -void WorldSession::HandleLootReleaseOpcode(WorldPacket & recv_data) +void WorldSession::HandleLootReleaseOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT_RELEASE"); // cheaters can modify lguid to prevent correct apply loot release code and re-loot // use internal stored guid - recv_data.read_skip(); // guid; + uint64 guid; + recvData >> guid; if (uint64 lguid = GetPlayer()->GetLootGUID()) - DoLootRelease(lguid); + if (lguid == guid) + DoLootRelease(lguid); } void WorldSession::DoLootRelease(uint64 lguid) From a43c3e815a34ffa6f905fb005044f848b3d38741 Mon Sep 17 00:00:00 2001 From: kaelima Date: Tue, 5 Jun 2012 13:17:43 +0200 Subject: [PATCH 0948/1149] Core/Protocol: Correct cooldowns sent with SMSG_PET_SPELLS and add summon duration --- .../game/Entities/Creature/TemporarySummon.h | 1 + src/server/game/Entities/Pet/Pet.h | 1 + src/server/game/Entities/Player/Player.cpp | 151 ++++++++++-------- 3 files changed, 86 insertions(+), 67 deletions(-) diff --git a/src/server/game/Entities/Creature/TemporarySummon.h b/src/server/game/Entities/Creature/TemporarySummon.h index 829eb73bf80..537bbd9c099 100755 --- a/src/server/game/Entities/Creature/TemporarySummon.h +++ b/src/server/game/Entities/Creature/TemporarySummon.h @@ -36,6 +36,7 @@ class TempSummon : public Creature Unit* GetSummoner() const; uint64 GetSummonerGUID() { return m_summonerGUID; } TempSummonType const& GetSummonType() { return m_type; } + uint32 GetTimer() { return m_timer; } const SummonPropertiesEntry* const m_Properties; private: diff --git a/src/server/game/Entities/Pet/Pet.h b/src/server/game/Entities/Pet/Pet.h index 1b1a6c0f62d..3475817816d 100755 --- a/src/server/game/Entities/Pet/Pet.h +++ b/src/server/game/Entities/Pet/Pet.h @@ -164,6 +164,7 @@ class Pet : public Guardian bool HaveInDiet(ItemTemplate const* item) const; uint32 GetCurrentFoodBenefitLevel(uint32 itemlevel); void SetDuration(int32 dur) { m_duration = dur; } + int32 GetDuration() { return m_duration; } /* bool UpdateStats(Stats stat); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 4cf6d4ad979..53defc0c017 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3322,7 +3322,7 @@ void Player::SendInitialSpells() uint16 spellCooldowns = m_spellCooldowns.size(); data << uint16(spellCooldowns); - for (SpellCooldowns::const_iterator itr=m_spellCooldowns.begin(); itr != m_spellCooldowns.end(); ++itr) + for (SpellCooldowns::const_iterator itr = m_spellCooldowns.begin(); itr != m_spellCooldowns.end(); ++itr) { SpellInfo const* sEntry = sSpellMgr->GetSpellInfo(itr->first); if (!sEntry) @@ -9103,7 +9103,6 @@ void Player::SendLoot(uint64 guid, LootType loot_type) loot->loot_type = loot_type; WorldPacket data(SMSG_LOOT_RESPONSE, (9+50)); // we guess size - data << uint64(guid); data << uint8(loot_type); data << LootView(*loot, this, permission); @@ -13555,9 +13554,9 @@ void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint } case EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM: // no idea about this one... { - data << uint64(0); - data << uint32(0); - data << uint64(0); + data << uint64(0); // item guid + data << uint32(0); // slot + data << uint64(0); // container break; } case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED: @@ -14242,7 +14241,7 @@ void Player::SendNewItem(Item* item, uint32 count, bool received, bool created, data << uint64(GetGUID()); // player GUID data << uint32(received); // 0=looted, 1=from npc data << uint32(created); // 0=received, 1=created - data << uint32(1); // always 0x01 (probably meant to be count of listed items) + data << uint32(1); // bool print error to chat data << uint8(item->GetBagSlot()); // bagslot // item slot, but when added to stack: 0xFFFFFFFF data << uint32((item->GetCount() == count) ? item->GetSlot() : -1); @@ -20121,8 +20120,10 @@ void Player::PetSpellInitialize() WorldPacket data(SMSG_PET_SPELLS, 8+2+4+4+4*MAX_UNIT_ACTION_BAR_INDEX+1+1); data << uint64(pet->GetGUID()); data << uint16(pet->GetCreatureTemplate()->family); // creature family (required for pet talents) - data << uint32(0); - data << uint8(pet->GetReactState()) << uint8(charmInfo->GetCommandState()) << uint16(0); + data << uint32(pet->GetDuration()); + data << uint8(pet->GetReactState()); + data << uint8(charmInfo->GetCommandState()); + data << uint16(0); // Flags, mostly unknown // action bar loop charmInfo->BuildActionBar(&data); @@ -20155,22 +20156,33 @@ void Player::PetSpellInitialize() for (CreatureSpellCooldowns::const_iterator itr = pet->m_CreatureSpellCooldowns.begin(); itr != pet->m_CreatureSpellCooldowns.end(); ++itr) { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); + if (!spellInfo) + { + data << uint32(0); + data << uint16(0); + data << uint32(0); + data << uint32(0); + continue; + } + time_t cooldown = (itr->second > curTime) ? (itr->second - curTime) * IN_MILLISECONDS : 0; + data << uint32(itr->first); // spell ID - data << uint32(itr->first); // spellid - data << uint16(0); // spell category? - data << uint32(cooldown); // cooldown - data << uint32(0); // category cooldown - } - - for (CreatureSpellCooldowns::const_iterator itr = pet->m_CreatureCategoryCooldowns.begin(); itr != pet->m_CreatureCategoryCooldowns.end(); ++itr) - { - time_t cooldown = (itr->second > curTime) ? (itr->second - curTime) * IN_MILLISECONDS : 0; - - data << uint32(itr->first); // spellid - data << uint16(0); // spell category? - data << uint32(0); // cooldown - data << uint32(cooldown); // category cooldown + CreatureSpellCooldowns::const_iterator categoryitr = pet->m_CreatureCategoryCooldowns.find(spellInfo->Category); + if (categoryitr != pet->m_CreatureCategoryCooldowns.end()) + { + time_t categoryCooldown = (categoryitr->second > curTime) ? (categoryitr->second - curTime) * IN_MILLISECONDS : 0; + data << uint16(spellInfo->Category); // spell category + data << uint32(cooldown); // spell cooldown + data << uint32(categoryCooldown); // category cooldown + } + else + { + data << uint16(0); + data << uint32(cooldown); + data << uint32(0); + } } GetSession()->SendPacket(&data); @@ -20206,24 +20218,24 @@ void Player::PossessSpellInitialize() void Player::VehicleSpellInitialize() { - Creature* veh = GetVehicleCreatureBase(); - if (!veh) + Creature* vehicle = GetVehicleCreatureBase(); + if (!vehicle) return; - uint8 cooldownCount = veh->m_CreatureSpellCooldowns.size() + veh->m_CreatureCategoryCooldowns.size(); + uint8 cooldownCount = vehicle->m_CreatureSpellCooldowns.size(); WorldPacket data(SMSG_PET_SPELLS, 8 + 2 + 4 + 4 + 4 * 10 + 1 + 1 + cooldownCount * (4 + 2 + 4 + 4)); - data << uint64(veh->GetGUID()); - data << uint16(veh->GetCreatureTemplate()->family); - data << uint32(0); - // The following three segments are read as one uint32 - data << uint8(veh->GetReactState()); - data << uint8(0); // CommandState? - data << uint16(0); // unk + data << uint64(vehicle->GetGUID()); // Guid + data << uint16(0); // Pet Family (0 for all vehicles) + data << uint32(vehicle->isSummon() ? vehicle->ToTempSummon()->GetTimer() : 0); // Duration + // The following three segments are read by the client as one uint32 + data << uint8(vehicle->GetReactState()); // React State + data << uint8(0); // Command State + data << uint16(0x800); // DisableActions (set for all vehicles) for (uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i) { - uint32 spellId = veh->m_spells[i]; + uint32 spellId = vehicle->m_spells[i]; SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); if (!spellInfo) { @@ -20231,54 +20243,59 @@ void Player::VehicleSpellInitialize() continue; } - ConditionList conditions = sConditionMgr->GetConditionsForVehicleSpell(veh->GetEntry(), spellId); - if (!sConditionMgr->IsObjectMeetToConditions(this, veh, conditions)) + ConditionList conditions = sConditionMgr->GetConditionsForVehicleSpell(vehicle->GetEntry(), spellId); + if (!sConditionMgr->IsObjectMeetToConditions(this, vehicle, conditions)) { - sLog->outDebug(LOG_FILTER_CONDITIONSYS, "VehicleSpellInitialize: conditions not met for Vehicle entry %u spell %u", veh->ToCreature()->GetEntry(), spellId); + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "VehicleSpellInitialize: conditions not met for Vehicle entry %u spell %u", vehicle->ToCreature()->GetEntry(), spellId); data << uint16(0) << uint8(0) << uint8(i+8); continue; } if (spellInfo->IsPassive()) - { - veh->CastSpell(veh, spellId, true); - data << uint16(0) << uint8(0) << uint8(i+8); - } - else - data << uint32(MAKE_UNIT_ACTION_BUTTON(spellId, i+8)); + vehicle->CastSpell(vehicle, spellId, true); + + data << uint32(MAKE_UNIT_ACTION_BUTTON(spellId, i+8)); } for (uint32 i = CREATURE_MAX_SPELLS; i < MAX_SPELL_CONTROL_BAR; ++i) - data << uint16(0) << uint8(0) << uint8(i+8); + data << uint32(0); - data << uint8(0); - /*if (v23 > 0) - { - for (uint32 i = 0; i < v23; ++i) - data << uint32(v16); // Some spellid? - }*/ + data << uint8(0); // Auras? // Cooldowns - data << cooldownCount; + data << uint8(cooldownCount); time_t now = sWorld->GetGameTime(); - CreatureSpellCooldowns::const_iterator itr; - for (itr = veh->m_CreatureSpellCooldowns.begin(); itr != veh->m_CreatureSpellCooldowns.end(); ++itr) - { - time_t cooldown = (itr->second > now) ? (itr->second - now) * IN_MILLISECONDS : 0; - data << uint32(itr->first); // SpellId - data << uint16(0); // unk - data << uint32(cooldown); // spell cooldown - data << uint32(0); // category cooldown - } - for (itr = veh->m_CreatureCategoryCooldowns.begin(); itr != veh->m_CreatureCategoryCooldowns.end(); ++itr) + for (CreatureSpellCooldowns::const_iterator itr = vehicle->m_CreatureSpellCooldowns.begin(); itr != vehicle->m_CreatureSpellCooldowns.end(); ++itr) { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); + if (!spellInfo) + { + data << uint32(0); + data << uint16(0); + data << uint32(0); + data << uint32(0); + continue; + } + time_t cooldown = (itr->second > now) ? (itr->second - now) * IN_MILLISECONDS : 0; - data << uint32(itr->first); // SpellId - data << uint16(0); // unk - data << uint32(0); // spell cooldown - data << uint32(cooldown); // category cooldown + data << uint32(itr->first); // spell ID + + CreatureSpellCooldowns::const_iterator categoryitr = vehicle->m_CreatureCategoryCooldowns.find(spellInfo->Category); + if (categoryitr != vehicle->m_CreatureCategoryCooldowns.end()) + { + time_t categoryCooldown = (categoryitr->second > now) ? (categoryitr->second - now) * IN_MILLISECONDS : 0; + data << uint16(spellInfo->Category); // spell category + data << uint32(cooldown); // spell cooldown + data << uint32(categoryCooldown); // category cooldown + } + else + { + data << uint16(0); + data << uint32(cooldown); + data << uint32(0); + } } GetSession()->SendPacket(&data); @@ -20317,7 +20334,7 @@ void Player::CharmSpellInitialize() if (charm->GetTypeId() != TYPEID_PLAYER) data << uint8(charm->ToCreature()->GetReactState()) << uint8(charmInfo->GetCommandState()) << uint16(0); else - data << uint8(0) << uint8(0) << uint16(0); + data << uint32(0); charmInfo->BuildActionBar(&data); @@ -22299,8 +22316,8 @@ void Player::SendInstanceResetWarning(uint32 mapid, Difficulty difficulty, uint3 data << uint32(time); if (type == RAID_INSTANCE_WELCOME) { - data << uint8(0); // is your (1) - data << uint8(0); // is extended (1), ignored if prev field is 0 + data << uint8(0); // is locked + data << uint8(0); // is extended, ignored if prev field is 0 } GetSession()->SendPacket(&data); } From 7e71488a1ea9f86b605821980a5ee7dbbb375b81 Mon Sep 17 00:00:00 2001 From: kaelima Date: Tue, 5 Jun 2012 13:23:37 +0200 Subject: [PATCH 0949/1149] Fixed build (forgot to save file) --- src/server/game/Handlers/GroupHandler.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 1dec75628fb..18435263b2e 100755 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -431,13 +431,6 @@ void WorldSession::HandleLootMethodOpcode(WorldPacket & recv_data) void WorldSession::HandleLootRoll(WorldPacket& recvData) { - Group* group = GetPlayer()->GetGroup(); - if (!group) - { - recv_data.rfinish(); - return; - } - uint64 guid; uint32 itemSlot; uint8 rollType; @@ -445,7 +438,10 @@ void WorldSession::HandleLootRoll(WorldPacket& recvData) recvData >> itemSlot; recvData >> rollType; // 0: pass, 1: need, 2: greed - // everything's fine, do it + Group* group = GetPlayer()->GetGroup(); + if (!group) + return; + group->CountRollVote(GetPlayer()->GetGUID(), guid, rollType); switch (rollType) From 295b1a00c8fa111c8a959fd2bf58534f759d7d5d Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 5 Jun 2012 14:53:18 +0200 Subject: [PATCH 0950/1149] Scripts/Icecrown Citadel: Fixed Sindragosa, Spinestalker and Rimefang flying in after related trash packs are dead - this solution is resistant to grid unload. --- .../IcecrownCitadel/boss_sindragosa.cpp | 22 +-- .../instance_icecrown_citadel.cpp | 187 ++++++++++-------- 2 files changed, 108 insertions(+), 101 deletions(-) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 734639a8b51..9baf6ba7a00 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -651,7 +651,7 @@ class npc_spinestalker : public CreatureScript // Increase add count if (!me->isDead()) { - _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, 1); // this cannot be in Reset because reset also happens on evade + _instance->SetData64(DATA_SINDRAGOSA_FROSTWYRMS, me->GetGUID()); // this cannot be in Reset because reset also happens on evade Reset(); } } @@ -674,13 +674,12 @@ class npc_spinestalker : public CreatureScript void JustRespawned() { ScriptedAI::JustRespawned(); - _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, 1); // this cannot be in Reset because reset also happens on evade + _instance->SetData64(DATA_SINDRAGOSA_FROSTWYRMS, me->GetGUID()); // this cannot be in Reset because reset also happens on evade } void JustDied(Unit* /*killer*/) { _events.Reset(); - _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, 0); } void DoAction(int32 const action) @@ -778,7 +777,7 @@ class npc_rimefang : public CreatureScript // Increase add count if (!me->isDead()) { - _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, 1); // this cannot be in Reset because reset also happens on evade + _instance->SetData64(DATA_SINDRAGOSA_FROSTWYRMS, me->GetGUID()); // this cannot be in Reset because reset also happens on evade Reset(); } } @@ -801,13 +800,12 @@ class npc_rimefang : public CreatureScript void JustRespawned() { ScriptedAI::JustRespawned(); - _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, 1); // this cannot be in Reset because reset also happens on evade + _instance->SetData64(DATA_SINDRAGOSA_FROSTWYRMS, me->GetGUID()); // this cannot be in Reset because reset also happens on evade } void JustDied(Unit* /*killer*/) { _events.Reset(); - _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, 0); } void DoAction(int32 const action) @@ -934,7 +932,8 @@ class npc_sindragosa_trash : public CreatureScript // Increase add count if (!me->isDead()) { - _instance->SetData(_frostwyrmId, 1); // this cannot be in Reset because reset also happens on evade + if (me->GetEntry() == NPC_FROSTWING_WHELP) + _instance->SetData64(_frostwyrmId, me->GetGUID()); // this cannot be in Reset because reset also happens on evade Reset(); } } @@ -956,13 +955,8 @@ class npc_sindragosa_trash : public CreatureScript ScriptedAI::JustRespawned(); // Increase add count - _instance->SetData(_frostwyrmId, 1); // this cannot be in Reset because reset also happens on evade - } - - void JustDied(Unit* /*killer*/) - { - // Decrease add count - _instance->SetData(_frostwyrmId, 0); + if (me->GetEntry() == NPC_FROSTWING_WHELP) + _instance->SetData64(_frostwyrmId, me->GetGUID()); // this cannot be in Reset because reset also happens on evade } void SetData(uint32 type, uint32 data) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index cb83efc748f..288fde28c38 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -89,6 +89,13 @@ WeeklyQuest const WeeklyQuestData[WeeklyNPCs] = {NPC_VALITHRIA_DREAMWALKER_QUEST, {QUEST_RESPITE_FOR_A_TORNMENTED_SOUL_10, QUEST_RESPITE_FOR_A_TORNMENTED_SOUL_25}}, // Respite for a Tormented Soul }; +enum FrostwyrmFlags +{ + FLAG_SPINESTALKER_SUMMONED = 0x01, + FLAG_RIMEFANG_SUMMONED = 0x02, + FLAG_SINDRAGOSA_SUMMONED = 0x04, +}; + class instance_icecrown_citadel : public InstanceMapScript { public: @@ -138,9 +145,6 @@ class instance_icecrown_citadel : public InstanceMapScript FrozenThroneEdgeGUID = 0; FrozenThroneWindGUID = 0; FrozenThroneWarningGUID = 0; - FrostwyrmCount = 0; - SpinestalkerTrashCount = 0; - RimefangTrashCount = 0; IsBonedEligible = true; IsOozeDanceEligible = true; IsNauseaEligible = true; @@ -148,6 +152,7 @@ class instance_icecrown_citadel : public InstanceMapScript ColdflameJetsState = NOT_STARTED; BloodQuickeningState = NOT_STARTED; BloodQuickeningMinutes = 0; + FrostwyrmFlags = 0; } void FillInitialWorldStates(WorldPacket& data) @@ -279,9 +284,13 @@ class instance_icecrown_citadel : public InstanceMapScript break; case NPC_SPINESTALKER: SpinestalkerGUID = creature->GetGUID(); + if (!creature->isAlive()) + FrostwyrmFlags |= FLAG_SPINESTALKER_SUMMONED; break; case NPC_RIMEFANG: RimefangGUID = creature->GetGUID(); + if (!creature->isAlive()) + FrostwyrmFlags |= FLAG_RIMEFANG_SUMMONED; break; case NPC_THE_LICH_KING: TheLichKingGUID = creature->GetGUID(); @@ -347,6 +356,56 @@ class instance_icecrown_citadel : public InstanceMapScript if (Creature* crok = instance->GetCreature(CrokScourgebaneGUID)) crok->AI()->SetGUID(creature->GetGUID(), ACTION_VRYKUL_DEATH); break; + case NPC_FROSTWING_WHELP: + if (creature->AI()->GetData(1/*DATA_FROSTWYRM_OWNER*/) == DATA_SPINESTALKER) + { + if (FrostwyrmFlags & FLAG_SPINESTALKER_SUMMONED) + return; + + SpinestalkerTrash.erase(creature->GetGUID()); + if (SpinestalkerTrash.empty()) + { + FrostwyrmFlags |= FLAG_SPINESTALKER_SUMMONED; + if (Creature* spinestalk = instance->GetCreature(SpinestalkerGUID)) + spinestalk->AI()->DoAction(ACTION_START_FROSTWYRM); + } + } + else + { + if (FrostwyrmFlags & FLAG_RIMEFANG_SUMMONED) + return; + + RimefangTrash.erase(creature->GetGUID()); + if (RimefangTrash.empty()) + { + FrostwyrmFlags |= FLAG_RIMEFANG_SUMMONED; + if (Creature* spinestalk = instance->GetCreature(RimefangGUID)) + spinestalk->AI()->DoAction(ACTION_START_FROSTWYRM); + } + } + break; + case NPC_RIMEFANG: + case NPC_SPINESTALKER: + { + if (FrostwyrmFlags & FLAG_SINDRAGOSA_SUMMONED) + return; + + if (instance->IsHeroic() && !HeroicAttempts) + return; + + if (GetBossState(DATA_SINDRAGOSA) == DONE) + return; + + FrostwyrmGUIDs.erase(creature->GetGUID()); + if (FrostwyrmGUIDs.empty()) + { + FrostwyrmFlags |= FLAG_SINDRAGOSA_SUMMONED; + instance->LoadGrid(SindragosaSpawnPos.GetPositionX(), SindragosaSpawnPos.GetPositionY()); + if (Creature* boss = instance->SummonCreature(NPC_SINDRAGOSA, SindragosaSpawnPos)) + boss->AI()->DoAction(ACTION_START_FROSTWYRM); + } + break; + } default: break; } @@ -538,11 +597,17 @@ class instance_icecrown_citadel : public InstanceMapScript switch (type) { case DATA_SINDRAGOSA_FROSTWYRMS: - return FrostwyrmCount; + if (FrostwyrmFlags & FLAG_SINDRAGOSA_SUMMONED) + return 255; + return FrostwyrmGUIDs.size(); case DATA_SPINESTALKER: - return SpinestalkerTrashCount; + if (FrostwyrmFlags & FLAG_SPINESTALKER_SUMMONED) + return 255; + return SpinestalkerTrash.size(); case DATA_RIMEFANG: - return RimefangTrashCount; + if (FrostwyrmFlags & FLAG_RIMEFANG_SUMMONED) + return 255; + return RimefangTrash.size(); case DATA_COLDFLAME_JETS: return ColdflameJetsState; case DATA_TEAM_IN_INSTANCE: @@ -741,6 +806,9 @@ class instance_icecrown_citadel : public InstanceMapScript sindra->DespawnOrUnsummon(); } } + // Reached when loading from DB + if (state == DONE) + FrostwyrmFlags |= FLAG_SINDRAGOSA_SUMMONED; break; case DATA_THE_LICH_KING: { @@ -798,89 +866,17 @@ class instance_icecrown_citadel : public InstanceMapScript IsOrbWhispererEligible = data ? true : false; break; case DATA_SINDRAGOSA_FROSTWYRMS: - { - if (FrostwyrmCount == 255) - return; - - if (instance->IsHeroic() && !HeroicAttempts) - return; - - if (GetBossState(DATA_SINDRAGOSA) == DONE) - return; - - switch (data) - { - case 0: - if (FrostwyrmCount) - { - --FrostwyrmCount; - if (!FrostwyrmCount) - { - instance->LoadGrid(SindragosaSpawnPos.GetPositionX(), SindragosaSpawnPos.GetPositionY()); - if (Creature* boss = instance->SummonCreature(NPC_SINDRAGOSA, SindragosaSpawnPos)) - boss->AI()->DoAction(ACTION_START_FROSTWYRM); - } - } - break; - case 1: - ++FrostwyrmCount; - break; - default: - FrostwyrmCount = data; - break; - } + if (data == 255) + FrostwyrmFlags |= FLAG_SINDRAGOSA_SUMMONED; break; - } case DATA_SPINESTALKER: - { - if (SpinestalkerTrashCount == 255) - return; - - switch (data) - { - case 0: - if (SpinestalkerTrashCount) - { - --SpinestalkerTrashCount; - if (!SpinestalkerTrashCount) - if (Creature* spinestalk = instance->GetCreature(SpinestalkerGUID)) - spinestalk->AI()->DoAction(ACTION_START_FROSTWYRM); - } - break; - case 1: - ++SpinestalkerTrashCount; - break; - default: - SpinestalkerTrashCount = data; - break; - } + if (data == 255) + FrostwyrmFlags |= FLAG_SPINESTALKER_SUMMONED; break; - } case DATA_RIMEFANG: - { - if (RimefangTrashCount == 255) - return; - - switch (data) - { - case 0: - if (RimefangTrashCount) - { - --RimefangTrashCount; - if (!RimefangTrashCount) - if (Creature* rime = instance->GetCreature(RimefangGUID)) - rime->AI()->DoAction(ACTION_START_FROSTWYRM); - } - break; - case 1: - ++RimefangTrashCount; - break; - default: - RimefangTrashCount = data; - break; - } + if (data == 255) + FrostwyrmFlags |= FLAG_RIMEFANG_SUMMONED; break; - } case DATA_COLDFLAME_JETS: ColdflameJetsState = data; if (ColdflameJetsState == DONE) @@ -922,6 +918,22 @@ class instance_icecrown_citadel : public InstanceMapScript } } + void SetData64(uint32 id, uint64 data) + { + switch (id) + { + case DATA_SINDRAGOSA_FROSTWYRMS: + FrostwyrmGUIDs.insert(data); + break; + case DATA_SPINESTALKER: + SpinestalkerTrash.insert(data); + break; + case DATA_RIMEFANG: + RimefangTrash.insert(data); + break; + } + } + bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) { switch (criteria_id) @@ -1289,12 +1301,13 @@ class instance_icecrown_citadel : public InstanceMapScript uint64 PillarsUnchainedGUID; uint32 TeamInInstance; uint32 ColdflameJetsState; - uint32 FrostwyrmCount; - uint32 SpinestalkerTrashCount; - uint32 RimefangTrashCount; + std::set FrostwyrmGUIDs; + std::set SpinestalkerTrash; + std::set RimefangTrash; uint32 BloodQuickeningState; uint32 HeroicAttempts; uint16 BloodQuickeningMinutes; + uint16 FrostwyrmFlags; bool IsBonedEligible; bool IsOozeDanceEligible; bool IsNauseaEligible; From 8c841d12b3e00c6f4e50a72113dbaac03a6158f4 Mon Sep 17 00:00:00 2001 From: kaelima Date: Tue, 5 Jun 2012 20:44:13 +0200 Subject: [PATCH 0951/1149] Scripts/Ulduar: Fixed some various bugs with XT-002 Deconstructor. He will now properly reset if he evades while being submerged. He will not always die directly after heart phase. Adds will now despawn on reset. Heart will now change seat and set unit flags properly, but is still not attackable by melee (seems like a vehicle flag bug) --- .../Northrend/Ulduar/Ulduar/boss_xt002.cpp | 75 ++++++++++--------- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index c7091b42c5a..a2044854672 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -170,7 +170,11 @@ enum AchievementCredits ACHIEV_MUST_DECONSTRUCT_FASTER = 21027, }; -#define HEART_VEHICLE_SEAT 0 +enum VehicleSeats +{ + HEART_VEHICLE_SEAT_NORMAL = 0, + HEART_VEHICLE_SEAT_EXPOSED = 1, +}; /*------------------------------------------------------- * @@ -198,6 +202,8 @@ class boss_xt002 : public CreatureScript _Reset(); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetReactState(REACT_AGGRESSIVE); + DoCast(me, SPELL_STAND); _healthRecovered = false; _gravityBombCasualty = false; @@ -356,15 +362,16 @@ class boss_xt002 : public CreatureScript me->AttackStop(); me->SetReactState(REACT_PASSIVE); - Unit* heart = me->GetVehicleKit() ? me->GetVehicleKit()->GetPassenger(HEART_VEHICLE_SEAT) : NULL; + Unit* heart = me->GetVehicleKit() ? me->GetVehicleKit()->GetPassenger(HEART_VEHICLE_SEAT_NORMAL) : NULL; if (heart) { heart->CastSpell(heart, SPELL_HEART_OVERLOAD, false); heart->CastSpell(me, SPELL_HEART_LIGHTNING_TETHER, false); heart->CastSpell(heart, SPELL_HEART_HEAL_TO_FULL, true); heart->CastSpell(heart, SPELL_EXPOSED_HEART, false); // Channeled - - heart->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + heart->ChangeSeat(HEART_VEHICLE_SEAT_EXPOSED, true); + heart->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + heart->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29); } events.CancelEvent(EVENT_SEARING_LIGHT); @@ -392,11 +399,13 @@ class boss_xt002 : public CreatureScript events.RescheduleEvent(EVENT_GRAVITY_BOMB, TIMER_GRAVITY_BOMB); events.RescheduleEvent(EVENT_TYMPANIC_TANTRUM, urand(TIMER_TYMPANIC_TANTRUM_MIN, TIMER_TYMPANIC_TANTRUM_MAX)); - Unit* heart = me->GetVehicleKit() ? me->GetVehicleKit()->GetPassenger(HEART_VEHICLE_SEAT) : NULL; + Unit* heart = me->GetVehicleKit() ? me->GetVehicleKit()->GetPassenger(HEART_VEHICLE_SEAT_EXPOSED) : NULL; if (!heart) return; - heart->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + heart->ChangeSeat(HEART_VEHICLE_SEAT_NORMAL, false); + heart->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + heart->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29); heart->RemoveAurasDueToSpell(SPELL_EXPOSED_HEART); if (!_hardMode) @@ -425,43 +434,39 @@ class boss_xt002 : public CreatureScript * XT-002 HEART * *///---------------------------------------------------- + class mob_xt002_heart : public CreatureScript { public: mob_xt002_heart() : CreatureScript("mob_xt002_heart") { } + struct mob_xt002_heartAI : public Scripted_NoMovementAI + { + mob_xt002_heartAI(Creature* creature) : Scripted_NoMovementAI(creature), + _instance(creature->GetInstanceScript()) + { + } + + void UpdateAI(uint32 const /*diff*/) { } + + void JustDied(Unit* /*killer*/) + { + Creature* xt002 = _instance ? me->GetCreature(*me, _instance->GetData64(BOSS_XT002)) : NULL; + if (!xt002 || !xt002->AI()) + return; + + xt002->AI()->SetData(DATA_TRANSFERED_HEALTH, me->GetHealth()); + xt002->AI()->DoAction(ACTION_ENTER_HARD_MODE); + } + + private: + InstanceScript* _instance; + }; + CreatureAI* GetAI(Creature* creature) const { return new mob_xt002_heartAI(creature); } - - struct mob_xt002_heartAI : public ScriptedAI - { - mob_xt002_heartAI(Creature* creature) : ScriptedAI(creature) - { - _instance = creature->GetInstanceScript(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_STUNNED | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); - me->SetReactState(REACT_PASSIVE); - } - - void DamageTaken(Unit* /*pDone*/, uint32 &damage) - { - Creature* xt002 = me->GetCreature(*me, _instance->GetData64(BOSS_XT002)); - if (!xt002 || !xt002->AI()) - return; - - if (damage >= me->GetHealth()) - { - xt002->AI()->SetData(DATA_TRANSFERED_HEALTH, me->GetMaxHealth()); - xt002->AI()->DoAction(ACTION_ENTER_HARD_MODE); - damage = 0; - } - } - - private: - InstanceScript* _instance; - uint32 _damageTaken; - }; }; /*------------------------------------------------------- @@ -915,7 +920,7 @@ class spell_xt002_heart_overload_periodic : public SpellScriptLoader { uint8 a = urand(0, 4); uint32 spellId = spells[a]; - toyPile->CastSpell(toyPile, spellId, true); + toyPile->CastSpell(toyPile, spellId, true, NULL, NULL, instance->GetData64(BOSS_XT002)); } } } From 6141c3076f6c73e772a1f6496e2be871a0eaec91 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Tue, 5 Jun 2012 19:38:43 -0230 Subject: [PATCH 0952/1149] DB/SAI: Fix Quest Cache of Mau'ari --- sql/updates/world/2012_06_05_00_world_sai.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 sql/updates/world/2012_06_05_00_world_sai.sql diff --git a/sql/updates/world/2012_06_05_00_world_sai.sql b/sql/updates/world/2012_06_05_00_world_sai.sql new file mode 100644 index 00000000000..c43998b7459 --- /dev/null +++ b/sql/updates/world/2012_06_05_00_world_sai.sql @@ -0,0 +1,13 @@ +-- Witch Doctor Mau'ari SAI +SET @ENTRY := 10307; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `quest_start_scripts` WHERE `id`=975; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@ENTRY*100; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,19,0,100,0,975,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Witch Doctor Mau''ari - On Quest Accept - Run Script'), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Witch Doctor Mau''ari - Script - Remove npc flags'), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,17,69,0,0,0,0,0,1,0,0,0,0,0,0,0,'Witch Doctor Mau''ari - Script - Set emote state use standing'), +(@ENTRY*100,9,2,0,0,0,100,0,9000,9000,0,0,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Witch Doctor Mau''ari - Script - Set emote state use standing'), +(@ENTRY*100,9,3,0,0,0,100,0,1000,1000,0,0,81,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Witch Doctor Mau''ari - Script - add npc flags'), +(@ENTRY*100,9,4,0,0,0,100,0,0,0,0,0,15,975,0,0,0,0,0,7,0,0,0,0,0,0,0,'Witch Doctor Mau''ari - Script - Complete quest 975'); From 565aa070feb53db2a91b25cdc27f0e166cff48c9 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Tue, 5 Jun 2012 20:52:38 -0230 Subject: [PATCH 0953/1149] DB/Gossip Core/Scripts: Fix Gossip for Witch Doctor Mau'ari --- .../world/2012_06_05_01_world_gossip.sql | 24 +++++++++++ src/server/scripts/Kalimdor/winterspring.cpp | 42 ------------------- 2 files changed, 24 insertions(+), 42 deletions(-) create mode 100644 sql/updates/world/2012_06_05_01_world_gossip.sql diff --git a/sql/updates/world/2012_06_05_01_world_gossip.sql b/sql/updates/world/2012_06_05_01_world_gossip.sql new file mode 100644 index 00000000000..11697eeffd4 --- /dev/null +++ b/sql/updates/world/2012_06_05_01_world_gossip.sql @@ -0,0 +1,24 @@ +-- Witch Doctor Mau'ari SAI +SET @ENTRY := 10307; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0 AND `id` IN (1,2); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,1,2,62,0,100,0,2703,2,0,0,85,16351,0,0,0,0,0,7,0,0,0,0,0,0,0,'Witch Doctor Mau''ari - On Gossip Option 2 Select - Cast Spell'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Witch Doctor Mau''ari - On Gossip Option 2 Select - Close gossip'); +-- Add some missing gossip for Witch Doctor Mau'ari +UPDATE `creature_template` SET `gossip_menu_id`=2703,`ScriptName`='' WHERE `entry`=10307; +DELETE FROM `gossip_menu` WHERE `entry` IN (2703,21320,21321); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (2703,3375),(2703,3377),(21320,3382),(21321,3383); +DELETE FROM `gossip_menu_option` WHERE `menu_id`=2703 AND `id` IN (0,1,2); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`) VALUES +(2703,0,0, 'How do I use the Cache of Mau''ari?',1,1,21320,0,0,0, ''), +(2703,1,0, 'What is E''ko?',1,1,21321,0,0,0, ''), +(2703,2,0, 'I''d like you to make me a new Cache of Mau''ari please',1,1,0,0,0,0, ''); +-- Add conditions for gossip text +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=2703; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,2703,3377,0,8,975,0,0,0,0,'','Only show gossip text 3377 if player has completed quest 975'); +-- Add conditions for gossip options +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=2703; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,2703,2,0,8,975,0,0,0,0,'','Only show gossip option if player has completed quest 975'), +(15,2703,2,0,2,12384,1,1,1,0,'','Only show gossip option if player Does not have item 12384'); diff --git a/src/server/scripts/Kalimdor/winterspring.cpp b/src/server/scripts/Kalimdor/winterspring.cpp index a02156ee110..6143fbaf74b 100644 --- a/src/server/scripts/Kalimdor/winterspring.cpp +++ b/src/server/scripts/Kalimdor/winterspring.cpp @@ -26,7 +26,6 @@ EndScriptData */ /* ContentData npc_lorax npc_rivern_frostwind -npc_witch_doctor_mauari EndContentData */ #include "ScriptMgr.h" @@ -131,49 +130,8 @@ public: }; -/*###### -## npc_witch_doctor_mauari -######*/ - -#define GOSSIP_HWDM "I'd like you to make me a new Cache of Mau'ari please." - -class npc_witch_doctor_mauari : public CreatureScript -{ -public: - npc_witch_doctor_mauari() : CreatureScript("npc_witch_doctor_mauari") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, 16351, false); - } - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestRewardStatus(975)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HWDM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(3377, creature->GetGUID()); - } - else - player->SEND_GOSSIP_MENU(3375, creature->GetGUID()); - - return true; - } -}; - void AddSC_winterspring() { new npc_lorax(); new npc_rivern_frostwind(); - new npc_witch_doctor_mauari(); } From 4ca77c5b0bf01752f9302a7591ba0c4226b889e1 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Tue, 5 Jun 2012 21:50:05 -0230 Subject: [PATCH 0954/1149] DB/Gossip Core/Scripts: Replace core script with db gossip for Lorax --- .../world/2012_06_05_01_world_gossip_sai.sql | 23 +++++++ src/server/scripts/Kalimdor/winterspring.cpp | 67 ------------------- 2 files changed, 23 insertions(+), 67 deletions(-) create mode 100644 sql/updates/world/2012_06_05_01_world_gossip_sai.sql diff --git a/sql/updates/world/2012_06_05_01_world_gossip_sai.sql b/sql/updates/world/2012_06_05_01_world_gossip_sai.sql new file mode 100644 index 00000000000..84893613c75 --- /dev/null +++ b/sql/updates/world/2012_06_05_01_world_gossip_sai.sql @@ -0,0 +1,23 @@ +-- Lorax SAI +SET @ENTRY := 10918; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,62,0,100,0,3051,0,0,0,5,11,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lorax - On Gossip Option Select - Laugh emote'), +(@ENTRY,0,1,2,62,0,100,0,3054,0,0,0,15,5126,0,0,0,0,0,7,0,0,0,0,0,0,0,'Lorax - On Gossip Option Select - Give Quest Credit'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Lorax - On Gossip Option Select - Close gossip'); +-- Lorax Gossip +DELETE FROM `gossip_menu` WHERE `entry` IN (3050,3051,3052,3053,3054); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (3050,3759),(3051,3760),(3052,3761),(3053,3762),(3054,3763); +DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN 3049 AND 3054; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`) VALUES +(3049,0,0, 'You will have to excuse me, Lorax, I do not speak ''crazy''.',1,1,3050,0,0,0, ''), +(3050,0,0, 'My apologies, I did not realize that you could understand what I was saying. What is it you are doing out here?',1,1,3051,0,0,0, ''), +(3051,0,0, 'Do you? Perhaps you should tell me what it is that is bothering you',1,1,3052,0,0,0, ''), +(3052,0,0, 'What deal?',1,1,3053,0,0,0, ''), +(3053,0,0, 'So how did he break the deal?',1,1,3054,0,0,0, ''), +(3054,0,0, 'Perhaps I can be of some assistance. I will make a deal with you, Satyr. I shall recover this unforged breastplate and slay the beast. In exchange for this task, you will teach me how to create the breastplate',1,1,0,0,0,0, ''); +-- Add conditions for gossip options +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=3049; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,3049,0,0,9,5126,0,0,0,0,'','Only show gossip option if player has quest 5126'); diff --git a/src/server/scripts/Kalimdor/winterspring.cpp b/src/server/scripts/Kalimdor/winterspring.cpp index 6143fbaf74b..cdcfedb9892 100644 --- a/src/server/scripts/Kalimdor/winterspring.cpp +++ b/src/server/scripts/Kalimdor/winterspring.cpp @@ -24,7 +24,6 @@ SDCategory: Winterspring EndScriptData */ /* ContentData -npc_lorax npc_rivern_frostwind EndContentData */ @@ -32,71 +31,6 @@ EndContentData */ #include "ScriptedCreature.h" #include "ScriptedGossip.h" -/*###### -## npc_lorax -######*/ - -#define GOSSIP_HL "Talk to me" - -#define GOSSIP_SL1 "What do you do here?" -#define GOSSIP_SL2 "I can help you" -#define GOSSIP_SL3 "What deal?" -#define GOSSIP_SL4 "Then what happened?" -#define GOSSIP_SL5 "He is not safe, i'll make sure of that." - -class npc_lorax : public CreatureScript -{ -public: - npc_lorax() : CreatureScript("npc_lorax") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(3759, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(3760, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(3761, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - player->SEND_GOSSIP_MENU(3762, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - player->SEND_GOSSIP_MENU(3763, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(5126); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(5126) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } - -}; - /*###### ## npc_rivern_frostwind ######*/ @@ -132,6 +66,5 @@ public: void AddSC_winterspring() { - new npc_lorax(); new npc_rivern_frostwind(); } From f08bc7d5028d70716c2a2e13473607d85515fc14 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Tue, 5 Jun 2012 23:32:09 -0230 Subject: [PATCH 0955/1149] Core/Scripts: Script for Frostblade Shrine to start The Cleansing quest. Quest is not yet scripted. --- .../world/2012_06_05_03_world_script.sql | 2 ++ src/server/scripts/World/go_scripts.cpp | 28 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 sql/updates/world/2012_06_05_03_world_script.sql diff --git a/sql/updates/world/2012_06_05_03_world_script.sql b/sql/updates/world/2012_06_05_03_world_script.sql new file mode 100644 index 00000000000..d10247979d9 --- /dev/null +++ b/sql/updates/world/2012_06_05_03_world_script.sql @@ -0,0 +1,2 @@ +-- Frostblade Shrine Script for Quest The Cleansing +UPDATE `gameobject_template` SET `ScriptName`= 'go_frostblade_shrine' WHERE `entry`=186649; diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 790a9d0f814..e691aed7395 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -1245,6 +1245,33 @@ class go_veil_skith_cage : public GameObjectScript } }; +/*###### +## go_frostblade_shrine +######*/ + +enum TheCleansing +{ + QUEST_THE_CLEANSING_HORDE = 11317, + QUEST_THE_CLEANSING_ALLIANCE = 11322, + SPELL_CLEANSING_SOUL = 43351, +}; + +class go_frostblade_shrine : public GameObjectScript +{ +public: + go_frostblade_shrine() : GameObjectScript("go_frostblade_shrine") { } + + bool OnGossipHello(Player* player, GameObject* go) + { + if (player->GetQuestStatus(QUEST_THE_CLEANSING_HORDE) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_THE_CLEANSING_ALLIANCE) == QUEST_STATUS_INCOMPLETE) + { + go->UseDoorOrButton(10); + player->CastSpell(player,SPELL_CLEANSING_SOUL); + } + return true; + } +}; + void AddSC_go_scripts() { new go_cat_figurine; @@ -1285,4 +1312,5 @@ void AddSC_go_scripts() new go_gjalerbron_cage; new go_large_gjalerbron_cage; new go_veil_skith_cage; + new go_frostblade_shrine; } From ee194a4f43664604a92b11928b983c09abc7ab0f Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 6 Jun 2012 00:08:07 -0230 Subject: [PATCH 0956/1149] Core/Scripts: Addition to previous commit. --- src/server/scripts/World/go_scripts.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index e691aed7395..b566b3d3b5b 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -1254,6 +1254,7 @@ enum TheCleansing QUEST_THE_CLEANSING_HORDE = 11317, QUEST_THE_CLEANSING_ALLIANCE = 11322, SPELL_CLEANSING_SOUL = 43351, + SPELL_RECENT_MEDITATION = 61720, }; class go_frostblade_shrine : public GameObjectScript @@ -1263,12 +1264,13 @@ public: bool OnGossipHello(Player* player, GameObject* go) { - if (player->GetQuestStatus(QUEST_THE_CLEANSING_HORDE) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_THE_CLEANSING_ALLIANCE) == QUEST_STATUS_INCOMPLETE) - { - go->UseDoorOrButton(10); - player->CastSpell(player,SPELL_CLEANSING_SOUL); - } - return true; + if (!player->HasAura(SPELL_RECENT_MEDITATION)) + if (player->GetQuestStatus(QUEST_THE_CLEANSING_HORDE) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_THE_CLEANSING_ALLIANCE) == QUEST_STATUS_INCOMPLETE) + { + go->UseDoorOrButton(10); + player->CastSpell(player, SPELL_CLEANSING_SOUL); + } + return true; } }; From 810f21efbceaa2e3a4f9ca487c904dfaa5e7a4ba Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 6 Jun 2012 20:36:34 +0200 Subject: [PATCH 0957/1149] Core/Movement * Moved enter/exit vehicle packets to spline. * Fixed spline movement on transports such as elevators (for which we do not keep track of its exact position) - path will be using normal coordinates (not transport offsets) --- src/server/game/Entities/Unit/Unit.cpp | 64 +++------------- src/server/game/Entities/Unit/Unit.h | 48 ------------ src/server/game/Entities/Vehicle/Vehicle.cpp | 11 ++- .../game/Movement/Spline/MoveSplineFlag.h | 76 ++++++++++--------- .../game/Movement/Spline/MoveSplineInit.cpp | 20 ++--- .../game/Movement/Spline/MoveSplineInit.h | 25 ++++-- .../game/Movement/Spline/MoveSplineInitArgs.h | 4 +- 7 files changed, 91 insertions(+), 157 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index bb2d057bfaa..d415d06e76f 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -424,50 +424,6 @@ void Unit::DisableSpline() movespline->_Interrupt(); } -void Unit::SendMonsterMoveExitVehicle(Position const* newPos) -{ - WorldPacket data(SMSG_MONSTER_MOVE, 1+12+4+1+4+4+4+12+GetPackGUID().size()); - data.append(GetPackGUID()); - - data << uint8(GetTypeId() == TYPEID_PLAYER ? 1 : 0); // sets/unsets MOVEMENTFLAG2_UNK7 (0x40) - data << GetPositionX() << GetPositionY() << GetPositionZ(); - data << getMSTime(); - - data << uint8(SPLINETYPE_FACING_ANGLE); - data << float(GetOrientation()); // guess - data << uint32(SPLINEFLAG_TRANSPORT_EXIT); - data << uint32(0); // Time in between points - data << uint32(1); // 1 single waypoint - data << newPos->GetPositionX(); - data << newPos->GetPositionY(); - data << newPos->GetPositionZ(); - - SendMessageToSet(&data, true); -} - -void Unit::SendMonsterMoveTransport(Unit* vehicleOwner) -{ - // TODO: Turn into BuildMonsterMoveTransport packet and allow certain variables (for npc movement aboard vehicles) - WorldPacket data(SMSG_MONSTER_MOVE_TRANSPORT, GetPackGUID().size()+vehicleOwner->GetPackGUID().size() + 47); - data.append(GetPackGUID()); - data.append(vehicleOwner->GetPackGUID()); - data << int8(GetTransSeat()); - data << uint8(0); // sets/unsets MOVEMENTFLAG2_UNK7 (0x40) - data << GetPositionX() - vehicleOwner->GetPositionX(); - data << GetPositionY() - vehicleOwner->GetPositionY(); - data << GetPositionZ() - vehicleOwner->GetPositionZ(); - data << uint32(getMSTime()); // should be an increasing constant that indicates movement packet count - data << uint8(SPLINETYPE_FACING_ANGLE); - data << GetTransOffsetO(); // facing angle? - data << uint32(SPLINEFLAG_TRANSPORT); - data << uint32(GetTransTime()); // move time - data << uint32(1); // amount of waypoints - data << uint32(0); // waypoint X - data << uint32(0); // waypoint Y - data << uint32(0); // waypoint Z - SendMessageToSet(&data, true); -} - void Unit::resetAttackTimer(WeaponAttackType type) { m_attackTimer[type] = uint32(GetAttackTime(type) * m_modAttackSpeedPct[type]); @@ -16308,7 +16264,7 @@ Creature* Unit::GetVehicleCreatureBase() const uint64 Unit::GetTransGUID() const { if (GetVehicle()) - return GetVehicle()->GetBase()->GetGUID(); + return GetVehicleBase()->GetGUID(); if (GetTransport()) return GetTransport()->GetGUID(); @@ -17171,11 +17127,12 @@ void Unit::_ExitVehicle(Position const* exitPosition) Vehicle* vehicle = m_vehicle; m_vehicle = NULL; - SetControlled(false, UNIT_STATE_ROOT); // SMSG_MOVE_FORCE_UNROOT, ~MOVEMENTFLAG_ROOT + SetControlled(false, UNIT_STATE_ROOT); // SMSG_MOVE_FORCE_UNROOT, ~MOVEMENTFLAG_ROOT Position pos; - if (!exitPosition) // Exit position not specified - vehicle->GetBase()->GetPosition(&pos); + if (!exitPosition) // Exit position not specified + vehicle->GetBase()->GetPosition(&pos); // This should use passenger's current position, leaving it as it is now + // because we calculate positions incorrect (sometimes under map) else pos = *exitPosition; @@ -17190,14 +17147,17 @@ void Unit::_ExitVehicle(Position const* exitPosition) SendMessageToSet(&data, false); } - SendMonsterMoveExitVehicle(&pos); - Relocate(&pos); + Movement::MoveSplineInit init(*this); + init.MoveTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()); + init.SetFacing(GetOrientation()); + init.SetTransportExit(); + init.Launch(); + + //GetMotionMaster()->MoveFall(); // Enable this once passenger positions are calculater properly (see above) if (Player* player = ToPlayer()) player->ResummonPetTemporaryUnSummonedIfAny(); - SendMovementFlagUpdate(); - if (vehicle->GetBase()->HasUnitTypeMask(UNIT_MASK_MINION)) if (((Minion*)vehicle->GetBase())->GetOwner() == this) vehicle->Dismiss(); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 65a165b40d2..9b63de0cdb8 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -735,52 +735,6 @@ enum MovementFlags2 MOVEMENTFLAG2_UNK16 = 0x00008000, }; -enum SplineFlags -{ - SPLINEFLAG_NONE = 0x00000000, - SPLINEFLAG_FORWARD = 0x00000001, - SPLINEFLAG_BACKWARD = 0x00000002, - SPLINEFLAG_STRAFE_LEFT = 0x00000004, - SPLINEFLAG_STRAFE_RIGHT = 0x00000008, - SPLINEFLAG_TURN_LEFT = 0x00000010, - SPLINEFLAG_TURN_RIGHT = 0x00000020, - SPLINEFLAG_PITCH_UP = 0x00000040, - SPLINEFLAG_PITCH_DOWN = 0x00000080, - SPLINEFLAG_DONE = 0x00000100, - SPLINEFLAG_FALLING = 0x00000200, - SPLINEFLAG_NO_SPLINE = 0x00000400, - SPLINEFLAG_TRAJECTORY = 0x00000800, - SPLINEFLAG_WALK_MODE = 0x00001000, - SPLINEFLAG_FLYING = 0x00002000, - SPLINEFLAG_KNOCKBACK = 0x00004000, - SPLINEFLAG_FINAL_POINT = 0x00008000, - SPLINEFLAG_FINAL_TARGET = 0x00010000, - SPLINEFLAG_FINAL_FACING = 0x00020000, - SPLINEFLAG_CATMULL_ROM = 0x00040000, - SPLINEFLAG_CYCLIC = 0x00080000, - SPLINEFLAG_ENTER_CYCLE = 0x00100000, - SPLINEFLAG_ANIMATION_TIER = 0x00200000, - SPLINEFLAG_FROZEN = 0x00400000, - SPLINEFLAG_TRANSPORT = 0x00800000, - SPLINEFLAG_TRANSPORT_EXIT = 0x01000000, - SPLINEFLAG_UNKNOWN7 = 0x02000000, - SPLINEFLAG_UNKNOWN8 = 0x04000000, - SPLINEFLAG_ORIENTATION_INVERTED = 0x08000000, - SPLINEFLAG_USE_PATH_SMOOTHING = 0x10000000, - SPLINEFLAG_ANIMATION = 0x20000000, - SPLINEFLAG_UNCOMPRESSED_PATH = 0x40000000, - SPLINEFLAG_UNKNOWN10 = 0x80000000, -}; - -enum SplineType -{ - SPLINETYPE_NORMAL = 0, - SPLINETYPE_STOP = 1, - SPLINETYPE_FACING_SPOT = 2, - SPLINETYPE_FACING_TARGET = 3, - SPLINETYPE_FACING_ANGLE = 4, -}; - enum UnitTypeMask { UNIT_MASK_NONE = 0x00000000, @@ -1662,9 +1616,7 @@ class Unit : public WorldObject void MonsterMoveWithSpeed(float x, float y, float z, float speed); //void SetFacing(float ori, WorldObject* obj = NULL); - void SendMonsterMoveExitVehicle(Position const* newPos); //void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = NULL); - void SendMonsterMoveTransport(Unit* vehicleOwner); void SendMovementFlagUpdate(); /*! These methods send the same packet to the client in apply and unapply case. diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index 04bcfdcc375..710821f2f24 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -28,6 +28,7 @@ #include "ZoneScript.h" #include "SpellMgr.h" #include "SpellInfo.h" +#include "MoveSplineInit.h" Vehicle::Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry) : _me(unit), _vehicleInfo(vehInfo), _usableSeatNum(0), _creatureEntry(creatureEntry) { @@ -364,7 +365,12 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) unit->SendClearTarget(); // SMSG_BREAK_TARGET unit->SetControlled(true, UNIT_STATE_ROOT); // SMSG_FORCE_ROOT - In some cases we send SMSG_SPLINE_MOVE_ROOT here (for creatures) // also adds MOVEMENTFLAG_ROOT - unit->SendMonsterMoveTransport(_me); // SMSG_MONSTER_MOVE_TRANSPORT + Movement::MoveSplineInit init(*unit); + init.DisableTransportPathTransformations(); + init.MoveTo(veSeat->m_attachmentOffsetX, veSeat->m_attachmentOffsetY, veSeat->m_attachmentOffsetZ); + init.SetFacing(0.0f); + init.SetTransportEnter(); + init.Launch(); if (_me->GetTypeId() == TYPEID_UNIT) { @@ -372,7 +378,8 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) _me->ToCreature()->AI()->PassengerBoarded(unit, seat->first, true); // update all passenger's positions - RelocatePassengers(_me->GetPositionX(), _me->GetPositionY(), _me->GetPositionZ(), _me->GetOrientation()); + //Passenger's spline OR vehicle movement will update positions + //RelocatePassengers(_me->GetPositionX(), _me->GetPositionY(), _me->GetPositionZ(), _me->GetOrientation()); } } diff --git a/src/server/game/Movement/Spline/MoveSplineFlag.h b/src/server/game/Movement/Spline/MoveSplineFlag.h index 33973064e09..cfc2fdee450 100644 --- a/src/server/game/Movement/Spline/MoveSplineFlag.h +++ b/src/server/game/Movement/Spline/MoveSplineFlag.h @@ -34,43 +34,43 @@ namespace Movement { public: enum eFlags{ - None = 0x00000000, - // x00-xFF(first byte) used as animation Ids storage in pair with Animation flag - Done = 0x00000100, - Falling = 0x00000200, // Affects elevation computation, can't be combined with Parabolic flag - No_Spline = 0x00000400, - Parabolic = 0x00000800, // Affects elevation computation, can't be combined with Falling flag - Walkmode = 0x00001000, - Flying = 0x00002000, // Smooth movement(Catmullrom interpolation mode), flying animation - OrientationFixed = 0x00004000, // Model orientation fixed - Final_Point = 0x00008000, - Final_Target = 0x00010000, - Final_Angle = 0x00020000, - Catmullrom = 0x00040000, // Used Catmullrom interpolation mode - Cyclic = 0x00080000, // Movement by cycled spline - Enter_Cycle = 0x00100000, // Everytimes appears with cyclic flag in monster move packet, erases first spline vertex after first cycle done - Animation = 0x00200000, // Plays animation after some time passed - Frozen = 0x00400000, // Will never arrive - Unknown5 = 0x00800000, - Unknown6 = 0x01000000, - Unknown7 = 0x02000000, - Unknown8 = 0x04000000, + None = 0x00000000, + // x00-xFF(first byte) used as animation Ids storage in pair with Animation flag + Done = 0x00000100, + Falling = 0x00000200, // Affects elevation computation, can't be combined with Parabolic flag + No_Spline = 0x00000400, + Parabolic = 0x00000800, // Affects elevation computation, can't be combined with Falling flag + Walkmode = 0x00001000, + Flying = 0x00002000, // Smooth movement(Catmullrom interpolation mode), flying animation + OrientationFixed = 0x00004000, // Model orientation fixed + Final_Point = 0x00008000, + Final_Target = 0x00010000, + Final_Angle = 0x00020000, + Catmullrom = 0x00040000, // Used Catmullrom interpolation mode + Cyclic = 0x00080000, // Movement by cycled spline + Enter_Cycle = 0x00100000, // Everytimes appears with cyclic flag in monster move packet, erases first spline vertex after first cycle done + Animation = 0x00200000, // Plays animation after some time passed + Frozen = 0x00400000, // Will never arrive + TransportEnter = 0x00800000, + TransportExit = 0x01000000, + Unknown7 = 0x02000000, + Unknown8 = 0x04000000, OrientationInversed = 0x08000000, - Unknown10 = 0x10000000, - Unknown11 = 0x20000000, - Unknown12 = 0x40000000, - Unknown13 = 0x80000000, + Unknown10 = 0x10000000, + Unknown11 = 0x20000000, + Unknown12 = 0x40000000, + Unknown13 = 0x80000000, // Masks - Mask_Final_Facing = Final_Point | Final_Target | Final_Angle, + Mask_Final_Facing = Final_Point | Final_Target | Final_Angle, // animation ids stored here, see AnimType enum, used with Animation flag - Mask_Animations = 0xFF, + Mask_Animations = 0xFF, // flags that shouldn't be appended into SMSG_MONSTER_MOVE\SMSG_MONSTER_MOVE_TRANSPORT packet, should be more probably Mask_No_Monster_Move = Mask_Final_Facing | Mask_Animations | Done, // CatmullRom interpolation mode used - Mask_CatmullRom = Flying | Catmullrom, + Mask_CatmullRom = Flying | Catmullrom, // Unused, not suported flags - Mask_Unused = No_Spline|Enter_Cycle|Frozen|Unknown5|Unknown6|Unknown7|Unknown8|Unknown10|Unknown11|Unknown12|Unknown13, + Mask_Unused = No_Spline|Enter_Cycle|Frozen|Unknown7|Unknown8|Unknown10|Unknown11|Unknown12|Unknown13, }; inline uint32& raw() { return (uint32&)*this;} @@ -98,14 +98,16 @@ namespace Movement void operator &= (uint32 f) { raw() &= f;} void operator |= (uint32 f) { raw() |= f;} - void EnableAnimation(uint8 anim) { raw() = (raw() & ~(Mask_Animations|Falling|Parabolic)) | Animation|anim;} - void EnableParabolic() { raw() = (raw() & ~(Mask_Animations|Falling|Animation)) | Parabolic;} - void EnableFalling() { raw() = (raw() & ~(Mask_Animations|Parabolic|Animation)) | Falling;} + void EnableAnimation(uint8 anim) { raw() = (raw() & ~(Mask_Animations | Falling | Parabolic)) | Animation | anim; } + void EnableParabolic() { raw() = (raw() & ~(Mask_Animations | Falling | Animation)) | Parabolic; } + void EnableFalling() { raw() = (raw() & ~(Mask_Animations | Parabolic | Animation)) | Falling; } void EnableFlying() { raw() = (raw() & ~Catmullrom) | Flying; } void EnableCatmullRom() { raw() = (raw() & ~Flying) | Catmullrom; } - void EnableFacingPoint() { raw() = (raw() & ~Mask_Final_Facing) | Final_Point;} - void EnableFacingAngle() { raw() = (raw() & ~Mask_Final_Facing) | Final_Angle;} - void EnableFacingTarget() { raw() = (raw() & ~Mask_Final_Facing) | Final_Target;} + void EnableFacingPoint() { raw() = (raw() & ~Mask_Final_Facing) | Final_Point; } + void EnableFacingAngle() { raw() = (raw() & ~Mask_Final_Facing) | Final_Angle; } + void EnableFacingTarget() { raw() = (raw() & ~Mask_Final_Facing) | Final_Target; } + void EnableTransportEnter() { raw() = (raw() & ~TransportExit) | TransportEnter; } + void EnableTransportExit() { raw() = (raw() & ~TransportEnter) | TransportExit; } uint8 animId : 8; bool done : 1; @@ -123,8 +125,8 @@ namespace Movement bool enter_cycle : 1; bool animation : 1; bool frozen : 1; - bool unknown5 : 1; - bool unknown6 : 1; + bool transportEnter: 1; + bool transportExit : 1; bool unknown7 : 1; bool unknown8 : 1; bool orientationInversed : 1; diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index c5f959e2f1d..ffc09a10e22 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -62,7 +62,8 @@ namespace Movement bool transport = false; Location real_position(unit.GetPositionX(), unit.GetPositionY(), unit.GetPositionZMinusOffset(), unit.GetOrientation()); - if (unit.HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + // Elevators also use MOVEMENTFLAG_ONTRANSPORT but we do not keep track of their position changes + if (unit.HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && unit.GetTransGUID()) { transport = true; real_position.x = unit.GetTransOffsetX(); @@ -108,13 +109,7 @@ namespace Movement data.append(unit.GetPackGUID()); if (transport) { - if (unit.GetVehicle()) - data.appendPackGUID(unit.GetVehicleBase()->GetGUID()); - else if (unit.GetTransport()) - data.appendPackGUID(unit.GetTransGUID()); - else - data << uint8(0); - + data.appendPackGUID(unit.GetTransGUID()); data << int8(unit.GetTransSeat()); } @@ -124,6 +119,8 @@ namespace Movement MoveSplineInit::MoveSplineInit(Unit& m) : unit(m) { + // Elevators also use MOVEMENTFLAG_ONTRANSPORT but we do not keep track of their position changes + args.TransformForTransport = unit.HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && unit.GetTransGUID(); // mix existing state into new args.flags.walkmode = unit.m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING); args.flags.flying = unit.m_movementInfo.HasMovementFlag((MovementFlags)(MOVEMENTFLAG_CAN_FLY|MOVEMENTFLAG_DISABLE_GRAVITY)); @@ -138,7 +135,7 @@ namespace Movement void MoveSplineInit::SetFacing(float angle) { - if (unit.HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + if (args.TransformForTransport) { if (Unit* vehicle = unit.GetVehicleBase()) angle -= vehicle->GetOrientation(); @@ -154,13 +151,13 @@ namespace Movement { args.path_Idx_offset = 0; args.path.resize(2); - TransportPathTransform transform(unit); + TransportPathTransform transform(unit, args.TransformForTransport); args.path[1] = transform(dest); } Vector3 TransportPathTransform::operator()(Vector3 input) { - if (_owner.HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + if (_transformForTransport) { if (Unit* vehicle = _owner.GetVehicleBase()) { @@ -177,5 +174,4 @@ namespace Movement return input; } - } diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h index 786324e3f77..ef847809ac8 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.h +++ b/src/server/game/Movement/Spline/MoveSplineInit.h @@ -37,11 +37,13 @@ namespace Movement class TransportPathTransform { public: - TransportPathTransform(Unit& owner) : _owner(owner) { } + TransportPathTransform(Unit& owner, bool transformForTransport) + : _owner(owner), _transformForTransport(transformForTransport) { } Vector3 operator()(Vector3 input); private: Unit& _owner; + bool _transformForTransport; }; /* Initializes and launches spline movement @@ -107,6 +109,12 @@ namespace Movement /* Enables falling mode. Disabled by default */ void SetFall(); + /* Enters transport. Disabled by default + */ + void SetTransportEnter(); + /* Exits transport. Disabled by default + */ + void SetTransportExit(); /* Inverses unit model orientation. Disabled by default */ void SetOrientationInversed(); @@ -123,31 +131,36 @@ namespace Movement PointsArray& Path() { return args.path; } + /* Disables transport coordinate transformations for cases where raw offsets are available + */ + void DisableTransportPathTransformations(); protected: MoveSplineInitArgs args; Unit& unit; }; - inline void MoveSplineInit::SetFly() { args.flags.EnableFlying();} + inline void MoveSplineInit::SetFly() { args.flags.EnableFlying(); } inline void MoveSplineInit::SetWalk(bool enable) { args.flags.walkmode = enable;} inline void MoveSplineInit::SetSmooth() { args.flags.EnableCatmullRom();} inline void MoveSplineInit::SetCyclic() { args.flags.cyclic = true;} inline void MoveSplineInit::SetFall() { args.flags.EnableFalling();} inline void MoveSplineInit::SetVelocity(float vel) { args.velocity = vel; args.HasVelocity = true; } inline void MoveSplineInit::SetOrientationInversed() { args.flags.orientationInversed = true;} + inline void MoveSplineInit::SetTransportEnter() { args.flags.EnableTransportEnter(); } + inline void MoveSplineInit::SetTransportExit() { args.flags.EnableTransportExit(); } inline void MoveSplineInit::SetOrientationFixed(bool enable) { args.flags.orientationFixed = enable;} inline void MoveSplineInit::MovebyPath(const PointsArray& controls, int32 path_offset) { args.path_Idx_offset = path_offset; args.path.resize(controls.size()); - std::transform(controls.begin(), controls.end(), args.path.begin(), TransportPathTransform(unit)); + std::transform(controls.begin(), controls.end(), args.path.begin(), TransportPathTransform(unit, args.TransformForTransport)); } inline void MoveSplineInit::MoveTo(float x, float y, float z) { - Vector3 v(x,y,z); + Vector3 v(x, y, z); MoveTo(v); } @@ -166,12 +179,14 @@ namespace Movement inline void MoveSplineInit::SetFacing(Vector3 const& spot) { - TransportPathTransform transform(unit); + TransportPathTransform transform(unit, args.TransformForTransport); Vector3 finalSpot = transform(spot); args.facing.f.x = finalSpot.x; args.facing.f.y = finalSpot.y; args.facing.f.z = finalSpot.z; args.flags.EnableFacingPoint(); } + + inline void MoveSplineInit::DisableTransportPathTransformations() { args.TransformForTransport = false; } } #endif // TRINITYSERVER_MOVESPLINEINIT_H diff --git a/src/server/game/Movement/Spline/MoveSplineInitArgs.h b/src/server/game/Movement/Spline/MoveSplineInitArgs.h index 74409c9562b..de02b35d0a0 100644 --- a/src/server/game/Movement/Spline/MoveSplineInitArgs.h +++ b/src/server/game/Movement/Spline/MoveSplineInitArgs.h @@ -42,7 +42,8 @@ namespace Movement struct MoveSplineInitArgs { MoveSplineInitArgs(size_t path_capacity = 16) : path_Idx_offset(0), - velocity(0.f), parabolic_amplitude(0.f), time_perc(0.f), splineId(0), initialOrientation(0.f), HasVelocity(false) + velocity(0.f), parabolic_amplitude(0.f), time_perc(0.f), splineId(0), initialOrientation(0.f), + HasVelocity(false), TransformForTransport(true) { path.reserve(path_capacity); } @@ -57,6 +58,7 @@ namespace Movement uint32 splineId; float initialOrientation; bool HasVelocity; + bool TransformForTransport; /** Returns true to show that the arguments were configured correctly and MoveSpline initialization will succeed. */ bool Validate() const; From a0311b645c34cc34e17d5c3ec53a53cd59016dce Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 6 Jun 2012 16:52:55 -0230 Subject: [PATCH 0958/1149] DB/Gossip: Fix Lorax quest script --- .../world/2012_06_06_00_world_script.sql | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 sql/updates/world/2012_06_06_00_world_script.sql diff --git a/sql/updates/world/2012_06_06_00_world_script.sql b/sql/updates/world/2012_06_06_00_world_script.sql new file mode 100644 index 00000000000..727d28e8ea9 --- /dev/null +++ b/sql/updates/world/2012_06_06_00_world_script.sql @@ -0,0 +1,27 @@ +-- Remove Mistake +DELETE FROM `gossip_menu` WHERE `entry` IN (3050,3051,3052,3053,3054); +DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN 3050 AND 3054; +-- Lorax SAI +SET @ENTRY := 10918; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,62,0,100,0,21323,0,0,0,5,11,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lorax - On Gossip Option Select - Laugh emote'), +(@ENTRY,0,1,2,62,0,100,0,21326,0,0,0,15,5126,0,0,0,0,0,7,0,0,0,0,0,0,0,'Lorax - On Gossip Option Select - Give Quest Credit'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Lorax - On Gossip Option Select - Close gossip'); +-- Lorax Gossip +DELETE FROM `gossip_menu` WHERE `entry` IN (21322,21323,21324,21325,21326); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (21322,3759),(21323,3760),(21324,3761),(21325,3762),(21326,3763); +DELETE FROM `gossip_menu_option` WHERE `menu_id`=3049; +DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN 21322 AND 21326; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`) VALUES +(3049,0,0, 'You will have to excuse me, Lorax, I do not speak ''crazy''.',1,1,21322,0,0,0, ''), +(21322,0,0, 'My apologies, I did not realize that you could understand what I was saying. What is it you are doing out here?',1,1,21323,0,0,0, ''), +(21323,0,0, 'Do you? Perhaps you should tell me what it is that is bothering you',1,1,21324,0,0,0, ''), +(21324,0,0, 'What deal?',1,1,21325,0,0,0, ''), +(21325,0,0, 'So how did he break the deal?',1,1,21326,0,0,0, ''), +(21326,0,0, 'Perhaps I can be of some assistance. I will make a deal with you, Satyr. I shall recover this unforged breastplate and slay the beast. In exchange for this task, you will teach me how to create the breastplate',1,1,0,0,0,0, ''); +-- Add conditions for gossip options +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=3049; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,3049,0,0,9,5126,0,0,0,0,'','Only show gossip option if player has quest 5126'); From 3e3a940a1c1904353058ef5b00dd683a696968dd Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 6 Jun 2012 18:54:13 -0230 Subject: [PATCH 0959/1149] DB/SAI: Fix for Quest 11317 & 11322 "The Cleansing" --- sql/updates/world/2012_06_06_01_world_sai.sql | 42 +++++++++++++++++++ src/server/scripts/World/go_scripts.cpp | 1 + 2 files changed, 43 insertions(+) create mode 100644 sql/updates/world/2012_06_06_01_world_sai.sql diff --git a/sql/updates/world/2012_06_06_01_world_sai.sql b/sql/updates/world/2012_06_06_01_world_sai.sql new file mode 100644 index 00000000000..97e175652d2 --- /dev/null +++ b/sql/updates/world/2012_06_06_01_world_sai.sql @@ -0,0 +1,42 @@ +-- Fix for Quest 11317 & 11322 "The Cleansing" +-- Your Inner Turmoil SAI +SET @ENTRY := 27959; +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`unit_flags`=`unit_flags`|256,`AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY*100 AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,54,0,100,0,0,0,0,0,11,41408,2,0,0,0,0,1,0,0,0,0,0,0,0,'Your Inner Turmoil - On Summon - Cast Shadowform on self'), +(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,85,50218,2,0,0,0,0,1,0,0,0,0,0,0,0,'Your Inner Turmoil - On Summon - Player Cast The Cleansing: Your Inner Turmoil''s Mirror Image Aura on npc'), +(@ENTRY,0,2,3,61,0,100,0,0,0,0,0,85,41054,2,0,0,0,0,1,0,0,0,0,0,0,0,'Your Inner Turmoil - On Summon - Player Cast Copy Weapon on npc'), +(@ENTRY,0,3,4,61,0,100,0,0,0,0,0,85,41055,2,0,0,0,0,1,0,0,0,0,0,0,0,'Your Inner Turmoil - On Summon - Player Cast Copy Weapon on npc'), +(@ENTRY,0,4,5,61,0,100,0,0,0,0,0,85,45205,2,0,0,0,0,1,0,0,0,0,0,0,0,'Your Inner Turmoil - On Summon - Player Cast Copy Offhand Weapon on npc'), +(@ENTRY,0,5,6,61,0,100,0,0,0,0,0,85,45206,2,0,0,0,0,1,0,0,0,0,0,0,0,'Your Inner Turmoil - On Summon - Player Cast Copy Offhand Weapon on npc'), +(@ENTRY,0,6,0,61,0,100,0,0,0,0,0,80,@ENTRY*100,2,0,0,0,0,1,0,0,0,0,0,0,0,'Your Inner Turmoil - On Summon - Run Script'), +(@ENTRY,0,7,0,2,0,100,1,0,50,0,0,1,2,2,0,0,0,0,1,0,0,0,0,0,0,0,'Your Inner Turmoil - @50%hp - Say 2'), +(@ENTRY,0,8,9,6,0,100,1,0,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Your Inner Turmoil - On death - Say 3'), +(@ENTRY,0,9,0,61,0,100,1,0,0,0,0,3,0,11686,0,0,0,0,1,0,0,0,0,0,0,0,'Your Inner Turmoil - On death - set model'), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Your Inner Turmoil - Script - Turn to invoker'), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Your Inner Turmoil - Script - Say 0'), +(@ENTRY*100,9,2,0,0,0,100,0,6000,6000,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Your Inner Turmoil - Script - Turn to invoker'), +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,7,0,0,0,0,0,0,0,'Your Inner Turmoil - Script - Say 1'), +(@ENTRY*100,9,4,0,0,0,100,0,7000,7000,0,0,19,256,0,0,0,0,0,1,0,0,0,0,0,0,0,'Your Inner Turmoil - Script - remove unit flags'), +(@ENTRY*100,9,5,0,0,0,100,0,0,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Your Inner Turmoil - Script - Attack invoker'); +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,'You think that you can get rid of me through meditation?',15,0,100,0,0,0,'Your Inner Turmoil text 0'), +(@ENTRY,1,0,'Fool! I will destroy you and finally become that which has been building inside of you all of these years!',15,0,100,0,0,0,'Your Inner Turmoil text 1'), +(@ENTRY,2,0,'You cannot defeat me. I''m an inseparable part of you!',15,0,100,0,0,0,'Your Inner Turmoil text 50%'), +(@ENTRY,3,0,'NOOOOOOOoooooooooo!',15,0,100,0,0,0,'Your Inner Turmoil text death'); +-- Spell Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (50218,41054,41055,45205,45206); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,50218,0,31,3,27959,0,0,'','Spell 50218 can target Your Inner Turmoil'), +(13,1,41054,0,31,3,27959,0,0,'','Spell 41054 can target Your Inner Turmoil'), +(13,1,41055,0,31,3,27959,0,0,'','Spell 41055 can target Your Inner Turmoil'), +(13,1,45205,0,31,3,27959,0,0,'','Spell 45205 can target Your Inner Turmoil'), +(13,1,45206,0,31,3,27959,0,0,'','Spell 45206 can target Your Inner Turmoil'); +-- Spell Linking +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=-43351; +INSERT INTO spell_linked_spell VALUES +(-43351,50167,0, ''), +(-43351,61720,0, ''); diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index b566b3d3b5b..308c7f9afa3 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -1269,6 +1269,7 @@ public: { go->UseDoorOrButton(10); player->CastSpell(player, SPELL_CLEANSING_SOUL); + player->SetStandState(UNIT_STAND_STATE_SIT); } return true; } From e4af5e4e2f88a200353ac2f17f75df9db289f3d7 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 6 Jun 2012 19:05:17 -0230 Subject: [PATCH 0960/1149] Core/Misc: A couple misc fixes. --- src/server/game/Spells/SpellMgr.cpp | 4 +++- src/server/scripts/Kalimdor/winterspring.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 05566bdf712..d9459b11ba1 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3043,9 +3043,11 @@ void SpellMgr::LoadDbcDataCorrections() case 61588: // Blazing Harpoon case 52479: // Gift of the Harvester case 48246: // Ball of Flame - case 36384: // Skartax Purple Beam spellInfo->MaxAffectedTargets = 1; break; + case 36384: // Skartax Purple Beam + spellInfo->MaxAffectedTargets = 2; + break; case 41376: // Spite case 39992: // Needle Spine case 29576: // Multi-Shot diff --git a/src/server/scripts/Kalimdor/winterspring.cpp b/src/server/scripts/Kalimdor/winterspring.cpp index cdcfedb9892..2c4da0fdf7c 100644 --- a/src/server/scripts/Kalimdor/winterspring.cpp +++ b/src/server/scripts/Kalimdor/winterspring.cpp @@ -18,8 +18,8 @@ /* ScriptData SDName: Winterspring -SD%Complete: 90 -SDComment: Quest support: 5126 (Loraxs' tale missing proper gossip items text). Vendor Rivern Frostwind. Obtain Cache of Mau'ari +SD%Complete: Almost Completely Emptied +SDComment: Vendor Rivern Frostwind. SDCategory: Winterspring EndScriptData */ From 5ed8d2ccd401a1133b4caa6c2d574efb84645724 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 6 Jun 2012 22:30:58 -0230 Subject: [PATCH 0961/1149] DB/SAI: Fix Quest 11307 "Field Test" Now more like offi --- sql/updates/world/2012_06_06_02_world_sai.sql | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sql/updates/world/2012_06_06_02_world_sai.sql diff --git a/sql/updates/world/2012_06_06_02_world_sai.sql b/sql/updates/world/2012_06_06_02_world_sai.sql new file mode 100644 index 00000000000..297409ed776 --- /dev/null +++ b/sql/updates/world/2012_06_06_02_world_sai.sql @@ -0,0 +1,91 @@ +-- Fix Quest 11307 "Field Test" + +-- Remove hack +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=43385; + +-- Fix Plagued Proto-Dragon +UPDATE `creature_addon` SET `bytes1`=50331648 WHERE guid=107626; + +-- Plagued Dragonflayer Tribesman SAI +SET @ENTRY := 23564; +SET @SPELL1 := 15496; -- Cleave +SET @SPELL2 := 32736; -- Mortal Strike +SET @SPELL3 := 43506; -- Plague Blight +SET @SPELL4 := 43381; -- Plague Spray +SET @SPELL5 := 43384; -- Plague Credit +SET @SPELL6 := 43327; -- Vomit +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +UPDATE `creature_addon` SET `auras`= '21862' WHERE guid IN (SELECT guid FROM creature WHERE id=@ENTRY); +DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY; +INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES (@ENTRY,1,'21862'); +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,2,0,100,1,0,95,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Plagued Dragonflayer Tribesman - HP@95% - Set Phase 1'), +(@ENTRY,0,1,0,0,0,100,0,1000,1000,4000,5000,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0,'Plagued Dragonflayer Tribesman - Combat - Cast Cleave'), +(@ENTRY,0,2,0,0,0,100,0,2000,4000,5000,8000,11,@SPELL2,0,0,0,0,0,2,0,0,0,0,0,0,0,'Plagued Dragonflayer Tribesman - Combat - Cast Mortal Strike'), +(@ENTRY,0,3,0,2,0,100,1,0,75,0,0,11,@SPELL3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Plagued Dragonflayer Tribesman - HP@75% - Cast Plague Blight'), +(@ENTRY,0,4,0,23,1,100,0,@SPELL4,1,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Plagued Dragonflayer Tribesman - On Aura - Set phase 0 (phase 1)'), +(@ENTRY,0,5,0,0,1,100,0,1000,1000,1000,1000,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Plagued Dragonflayer Tribesman - Combat - Set phase 2 (phase 1)'), +(@ENTRY,0,6,0,23,2,100,0,@SPELL4,1,0,0,22,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Plagued Dragonflayer Tribesman - On Spell Hit - Set Phase 3 (phase 2)'), +(@ENTRY,0,7,0,0,4,100,0,0,0,10000,10000,49,0,0,0,0,0,0,5,0,0,0,0,0,0,0,'Plagued Dragonflayer Tribesman - Combat - Attack Random target (phase 3)'), +(@ENTRY,0,8,0,6,4,100,0,0,0,0,0,85,@SPELL5,0,0,0,0,0,16,0,0,0,0,0,0,0,'Plagued Dragonflayer Tribesman - On Death - Give Killcredit (phase 3)'), +(@ENTRY,0,9,0,1,0,35,0,0,30000,25000,45000,11,@SPELL6,0,0,0,0,0,1,0,0,0,0,0,0,0,'Plagued Dragonflayer Tribesman - OOC - Cast 43327 on self'), +(@ENTRY,0,10,11,23,0,100,1,@SPELL4,1,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,'Plagued Dragonflayer Tribesman - On Spell Hit - Say 0'), +(@ENTRY,0,11,0,61,0,100,0,0,0,0,0,2,1925,0,0,0,0,0,1,0,0,0,0,0,0,0,'Plagued Dragonflayer Tribesman - On Spell Hit - Set Faction'); +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,'%s loses all self control and begins to attack friend and foe alike!',16,0,100,0,0,0,'Plagued Dragonflayer Tribesman'); + +-- Plagued Dragonflayer Rune-Caster SAI +SET @ENTRY := 24199; +SET @SPELL1 := 47782; -- Corruption +SET @SPELL2 := 15616; -- Flame Shock +SET @SPELL3 := 43381; -- Plague Spray +SET @SPELL4 := 43384; -- Plague Credit +SET @SPELL5 := 43327; -- Vomit +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +UPDATE `creature_addon` SET `auras`= '21862' WHERE guid IN (SELECT guid FROM creature WHERE id=@ENTRY); +DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY; +INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES (@ENTRY,1,'21862'); +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,2,0,100,1,0,95,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Plagued Dragonflayer Rune-Caster - HP@95% - Set Phase 1'), +(@ENTRY,0,1,0,4,0,100,0,0,0,0,0,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0,'Plagued Dragonflayer Rune-Caster - On aggro - Cast Corruption'), +(@ENTRY,0,2,0,0,0,100,0,2000,4000,15000,17000,11,@SPELL2,0,0,0,0,0,5,0,0,0,0,0,0,0,'Plagued Dragonflayer Rune-Caster - Combat - Cast Flame Shock'), +(@ENTRY,0,3,0,23,1,100,0,@SPELL3,1,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Plagued Dragonflayer Rune-Caster - On Aura - Set phase 0 (phase 1)'), +(@ENTRY,0,4,0,0,1,100,0,1000,1000,1000,1000,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Plagued Dragonflayer Rune-Caster - Combat - Set phase 2 (phase 1)'), +(@ENTRY,0,5,0,23,2,100,0,@SPELL3,1,0,0,22,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Plagued Dragonflayer Rune-Caster - On Spell Hit - Set Phase 3 (phase 2)'), +(@ENTRY,0,6,0,0,4,100,0,0,0,10000,10000,49,0,0,0,0,0,0,5,0,0,0,0,0,0,0,'Plagued Dragonflayer Rune-Caster - Combat - Attack Random target (phase 3)'), +(@ENTRY,0,7,0,6,4,100,0,0,0,0,0,85,@SPELL4,0,0,0,0,0,16,0,0,0,0,0,0,0,'Plagued Dragonflayer Rune-Caster - On Death - Give Killcredit (phase 3)'), +(@ENTRY,0,8,0,1,0,35,0,0,30000,25000,45000,11,@SPELL5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Plagued Dragonflayer Rune-Caster - OOC - Cast 43327 on self'), +(@ENTRY,0,9,10,23,0,100,1,@SPELL3,1,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,'Plagued Dragonflayer Rune-Caster - On Spell Hit - Say 0'), +(@ENTRY,0,10,0,61,0,100,0,0,0,0,0,2,1925,0,0,0,0,0,1,0,0,0,0,0,0,0,'Plagued Dragonflayer Rune-Caster - On Spell Hit - Set Faction'); +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,'%s loses all self control and begins to attack friend and foe alike!',16,0,100,0,0,0,'Plagued Dragonflayer Rune-Caster'); + +-- Plagued Dragonflayer Handler SAI +SET @ENTRY := 24199; +SET @SPELL1 := 43506; -- Plague Blight +SET @SPELL2 := 43381; -- Plague Spray +SET @SPELL3 := 43384; -- Plague Credit +SET @SPELL4 := 43327; -- Vomit +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +UPDATE `creature_addon` SET `auras`= '21862' WHERE guid IN (SELECT guid FROM creature WHERE id=@ENTRY); +DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY; +INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES (@ENTRY,1,'21862'); +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,2,0,100,1,0,95,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Plagued Dragonflayer Handler - HP@95% - Set Phase 1'), +(@ENTRY,0,1,0,2,0,100,1,0,75,0,0,11,@SPELL1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Plagued Dragonflayer Handler - HP@75% - Cast Plague Blight'), +(@ENTRY,0,2,0,23,1,100,0,@SPELL2,1,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Plagued Dragonflayer Handler - On Aura - Set phase 0 (phase 1)'), +(@ENTRY,0,3,0,0,1,100,0,1000,1000,1000,1000,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Plagued Dragonflayer Handler - Combat - Set phase 2 (phase 1)'), +(@ENTRY,0,4,0,23,2,100,0,@SPELL2,1,0,0,22,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Plagued Dragonflayer Handler - On Spell Hit - Set Phase 3 (phase 2)'), +(@ENTRY,0,5,0,0,4,100,0,0,0,10000,10000,49,0,0,0,0,0,0,5,0,0,0,0,0,0,0,'Plagued Dragonflayer Handler - Combat - Attack Random target (phase 3)'), +(@ENTRY,0,6,0,6,4,100,0,0,0,0,0,85,@SPELL3,0,0,0,0,0,16,0,0,0,0,0,0,0,'Plagued Dragonflayer Handler - On Death - Give Killcredit (phase 3)'), +(@ENTRY,0,7,0,1,0,35,0,0,30000,25000,45000,11,@SPELL4,0,0,0,0,0,1,0,0,0,0,0,0,0,'Plagued Dragonflayer Handler - OOC - Cast 43327 on self'), +(@ENTRY,0,8,9,23,0,100,1,@SPELL2,1,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,'Plagued Dragonflayer Handler - On Spell Hit - Say 0'), +(@ENTRY,0,9,0,61,0,100,0,0,0,0,0,2,1925,0,0,0,0,0,1,0,0,0,0,0,0,0,'Plagued Dragonflayer Handler - On Spell Hit - Set Faction'); +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,'%s loses all self control and begins to attack friend and foe alike!',16,0,100,0,0,0,'Plagued Dragonflayer Handler'); From 3968d2e2d22b38b6796c4f793bf97ccc83d281c9 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 6 Jun 2012 22:54:49 -0230 Subject: [PATCH 0962/1149] Db/Conditions: Remove unneeded spell conditions. --- sql/updates/world/2012_06_06_03_world_conditions.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_06_06_03_world_conditions.sql diff --git a/sql/updates/world/2012_06_06_03_world_conditions.sql b/sql/updates/world/2012_06_06_03_world_conditions.sql new file mode 100644 index 00000000000..c9af2a1bcbc --- /dev/null +++ b/sql/updates/world/2012_06_06_03_world_conditions.sql @@ -0,0 +1,2 @@ +-- Spell conditions shouldn't have been added +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (41054,41055,45205,45206); From 7b5bdc2fe55090c42d0256b65d5246bfb5c8857d Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 6 Jun 2012 23:39:52 -0230 Subject: [PATCH 0963/1149] DB/SAI: Add SAI for Forsaken Plaguebringer and fix weapon. --- sql/updates/world/2012_06_06_04_world_sai.sql | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 sql/updates/world/2012_06_06_04_world_sai.sql diff --git a/sql/updates/world/2012_06_06_04_world_sai.sql b/sql/updates/world/2012_06_06_04_world_sai.sql new file mode 100644 index 00000000000..af820f418be --- /dev/null +++ b/sql/updates/world/2012_06_06_04_world_sai.sql @@ -0,0 +1,19 @@ +-- Forsaken Plaguebringer SAI +SET @ENTRY := 23760; +SET @SPELL1 := 44005; -- Shoot Plague +SET @SPELL2 := 3436; -- Wandering Plague +SET @SPELL3 := 11978; -- Kick +SET @SPELL4 := 43333; -- Shoot Plague +UPDATE `creature_template` SET `equipment_id`=509,`AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY; +INSERT INTO `creature_template_addon` (`entry`,`bytes2`) VALUES (@ENTRY,2); +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,0,4000,11000,7000,11000,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0,'Forsaken Plaguebringer - Combat - Cast Shoot Plague'), +(@ENTRY,0,1,0,0,0,100,0,4000,10000,40000,50000,11,@SPELL2,0,0,0,0,0,2,0,0,0,0,0,0,0,'Forsaken Plaguebringer - Combat - Cast Wandering Plague'), +(@ENTRY,0,2,0,0,0,80,0,4000,12000,12000,18000,11,@SPELL3,0,0,0,0,0,2,0,0,0,0,0,0,0,'Forsaken Plaguebringer - Combat - Cast Kick'), +(@ENTRY,0,3,0,10,0,100,0,24042,40,6000,11000,11,@SPELL4,0,0,0,0,0,1,0,0,0,0,0,0,0,'Forsaken Plaguebringer - OOC - Cast Shoot Plague'); -- Not working correctly +-- Spell Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (43333); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,43333,0,31,3,24042,0,0,'','Spell 43333 can target Generic Trigger LAB - OLD'); From 8223bcea04aba481d5fc4faa12bd3cb82cbfb122 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 7 Jun 2012 14:56:41 +0200 Subject: [PATCH 0964/1149] SQL: Corrected file names --- ...emplate.sql => 2012_05_19_04_world_creature_loot_template.sql} | 0 ...plate.sql => 2012_05_19_05_world_gameobject_loot_template.sql} | 0 ...plate.sql => 2012_05_19_06_world_gameobject_loot_template.sql} | 0 ...03_waypoint_data.sql => 2012_05_28_03_world_waypoint_data.sql} | 0 ...e_hp.sql => 2012_06_02_03_world_creature_loot_template_hp.sql} | 0 ...e_zm.sql => 2012_06_02_03_world_creature_loot_template_zm.sql} | 0 ...mplate.sql => 2012_06_02_03_world_reference_loot_template.sql} | 0 ...mplate.sql => 2012_06_02_04_world_reference_loot_template.sql} | 0 ...mplate.sql => 2012_06_02_05_world_reference_loot_template.sql} | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename sql/updates/world/{2012_05_19_04_creature_loot_template.sql => 2012_05_19_04_world_creature_loot_template.sql} (100%) rename sql/updates/world/{2012_05_19_05_gameobject_loot_template.sql => 2012_05_19_05_world_gameobject_loot_template.sql} (100%) rename sql/updates/world/{2012_05_19_06_gameobject_loot_template.sql => 2012_05_19_06_world_gameobject_loot_template.sql} (100%) rename sql/updates/world/{2012_05_28_03_waypoint_data.sql => 2012_05_28_03_world_waypoint_data.sql} (100%) rename sql/updates/world/{2012_06_02_03_creature_loot_template_hp.sql => 2012_06_02_03_world_creature_loot_template_hp.sql} (100%) rename sql/updates/world/{2012_06_02_03_creature_loot_template_zm.sql => 2012_06_02_03_world_creature_loot_template_zm.sql} (100%) rename sql/updates/world/{2012_06_02_03_reference_loot_template.sql => 2012_06_02_03_world_reference_loot_template.sql} (100%) rename sql/updates/world/{2012_06_02_04_reference_loot_template.sql => 2012_06_02_04_world_reference_loot_template.sql} (100%) rename sql/updates/world/{2012_06_02_05_reference_loot_template.sql => 2012_06_02_05_world_reference_loot_template.sql} (100%) diff --git a/sql/updates/world/2012_05_19_04_creature_loot_template.sql b/sql/updates/world/2012_05_19_04_world_creature_loot_template.sql similarity index 100% rename from sql/updates/world/2012_05_19_04_creature_loot_template.sql rename to sql/updates/world/2012_05_19_04_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_05_19_05_gameobject_loot_template.sql b/sql/updates/world/2012_05_19_05_world_gameobject_loot_template.sql similarity index 100% rename from sql/updates/world/2012_05_19_05_gameobject_loot_template.sql rename to sql/updates/world/2012_05_19_05_world_gameobject_loot_template.sql diff --git a/sql/updates/world/2012_05_19_06_gameobject_loot_template.sql b/sql/updates/world/2012_05_19_06_world_gameobject_loot_template.sql similarity index 100% rename from sql/updates/world/2012_05_19_06_gameobject_loot_template.sql rename to sql/updates/world/2012_05_19_06_world_gameobject_loot_template.sql diff --git a/sql/updates/world/2012_05_28_03_waypoint_data.sql b/sql/updates/world/2012_05_28_03_world_waypoint_data.sql similarity index 100% rename from sql/updates/world/2012_05_28_03_waypoint_data.sql rename to sql/updates/world/2012_05_28_03_world_waypoint_data.sql diff --git a/sql/updates/world/2012_06_02_03_creature_loot_template_hp.sql b/sql/updates/world/2012_06_02_03_world_creature_loot_template_hp.sql similarity index 100% rename from sql/updates/world/2012_06_02_03_creature_loot_template_hp.sql rename to sql/updates/world/2012_06_02_03_world_creature_loot_template_hp.sql diff --git a/sql/updates/world/2012_06_02_03_creature_loot_template_zm.sql b/sql/updates/world/2012_06_02_03_world_creature_loot_template_zm.sql similarity index 100% rename from sql/updates/world/2012_06_02_03_creature_loot_template_zm.sql rename to sql/updates/world/2012_06_02_03_world_creature_loot_template_zm.sql diff --git a/sql/updates/world/2012_06_02_03_reference_loot_template.sql b/sql/updates/world/2012_06_02_03_world_reference_loot_template.sql similarity index 100% rename from sql/updates/world/2012_06_02_03_reference_loot_template.sql rename to sql/updates/world/2012_06_02_03_world_reference_loot_template.sql diff --git a/sql/updates/world/2012_06_02_04_reference_loot_template.sql b/sql/updates/world/2012_06_02_04_world_reference_loot_template.sql similarity index 100% rename from sql/updates/world/2012_06_02_04_reference_loot_template.sql rename to sql/updates/world/2012_06_02_04_world_reference_loot_template.sql diff --git a/sql/updates/world/2012_06_02_05_reference_loot_template.sql b/sql/updates/world/2012_06_02_05_world_reference_loot_template.sql similarity index 100% rename from sql/updates/world/2012_06_02_05_reference_loot_template.sql rename to sql/updates/world/2012_06_02_05_world_reference_loot_template.sql From 2c153b8a437dbf78646cc7463722bcfdd132eef9 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 7 Jun 2012 15:02:51 +0200 Subject: [PATCH 0965/1149] Core/Movement: Fixed Unit::SetFacingTo --- src/server/game/Entities/Unit/Unit.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index d415d06e76f..0ea8731e591 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17553,6 +17553,7 @@ void Unit::SetInFront(Unit const* target) void Unit::SetFacingTo(float ori) { Movement::MoveSplineInit init(*this); + init.MoveTo(GetPositionX(), GetPositionY(), GetPositionZMinusOffset()); init.SetFacing(ori); init.Launch(); } From 089b0a44d71a63a9949ab4ad69a435c9546b30da Mon Sep 17 00:00:00 2001 From: Subv Date: Thu, 7 Jun 2012 08:09:16 -0500 Subject: [PATCH 0966/1149] Core/SAI: Fixed the cage GameObject template script, the script should start when the gameobject is activated, not in gossip hello --- src/server/game/AI/SmartScripts/SmartScript.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index e4c9e4a3047..9feca1c073a 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -2020,16 +2020,16 @@ void SmartScript::InstallTemplate(SmartScriptHolder const& e) if (!go) return; //store hostage as id1 - AddEvent(SMART_EVENT_GOSSIP_HELLO, 0, 0, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 1, 0, 0, 0, 0, 0, SMART_TARGET_CLOSEST_CREATURE, e.action.installTtemplate.param1, 10, 0, 0); + AddEvent(SMART_EVENT_GO_STATE_CHANGED, 0, 2, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 1, 0, 0, 0, 0, 0, SMART_TARGET_CLOSEST_CREATURE, e.action.installTtemplate.param1, 10, 0, 0); //store invoker as id2 - AddEvent(SMART_EVENT_GOSSIP_HELLO, 0, 0, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 2, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); + AddEvent(SMART_EVENT_GO_STATE_CHANGED, 0, 2, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 2, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); //signal hostage - AddEvent(SMART_EVENT_GOSSIP_HELLO, 0, 0, 0, 0, 0, SMART_ACTION_SET_DATA, 0, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 1, 0, 0, 0); + AddEvent(SMART_EVENT_GO_STATE_CHANGED, 0, 2, 0, 0, 0, SMART_ACTION_SET_DATA, 0, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 1, 0, 0, 0); //when hostage raeched end point, give credit to invoker if (e.action.installTtemplate.param2) AddEvent(SMART_EVENT_DATA_SET, 0, 0, 0, 0, 0, SMART_ACTION_CALL_KILLEDMONSTER, e.action.installTtemplate.param1, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 2, 0, 0, 0); else - AddEvent(SMART_EVENT_GOSSIP_HELLO, 0, 0, 0, 0, 0, SMART_ACTION_CALL_KILLEDMONSTER, e.action.installTtemplate.param1, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 2, 0, 0, 0); + AddEvent(SMART_EVENT_GO_STATE_CHANGED, 0, 2, 0, 0, 0, SMART_ACTION_CALL_KILLEDMONSTER, e.action.installTtemplate.param1, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 2, 0, 0, 0); break; } case SMARTAI_TEMPLATE_BASIC: From ed42aa14e79d1ca7782db3386fc12e7694c591aa Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 7 Jun 2012 12:05:25 -0230 Subject: [PATCH 0967/1149] DB/Updates: Fix file name and add missing deletes to a file. --- sql/updates/world/2012_05_30_05_world_gossip.sql | 3 ++- ...1_world_waypoimts.sql => 2012_06_02_01_world_waypoints.sql} | 0 2 files changed, 2 insertions(+), 1 deletion(-) rename sql/updates/world/{2012_06_02_01_world_waypoimts.sql => 2012_06_02_01_world_waypoints.sql} (100%) diff --git a/sql/updates/world/2012_05_30_05_world_gossip.sql b/sql/updates/world/2012_05_30_05_world_gossip.sql index 37c7586cd60..5e7f1375320 100644 --- a/sql/updates/world/2012_05_30_05_world_gossip.sql +++ b/sql/updates/world/2012_05_30_05_world_gossip.sql @@ -175,7 +175,8 @@ INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (8757,11094),(8757,11095); -- Creature Gossip_menu_option insert from sniff -DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (8429,8435,8436,8437,8438,8439,8454,8490,8660,8661,8671,8672,8673,8674,8675,8676,8677,8679,8683,8685,8687,8689,8690,8691,8716,8717,8718,8719,8721,8722,8723,8724,8726,8737) AND `id`=0; +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (8303,8429,8435,8436,8437,8438,8439,8454,8490,8660,8661,8671,8672,8673,8674,8675,8676,8677,8679,8683,8685,8687,8689,8690,8691,8716,8717,8718,8719,8721,8722,8723,8724,8726,8737) AND `id`=0; +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (8672,8677,8718,8719) AND `id` IN (1); DELETE FROM `gossip_menu_option` WHERE `menu_id`=8304 AND `id` IN (0,1,2,3,4,5); DELETE FROM `gossip_menu_option` WHERE `menu_id`=8306 AND `id` IN (0,1); DELETE FROM `gossip_menu_option` WHERE `menu_id`=8455 AND `id` IN (0,1,2,3,4); diff --git a/sql/updates/world/2012_06_02_01_world_waypoimts.sql b/sql/updates/world/2012_06_02_01_world_waypoints.sql similarity index 100% rename from sql/updates/world/2012_06_02_01_world_waypoimts.sql rename to sql/updates/world/2012_06_02_01_world_waypoints.sql From 37f0e1fcb524e35d082fc1cdb3f11d36a5501c68 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 7 Jun 2012 12:09:01 -0230 Subject: [PATCH 0968/1149] DB/Gossip: Fix gossip for Charles Worth to add tailoring spells closes 6697 --- .../world/2012_06_07_00_world_gossip.sql | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 sql/updates/world/2012_06_07_00_world_gossip.sql diff --git a/sql/updates/world/2012_06_07_00_world_gossip.sql b/sql/updates/world/2012_06_07_00_world_gossip.sql new file mode 100644 index 00000000000..1fe4a23bc5a --- /dev/null +++ b/sql/updates/world/2012_06_07_00_world_gossip.sql @@ -0,0 +1,39 @@ +-- SAI for Charles Worth +SET @NPC := 28699; +SET @GOSSIP := 10118; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@NPC; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@NPC; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(@NPC,0,0,2,62,0,100,0,@GOSSIP,3,0,0,85,59817,2,0,0,0,0,7,0,0,0,0,0,0,0, 'Charles Worth - On Gossip Select - Cast Spell Teach Wispcloak'), +(@NPC,0,1,2,62,0,100,0,@GOSSIP,5,0,0,85,59841,2,0,0,0,0,7,0,0,0,0,0,0,0, 'Charles Worth - On Gossip Select - Cast Spell Teach Deathchill Cloak'), +(@NPC,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Charles Worth - On Gossip Select - Close Gossip'); +-- Add missing Gossip for Charles Worth +DELETE FROM `gossip_menu` WHERE `entry` IN (10136,10138); +DELETE FROM `gossip_menu` WHERE `entry`=14076 AND `text_id`=14076; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (10136,14072),(10138,14074),(10118,14076); +-- Add Gossip Options +DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP AND `id` IN (2,3,4,5); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`) VALUES +(@GOSSIP,2,0, 'Tell me about the Wispcloak Recipe.',1,1,10136,0,0,0, ''), +(@GOSSIP,3,0, 'I am ready to learn the Wispcloak Recipe.',1,1,0,0,0,0, ''), +(@GOSSIP,4,0, 'Tell me about the Deathchill Cloak Recipe.',1,1,10138,0,0,0, ''), +(@GOSSIP,5,0, 'I am ready to learn the Deathchill Cloak Recipe.',1,1,0,0,0,0, ''); +-- Add conditions for gossip text +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,14076,0,7,197,420,0,0,0,'','Only show gossip text 14076 if player has Tailoring with skill level 420'); +-- Add conditions for gossip options +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,@GOSSIP,2,0,7,197,420,0,0,0,'','Only show gossip option if player has Tailoring with skill level 420'), +(15,@GOSSIP,2,0,25,56016,0,0,1,0,'','Only show gossip option if player has not learned spell 56016'), +(15,@GOSSIP,3,0,7,197,420,0,0,0,'','Only show gossip option if player has Tailoring with skill level 420 Alliance'), +(15,@GOSSIP,3,0,17,41,0,0,0,0,'','Only show gossip option if player has achievement Loremaster of Northrend Alliance'), +(15,@GOSSIP,3,1,7,197,420,0,0,0,'','Only show gossip option if player has Tailoring with skill level 420 Horde'), +(15,@GOSSIP,3,1,17,1360,0,0,0,0,'','Only show gossip option if player has achievement Loremaster of Northrend Horde'), +(15,@GOSSIP,3,0,25,56016,0,0,1,0,'','Only show gossip option if player has not learned spell 56016'), +(15,@GOSSIP,4,0,7,197,420,0,0,0,'','Only show gossip option if player has Tailoring with skill level 420'), +(15,@GOSSIP,4,0,25,56017,0,0,1,0,'','Only show gossip option if player has not learned spell 56017'), +(15,@GOSSIP,5,0,7,197,420,0,0,0,'','Only show gossip option if player has Tailoring with skill level 420'), +(15,@GOSSIP,5,0,17,1288,0,0,0,0,'','Only show gossip option if player has achievement Northrend Dungeonmaster'), +(15,@GOSSIP,5,0,25,56017,0,0,1,0,'','Only show gossip option if player has not learned spell 56017'); From 7bf459c10e4a5d28828acb8c0356bedf9797a6f5 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 7 Jun 2012 12:16:54 -0230 Subject: [PATCH 0969/1149] DB/Gossip: Fix Gossip for Leryssa Closes 6732 --- sql/updates/world/2012_06_07_01_world_gossip.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 sql/updates/world/2012_06_07_01_world_gossip.sql diff --git a/sql/updates/world/2012_06_07_01_world_gossip.sql b/sql/updates/world/2012_06_07_01_world_gossip.sql new file mode 100644 index 00000000000..d77d41fa523 --- /dev/null +++ b/sql/updates/world/2012_06_07_01_world_gossip.sql @@ -0,0 +1,11 @@ +-- Fix Gossip for Leryssa +SET @ENTRY := 9223; +SET @TEXT1 := 12534; +SET @TEXT2 := 13481; +SET @QUEST := 11599; +DELETE FROM `gossip_menu` WHERE `entry`=@ENTRY AND `text_id`=@TEXT1; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@ENTRY,@TEXT1); +-- Add conditions for gossip text +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=@ENTRY AND `SourceEntry`=@TEXT2; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@ENTRY,@TEXT2,0,8,@QUEST,0,0,0,0,'','Only show gossip text if player has completed quest 11599'); From d719730929db84674cee0b56834e2a9ef248e472 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 7 Jun 2012 12:02:06 -0400 Subject: [PATCH 0970/1149] Core/Spells: do not apply unit_state_casting for instant cast spells. --- src/server/game/Entities/Unit/Unit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 0ea8731e591..3315760a2af 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2893,7 +2893,8 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) InterruptSpell(CURRENT_AUTOREPEAT_SPELL); m_AutoRepeatFirstCast = true; } - AddUnitState(UNIT_STATE_CASTING); + if (m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->CalcCastTime(this) > 0 && IsNonMeleeSpellCasted(false, false, true)) + AddUnitState(UNIT_STATE_CASTING); } break; case CURRENT_CHANNELED_SPELL: From 0965e1f4c22f4e47a0b478329ecbe48a7738f21e Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 7 Jun 2012 13:01:49 -0400 Subject: [PATCH 0971/1149] Core/Loot: fix loot rules for looting quest items that have the party loot flag --- src/server/game/Loot/LootMgr.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index a5ad46c9ec4..e1dcf8e5d27 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -358,7 +358,12 @@ bool LootItem::AllowedForPlayer(Player const* player) const // check quest requirements if (!(pProto->FlagsCu & ITEM_FLAGS_CU_IGNORE_QUEST_STATUS) && ((needs_quest || (pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE)) && !player->HasQuestForItem(itemid))) - return false; + if (Group const* group = player->GetGroup()) + { + if ((pProto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT) == 0 || (pProto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT && (group->GetLootMethod() != MASTER_LOOT || group->GetLooterGuid() != player->GetGUID()))) + return false; + } + else return false; return true; } @@ -889,6 +894,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) } LootSlotType slotType = lv.permission == OWNER_PERMISSION ? LOOT_SLOT_TYPE_OWNER : LOOT_SLOT_TYPE_ALLOW_LOOT; + LootSlotType partySlotType = lv.permission == MASTER_PERMISSION ? LOOT_SLOT_TYPE_MASTER : (lv.permission == GROUP_PERMISSION ? LOOT_SLOT_TYPE_ROLL_ONGOING : slotType); QuestItemMap const& lootPlayerQuestItems = l.GetPlayerQuestItems(); QuestItemMap::const_iterator q_itr = lootPlayerQuestItems.find(lv.viewer->GetGUIDLow()); if (q_itr != lootPlayerQuestItems.end()) @@ -901,7 +907,10 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) { b << uint8(l.items.size() + (qi - q_list->begin())); b << item; - b << uint8(slotType); + if (!item.freeforall) + b << uint8(partySlotType); + else + b << uint8(slotType); ++itemsShown; } } @@ -919,7 +928,10 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) { b << uint8(fi->index); b << item; - b << uint8(slotType); + if (!item.freeforall) + b << uint8(partySlotType); + else + b << uint8(slotType); ++itemsShown; } } @@ -937,7 +949,10 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) { b << uint8(ci->index); b << item; - b << uint8(slotType); + if (!item.freeforall) + b << uint8(partySlotType); + else + b << uint8(slotType); ++itemsShown; } } From b668bd6ff11676f2fa7aa9b0fe87a7d19c7981c1 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 7 Jun 2012 13:05:22 -0400 Subject: [PATCH 0972/1149] DB/ItemTemplate: make rotface/festergut acidic blood and shadowfrost shards adhere to party loot rules. --- sql/updates/world/2012_06_07_02_world_item_template.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2012_06_07_02_world_item_template.sql diff --git a/sql/updates/world/2012_06_07_02_world_item_template.sql b/sql/updates/world/2012_06_07_02_world_item_template.sql new file mode 100644 index 00000000000..fdf3cce7c24 --- /dev/null +++ b/sql/updates/world/2012_06_07_02_world_item_template.sql @@ -0,0 +1 @@ +UPDATE `item_template` SET `flags` = `flags` | 2048 WHERE `entry` IN (50274,50226,50231); From 22efc5e2bd91ebc0a1e019fb2d5144ae6302250c Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 7 Jun 2012 13:10:27 -0400 Subject: [PATCH 0973/1149] Core/Spells: fix mocking blow doing damage to players and non tauntable creatures. --- src/server/game/Spells/SpellEffects.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 17e79501d16..0d5dac8f8e0 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3317,6 +3317,14 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) fixed_bonus += (aur->GetStackAmount() - 1) * CalculateDamage(2, unitTarget); } } + if (m_spellInfo->SpellFamilyFlags[0] & 0x8000000) // Mocking Blow + { + if (unitTarget->IsImmunedToSpellEffect(m_spellInfo,EFFECT_1) || unitTarget->GetTypeId() == TYPEID_PLAYER) + { + m_damage = 0; + return; + } + } break; } case SPELLFAMILY_ROGUE: From 4bfb96fbcfb5a64cbaf70ede0a2f682987f1a877 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 7 Jun 2012 14:05:52 -0400 Subject: [PATCH 0974/1149] Core/Loot: fix mistake in previous commit. also fix flags in sql. i did things backwards ^^ --- sql/updates/world/2012_06_07_03_world_item_template.sql | 1 + src/server/game/Loot/LootMgr.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_06_07_03_world_item_template.sql diff --git a/sql/updates/world/2012_06_07_03_world_item_template.sql b/sql/updates/world/2012_06_07_03_world_item_template.sql new file mode 100644 index 00000000000..a6caa15632e --- /dev/null +++ b/sql/updates/world/2012_06_07_03_world_item_template.sql @@ -0,0 +1 @@ +UPDATE `item_template` SET `flags` = 0 WHERE `entry` IN (50274,50226,50231); diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index e1dcf8e5d27..53b560e0b77 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -360,7 +360,7 @@ bool LootItem::AllowedForPlayer(Player const* player) const if (!(pProto->FlagsCu & ITEM_FLAGS_CU_IGNORE_QUEST_STATUS) && ((needs_quest || (pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE)) && !player->HasQuestForItem(itemid))) if (Group const* group = player->GetGroup()) { - if ((pProto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT) == 0 || (pProto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT && (group->GetLootMethod() != MASTER_LOOT || group->GetLooterGuid() != player->GetGUID()))) + if (pProto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT || ((pProto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT) == 0 && (group->GetLootMethod() != MASTER_LOOT || group->GetLooterGuid() != player->GetGUID()))) return false; } else return false; From f92ae938063060c8c1eeae9ec863dca1645e1985 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 7 Jun 2012 14:48:43 -0400 Subject: [PATCH 0975/1149] Core/Spells: fix crash introduced in d719730929db84674cee0b56834e2a9ef248e472 (thx vincent-michael) --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3315760a2af..e89e5df2a0c 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2893,7 +2893,7 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) InterruptSpell(CURRENT_AUTOREPEAT_SPELL); m_AutoRepeatFirstCast = true; } - if (m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->CalcCastTime(this) > 0 && IsNonMeleeSpellCasted(false, false, true)) + if ((m_currentSpells[CURRENT_GENERIC_SPELL] && m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->CalcCastTime(this) > 0) && IsNonMeleeSpellCasted(false, false, true)) AddUnitState(UNIT_STATE_CASTING); } break; From 870503059341723bb9ec76b3ef103d1cfc7a9134 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 7 Jun 2012 16:00:16 -0400 Subject: [PATCH 0976/1149] Core/Auras: use a case for SPELL_AURA_MECHANIC_IMMUNITY_MASK. distinguish between spells manually. blizzard probably has a seperate database as to which spells have which immunities. --- .../game/Spells/Auras/SpellAuraEffects.cpp | 261 ++++++++++++++++-- 1 file changed, 232 insertions(+), 29 deletions(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 05114c8bc07..1b6ae348b1c 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -3368,41 +3368,244 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8 return; Unit* target = aurApp->GetTarget(); + std::list aura_immunity_list; + uint32 mechanic_immunity_list; + int32 miscVal = GetMiscValue(); - std::list immunity_list; - if (GetMiscValue() & (1<<10)) - immunity_list.push_back(SPELL_AURA_MOD_STUN); - if (GetMiscValue() & (1<<1)) - immunity_list.push_back(SPELL_AURA_TRANSFORM); - - // These flag can be recognized wrong: - if (GetMiscValue() & (1<<6)) - immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED); - if (GetMiscValue() & (1<<0)) - immunity_list.push_back(SPELL_AURA_MOD_ROOT); - if (GetMiscValue() & (1<<2)) - immunity_list.push_back(SPELL_AURA_MOD_CONFUSE); - if (GetMiscValue() & (1<<9)) - immunity_list.push_back(SPELL_AURA_MOD_FEAR); - - // an exception for Bladestorm - if ((GetMiscValue() & (1<<7)) && (GetId() != 46924)) - immunity_list.push_back(SPELL_AURA_MOD_DISARM); - - // apply immunities - for (std::list ::iterator iter = immunity_list.begin(); iter != immunity_list.end(); ++iter) - target->ApplySpellImmune(GetId(), IMMUNITY_STATE, *iter, apply); - - // Patch 3.0.3 Bladestorm now breaks all snares and roots on the warrior when activated. - if (apply && GetId() == 46924) + switch (miscVal) { - target->RemoveAurasByType(SPELL_AURA_MOD_ROOT); - target->RemoveAurasByType(SPELL_AURA_MOD_DECREASE_SPEED); + case 96: + case 1615: + { + if (GetBaseAmount()) + { + mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT) + | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN) + | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM) + | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR) + | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_DISORIENTED) + | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN); + + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SNARE, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_ROOT, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FEAR, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SLEEP, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_CHARM, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SAPPED, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_HORROR, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_POLYMORPH, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_DISORIENTED, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply); + aura_immunity_list.push_back(SPELL_AURA_MOD_STUN); + aura_immunity_list.push_back(SPELL_AURA_TRANSFORM); + aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED); + aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT); + aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE); + aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR); + } + break; + } + case 679: + { + if (GetId() == 57742) + { + mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT) + | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN) + | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM) + | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR) + | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_DISORIENTED) + | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN); + + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SNARE, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_ROOT, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FEAR, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SLEEP, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_CHARM, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SAPPED, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_HORROR, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_POLYMORPH, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_DISORIENTED, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply); + aura_immunity_list.push_back(SPELL_AURA_MOD_STUN); + aura_immunity_list.push_back(SPELL_AURA_TRANSFORM); + aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED); + aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT); + aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE); + aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR); + } + break; + } + case 1557: + { + if (GetId() == 64187) + { + mechanic_immunity_list = (1 << MECHANIC_STUN); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply); + aura_immunity_list.push_back(SPELL_AURA_MOD_STUN); + } + else + { + mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT) + | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN) + | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM) + | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR) + | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_DISORIENTED) + | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN); + + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SNARE, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_ROOT, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FEAR, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SLEEP, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_CHARM, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SAPPED, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_HORROR, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_POLYMORPH, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_DISORIENTED, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply); + aura_immunity_list.push_back(SPELL_AURA_MOD_STUN); + aura_immunity_list.push_back(SPELL_AURA_TRANSFORM); + aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED); + aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT); + aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE); + aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR); + } + break; + } + case 1614: + case 1694: + { + target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, apply); + aura_immunity_list.push_back(SPELL_AURA_MOD_TAUNT); + break; + } + case 1630: + { + if (!GetBaseAmount()) + { + target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, apply); + aura_immunity_list.push_back(SPELL_AURA_MOD_TAUNT); + } + else + { + mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT) + | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN) + | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM) + | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR) + | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_DISORIENTED) + | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN); + + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SNARE, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_ROOT, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FEAR, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SLEEP, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_CHARM, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SAPPED, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_HORROR, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_POLYMORPH, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_DISORIENTED, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply); + aura_immunity_list.push_back(SPELL_AURA_MOD_STUN); + aura_immunity_list.push_back(SPELL_AURA_TRANSFORM); + aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED); + aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT); + aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE); + aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR); + } + break; + } + case 477: + case 1733: + { + if (!GetBaseAmount()) + { + mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT) + | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN) + | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM) + | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR) + | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_DISORIENTED) + | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN); + + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SNARE, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_ROOT, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FEAR, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SLEEP, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_CHARM, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SAPPED, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_HORROR, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_POLYMORPH, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_DISORIENTED, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, apply); + aura_immunity_list.push_back(SPELL_AURA_MOD_STUN); + aura_immunity_list.push_back(SPELL_AURA_TRANSFORM); + aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED); + aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT); + aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE); + aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR); + } + break; + } + case 878: + { + if (GetBaseAmount() == 1) + { + mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_STUN) + | (1 << MECHANIC_DISORIENTED) | (1 << MECHANIC_FREEZE); + + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SNARE, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_DISORIENTED, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply); + aura_immunity_list.push_back(SPELL_AURA_MOD_STUN); + aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED); + } + break; + } + default: + break; } + if (aura_immunity_list.size() == 0) + { + if (miscVal & (1<<10)) + aura_immunity_list.push_back(SPELL_AURA_MOD_STUN); + if (miscVal & (1<<1)) + aura_immunity_list.push_back(SPELL_AURA_TRANSFORM); + + // These flag can be recognized wrong: + if (miscVal & (1<<6)) + aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED); + if (miscVal & (1<<0)) + aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT); + if (miscVal & (1<<2)) + aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE); + if (miscVal & (1<<9)) + aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR); + if (miscVal & (1<<7)) + aura_immunity_list.push_back(SPELL_AURA_MOD_DISARM); + } + + // apply immunities + for (std::list ::iterator iter = aura_immunity_list.begin(); iter != aura_immunity_list.end(); ++iter) + target->ApplySpellImmune(GetId(), IMMUNITY_STATE, *iter, apply); + if (apply && GetSpellInfo()->AttributesEx & SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY) - for (std::list ::iterator iter = immunity_list.begin(); iter != immunity_list.end(); ++iter) + { + target->RemoveAurasWithMechanic(mechanic_immunity_list, AURA_REMOVE_BY_DEFAULT, GetId()); + for (std::list ::iterator iter = aura_immunity_list.begin(); iter != aura_immunity_list.end(); ++iter) target->RemoveAurasByType(*iter); + } } void AuraEffect::HandleModMechanicImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const From 426145373ba93f080c5503054daecd9ec823edcb Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 7 Jun 2012 17:58:20 -0230 Subject: [PATCH 0977/1149] DB/Spell_dbc: Add missing spell to db --- sql/updates/world/2012_06_07_04_world_spell_dbc.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 sql/updates/world/2012_06_07_04_world_spell_dbc.sql diff --git a/sql/updates/world/2012_06_07_04_world_spell_dbc.sql b/sql/updates/world/2012_06_07_04_world_spell_dbc.sql new file mode 100644 index 00000000000..3a693d025e7 --- /dev/null +++ b/sql/updates/world/2012_06_07_04_world_spell_dbc.sql @@ -0,0 +1,8 @@ +-- add missing spell to db +DELETE FROM `Spell_dbc` WHERE `Id`=28782; +INSERT INTO `Spell_dbc` (`Id`,`SchoolMask`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`Comment`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`AreaGroupId`)VALUES +(28782,0,0,0,256,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,21,1,0,-1,0,0,6,6,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,12,40,0,0,0,0,0,0,0,0,127,0,0,0,0, 'Stun Self + Immune',0,0,0,0,0,0,0,1,1,0); + +-- Add Stun Self + Immune aura to Snack-O-Matic IV & Vend-O-Tron D-Luxe +DELETE FROM `creature_template_addon` WHERE `entry` IN (24934,24935); +INSERT INTO `creature_template_addon` (`entry`,`auras`) VALUES (24934, '28782'),(24935, '28782'); From c7775c8d72fb8618ad96c243910f923b239ea39b Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 7 Jun 2012 23:20:57 +0200 Subject: [PATCH 0978/1149] Core/Maps: Moved object respawn time storage from global to map level. This removes unneccessary locking since all objects run within its map's thread. --- .../2012_06_07_00_characters_respawn.sql | 2 + .../game/Entities/Creature/Creature.cpp | 10 +- .../game/Entities/GameObject/GameObject.cpp | 12 +- src/server/game/Globals/ObjectMgr.cpp | 178 ------------------ src/server/game/Globals/ObjectMgr.h | 38 ---- src/server/game/Instances/InstanceSaveMgr.cpp | 2 +- src/server/game/Maps/Map.cpp | 127 ++++++++++++- src/server/game/Maps/Map.h | 34 ++++ src/server/game/Maps/MapInstanced.cpp | 2 + src/server/game/Maps/MapManager.cpp | 1 + .../game/Movement/Spline/MoveSplineInit.cpp | 3 +- src/server/game/OutdoorPvP/OutdoorPvP.cpp | 4 +- src/server/game/World/World.cpp | 6 - .../Implementation/CharacterDatabase.cpp | 17 +- .../Implementation/CharacterDatabase.h | 1 - 15 files changed, 189 insertions(+), 248 deletions(-) create mode 100644 sql/updates/characters/2012_06_07_00_characters_respawn.sql diff --git a/sql/updates/characters/2012_06_07_00_characters_respawn.sql b/sql/updates/characters/2012_06_07_00_characters_respawn.sql new file mode 100644 index 00000000000..168aa312713 --- /dev/null +++ b/sql/updates/characters/2012_06_07_00_characters_respawn.sql @@ -0,0 +1,2 @@ +ALTER TABLE `creature_respawn` ADD `mapId` SMALLINT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `respawnTime`; +ALTER TABLE `gameobject_respawn` ADD `mapId` SMALLINT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `respawnTime`; diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index e8ec686daf5..07e8e37e82a 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -486,7 +486,7 @@ void Creature::Update(uint32 diff) break; uint64 dbtableHighGuid = MAKE_NEW_GUID(m_DBTableGuid, GetEntry(), HIGHGUID_UNIT); - time_t linkedRespawntime = sObjectMgr->GetLinkedRespawnTime(dbtableHighGuid, GetMap()->GetInstanceId()); + time_t linkedRespawntime = GetMap()->GetLinkedRespawnTime(dbtableHighGuid); if (!linkedRespawntime) // Can respawn Respawn(); else // the master is dead @@ -1303,7 +1303,7 @@ bool Creature::LoadCreatureFromDB(uint32 guid, Map* map, bool addToMap) m_respawnDelay = data->spawntimesecs; m_deathState = ALIVE; - m_respawnTime = sObjectMgr->GetCreatureRespawnTime(m_DBTableGuid, GetInstanceId()); + m_respawnTime = GetMap()->GetCreatureRespawnTime(m_DBTableGuid); if (m_respawnTime) // respawn on Update { m_deathState = DEAD; @@ -1398,7 +1398,7 @@ void Creature::DeleteFromDB() return; } - sObjectMgr->RemoveCreatureRespawnTime(m_DBTableGuid, GetInstanceId()); + GetMap()->RemoveCreatureRespawnTime(m_DBTableGuid); sObjectMgr->DeleteCreatureData(m_DBTableGuid); SQLTransaction trans = WorldDatabase.BeginTransaction(); @@ -1598,7 +1598,7 @@ void Creature::Respawn(bool force) if (getDeathState() == DEAD) { if (m_DBTableGuid) - sObjectMgr->RemoveCreatureRespawnTime(m_DBTableGuid, GetInstanceId()); + GetMap()->RemoveCreatureRespawnTime(m_DBTableGuid); sLog->outStaticDebug("Respawning creature %s (GuidLow: %u, Full GUID: " UI64FMTD " Entry: %u)", GetName(), GetGUIDLow(), GetGUID(), GetEntry()); m_respawnTime = 0; @@ -2013,7 +2013,7 @@ void Creature::SaveRespawnTime() if (isSummon() || !m_DBTableGuid || (m_creatureData && !m_creatureData->dbData)) return; - sObjectMgr->SaveCreatureRespawnTime(m_DBTableGuid, GetInstanceId(), m_respawnTime); + GetMap()->SaveCreatureRespawnTime(m_DBTableGuid, m_respawnTime); } // this should not be called by petAI or diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 5101d01899d..58440095075 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -338,7 +338,7 @@ void GameObject::Update(uint32 diff) if (m_respawnTime <= now) // timer expired { uint64 dbtableHighGuid = MAKE_NEW_GUID(m_DBTableGuid, GetEntry(), HIGHGUID_GAMEOBJECT); - time_t linkedRespawntime = sObjectMgr->GetLinkedRespawnTime(dbtableHighGuid, GetMap()->GetInstanceId()); + time_t linkedRespawntime = GetMap()->GetLinkedRespawnTime(dbtableHighGuid); if (linkedRespawntime) // Can't respawn, the master is dead { uint64 targetGuid = sObjectMgr->GetLinkedRespawnGuid(dbtableHighGuid); @@ -761,13 +761,13 @@ bool GameObject::LoadGameObjectFromDB(uint32 guid, Map* map, bool addToMap) else { m_respawnDelayTime = data->spawntimesecs; - m_respawnTime = sObjectMgr->GetGORespawnTime(m_DBTableGuid, map->GetInstanceId()); + m_respawnTime = GetMap()->GetGORespawnTime(m_DBTableGuid); // ready to respawn if (m_respawnTime && m_respawnTime <= time(NULL)) { m_respawnTime = 0; - sObjectMgr->RemoveGORespawnTime(m_DBTableGuid, GetInstanceId()); + GetMap()->RemoveGORespawnTime(m_DBTableGuid); } } } @@ -788,7 +788,7 @@ bool GameObject::LoadGameObjectFromDB(uint32 guid, Map* map, bool addToMap) void GameObject::DeleteFromDB() { - sObjectMgr->RemoveGORespawnTime(m_DBTableGuid, GetInstanceId()); + GetMap()->RemoveGORespawnTime(m_DBTableGuid); sObjectMgr->DeleteGOData(m_DBTableGuid); PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAMEOBJECT); @@ -863,7 +863,7 @@ Unit* GameObject::GetOwner() const void GameObject::SaveRespawnTime() { if (m_goData && m_goData->dbData && m_respawnTime > time(NULL) && m_spawnedByDefault) - sObjectMgr->SaveGORespawnTime(m_DBTableGuid, GetInstanceId(), m_respawnTime); + GetMap()->SaveGORespawnTime(m_DBTableGuid, m_respawnTime); } bool GameObject::IsAlwaysVisibleFor(WorldObject const* seer) const @@ -908,7 +908,7 @@ void GameObject::Respawn() if (m_spawnedByDefault && m_respawnTime > 0) { m_respawnTime = time(NULL); - sObjectMgr->RemoveGORespawnTime(m_DBTableGuid, GetInstanceId()); + GetMap()->RemoveGORespawnTime(m_DBTableGuid); } } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index df6018faf39..65f2ccff476 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1872,71 +1872,6 @@ void ObjectMgr::RemoveGameobjectFromGrid(uint32 guid, GameObjectData const* data } } -void ObjectMgr::LoadCreatureRespawnTimes() -{ - uint32 oldMSTime = getMSTime(); - - uint32 count = 0; - - PreparedQueryResult result = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_SEL_CREATURE_RESPAWNS)); - if (!result) - { - sLog->outString(">> Loaded 0 creature respawn time."); - sLog->outString(); - return; - } - - do - { - Field* fields = result->Fetch(); - - uint32 loguid = fields[0].GetUInt32(); - uint32 respawn_time = fields[1].GetUInt32(); - uint32 instance = fields[2].GetUInt32(); - - _creatureRespawnTimes[MAKE_PAIR64(loguid, instance)] = time_t(respawn_time); - - ++count; - } while (result->NextRow()); - - sLog->outString(">> Loaded %lu creature respawn times in %u ms", (unsigned long)_creatureRespawnTimes.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); -} - -void ObjectMgr::LoadGameobjectRespawnTimes() -{ - uint32 oldMSTime = getMSTime(); - - // Remove outdated data - CharacterDatabase.DirectExecute("DELETE FROM gameobject_respawn WHERE respawnTime <= UNIX_TIMESTAMP(NOW())"); - - uint32 count = 0; - - PreparedQueryResult result = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_SEL_GO_RESPAWNS)); - if (!result) - { - sLog->outString(">> Loaded 0 gameobject respawn times. DB table `gameobject_respawn` is empty!"); - sLog->outString(); - return; - } - - do - { - Field* fields = result->Fetch(); - - uint32 loguid = fields[0].GetUInt32(); - uint32 respawn_time = fields[1].GetUInt32(); - uint32 instance = fields[2].GetUInt32(); - - _goRespawnTimes[MAKE_PAIR64(loguid, instance)] = time_t(respawn_time); - - ++count; - } while (result->NextRow()); - - sLog->outString(); - sLog->outString(">> Loaded %lu gameobject respawn times in %u ms", (unsigned long)_goRespawnTimes.size(), GetMSTimeDiffToNow(oldMSTime)); -} - Player* ObjectMgr::GetPlayerByLowGUID(uint32 lowguid) const { uint64 guid = MAKE_NEW_GUID(lowguid, 0, HIGHGUID_PLAYER); @@ -7172,44 +7107,6 @@ void ObjectMgr::LoadNPCSpellClickSpells() sLog->outString(); } -void ObjectMgr::SaveCreatureRespawnTime(uint32 loguid, uint32 instance, time_t t) -{ - if (!t) - { - // Delete only - RemoveCreatureRespawnTime(loguid, instance); - return; - } - - // This function can be called from various map threads concurrently - { - _creatureRespawnTimesMutex.acquire(); - _creatureRespawnTimes[MAKE_PAIR64(loguid, instance)] = t; - _creatureRespawnTimesMutex.release(); - } - - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN); - stmt->setUInt32(0, loguid); - stmt->setUInt32(1, uint32(t)); - stmt->setUInt32(2, instance); - CharacterDatabase.Execute(stmt); -} - -void ObjectMgr::RemoveCreatureRespawnTime(uint32 loguid, uint32 instance) -{ - // This function can be called from various map threads concurrently - { - _creatureRespawnTimesMutex.acquire(); - _creatureRespawnTimes[MAKE_PAIR64(loguid, instance)] = 0; - _creatureRespawnTimesMutex.release(); - } - - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN); - stmt->setUInt32(0, loguid); - stmt->setUInt32(1, instance); - CharacterDatabase.Execute(stmt); -} - void ObjectMgr::DeleteCreatureData(uint32 guid) { // remove mapid*cellid -> guid_set map @@ -7220,81 +7117,6 @@ void ObjectMgr::DeleteCreatureData(uint32 guid) _creatureDataStore.erase(guid); } -void ObjectMgr::SaveGORespawnTime(uint32 loguid, uint32 instance, time_t t) -{ - if (!t) - { - // Delete only - RemoveGORespawnTime(loguid, instance); - return; - } - - // This function can be called from different map threads concurrently - { - _goRespawnTimesMutex.acquire(); - _goRespawnTimes[MAKE_PAIR64(loguid, instance)] = t; - _goRespawnTimesMutex.release(); - } - - PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GO_RESPAWN); - stmt->setUInt32(0, loguid); - stmt->setUInt64(1, uint64(t)); - stmt->setUInt32(2, instance); - CharacterDatabase.Execute(stmt); -} - -void ObjectMgr::RemoveGORespawnTime(uint32 loguid, uint32 instance) -{ - // This function can be called from different map threads concurrently - { - _goRespawnTimesMutex.acquire(); - _goRespawnTimes[MAKE_PAIR64(loguid, instance)] = 0; - _goRespawnTimesMutex.release(); - } - - PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GO_RESPAWN); - stmt->setUInt32(0, loguid); - stmt->setUInt32(1, instance); - CharacterDatabase.Execute(stmt); -} - -void ObjectMgr::DeleteRespawnTimeForInstance(uint32 instance) -{ - // This function can be called from different map threads concurrently - RespawnTimes::iterator next; - - { - _goRespawnTimesMutex.acquire(); - for (RespawnTimes::iterator itr = _goRespawnTimes.begin(); itr != _goRespawnTimes.end(); itr = next) - { - next = itr; - ++next; - - if (GUID_HIPART(itr->first) == instance) - _goRespawnTimes.erase(itr); - } - _goRespawnTimesMutex.release(); - } - { - _creatureRespawnTimesMutex.acquire(); - for (RespawnTimes::iterator itr = _creatureRespawnTimes.begin(); itr != _creatureRespawnTimes.end(); itr = next) - { - next = itr; - ++next; - - if (GUID_HIPART(itr->first) == instance) - _creatureRespawnTimes.erase(itr); - } - _creatureRespawnTimesMutex.release(); - } - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE); - stmt->setUInt32(0, instance); - CharacterDatabase.Execute(stmt); - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GO_RESPAWN_BY_INSTANCE); - stmt->setUInt32(0, instance); - CharacterDatabase.Execute(stmt); -} - void ObjectMgr::DeleteGOData(uint32 guid) { // remove mapid*cellid -> guid_set map diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index f81e7f1f074..97c2f0234ba 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -367,8 +367,6 @@ struct CellObjectGuids typedef UNORDERED_MAP CellObjectGuidsMap; typedef UNORDERED_MAP MapObjectGuids; -typedef UNORDERED_MAP RespawnTimes; - // Trinity string ranges #define MIN_TRINITY_STRING_ID 1 // 'trinity_string' #define MAX_TRINITY_STRING_ID 2000000000 @@ -854,13 +852,11 @@ class ObjectMgr void LoadCreatures(); void LoadLinkedRespawn(); bool SetCreatureLinkedRespawn(uint32 guid, uint32 linkedGuid); - void LoadCreatureRespawnTimes(); void LoadCreatureAddons(); void LoadCreatureModelInfo(); void LoadEquipmentTemplates(); void LoadGameObjectLocales(); void LoadGameobjects(); - void LoadGameobjectRespawnTimes(); void LoadItemTemplates(); void LoadItemLocales(); void LoadItemSetNames(); @@ -1048,36 +1044,6 @@ class ObjectMgr void AddCorpseCellData(uint32 mapid, uint32 cellid, uint32 player_guid, uint32 instance); void DeleteCorpseCellData(uint32 mapid, uint32 cellid, uint32 player_guid); - time_t GetLinkedRespawnTime(uint64 guid, uint32 instance) - { - uint64 linkedGuid = GetLinkedRespawnGuid(guid); - switch (GUID_HIPART(linkedGuid)) - { - case HIGHGUID_UNIT: - return GetCreatureRespawnTime(GUID_LOPART(linkedGuid), instance); - case HIGHGUID_GAMEOBJECT: - return GetGORespawnTime(GUID_LOPART(linkedGuid), instance); - default: - return 0; - } - } - - time_t GetCreatureRespawnTime(uint32 loguid, uint32 instance) - { - TRINITY_GUARD(ACE_Thread_Mutex, _creatureRespawnTimesMutex); - return _creatureRespawnTimes[MAKE_PAIR64(loguid, instance)]; - } - void SaveCreatureRespawnTime(uint32 loguid, uint32 instance, time_t t); - void RemoveCreatureRespawnTime(uint32 loguid, uint32 instance); - time_t GetGORespawnTime(uint32 loguid, uint32 instance) - { - TRINITY_GUARD(ACE_Thread_Mutex, _goRespawnTimesMutex); - return _goRespawnTimes[MAKE_PAIR64(loguid, instance)]; - } - void SaveGORespawnTime(uint32 loguid, uint32 instance, time_t t); - void RemoveGORespawnTime(uint32 loguid, uint32 instance); - void DeleteRespawnTimeForInstance(uint32 instance); - // grid objects void AddCreatureToGrid(uint32 guid, CreatureData const* data); void RemoveCreatureFromGrid(uint32 guid, CreatureData const* data); @@ -1307,10 +1273,6 @@ class ObjectMgr TrinityStringLocaleContainer _trinityStringLocaleStore; GossipMenuItemsLocaleContainer _gossipMenuItemsLocaleStore; PointOfInterestLocaleContainer _pointOfInterestLocaleStore; - RespawnTimes _creatureRespawnTimes; - ACE_Thread_Mutex _creatureRespawnTimesMutex; - RespawnTimes _goRespawnTimes; - ACE_Thread_Mutex _goRespawnTimesMutex; CacheVendorItemContainer _cacheVendorItemStore; CacheTrainerSpellContainer _cacheTrainerSpellStore; diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index 8078a91d082..2e0d1e47c92 100755 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -543,7 +543,7 @@ void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId) if (iMap && iMap->IsDungeon()) ((InstanceMap*)iMap)->Reset(INSTANCE_RESET_RESPAWN_DELAY); - sObjectMgr->DeleteRespawnTimeForInstance(instanceId); // even if map is not loaded + iMap->DeleteRespawnTimes(); // Free up the instance id and allow it to be reused sMapMgr->FreeInstanceId(instanceId); diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 162dd12d121..6f19fdcbc0a 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2632,7 +2632,7 @@ void InstanceMap::UnloadAll() ASSERT(!HavePlayers()); if (m_resetAfterUnload == true) - sObjectMgr->DeleteRespawnTimeForInstance(GetInstanceId()); + DeleteRespawnTimes(); Map::UnloadAll(); } @@ -2781,3 +2781,128 @@ void Map::UpdateIteratorBack(Player* player) if (m_mapRefIter == player->GetMapRef()) m_mapRefIter = m_mapRefIter->nocheck_prev(); } + +void Map::SaveCreatureRespawnTime(uint32 dbGuid, time_t respawnTime) +{ + if (!respawnTime) + { + // Delete only + RemoveCreatureRespawnTime(dbGuid); + return; + } + + _creatureRespawnTimes[dbGuid] = respawnTime; + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN); + stmt->setUInt32(0, dbGuid); + stmt->setUInt32(1, uint32(respawnTime)); + stmt->setUInt16(2, GetId()); + stmt->setUInt32(3, GetInstanceId()); + CharacterDatabase.Execute(stmt); +} + +void Map::RemoveCreatureRespawnTime(uint32 dbGuid) +{ + _creatureRespawnTimes.erase(dbGuid); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN); + stmt->setUInt32(0, dbGuid); + stmt->setUInt16(1, GetId()); + stmt->setUInt32(2, GetInstanceId()); + CharacterDatabase.Execute(stmt); +} + +void Map::SaveGORespawnTime(uint32 dbGuid, time_t respawnTime) +{ + if (!respawnTime) + { + // Delete only + RemoveGORespawnTime(dbGuid); + return; + } + + _goRespawnTimes[dbGuid] = respawnTime; + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GO_RESPAWN); + stmt->setUInt32(0, dbGuid); + stmt->setUInt32(1, uint32(respawnTime)); + stmt->setUInt16(2, GetId()); + stmt->setUInt32(3, GetInstanceId()); + CharacterDatabase.Execute(stmt); +} + +void Map::RemoveGORespawnTime(uint32 dbGuid) +{ + _goRespawnTimes.erase(dbGuid); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GO_RESPAWN); + stmt->setUInt32(0, dbGuid); + stmt->setUInt16(1, GetId()); + stmt->setUInt32(2, GetInstanceId()); + CharacterDatabase.Execute(stmt); +} + +void Map::LoadRespawnTimes() +{ + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CREATURE_RESPAWNS); + stmt->setUInt16(0, GetId()); + stmt->setUInt32(1, GetInstanceId()); + if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) + { + do + { + Field* fields = result->Fetch(); + uint32 loguid = fields[0].GetUInt32(); + uint32 respawnTime = fields[1].GetUInt32(); + + _creatureRespawnTimes[loguid] = time_t(respawnTime); + } while (result->NextRow()); + } + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GO_RESPAWNS); + stmt->setUInt16(0, GetId()); + stmt->setUInt32(1, GetInstanceId()); + if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) + { + do + { + Field* fields = result->Fetch(); + uint32 loguid = fields[0].GetUInt32(); + uint32 respawnTime = fields[1].GetUInt32(); + + _goRespawnTimes[loguid] = time_t(respawnTime); + } while (result->NextRow()); + } +} + +void Map::DeleteRespawnTimes() +{ + _creatureRespawnTimes.clear(); + _goRespawnTimes.clear(); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE); + stmt->setUInt16(0, GetId()); + stmt->setUInt32(1, GetInstanceId()); + CharacterDatabase.Execute(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GO_RESPAWN_BY_INSTANCE); + stmt->setUInt16(0, GetId()); + stmt->setUInt32(1, GetInstanceId()); + CharacterDatabase.Execute(stmt); +} + +time_t Map::GetLinkedRespawnTime(uint64 guid) const +{ + uint64 linkedGuid = sObjectMgr->GetLinkedRespawnGuid(guid); + switch (GUID_HIPART(linkedGuid)) + { + case HIGHGUID_UNIT: + return GetCreatureRespawnTime(GUID_LOPART(linkedGuid)); + case HIGHGUID_GAMEOBJECT: + return GetGORespawnTime(GUID_LOPART(linkedGuid)); + default: + break; + } + + return time_t(0); +} diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 6ba08646f25..94a64126da1 100755 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -443,6 +443,36 @@ class Map : public GridRefManager void Insert(const GameObjectModel& mdl) { _dynamicTree.insert(mdl); } bool Contains(const GameObjectModel& mdl) const { return _dynamicTree.contains(mdl);} bool getObjectHitPos(uint32 phasemask, float x1, float y1, float z1, float x2, float y2, float z2, float& rx, float &ry, float& rz, float modifyDist); + + /* + RESPAWN TIMES + */ + time_t GetLinkedRespawnTime(uint64 guid) const; + time_t GetCreatureRespawnTime(uint32 dbGuid) const + { + UNORDERED_MAP::const_iterator itr = _creatureRespawnTimes.find(dbGuid); + if (itr != _creatureRespawnTimes.end()) + return itr->second; + + return time_t(0); + } + + time_t GetGORespawnTime(uint32 dbGuid) const + { + UNORDERED_MAP::const_iterator itr = _goRespawnTimes.find(dbGuid); + if (itr != _goRespawnTimes.end()) + return itr->second; + + return time_t(0); + } + + void SaveCreatureRespawnTime(uint32 dbGuid, time_t respawnTime); + void RemoveCreatureRespawnTime(uint32 dbGuid); + void SaveGORespawnTime(uint32 dbGuid, time_t respawnTime); + void RemoveGORespawnTime(uint32 dbGuid); + void LoadRespawnTimes(); + void DeleteRespawnTimes(); + private: void LoadMapAndVMap(int gx, int gy); void LoadVMap(int gx, int gy); @@ -488,6 +518,7 @@ class Map : public GridRefManager void ScriptsProcess(); void UpdateActiveCells(const float &x, const float &y, const uint32 t_diff); + protected: void SetUnloadReferenceLock(const GridCoord &p, bool on) { getNGrid(p.x_coord, p.y_coord)->setUnloadReferenceLock(on); } @@ -570,6 +601,9 @@ class Map : public GridRefManager else m_activeNonPlayers.erase(obj); } + + UNORDERED_MAP _creatureRespawnTimes; + UNORDERED_MAP _goRespawnTimes; }; enum InstanceResetMethod diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index 5543251e115..2c1bdb00834 100755 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -211,6 +211,8 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save, InstanceMap* map = new InstanceMap(GetId(), GetGridExpiry(), InstanceId, difficulty, this); ASSERT(map->IsDungeon()); + map->LoadRespawnTimes(); + bool load_data = save != NULL; map->CreateInstanceData(load_data); diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index eb09538721d..e9de3ae001f 100755 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -110,6 +110,7 @@ Map* MapManager::CreateBaseMap(uint32 id) else { map = new Map(id, i_gridCleanUpDelay, 0, REGULAR_DIFFICULTY); + map->LoadRespawnTimes(); } i_maps[id] = map; } diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index ffc09a10e22..c539dd3cc39 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -129,8 +129,7 @@ namespace Movement void MoveSplineInit::SetFacing(const Unit * target) { args.flags.EnableFacingTarget(); - //args.facing.target = target->GetObjectGuid().GetRawValue(); - args.facing.target = target->GetUInt64Value(OBJECT_FIELD_GUID); + args.facing.target = target->GetGUID(); } void MoveSplineInit::SetFacing(float angle) diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp index 465fca75030..dfdd4fc4ffc 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp @@ -166,8 +166,10 @@ bool OPvPCapturePoint::DelCreature(uint32 type) //if (Map* map = sMapMgr->FindMap(cr->GetMapId())) // map->Remove(cr, false); // delete respawn time for this creature - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN_BY_GUID); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN); stmt->setUInt32(0, guid); + stmt->setUInt16(1, cr->GetMapId()); + stmt->setUInt32(2, 0); // instance id, always 0 for world maps CharacterDatabase.Execute(stmt); cr->AddObjectToRemoveList(); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 6e32d33a7bb..5bd5961a05b 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1410,15 +1410,9 @@ void World::SetInitialWorldSettings() sLog->outString("Loading Creature Addon Data..."); sObjectMgr->LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures() - sLog->outString("Loading Creature Respawn Data..."); // must be after PackInstances() - sObjectMgr->LoadCreatureRespawnTimes(); - sLog->outString("Loading Gameobject Data..."); sObjectMgr->LoadGameobjects(); - sLog->outString("Loading Gameobject Respawn Data..."); // must be after PackInstances() - sObjectMgr->LoadGameobjectRespawnTimes(); - sLog->outString("Loading Creature Linked Respawn..."); sObjectMgr->LoadLinkedRespawn(); // must be after LoadCreatures(), LoadGameObjects() diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index d315c6417ea..89cc6ab25e5 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -314,18 +314,17 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_OLD_CORPSES, "DELETE FROM corpse WHERE corpseType = 0 OR time < (UNIX_TIMESTAMP(NOW()) - ?)", CONNECTION_ASYNC) // Creature respawn - PREPARE_STATEMENT(CHAR_SEL_CREATURE_RESPAWNS, "SELECT guid, respawnTime, instanceId FROM creature_respawn", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_REP_CREATURE_RESPAWN, "REPLACE INTO creature_respawn (guid, respawnTime, instanceId) VALUES (?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_CREATURE_RESPAWN, "DELETE FROM creature_respawn WHERE guid = ? AND instanceId = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_CREATURE_RESPAWN_BY_GUID, "DELETE FROM creature_respawn WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE, "DELETE FROM creature_respawn WHERE instanceId = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SEL_CREATURE_RESPAWNS, "SELECT guid, respawnTime FROM creature_respawn WHERE mapId = ? AND instanceId = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_REP_CREATURE_RESPAWN, "REPLACE INTO creature_respawn (guid, respawnTime, mapId, instanceId) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_CREATURE_RESPAWN, "DELETE FROM creature_respawn WHERE guid = ? AND mapId = ? AND instanceId = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE, "DELETE FROM creature_respawn WHERE mapId = ? AND instanceId = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_MAX_CREATURE_RESPAWNS, "SELECT MAX(respawnTime), instanceId FROM creature_respawn WHERE instanceId > 0 GROUP BY instanceId", CONNECTION_SYNCH) // Gameobject respawn - PREPARE_STATEMENT(CHAR_SEL_GO_RESPAWNS, "SELECT guid, respawnTime, instanceId FROM gameobject_respawn", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_REP_GO_RESPAWN, "REPLACE INTO gameobject_respawn (guid, respawnTime, instanceId) VALUES (?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_GO_RESPAWN, "DELETE FROM gameobject_respawn WHERE guid = ? AND instanceId = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_GO_RESPAWN_BY_INSTANCE, "DELETE FROM gameobject_respawn WHERE instanceId = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SEL_GO_RESPAWNS, "SELECT guid, respawnTime FROM gameobject_respawn WHERE mapId = ? AND instanceId = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_REP_GO_RESPAWN, "REPLACE INTO gameobject_respawn (guid, respawnTime, mapId, instanceId) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_GO_RESPAWN, "DELETE FROM gameobject_respawn WHERE guid = ? AND mapId = ? AND instanceId = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_GO_RESPAWN_BY_INSTANCE, "DELETE FROM gameobject_respawn WHERE mapId = ? AND instanceId = ?", CONNECTION_ASYNC) // GM Tickets PREPARE_STATEMENT(CHAR_SEL_GM_TICKETS, "SELECT ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, completed, escalated, viewed FROM gm_tickets", CONNECTION_SYNCH) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index cf6bbd7bdfa..e1530f36e44 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -296,7 +296,6 @@ enum CharacterDatabaseStatements CHAR_SEL_CREATURE_RESPAWNS, CHAR_REP_CREATURE_RESPAWN, CHAR_DEL_CREATURE_RESPAWN, - CHAR_DEL_CREATURE_RESPAWN_BY_GUID, CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE, CHAR_SEL_MAX_CREATURE_RESPAWNS, From 73e6eedce8e89f823de4646e204d78826758c840 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 7 Jun 2012 23:25:33 +0200 Subject: [PATCH 0979/1149] And missing full sql changes --- sql/base/characters_database.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 9908254ff0e..57e5f6f6ab7 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1266,6 +1266,7 @@ DROP TABLE IF EXISTS `creature_respawn`; CREATE TABLE `creature_respawn` ( `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', `respawnTime` int(10) unsigned NOT NULL DEFAULT '0', + `mapId` smallint(10) unsigned NOT NULL DEFAULT '0', `instanceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Instance Identifier', PRIMARY KEY (`guid`,`instanceId`), KEY `idx_instance` (`instanceId`) @@ -1339,6 +1340,7 @@ DROP TABLE IF EXISTS `gameobject_respawn`; CREATE TABLE `gameobject_respawn` ( `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', `respawnTime` int(10) unsigned NOT NULL DEFAULT '0', + `mapId` smallint(10) unsigned NOT NULL DEFAULT '0', `instanceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Instance Identifier', PRIMARY KEY (`guid`,`instanceId`), KEY `idx_instance` (`instanceId`) From 1e34d3eaec1f650d088b55fc748fff793b7c69f0 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 7 Jun 2012 19:19:52 -0230 Subject: [PATCH 0980/1149] Db/spell_dbc: typo fix --- sql/updates/world/2012_06_07_04_world_spell_dbc.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/updates/world/2012_06_07_04_world_spell_dbc.sql b/sql/updates/world/2012_06_07_04_world_spell_dbc.sql index 3a693d025e7..de5753fc7a6 100644 --- a/sql/updates/world/2012_06_07_04_world_spell_dbc.sql +++ b/sql/updates/world/2012_06_07_04_world_spell_dbc.sql @@ -1,6 +1,6 @@ -- add missing spell to db -DELETE FROM `Spell_dbc` WHERE `Id`=28782; -INSERT INTO `Spell_dbc` (`Id`,`SchoolMask`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`Comment`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`AreaGroupId`)VALUES +DELETE FROM `spell_dbc` WHERE `Id`=28782; +INSERT INTO `spell_dbc` (`Id`,`SchoolMask`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`Comment`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`AreaGroupId`)VALUES (28782,0,0,0,256,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,21,1,0,-1,0,0,6,6,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,12,40,0,0,0,0,0,0,0,0,127,0,0,0,0, 'Stun Self + Immune',0,0,0,0,0,0,0,1,1,0); -- Add Stun Self + Immune aura to Snack-O-Matic IV & Vend-O-Tron D-Luxe From 1c0fc0a1eea8dc5ae1581b67b94473e669375902 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 7 Jun 2012 23:20:47 -0230 Subject: [PATCH 0981/1149] DB/misc: Some misc updates --- .../world/2012_06_07_05_world_misc.sql | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 sql/updates/world/2012_06_07_05_world_misc.sql diff --git a/sql/updates/world/2012_06_07_05_world_misc.sql b/sql/updates/world/2012_06_07_05_world_misc.sql new file mode 100644 index 00000000000..d45384dd3ef --- /dev/null +++ b/sql/updates/world/2012_06_07_05_world_misc.sql @@ -0,0 +1,117 @@ +-- Remove some bad spawns in world +DELETE FROM `creature` WHERE `guid` IN (45208,45099,45075,45136,12925,12402); +DELETE FROM `creature_addon` WHERE `guid` IN (45208,45099,45075,45136,12925,12402); + +-- Some missing Gossip +UPDATE `creature_template` SET `gossip_menu_id`=9054 WHERE `entry`=25021; +UPDATE `creature_template` SET `gossip_menu_id`=9056 WHERE `entry`=25022; +UPDATE `creature_template` SET `gossip_menu_id`=9057 WHERE `entry`=25023; +UPDATE `creature_template` SET `gossip_menu_id`=9054 WHERE `entry`=25024; +UPDATE `creature_template` SET `gossip_menu_id`=9077 WHERE `entry`=25025; +DELETE FROM `gossip_menu` WHERE `entry`=9054 AND `text_id`=12243; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (9054,12243); +DELETE FROM `gossip_menu` WHERE `entry`=9057 AND `text_id`=12245; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (9057,12245); +DELETE FROM `gossip_menu` WHERE `entry`=9077 AND `text_id`=12275; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (9077,12275); + +-- Zeppelin: "Durotar to Tirisfal Glades" +DELETE FROM `creature_transport` WHERE `transport_entry`=164871; +INSERT INTO `creature_transport` (`guid`,`transport_entry`,`npc_entry`,`TransOffsetX`,`TransOffsetY`,`TransOffsetZ`,`TransOffsetO`,`emote`) VALUES +(1,164871,15214,7.005304,-7.647912,-16.11262,2.897247,0), -- Invisible Stalker +(2,164871,24934,-4.516505,-13.11248,-22.59472,1.53589,0), -- Snack-O-Matic IV +(3,164871,24935,-6.37827,-13.18376,-22.59391,4.712389,0), -- Vend-O-Tron D-Luxe +(4,164871,25070,-9.407872,-8.023982,-17.15783,3.176499,0), -- Chief Officer Coppernut +(5,164871,25071,7.248865,-5.480326,-17.68592,4.817109,432), -- Crewman Rusthammer +(6,164871,25072,8.008065,-10.71344,-17.67366,1.169371,432), -- Crewman Quickfix +(7,164871,25074,5.023749,-7.69781,-17.78876,5.986479,432), -- Crewman Sparkfly +(8,164871,25075,-8.875813,-11.40282,-22.5883,6.248279,0), -- Zeppelin Controls +(9,164871,25075,-3.307774,-9.474165,-23.69589,1.553343,0), -- Zeppelin Controls +(10,164871,25075,4.482075,-13.40077,-23.59003,1.623156,0), -- Zeppelin Controls +(11,164871,25075,-3.314179,-6.128806,-23.69835,4.677482,0), -- Zeppelin Controls +(12,164871,25075,4.362147,-2.254167,-23.59002,4.712389,0), -- Zeppelin Controls +(13,164871,25075,-4.161887,-7.687522,-23.69754,0,0), -- Zeppelin Controls +(14,164871,25075,11.74357,-10.44521,-24.21887,6.161012,0), -- Zeppelin Controls +(15,164871,25075,10.82609,-12.18536,-23.48949,3.176499,0), -- Zeppelin Controls +(16,164871,25075,10.70341,-3.505423,-23.49001,3.246312,0), -- Zeppelin Controls +(17,164871,25076,-2.727229,-7.772857,-23.69677,1.553343,432), -- Navigator Fairweather +(18,164871,25077,-19.68856,-8.170582,-14.37648,3.176499,0), -- Sky-Captain Cloudkicker +(19,164871,25079,-5.1094,-11.14663,-17.60601,4.485496,0), -- Deathguard Fowles +(20,164871,25083,-5.212496,-4.927022,-17.5966,1.43117,0), -- Deathguard Lawson +(21,164871,25171,-8.703286,-11.40788,-22.58871,0.03490658,0); -- Invisible Stalker (Scale x0.5) +-- gameobject 21680 -6.905273,-4.876801,-17.51628,5.911792 Rotation: 0,0,0.9850225,0.1724255 + +-- Zeppelin: "Durotar to Thunder Bluff" +DELETE FROM `creature_transport` WHERE `transport_entry`=190549; +INSERT INTO `creature_transport` (`guid`,`transport_entry`,`npc_entry`,`TransOffsetX`,`TransOffsetY`,`TransOffsetZ`,`TransOffsetO`,`emote`) VALUES +(1,190549,3084,-4.83257,-4.312334,-17.63218,1.623156,0), -- Bluffwatcher +(2,190549,3084,-5.206744,-11.34318,-17.61012,4.712389,0), -- Bluffwatcher +(3,190549,24934,10.32099,-3.573514,-23.49413,3.176499,0), -- Snack-O-Matic IV +(4,190549,24935,10.2871,-12.02722,-23.49424,3.106686,0), -- Vend-O-Tron D-Luxe +(5,190549,25075,-3.396398,-7.905448,-23.69672,6.248279,0), -- Zeppelin Controls +(6,190549,34715,-9.183155,-7.775729,-17.21699,3.281219,0), -- Sky-Captain "Dusty" Blastnut +(7,190549,34717,-13.67017,-12.40177,-15.98756,4.590216,0), -- Crewman Pipewrench +(8,190549,34718,13.74505,-5.128461,-24.04518,0.1396263,207), -- Crewman Deadbolt +(9,190549,34719,7.623085,-5.025319,-17.67015,4.921828,28), -- Crewman Grit +(10,190549,34721,-0.919197,-6.164221,-23.67286,3.577925,0), -- Chief Officer Ograh +(11,190549,34723,-17.47968,-5.606984,-14.92807,3.228859,0), -- Watcher Tolwe +(12,190549,34730,-2.166869,-7.854215,-23.6919,3.385939,0); -- Navigator Zippik + +-- Zeppelin: "Durotar to Stranglethorn Val" +DELETE FROM `creature_transport` WHERE `transport_entry`=175080; +INSERT INTO `creature_transport` (`guid`,`transport_entry`,`npc_entry`,`TransOffsetX`,`TransOffsetY`,`TransOffsetZ`,`TransOffsetO`,`emote`) VALUES +(1,175080,24924,-1.207598,-9.948863,-23.67485,0.1570796,0), -- Sky-Captain Bomblast +(2,175080,24926,-10.3057,-12.10524,-16.96907,5.927236,0), -- Chief Officer Brassbolt +(3,175080,24927,-1.874165,-7.847112,-23.68718,3.385939,0), -- Navigator Sparksizzle +(4,175080,24929,9.083008,-4.964111,-23.59211,1.594056,0), -- Crewman Crosswire +(5,175080,24930,-17.0083,-7.874878,-15.18782,3.141593,0), -- Crewman Gazzlegear +(6,175080,24931,7.884921,-11.15133,-17.76227,4.90483,432), -- Crewman Fastwrench +(7,175080,24934,9.209188,-3.503923,-23.51212,3.124139,0), -- Snack-O-Matic IV +(8,175080,24935,9.554915,-12.02288,-23.50588,3.124139,0), -- Vend-O-Tron D-Luxe +(9,175080,25075,-2.705565,-7.845885,-23.6967,0.03490658,0), -- Zeppelin Controls +(10,175080,25080,-4.910018,-4.742365,-17.61534,1.605703,0), -- Grunt Umgor +(11,175080,25081,-4.939394,-10.80493,-17.61089,4.712389,0); -- Grunt Ounda + +-- Zeppelin: "Durotar to Borean Tundra" +DELETE FROM `creature_transport` WHERE `transport_entry`=186238; +INSERT INTO `creature_transport` (`guid`,`transport_entry`,`npc_entry`,`TransOffsetX`,`TransOffsetY`,`TransOffsetZ`,`TransOffsetO`,`emote`) VALUES +(1,186238,25075,9.44542,-7.849475,-16.60061,0.05235988,0), -- Zeppelin Controls +(2,186238,31720,-16.56853,-5.083331,-15.94212,1.989675,0), -- Crewman Shubbscoop +(3,186238,31723,-10.75516,-12.81286,-16.77452,4.537856,0), -- Crewman Barrowswizzle +(4,186238,31724,5.77627,-2.004689,-17.72185,1.64061,0), -- Crewman Paltertop +(5,186238,31725,10.69841,-7.821921,-16.60061,3.281219,0), -- Sky-Captain LaFontaine +(6,186238,31726,-3.453068,-13.78959,-17.61107,1.43117,0), -- Grunt Gritch +(7,186238,31727,-3.383076,-1.913925,-17.6198,4.729842,0); -- Grunt Grikee + +-- Ship: "Wetlands to Howling Fjord" +DELETE FROM `creature_transport` WHERE `transport_entry`=181688; +INSERT INTO `creature_transport` (`guid`,`transport_entry`,`npc_entry`,`TransOffsetX`,`TransOffsetY`,`TransOffsetZ`,`TransOffsetO`,`emote`) VALUES +(1,181688,31759,-9.170654,-9.222412,9.44523,4.339638,0), -- Sailor Jansen +(2,181688,31760,-24.34204,-1.495605,11.79066,4.531185,0), -- Sailor Berg +(3,181688,31761,17.25,3.982666,9.827404,1.127068,0), -- Sailor Davies +(4,181688,31762,34.08345,-0.002845,19.79711,3.124139,0), -- Navigator Marcus +(5,181688,31763,30.11512,-5.088479,19.32816,3.089233,0), -- Captain John Brookman +(6,181688,31764,26.07068,2.057755,19.32802,3.001966,0); -- First Mate Kacy Dishon + +-- Ship: "Stormwind to Borean Tundra" +DELETE FROM `creature_transport` WHERE `transport_entry`=190536; +INSERT INTO `creature_transport` (`guid`,`transport_entry`,`npc_entry`,`TransOffsetX`,`TransOffsetY`,`TransOffsetZ`,`TransOffsetO`,`emote`) VALUES +(1,190536,31788,27.59511,-2.344238,19.32811,3.228859,0), -- Captain Constance +(2,190536,31789,28.09979,5.993899,19.32799,3.647738,0), -- First Mate Fitzgerald +(3,190536,31790,34.22358,0.067648,19.76266,3.071779,0), -- Navigator Meyer +(4,190536,31791,0.919363,8.75723,9.436611,1.256637,0), -- Sailor Dawning +(5,190536,31792,-4.766113,0.09985352,9.36669,4.834562,0), -- Sailor Picardo +(6,190536,31793,17.146,-3.921387,9.813052,5.497081,0); -- Sailor Phillips + +-- Ship: "Feralas to Feathermoon Stronghold" +DELETE FROM `creature_transport` WHERE `transport_entry`=177233; +INSERT INTO `creature_transport` (`guid`,`transport_entry`,`npc_entry`,`TransOffsetX`,`TransOffsetY`,`TransOffsetZ`,`TransOffsetO`,`emote`) VALUES +(1,177233,3681,-38.64771,-0.071194,6.08577,0.06981317,0), -- Wisp +(2,177233,3681,29.56227,0.119925,24.45391,0.08726646,0), -- Wisp +(3,177233,25019,12.80499,-7.601957,6.105068,2.9147,0), -- Merchant Felagunne +(4,177233,25020,12.95386,7.333937,6.131125,3.281219,0), -- Galley Chief Alunwea +(5,177233,25021,-21.41735,-2.833596,4.391686,6.248279,0), -- Mariner Moonblade +(6,177233,25022,20.86332,-1.285908,11.80898,2.949606,0), -- Mariner Stillwake +(7,177233,25023,-36.76907,0.169367,5.975922,3.176499,0), -- Mariner Everwatch +(8,177233,25024,-21.65951,3.22012,4.402726,0.1396263,0), -- Mariner Softsong +(9,177233,25025,31.13095,-0.454317,16.73282,2.96706,0); -- Captain Idrilae From 32aa983fe23ffc49ae0cf5322bae9f31beab5d47 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 8 Jun 2012 14:52:52 +0200 Subject: [PATCH 0982/1149] Core/Maps: Fixed possible crash when resetting instances --- src/server/game/Instances/InstanceSaveMgr.cpp | 5 ++++- src/server/game/Maps/Map.cpp | 14 ++++++++++---- src/server/game/Maps/Map.h | 2 ++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index 2e0d1e47c92..59bb86cb68e 100755 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -543,7 +543,10 @@ void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId) if (iMap && iMap->IsDungeon()) ((InstanceMap*)iMap)->Reset(INSTANCE_RESET_RESPAWN_DELAY); - iMap->DeleteRespawnTimes(); + if (iMap) + iMap->DeleteRespawnTimes(); + else + Map::DeleteRespawnTimesInDB(mapid, instanceId); // Free up the instance id and allow it to be reused sMapMgr->FreeInstanceId(instanceId); diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 6f19fdcbc0a..82659e32016 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2880,14 +2880,19 @@ void Map::DeleteRespawnTimes() _creatureRespawnTimes.clear(); _goRespawnTimes.clear(); + DeleteRespawnTimesInDB(GetId(), GetInstanceId()); +} + +void Map::DeleteRespawnTimesInDB(uint16 mapId, uint32 instanceId) +{ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE); - stmt->setUInt16(0, GetId()); - stmt->setUInt32(1, GetInstanceId()); + stmt->setUInt16(0, mapId); + stmt->setUInt32(1, instanceId); CharacterDatabase.Execute(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GO_RESPAWN_BY_INSTANCE); - stmt->setUInt16(0, GetId()); - stmt->setUInt32(1, GetInstanceId()); + stmt->setUInt16(0, mapId); + stmt->setUInt32(1, instanceId); CharacterDatabase.Execute(stmt); } @@ -2906,3 +2911,4 @@ time_t Map::GetLinkedRespawnTime(uint64 guid) const return time_t(0); } + diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 94a64126da1..214f50e6d3c 100755 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -473,6 +473,8 @@ class Map : public GridRefManager void LoadRespawnTimes(); void DeleteRespawnTimes(); + static void DeleteRespawnTimesInDB(uint16 mapId, uint32 instanceId); + private: void LoadMapAndVMap(int gx, int gy); void LoadVMap(int gx, int gy); From 643b68926eb895c155df76e8534bca8155dbe87d Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 8 Jun 2012 08:56:49 -0400 Subject: [PATCH 0983/1149] Core/Spells: codestyle and fix logic for adding unit state casting. (thx Moriquendu) --- src/server/game/Entities/Unit/Unit.cpp | 15 ++-- .../game/Spells/Auras/SpellAuraEffects.cpp | 84 +++++++++---------- 2 files changed, 50 insertions(+), 49 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index e89e5df2a0c..d133a2b6a38 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2893,10 +2893,11 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) InterruptSpell(CURRENT_AUTOREPEAT_SPELL); m_AutoRepeatFirstCast = true; } - if ((m_currentSpells[CURRENT_GENERIC_SPELL] && m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->CalcCastTime(this) > 0) && IsNonMeleeSpellCasted(false, false, true)) + if ((pSpell->m_spellInfo->CalcCastTime(this) > 0) && IsNonMeleeSpellCasted(false, false, true)) AddUnitState(UNIT_STATE_CASTING); - } break; + break; + } case CURRENT_CHANNELED_SPELL: { // channel spells always break generic non-delayed and any channeled spells @@ -2908,8 +2909,9 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != 75) InterruptSpell(CURRENT_AUTOREPEAT_SPELL); AddUnitState(UNIT_STATE_CASTING); - } break; + break; + } case CURRENT_AUTOREPEAT_SPELL: { // only Auto Shoot does not break anything @@ -2921,12 +2923,11 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) } // special action: set first cast flag m_AutoRepeatFirstCast = true; - } break; + break; + } default: - { - // other spell types don't break anything now - } break; + break; // other spell types don't break anything now } // current spell (if it is still here) may be safely deleted now diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 1b6ae348b1c..efbaf76406c 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -3523,55 +3523,55 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8 } case 477: case 1733: + { + if (!GetBaseAmount()) { - if (!GetBaseAmount()) - { - mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT) - | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN) - | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM) - | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR) - | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_DISORIENTED) - | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN); + mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT) + | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN) + | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM) + | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR) + | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_DISORIENTED) + | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN); - target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SNARE, apply); - target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_ROOT, apply); - target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FEAR, apply); - target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply); - target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SLEEP, apply); - target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_CHARM, apply); - target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SAPPED, apply); - target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_HORROR, apply); - target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_POLYMORPH, apply); - target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_DISORIENTED, apply); - target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply); - target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply); - target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, apply); - target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, apply); - aura_immunity_list.push_back(SPELL_AURA_MOD_STUN); - aura_immunity_list.push_back(SPELL_AURA_TRANSFORM); - aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED); - aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT); - aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE); - aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR); - } - break; + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SNARE, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_ROOT, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FEAR, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SLEEP, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_CHARM, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SAPPED, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_HORROR, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_POLYMORPH, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_DISORIENTED, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, apply); + aura_immunity_list.push_back(SPELL_AURA_MOD_STUN); + aura_immunity_list.push_back(SPELL_AURA_TRANSFORM); + aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED); + aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT); + aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE); + aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR); } + break; + } case 878: + { + if (GetBaseAmount() == 1) { - if (GetBaseAmount() == 1) - { - mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_STUN) - | (1 << MECHANIC_DISORIENTED) | (1 << MECHANIC_FREEZE); + mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_STUN) + | (1 << MECHANIC_DISORIENTED) | (1 << MECHANIC_FREEZE); - target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SNARE, apply); - target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply); - target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_DISORIENTED, apply); - target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply); - aura_immunity_list.push_back(SPELL_AURA_MOD_STUN); - aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED); - } - break; + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SNARE, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_DISORIENTED, apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply); + aura_immunity_list.push_back(SPELL_AURA_MOD_STUN); + aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED); } + break; + } default: break; } From 6107e48f8b0f80cdefa725055ef662c41ff4bb82 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 8 Jun 2012 10:08:02 -0400 Subject: [PATCH 0984/1149] Core/Spells: fix scourge strike extra damage. thanks to tibbi --- src/server/scripts/Spells/spell_dk.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 36dcb53ad00..7a4b8f273d2 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -381,6 +381,7 @@ class spell_dk_scourge_strike : public SpellScriptLoader class spell_dk_scourge_strike_SpellScript : public SpellScript { PrepareSpellScript(spell_dk_scourge_strike_SpellScript); + float multiplier; bool Validate(SpellInfo const* /*spellEntry*/) { @@ -390,11 +391,18 @@ class spell_dk_scourge_strike : public SpellScriptLoader } void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (Unit* unitTarget = GetHitUnit()) + multiplier = (GetEffectValue() * unitTarget->GetDiseasesByCaster(caster->GetGUID()) / 100.f); + } + + void HandleAfterHit() { Unit* caster = GetCaster(); if (Unit* unitTarget = GetHitUnit()) { - int32 bp = CalculatePctN(GetHitDamage(), GetEffectValue() * unitTarget->GetDiseasesByCaster(caster->GetGUID())); + int32 bp = GetHitDamage() * multiplier; caster->CastCustomSpell(unitTarget, DK_SPELL_SCOURGE_STRIKE_TRIGGERED, &bp, NULL, NULL, true); } } @@ -402,6 +410,7 @@ class spell_dk_scourge_strike : public SpellScriptLoader void Register() { OnEffectHitTarget += SpellEffectFn(spell_dk_scourge_strike_SpellScript::HandleDummy, EFFECT_2, SPELL_EFFECT_DUMMY); + AfterHit += SpellHitFn(spell_dk_scourge_strike_SpellScript::HandleAfterHit); } }; From e9feb0e3e2e3f1b7069dfe156f3063e9df39d357 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 8 Jun 2012 10:57:24 -0400 Subject: [PATCH 0985/1149] DB/Spells: fix bonus coefficient for lava burst. (thx 3kids) --- sql/updates/world/2012_06_08_00_world_spell_bonus_data.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2012_06_08_00_world_spell_bonus_data.sql diff --git a/sql/updates/world/2012_06_08_00_world_spell_bonus_data.sql b/sql/updates/world/2012_06_08_00_world_spell_bonus_data.sql new file mode 100644 index 00000000000..bf899421605 --- /dev/null +++ b/sql/updates/world/2012_06_08_00_world_spell_bonus_data.sql @@ -0,0 +1 @@ +UPDATE `spell_bonus_data` SET `direct_bonus`=0.571 WHERE `entry`=51505; From 69bf716c1b24ccac1b4a6a226467f731e3ce369c Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 8 Jun 2012 11:01:27 -0400 Subject: [PATCH 0986/1149] Core/Spells: set default multiplier for scourge strike bonus damage to 1. --- src/server/scripts/Spells/spell_dk.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 7a4b8f273d2..c33ca548d73 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -383,6 +383,12 @@ class spell_dk_scourge_strike : public SpellScriptLoader PrepareSpellScript(spell_dk_scourge_strike_SpellScript); float multiplier; + bool Load() + { + multiplier = 1.0f; + return true; + } + bool Validate(SpellInfo const* /*spellEntry*/) { if (!sSpellMgr->GetSpellInfo(DK_SPELL_SCOURGE_STRIKE_TRIGGERED)) From 69ea6b5d323a6834fd4e54c6979de20ffc596be2 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 8 Jun 2012 13:08:38 -0400 Subject: [PATCH 0987/1149] Core/Pets: base implementation for pet aura scaling system. not currently hooked into anything. (thx vincent-michael for the base work) --- src/server/scripts/Spells/spell_pet.cpp | 178 ++++++++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 src/server/scripts/Spells/spell_pet.cpp diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp new file mode 100644 index 00000000000..1265b808ecd --- /dev/null +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -0,0 +1,178 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* + * Scripts for spells with SPELLFAMILY_DEATHKNIGHT and SPELLFAMILY_GENERIC spells used by deathknight players. + * Ordered alphabetically using scriptname. + * Scriptnames of files in this file should be prefixed with "spell_dk_". + */ + +#include "ScriptMgr.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" + +enum PetCalculate +{ + SPELL_HUNTER_PET_CRIT = 19591, + SPELL_HUNTER_PET_SCALING_01 = 34902, + SPELL_HUNTER_PET_SCALING_02 = 34903, + SPELL_HUNTER_PET_SCALING_03 = 34904, + SPELL_HUNTER_PET_SCALING_04 = 61017, + SPELL_WARLOCK_PET_CRIT = 35695, + SPELL_WARLOCK_PET_HIT_EXPERTISE = 61013, + SPELL_DK_PET_HIT = 61697, + SPELL_SHAMAN_PET_HIT = 61783, +}; + +class spell_gen_pet_calculate : public SpellScriptLoader +{ + public: + spell_gen_pet_calculate() : SpellScriptLoader("spell_gen_pet_calculate") { } + + class spell_gen_pet_calculate_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_pet_calculate_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } + + void CalculateAmountCritSpell(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float CritSpell = 0.0f; + // Crit from Intellect + CritSpell += owner->GetSpellCritFromIntellect(); + // Increase crit from SPELL_AURA_MOD_SPELL_CRIT_CHANCE + CritSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE); + // Increase crit from SPELL_AURA_MOD_CRIT_PCT + CritSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_PCT); + // Increase crit spell from spell crit ratings + CritSpell += owner->GetRatingBonusValue(CR_CRIT_SPELL); + + amount += int32(CritSpell); + } + } + + void CalculateAmountCritMelee(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float CritMelee = 0.0f; + // Crit from Agility + CritMelee += owner->GetMeleeCritFromAgility(); + // Increase crit from SPELL_AURA_MOD_WEAPON_CRIT_PERCENT + CritMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_WEAPON_CRIT_PERCENT); + // Increase crit from SPELL_AURA_MOD_CRIT_PCT + CritMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_PCT); + // Increase crit melee from melee crit ratings + CritMelee += owner->GetRatingBonusValue(CR_CRIT_MELEE); + + amount += int32(CritMelee); + } + } + + void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float HitMelee = 0.0f; + // Increase hit from SPELL_AURA_MOD_HIT_CHANCE + HitMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_HIT_CHANCE); + // Increase hit melee from meele hit ratings + HitMelee += owner->GetRatingBonusValue(CR_HIT_MELEE); + + amount += int32(HitMelee); + } + } + + void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float HitSpell = 0.0f; + // Increase hit from SPELL_AURA_MOD_SPELL_HIT_CHANCE + HitSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_HIT_CHANCE); + // Increase hit spell from spell hit ratings + HitSpell += owner->GetRatingBonusValue(CR_HIT_SPELL); + + amount += int32(HitSpell); + } + } + + void CalculateAmountExpertise(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float Expertise = 0.0f; + // Increase hit from SPELL_AURA_MOD_EXPERTISE + Expertise += owner->GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE); + // Increase Expertise from Expertise ratings + Expertise += owner->GetRatingBonusValue(CR_EXPERTISE); + + amount += int32(Expertise); + } + } + + void Register() + { + switch (m_scriptSpellId) + { + case SPELL_HUNTER_PET_CRIT: + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountCritMelee, EFFECT_0, SPELL_AURA_MOD_WEAPON_CRIT_PERCENT); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountCritSpell, EFFECT_1, SPELL_AURA_MOD_SPELL_CRIT_CHANCE); + break; + case SPELL_WARLOCK_PET_CRIT: + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountCritSpell, EFFECT_0, SPELL_AURA_MOD_SPELL_CRIT_CHANCE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountCritMelee, EFFECT_1, SPELL_AURA_MOD_WEAPON_CRIT_PERCENT); + break; + case SPELL_WARLOCK_PET_HIT_EXPERTISE: + case SPELL_HUNTER_PET_SCALING_04: + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountMeleeHit, EFFECT_0, SPELL_AURA_MOD_HIT_CHANCE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountSpellHit, EFFECT_1, SPELL_AURA_MOD_SPELL_HIT_CHANCE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountExpertise, EFFECT_2, SPELL_AURA_MOD_EXPERTISE); + break; + case SPELL_DK_PET_HIT: + case SPELL_SHAMAN_PET_HIT: + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountMeleeHit, EFFECT_0, SPELL_AURA_MOD_HIT_CHANCE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountSpellHit, EFFECT_1, SPELL_AURA_MOD_SPELL_HIT_CHANCE); + break; + default: + break; + } + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_gen_pet_calculate_AuraScript(); + } +}; + +void AddSC_pet_spell_scripts() +{ + new spell_gen_pet_calculate(); +} From 38424024e610356d75e4333e3198698d85dfd847 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 8 Jun 2012 14:05:17 -0400 Subject: [PATCH 0988/1149] Core/Pets: more updates to spells for pet scaling. based on research and sniffs. (some spells are unk at this moment) --- src/server/scripts/Spells/spell_pet.cpp | 54 ++++++++++++++++++++----- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index 1265b808ecd..d1c71817316 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -25,17 +25,51 @@ #include "SpellScript.h" #include "SpellAuraEffects.h" -enum PetCalculate +enum HunterPetCalculate { - SPELL_HUNTER_PET_CRIT = 19591, + SPELL_TAMED_PET_PASSIVE_06 = 19591, + SPELL_TAMED_PET_PASSIVE_07 = 20784, + SPELL_TAMED_PET_PASSIVE_08 = 34666, + SPELL_TAMED_PET_PASSIVE_09 = 34667, + SPELL_TAMED_PET_PASSIVE_10 = 34675, SPELL_HUNTER_PET_SCALING_01 = 34902, SPELL_HUNTER_PET_SCALING_02 = 34903, SPELL_HUNTER_PET_SCALING_03 = 34904, SPELL_HUNTER_PET_SCALING_04 = 61017, - SPELL_WARLOCK_PET_CRIT = 35695, - SPELL_WARLOCK_PET_HIT_EXPERTISE = 61013, - SPELL_DK_PET_HIT = 61697, - SPELL_SHAMAN_PET_HIT = 61783, +}; + +enum WarlockPetCalculate +{ + SPELL_PET_PASSIVE_CRIT = 35695, + SPELL_PET_PASSIVE_DAMAGE_TAKEN = 35697, + SPELL_WARLOCK_PET_SCALING_01 = 34947, + SPELL_WARLOCK_PET_SCALING_02 = 34956, + SPELL_WARLOCK_PET_SCALING_03 = 34957, + SPELL_WARLOCK_PET_SCALING_04 = 34958, + SPELL_WARLOCK_PET_SCALING_05 = 61013, +}; + +enum DKPetCalculate +{ + SPELL_DEATH_KNIGHT_PET_SCALING_01 = 54566, + SPELL_DEATH_KNIGHT_PET_SCALING_02 = 51996, + SPELL_DEATH_KNIGHT_PET_SCALING_03 = 61697, +}; + +enum ShamanPetCalculate +{ + SPELL_FERAL_SPIRIT_PET_UNK_01 = 35674, + SPELL_FERAL_SPIRIT_PET_UNK_02 = 35675, + SPELL_FERAL_SPIRIT_PET_UNK_03 = 35676, + SPELL_FERAL_SPIRIT_PET_SCALING_04 = 61783, +}; + +enum MiscPetCalculate +{ + SPELL_FERAL_SPIRIT_PET_SCALING_04 = 61783, + SPELL_PET_HEALTH_SCALING = 61679, + SPELL_PET_UNK_01 = 67561, + SPELL_PET_UNK_01 = 67557, }; class spell_gen_pet_calculate : public SpellScriptLoader @@ -141,21 +175,21 @@ class spell_gen_pet_calculate : public SpellScriptLoader { switch (m_scriptSpellId) { - case SPELL_HUNTER_PET_CRIT: + case SPELL_TAMED_PET_PASSIVE_06: DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountCritMelee, EFFECT_0, SPELL_AURA_MOD_WEAPON_CRIT_PERCENT); DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountCritSpell, EFFECT_1, SPELL_AURA_MOD_SPELL_CRIT_CHANCE); break; - case SPELL_WARLOCK_PET_CRIT: + case SPELL_PET_PASSIVE_CRIT: DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountCritSpell, EFFECT_0, SPELL_AURA_MOD_SPELL_CRIT_CHANCE); DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountCritMelee, EFFECT_1, SPELL_AURA_MOD_WEAPON_CRIT_PERCENT); break; - case SPELL_WARLOCK_PET_HIT_EXPERTISE: + case SPELL_WARLOCK_PET_SCALING_05: case SPELL_HUNTER_PET_SCALING_04: DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountMeleeHit, EFFECT_0, SPELL_AURA_MOD_HIT_CHANCE); DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountSpellHit, EFFECT_1, SPELL_AURA_MOD_SPELL_HIT_CHANCE); DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountExpertise, EFFECT_2, SPELL_AURA_MOD_EXPERTISE); break; - case SPELL_DK_PET_HIT: + case SPELL_DEATH_KNIGHT_PET_SCALING_03: case SPELL_SHAMAN_PET_HIT: DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountMeleeHit, EFFECT_0, SPELL_AURA_MOD_HIT_CHANCE); DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountSpellHit, EFFECT_1, SPELL_AURA_MOD_SPELL_HIT_CHANCE); From 8e8bf5c67d346e61ce81b971043e56a01ac2ed6c Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 8 Jun 2012 14:10:05 -0400 Subject: [PATCH 0989/1149] Core/Pets: one more update before i leave for the weekend! --- src/server/scripts/Spells/spell_pet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index d1c71817316..27cb0d3bb71 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -66,7 +66,7 @@ enum ShamanPetCalculate enum MiscPetCalculate { - SPELL_FERAL_SPIRIT_PET_SCALING_04 = 61783, + SPELL_MAGE_PET_PASSIVE_ELEMENTAL = 44559, SPELL_PET_HEALTH_SCALING = 61679, SPELL_PET_UNK_01 = 67561, SPELL_PET_UNK_01 = 67557, From 8ab6d578ce207c3e195939960c8e81a1da90554d Mon Sep 17 00:00:00 2001 From: joschiwald Date: Fri, 8 Jun 2012 22:25:33 +0200 Subject: [PATCH 0990/1149] fix typos - i failed so hard :( --- ...2012_05_28_01_world_spell_script_names.sql | 4 ++-- ...012_05_28_02_world_spelldifficulty_dbc.sql | 2 +- .../world/2012_05_28_03_world_conditions.sql | 2 +- src/server/game/Spells/Spell.cpp | 21 +------------------ src/server/game/Spells/SpellMgr.cpp | 5 ++++- .../Northrend/Naxxramas/boss_gothik.cpp | 16 +++++++------- .../Ulduar/HallsOfLightning/boss_loken.cpp | 8 ++++--- src/server/scripts/Spells/spell_druid.cpp | 11 ++++------ src/server/scripts/Spells/spell_generic.cpp | 17 +++++++++------ src/server/scripts/Spells/spell_shaman.cpp | 8 +++---- 10 files changed, 42 insertions(+), 52 deletions(-) diff --git a/sql/updates/world/2012_05_28_01_world_spell_script_names.sql b/sql/updates/world/2012_05_28_01_world_spell_script_names.sql index e1db8fff869..00ceb1df9e9 100644 --- a/sql/updates/world/2012_05_28_01_world_spell_script_names.sql +++ b/sql/updates/world/2012_05_28_01_world_spell_script_names.sql @@ -39,8 +39,8 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES (28833, 'spell_four_horsemen_mark'), (28834, 'spell_four_horsemen_mark'), (28835, 'spell_four_horsemen_mark'), -(27831, 'spell_gothic_shadow_bolt_volley'), -(55638, 'spell_gothic_shadow_bolt_volley'), +(27831, 'spell_gothik_shadow_bolt_volley'), +(55638, 'spell_gothik_shadow_bolt_volley'), (31447, 'spell_mark_of_kazrogal'), (32960, 'spell_mark_of_kazzak'), (33654, 'spell_gruul_shatter'), diff --git a/sql/updates/world/2012_05_28_02_world_spelldifficulty_dbc.sql b/sql/updates/world/2012_05_28_02_world_spelldifficulty_dbc.sql index 8caaf1a6fc7..198a2bf839d 100644 --- a/sql/updates/world/2012_05_28_02_world_spelldifficulty_dbc.sql +++ b/sql/updates/world/2012_05_28_02_world_spelldifficulty_dbc.sql @@ -1,6 +1,6 @@ SET @DIFF := xxxx; -- set by TDB team DELETE FROM `spelldifficulty_dbc` WHERE `id` BETWEEN @DIFF+0 AND @DIFF+2; -INSERT INTO `spelldifficulty_dbc` (`id`,`spelld0`,`spellid1`,`spelld2`,`spellid3`) VALUES +INSERT INTO `spelldifficulty_dbc` (`id`,`spellid0`,`spellid1`,`spellid2`,`spellid3`) VALUES (@DIFF+0,50811,61547,0,0), (@DIFF+1,57762,59990,0,0), (@DIFF+2,57763,61489,0,0); diff --git a/sql/updates/world/2012_05_28_03_world_conditions.sql b/sql/updates/world/2012_05_28_03_world_conditions.sql index 8369352481b..43d422e9239 100644 --- a/sql/updates/world/2012_05_28_03_world_conditions.sql +++ b/sql/updates/world/2012_05_28_03_world_conditions.sql @@ -1,5 +1,5 @@ DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry` IN (19938,30877); -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES (17,0,19938,0,0,1,1,17743,0,0,0,0,'','Awaken Peon'), (17,0,30877,0,0,31,1,3,17326,0,0,0,'','Tag Murloc'); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 8165c8172d7..da1841f7400 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5297,29 +5297,10 @@ SpellCastResult Spell::CheckCast(bool strict) } } - for (int i = 0; i < MAX_SPELL_EFFECTS; i++) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { switch (m_spellInfo->Effects[i].ApplyAuraName) { - case SPELL_AURA_DUMMY: - { - //custom check - switch (m_spellInfo->Id) - { - case 44795: // Parachute - { - float x, y, z; - m_caster->GetPosition(x, y, z); - float ground_Z = m_caster->GetMap()->GetHeight(m_caster->GetPhaseMask(), x, y, z); - if (fabs(ground_Z - z) < 0.1f) - return SPELL_FAILED_DONT_REPORT; - break; - } - default: - break; - } - break; - } case SPELL_AURA_MOD_POSSESS_PET: { if (m_caster->GetTypeId() != TYPEID_PLAYER) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 87373321a36..fd71ee294d7 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2975,7 +2975,6 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->EffectImplicitTargetB[0] = 0; break; case 63665: // Charge (Argent Tournament emote on riders) - case 31447: // Mark of Kaz'rogal (needs target selection script) case 31298: // Sleep (needs target selection script) case 51904: // Summon Ghouls On Scarlet Crusade (this should use conditions table, script for this spell needs to be fixed) case 2895: // Wrath of Air Totem rank 1 (Aura) @@ -3257,6 +3256,10 @@ void SpellMgr::LoadDbcDataCorrections() case 53313: // Entangling Roots (Rank 8) -- Nature's Grasp Proc spellInfo->CastingTimeIndex = 1; break; + case 59414: // Pulsing Shockwave Aura (Loken) + // this flag breaks movement, remove it + spellInfo->AttributesEx &= ~SPELL_ATTR1_CHANNELED_1; + break; case 61719: // Easter Lay Noblegarden Egg Aura - Interrupt flags copied from aura which this aura is linked with spellInfo->AuraInterruptFlags = AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE; break; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index 227dfaada9c..7f4915cb3f1 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -18,6 +18,8 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "SpellScript.h" +#include "GridNotifiers.h" +#include "CombatAI.h" #include "naxxramas.h" enum Yells @@ -591,14 +593,14 @@ class mob_gothik_minion : public CreatureScript } }; -class spell_gothic_shadow_bolt_volley : public SpellScriptLoader +class spell_gothik_shadow_bolt_volley : public SpellScriptLoader { public: - spell_gothic_shadow_bolt_volley() : SpellScriptLoader("spell_gothic_shadow_bolt_volley") { } + spell_gothik_shadow_bolt_volley() : SpellScriptLoader("spell_gothik_shadow_bolt_volley") { } - class spell_gothic_shadow_bolt_volley_SpellScript : public SpellScript + class spell_gothik_shadow_bolt_volley_SpellScript : public SpellScript { - PrepareSpellScript(spell_gothic_shadow_bolt_volley_SpellScript); + PrepareSpellScript(spell_gothik_shadow_bolt_volley_SpellScript); void FilterTargets(std::list& unitList) { @@ -607,13 +609,13 @@ class spell_gothic_shadow_bolt_volley : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_gothic_shadow_bolt_volley_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnUnitTargetSelect += SpellUnitTargetFn(spell_gothik_shadow_bolt_volley_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; SpellScript* GetSpellScript() const { - return new spell_gothic_shadow_bolt_volley_SpellScript(); + return new spell_gothik_shadow_bolt_volley_SpellScript(); } }; @@ -621,5 +623,5 @@ void AddSC_boss_gothik() { new boss_gothik(); new mob_gothik_minion(); - new spell_gothic_shadow_bolt_volley(); + new spell_gothik_shadow_bolt_volley(); } diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp index 0034747c6c2..bdaaa002b3f 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp @@ -19,7 +19,7 @@ /* ScriptData SDName: Boss Loken SD%Complete: 60% -SDComment: Missing intro. Aura is not working (59414) +SDComment: Missing intro. SDCategory: Halls of Lightning EndScriptData */ @@ -85,7 +85,7 @@ public: { m_uiArcLightning_Timer = 15000; m_uiLightningNova_Timer = 20000; - m_uiResumePulsingShockwave_Timer = 15000; + m_uiResumePulsingShockwave_Timer = 1000; m_uiHealthAmountModifier = 1; @@ -112,7 +112,10 @@ public: Talk(SAY_DEATH); if (instance) + { instance->SetData(TYPE_LOKEN, DONE); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_PULSING_SHOCKWAVE_AURA); + } } void KilledUnit(Unit* /*victim*/) @@ -130,7 +133,6 @@ public: { if (m_uiResumePulsingShockwave_Timer <= uiDiff) { - //breaks at movement, can we assume when it's time, this spell is casted and also must stop movement? DoCast(me, SPELL_PULSING_SHOCKWAVE_AURA, true); DoCast(me, SPELL_PULSING_SHOCKWAVE_N, true); diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index f759efbee83..9dedeaf5bd7 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -388,7 +388,7 @@ class spell_dru_starfall_dummy : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_dru_starfall_dummy_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); + OnUnitTargetSelect += SpellUnitTargetFn(spell_dru_starfall_dummy_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_dru_starfall_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; @@ -549,8 +549,7 @@ class spell_dru_savage_roar : public SpellScriptLoader void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { Unit* target = GetTarget(); - int32 bp0 = aurEff->GetAmount(); // todo: check if needed - target->CastCustomSpell(target, DRUID_SAVAGE_ROAR, &bp0, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); + target->CastSpell(target, DRUID_SAVAGE_ROAR, true, NULL, aurEff, GetCasterGUID()); } void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) @@ -560,9 +559,8 @@ class spell_dru_savage_roar : public SpellScriptLoader void Register() { - // todo: check AuraEffectHandleModes - AfterEffectApply += AuraEffectApplyFn(spell_dru_savage_roar_AuraScript::AfterApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); - AfterEffectRemove += AuraEffectRemoveFn(spell_dru_savage_roar_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + AfterEffectApply += AuraEffectApplyFn(spell_dru_savage_roar_AuraScript::AfterApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_dru_savage_roar_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); } }; @@ -626,7 +624,6 @@ class spell_dru_survival_instincts : public SpellScriptLoader void Register() { - // todo: check AuraEffectHandleModes AfterEffectApply += AuraEffectApplyFn(spell_dru_survival_instincts_AuraScript::AfterApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); AfterEffectRemove += AuraEffectRemoveFn(spell_dru_survival_instincts_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index b619dd9ac6f..85b1a79efd7 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -239,7 +239,7 @@ class spell_gen_parachute : public SpellScriptLoader { PrepareAuraScript(spell_gen_parachute_AuraScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spell*/) { if (!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE) || !sSpellMgr->GetSpellInfo(SPELL_PARACHUTE_BUFF)) return false; @@ -252,7 +252,12 @@ class spell_gen_parachute : public SpellScriptLoader if (target->IsFalling()) { target->RemoveAurasDueToSpell(SPELL_PARACHUTE); - target->CastSpell(target, SPELL_PARACHUTE_BUFF, true); + + float x, y, z; + target->GetPosition(x, y, z); + float groundZ = target->GetMap()->GetHeight(target->GetPhaseMask(), x, y, z); + if (fabs(groundZ - z) > 0.1f) + target->CastSpell(target, SPELL_PARACHUTE_BUFF, true); } } @@ -2864,6 +2869,8 @@ class spell_gen_summon_elemental : public SpellScriptLoader enum Mounts { + SPELL_COLD_WEATHER_FLYING = 54197, + // Magic Broom SPELL_MAGIC_BROOM_60 = 42680, SPELL_MAGIC_BROOM_100 = 42683, @@ -2953,7 +2960,7 @@ class spell_gen_mount : public SpellScriptLoader // Triggered spell id dependent on riding skill and zone bool canFly = false; uint32 vmap = GetVirtualMapForMapAndZone(target->GetMapId(), target->GetZoneId()); - if (vmap == 530 || (vmap == 571 && target->HasSpell(54197))) + if (vmap == 530 || (vmap == 571 && target->HasSpell(SPELL_COLD_WEATHER_FLYING))) canFly = true; float x, y, z; @@ -2998,9 +3005,7 @@ class spell_gen_mount : public SpellScriptLoader if (mount) { - // Prevent stacking of mounts and client crashes upon dismounting - //target->RemoveAurasByType(SPELL_AURA_MOUNTED, 0, GetHitAura()); - + PreventHitAura(); target->CastSpell(target, mount, true); } } diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index a7c196701ad..da15c5c5046 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -713,7 +713,7 @@ class spell_sha_sentry_totem : public SpellScriptLoader { PrepareAuraScript(spell_sha_sentry_totem_AuraScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spell*/) { if (!sSpellMgr->GetSpellInfo(SHAMAN_BIND_SIGHT)) return false; @@ -732,9 +732,9 @@ class spell_sha_sentry_totem : public SpellScriptLoader void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - if (GetCaster) - if (Player* caster = GetCaster()->ToPlayer()) - caster->StopCastingBindSight(); + if (Unit* caster = GetCaster()) + if (caster->GetTypeId() == TYPEID_PLAYER) + caster->ToPlayer()->StopCastingBindSight(); } void Register() From 563c70e41a902d3009a37df8d44d133eb125ff13 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 9 Jun 2012 12:52:01 +0200 Subject: [PATCH 0991/1149] DB/Spawns: Corrected Nerub'ar Broodkeeper spawns in ICC, they should be hanging from the ceiling. --- .../world/2012_06_09_00_world_creature.sql | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 sql/updates/world/2012_06_09_00_world_creature.sql diff --git a/sql/updates/world/2012_06_09_00_world_creature.sql b/sql/updates/world/2012_06_09_00_world_creature.sql new file mode 100644 index 00000000000..b2454b54163 --- /dev/null +++ b/sql/updates/world/2012_06_09_00_world_creature.sql @@ -0,0 +1,21 @@ +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=36725; -- Nerub'ar Broodkeeper + +DELETE FROM `creature` WHERE `guid` IN (200939,200949,200956,201106,201127,201170); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`MovementType`) VALUES +(200939,36725,631,15,1,-210.3750,2202.675,75.09233,0.13962630,7200,0,0), -- Nerub'ar Broodkeeper +(200949,36725,631,15,1,-220.3819,2177.068,81.70050,0.85521130,7200,0,0), -- Nerub'ar Broodkeeper +(200956,36725,631,15,1,-216.4861,2245.405,81.70050,5.18362800,7200,0,0), -- Nerub'ar Broodkeeper +(201106,36725,631,15,1,-211.2899,2219.420,75.09233,0.15707960,7200,0,0), -- Nerub'ar Broodkeeper +(201127,36725,631,15,1,-249.8542,2219.672,86.27979,5.95157300,7200,0,0), -- Nerub'ar Broodkeeper +(201170,36725,631,15,1,-250.6129,2203.800,86.27979,0.03490658,7200,0,0); -- Nerub'ar Broodkeeper + +DELETE FROM `creature_addon` WHERE `guid` IN (200912,200934,200939,200949,200956,201106,201127,201170); +INSERT INTO `creature_addon` (`guid`,`mount`,`bytes1`,`bytes2`,`auras`) VALUES +(200912,0,0x3000000,0x1,''), -- Nerub'ar Broodkeeper +(200934,0,0x3000000,0x1,''), -- Nerub'ar Broodkeeper +(200939,0,0x3000000,0x1,''), -- Nerub'ar Broodkeeper +(200949,0,0x3000000,0x1,''), -- Nerub'ar Broodkeeper +(200956,0,0x3000000,0x1,''), -- Nerub'ar Broodkeeper +(201106,0,0x3000000,0x1,''), -- Nerub'ar Broodkeeper +(201127,0,0x3000000,0x1,''), -- Nerub'ar Broodkeeper +(201170,0,0x3000000,0x1,''); -- Nerub'ar Broodkeeper From 7d98f2ffc7652e4797839a86063abfff86603de9 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 9 Jun 2012 13:09:49 +0200 Subject: [PATCH 0992/1149] Core/Spells: Fixed WotF and PvP trinket shared cooldown --- src/server/scripts/Spells/spell_generic.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index e23e21cf2cd..07e9546173d 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -660,22 +660,16 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScriptLoader return true; } - void HandleScript(SpellEffIndex /*effIndex*/) + void HandleScript() { - Player* caster = GetCaster()->ToPlayer(); - SpellInfo const* spellInfo = GetSpellInfo(); - caster->AddSpellCooldown(spellInfo->Id, 0, time(NULL) + sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER)->GetRecoveryTime() / IN_MILLISECONDS); - WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4); - data << uint64(caster->GetGUID()); - data << uint8(0); - data << uint32(spellInfo->Id); - data << uint32(0); - caster->GetSession()->SendPacket(&data); + // This is only needed because spells cast from spell_linked_spell are triggered by default + // Spell::SendSpellCooldown() skips all spells with TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD + GetCaster()->ToPlayer()->AddSpellAndCategoryCooldowns(GetSpellInfo(), GetCastItem() ? GetCastItem()->GetEntry() : 0, GetSpell()); } void Register() { - OnEffectHit += SpellEffectFn(spell_pvp_trinket_wotf_shared_cd_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); + AfterCast += SpellCastFn(spell_pvp_trinket_wotf_shared_cd_SpellScript::HandleScript); } }; From be5f0b0f478dec5f9a49680dec24ba0dd1870f63 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 9 Jun 2012 22:50:56 +0200 Subject: [PATCH 0993/1149] Core/Scripts: Fixed crash in mob_phase_hunterAI, this entire script is crappy and needs rewrite anyway. --- src/server/scripts/Outland/netherstorm.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp index afc18c71b92..16dac13d1a9 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/netherstorm.cpp @@ -777,10 +777,10 @@ public: PlayerGUID = who->GetGUID(); } - void SpellHit(Unit* /*caster*/, const SpellInfo* /*spell*/) - { - DoCast(me, SPELL_DE_MATERIALIZE); - } + //void SpellHit(Unit* /*caster*/, const SpellInfo* /*spell*/) + //{ + // DoCast(me, SPELL_DE_MATERIALIZE); + //} void UpdateAI(const uint32 diff) { From f6fc2ef8cfa6cd67ec6c7595de6b4101d6877385 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 10 Jun 2012 03:28:51 +0200 Subject: [PATCH 0994/1149] Fix non PCH build --- src/server/game/Server/Protocol/PacketLog.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/Server/Protocol/PacketLog.cpp b/src/server/game/Server/Protocol/PacketLog.cpp index bede48ace87..a8e184c369a 100644 --- a/src/server/game/Server/Protocol/PacketLog.cpp +++ b/src/server/game/Server/Protocol/PacketLog.cpp @@ -18,6 +18,7 @@ #include "PacketLog.h" #include "Config.h" #include "ByteBuffer.h" +#include "WorldPacket.h" PacketLog::PacketLog() : _file(NULL) { From 41d2de2ca3affcc7fbb900a6d7e177960cb569ef Mon Sep 17 00:00:00 2001 From: kandera Date: Sun, 10 Jun 2012 16:10:43 -0300 Subject: [PATCH 0995/1149] Core/Spells: fix addition of unit_state_casting. thx vincent-michael --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index d133a2b6a38..a99356681e2 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2893,7 +2893,7 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) InterruptSpell(CURRENT_AUTOREPEAT_SPELL); m_AutoRepeatFirstCast = true; } - if ((pSpell->m_spellInfo->CalcCastTime(this) > 0) && IsNonMeleeSpellCasted(false, false, true)) + if (pSpell->m_spellInfo->CalcCastTime(this) > 0) AddUnitState(UNIT_STATE_CASTING); break; From 41b1416445d917e7cce09853829ef9f1a8e632bf Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 10 Jun 2012 21:40:27 -0500 Subject: [PATCH 0996/1149] Core/Warden: Fixed a crash when Warden.ClientCheckFailAction was set to ban in the config, and Warden::Penalty was called in a context where check is NULL closes #6736 --- src/server/game/Warden/Warden.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/server/game/Warden/Warden.cpp b/src/server/game/Warden/Warden.cpp index 0734e0a0f63..cc1c2ff50c6 100644 --- a/src/server/game/Warden/Warden.cpp +++ b/src/server/game/Warden/Warden.cpp @@ -188,7 +188,11 @@ std::string Warden::Penalty(WardenCheck* check /*= NULL*/) std::string accountName; AccountMgr::GetName(_session->GetAccountId(), accountName); std::stringstream banReason; - banReason << "Warden Anticheat Violation: " << check->Comment << " (CheckId: " << check->CheckId << ")"; + banReason << "Warden Anticheat Violation"; + // Check can be NULL, for example if the client sent a wrong signature in the warden packet (CHECKSUM FAIL) + if (check) + banReason << ": " << check->Comment << " (CheckId: " << check->CheckId << ")"; + sWorld->BanAccount(BAN_ACCOUNT, accountName, duration.str(), banReason.str(),"Server"); return "Ban"; From 28f8e42a69fa6348600c7a45629830bfe5b2dbdc Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 11 Jun 2012 11:10:46 +0200 Subject: [PATCH 0997/1149] Core/AI: Added EventInform hook for GameObjectAI and implemented it in SAI --- src/server/game/AI/CoreAI/GameObjectAI.h | 3 +- src/server/game/AI/SmartScripts/SmartAI.cpp | 5 +++ src/server/game/AI/SmartScripts/SmartAI.h | 45 ++++++++++--------- .../game/AI/SmartScripts/SmartScript.cpp | 7 +++ .../game/AI/SmartScripts/SmartScriptMgr.cpp | 1 + .../game/AI/SmartScripts/SmartScriptMgr.h | 10 ++++- .../game/Entities/GameObject/GameObject.cpp | 8 +++- 7 files changed, 53 insertions(+), 26 deletions(-) diff --git a/src/server/game/AI/CoreAI/GameObjectAI.h b/src/server/game/AI/CoreAI/GameObjectAI.h index f4555649210..21466f8c796 100644 --- a/src/server/game/AI/CoreAI/GameObjectAI.h +++ b/src/server/game/AI/CoreAI/GameObjectAI.h @@ -53,7 +53,8 @@ class GameObjectAI virtual uint64 GetData64(uint32 /*id*/) { return 0; } virtual void SetData(uint32 /*id*/, uint32 /*value*/) {} virtual void OnGameEvent(bool /*start*/, uint16 /*eventId*/) {} - virtual void OnStateChanged(uint32 /*state*/, Unit* /*unit*/) { } + virtual void OnStateChanged(uint32 /*state*/, Unit* /*unit*/) {} + virtual void EventInform(uint32 eventId) {} }; class NullGameObjectAI : public GameObjectAI diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 08f1b18ffad..98b5c0a6ba3 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -937,6 +937,11 @@ void SmartGameObjectAI::OnStateChanged(uint32 state, Unit* unit) GetScript()->ProcessEventsFor(SMART_EVENT_GO_STATE_CHANGED, unit, state); } +void SmartGameObjectAI::EventInform(uint32 eventId) +{ + GetScript()->ProcessEventsFor(SMART_EVENT_GO_EVENT_INFORM, NULL, eventId); +} + class SmartTrigger : public AreaTriggerScript { public: diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h index 435aa176d4d..3a3a7dc9510 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.h +++ b/src/server/game/AI/SmartScripts/SmartAI.h @@ -235,30 +235,31 @@ class SmartAI : public CreatureAI class SmartGameObjectAI : public GameObjectAI { -public: - SmartGameObjectAI(GameObject* g) : GameObjectAI(g), go(g) {} - ~SmartGameObjectAI() {} + public: + SmartGameObjectAI(GameObject* g) : GameObjectAI(g), go(g) {} + ~SmartGameObjectAI() {} - void UpdateAI(uint32 diff); - void InitializeAI(); - void Reset(); - SmartScript* GetScript() { return &mScript; } - static int Permissible(const GameObject* g); + void UpdateAI(uint32 diff); + void InitializeAI(); + void Reset(); + SmartScript* GetScript() { return &mScript; } + static int Permissible(const GameObject* g); - bool GossipHello(Player* player); - bool GossipSelect(Player* player, uint32 sender, uint32 action); - bool GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/); - bool QuestAccept(Player* player, Quest const* quest); - bool QuestReward(Player* player, Quest const* quest, uint32 opt); - uint32 GetDialogStatus(Player* /*player*/); - void Destroyed(Player* player, uint32 eventId); - void SetData(uint32 id, uint32 value); - void SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker); - void OnGameEvent(bool start, uint16 eventId); - void OnStateChanged(uint32 state, Unit* unit); + bool GossipHello(Player* player); + bool GossipSelect(Player* player, uint32 sender, uint32 action); + bool GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/); + bool QuestAccept(Player* player, Quest const* quest); + bool QuestReward(Player* player, Quest const* quest, uint32 opt); + uint32 GetDialogStatus(Player* /*player*/); + void Destroyed(Player* player, uint32 eventId); + void SetData(uint32 id, uint32 value); + void SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker); + void OnGameEvent(bool start, uint16 eventId); + void OnStateChanged(uint32 state, Unit* unit); + void EventInform(uint32 eventId); -protected: - GameObject* const go; - SmartScript mScript; + protected: + GameObject* const go; + SmartScript mScript; }; #endif diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 9feca1c073a..fb17237fdc5 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -2771,6 +2771,13 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui ProcessAction(e, unit, var0, var1); break; } + case SMART_EVENT_GO_EVENT_INFORM: + { + if (e.event.eventInform.eventId != var0) + return; + ProcessAction(e, NULL, var0); + break; + } default: sLog->outErrorDb("SmartScript::ProcessEvent: Unhandled Event type %u", e.GetEventType()); break; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index d529479d9dd..bf84f39747a 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -533,6 +533,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) break; } case SMART_EVENT_GO_STATE_CHANGED: + case SMART_EVENT_GO_EVENT_INFORM: case SMART_EVENT_TIMED_EVENT_TRIGGERED: case SMART_EVENT_INSTANCE_PLAYER_ENTER: case SMART_EVENT_TRANSPORT_RELOCATE: diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 5b54a4d3048..6c43a9297fc 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -153,9 +153,10 @@ enum SMART_EVENT SMART_EVENT_IS_BEHIND_TARGET = 67, //1 // cooldownMin, CooldownMax SMART_EVENT_GAME_EVENT_START = 68, //1 // game_event.Entry SMART_EVENT_GAME_EVENT_END = 69, //1 // game_event.Entry - SMART_EVENT_GO_STATE_CHANGED = 70, // go state + SMART_EVENT_GO_STATE_CHANGED = 70, //1 // go state + SMART_EVENT_GO_EVENT_INFORM = 71, //1 // eventId - SMART_EVENT_END = 71, + SMART_EVENT_END = 72, }; struct SmartEvent @@ -350,6 +351,11 @@ struct SmartEvent uint32 state; } goStateChanged; + struct + { + uint32 eventId; + } eventInform; + struct { uint32 param1; diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 58440095075..1d9958a6524 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -1711,7 +1711,13 @@ bool GameObject::IsInRange(float x, float y, float z, float radius) const void GameObject::EventInform(uint32 eventId) { - if (eventId && m_zoneScript) + if (!eventId) + return; + + if (AI()) + AI()->EventInform(eventId); + + if (m_zoneScript) m_zoneScript->ProcessEvent(this, eventId); } From 38f6f9d8cb6f31b6d9690e56e0e12da190c504fc Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 11 Jun 2012 11:15:33 -0500 Subject: [PATCH 0998/1149] Core/SAI: Missing change from previous commit --- src/server/game/AI/SmartScripts/SmartScriptMgr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 6c43a9297fc..b82d0724f53 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -1172,7 +1172,7 @@ const uint32 SmartAIEventMask[SMART_EVENT_END][2] = {SMART_EVENT_GAME_EVENT_START, SMART_SCRIPT_TYPE_MASK_CREATURE + SMART_SCRIPT_TYPE_MASK_GAMEOBJECT }, {SMART_EVENT_GAME_EVENT_END, SMART_SCRIPT_TYPE_MASK_CREATURE + SMART_SCRIPT_TYPE_MASK_GAMEOBJECT }, {SMART_EVENT_GO_STATE_CHANGED, SMART_SCRIPT_TYPE_MASK_GAMEOBJECT }, - + {SMART_EVENT_GO_EVENT_INFORM, SMART_SCRIPT_TYPE_MASK_GAMEOBJECT }, }; enum SmartEventFlags From 042f825400c347dd5144317dde969b41299ac1f2 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 11 Jun 2012 12:22:15 -0400 Subject: [PATCH 0999/1149] Core/Spells: use raw basepoint value for extra attacks. damage gets fuddled somewhere for this spell. fixes hardened steel berserker doing insane damages! --- src/server/game/Spells/SpellEffects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 0d5dac8f8e0..a01497d87dc 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -5320,7 +5320,7 @@ void Spell::EffectAddExtraAttacks(SpellEffIndex effIndex) if (unitTarget->m_extraAttacks) return; - unitTarget->m_extraAttacks = damage; + unitTarget->m_extraAttacks = GetSpellInfo()->Effects[effIndex].BasePoints; ExecuteLogEffectExtraAttacks(effIndex, unitTarget->getVictim(), damage); } From 9fe66cafbef1eeae5e7da7dcb90ba5136a645e76 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 11 Jun 2012 12:26:10 -0400 Subject: [PATCH 1000/1149] Core/Pets: add ghoul reactions to owner emotes. thx joshwhedon --- src/server/game/AI/CoreAI/PetAI.cpp | 18 ++++++++++++++++++ src/server/game/AI/CoreAI/PetAI.h | 1 + 2 files changed, 19 insertions(+) diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 160b406a6ea..5551f45cb6a 100755 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -532,3 +532,21 @@ bool PetAI::CanAttack(Unit* target) // default, though we shouldn't ever get here return false; } + + +void PetAI::ReceiveEmote(Player* player, uint32 emote) +{ + sLog->outError("recieved emote : %d", emote); + if (me->GetOwnerGUID() && me->GetOwnerGUID() == player->GetGUID()) + switch (emote) + { + case TEXT_EMOTE_COWER: + if (me->isPet() && me->ToPet()->IsPetGhoul()) + me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); + break; + case TEXT_EMOTE_ANGRY: + if (me->isPet() && me->ToPet()->IsPetGhoul()) + me->HandleEmoteCommand(EMOTE_ONESHOT_COWER); + break; + } +} \ No newline at end of file diff --git a/src/server/game/AI/CoreAI/PetAI.h b/src/server/game/AI/CoreAI/PetAI.h index ed3e2305556..8e5311fa000 100755 --- a/src/server/game/AI/CoreAI/PetAI.h +++ b/src/server/game/AI/CoreAI/PetAI.h @@ -42,6 +42,7 @@ class PetAI : public CreatureAI void MovementInform(uint32 moveType, uint32 data); void OwnerDamagedBy(Unit* attacker); void OwnerAttacked(Unit* target); + void ReceiveEmote(Player* player, uint32 textEmote); private: bool _isVisible(Unit*) const; From cdb3ab809b133b379258c82f72c652d9ee0c25cc Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 11 Jun 2012 12:28:27 -0400 Subject: [PATCH 1001/1149] Core/Pets: removed logerror from previous commit --- src/server/game/AI/CoreAI/PetAI.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 5551f45cb6a..97ae0581a18 100755 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -533,10 +533,8 @@ bool PetAI::CanAttack(Unit* target) return false; } - void PetAI::ReceiveEmote(Player* player, uint32 emote) { - sLog->outError("recieved emote : %d", emote); if (me->GetOwnerGUID() && me->GetOwnerGUID() == player->GetGUID()) switch (emote) { @@ -549,4 +547,4 @@ void PetAI::ReceiveEmote(Player* player, uint32 emote) me->HandleEmoteCommand(EMOTE_ONESHOT_COWER); break; } -} \ No newline at end of file +} From 5b8d3f8109c629b1a50b467e0d5ba49f525b9de8 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 11 Jun 2012 12:40:20 -0400 Subject: [PATCH 1002/1149] Core/Pets: more functionality for pet auras. thx to joshwhedon for the new functions. still have a lot to do! --- src/server/scripts/Spells/spell_pet.cpp | 1568 ++++++++++++++++++++++- 1 file changed, 1566 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index 27cb0d3bb71..5c1eb2f1ccd 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -36,6 +36,7 @@ enum HunterPetCalculate SPELL_HUNTER_PET_SCALING_02 = 34903, SPELL_HUNTER_PET_SCALING_03 = 34904, SPELL_HUNTER_PET_SCALING_04 = 61017, + SPELL_HUNTER_ANIMAL_HANDLER = 34453, }; enum WarlockPetCalculate @@ -47,10 +48,15 @@ enum WarlockPetCalculate SPELL_WARLOCK_PET_SCALING_03 = 34957, SPELL_WARLOCK_PET_SCALING_04 = 34958, SPELL_WARLOCK_PET_SCALING_05 = 61013, + ENTRY_FELGUARD = 17252, + ENTRY_VOIDWALKER = 1860, + ENTRY_FELHUNTER = 417, + ENTRY_SUCCUBUS = 1863, }; enum DKPetCalculate { + SPELL_DEATH_KNIGHT_RUNE_WEAPON_02 = 51906, SPELL_DEATH_KNIGHT_PET_SCALING_01 = 54566, SPELL_DEATH_KNIGHT_PET_SCALING_02 = 51996, SPELL_DEATH_KNIGHT_PET_SCALING_03 = 61697, @@ -69,7 +75,7 @@ enum MiscPetCalculate SPELL_MAGE_PET_PASSIVE_ELEMENTAL = 44559, SPELL_PET_HEALTH_SCALING = 61679, SPELL_PET_UNK_01 = 67561, - SPELL_PET_UNK_01 = 67557, + SPELL_PET_UNK_02 = 67557, }; class spell_gen_pet_calculate : public SpellScriptLoader @@ -190,7 +196,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountExpertise, EFFECT_2, SPELL_AURA_MOD_EXPERTISE); break; case SPELL_DEATH_KNIGHT_PET_SCALING_03: - case SPELL_SHAMAN_PET_HIT: +// case SPELL_SHAMAN_PET_HIT: DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountMeleeHit, EFFECT_0, SPELL_AURA_MOD_HIT_CHANCE); DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountSpellHit, EFFECT_1, SPELL_AURA_MOD_SPELL_HIT_CHANCE); break; @@ -206,6 +212,1564 @@ class spell_gen_pet_calculate : public SpellScriptLoader } }; +class spell_warl_pet_scaling_01 : public SpellScriptLoader +{ +public: + spell_warl_pet_scaling_01() : SpellScriptLoader("spell_warl_pet_scaling_01") { } + + class spell_warl_pet_scaling_01_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_pet_scaling_01_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + _tempHealth = 0; + return true; + } + + void CalculateStaminaAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isPet()) + return; + + Unit* owner = pet->ToPet()->GetOwner(); + if (!owner) + return; + + float ownerBonus = 0.0f; + + ownerBonus = CalculatePctN(owner->GetStat(STAT_STAMINA), 75); + + amount += ownerBonus; + } + } + + void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* pet = GetUnitOwner()) + if (_tempHealth) + pet->SetHealth(_tempHealth); + } + + void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* pet = GetUnitOwner()) + _tempHealth = pet->GetHealth(); + } + + void CalculateAttackPowerAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isPet()) + return; + + Unit* owner = pet->ToPet()->GetOwner(); + if (!owner) + return; + + int32 fire = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE); + int32 shadow = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW); + int32 maximum = (fire > shadow) ? fire : shadow; + if (maximum < 0) + maximum = 0; + float bonusAP = maximum * 0.57f; + + amount += bonusAP; + + // Glyph of felguard + if (pet->GetEntry() == ENTRY_FELGUARD) + { + if (AuraEffect* aurEffect = owner->GetAuraEffect(56246, EFFECT_0)) + { + float base_attPower = pet->GetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE) * pet->GetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_PCT); + amount += CalculatePctN(amount+base_attPower, aurEffect->GetAmount()); + } + } + } + } + + void CalculateDamageDoneAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isPet()) + return; + + Unit* owner = pet->ToPet()->GetOwner(); + if (!owner) + return; + + //the damage bonus used for pets is either fire or shadow damage, whatever is higher + int32 fire = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE); + int32 shadow = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW); + int32 maximum = (fire > shadow) ? fire : shadow; + if (maximum < 0) + maximum = 0; + float bonusDamage = maximum * 0.15f; + + amount += bonusDamage; + } + } + + void Register() + { + OnEffectRemove += AuraEffectRemoveFn(spell_warl_pet_scaling_01_AuraScript::RemoveEffect, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + AfterEffectApply += AuraEffectApplyFn(spell_warl_pet_scaling_01_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_01_AuraScript::CalculateStaminaAmount, EFFECT_0, SPELL_AURA_MOD_STAT); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_01_AuraScript::CalculateAttackPowerAmount, EFFECT_1, SPELL_AURA_MOD_ATTACK_POWER); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_01_AuraScript::CalculateDamageDoneAmount, EFFECT_2, SPELL_AURA_MOD_DAMAGE_DONE); + } + + private: + uint32 _tempHealth; + }; + + AuraScript* GetAuraScript() const + { + return new spell_warl_pet_scaling_01_AuraScript(); + } +}; + +class spell_warl_pet_scaling_02 : public SpellScriptLoader +{ +public: + spell_warl_pet_scaling_02() : SpellScriptLoader("spell_warl_pet_scaling_02") { } + + class spell_warl_pet_scaling_02_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_pet_scaling_02_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + _tempMana = 0; + return true; + } + + void CalculateIntellectAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isPet()) + return; + + Unit* owner = pet->ToPet()->GetOwner(); + if (!owner) + return; + + float ownerBonus = 0.0f; + + ownerBonus = CalculatePctN(owner->GetStat(STAT_INTELLECT), 30); + + amount += ownerBonus; + } + } + + void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* pet = GetUnitOwner()) + if (_tempMana) + pet->SetPower(POWER_MANA, _tempMana); + } + + void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* pet = GetUnitOwner()) + _tempMana = pet->GetPower(POWER_MANA); + } + + void CalculateArmorAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isPet()) + return; + + Unit* owner = pet->ToPet()->GetOwner(); + if (!owner) + return; + + float ownerBonus = 0.0f; + + ownerBonus = CalculatePctN(owner->GetArmor(), 35); + + amount += ownerBonus; + } + } + + void CalculateFireResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isPet()) + return; + + Unit* owner = pet->ToPet()->GetOwner(); + if (!owner) + return; + + float ownerBonus = 0.0f; + + ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_FIRE), 40); + + amount += ownerBonus; + } + } + + void Register() + { + OnEffectRemove += AuraEffectRemoveFn(spell_warl_pet_scaling_02_AuraScript::RemoveEffect, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + AfterEffectApply += AuraEffectApplyFn(spell_warl_pet_scaling_02_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_02_AuraScript::CalculateIntellectAmount, EFFECT_0, SPELL_AURA_MOD_STAT); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_02_AuraScript::CalculateArmorAmount, EFFECT_1, SPELL_AURA_MOD_RESISTANCE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_02_AuraScript::CalculateFireResistanceAmount, EFFECT_2, SPELL_AURA_MOD_RESISTANCE); + } + + private: + uint32 _tempMana; + }; + + AuraScript* GetAuraScript() const + { + return new spell_warl_pet_scaling_02_AuraScript(); + } +}; + +class spell_warl_pet_scaling_03 : public SpellScriptLoader +{ +public: + spell_warl_pet_scaling_03() : SpellScriptLoader("spell_warl_pet_scaling_03") { } + + class spell_warl_pet_scaling_03_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_pet_scaling_03_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } + + void CalculateFrostResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isPet()) + return; + + Unit* owner = pet->ToPet()->GetOwner(); + if (!owner) + return; + + float ownerBonus = 0.0f; + + ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_FROST), 40); + + amount += ownerBonus; + } + } + + void CalculateArcaneResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isPet()) + return; + + Unit* owner = pet->ToPet()->GetOwner(); + if (!owner) + return; + + float ownerBonus = 0.0f; + + ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_ARCANE), 40); + + amount += ownerBonus; + } + } + + void CalculateNatureResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isPet()) + return; + + Unit* owner = pet->ToPet()->GetOwner(); + if (!owner) + return; + + float ownerBonus = 0.0f; + + ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_NATURE), 40); + + amount += ownerBonus; + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_03_AuraScript::CalculateFrostResistanceAmount, EFFECT_0, SPELL_AURA_MOD_RESISTANCE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_03_AuraScript::CalculateArcaneResistanceAmount, EFFECT_1, SPELL_AURA_MOD_RESISTANCE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_03_AuraScript::CalculateNatureResistanceAmount, EFFECT_2, SPELL_AURA_MOD_RESISTANCE); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_warl_pet_scaling_03_AuraScript(); + } +}; + + +class spell_warl_pet_scaling_04 : public SpellScriptLoader +{ +public: + spell_warl_pet_scaling_04() : SpellScriptLoader("spell_warl_pet_scaling_04") { } + + class spell_warl_pet_scaling_04_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_pet_scaling_04_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } + + void CalculateShadowResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isPet()) + return; + + Unit* owner = pet->ToPet()->GetOwner(); + if (!owner) + return; + + float ownerBonus = 0.0f; + + ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_SHADOW), 40); + + amount += ownerBonus; + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_04_AuraScript::CalculateShadowResistanceAmount, EFFECT_0, SPELL_AURA_MOD_RESISTANCE); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_warl_pet_scaling_04_AuraScript(); + } +}; + +class spell_warl_pet_scaling_05 : public SpellScriptLoader +{ +public: + spell_warl_pet_scaling_05() : SpellScriptLoader("spell_warl_pet_scaling_05") { } + + class spell_warl_pet_scaling_05_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_pet_scaling_05_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } + + void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster() || !GetCaster()->GetOwner()) + return; + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float HitMelee = 0.0f; + // Increase hit from SPELL_AURA_MOD_SPELL_HIT_CHANCE + HitMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_HIT_CHANCE); + // Increase hit spell from spell hit ratings + HitMelee += owner->GetRatingBonusValue(CR_HIT_SPELL); + + amount += int32(HitMelee); + } + } + + void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster() || !GetCaster()->GetOwner()) + return; + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float HitSpell = 0.0f; + // Increase hit from SPELL_AURA_MOD_SPELL_HIT_CHANCE + HitSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_HIT_CHANCE); + // Increase hit spell from spell hit ratings + HitSpell += owner->GetRatingBonusValue(CR_HIT_SPELL); + + amount += int32(HitSpell); + } + } + + void CalculateAmountExpertise(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster() || !GetCaster()->GetOwner()) + return; + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float Expertise = 0.0f; + // Increase hit from SPELL_AURA_MOD_SPELL_HIT_CHANCE + Expertise += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_HIT_CHANCE); + // Increase hit spell from spell hit ratings + Expertise += owner->GetRatingBonusValue(CR_HIT_SPELL); + + amount += int32(Expertise); + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_05_AuraScript::CalculateAmountMeleeHit, EFFECT_0, SPELL_AURA_MOD_HIT_CHANCE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_05_AuraScript::CalculateAmountSpellHit, EFFECT_1, SPELL_AURA_MOD_SPELL_HIT_CHANCE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_05_AuraScript::CalculateAmountExpertise, EFFECT_2, SPELL_AURA_MOD_EXPERTISE); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_warl_pet_scaling_05_AuraScript(); + } +}; + +class spell_warl_pet_passive : public SpellScriptLoader +{ +public: + spell_warl_pet_passive() : SpellScriptLoader("spell_warl_pet_passive") { } + + class spell_warl_pet_passive_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_pet_passive_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } + + void CalculateAmountCritSpell(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster() || !GetCaster()->GetOwner()) + return; + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float CritSpell = 0.0f; + // Crit from Intellect + CritSpell += owner->GetSpellCritFromIntellect(); + // Increase crit from SPELL_AURA_MOD_SPELL_CRIT_CHANCE + CritSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE); + // Increase crit from SPELL_AURA_MOD_CRIT_PCT + CritSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_PCT); + // Increase crit spell from spell crit ratings + CritSpell += owner->GetRatingBonusValue(CR_CRIT_SPELL); + + if (AuraApplication* improvedDemonicTacticsApp = owner->GetAuraApplicationOfRankedSpell(54347)) + if (Aura* improvedDemonicTactics = improvedDemonicTacticsApp->GetBase()) + if (AuraEffect* improvedDemonicTacticsEffect = improvedDemonicTactics->GetEffect(EFFECT_0)) + amount += CalculatePctN(CritSpell, improvedDemonicTacticsEffect->GetAmount()); + } + } + + void CalculateAmountCritMelee(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster() || !GetCaster()->GetOwner()) + return; + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float CritMelee = 0.0f; + // Crit from Agility + CritMelee += owner->GetMeleeCritFromAgility(); + // Increase crit from SPELL_AURA_MOD_WEAPON_CRIT_PERCENT + CritMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_WEAPON_CRIT_PERCENT); + // Increase crit from SPELL_AURA_MOD_CRIT_PCT + CritMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_PCT); + // Increase crit melee from melee crit ratings + CritMelee += owner->GetRatingBonusValue(CR_CRIT_MELEE); + + if (AuraApplication* improvedDemonicTacticsApp = owner->GetAuraApplicationOfRankedSpell(54347)) + if (Aura* improvedDemonicTactics = improvedDemonicTacticsApp->GetBase()) + if (AuraEffect* improvedDemonicTacticsEffect = improvedDemonicTactics->GetEffect(EFFECT_0)) + amount += CalculatePctN(CritMelee, improvedDemonicTacticsEffect->GetAmount()); + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_passive_AuraScript::CalculateAmountCritSpell, EFFECT_0, SPELL_AURA_MOD_SPELL_CRIT_CHANCE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_passive_AuraScript::CalculateAmountCritMelee, EFFECT_1, SPELL_AURA_MOD_WEAPON_CRIT_PERCENT); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_warl_pet_passive_AuraScript(); + } +}; + +class spell_warl_pet_passive_damage_done : public SpellScriptLoader +{ +public: + spell_warl_pet_passive_damage_done() : SpellScriptLoader("spell_warl_pet_passive_damage_done") { } + + class spell_warl_pet_passive_damage_done_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_pet_passive_damage_done_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } + + void CalculateAmountDamageDone(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster() || !GetCaster()->GetOwner()) + return; + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + switch (GetCaster()->GetEntry()) + { + case ENTRY_VOIDWALKER: + amount += -16; + break; + case ENTRY_FELHUNTER: + amount += -20; + break; + case ENTRY_SUCCUBUS: + case ENTRY_FELGUARD: + amount += 5; + break; + } + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_passive_damage_done_AuraScript::CalculateAmountDamageDone, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_passive_damage_done_AuraScript::CalculateAmountDamageDone, EFFECT_1, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_warl_pet_passive_damage_done_AuraScript(); + } +}; + +class spell_warl_pet_passive_voidwalker : public SpellScriptLoader +{ +public: + spell_warl_pet_passive_voidwalker() : SpellScriptLoader("spell_warl_pet_passive_voidwalker") { } + + class spell_warl_pet_passive_voidwalker_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_pet_passive_voidwalker_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } + + void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isPet()) + return; + + Unit* owner = pet->ToPet()->GetOwner(); + if (!owner) + return; + + if (AuraEffect* aurEffect = owner->GetAuraEffect(56247, EFFECT_0)) + amount += aurEffect->GetAmount(); + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_passive_voidwalker_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_warl_pet_passive_voidwalker_AuraScript(); + } +}; + + +class spell_sha_pet_scaling_04 : public SpellScriptLoader +{ +public: + spell_sha_pet_scaling_04() : SpellScriptLoader("spell_sha_pet_scaling_04") { } + + class spell_sha_pet_scaling_04_AuraScript : public AuraScript + { + PrepareAuraScript(spell_sha_pet_scaling_04_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } + + void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster() || !GetCaster()->GetOwner()) + return; + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float HitMelee = 0.0f; + // Increase hit from SPELL_AURA_MOD_HIT_CHANCE + HitMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_HIT_CHANCE); + // Increase hit melee from meele hit ratings + HitMelee += owner->GetRatingBonusValue(CR_HIT_MELEE); + + amount += int32(HitMelee); + } + } + + void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster() || !GetCaster()->GetOwner()) + return; + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float HitSpell = 0.0f; + // Increase hit from SPELL_AURA_MOD_SPELL_HIT_CHANCE + HitSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_HIT_CHANCE); + // Increase hit spell from spell hit ratings + HitSpell += owner->GetRatingBonusValue(CR_HIT_SPELL); + + amount += int32(HitSpell); + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_pet_scaling_04_AuraScript::CalculateAmountMeleeHit, EFFECT_0, SPELL_AURA_MOD_HIT_CHANCE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_pet_scaling_04_AuraScript::CalculateAmountSpellHit, EFFECT_1, SPELL_AURA_MOD_SPELL_HIT_CHANCE); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_sha_pet_scaling_04_AuraScript(); + } +}; + +class spell_hun_pet_scaling_01 : public SpellScriptLoader +{ +public: + spell_hun_pet_scaling_01() : SpellScriptLoader("spell_hun_pet_scaling_01") { } + + class spell_hun_pet_scaling_01_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_pet_scaling_01_AuraScript); + + void CalculateStaminaAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isPet()) + return; + + Unit* owner = pet->ToPet()->GetOwner(); + if (!owner) + return; + + float mod = 0.45f; + float ownerBonus = 0.0f; + + PetSpellMap::const_iterator itr = (pet->ToPet()->m_spells.find(62758)); // Wild Hunt rank 1 + if (itr == pet->ToPet()->m_spells.end()) + itr = pet->ToPet()->m_spells.find(62762); // Wild Hunt rank 2 + + if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt + { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value + AddPctN(mod, spellInfo->Effects[EFFECT_0].CalcValue()); + } + + ownerBonus = owner->GetStat(STAT_STAMINA)*mod; + + amount += ownerBonus; + } + } + + void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* pet = GetUnitOwner()) + if (_tempHealth) + pet->SetHealth(_tempHealth); + } + + void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* pet = GetUnitOwner()) + _tempHealth = pet->GetHealth(); + } + + void CalculateAttackPowerAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isPet()) + return; + + Unit* owner = pet->ToPet()->GetOwner(); + if (!owner) + return; + + float mod = 1.0f; //Hunter contribution modifier + float bonusAP = 0.0f; + + PetSpellMap::const_iterator itr = (pet->ToPet()->m_spells.find(62758)); // Wild Hunt rank 1 + if (itr == pet->ToPet()->m_spells.end()) + itr = pet->ToPet()->m_spells.find(62762); // Wild Hunt rank 2 + + if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt + { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value + mod += CalculatePctN(1.0f, spellInfo->Effects[EFFECT_1].CalcValue()); + } + + bonusAP = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.22f * mod; + + amount += bonusAP; + } + } + + void CalculateDamageDoneAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isPet()) + return; + + Unit* owner = pet->ToPet()->GetOwner(); + if (!owner) + return; + + float mod = 1.0f; //Hunter contribution modifier + float bonusDamage = 0.0f; + + PetSpellMap::const_iterator itr = (pet->ToPet()->m_spells.find(62758)); // Wild Hunt rank 1 + if (itr == pet->ToPet()->m_spells.end()) + itr = pet->ToPet()->m_spells.find(62762); // Wild Hunt rank 2 + + if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt + { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value + mod += CalculatePctN(1.0f, spellInfo->Effects[EFFECT_1].CalcValue()); + } + + bonusDamage = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.1287f * mod; + + amount += bonusDamage; + } + } + + void Register() + { + OnEffectRemove += AuraEffectRemoveFn(spell_hun_pet_scaling_01_AuraScript::RemoveEffect, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + AfterEffectApply += AuraEffectApplyFn(spell_hun_pet_scaling_01_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_01_AuraScript::CalculateStaminaAmount, EFFECT_0, SPELL_AURA_MOD_STAT); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_01_AuraScript::CalculateAttackPowerAmount, EFFECT_1, SPELL_AURA_MOD_ATTACK_POWER); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_01_AuraScript::CalculateDamageDoneAmount, EFFECT_2, SPELL_AURA_MOD_DAMAGE_DONE); + } + + private: + uint32 _tempHealth; + }; + + AuraScript* GetAuraScript() const + { + return new spell_hun_pet_scaling_01_AuraScript(); + } +}; + +class spell_hun_pet_scaling_02 : public SpellScriptLoader +{ +public: + spell_hun_pet_scaling_02() : SpellScriptLoader("spell_hun_pet_scaling_02") { } + + class spell_hun_pet_scaling_02_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_pet_scaling_02_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } + + void CalculateFrostResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isPet()) + return; + + Unit* owner = pet->ToPet()->GetOwner(); + if (!owner) + return; + + float ownerBonus = 0.0f; + + ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_FROST), 40); + + amount += ownerBonus; + } + } + + void CalculateFireResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isPet()) + return; + + Unit* owner = pet->ToPet()->GetOwner(); + if (!owner) + return; + + float ownerBonus = 0.0f; + + ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_FIRE), 40); + + amount += ownerBonus; + } + } + + void CalculateNatureResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isPet()) + return; + + Unit* owner = pet->ToPet()->GetOwner(); + if (!owner) + return; + + float ownerBonus = 0.0f; + + ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_NATURE), 40); + + amount += ownerBonus; + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_02_AuraScript::CalculateFrostResistanceAmount, EFFECT_1, SPELL_AURA_MOD_RESISTANCE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_02_AuraScript::CalculateFireResistanceAmount, EFFECT_0, SPELL_AURA_MOD_RESISTANCE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_02_AuraScript::CalculateNatureResistanceAmount, EFFECT_2, SPELL_AURA_MOD_RESISTANCE); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_hun_pet_scaling_02_AuraScript(); + } +}; + +class spell_hun_pet_scaling_03 : public SpellScriptLoader +{ +public: + spell_hun_pet_scaling_03() : SpellScriptLoader("spell_hun_pet_scaling_03") { } + + class spell_hun_pet_scaling_03_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_pet_scaling_03_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } + + void CalculateShadowResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isPet()) + return; + + Unit* owner = pet->ToPet()->GetOwner(); + if (!owner) + return; + + float ownerBonus = 0.0f; + + ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_SHADOW), 40); + + amount += ownerBonus; + } + } + + void CalculateArcaneResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isPet()) + return; + + Unit* owner = pet->ToPet()->GetOwner(); + if (!owner) + return; + + float ownerBonus = 0.0f; + + ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_ARCANE), 40); + + amount += ownerBonus; + } + } + + void CalculateArmorAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isPet()) + return; + + Unit* owner = pet->ToPet()->GetOwner(); + if (!owner) + return; + + float ownerBonus = 0.0f; + + ownerBonus = CalculatePctN(owner->GetArmor(), 35); + + amount += ownerBonus; + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_03_AuraScript::CalculateShadowResistanceAmount, EFFECT_0, SPELL_AURA_MOD_RESISTANCE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_03_AuraScript::CalculateArcaneResistanceAmount, EFFECT_1, SPELL_AURA_MOD_RESISTANCE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_03_AuraScript::CalculateArmorAmount, EFFECT_2, SPELL_AURA_MOD_RESISTANCE); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_hun_pet_scaling_03_AuraScript(); + } +}; + +class spell_hun_pet_scaling_04 : public SpellScriptLoader +{ +public: + spell_hun_pet_scaling_04() : SpellScriptLoader("spell_hun_pet_scaling_04") { } + + class spell_hun_pet_scaling_04_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_pet_scaling_04_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } + + void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster() || !GetCaster()->GetOwner()) + return; + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float HitMelee = 0.0f; + // Increase hit from SPELL_AURA_MOD_HIT_CHANCE + HitMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_HIT_CHANCE); + // Increase hit melee from meele hit ratings + HitMelee += owner->GetRatingBonusValue(CR_HIT_MELEE); + + amount += int32(HitMelee); + } + } + + void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster() || !GetCaster()->GetOwner()) + return; + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float HitSpell = 0.0f; + // Increase hit from SPELL_AURA_MOD_SPELL_HIT_CHANCE + HitSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_HIT_CHANCE); + // Increase hit spell from spell hit ratings + HitSpell += owner->GetRatingBonusValue(CR_HIT_SPELL); + + amount += int32(HitSpell); + } + } + + void CalculateAmountExpertise(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster() || !GetCaster()->GetOwner()) + return; + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float Expertise = 0.0f; + // Increase hit from SPELL_AURA_MOD_EXPERTISE + Expertise += owner->GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE); + // Increase Expertise from Expertise ratings + Expertise += owner->GetRatingBonusValue(CR_EXPERTISE); + + amount += int32(Expertise); + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_04_AuraScript::CalculateAmountMeleeHit, EFFECT_0, SPELL_AURA_MOD_HIT_CHANCE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_04_AuraScript::CalculateAmountSpellHit, EFFECT_1, SPELL_AURA_MOD_SPELL_HIT_CHANCE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_04_AuraScript::CalculateAmountExpertise, EFFECT_2, SPELL_AURA_MOD_EXPERTISE); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_hun_pet_scaling_04_AuraScript(); + } +}; + +class spell_hun_pet_passive_crit : public SpellScriptLoader +{ +public: + spell_hun_pet_passive_crit() : SpellScriptLoader("spell_hun_pet_passive_crit") { } + + class spell_hun_pet_passive_crit_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_pet_passive_crit_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } + + void CalculateAmountCritSpell(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster() || !GetCaster()->GetOwner()) + return; + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float CritSpell = 0.0f; + // Crit from Intellect + // CritSpell += owner->GetSpellCritFromIntellect(); + // Increase crit from SPELL_AURA_MOD_SPELL_CRIT_CHANCE + // CritSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE); + // Increase crit from SPELL_AURA_MOD_CRIT_PCT + // CritSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_PCT); + // Increase crit spell from spell crit ratings + // CritSpell += owner->GetRatingBonusValue(CR_CRIT_SPELL); + + amount += (CritSpell*0.8f); + } + } + + void CalculateAmountCritMelee(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster() || !GetCaster()->GetOwner()) + return; + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float CritMelee = 0.0f; + // Crit from Agility + // CritMelee += owner->GetMeleeCritFromAgility(); + // Increase crit from SPELL_AURA_MOD_WEAPON_CRIT_PERCENT + // CritMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_WEAPON_CRIT_PERCENT); + // Increase crit from SPELL_AURA_MOD_CRIT_PCT + // CritMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_PCT); + // Increase crit melee from melee crit ratings + // CritMelee += owner->GetRatingBonusValue(CR_CRIT_MELEE); + + amount += (CritMelee*0.8f); + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_passive_crit_AuraScript::CalculateAmountCritSpell, EFFECT_1, SPELL_AURA_MOD_SPELL_CRIT_CHANCE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_passive_crit_AuraScript::CalculateAmountCritMelee, EFFECT_0, SPELL_AURA_MOD_WEAPON_CRIT_PERCENT); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_hun_pet_passive_crit_AuraScript(); + } +}; + +class spell_hun_pet_passive_damage_done : public SpellScriptLoader +{ +public: + spell_hun_pet_passive_damage_done() : SpellScriptLoader("spell_hun_pet_passive_damage_done") { } + + class spell_hun_pet_passive_damage_done_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_pet_passive_damage_done_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } + + void CalculateAmountDamageDone(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster() || !GetCaster()->GetOwner()) + return; + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // Pet's base damage changes depending on happiness + if (GetCaster()->isPet() && GetCaster()->ToPet()->isHunterPet()) + { + switch (GetCaster()->ToPet()->GetHappinessState()) + { + case HAPPY: + // 125% of normal damage + amount += 25.0f; + break; + case CONTENT: + // 100% of normal damage, nothing to modify + break; + case UNHAPPY: + // 75% of normal damage + amount += -25.0f; + break; + } + } + // Cobra Reflexes + if (AuraEffect* cobraReflexes = GetCaster()->GetAuraEffectOfRankedSpell(61682, EFFECT_0)) + amount -= cobraReflexes->GetAmount(); + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_passive_damage_done_AuraScript::CalculateAmountDamageDone, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_hun_pet_passive_damage_done_AuraScript(); + } +}; + +class spell_hun_animal_handler : public SpellScriptLoader +{ +public: + spell_hun_animal_handler() : SpellScriptLoader("spell_hun_animal_handler") { } + + class spell_hun_animal_handler_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_animal_handler_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } + + void CalculateAmountDamageDone(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster() || !GetCaster()->GetOwner()) + return; + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + if (AuraEffect* aurEffect = owner->GetAuraEffectOfRankedSpell(SPELL_HUNTER_ANIMAL_HANDLER, EFFECT_1)) + amount = aurEffect->GetAmount(); + else + amount = 0; + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_animal_handler_AuraScript::CalculateAmountDamageDone, EFFECT_0, SPELL_AURA_MOD_ATTACK_POWER_PCT); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_hun_animal_handler_AuraScript(); + } +}; + + +class spell_dk_avoidance_passive : public SpellScriptLoader +{ +public: + spell_dk_avoidance_passive() : SpellScriptLoader("spell_dk_avoidance_passive") { } + + class spell_dk_avoidance_passive_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_avoidance_passive_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } + + void CalculateAvoidanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + Unit* owner = pet->GetOwner(); + if (!owner) + return; + + // Army of the dead ghoul + if (pet->GetEntry() == 24207) + amount = -90; + // Night of the dead + else if (owner->HasAura(55623)) + amount = -90; + else if (owner->HasAura(55620)) + amount = -45; + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_avoidance_passive_AuraScript::CalculateAvoidanceAmount, EFFECT_0, SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_dk_avoidance_passive_AuraScript(); + } +}; + +class spell_dk_pet_scaling_01 : public SpellScriptLoader +{ +public: + spell_dk_pet_scaling_01() : SpellScriptLoader("spell_dk_pet_scaling_01") { } + + class spell_dk_pet_scaling_01_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_pet_scaling_01_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + _tempHealth = 0; + return true; + } + + void CalculateStaminaAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isGuardian()) + return; + + Unit* owner = pet->GetOwner(); + if (!owner) + return; + + float mod = 0.3f; + + // Ravenous Dead + AuraEffect const* aurEff = NULL; + // Check just if owner has Ravenous Dead since it's effect is not an aura + aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0); + if (aurEff) + { + mod += CalculatePctN(mod, aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue()); // Ravenous Dead edits the original scale + } + // Glyph of the Ghoul + aurEff = owner->GetAuraEffect(58686, 0); + if (aurEff) + mod += CalculatePctN(1.0f, aurEff->GetAmount()); // Glyph of the Ghoul adds a flat value to the scale mod + float ownerBonus = float(owner->GetStat(STAT_STAMINA)) * mod; + amount += ownerBonus; + } + } + + void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* pet = GetUnitOwner()) + if (_tempHealth) + pet->SetHealth(_tempHealth); + } + + void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* pet = GetUnitOwner()) + _tempHealth = pet->GetHealth(); + } + + void CalculateStrengthAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + if (!pet->isGuardian()) + return; + + Unit* owner = pet->GetOwner(); + if (!owner) + return; + + float mod = 0.7f; + + // Ravenous Dead + AuraEffect const* aurEff = NULL; + // Check just if owner has Ravenous Dead since it's effect is not an aura + aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0); + if (aurEff) + { + mod += CalculatePctN(mod, aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue()); // Ravenous Dead edits the original scale + } + // Glyph of the Ghoul + aurEff = owner->GetAuraEffect(58686, 0); + if (aurEff) + mod += CalculatePctN(1.0f, aurEff->GetAmount()); // Glyph of the Ghoul adds a flat value to the scale mod + float ownerBonus = float(owner->GetStat(STAT_STRENGTH)) * mod; + amount += ownerBonus; + } + } + + void Register() + { + OnEffectRemove += AuraEffectRemoveFn(spell_dk_pet_scaling_01_AuraScript::RemoveEffect, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + AfterEffectApply += AuraEffectApplyFn(spell_dk_pet_scaling_01_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_pet_scaling_01_AuraScript::CalculateStaminaAmount, EFFECT_0, SPELL_AURA_MOD_STAT); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_pet_scaling_01_AuraScript::CalculateStrengthAmount, EFFECT_1, SPELL_AURA_MOD_STAT); + } + + private: + uint32 _tempHealth; + }; + + AuraScript* GetAuraScript() const + { + return new spell_dk_pet_scaling_01_AuraScript(); + } +}; + +class spell_dk_pet_scaling_02 : public SpellScriptLoader +{ +public: + spell_dk_pet_scaling_02() : SpellScriptLoader("spell_dk_pet_scaling_02") { } + + class spell_dk_pet_scaling_02_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_pet_scaling_02_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } + + void CalculateAmountMeleeHaste(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster() || !GetCaster()->GetOwner()) + return; + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float HasteMelee = 0.0f; + // Increase hit from SPELL_AURA_MOD_HIT_CHANCE + HasteMelee += (1-owner->m_modAttackSpeedPct[BASE_ATTACK])*100; + + amount += int32(HasteMelee); + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_pet_scaling_02_AuraScript::CalculateAmountMeleeHaste, EFFECT_1, SPELL_AURA_MELEE_SLOW); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_dk_pet_scaling_02_AuraScript(); + } +}; + +class spell_dk_pet_scaling_03 : public SpellScriptLoader +{ +public: + spell_dk_pet_scaling_03() : SpellScriptLoader("spell_dk_pet_scaling_03") { } + + class spell_dk_pet_scaling_03_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_pet_scaling_03_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } + + void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster() || !GetCaster()->GetOwner()) + return; + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float HitMelee = 0.0f; + // Increase hit from SPELL_AURA_MOD_HIT_CHANCE + HitMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_HIT_CHANCE); + // Increase hit melee from meele hit ratings + HitMelee += owner->GetRatingBonusValue(CR_HIT_MELEE); + + amount += int32(HitMelee); + } + } + + void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster() || !GetCaster()->GetOwner()) + return; + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float HitSpell = 0.0f; + // Increase hit from SPELL_AURA_MOD_SPELL_HIT_CHANCE + HitSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_HIT_CHANCE); + // Increase hit spell from spell hit ratings + HitSpell += owner->GetRatingBonusValue(CR_HIT_SPELL); + + amount += int32(HitSpell); + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_pet_scaling_03_AuraScript::CalculateAmountMeleeHit, EFFECT_0, SPELL_AURA_MOD_HIT_CHANCE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_pet_scaling_03_AuraScript::CalculateAmountSpellHit, EFFECT_1, SPELL_AURA_MOD_SPELL_HIT_CHANCE); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_dk_pet_scaling_03_AuraScript(); + } +}; + +class spell_dk_rune_weapon_scaling_02 : public SpellScriptLoader +{ +public: + spell_dk_rune_weapon_scaling_02() : SpellScriptLoader("spell_dk_rune_weapon_scaling_02") { } + + class spell_dk_rune_weapon_scaling_02_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_rune_weapon_scaling_02_AuraScript); + + bool Load() + { + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } + + void CalculateDamageDoneAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* pet = GetUnitOwner()) + { + Unit* owner = pet->GetOwner(); + if (!owner) + return; + + if (pet->isGuardian()) + ((Guardian*)pet)->SetBonusDamage(owner->GetTotalAttackPowerValue(BASE_ATTACK)); + + amount += owner->CalculateDamage(BASE_ATTACK, true, true);; + } + } + + void CalculateAmountMeleeHaste(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster() || !GetCaster()->GetOwner()) + return; + if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + { + // For others recalculate it from: + float HasteMelee = 0.0f; + // Increase hit from SPELL_AURA_MOD_HIT_CHANCE + HasteMelee += (1-owner->m_modAttackSpeedPct[BASE_ATTACK])*100; + + amount += int32(HasteMelee); + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_rune_weapon_scaling_02_AuraScript::CalculateDamageDoneAmount, EFFECT_0, SPELL_AURA_MOD_DAMAGE_DONE); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_rune_weapon_scaling_02_AuraScript::CalculateAmountMeleeHaste, EFFECT_1, SPELL_AURA_MELEE_SLOW); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_dk_rune_weapon_scaling_02_AuraScript(); + } +}; + void AddSC_pet_spell_scripts() { new spell_gen_pet_calculate(); From b80621838a1594cc11dc273c43655ed4f65698c5 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 11 Jun 2012 13:26:30 -0400 Subject: [PATCH 1003/1149] Core/Spells: Correctly fix basepoint calculation for adding extra attacks. --- src/server/game/Spells/SpellEffects.cpp | 2 +- src/server/game/Spells/SpellInfo.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index a01497d87dc..0d5dac8f8e0 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -5320,7 +5320,7 @@ void Spell::EffectAddExtraAttacks(SpellEffIndex effIndex) if (unitTarget->m_extraAttacks) return; - unitTarget->m_extraAttacks = GetSpellInfo()->Effects[effIndex].BasePoints; + unitTarget->m_extraAttacks = damage; ExecuteLogEffectExtraAttacks(effIndex, unitTarget->getVictim(), damage); } diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index a931f759163..7995087f2c1 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -450,6 +450,7 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const if (!basePointsPerLevel && (_spellInfo->Attributes & SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION && _spellInfo->SpellLevel) && Effect != SPELL_EFFECT_WEAPON_PERCENT_DAMAGE && Effect != SPELL_EFFECT_KNOCK_BACK && + Effect != SPELL_EFFECT_ADD_EXTRA_ATTACKS && ApplyAuraName != SPELL_AURA_MOD_SPEED_ALWAYS && ApplyAuraName != SPELL_AURA_MOD_SPEED_NOT_STACK && ApplyAuraName != SPELL_AURA_MOD_INCREASE_SPEED && From a2848f543e1f265f712be0b5bdd20be557a29208 Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 12 Jun 2012 08:53:21 -0400 Subject: [PATCH 1004/1149] Core/Spells: use calculated basepoints for mechanic_immunity_mask aura effect. --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index efbaf76406c..849a7136ea8 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -3377,7 +3377,7 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8 case 96: case 1615: { - if (GetBaseAmount()) + if (GetAmount()) { mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT) | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN) @@ -3486,7 +3486,7 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8 } case 1630: { - if (!GetBaseAmount()) + if (!GetAmount()) { target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, apply); aura_immunity_list.push_back(SPELL_AURA_MOD_TAUNT); @@ -3524,7 +3524,7 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8 case 477: case 1733: { - if (!GetBaseAmount()) + if (!GetAmount()) { mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT) | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN) @@ -3558,7 +3558,7 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8 } case 878: { - if (GetBaseAmount() == 1) + if (GetAmount() == 1) { mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_STUN) | (1 << MECHANIC_DISORIENTED) | (1 << MECHANIC_FREEZE); From c6c23b7f7ef148f88b64346a44a46f51d2cad212 Mon Sep 17 00:00:00 2001 From: kaelima Date: Tue, 12 Jun 2012 18:14:33 +0200 Subject: [PATCH 1005/1149] Core/DungeonFinder: - Prevent players from vote kicking in combat (basic implementation, still needs a timer) partially closes #2563 - Prevent players from teleporting to a finished dungeon using macro commands. Closes #6748 Also add a missing change for ff77610e1d3fee89507b8469b10bea800f8c0815 thanks 2010phenix for the hint. --- src/server/game/DungeonFinding/LFGMgr.cpp | 13 ++++++------- src/server/game/Entities/Player/Player.cpp | 8 ++++++-- src/server/game/Handlers/QuestHandler.cpp | 2 +- src/server/game/Server/Protocol/PacketLog.cpp | 2 +- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 47c298d7467..f63d3172e52 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1626,6 +1626,7 @@ void LFGMgr::InitBoot(Group* grp, uint64 kicker, uint64 victim, std::string reas { if (!grp) return; + uint64 gguid = grp->GetGUID(); SetState(gguid, LFG_STATE_BOOT); @@ -1635,7 +1636,6 @@ void LFGMgr::InitBoot(Group* grp, uint64 kicker, uint64 victim, std::string reas pBoot->reason = reason; pBoot->victim = victim; pBoot->votedNeeded = GetVotesNeeded(gguid); - PlayerSet players; // Set votes for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) @@ -1651,15 +1651,11 @@ void LFGMgr::InitBoot(Group* grp, uint64 kicker, uint64 victim, std::string reas else { pBoot->votes[guid] = LFG_ANSWER_PENDING; // Other members need to vote - players.insert(plrg); + plrg->GetSession()->SendLfgBootPlayer(pBoot); } } } - // Notify players - for (PlayerSet::const_iterator it = players.begin(); it != players.end(); ++it) - (*it)->GetSession()->SendLfgBootPlayer(pBoot); - m_Boots[grp->GetLowGUID()] = pBoot; } @@ -1770,6 +1766,9 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false* uint64 gguid = grp->GetGUID(); LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(GetDungeon(gguid)); + if (GetState(gguid) == LFG_STATE_FINISHED_DUNGEON) + error = LFG_TELEPORTERROR_INVALID_LOCATION; + if (!dungeon) error = LFG_TELEPORTERROR_INVALID_LOCATION; else if (player->GetMapId() != uint32(dungeon->map)) // Do not teleport players in dungeon to the entrance @@ -1817,7 +1816,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false* if (error == LFG_TELEPORTERROR_OK) { - if (!player->GetMap()->IsDungeon() && !player->GetMap()->IsRaid()) + if (!player->GetMap()->IsDungeon()) player->SetBattlegroundEntryPoint(); if (player->isInFlight()) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 53defc0c017..5dd3acfa13c 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -23362,7 +23362,7 @@ Player* Player::GetNextRandomRaidMember(float radius) PartyResult Player::CanUninviteFromGroup() const { - const Group* grp = GetGroup(); + Group const* grp = GetGroup(); if (!grp) return ERR_NOT_IN_GROUP; @@ -23385,8 +23385,12 @@ PartyResult Player::CanUninviteFromGroup() const if (grp->isRollLootActive()) return ERR_PARTY_LFG_BOOT_LOOT_ROLLS; + // TODO: Should also be sent when anyone has recently left combat, with an aprox ~5 seconds timer. + for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) + if (itr->getSource() && itr->getSource()->isInCombat()) + return ERR_PARTY_LFG_BOOT_IN_COMBAT; + /* Missing support for these types - return ERR_PARTY_LFG_BOOT_IN_COMBAT; // also have a cooldown (some secs after combat finish return ERR_PARTY_LFG_BOOT_COOLDOWN_S; return ERR_PARTY_LFG_BOOT_NOT_ELIGIBLE_S; */ diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index ca5a5c311c5..d13c2fb0956 100755 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -343,7 +343,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data) // Send next quest if (Quest const* nextQuest = _player->GetNextQuest(guid, quest)) { - if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true) && _player->CanTakeQuest(quest, true)) + if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true) && _player->CanTakeQuest(nextQuest, true)) { _player->AddQuest(nextQuest, object); if (_player->CanCompleteQuest(nextQuest->GetQuestId())) diff --git a/src/server/game/Server/Protocol/PacketLog.cpp b/src/server/game/Server/Protocol/PacketLog.cpp index a8e184c369a..cb6dcdbdb9e 100644 --- a/src/server/game/Server/Protocol/PacketLog.cpp +++ b/src/server/game/Server/Protocol/PacketLog.cpp @@ -51,7 +51,7 @@ void PacketLog::LogPacket(WorldPacket const& packet, Direction direction) ByteBuffer data(4+4+4+1+packet.size()); data << int32(packet.GetOpcode()); data << int32(packet.size()); - data << int32(time(NULL)); + data << uint32(time(NULL)); data << uint8(direction); for (uint32 i = 0; i < packet.size(); i++) From 76a2d132397ba859f99fc08034486ef63833d20d Mon Sep 17 00:00:00 2001 From: Kandera Date: Tue, 12 Jun 2012 12:18:49 -0400 Subject: [PATCH 1006/1149] Core/Pets: more updates for pet calculations. feedback would be nice! (nothing is applied to anything yet so this will not reflect ingame atm) --- src/server/scripts/Spells/spell_pet.cpp | 210 +++++++++++++----------- 1 file changed, 110 insertions(+), 100 deletions(-) diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index 5c1eb2f1ccd..0f16a340863 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -24,6 +24,9 @@ #include "ScriptMgr.h" #include "SpellScript.h" #include "SpellAuraEffects.h" +#include "Unit.h" +#include "Player.h" +#include "Pet.h" enum HunterPetCalculate { @@ -52,6 +55,7 @@ enum WarlockPetCalculate ENTRY_VOIDWALKER = 1860, ENTRY_FELHUNTER = 417, ENTRY_SUCCUBUS = 1863, + ENTRY_IMP = 416, }; enum DKPetCalculate @@ -60,6 +64,9 @@ enum DKPetCalculate SPELL_DEATH_KNIGHT_PET_SCALING_01 = 54566, SPELL_DEATH_KNIGHT_PET_SCALING_02 = 51996, SPELL_DEATH_KNIGHT_PET_SCALING_03 = 61697, + SPELL_NIGHT_OF_THE_DEAD = 55620, + ENTRY_ARMY_OF_THE_DEAD_GHOUL = 24207, + SPELL_DEATH_KNIGHT_GLYPH_OF_GHOUL = 58686, }; enum ShamanPetCalculate @@ -225,95 +232,111 @@ public: { if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) return false; - _tempHealth = 0; + _tempBonus = 0; return true; } void CalculateStaminaAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) - { - if (!pet->isPet()) - return; + if (pet->isPet()) + if (Unit* owner = pet->ToPet()->GetOwner()) + { + float ownerBonus = CalculatePctN(owner->GetStat(STAT_STAMINA), 75); - Unit* owner = pet->ToPet()->GetOwner(); - if (!owner) - return; - - float ownerBonus = 0.0f; - - ownerBonus = CalculatePctN(owner->GetStat(STAT_STAMINA), 75); - - amount += ownerBonus; - } + amount += ownerBonus; + } } void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) - if (_tempHealth) - pet->SetHealth(_tempHealth); + if (_tempBonus) + { + PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->getLevel()); + uint32 healthMod = 0; + uint32 baseHealth = pInfo->health; + switch (pet->GetEntry()) + { + case ENTRY_IMP: + healthMod = uint32(_tempBonus * 8.4f); + break; + case ENTRY_VOIDWALKER: + healthMod = _tempBonus * 11; + break; + case ENTRY_SUCCUBUS: + healthMod = uint32(_tempBonus * 9.1f); + break; + case ENTRY_FELHUNTER: + healthMod = uint32(_tempBonus * 9.5f); + break; + case ENTRY_FELGUARD: + healthMod = _tempBonus * 11; + break; + default: + healthMod = 0; + break; + } + if (healthMod) + pet->ToPet()->SetCreateHealth(baseHealth + healthMod); + } } void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) - _tempHealth = pet->GetHealth(); + if (pet->isPet()) + { + PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->getLevel()); + pet->ToPet()->SetCreateHealth(pInfo->health); + } } void CalculateAttackPowerAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) - { - if (!pet->isPet()) - return; + if (pet->isPet()) - Unit* owner = pet->ToPet()->GetOwner(); - if (!owner) - return; - - int32 fire = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE); - int32 shadow = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW); - int32 maximum = (fire > shadow) ? fire : shadow; - if (maximum < 0) - maximum = 0; - float bonusAP = maximum * 0.57f; - - amount += bonusAP; - - // Glyph of felguard - if (pet->GetEntry() == ENTRY_FELGUARD) + if (Unit* owner = pet->ToPet()->GetOwner()) { - if (AuraEffect* aurEffect = owner->GetAuraEffect(56246, EFFECT_0)) + int32 fire = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE); + int32 shadow = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW); + int32 maximum = (fire > shadow) ? fire : shadow; + if (maximum < 0) + maximum = 0; + float bonusAP = maximum * 0.57f; + + amount += bonusAP; + + // Glyph of felguard + if (pet->GetEntry() == ENTRY_FELGUARD) { - float base_attPower = pet->GetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE) * pet->GetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_PCT); - amount += CalculatePctN(amount+base_attPower, aurEffect->GetAmount()); + if (AuraEffect* aurEffect = owner->GetAuraEffect(56246, EFFECT_0)) + { + float base_attPower = pet->GetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE) * pet->GetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_PCT); + amount += CalculatePctN(amount+base_attPower, aurEffect->GetAmount()); + } } } - } } void CalculateDamageDoneAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) - { - if (!pet->isPet()) - return; + if (pet->isPet()) + if (Unit* owner = pet->ToPet()->GetOwner()) + { + //the damage bonus used for pets is either fire or shadow damage, whatever is higher + int32 fire = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE); + int32 shadow = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW); + int32 maximum = (fire > shadow) ? fire : shadow; + float bonusDamage = 0.0f; - Unit* owner = pet->ToPet()->GetOwner(); - if (!owner) - return; + if (maximum > 0) + bonusDamage = maximum * 0.15f; - //the damage bonus used for pets is either fire or shadow damage, whatever is higher - int32 fire = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE); - int32 shadow = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW); - int32 maximum = (fire > shadow) ? fire : shadow; - if (maximum < 0) - maximum = 0; - float bonusDamage = maximum * 0.15f; - - amount += bonusDamage; - } + amount += bonusDamage; + } } void Register() @@ -326,7 +349,7 @@ public: } private: - uint32 _tempHealth; + uint32 _tempBonus; }; AuraScript* GetAuraScript() const @@ -355,20 +378,15 @@ public: void CalculateIntellectAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) - { - if (!pet->isPet()) - return; + if (pet->isPet()) + if (Unit* owner = pet->ToPet()->GetOwner()) + { + float ownerBonus = 0.0f; - Unit* owner = pet->ToPet()->GetOwner(); - if (!owner) - return; + ownerBonus = CalculatePctN(owner->GetStat(STAT_INTELLECT), 30); - float ownerBonus = 0.0f; - - ownerBonus = CalculatePctN(owner->GetStat(STAT_INTELLECT), 30); - - amount += ownerBonus; - } + amount += ownerBonus; + } } void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) @@ -1470,18 +1488,14 @@ public: { if (Unit* pet = GetUnitOwner()) { - Unit* owner = pet->GetOwner(); - if (!owner) - return; + if (Unit* owner = pet->GetOwner()) - // Army of the dead ghoul - if (pet->GetEntry() == 24207) - amount = -90; - // Night of the dead - else if (owner->HasAura(55623)) - amount = -90; - else if (owner->HasAura(55620)) - amount = -45; + // Army of the dead ghoul + if (pet->GetEntry() == ENTRY_ARMY_OF_THE_DEAD_GHOUL) + amount = -90; + // Night of the dead + else if ( Aura * aur = owner->GetAuraOfRankedSpell(SPELL_NIGHT_OF_THE_DEAD)) + amount = aur->GetSpellInfo()->Effects[EFFECT_2].CalcValue(); } } @@ -1518,29 +1532,25 @@ public: { if (Unit* pet = GetUnitOwner()) { - if (!pet->isGuardian()) - return; - - Unit* owner = pet->GetOwner(); - if (!owner) - return; - - float mod = 0.3f; - - // Ravenous Dead - AuraEffect const* aurEff = NULL; - // Check just if owner has Ravenous Dead since it's effect is not an aura - aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0); - if (aurEff) + if (pet->isGuardian()) { - mod += CalculatePctN(mod, aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue()); // Ravenous Dead edits the original scale + if (Unit* owner = pet->GetOwner()) + { + float mod = 0.3f; + + // Ravenous Dead. Check just if owner has Ravenous Dead since it's effect is not an aura + if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0)) + { + mod += aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue()/100; // Ravenous Dead edits the original scale + } + // Glyph of the Ghoul + if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_DEATH_KNIGHT_GLYPH_OF_GHOUL, 0)) + mod += aurEff->GetAmount()/100; + + float ownerBonus = float(owner->GetStat(STAT_STAMINA)) * mod; + amount += ownerBonus; + } } - // Glyph of the Ghoul - aurEff = owner->GetAuraEffect(58686, 0); - if (aurEff) - mod += CalculatePctN(1.0f, aurEff->GetAmount()); // Glyph of the Ghoul adds a flat value to the scale mod - float ownerBonus = float(owner->GetStat(STAT_STAMINA)) * mod; - amount += ownerBonus; } } From b24c15740f59668160b7a7d98674ad3c9d709a55 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 12 Jun 2012 20:17:55 +0200 Subject: [PATCH 1007/1149] Build fix --- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Groups/Group.cpp | 14 -------------- src/server/game/Groups/Group.h | 8 +++++--- src/server/game/Groups/GroupRefManager.h | 3 ++- src/server/game/Groups/GroupReference.h | 1 + 5 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 5dd3acfa13c..42d342cbcf9 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -23386,7 +23386,7 @@ PartyResult Player::CanUninviteFromGroup() const return ERR_PARTY_LFG_BOOT_LOOT_ROLLS; // TODO: Should also be sent when anyone has recently left combat, with an aprox ~5 seconds timer. - for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) + for (GroupReference const* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) if (itr->getSource() && itr->getSource()->isInCombat()) return ERR_PARTY_LFG_BOOT_IN_COMBAT; diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 9a898dbfc4c..3a6390cd83a 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -2076,20 +2076,6 @@ bool Group::HasFreeSlotSubGroup(uint8 subgroup) const return (m_subGroupsCounts && m_subGroupsCounts[subgroup] < MAXGROUPSIZE); } -Group::MemberSlotList const& Group::GetMemberSlots() const -{ - return m_memberSlots; -} - -GroupReference* Group::GetFirstMember() -{ - return m_memberMgr.getFirst(); -} - -uint32 Group::GetMembersCount() const -{ - return m_memberSlots.size(); -} uint8 Group::GetMemberGroup(uint64 guid) const { diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index 1f932567319..e5f174c4230 100755 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -230,9 +230,11 @@ class Group bool SameSubGroup(Player const* member1, Player const* member2) const; bool HasFreeSlotSubGroup(uint8 subgroup) const; - MemberSlotList const& GetMemberSlots() const; - GroupReference* GetFirstMember(); - uint32 GetMembersCount() const; + MemberSlotList const& GetMemberSlots() const { return m_memberSlots; } + GroupReference* GetFirstMember() { return m_memberMgr.getFirst(); } + GroupReference const* GetFirstMember() const { return m_memberMgr.getFirst(); } + uint32 GetMembersCount() const { return m_memberSlots.size(); } + uint8 GetMemberGroup(uint64 guid) const; void ConvertToLFG(); diff --git a/src/server/game/Groups/GroupRefManager.h b/src/server/game/Groups/GroupRefManager.h index 9bcc05f8724..d9fef8611de 100755 --- a/src/server/game/Groups/GroupRefManager.h +++ b/src/server/game/Groups/GroupRefManager.h @@ -28,7 +28,8 @@ class GroupReference; class GroupRefManager : public RefManager { public: - GroupReference* getFirst() { return ((GroupReference*) RefManager::getFirst()); } + GroupReference* getFirst() { return ((GroupReference*)RefManager::getFirst()); } + GroupReference const* getFirst() const { return ((GroupReference const*)RefManager::getFirst()); } }; #endif diff --git a/src/server/game/Groups/GroupReference.h b/src/server/game/Groups/GroupReference.h index 2048fd9cb0d..7960dd21035 100755 --- a/src/server/game/Groups/GroupReference.h +++ b/src/server/game/Groups/GroupReference.h @@ -35,6 +35,7 @@ class GroupReference : public Reference GroupReference() : Reference(), iSubGroup(0) {} ~GroupReference() { unlink(); } GroupReference* next() { return (GroupReference*)Reference::next(); } + GroupReference const* next() const { return (GroupReference const*)Reference::next(); } uint8 getSubGroup() const { return iSubGroup; } void setSubGroup(uint8 pSubGroup) { iSubGroup = pSubGroup; } }; From 15eb5f07492490e2fd7a87345301f2fbcab252c7 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 12 Jun 2012 22:22:18 +0200 Subject: [PATCH 1008/1149] Core/SmartAI: Allow calling talk action on targeted creature even if scripted object itself is not a creature --- src/server/game/AI/SmartScripts/SmartScript.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index fb17237fdc5..1b414029366 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -160,9 +160,6 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { case SMART_ACTION_TALK: { - if (!me) - break; - ObjectList* targets = GetTargets(e, unit); Creature* talker = me; Player* targetPlayer = NULL; @@ -185,6 +182,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u delete targets; } + if (!talker) + break; + mTalkerEntry = talker->GetEntry(); mLastTextID = e.action.talk.textGroupID; mTextTimer = e.action.talk.duration; From e8f4eb28f5f975f7f11b73a643c1b88500b2f0e4 Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 12 Jun 2012 16:32:50 -0500 Subject: [PATCH 1009/1149] Core/DF: Add Dungeon Deserter debuff when leaving an incomplete DF match, and implemented Dungeon Cooldown for random dungeons --- src/server/game/DungeonFinding/LFGMgr.cpp | 11 ++++++++--- src/server/game/DungeonFinding/LFGScripts.cpp | 7 ++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index f63d3172e52..5bd0780847b 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1417,6 +1417,10 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept) waitTimesMap[(*it)->GetGUID()] = int32(joinTime - itQueue->second->joinTime); } + // Set the dungeon difficulty + LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(pProposal->dungeonId); + ASSERT(dungeon); + // Create a new group (if needed) LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_GROUP_FOUND); Group* grp = pProposal->groupLowGuid ? sGroupMgr->GetGroupByGUID(pProposal->groupLowGuid) : NULL; @@ -1481,11 +1485,12 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept) m_teleport.push_back(pguid); grp->SetLfgRoles(pguid, pProposal->players[pguid]->role); SetState(pguid, LFG_STATE_DUNGEON); + + // Add the cooldown spell if queued for a random dungeon + if (dungeon->type == LFG_TYPE_RANDOM) + player->CastSpell(player, LFG_SPELL_DUNGEON_COOLDOWN, false); } - // Set the dungeon difficulty - LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(pProposal->dungeonId); - ASSERT(dungeon); grp->SetDungeonDifficulty(Difficulty(dungeon->difficulty)); uint64 gguid = grp->GetGUID(); SetDungeon(gguid, dungeon->Entry()); diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp index 6175addfae2..1fa7fe0ca9f 100644 --- a/src/server/game/DungeonFinding/LFGScripts.cpp +++ b/src/server/game/DungeonFinding/LFGScripts.cpp @@ -117,13 +117,14 @@ void LFGGroupScript::OnRemoveMember(Group* group, uint64 guid, RemoveMethod meth return; } + uint32 state = sLFGMgr->GetState(gguid); sLFGMgr->ClearState(guid); sLFGMgr->SetState(guid, LFG_STATE_NONE); if (Player* player = ObjectAccessor::FindPlayer(guid)) { + if (method == GROUP_REMOVEMETHOD_LEAVE && state != LFG_STATE_FINISHED_DUNGEON && player->HasAura(LFG_SPELL_DUNGEON_COOLDOWN)) + player->CastSpell(player, LFG_SPELL_DUNGEON_DESERTER, false); /* - if (method == GROUP_REMOVEMETHOD_LEAVE) - // Add deserter flag else if (group->isLfgKickActive()) // Update internal kick cooldown of kicked */ @@ -134,7 +135,7 @@ void LFGGroupScript::OnRemoveMember(Group* group, uint64 guid, RemoveMethod meth sLFGMgr->TeleportPlayer(player, true); } - if (sLFGMgr->GetState(gguid) != LFG_STATE_FINISHED_DUNGEON)// Need more players to finish the dungeon + if (state != LFG_STATE_FINISHED_DUNGEON)// Need more players to finish the dungeon sLFGMgr->OfferContinue(group); } From 5180bc46011d4780b6a19e161c7255fa023ef07a Mon Sep 17 00:00:00 2001 From: Malcrom Date: Tue, 12 Jun 2012 21:38:49 -0230 Subject: [PATCH 1010/1149] DB/Transport: First Transport to be properly Spawned and scripted. New transport system required. --- .../world/2012_06_12_00_world_transport.sql | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sql/updates/world/2012_06_12_00_world_transport.sql diff --git a/sql/updates/world/2012_06_12_00_world_transport.sql b/sql/updates/world/2012_06_12_00_world_transport.sql new file mode 100644 index 00000000000..3099292f48d --- /dev/null +++ b/sql/updates/world/2012_06_12_00_world_transport.sql @@ -0,0 +1,82 @@ +-- Zeppelin: "Durotar to Thunder Bluff" +SET @GUID := 43468; +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+11; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@GUID,3084,647,1,1,0,0,-4.83257,-4.312334,-17.63218,1.623156,180,0,0,1,0,0), -- Bluffwatcher +(@GUID+1,3084,647,1,1,0,0,-5.206744,-11.34318,-17.61012,4.712389,180,0,0,1,0,0), -- Bluffwatcher +(@GUID+2,24934,647,1,1,0,0,10.32099,-3.573514,-23.49413,3.176499,180,0,0,1,0,0), -- Snack-O-Matic IV +(@GUID+3,24935,647,1,1,0,0,10.2871,-12.02722,-23.49424,3.106686,180,0,0,1,0,0), -- Vend-O-Tron D-Luxe +(@GUID+4,25075,647,1,1,0,0,-3.396398,-7.905448,-23.69672,6.248279,180,0,0,1,0,0), -- Zeppelin Controls +(@GUID+5,34715,647,1,1,0,0,-9.183155,-7.775729,-17.21699,3.281219,180,0,0,1,0,0), -- Sky-Captain "Dusty" Blastnut +(@GUID+6,34717,647,1,1,0,0,-13.67017,-12.40177,-15.98756,4.590216,180,0,0,1,0,2), -- Crewman Pipewrench +(@GUID+7,34718,647,1,1,0,0,13.74505,-5.128461,-24.04518,0.1396263,180,0,0,1,0,0), -- Crewman Deadbolt +(@GUID+8,34719,647,1,1,0,0,7.623085,-5.025319,-17.67015,4.921828,180,0,0,1,0,0), -- Crewman Grit +(@GUID+9,34721,647,1,1,0,0,-0.919197,-6.164221,-23.67286,3.577925,180,0,0,1,0,0), -- Chief Officer Ograh +(@GUID+10,34723,647,1,1,0,0,-17.47968,-5.606984,-14.92807,3.228859,180,0,0,1,0,0), -- Watcher Tolwe +(@GUID+11,34730,647,1,1,0,0,-2.166869,-7.854215,-23.6919,3.385939,180,0,0,1,0,0); -- Navigator Zippik +DELETE FROM `creature_template_addon` WHERE `entry` IN (34718,34719); +INSERT INTO `creature_template_addon` (`entry`,`bytes1`,`bytes2`,`emote`) VALUES +(34718,3,1,0),(34719,0,1,133); +-- Pathing for Crewman Pipewrench Entry: 34717 +SET @NPC := @GUID+6; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,1,69, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-13.66992,-12.40186,-16.09792,4.590216,26000,0,0,100,0), +(@PATH,2,-14.49512,-9.873911,-15.99125,0,0,0,0,100,0), +(@PATH,3,-14.49512,-6.373911,-15.99125,0,0,0,0,100,0), +(@PATH,4,-14.31525,-3.41333,-15.88589,0,24000,0,0,100,0); +-- Zeppelin: SAI +SET @ENTRY := 190549; +UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=1; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY*100,@ENTRY*100+1,@ENTRY*100+2,@ENTRY*100+3) AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,1,0,0,71,0,100,0,21868,0,0,0,80,@ENTRY*100 ,0,0,0,0,0,1,0,0,0,0,0,0,0,'Zeppelin: - Event Dock Orgrimmar - Run Script'), +(@ENTRY,1,1,0,71,0,100,0,21869,0,0,0,80,@ENTRY*100+1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Zeppelin: - Event Leave Orgrimmar - Run Script'), +(@ENTRY,1,2,0,71,0,100,0,21870,0,0,0,80,@ENTRY*100+2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Zeppelin: - Event Dock Thunder Bluff - Run Script'), +(@ENTRY,1,3,0,71,0,100,0,21871,0,0,0,80,@ENTRY*100+3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Zeppelin: - Event Leave Thunder Bluff - Run Script'), +-- Script 0 +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Sky-Captain Blastnut Say 0'), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Chief Officer Ograh Say 1'), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,19,34765,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Zelli Hotnozzle Say 0'), +(@ENTRY*100,9,3,0,0,0,100,0,3000,3000,0,0,5,5,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Sky-Captain Blastnut emote'), +(@ENTRY*100,9,4,0,0,0,100,0,1000,1000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Chief Officer Ograh emote'), +-- Script 1 +(@ENTRY*100+1,9,0,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Sky-Captain Blastnut Say 1'), +(@ENTRY*100+1,9,1,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Chief Officer Ograh Say 0'), +(@ENTRY*100+1,9,2,0,0,0,100,0,4000,4000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Chief Officer Ograh emote'), +-- Script 2 +(@ENTRY*100+2,9,0,0,0,0,100,0,0,0,0,0,1,2,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Sky-Captain Blastnut Say 2'), +(@ENTRY*100+2,9,1,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Chief Officer Ograh Say 1'), +(@ENTRY*100+2,9,2,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,19,34766,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Krendle Bigpockets Say 0'), +(@ENTRY*100+2,9,3,0,0,0,100,0,3000,3000,0,0,5,5,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Sky-Captain Blastnut emote'), +(@ENTRY*100+2,9,4,0,0,0,100,0,1000,1000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Chief Officer Ograh emote'), +-- Script 3 +(@ENTRY*100+3,9,0,0,0,0,100,0,0,0,0,0,1,3,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Sky-Captain Blastnut Say 3'), +(@ENTRY*100+3,9,1,0,0,0,100,0,0,0,0,0,1,2,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Chief Officer Ograh Say 2'), +(@ENTRY*100+3,9,2,0,0,0,100,0,4000,4000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Chief Officer Ograh emote'); +-- Watcher Tolwe SAI +SET @ENTRY := 34723; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,0,60000,120000,60000,120000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Watcher Tolwe - OOC - Say Random'); +-- Text for Watcher Tolwe, Sky-Captain Blastnut, Chief Officer Ograh, Krendle Bigpockets, & Zelli Hotnozzle +DELETE FROM `creature_text` WHERE `entry` IN (34723,34715,34721,34766,34765); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(34723,0,0,'Dat cloud look like da Warchief.',12,1,100,25,0,0,'Watcher Tolwe - Random'), +(34723,0,1,'Dere be a bug.',12,1,100,25,0,0,'Watcher Tolwe - Random'), +(34723,0,2,'Ware da ship! A harpy! ...wait, dat be another bird.',12,1,100,25,0,0,'Watcher Tolwe - Random'), +(34723,0,3,'Dere be a bird!',12,1,100,25,0,0,'Watcher Tolwe - Random'), +(34715,0,0,'And there''s Orgrimmar, huge and menacing like always. Take a quick break, boys, then it''s back to the Bluff!',12,1,100,1,0,0,'Sky-Captain Blastnut - Dock at Orgrimmar'), -- wait 3 sec do emote 5 +(34715,1,0,'Next stop, Thunder Bluff',12,1,100,5,0,0,'Sky-Captain Blastnut - Leave for Thunder Bluff'), +(34715,2,0,'Watch your step! Don''t want you becoming a smudge down there. Welcome to Thunder Bluff!',12,1,100,1,0,0,'Sky-Captain Blastnut - Dock at Thunder Bluff'), -- wait 3 sec do emote 5 +(34715,3,0,'Okay, boys, let''s get this baby over to Orgrimmar!',12,1,100,25,0,0,'Sky-Captain Blastnut - Leave for Orgrimmar'), +(34721,0,0,'Move it, Zippik! We don''t have all day!',12,1,100,5,0,0,'Chief Officer Ograh - Leave for Thunder Bluff'), +(34721,1,0,'Careful. CAREFUL! Did I feel a shudder? You''re going to knock that tower down, oaf!',12,1,100,5,0,0,'Chief Officer Ograh - Dock at Thunder Bluff'), -- wait 4 sec do emote 25 +(34721,2,0,'We''re behind schedule! Turn this tub east! EAST!',12,1,100,5,0,0,'Chief Officer Ograh - Leave for Orgrimmar'), +(34766,0,0,'Step right up! The zeppelin to Orgrimmar has arrived! All aboard to Durotar!',14,0,100,22,0,11804,'Krendle Bigpockets - Dock at Thunder Bluff'), +(34765,0,0,'The zeppelin to Thunder Bluff has arrived! All aboard for a smooth ride across the Barrens!',14,0,100,22,0,11804,'Zelli Hotnozzle - Dock at Orgrimmar'); From 9cdf3fb4c03b856a808e4b202112ccce42652057 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 13 Jun 2012 08:21:29 +0200 Subject: [PATCH 1011/1149] Core/DungeonFinder: - Corrections to c6c23b7f7ef148f88b64346a44a46f51d2cad212: Properly fixed #6748 after misunderstanding the issue. - Display proper error message when teleportating as fatigued --- src/server/game/DungeonFinding/LFGMgr.cpp | 33 ++++++++++++++--------- src/server/game/DungeonFinding/LFGMgr.h | 1 + src/server/game/Entities/Player/Player.h | 1 + 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 5bd0780847b..a5ff89136b8 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1420,7 +1420,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept) // Set the dungeon difficulty LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(pProposal->dungeonId); ASSERT(dungeon); - + // Create a new group (if needed) LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_GROUP_FOUND); Group* grp = pProposal->groupLowGuid ? sGroupMgr->GetGroupByGUID(pProposal->groupLowGuid) : NULL; @@ -1431,6 +1431,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept) Group* group = player->GetGroup(); if (sendUpdate) player->GetSession()->SendLfgUpdateProposal(proposalId, pProposal); + if (group) { player->GetSession()->SendLfgUpdateParty(updateData); @@ -1482,10 +1483,11 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept) break; } } + m_teleport.push_back(pguid); grp->SetLfgRoles(pguid, pProposal->players[pguid]->role); SetState(pguid, LFG_STATE_DUNGEON); - + // Add the cooldown spell if queued for a random dungeon if (dungeon->type == LFG_TYPE_RANDOM) player->CastSpell(player, LFG_SPELL_DUNGEON_COOLDOWN, false); @@ -1749,14 +1751,7 @@ void LFGMgr::UpdateBoot(Player* player, bool accept) void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*/) { sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::TeleportPlayer: [" UI64FMTD "] is being teleported %s", player->GetGUID(), out ? "out" : "in"); - if (out) - { - player->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW); - player->TeleportToBGEntryPoint(); - return; - } - // TODO Add support for LFG_TELEPORTERROR_FATIGUE LfgTeleportError error = LFG_TELEPORTERROR_OK; Group* grp = player->GetGroup(); @@ -1766,13 +1761,25 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false* error = LFG_TELEPORTERROR_PLAYER_DEAD; else if (player->IsFalling() || player->HasUnitState(UNIT_STATE_JUMPING)) error = LFG_TELEPORTERROR_FALLING; + else if (player->IsMirrorTimerActive(FATIGUE_TIMER)) + error = LFG_TELEPORTERROR_FATIGUE; else { - uint64 gguid = grp->GetGUID(); - LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(GetDungeon(gguid)); + LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(GetDungeon(grp->GetGUID())); - if (GetState(gguid) == LFG_STATE_FINISHED_DUNGEON) - error = LFG_TELEPORTERROR_INVALID_LOCATION; + if (out) + { + // Player needs to be inside the LFG dungeon to be able to teleport out + if (dungeon && player->GetMapId() == uint32(dungeon->map)) + { + player->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW); + player->TeleportToBGEntryPoint(); + } + else + player->GetSession()->SendLfgTeleportError(LFG_TELEPORTERROR_DONT_REPORT); // Not sure which error message to send + + return; + } if (!dungeon) error = LFG_TELEPORTERROR_INVALID_LOCATION; diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h index d10902b9553..f21818deb64 100755 --- a/src/server/game/DungeonFinding/LFGMgr.h +++ b/src/server/game/DungeonFinding/LFGMgr.h @@ -68,6 +68,7 @@ enum LfgTeleportError LFG_TELEPORTERROR_OK = 0, // Internal use LFG_TELEPORTERROR_PLAYER_DEAD = 1, LFG_TELEPORTERROR_FALLING = 2, + LFG_TELEPORTERROR_DONT_REPORT = 3, LFG_TELEPORTERROR_FATIGUE = 4, LFG_TELEPORTERROR_INVALID_LOCATION = 6 }; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index ed887994bca..b0cbb5c7927 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1970,6 +1970,7 @@ class Player : public Unit, public GridObject StopMirrorTimer(BREATH_TIMER); StopMirrorTimer(FIRE_TIMER); } + bool IsMirrorTimerActive(MirrorTimerType type) { return m_MirrorTimer[type] == getMaxTimer(type); } void SetMovement(PlayerMovementType pType); From 12ff298b59da1586871fbe890f3e87f9956fa1ea Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 13 Jun 2012 11:52:32 -0230 Subject: [PATCH 1012/1149] DB/creature: Spawning and pathing for Violetta by Wishtodie. --- .../world/2012_06_13_00_world_creature.sql | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sql/updates/world/2012_06_13_00_world_creature.sql diff --git a/sql/updates/world/2012_06_13_00_world_creature.sql b/sql/updates/world/2012_06_13_00_world_creature.sql new file mode 100644 index 00000000000..a2415a043f3 --- /dev/null +++ b/sql/updates/world/2012_06_13_00_world_creature.sql @@ -0,0 +1,71 @@ +-- Pathing for Violetta (32720) +SET @NPC := 32720; +SET @GUID := 12402; +DELETE FROM `creature` WHERE `guid`=@GUID; +DELETE FROM `creature` WHERE `id`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) +VALUES (@GUID,@NPC,571,1,1,0,0,5693.527,680.9248,645.9013,4.681826,300,0,0,1,0,0,0,0,0); +DELETE FROM `creature_template_addon` WHERE `entry`=@NPC; +INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(@NPC,0,0,0,1,0,''); +-- SAI +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@NPC; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@NPC AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC*100+0,@NPC*100+1,@NPC*100+2,@NPC*100+3) AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@NPC,0,0,1,25,0,100,0,0,0,0,0,71,1670,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On reset - Equip default"), +(@NPC,0,1,0,61,0,100,0,0,0,0,0,88,@NPC*100+0,@NPC*100+1,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On reset - Run random script"), +(@NPC,0,2,0,40,1,100,0,8,0,0,0,80,@NPC*100+2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On wp8 - Run script"), +(@NPC,0,3,0,40,2,100,0,8,0,0,0,80,@NPC*100+3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On wp8 - Run script"), +(@NPC,0,4,0,58,0,100,0,0,0,0,0,41,10000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On wp end - Despawn"), +(@NPC*100+0,9,0,0,0,0,100,0,0,0,0,0,53,0,@NPC*10+0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script 1 - Start waypoint 1"), +(@NPC*100+0,9,1,0,0,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script 1 - Set phase 1"), +(@NPC*100+1,9,0,0,0,0,100,0,0,0,0,0,53,0,@NPC*10+1,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script 2 - Start waypoint 2"), +(@NPC*100+1,9,1,0,0,0,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script 2 - Set phase 2"), +(@NPC*100+2,9,0,0,0,0,100,0,0,0,0,0,54,10000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script - Pause WP 10 seconds"), +(@NPC*100+2,9,1,0,0,0,100,0,5000,5000,5000,5000,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script - Emote talk"), +(@NPC*100+2,9,2,0,0,0,100,0,3000,3000,3000,3000,71,0,0,44655,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script - Equip item"), +(@NPC*100+3,9,0,0,0,0,100,0,0,0,0,0,54,10000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script - Pause WP 10 seconds"), +(@NPC*100+3,9,1,0,0,0,100,0,5000,5000,5000,5000,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script - Emote talk"), +(@NPC*100+3,9,2,0,0,0,100,0,3000,3000,3000,3000,71,0,0,40020,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script - Equip item"); +-- Waypoints +DELETE FROM `waypoints` WHERE `entry` IN (@NPC*10+0,@NPC*10+1); +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@NPC*10+0,1,5693.35,675.1416,645.6994,'Violetta wp1'), +(@NPC*10+0,2,5690.851,664.07,646.2488,'Violetta wp1'), +(@NPC*10+0,3,5686.851,656.5425,646.5913,'Violetta wp1'), +(@NPC*10+0,4,5679.384,648.7989,646.6834,'Violetta wp1'), +(@NPC*10+0,5,5675.498,647.6321,647.0242,'Violetta wp1'), +(@NPC*10+0,6,5669.809,645.4785,647.9725,'Violetta wp1'), +(@NPC*10+0,7,5664.492,643.8845,647.98,'Violetta wp1'), +(@NPC*10+0,8,5664.87,642.0466,647.98,'Violetta wp1'), +(@NPC*10+0,9,5669.127,645.5728,647.9717,'Violetta wp1'), +(@NPC*10+0,10,5675.875,647.3784,647.0391,'Violetta wp1'), +(@NPC*10+0,11,5681.011,648.9694,646.6834,'Violetta wp1'), +(@NPC*10+0,12,5683.774,658.9824,646.6004,'Violetta wp1'), +(@NPC*10+0,13,5682.824,671.3663,647.0424,'Violetta wp1'), +(@NPC*10+0,14,5677.113,674.4891,649.4763,'Violetta wp1'), +(@NPC*10+0,15,5667.89,677.9095,652.0448,'Violetta wp1'), +(@NPC*10+0,16,5655.117,684.3335,651.9886,'Violetta wp1'), +(@NPC*10+0,17,5649.896,690.4983,651.9928,'Violetta wp1'), +(@NPC*10+0,18,5646.092,697.507,651.9928,'Violetta wp1'), +(@NPC*10+0,19,5646.725,700.2504,651.9928,'Violetta wp1'), +(@NPC*10+1,1,5693.35,675.1416,645.6994,'Violetta wp2'), +(@NPC*10+1,2,5690.851,664.07,646.2488,'Violetta wp2'), +(@NPC*10+1,3,5686.851,656.5425,646.5913,'Violetta wp2'), +(@NPC*10+1,4,5679.384,648.7989,646.6834,'Violetta wp2'), +(@NPC*10+1,5,5675.498,647.6321,647.0242,'Violetta wp2'), +(@NPC*10+1,6,5669.809,645.4785,647.9725,'Violetta wp2'), +(@NPC*10+1,7,5664.369,644.7076,647.9811,'Violetta wp2'), +(@NPC*10+1,8,5661.005,643.9919,647.9821,'Violetta wp2'), +(@NPC*10+1,9,5669.143,645.5861,647.9418,'Violetta wp2'), +(@NPC*10+1,10,5675.875,647.3784,647.0391,'Violetta wp2'), +(@NPC*10+1,11,5681.011,648.9694,646.6834,'Violetta wp2'), +(@NPC*10+1,12,5683.774,658.9824,646.6004,'Violetta wp2'), +(@NPC*10+1,13,5682.824,671.3663,647.0424,'Violetta wp2'), +(@NPC*10+1,14,5677.113,674.4891,649.4763,'Violetta wp2'), +(@NPC*10+1,15,5667.89,677.9095,652.0448,'Violetta wp2'), +(@NPC*10+1,16,5655.117,684.3335,651.9886,'Violetta wp2'), +(@NPC*10+1,17,5649.896,690.4983,651.9928,'Violetta wp2'), +(@NPC*10+1,18,5646.092,697.507,651.9928,'Violetta wp2'), +(@NPC*10+1,19,5646.725,700.2504,651.9928,'Violetta wp2'); \ No newline at end of file From ca85c03afdc6cff71a5991b1a091e4eb0262e9f7 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 13 Jun 2012 11:55:27 -0230 Subject: [PATCH 1013/1149] Db/creature: Add newline --- sql/updates/world/2012_06_13_00_world_creature.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/updates/world/2012_06_13_00_world_creature.sql b/sql/updates/world/2012_06_13_00_world_creature.sql index a2415a043f3..0d2aa74c9c7 100644 --- a/sql/updates/world/2012_06_13_00_world_creature.sql +++ b/sql/updates/world/2012_06_13_00_world_creature.sql @@ -68,4 +68,4 @@ INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z (@NPC*10+1,16,5655.117,684.3335,651.9886,'Violetta wp2'), (@NPC*10+1,17,5649.896,690.4983,651.9928,'Violetta wp2'), (@NPC*10+1,18,5646.092,697.507,651.9928,'Violetta wp2'), -(@NPC*10+1,19,5646.725,700.2504,651.9928,'Violetta wp2'); \ No newline at end of file +(@NPC*10+1,19,5646.725,700.2504,651.9928,'Violetta wp2'); From 39a46e6ef16ea1f53feea9b0eb18247cf3ec3d6b Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 13 Jun 2012 10:34:29 -0400 Subject: [PATCH 1014/1149] DB/Spawns: correct spawn for Lok'lira the Crone. add the quest invisibility 2 aura to her creature_template_addon. give the player the see quest invisibility 2 aura once Change of Scenery has been accepted. Closes #1292 --- sql/updates/world/2012_06_13_01_world_creature.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 sql/updates/world/2012_06_13_01_world_creature.sql diff --git a/sql/updates/world/2012_06_13_01_world_creature.sql b/sql/updates/world/2012_06_13_01_world_creature.sql new file mode 100644 index 00000000000..5ba3e0d34a2 --- /dev/null +++ b/sql/updates/world/2012_06_13_01_world_creature.sql @@ -0,0 +1,11 @@ +DELETE FROM `creature_template_addon` WHERE `entry` = 29975; +INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES +(29975, 0, 0x10000, 0x1, 54503); -- Lok'lira the Crone - Quest Invisibility 2 + +DELETE FROM `creature` WHERE `id` = 29975 OR `guid` = 2593; +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES +(2593, 29975, 571, 1, 1, 6922.175, -1534.575, 836.1568, 4.276057, 120, 0, 0); -- Lok'lira the Crone (Area: Brunnhildar Village) + +DELETE FROM `spell_area` WHERE `spell` = 54504; +INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`) VALUES +(54504,4422,12921,1,0,0,0,2,1); -- cast see quest invisibility 2 after accepting the quest from lok'lira. From 1aaea81c10bdb985b703f138ffbcb605fbdade42 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 13 Jun 2012 12:04:44 -0230 Subject: [PATCH 1015/1149] DB/Gossip: Misc fixes from Durotar. Closes 6785 , 6770 , 6768 , 6767 , 6766 --- .../world/2012_06_13_01_world_gossip.sql | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sql/updates/world/2012_06_13_01_world_gossip.sql diff --git a/sql/updates/world/2012_06_13_01_world_gossip.sql b/sql/updates/world/2012_06_13_01_world_gossip.sql new file mode 100644 index 00000000000..2cac9fe2a0a --- /dev/null +++ b/sql/updates/world/2012_06_13_01_world_gossip.sql @@ -0,0 +1,32 @@ +-- Missing gossip for Krendle Bigpockets in Thunder Bluff +UPDATE `creature_template` SET `gossip_menu_id`=10566 WHERE `entry`=34766; +DELETE FROM `gossip_menu` WHERE `entry`=10566 AND `text_id`=14622; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (10566,14622); +-- Missing gossip +DELETE FROM `gossip_menu_option` WHERE `menu_id`=7368 AND `id` IN (3,4); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(7368,3,0,'Acteon, where is the best area to hunt for moongraze stags?',1,1,7423,0,0,0,''), +(7368,4,0,'Acteon, where is the best place to hunt moongraze bucks?',1,1,7424,0,0,0,''); +-- conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=7368 AND `SourceEntry` IN (3,4); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,7368,3,0,0,9,9454,0,0,0,0,'','Acteon - Show gossip option if player has quest 9454'), +(15,7368,4,0,0,9,10324,0,0,0,0,'','Acteon - Show gossip option if player has quest 10324'); +-- Gossip Condition for Archmage Celindra +SET @GOSSIP := 9777; +SET @TEXTNO := 13455; +SET @TEXTYES := 13456; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'), +(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage'); +-- Update NPC 4217 Mathrengyl Bearwalker +DELETE FROM `gossip_menu_option` WHERE `menu_id`=1403 AND `id`=3; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(1403,3,1,'I''d like to purchase more Tharlendris seeds.',3,128,0,0,0,0,''); +-- conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=1403 AND `SourceEntry`=3; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,1403,3,0,0,8,3781,0,0,0,0,'','Mathrengyl Bearwalker - Show gossip option if player has rewarded quest 3781'); -- available only for druids + -- Quest 3792 should only be available after quest 3791 +UPDATE `quest_template` SET `PrevQuestId`=3791 WHERE `id`=3792; From b43fa6f7438b4b1100687ebd220df756cd2bb420 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 13 Jun 2012 12:10:33 -0230 Subject: [PATCH 1016/1149] DB/Gossip: Misc fixes from Durotar. Closes 6785 , 6770 , 6768 , 6767 , 6766 --- ...2_06_13_01_world_gossip.sql => 2012_06_13_02_world_gossip.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sql/updates/world/{2012_06_13_01_world_gossip.sql => 2012_06_13_02_world_gossip.sql} (100%) diff --git a/sql/updates/world/2012_06_13_01_world_gossip.sql b/sql/updates/world/2012_06_13_02_world_gossip.sql similarity index 100% rename from sql/updates/world/2012_06_13_01_world_gossip.sql rename to sql/updates/world/2012_06_13_02_world_gossip.sql From 5daa540d3ab5198e7c7ad678517d43c2baa15f50 Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 13 Jun 2012 12:34:59 -0400 Subject: [PATCH 1017/1149] Core/Spells: handle SPELL_AURA_MOD_DEBUFF_RESISTANCE only for auras. fixes sacred cleansing causing the whole spell to be resisted. --- src/server/game/Entities/Unit/Unit.cpp | 6 +++--- src/server/game/Spells/Spell.cpp | 29 +++++++++++++++++++++----- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a99356681e2..3305c4a9325 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2465,12 +2465,12 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spell) // Chance resist debuff if (!spell->IsPositive()) { - bool bNegativeAura = false; + bool bNegativeAura = true; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { - if (spell->Effects[i].ApplyAuraName != 0) + if (spell->Effects[i].ApplyAuraName == 0) { - bNegativeAura = true; + bNegativeAura = false; break; } } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 58a89f75fd3..b51a3e8ee73 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2547,13 +2547,32 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA return SPELL_MISS_EVADE; // For delayed spells immunity may be applied between missile launch and hit - check immunity for that case - // disable effects to which unit is immune - for (uint32 effectNumber = 0; effectNumber < MAX_SPELL_EFFECTS; ++effectNumber) - if (effectMask & (1 << effectNumber) && unit->IsImmunedToSpellEffect(m_spellInfo, effectNumber)) - effectMask &= ~(1 << effectNumber); - if (!effectMask || (m_spellInfo->Speed && (unit->IsImmunedToDamage(m_spellInfo) || unit->IsImmunedToSpell(m_spellInfo)))) + if (m_spellInfo->Speed && (unit->IsImmunedToDamage(m_spellInfo) || unit->IsImmunedToSpell(m_spellInfo))) return SPELL_MISS_IMMUNE; + // disable effects to which unit is immune + SpellMissInfo returnVal = SPELL_MISS_IMMUNE; + for (uint32 effectNumber = 0; effectNumber < MAX_SPELL_EFFECTS; ++effectNumber) + { + if (effectMask & (1 << effectNumber)) + if (unit->IsImmunedToSpellEffect(m_spellInfo, effectNumber)) + effectMask &= ~(1 << effectNumber); + else if (m_spellInfo->Effects[effectNumber].IsAura() && !m_spellInfo->IsPositiveEffect(effectNumber)) + { + int32 debuff_resist_chance = unit->GetMaxPositiveAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(m_spellInfo->Dispel)); + debuff_resist_chance += unit->GetMaxNegativeAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(m_spellInfo->Dispel)); + + if (debuff_resist_chance > 0) + if (irand(0,10000) <= (debuff_resist_chance * 100)) + { + effectMask &= ~(1 << effectNumber); + returnVal = SPELL_MISS_RESIST; + } + } + } + if (!effectMask) + return returnVal; + PrepareScriptHitHandlers(); CallScriptBeforeHitHandlers(); From 50bd43661ca2e70a6f068ae8ba7c63e3ede646c0 Mon Sep 17 00:00:00 2001 From: click Date: Wed, 13 Jun 2012 18:38:21 +0200 Subject: [PATCH 1018/1149] Core: Remove a few silly warnings here and there (and adjust a comment to allow System.cpp to show properly in the nano-editor) --- src/server/game/AI/CoreAI/GameObjectAI.h | 2 +- src/server/scripts/Spells/spell_generic.cpp | 2 +- src/tools/map_extractor/System.cpp | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/server/game/AI/CoreAI/GameObjectAI.h b/src/server/game/AI/CoreAI/GameObjectAI.h index 21466f8c796..fbc8675cc47 100644 --- a/src/server/game/AI/CoreAI/GameObjectAI.h +++ b/src/server/game/AI/CoreAI/GameObjectAI.h @@ -54,7 +54,7 @@ class GameObjectAI virtual void SetData(uint32 /*id*/, uint32 /*value*/) {} virtual void OnGameEvent(bool /*start*/, uint16 /*eventId*/) {} virtual void OnStateChanged(uint32 /*state*/, Unit* /*unit*/) {} - virtual void EventInform(uint32 eventId) {} + virtual void EventInform(uint32 /*eventId*/) {} }; class NullGameObjectAI : public GameObjectAI diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 07e9546173d..5b65d0ca763 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2691,7 +2691,7 @@ public: { PrepareSpellScript(spell_gen_touch_the_nightmare_SpellScript); - void HandleDamageCalc(SpellEffIndex effIndex) + void HandleDamageCalc(SpellEffIndex /*effIndex*/) { uint32 bp = GetCaster()->GetMaxHealth() * 0.3f; SetHitDamage(bp); diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 1505f2c2cee..d64276c6363 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -48,9 +48,9 @@ char output_path[128] = "."; char input_path[128] = "."; uint32 maxAreaId = 0; -//************************************************** +// ************************************************** // Extractor options -//************************************************** +// ************************************************** enum Extract { EXTRACT_MAP = 1, @@ -221,7 +221,7 @@ uint32 ReadMapDBC() map_ids[x].id = dbc.getRecord(x).getUInt(0); strcpy(map_ids[x].name, dbc.getRecord(x).getString(1)); } - printf("Done! (%u maps loaded)\n", map_count); + printf("Done! (%zu maps loaded)\n", map_count); return map_count; } @@ -246,7 +246,7 @@ void ReadAreaTableDBC() maxAreaId = dbc.getMaxId(); - printf("Done! (%u areas loaded)\n", area_count); + printf("Done! (%zu areas loaded)\n", area_count); } void ReadLiquidTypeTableDBC() @@ -267,7 +267,7 @@ void ReadLiquidTypeTableDBC() for(uint32 x = 0; x < liqTypeCount; ++x) LiqType[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3); - printf("Done! (%u LiqTypes loaded)\n", liqTypeCount); + printf("Done! (%zu LiqTypes loaded)\n", liqTypeCount); } // @@ -572,7 +572,7 @@ bool ConvertADT(char *filename, char *filename2, int /*cell_y*/, int /*cell_x*/, // Try store as packed in uint16 or uint8 values if (!(heightHeader.flags & MAP_HEIGHT_NO_HEIGHT)) { - float step; + float step = 0; // Try Store as uint values if (CONF_allow_float_to_int) { From 0ddaeaddc8d433908aa3ba3f3828507bed914fc1 Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 13 Jun 2012 12:39:56 -0400 Subject: [PATCH 1019/1149] Core/Pets: more updates for pets and add spell_pet.cpp to the cmakelist file --- src/server/scripts/Spells/CMakeLists.txt | 1 + src/server/scripts/Spells/spell_pet.cpp | 194 ++++++++++------------- 2 files changed, 81 insertions(+), 114 deletions(-) diff --git a/src/server/scripts/Spells/CMakeLists.txt b/src/server/scripts/Spells/CMakeLists.txt index 04dcee9287c..2bb695bd8a9 100644 --- a/src/server/scripts/Spells/CMakeLists.txt +++ b/src/server/scripts/Spells/CMakeLists.txt @@ -24,6 +24,7 @@ set(scripts_STAT_SRCS Spells/spell_paladin.cpp Spells/spell_item.cpp Spells/spell_holiday.cpp + Spells/spell_pet.cpp ) message(" -> Prepared: Spells") diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index 0f16a340863..6ed0f18c785 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -56,6 +56,7 @@ enum WarlockPetCalculate ENTRY_FELHUNTER = 417, ENTRY_SUCCUBUS = 1863, ENTRY_IMP = 416, + SPELL_WARLOCK_GLYPH_OF_VOIDWALKER = 56247, }; enum DKPetCalculate @@ -261,6 +262,7 @@ public: case ENTRY_IMP: healthMod = uint32(_tempBonus * 8.4f); break; + case ENTRY_FELGUARD: case ENTRY_VOIDWALKER: healthMod = _tempBonus * 11; break; @@ -270,9 +272,6 @@ public: case ENTRY_FELHUNTER: healthMod = uint32(_tempBonus * 9.5f); break; - case ENTRY_FELGUARD: - healthMod = _tempBonus * 11; - break; default: healthMod = 0; break; @@ -371,7 +370,7 @@ public: { if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) return false; - _tempMana = 0; + _tempBonus = 0; return true; } @@ -386,58 +385,70 @@ public: ownerBonus = CalculatePctN(owner->GetStat(STAT_INTELLECT), 30); amount += ownerBonus; + _tempBonus = ownerBonus; } } void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) - if (_tempMana) - pet->SetPower(POWER_MANA, _tempMana); + if (_tempBonus) + { + PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->getLevel()); + uint32 manaMod = 0; + uint32 baseMana = pInfo->mana; + switch (pet->GetEntry()) + { + case ENTRY_IMP: + manaMod = uint32(_tempBonus * 4.9f); + break; + case ENTRY_VOIDWALKER: + case ENTRY_SUCCUBUS: + case ENTRY_FELHUNTER: + case ENTRY_FELGUARD: + manaMod = uint32(_tempBonus * 11.5f); + break; + default: + manaMod = 0; + break; + } + if (manaMod) + pet->ToPet()->SetCreateMana(baseMana + manaMod); + } } void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) - _tempMana = pet->GetPower(POWER_MANA); + if (pet->isPet()) + { + PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->getLevel()); + pet->ToPet()->SetCreateMana(pInfo->mana); + } } void CalculateArmorAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) - { - if (!pet->isPet()) - return; - - Unit* owner = pet->ToPet()->GetOwner(); - if (!owner) - return; - - float ownerBonus = 0.0f; - - ownerBonus = CalculatePctN(owner->GetArmor(), 35); - - amount += ownerBonus; - } + if (pet->isPet()) + if (Unit* owner = pet->ToPet()->GetOwner()) + { + float ownerBonus = 0.0f; + ownerBonus = CalculatePctN(owner->GetArmor(), 35); + amount += ownerBonus; + } } void CalculateFireResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) - { - if (!pet->isPet()) - return; - - Unit* owner = pet->ToPet()->GetOwner(); - if (!owner) - return; - - float ownerBonus = 0.0f; - - ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_FIRE), 40); - - amount += ownerBonus; - } + if (pet->isPet()) + if (Unit* owner = pet->ToPet()->GetOwner()) + { + float ownerBonus = 0.0f; + ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_FIRE), 40); + amount += ownerBonus; + } } void Register() @@ -450,7 +461,7 @@ public: } private: - uint32 _tempMana; + uint32 _tempBonus; }; AuraScript* GetAuraScript() const @@ -478,58 +489,37 @@ public: void CalculateFrostResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) - { - if (!pet->isPet()) - return; - - Unit* owner = pet->ToPet()->GetOwner(); - if (!owner) - return; - - float ownerBonus = 0.0f; - - ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_FROST), 40); - - amount += ownerBonus; - } + if (pet->isPet()) + if (Unit* owner = pet->ToPet()->GetOwner()) + { + float ownerBonus = 0.0f; + ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_FROST), 40); + amount += ownerBonus; + } } void CalculateArcaneResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) - { - if (!pet->isPet()) - return; - - Unit* owner = pet->ToPet()->GetOwner(); - if (!owner) - return; - - float ownerBonus = 0.0f; - - ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_ARCANE), 40); - - amount += ownerBonus; - } + if (pet->isPet()) + if (Unit* owner = pet->ToPet()->GetOwner()) + { + float ownerBonus = 0.0f; + ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_ARCANE), 40); + amount += ownerBonus; + } } void CalculateNatureResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) - { - if (!pet->isPet()) - return; - - Unit* owner = pet->ToPet()->GetOwner(); - if (!owner) - return; - - float ownerBonus = 0.0f; - - ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_NATURE), 40); - - amount += ownerBonus; - } + if (pet->isPet()) + if (Unit* owner = pet->ToPet()->GetOwner()) + { + float ownerBonus = 0.0f; + ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_NATURE), 40); + amount += ownerBonus; + } } void Register() @@ -566,20 +556,13 @@ public: void CalculateShadowResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) - { - if (!pet->isPet()) - return; - - Unit* owner = pet->ToPet()->GetOwner(); - if (!owner) - return; - - float ownerBonus = 0.0f; - - ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_SHADOW), 40); - - amount += ownerBonus; - } + if (pet->isPet()) + if (Unit* owner = pet->ToPet()->GetOwner()) + { + float ownerBonus = 0.0f; + ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_SHADOW), 40); + amount += ownerBonus; + } } void Register() @@ -612,8 +595,6 @@ public: void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { - if (!GetCaster() || !GetCaster()->GetOwner()) - return; if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { // For others recalculate it from: @@ -629,8 +610,6 @@ public: void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { - if (!GetCaster() || !GetCaster()->GetOwner()) - return; if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { // For others recalculate it from: @@ -646,8 +625,6 @@ public: void CalculateAmountExpertise(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { - if (!GetCaster() || !GetCaster()->GetOwner()) - return; if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { // For others recalculate it from: @@ -693,8 +670,6 @@ public: void CalculateAmountCritSpell(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { - if (!GetCaster() || !GetCaster()->GetOwner()) - return; if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { // For others recalculate it from: @@ -717,8 +692,6 @@ public: void CalculateAmountCritMelee(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { - if (!GetCaster() || !GetCaster()->GetOwner()) - return; if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { // For others recalculate it from: @@ -751,7 +724,7 @@ public: return new spell_warl_pet_passive_AuraScript(); } }; - +// this doesnt actually fit in here class spell_warl_pet_passive_damage_done : public SpellScriptLoader { public: @@ -822,17 +795,10 @@ public: void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) - { - if (!pet->isPet()) - return; - - Unit* owner = pet->ToPet()->GetOwner(); - if (!owner) - return; - - if (AuraEffect* aurEffect = owner->GetAuraEffect(56247, EFFECT_0)) - amount += aurEffect->GetAmount(); - } + if (pet->isPet()) + if (Unit* owner = pet->ToPet()->GetOwner()) + if (AuraEffect* aurEffect = owner->GetAuraEffect(SPELL_WARLOCK_GLYPH_OF_VOIDWALKER, EFFECT_0)) + amount += aurEffect->GetAmount(); } void Register() From 2f468319af223332661721e1c1eaf1fc34203973 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 13 Jun 2012 17:04:10 -0230 Subject: [PATCH 1020/1149] Db/Gossip: Fix error in sql --- sql/updates/world/2012_06_07_00_world_gossip.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/updates/world/2012_06_07_00_world_gossip.sql b/sql/updates/world/2012_06_07_00_world_gossip.sql index 1fe4a23bc5a..aac3ac53e74 100644 --- a/sql/updates/world/2012_06_07_00_world_gossip.sql +++ b/sql/updates/world/2012_06_07_00_world_gossip.sql @@ -9,7 +9,7 @@ INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_ (@NPC,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Charles Worth - On Gossip Select - Close Gossip'); -- Add missing Gossip for Charles Worth DELETE FROM `gossip_menu` WHERE `entry` IN (10136,10138); -DELETE FROM `gossip_menu` WHERE `entry`=14076 AND `text_id`=14076; +DELETE FROM `gossip_menu` WHERE `entry`=10118 AND `text_id`=14076; INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (10136,14072),(10138,14074),(10118,14076); -- Add Gossip Options DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP AND `id` IN (2,3,4,5); From 62c64920f17dc08834098c383a8a8ba7044e4c8d Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 9 Jun 2012 00:14:55 +0200 Subject: [PATCH 1021/1149] Core/Spells: Fix Empowered Renew calculation --- .../2012_06_09_00_world_spell_bonus_data.sql | 3 ++ ...2012_06_09_00_world_spell_script_names.sql | 3 ++ src/server/game/Spells/Auras/SpellAuras.cpp | 13 ------ src/server/scripts/Spells/spell_priest.cpp | 45 +++++++++++++++++++ 4 files changed, 51 insertions(+), 13 deletions(-) create mode 100644 sql/updates/world/2012_06_09_00_world_spell_bonus_data.sql create mode 100644 sql/updates/world/2012_06_09_00_world_spell_script_names.sql diff --git a/sql/updates/world/2012_06_09_00_world_spell_bonus_data.sql b/sql/updates/world/2012_06_09_00_world_spell_bonus_data.sql new file mode 100644 index 00000000000..aa9c1b732c4 --- /dev/null +++ b/sql/updates/world/2012_06_09_00_world_spell_bonus_data.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_bonus_data` WHERE `entry`=63544; +INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES +(63544,0,0,0,0,'Priest - Empowered Renew'); diff --git a/sql/updates/world/2012_06_09_00_world_spell_script_names.sql b/sql/updates/world/2012_06_09_00_world_spell_script_names.sql new file mode 100644 index 00000000000..a9faa529143 --- /dev/null +++ b/sql/updates/world/2012_06_09_00_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=-139; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(-139,'spell_priest_renew'); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 4dda1c731a7..9456a219274 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1221,19 +1221,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b caster->CastCustomSpell(caster, 75999, &heal, NULL, NULL, true, NULL, GetEffect(0)); } } - // Renew - else if (GetSpellInfo()->SpellFamilyFlags[0] & 0x00000040 && GetEffect(0)) - { - // Empowered Renew - if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 3021, 1)) - { - uint32 damage = caster->SpellHealingBonusDone(target, GetSpellInfo(), GetEffect(0)->GetAmount(), HEAL); - damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, HEAL); - - int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * int32(damage) / 100; - caster->CastCustomSpell(target, 63544, &basepoints0, NULL, NULL, true, NULL, GetEffect(0)); - } - } // Power Word: Shield else if (m_spellInfo->SpellFamilyFlags[0] & 0x1 && m_spellInfo->SpellFamilyFlags[2] & 0x400 && GetEffect(0)) { diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 8088004c9d1..cb9f2ad1753 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -34,6 +34,8 @@ enum PriestSpells PRIEST_SPELL_PENANCE_R1_HEAL = 47757, PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED = 33619, PRIEST_SPELL_REFLECTIVE_SHIELD_R1 = 33201, + PRIEST_SPELL_EMPOWERED_RENEW = 63544, + PRIEST_ICON_ID_EMPOWERED_RENEW_TALENT = 3021, }; // Guardian Spirit @@ -330,6 +332,48 @@ public: } }; +class spell_priest_renew : public SpellScriptLoader +{ + public: + spell_priest_renew() : SpellScriptLoader("spell_priest_renew") { } + + class spell_priest_renew_AuraScript : public AuraScript + { + PrepareAuraScript(spell_priest_renew_AuraScript); + + bool Load() + { + return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + void HandleApplyEffect(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + { + // Empowered Renew + if (AuraEffect const* empoweredRenewAurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, PRIEST_ICON_ID_EMPOWERED_RENEW_TALENT, EFFECT_1)) + { + uint32 heal = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), GetEffect(EFFECT_0)->GetAmount(), DOT); + heal = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, DOT); + + int32 basepoints0 = empoweredRenewAurEff->GetAmount() * GetEffect(EFFECT_0)->GetTotalTicks() * int32(heal) / 100; + caster->CastCustomSpell(GetTarget(), PRIEST_SPELL_EMPOWERED_RENEW, &basepoints0, NULL, NULL, true, NULL, aurEff); + } + } + } + + void Register() + { + OnEffectApply += AuraEffectApplyFn(spell_priest_renew_AuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_priest_renew_AuraScript(); + } +}; + void AddSC_priest_spell_scripts() { new spell_pri_guardian_spirit(); @@ -339,4 +383,5 @@ void AddSC_priest_spell_scripts() new spell_pri_reflective_shield_trigger(); new spell_pri_mind_sear(); new spell_pri_prayer_of_mending_heal(); + new spell_priest_renew(); } From ace68d5f4f87284c40171ac287ca21c1bb5de15f Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 13 Jun 2012 19:35:33 -0230 Subject: [PATCH 1022/1149] DB/SAI: Scripting for Grand Anchorite Almonen --- sql/updates/world/2012_06_13_03_world_sai.sql | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sql/updates/world/2012_06_13_03_world_sai.sql diff --git a/sql/updates/world/2012_06_13_03_world_sai.sql b/sql/updates/world/2012_06_13_03_world_sai.sql new file mode 100644 index 00000000000..ad9642447c0 --- /dev/null +++ b/sql/updates/world/2012_06_13_03_world_sai.sql @@ -0,0 +1,70 @@ +-- Grand Anchorite Almonen SAI +SET @ENTRY := 19216; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY*100) AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,0,10000,10000,300000,300000,80,@ENTRY*100 ,0,0,0,0,0,1,0,0,0,0,0,0,0,'Sky-Captain Cloudkicker - OOC - Run Script'), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.654867,'Grand Anchorite Almonen - Script - Turn to'), +(@ENTRY*100,9,1,0,0,0,100,0,9000,9000,0,0,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - emote'), +(@ENTRY*100,9,2,0,0,0,100,0,23000,23000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1854.72,5423.082,-10.45947,0,'Grand Anchorite Almonen - Script - move to'), +(@ENTRY*100,9,3,0,0,0,100,0,800,800,0,0,69,0,0,0,0,0,0,8,0,0,0,-1854.598,5411.999,-12.42815,0,'Grand Anchorite Almonen - Script - move to'), +(@ENTRY*100,9,4,0,0,0,100,0,5000,5000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.183628,'Grand Anchorite Almonen - Script - Turn to'), +(@ENTRY*100,9,5,0,0,0,100,0,100,100,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 0'), +(@ENTRY*100,9,6,0,0,0,100,0,9000,9000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 1'), +(@ENTRY*100,9,7,0,0,0,100,0,9000,9000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 2'), +(@ENTRY*100,9,8,0,0,0,100,0,25000,25000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 3'), +(@ENTRY*100,9,9,0,0,0,100,0,10000,10000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1851.699,5413.06,-12.42816,0,'Grand Anchorite Almonen - Script - move to'), +(@ENTRY*100,9,10,0,0,0,100,0,100,100,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 4'), +(@ENTRY*100,9,11,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1848.775,5412.81,-12.42815,0,'Grand Anchorite Almonen - Script - move to'), +(@ENTRY*100,9,12,0,0,0,100,0,2000,2000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,4.276057,'Grand Anchorite Almonen - Script - Turn to'), +(@ENTRY*100,9,13,0,0,0,100,0,4000,4000,0,0,1,5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 5'), +(@ENTRY*100,9,14,0,0,0,100,0,7000,7000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1851.574,5412.084,-12.42816,0,'Grand Anchorite Almonen - Script - move to'), +(@ENTRY*100,9,15,0,0,0,100,0,1900,1900,0,0,69,0,0,0,0,0,0,8,0,0,0,-1856.307,5410.266,-12.42815,0,'Grand Anchorite Almonen - Script - move to'), +(@ENTRY*100,9,16,0,0,0,100,0,1900,1900,0,0,69,0,0,0,0,0,0,8,0,0,0,-1859.002,5406.959,-12.42814,0,'Grand Anchorite Almonen - Script - move to'), +(@ENTRY*100,9,17,0,0,0,100,0,3000,3000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.707227,'Grand Anchorite Almonen - Script - Turn to'), +(@ENTRY*100,9,18,0,0,0,100,0,100,100,0,0,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 6'), +(@ENTRY*100,9,19,0,0,0,100,0,10000,10000,0,0,1,7,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 7'), +(@ENTRY*100,9,20,0,0,0,100,0,9000,9000,0,0,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 8'), +(@ENTRY*100,9,21,0,0,0,100,0,5000,5000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1855.089,5410.676,-12.42815,0,'Grand Anchorite Almonen - Script - move to'), +(@ENTRY*100,9,22,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1853.62,5409.833,-12.42815,0,'Grand Anchorite Almonen - Script - move to'), +(@ENTRY*100,9,23,0,0,0,100,0,3000,3000,0,0,1,9,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 9'), +(@ENTRY*100,9,24,0,0,0,100,0,11000,11000,0,0,1,10,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 10'), +(@ENTRY*100,9,25,0,0,0,100,0,9000,9000,0,0,1,11,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 11'), +(@ENTRY*100,9,26,0,0,0,100,0,100,100,0,0,69,0,0,0,0,0,0,8,0,0,0,-1852.503,5412.286,-12.42816,0,'Grand Anchorite Almonen - Script - move to'), +(@ENTRY*100,9,27,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1849.053,5415.075,-12.42815,0,'Grand Anchorite Almonen - Script - move to'), +(@ENTRY*100,9,28,0,0,0,100,0,2000,2000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.340707,'Grand Anchorite Almonen - Script - Turn to'), +(@ENTRY*100,9,29,0,0,0,100,0,5000,5000,0,0,1,12,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 12'), +(@ENTRY*100,9,30,0,0,0,100,0,11000,11000,0,0,1,13,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 13'), +(@ENTRY*100,9,31,0,0,0,100,0,4000,4000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1851.643,5414.012,-12.42816,0,'Grand Anchorite Almonen - Script - move to'), +(@ENTRY*100,9,32,0,0,0,100,0,1200,1200,0,0,69,0,0,0,0,0,0,8,0,0,0,-1854.913,5412.682,-12.42815,0,'Grand Anchorite Almonen - Script - move to'), +(@ENTRY*100,9,33,0,0,0,100,0,800,800,0,0,69,0,0,0,0,0,0,8,0,0,0,-1854.408,5411.227,-12.42815,0,'Grand Anchorite Almonen - Script - move to'), +(@ENTRY*100,9,34,0,0,0,100,0,1000,1000,0,0,1,14,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 14'), +(@ENTRY*100,9,35,0,0,0,100,0,10000,10000,0,0,1,15,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 15'), +(@ENTRY*100,9,36,0,0,0,100,0,7000,7000,0,0,1,16,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 16'), +(@ENTRY*100,9,37,0,0,0,100,0,10000,10000,0,0,1,17,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 17'), +(@ENTRY*100,9,38,0,0,0,100,0,11000,11000,0,0,1,18,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 18'), +(@ENTRY*100,9,39,0,0,0,100,0,10000,10000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1853.137,5424.863,-10.47787,0,'Grand Anchorite Almonen - Script - move to'), +(@ENTRY*100,9,40,0,0,0,100,0,6500,6500,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,2.6529,'Grand Anchorite Almonen - Script - Turn to'); +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry`=19216; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(19216,0,0, 'Friends, it is my great pleasure to welcome you to the temple today.',12,0,100,1,0,0, 'Grand Anchorite Almonen'), +(19216,1,0, 'A''dal has been most generous in his revelations to me, a humble servant of the Light.',12,0,100,0,0,0, 'Grand Anchorite Almonen'), +(19216,2,0, 'In accordance with my divine calling, I must share these revealed truths to all who would hear.',12,0,100,0,0,0, 'Grand Anchorite Almonen'), +(19216,3,0, 'It has been made known to me that inside each of us, the Light resides...',12,0,100,0,0,0, 'Grand Anchorite Almonen'), +(19216,4,0, '...that it is a gift, given freely to all naturally born beings.',12,0,100,0,0,0, 'Grand Anchorite Almonen'), +(19216,5,0, 'It manifests itself as a feeling, small at first and easily ignored, that confirms truths and subtly prods one to do good.',12,0,100,0,0,0, 'Grand Anchorite Almonen'), +(19216,6,0, 'Simple kindnesses, charitable deeds, service to those in need. These are all fruits of the Light.',12,0,100,0,0,0, 'Grand Anchorite Almonen'), +(19216,7,0, 'It rewards those who heed its promptings with blessings, both seen and unseen.',12,0,100,1,0,0, 'Grand Anchorite Almonen'), +(19216,8,0, 'Personal reservoirs of hope and faith are strengthened, and one''s capacity for greater light increases.',12,0,100,0,0,0, 'Grand Anchorite Almonen'), +(19216,9,0, 'Over the course of time, through obedience to the Light''s guidance, one becomes more sensitive to its voice, and its power.',12,0,100,273,0,0, 'Grand Anchorite Almonen'), +(19216,10,0, 'Great is the healing and blessing power of the Light''s most diligent followers.',12,0,100,0,0,0, 'Grand Anchorite Almonen'), +(19216,11,0, 'Sadly, there are those who wander through mortality in defiance of the Light.',12,0,100,1,0,0, 'Grand Anchorite Almonen'), +(19216,12,0, 'From these the Light withdraws, until only darkness remains.',12,0,100,0,0,0, 'Grand Anchorite Almonen'), +(19216,13,0, 'Where there is no light, despair, loathing and rage thrive.',12,0,100,5,0,0, 'Grand Anchorite Almonen'), +(19216,14,0, 'We are born into a perilous age, where the forces of darkness are determined to bring about our destruction.',12,0,100,1,0,0, 'Grand Anchorite Almonen'), +(19216,15,0, 'These are the times to find yourselves in unison with the Light.',12,0,100,5,0,0, 'Grand Anchorite Almonen'), +(19216,16,0, 'Hear my words, and let the Light inside of you confirm the truth of them.',12,0,100,0,0,0, 'Grand Anchorite Almonen'), +(19216,17,0, 'Embrace the light that is in you, my friends! Deny yourself all darkness...',12,0,100,5,0,0, 'Grand Anchorite Almonen'), +(19216,18,0, 'We must endure these trying times faithfully, and one day we will find ourselves victorious.',12,0,100,5,0,0, 'Grand Anchorite Almonen'); From 63dd6251540eb3e392d8789f92035b021fb773e2 Mon Sep 17 00:00:00 2001 From: "dr.skull" Date: Thu, 14 Jun 2012 00:39:09 +0200 Subject: [PATCH 1023/1149] Fix wrong magnet aura takeCharges when spell hit not magnet unit This will fix issue 3151 second problem Signed-off-by: dr.skull --- src/server/game/Entities/Unit/Unit.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3305c4a9325..daa8c1e05de 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -14525,6 +14525,11 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u if (procSpell && (triggeredByAura->GetMiscValue() & procSpell->SchoolMask)) // School check takeCharges = true; break; + case SPELL_AURA_SPELL_MAGNET: + // Skip Melee hits and targets with magnet aura + if (procSpell && (triggeredByAura->GetBase()->GetUnitOwner()->ToUnit() == ToUnit())) // Magnet + takeCharges = true; + break; case SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT: case SPELL_AURA_MOD_POWER_COST_SCHOOL: // Skip melee hits and spells ws wrong school or zero cost From 6c8fca7e25c9160d68075a9c5910d30509acdc45 Mon Sep 17 00:00:00 2001 From: QAston Date: Thu, 14 Jun 2012 13:13:04 +0200 Subject: [PATCH 1024/1149] DB/Spells: Fix spell Surge of Adrenaline --- sql/updates/world/2012_06_14_00_world_spell_linked_spell.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/2012_06_14_00_world_spell_linked_spell.sql diff --git a/sql/updates/world/2012_06_14_00_world_spell_linked_spell.sql b/sql/updates/world/2012_06_14_00_world_spell_linked_spell.sql new file mode 100644 index 00000000000..85cae64c21d --- /dev/null +++ b/sql/updates/world/2012_06_14_00_world_spell_linked_spell.sql @@ -0,0 +1,5 @@ +-- Fix Surge of Adrenaline +DELETE FROM `spell_linked_spell` WHERE `spell_effect`=68667; +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES +(-66683,68667,0, 'Icehowl - Surge of Adrenaline'), +(-67660,68667,0, 'Icehowl - Surge of Adrenaline'); From 0e8889415d0c28b23666ee3329deed2b94ce3b3e Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Thu, 14 Jun 2012 17:33:46 +0200 Subject: [PATCH 1025/1149] Core/Chat: Convert instance commands in commandscript --- src/server/game/Chat/Chat.cpp | 10 - src/server/game/Chat/Chat.h | 5 - src/server/game/Chat/Commands/Level3.cpp | 126 ------------- src/server/game/Scripting/ScriptLoader.cpp | 2 + src/server/scripts/Commands/CMakeLists.txt | 2 +- src/server/scripts/Commands/cs_instance.cpp | 193 ++++++++++++++++++++ 6 files changed, 196 insertions(+), 142 deletions(-) create mode 100644 src/server/scripts/Commands/cs_instance.cpp diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index cc64a8e22dd..72011a339f8 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -156,15 +156,6 @@ ChatCommand* ChatHandler::getCommandTable() { NULL, 0, false, NULL, "", NULL } }; - static ChatCommand instanceCommandTable[] = - { - { "listbinds", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleInstanceListBindsCommand>, "", NULL }, - { "unbind", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleInstanceUnbindCommand>, "", NULL }, - { "stats", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleInstanceStatsCommand>, "", NULL }, - { "savedata", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleInstanceSaveDataCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - static ChatCommand listCommandTable[] = { { "creature", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleListCreatureCommand>, "", NULL }, @@ -339,7 +330,6 @@ ChatCommand* ChatHandler::getCommandTable() { "group", SEC_ADMINISTRATOR, false, NULL, "", groupCommandTable }, { "cast", SEC_ADMINISTRATOR, false, NULL, "", castCommandTable }, { "reset", SEC_ADMINISTRATOR, true, NULL, "", resetCommandTable }, - { "instance", SEC_ADMINISTRATOR, true, NULL, "", instanceCommandTable }, { "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable }, { "channel", SEC_ADMINISTRATOR, true, NULL, "", channelCommandTable }, diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index e88914a2daf..0a5cd9391f6 100755 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -180,11 +180,6 @@ class ChatHandler bool HandleGuildRankCommand(const char* args); bool HandleGuildDeleteCommand(const char* args); - bool HandleInstanceListBindsCommand(const char* args); - bool HandleInstanceUnbindCommand(const char* args); - bool HandleInstanceStatsCommand(const char* args); - bool HandleInstanceSaveDataCommand(const char * args); - bool HandleListAurasCommand(const char * args); bool HandleListCreatureCommand(const char* args); bool HandleListItemCommand(const char* args); diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 4b2f1c5e7bb..4decc7a523f 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -4096,132 +4096,6 @@ bool ChatHandler::HandleCastSelfCommand(const char *args) return true; } -std::string GetTimeString(uint64 time) -{ - uint64 days = time / DAY, hours = (time % DAY) / HOUR, minute = (time % HOUR) / MINUTE; - std::ostringstream ss; - if (days) ss << days << "d "; - if (hours) ss << hours << "h "; - ss << minute << 'm'; - return ss.str(); -} - -bool ChatHandler::HandleInstanceListBindsCommand(const char* /*args*/) -{ - Player* player = getSelectedPlayer(); - if (!player) player = m_session->GetPlayer(); - uint32 counter = 0; - for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) - { - Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i)); - for (Player::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr) - { - InstanceSave* save = itr->second.save; - std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); - PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); - counter++; - } - } - PSendSysMessage("player binds: %d", counter); - counter = 0; - Group* group = player->GetGroup(); - if (group) - { - for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) - { - Group::BoundInstancesMap &binds = group->GetBoundInstances(Difficulty(i)); - for (Group::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr) - { - InstanceSave* save = itr->second.save; - std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); - PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); - counter++; - } - } - } - PSendSysMessage("group binds: %d", counter); - - return true; -} - -bool ChatHandler::HandleInstanceUnbindCommand(const char *args) -{ - if (!*args) - return false; - - Player* player = getSelectedPlayer(); - if (!player) - player = m_session->GetPlayer(); - - char* map = strtok((char*)args, " "); - char* pDiff = strtok(NULL, " "); - int8 diff = -1; - if (pDiff) - diff = atoi(pDiff); - uint16 counter = 0; - uint16 MapId = 0; - - if (strcmp(map, "all")) - { - MapId = uint16(atoi(map)); - if (!MapId) - return false; - } - - for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) - { - Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i)); - for (Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();) - { - InstanceSave* save = itr->second.save; - if (itr->first != player->GetMapId() && (!MapId || MapId == itr->first) && (diff == -1 || diff == save->GetDifficulty())) - { - std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); - PSendSysMessage("unbinding map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); - player->UnbindInstance(itr, Difficulty(i)); - counter++; - } - else - ++itr; - } - } - PSendSysMessage("instances unbound: %d", counter); - return true; -} - -bool ChatHandler::HandleInstanceStatsCommand(const char* /*args*/) -{ - PSendSysMessage("instances loaded: %d", sMapMgr->GetNumInstances()); - PSendSysMessage("players in instances: %d", sMapMgr->GetNumPlayersInInstances()); - PSendSysMessage("instance saves: %d", sInstanceSaveMgr->GetNumInstanceSaves()); - PSendSysMessage("players bound: %d", sInstanceSaveMgr->GetNumBoundPlayersTotal()); - PSendSysMessage("groups bound: %d", sInstanceSaveMgr->GetNumBoundGroupsTotal()); - return true; -} - -bool ChatHandler::HandleInstanceSaveDataCommand(const char * /*args*/) -{ - Player* player = m_session->GetPlayer(); - - Map* map = player->GetMap(); - if (!map->IsDungeon()) - { - PSendSysMessage("Map is not a dungeon."); - SetSentErrorMessage(true); - return false; - } - - if (!((InstanceMap*)map)->GetInstanceScript()) - { - PSendSysMessage("Map has no instance data."); - SetSentErrorMessage(true); - return false; - } - - ((InstanceMap*)map)->GetInstanceScript()->SaveToDB(); - return true; -} - /// Define the 'Message of the day' for the realm bool ChatHandler::HandleServerSetMotdCommand(const char *args) { diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index f64d0953e86..a1a23ca7074 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -52,6 +52,7 @@ void AddSC_gm_commandscript(); void AddSC_go_commandscript(); void AddSC_gobject_commandscript(); void AddSC_honor_commandscript(); +void AddSC_instance_commandscript(); void AddSC_learn_commandscript(); void AddSC_misc_commandscript(); void AddSC_modify_commandscript(); @@ -654,6 +655,7 @@ void AddCommandScripts() AddSC_go_commandscript(); AddSC_gobject_commandscript(); AddSC_honor_commandscript(); + AddSC_instance_commandscript(); AddSC_learn_commandscript(); AddSC_misc_commandscript(); AddSC_modify_commandscript(); diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index 86fe984e197..867d54a3cc6 100644 --- a/src/server/scripts/Commands/CMakeLists.txt +++ b/src/server/scripts/Commands/CMakeLists.txt @@ -18,6 +18,7 @@ set(scripts_STAT_SRCS Commands/cs_go.cpp Commands/cs_gobject.cpp Commands/cs_honor.cpp + Commands/cs_instance.cpp Commands/cs_learn.cpp Commands/cs_misc.cpp Commands/cs_modify.cpp @@ -34,7 +35,6 @@ set(scripts_STAT_SRCS # Commands/cs_guild.cpp # Commands/cs_cast.cpp # Commands/cs_reset.cpp -# Commands/cs_instance.cpp # Commands/cs_server.cpp # Commands/cs_channel.cpp # Commands/cs_pet.cpp diff --git a/src/server/scripts/Commands/cs_instance.cpp b/src/server/scripts/Commands/cs_instance.cpp new file mode 100644 index 00000000000..127a3848ebc --- /dev/null +++ b/src/server/scripts/Commands/cs_instance.cpp @@ -0,0 +1,193 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +Name: instance_commandscript +%Complete: 100 +Comment: All instance related commands +Category: commandscripts +EndScriptData */ + +#include "ScriptMgr.h" +#include "Chat.h" +#include "Group.h" +#include "InstanceSaveMgr.h" +#include "InstanceScript.h" +#include "MapManager.h" + +class instance_commandscript : public CommandScript +{ +public: + instance_commandscript() : CommandScript("instance_commandscript") { } + + ChatCommand* GetCommands() const + { + static ChatCommand instanceCommandTable[] = + { + { "listbinds", SEC_ADMINISTRATOR, false, &HandleInstanceListBindsCommand, "", NULL }, + { "unbind", SEC_ADMINISTRATOR, false, &HandleInstanceUnbindCommand, "", NULL }, + { "stats", SEC_ADMINISTRATOR, true, &HandleInstanceStatsCommand, "", NULL }, + { "savedata", SEC_ADMINISTRATOR, false, &HandleInstanceSaveDataCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand commandTable[] = + { + { "instance", SEC_ADMINISTRATOR, true, NULL, "", instanceCommandTable }, + { NULL, 0, false, NULL, "", NULL } + }; + + return commandTable; + } + + static std::string GetTimeString(uint64 time) + { + uint64 days = time / DAY, hours = (time % DAY) / HOUR, minute = (time % HOUR) / MINUTE; + std::ostringstream ss; + if (days) + ss << days << "d "; + if (hours) + ss << hours << "h "; + ss << minute << 'm'; + return ss.str(); + } + + static bool HandleInstanceListBindsCommand(ChatHandler* handler, char const* args) + { + Player* player = handler->getSelectedPlayer(); + if (!player) + player = handler->GetSession()->GetPlayer(); + + uint32 counter = 0; + for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) + { + Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i)); + for (Player::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr) + { + InstanceSave* save = itr->second.save; + std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); + handler->PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); + counter++; + } + } + handler->PSendSysMessage("player binds: %d", counter); + + counter = 0; + if (Group* group = player->GetGroup()) + { + for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) + { + Group::BoundInstancesMap &binds = group->GetBoundInstances(Difficulty(i)); + for (Group::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr) + { + InstanceSave* save = itr->second.save; + std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); + handler->PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); + counter++; + } + } + } + handler->PSendSysMessage("group binds: %d", counter); + + return true; + } + + static bool HandleInstanceUnbindCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + Player* player = handler->getSelectedPlayer(); + if (!player) + player = handler->GetSession()->GetPlayer(); + + char* map = strtok((char*)args, " "); + char* pDiff = strtok(NULL, " "); + int8 diff = -1; + if (pDiff) + diff = atoi(pDiff); + uint16 counter = 0; + uint16 MapId = 0; + + if (strcmp(map, "all")) + { + MapId = uint16(atoi(map)); + if (!MapId) + return false; + } + + for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) + { + Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i)); + for (Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();) + { + InstanceSave* save = itr->second.save; + if (itr->first != player->GetMapId() && (!MapId || MapId == itr->first) && (diff == -1 || diff == save->GetDifficulty())) + { + std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); + handler->PSendSysMessage("unbinding map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); + player->UnbindInstance(itr, Difficulty(i)); + counter++; + } + else + ++itr; + } + } + handler->PSendSysMessage("instances unbound: %d", counter); + + return true; + } + + static bool HandleInstanceStatsCommand(ChatHandler* handler, char const* /*args*/) + { + handler->PSendSysMessage("instances loaded: %d", sMapMgr->GetNumInstances()); + handler->PSendSysMessage("players in instances: %d", sMapMgr->GetNumPlayersInInstances()); + handler->PSendSysMessage("instance saves: %d", sInstanceSaveMgr->GetNumInstanceSaves()); + handler->PSendSysMessage("players bound: %d", sInstanceSaveMgr->GetNumBoundPlayersTotal()); + handler->PSendSysMessage("groups bound: %d", sInstanceSaveMgr->GetNumBoundGroupsTotal()); + + return true; + } + + static bool HandleInstanceSaveDataCommand(ChatHandler* handler, char const* /*args*/) + { + Player* player = handler->GetSession()->GetPlayer(); + Map* map = player->GetMap(); + if (!map->IsDungeon()) + { + handler->PSendSysMessage("Map is not a dungeon."); + handler->SetSentErrorMessage(true); + return false; + } + + if (!((InstanceMap*)map)->GetInstanceScript()) + { + handler->PSendSysMessage("Map has no instance data."); + handler->SetSentErrorMessage(true); + return false; + } + + ((InstanceMap*)map)->GetInstanceScript()->SaveToDB(); + + return true; + } +}; + +void AddSC_instance_commandscript() +{ + new instance_commandscript(); +} From f5fd27fd07c1dd95d44c678c1e996ac0cd8d1159 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 14 Jun 2012 11:52:22 -0400 Subject: [PATCH 1026/1149] DB/Spells: fix bonus coeff for spells. -1 does auto calculation and should not be used for no calculation. --- .../2012_06_14_03_world_spell_bonus_data.sql | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 sql/updates/world/2012_06_14_03_world_spell_bonus_data.sql diff --git a/sql/updates/world/2012_06_14_03_world_spell_bonus_data.sql b/sql/updates/world/2012_06_14_03_world_spell_bonus_data.sql new file mode 100644 index 00000000000..dc59f152e33 --- /dev/null +++ b/sql/updates/world/2012_06_14_03_world_spell_bonus_data.sql @@ -0,0 +1,94 @@ +-- Death Knight +DELETE FROM `spell_bonus_data` WHERE `entry` IN (58621, 47632, 47633, 50444, 70890, 50526, 48982, 59754, 49184); +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(58621, 0, 0, 0.08, 0, 'Death Knight - Glyph of Chains of Ice'), -- Shouldn't scale with SP. +(47632, 0, 0, 0.15, 0, 'Death Knight - Death Coil'), -- Shouldn't scale with SP. +(47633, 0, 0, 0.15, 0, 'Death Knight - Death Coil (Heal)'), -- Shouldn't scale with SP. +(50444, 0, 0, 0.105, 0, 'Death Knight - Corpse Explosion (Triggered)'), -- Shouldn't scale with SP. +(70890, 0, 0, 0, 0, 'Death Knight - Scourge Strike (Shadow)'), -- Shouldn't scale with SP. +(50526, 0, 0, 0, 0, 'Death Knight - Wandering Plague (Triggered)'), -- Shouldn't scale with SP. +(48982, 0, 0, 0, 0, 'Death Knight - Rune Tap'), -- Shouldn't scale with SP. +(59754, 0, 0, 0, 0, 'Death Knight - Glyph of Rune Tap (Triggered)'), -- Shouldn't scale with SP. +(49184, 0, 0, 0.2, 0, 'Death Knight - Howling Blast'); -- Shouldn't scale with SP. + +-- Druid +DELETE FROM `spell_bonus_data` WHERE `entry` IN (33745, 9007); +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(33745, 0, 0, 0.01, 0.01, 'Druid - Lacerate ($AP*0.05/number of ticks)'), -- Direct damage should scale with AP, based on DrDamage addon(3.3.5a). +(9007, 0, 0, 0, 0.03, 'Druid - Pounce Bleed (Triggered)'); -- Shouldn't scale with SP. Increase AP coefficient, based on DrDamage addon(3.3.5a) and Wowwiki.com. + +-- Hunter +DELETE FROM `spell_bonus_data` WHERE `entry` IN (56641, 42243, 3674, 19306, 1495, 63468, 136); +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(56641, 0, 0, 0.1, 0, 'Hunter - Steady Shot'), -- Shouldn't scale with SP. +(42243, 0, 0, 0.0837, 0, 'Hunter - Volley (Triggered)'), -- Shouldn't scale with SP. +(3674, 0, 0, 0, 0.023, 'Hunter - Black Arrow ($RAP*0.1 / number of ticks)'), -- Shouldn't scale with SP. Increase AP coefficient, based on DrDamage addon(3.3.5a). +(19306, 0, 0, 0.2, 0, 'Hunter - Counterattack'), -- Shouldn't scale with SP. +(1495, 0, 0, 0.2, 0, 'Hunter - Mongoose Bite'), -- Shouldn't scale with SP. +(63468, 0, 0, 0, 0, 'Hunter - Piercing Shots'), -- Shouldn't scale with SP. +(136, 0, 0, 0, 0, 'Hunter - Mend Pet'); -- Shouldn't scale with SP. + +-- Mage +DELETE FROM `spell_bonus_data` WHERE `entry` IN (133, 44614, 44457, 44461); +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(133, 1, 0, 0, 0, 'Mage - Fireball'), -- DoT componenet shouldn't scale. +(44614, 0.8571, 0, 0, 0, 'Mage - Frostfire Bolt'), -- DoT componenet shouldn't scale. +(44457, 0, 0.2, 0, 0, 'Mage - Living Bomb ($SP*0.8 / number of ticks)'), -- Direct damage bonus correction. +(44461, 0.4286, 0, 0, 0, 'Mage - Living Bomb (Triggered)'); -- Direct damage bonus correction. + +-- Paladin +DELETE FROM `spell_bonus_data` WHERE `entry` IN (633, 54158, 20467, 20187, 31803, 53742, 31804, 53733); +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(633, 0, 0, 0, 0, 'Paladin - Lay on Hands'), -- Shouldn't scale with SP. +(54158, 0.27, 0, 0.175, 0, 'Paladin - Judgement (Seal of Light, Seal of Wisdom, Seal of Justice)'), -- Increase coefficient, based on Wowwiki.com. +(20467, 0.14, 0, 0.115, 0, 'Paladin - Judgement of Command'), -- Decrease coefficient, based on Wowwiki.com. +(20187, 0.355, 0, 0.225, 0, 'Paladin - Judgement of Righteousness'), -- Increase coefficient, based on Wowwiki.com. +(31803, 0, 0.0132, 0, 0.0252, 'Paladin - Holy Vengeance'), -- Decrease coefficient, based on DrDamage addon(3.3.5a) and Wowwiki.com. +(53742, 0, 0.0132, 0, 0.0252, 'Paladin - Blood Corruption'), -- Decrease coefficient, based on DrDamage addon(3.3.5a) and Wowwiki.com. +(31804, 0.24, 0, 0.15, 0, 'Paladin - Judgement of Vengeance'), -- Increase coefficient, based on Wowwiki.com. +(53733, 0.24, 0, 0.15, 0, 'Paladin - Judgement of Corruption'); -- Increase coefficient, based on Wowwiki.com. + +-- Priest +DELETE FROM `spell_bonus_data` WHERE `entry` = 7001; +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(7001, 0, 0.626, 0, 0, 'Priest - Lightwell Renew ($SP*1.878 / number of ticks)'); -- Increase coefficient, based on DrDamage addon(3.3.5a). + +-- Rogue +DELETE FROM `spell_bonus_data` WHERE `entry` IN (32645, 2098, 703, 1776, 1943, 8680, 26688, 13218); +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(32645, 0, 0, 0, 0, 'Rogue - Envenom'), -- Shouldn't scale with SP. +(2098, 0, 0, 0, 0, 'Rogue - Eviscerate'), -- Shouldn't scale with SP. +(703, 0, 0, 0, 0.07, 'Rogue - Garrote'), -- Shouldn't scale with SP. +(1776, 0, 0, 0.21, 0, 'Rogue - Gouge'), -- Shouldn't scale with SP. +(1943, 0, 0, 0, 0, 'Rogue - Rupture'), -- Shouldn't scale with SP. +(8680, 0, 0, 0.1, 0, 'Rogue - Instant Poison'), -- Shouldn't scale with SP. +(26688, 0, 0, 0, 0, 'Rogue - Anesthetic Poison'), -- Shouldn't scale with SP nor AP. +(13218, 0, 0, 0.04, 0, 'Rogue - Wound Poison'); -- Shouldn't scale with SP. + + -- Warlock Healthstones Shouldn't scale with SP. +DELETE FROM `spell_bonus_data` WHERE `entry` IN (6262, 23468, 23469, 6263, 23470, 23471, 5720, 23472, 23473, 5723, 23474, 23475, 11732, 23476, 23477, 27235, 27236, 27237, 47874, 47873, 47872, 47875, 47876, 47877); +INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES +(6262, 0, 0, 0, 0, 'Warlock - HS - Minor Healthstone (with 0/2 Improved Healthstone)'), +(23468, 0, 0, 0, 0, 'Warlock - HS - Minor Healthstone (with 1/2 Improved Healthstone)'), +(23469, 0, 0, 0, 0, 'Warlock - HS - Minor Healthstone (with 2/2 Improved Healthstone)'), +(6263, 0, 0, 0, 0, 'Warlock - HS - Lesser Healthstone (with 0/2 Improved Healthstone)'), +(23470, 0, 0, 0, 0, 'Warlock - HS - Lesser Healthstone (with 1/2 Improved Healthstone)'), +(23471, 0, 0, 0, 0, 'Warlock - HS - Lesser Healthstone (with 2/2 Improved Healthstone)'), +(5720, 0, 0, 0, 0, 'Warlock - HS - Healthstone (with 0/2 Improved Healthstone)'), +(23472, 0, 0, 0, 0, 'Warlock - HS - Healthstone (with 1/2 Improved Healthstone)'), +(23473, 0, 0, 0, 0, 'Warlock - HS - Healthstone (with 2/2 Improved Healthstone)'), +(5723, 0, 0, 0, 0, 'Warlock - HS - Greater Healthstone (with 0/2 Improved Healthstone)'), +(23474, 0, 0, 0, 0, 'Warlock - HS - Greater Healthstone (with 1/2 Improved Healthstone)'), +(23475, 0, 0, 0, 0, 'Warlock - HS - Greater Healthstone (with 2/2 Improved Healthstone)'), +(11732, 0, 0, 0, 0, 'Warlock - HS - Major Healthstone (with 0/2 Improved Healthstone)'), +(23476, 0, 0, 0, 0, 'Warlock - HS - Major Healthstone (with 1/2 Improved Healthstone)'), +(23477, 0, 0, 0, 0, 'Warlock - HS - Major Healthstone (with 2/2 Improved Healthstone)'), +(27235, 0, 0, 0, 0, 'Warlock - HS - Master Healthstone (with 0/2 Improved Healthstone)'), +(27236, 0, 0, 0, 0, 'Warlock - HS - Master Healthstone (with 1/2 Improved Healthstone)'), +(27237, 0, 0, 0, 0, 'Warlock - HS - Master Healthstone (with 2/2 Improved Healthstone)'), +(47874, 0, 0, 0, 0, 'Warlock - HS - Demonic Healthstone (with 0/2 Improved Healthstone)'), +(47873, 0, 0, 0, 0, 'Warlock - HS - Demonic Healthstone (with 1/2 Improved Healthstone)'), +(47872, 0, 0, 0, 0, 'Warlock - HS - Demonic Healthstone (with 2/2 Improved Healthstone)'), +(47875, 0, 0, 0, 0, 'Warlock - HS - Fel Healthstone (with 0/2 Improved Healthstone)'), +(47876, 0, 0, 0, 0, 'Warlock - HS - Fel Healthstone (with 1/2 Improved Healthstone)'), +(47877, 0, 0, 0, 0, 'Warlock - HS - Fel Healthstone (with 2/2 Improved Healthstone)'); From d77a8568b7df8e1e7131f81c0c67487384232047 Mon Sep 17 00:00:00 2001 From: Faq Date: Thu, 14 Jun 2012 22:36:56 +0300 Subject: [PATCH 1027/1149] Fixing Death Knight T8 Melee 4P Bonus (darkruned set). tibbi --- src/server/game/Spells/SpellEffects.cpp | 19 ++++++++++++++++--- src/server/scripts/Spells/spell_dk.cpp | 5 +++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index e08c7dc6d55..b4a1ba19a08 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3388,7 +3388,11 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) // Blood Strike if (m_spellInfo->SpellFamilyFlags[0] & 0x400000) { - AddPctF(totalDamagePercentMod, m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()) / 2.0f); + float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()) / 2.0f; + // Death Knight T8 Melee 4P Bonus + if (AuraEffect const* aurEff = m_caster->GetAuraEffect(64736, EFFECT_0)) + AddPctF(bonusPct, aurEff->GetAmount()); + AddPctF(totalDamagePercentMod, bonusPct); // Glyph of Blood Strike if (m_caster->GetAuraEffect(59332, EFFECT_0)) @@ -3415,7 +3419,11 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) if (roll_chance_i(aurEff->GetAmount())) consumeDiseases = false; - AddPctF(totalDamagePercentMod, m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(m_caster->GetGUID(), consumeDiseases) / 2.0f); + float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(m_caster->GetGUID(), consumeDiseases) / 2.0f; + // Death Knight T8 Melee 4P Bonus + if (AuraEffect const* aurEff = m_caster->GetAuraEffect(64736, EFFECT_0)) + AddPctF(bonusPct, aurEff->GetAmount()); + AddPctF(totalDamagePercentMod, bonusPct); break; } // Blood-Caked Strike - Blood-Caked Blade @@ -3427,7 +3435,12 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) // Heart Strike if (m_spellInfo->SpellFamilyFlags[0] & 0x1000000) { - AddPctN(totalDamagePercentMod, m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(m_caster->GetGUID())); + float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()); + // Death Knight T8 Melee 4P Bonus + if (AuraEffect const* aurEff = m_caster->GetAuraEffect(64736, EFFECT_0)) + AddPctF(bonusPct, aurEff->GetAmount()); + + AddPctF(totalDamagePercentMod, bonusPct); break; } break; diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 118097a38cb..defca2b8d33 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -400,7 +400,12 @@ class spell_dk_scourge_strike : public SpellScriptLoader { Unit* caster = GetCaster(); if (Unit* unitTarget = GetHitUnit()) + { multiplier = (GetEffectValue() * unitTarget->GetDiseasesByCaster(caster->GetGUID()) / 100.f); + // Death Knight T8 Melee 4P Bonus + if (AuraEffect const* aurEff = caster->GetAuraEffect(64736, EFFECT_0)) + AddPctF(multiplier, aurEff->GetAmount()); + } } void HandleAfterHit() From cc7f95807a830fc8413f8f8c40925cc8dbbea494 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 14 Jun 2012 18:24:05 -0230 Subject: [PATCH 1028/1149] DB/SAI: Fix up quest 9539 "Totem of Coo" --- sql/updates/world/2012_06_14_09_world_sai.sql | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 sql/updates/world/2012_06_14_09_world_sai.sql diff --git a/sql/updates/world/2012_06_14_09_world_sai.sql b/sql/updates/world/2012_06_14_09_world_sai.sql new file mode 100644 index 00000000000..c918d35de2e --- /dev/null +++ b/sql/updates/world/2012_06_14_09_world_sai.sql @@ -0,0 +1,45 @@ +-- Fix up quest 9539 "Totem of Coo" +-- Totem of Akida SAI +SET @ENTRY := 17360; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,19,0,100,0,9539,0,0,0,11,30437,0,0,0,0,0,7,0,0,0,0,0,0,0,'Totem of Akida - Quest accepted - Cast Spell on player'); +-- Stillpine Ancestor Akida SAI +SET @ENTRY := 17379; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY*100) AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,54,0,100,0,0,1,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Just Summoned - Run Script'), +-- Script +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,3,0,16995,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - set model'), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - turn to player'), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,11,25035,0,0,0,0,0,1,0,0,0,0,0,0,0.01745319,'Stillpine Ancestor Akida - Script - Cast Spell'), +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - Set run on'), +(@ENTRY*100,9,4,0,0,0,100,0,4000,4000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - say 0'), +(@ENTRY*100,9,5,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-4154.224,-12514.75,45.35527,0,'Stillpine Ancestor Akida - Script - move to'), +(@ENTRY*100,9,6,0,0,0,100,0,2000,2000,0,0,69,0,0,0,0,0,0,8,0,0,0,-4123.563,-12517.23,44.9127,0,'Stillpine Ancestor Akida - Script - move to'), +(@ENTRY*100,9,7,0,0,0,100,0,3500,3500,0,0,69,0,0,0,0,0,0,8,0,0,0,-4091.881,-12524,42.37354,0,'Stillpine Ancestor Akida - Script - move to'), +(@ENTRY*100,9,8,0,0,0,100,0,5500,5500,0,0,69,0,0,0,0,0,0,8,0,0,0,-4058.039,-12538.57,43.96096,0,'Stillpine Ancestor Akida - Script - move to'), +(@ENTRY*100,9,9,0,0,0,100,0,4500,4500,0,0,69,0,0,0,0,0,0,8,0,0,0,-4026.534,-12568.4,45.82222,0,'Stillpine Ancestor Akida - Script - move to'), +(@ENTRY*100,9,10,0,0,0,100,0,3000,3000,0,0,69,0,0,0,0,0,0,8,0,0,0,-4000.155,-12598.55,54.19722,0,'Stillpine Ancestor Akida - Script - move to'), -- +(@ENTRY*100,9,11,0,0,0,100,0,7500,7500,0,0,69,0,0,0,0,0,0,8,0,0,0,-3977.5,-12627.22,63.1442,0,'Stillpine Ancestor Akida - Script - move to'), +(@ENTRY*100,9,12,0,0,0,100,0,3500,3500,0,0,69,0,0,0,0,0,0,8,0,0,0,-3952.254,-12660.37,74.23783,0,'Stillpine Ancestor Akida - Script - move to'), +(@ENTRY*100,9,13,0,0,0,100,0,6500,6500,0,0,69,0,0,0,0,0,0,8,0,0,0,-3933.183,-12698.27,85.65151,0,'Stillpine Ancestor Akida - Script - move to'), +(@ENTRY*100,9,14,0,0,0,100,0,4500,4500,0,0,69,0,0,0,0,0,0,8,0,0,0,-3925.843,-12718.81,89.94553,0,'Stillpine Ancestor Akida - Script - move to'), -- +(@ENTRY*100,9,15,0,0,0,100,0,3500,3500,0,0,69,0,0,0,0,0,0,8,0,0,0,-3915.914,-12743.41,98.56779,0,'Stillpine Ancestor Akida - Script - move to'), +(@ENTRY*100,9,16,0,0,0,100,0,4500,4500,0,0,66,0,0,0,0,0,0,19,17361,10,0,0,0,0,0,'Stillpine Ancestor Akida - Script - turn to Totem of Coo'), +(@ENTRY*100,9,17,0,0,0,100,0,2000,2000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - say 1'), +(@ENTRY*100,9,18,0,0,0,100,0,3000,3000,0,0,11,30428,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - cast spell'), +(@ENTRY*100,9,19,0,0,0,100,0,1000,1000,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - despawn'); +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry`=17379; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(17379,0,0, '%s urges you to follow him.',16,0,100,0,0,0, 'Stillpine Ancestor Akida'), +(17379,1,0, '%s points to the totem of Coo.',16,0,100,25,0,0, 'Stillpine Ancestor Akida'); +-- add missing spells to db +DELETE FROM `Spell_dbc` WHERE `Id` IN (30426,30437); +INSERT INTO `Spell_dbc` (`Id`,`SchoolMask`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`Comment`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`AreaGroupId`,`EffectMiscValueB1`) VALUES +(30426,0,0,0,256,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,40,12,0,-1,0,0,28,6,0,0,0,0,0,0,0,0,0,0,0,0,0,32,1,0,0,0,0,15,0,0,0,4,0,0,0,0,0,0,0,17379,0,0,0,0,0,'Stillpine Ancestor Akida',0,0,0,0,0,0,0,1,1,0,64), +(30437,0,0,0,2304,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,36,3,0,-1,0,0,6,0,0,1,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,23,0,0,1000,0,0,0,0,0,0,0,0,30426,0,0,'Stillpine Ancestor Akida TRIGGER',0,0,0,0,0,0,0,1,0,0,0); From 3fac8f17d1c916e8201d12318663292b7ec9c5b8 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 14 Jun 2012 18:33:50 -0230 Subject: [PATCH 1029/1149] DB/EAI: Remove Stillpine Ancestor Akida EAI --- sql/updates/world/2012_06_14_10_world_eai.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_06_14_10_world_eai.sql diff --git a/sql/updates/world/2012_06_14_10_world_eai.sql b/sql/updates/world/2012_06_14_10_world_eai.sql new file mode 100644 index 00000000000..355646fbd69 --- /dev/null +++ b/sql/updates/world/2012_06_14_10_world_eai.sql @@ -0,0 +1,2 @@ +-- Remove Stillpine Ancestor Akida EAI +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=17379; From 8cf01fdb2638b0023800bc5a74c64f4234902047 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 14 Jun 2012 18:58:12 -0230 Subject: [PATCH 1030/1149] DB/Misc: blah blah blah --- sql/updates/world/2012_06_14_09_world_sai.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/updates/world/2012_06_14_09_world_sai.sql b/sql/updates/world/2012_06_14_09_world_sai.sql index c918d35de2e..c09ec6c0516 100644 --- a/sql/updates/world/2012_06_14_09_world_sai.sql +++ b/sql/updates/world/2012_06_14_09_world_sai.sql @@ -39,7 +39,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr (17379,0,0, '%s urges you to follow him.',16,0,100,0,0,0, 'Stillpine Ancestor Akida'), (17379,1,0, '%s points to the totem of Coo.',16,0,100,25,0,0, 'Stillpine Ancestor Akida'); -- add missing spells to db -DELETE FROM `Spell_dbc` WHERE `Id` IN (30426,30437); -INSERT INTO `Spell_dbc` (`Id`,`SchoolMask`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`Comment`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`AreaGroupId`,`EffectMiscValueB1`) VALUES +DELETE FROM `spell_dbc` WHERE `Id` IN (30426,30437); +INSERT INTO `spell_dbc` (`Id`,`SchoolMask`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`Comment`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`AreaGroupId`,`EffectMiscValueB1`) VALUES (30426,0,0,0,256,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,40,12,0,-1,0,0,28,6,0,0,0,0,0,0,0,0,0,0,0,0,0,32,1,0,0,0,0,15,0,0,0,4,0,0,0,0,0,0,0,17379,0,0,0,0,0,'Stillpine Ancestor Akida',0,0,0,0,0,0,0,1,1,0,64), (30437,0,0,0,2304,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,36,3,0,-1,0,0,6,0,0,1,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,23,0,0,1000,0,0,0,0,0,0,0,0,30426,0,0,'Stillpine Ancestor Akida TRIGGER',0,0,0,0,0,0,0,1,0,0,0); From ac7485341554d09cf7740b9a2b5a9cf43674710b Mon Sep 17 00:00:00 2001 From: Faq Date: Fri, 15 Jun 2012 01:21:02 +0300 Subject: [PATCH 1031/1149] Adding enums --- src/server/scripts/Spells/spell_dk.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index defca2b8d33..9051d9510f9 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -40,6 +40,8 @@ enum DeathKnightSpells DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED = 63611, DK_SPELL_UNHOLY_PRESENCE = 48265, DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED = 63622, + DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED = 63611, + SPELL_DK_ITEM_T8_MALEE_4P_BONUS = 64736, }; // 50462 - Anti-Magic Shell (on raid member) @@ -403,7 +405,7 @@ class spell_dk_scourge_strike : public SpellScriptLoader { multiplier = (GetEffectValue() * unitTarget->GetDiseasesByCaster(caster->GetGUID()) / 100.f); // Death Knight T8 Melee 4P Bonus - if (AuraEffect const* aurEff = caster->GetAuraEffect(64736, EFFECT_0)) + if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_DK_ITEM_T8_MALEE_4P_BONUS, EFFECT_0)) AddPctF(multiplier, aurEff->GetAmount()); } } @@ -608,7 +610,7 @@ public: if (!target->HasAura(DK_SPELL_BLOOD_PRESENCE) && !target->HasAura(DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) { int32 basePoints1 = aurEff->GetAmount(); - target->CastCustomSpell(target, 63611, NULL, &basePoints1, NULL, true, 0, aurEff); + target->CastCustomSpell(target, DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED, NULL, &basePoints1, NULL, true, 0, aurEff); } } From 67a0e54bb9afc4ddcd4c6c4e47c57cb5079b62af Mon Sep 17 00:00:00 2001 From: Faq Date: Fri, 15 Jun 2012 01:29:52 +0300 Subject: [PATCH 1032/1149] Correct the amount of dmg absorbed by Anti-magic shell.tibbi --- src/server/scripts/Spells/spell_dk.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 9051d9510f9..2a414c7c094 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -113,8 +113,7 @@ class spell_dk_anti_magic_shell_self : public SpellScriptLoader void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) { - // Set absorbtion amount to unlimited - amount = -1; + amount = GetCaster()->CountPctFromMaxHealth(hpPct); } void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount) From 39e4211b19f2c55393201d80f37472549ae376f3 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 14 Jun 2012 20:30:44 -0230 Subject: [PATCH 1033/1149] DB/SAI: Fix up quest 9540 "Totem of Tikti" Also minor fix for Totem of Akida. --- sql/updates/world/2012_06_14_09_world_sai.sql | 2 +- sql/updates/world/2012_06_14_11_world_sai | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_06_14_11_world_sai diff --git a/sql/updates/world/2012_06_14_09_world_sai.sql b/sql/updates/world/2012_06_14_09_world_sai.sql index c09ec6c0516..3beb7c06326 100644 --- a/sql/updates/world/2012_06_14_09_world_sai.sql +++ b/sql/updates/world/2012_06_14_09_world_sai.sql @@ -4,7 +4,7 @@ SET @ENTRY := 17360; UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES -(@ENTRY,0,0,0,19,0,100,0,9539,0,0,0,11,30437,0,0,0,0,0,7,0,0,0,0,0,0,0,'Totem of Akida - Quest accepted - Cast Spell on player'); +(@ENTRY,0,0,0,19,0,100,0,9539,0,0,0,85,30437,0,0,0,0,0,7,0,0,0,0,0,0,0,'Totem of Akida - Quest accepted - Cast Spell on player'); -- Stillpine Ancestor Akida SAI SET @ENTRY := 17379; UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; diff --git a/sql/updates/world/2012_06_14_11_world_sai b/sql/updates/world/2012_06_14_11_world_sai new file mode 100644 index 00000000000..5dbef082a1e --- /dev/null +++ b/sql/updates/world/2012_06_14_11_world_sai @@ -0,0 +1,48 @@ +-- Fix up quest 9540 "Totem of Tikti" +-- Totem of Tikti SAI +SET @ENTRY := 17361; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,19,0,100,0,9540,0,0,0,85,30442,0,0,0,0,0,7,0,0,0,0,0,0,0,'Totem of Tikti - Quest accepted - Cast Spell on player'); +-- Stillpine Ancestor Coo SAI +SET @ENTRY := 17391; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY*100) AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,54,0,100,0,0,1,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Just Summoned - Run Script'), +-- Script +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,3,0,16995,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - set model'), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - turn to player'), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,11,25035,0,0,0,0,0,1,0,0,0,0,0,0,0.01745319,'Stillpine Ancestor Coo - Script - Cast Spell'), +(@ENTRY*100,9,3,0,0,0,100,0,3000,3000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - say 0'), +(@ENTRY*100,9,4,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-3926.039,-12746.71,96.06779,0,'Stillpine Ancestor Coo - Script - move to'), +(@ENTRY*100,9,5,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-3926.326,-12753.71,98.44279,0,'Stillpine Ancestor Coo - Script - move to'), +(@ENTRY*100,9,6,0,0,0,100,0,2000,2000,0,0,69,0,0,0,0,0,0,8,0,0,0,-3924.268,-12761.45,101.6928,0,'Stillpine Ancestor Coo - Script - move to'), +(@ENTRY*100,9,7,0,0,0,100,0,6000,6000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - say 1'), +(@ENTRY*100,9,8,0,0,0,100,0,4000,4000,0,0,11,30424,0,0,0,0,0,7,0,0,0,0,0,0,0.01745319,'Stillpine Ancestor Coo - Script - Cast Spell'), +(@ENTRY*100,9,9,0,0,0,100,0,1000,1000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - say 2'), +(@ENTRY*100,9,10,0,0,0,100,0,4000,4000,0,0,11,30473,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - cast spell'), +(@ENTRY*100,9,11,0,0,0,100,0,0,0,0,0,3,0,17019,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - set model'), +(@ENTRY*100,9,12,0,0,0,100,0,3000,3000,0,0,60,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - Fly on'), +(@ENTRY*100,9,13,0,0,0,100,0,0,0,0,0,69,0,0,0,0,0,0,8,0,0,0,-3926.068,-12767.33,104.3799,0,'Stillpine Ancestor Coo - Script - move to'), +(@ENTRY*100,9,14,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-3923.497,-12794.98,98.46323,0,'Stillpine Ancestor Coo - Script - move to'), +(@ENTRY*100,9,15,0,0,0,100,0,4000,4000,0,0,69,0,0,0,0,0,0,8,0,0,0,-3922.687,-12832.4,89.24097,0,'Stillpine Ancestor Coo - Script - move to'), +(@ENTRY*100,9,16,0,0,0,100,0,8000,8000,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - despawn'); +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry`=17391; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(17391,0,0, '%s motions for you to follow him.',16,0,100,0,0,0, 'Stillpine Ancestor Coo'), +(17391,1,0, '[Furbolg] Ritk kin''chikx azul azure summit...',12,0,100,0,0,0, 'Stillpine Ancestor Coo'), +(17391,2,0, '[Furbolg] Coo xip fly... Jump ilos river. Find Tikti.',12,0,100,0,0,0, 'Stillpine Ancestor Coo'); +-- add missing spells to db +DELETE FROM `spell_dbc` WHERE `Id` IN (30429,30442); +INSERT INTO `spell_dbc` (`Id`,`SchoolMask`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`Comment`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`AreaGroupId`,`EffectMiscValueB1`) VALUES +(30429,0,0,0,256,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,40,12,0,-1,0,0,28,6,0,0,0,0,0,0,0,0,0,0,0,0,0,32,1,0,0,0,0,7,0,0,0,4,0,0,0,0,0,0,0,17391,0,0,0,0,0,'Stillpine Ancestor Coo',0,0,0,0,0,0,0,1,1,0,64), +(30442,0,0,0,2304,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,36,3,0,-1,0,0,6,0,0,1,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,23,0,0,1000,0,0,0,0,0,0,0,0,30429,0,0,'Stillpine Ancestor Coo TRIGGER',0,0,0,0,0,0,0,1,0,0,0); +-- Delete bad spawn of Stillpine Ancestor Coo +DELETE FROM `creature` WHERE `guid`=86512; +DELETE FROM `creature_addon` WHERE `guid`=86512; +-- Remove Stillpine Ancestor Akida EAI +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=17391; From 8962b8842584610a3597e9e691267b5aaa1c436e Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 14 Jun 2012 20:41:28 -0230 Subject: [PATCH 1034/1149] DB/SAI: Comment update to previous commit --- sql/updates/world/2012_06_14_11_world_sai | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/updates/world/2012_06_14_11_world_sai b/sql/updates/world/2012_06_14_11_world_sai index 5dbef082a1e..1d01b02f86b 100644 --- a/sql/updates/world/2012_06_14_11_world_sai +++ b/sql/updates/world/2012_06_14_11_world_sai @@ -1,10 +1,10 @@ -- Fix up quest 9540 "Totem of Tikti" --- Totem of Tikti SAI +-- Totem of Coo SAI SET @ENTRY := 17361; UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES -(@ENTRY,0,0,0,19,0,100,0,9540,0,0,0,85,30442,0,0,0,0,0,7,0,0,0,0,0,0,0,'Totem of Tikti - Quest accepted - Cast Spell on player'); +(@ENTRY,0,0,0,19,0,100,0,9540,0,0,0,85,30442,0,0,0,0,0,7,0,0,0,0,0,0,0,'Totem of Coo - Quest accepted - Cast Spell on player'); -- Stillpine Ancestor Coo SAI SET @ENTRY := 17391; UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; From cf1f21a5e7bd83122100563f921f12ffbb1bda22 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Fri, 15 Jun 2012 07:23:54 -0230 Subject: [PATCH 1035/1149] Misc: fix filename --- .../{2012_06_14_11_world_sai => 2012_06_14_11_world_sai.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sql/updates/world/{2012_06_14_11_world_sai => 2012_06_14_11_world_sai.sql} (100%) diff --git a/sql/updates/world/2012_06_14_11_world_sai b/sql/updates/world/2012_06_14_11_world_sai.sql similarity index 100% rename from sql/updates/world/2012_06_14_11_world_sai rename to sql/updates/world/2012_06_14_11_world_sai.sql From 478de6298e4c2b1f1239cd545113b61127cf02d3 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 15 Jun 2012 15:19:31 +0200 Subject: [PATCH 1036/1149] Scripts/Icecrown Citadel: Fixed Sindragosa & her frost wyrms summoning - this time properly using constant db data (turns out creatures receive a new GUID when grid reloads in instance) --- .../IcecrownCitadel/boss_sindragosa.cpp | 44 ++++++---- .../instance_icecrown_citadel.cpp | 84 ++++--------------- 2 files changed, 46 insertions(+), 82 deletions(-) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 9baf6ba7a00..fdc9a6a21d6 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -200,7 +200,7 @@ class boss_sindragosa : public CreatureScript struct boss_sindragosaAI : public BossAI { - boss_sindragosaAI(Creature* creature) : BossAI(creature, DATA_SINDRAGOSA) + boss_sindragosaAI(Creature* creature) : BossAI(creature, DATA_SINDRAGOSA), _summoned(false) { } @@ -220,7 +220,7 @@ class boss_sindragosa : public CreatureScript _isInAirPhase = false; _isThirdPhase = false; - if (instance->GetData(DATA_SINDRAGOSA_FROSTWYRMS) != 255) + if (!_summoned) { me->SetCanFly(true); me->SetDisableGravity(true); @@ -266,10 +266,13 @@ class boss_sindragosa : public CreatureScript { if (action == ACTION_START_FROSTWYRM) { + if (_summoned) + return; + + _summoned = true; if (TempSummon* summon = me->ToTempSummon()) summon->SetTempSummonType(TEMPSUMMON_DEAD_DESPAWN); - instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, 255); if (me->isDead()) return; @@ -550,6 +553,7 @@ class boss_sindragosa : public CreatureScript uint8 _mysticBuffetStack; bool _isInAirPhase; bool _isThirdPhase; + bool _summoned; }; CreatureAI* GetAI(Creature* creature) const @@ -642,7 +646,7 @@ class npc_spinestalker : public CreatureScript struct npc_spinestalkerAI : public ScriptedAI { - npc_spinestalkerAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) + npc_spinestalkerAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _summoned(false) { } @@ -651,7 +655,7 @@ class npc_spinestalker : public CreatureScript // Increase add count if (!me->isDead()) { - _instance->SetData64(DATA_SINDRAGOSA_FROSTWYRMS, me->GetGUID()); // this cannot be in Reset because reset also happens on evade + _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade Reset(); } } @@ -664,7 +668,7 @@ class npc_spinestalker : public CreatureScript _events.ScheduleEvent(EVENT_TAIL_SWEEP, urand(8000, 12000)); me->SetReactState(REACT_DEFENSIVE); - if (_instance->GetData(DATA_SPINESTALKER) != 255) + if (!_summoned) { me->SetCanFly(true); me->SetDisableGravity(true); @@ -674,7 +678,7 @@ class npc_spinestalker : public CreatureScript void JustRespawned() { ScriptedAI::JustRespawned(); - _instance->SetData64(DATA_SINDRAGOSA_FROSTWYRMS, me->GetGUID()); // this cannot be in Reset because reset also happens on evade + _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade } void JustDied(Unit* /*killer*/) @@ -686,7 +690,10 @@ class npc_spinestalker : public CreatureScript { if (action == ACTION_START_FROSTWYRM) { - _instance->SetData(DATA_SPINESTALKER, 255); + if (_summoned) + return; + + _summoned = true; if (me->isDead()) return; @@ -753,6 +760,7 @@ class npc_spinestalker : public CreatureScript private: EventMap _events; InstanceScript* _instance; + bool _summoned; }; CreatureAI* GetAI(Creature* creature) const @@ -768,7 +776,7 @@ class npc_rimefang : public CreatureScript struct npc_rimefangAI : public ScriptedAI { - npc_rimefangAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) + npc_rimefangAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _summoned(false) { } @@ -777,7 +785,7 @@ class npc_rimefang : public CreatureScript // Increase add count if (!me->isDead()) { - _instance->SetData64(DATA_SINDRAGOSA_FROSTWYRMS, me->GetGUID()); // this cannot be in Reset because reset also happens on evade + _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade Reset(); } } @@ -790,7 +798,7 @@ class npc_rimefang : public CreatureScript me->SetReactState(REACT_DEFENSIVE); _icyBlastCounter = 0; - if (_instance->GetData(DATA_RIMEFANG) != 255) + if (!_summoned) { me->SetCanFly(true); me->SetDisableGravity(true); @@ -800,7 +808,7 @@ class npc_rimefang : public CreatureScript void JustRespawned() { ScriptedAI::JustRespawned(); - _instance->SetData64(DATA_SINDRAGOSA_FROSTWYRMS, me->GetGUID()); // this cannot be in Reset because reset also happens on evade + _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade } void JustDied(Unit* /*killer*/) @@ -812,7 +820,10 @@ class npc_rimefang : public CreatureScript { if (action == ACTION_START_FROSTWYRM) { - _instance->SetData(DATA_RIMEFANG, 255); + if (_summoned) + return; + + _summoned = true; if (me->isDead()) return; @@ -906,6 +917,7 @@ class npc_rimefang : public CreatureScript EventMap _events; InstanceScript* _instance; uint8 _icyBlastCounter; + bool _summoned; }; CreatureAI* GetAI(Creature* creature) const @@ -933,7 +945,7 @@ class npc_sindragosa_trash : public CreatureScript if (!me->isDead()) { if (me->GetEntry() == NPC_FROSTWING_WHELP) - _instance->SetData64(_frostwyrmId, me->GetGUID()); // this cannot be in Reset because reset also happens on evade + _instance->SetData(_frostwyrmId, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade Reset(); } } @@ -956,7 +968,7 @@ class npc_sindragosa_trash : public CreatureScript // Increase add count if (me->GetEntry() == NPC_FROSTWING_WHELP) - _instance->SetData64(_frostwyrmId, me->GetGUID()); // this cannot be in Reset because reset also happens on evade + _instance->SetData(_frostwyrmId, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade } void SetData(uint32 type, uint32 data) @@ -1503,7 +1515,7 @@ class at_sindragosa_lair : public AreaTriggerScript if (Creature* rimefang = ObjectAccessor::GetCreature(*player, instance->GetData64(DATA_RIMEFANG))) rimefang->AI()->DoAction(ACTION_START_FROSTWYRM); - if (!instance->GetData(DATA_SINDRAGOSA_FROSTWYRMS) && instance->GetBossState(DATA_SINDRAGOSA) != DONE) + if (!instance->GetData(DATA_SINDRAGOSA_FROSTWYRMS) && !instance->GetData64(DATA_SINDRAGOSA) && instance->GetBossState(DATA_SINDRAGOSA) != DONE) { if (player->GetMap()->IsHeroic() && !instance->GetData(DATA_HEROIC_ATTEMPTS)) return true; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index 288fde28c38..704c3c2b0c2 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -89,13 +89,6 @@ WeeklyQuest const WeeklyQuestData[WeeklyNPCs] = {NPC_VALITHRIA_DREAMWALKER_QUEST, {QUEST_RESPITE_FOR_A_TORNMENTED_SOUL_10, QUEST_RESPITE_FOR_A_TORNMENTED_SOUL_25}}, // Respite for a Tormented Soul }; -enum FrostwyrmFlags -{ - FLAG_SPINESTALKER_SUMMONED = 0x01, - FLAG_RIMEFANG_SUMMONED = 0x02, - FLAG_SINDRAGOSA_SUMMONED = 0x04, -}; - class instance_icecrown_citadel : public InstanceMapScript { public: @@ -152,7 +145,6 @@ class instance_icecrown_citadel : public InstanceMapScript ColdflameJetsState = NOT_STARTED; BloodQuickeningState = NOT_STARTED; BloodQuickeningMinutes = 0; - FrostwyrmFlags = 0; } void FillInitialWorldStates(WorldPacket& data) @@ -284,13 +276,9 @@ class instance_icecrown_citadel : public InstanceMapScript break; case NPC_SPINESTALKER: SpinestalkerGUID = creature->GetGUID(); - if (!creature->isAlive()) - FrostwyrmFlags |= FLAG_SPINESTALKER_SUMMONED; break; case NPC_RIMEFANG: RimefangGUID = creature->GetGUID(); - if (!creature->isAlive()) - FrostwyrmFlags |= FLAG_RIMEFANG_SUMMONED; break; case NPC_THE_LICH_KING: TheLichKingGUID = creature->GetGUID(); @@ -307,6 +295,12 @@ class instance_icecrown_citadel : public InstanceMapScript } } + void OnCreatureRemove(Creature* creature) + { + if (creature->GetEntry() == NPC_SINDRAGOSA) + SindragosaGUID = 0; + } + // Weekly quest spawn prevention uint32 GetCreatureEntry(uint32 /*guidLow*/, CreatureData const* data) { @@ -357,49 +351,36 @@ class instance_icecrown_citadel : public InstanceMapScript crok->AI()->SetGUID(creature->GetGUID(), ACTION_VRYKUL_DEATH); break; case NPC_FROSTWING_WHELP: + if (FrostwyrmGUIDs.empty()) + return; + if (creature->AI()->GetData(1/*DATA_FROSTWYRM_OWNER*/) == DATA_SPINESTALKER) { - if (FrostwyrmFlags & FLAG_SPINESTALKER_SUMMONED) - return; - - SpinestalkerTrash.erase(creature->GetGUID()); + SpinestalkerTrash.erase(creature->GetDBTableGUIDLow()); if (SpinestalkerTrash.empty()) - { - FrostwyrmFlags |= FLAG_SPINESTALKER_SUMMONED; if (Creature* spinestalk = instance->GetCreature(SpinestalkerGUID)) spinestalk->AI()->DoAction(ACTION_START_FROSTWYRM); - } } else { - if (FrostwyrmFlags & FLAG_RIMEFANG_SUMMONED) - return; - - RimefangTrash.erase(creature->GetGUID()); + RimefangTrash.erase(creature->GetDBTableGUIDLow()); if (RimefangTrash.empty()) - { - FrostwyrmFlags |= FLAG_RIMEFANG_SUMMONED; if (Creature* spinestalk = instance->GetCreature(RimefangGUID)) spinestalk->AI()->DoAction(ACTION_START_FROSTWYRM); - } } break; case NPC_RIMEFANG: case NPC_SPINESTALKER: { - if (FrostwyrmFlags & FLAG_SINDRAGOSA_SUMMONED) - return; - if (instance->IsHeroic() && !HeroicAttempts) return; if (GetBossState(DATA_SINDRAGOSA) == DONE) return; - FrostwyrmGUIDs.erase(creature->GetGUID()); + FrostwyrmGUIDs.erase(creature->GetDBTableGUIDLow()); if (FrostwyrmGUIDs.empty()) { - FrostwyrmFlags |= FLAG_SINDRAGOSA_SUMMONED; instance->LoadGrid(SindragosaSpawnPos.GetPositionX(), SindragosaSpawnPos.GetPositionY()); if (Creature* boss = instance->SummonCreature(NPC_SINDRAGOSA, SindragosaSpawnPos)) boss->AI()->DoAction(ACTION_START_FROSTWYRM); @@ -597,16 +578,10 @@ class instance_icecrown_citadel : public InstanceMapScript switch (type) { case DATA_SINDRAGOSA_FROSTWYRMS: - if (FrostwyrmFlags & FLAG_SINDRAGOSA_SUMMONED) - return 255; return FrostwyrmGUIDs.size(); case DATA_SPINESTALKER: - if (FrostwyrmFlags & FLAG_SPINESTALKER_SUMMONED) - return 255; return SpinestalkerTrash.size(); case DATA_RIMEFANG: - if (FrostwyrmFlags & FLAG_RIMEFANG_SUMMONED) - return 255; return RimefangTrash.size(); case DATA_COLDFLAME_JETS: return ColdflameJetsState; @@ -806,9 +781,6 @@ class instance_icecrown_citadel : public InstanceMapScript sindra->DespawnOrUnsummon(); } } - // Reached when loading from DB - if (state == DONE) - FrostwyrmFlags |= FLAG_SINDRAGOSA_SUMMONED; break; case DATA_THE_LICH_KING: { @@ -866,16 +838,13 @@ class instance_icecrown_citadel : public InstanceMapScript IsOrbWhispererEligible = data ? true : false; break; case DATA_SINDRAGOSA_FROSTWYRMS: - if (data == 255) - FrostwyrmFlags |= FLAG_SINDRAGOSA_SUMMONED; + FrostwyrmGUIDs.insert(data); break; case DATA_SPINESTALKER: - if (data == 255) - FrostwyrmFlags |= FLAG_SPINESTALKER_SUMMONED; + SpinestalkerTrash.insert(data); break; case DATA_RIMEFANG: - if (data == 255) - FrostwyrmFlags |= FLAG_RIMEFANG_SUMMONED; + RimefangTrash.insert(data); break; case DATA_COLDFLAME_JETS: ColdflameJetsState = data; @@ -918,22 +887,6 @@ class instance_icecrown_citadel : public InstanceMapScript } } - void SetData64(uint32 id, uint64 data) - { - switch (id) - { - case DATA_SINDRAGOSA_FROSTWYRMS: - FrostwyrmGUIDs.insert(data); - break; - case DATA_SPINESTALKER: - SpinestalkerTrash.insert(data); - break; - case DATA_RIMEFANG: - RimefangTrash.insert(data); - break; - } - } - bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) { switch (criteria_id) @@ -1301,13 +1254,12 @@ class instance_icecrown_citadel : public InstanceMapScript uint64 PillarsUnchainedGUID; uint32 TeamInInstance; uint32 ColdflameJetsState; - std::set FrostwyrmGUIDs; - std::set SpinestalkerTrash; - std::set RimefangTrash; + std::set FrostwyrmGUIDs; + std::set SpinestalkerTrash; + std::set RimefangTrash; uint32 BloodQuickeningState; uint32 HeroicAttempts; uint16 BloodQuickeningMinutes; - uint16 FrostwyrmFlags; bool IsBonedEligible; bool IsOozeDanceEligible; bool IsNauseaEligible; From 6bd8a01aa5474b55dc8681e224d31b16a43a87bc Mon Sep 17 00:00:00 2001 From: Faq Date: Fri, 15 Jun 2012 17:21:34 +0300 Subject: [PATCH 1037/1149] ... --- src/server/scripts/Spells/spell_dk.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 2a414c7c094..38901287e0d 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -40,7 +40,6 @@ enum DeathKnightSpells DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED = 63611, DK_SPELL_UNHOLY_PRESENCE = 48265, DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED = 63622, - DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED = 63611, SPELL_DK_ITEM_T8_MALEE_4P_BONUS = 64736, }; From 9d19be2ee5be7cf46ea3eb6b197647737266c69e Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 14 Jun 2012 17:07:05 -0400 Subject: [PATCH 1038/1149] Core/Spells: fix spell scripts from recent commit and cleanup scripts --- .../Ulduar/HallsOfLightning/boss_loken.cpp | 4 +- src/server/scripts/Spells/spell_druid.cpp | 65 +------ src/server/scripts/Spells/spell_generic.cpp | 29 +-- src/server/scripts/Spells/spell_paladin.cpp | 11 +- src/server/scripts/Spells/spell_pet.cpp | 178 +++++++++--------- src/server/scripts/Spells/spell_priest.cpp | 4 - src/server/scripts/Spells/spell_shaman.cpp | 10 +- src/server/scripts/Spells/spell_warlock.cpp | 15 +- 8 files changed, 110 insertions(+), 206 deletions(-) diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp index bdaaa002b3f..f42fd87c643 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp @@ -193,7 +193,7 @@ class spell_loken_pulsing_shockwave : public SpellScriptLoader { PrepareSpellScript(spell_loken_pulsing_shockwave_SpellScript); - void CalculateDamage() + void CalculateDamage(SpellEffIndex /*effIndex*/) { if (!GetHitUnit()) return; @@ -205,7 +205,7 @@ class spell_loken_pulsing_shockwave : public SpellScriptLoader void Register() { - OnHit += SpellHitFn(spell_loken_pulsing_shockwave_SpellScript::CalculateDamage); + OnEffectHitTarget += SpellEffectFn(spell_loken_pulsing_shockwave_SpellScript::CalculateDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); } }; diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 9dedeaf5bd7..b817036a9e4 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -332,26 +332,6 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader } }; -class StarfallDummyTargetFilter -{ - public: - StarfallDummyTargetFilter(Unit* caster) : _caster(caster) { } - - bool operator()(Unit* target) const - { - if (target->HasStealthAura() || target->HasInvisibilityAura()) - return true; - - if (!target->IsWithinLOSInMap(_caster)) - return true; - - return false; - } - - private: - Unit* _caster; -}; - class spell_dru_starfall_dummy : public SpellScriptLoader { public: @@ -363,8 +343,6 @@ class spell_dru_starfall_dummy : public SpellScriptLoader void FilterTargets(std::list& unitList) { - // Remove targets not in LoS or in stealth - unitList.remove_if(StarfallDummyTargetFilter(GetCaster())); Trinity::Containers::RandomResizeList(unitList, 2); } @@ -419,61 +397,28 @@ class spell_dru_lifebloom : public SpellScriptLoader void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { - // Final heal only on duration end - if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) + // Final heal only on duration end and dispel + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL) return; // final heal int32 stack = GetStackAmount(); int32 healAmount = aurEff->GetAmount(); - Unit* caster = GetCaster(); - if (caster) + if (Unit* caster = GetCaster()) { healAmount = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), healAmount, HEAL, stack); healAmount = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, stack); - } - GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); - - // restore mana - if (caster) - { + // restore mana int32 returnMana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * stack / 2; caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); } - } - - void HandleDispel(DispelInfo* dispelInfo) - { - if (Unit* target = GetUnitOwner()) - { - if (AuraEffect const* aurEff = GetEffect(EFFECT_1)) - { - // final heal - int32 healAmount = aurEff->GetAmount(); - Unit* caster = GetCaster(); - if (caster) - { - healAmount = caster->SpellHealingBonusDone(target, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges()); - healAmount = target->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges()); - } - - target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID()); - - // restore mana - if (caster) - { - int32 returnMana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * dispelInfo->GetRemovedCharges() / 2; - caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID()); - } - } - } + GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); } void Register() { AfterEffectRemove += AuraEffectRemoveFn(spell_dru_lifebloom_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - AfterDispel += AuraDispelFn(spell_dru_lifebloom_AuraScript::HandleDispel); } }; diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index f254908fe55..e7cc7360aab 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -252,12 +252,7 @@ class spell_gen_parachute : public SpellScriptLoader if (target->IsFalling()) { target->RemoveAurasDueToSpell(SPELL_PARACHUTE); - - float x, y, z; - target->GetPosition(x, y, z); - float groundZ = target->GetMap()->GetHeight(target->GetPhaseMask(), x, y, z); - if (fabs(groundZ - z) > 0.1f) - target->CastSpell(target, SPELL_PARACHUTE_BUFF, true); + target->CastSpell(target, SPELL_PARACHUTE_BUFF, true); } } @@ -2825,24 +2820,16 @@ class spell_gen_lifebloom : public SpellScriptLoader void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { // Final heal only on duration end - if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL) return; // final heal GetTarget()->CastSpell(GetTarget(), _spellId, true, NULL, aurEff, GetCasterGUID()); } - void HandleDispel(DispelInfo* /*dispelInfo*/) - { - // final heal - if (Unit* target = GetUnitOwner()) - target->CastSpell(target, _spellId, true, NULL, GetEffect(EFFECT_0), GetCasterGUID()); - } - void Register() { AfterEffectRemove += AuraEffectRemoveFn(spell_gen_lifebloom_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL); - AfterDispel += AuraDispelFn(spell_gen_lifebloom_AuraScript::HandleDispel); } private: @@ -2887,8 +2874,7 @@ class spell_gen_summon_elemental : public SpellScriptLoader { if (GetCaster()) if (Unit* owner = GetCaster()->GetOwner()) - if (owner->GetTypeId() == TYPEID_PLAYER) // todo: this check is maybe wrong - owner->CastSpell(owner, _spellId, true); + owner->CastSpell(owner, _spellId, true); } void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) @@ -3010,14 +2996,11 @@ class spell_gen_mount : public SpellScriptLoader // Triggered spell id dependent on riding skill and zone bool canFly = false; - uint32 vmap = GetVirtualMapForMapAndZone(target->GetMapId(), target->GetZoneId()); - if (vmap == 530 || (vmap == 571 && target->HasSpell(SPELL_COLD_WEATHER_FLYING))) + uint32 map = target->GetMapId(); + if (map == 530 || (map == 571 && target->HasSpell(SPELL_COLD_WEATHER_FLYING))) canFly = true; - float x, y, z; - target->GetPosition(x, y, z); - uint32 areaFlag = target->GetBaseMap()->GetAreaFlag(x, y, z); - AreaTableEntry const* area = sAreaStore.LookupEntry(areaFlag); + AreaTableEntry const* area = sAreaStore.LookupEntry(target->GetAreaId()); if (!area || (canFly && (area->flags & AREA_FLAG_NO_FLY_ZONE))) canFly = false; diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index fe681032c1c..329e0d2e170 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -462,19 +462,10 @@ class spell_pal_lay_on_hands : public SpellScriptLoader { Unit* caster = GetCaster(); if (Unit* target = GetExplTargetUnit()) - { if (caster == target) - { - if (target->HasAura(SPELL_FORBEARANCE)) + if (target->HasAura(SPELL_FORBEARANCE) || target->HasAura(SPELL_AVENGING_WRATH_MARKER) || target->HasAura(SPELL_IMMUNE_SHIELD_MARKER)) return SPELL_FAILED_TARGET_AURASTATE; - if (target->HasAura(SPELL_AVENGING_WRATH_MARKER)) - return SPELL_FAILED_TARGET_AURASTATE; - - if (target->HasAura(SPELL_IMMUNE_SHIELD_MARKER)) - return SPELL_FAILED_TARGET_AURASTATE; - } - } return SPELL_CAST_OK; } diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index 6ed0f18c785..78bdbb7f127 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -1,4 +1,4 @@ -/* + /* * Copyright (C) 2008-2012 TrinityCore * * This program is free software; you can redistribute it and/or modify it @@ -102,7 +102,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader return true; } - void CalculateAmountCritSpell(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountCritSpell(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -121,7 +121,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader } } - void CalculateAmountCritMelee(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountCritMelee(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -140,7 +140,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader } } - void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -155,7 +155,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader } } - void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountSpellHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -170,7 +170,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader } } - void CalculateAmountExpertise(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountExpertise(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -237,7 +237,7 @@ public: return true; } - void CalculateStaminaAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateStaminaAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -249,7 +249,7 @@ public: } } - void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void ApplyEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) if (_tempBonus) @@ -281,7 +281,7 @@ public: } } - void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void RemoveEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -291,7 +291,7 @@ public: } } - void CalculateAttackPowerAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAttackPowerAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -310,16 +310,16 @@ public: // Glyph of felguard if (pet->GetEntry() == ENTRY_FELGUARD) { - if (AuraEffect* aurEffect = owner->GetAuraEffect(56246, EFFECT_0)) + if (AuraEffect* /* aurEff */ect = owner->GetAuraEffect(56246, EFFECT_0)) { float base_attPower = pet->GetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE) * pet->GetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_PCT); - amount += CalculatePctN(amount+base_attPower, aurEffect->GetAmount()); + amount += CalculatePctN(amount+base_attPower, /* aurEff */ect->GetAmount()); } } } } - void CalculateDamageDoneAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateDamageDoneAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -374,7 +374,7 @@ public: return true; } - void CalculateIntellectAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateIntellectAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -389,7 +389,7 @@ public: } } - void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void ApplyEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) if (_tempBonus) @@ -417,7 +417,7 @@ public: } } - void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void RemoveEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -427,7 +427,7 @@ public: } } - void CalculateArmorAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateArmorAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -439,7 +439,7 @@ public: } } - void CalculateFireResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateFireResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -486,7 +486,7 @@ public: return true; } - void CalculateFrostResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateFrostResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -498,7 +498,7 @@ public: } } - void CalculateArcaneResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateArcaneResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -510,7 +510,7 @@ public: } } - void CalculateNatureResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateNatureResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -553,7 +553,7 @@ public: return true; } - void CalculateShadowResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateShadowResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -593,7 +593,7 @@ public: return true; } - void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -608,7 +608,7 @@ public: } } - void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountSpellHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -623,7 +623,7 @@ public: } } - void CalculateAmountExpertise(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountExpertise(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -668,7 +668,7 @@ public: return true; } - void CalculateAmountCritSpell(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountCritSpell(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -690,7 +690,7 @@ public: } } - void CalculateAmountCritMelee(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountCritMelee(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -741,11 +741,11 @@ public: return true; } - void CalculateAmountDamageDone(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountDamageDone(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; - if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + if (GetCaster()->GetOwner()->ToPlayer()) { switch (GetCaster()->GetEntry()) { @@ -792,13 +792,13 @@ public: return true; } - void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) if (Unit* owner = pet->ToPet()->GetOwner()) - if (AuraEffect* aurEffect = owner->GetAuraEffect(SPELL_WARLOCK_GLYPH_OF_VOIDWALKER, EFFECT_0)) - amount += aurEffect->GetAmount(); + if (AuraEffect* /* aurEff */ect = owner->GetAuraEffect(SPELL_WARLOCK_GLYPH_OF_VOIDWALKER, EFFECT_0)) + amount += /* aurEff */ect->GetAmount(); } void Register() @@ -830,10 +830,8 @@ public: return true; } - void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { - if (!GetCaster() || !GetCaster()->GetOwner()) - return; if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { // For others recalculate it from: @@ -847,10 +845,8 @@ public: } } - void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountSpellHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { - if (!GetCaster() || !GetCaster()->GetOwner()) - return; if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { // For others recalculate it from: @@ -886,50 +882,45 @@ public: { PrepareAuraScript(spell_hun_pet_scaling_01_AuraScript); - void CalculateStaminaAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateStaminaAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) - { - if (!pet->isPet()) - return; + if (pet->isPet()) + if (Unit* owner = pet->ToPet()->GetOwner()) + { + float mod = 0.45f; + float ownerBonus = 0.0f; - Unit* owner = pet->ToPet()->GetOwner(); - if (!owner) - return; + PetSpellMap::const_iterator itr = (pet->ToPet()->m_spells.find(62758)); // Wild Hunt rank 1 + if (itr == pet->ToPet()->m_spells.end()) + itr = pet->ToPet()->m_spells.find(62762); // Wild Hunt rank 2 - float mod = 0.45f; - float ownerBonus = 0.0f; + if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt + { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value + AddPctN(mod, spellInfo->Effects[EFFECT_0].CalcValue()); + } - PetSpellMap::const_iterator itr = (pet->ToPet()->m_spells.find(62758)); // Wild Hunt rank 1 - if (itr == pet->ToPet()->m_spells.end()) - itr = pet->ToPet()->m_spells.find(62762); // Wild Hunt rank 2 + ownerBonus = owner->GetStat(STAT_STAMINA)*mod; - if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt - { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value - AddPctN(mod, spellInfo->Effects[EFFECT_0].CalcValue()); - } - - ownerBonus = owner->GetStat(STAT_STAMINA)*mod; - - amount += ownerBonus; - } + amount += ownerBonus; + } } - void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void ApplyEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) if (_tempHealth) pet->SetHealth(_tempHealth); } - void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void RemoveEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) _tempHealth = pet->GetHealth(); } - void CalculateAttackPowerAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAttackPowerAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -959,7 +950,7 @@ public: } } - void CalculateDamageDoneAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateDamageDoneAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1024,7 +1015,7 @@ public: return true; } - void CalculateFrostResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateFrostResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1043,7 +1034,7 @@ public: } } - void CalculateFireResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateFireResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1062,7 +1053,7 @@ public: } } - void CalculateNatureResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateNatureResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1111,7 +1102,7 @@ public: return true; } - void CalculateShadowResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateShadowResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1130,7 +1121,7 @@ public: } } - void CalculateArcaneResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateArcaneResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1149,7 +1140,7 @@ public: } } - void CalculateArmorAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateArmorAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1198,7 +1189,7 @@ public: return true; } - void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; @@ -1215,7 +1206,7 @@ public: } } - void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountSpellHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; @@ -1232,7 +1223,7 @@ public: } } - void CalculateAmountExpertise(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountExpertise(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; @@ -1279,11 +1270,11 @@ public: return true; } - void CalculateAmountCritSpell(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountCritSpell(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; - if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + if (GetCaster()->GetOwner()->ToPlayer()) { // For others recalculate it from: float CritSpell = 0.0f; @@ -1300,11 +1291,11 @@ public: } } - void CalculateAmountCritMelee(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountCritMelee(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; - if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + if (GetCaster()->GetOwner()->ToPlayer()) { // For others recalculate it from: float CritMelee = 0.0f; @@ -1350,11 +1341,11 @@ public: return true; } - void CalculateAmountDamageDone(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountDamageDone(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; - if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + if (GetCaster()->GetOwner()->ToPlayer()) { // Pet's base damage changes depending on happiness if (GetCaster()->isPet() && GetCaster()->ToPet()->isHunterPet()) @@ -1408,14 +1399,14 @@ public: return true; } - void CalculateAmountDamageDone(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountDamageDone(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { - if (AuraEffect* aurEffect = owner->GetAuraEffectOfRankedSpell(SPELL_HUNTER_ANIMAL_HANDLER, EFFECT_1)) - amount = aurEffect->GetAmount(); + if (AuraEffect* /* aurEff */ect = owner->GetAuraEffectOfRankedSpell(SPELL_HUNTER_ANIMAL_HANDLER, EFFECT_1)) + amount = /* aurEff */ect->GetAmount(); else amount = 0; } @@ -1450,18 +1441,19 @@ public: return true; } - void CalculateAvoidanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAvoidanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { if (Unit* owner = pet->GetOwner()) - + { // Army of the dead ghoul if (pet->GetEntry() == ENTRY_ARMY_OF_THE_DEAD_GHOUL) amount = -90; // Night of the dead else if ( Aura * aur = owner->GetAuraOfRankedSpell(SPELL_NIGHT_OF_THE_DEAD)) amount = aur->GetSpellInfo()->Effects[EFFECT_2].CalcValue(); + } } } @@ -1494,7 +1486,7 @@ public: return true; } - void CalculateStaminaAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateStaminaAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1520,20 +1512,20 @@ public: } } - void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void ApplyEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) if (_tempHealth) pet->SetHealth(_tempHealth); } - void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void RemoveEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) _tempHealth = pet->GetHealth(); } - void CalculateStrengthAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateStrengthAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1597,7 +1589,7 @@ public: return true; } - void CalculateAmountMeleeHaste(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHaste(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; @@ -1640,7 +1632,7 @@ public: return true; } - void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; @@ -1657,7 +1649,7 @@ public: } } - void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountSpellHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; @@ -1703,7 +1695,7 @@ public: return true; } - void CalculateDamageDoneAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateDamageDoneAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1718,7 +1710,7 @@ public: } } - void CalculateAmountMeleeHaste(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHaste(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index dbc3a91012b..6910bf47805 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -352,17 +352,13 @@ class spell_pri_vampiric_touch : public SpellScriptLoader void HandleDispel(DispelInfo* /*dispelInfo*/) { if (Unit* caster = GetCaster()) - { if (Unit* target = GetUnitOwner()) - { if (AuraEffect const* aurEff = GetEffect(EFFECT_1)) { int32 damage = aurEff->GetAmount() * 8; // backfire damage caster->CastCustomSpell(target, PRIEST_SPELL_VAMPIRIC_TOUCH_DISPEL, &damage, NULL, NULL, true, NULL, aurEff); } - } - } } void Register() diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index da15c5c5046..fce3d0415a6 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -35,7 +35,7 @@ enum ShamanSpells SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1 = 8349, SHAMAN_SPELL_SATED = 57724, SHAMAN_SPELL_EXHAUSTION = 57723, - + SHAMAN_SPELL_STORM_EARTH_AND_FIRE = 51483, EARTHBIND_TOTEM_SPELL_EARTHGRAB = 64695, @@ -261,7 +261,7 @@ class EarthenPowerTargetSelector { public: EarthenPowerTargetSelector() { } - + bool operator() (Unit* target) { if (!target->HasAuraWithMechanic(1 << MECHANIC_SNARE)) @@ -679,9 +679,8 @@ class spell_sha_flame_shock : public SpellScriptLoader void HandleDispel(DispelInfo* /*dispelInfo*/) { if (Unit* caster = GetCaster()) - { // Lava Flows - if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, ICON_ID_SHAMAN_LAVA_FLOW, 0)) + if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, ICON_ID_SHAMAN_LAVA_FLOW, EFFECT_0)) { if (sSpellMgr->GetFirstSpellInChain(SHAMAN_LAVA_FLOWS_R1) != sSpellMgr->GetFirstSpellInChain(aurEff->GetId())) return; @@ -689,7 +688,6 @@ class spell_sha_flame_shock : public SpellScriptLoader uint8 rank = sSpellMgr->GetSpellRank(aurEff->GetId()); caster->CastSpell(caster, sSpellMgr->GetSpellWithRank(SHAMAN_LAVA_FLOWS_TRIGGERED_R1, rank), true); } - } } void Register() @@ -723,11 +721,9 @@ class spell_sha_sentry_totem : public SpellScriptLoader void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (Unit* caster = GetCaster()) - { if (Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[4])) if (totem->isTotem()) caster->CastSpell(totem, SHAMAN_BIND_SIGHT, true); - } } void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 1b24a9ec09f..5f6bbe758f4 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -37,6 +37,7 @@ enum WarlockSpells WARLOCK_DEMONIC_CIRCLE_SUMMON = 48018, WARLOCK_DEMONIC_CIRCLE_TELEPORT = 48020, WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388, + WARLOCK_HAUNT = 48181, WARLOCK_HAUNT_HEAL = 48210, WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117, }; @@ -534,16 +535,15 @@ class spell_warl_haunt : public SpellScriptLoader { PrepareSpellScript(spell_warl_haunt_SpellScript); - void HandleOnHit() + void HandleEffectHit(SpellEffIndex /*effIndex*/) { - if (Aura* aura = GetHitAura()) - if (AuraEffect* aurEff = aura->GetEffect(EFFECT_1)) - aurEff->SetAmount(CalculatePctN(aurEff->GetAmount(), GetHitDamage())); + if (AuraEffect* aurEff = GetExplTargetUnit()->GetAuraEffectOfRankedSpell(WARLOCK_HAUNT,EFFECT_1)) + aurEff->SetAmount(CalculatePctN(aurEff->GetAmount(), GetHitDamage())); } void Register() { - OnHit += SpellHitFn(spell_warl_haunt_SpellScript::HandleOnHit); + OnEffectHitTarget += SpellEffectFn(spell_warl_haunt_SpellScript::HandleEffectHit, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); } }; @@ -560,6 +560,9 @@ class spell_warl_haunt : public SpellScriptLoader void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) + return; + if (Unit* caster = GetCaster()) { int32 amount = aurEff->GetAmount(); @@ -603,14 +606,12 @@ class spell_warl_unstable_affliction : public SpellScriptLoader void HandleDispel(DispelInfo* dispelInfo) { if (Unit* caster = GetCaster()) - { if (AuraEffect const* aurEff = GetEffect(EFFECT_0)) { int32 damage = aurEff->GetAmount() * 9; // backfire damage and silence caster->CastCustomSpell(dispelInfo->GetDispeller(), WARLOCK_UNSTABLE_AFFLICTION_DISPEL, &damage, NULL, NULL, true, NULL, aurEff); } - } } void Register() From 38ac9b38fce779bbd141f8651e9689e3385b70e7 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 15 Jun 2012 13:07:48 -0400 Subject: [PATCH 1039/1149] DB/Spells: added spell script name that was missed. --- sql/updates/world/2012_06_15_00_world_spell_script_names.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2012_06_15_00_world_spell_script_names.sql diff --git a/sql/updates/world/2012_06_15_00_world_spell_script_names.sql b/sql/updates/world/2012_06_15_00_world_spell_script_names.sql new file mode 100644 index 00000000000..040ad3c87ba --- /dev/null +++ b/sql/updates/world/2012_06_15_00_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` = 27819; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(27819, 'spell_kelthuzad_detonate_mana'); From 2ff2387aa529df746d32910784a307c260ac9303 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 15 Jun 2012 14:07:10 -0400 Subject: [PATCH 1040/1149] Core/Spells: revert some of previous commit and fix up a few things. --- src/server/scripts/Spells/spell_druid.cpp | 34 +++++++++++++++++++-- src/server/scripts/Spells/spell_warlock.cpp | 9 +++--- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index b817036a9e4..4c8a9db1571 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -397,8 +397,8 @@ class spell_dru_lifebloom : public SpellScriptLoader void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { - // Final heal only on duration end and dispel - if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL) + // Final heal only on duration end + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) return; // final heal @@ -409,16 +409,46 @@ class spell_dru_lifebloom : public SpellScriptLoader healAmount = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), healAmount, HEAL, stack); healAmount = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, stack); + GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); + // restore mana int32 returnMana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * stack / 2; caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); + return; } + GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); } + void HandleDispel(DispelInfo* dispelInfo) + { + if (Unit* target = GetUnitOwner()) + { + if (AuraEffect const* aurEff = GetEffect(EFFECT_1)) + { + // final heal + int32 healAmount = aurEff->GetAmount(); + if (Unit* caster = GetCaster()) + { + healAmount = caster->SpellHealingBonusDone(target, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges()); + healAmount = target->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges()); + target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID()); + + // restore mana + int32 returnMana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * dispelInfo->GetRemovedCharges() / 2; + caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID()); + return; + } + + target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID()); + } + } + } + void Register() { AfterEffectRemove += AuraEffectRemoveFn(spell_dru_lifebloom_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + AfterDispel += AuraDispelFn(spell_dru_lifebloom_AuraScript::HandleDispel); } }; diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 5f6bbe758f4..75953283113 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -535,15 +535,16 @@ class spell_warl_haunt : public SpellScriptLoader { PrepareSpellScript(spell_warl_haunt_SpellScript); - void HandleEffectHit(SpellEffIndex /*effIndex*/) + void HandleEffectHit() { - if (AuraEffect* aurEff = GetExplTargetUnit()->GetAuraEffectOfRankedSpell(WARLOCK_HAUNT,EFFECT_1)) - aurEff->SetAmount(CalculatePctN(aurEff->GetAmount(), GetHitDamage())); + if (Aura* aura = GetHitAura()) + if (AuraEffect* aurEff = aura->GetEffect(EFFECT_1)) + aurEff->SetAmount(CalculatePctN(aurEff->GetAmount(), GetHitDamage())); } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_warl_haunt_SpellScript::HandleEffectHit, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + OnHit += SpellHitFn(spell_warl_haunt_SpellScript::HandleOnHit); } }; From 521bf5f64ed03585ac427f1056af63c4f92de38b Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 15 Jun 2012 14:19:42 -0400 Subject: [PATCH 1041/1149] Core/Spells: fix build error from previous commit. --- src/server/scripts/Spells/spell_warlock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 75953283113..e20eb07d45a 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -535,7 +535,7 @@ class spell_warl_haunt : public SpellScriptLoader { PrepareSpellScript(spell_warl_haunt_SpellScript); - void HandleEffectHit() + void HandleOnHit() { if (Aura* aura = GetHitAura()) if (AuraEffect* aurEff = aura->GetEffect(EFFECT_1)) From c430b45dc273bb4af95195377c0de4f612408c2b Mon Sep 17 00:00:00 2001 From: Malcrom Date: Fri, 15 Jun 2012 18:18:02 -0230 Subject: [PATCH 1042/1149] DB/SAI: Fix up quest 9544 "The Prophecy of Akida" --- sql/updates/world/2012_06_15_01_world_sai.sql | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sql/updates/world/2012_06_15_01_world_sai.sql diff --git a/sql/updates/world/2012_06_15_01_world_sai.sql b/sql/updates/world/2012_06_15_01_world_sai.sql new file mode 100644 index 00000000000..501c3aa1c40 --- /dev/null +++ b/sql/updates/world/2012_06_15_01_world_sai.sql @@ -0,0 +1,32 @@ +-- Fix up quest 9544 "The Prophecy of Akida" +-- Totem of Vark SAI +SET @ENTRY := 17364; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +UPDATE `creature_template_addon` SET `bytes2`=1,`auras`='18950' WHERE `entry`=17364; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,19,0,100,0,9544,0,0,0,85,30453,0,0,0,0,0,7,0,0,0,0,0,0,0,'Totem of Vark - Quest accepted - Cast Spell on player'); +-- Stillpine Ancestor Vark SAI +SET @ENTRY := 17410; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY*100) AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,54,0,100,0,0,1,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Vark - Just Summoned - Run Script'), +-- Script +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,3,0,17109,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Vark - Script - set model'), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,11,25035,0,0,0,0,0,1,0,0,0,0,0,0,0.01745319,'Stillpine Ancestor Vark - Script - Cast Spell'), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Vark - Script - Set run on'), +(@ENTRY*100,9,3,0,0,0,100,0,2000,2000,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Stillpine Ancestor Vark - Script - turn to player'), +(@ENTRY*100,9,4,0,0,0,100,0,2000,2000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Vark - Script - say 0'), +(@ENTRY*100,9,5,0,0,0,100,0,8000,8000,0,0,11,30428,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Vark - Script - cast spell'), +(@ENTRY*100,9,6,0,0,0,100,0,3000,3000,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Vark - Script - despawn'); +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry`=17410; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(17410,0,0, '[Furbolg] Bear witness to the savage acts of our adversaries, $N. They steal our young... our weak... Imprisoned here, they are left to the devices of the Bristlelimb. Set them free, Promised One!',12,0,100,0,0,0, 'Stillpine Ancestor Vark'); +-- add missing spells to db +DELETE FROM `spell_dbc` WHERE `Id` IN (30453,30454); +INSERT INTO `spell_dbc` (`Id`,`SchoolMask`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`Comment`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`AreaGroupId`,`EffectMiscValueB1`) VALUES +(30454,0,0,0,256,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,40,12,0,-1,0,0,28,6,0,0,0,0,0,0,0,0,0,0,0,0,0,32,1,0,0,0,0,7,0,0,0,4,0,0,0,0,0,0,0,17410,0,0,0,0,0,'Stillpine Ancestor Vark',0,0,0,0,0,0,0,1,1,0,64), +(30453,0,0,0,2304,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,36,3,0,-1,0,0,6,0,0,1,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,23,0,0,1000,0,0,0,0,0,0,0,0,30454,0,0,'Stillpine Ancestor Vark TRIGGER',0,0,0,0,0,0,0,1,0,0,0); From 47b2df83103dedefeed5a5c7d127b22b9d497eb0 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Fri, 15 Jun 2012 23:42:50 -0230 Subject: [PATCH 1043/1149] DB/SAI: Fix up quest 9312 "The Emitter" --- sql/updates/world/2012_06_15_02_world_sai.sql | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 sql/updates/world/2012_06_15_02_world_sai.sql diff --git a/sql/updates/world/2012_06_15_02_world_sai.sql b/sql/updates/world/2012_06_15_02_world_sai.sql new file mode 100644 index 00000000000..f813ae2996b --- /dev/null +++ b/sql/updates/world/2012_06_15_02_world_sai.sql @@ -0,0 +1,44 @@ +-- Fix up quest 9312 "The Emitter" +-- Technician Zhanaa SAI +SET @ENTRY := 17071; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY*100 AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,20,0,100,0,9312,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Technician Zhanaa - Quest Completed - Run Script'), +-- Script +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,83,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Technician Zhanaa - Script - Remove npc flags'), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,9,0,0,0,0,0,0,20,181286,0,0,0,0,0,0,'Technician Zhanaa - Script - Activate go'), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,12,16550,1,39000,0,0,0,8,0,0,0,-4187.708,-13738.72,75.65491,1.850049,'Technician Zhanaa - Script - Spawn '), +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,64,2,0,0,0,0,0,7,0,0,0,0,0,0,0,'Technician Zhanaa - Script - store invoker'), -- Send target +(@ENTRY*100,9,4,0,0,0,100,0,1000,1000,0,0,100,2,0,0,0,0,0,19,16550,10,0,0,0,0,0,'Technician Zhanaa - Script - send target'), -- Send target +(@ENTRY*100,9,5,0,0,0,100,0,1000,1000,0,0,45,0,1,0,0,0,0,19,16550,10,0,0,0,0,0,'Technician Zhanaa - Script - set data'), +(@ENTRY*100,9,6,0,0,0,100,0,1000,1000,0,0,66,0,0,0,0,0,0,19,16550,10,0,0,0,0,0,'Technician Zhanaa - Script - turn to Image of Technician Dyvuun'), +(@ENTRY*100,9,7,0,0,0,100,0,2000,2000,0,0,5,70,0,0,0,0,0,1,0,0,0,0,0,0,0,'Technician Zhanaa - Script - emote'), +(@ENTRY*100,9,8,0,0,0,100,0,39000,39000,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Technician Zhanaa - Script - turn to invoker'), +(@ENTRY*100,9,9,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Technician Zhanaa - Script - Say 0'), +(@ENTRY*100,9,10,0,0,0,100,0,6000,6000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,1.919862,'Technician Zhanaa - Script - turn to'), +(@ENTRY*100,9,11,0,0,0,100,0,1000,1000,0,0,81,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Technician Zhanaa - Script - add npc flags'); +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0, 'This is great news! Your efforts have indeed saved us, $N!',12,0,100,0,0,0, 'Technician Zhanaa'); +-- Image of Technician Dyvuun SAI +SET @ENTRY := 16550; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='',`InhabitType`=4 WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY*100 AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,38,0,100,0,0,1,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Image of Technician Dyvuun - On data set - Run Script'), +-- Script +(@ENTRY*100,9,0,0,0,0,100,0,2000,2000,0,0,66,0,0,0,0,0,0,19,17071,10,0,0,0,0,0,'Image of Technician Dyvuun - Script - turn to Technician Zhanaa'), +(@ENTRY*100,9,1,0,0,0,100,0,2000,2000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Image of Technician Dyvuun - Script - Say 0'), +(@ENTRY*100,9,2,0,0,0,100,0,10000,10000,0,0,66,0,0,0,0,0,0,12,2,0,0,0,0,0,0,'Image of Technician Dyvuun - Script - turn to Stored target'), -- use target +(@ENTRY*100,9,3,0,0,0,100,0,4000,4000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Image of Technician Dyvuun - Script - Say 1'), +(@ENTRY*100,9,4,0,0,0,100,0,5000,5000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Image of Technician Dyvuun - Script - Say 2'); +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0, 'By the seven Ata''mal crystals! Others have survived the crash! Zhanaa, is that you? It is so good to see you again!',12,0,100,0,0,0, 'Image of Technician Dyvuun'), +(@ENTRY,1,0, 'And who do we have here? No doubt th... crzzzk ...ade this communication possible? I give you greetings fro... psshzzzk... Azure Watch.',12,0,100,0,0,0, 'Image of Technician Dyvuun'), +(@ENTRY,2,0, 'Judging by your signal, we put you... ust southeast of the larger part of the island we crashed onto. Cross the Crystalbrook River to ge... kshhhhk zzzt. Sorry, there''s a lot of stat...',12,0,100,0,0,0, 'Image of Technician Dyvuun'); From 89af15fed50d1de0cea2d20952192812166ca08c Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 16 Jun 2012 10:26:24 -0230 Subject: [PATCH 1044/1149] DB/SAI: Fix up quest 9541 "Totem of Yor" --- sql/updates/world/2012_06_16_00_world_sai.sql | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 sql/updates/world/2012_06_16_00_world_sai.sql diff --git a/sql/updates/world/2012_06_16_00_world_sai.sql b/sql/updates/world/2012_06_16_00_world_sai.sql new file mode 100644 index 00000000000..a714e498bc9 --- /dev/null +++ b/sql/updates/world/2012_06_16_00_world_sai.sql @@ -0,0 +1,46 @@ +-- Fix up quest 9541 "Totem of Yor" +-- Totem of Tikti SAI +SET @ENTRY := 17362; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,19,0,100,0,9541,0,0,0,85,30443,0,0,0,0,0,7,0,0,0,0,0,0,0,'Totem of Tikti - Quest accepted - Cast Spell on player'); +-- Stillpine Ancestor Tikti SAI +SET @ENTRY := 17392; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY*100) AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,54,0,100,0,0,1,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Just Summoned - Run Script'), +-- Script +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,3,0,16999,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - set model'), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - turn to player'), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,11,25035,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - Cast Spell'), +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - Set run on'), +(@ENTRY*100,9,4,0,0,0,100,0,2000,2000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - say 0'), +(@ENTRY*100,9,5,0,0,0,100,0,0,0,0,0,69,0,0,0,0,0,0,8,0,0,0,-3885.665,-13096.55,3.563835,0,'Stillpine Ancestor Tikti - Script - move to'), +(@ENTRY*100,9,6,0,0,0,100,0,16000,16000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - say 1'), +(@ENTRY*100,9,7,0,0,0,100,0,6000,6000,0,0,11,30430,2,0,0,0,0,7,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - Cast Spell on player'), +(@ENTRY*100,9,8,0,0,0,100,0,2000,2000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - say 2'), +(@ENTRY*100,9,9,0,0,0,100,0,1000,1000,0,0,11,30431,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - Cast Spell'), +(@ENTRY*100,9,10,0,0,0,100,0,0,0,0,0,3,0,17000,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - set model'), +(@ENTRY*100,9,11,0,0,0,100,0,3000,3000,0,0,69,0,0,0,0,0,0,8,0,0,0,-3939.131,-13024.07,-5.92465,0,'Stillpine Ancestor Tikti - Script - move to'), +(@ENTRY*100,9,12,0,0,0,100,0,25000,25000,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Tikti - Script - despawn'); +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry`=17392; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(17392,0,0, '%s asks you to follow him.',16,0,100,0,0,0, 'Stillpine Ancestor Tikti'), +(17392,1,0, '[Furbolg] Far you mixik tak come. Gaze upon the kitch''kal river. Follow. Ilog to Yor.',12,0,100,0,0,0, 'Stillpine Ancestor Tikti'), +(17392,2,0, '[Furbolg] Go... Search yitix''kil bottom river. South!',12,0,100,0,0,0, 'Stillpine Ancestor Tikti'); +-- add missing spells to db +DELETE FROM `spell_dbc` WHERE `Id` IN (30432,30443); +INSERT INTO `spell_dbc` (`Id`,`SchoolMask`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`Comment`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`AreaGroupId`,`EffectMiscValueB1`) VALUES +(30432,0,0,0,256,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,40,12,0,-1,0,0,28,6,0,0,0,0,0,0,0,0,0,0,0,0,0,32,1,0,0,0,0,7,0,0,0,4,0,0,0,0,0,0,0,17392,0,0,0,0,0,'Stillpine Ancestor Tikti',0,0,0,0,0,0,0,1,1,0,64), +(30443,0,0,0,2304,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,36,3,0,-1,0,0,6,0,0,1,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,23,0,0,1000,0,0,0,0,0,0,0,0,30432,0,0,'Stillpine Ancestor Tikti TRIGGER',0,0,0,0,0,0,0,1,0,0,0); +-- Delete bad spawn of Stillpine Ancestor Tikti +DELETE FROM `creature` WHERE `guid`=86513; +DELETE FROM `creature_addon` WHERE `guid`=86513; +-- Remove Stillpine Ancestor Tikti EAI +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=17392; +-- Remove Hack from quest_template +UPDATE `quest_template` SET `SourceSpellId`=0 WHERE `Id`=9541; From 1c8211e85222ca85e46079bfa809192e68c30fda Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 16 Jun 2012 14:41:08 -0230 Subject: [PATCH 1045/1149] Db/creature: Add missing Storm Totem spawn to Borean Tundra --- sql/updates/world/2012_06_16_01_world_creature.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sql/updates/world/2012_06_16_01_world_creature.sql diff --git a/sql/updates/world/2012_06_16_01_world_creature.sql b/sql/updates/world/2012_06_16_01_world_creature.sql new file mode 100644 index 00000000000..d44b568f79b --- /dev/null +++ b/sql/updates/world/2012_06_16_01_world_creature.sql @@ -0,0 +1,6 @@ +-- Add missing Storm Totem spawn to Borean Tundra +SET @GUID := 12925; +DELETE FROM `creature` WHERE `guid`=@GUID; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@GUID,26048,571,1,1,0,0,3409.903,4128.829,18.13754,5.742133,300,0,0,1,0,0); +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|16777216 WHERE `entry`=26048; From 3164ba627b3405ac201539f975bb3a57333a5070 Mon Sep 17 00:00:00 2001 From: Elron103 Date: Sat, 16 Jun 2012 20:21:57 +0200 Subject: [PATCH 1046/1149] Core/Combat: Fix CanAIAttack implementation --- src/server/game/Combat/ThreatManager.cpp | 4 +++- src/server/game/Entities/Unit/Unit.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index 9737d4584ea..0c43c9ece0e 100755 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -354,7 +354,9 @@ HostileReference* ThreatContainer::selectNextVictim(Creature* attacker, HostileR // list sorted and and we check current target, then this is best case if (currentVictim == currentRef || currentRef->getThreat() <= 1.1f * currentVictim->getThreat()) { - currentRef = currentVictim; // for second case + if (currentVictim != currentRef && attacker->canCreatureAttack(currentVictim->getTarget())) + currentRef = currentVictim; // for second case, if currentvictim is attackable + found = true; break; } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 82cdb73a5ba..2646eae5351 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12958,7 +12958,7 @@ Unit* Creature::SelectVictim() else return NULL; - if (target && _IsTargetAcceptable(target)) + if (target && _IsTargetAcceptable(target) && canCreatureAttack(target)) { SetInFront(target); return target; @@ -12984,7 +12984,7 @@ Unit* Creature::SelectVictim() { target = SelectNearestTargetInAttackDistance(m_CombatDistance ? m_CombatDistance : ATTACK_DISTANCE); - if (target && _IsTargetAcceptable(target)) + if (target && _IsTargetAcceptable(target) && canCreatureAttack(target)) return target; } From f0d14c372c34e23a908b581fa90c058b32f81e06 Mon Sep 17 00:00:00 2001 From: Elron103 Date: Sun, 17 Jun 2012 00:50:21 +0200 Subject: [PATCH 1047/1149] Core/Entities: Fix possible variable overflows in health calculation functions --- src/server/game/Entities/Unit/Unit.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 9b63de0cdb8..98088f9ef6a 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1337,10 +1337,10 @@ class Unit : public WorldObject uint32 GetMaxHealth() const { return GetUInt32Value(UNIT_FIELD_MAXHEALTH); } bool IsFullHealth() const { return GetHealth() == GetMaxHealth(); } - bool HealthBelowPct(int32 pct) const { return GetHealth() * uint64(100) < GetMaxHealth() * uint64(pct); } - bool HealthBelowPctDamaged(int32 pct, uint32 damage) const { return (int32(GetHealth()) - damage) * int64(100) < GetMaxHealth() * int64(pct); } - bool HealthAbovePct(int32 pct) const { return GetHealth() * uint64(100) > GetMaxHealth() * uint64(pct); } - bool HealthAbovePctHealed(int32 pct, uint32 heal) const { return (GetHealth() + heal) * uint64(100) > GetMaxHealth() * uint64(pct); } + bool HealthBelowPct(int32 pct) const { return GetHealth() < CountPctFromMaxHealth(pct); } + bool HealthBelowPctDamaged(int32 pct, uint32 damage) const { return int64(GetHealth()) - int64(damage) < int64(CountPctFromMaxHealth(pct)); } + bool HealthAbovePct(int32 pct) const { return GetHealth() > CountPctFromMaxHealth(pct); } + bool HealthAbovePctHealed(int32 pct, uint32 heal) const { return uint64(GetHealth()) + uint64(heal) > CountPctFromMaxHealth(pct); } float GetHealthPct() const { return GetMaxHealth() ? 100.f * GetHealth() / GetMaxHealth() : 0.0f; } uint32 CountPctFromMaxHealth(int32 pct) const { return CalculatePctN(GetMaxHealth(), pct); } uint32 CountPctFromCurHealth(int32 pct) const { return CalculatePctN(GetHealth(), pct); } From 3f8efb21cd46dcc0391c84916be6d8f9920aee23 Mon Sep 17 00:00:00 2001 From: "dr.skull" Date: Sun, 17 Jun 2012 02:21:40 +0200 Subject: [PATCH 1048/1149] add IsEffect() check to correct IsImmunedToSpell Signed-off-by: dr.skull --- src/server/game/Entities/Creature/Creature.cpp | 6 +++++- src/server/game/Entities/Unit/Unit.cpp | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 07e8e37e82a..6857abde2bd 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1675,12 +1675,16 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo) // This check must be done instead of 'if (GetCreatureTemplate()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))' for not break // the check of mechanic immunity on DB (tested) because GetCreatureTemplate()->MechanicImmuneMask and m_spellImmune[IMMUNITY_MECHANIC] don't have same data. bool immunedToAllEffects = true; - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + if(!spellInfo->Effects[i].IsEffect()) + break; if (!IsImmunedToSpellEffect(spellInfo, i)) { immunedToAllEffects = false; break; } + } if (immunedToAllEffects) return true; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index daa8c1e05de..0915f9ea3e9 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11534,10 +11534,12 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) } bool immuneToAllEffects = true; - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) { // State/effect immunities applied by aura expect full spell immunity // Ignore effects with mechanic, they are supposed to be checked separately + if(!spellInfo->Effects[i].IsEffect()) + break; if (!IsImmunedToSpellEffect(spellInfo, i)) { immuneToAllEffects = false; From 99888e1a3ee8a0d69fe956e79257466a6ea8e446 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 17 Jun 2012 10:41:21 -0230 Subject: [PATCH 1049/1149] DB/creature: Fix Storm Totem flags --- sql/updates/world/2012_06_17_00_world_creature.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2012_06_17_00_world_creature.sql diff --git a/sql/updates/world/2012_06_17_00_world_creature.sql b/sql/updates/world/2012_06_17_00_world_creature.sql new file mode 100644 index 00000000000..53e101c5d60 --- /dev/null +++ b/sql/updates/world/2012_06_17_00_world_creature.sql @@ -0,0 +1,3 @@ +-- Fix Storm Totem flags +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216 WHERE `entry`=26048; +UPDATE `creature_template` SET `flags_extra`=`flags_extra`&~16777216 WHERE `entry`=26048; From 3fb93ce659e6c65fddbc5c93e7297012003f503d Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 17 Jun 2012 11:03:07 -0230 Subject: [PATCH 1050/1149] DB/creature: Add aura missing aura to Nerub'ar Scarab --- sql/updates/world/2012_06_17_01_world_creature.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2012_06_17_01_world_creature.sql diff --git a/sql/updates/world/2012_06_17_01_world_creature.sql b/sql/updates/world/2012_06_17_01_world_creature.sql new file mode 100644 index 00000000000..c5d50fdde1e --- /dev/null +++ b/sql/updates/world/2012_06_17_01_world_creature.sql @@ -0,0 +1,4 @@ +-- Add aura missing aura to Nerub'ar Scarab +DELETE FROM `creature_addon` WHERE `guid` IN (SELECT `guid` FROM creature WHERE id=25652); +DELETE FROM `creature_template_addon` WHERE `entry`=25652; +INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES (25652,1,'45814'); From 5bcfd8303138226af83c6182d830a53b9ce9ba6e Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 17 Jun 2012 11:48:53 -0230 Subject: [PATCH 1051/1149] DB/creature: Add missing Gan'jo spawn to Grizzly Hills --- sql/updates/world/2012_06_17_02_world_creature.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sql/updates/world/2012_06_17_02_world_creature.sql diff --git a/sql/updates/world/2012_06_17_02_world_creature.sql b/sql/updates/world/2012_06_17_02_world_creature.sql new file mode 100644 index 00000000000..a309ada3498 --- /dev/null +++ b/sql/updates/world/2012_06_17_02_world_creature.sql @@ -0,0 +1,9 @@ +-- Add missing Gan'jo spawn to Grizzly Hills +SET @GUID := 42187; +SET @ENTRY := 26924; +DELETE FROM `creature` WHERE `guid`=@GUID; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@GUID,@ENTRY,571,1,2,0,0,4834.98,-4754.5,32.5689,3.97935,180,0,0,1,0,0); +-- Add Aura to Gan'jo +DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY; +INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES (@ENTRY,1,'17327'); From 8c16cc2260a6819083153d7b4ca707c0ba315caa Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 17 Jun 2012 21:50:01 +0100 Subject: [PATCH 1052/1149] Core/SAI: Implement SMART_EVENT_ACTION_DONE (72, DoAction) Param1 is event id This event is triggered on spellclick (id=1001), fall on ground (id=1002) and charge (id=1003) Signed-off-by: Nay --- src/server/game/AI/SmartScripts/SmartAI.cpp | 25 +-- .../game/AI/SmartScripts/SmartScript.cpp | 6 + .../game/AI/SmartScripts/SmartScriptMgr.cpp | 75 +++++---- .../game/AI/SmartScripts/SmartScriptMgr.h | 154 +++++++++--------- 4 files changed, 132 insertions(+), 128 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 98b5c0a6ba3..f8658dd8689 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -696,8 +696,9 @@ void SmartAI::OnCharmed(bool apply) GetScript()->ProcessEventsFor(SMART_EVENT_CHARMED, NULL, 0, 0, apply); } -void SmartAI::DoAction(const int32 /*param*/) +void SmartAI::DoAction(const int32 param) { + GetScript()->ProcessEventsFor(SMART_EVENT_ACTION_DONE, NULL, param); } uint32 SmartAI::GetData(uint32 /*id*/) @@ -825,28 +826,6 @@ void SmartAI::sOnGameEvent(bool start, uint16 eventId) GetScript()->ProcessEventsFor(start ? SMART_EVENT_GAME_EVENT_START : SMART_EVENT_GAME_EVENT_END, NULL, eventId); } -/* -SMART_EVENT_UPDATE_OOC -SMART_EVENT_SPELLHIT -SMART_EVENT_RANGE -SMART_EVENT_RESPAWN -SMART_EVENT_SUMMONED_UNIT -SMART_EVENT_ACCEPTED_QUEST -SMART_EVENT_REWARD_QUEST -SMART_EVENT_TARGET_BUFFED -SMART_EVENT_SUMMON_DESPAWNED -SMART_EVENT_AI_INIT -SMART_EVENT_DATA_SET -SMART_EVENT_TEXT_OVER -SMART_EVENT_TIMED_EVENT_TRIGGERED -SMART_EVENT_UPDATE -SMART_EVENT_LINK -SMART_EVENT_GOSSIP_SELECT -SMART_EVENT_JUST_CREATED -SMART_EVENT_GOSSIP_HELLO -SMART_EVENT_DEATH -*/ - int SmartGameObjectAI::Permissible(const GameObject* g) { if (g->GetAIName() == "SmartGameObjectAI") diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 1b414029366..f564bce1e25 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -2778,6 +2778,12 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui ProcessAction(e, NULL, var0); break; } + case SMART_EVENT_ACTION_DONE: + { + if (e.event.doAction.eventId != var0) + return; + ProcessAction(e, unit, var0); + } default: sLog->outErrorDb("SmartScript::ProcessEvent: Unhandled Event type %u", e.GetEventType()); break; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index bf84f39747a..b01aaf5434c 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -475,63 +475,76 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) break; } case SMART_EVENT_TRANSPORT_ADDCREATURE: - { - if (e.event.transportAddCreature.creature && !IsCreatureValid(e, e.event.transportAddCreature.creature)) - return false; - break; - } + { + if (e.event.transportAddCreature.creature && !IsCreatureValid(e, e.event.transportAddCreature.creature)) + return false; + break; + } case SMART_EVENT_MOVEMENTINFORM: + { + if (e.event.movementInform.type > NULL_MOTION_TYPE) { - if (e.event.movementInform.type > NULL_MOTION_TYPE) - { - sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Motion type %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.movementInform.type); - return false; - } - break; + sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Motion type %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.movementInform.type); + return false; } + break; + } case SMART_EVENT_DATA_SET: - { - if (!IsMinMaxValid(e, e.event.dataSet.cooldownMin, e.event.dataSet.cooldownMax)) - return false; - break; - } + { + if (!IsMinMaxValid(e, e.event.dataSet.cooldownMin, e.event.dataSet.cooldownMax)) + return false; + break; + } case SMART_EVENT_AREATRIGGER_ONTRIGGER: - { - if (e.event.areatrigger.id && !IsAreaTriggerValid(e, e.event.areatrigger.id)) - return false; - break; - } + { + if (e.event.areatrigger.id && !IsAreaTriggerValid(e, e.event.areatrigger.id)) + return false; + break; + } case SMART_EVENT_TEXT_OVER: //if (e.event.textOver.textGroupID && !IsTextValid(e, e.event.textOver.textGroupID)) return false;// 0 is a valid text group! break; case SMART_EVENT_LINK: + { + if (e.link && e.link == e.event_id) { - if (e.link && e.link == e.event_id) - { - sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u, Event %u, Link Event is linking self (infinite loop), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id); - return false; - } - break; + sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u, Event %u, Link Event is linking self (infinite loop), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id); + return false; } + break; + } case SMART_EVENT_DUMMY_EFFECT: + { if (!IsSpellValid(e, e.event.dummy.spell)) return false; if (e.event.dummy.effIndex > EFFECT_2) return false; break; + } case SMART_EVENT_IS_BEHIND_TARGET: + { if (!IsMinMaxValid(e, e.event.behindTarget.cooldownMin, e.event.behindTarget.cooldownMax)) return false; break; + } case SMART_EVENT_GAME_EVENT_START: case SMART_EVENT_GAME_EVENT_END: + { + GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap(); + if (e.event.gameEvent.gameEventId >= events.size() || !events[e.event.gameEvent.gameEventId].isValid()) + return false; + break; + } + case SMART_EVENT_ACTION_DONE: + { + if (e.event.doAction.eventId < EventId::EVENT_SPELLCLICK || e.event.doAction.eventId > EventId::EVENT_CHARGE) { - GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap(); - if (e.event.gameEvent.gameEventId >= events.size() || !events[e.event.gameEvent.gameEventId].isValid()) - return false; - break; + sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid event id %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.doAction.eventId); + return false; } + break; + } case SMART_EVENT_GO_STATE_CHANGED: case SMART_EVENT_GO_EVENT_INFORM: case SMART_EVENT_TIMED_EVENT_TRIGGERED: diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index b82d0724f53..2291c21bf71 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -82,81 +82,81 @@ const uint32 SmartPhaseMask[SMART_EVENT_PHASE_COUNT][2] = enum SMART_EVENT { - SMART_EVENT_UPDATE_IC = 0, //1 // InitialMin, InitialMax, RepeatMin, RepeatMax - SMART_EVENT_UPDATE_OOC = 1, //1 // InitialMin, InitialMax, RepeatMin, RepeatMax - SMART_EVENT_HEALT_PCT = 2, //1 // HPMin%, HPMax%, RepeatMin, RepeatMax - SMART_EVENT_MANA_PCT = 3, //1 // ManaMin%, ManaMax%, RepeatMin, RepeatMax - SMART_EVENT_AGGRO = 4, //1 // NONE - SMART_EVENT_KILL = 5, //1 // CooldownMin0, CooldownMax1, playerOnly2, else creature entry3 - SMART_EVENT_DEATH = 6, //1 // NONE - SMART_EVENT_EVADE = 7, //1 // NONE - SMART_EVENT_SPELLHIT = 8, //1 // SpellID, School, CooldownMin, CooldownMax - SMART_EVENT_RANGE = 9, //1 // MinDist, MaxDist, RepeatMin, RepeatMax - SMART_EVENT_OOC_LOS = 10, //1 // NoHostile, MaxRnage, CooldownMin, CooldownMax - SMART_EVENT_RESPAWN = 11, //1 // type, MapId, ZoneId - SMART_EVENT_TARGET_HEALTH_PCT = 12, //1 // HPMin%, HPMax%, RepeatMin, RepeatMax - SMART_EVENT_TARGET_CASTING = 13, //1 // RepeatMin, RepeatMax - SMART_EVENT_FRIENDLY_HEALTH = 14, //1 // HPDeficit, Radius, RepeatMin, RepeatMax - SMART_EVENT_FRIENDLY_IS_CC = 15, //1 // Radius, RepeatMin, RepeatMax - SMART_EVENT_FRIENDLY_MISSING_BUFF = 16, //1 // SpellId, Radius, RepeatMin, RepeatMax - SMART_EVENT_SUMMONED_UNIT = 17, //1 // CreatureId(0 all), CooldownMin, CooldownMax - SMART_EVENT_TARGET_MANA_PCT = 18, //1 // ManaMin%, ManaMax%, RepeatMin, RepeatMax - SMART_EVENT_ACCEPTED_QUEST = 19, //1 // QuestID(0any) - SMART_EVENT_REWARD_QUEST = 20, //1 // QuestID(0any) - SMART_EVENT_REACHED_HOME = 21, //1 // NONE - SMART_EVENT_RECEIVE_EMOTE = 22, //1 // EmoteId, CooldownMin, CooldownMax, condition, val1, val2, val3 - SMART_EVENT_HAS_AURA = 23, //1 // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 RepeatMin, RepeatMax - SMART_EVENT_TARGET_BUFFED = 24, //1 // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 RepeatMin, RepeatMax - SMART_EVENT_RESET = 25, //1 // Called after combat, when the creature respawn and spawn. + SMART_EVENT_UPDATE_IC = 0, // InitialMin, InitialMax, RepeatMin, RepeatMax + SMART_EVENT_UPDATE_OOC = 1, // InitialMin, InitialMax, RepeatMin, RepeatMax + SMART_EVENT_HEALT_PCT = 2, // HPMin%, HPMax%, RepeatMin, RepeatMax + SMART_EVENT_MANA_PCT = 3, // ManaMin%, ManaMax%, RepeatMin, RepeatMax + SMART_EVENT_AGGRO = 4, // NONE + SMART_EVENT_KILL = 5, // CooldownMin0, CooldownMax1, playerOnly2, else creature entry3 + SMART_EVENT_DEATH = 6, // NONE + SMART_EVENT_EVADE = 7, // NONE + SMART_EVENT_SPELLHIT = 8, // SpellID, School, CooldownMin, CooldownMax + SMART_EVENT_RANGE = 9, // MinDist, MaxDist, RepeatMin, RepeatMax + SMART_EVENT_OOC_LOS = 10, // NoHostile, MaxRnage, CooldownMin, CooldownMax + SMART_EVENT_RESPAWN = 11, // type, MapId, ZoneId + SMART_EVENT_TARGET_HEALTH_PCT = 12, // HPMin%, HPMax%, RepeatMin, RepeatMax + SMART_EVENT_TARGET_CASTING = 13, // RepeatMin, RepeatMax + SMART_EVENT_FRIENDLY_HEALTH = 14, // HPDeficit, Radius, RepeatMin, RepeatMax + SMART_EVENT_FRIENDLY_IS_CC = 15, // Radius, RepeatMin, RepeatMax + SMART_EVENT_FRIENDLY_MISSING_BUFF = 16, // SpellId, Radius, RepeatMin, RepeatMax + SMART_EVENT_SUMMONED_UNIT = 17, // CreatureId(0 all), CooldownMin, CooldownMax + SMART_EVENT_TARGET_MANA_PCT = 18, // ManaMin%, ManaMax%, RepeatMin, RepeatMax + SMART_EVENT_ACCEPTED_QUEST = 19, // QuestID(0any) + SMART_EVENT_REWARD_QUEST = 20, // QuestID(0any) + SMART_EVENT_REACHED_HOME = 21, // NONE + SMART_EVENT_RECEIVE_EMOTE = 22, // EmoteId, CooldownMin, CooldownMax, condition, val1, val2, val3 + SMART_EVENT_HAS_AURA = 23, // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 RepeatMin, RepeatMax + SMART_EVENT_TARGET_BUFFED = 24, // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 RepeatMin, RepeatMax + SMART_EVENT_RESET = 25, // Called after combat, when the creature respawn and spawn. + SMART_EVENT_IC_LOS = 26, // NoHostile, MaxRnage, CooldownMin, CooldownMax + SMART_EVENT_PASSENGER_BOARDED = 27, // CooldownMin, CooldownMax + SMART_EVENT_PASSENGER_REMOVED = 28, // CooldownMin, CooldownMax + SMART_EVENT_CHARMED = 29, // NONE + SMART_EVENT_CHARMED_TARGET = 30, // NONE + SMART_EVENT_SPELLHIT_TARGET = 31, // SpellID, School, CooldownMin, CooldownMax + SMART_EVENT_DAMAGED = 32, // MinDmg, MaxDmg, CooldownMin, CooldownMax + SMART_EVENT_DAMAGED_TARGET = 33, // MinDmg, MaxDmg, CooldownMin, CooldownMax + SMART_EVENT_MOVEMENTINFORM = 34, // MovementType(any), PointID + SMART_EVENT_SUMMON_DESPAWNED = 35, // Entry, CooldownMin, CooldownMax + SMART_EVENT_CORPSE_REMOVED = 36, // NONE + SMART_EVENT_AI_INIT = 37, // NONE + SMART_EVENT_DATA_SET = 38, // Id, Value, CooldownMin, CooldownMax + SMART_EVENT_WAYPOINT_START = 39, // PointId(0any), pathID(0any) + SMART_EVENT_WAYPOINT_REACHED = 40, // PointId(0any), pathID(0any) + SMART_EVENT_TRANSPORT_ADDPLAYER = 41, // NONE + SMART_EVENT_TRANSPORT_ADDCREATURE = 42, // Entry (0 any) + SMART_EVENT_TRANSPORT_REMOVE_PLAYER = 43, // NONE + SMART_EVENT_TRANSPORT_RELOCATE = 44, // PointId + SMART_EVENT_INSTANCE_PLAYER_ENTER = 45, // Team (0 any), CooldownMin, CooldownMax + SMART_EVENT_AREATRIGGER_ONTRIGGER = 46, // TriggerId(0 any) + SMART_EVENT_QUEST_ACCEPTED = 47, // none + SMART_EVENT_QUEST_OBJ_COPLETETION = 48, // none + SMART_EVENT_QUEST_COMPLETION = 49, // none + SMART_EVENT_QUEST_REWARDED = 50, // none + SMART_EVENT_QUEST_FAIL = 51, // none + SMART_EVENT_TEXT_OVER = 52, // GroupId from creature_text, creature entry who talks (0 any) + SMART_EVENT_RECEIVE_HEAL = 53, // MinHeal, MaxHeal, CooldownMin, CooldownMax + SMART_EVENT_JUST_SUMMONED = 54, // none + SMART_EVENT_WAYPOINT_PAUSED = 55, // PointId(0any), pathID(0any) + SMART_EVENT_WAYPOINT_RESUMED = 56, // PointId(0any), pathID(0any) + SMART_EVENT_WAYPOINT_STOPPED = 57, // PointId(0any), pathID(0any) + SMART_EVENT_WAYPOINT_ENDED = 58, // PointId(0any), pathID(0any) + SMART_EVENT_TIMED_EVENT_TRIGGERED = 59, // id + SMART_EVENT_UPDATE = 60, // InitialMin, InitialMax, RepeatMin, RepeatMax + SMART_EVENT_LINK = 61, // INTERNAL USAGE, no params, used to link together multiple events, does not use any extra resources to iterate event lists needlessly + SMART_EVENT_GOSSIP_SELECT = 62, // menuID, actionID + SMART_EVENT_JUST_CREATED = 63, // none + SMART_EVENT_GOSSIP_HELLO = 64, // none + SMART_EVENT_FOLLOW_COMPLETED = 65, // none + SMART_EVENT_DUMMY_EFFECT = 66, // spellId, effectIndex + SMART_EVENT_IS_BEHIND_TARGET = 67, // cooldownMin, CooldownMax + SMART_EVENT_GAME_EVENT_START = 68, // game_event.Entry + SMART_EVENT_GAME_EVENT_END = 69, // game_event.Entry + SMART_EVENT_GO_STATE_CHANGED = 70, // go state + SMART_EVENT_GO_EVENT_INFORM = 71, // eventId + SMART_EVENT_ACTION_DONE = 72, // eventId (SharedDefines.EventId) - SMART_EVENT_IC_LOS = 26, //1 // NoHostile, MaxRnage, CooldownMin, CooldownMax - SMART_EVENT_PASSENGER_BOARDED = 27, //1 // CooldownMin, CooldownMax - SMART_EVENT_PASSENGER_REMOVED = 28, //1 // CooldownMin, CooldownMax - SMART_EVENT_CHARMED = 29, //1 // NONE - SMART_EVENT_CHARMED_TARGET = 30, //1 // NONE - SMART_EVENT_SPELLHIT_TARGET = 31, //1 // SpellID, School, CooldownMin, CooldownMax - SMART_EVENT_DAMAGED = 32, //1 // MinDmg, MaxDmg, CooldownMin, CooldownMax - SMART_EVENT_DAMAGED_TARGET = 33, //1 // MinDmg, MaxDmg, CooldownMin, CooldownMax - SMART_EVENT_MOVEMENTINFORM = 34, //1 // MovementType(any), PointID - SMART_EVENT_SUMMON_DESPAWNED = 35, //1 // Entry, CooldownMin, CooldownMax - SMART_EVENT_CORPSE_REMOVED = 36, //1 // NONE - SMART_EVENT_AI_INIT = 37, //1 // NONE - SMART_EVENT_DATA_SET = 38, //1 // Id, Value, CooldownMin, CooldownMax - SMART_EVENT_WAYPOINT_START = 39, //1 // PointId(0any), pathID(0any) - SMART_EVENT_WAYPOINT_REACHED = 40, //1 // PointId(0any), pathID(0any) - SMART_EVENT_TRANSPORT_ADDPLAYER = 41, //1 // NONE - SMART_EVENT_TRANSPORT_ADDCREATURE = 42, //1 // Entry (0 any) - SMART_EVENT_TRANSPORT_REMOVE_PLAYER = 43, //1 // NONE - SMART_EVENT_TRANSPORT_RELOCATE = 44, //1 // PointId - SMART_EVENT_INSTANCE_PLAYER_ENTER = 45, //1 // Team (0 any), CooldownMin, CooldownMax - SMART_EVENT_AREATRIGGER_ONTRIGGER = 46, //1 // TriggerId(0 any) - SMART_EVENT_QUEST_ACCEPTED = 47, //1 // none - SMART_EVENT_QUEST_OBJ_COPLETETION = 48, //1 // none - SMART_EVENT_QUEST_COMPLETION = 49, //1 // none - SMART_EVENT_QUEST_REWARDED = 50, //1 // none - SMART_EVENT_QUEST_FAIL = 51, //1 // none - SMART_EVENT_TEXT_OVER = 52, //1 // GroupId from creature_text, creature entry who talks (0 any) - SMART_EVENT_RECEIVE_HEAL = 53, //1 // MinHeal, MaxHeal, CooldownMin, CooldownMax - SMART_EVENT_JUST_SUMMONED = 54, //1 // none - SMART_EVENT_WAYPOINT_PAUSED = 55, //1 // PointId(0any), pathID(0any) - SMART_EVENT_WAYPOINT_RESUMED = 56, //1 // PointId(0any), pathID(0any) - SMART_EVENT_WAYPOINT_STOPPED = 57, //1 // PointId(0any), pathID(0any) - SMART_EVENT_WAYPOINT_ENDED = 58, //1 // PointId(0any), pathID(0any) - SMART_EVENT_TIMED_EVENT_TRIGGERED = 59, //1 // id - SMART_EVENT_UPDATE = 60, //1 // InitialMin, InitialMax, RepeatMin, RepeatMax - SMART_EVENT_LINK = 61, //1 // INTERNAL USAGE, no params, used to link together multiple events, does not use any extra resources to iterate event lists needlessly - SMART_EVENT_GOSSIP_SELECT = 62, //1 // menuID, actionID - SMART_EVENT_JUST_CREATED = 63, //1 // none - SMART_EVENT_GOSSIP_HELLO = 64, //1 // none - SMART_EVENT_FOLLOW_COMPLETED = 65, //1 // none - SMART_EVENT_DUMMY_EFFECT = 66, //1 // spellId, effectIndex - SMART_EVENT_IS_BEHIND_TARGET = 67, //1 // cooldownMin, CooldownMax - SMART_EVENT_GAME_EVENT_START = 68, //1 // game_event.Entry - SMART_EVENT_GAME_EVENT_END = 69, //1 // game_event.Entry - SMART_EVENT_GO_STATE_CHANGED = 70, //1 // go state - SMART_EVENT_GO_EVENT_INFORM = 71, //1 // eventId - - SMART_EVENT_END = 72, + SMART_EVENT_END = 73, }; struct SmartEvent @@ -356,6 +356,11 @@ struct SmartEvent uint32 eventId; } eventInform; + struct + { + uint32 eventId; + } doAction; + struct { uint32 param1; @@ -1173,6 +1178,7 @@ const uint32 SmartAIEventMask[SMART_EVENT_END][2] = {SMART_EVENT_GAME_EVENT_END, SMART_SCRIPT_TYPE_MASK_CREATURE + SMART_SCRIPT_TYPE_MASK_GAMEOBJECT }, {SMART_EVENT_GO_STATE_CHANGED, SMART_SCRIPT_TYPE_MASK_GAMEOBJECT }, {SMART_EVENT_GO_EVENT_INFORM, SMART_SCRIPT_TYPE_MASK_GAMEOBJECT }, + {SMART_EVENT_ACTION_DONE, SMART_SCRIPT_TYPE_MASK_CREATURE }, }; enum SmartEventFlags From d61f9fb40cd85cd786022ceb5a040fe9629a3981 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 17 Jun 2012 22:11:27 +0100 Subject: [PATCH 1053/1149] Fix build in GCC Signed-off-by: Nay --- src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 2 +- src/server/game/AI/SmartScripts/SmartScriptMgr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index b01aaf5434c..426593d1757 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -538,7 +538,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) } case SMART_EVENT_ACTION_DONE: { - if (e.event.doAction.eventId < EventId::EVENT_SPELLCLICK || e.event.doAction.eventId > EventId::EVENT_CHARGE) + if (e.event.doAction.eventId < EVENT_SPELLCLICK || e.event.doAction.eventId > EVENT_CHARGE) { sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid event id %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.doAction.eventId); return false; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 2291c21bf71..ade1c18de39 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -1178,7 +1178,7 @@ const uint32 SmartAIEventMask[SMART_EVENT_END][2] = {SMART_EVENT_GAME_EVENT_END, SMART_SCRIPT_TYPE_MASK_CREATURE + SMART_SCRIPT_TYPE_MASK_GAMEOBJECT }, {SMART_EVENT_GO_STATE_CHANGED, SMART_SCRIPT_TYPE_MASK_GAMEOBJECT }, {SMART_EVENT_GO_EVENT_INFORM, SMART_SCRIPT_TYPE_MASK_GAMEOBJECT }, - {SMART_EVENT_ACTION_DONE, SMART_SCRIPT_TYPE_MASK_CREATURE }, + {SMART_EVENT_ACTION_DONE, SMART_SCRIPT_TYPE_MASK_CREATURE }, }; enum SmartEventFlags From b5a072855e53a01b263338ff9211dca862a7f39a Mon Sep 17 00:00:00 2001 From: "dr.skull" Date: Sun, 17 Jun 2012 23:17:59 +0200 Subject: [PATCH 1054/1149] Fix added check for IsImmunedToSpell Signed-off-by: dr.skull --- src/server/game/Entities/Creature/Creature.cpp | 6 +++--- src/server/game/Entities/Unit/Unit.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 6857abde2bd..4d54d1599a8 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1675,10 +1675,10 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo) // This check must be done instead of 'if (GetCreatureTemplate()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))' for not break // the check of mechanic immunity on DB (tested) because GetCreatureTemplate()->MechanicImmuneMask and m_spellImmune[IMMUNITY_MECHANIC] don't have same data. bool immunedToAllEffects = true; - for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { - if(!spellInfo->Effects[i].IsEffect()) - break; + if (!spellInfo->Effects[i].IsEffect()) + continue; if (!IsImmunedToSpellEffect(spellInfo, i)) { immunedToAllEffects = false; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 0915f9ea3e9..45c2d6b0b9a 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11534,12 +11534,12 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) } bool immuneToAllEffects = true; - for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { // State/effect immunities applied by aura expect full spell immunity // Ignore effects with mechanic, they are supposed to be checked separately - if(!spellInfo->Effects[i].IsEffect()) - break; + if (!spellInfo->Effects[i].IsEffect()) + continue; if (!IsImmunedToSpellEffect(spellInfo, i)) { immuneToAllEffects = false; From 0e4d6bf4df723cb57190c60f7667021a87dd4eed Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 17 Jun 2012 23:13:48 +0100 Subject: [PATCH 1055/1149] Missing break on 8c16cc2260a68 Signed-off-by: Nay --- src/server/game/AI/SmartScripts/SmartScript.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index f564bce1e25..e888d4af030 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -2783,6 +2783,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui if (e.event.doAction.eventId != var0) return; ProcessAction(e, unit, var0); + break; } default: sLog->outErrorDb("SmartScript::ProcessEvent: Unhandled Event type %u", e.GetEventType()); From 53b561f55031eb3f2cd46d918b94626782e7a59f Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 18 Jun 2012 00:42:37 +0100 Subject: [PATCH 1056/1149] Core/SAI: Remove some unused conditions related code SAI conditions were implemented in a different way than initially planned Signed-off-by: Nay --- .../game/AI/SmartScripts/SmartScript.cpp | 17 --------------- src/server/game/AI/SmartScripts/SmartScript.h | 2 -- .../game/AI/SmartScripts/SmartScriptMgr.h | 21 ------------------- 3 files changed, 40 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index e888d4af030..4bc5671b84b 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -2901,23 +2901,6 @@ void SmartScript::InstallEvents() } } -bool SmartScript::ConditionValid(Unit* u, int32 c, int32 v1, int32 v2, int32 v3) -{ - if (c == 0) - return true; - - if (!u || !u->ToPlayer()) - return false; - - Condition cond; - cond.ConditionType = ConditionTypes(uint32(c)); - cond.ConditionValue1 = uint32(v1); - cond.ConditionValue1 = uint32(v2); - cond.ConditionValue1 = uint32(v3); - ConditionSourceInfo srcInfo = ConditionSourceInfo(u->ToPlayer()); - return cond.Meets(srcInfo); -} - void SmartScript::OnUpdate(uint32 const diff) { if ((mScriptType == SMART_SCRIPT_TYPE_CREATURE || mScriptType == SMART_SCRIPT_TYPE_GAMEOBJECT) && !GetBaseObject()) diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h index 5fb691c87f2..03d533e69e5 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.h +++ b/src/server/game/AI/SmartScripts/SmartScript.h @@ -83,8 +83,6 @@ class SmartScript return obj && obj->GetTypeId() == TYPEID_GAMEOBJECT; } - bool ConditionValid(Unit* u, int32 c, int32 v1, int32 v2, int32 v3); - void OnUpdate(const uint32 diff); void OnMoveInLineOfSight(Unit* who); diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index ade1c18de39..0f50985cef4 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -22,7 +22,6 @@ #include "Creature.h" #include "CreatureAI.h" #include "Unit.h" -#include "ConditionMgr.h" #include "Spell.h" //#include "SmartScript.h" @@ -1391,26 +1390,6 @@ class SmartAIMgr } return true; } - /*inline bool IsConditionValid(SmartScriptHolder e, int32 t, int32 v1, int32 v2, int32 v3) - { - bool error = false; - if (t > 0 && v1 >= 0 && v2 >= 0 && v3 >= 0) - { - Condition cond; - cond.mConditionType = ConditionType(t); - cond.mConditionValue1 = uint32(v1); - cond.mConditionValue2 = uint32(v2); - cond.mConditionValue3 = uint32(v3); - if (!sConditionMgr->isConditionTypeValid(&cond)) - error = true; - } - if (error) - { - sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Condition, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); - return false; - } - return true; - }*/ bool IsTextEmoteValid(SmartScriptHolder const& e, uint32 entry) { From 32d3e33f87318c508a297851adc64f696953ca1d Mon Sep 17 00:00:00 2001 From: Abdollah Hasan Date: Mon, 18 Jun 2012 04:54:50 +0300 Subject: [PATCH 1057/1149] Core/Commands: Update TeleDel command to support id, shift click, or name of teleport location. --- src/server/scripts/Commands/cs_tele.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp index ca7c3af7fde..cd143eacb50 100644 --- a/src/server/scripts/Commands/cs_tele.cpp +++ b/src/server/scripts/Commands/cs_tele.cpp @@ -97,15 +97,16 @@ public: if (!*args) return false; - std::string name = args; - - if (!sObjectMgr->DeleteGameTele(name)) - { - handler->SendSysMessage(LANG_COMMAND_TELE_NOTFOUND); + // id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r + GameTele const* tele = handler->extractGameTeleFromLink((char*)args); + if (!tele) + { + handler->SendSysMessage(LANG_COMMAND_TELE_NOTFOUND); handler->SetSentErrorMessage(true); return false; - } - + } + std::string name = tele->name; + sObjectMgr->DeleteGameTele(name); handler->SendSysMessage(LANG_COMMAND_TP_DELETED); return true; } From b3d99e968f03f1085c8a0a50267ebd4832c29471 Mon Sep 17 00:00:00 2001 From: Abdollah Hasan Date: Mon, 18 Jun 2012 05:16:00 +0300 Subject: [PATCH 1058/1149] Core/Commands: TeleDel command cleanup. --- src/server/scripts/Commands/cs_tele.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp index cd143eacb50..8f390d17cd4 100644 --- a/src/server/scripts/Commands/cs_tele.cpp +++ b/src/server/scripts/Commands/cs_tele.cpp @@ -97,16 +97,16 @@ public: if (!*args) return false; - // id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r + // id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r GameTele const* tele = handler->extractGameTeleFromLink((char*)args); - if (!tele) - { - handler->SendSysMessage(LANG_COMMAND_TELE_NOTFOUND); + if (!tele) + { + handler->SendSysMessage(LANG_COMMAND_TELE_NOTFOUND); handler->SetSentErrorMessage(true); return false; - } + } std::string name = tele->name; - sObjectMgr->DeleteGameTele(name); + sObjectMgr->DeleteGameTele(name); handler->SendSysMessage(LANG_COMMAND_TP_DELETED); return true; } From 99381289327a2eb07c0074044e024527f7e56913 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 18 Jun 2012 13:16:01 +0200 Subject: [PATCH 1059/1149] Scripts/Icecrown Citadel * Fixed position of summoned creatures (if supposed to be in air) * Fixed casting Fury of Frostmourne initiating outro roleplay while casting something else at the same time * Fixed outro visuals --- .../world/2012_06_18_00_world_creature.sql | 26 ++++ .../IcecrownCitadel/boss_the_lich_king.cpp | 129 ++++++++++-------- .../instance_icecrown_citadel.cpp | 5 + 3 files changed, 103 insertions(+), 57 deletions(-) create mode 100644 sql/updates/world/2012_06_18_00_world_creature.sql diff --git a/sql/updates/world/2012_06_18_00_world_creature.sql b/sql/updates/world/2012_06_18_00_world_creature.sql new file mode 100644 index 00000000000..23538c33f73 --- /dev/null +++ b/sql/updates/world/2012_06_18_00_world_creature.sql @@ -0,0 +1,26 @@ +SET @CGUID := 88615; +DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+00 AND @CGUID+22; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`MovementType`) VALUES +(@CGUID+00,39190,631,12,1,505.1563,-2536.863,1069.598,0,10,10,1), -- Wicked Spirit +(@CGUID+01,39190,631,12,1,502.6493,-2531.328,1069.598,0,10,10,1), -- Wicked Spirit +(@CGUID+02,39190,631,12,1,503.8246,-2508.141,1069.598,0,10,10,1), -- Wicked Spirit +(@CGUID+03,39190,631,12,1,495.3629,-2538.215,1069.598,0,10,10,1), -- Wicked Spirit +(@CGUID+04,39190,631,12,1,506.8715,-2515.552,1069.598,0,10,10,1), -- Wicked Spirit +(@CGUID+05,39190,631,12,1,481.3021,-2509.222,1069.598,0,10,10,1), -- Wicked Spirit +(@CGUID+06,39190,631,12,1,481.5382,-2527.332,1069.598,0,10,10,1), -- Wicked Spirit +(@CGUID+07,39190,631,12,1,500.0807,-2523.289,1069.598,0,10,10,1), -- Wicked Spirit +(@CGUID+08,39190,631,12,1,486.6632,-2517.747,1069.598,0,10,10,1), -- Wicked Spirit +(@CGUID+09,39190,631,12,1,513.8802,-2511.795,1069.596,0,10,10,1), -- Wicked Spirit +(@CGUID+10,39190,631,12,1,499.6406,-2500.783,1069.656,0,10,10,1), -- Wicked Spirit +(@CGUID+11,39190,631,12,1,513.7101,-2530.931,1069.596,0,10,10,1), -- Wicked Spirit +(@CGUID+12,39190,631,12,1,502.6811,-2522.542,1069.598,0,10,10,1), -- Wicked Spirit +(@CGUID+13,39190,631,12,1,518.7483,-2521.240,1069.596,0,10,10,1), -- Wicked Spirit +(@CGUID+14,39190,631,12,1,478.9774,-2517.446,1069.598,0,10,10,1), -- Wicked Spirit +(@CGUID+15,39190,631,12,1,489.0104,-2538.535,1069.598,0,10,10,1), -- Wicked Spirit +(@CGUID+16,39190,631,12,1,511.6320,-2522.373,1069.598,0,10,10,1), -- Wicked Spirit +(@CGUID+17,39190,631,12,1,500.8976,-2527.198,1069.598,0,10,10,1), -- Wicked Spirit +(@CGUID+18,39190,631,12,1,484.7934,-2533.592,1069.598,0,10,10,1), -- Wicked Spirit +(@CGUID+19,39190,631,12,1,490.4132,-2504.323,1069.598,0,10,10,1), -- Wicked Spirit +(@CGUID+20,39190,631,12,1,485.0298,-2527.724,1069.598,0,10,10,1), -- Wicked Spirit +(@CGUID+21,39190,631,12,1,494.2899,-2511.384,1069.598,0,10,10,1), -- Wicked Spirit +(@CGUID+22,39190,631,12,1,491.7170,-2532.490,1069.598,0,10,10,1); -- Wicked Spirit diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 4dab215d1da..03d6c0ef919 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -138,7 +138,7 @@ enum Spells SPELL_IN_FROSTMOURNE_ROOM = 74276, SPELL_KILL_FROSTMOURNE_PLAYERS = 75127, SPELL_HARVESTED_SOUL = 72679, - SPELL_TRIGGER_VILE_SPIRIT_HEROIC = 73582, + SPELL_TRIGGER_VILE_SPIRIT_HEROIC = 73582, // TODO: Cast every 3 seconds during Frostmourne phase, targets a Wicked Spirit amd activates it // Frostmourne SPELL_LIGHTS_FAVOR = 69382, @@ -152,6 +152,7 @@ enum Spells SPELL_SUMMON_SPIRIT_BOMB_1 = 73581, // (Heroic) SPELL_SUMMON_SPIRIT_BOMB_2 = 74299, // (Heroic) SPELL_EXPLOSION = 73576, // Spirit Bomb (Heroic) + SPELL_HARVEST_SOUL_DAMAGE_AURA = 73655, // Outro SPELL_FURY_OF_FROSTMOURNE = 72350, @@ -221,7 +222,7 @@ enum Events EVENT_QUAKE_2 = 27, EVENT_VILE_SPIRITS = 28, EVENT_HARVEST_SOULS = 29, // heroic only - EVENT_WICKED_SPIRITS = 30, + EVENT_BERSERK = 30, EVENT_SOUL_RIP = 31, EVENT_DESTROY_SOUL = 32, EVENT_FROSTMOURNE_TALK_1 = 33, @@ -249,19 +250,18 @@ enum Events EVENT_OUTRO_TERENAS_TALK_2 = 55, EVENT_OUTRO_TALK_7 = 56, EVENT_OUTRO_TALK_8 = 57, - EVENT_BERSERK = 58, // Shambling Horror - EVENT_SHOCKWAVE = 59, - EVENT_ENRAGE = 60, + EVENT_SHOCKWAVE = 58, + EVENT_ENRAGE = 59, // Raging Spirit - EVENT_SOUL_SHRIEK = 61, + EVENT_SOUL_SHRIEK = 60, // Strangulate Vehicle (Harvest Soul) - EVENT_TELEPORT = 62, - EVENT_MOVE_TO_LICH_KING = 63, - EVENT_DESPAWN_SELF = 64, + EVENT_TELEPORT = 61, + EVENT_MOVE_TO_LICH_KING = 62, + EVENT_DESPAWN_SELF = 63, }; enum EventGroups @@ -475,6 +475,25 @@ class VileSpiritActivateEvent : public BasicEvent Creature* _owner; }; +class TriggerWickedSpirit : public BasicEvent +{ + public: + explicit TriggerWickedSpirit(Creature* owner) + : _owner(owner), _counter(13) + { + } + + bool Execute(uint64 /*time*/, uint32 /*diff*/) + { + _owner->CastCustomSpell(SPELL_TRIGGER_VILE_SPIRIT_HEROIC, SPELLVALUE_MAX_TARGETS, 1, NULL, true); + return --_counter > 0; + } + + private: + Creature* _owner; + int32 _counter; +}; + class boss_the_lich_king : public CreatureScript { public: @@ -503,6 +522,8 @@ class boss_the_lich_king : public CreatureScript me->SetDisableGravity(false); me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->GetMotionMaster()->MoveFall(); + if (Creature* frostmourne = me->FindNearestCreature(NPC_FROSTMOURNE_TRIGGER, 50.0f)) + frostmourne->DespawnOrUnsummon(); } void EnterCombat(Unit* target) @@ -601,8 +622,6 @@ class boss_the_lich_king : public CreatureScript summons.DoAction(ACTION_TELEPORT_BACK, pred); if (!IsHeroic()) Talk(SAY_LK_FROSTMOURNE_ESCAPE); - else - DoCastAOE(SPELL_TRIGGER_VILE_SPIRIT_HEROIC); break; } default: @@ -645,6 +664,8 @@ class boss_the_lich_king : public CreatureScript if (events.GetPhaseMask() & PHASE_MASK_ONE && !HealthAbovePct(70)) { events.SetPhase(PHASE_TRANSITION); + me->SetReactState(REACT_PASSIVE); + me->AttackStop(); me->GetMotionMaster()->MovePoint(POINT_CENTER_1, CenterPosition); return; } @@ -652,6 +673,8 @@ class boss_the_lich_king : public CreatureScript if (events.GetPhaseMask() & PHASE_MASK_TWO && !HealthAbovePct(40)) { events.SetPhase(PHASE_TRANSITION); + me->SetReactState(REACT_PASSIVE); + me->AttackStop(); me->GetMotionMaster()->MovePoint(POINT_CENTER_2, CenterPosition); return; } @@ -664,7 +687,8 @@ class boss_the_lich_king : public CreatureScript events.SetPhase(PHASE_OUTRO); summons.DespawnAll(); SendMusicToPlayers(MUSIC_FURY_OF_FROSTMOURNE); - DoCastAOE(SPELL_FURY_OF_FROSTMOURNE); + me->InterruptNonMeleeSpells(true); + me->CastSpell((Unit*)NULL, SPELL_FURY_OF_FROSTMOURNE, TRIGGERED_NONE); me->SetWalk(true); events.ScheduleEvent(EVENT_OUTRO_TALK_1, 2600, 0, PHASE_OUTRO); events.ScheduleEvent(EVENT_OUTRO_EMOTE_TALK, 6600, 0, PHASE_OUTRO); @@ -712,7 +736,6 @@ class boss_the_lich_king : public CreatureScript break; case NPC_FROSTMOURNE_TRIGGER: { - summons.Summon(summon); summon->CastSpell((Unit*)NULL, SPELL_BROKEN_FROSTMOURNE, true); SendLightOverride(LIGHT_SOULSTORM, 10000); @@ -724,16 +747,11 @@ class boss_the_lich_king : public CreatureScript case NPC_VILE_SPIRIT: { summons.Summon(summon); - if (events.GetPhaseMask() & PHASE_MASK_FROSTMOURNE) - { - TeleportSpirit(summon); - return; - } - summon->SetReactState(REACT_PASSIVE); summon->SetSpeed(MOVE_FLIGHT, 0.5f); summon->GetMotionMaster()->MoveRandom(10.0f); - summon->m_Events.AddEvent(new VileSpiritActivateEvent(summon), summon->m_Events.CalculateTime(15000)); + if (!(events.GetPhaseMask() & PHASE_MASK_FROSTMOURNE)) + summon->m_Events.AddEvent(new VileSpiritActivateEvent(summon), summon->m_Events.CalculateTime(15000)); return; } case NPC_STRANGULATE_VEHICLE: @@ -756,7 +774,6 @@ class boss_the_lich_king : public CreatureScript case NPC_VALKYR_SHADOWGUARD: case NPC_RAGING_SPIRIT: case NPC_VILE_SPIRIT: - case NPC_WICKED_SPIRIT: summon->ToTempSummon()->SetTempSummonType(TEMPSUMMON_CORPSE_DESPAWN); break; default: @@ -802,8 +819,6 @@ class boss_the_lich_king : public CreatureScript me->SetFacingTo(0.0f); Talk(SAY_LK_REMORSELESS_WINTER); SendMusicToPlayers(MUSIC_SPECIAL); - me->SetReactState(REACT_PASSIVE); - me->AttackStop(); DoCast(me, SPELL_REMORSELESS_WINTER_1); events.DelayEvents(62500, EVENT_GROUP_BERSERK); // delay berserk timer, its not ticking during phase transitions events.ScheduleEvent(EVENT_QUAKE, 62500, 0, PHASE_TRANSITION); @@ -819,8 +834,6 @@ class boss_the_lich_king : public CreatureScript me->SetFacingTo(0.0f); Talk(SAY_LK_REMORSELESS_WINTER); SendMusicToPlayers(MUSIC_SPECIAL); - me->SetReactState(REACT_PASSIVE); - me->AttackStop(); DoCast(me, SPELL_REMORSELESS_WINTER_2); summons.DespawnEntry(NPC_VALKYR_SHADOWGUARD); events.DelayEvents(62500, EVENT_GROUP_BERSERK); // delay berserk timer, its not ticking during phase transitions @@ -992,10 +1005,6 @@ class boss_the_lich_king : public CreatureScript DoCastAOE(SPELL_VILE_SPIRITS); events.ScheduleEvent(EVENT_VILE_SPIRITS, urand(35000, 40000), EVENT_GROUP_VILE_SPIRITS, PHASE_THREE); break; - case EVENT_WICKED_SPIRITS: - DoCastAOE(SPELL_VILE_SPIRITS); - events.ScheduleEvent(EVENT_WICKED_SPIRITS, urand(35000, 40000), 0, PHASE_FROSTMOURNE); - break; case EVENT_HARVEST_SOULS: Talk(SAY_LK_HARVEST_SOUL); DoCastAOE(SPELL_HARVEST_SOULS); @@ -1003,7 +1012,6 @@ class boss_the_lich_king : public CreatureScript events.SetPhase(PHASE_FROSTMOURNE); // will stop running UpdateVictim (no evading) me->SetReactState(REACT_PASSIVE); me->AttackStop(); - events.ScheduleEvent(EVENT_WICKED_SPIRITS, events.GetNextEventTime(EVENT_VILE_SPIRITS) - events.GetTimer(), 0, PHASE_FROSTMOURNE); events.DelayEvents(50000, EVENT_GROUP_VILE_SPIRITS); events.RescheduleEvent(EVENT_DEFILE, 50000, 0, PHASE_THREE); events.RescheduleEvent(EVENT_SOUL_REAPER, urand(57000, 62000), 0, PHASE_THREE); @@ -1019,16 +1027,22 @@ class boss_the_lich_king : public CreatureScript if (!triggers.empty()) { triggers.sort(Trinity::ObjectDistanceOrderPred(terenas, true)); - Unit* spawner = triggers.front(); + Creature* spawner = triggers.front(); spawner->CastSpell(spawner, SPELL_SUMMON_SPIRIT_BOMB_1, true); // summons bombs randomly spawner->CastSpell(spawner, SPELL_SUMMON_SPIRIT_BOMB_2, true); // summons bombs on players + spawner->m_Events.AddEvent(new TriggerWickedSpirit(spawner), spawner->m_Events.CalculateTime(3000)); } for (SummonList::iterator i = summons.begin(); i != summons.end(); ++i) { Creature* summon = ObjectAccessor::GetCreature(*me, *i); if (summon && summon->GetEntry() == NPC_VILE_SPIRIT) - TeleportSpirit(summon); + { + summon->m_Events.KillAllEvents(true); + summon->m_Events.AddEvent(new VileSpiritActivateEvent(summon), summon->m_Events.CalculateTime(50000)); + summon->GetMotionMaster()->MoveRandom(10.0f); + summon->SetReactState(REACT_PASSIVE); + } } } break; @@ -1099,22 +1113,6 @@ class boss_the_lich_king : public CreatureScript } private: - - void TeleportSpirit(Creature* summon) - { - float dist = me->GetObjectSize() + (15.0f - me->GetObjectSize()) * float(rand_norm()); - float angle = float(rand_norm()) * float(2.0f * M_PI); - Position dest = TerenasSpawnHeroic; - me->MovePosition(dest, dist, angle); - dest.m_positionZ += 15.0f; - summon->UpdateEntry(NPC_WICKED_SPIRIT); - summon->SetReactState(REACT_PASSIVE); - summon->NearTeleportTo(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ(), dest.GetOrientation()); - summon->SetSpeed(MOVE_FLIGHT, 0.5f); - summon->m_Events.KillAllEvents(true); - summon->m_Events.AddEvent(new VileSpiritActivateEvent(summon), summon->m_Events.CalculateTime(1000)); - } - void SendMusicToPlayers(uint32 musicId) const { WorldPacket data(SMSG_PLAY_MUSIC, 4); @@ -1635,8 +1633,13 @@ class npc_strangulate_vehicle : public CreatureScript return; if (TempSummon* summ = me->ToTempSummon()) + { if (Unit* summoner = summ->GetSummoner()) + { DoCast(summoner, SPELL_HARVEST_SOUL_TELEPORT_BACK); + summoner->RemoveAurasDueToSpell(SPELL_HARVEST_SOUL_DAMAGE_AURA); + } + } if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_THE_LICH_KING))) lichKing->AI()->SummonedCreatureDespawn(me); @@ -1993,6 +1996,10 @@ class npc_broken_frostmourne : public CreatureScript _events.ScheduleEvent(EVENT_OUTRO_SUMMON_TERENAS, 6000, 0, PHASE_OUTRO); } + void EnterEvadeMode() + { + } + void UpdateAI(uint32 const diff) { UpdateVictim(); @@ -2472,14 +2479,18 @@ class spell_the_lich_king_summon_into_air : public SpellScriptLoader static Position const offset = {0.0f, 0.0f, 15.0f, 0.0f}; WorldLocation* dest = const_cast(GetExplTargetDest()); dest->RelocateOffset(offset); + GetHitDest()->RelocateOffset(offset); // spirit bombs get higher if (GetSpellInfo()->Effects[effIndex].MiscValue == NPC_SPIRIT_BOMB) + { dest->RelocateOffset(offset); + GetHitDest()->RelocateOffset(offset); + } } void Register() { - OnEffectLaunch += SpellEffectFn(spell_the_lich_king_summon_into_air_SpellScript::ModDestHeight, EFFECT_0, SPELL_EFFECT_SUMMON); + OnEffectHit += SpellEffectFn(spell_the_lich_king_summon_into_air_SpellScript::ModDestHeight, EFFECT_0, SPELL_EFFECT_SUMMON); } }; @@ -2954,6 +2965,15 @@ class spell_the_lich_king_restore_soul : public SpellScriptLoader lichKing->AI()->DoAction(ACTION_TELEPORT_BACK); if (Creature* spawner = GetCaster()->FindNearestCreature(NPC_WORLD_TRIGGER_INFINITE_AOI, 50.0f)) spawner->RemoveAllAuras(); + + std::list spirits; + GetCaster()->GetCreatureListWithEntryInGrid(spirits, NPC_WICKED_SPIRIT, 200.0f); + for (std::list::iterator itr = spirits.begin(); itr != spirits.end(); ++itr) + { + (*itr)->m_Events.KillAllEvents(true); + (*itr)->SetReactState(REACT_PASSIVE); + (*itr)->AI()->EnterEvadeMode(); + } } void RemoveAura() @@ -3046,23 +3066,18 @@ class spell_the_lich_king_trigger_vile_spirit : public SpellScriptLoader { PrepareSpellScript(spell_the_lich_king_trigger_vile_spirit_SpellScript); - void TeleportOutside() + void ActivateSpirit() { Creature* target = GetHitCreature(); if (!target) return; - Position dest; - Position offset; - TerenasSpawnHeroic.GetPositionOffsetTo(*target, offset); - GetCaster()->GetPosition(&dest); - dest.RelocateOffset(offset); - target->NearTeleportTo(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ(), dest.GetOrientation()); + VileSpiritActivateEvent(target).Execute(0, 0); } void Register() { - OnHit += SpellHitFn(spell_the_lich_king_trigger_vile_spirit_SpellScript::TeleportOutside); + OnHit += SpellHitFn(spell_the_lich_king_trigger_vile_spirit_SpellScript::ActivateSpirit); } }; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index 704c3c2b0c2..270f56674eb 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -290,6 +290,11 @@ class instance_icecrown_citadel : public InstanceMapScript case NPC_TERENAS_MENETHIL_FROSTMOURNE_H: TerenasMenethilGUID = creature->GetGUID(); break; + case NPC_WICKED_SPIRIT: + // Remove corpse as soon as it dies (and respawn 10 seconds later) + creature->SetCorpseDelay(0); + creature->SetReactState(REACT_PASSIVE); + break; default: break; } From 2cafa85daacb8e1908953f1e529a87d6f8371dd1 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 18 Jun 2012 13:19:09 +0200 Subject: [PATCH 1060/1149] Scripts/Icecrown Citadel: Minor correction for previous commit --- .../Northrend/IcecrownCitadel/boss_the_lich_king.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 03d6c0ef919..d2eaab361a1 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -486,12 +486,19 @@ class TriggerWickedSpirit : public BasicEvent bool Execute(uint64 /*time*/, uint32 /*diff*/) { _owner->CastCustomSpell(SPELL_TRIGGER_VILE_SPIRIT_HEROIC, SPELLVALUE_MAX_TARGETS, 1, NULL, true); - return --_counter > 0; + + if (--_counter) + { + _owner->m_Events.AddEvent(this, _owner->m_Events.CalculateTime(3000)); + return false; + } + + return true; } private: Creature* _owner; - int32 _counter; + uint32 _counter; }; class boss_the_lich_king : public CreatureScript From bd7299ac35600f4f084074c95c64ba27cad04ac4 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 18 Jun 2012 13:27:10 +0200 Subject: [PATCH 1061/1149] Scripts/Spells: Reverted part of 9d19be2ee5be7cf46ea3eb6b197647737266c69e, fixes scaling mounts Closes #6815. --- src/server/scripts/Spells/spell_generic.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index e7cc7360aab..9cbf81b39af 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2996,11 +2996,14 @@ class spell_gen_mount : public SpellScriptLoader // Triggered spell id dependent on riding skill and zone bool canFly = false; - uint32 map = target->GetMapId(); + uint32 map = GetVirtualMapForMapAndZone(target->GetMapId(), target->GetZoneId()); if (map == 530 || (map == 571 && target->HasSpell(SPELL_COLD_WEATHER_FLYING))) canFly = true; - AreaTableEntry const* area = sAreaStore.LookupEntry(target->GetAreaId()); + float x, y, z; + target->GetPosition(x, y, z); + uint32 areaFlag = target->GetBaseMap()->GetAreaFlag(x, y, z); + AreaTableEntry const* area = sAreaStore.LookupEntry(areaFlag); if (!area || (canFly && (area->flags & AREA_FLAG_NO_FLY_ZONE))) canFly = false; From 2affb39bc0adcfa5758268222a115e3eb3a3247d Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 18 Jun 2012 12:48:34 -0400 Subject: [PATCH 1062/1149] Core/Spells: fix bloodthirst. again. --- ...2012_06_18_01_world_spell_script_names.sql | 3 ++ src/server/scripts/Spells/spell_warrior.cpp | 34 +++++++++++++++++-- 2 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 sql/updates/world/2012_06_18_01_world_spell_script_names.sql diff --git a/sql/updates/world/2012_06_18_01_world_spell_script_names.sql b/sql/updates/world/2012_06_18_01_world_spell_script_names.sql new file mode 100644 index 00000000000..5f227a887d7 --- /dev/null +++ b/sql/updates/world/2012_06_18_01_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` = 23880; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(23880, 'spell_warr_bloodthirst_heal'); diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 0ba5c866d63..f1276c24a75 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -184,9 +184,9 @@ class spell_warr_deep_wounds : public SpellScriptLoader damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); ApplyPctN(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id)); - + damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); - + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_PERIODIC); uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude; @@ -405,7 +405,7 @@ class spell_warr_bloodthirst : public SpellScriptLoader void Register() { - OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); + OnEffectHit += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); } }; @@ -415,6 +415,33 @@ class spell_warr_bloodthirst : public SpellScriptLoader } }; +class spell_warr_bloodthirst_heal : public SpellScriptLoader +{ +public: + spell_warr_bloodthirst_heal() : SpellScriptLoader("spell_warr_bloodthirst_heal") { } + + class spell_warr_bloodthirst_heal_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warr_bloodthirst_heal_SpellScript); + + void HandleHeal(SpellEffIndex /* effIndex */) + { + if (GetTriggeringSpell()) + SetHitHeal(CalculatePctN(GetCaster()->GetMaxHealth(),GetTriggeringSpell()->Effects[EFFECT_1].CalcValue())); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warr_bloodthirst_heal_SpellScript(); + } +}; + enum Overpower { SPELL_UNRELENTING_ASSAULT_RANK_1 = 46859, @@ -472,4 +499,5 @@ void AddSC_warrior_spell_scripts() new spell_warr_concussion_blow(); new spell_warr_bloodthirst(); new spell_warr_overpower(); + new spell_warr_bloodthirst_heal(); } From c1a014807015a30152fdc02d64546ab27d77c775 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 18 Jun 2012 12:57:33 -0400 Subject: [PATCH 1063/1149] Core/Scripts: fix professor oozes being able to be knocked back. --- .../Northrend/IcecrownCitadel/boss_professor_putricide.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index a0fca522f61..b2662b644a7 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -296,6 +296,7 @@ class boss_professor_putricide : public CreatureScript summon->ModifyAuraState(AURA_STATE_UNKNOWN22, true); summon->CastSpell(summon, SPELL_GASEOUS_BLOAT_PROC, true); summon->CastCustomSpell(SPELL_GASEOUS_BLOAT, SPELLVALUE_AURA_STACK, 10, summon, false); + summon->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true); summon->SetReactState(REACT_PASSIVE); return; case NPC_VOLATILE_OOZE: @@ -303,6 +304,7 @@ class boss_professor_putricide : public CreatureScript summon->ModifyAuraState(AURA_STATE_UNKNOWN19, true); summon->CastSpell(summon, SPELL_OOZE_ERUPTION_SEARCH_PERIODIC, true); summon->CastSpell(summon, SPELL_VOLATILE_OOZE_ADHESIVE, false); + summon->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true); summon->SetReactState(REACT_PASSIVE); return; case NPC_CHOKING_GAS_BOMB: From 29f1ab2438d6bf7ac1370696033788df46f9ff27 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 18 Jun 2012 19:05:25 +0200 Subject: [PATCH 1064/1149] Core/Achievements: Corrected map requirement for Once Bitten, Twice Shy (10 player) - was requiring Ulduar --- src/server/game/Achievements/AchievementMgr.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 2a9f4212f46..450c05329b4 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2208,7 +2208,6 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList() for (uint32 entryId = 0; entryId < sAchievementCriteriaStore.GetNumRows(); ++entryId) { - AchievementCriteriaEntry const* criteria = sAchievementCriteriaStore.LookupEntry(entryId); if (!criteria) continue; @@ -2239,7 +2238,6 @@ void AchievementGlobalMgr::LoadAchievementReferenceList() for (uint32 entryId = 0; entryId < sAchievementStore.GetNumRows(); ++entryId) { - AchievementEntry const* achievement = sAchievementStore.LookupEntry(entryId); if (!achievement || !achievement->refAchievement) continue; @@ -2248,6 +2246,10 @@ void AchievementGlobalMgr::LoadAchievementReferenceList() ++count; } + // Once Bitten, Twice Shy (10 player) - Icecrown Citadel + if (AchievementEntry const* achievement = sAchievementStore.LookupEntry(4539)) + const_cast(achievement)->mapID = 631; // Correct map requirement (currently has Ulduar) + sLog->outString(">> Loaded %u achievement references in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } From e190a202cac3787c95749a0a628fa2dd6b082015 Mon Sep 17 00:00:00 2001 From: Discover- Date: Tue, 19 Jun 2012 00:07:20 +0200 Subject: [PATCH 1065/1149] Core/CreatureAI: Implement an OnSpellClick hook instead of the ugly way that uses DoAction with EVENT_SPELLCLICK. Core/SmartAI: Implement SMART_EVENT_ON_SPELLCLICK. Parameter is the clicker. If someone could update the wiki accordingly for SAI I would appreciate that. Thanks to @Shauren for some help! --- src/server/game/AI/CreatureAI.h | 4 ++-- src/server/game/AI/SmartScripts/SmartAI.cpp | 5 +++++ src/server/game/AI/SmartScripts/SmartAI.h | 2 ++ .../game/AI/SmartScripts/SmartScript.cpp | 1 + .../game/AI/SmartScripts/SmartScriptMgr.cpp | 3 ++- .../game/AI/SmartScripts/SmartScriptMgr.h | 4 +++- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/game/Miscellaneous/SharedDefines.h | 2 -- .../PointMovementGenerator.cpp | 5 ----- .../boss_valithria_dreamwalker.cpp | 5 +---- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 20 +++++++++---------- 11 files changed, 26 insertions(+), 27 deletions(-) diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h index 94ac452b9f3..68752b82e7f 100755 --- a/src/server/game/AI/CreatureAI.h +++ b/src/server/game/AI/CreatureAI.h @@ -128,8 +128,6 @@ class CreatureAI : public UnitAI void OnCharmed(bool apply); - //virtual void SpellClick(Player* player) {} - // Called at reaching home after evade virtual void JustReachedHome() {} @@ -171,6 +169,8 @@ class CreatureAI : public UnitAI virtual void PassengerBoarded(Unit* /*passenger*/, int8 /*seatId*/, bool /*apply*/) {} + virtual void OnSpellClick(Unit* /*clicker*/) { } + virtual bool CanSeeAlways(WorldObject const* /*obj*/) { return false; } protected: virtual void MoveInLineOfSight(Unit* /*who*/); diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index f8658dd8689..96fc43e0572 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -826,6 +826,11 @@ void SmartAI::sOnGameEvent(bool start, uint16 eventId) GetScript()->ProcessEventsFor(start ? SMART_EVENT_GAME_EVENT_START : SMART_EVENT_GAME_EVENT_END, NULL, eventId); } +void SmartAI::OnSpellClick(Unit* clicker) +{ + GetScript()->ProcessEventsFor(SMART_EVENT_ON_SPELLCLICK, clicker); +} + int SmartGameObjectAI::Permissible(const GameObject* g) { if (g->GetAIName() == "SmartGameObjectAI") diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h index 3a3a7dc9510..79cef0c3b37 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.h +++ b/src/server/game/AI/SmartScripts/SmartAI.h @@ -198,6 +198,8 @@ class SmartAI : public CreatureAI void RemoveAuras(); + void OnSpellClick(Unit* clicker); + private: uint32 mFollowCreditType; uint32 mFollowArrivedTimer; diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 4bc5671b84b..b6624586551 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -2534,6 +2534,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui case SMART_EVENT_JUST_CREATED: case SMART_EVENT_GOSSIP_HELLO: case SMART_EVENT_FOLLOW_COMPLETED: + case SMART_EVENT_ON_SPELLCLICK: ProcessAction(e, unit, var0, var1, bvar, spell, gob); break; case SMART_EVENT_IS_BEHIND_TARGET: diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 426593d1757..de766d2a7e1 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -538,7 +538,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) } case SMART_EVENT_ACTION_DONE: { - if (e.event.doAction.eventId < EVENT_SPELLCLICK || e.event.doAction.eventId > EVENT_CHARGE) + if (e.event.doAction.eventId > EVENT_CHARGE) { sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid event id %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.doAction.eventId); return false; @@ -577,6 +577,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) case SMART_EVENT_GOSSIP_HELLO: case SMART_EVENT_JUST_CREATED: case SMART_EVENT_FOLLOW_COMPLETED: + case SMART_EVENT_ON_SPELLCLICK: break; default: sLog->outErrorDb("SmartAIMgr: Not handled event_type(%u), Entry %d SourceType %u Event %u Action %u, skipped.", e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 0f50985cef4..d71d71ce519 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -154,8 +154,9 @@ enum SMART_EVENT SMART_EVENT_GO_STATE_CHANGED = 70, // go state SMART_EVENT_GO_EVENT_INFORM = 71, // eventId SMART_EVENT_ACTION_DONE = 72, // eventId (SharedDefines.EventId) + SMART_EVENT_ON_SPELLCLICK = 73, // clicker (unit) - SMART_EVENT_END = 73, + SMART_EVENT_END = 74, }; struct SmartEvent @@ -1178,6 +1179,7 @@ const uint32 SmartAIEventMask[SMART_EVENT_END][2] = {SMART_EVENT_GO_STATE_CHANGED, SMART_SCRIPT_TYPE_MASK_GAMEOBJECT }, {SMART_EVENT_GO_EVENT_INFORM, SMART_SCRIPT_TYPE_MASK_GAMEOBJECT }, {SMART_EVENT_ACTION_DONE, SMART_SCRIPT_TYPE_MASK_CREATURE }, + {SMART_EVENT_ON_SPELLCLICK, SMART_SCRIPT_TYPE_MASK_CREATURE }, }; enum SmartEventFlags diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a261a633499..50c8920a0d3 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16935,7 +16935,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId) Creature* creature = ToCreature(); if (creature && creature->IsAIEnabled) - creature->AI()->DoAction(EVENT_SPELLCLICK); + creature->AI()->OnSpellClick(clicker); return true; } diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 06aca10879d..f74d6c44be7 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -3151,8 +3151,6 @@ enum SummonType enum EventId { - EVENT_SPELLCLICK = 1001, - EVENT_FALL_GROUND = 1002, EVENT_CHARGE = 1003, }; diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index a922c937b5f..940be26abe2 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -81,11 +81,6 @@ void PointMovementGenerator::MovementInform(T & /*unit*/) template <> void PointMovementGenerator::MovementInform(Creature &unit) { - //if (id == EVENT_FALL_GROUND) - //{ - // unit.setDeathState(JUST_DIED); - // unit.SetFlying(true); - //} if (unit.AI()) unit.AI()->MovementInform(POINT_MOTION_TYPE, id); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index c40a521c794..31ed1eedf10 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -1013,11 +1013,8 @@ class npc_dream_portal : public CreatureScript { } - void DoAction(int32 const action) + void OnSpellClick(Unit* /*clicker*/) { - if (action != EVENT_SPELLCLICK) - return; - _used = true; me->DespawnOrUnsummon(); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 0e453eceaa1..8ff6c2e1a3a 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -720,20 +720,18 @@ class boss_flame_leviathan_overload_device : public CreatureScript { } - void DoAction(const int32 param) + void OnSpellClick(Unit* /*clicker*/) { - if (param == EVENT_SPELLCLICK) + if (me->GetVehicle()) { - if (me->GetVehicle()) + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + if (Unit* player = me->GetVehicle()->GetPassenger(SEAT_PLAYER)) { - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - if (Unit* player = me->GetVehicle()->GetPassenger(SEAT_PLAYER)) - { - me->GetVehicleBase()->CastSpell(player, SPELL_SMOKE_TRAIL, true); - player->GetMotionMaster()->MoveKnockbackFrom(me->GetVehicleBase()->GetPositionX(), me->GetVehicleBase()->GetPositionY(), 30, 30); - player->ExitVehicle(); - } + me->GetVehicleBase()->CastSpell(player, SPELL_SMOKE_TRAIL, true); + player->GetMotionMaster()->MoveKnockbackFrom(me->GetVehicleBase()->GetPositionX(), me->GetVehicleBase()->GetPositionY(), 30, 30); + player->ExitVehicle(); } } } From 0b947c90b0ef486643d25e5153f2fb36b3f93924 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 18 Jun 2012 20:22:56 -0230 Subject: [PATCH 1066/1149] DB/SAI: Fix quest 11895 "Master the Storm" --- sql/updates/world/2012_06_18_02_world_sai.sql | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 sql/updates/world/2012_06_18_02_world_sai.sql diff --git a/sql/updates/world/2012_06_18_02_world_sai.sql b/sql/updates/world/2012_06_18_02_world_sai.sql new file mode 100644 index 00000000000..0c036d3d5f0 --- /dev/null +++ b/sql/updates/world/2012_06_18_02_world_sai.sql @@ -0,0 +1,41 @@ +-- Fix quest 11895 "Master the Storm" +-- Storm Totem SAI +SET @ENTRY := 26048; +UPDATE `creature_template` SET `npcflag`=`npcflag`&~16777216,`AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,81,16777216,0,0,0,0,0,1,0,0,0,0,0,0,0,'Storm Totem - On spawn - set npcflag'), +(@ENTRY,0,1,2,73,0,100,0,0,0,0,0,12,26045,2,300000,0,0,0,8,0,0,0,3403.829,4133.074,18.13754,5.759586,'Storm Totem - On Spellclick - Spawn Storm Tempest'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Storm Totem - On spawn - remove npcflag'); +-- Storm Tempest SAI +SET @ENTRY := 26045; +UPDATE `creature_template` SET `unit_flags`=0,`AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=26045; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY*100 AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,63,0,100,0,0,0,0,0,11,8609,2,0,0,0,0,1,0,0,0,0,0,0,0,'Storm Totem - On spawn - cast aura'), +(@ENTRY,0,1,0,1,0,100,1,1000,1000,1000,1000,12,23837,2,120000,0,0,0,8,0,0,0,3403.871,4133.031,18.13754,5.67232,'Storm Totem - OOC - Spawn ELM General Purpose Bunny'), +(@ENTRY,0,2,0,60,0,100,1,1000,1000,7000,8000,11,40136,2,0,0,0,0,19,23837,5,0,0,0,0,0,'Storm Totem - Update Event - cast aura'), +(@ENTRY,0,3,4,4,0,100,1,0,0,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,'Storm Totem - On Aggro - Say 0'), +(@ENTRY,0,4,0,61,0,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Storm Totem - On Aggro - Prevent combat movement'), +(@ENTRY,0,5,0,0,0,100,0,0,30,6000,7500,11,15659,0,0,0,0,0,2,0,0,0,0,0,0,0,'Storm Totem - Combat - Cast Chain Lightning'), +(@ENTRY,0,6,0,0,0,100,0,8000,11000,9000,14000,11,31272,0,0,0,0,0,2,0,0,0,0,0,0,0,'Storm Totem - Combat - Cast Wind Shock'), +(@ENTRY,0,7,8,6,0,100,0,0,0,0,0,51,0,0,0,0,0,0,9,23837,0,10,0,0,0,0,'Storm Totem - On death - despawn trigger'), +(@ENTRY,0,8,9,61,0,100,0,0,0,0,0,81,16777216,0,0,0,0,0,19,26048,10,0,0,0,0,0,'Storm Totem - On death - set npc flags on totem'), +(@ENTRY,0,9,0,61,0,100,0,0,0,0,0,85,46424,2,0,0,0,0,16,0,0,0,0,0,0,0,'Storm Totem - Combat - Cast Power of the Storm'); +-- Sage Earth and Sky SAI +SET @ENTRY := 25982; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,20,0,100,0,11895,0,0,0,28,46424,0,0,0,0,0,7,0,0,0,0,0,0,0,'Sage Earth and Sky - On Quest reward - remove aura from player'); +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry`=26045; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(26045,0,0, 'You will not master me, puny $r!',12,0,100,0,0,0, 'Storm Tempest'); +-- Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=26048; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(22,2,26048,0,0,9,0,11895,0,0,0,0, '', 'Storm Totem - Allow sai action only if quest has been taken'), +(22,2,26048,0,0,28,0,11895,0,0,1,0, '', 'Storm Totem - Allow sai action only if quest has not been completed'); From 225d2644ae43c60897f00ecf85a3aac2898dc56b Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 18 Jun 2012 22:41:47 -0230 Subject: [PATCH 1067/1149] DB:SAI: Fix Quest 13231 The Broken Front and 13232 Finish Me! Closes 3223 Closes 6814 --- sql/updates/world/2012_06_18_03_world_sai.sql | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 sql/updates/world/2012_06_18_03_world_sai.sql diff --git a/sql/updates/world/2012_06_18_03_world_sai.sql b/sql/updates/world/2012_06_18_03_world_sai.sql new file mode 100644 index 00000000000..833c64c8d9d --- /dev/null +++ b/sql/updates/world/2012_06_18_03_world_sai.sql @@ -0,0 +1,39 @@ +-- Fix Quest 13231 The Broken Front and 13232 Finish Me! +-- Dying Soldier SAI +SET @ENTRY := 31304; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,62,0,100,0,10040,0,0,0,11,58955,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Cast Alliance Quest Aura on player'), +(@ENTRY,0,1,2,62,0,100,0,10040,3,0,0,11,58955,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Cast Alliance Quest Aura on player'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Close Gossip'), +(@ENTRY,0,3,4,62,0,100,0,10040,1,0,0,85,59226,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Player cast Finish It on npc'), +(@ENTRY,0,4,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Close Gossip'), +(@ENTRY,0,6,7,8,0,100,0,59226,0,0,0,11,3240,2,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Spellhit - Cast Bloody Explosion on self'), +(@ENTRY,0,7,0,61,0,100,0,0,0,0,0,33,31312,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Give Kill credit to player'); +-- Update Gossip +SET @GOSSIP := 10040; +-- Add conditions for gossip text +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,13948,0,28,13231,0,0,0,0,'','Only show gossip text 13948 if player has quest 13231 Complete'), +(14,@GOSSIP,13948,0,14,13232,0,0,0,0,'','Only show gossip text 13948 if player has quest 13232 Not Taken'), +(14,@GOSSIP,14035,0,9,13232,0,0,0,0,'','Only show gossip text 14035 if player has quest 13232 active'); +-- Add conditions for gossip options +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,@GOSSIP,0,0,9,13231,0,0,0,0,'','Only show gossip option 0 if player has if player has quest 13231 active'), +(15,@GOSSIP,1,0,9,13232,0,0,0,0,'','Only show gossip option 1 if player has if player has quest 13232 active'), +(15,@GOSSIP,3,0,28,13231,0,0,0,0,'','Only show gossip option 3 if player has quest 13231 Complete'), +(15,@GOSSIP,3,0,14,13232,0,0,0,0,'','Only show gossip option 3 if player has quest 13232 Not Taken'); +-- Update Gossip options +UPDATE `gossip_menu_option` SET `action_menu_id`=10041 WHERE `menu_id`=10040 AND `id`=0; +-- Fix npcflags for Dying Soldier +UPDATE `creature_template` SET `npcflag`=1 WHERE `entry`=31304; +UPDATE `creature` SET `npcflag`=3 WHERE `guid`=122230; +UPDATE `creature` SET `npcflag`=0 WHERE `guid`=122233; +-- Quest conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (19,20) AND `SourceEntry`=13232; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(19,0,13232,0,28,13231,0,0,0,0, '', 'Quest 13232 Finish Me! Requires Quest 13231 The Broken Front to be complete'), +(20,0,13232,0,28,13231,0,0,0,0, '', 'Quest 13232 Finish Me! Requires Quest 13231 The Broken Front to be complete'); From c19f13e6fcf48650888254a759bfd4a9c17a26c6 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Mon, 18 Jun 2012 15:00:45 +0200 Subject: [PATCH 1068/1149] Core/Commands: Convert cast commands in commandscript --- src/server/game/Chat/Chat.cpp | 12 - src/server/game/Chat/Chat.h | 7 - src/server/game/Chat/Commands/Level3.cpp | 256 ----------------- src/server/game/Scripting/ScriptLoader.cpp | 2 + src/server/scripts/Commands/CMakeLists.txt | 2 +- src/server/scripts/Commands/cs_cast.cpp | 310 +++++++++++++++++++++ 6 files changed, 313 insertions(+), 276 deletions(-) create mode 100644 src/server/scripts/Commands/cs_cast.cpp diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 72011a339f8..7d23b14110b 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -92,17 +92,6 @@ ChatCommand* ChatHandler::getCommandTable() { NULL, 0, false, NULL, "", NULL } }; - static ChatCommand castCommandTable[] = - { - { "back", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastBackCommand>, "", NULL }, - { "dist", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastDistCommand>, "", NULL }, - { "self", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastSelfCommand>, "", NULL }, - { "target", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastTargetCommand>, "", NULL }, - { "dest", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastDestCommand>, "", NULL }, - { "", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - static ChatCommand characterDeletedCommandTable[] = { { "delete", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleCharacterDeletedDeleteCommand>, "", NULL }, @@ -328,7 +317,6 @@ ChatCommand* ChatHandler::getCommandTable() { "pdump", SEC_ADMINISTRATOR, true, NULL, "", pdumpCommandTable }, { "guild", SEC_ADMINISTRATOR, true, NULL, "", guildCommandTable }, { "group", SEC_ADMINISTRATOR, false, NULL, "", groupCommandTable }, - { "cast", SEC_ADMINISTRATOR, false, NULL, "", castCommandTable }, { "reset", SEC_ADMINISTRATOR, true, NULL, "", resetCommandTable }, { "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable }, diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index 0a5cd9391f6..1612de741a6 100755 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -147,13 +147,6 @@ class ChatHandler bool HandleBanListCharacterCommand(const char* args); bool HandleBanListIPCommand(const char* args); - bool HandleCastCommand(const char *args); - bool HandleCastBackCommand(const char *args); - bool HandleCastDistCommand(const char *args); - bool HandleCastSelfCommand(const char *args); - bool HandleCastTargetCommand(const char *args); - bool HandleCastDestCommand(const char *args); - bool HandleCharacterCustomizeCommand(const char* args); bool HandleCharacterChangeFactionCommand(const char* args); bool HandleCharacterChangeRaceCommand(const char * args); diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 4decc7a523f..3898232fa40 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -3814,227 +3814,6 @@ bool ChatHandler::HandleServerPLimitCommand(const char *args) return true; } -bool ChatHandler::HandleCastCommand(const char *args) -{ - if (!*args) - return false; - - Unit* target = getSelectedUnit(); - - if (!target) - { - SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - SetSentErrorMessage(true); - return false; - } - - // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint32 spell = extractSpellIdFromLink((char*)args); - if (!spell) - return false; - - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell); - if (!spellInfo) - { - PSendSysMessage(LANG_COMMAND_NOSPELLFOUND); - SetSentErrorMessage(true); - return false; - } - - if (!SpellMgr::IsSpellValid(spellInfo, m_session->GetPlayer())) - { - PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spell); - SetSentErrorMessage(true); - return false; - } - - char* trig_str = strtok(NULL, " "); - if (trig_str) - { - int l = strlen(trig_str); - if (strncmp(trig_str, "triggered", l) != 0) - return false; - } - - bool triggered = (trig_str != NULL); - - m_session->GetPlayer()->CastSpell(target, spell, triggered); - - return true; -} - -bool ChatHandler::HandleCastBackCommand(const char *args) -{ - Creature* caster = getSelectedCreature(); - - if (!caster) - { - SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - SetSentErrorMessage(true); - return false; - } - - // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r - // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint32 spell = extractSpellIdFromLink((char*)args); - if (!spell || !sSpellMgr->GetSpellInfo(spell)) - { - PSendSysMessage(LANG_COMMAND_NOSPELLFOUND); - SetSentErrorMessage(true); - return false; - } - - char* trig_str = strtok(NULL, " "); - if (trig_str) - { - int l = strlen(trig_str); - if (strncmp(trig_str, "triggered", l) != 0) - return false; - } - - bool triggered = (trig_str != NULL); - - caster->CastSpell(m_session->GetPlayer(), spell, triggered); - - return true; -} - -bool ChatHandler::HandleCastDistCommand(const char *args) -{ - if (!*args) - return false; - - // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint32 spell = extractSpellIdFromLink((char*)args); - if (!spell) - return false; - - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell); - if (!spellInfo) - { - PSendSysMessage(LANG_COMMAND_NOSPELLFOUND); - SetSentErrorMessage(true); - return false; - } - - if (!SpellMgr::IsSpellValid(spellInfo, m_session->GetPlayer())) - { - PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spell); - SetSentErrorMessage(true); - return false; - } - - char *distStr = strtok(NULL, " "); - - float dist = 0; - - if (distStr) - sscanf(distStr, "%f", &dist); - - char* trig_str = strtok(NULL, " "); - if (trig_str) - { - int l = strlen(trig_str); - if (strncmp(trig_str, "triggered", l) != 0) - return false; - } - - bool triggered = (trig_str != NULL); - - float x, y, z; - m_session->GetPlayer()->GetClosePoint(x, y, z, dist); - - m_session->GetPlayer()->CastSpell(x, y, z, spell, triggered); - return true; -} - -bool ChatHandler::HandleCastTargetCommand(const char *args) -{ - Creature* caster = getSelectedCreature(); - - if (!caster) - { - SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - SetSentErrorMessage(true); - return false; - } - - if (!caster->getVictim()) - { - SendSysMessage(LANG_SELECTED_TARGET_NOT_HAVE_VICTIM); - SetSentErrorMessage(true); - return false; - } - - // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint32 spell = extractSpellIdFromLink((char*)args); - if (!spell || !sSpellMgr->GetSpellInfo(spell)) - { - PSendSysMessage(LANG_COMMAND_NOSPELLFOUND); - SetSentErrorMessage(true); - return false; - } - - char* trig_str = strtok(NULL, " "); - if (trig_str) - { - int l = strlen(trig_str); - if (strncmp(trig_str, "triggered", l) != 0) - return false; - } - - bool triggered = (trig_str != NULL); - - caster->CastSpell(caster->getVictim(), spell, triggered); - - return true; -} - -bool ChatHandler::HandleCastDestCommand(const char *args) -{ - Unit* caster = getSelectedUnit(); - if (!caster) - { - SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - SetSentErrorMessage(true); - return false; - } - - // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint32 spell = extractSpellIdFromLink((char*)args); - if (!spell || !sSpellMgr->GetSpellInfo(spell)) - { - PSendSysMessage(LANG_COMMAND_NOSPELLFOUND); - SetSentErrorMessage(true); - return false; - } - - char* px = strtok(NULL, " "); - char* py = strtok(NULL, " "); - char* pz = strtok(NULL, " "); - - if (!px || !py || !pz) - return false; - - float x = (float)atof(px); - float y = (float)atof(py); - float z = (float)atof(pz); - - char* trig_str = strtok(NULL, " "); - if (trig_str) - { - int l = strlen(trig_str); - if (strncmp(trig_str, "triggered", l) != 0) - return false; - } - - bool triggered = (trig_str != NULL); - - caster->CastSpell(x, y, z, spell, triggered); - - return true; -} - /* ComeToMe command REQUIRED for 3rd party scripting library to have access to PointMovementGenerator Without this function 3rd party scripting library will get linking errors (unresolved external) @@ -4061,41 +3840,6 @@ bool ChatHandler::HandleComeToMeCommand(const char *args) return true; } -bool ChatHandler::HandleCastSelfCommand(const char *args) -{ - if (!*args) - return false; - - Unit* target = getSelectedUnit(); - - if (!target) - { - SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - SetSentErrorMessage(true); - return false; - } - - // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint32 spell = extractSpellIdFromLink((char*)args); - if (!spell) - return false; - - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell); - if (!spellInfo) - return false; - - if (!SpellMgr::IsSpellValid(spellInfo, m_session->GetPlayer())) - { - PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spell); - SetSentErrorMessage(true); - return false; - } - - target->CastSpell(target, spell, false); - - return true; -} - /// Define the 'Message of the day' for the realm bool ChatHandler::HandleServerSetMotdCommand(const char *args) { diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index a1a23ca7074..8bc4ce24665 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -46,6 +46,7 @@ void AddSC_SmartSCripts(); //Commands void AddSC_account_commandscript(); void AddSC_achievement_commandscript(); +void AddSC_cast_commandscript(); void AddSC_debug_commandscript(); void AddSC_event_commandscript(); void AddSC_gm_commandscript(); @@ -649,6 +650,7 @@ void AddCommandScripts() { AddSC_account_commandscript(); AddSC_achievement_commandscript(); + AddSC_cast_commandscript(); AddSC_debug_commandscript(); AddSC_event_commandscript(); AddSC_gm_commandscript(); diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index 867d54a3cc6..77d42ac5fd1 100644 --- a/src/server/scripts/Commands/CMakeLists.txt +++ b/src/server/scripts/Commands/CMakeLists.txt @@ -12,6 +12,7 @@ set(scripts_STAT_SRCS ${scripts_STAT_SRCS} Commands/cs_account.cpp Commands/cs_achievement.cpp + Commands/cs_cast.cpp Commands/cs_debug.cpp Commands/cs_event.cpp Commands/cs_gm.cpp @@ -33,7 +34,6 @@ set(scripts_STAT_SRCS # Commands/cs_lookup.cpp # Commands/cs_pdump.cpp # Commands/cs_guild.cpp -# Commands/cs_cast.cpp # Commands/cs_reset.cpp # Commands/cs_server.cpp # Commands/cs_channel.cpp diff --git a/src/server/scripts/Commands/cs_cast.cpp b/src/server/scripts/Commands/cs_cast.cpp new file mode 100644 index 00000000000..33983411427 --- /dev/null +++ b/src/server/scripts/Commands/cs_cast.cpp @@ -0,0 +1,310 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +Name: cast_commandscript +%Complete: 100 +Comment: All cast related commands +Category: commandscripts +EndScriptData */ + +#include "ScriptMgr.h" +#include "Chat.h" + +class cast_commandscript : public CommandScript +{ +public: + cast_commandscript() : CommandScript("cast_commandscript") { } + + ChatCommand* GetCommands() const + { + static ChatCommand castCommandTable[] = + { + { "back", SEC_ADMINISTRATOR, false, &HandleCastBackCommand, "", NULL }, + { "dist", SEC_ADMINISTRATOR, false, &HandleCastDistCommand, "", NULL }, + { "self", SEC_ADMINISTRATOR, false, &HandleCastSelfCommand, "", NULL }, + { "target", SEC_ADMINISTRATOR, false, &HandleCastTargetCommad, "", NULL }, + { "dest", SEC_ADMINISTRATOR, false, &HandleCastDestCommand, "", NULL }, + { "", SEC_ADMINISTRATOR, false, &HandleCastCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + static ChatCommand commandTable[] = + { + { "cast", SEC_ADMINISTRATOR, false, NULL, "", castCommandTable }, + { NULL, 0, false, NULL, "", NULL } + }; + return commandTable; + } + + static bool HandleCastCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + Unit* target = handler->getSelectedUnit(); + if (!target) + { + handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + + // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form + uint32 spellId = handler->extractSpellIdFromLink((char*)args); + if (!spellId) + return false; + + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); + if (!spellInfo) + { + handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND); + handler->SetSentErrorMessage(true); + return false; + } + + if (!SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer())) + { + handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId); + handler->SetSentErrorMessage(true); + return false; + } + + char* triggeredStr = strtok(NULL, " "); + if (triggeredStr) + { + int l = strlen(triggeredStr); + if (strncmp(triggeredStr, "triggered", l) != 0) + return false; + } + + bool triggered = (triggeredStr != NULL); + + handler->GetSession()->GetPlayer()->CastSpell(target, spellId, triggered); + + return true; + } + + static bool HandleCastBackCommand(ChatHandler* handler, char const* args) + { + Creature* caster = handler->getSelectedCreature(); + if (!caster) + { + handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + + // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r + // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form + uint32 spellId = handler->extractSpellIdFromLink((char*)args); + if (!spellId || !sSpellMgr->GetSpellInfo(spellId)) + { + handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND); + handler->SetSentErrorMessage(true); + return false; + } + + char* triggeredStr = strtok(NULL, " "); + if (triggeredStr) + { + int l = strlen(triggeredStr); + if (strncmp(triggeredStr, "triggered", l) != 0) + return false; + } + + bool triggered = (triggeredStr != NULL); + + caster->CastSpell(handler->GetSession()->GetPlayer(), spellId, triggered); + + return true; + } + + static bool HandleCastDistCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form + uint32 spellId = handler->extractSpellIdFromLink((char*)args); + if (!spellId) + return false; + + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); + if (!spellInfo) + { + handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND); + handler->SetSentErrorMessage(true); + return false; + } + + if (!SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer())) + { + handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId); + handler->SetSentErrorMessage(true); + return false; + } + + char* distStr = strtok(NULL, " "); + + float dist = 0; + + if (distStr) + sscanf(distStr, "%f", &dist); + + char* triggeredStr = strtok(NULL, " "); + if (triggeredStr) + { + int l = strlen(triggeredStr); + if (strncmp(triggeredStr, "triggered", l) != 0) + return false; + } + + bool triggered = (triggeredStr != NULL); + + float x, y, z; + handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, dist); + + handler->GetSession()->GetPlayer()->CastSpell(x, y, z, spellId, triggered); + + return true; + } + + static bool HandleCastSelfCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + Unit* target = handler->getSelectedUnit(); + if (!target) + { + handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + + // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form + uint32 spellId = handler->extractSpellIdFromLink((char*)args); + if (!spellId) + return false; + + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); + if (!spellInfo) + return false; + + if (!SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer())) + { + handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId); + handler->SetSentErrorMessage(true); + return false; + } + + target->CastSpell(target, spellId, false); + + return true; + } + + static bool HandleCastTargetCommad(ChatHandler* handler, char const* args) + { + Creature* caster = handler->getSelectedCreature(); + if (!caster) + { + handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + + if (!caster->getVictim()) + { + handler->SendSysMessage(LANG_SELECTED_TARGET_NOT_HAVE_VICTIM); + handler->SetSentErrorMessage(true); + return false; + } + + // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form + uint32 spellId = handler->extractSpellIdFromLink((char*)args); + if (!spellId || !sSpellMgr->GetSpellInfo(spellId)) + { + handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND); + handler->SetSentErrorMessage(true); + return false; + } + + char* triggeredStr = strtok(NULL, " "); + if (triggeredStr) + { + int l = strlen(triggeredStr); + if (strncmp(triggeredStr, "triggered", l) != 0) + return false; + } + + bool triggered = (triggeredStr != NULL); + + caster->CastSpell(caster->getVictim(), spellId, triggered); + + return true; + } + + static bool HandleCastDestCommand(ChatHandler* handler, char const* args) + { + Unit* caster = handler->getSelectedUnit(); + if (!caster) + { + handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + + // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form + uint32 spellId = handler->extractSpellIdFromLink((char*)args); + if (!spellId || !sSpellMgr->GetSpellInfo(spellId)) + { + handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND); + handler->SetSentErrorMessage(true); + return false; + } + + char* posX = strtok(NULL, " "); + char* posY = strtok(NULL, " "); + char* posZ = strtok(NULL, " "); + + if (!posX || !posY || !posZ) + return false; + + float x = float(atof(posX)); + float y = float(atof(posY)); + float z = float(atof(posZ)); + + char* triggeredStr = strtok(NULL, " "); + if (triggeredStr) + { + int l = strlen(triggeredStr); + if (strncmp(triggeredStr, "triggered", l) != 0) + return false; + } + + bool triggered = (triggeredStr != NULL); + + caster->CastSpell(x, y, z, spellId, triggered); + + return true; + } +}; + +void AddSC_cast_commandscript() +{ + new cast_commandscript(); +} From f166fe62fc12a5bc228123c3228efefb9ec410a7 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Tue, 19 Jun 2012 19:13:14 -0230 Subject: [PATCH 1069/1149] DB/SAI: Fix up Quest to prevend Startup errors. --- sql/updates/world/2012_06_19_00_world_sai.sql | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sql/updates/world/2012_06_19_00_world_sai.sql diff --git a/sql/updates/world/2012_06_19_00_world_sai.sql b/sql/updates/world/2012_06_19_00_world_sai.sql new file mode 100644 index 00000000000..fdfc5aec5f8 --- /dev/null +++ b/sql/updates/world/2012_06_19_00_world_sai.sql @@ -0,0 +1,25 @@ +-- Fix Quest 13231 The Broken Front and 13232 Finish Me! +-- Dying Soldier SAI +SET @ENTRY := 31304; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,62,0,100,0,10040,0,0,0,11,58955,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Cast Alliance Quest Aura on player'), +(@ENTRY,0,1,2,62,0,100,0,10040,3,0,0,81,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Set npcflag'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Close Gossip'), +(@ENTRY,0,3,4,62,0,100,0,10040,1,0,0,85,59226,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Player cast Finish It on npc'), +(@ENTRY,0,4,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Close Gossip'), +(@ENTRY,0,6,7,8,0,100,0,59226,0,0,0,11,3240,2,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Spellhit - Cast Bloody Explosion on self'), +(@ENTRY,0,7,0,61,0,100,0,0,0,0,0,33,31312,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Give Kill credit to player'), +(@ENTRY,0,8,9,25,0,100,0,0,0,0,0,81,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Spawn - Set npcflag'), +(@ENTRY,0,9,0,61,0,100,0,0,0,0,0,8,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Spawn - Set react state'), +(@ENTRY,0,10,0,19,0,100,0,13232,0,0,0,81,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Quest accept - Set npcflag'); +-- Creature updates +UPDATE `creature_template` SET `npcflag`=3,`RegenHealth`=0 WHERE `entry`=31304; +UPDATE `creature` SET `npcflag`=0 WHERE `guid`=122230; +UPDATE `creature` SET `curhealth`=37 WHERE `id`=31304; + +-- Start Fixing Quest 13228 The Broken Front and 13230 No Mercy! +-- Creature updates +UPDATE `creature_template` SET `npcflag`=3,`RegenHealth`=0 WHERE `entry`=31273; +UPDATE `creature` SET `curhealth`=37 WHERE `id`=31273; From be2d3246da0653701fe5f29151c9ac0abb151b91 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Tue, 19 Jun 2012 19:14:29 -0230 Subject: [PATCH 1070/1149] DB?Gossip: Gossip fixes from Pitcrawler Closes 6772 --- .../world/2012_06_19_01_world_gossip.sql | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 sql/updates/world/2012_06_19_01_world_gossip.sql diff --git a/sql/updates/world/2012_06_19_01_world_gossip.sql b/sql/updates/world/2012_06_19_01_world_gossip.sql new file mode 100644 index 00000000000..7800d2a9740 --- /dev/null +++ b/sql/updates/world/2012_06_19_01_world_gossip.sql @@ -0,0 +1,161 @@ +-- Creature Gossip_menu_id Update from sniff +UPDATE `creature_template` SET `gossip_menu_id`=8871 WHERE `entry`=4501; -- Draz'Zilb +UPDATE `creature_template` SET `gossip_menu_id`=4004 WHERE `entry`=4885; -- Gregor MacVince +UPDATE `creature_template` SET `gossip_menu_id`=541 WHERE `entry`=4895; -- Smiling Jim +UPDATE `creature_template` SET `gossip_menu_id`=4122 WHERE `entry`=4900; -- Alchemist Narett +UPDATE `creature_template` SET `gossip_menu_id`=8840 WHERE `entry`=4921; -- Guard Byron +UPDATE `creature_template` SET `gossip_menu_id`=1186 WHERE `entry`=4926; -- Krog +UPDATE `creature_template` SET `gossip_menu_id`=1161 WHERE `entry`=4944; -- Captain Garran Vimes +UPDATE `creature_template` SET `gossip_menu_id`=5301 WHERE `entry`=4967; -- Archmage Tervosh +UPDATE `creature_template` SET `gossip_menu_id`=2465 WHERE `entry`=4968; -- Lady Jaina Proudmoore +UPDATE `creature_template` SET `gossip_menu_id`=8793 WHERE `entry`=5086; -- Captain Wymor +UPDATE `creature_template` SET `gossip_menu_id`=2916 WHERE `entry`=6546; -- Tabetha +UPDATE `creature_template` SET `gossip_menu_id`=4091 WHERE `entry`=8141; -- Captain Evencane +UPDATE `creature_template` SET `gossip_menu_id`=4355 WHERE `entry`=11052; -- Timothy Worthington +UPDATE `creature_template` SET `gossip_menu_id`=5382 WHERE `entry`=12939; -- Doctor Gustaf VanHowzen +UPDATE `creature_template` SET `gossip_menu_id`=8761 WHERE `entry`=23567; -- Inspector Tarem +UPDATE `creature_template` SET `gossip_menu_id`=8788 WHERE `entry`=23568; -- Captain Darill +UPDATE `creature_template` SET `gossip_menu_id`=8837 WHERE `entry`=23569; -- Renn McGill +UPDATE `creature_template` SET `gossip_menu_id`=8801 WHERE `entry`=23579; -- Brogg +UPDATE `creature_template` SET `gossip_menu_id`=8811 WHERE `entry`=23600; -- Apprentice Morlann +UPDATE `creature_template` SET `gossip_menu_id`=8812 WHERE `entry`=23601; -- Apprentice Garion +UPDATE `creature_template` SET `gossip_menu_id`=8762 WHERE `entry`=23602; -- Deserter Agitator +UPDATE `creature_template` SET `gossip_menu_id`=8782 WHERE `entry`=23704; -- Cassa Crimsonwing +UPDATE `creature_template` SET `gossip_menu_id`=8787 WHERE `entry`=23723; -- Sergeant Lukas +UPDATE `creature_template` SET `gossip_menu_id`=8830 WHERE `entry`=23797; -- Moxie Steelgrille +UPDATE `creature_template` SET `gossip_menu_id`=8831 WHERE `entry`=23835; -- Sergeant Amelyn +UPDATE `creature_template` SET `gossip_menu_id`=8826 WHERE `entry`=23896; -- "Dirty" Michael Crowe +UPDATE `creature_template` SET `gossip_menu_id`=8835 WHERE `entry`=23949; -- Lieutenant Nath +UPDATE `creature_template` SET `gossip_menu_id`=8836 WHERE `entry`=23950; -- Lieutenant Khand +UPDATE `creature_template` SET `gossip_menu_id`=8912 WHERE `entry`=24208; -- "Little" Logok +UPDATE `creature_template` SET `gossip_menu_id`=9342 WHERE `entry`=26546; -- Ludin Farrow + +-- Gossip Menu insert from sniff +DELETE FROM `gossip_menu` WHERE `entry`=541 AND `text_id`=1058; +DELETE FROM `gossip_menu` WHERE `entry`=1161 AND `text_id`=1793; +DELETE FROM `gossip_menu` WHERE `entry`=1162 AND `text_id`=1794; +DELETE FROM `gossip_menu` WHERE `entry`=1186 AND `text_id`=1818; +DELETE FROM `gossip_menu` WHERE `entry`=1187 AND `text_id`=1819; +DELETE FROM `gossip_menu` WHERE `entry`=1188 AND `text_id`=1820; +DELETE FROM `gossip_menu` WHERE `entry`=2465 AND `text_id`=3157; +DELETE FROM `gossip_menu` WHERE `entry`=2916 AND `text_id`=3590; +DELETE FROM `gossip_menu` WHERE `entry`=4004 AND `text_id`=5855; +DELETE FROM `gossip_menu` WHERE `entry`=4091 AND `text_id`=4991; +DELETE FROM `gossip_menu` WHERE `entry`=4122 AND `text_id`=5049; +DELETE FROM `gossip_menu` WHERE `entry`=4355 AND `text_id`=5571; +DELETE FROM `gossip_menu` WHERE `entry`=5301 AND `text_id`=6333; +DELETE FROM `gossip_menu` WHERE `entry`=5382 AND `text_id`=6414; +DELETE FROM `gossip_menu` WHERE `entry`=8761 AND `text_id`=11126; +DELETE FROM `gossip_menu` WHERE `entry`=8762 AND `text_id`=11136; +DELETE FROM `gossip_menu` WHERE `entry`=8782 AND `text_id`=11224; +DELETE FROM `gossip_menu` WHERE `entry`=8787 AND `text_id`=11243; +DELETE FROM `gossip_menu` WHERE `entry`=8788 AND `text_id`=11245; +DELETE FROM `gossip_menu` WHERE `entry`=8793 AND `text_id`=11264; +DELETE FROM `gossip_menu` WHERE `entry`=8801 AND `text_id`=11281; +DELETE FROM `gossip_menu` WHERE `entry`=8811 AND `text_id`=11309; +DELETE FROM `gossip_menu` WHERE `entry`=8812 AND `text_id`=11311; +DELETE FROM `gossip_menu` WHERE `entry`=8826 AND `text_id`=11376; +DELETE FROM `gossip_menu` WHERE `entry`=8830 AND `text_id`=11403; +DELETE FROM `gossip_menu` WHERE `entry`=8831 AND `text_id`=11406; +DELETE FROM `gossip_menu` WHERE `entry`=8835 AND `text_id`=11426; +DELETE FROM `gossip_menu` WHERE `entry`=8836 AND `text_id`=11428; +DELETE FROM `gossip_menu` WHERE `entry`=8837 AND `text_id`=11432; +DELETE FROM `gossip_menu` WHERE `entry`=8840 AND `text_id`=11457; +DELETE FROM `gossip_menu` WHERE `entry`=8871 AND `text_id`=11567; +DELETE FROM `gossip_menu` WHERE `entry`=8912 AND `text_id`=11797; +DELETE FROM `gossip_menu` WHERE `entry`=9342 AND `text_id`=12642; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(541,1058), +(1161,1793), +(1162,1794), +(1186,1818), +(1187,1819), +(1188,1820), +(2465,3157), +(2916,3590), +(4004,5855), +(4091,4991), +(4122,5049), +(4355,5571), +(5301,6333), +(5382,6414), +(8761,11126), +(8762,11136), +(8782,11224), +(8787,11243), +(8788,11245), +(8793,11264), +(8801,11281), +(8811,11309), +(8812,11311), +(8826,11376), +(8830,11403), +(8831,11406), +(8835,11426), +(8836,11428), +(8837,11432), +(8840,11457), +(8871,11567), +(8912,11797), +(9342,12642); + +-- Creature Gossip_menu_option insert from sniff +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1161,4122,4355,5382,8761,8762) AND `id`=0; +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1186,8826,8912) AND `id` IN (0,1); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(1161,0,0,'What have you heard of the Shady Rest Inn?',1,1,1162,0,0,0,''), +(1186,0,0,'The Burning Inn.',1,1,1187,0,0,0,''), +(1186,1,0,'Paval Reethe.',1,1,1188,0,0,0,''), +(4122,0,3,'Train me.',5,16,0,0,0,0,''), +(4355,0,3,'Train me.',5,16,0,0,0,0,''), +(5382,0,3,'Train me.',5,16,0,0,0,0,''), +(8761,0,0,'Can you spread the reflective dust again?',1,1,0,0,0,0,''), +(8762,0,0,'Your propaganda won''t work on me. Spout your treasonous filth elsewhere, traitor!',1,1,0,0,0,0,''), +(8826,0,3,'Train me.',5,16,0,0,0,0,''), +(8826,1,1,'Show me what you have for sale.',3,128,0,0,0,0,''), +(8912,0,5,'Make this inn your home.',8,65536,0,0,0,0,''), +(8912,1,1,'I want to browse your goods.',3,128,0,0,0,0,''); + +SET @NPC_DESERTER := 23602; +SET @NPC_INSPECTOR := 23567; +SET @SPELL_DISCOVERED_SUB := 42219; + +-- Insert creature_text from sniff +DELETE FROM `creature_text` WHERE `entry`=@NPC_DESERTER; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@NPC_DESERTER,0,0,'It''s good to see you defending Theramore with pride, friend.',12,7,100,25,0,0,'Deserter Agitator'), +(@NPC_DESERTER,0,1,'When you''re off duty, let''s go to the inn. I''ll buy a round and we can reminisce about the good old days.',12,7,100,1,0,0,'Deserter Agitator'), +(@NPC_DESERTER,0,2,'Wouldn''t you like to bring those days back? I have some friends who know just the way to do that...''',12,7,100,1,0,0,'Deserter Agitator'), +(@NPC_DESERTER,1,0,'These people will know Admiral Proudmoore for the true hero he was!',12,7,100,5,0,0,'Deserter Agitator'), +(@NPC_DESERTER,1,1,'You can''t stop us from exposing the truth about Jaina''s cowardice!',12,7,100,5,0,0,'Deserter Agitator'), +(@NPC_DESERTER,1,2,'If you think you can stop us, you''re mistaken, ''friend.''',12,7,100,5,0,0,'Deserter Agitator'), +(@NPC_DESERTER,1,3,'It''s people like you who weaken the Alliance and invite the Horde to take away all we''ve fought for!',12,7,100,5,0,0,'Deserter Agitator'); + +-- Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=@SPELL_DISCOVERED_SUB; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8762 AND `SourceEntry`=0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,@SPELL_DISCOVERED_SUB,0,0,31,0,3,23602,0,0,0,'','Spell Discovered (Sub) only targets Deserter Agitator'), +(15,8762,0,0,0,9,0,11126,0,0,0,0,'','Show gossip option only if player has taken quest 11126'); + +-- SmartAI +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_INSPECTOR,@NPC_DESERTER) AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_DESERTER*100,@NPC_DESERTER*100+1) AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@NPC_INSPECTOR,0,0,1,62,0,100,0,8761,0,0,0,11,42169,0,0,0,0,0,7,0,0,0,0,0,0,0,'Inspector Tarem - On Gossip option select - Cast Reflective Dust'), +(@NPC_INSPECTOR,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Inspector Tarem - On Gossip option select - Close Gossip'), + +(@NPC_DESERTER,0,0,0,25,0,100,0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Deserter Agitator - On reset - Set faction default'), +(@NPC_DESERTER,0,1,0,1,0,100,0,0,1,30000,40000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Deserter Agitator - On update OOC - Say line'), +(@NPC_DESERTER,0,2,3,62,0,100,0,8762,0,0,0,11,42203,0,0,0,0,0,7,0,0,0,0,0,0,0,'Deserter Agitator - On Gossip option select - Cast Discovered'), +(@NPC_DESERTER,0,3,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Deserter Agitator - On Gossip option select - Close Gossip'), +(@NPC_DESERTER,0,4,5,8,0,100,0,@SPELL_DISCOVERED_SUB,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Deserter Agitator - On spellhit Discovered (Sub) - Turn to invoker'), +(@NPC_DESERTER,0,5,6,61,0,100,0,0,0,0,0,1,1,0,0,0,0,0,7,0,0,0,0,0,0,0,'Deserter Agitator - On spellhit Discovered (Sub) - Say line'), +(@NPC_DESERTER,0,6,0,61,0,100,0,0,0,0,0,87,@NPC_DESERTER*100,@NPC_DESERTER*100+1,0,0,0,0,1,0,0,0,0,0,0,0,'Deserter Agitator - On spellhit Discovered (Sub) - Run script'), + +(@NPC_DESERTER*100,9,0,0,0,0,100,0,2000,2000,0,0,2,14,0,0,0,0,0,1,0,0,0,0,0,0,0,'Deserter Agitator''s script 0 - Set faction monster'), +(@NPC_DESERTER*100,9,1,0,0,0,100,0,0,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Deserter Agitator''s script 0 - Attack'), + +(@NPC_DESERTER*100+1,9,0,0,0,0,100,0,0,0,0,0,83,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Deserter Agitator''s script 1 - Remove npcflag gossip'), +(@NPC_DESERTER*100+1,9,1,0,0,0,100,0,0,0,0,0,33,@NPC_DESERTER,0,0,0,0,0,7,0,0,0,0,0,0,0,'Deserter Agitator''s script 1 - Credit'), +(@NPC_DESERTER*100+1,9,2,0,0,0,100,0,30000,30000,0,0,82,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Deserter Agitator''s script 1 - Add npcflag gossip'); From 35b444fdb8e1be43c261b23bbeb8a94cefada93a Mon Sep 17 00:00:00 2001 From: Elron103 Date: Wed, 20 Jun 2012 01:52:31 +0200 Subject: [PATCH 1071/1149] Core/Movement: Implement speed changes for PointMovementGenerator --- .../MovementGenerators/PointMovementGenerator.cpp | 12 ++++++++++++ .../MovementGenerators/PointMovementGenerator.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index a922c937b5f..0496d0862af 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -33,6 +33,7 @@ void PointMovementGenerator::Initialize(T &unit) unit.StopMoving(); unit.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE); + i_recalculateSpeed = false; Movement::MoveSplineInit init(unit); init.MoveTo(i_x, i_y, i_z); if (speed > 0.0f) @@ -53,6 +54,17 @@ bool PointMovementGenerator::Update(T &unit, const uint32 & /*diff*/) } unit.AddUnitState(UNIT_STATE_ROAMING_MOVE); + + if (i_recalculateSpeed && !unit.movespline->Finalized()) + { + i_recalculateSpeed = false; + Movement::MoveSplineInit init(unit); + init.MoveTo(i_x, i_y, i_z); + if (speed > 0.0f) // Default value for point motion type is 0.0, if 0.0 spline will use GetSpeed on unit + init.SetVelocity(speed); + init.Launch(); + } + return !unit.movespline->Finalized(); } diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h index 13be9fee77b..d2833a5ee10 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h @@ -36,6 +36,8 @@ class PointMovementGenerator : public MovementGeneratorMedium< T, PointMovementG void MovementInform(T &); + void unitSpeedChanged() { i_recalculateSpeed = true; } + MovementGeneratorType GetMovementGeneratorType() { return POINT_MOTION_TYPE; } bool GetDestination(float& x, float& y, float& z) const { x=i_x; y=i_y; z=i_z; return true; } @@ -43,6 +45,7 @@ class PointMovementGenerator : public MovementGeneratorMedium< T, PointMovementG uint32 id; float i_x, i_y, i_z; float speed; + bool i_recalculateSpeed; }; class AssistanceMovementGenerator : public PointMovementGenerator From 793421be7aa1d4efe0be28539441a92f72f3c978 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Tue, 19 Jun 2012 21:53:45 -0230 Subject: [PATCH 1072/1149] DB/Misc: Some spawn fixes and a path added to Dragonblight. --- .../world/2012_06_19_02_world_misc.sql | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sql/updates/world/2012_06_19_02_world_misc.sql diff --git a/sql/updates/world/2012_06_19_02_world_misc.sql b/sql/updates/world/2012_06_19_02_world_misc.sql new file mode 100644 index 00000000000..32aa493f4f7 --- /dev/null +++ b/sql/updates/world/2012_06_19_02_world_misc.sql @@ -0,0 +1,98 @@ +-- Add missing spawns +SET @GUID := 42875; +SET @ENTRY := 26257; +DELETE FROM `creature` WHERE `guid` IN (@GUID,@GUID+1); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@GUID,@ENTRY,571,1,1,0,0,3369.694,2528.735,197.4004,3.490659,180,0,0,1,0,0), +(@GUID+1,@ENTRY,571,1,1,0,0,3346.363,2534.127,197.4004,4.258604,180,0,0,1,0,0); +-- Add SAI +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (-42875,-42876,-109574,-109575) AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(-42875,0,0,0,1,0,100,1,1000,1000,30000,30000,11,46906,2,0,0,0,0,10,115101,27853,0,0,0,0,0,'Surge Needle Sorcerer - OOC - Cast Surge Needle Beam'), +(-42875,0,1,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Surge Needle Sorcerer - Combat - Cast Arcane Blast on victim'), +(-42876,0,0,0,1,0,100,1,1000,1000,30000,30000,11,46906,2,0,0,0,0,10,115101,27853,0,0,0,0,0,'Surge Needle Sorcerer - OOC - Cast Surge Needle Beam'), +(-42876,0,1,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Surge Needle Sorcerer - Combat - Cast Arcane Blast on victim'), +(-109574,0,0,0,1,0,100,1,1000,1000,30000,30000,11,46906,2,0,0,0,0,10,115101,27853,0,0,0,0,0,'Surge Needle Sorcerer - OOC - Cast Surge Needle Beam'), +(-109574,0,1,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Surge Needle Sorcerer - Combat - Cast Arcane Blast on victim'), +(-109575,0,0,0,1,0,100,1,1000,1000,30000,30000,11,46906,2,0,0,0,0,10,115101,27853,0,0,0,0,0,'Surge Needle Sorcerer - OOC - Cast Surge Needle Beam'), +(-109575,0,1,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Surge Needle Sorcerer - Combat - Cast Arcane Blast on victim'); +-- Add missing go +SET @GUID := 325; +SET @ENTRY := 188448; +DELETE FROM `gameobject` WHERE `guid` IN (@GUID); +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(@GUID,@ENTRY,571,1,1,3346.398,2534.092,197.3171,2.82743,0,0,0.9876881,0.1564362,180,255,1); + +-- Pathing for Nexus Guardian +SET @NPC := 111304; +SET @PATH := @NPC*10; +DELETE FROM `creature` WHERE `guid`=@NPC; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@NPC,26276,571,1,1,0,0,3560.472,1769.351,171.9977,1.91463,120,0,0,1,0,2); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`) VALUES (@NPC,@PATH,50331648,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3560.472,1769.351,171.9977,0,0,0,100,0), +(@PATH,2,3567.688,1720.065,171.9977,0,0,0,100,0), +(@PATH,3,3575.305,1671.264,171.9977,0,0,0,100,0), +(@PATH,4,3614.985,1641.572,171.9977,0,0,0,100,0), +(@PATH,5,3661.11,1627.888,179.4142,0,0,0,100,0), +(@PATH,6,3710.721,1625.472,184.0807,0,0,0,100,0), +(@PATH,7,3758.05,1626.899,186.8029,0,0,0,100,0), +(@PATH,8,3806.817,1636.863,186.8029,0,0,0,100,0), +(@PATH,9,3855.013,1638.274,186.8029,0,0,0,100,0), +(@PATH,10,3893.953,1607.221,186.8029,0,0,0,100,0), +(@PATH,11,3908.07,1563.533,186.8029,0,0,0,100,0), +(@PATH,12,3892.732,1516.304,186.8029,0,0,0,100,0), +(@PATH,13,3853.05,1486.712,186.8029,0,0,0,100,0), +(@PATH,14,3804.016,1484.734,186.8029,0,0,0,100,0), +(@PATH,15,3768.95,1518.886,186.8029,0,0,0,100,0), +(@PATH,16,3741.332,1558.961,193.6083,0,0,0,100,0), +(@PATH,17,3735.918,1607.949,197.9415,0,0,0,100,0), +(@PATH,18,3726.846,1656.945,201.9971,0,0,0,100,0), +(@PATH,19,3706.031,1701.895,208.3303,0,0,0,100,0), +(@PATH,20,3693.807,1748.982,208.3303,0,0,0,100,0), +(@PATH,21,3686.946,1791.952,208.3303,0,0,0,100,0), +(@PATH,22,3684.135,1840.943,208.3303,0,0,0,100,0), +(@PATH,23,3693.31,1889.799,208.3303,0,0,0,100,0), +(@PATH,24,3710.331,1936.957,208.3303,0,0,0,100,0), +(@PATH,25,3708.896,1985.871,203.9415,0,0,0,100,0), +(@PATH,26,3711.546,2034.778,199.0248,0,0,0,100,0), +(@PATH,27,3700.25,2079.795,185.8581,0,0,0,100,0), +(@PATH,28,3671.014,2118.18,175.6918,0,0,0,100,0), +(@PATH,29,3627.495,2141.961,170.8588,0,0,0,100,0), +(@PATH,30,3582.266,2162.844,165.0257,0,0,0,100,0), +(@PATH,31,3536.079,2181.72,161.0814,0,0,0,100,0), +(@PATH,32,3492.185,2203.827,153.3039,0,0,0,100,0), +(@PATH,33,3449.847,2227.899,147.0816,0,0,0,100,0), +(@PATH,34,3411.07,2258.388,138.6929,0,0,0,100,0), +(@PATH,35,3372.244,2288.043,130.0542,0,0,0,100,0), +(@PATH,36,3334.966,2320.363,127.8878,0,0,0,100,0), +(@PATH,37,3302.867,2358.885,123.2211,0,0,0,100,0), +(@PATH,38,3272.494,2397.996,120.9432,0,0,0,100,0), +(@PATH,39,3239.637,2434.888,118.8322,0,0,0,100,0), +(@PATH,40,3212.678,2476.519,116.0821,0,0,0,100,0), +(@PATH,41,3211.545,2525.56,108.0818,0,0,0,100,0), +(@PATH,42,3250.958,2578.278,107.5538,0,0,0,100,0), +(@PATH,43,3293.958,2602.603,107.5538,0,0,0,100,0), +(@PATH,44,3342.687,2610.276,112.9983,0,0,0,100,0), +(@PATH,45,3386.911,2594.68,123.2483,0,0,0,100,0), +(@PATH,46,3415.89,2554.956,128.7483,0,0,0,100,0), +(@PATH,47,3424.978,2506.423,128.7483,0,0,0,100,0), +(@PATH,48,3417.17,2457.855,128.7483,0,0,0,100,0), +(@PATH,49,3403.204,2427.43,128.7483,0,0,0,100,0), +(@PATH,50,3373.681,2392.189,128.7483,0,0,0,100,0), +(@PATH,51,3355.053,2347.842,128.7483,0,0,0,100,0), +(@PATH,52,3358.651,2298.717,128.7483,0,0,0,100,0), +(@PATH,53,3365.574,2249.818,135.9983,0,0,0,100,0), +(@PATH,54,3382.769,2202.925,136.9983,0,0,0,100,0), +(@PATH,55,3406.081,2159.531,144.9981,0,0,0,100,0), +(@PATH,56,3435.854,2119.649,151.8868,0,0,0,100,0), +(@PATH,57,3465.756,2080.089,151.8868,0,0,0,100,0), +(@PATH,58,3482.463,2041.774,142.5257,0,0,0,100,0), +(@PATH,59,3503.596,1996.099,137.0257,0,0,0,100,0), +(@PATH,60,3521.709,1951.099,137.0257,0,0,0,100,0), +(@PATH,61,3531.027,1914.229,150.5535,0,0,0,100,0), +(@PATH,62,3542.625,1866.008,158.9424,0,0,0,100,0), +(@PATH,63,3550.662,1817.174,163.9979,0,0,0,100,0); From ab3430762d965f84717fdf7a18e2cbc2271c436a Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 20 Jun 2012 12:39:34 -0230 Subject: [PATCH 1073/1149] DB/Gossip: Some gossip updates from pitcrawler and remove old cpp script he replaced in last commit. Also a couple little fixes of my own. Closes #6866 Closes #6862 Closes #6842 --- .../world/2012_06_20_00_world_gossip.sql | 132 ++++++++++++++++++ .../scripts/Kalimdor/dustwallow_marsh.cpp | 108 -------------- 2 files changed, 132 insertions(+), 108 deletions(-) create mode 100644 sql/updates/world/2012_06_20_00_world_gossip.sql diff --git a/sql/updates/world/2012_06_20_00_world_gossip.sql b/sql/updates/world/2012_06_20_00_world_gossip.sql new file mode 100644 index 00000000000..b4d61887223 --- /dev/null +++ b/sql/updates/world/2012_06_20_00_world_gossip.sql @@ -0,0 +1,132 @@ +-- Insert npc_text from sniff +DELETE FROM `npc_text` WHERE `ID`=11428; +INSERT INTO `npc_text` (`ID`,`text0_0`,`text0_1`,`lang0`,`prob0`,`em0_0`,`em0_1`,`em0_2`,`em0_3`,`em0_4`,`em0_5`,`text1_0`,`text1_1`,`lang1`,`prob1`,`em1_0`,`em1_1`,`em1_2`,`em1_3`,`em1_4`,`em1_5`,`text2_0`,`text2_1`,`lang2`,`prob2`,`em2_0`,`em2_1`,`em2_2`,`em2_3`,`em2_4`,`em2_5`,`text3_0`,`text3_1`,`lang3`,`prob3`,`em3_0`,`em3_1`,`em3_2`,`em3_3`,`em3_4`,`em3_5`,`text4_0`,`text4_1`,`lang4`,`prob4`,`em4_0`,`em4_1`,`em4_2`,`em4_3`,`em4_4`,`em4_5`,`text5_0`,`text5_1`,`lang5`,`prob5`,`em5_0`,`em5_1`,`em5_2`,`em5_3`,`em5_4`,`em5_5`,`text6_0`,`text6_1`,`lang6`,`prob6`,`em6_0`,`em6_1`,`em6_2`,`em6_3`,`em6_4`,`em6_5`,`text7_0`,`text7_1`,`lang7`,`prob7`,`em7_0`,`em7_1`,`em7_2`,`em7_3`,`em7_4`,`em7_5`,`WDBVerified`) VALUES +(11428,'Are you here to relieve me? I''m certain it''s almost time. Well, if you want to relieve me anyway, let me know. I could use a drink or three.','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,12340); + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=23567; +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=23602; + +-- Creature Gossip_menu_id Update from sniff +UPDATE `creature_template` SET `gossip_menu_id`=7981 WHERE `entry`=19217; -- Ravandwyr +UPDATE `creature_template` SET `gossip_menu_id`=7996 WHERE `entry`=19488; -- Custodian Dieworth +UPDATE `creature_template` SET `gossip_menu_id`=7995 WHERE `entry`=19489; -- Lieutenant-Sorcerer Morran +UPDATE `creature_template` SET `gossip_menu_id`=7991 WHERE `entry`=19569; -- Netherologist Coppernickels +UPDATE `creature_template` SET `gossip_menu_id`=7994 WHERE `entry`=19578; -- Bot-Specialist Alley +UPDATE `creature_template` SET `gossip_menu_id`=8001 WHERE `entry`=19617; -- Boots +UPDATE `creature_template` SET `gossip_menu_id`=8003 WHERE `entry`=19634; -- Lead Sapper Blastfizzle +UPDATE `creature_template` SET `gossip_menu_id`=8024 WHERE `entry`=19644; -- Image of Archmage Vargoth +UPDATE `creature_template` SET `gossip_menu_id`=8008 WHERE `entry`=19645; -- Papa Wheeler +UPDATE `creature_template` SET `gossip_menu_id`=8030 WHERE `entry`=19709; -- Chief Engineer Trep +UPDATE `creature_template` SET `gossip_menu_id`=8032 WHERE `entry`=19728; -- Mama Wheeler +UPDATE `creature_template` SET `gossip_menu_id`=8048 WHERE `entry`=19880; -- Nether-Stalker Khay'ji +UPDATE `creature_template` SET `gossip_menu_id`=8054 WHERE `entry`=20066; -- Gahruj +UPDATE `creature_template` SET `gossip_menu_id`=8055 WHERE `entry`=20067; -- Zuben Elgenubi +UPDATE `creature_template` SET `gossip_menu_id`=8056 WHERE `entry`=20068; -- Zuben Eschamali +UPDATE `creature_template` SET `gossip_menu_id`=8071 WHERE `entry`=20071; -- Wind Trader Marid +UPDATE `creature_template` SET `gossip_menu_id`=8063 WHERE `entry`=20092; -- Dealer Hazzin +UPDATE `creature_template` SET `gossip_menu_id`=8068 WHERE `entry`=20110; -- Tyri +UPDATE `creature_template` SET `gossip_menu_id`=8070 WHERE `entry`=20112; -- Wind Trader Tuluman +UPDATE `creature_template` SET `gossip_menu_id`=8084 WHERE `entry`=20194; -- Dealer Dunar +UPDATE `creature_template` SET `gossip_menu_id`=8101 WHERE `entry`=20281; -- Drijya +UPDATE `creature_template` SET `gossip_menu_id`=8106 WHERE `entry`=20389; -- Lee Sparks +UPDATE `creature_template` SET `gossip_menu_id`=8107 WHERE `entry`=20393; -- Foreman Sundown +UPDATE `creature_template` SET `gossip_menu_id`=8120 WHERE `entry`=20448; -- Commander Ameer +UPDATE `creature_template` SET `gossip_menu_id`=8180 WHERE `entry`=20449; -- Researcher Navuud +UPDATE `creature_template` SET `gossip_menu_id`=8183 WHERE `entry`=20450; -- Flesh Handler Viridius +UPDATE `creature_template` SET `gossip_menu_id`=8126 WHERE `entry`=20463; -- Apprentice Andrethan +UPDATE `creature_template` SET `gossip_menu_id`=8128 WHERE `entry`=20551; -- Agent Araxes +UPDATE `creature_template` SET `gossip_menu_id`=8231 WHERE `entry`=20810; -- Mehrdad +UPDATE `creature_template` SET `gossip_menu_id`=8229 WHERE `entry`=20903; -- Protectorate Nether Drake +UPDATE `creature_template` SET `gossip_menu_id`=8207 WHERE `entry`=20907; -- Professor Dabiri +UPDATE `creature_template` SET `gossip_menu_id`=8228 WHERE `entry`=20985; -- Captain Saeed +UPDATE `creature_template` SET `gossip_menu_id`=8308 WHERE `entry`=21493; -- Kablamm Farflinger +UPDATE `creature_template` SET `gossip_menu_id`=8542 WHERE `entry`=22427; -- Zarevhi +UPDATE `creature_template` SET `gossip_menu_id`=8710 WHERE `entry`=23396; -- Krixel Pinchwhistle +UPDATE `creature_template` SET `gossip_menu_id`=9781 WHERE `entry`=29145; -- Pulik Swiftsnip + +-- Gossip Menu insert from sniff +DELETE FROM `gossip_menu` WHERE `entry`=7981 AND `text_id` IN (9826,9828); +DELETE FROM `gossip_menu` WHERE `entry`=7991 AND `text_id`=9841; +DELETE FROM `gossip_menu` WHERE `entry`=7994 AND `text_id`=9846; +DELETE FROM `gossip_menu` WHERE `entry`=7995 AND `text_id`=9847; +DELETE FROM `gossip_menu` WHERE `entry`=7996 AND `text_id`=9848; +DELETE FROM `gossip_menu` WHERE `entry`=8001 AND `text_id`=9863; +DELETE FROM `gossip_menu` WHERE `entry`=8003 AND `text_id`=9869; +DELETE FROM `gossip_menu` WHERE `entry`=8008 AND `text_id`=9875; +DELETE FROM `gossip_menu` WHERE `entry`=8024 AND `text_id`=9901; +DELETE FROM `gossip_menu` WHERE `entry`=8030 AND `text_id`=9916; +DELETE FROM `gossip_menu` WHERE `entry`=8032 AND `text_id`=9919; +DELETE FROM `gossip_menu` WHERE `entry`=8048 AND `text_id`=9937; +DELETE FROM `gossip_menu` WHERE `entry`=8054 AND `text_id`=9947; +DELETE FROM `gossip_menu` WHERE `entry`=8055 AND `text_id`=9948; +DELETE FROM `gossip_menu` WHERE `entry`=8056 AND `text_id`=9949; +DELETE FROM `gossip_menu` WHERE `entry`=8063 AND `text_id`=9959; +DELETE FROM `gossip_menu` WHERE `entry`=8068 AND `text_id`=9968; +DELETE FROM `gossip_menu` WHERE `entry`=8070 AND `text_id`=9970; +DELETE FROM `gossip_menu` WHERE `entry`=8071 AND `text_id`=9971; +DELETE FROM `gossip_menu` WHERE `entry`=8084 AND `text_id`=9994; +DELETE FROM `gossip_menu` WHERE `entry`=8101 AND `text_id`=10019; +DELETE FROM `gossip_menu` WHERE `entry`=8106 AND `text_id`=10031; +DELETE FROM `gossip_menu` WHERE `entry`=8107 AND `text_id`=10032; +DELETE FROM `gossip_menu` WHERE `entry`=8120 AND `text_id`=10058; +DELETE FROM `gossip_menu` WHERE `entry`=8121 AND `text_id`=10061; +DELETE FROM `gossip_menu` WHERE `entry`=8122 AND `text_id`=10060; +DELETE FROM `gossip_menu` WHERE `entry`=8123 AND `text_id`=10059; +DELETE FROM `gossip_menu` WHERE `entry`=8126 AND `text_id`=10064; +DELETE FROM `gossip_menu` WHERE `entry`=8128 AND `text_id`=10065; +DELETE FROM `gossip_menu` WHERE `entry`=8180 AND `text_id`=10152; +DELETE FROM `gossip_menu` WHERE `entry`=8183 AND `text_id`=10179; +DELETE FROM `gossip_menu` WHERE `entry`=8207 AND `text_id`=10202; +DELETE FROM `gossip_menu` WHERE `entry`=8228 AND `text_id`=10229; +DELETE FROM `gossip_menu` WHERE `entry`=8229 AND `text_id`=10230; +DELETE FROM `gossip_menu` WHERE `entry`=8231 AND `text_id`=10233; +DELETE FROM `gossip_menu` WHERE `entry`=8308 AND `text_id`=10365; +DELETE FROM `gossip_menu` WHERE `entry`=8542 AND `text_id`=10687; +DELETE FROM `gossip_menu` WHERE `entry`=8710 AND `text_id`=10957; +DELETE FROM `gossip_menu` WHERE `entry`=9781 AND `text_id`=13459; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(7981,9828),(7981, 9826),(7991,9841),(7994,9846),(7995,9847), +(7996,9848),(8001,9863),(8003,9869),(8008,9875),(8024,9901), +(8030,9916),(8032,9919),(8048,9937),(8054,9947),(8055,9948), +(8056,9949),(8063,9959),(8068,9968),(8070,9970),(8071,9971), +(8084,9994),(8101,10019),(8106,10031),(8107,10032),(8120,10058), +(8121,10061),(8122,10060),(8123,10059),(8126,10064),(8128,10065), +(8180,10152),(8183,10179),(8207,10202),(8228,10229),(8229,10230), +(8231,10233),(8308,10365),(8542,10687),(8710,10957),(9781,13459); + +-- Insert npc_text from sniff +DELETE FROM `npc_text` WHERE `ID` IN (10059,10061); +INSERT INTO `npc_text` (`ID`,`text0_0`,`text0_1`,`lang0`,`prob0`,`em0_0`,`em0_1`,`em0_2`,`em0_3`,`em0_4`,`em0_5`,`text1_0`,`text1_1`,`lang1`,`prob1`,`em1_0`,`em1_1`,`em1_2`,`em1_3`,`em1_4`,`em1_5`,`text2_0`,`text2_1`,`lang2`,`prob2`,`em2_0`,`em2_1`,`em2_2`,`em2_3`,`em2_4`,`em2_5`,`text3_0`,`text3_1`,`lang3`,`prob3`,`em3_0`,`em3_1`,`em3_2`,`em3_3`,`em3_4`,`em3_5`,`text4_0`,`text4_1`,`lang4`,`prob4`,`em4_0`,`em4_1`,`em4_2`,`em4_3`,`em4_4`,`em4_5`,`text5_0`,`text5_1`,`lang5`,`prob5`,`em5_0`,`em5_1`,`em5_2`,`em5_3`,`em5_4`,`em5_5`,`text6_0`,`text6_1`,`lang6`,`prob6`,`em6_0`,`em6_1`,`em6_2`,`em6_3`,`em6_4`,`em6_5`,`text7_0`,`text7_1`,`lang7`,`prob7`,`em7_0`,`em7_1`,`em7_2`,`em7_3`,`em7_4`,`em7_5`,`WDBVerified`) VALUES +(10059,'The Ethereum were the ruling class of ethereal on my homeworld of K''aresh. Tragically, we were forced to evacuate K''aresh shortly before the void lord, Dimensius, unleashed his void armies upon the world and utterly decimated all that stood in his way. For this act, the Ethereum vowed vengeance. They have been tracking Dimensius ever since...$B$BThe Protectorate, however, were not a reaction to Dimensius. We were a reaction to Ethereum.','',0,1,0,1,0,1,0,1,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(10061,'We feel that the Ethereum are as great a threat to our existence as Dimensius. Both must be stopped...','',0,1,0,1,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340); + +-- Creature Gossip_menu_option insert from sniff +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (8001,8063,8070,8084,8103,8120,8121,8122,8123,8126,8710) AND `id`=0; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES +(8001, 0, 1, 'Boots, what do you have back there that goes down smooth?', 3, 128, 0, 0, 0, 0, ''), +(8063, 0, 1, 'Dealer Hazzin, what do you have to offer?', 3, 128, 0, 0, 0, 0, ''), +(8070, 0, 1, 'What do you have to sell, Tuluman?', 3, 128, 0, 0, 0, 0, ''), +(8084, 0, 1, 'Dealer Dunar, I wish to browse your wares.', 3, 128, 0, 0, 0, 0, ''), +(8103, 0, 5, 'Make this inn your home.', 8, 65536, 0, 0, 0, 0, ''), +(8120, 0, 0, 'What are Ethereum?', 1, 1, 8123, 0, 0, 0, ''), +(8121, 0, 0, 'I think I understand now. Can I help with any of this? The Ethereum and void creatures are a threat to our survival as well.', 1, 1, 8120, 0, 0, 0, ''), +(8122, 0, 0, 'So what is your purpose?', 1, 1, 8121, 0, 0, 0, ''), +(8123, 0, 0, 'I don''t understand. What do you mean, Ameer?', 1, 1, 8122, 0, 0, 0, ''), +(8126, 0, 1, 'I wish to browse your wares.', 3, 128, 0, 0, 0, 0, ''), +(8710, 0, 1, 'Let me browse your goods.', 3, 128, 0, 0, 0, 0, ''); + +-- Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7981 AND `SourceEntry`=9828; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,7981,9828,0,0,9,0,10173,0,0,0,0,'','Ravandwyr - Show different gossip if player has taken quest 10173'); + +-- Remove some old script text +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000649 AND -1000641; + +-- Add missing loot +DELETE FROM `creature_loot_template` WHERE `entry`=30524 AND `item`=35490; +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(30524,35490,-100,1,0,1,1); + +-- Add a missing gossip +UPDATE `creature_template` SET `gossip_menu_id`=1100 WHERE `entry`=4963; diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp index 45e1c1808c1..0aeb3c3ac11 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp @@ -25,7 +25,6 @@ EndScriptData */ /* ContentData mobs_risen_husk_spirit -npc_deserter_agitator npc_lady_jaina_proudmoore npc_nat_pagle npc_private_hendel @@ -217,112 +216,6 @@ public: }; }; -/*###### -## npc_deserter_agitator -######*/ - -enum TheramoreGuard -{ - SAY_QUEST1 = -1000641, - SAY_QUEST2 = -1000642, - SAY_QUEST3 = -1000643, - SAY_QUEST4 = -1000644, - SAY_QUEST5 = -1000645, - SAY_QUEST6 = -1000646, - SAY_QUEST7 = -1000647, - SAY_QUEST8 = -1000648, - SAY_QUEST9 = -1000649, - - QUEST_DISCREDITING_THE_DESERTERS = 11133, - - NPC_THERAMORE_GUARD = 4979, - - SPELL_DOCTORED_LEAFLET = 42725, - SPELL_PROPAGANDIZED = 42246, -}; - -#define GOSSIP_ITEM_THERAMORE_GUARD "You look like an intelligent person. Why don't you read one of these leaflets and give it some thought?" - -class npc_theramore_guard : public CreatureScript -{ -public: - npc_theramore_guard() : CreatureScript("npc_theramore_guard") { } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(QUEST_DISCREDITING_THE_DESERTERS) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THERAMORE_GUARD, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - - if (action == GOSSIP_SENDER_INFO) - { - player->CLOSE_GOSSIP_MENU(); - player->KilledMonsterCredit(NPC_THERAMORE_GUARD, 0); - DoScriptText(SAY_QUEST1, creature); - creature->CastSpell(creature, SPELL_DOCTORED_LEAFLET, false); - creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->YellTimer = 4000; - CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->bYellTimer = true; - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_theramore_guardAI(creature); - } - - struct npc_theramore_guardAI : public ScriptedAI - { - npc_theramore_guardAI(Creature* creature) : ScriptedAI(creature) { } - - uint32 YellTimer; - uint32 Step; - bool bYellTimer; - - void Reset() - { - bYellTimer = false; - Step = 0; - } - - void UpdateAI(const uint32 Diff) - { - if (!me->HasAura(SPELL_PROPAGANDIZED)) - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - - if (bYellTimer && YellTimer <= Diff) - { - switch (Step) - { - case 0: - DoScriptText(RAND(SAY_QUEST2, SAY_QUEST3, SAY_QUEST4, SAY_QUEST5, SAY_QUEST6), me); - YellTimer = 3000; - ++Step; - break; - case 1: - DoScriptText(RAND(SAY_QUEST7, SAY_QUEST8, SAY_QUEST9), me); - me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); - Step = 0; - bYellTimer = false; - break; - } - } - else - YellTimer -= Diff; - } - }; -}; - /*###### ## npc_lady_jaina_proudmoore ######*/ @@ -865,7 +758,6 @@ void AddSC_dustwallow_marsh() new npc_zelfrax(); new npc_stinky(); new npc_theramore_guard(); - new npc_deserter_agitator(); new spell_ooze_zap(); new spell_ooze_zap_channel_end(); new spell_energize_aoe(); From ef4d9dd4ae188aeabe19388f0cad7543dae3c907 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Wed, 20 Jun 2012 18:06:29 +0200 Subject: [PATCH 1074/1149] Core/Spells: * Fix bloodthirst Heal * Move bloodthirst damage calculation in Spell script * Fix some codestyle --- src/server/game/Entities/Unit/Unit.cpp | 6 --- src/server/game/Spells/SpellEffects.cpp | 5 +- src/server/scripts/Spells/spell_pet.cpp | 2 +- src/server/scripts/Spells/spell_warrior.cpp | 59 ++++++++++++++------- 4 files changed, 41 insertions(+), 31 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 50c8920a0d3..d8e7e1c9717 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -8865,12 +8865,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg CastSpell(this, 70721, true); break; } - // Bloodthirst (($m/100)% of max health) - case 23880: - { - basepoints0 = int32(CountPctFromMaxHealth(triggerAmount)); - break; - } // Shamanistic Rage triggered spell case 30824: { diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index b4a1ba19a08..84c1401bb5b 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -365,11 +365,8 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) } case SPELLFAMILY_WARRIOR: { - // Bloodthirst - if (m_spellInfo->SpellFamilyFlags[1] & 0x400) - ApplyPctF(damage, m_caster->GetTotalAttackPowerValue(BASE_ATTACK)); // Shield Slam - else if (m_spellInfo->SpellFamilyFlags[1] & 0x200 && m_spellInfo->Category == 1209) + if (m_spellInfo->SpellFamilyFlags[1] & 0x200 && m_spellInfo->Category == 1209) { uint8 level = m_caster->getLevel(); uint32 block_value = m_caster->GetShieldBlockValue(uint32(float(level) * 24.5f), uint32(float(level) * 34.5f)); diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index 78bdbb7f127..7830d46260c 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -1,4 +1,4 @@ - /* +/* * Copyright (C) 2008-2012 TrinityCore * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index f1276c24a75..463b9b2fb97 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -397,7 +397,20 @@ class spell_warr_bloodthirst : public SpellScriptLoader { PrepareSpellScript(spell_warr_bloodthirst_SpellScript); - void HandleDummy(SpellEffIndex /* effIndex */) + void HandleDamage(SpellEffIndex /*effIndex*/) + { + int32 damage = GetEffectValue(); + ApplyPctF(damage, GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK)); + + if (Unit* target = GetHitUnit()) + { + damage = GetCaster()->SpellDamageBonusDone(target, GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE); + damage = target->SpellDamageBonusTaken(GetCaster(), GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE); + } + SetHitDamage(damage); + } + + void HandleDummy(SpellEffIndex /*effIndex*/) { int32 damage = GetEffectValue(); GetCaster()->CastCustomSpell(GetCaster(), SPELL_BLOODTHIRST, &damage, NULL, NULL, true, NULL); @@ -405,6 +418,7 @@ class spell_warr_bloodthirst : public SpellScriptLoader void Register() { + OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); OnEffectHit += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); } }; @@ -415,31 +429,36 @@ class spell_warr_bloodthirst : public SpellScriptLoader } }; +enum BloodthirstHeal +{ + SPELL_BLOODTHIRST_DAMAGE = 23881, +}; + class spell_warr_bloodthirst_heal : public SpellScriptLoader { -public: - spell_warr_bloodthirst_heal() : SpellScriptLoader("spell_warr_bloodthirst_heal") { } + public: + spell_warr_bloodthirst_heal() : SpellScriptLoader("spell_warr_bloodthirst_heal") { } - class spell_warr_bloodthirst_heal_SpellScript : public SpellScript - { - PrepareSpellScript(spell_warr_bloodthirst_heal_SpellScript); - - void HandleHeal(SpellEffIndex /* effIndex */) + class spell_warr_bloodthirst_heal_SpellScript : public SpellScript { - if (GetTriggeringSpell()) - SetHitHeal(CalculatePctN(GetCaster()->GetMaxHealth(),GetTriggeringSpell()->Effects[EFFECT_1].CalcValue())); - } + PrepareSpellScript(spell_warr_bloodthirst_heal_SpellScript); - void Register() + void HandleHeal(SpellEffIndex /*effIndex*/) + { + if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_BLOODTHIRST_DAMAGE)) + SetHitHeal(GetCaster()->CountPctFromMaxHealth(spellInfo->Effects[EFFECT_1].CalcValue(GetCaster()))); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); + } + }; + + SpellScript* GetSpellScript() const { - OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); + return new spell_warr_bloodthirst_heal_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_warr_bloodthirst_heal_SpellScript(); - } }; enum Overpower @@ -498,6 +517,6 @@ void AddSC_warrior_spell_scripts() new spell_warr_execute(); new spell_warr_concussion_blow(); new spell_warr_bloodthirst(); - new spell_warr_overpower(); new spell_warr_bloodthirst_heal(); + new spell_warr_overpower(); } From 66c9973d44faededc8597bb1a3af9d657577c1f5 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 20 Jun 2012 17:17:34 +0100 Subject: [PATCH 1075/1149] Fix build, replace script that should have been removed --- .../scripts/Kalimdor/dustwallow_marsh.cpp | 100 +++++++++++------- 1 file changed, 60 insertions(+), 40 deletions(-) diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp index 0aeb3c3ac11..397b0849d5e 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp @@ -131,28 +131,40 @@ class mobs_risen_husk_spirit : public CreatureScript }; /*###### -## npc_deserter_agitator +## npc_theramor_guard ######*/ -enum Deserter +enum TheramoreGuard { - QUEST_TRAITORS_AMONG_US = 11126, - NPC_THERAMORE_DESERTER = 23602, + SAY_QUEST1 = -1000641, + SAY_QUEST2 = -1000642, + SAY_QUEST3 = -1000643, + SAY_QUEST4 = -1000644, + SAY_QUEST5 = -1000645, + SAY_QUEST6 = -1000646, + SAY_QUEST7 = -1000647, + SAY_QUEST8 = -1000648, + SAY_QUEST9 = -1000649, + + QUEST_DISCREDITING_THE_DESERTERS = 11133, + + NPC_THERAMORE_GUARD = 4979, + + SPELL_DOCTORED_LEAFLET = 42725, + SPELL_PROPAGANDIZED = 42246, }; -const Position DeserterDisappearPos = {-3609.03f, -4332.91f, 9.39354f, 3.73862f}; +#define GOSSIP_ITEM_THERAMORE_GUARD "You look like an intelligent person. Why don't you read one of these leaflets and give it some thought?" -#define GOSSIP_ITEM_DESERTER "Your propaganda wont`t work on me. Spout your treasonous filth elsewhere traitor!" - -class npc_deserter_agitator : public CreatureScript +class npc_theramore_guard : public CreatureScript { public: - npc_deserter_agitator() : CreatureScript("npc_deserter_agitator") { } + npc_theramore_guard() : CreatureScript("npc_theramore_guard") { } bool OnGossipHello(Player* player, Creature* creature) { - if (player->GetQuestStatus(QUEST_TRAITORS_AMONG_US) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DESERTER, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); + if (player->GetQuestStatus(QUEST_DISCREDITING_THE_DESERTERS) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THERAMORE_GUARD, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); @@ -166,23 +178,12 @@ public: if (action == GOSSIP_SENDER_INFO) { player->CLOSE_GOSSIP_MENU(); - switch (urand(0, 1)) - { - case 0: - creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - creature->setFaction(14); - creature->AI()->AttackStart(player); - break; - case 1: - player->KilledMonsterCredit(NPC_THERAMORE_DESERTER, 0); - creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - creature->SetSpeed(MOVE_RUN, creature->GetSpeedRate(MOVE_RUN), true); - creature->setFaction(35); - creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NON_ATTACKABLE); - creature->SetReactState(REACT_PASSIVE); - creature->GetMotionMaster()->MovePoint(1, DeserterDisappearPos); - break; - } + player->KilledMonsterCredit(NPC_THERAMORE_GUARD, 0); + DoScriptText(SAY_QUEST1, creature); + creature->CastSpell(creature, SPELL_DOCTORED_LEAFLET, false); + creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->YellTimer = 4000; + CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->bYellTimer = true; } return true; @@ -190,28 +191,47 @@ public: CreatureAI* GetAI(Creature* creature) const { - return new npc_deserter_agitatorAI(creature); + return new npc_theramore_guardAI(creature); } - struct npc_deserter_agitatorAI : public ScriptedAI + struct npc_theramore_guardAI : public ScriptedAI { - npc_deserter_agitatorAI(Creature* creature) : ScriptedAI(creature) { } + npc_theramore_guardAI(Creature* creature) : ScriptedAI(creature) { } + + uint32 YellTimer; + uint32 Step; + bool bYellTimer; void Reset() { - me->RestoreFaction(); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NON_ATTACKABLE); - me->SetReactState(REACT_AGGRESSIVE); - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + bYellTimer = false; + Step = 0; } - void MovementInform(uint32 Type, uint32 Id) + void UpdateAI(const uint32 Diff) { - if (Type != POINT_MOTION_TYPE) - return; + if (!me->HasAura(SPELL_PROPAGANDIZED)) + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - if (Id == 1) - me->DisappearAndDie(); + if (bYellTimer && YellTimer <= Diff) + { + switch (Step) + { + case 0: + DoScriptText(RAND(SAY_QUEST2, SAY_QUEST3, SAY_QUEST4, SAY_QUEST5, SAY_QUEST6), me); + YellTimer = 3000; + ++Step; + break; + case 1: + DoScriptText(RAND(SAY_QUEST7, SAY_QUEST8, SAY_QUEST9), me); + me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); + Step = 0; + bYellTimer = false; + break; + } + } + else + YellTimer -= Diff; } }; }; From f3aacb669ca1ad3147bdcc1c541ebf3a7e2d7343 Mon Sep 17 00:00:00 2001 From: Elron103 Date: Wed, 20 Jun 2012 21:29:41 +0200 Subject: [PATCH 1076/1149] Scripts/Miscellaneous: Enable const-ness for various functions in ScriptedAI (Author: DorianGrey) - Improve codestyle, since objects internal state is not changed here - Make these functions available for inherited CanAIAttack() function --- src/server/game/AI/ScriptedAI/ScriptedCreature.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index 4fac8b3cba5..ba0a94d2590 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -191,7 +191,7 @@ struct ScriptedAI : public CreatureAI //Generally used to control if MoveChase() is to be used or not in AttackStart(). Some creatures does not chase victims void SetCombatMovement(bool allowMovement); - bool IsCombatMovementAllowed() { return _isCombatMovementAllowed; } + bool IsCombatMovementAllowed() const { return _isCombatMovementAllowed; } bool EnterEvadeIfOutOfCombatArea(uint32 const diff); @@ -200,16 +200,16 @@ struct ScriptedAI : public CreatureAI // - for raid in mode 10-Heroic // - for raid in mode 25-heroic // DO NOT USE to check raid in mode 25-normal. - bool IsHeroic() { return _isHeroic; } + bool IsHeroic() const { return _isHeroic; } // return the dungeon or raid difficulty - Difficulty GetDifficulty() { return _difficulty; } + Difficulty GetDifficulty() const { return _difficulty; } // return true for 25 man or 25 man heroic mode - bool Is25ManRaid() { return _difficulty & RAID_DIFFICULTY_MASK_25MAN; } + bool Is25ManRaid() const { return _difficulty & RAID_DIFFICULTY_MASK_25MAN; } template inline - const T& DUNGEON_MODE(const T& normal5, const T& heroic10) + const T& DUNGEON_MODE(const T& normal5, const T& heroic10) const { switch (_difficulty) { @@ -225,7 +225,7 @@ struct ScriptedAI : public CreatureAI } template inline - const T& RAID_MODE(const T& normal10, const T& normal25) + const T& RAID_MODE(const T& normal10, const T& normal25) const { switch (_difficulty) { @@ -241,7 +241,7 @@ struct ScriptedAI : public CreatureAI } template inline - const T& RAID_MODE(const T& normal10, const T& normal25, const T& heroic10, const T& heroic25) + const T& RAID_MODE(const T& normal10, const T& normal25, const T& heroic10, const T& heroic25) const { switch (_difficulty) { From de3f982c913d0fe1006c0b53d959fd26da7ab17f Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 20 Jun 2012 20:08:05 -0230 Subject: [PATCH 1077/1149] DB/SAI: Fix Quest 9689 "Razormaw" Thanks to Kiper for sniff. Closes #1794 --- sql/updates/world/2012_06_20_01_world_sai.sql | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 sql/updates/world/2012_06_20_01_world_sai.sql diff --git a/sql/updates/world/2012_06_20_01_world_sai.sql b/sql/updates/world/2012_06_20_01_world_sai.sql new file mode 100644 index 00000000000..989550de185 --- /dev/null +++ b/sql/updates/world/2012_06_20_01_world_sai.sql @@ -0,0 +1,26 @@ +-- Razormaw SAI fixes quest 9689 +SET @ENTRY := 17592; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY; +INSERT INTO `creature_template_addon` (`entry`,`bytes1`,`bytes2`) VALUES (@ENTRY,50331648,1); +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,0,6000,6000,7000,9000,11,31279,0,0,0,0,0,2,0,0,0,0,0,0,0,'Razormaw - Combat - Cast Swipe'), +(@ENTRY,0,1,0,0,0,100,0,26000,30000,26000,30000,11,8873,0,0,0,0,0,1,0,0,0,0,0,0,0,'Razormaw - Combat - Cast Flame Breath'), +(@ENTRY,0,2,0,0,0,50,0,12000,12000,12000,12000,11,14100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Razormaw - Combat - Cast Terrifying Roar'), +(@ENTRY,0,3,0,11,0,100,0,0,0,0,0,53,1,@ENTRY,0,0,0,0,1,0,0,0,0,0,0,0,'Razormaw - On spawn - Load Path'), +(@ENTRY,0,4,0,40,0,100,0,10,@ENTRY,0,0,19,256,0,0,0,0,0,1,0,0,0,0,0,0,0,'Razormaw - On Reach waypoint - Remove unitflag'); +-- Waypoints for Razormaw +DELETE FROM `waypoints` WHERE `entry` IN (@ENTRY); +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,-1045.958,-12583.85,111.7434, 'Razormaw'), +(@ENTRY,2,-1045.115,-12583.31,111.7434, 'Razormaw'), +(@ENTRY,3,-1213.006,-12663.19,200.4278, 'Razormaw'), +(@ENTRY,4,-1204.485,-12626.66,200.4278, 'Razormaw'), +(@ENTRY,5,-1204.906,-12599.65,188.7889, 'Razormaw'), +(@ENTRY,6,-1206.845,-12579.84,173.2892, 'Razormaw'), +(@ENTRY,7,-1203.169,-12555.49,160.956, 'Razormaw'), +(@ENTRY,8,-1201.284,-12529.25,134.3167, 'Razormaw'), +(@ENTRY,9,-1204.178,-12483.84,115.039, 'Razormaw'), +(@ENTRY,10,-1204.349,-12465.61,104.7762, 'Razormaw'), +(@ENTRY,11,-1205.651,-12460.52,97.53908, 'Razormaw'); From a312cd4ba1f47d3dceb774091ec143c90a298cda Mon Sep 17 00:00:00 2001 From: Xees Date: Wed, 20 Jun 2012 23:28:16 +0100 Subject: [PATCH 1078/1149] Scripts/Commands: Convert character and server commands to commandscript Closes #6856 Signed-off-by: Nay --- src/server/game/Chat/Chat.cpp | 79 -- src/server/game/Chat/Chat.h | 59 +- src/server/game/Chat/Commands/Level0.cpp | 30 - src/server/game/Chat/Commands/Level2.cpp | 231 ------ src/server/game/Chat/Commands/Level3.cpp | 266 ------- src/server/game/Scripting/ScriptLoader.cpp | 4 + src/server/scripts/Commands/CMakeLists.txt | 3 +- src/server/scripts/Commands/cs_character.cpp | 680 ++++++++++++++++++ src/server/scripts/Commands/cs_server.cpp | 430 +++++++++++ src/server/scripts/Kalimdor/ashenvale.cpp | 6 +- .../worldserver/CommandLine/CliRunnable.cpp | 452 ------------ 11 files changed, 1126 insertions(+), 1114 deletions(-) create mode 100644 src/server/scripts/Commands/cs_character.cpp create mode 100644 src/server/scripts/Commands/cs_server.cpp diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 7d23b14110b..f96199f9bd3 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -92,29 +92,6 @@ ChatCommand* ChatHandler::getCommandTable() { NULL, 0, false, NULL, "", NULL } }; - static ChatCommand characterDeletedCommandTable[] = - { - { "delete", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleCharacterDeletedDeleteCommand>, "", NULL }, - { "list", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleCharacterDeletedListCommand>, "", NULL }, - { "restore", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleCharacterDeletedRestoreCommand>, "", NULL }, - { "old", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleCharacterDeletedOldCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - - static ChatCommand characterCommandTable[] = - { - { "customize", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterCustomizeCommand>, "", NULL }, - { "changefaction", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterChangeFactionCommand>, "", NULL }, - { "changerace", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterChangeRaceCommand>, "", NULL }, - { "deleted", SEC_GAMEMASTER, true, NULL, "", characterDeletedCommandTable}, - { "erase", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleCharacterEraseCommand>, "", NULL }, - { "level", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleCharacterLevelCommand>, "", NULL }, - { "rename", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterRenameCommand>, "", NULL }, - { "reputation", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterReputationCommand>, "", NULL }, - { "titles", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterTitlesCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - static ChatCommand channelSetCommandTable[] = { { "ownership", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleChannelSetOwnership>, "", NULL }, @@ -218,60 +195,6 @@ ChatCommand* ChatHandler::getCommandTable() { NULL, 0, false, NULL, "", NULL } }; - static ChatCommand serverIdleRestartCommandTable[] = - { - { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL }, - { "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerIdleRestartCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - - static ChatCommand serverIdleShutdownCommandTable[] = - { - { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL }, - { "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerIdleShutDownCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - - static ChatCommand serverRestartCommandTable[] = - { - { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL }, - { "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerRestartCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - - static ChatCommand serverShutdownCommandTable[] = - { - { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL }, - { "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - - static ChatCommand serverSetCommandTable[] = - { - { "difftime", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerSetDiffTimeCommand>, "", NULL }, - { "loglevel", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerSetLogLevelCommand>, "", NULL }, - { "logfilelevel", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerSetLogFileLevelCommand>, "", NULL }, - { "motd", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerSetMotdCommand>, "", NULL }, - { "closed", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerSetClosedCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - - static ChatCommand serverCommandTable[] = - { - { "corpses", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleServerCorpsesCommand>, "", NULL }, - { "exit", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerExitCommand>, "", NULL }, - { "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable }, - { "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverIdleShutdownCommandTable }, - { "info", SEC_PLAYER, true, OldHandler<&ChatHandler::HandleServerInfoCommand>, "", NULL }, - { "motd", SEC_PLAYER, true, OldHandler<&ChatHandler::HandleServerMotdCommand>, "", NULL }, - { "plimit", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerPLimitCommand>, "", NULL }, - { "restart", SEC_ADMINISTRATOR, true, NULL, "", serverRestartCommandTable }, - { "shutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable }, - { "set", SEC_ADMINISTRATOR, true, NULL, "", serverSetCommandTable }, - { "togglequerylog", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerToggleQueryLogging>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - static ChatCommand unbanCommandTable[] = { { "account", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleUnBanAccountCommand>, "", NULL }, @@ -311,14 +234,12 @@ ChatCommand* ChatHandler::getCommandTable() static ChatCommand commandTable[] = { - { "character", SEC_GAMEMASTER, true, NULL, "", characterCommandTable}, { "list", SEC_ADMINISTRATOR, true, NULL, "", listCommandTable }, { "lookup", SEC_ADMINISTRATOR, true, NULL, "", lookupCommandTable }, { "pdump", SEC_ADMINISTRATOR, true, NULL, "", pdumpCommandTable }, { "guild", SEC_ADMINISTRATOR, true, NULL, "", guildCommandTable }, { "group", SEC_ADMINISTRATOR, false, NULL, "", groupCommandTable }, { "reset", SEC_ADMINISTRATOR, true, NULL, "", resetCommandTable }, - { "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable }, { "channel", SEC_ADMINISTRATOR, true, NULL, "", channelCommandTable }, diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index 1612de741a6..c43b0fa9aca 100755 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -119,10 +119,13 @@ class ChatHandler GameObject* GetNearbyGameObject(); GameObject* GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid, uint32 entry); - bool HasSentErrorMessage() const { return sentErrorMessage;} - void SetSentErrorMessage(bool val){ sentErrorMessage = val;}; - static bool LoadCommandTable() { return load_command_table;} - static void SetLoadCommandTable(bool val){ load_command_table = val;}; + bool HasSentErrorMessage() const { return sentErrorMessage; } + void SetSentErrorMessage(bool val){ sentErrorMessage = val; } + static bool LoadCommandTable() { return load_command_table; } + static void SetLoadCommandTable(bool val) { load_command_table = val; } + + // cs_character + void HandleCharacterLevel(Player* player, uint64 playerGuid, uint32 oldLevel, uint32 newLevel); protected: explicit ChatHandler() : m_session(NULL) {} // for CLI subclass @@ -147,19 +150,6 @@ class ChatHandler bool HandleBanListCharacterCommand(const char* args); bool HandleBanListIPCommand(const char* args); - bool HandleCharacterCustomizeCommand(const char* args); - bool HandleCharacterChangeFactionCommand(const char* args); - bool HandleCharacterChangeRaceCommand(const char * args); - bool HandleCharacterDeletedDeleteCommand(const char* args); - bool HandleCharacterDeletedListCommand(const char* args); - bool HandleCharacterDeletedRestoreCommand(const char* args); - bool HandleCharacterDeletedOldCommand(const char* args); - bool HandleCharacterEraseCommand(const char* args); - bool HandleCharacterLevelCommand(const char* args); - bool HandleCharacterRenameCommand(const char* args); - bool HandleCharacterReputationCommand(const char* args); - bool HandleCharacterTitlesCommand(const char* args); - bool HandleChannelSetOwnership(const char *args); bool HandlePossessCommand(const char* args); @@ -212,24 +202,6 @@ class ChatHandler bool HandleSendMessageCommand(const char * args); bool HandleSendMoneyCommand(const char* args); - bool HandleServerCorpsesCommand(const char* args); - bool HandleServerExitCommand(const char* args); - bool HandleServerIdleRestartCommand(const char* args); - bool HandleServerIdleShutDownCommand(const char* args); - bool HandleServerInfoCommand(const char* args); - bool HandleServerMotdCommand(const char* args); - bool HandleServerPLimitCommand(const char* args); - bool HandleServerRestartCommand(const char* args); - bool HandleServerSetLogLevelCommand(const char* args); - bool HandleServerSetMotdCommand(const char* args); - bool HandleServerShutDownCommand(const char* args); - bool HandleServerShutDownCancelCommand(const char* args); - bool HandleServerSetClosedCommand(const char* args); - bool HandleServerToggleQueryLogging(const char* args); - - bool HandleServerSetLogFileLevelCommand(const char* args); - bool HandleServerSetDiffTimeCommand(const char* args); - bool HandleUnBanAccountCommand(const char* args); bool HandleUnBanAccountByCharCommand(const char* args); bool HandleUnBanCharacterCommand(const char* args); @@ -342,25 +314,8 @@ class ChatHandler bool HandleBanHelper(BanMode mode, char const* args); bool HandleBanInfoHelper(uint32 accountid, char const* accountname); bool HandleUnBanHelper(BanMode mode, char const* args); - void HandleCharacterLevel(Player* player, uint64 playerGuid, uint32 oldLevel, uint32 newLevel); void HandleLearnSkillRecipesHelper(Player* player, uint32 skill_id); - // Stores informations about a deleted character - struct DeletedInfo - { - uint32 lowguid; ///< the low GUID from the character - std::string name; ///< the character name - uint32 accountId; ///< the account id - std::string accountName; ///< the account name - time_t deleteDate; ///< the date at which the character has been deleted - }; - - typedef std::list DeletedInfoList; - bool GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::string searchString = ""); - std::string GenerateDeletedCharacterGUIDsWhereStr(DeletedInfoList::const_iterator& itr, DeletedInfoList::const_iterator const& itr_end); - void HandleCharacterDeletedListHelper(DeletedInfoList const& foundList); - void HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo); - private: bool _HandleGMTicketResponseAppendCommand(const char* args, bool newLine); diff --git a/src/server/game/Chat/Commands/Level0.cpp b/src/server/game/Chat/Commands/Level0.cpp index b2ac090c313..b05ba9b4194 100755 --- a/src/server/game/Chat/Commands/Level0.cpp +++ b/src/server/game/Chat/Commands/Level0.cpp @@ -80,29 +80,6 @@ bool ChatHandler::HandleStartCommand(const char* /*args*/) return true; } -bool ChatHandler::HandleServerInfoCommand(const char* /*args*/) -{ - uint32 playersNum = sWorld->GetPlayerCount(); - uint32 maxPlayersNum = sWorld->GetMaxPlayerCount(); - uint32 activeClientsNum = sWorld->GetActiveSessionCount(); - uint32 queuedClientsNum = sWorld->GetQueuedSessionCount(); - uint32 maxActiveClientsNum = sWorld->GetMaxActiveSessionCount(); - uint32 maxQueuedClientsNum = sWorld->GetMaxQueuedSessionCount(); - std::string uptime = secsToTimeString(sWorld->GetUptime()); - uint32 updateTime = sWorld->GetUpdateTime(); - - SendSysMessage(_FULLVERSION); - PSendSysMessage(LANG_CONNECTED_PLAYERS, playersNum, maxPlayersNum); - PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum); - PSendSysMessage(LANG_UPTIME, uptime.c_str()); - PSendSysMessage(LANG_UPDATE_DIFF, updateTime); - //! Can't use sWorld->ShutdownMsg here in case of console command - if (sWorld->IsShuttingDown()) - PSendSysMessage(LANG_SHUTDOWN_TIMELEFT, secsToTimeString(sWorld->GetShutDownTimeLeft()).c_str()); - - return true; -} - bool ChatHandler::HandleDismountCommand(const char* /*args*/) { Player* player = m_session->GetPlayer(); @@ -150,10 +127,3 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/) return true; } -/// Display the 'Message of the day' for the realm -bool ChatHandler::HandleServerMotdCommand(const char* /*args*/) -{ - PSendSysMessage(LANG_MOTD_CURRENT, sWorld->GetMotd()); - return true; -} - diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index 52bdcd15163..42a379753d5 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -456,190 +456,6 @@ bool ChatHandler::HandlePInfoCommand(const char* args) return true; } -//rename characters -bool ChatHandler::HandleCharacterRenameCommand(const char* args) -{ - Player* target; - uint64 targetGuid; - std::string targetName; - if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) - return false; - - if (target) - { - // check online security - if (HasLowerSecurity(target, 0)) - return false; - - PSendSysMessage(LANG_RENAME_PLAYER, GetNameLink(target).c_str()); - target->SetAtLoginFlag(AT_LOGIN_RENAME); - } - else - { - // check offline security - if (HasLowerSecurity(NULL, targetGuid)) - return false; - - std::string oldNameLink = playerLink(targetName); - - PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid)); - - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); - - stmt->setUInt16(0, uint16(AT_LOGIN_RENAME)); - stmt->setUInt32(1, GUID_LOPART(targetGuid)); - - CharacterDatabase.Execute(stmt); - } - - return true; -} - -// customize characters -bool ChatHandler::HandleCharacterCustomizeCommand(const char* args) -{ - Player* target; - uint64 targetGuid; - std::string targetName; - if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) - return false; - - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); - - stmt->setUInt16(0, uint16(AT_LOGIN_CUSTOMIZE)); - - if (target) - { - PSendSysMessage(LANG_CUSTOMIZE_PLAYER, GetNameLink(target).c_str()); - target->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE); - - stmt->setUInt32(1, target->GetGUIDLow()); - } - else - { - std::string oldNameLink = playerLink(targetName); - - stmt->setUInt32(1, GUID_LOPART(targetGuid)); - - PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid)); - } - - CharacterDatabase.Execute(stmt); - - return true; -} - -bool ChatHandler::HandleCharacterChangeFactionCommand(const char* args) -{ - Player* target; - uint64 targetGuid; - std::string targetName; - - if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) - return false; - - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); - - stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_FACTION)); - - if (target) - { - PSendSysMessage(LANG_CUSTOMIZE_PLAYER, GetNameLink(target).c_str()); - target->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION); - - stmt->setUInt32(1, target->GetGUIDLow()); - } - else - { - std::string oldNameLink = playerLink(targetName); - - PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid)); - - stmt->setUInt32(1, GUID_LOPART(targetGuid)); - } - - CharacterDatabase.Execute(stmt); - - return true; -} - -bool ChatHandler::HandleCharacterChangeRaceCommand(const char * args) -{ - Player* target; - uint64 targetGuid; - std::string targetName; - if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) - return false; - - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); - - stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_RACE)); - - if (target) - { - // TODO : add text into database - PSendSysMessage(LANG_CUSTOMIZE_PLAYER, GetNameLink(target).c_str()); - target->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE); - - stmt->setUInt32(1, target->GetGUIDLow()); - } - else - { - std::string oldNameLink = playerLink(targetName); - - // TODO : add text into database - PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid)); - - stmt->setUInt32(1, GUID_LOPART(targetGuid)); - } - - CharacterDatabase.Execute(stmt); - - return true; -} - -bool ChatHandler::HandleCharacterReputationCommand(const char* args) -{ - Player* target; - if (!extractPlayerTarget((char*)args, &target)) - return false; - - LocaleConstant loc = GetSessionDbcLocale(); - - FactionStateList const& targetFSL = target->GetReputationMgr().GetStateList(); - for (FactionStateList::const_iterator itr = targetFSL.begin(); itr != targetFSL.end(); ++itr) - { - const FactionState& faction = itr->second; - FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID); - char const* factionName = factionEntry ? factionEntry->name[loc] : "#Not found#"; - ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry); - std::string rankName = GetTrinityString(ReputationRankStrIndex[rank]); - std::ostringstream ss; - if (m_session) - ss << faction.ID << " - |cffffffff|Hfaction:" << faction.ID << "|h[" << factionName << ' ' << localeNames[loc] << "]|h|r"; - else - ss << faction.ID << " - " << factionName << ' ' << localeNames[loc]; - - ss << ' ' << rankName << " (" << target->GetReputationMgr().GetReputation(factionEntry) << ')'; - - if (faction.Flags & FACTION_FLAG_VISIBLE) - ss << GetTrinityString(LANG_FACTION_VISIBLE); - if (faction.Flags & FACTION_FLAG_AT_WAR) - ss << GetTrinityString(LANG_FACTION_ATWAR); - if (faction.Flags & FACTION_FLAG_PEACE_FORCED) - ss << GetTrinityString(LANG_FACTION_PEACE_FORCED); - if (faction.Flags & FACTION_FLAG_HIDDEN) - ss << GetTrinityString(LANG_FACTION_HIDDEN); - if (faction.Flags & FACTION_FLAG_INVISIBLE_FORCED) - ss << GetTrinityString(LANG_FACTION_INVISIBLE_FORCED); - if (faction.Flags & FACTION_FLAG_INACTIVE) - ss << GetTrinityString(LANG_FACTION_INACTIVE); - - SendSysMessage(ss.str().c_str()); - } - return true; -} - bool ChatHandler::HandleLookupEventCommand(const char* args) { if (!*args) @@ -846,13 +662,6 @@ bool ChatHandler::LookupPlayerSearchCommand(PreparedQueryResult result, int32 li return true; } -/// Triggering corpses expire check in world -bool ChatHandler::HandleServerCorpsesCommand(const char* /*args*/) -{ - sObjectAccessor->RemoveOldCorpses(); - return true; -} - bool ChatHandler::HandleRepairitemsCommand(const char* args) { Player* target; @@ -1128,43 +937,3 @@ bool ChatHandler::HandleLookupTitleCommand(const char* args) SendSysMessage(LANG_COMMAND_NOTITLEFOUND); return true; } - -bool ChatHandler::HandleCharacterTitlesCommand(const char* args) -{ - if (!*args) - return false; - - Player* target; - if (!extractPlayerTarget((char*)args, &target)) - return false; - - LocaleConstant loc = GetSessionDbcLocale(); - char const* targetName = target->GetName(); - char const* knownStr = GetTrinityString(LANG_KNOWN); - - // Search in CharTitles.dbc - for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++) - { - CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id); - if (titleInfo && target->HasTitle(titleInfo)) - { - std::string name = titleInfo->name[loc]; - if (name.empty()) - continue; - - char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index - ? GetTrinityString(LANG_ACTIVE) - : ""; - - char titleNameStr[80]; - snprintf(titleNameStr, 80, name.c_str(), targetName); - - // send title in "id (idx:idx) - [namedlink locale]" format - if (m_session) - PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr); - else - PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr); - } - } - return true; -} diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 3898232fa40..33855a96617 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -2198,47 +2198,6 @@ void ChatHandler::HandleCharacterLevel(Player* player, uint64 playerGuid, uint32 } } -bool ChatHandler::HandleCharacterLevelCommand(const char *args) -{ - char* nameStr; - char* levelStr; - extractOptFirstArg((char*)args, &nameStr, &levelStr); - if (!levelStr) - return false; - - // exception opt second arg: .character level $name - if (isalpha(levelStr[0])) - { - nameStr = levelStr; - levelStr = NULL; // current level will used - } - - Player* target; - uint64 target_guid; - std::string target_name; - if (!extractPlayerTarget(nameStr, &target, &target_guid, &target_name)) - return false; - - int32 oldlevel = target ? target->getLevel() : Player::GetLevelFromDB(target_guid); - int32 newlevel = levelStr ? atoi(levelStr) : oldlevel; - - if (newlevel < 1) - return false; // invalid level - - if (newlevel > STRONG_MAX_LEVEL) // hardcoded maximum level - newlevel = STRONG_MAX_LEVEL; - - HandleCharacterLevel(target, target_guid, oldlevel, newlevel); - - if (!m_session || m_session->GetPlayer() != target) // including player == NULL - { - std::string nameLink = playerLink(target_name); - PSendSysMessage(LANG_YOU_CHANGE_LVL, nameLink.c_str(), newlevel); - } - - return true; -} - bool ChatHandler::HandleLevelUpCommand(const char *args) { char* nameStr; @@ -2698,152 +2657,6 @@ bool ChatHandler::HandleResetAllCommand(const char * args) return true; } -bool ChatHandler::HandleServerShutDownCancelCommand(const char* /*args*/) -{ - sWorld->ShutdownCancel(); - return true; -} - -bool ChatHandler::HandleServerShutDownCommand(const char *args) -{ - if (!*args) - return false; - - char* time_str = strtok ((char*) args, " "); - char* exitcode_str = strtok (NULL, ""); - - int32 time = atoi (time_str); - - ///- Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) - return false; - - if (exitcode_str) - { - int32 exitcode = atoi (exitcode_str); - - // Handle atoi() errors - if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) - return false; - - // Exit code should be in range of 0-125, 126-255 is used - // in many shells for their own return codes and code > 255 - // is not supported in many others - if (exitcode < 0 || exitcode > 125) - return false; - - sWorld->ShutdownServ(time, 0, exitcode); - } - else - sWorld->ShutdownServ(time, 0, SHUTDOWN_EXIT_CODE); - return true; -} - -bool ChatHandler::HandleServerRestartCommand(const char *args) -{ - if (!*args) - return false; - - char* time_str = strtok ((char*) args, " "); - char* exitcode_str = strtok (NULL, ""); - - int32 time = atoi (time_str); - - ///- Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) - return false; - - if (exitcode_str) - { - int32 exitcode = atoi (exitcode_str); - - // Handle atoi() errors - if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) - return false; - - // Exit code should be in range of 0-125, 126-255 is used - // in many shells for their own return codes and code > 255 - // is not supported in many others - if (exitcode < 0 || exitcode > 125) - return false; - - sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, exitcode); - } - else - sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE); - return true; -} - -bool ChatHandler::HandleServerIdleRestartCommand(const char *args) -{ - if (!*args) - return false; - - char* time_str = strtok ((char*) args, " "); - char* exitcode_str = strtok (NULL, ""); - - int32 time = atoi (time_str); - - ///- Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) - return false; - - if (exitcode_str) - { - int32 exitcode = atoi (exitcode_str); - - // Handle atoi() errors - if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) - return false; - - // Exit code should be in range of 0-125, 126-255 is used - // in many shells for their own return codes and code > 255 - // is not supported in many others - if (exitcode < 0 || exitcode > 125) - return false; - - sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, exitcode); - } - else - sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE); - return true; -} - -bool ChatHandler::HandleServerIdleShutDownCommand(const char *args) -{ - if (!*args) - return false; - - char* time_str = strtok ((char*) args, " "); - char* exitcode_str = strtok (NULL, ""); - - int32 time = atoi (time_str); - - ///- Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) - return false; - - if (exitcode_str) - { - int32 exitcode = atoi (exitcode_str); - - // Handle atoi() errors - if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) - return false; - - // Exit code should be in range of 0-125, 126-255 is used - // in many shells for their own return codes and code > 255 - // is not supported in many others - if (exitcode < 0 || exitcode > 125) - return false; - - sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, exitcode); - } - else - sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE); - return true; -} - bool ChatHandler::HandleBanAccountCommand(const char *args) { return HandleBanHelper(BAN_ACCOUNT, args); @@ -3764,56 +3577,6 @@ bool ChatHandler::HandleMovegensCommand(const char* /*args*/) return true; } -bool ChatHandler::HandleServerPLimitCommand(const char *args) -{ - if (*args) - { - char* param = strtok((char*)args, " "); - if (!param) - return false; - - int l = strlen(param); - - if (strncmp(param, "player", l) == 0) - sWorld->SetPlayerSecurityLimit(SEC_PLAYER); - else if (strncmp(param, "moderator", l) == 0) - sWorld->SetPlayerSecurityLimit(SEC_MODERATOR); - else if (strncmp(param, "gamemaster", l) == 0) - sWorld->SetPlayerSecurityLimit(SEC_GAMEMASTER); - else if (strncmp(param, "administrator", l) == 0) - sWorld->SetPlayerSecurityLimit(SEC_ADMINISTRATOR); - else if (strncmp(param, "reset", l) == 0) - { - sWorld->SetPlayerAmountLimit(ConfigMgr::GetIntDefault("PlayerLimit", 100)); - sWorld->LoadDBAllowedSecurityLevel(); - } - else - { - int val = atoi(param); - if (val < 0) - sWorld->SetPlayerSecurityLimit(AccountTypes(uint32(-val))); - else - sWorld->SetPlayerAmountLimit(uint32(val)); - } - } - - uint32 pLimit = sWorld->GetPlayerAmountLimit(); - AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit(); - char const* secName = ""; - switch (allowedAccountType) - { - case SEC_PLAYER: secName = "Player"; break; - case SEC_MODERATOR: secName = "Moderator"; break; - case SEC_GAMEMASTER: secName = "Gamemaster"; break; - case SEC_ADMINISTRATOR: secName = "Administrator"; break; - default: secName = ""; break; - } - - PSendSysMessage("Player limits: amount %u, min. security level %s.", pLimit, secName); - - return true; -} - /* ComeToMe command REQUIRED for 3rd party scripting library to have access to PointMovementGenerator Without this function 3rd party scripting library will get linking errors (unresolved external) @@ -3840,35 +3603,6 @@ bool ChatHandler::HandleComeToMeCommand(const char *args) return true; } -/// Define the 'Message of the day' for the realm -bool ChatHandler::HandleServerSetMotdCommand(const char *args) -{ - sWorld->SetMotd(args); - PSendSysMessage(LANG_MOTD_NEW, args); - return true; -} - -/// Set whether we accept new clients -bool ChatHandler::HandleServerSetClosedCommand(const char *args) -{ - if (strncmp(args, "on", 3) == 0) - { - SendSysMessage(LANG_WORLD_CLOSED); - sWorld->SetClosed(true); - return true; - } - else if (strncmp(args, "off", 4) == 0) - { - SendSysMessage(LANG_WORLD_OPENED); - sWorld->SetClosed(false); - return true; - } - - SendSysMessage(LANG_USE_BOL); - SetSentErrorMessage(true); - return false; -} - //Send items by mail bool ChatHandler::HandleSendItemsCommand(const char *args) { diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 8bc4ce24665..c18c6914096 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -61,8 +61,10 @@ void AddSC_npc_commandscript(); void AddSC_quest_commandscript(); void AddSC_reload_commandscript(); void AddSC_tele_commandscript(); +void AddSC_server_commandscript(); void AddSC_titles_commandscript(); void AddSC_wp_commandscript(); +void AddSC_character_commandscript(); #ifdef SCRIPTS //world @@ -665,8 +667,10 @@ void AddCommandScripts() AddSC_quest_commandscript(); AddSC_reload_commandscript(); AddSC_tele_commandscript(); + AddSC_server_commandscript(); AddSC_titles_commandscript(); AddSC_wp_commandscript(); + AddSC_character_commandscript(); } void AddWorldScripts() diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index 77d42ac5fd1..86e1baeb52d 100644 --- a/src/server/scripts/Commands/CMakeLists.txt +++ b/src/server/scripts/Commands/CMakeLists.txt @@ -27,9 +27,10 @@ set(scripts_STAT_SRCS Commands/cs_quest.cpp Commands/cs_reload.cpp Commands/cs_tele.cpp + Commands/cs_server.cpp Commands/cs_titles.cpp Commands/cs_wp.cpp -# Commands/cs_character.cpp + Commands/cs_character.cpp # Commands/cs_list.cpp # Commands/cs_lookup.cpp # Commands/cs_pdump.cpp diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp new file mode 100644 index 00000000000..d5e674a1097 --- /dev/null +++ b/src/server/scripts/Commands/cs_character.cpp @@ -0,0 +1,680 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +Name: character_commandscript +%Complete: 100 +Comment: All character related commands +Category: commandscripts +EndScriptData */ + +#include "ScriptMgr.h" +#include "Chat.h" +#include "AccountMgr.h" + +class character_commandscript : public CommandScript +{ +public: + character_commandscript() : CommandScript("character_commandscript") { } + + ChatCommand* GetCommands() const + { + static ChatCommand characterDeletedCommandTable[] = + { + { "delete", SEC_CONSOLE, true, &HandleCharacterDeletedDeleteCommand, "", NULL }, + { "list", SEC_ADMINISTRATOR, true, &HandleCharacterDeletedListCommand, "", NULL }, + { "restore", SEC_ADMINISTRATOR, true, &HandleCharacterDeletedRestoreCommand, "", NULL }, + { "old", SEC_CONSOLE, true, &HandleCharacterDeletedOldCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand characterCommandTable[] = + { + { "customize", SEC_GAMEMASTER, true, &HandleCharacterCustomizeCommand, "", NULL }, + { "changefaction", SEC_GAMEMASTER, true, &HandleCharacterChangeFactionCommand, "", NULL }, + { "changerace", SEC_GAMEMASTER, true, &HandleCharacterChangeRaceCommand, "", NULL }, + { "deleted", SEC_GAMEMASTER, true, NULL, "", characterDeletedCommandTable}, + { "erase", SEC_CONSOLE, true, &HandleCharacterEraseCommand, "", NULL }, + { "level", SEC_ADMINISTRATOR, true, &HandleCharacterLevelCommand, "", NULL }, + { "rename", SEC_GAMEMASTER, true, &HandleCharacterRenameCommand, "", NULL }, + { "reputation", SEC_GAMEMASTER, true, &HandleCharacterReputationCommand, "", NULL }, + { "titles", SEC_GAMEMASTER, true, &HandleCharacterTitlesCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand commandTable[] = + { + { "character", SEC_GAMEMASTER, true, NULL, "", characterCommandTable}, + { NULL, 0, false, NULL, "", NULL } + }; + + return commandTable; + } + + // Stores informations about a deleted character + struct DeletedInfo + { + uint32 lowguid; ///< the low GUID from the character + std::string name; ///< the character name + uint32 accountId; ///< the account id + std::string accountName; ///< the account name + time_t deleteDate; ///< the date at which the character has been deleted + }; + + typedef std::list DeletedInfoList; + + /** + * Collects all GUIDs (and related info) from deleted characters which are still in the database. + * + * @param foundList a reference to an std::list which will be filled with info data + * @param searchString the search string which either contains a player GUID or a part fo the character-name + * @return returns false if there was a problem while selecting the characters (e.g. player name not normalizeable) + */ + static bool GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::string searchString) + { + PreparedQueryResult result; + PreparedStatement* stmt; + if (!searchString.empty()) + { + // search by GUID + if (isNumeric(searchString.c_str())) + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_GUID); + + stmt->setUInt32(0, uint32(atoi(searchString.c_str()))); + + result = CharacterDatabase.Query(stmt); + } + // search by name + else + { + if (!normalizePlayerName(searchString)) + return false; + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_NAME); + + stmt->setString(0, searchString); + + result = CharacterDatabase.Query(stmt); + } + } + else + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO); + + result = CharacterDatabase.Query(stmt); + } + + if (result) + { + do + { + Field* fields = result->Fetch(); + + DeletedInfo info; + + info.lowguid = fields[0].GetUInt32(); + info.name = fields[1].GetString(); + info.accountId = fields[2].GetUInt32(); + + // account name will be empty for not existed account + AccountMgr::GetName(info.accountId, info.accountName); + + info.deleteDate = time_t(fields[3].GetUInt32()); + + foundList.push_back(info); + } while (result->NextRow()); + } + + return true; + } + + /** + * Shows all deleted characters which matches the given search string, expected non empty list + * + * @see HandleCharacterDeletedListCommand + * @see HandleCharacterDeletedRestoreCommand + * @see HandleCharacterDeletedDeleteCommand + * @see DeletedInfoList + * + * @param foundList contains a list with all found deleted characters + */ + static void HandleCharacterDeletedListHelper(DeletedInfoList const& foundList, ChatHandler* handler) + { + if (!handler->GetSession()) + { + handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR); + handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_HEADER); + handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR); + } + + for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr) + { + std::string dateStr = TimeToTimestampStr(itr->deleteDate); + + if (!handler->GetSession()) + handler->PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CONSOLE, + itr->lowguid, itr->name.c_str(), itr->accountName.empty() ? "" : itr->accountName.c_str(), + itr->accountId, dateStr.c_str()); + else + handler->PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CHAT, + itr->lowguid, itr->name.c_str(), itr->accountName.empty() ? "" : itr->accountName.c_str(), + itr->accountId, dateStr.c_str()); + } + + if (!handler->GetSession()) + handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR); + } + + /** + * Restore a previously deleted character + * + * @see HandleCharacterDeletedListHelper + * @see HandleCharacterDeletedRestoreCommand + * @see HandleCharacterDeletedDeleteCommand + * @see DeletedInfoList + * + * @param delInfo the informations about the character which will be restored + */ + static void HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo, ChatHandler* handler) + { + if (delInfo.accountName.empty()) // account not exist + { + handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_ACCOUNT, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId); + return; + } + + // check character count + uint32 charcount = AccountMgr::GetCharactersCount(delInfo.accountId); + if (charcount >= 10) + { + handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_FULL, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId); + return; + } + + if (sObjectMgr->GetPlayerGUIDByName(delInfo.name)) + { + handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId); + return; + } + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_RESTORE_DELETE_INFO); + + stmt->setString(0, delInfo.name); + stmt->setUInt32(1, delInfo.accountId); + stmt->setUInt32(2, delInfo.lowguid); + + CharacterDatabase.Execute(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME_DATA); + stmt->setUInt32(0, delInfo.lowguid); + if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) + sWorld->AddCharacterNameData(delInfo.lowguid, delInfo.name, (*result)[2].GetUInt8(), (*result)[0].GetUInt8(), (*result)[1].GetUInt8()); + } + + static bool HandleCharacterTitlesCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + Player* target; + if (!handler->extractPlayerTarget((char*)args, &target)) + return false; + + LocaleConstant loc = handler->GetSessionDbcLocale(); + char const* targetName = target->GetName(); + char const* knownStr = handler->GetTrinityString(LANG_KNOWN); + + // Search in CharTitles.dbc + for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++) + { + CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id); + + if (titleInfo && target->HasTitle(titleInfo)) + { + std::string name = titleInfo->name[loc]; + if (name.empty()) + continue; + + char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index + ? handler->GetTrinityString(LANG_ACTIVE) + : ""; + + char titleNameStr[80]; + snprintf(titleNameStr, 80, name.c_str(), targetName); + + // send title in "id (idx:idx) - [namedlink locale]" format + if (handler->GetSession()) + handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr); + else + handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr); + } + } + return true; + } + + //rename characters + static bool HandleCharacterRenameCommand(ChatHandler* handler, char const* args) + { + Player* target; + uint64 targetGuid; + std::string targetName; + if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) + return false; + + if (target) + { + // check online security + if (handler->HasLowerSecurity(target, 0)) + return false; + + handler->PSendSysMessage(LANG_RENAME_PLAYER, handler->GetNameLink(target).c_str()); + target->SetAtLoginFlag(AT_LOGIN_RENAME); + } + else + { + // check offline security + if (handler->HasLowerSecurity(NULL, targetGuid)) + return false; + + std::string oldNameLink = handler->playerLink(targetName); + handler->PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); + stmt->setUInt16(0, uint16(AT_LOGIN_RENAME)); + stmt->setUInt32(1, GUID_LOPART(targetGuid)); + CharacterDatabase.Execute(stmt); + } + return true; + } + + static bool HandleCharacterLevelCommand(ChatHandler* handler, char const* args) + { + char* nameStr; + char* levelStr; + handler->extractOptFirstArg((char*)args, &nameStr, &levelStr); + if (!levelStr) + return false; + + // exception opt second arg: .character level $name + if (isalpha(levelStr[0])) + { + nameStr = levelStr; + levelStr = NULL; // current level will used + } + + Player* target; + uint64 target_guid; + std::string target_name; + if (!handler->extractPlayerTarget(nameStr, &target, &target_guid, &target_name)) + return false; + + int32 oldlevel = target ? target->getLevel() : Player::GetLevelFromDB(target_guid); + int32 newlevel = levelStr ? atoi(levelStr) : oldlevel; + + if (newlevel < 1) + return false; // invalid level + + if (newlevel > STRONG_MAX_LEVEL) // hardcoded maximum level + newlevel = STRONG_MAX_LEVEL; + + handler->HandleCharacterLevel(target, target_guid, oldlevel, newlevel); + if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target) // including player == NULL + { + std::string nameLink = handler->playerLink(target_name); + handler->PSendSysMessage(LANG_YOU_CHANGE_LVL, nameLink.c_str(), newlevel); + } + + return true; + } + + // customize characters + static bool HandleCharacterCustomizeCommand(ChatHandler* handler, char const* args) + { + Player* target; + uint64 targetGuid; + std::string targetName; + if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) + return false; + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); + stmt->setUInt16(0, uint16(AT_LOGIN_CUSTOMIZE)); + if (target) + { + handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target).c_str()); + target->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE); + stmt->setUInt32(1, target->GetGUIDLow()); + } + else + { + std::string oldNameLink = handler->playerLink(targetName); + stmt->setUInt32(1, GUID_LOPART(targetGuid)); + handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid)); + } + CharacterDatabase.Execute(stmt); + + return true; + } + + static bool HandleCharacterChangeFactionCommand(ChatHandler* handler, char const* args) + { + Player* target; + uint64 targetGuid; + std::string targetName; + + if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) + return false; + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); + stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_FACTION)); + if (target) + { + handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target).c_str()); + target->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION); + stmt->setUInt32(1, target->GetGUIDLow()); + } + else + { + std::string oldNameLink = handler->playerLink(targetName); + handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid)); + stmt->setUInt32(1, GUID_LOPART(targetGuid)); + } + CharacterDatabase.Execute(stmt); + + return true; + } + + static bool HandleCharacterChangeRaceCommand(ChatHandler* handler, char const* args) + { + Player* target; + uint64 targetGuid; + std::string targetName; + if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) + return false; + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); + stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_RACE)); + if (target) + { + // TODO : add text into database + handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target).c_str()); + target->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE); + stmt->setUInt32(1, target->GetGUIDLow()); + } + else + { + std::string oldNameLink = handler->playerLink(targetName); + // TODO : add text into database + handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid)); + stmt->setUInt32(1, GUID_LOPART(targetGuid)); + } + CharacterDatabase.Execute(stmt); + + return true; + } + + static bool HandleCharacterReputationCommand(ChatHandler* handler, char const* args) + { + Player* target; + if (!handler->extractPlayerTarget((char*)args, &target)) + return false; + + LocaleConstant loc = handler->GetSessionDbcLocale(); + + FactionStateList const& targetFSL = target->GetReputationMgr().GetStateList(); + for (FactionStateList::const_iterator itr = targetFSL.begin(); itr != targetFSL.end(); ++itr) + { + const FactionState& faction = itr->second; + FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID); + char const* factionName = factionEntry ? factionEntry->name[loc] : "#Not found#"; + ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry); + std::string rankName = handler->GetTrinityString(ReputationRankStrIndex[rank]); + std::ostringstream ss; + if (handler->GetSession()) + ss << faction.ID << " - |cffffffff|Hfaction:" << faction.ID << "|h[" << factionName << ' ' << localeNames[loc] << "]|h|r"; + else + ss << faction.ID << " - " << factionName << ' ' << localeNames[loc]; + + ss << ' ' << rankName << " (" << target->GetReputationMgr().GetReputation(factionEntry) << ')'; + + if (faction.Flags & FACTION_FLAG_VISIBLE) + ss << handler->GetTrinityString(LANG_FACTION_VISIBLE); + if (faction.Flags & FACTION_FLAG_AT_WAR) + ss << handler->GetTrinityString(LANG_FACTION_ATWAR); + if (faction.Flags & FACTION_FLAG_PEACE_FORCED) + ss << handler->GetTrinityString(LANG_FACTION_PEACE_FORCED); + if (faction.Flags & FACTION_FLAG_HIDDEN) + ss << handler->GetTrinityString(LANG_FACTION_HIDDEN); + if (faction.Flags & FACTION_FLAG_INVISIBLE_FORCED) + ss << handler->GetTrinityString(LANG_FACTION_INVISIBLE_FORCED); + if (faction.Flags & FACTION_FLAG_INACTIVE) + ss << handler->GetTrinityString(LANG_FACTION_INACTIVE); + + handler->SendSysMessage(ss.str().c_str()); + } + return true; + } + + /** + * Handles the '.character deleted list' command, which shows all deleted characters which matches the given search string + * + * @see HandleCharacterDeletedListHelper + * @see HandleCharacterDeletedRestoreCommand + * @see HandleCharacterDeletedDeleteCommand + * @see DeletedInfoList + * + * @param args the search string which either contains a player GUID or a part fo the character-name + */ + static bool HandleCharacterDeletedListCommand(ChatHandler* handler, char const* args) + { + DeletedInfoList foundList; + if (!GetDeletedCharacterInfoList(foundList, args)) + return false; + + // if no characters have been found, output a warning + if (foundList.empty()) + { + handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY); + return false; + } + + HandleCharacterDeletedListHelper(foundList, handler); + return true; + } + + /** + * Handles the '.character deleted restore' command, which restores all deleted characters which matches the given search string + * + * The command automatically calls '.character deleted list' command with the search string to show all restored characters. + * + * @see HandleCharacterDeletedRestoreHelper + * @see HandleCharacterDeletedListCommand + * @see HandleCharacterDeletedDeleteCommand + * + * @param args the search string which either contains a player GUID or a part of the character-name + */ + static bool HandleCharacterDeletedRestoreCommand(ChatHandler* handler, char const* args) + { + // It is required to submit at least one argument + if (!*args) + return false; + + std::string searchString; + std::string newCharName; + uint32 newAccount = 0; + + // GCC by some strange reason fail build code without temporary variable + std::istringstream params(args); + params >> searchString >> newCharName >> newAccount; + + DeletedInfoList foundList; + if (!GetDeletedCharacterInfoList(foundList, searchString)) + return false; + + if (foundList.empty()) + { + handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY); + return false; + } + + handler->SendSysMessage(LANG_CHARACTER_DELETED_RESTORE); + HandleCharacterDeletedListHelper(foundList, handler); + + if (newCharName.empty()) + { + // Drop not existed account cases + for (DeletedInfoList::iterator itr = foundList.begin(); itr != foundList.end(); ++itr) + HandleCharacterDeletedRestoreHelper(*itr, handler); + } + else if (foundList.size() == 1 && normalizePlayerName(newCharName)) + { + DeletedInfo delInfo = foundList.front(); + + // update name + delInfo.name = newCharName; + + // if new account provided update deleted info + if (newAccount && newAccount != delInfo.accountId) + { + delInfo.accountId = newAccount; + AccountMgr::GetName(newAccount, delInfo.accountName); + } + + HandleCharacterDeletedRestoreHelper(delInfo, handler); + } + else + handler->SendSysMessage(LANG_CHARACTER_DELETED_ERR_RENAME); + + return true; + } + + /** + * Handles the '.character deleted delete' command, which completely deletes all deleted characters which matches the given search string + * + * @see Player::GetDeletedCharacterGUIDs + * @see Player::DeleteFromDB + * @see HandleCharacterDeletedListCommand + * @see HandleCharacterDeletedRestoreCommand + * + * @param args the search string which either contains a player GUID or a part fo the character-name + */ + static bool HandleCharacterDeletedDeleteCommand(ChatHandler* handler, char const* args) + { + // It is required to submit at least one argument + if (!*args) + return false; + + DeletedInfoList foundList; + if (!GetDeletedCharacterInfoList(foundList, args)) + return false; + + if (foundList.empty()) + { + handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY); + return false; + } + + handler->SendSysMessage(LANG_CHARACTER_DELETED_DELETE); + HandleCharacterDeletedListHelper(foundList, handler); + + // Call the appropriate function to delete them (current account for deleted characters is 0) + for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr) + Player::DeleteFromDB(itr->lowguid, 0, false, true); + + return true; + } + + /** + * Handles the '.character deleted old' command, which completely deletes all deleted characters deleted with some days ago + * + * @see Player::DeleteOldCharacters + * @see Player::DeleteFromDB + * @see HandleCharacterDeletedDeleteCommand + * @see HandleCharacterDeletedListCommand + * @see HandleCharacterDeletedRestoreCommand + * + * @param args the search string which either contains a player GUID or a part fo the character-name + */ + static bool HandleCharacterDeletedOldCommand(ChatHandler* handler, char const* args) + { + int32 keepDays = sWorld->getIntConfig(CONFIG_CHARDELETE_KEEP_DAYS); + + char* px = strtok((char*)args, " "); + if (px) + { + if (!isNumeric(px)) + return false; + + keepDays = atoi(px); + if (keepDays < 0) + return false; + } + // config option value 0 -> disabled and can't be used + else if (keepDays <= 0) + return false; + + Player::DeleteOldCharacters((uint32)keepDays); + return true; + } + + static bool HandleCharacterEraseCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char *character_name_str = strtok((char*)args, " "); + if (!character_name_str) + return false; + + std::string character_name = character_name_str; + if (!normalizePlayerName(character_name)) + return false; + + uint64 character_guid; + uint32 account_id; + + Player* player = sObjectAccessor->FindPlayerByName(character_name.c_str()); + if (player) + { + character_guid = player->GetGUID(); + account_id = player->GetSession()->GetAccountId(); + player->GetSession()->KickPlayer(); + } + else + { + character_guid = sObjectMgr->GetPlayerGUIDByName(character_name); + if (!character_guid) + { + handler->PSendSysMessage(LANG_NO_PLAYER, character_name.c_str()); + handler->SetSentErrorMessage(true); + return false; + } + account_id = sObjectMgr->GetPlayerAccountIdByGUID(character_guid); + } + + std::string account_name; + AccountMgr::GetName (account_id, account_name); + + Player::DeleteFromDB(character_guid, account_id, true, true); + handler->PSendSysMessage(LANG_CHARACTER_DELETED, character_name.c_str(), GUID_LOPART(character_guid), account_name.c_str(), account_id); + return true; + } +}; + +void AddSC_character_commandscript() +{ + new character_commandscript(); +} \ No newline at end of file diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp new file mode 100644 index 00000000000..12528f384a4 --- /dev/null +++ b/src/server/scripts/Commands/cs_server.cpp @@ -0,0 +1,430 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +Name: server_commandscript +%Complete: 100 +Comment: All server related commands +Category: commandscripts +EndScriptData */ + +#include "ScriptMgr.h" +#include "Chat.h" +#include "SystemConfig.h" +#include "Config.h" + +class server_commandscript : public CommandScript +{ +public: + server_commandscript() : CommandScript("server_commandscript") { } + + ChatCommand* GetCommands() const + { + static ChatCommand serverIdleRestartCommandTable[] = + { + { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, + { "" , SEC_ADMINISTRATOR, true, &HandleServerIdleRestartCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand serverIdleShutdownCommandTable[] = + { + { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, + { "" , SEC_ADMINISTRATOR, true, &HandleServerIdleShutDownCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand serverRestartCommandTable[] = + { + { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, + { "" , SEC_ADMINISTRATOR, true, &HandleServerRestartCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand serverShutdownCommandTable[] = + { + { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, + { "" , SEC_ADMINISTRATOR, true, &HandleServerShutDownCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand serverSetCommandTable[] = + { + { "difftime", SEC_CONSOLE, true, &HandleServerSetDiffTimeCommand, "", NULL }, + { "loglevel", SEC_CONSOLE, true, &HandleServerSetLogLevelCommand, "", NULL }, + { "logfilelevel", SEC_CONSOLE, true, &HandleServerSetLogFileLevelCommand, "", NULL }, + { "motd", SEC_ADMINISTRATOR, true, &HandleServerSetMotdCommand, "", NULL }, + { "closed", SEC_ADMINISTRATOR, true, &HandleServerSetClosedCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand serverCommandTable[] = + { + { "corpses", SEC_GAMEMASTER, true, &HandleServerCorpsesCommand, "", NULL }, + { "exit", SEC_CONSOLE, true, &HandleServerExitCommand, "", NULL }, + { "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable }, + { "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverIdleShutdownCommandTable }, + { "info", SEC_PLAYER, true, &HandleServerInfoCommand, "", NULL }, + { "motd", SEC_PLAYER, true, &HandleServerMotdCommand, "", NULL }, + { "plimit", SEC_ADMINISTRATOR, true, &HandleServerPLimitCommand, "", NULL }, + { "restart", SEC_ADMINISTRATOR, true, NULL, "", serverRestartCommandTable }, + { "shutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable }, + { "set", SEC_ADMINISTRATOR, true, NULL, "", serverSetCommandTable }, + { "togglequerylog", SEC_CONSOLE, true, &HandleServerToggleQueryLogging, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand commandTable[] = + { + { "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable }, + { NULL, 0, false, NULL, "", NULL } + }; + return commandTable; + } + + // Triggering corpses expire check in world + static bool HandleServerCorpsesCommand(ChatHandler* handler, char const* args) + { + sObjectAccessor->RemoveOldCorpses(); + return true; + } + + static bool HandleServerInfoCommand(ChatHandler* handler, char const* args) + { + uint32 playersNum = sWorld->GetPlayerCount(); + uint32 maxPlayersNum = sWorld->GetMaxPlayerCount(); + uint32 activeClientsNum = sWorld->GetActiveSessionCount(); + uint32 queuedClientsNum = sWorld->GetQueuedSessionCount(); + uint32 maxActiveClientsNum = sWorld->GetMaxActiveSessionCount(); + uint32 maxQueuedClientsNum = sWorld->GetMaxQueuedSessionCount(); + std::string uptime = secsToTimeString(sWorld->GetUptime()); + uint32 updateTime = sWorld->GetUpdateTime(); + + handler->SendSysMessage(_FULLVERSION); + handler->PSendSysMessage(LANG_CONNECTED_PLAYERS, playersNum, maxPlayersNum); + handler->PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum); + handler->PSendSysMessage(LANG_UPTIME, uptime.c_str()); + handler->PSendSysMessage(LANG_UPDATE_DIFF, updateTime); + // Can't use sWorld->ShutdownMsg here in case of console command + if (sWorld->IsShuttingDown()) + handler->PSendSysMessage(LANG_SHUTDOWN_TIMELEFT, secsToTimeString(sWorld->GetShutDownTimeLeft()).c_str()); + + return true; + } + // Display the 'Message of the day' for the realm + static bool HandleServerMotdCommand(ChatHandler* handler, char const* args) + { + handler->PSendSysMessage(LANG_MOTD_CURRENT, sWorld->GetMotd()); + return true; + } + + static bool HandleServerPLimitCommand(ChatHandler* handler, char const* args) + { + if (*args) + { + char* param = strtok((char*)args, " "); + if (!param) + return false; + + int l = strlen(param); + + if (strncmp(param, "player", l) == 0) + sWorld->SetPlayerSecurityLimit(SEC_PLAYER); + else if (strncmp(param, "moderator", l) == 0) + sWorld->SetPlayerSecurityLimit(SEC_MODERATOR); + else if (strncmp(param, "gamemaster", l) == 0) + sWorld->SetPlayerSecurityLimit(SEC_GAMEMASTER); + else if (strncmp(param, "administrator", l) == 0) + sWorld->SetPlayerSecurityLimit(SEC_ADMINISTRATOR); + else if (strncmp(param, "reset", l) == 0) + { + sWorld->SetPlayerAmountLimit(ConfigMgr::GetIntDefault("PlayerLimit", 100)); + sWorld->LoadDBAllowedSecurityLevel(); + } + else + { + int val = atoi(param); + if (val < 0) + sWorld->SetPlayerSecurityLimit(AccountTypes(uint32(-val))); + else + sWorld->SetPlayerAmountLimit(uint32(val)); + } + } + + uint32 pLimit = sWorld->GetPlayerAmountLimit(); + AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit(); + char const* secName = ""; + switch (allowedAccountType) + { + case SEC_PLAYER: secName = "Player"; break; + case SEC_MODERATOR: secName = "Moderator"; break; + case SEC_GAMEMASTER: secName = "Gamemaster"; break; + case SEC_ADMINISTRATOR: secName = "Administrator"; break; + default: secName = ""; break; + } + handler->PSendSysMessage("Player limits: amount %u, min. security level %s.", pLimit, secName); + + return true; + } + + static bool HandleServerShutDownCancelCommand(ChatHandler* handler, char const* args) + { + sWorld->ShutdownCancel(); + return true; + } + + static bool HandleServerShutDownCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char* time_str = strtok ((char*) args, " "); + char* exitcode_str = strtok (NULL, ""); + + int32 time = atoi (time_str); + + // Prevent interpret wrong arg value as 0 secs shutdown time + if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) + return false; + + if (exitcode_str) + { + int32 exitcode = atoi(exitcode_str); + + // Handle atoi() errors + if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) + return false; + + // Exit code should be in range of 0-125, 126-255 is used + // in many shells for their own return codes and code > 255 + // is not supported in many others + if (exitcode < 0 || exitcode > 125) + return false; + + sWorld->ShutdownServ(time, 0, exitcode); + } + else + sWorld->ShutdownServ(time, 0, SHUTDOWN_EXIT_CODE); + return true; + } + + static bool HandleServerRestartCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char* time_str = strtok ((char*) args, " "); + char* exitcode_str = strtok (NULL, ""); + + int32 time = atoi (time_str); + + // Prevent interpret wrong arg value as 0 secs shutdown time + if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) + return false; + + if (exitcode_str) + { + int32 exitcode = atoi (exitcode_str); + + // Handle atoi() errors + if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) + return false; + + // Exit code should be in range of 0-125, 126-255 is used + // in many shells for their own return codes and code > 255 + // is not supported in many others + if (exitcode < 0 || exitcode > 125) + return false; + + sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, exitcode); + } + else + sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE); + return true; + } + + static bool HandleServerIdleRestartCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char* time_str = strtok ((char*) args, " "); + char* exitcode_str = strtok (NULL, ""); + + int32 time = atoi (time_str); + + // Prevent interpret wrong arg value as 0 secs shutdown time + if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) + return false; + + if (exitcode_str) + { + int32 exitcode = atoi (exitcode_str); + + // Handle atoi() errors + if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) + return false; + + // Exit code should be in range of 0-125, 126-255 is used + // in many shells for their own return codes and code > 255 + // is not supported in many others + if (exitcode < 0 || exitcode > 125) + return false; + + sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, exitcode); + } + else + sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE); + return true; + } + + static bool HandleServerIdleShutDownCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char* time_str = strtok ((char*) args, " "); + char* exitcode_str = strtok (NULL, ""); + + int32 time = atoi (time_str); + + // Prevent interpret wrong arg value as 0 secs shutdown time + if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) + return false; + + if (exitcode_str) + { + int32 exitcode = atoi (exitcode_str); + + // Handle atoi() errors + if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) + return false; + + // Exit code should be in range of 0-125, 126-255 is used + // in many shells for their own return codes and code > 255 + // is not supported in many others + if (exitcode < 0 || exitcode > 125) + return false; + + sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, exitcode); + } + else + sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE); + return true; + } + + // Exit the realm + static bool HandleServerExitCommand(ChatHandler* handler, char const* args) + { + handler->SendSysMessage(LANG_COMMAND_EXIT); + World::StopNow(SHUTDOWN_EXIT_CODE); + return true; + } + + // Define the 'Message of the day' for the realm + static bool HandleServerSetMotdCommand(ChatHandler* handler, char const* args) + { + sWorld->SetMotd(args); + handler->PSendSysMessage(LANG_MOTD_NEW, args); + return true; + } + + // Set whether we accept new clients + static bool HandleServerSetClosedCommand(ChatHandler* handler, char const* args) + { + if (strncmp(args, "on", 3) == 0) + { + handler->SendSysMessage(LANG_WORLD_CLOSED); + sWorld->SetClosed(true); + return true; + } + else if (strncmp(args, "off", 4) == 0) + { + handler->SendSysMessage(LANG_WORLD_OPENED); + sWorld->SetClosed(false); + return true; + } + + handler->SendSysMessage(LANG_USE_BOL); + handler->SetSentErrorMessage(true); + return false; + } + + // Set the level of logging + static bool HandleServerSetLogFileLevelCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char *NewLevel = strtok((char*)args, " "); + if (!NewLevel) + return false; + + sLog->SetLogFileLevel(NewLevel); + return true; + } + + // Set the level of logging + static bool HandleServerSetLogLevelCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char *NewLevel = strtok((char*)args, " "); + if (!NewLevel) + return false; + + sLog->SetLogLevel(NewLevel); + return true; + } + + // set diff time record interval + static bool HandleServerSetDiffTimeCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char *NewTimeStr = strtok((char*)args, " "); + if (!NewTimeStr) + return false; + + int32 NewTime =atoi(NewTimeStr); + if (NewTime < 0) + return false; + + sWorld->SetRecordDiffInterval(NewTime); + printf( "Record diff every %u ms\n", NewTime); + return true; + } + + // toggle sql driver query logging + static bool HandleServerToggleQueryLogging(ChatHandler* handler,const char* args ) + { + sLog->SetSQLDriverQueryLogging(!sLog->GetSQLDriverQueryLogging()); + if (sLog->GetSQLDriverQueryLogging()) + handler->PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_ENABLED); + else + handler->PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_DISABLED); + + return true; + } +}; + +void AddSC_server_commandscript() +{ + new server_commandscript(); +} \ No newline at end of file diff --git a/src/server/scripts/Kalimdor/ashenvale.cpp b/src/server/scripts/Kalimdor/ashenvale.cpp index e28665c038e..9e8cdaa8b92 100644 --- a/src/server/scripts/Kalimdor/ashenvale.cpp +++ b/src/server/scripts/Kalimdor/ashenvale.cpp @@ -169,15 +169,15 @@ class npc_torek : public CreatureScript # npc_ruul_snowhoof ####*/ -enum RuulSnowhoof -{ +enum RuulSnowhoof +{ NPC_THISTLEFUR_URSA = 3921, NPC_THISTLEFUR_TOTEMIC = 3922, NPC_THISTLEFUR_PATHFINDER = 3926, QUEST_FREEDOM_TO_RUUL = 6482, - GO_CAGE = 178147 + GO_CAGE = 178147 }; Position const RuulSnowhoofSummonsCoord[6] = diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp index e85a3e1870d..699e7cad97c 100755 --- a/src/server/worldserver/CommandLine/CliRunnable.cpp +++ b/src/server/worldserver/CommandLine/CliRunnable.cpp @@ -116,458 +116,6 @@ void commandFinished(void*, bool /*success*/) fflush(stdout); } -/** - * Collects all GUIDs (and related info) from deleted characters which are still in the database. - * - * @param foundList a reference to an std::list which will be filled with info data - * @param searchString the search string which either contains a player GUID or a part fo the character-name - * @return returns false if there was a problem while selecting the characters (e.g. player name not normalizeable) - */ -bool ChatHandler::GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::string searchString) -{ - PreparedQueryResult result; - PreparedStatement* stmt; - if (!searchString.empty()) - { - // search by GUID - if (isNumeric(searchString.c_str())) - { - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_GUID); - - stmt->setUInt32(0, uint32(atoi(searchString.c_str()))); - - result = CharacterDatabase.Query(stmt); - } - // search by name - else - { - if (!normalizePlayerName(searchString)) - return false; - - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_NAME); - - stmt->setString(0, searchString); - - result = CharacterDatabase.Query(stmt); - } - } - else - { - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO); - - result = CharacterDatabase.Query(stmt); - } - - if (result) - { - do - { - Field* fields = result->Fetch(); - - DeletedInfo info; - - info.lowguid = fields[0].GetUInt32(); - info.name = fields[1].GetString(); - info.accountId = fields[2].GetUInt32(); - - // account name will be empty for not existed account - AccountMgr::GetName(info.accountId, info.accountName); - - info.deleteDate = time_t(fields[3].GetUInt32()); - - foundList.push_back(info); - } while (result->NextRow()); - } - - return true; -} - -/** - * Generate WHERE guids list by deleted info in way preventing return too long where list for existed query string length limit. - * - * @param itr a reference to an deleted info list iterator, it updated in function for possible next function call if list to long - * @param itr_end a reference to an deleted info list iterator end() - * @return returns generated where list string in form: 'guid IN (gui1, guid2, ...)' - */ -std::string ChatHandler::GenerateDeletedCharacterGUIDsWhereStr(DeletedInfoList::const_iterator& itr, DeletedInfoList::const_iterator const& itr_end) -{ - std::ostringstream wherestr; - wherestr << "guid IN ('"; - for (; itr != itr_end; ++itr) - { - wherestr << itr->lowguid; - - if (wherestr.str().size() > MAX_QUERY_LEN - 50) // near to max query - { - ++itr; - break; - } - - DeletedInfoList::const_iterator itr2 = itr; - if (++itr2 != itr_end) - wherestr << "', '"; - } - wherestr << "')"; - return wherestr.str(); -} - -/** - * Shows all deleted characters which matches the given search string, expected non empty list - * - * @see ChatHandler::HandleCharacterDeletedListCommand - * @see ChatHandler::HandleCharacterDeletedRestoreCommand - * @see ChatHandler::HandleCharacterDeletedDeleteCommand - * @see ChatHandler::DeletedInfoList - * - * @param foundList contains a list with all found deleted characters - */ -void ChatHandler::HandleCharacterDeletedListHelper(DeletedInfoList const& foundList) -{ - if (!m_session) - { - SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR); - SendSysMessage(LANG_CHARACTER_DELETED_LIST_HEADER); - SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR); - } - - for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr) - { - std::string dateStr = TimeToTimestampStr(itr->deleteDate); - - if (!m_session) - PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CONSOLE, - itr->lowguid, itr->name.c_str(), itr->accountName.empty() ? "" : itr->accountName.c_str(), - itr->accountId, dateStr.c_str()); - else - PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CHAT, - itr->lowguid, itr->name.c_str(), itr->accountName.empty() ? "" : itr->accountName.c_str(), - itr->accountId, dateStr.c_str()); - } - - if (!m_session) - SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR); -} - -/** - * Handles the '.character deleted list' command, which shows all deleted characters which matches the given search string - * - * @see ChatHandler::HandleCharacterDeletedListHelper - * @see ChatHandler::HandleCharacterDeletedRestoreCommand - * @see ChatHandler::HandleCharacterDeletedDeleteCommand - * @see ChatHandler::DeletedInfoList - * - * @param args the search string which either contains a player GUID or a part fo the character-name - */ -bool ChatHandler::HandleCharacterDeletedListCommand(const char* args) -{ - DeletedInfoList foundList; - if (!GetDeletedCharacterInfoList(foundList, args)) - return false; - - // if no characters have been found, output a warning - if (foundList.empty()) - { - SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY); - return false; - } - - HandleCharacterDeletedListHelper(foundList); - return true; -} - -/** - * Restore a previously deleted character - * - * @see ChatHandler::HandleCharacterDeletedListHelper - * @see ChatHandler::HandleCharacterDeletedRestoreCommand - * @see ChatHandler::HandleCharacterDeletedDeleteCommand - * @see ChatHandler::DeletedInfoList - * - * @param delInfo the informations about the character which will be restored - */ -void ChatHandler::HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo) -{ - if (delInfo.accountName.empty()) // account not exist - { - PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_ACCOUNT, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId); - return; - } - - // check character count - uint32 charcount = AccountMgr::GetCharactersCount(delInfo.accountId); - if (charcount >= 10) - { - PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_FULL, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId); - return; - } - - if (sObjectMgr->GetPlayerGUIDByName(delInfo.name)) - { - PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId); - return; - } - - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_RESTORE_DELETE_INFO); - - stmt->setString(0, delInfo.name); - stmt->setUInt32(1, delInfo.accountId); - stmt->setUInt32(2, delInfo.lowguid); - - CharacterDatabase.Execute(stmt); - - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME_DATA); - stmt->setUInt32(0, delInfo.lowguid); - if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) - sWorld->AddCharacterNameData(delInfo.lowguid, delInfo.name, (*result)[2].GetUInt8(), (*result)[0].GetUInt8(), (*result)[1].GetUInt8()); -} - -/** - * Handles the '.character deleted restore' command, which restores all deleted characters which matches the given search string - * - * The command automatically calls '.character deleted list' command with the search string to show all restored characters. - * - * @see ChatHandler::HandleCharacterDeletedRestoreHelper - * @see ChatHandler::HandleCharacterDeletedListCommand - * @see ChatHandler::HandleCharacterDeletedDeleteCommand - * - * @param args the search string which either contains a player GUID or a part of the character-name - */ -bool ChatHandler::HandleCharacterDeletedRestoreCommand(const char* args) -{ - // It is required to submit at least one argument - if (!*args) - return false; - - std::string searchString; - std::string newCharName; - uint32 newAccount = 0; - - // GCC by some strange reason fail build code without temporary variable - std::istringstream params(args); - params >> searchString >> newCharName >> newAccount; - - DeletedInfoList foundList; - if (!GetDeletedCharacterInfoList(foundList, searchString)) - return false; - - if (foundList.empty()) - { - SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY); - return false; - } - - SendSysMessage(LANG_CHARACTER_DELETED_RESTORE); - HandleCharacterDeletedListHelper(foundList); - - if (newCharName.empty()) - { - // Drop not existed account cases - for (DeletedInfoList::iterator itr = foundList.begin(); itr != foundList.end(); ++itr) - HandleCharacterDeletedRestoreHelper(*itr); - } - else if (foundList.size() == 1 && normalizePlayerName(newCharName)) - { - DeletedInfo delInfo = foundList.front(); - - // update name - delInfo.name = newCharName; - - // if new account provided update deleted info - if (newAccount && newAccount != delInfo.accountId) - { - delInfo.accountId = newAccount; - AccountMgr::GetName(newAccount, delInfo.accountName); - } - - HandleCharacterDeletedRestoreHelper(delInfo); - } - else - SendSysMessage(LANG_CHARACTER_DELETED_ERR_RENAME); - - return true; -} - -/** - * Handles the '.character deleted delete' command, which completely deletes all deleted characters which matches the given search string - * - * @see Player::GetDeletedCharacterGUIDs - * @see Player::DeleteFromDB - * @see ChatHandler::HandleCharacterDeletedListCommand - * @see ChatHandler::HandleCharacterDeletedRestoreCommand - * - * @param args the search string which either contains a player GUID or a part fo the character-name - */ -bool ChatHandler::HandleCharacterDeletedDeleteCommand(const char* args) -{ - // It is required to submit at least one argument - if (!*args) - return false; - - DeletedInfoList foundList; - if (!GetDeletedCharacterInfoList(foundList, args)) - return false; - - if (foundList.empty()) - { - SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY); - return false; - } - - SendSysMessage(LANG_CHARACTER_DELETED_DELETE); - HandleCharacterDeletedListHelper(foundList); - - // Call the appropriate function to delete them (current account for deleted characters is 0) - for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr) - Player::DeleteFromDB(itr->lowguid, 0, false, true); - - return true; -} - -/** - * Handles the '.character deleted old' command, which completely deletes all deleted characters deleted with some days ago - * - * @see Player::DeleteOldCharacters - * @see Player::DeleteFromDB - * @see ChatHandler::HandleCharacterDeletedDeleteCommand - * @see ChatHandler::HandleCharacterDeletedListCommand - * @see ChatHandler::HandleCharacterDeletedRestoreCommand - * - * @param args the search string which either contains a player GUID or a part fo the character-name - */ -bool ChatHandler::HandleCharacterDeletedOldCommand(const char* args) -{ - int32 keepDays = sWorld->getIntConfig(CONFIG_CHARDELETE_KEEP_DAYS); - - char* px = strtok((char*)args, " "); - if (px) - { - if (!isNumeric(px)) - return false; - - keepDays = atoi(px); - if (keepDays < 0) - return false; - } - // config option value 0 -> disabled and can't be used - else if (keepDays <= 0) - return false; - - Player::DeleteOldCharacters((uint32)keepDays); - return true; -} - -bool ChatHandler::HandleCharacterEraseCommand(const char* args){ - if (!*args) - return false; - - char *character_name_str = strtok((char*)args, " "); - if (!character_name_str) - return false; - - std::string character_name = character_name_str; - if (!normalizePlayerName(character_name)) - return false; - - uint64 character_guid; - uint32 account_id; - - Player* player = sObjectAccessor->FindPlayerByName(character_name.c_str()); - if (player) - { - character_guid = player->GetGUID(); - account_id = player->GetSession()->GetAccountId(); - player->GetSession()->KickPlayer(); - } - else - { - character_guid = sObjectMgr->GetPlayerGUIDByName(character_name); - if (!character_guid) - { - PSendSysMessage(LANG_NO_PLAYER, character_name.c_str()); - SetSentErrorMessage(true); - return false; - } - - account_id = sObjectMgr->GetPlayerAccountIdByGUID(character_guid); - } - - std::string account_name; - AccountMgr::GetName (account_id, account_name); - - Player::DeleteFromDB(character_guid, account_id, true, true); - PSendSysMessage(LANG_CHARACTER_DELETED, character_name.c_str(), GUID_LOPART(character_guid), account_name.c_str(), account_id); - return true; -} - -/// Exit the realm -bool ChatHandler::HandleServerExitCommand(const char* /*args*/) -{ - SendSysMessage(LANG_COMMAND_EXIT); - World::StopNow(SHUTDOWN_EXIT_CODE); - return true; -} - -/// Set the level of logging -bool ChatHandler::HandleServerSetLogFileLevelCommand(const char *args) -{ - if (!*args) - return false; - - char *NewLevel = strtok((char*)args, " "); - if (!NewLevel) - return false; - - sLog->SetLogFileLevel(NewLevel); - return true; -} - -/// Set the level of logging -bool ChatHandler::HandleServerSetLogLevelCommand(const char *args) -{ - if (!*args) - return false; - - char *NewLevel = strtok((char*)args, " "); - if (!NewLevel) - return false; - - sLog->SetLogLevel(NewLevel); - return true; -} - -/// set diff time record interval -bool ChatHandler::HandleServerSetDiffTimeCommand(const char *args) -{ - if (!*args) - return false; - - char *NewTimeStr = strtok((char*)args, " "); - if (!NewTimeStr) - return false; - - int32 NewTime =atoi(NewTimeStr); - if (NewTime < 0) - return false; - - sWorld->SetRecordDiffInterval(NewTime); - printf( "Record diff every %u ms\n", NewTime); - return true; -} - -/// toggle sql driver query logging -bool ChatHandler::HandleServerToggleQueryLogging(const char* /* args */) -{ - sLog->SetSQLDriverQueryLogging(!sLog->GetSQLDriverQueryLogging()); - if (sLog->GetSQLDriverQueryLogging()) - PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_ENABLED); - else - PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_DISABLED); - - return true; -} - -/// @} - #ifdef linux // Non-blocking keypress detector, when return pressed, return 1, else always return 0 int kb_hit_return() From 90efff96a82162449788b2b575186111730272e5 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 20 Jun 2012 20:54:09 -0230 Subject: [PATCH 1079/1149] DB/Gossip: Add a Missing gossip --- .../world/2012_06_20_02_world_gossip.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 sql/updates/world/2012_06_20_02_world_gossip.sql diff --git a/sql/updates/world/2012_06_20_02_world_gossip.sql b/sql/updates/world/2012_06_20_02_world_gossip.sql new file mode 100644 index 00000000000..c20cb99aa4a --- /dev/null +++ b/sql/updates/world/2012_06_20_02_world_gossip.sql @@ -0,0 +1,17 @@ + -- Prince Toreth +UPDATE `creature_template` SET `gossip_menu_id`=7478 WHERE `entry`=17674; +-- Creature Gossip_menu insert from sniff +DELETE FROM `gossip_menu` WHERE `entry`=7474 AND `text_id`=9060; +DELETE FROM `gossip_menu` WHERE `entry`=7475 AND `text_id`=9059; +DELETE FROM `gossip_menu` WHERE `entry`=7476 AND `text_id`=9058; +DELETE FROM `gossip_menu` WHERE `entry`=7477 AND `text_id`=9057; +DELETE FROM `gossip_menu` WHERE `entry`=7478 AND `text_id`=9056; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(7474,9060),(7475, 9059),(7476,9058),(7477,9057),(7478,9056); +-- Creature Gossip_menu_option insert from sniff +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7478,7477,7476,7475) AND `id`=0; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES +(7478,0,0, 'Why do you suffer?',1,1,7477,0,0,0, ''), +(7477,0,0, 'What is Ysera and how were you blessed?',1,1,7476,0,0,0, ''), +(7476,0,0, 'Until what?',1,1,7475,0,0,0, ''), +(7475,0,0, 'So why are you still here?',1,1,7474,0,0,0, ''); From 7e6273315cea7877063dc0e901dab7fdfbb44e60 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 21 Jun 2012 00:27:13 +0100 Subject: [PATCH 1080/1149] Scripts/Commands: Fix non pch build (add missing includes) --- src/server/scripts/Commands/cs_character.cpp | 1 + src/server/scripts/Commands/cs_server.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index d5e674a1097..1784d73cbab 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -25,6 +25,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "Chat.h" #include "AccountMgr.h" +#include "ObjectMgr.h" class character_commandscript : public CommandScript { diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index 12528f384a4..2e5b929d460 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -26,6 +26,7 @@ EndScriptData */ #include "Chat.h" #include "SystemConfig.h" #include "Config.h" +#include "ObjectAccessor.h" class server_commandscript : public CommandScript { From 874dff2050da98b2ca164319430e76148020ff23 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 21 Jun 2012 01:38:55 +0100 Subject: [PATCH 1081/1149] Scripts/Commands: No one likes tabs :( --- src/server/game/Scripting/ScriptLoader.cpp | 2 +- src/server/scripts/Commands/cs_modify.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index c18c6914096..94da23110b8 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -667,7 +667,7 @@ void AddCommandScripts() AddSC_quest_commandscript(); AddSC_reload_commandscript(); AddSC_tele_commandscript(); - AddSC_server_commandscript(); + AddSC_server_commandscript(); AddSC_titles_commandscript(); AddSC_wp_commandscript(); AddSC_character_commandscript(); diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 3e04cb48af4..60c5e1cf162 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1390,7 +1390,7 @@ public: if (!target) target = handler->GetSession()->GetPlayer(); - // check online security + // check online security else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), 0)) return false; From d3bf4626d05883ed856785e19f70f29340157ad2 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Wed, 20 Jun 2012 14:57:03 +0200 Subject: [PATCH 1082/1149] Core/Commands: Convert list commands in commandscript --- src/server/game/Chat/Chat.cpp | 10 - src/server/game/Chat/Chat.h | 5 - src/server/game/Chat/Commands/Level3.cpp | 407 ------------------ src/server/scripts/Commands/CMakeLists.txt | 5 +- src/server/scripts/Commands/cs_list.cpp | 467 +++++++++++++++++++++ 5 files changed, 469 insertions(+), 425 deletions(-) create mode 100644 src/server/scripts/Commands/cs_list.cpp diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index f96199f9bd3..bbfab474e22 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -122,15 +122,6 @@ ChatCommand* ChatHandler::getCommandTable() { NULL, 0, false, NULL, "", NULL } }; - static ChatCommand listCommandTable[] = - { - { "creature", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleListCreatureCommand>, "", NULL }, - { "item", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleListItemCommand>, "", NULL }, - { "object", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleListObjectCommand>, "", NULL }, - { "auras", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleListAurasCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - static ChatCommand lookupPlayerCommandTable[] = { { "ip", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleLookupPlayerIpCommand>, "", NULL }, @@ -234,7 +225,6 @@ ChatCommand* ChatHandler::getCommandTable() static ChatCommand commandTable[] = { - { "list", SEC_ADMINISTRATOR, true, NULL, "", listCommandTable }, { "lookup", SEC_ADMINISTRATOR, true, NULL, "", lookupCommandTable }, { "pdump", SEC_ADMINISTRATOR, true, NULL, "", pdumpCommandTable }, { "guild", SEC_ADMINISTRATOR, true, NULL, "", guildCommandTable }, diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index c43b0fa9aca..9fc9b394947 100755 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -163,11 +163,6 @@ class ChatHandler bool HandleGuildRankCommand(const char* args); bool HandleGuildDeleteCommand(const char* args); - bool HandleListAurasCommand(const char * args); - bool HandleListCreatureCommand(const char* args); - bool HandleListItemCommand(const char* args); - bool HandleListObjectCommand(const char* args); - bool HandleLookupAreaCommand(const char* args); bool HandleLookupCreatureCommand(const char* args); bool HandleLookupEventCommand(const char* args); diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 33855a96617..eed4c11e1a9 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -385,365 +385,6 @@ bool ChatHandler::HandleAddItemSetCommand(const char *args) return true; } -bool ChatHandler::HandleListItemCommand(const char *args) -{ - if (!*args) - return false; - - char* cId = extractKeyFromLink((char*)args, "Hitem"); - if (!cId) - return false; - - uint32 item_id = atol(cId); - if (!item_id) - { - PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, item_id); - SetSentErrorMessage(true); - return false; - } - - ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(item_id); - if (!itemProto) - { - PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, item_id); - SetSentErrorMessage(true); - return false; - } - - char* c_count = strtok(NULL, " "); - int _count = c_count ? atol(c_count) : 10; - - if (_count < 0) - return false; - uint32 count = uint32(_count); - - PreparedQueryResult result; - - // inventory case - uint32 inv_count = 0; - - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM); - stmt->setUInt32(0, item_id); - result = CharacterDatabase.Query(stmt); - - if (result) - inv_count = (*result)[0].GetUInt64(); - - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_INVENTORY_ITEM_BY_ENTRY); - stmt->setUInt32(0, item_id); - stmt->setUInt32(1, count); - result = CharacterDatabase.Query(stmt); - - if (result) - { - do - { - Field* fields = result->Fetch(); - uint32 item_guid = fields[0].GetUInt32(); - uint32 item_bag = fields[1].GetUInt32(); - uint8 item_slot = fields[2].GetUInt8(); - uint32 owner_guid = fields[3].GetUInt32(); - uint32 owner_acc = fields[4].GetUInt32(); - std::string owner_name = fields[5].GetString(); - - char const* item_pos = 0; - if (Player::IsEquipmentPos(item_bag, item_slot)) - item_pos = "[equipped]"; - else if (Player::IsInventoryPos(item_bag, item_slot)) - item_pos = "[in inventory]"; - else if (Player::IsBankPos(item_bag, item_slot)) - item_pos = "[in bank]"; - else - item_pos = ""; - - PSendSysMessage(LANG_ITEMLIST_SLOT, item_guid, owner_name.c_str(), owner_guid, owner_acc, item_pos); - } - while (result->NextRow()); - - uint32 res_count = uint32(result->GetRowCount()); - - if (count > res_count) - count -= res_count; - else if (count) - count = 0; - } - - // mail case - uint32 mail_count = 0; - - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_COUNT_ITEM); - stmt->setUInt32(0, item_id); - result = CharacterDatabase.Query(stmt); - - if (result) - mail_count = (*result)[0].GetUInt64(); - - if (count > 0) - { - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_ITEMS_BY_ENTRY); - stmt->setUInt32(0, item_id); - stmt->setUInt32(1, count); - result = CharacterDatabase.Query(stmt); - } - else - result = PreparedQueryResult(NULL); - - if (result) - { - do - { - Field* fields = result->Fetch(); - uint32 item_guid = fields[0].GetUInt32(); - uint32 item_s = fields[1].GetUInt32(); - uint32 item_r = fields[2].GetUInt32(); - uint32 item_s_acc = fields[3].GetUInt32(); - std::string item_s_name = fields[4].GetString(); - uint32 item_r_acc = fields[5].GetUInt32(); - std::string item_r_name = fields[6].GetString(); - - char const* item_pos = "[in mail]"; - - PSendSysMessage(LANG_ITEMLIST_MAIL, item_guid, item_s_name.c_str(), item_s, item_s_acc, item_r_name.c_str(), item_r, item_r_acc, item_pos); - } - while (result->NextRow()); - - uint32 res_count = uint32(result->GetRowCount()); - - if (count > res_count) - count -= res_count; - else if (count) - count = 0; - } - - // auction case - uint32 auc_count = 0; - - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONHOUSE_COUNT_ITEM); - stmt->setUInt32(0, item_id); - result = CharacterDatabase.Query(stmt); - - if (result) - auc_count = (*result)[0].GetUInt64(); - - if (count > 0) - { - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONHOUSE_ITEM_BY_ENTRY); - stmt->setUInt32(0, item_id); - stmt->setUInt32(1, count); - result = CharacterDatabase.Query(stmt); - } - else - result = PreparedQueryResult(NULL); - - if (result) - { - do - { - Field* fields = result->Fetch(); - uint32 item_guid = fields[0].GetUInt32(); - uint32 owner = fields[1].GetUInt32(); - uint32 owner_acc = fields[2].GetUInt32(); - std::string owner_name = fields[3].GetString(); - - char const* item_pos = "[in auction]"; - - PSendSysMessage(LANG_ITEMLIST_AUCTION, item_guid, owner_name.c_str(), owner, owner_acc, item_pos); - } - while (result->NextRow()); - } - - // guild bank case - uint32 guild_count = 0; - - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_BANK_COUNT_ITEM); - stmt->setUInt32(0, item_id); - result = CharacterDatabase.Query(stmt); - - if (result) - guild_count = (*result)[0].GetUInt64(); - - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY); - stmt->setUInt32(0, item_id); - stmt->setUInt32(1, count); - result = CharacterDatabase.Query(stmt); - - if (result) - { - do - { - Field* fields = result->Fetch(); - uint32 item_guid = fields[0].GetUInt32(); - uint32 guild_guid = fields[1].GetUInt32(); - std::string guild_name = fields[2].GetString(); - - char const* item_pos = "[in guild bank]"; - - PSendSysMessage(LANG_ITEMLIST_GUILD, item_guid, guild_name.c_str(), guild_guid, item_pos); - } - while (result->NextRow()); - - uint32 res_count = uint32(result->GetRowCount()); - - if (count > res_count) - count -= res_count; - else if (count) - count = 0; - } - - if (inv_count + mail_count + auc_count + guild_count == 0) - { - SendSysMessage(LANG_COMMAND_NOITEMFOUND); - SetSentErrorMessage(true); - return false; - } - - PSendSysMessage(LANG_COMMAND_LISTITEMMESSAGE, item_id, inv_count + mail_count + auc_count + guild_count, inv_count, mail_count, auc_count, guild_count); - return true; -} - -bool ChatHandler::HandleListObjectCommand(const char *args) -{ - if (!*args) - return false; - - // number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r - char* cId = extractKeyFromLink((char*)args, "Hgameobject_entry"); - if (!cId) - return false; - - uint32 go_id = atol(cId); - if (!go_id) - { - PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, go_id); - SetSentErrorMessage(true); - return false; - } - - GameObjectTemplate const* gInfo = sObjectMgr->GetGameObjectTemplate(go_id); - if (!gInfo) - { - PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, go_id); - SetSentErrorMessage(true); - return false; - } - - char* c_count = strtok(NULL, " "); - int count = c_count ? atol(c_count) : 10; - - if (count < 0) - return false; - - QueryResult result; - - uint32 obj_count = 0; - result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM gameobject WHERE id='%u'", go_id); - if (result) - obj_count = (*result)[0].GetUInt64(); - - if (m_session) - { - Player* player = m_session->GetPlayer(); - result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM gameobject WHERE id = '%u' ORDER BY order_ ASC LIMIT %u", - player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), go_id, uint32(count)); - } - else - result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id FROM gameobject WHERE id = '%u' LIMIT %u", - go_id, uint32(count)); - - if (result) - { - do - { - Field* fields = result->Fetch(); - uint32 guid = fields[0].GetUInt32(); - float x = fields[1].GetFloat(); - float y = fields[2].GetFloat(); - float z = fields[3].GetFloat(); - int mapid = fields[4].GetUInt16(); - uint32 entry = fields[5].GetUInt32(); - - if (m_session) - PSendSysMessage(LANG_GO_LIST_CHAT, guid, entry, guid, gInfo->name.c_str(), x, y, z, mapid); - else - PSendSysMessage(LANG_GO_LIST_CONSOLE, guid, gInfo->name.c_str(), x, y, z, mapid); - } while (result->NextRow()); - } - - PSendSysMessage(LANG_COMMAND_LISTOBJMESSAGE, go_id, obj_count); - return true; -} - -bool ChatHandler::HandleListCreatureCommand(const char *args) -{ - if (!*args) - return false; - - // number or [name] Shift-click form |color|Hcreature_entry:creature_id|h[name]|h|r - char* cId = extractKeyFromLink((char*)args, "Hcreature_entry"); - if (!cId) - return false; - - uint32 cr_id = atol(cId); - if (!cr_id) - { - PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, cr_id); - SetSentErrorMessage(true); - return false; - } - - CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(cr_id); - if (!cInfo) - { - PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, cr_id); - SetSentErrorMessage(true); - return false; - } - - char* c_count = strtok(NULL, " "); - int count = c_count ? atol(c_count) : 10; - - if (count < 0) - return false; - - QueryResult result; - - uint32 cr_count = 0; - result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM creature WHERE id='%u'", cr_id); - if (result) - cr_count = (*result)[0].GetUInt64(); - - if (m_session) - { - Player* player = m_session->GetPlayer(); - result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM creature WHERE id = '%u' ORDER BY order_ ASC LIMIT %u", - player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), cr_id, uint32(count)); - } - else - result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map FROM creature WHERE id = '%u' LIMIT %u", - cr_id, uint32(count)); - - if (result) - { - do - { - Field* fields = result->Fetch(); - uint32 guid = fields[0].GetUInt32(); - float x = fields[1].GetFloat(); - float y = fields[2].GetFloat(); - float z = fields[3].GetFloat(); - int mapid = fields[4].GetUInt16(); - - if (m_session) - PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, guid, cInfo->Name.c_str(), x, y, z, mapid); - else - PSendSysMessage(LANG_CREATURE_LIST_CONSOLE, guid, cInfo->Name.c_str(), x, y, z, mapid); - } while (result->NextRow()); - } - - PSendSysMessage(LANG_COMMAND_LISTCREATUREMESSAGE, cr_id, cr_count); - return true; -} - bool ChatHandler::HandleLookupItemCommand(const char *args) { if (!*args) @@ -2349,54 +1990,6 @@ bool ChatHandler::HandleChangeWeather(const char *args) return true; } -bool ChatHandler::HandleListAurasCommand (const char * /*args*/) -{ - Unit* unit = getSelectedUnit(); - if (!unit) - { - SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - SetSentErrorMessage(true); - return false; - } - - char const* talentStr = GetTrinityString(LANG_TALENT); - char const* passiveStr = GetTrinityString(LANG_PASSIVE); - - Unit::AuraApplicationMap const& uAuras = unit->GetAppliedAuras(); - PSendSysMessage(LANG_COMMAND_TARGET_LISTAURAS, uAuras.size()); - for (Unit::AuraApplicationMap::const_iterator itr = uAuras.begin(); itr != uAuras.end(); ++itr) - { - bool talent = GetTalentSpellCost(itr->second->GetBase()->GetId()) > 0; - - AuraApplication const* aurApp = itr->second; - Aura const* aura = aurApp->GetBase(); - char const* name = aura->GetSpellInfo()->SpellName[GetSessionDbcLocale()]; - - std::ostringstream ss_name; - ss_name << "|cffffffff|Hspell:" << aura->GetId() << "|h[" << name << "]|h|r"; - - PSendSysMessage(LANG_COMMAND_TARGET_AURADETAIL, aura->GetId(), (m_session ? ss_name.str().c_str() : name), - aurApp->GetEffectMask(), aura->GetCharges(), aura->GetStackAmount(), aurApp->GetSlot(), - aura->GetDuration(), aura->GetMaxDuration(), (aura->IsPassive() ? passiveStr : ""), - (talent ? talentStr : ""), IS_PLAYER_GUID(aura->GetCasterGUID()) ? "player" : "creature", - GUID_LOPART(aura->GetCasterGUID())); - } - for (uint16 i = 0; i < TOTAL_AURAS; ++i) - { - Unit::AuraEffectList const& uAuraList = unit->GetAuraEffectsByType(AuraType(i)); - if (uAuraList.empty()) - continue; - - PSendSysMessage(LANG_COMMAND_TARGET_LISTAURATYPE, uAuraList.size(), i); - for (Unit::AuraEffectList::const_iterator itr = uAuraList.begin(); itr != uAuraList.end(); ++itr) - { - PSendSysMessage(LANG_COMMAND_TARGET_AURASIMPLE, (*itr)->GetId(), (*itr)->GetEffIndex(), - (*itr)->GetAmount()); - } - } - return true; -} - bool ChatHandler::HandleResetAchievementsCommand (const char * args) { Player* target; diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index 86e1baeb52d..962efd1d79c 100644 --- a/src/server/scripts/Commands/CMakeLists.txt +++ b/src/server/scripts/Commands/CMakeLists.txt @@ -13,6 +13,7 @@ set(scripts_STAT_SRCS Commands/cs_account.cpp Commands/cs_achievement.cpp Commands/cs_cast.cpp + Commands/cs_character.cpp Commands/cs_debug.cpp Commands/cs_event.cpp Commands/cs_gm.cpp @@ -21,6 +22,7 @@ set(scripts_STAT_SRCS Commands/cs_honor.cpp Commands/cs_instance.cpp Commands/cs_learn.cpp + Commands/cs_list.cpp Commands/cs_misc.cpp Commands/cs_modify.cpp Commands/cs_npc.cpp @@ -30,13 +32,10 @@ set(scripts_STAT_SRCS Commands/cs_server.cpp Commands/cs_titles.cpp Commands/cs_wp.cpp - Commands/cs_character.cpp -# Commands/cs_list.cpp # Commands/cs_lookup.cpp # Commands/cs_pdump.cpp # Commands/cs_guild.cpp # Commands/cs_reset.cpp -# Commands/cs_server.cpp # Commands/cs_channel.cpp # Commands/cs_pet.cpp # Commands/cs_ticket.cpp diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp new file mode 100644 index 00000000000..bec5eacdc21 --- /dev/null +++ b/src/server/scripts/Commands/cs_list.cpp @@ -0,0 +1,467 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +Name: list_commandscript +%Complete: 100 +Comment: All list related commands +Category: commandscripts +EndScriptData */ + +#include "ScriptMgr.h" +#include "Chat.h" +#include "SpellAuraEffects.h" + +class list_commandscript : public CommandScript +{ +public: + list_commandscript() : CommandScript("list_commandscript") { } + + ChatCommand* GetCommands() const + { + static ChatCommand listCommandTable[] = + { + { "creature", SEC_ADMINISTRATOR, true, &HandleListCreatureCommand, "", NULL }, + { "item", SEC_ADMINISTRATOR, true, &HandleListItemCommand, "", NULL }, + { "object", SEC_ADMINISTRATOR, true, &HandleListObjectCommand, "", NULL }, + { "auras", SEC_ADMINISTRATOR, false, &HandleListAurasCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + static ChatCommand commandTable[] = + { + { "list", SEC_ADMINISTRATOR, true, NULL, "", listCommandTable }, + { NULL, 0, false, NULL, "", NULL } + }; + return commandTable; + } + + static bool HandleListCreatureCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + // number or [name] Shift-click form |color|Hcreature_entry:creature_id|h[name]|h|r + char* id = handler->extractKeyFromLink((char*)args, "Hcreature_entry"); + if (!id) + return false; + + uint32 creatureId = atol(id); + if (!creatureId) + { + handler->PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, creatureId); + handler->SetSentErrorMessage(true); + return false; + } + + CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(creatureId); + if (!cInfo) + { + handler->PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, creatureId); + handler->SetSentErrorMessage(true); + return false; + } + + char* countStr = strtok(NULL, " "); + uint32 count = countStr ? atol(countStr) : 10; + + if (count < 0) + return false; + + QueryResult result; + + uint32 creatureCount = 0; + result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM creature WHERE id='%u'", creatureId); + if (result) + creatureCount = (*result)[0].GetUInt64(); + + if (handler->GetSession()) + { + Player* player = handler->GetSession()->GetPlayer(); + result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM creature WHERE id = '%u' ORDER BY order_ ASC LIMIT %u", + player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), creatureId, count); + } + else + result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map FROM creature WHERE id = '%u' LIMIT %u", + creatureId, count); + + if (result) + { + do + { + Field* fields = result->Fetch(); + uint32 guid = fields[0].GetUInt32(); + float x = fields[1].GetFloat(); + float y = fields[2].GetFloat(); + float z = fields[3].GetFloat(); + uint16 mapId = fields[4].GetUInt16(); + + if (handler->GetSession()) + handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, guid, cInfo->Name.c_str(), x, y, z, mapId); + else + handler->PSendSysMessage(LANG_CREATURE_LIST_CONSOLE, guid, cInfo->Name.c_str(), x, y, z, mapId); + } + while (result->NextRow()); + } + + handler->PSendSysMessage(LANG_COMMAND_LISTCREATUREMESSAGE, creatureId, creatureCount); + + return true; + } + + static bool HandleListItemCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char* id = handler->extractKeyFromLink((char*)args, "Hitem"); + if (!id) + return false; + + uint32 itemId = atol(id); + if (!itemId) + { + handler->PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId); + handler->SetSentErrorMessage(true); + return false; + } + + ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemId); + if (!itemTemplate) + { + handler->PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId); + handler->SetSentErrorMessage(true); + return false; + } + + char* countStr = strtok(NULL, " "); + uint32 count = countStr ? atol(countStr) : 10; + + if (count < 0) + return false; + + PreparedQueryResult result; + + // inventory case + uint32 inventoryCount = 0; + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM); + stmt->setUInt32(0, itemId); + result = CharacterDatabase.Query(stmt); + + if (result) + inventoryCount = (*result)[0].GetUInt64(); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_INVENTORY_ITEM_BY_ENTRY); + stmt->setUInt32(0, itemId); + stmt->setUInt32(1, count); + result = CharacterDatabase.Query(stmt); + + if (result) + { + do + { + Field* fields = result->Fetch(); + uint32 itemGuid = fields[0].GetUInt32(); + uint32 itemBag = fields[1].GetUInt32(); + uint8 itemSlot = fields[2].GetUInt8(); + uint32 ownerGuid = fields[3].GetUInt32(); + uint32 ownerAccountId = fields[4].GetUInt32(); + std::string ownerName = fields[5].GetString(); + + char const* itemPos = 0; + if (Player::IsEquipmentPos(itemBag, itemSlot)) + itemPos = "[equipped]"; + else if (Player::IsInventoryPos(itemBag, itemSlot)) + itemPos = "[in inventory]"; + else if (Player::IsBankPos(itemBag, itemSlot)) + itemPos = "[in bank]"; + else + itemPos = ""; + + handler->PSendSysMessage(LANG_ITEMLIST_SLOT, itemGuid, ownerName.c_str(), ownerGuid, ownerAccountId, itemPos); + } + while (result->NextRow()); + + uint32 resultCount = uint32(result->GetRowCount()); + + if (count > resultCount) + count -= resultCount; + else if (count) + count = 0; + } + + // mail case + uint32 mailCount; + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_COUNT_ITEM); + stmt->setUInt32(0, itemId); + result = CharacterDatabase.Query(stmt); + + if (result) + mailCount = (*result)[0].GetUInt64(); + + if (count > 0) + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_ITEMS_BY_ENTRY); + stmt->setUInt32(0, itemId); + stmt->setUInt32(1, count); + result = CharacterDatabase.Query(stmt); + } + else + result = PreparedQueryResult(NULL); + + if (result) + { + do + { + Field* fields = result->Fetch(); + uint32 itemGuid = fields[0].GetUInt32(); + uint32 itemSender = fields[1].GetUInt32(); + uint32 itemReceiver = fields[2].GetUInt32(); + uint32 itemSenderAccountId = fields[3].GetUInt32(); + std::string itemSenderName = fields[4].GetString(); + uint32 itemReceiverAccount = fields[5].GetUInt32(); + std::string itemReceiverName = fields[6].GetString(); + + char const* itemPos = "[in mail]"; + + handler->PSendSysMessage(LANG_ITEMLIST_MAIL, itemGuid, itemSenderName.c_str(), itemSender, itemSenderAccountId, itemReceiverName.c_str(), itemReceiver, itemReceiverAccount, itemPos); + } + while (result->NextRow()); + + uint32 resultCount = uint32(result->GetRowCount()); + + if (count > resultCount) + count -= resultCount; + else if (count) + count = 0; + } + + // auction case + uint32 auctionCount = 0; + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONHOUSE_COUNT_ITEM); + stmt->setUInt32(0, itemId); + result = CharacterDatabase.Query(stmt); + + if (result) + auctionCount = (*result)[0].GetUInt64(); + + if (count > 0) + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONHOUSE_ITEM_BY_ENTRY); + stmt->setUInt32(0, itemId); + stmt->setUInt32(1, count); + result = CharacterDatabase.Query(stmt); + } + else + result = PreparedQueryResult(NULL); + + if (result) + { + do + { + Field* fields = result->Fetch(); + uint32 itemGuid = fields[0].GetUInt32(); + uint32 owner = fields[1].GetUInt32(); + uint32 ownerAccountId = fields[2].GetUInt32(); + std::string ownerName = fields[3].GetString(); + + char const* itemPos = "[in auction]"; + + handler->PSendSysMessage(LANG_ITEMLIST_AUCTION, itemGuid, ownerName.c_str(), owner, ownerAccountId, itemPos); + } + while (result->NextRow()); + } + + // guild bank case + uint32 guildCount = 0; + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_BANK_COUNT_ITEM); + stmt->setUInt32(0, itemId); + result = CharacterDatabase.Query(stmt); + + if (result) + guildCount = (*result)[0].GetUInt64(); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY); + stmt->setUInt32(0, itemId); + stmt->setUInt32(1, count); + result = CharacterDatabase.Query(stmt); + + if (result) + { + do + { + Field* fields = result->Fetch(); + uint32 itemGuid = fields[0].GetUInt32(); + uint32 guildGuid = fields[1].GetUInt32(); + std::string guildName = fields[2].GetString(); + + char const* itemPos = "[in guild bank]"; + + handler->PSendSysMessage(LANG_ITEMLIST_GUILD, itemGuid, guildName.c_str(), guildGuid, itemPos); + } + while (result->NextRow()); + + uint32 resultCount = uint32(result->GetRowCount()); + + if (count > resultCount) + count -= resultCount; + else if (count) + count = 0; + } + + if (inventoryCount + mailCount + auctionCount + guildCount == 0) + { + handler->SendSysMessage(LANG_COMMAND_NOITEMFOUND); + handler->SetSentErrorMessage(true); + return false; + } + + handler->PSendSysMessage(LANG_COMMAND_LISTITEMMESSAGE, itemId, inventoryCount + mailCount + auctionCount + guildCount, inventoryCount, mailCount, auctionCount, guildCount); + + return true; + } + + static bool HandleListObjectCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + // number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r + char* id = handler->extractKeyFromLink((char*)args, "Hgameobject_entry"); + if (!id) + return false; + + uint32 gameObjectId = atol(id); + if (!gameObjectId) + { + handler->PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, gameObjectId); + handler->SetSentErrorMessage(true); + return false; + } + + GameObjectTemplate const* gInfo = sObjectMgr->GetGameObjectTemplate(gameObjectId); + if (!gInfo) + { + handler->PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, gameObjectId); + handler->SetSentErrorMessage(true); + return false; + } + + char* countStr = strtok(NULL, " "); + uint32 count = countStr ? atol(countStr) : 10; + + if (count < 0) + return false; + + QueryResult result; + + uint32 objectCount = 0; + result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM gameobject WHERE id='%u'", gameObjectId); + if (result) + objectCount = (*result)[0].GetUInt64(); + + if (handler->GetSession()) + { + Player* player = handler->GetSession()->GetPlayer(); + result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM gameobject WHERE id = '%u' ORDER BY order_ ASC LIMIT %u", + player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), gameObjectId, count); + } + else + result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id FROM gameobject WHERE id = '%u' LIMIT %u", + gameObjectId, count); + + if (result) + { + do + { + Field* fields = result->Fetch(); + uint32 guid = fields[0].GetUInt32(); + float x = fields[1].GetFloat(); + float y = fields[2].GetFloat(); + float z = fields[3].GetFloat(); + uint16 mapId = fields[4].GetUInt16(); + uint32 entry = fields[5].GetUInt32(); + + if (handler->GetSession()) + handler->PSendSysMessage(LANG_GO_LIST_CHAT, guid, entry, guid, gInfo->name.c_str(), x, y, z, mapId); + else + handler->PSendSysMessage(LANG_GO_LIST_CONSOLE, guid, gInfo->name.c_str(), x, y, z, mapId); + } + while (result->NextRow()); + } + + handler->PSendSysMessage(LANG_COMMAND_LISTOBJMESSAGE, gameObjectId, objectCount); + + return true; + } + + static bool HandleListAurasCommand(ChatHandler* handler, char const* /*args*/) + { + Unit* unit = handler->getSelectedUnit(); + if (!unit) + { + handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + + char const* talentStr = handler->GetTrinityString(LANG_TALENT); + char const* passiveStr = handler->GetTrinityString(LANG_PASSIVE); + + Unit::AuraApplicationMap const& auras = unit->GetAppliedAuras(); + handler->PSendSysMessage(LANG_COMMAND_TARGET_LISTAURAS, auras.size()); + for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) + { + bool talent = GetTalentSpellCost(itr->second->GetBase()->GetId()) > 0; + + AuraApplication const* aurApp = itr->second; + Aura const* aura = aurApp->GetBase(); + char const* name = aura->GetSpellInfo()->SpellName[handler->GetSessionDbcLocale()]; + + std::ostringstream ss_name; + ss_name << "|cffffffff|Hspell:" << aura->GetId() << "|h[" << name << "]|h|r"; + + handler->PSendSysMessage(LANG_COMMAND_TARGET_AURADETAIL, aura->GetId(), (handler->GetSession() ? ss_name.str().c_str() : name), + aurApp->GetEffectMask(), aura->GetCharges(), aura->GetStackAmount(), aurApp->GetSlot(), + aura->GetDuration(), aura->GetMaxDuration(), (aura->IsPassive() ? passiveStr : ""), + (talent ? talentStr : ""), IS_PLAYER_GUID(aura->GetCasterGUID()) ? "player" : "creature", + GUID_LOPART(aura->GetCasterGUID())); + } + + for (uint16 i = 0; i < TOTAL_AURAS; ++i) + { + Unit::AuraEffectList const& auraList = unit->GetAuraEffectsByType(AuraType(i)); + if (auraList.empty()) + continue; + + handler->PSendSysMessage(LANG_COMMAND_TARGET_LISTAURATYPE, auraList.size(), i); + + for (Unit::AuraEffectList::const_iterator itr = auraList.begin(); itr != auraList.end(); ++itr) + handler->PSendSysMessage(LANG_COMMAND_TARGET_AURASIMPLE, (*itr)->GetId(), (*itr)->GetEffIndex(), (*itr)->GetAmount()); + } + + return true; + } +}; + +void AddSC_list_commandscript() +{ + new list_commandscript(); +} From 3368e888a182969e2a6a5bf56ee35b8971714628 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Thu, 21 Jun 2012 18:21:34 +0200 Subject: [PATCH 1083/1149] Core/Commands: Fix some codestyle for a312cd4ba1f47d3dceb774091ec143c90a298cda --- src/server/scripts/Commands/cs_character.cpp | 150 ++++---- src/server/scripts/Commands/cs_server.cpp | 342 ++++++++++--------- 2 files changed, 252 insertions(+), 240 deletions(-) diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index 1784d73cbab..a40b586f8c8 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -48,7 +48,7 @@ public: { "customize", SEC_GAMEMASTER, true, &HandleCharacterCustomizeCommand, "", NULL }, { "changefaction", SEC_GAMEMASTER, true, &HandleCharacterChangeFactionCommand, "", NULL }, { "changerace", SEC_GAMEMASTER, true, &HandleCharacterChangeRaceCommand, "", NULL }, - { "deleted", SEC_GAMEMASTER, true, NULL, "", characterDeletedCommandTable}, + { "deleted", SEC_GAMEMASTER, true, NULL, "", characterDeletedCommandTable}, { "erase", SEC_CONSOLE, true, &HandleCharacterEraseCommand, "", NULL }, { "level", SEC_ADMINISTRATOR, true, &HandleCharacterLevelCommand, "", NULL }, { "rename", SEC_GAMEMASTER, true, &HandleCharacterRenameCommand, "", NULL }, @@ -59,17 +59,16 @@ public: static ChatCommand commandTable[] = { - { "character", SEC_GAMEMASTER, true, NULL, "", characterCommandTable}, - { NULL, 0, false, NULL, "", NULL } - }; - + { "character", SEC_GAMEMASTER, true, NULL, "", characterCommandTable}, + { NULL, 0, false, NULL, "", NULL } + }; return commandTable; } // Stores informations about a deleted character struct DeletedInfo { - uint32 lowguid; ///< the low GUID from the character + uint32 lowGuid; ///< the low GUID from the character std::string name; ///< the character name uint32 accountId; ///< the account id std::string accountName; ///< the account name @@ -95,9 +94,7 @@ public: if (isNumeric(searchString.c_str())) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_GUID); - stmt->setUInt32(0, uint32(atoi(searchString.c_str()))); - result = CharacterDatabase.Query(stmt); } // search by name @@ -105,42 +102,38 @@ public: { if (!normalizePlayerName(searchString)) return false; - - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_NAME); - - stmt->setString(0, searchString); - + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_NAME); + stmt->setString(0, searchString); result = CharacterDatabase.Query(stmt); } } else { - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO); - + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO); result = CharacterDatabase.Query(stmt); } - + if (result) { do { Field* fields = result->Fetch(); - + DeletedInfo info; - - info.lowguid = fields[0].GetUInt32(); + + info.lowGuid = fields[0].GetUInt32(); info.name = fields[1].GetString(); info.accountId = fields[2].GetUInt32(); - + // account name will be empty for not existed account AccountMgr::GetName(info.accountId, info.accountName); - - info.deleteDate = time_t(fields[3].GetUInt32()); - + info.deleteDate = time_t(fields[3].GetUInt32()); foundList.push_back(info); - } while (result->NextRow()); + } + while (result->NextRow()); } - + return true; } @@ -162,21 +155,21 @@ public: handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_HEADER); handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR); } - + for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr) { std::string dateStr = TimeToTimestampStr(itr->deleteDate); - + if (!handler->GetSession()) handler->PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CONSOLE, - itr->lowguid, itr->name.c_str(), itr->accountName.empty() ? "" : itr->accountName.c_str(), + itr->lowGuid, itr->name.c_str(), itr->accountName.empty() ? "" : itr->accountName.c_str(), itr->accountId, dateStr.c_str()); else handler->PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CHAT, - itr->lowguid, itr->name.c_str(), itr->accountName.empty() ? "" : itr->accountName.c_str(), + itr->lowGuid, itr->name.c_str(), itr->accountName.empty() ? "" : itr->accountName.c_str(), itr->accountId, dateStr.c_str()); } - + if (!handler->GetSession()) handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR); } @@ -195,36 +188,34 @@ public: { if (delInfo.accountName.empty()) // account not exist { - handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_ACCOUNT, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId); + handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_ACCOUNT, delInfo.name.c_str(), delInfo.lowGuid, delInfo.accountId); return; } - + // check character count uint32 charcount = AccountMgr::GetCharactersCount(delInfo.accountId); if (charcount >= 10) { - handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_FULL, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId); + handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_FULL, delInfo.name.c_str(), delInfo.lowGuid, delInfo.accountId); return; } - + if (sObjectMgr->GetPlayerGUIDByName(delInfo.name)) { - handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId); + handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name.c_str(), delInfo.lowGuid, delInfo.accountId); return; } - + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_RESTORE_DELETE_INFO); - stmt->setString(0, delInfo.name); stmt->setUInt32(1, delInfo.accountId); - stmt->setUInt32(2, delInfo.lowguid); - + stmt->setUInt32(2, delInfo.lowGuid); CharacterDatabase.Execute(stmt); - + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME_DATA); - stmt->setUInt32(0, delInfo.lowguid); + stmt->setUInt32(0, delInfo.lowGuid); if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) - sWorld->AddCharacterNameData(delInfo.lowguid, delInfo.name, (*result)[2].GetUInt8(), (*result)[0].GetUInt8(), (*result)[1].GetUInt8()); + sWorld->AddCharacterNameData(delInfo.lowGuid, delInfo.name, (*result)[2].GetUInt8(), (*result)[0].GetUInt8(), (*result)[1].GetUInt8()); } static bool HandleCharacterTitlesCommand(ChatHandler* handler, char const* args) @@ -265,6 +256,7 @@ public: handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr); } } + return true; } @@ -294,11 +286,13 @@ public: std::string oldNameLink = handler->playerLink(targetName); handler->PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); stmt->setUInt16(0, uint16(AT_LOGIN_RENAME)); stmt->setUInt32(1, GUID_LOPART(targetGuid)); CharacterDatabase.Execute(stmt); } + return true; } @@ -318,12 +312,12 @@ public: } Player* target; - uint64 target_guid; - std::string target_name; - if (!handler->extractPlayerTarget(nameStr, &target, &target_guid, &target_name)) - return false; + uint64 targetGuid; + std::string targetName; + if (!handler->extractPlayerTarget(nameStr, &target, &targetGuid, &targetName)) + return false; - int32 oldlevel = target ? target->getLevel() : Player::GetLevelFromDB(target_guid); + int32 oldlevel = target ? target->getLevel() : Player::GetLevelFromDB(targetGuid); int32 newlevel = levelStr ? atoi(levelStr) : oldlevel; if (newlevel < 1) @@ -332,10 +326,10 @@ public: if (newlevel > STRONG_MAX_LEVEL) // hardcoded maximum level newlevel = STRONG_MAX_LEVEL; - handler->HandleCharacterLevel(target, target_guid, oldlevel, newlevel); + handler->HandleCharacterLevel(target, targetGuid, oldlevel, newlevel); if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target) // including player == NULL { - std::string nameLink = handler->playerLink(target_name); + std::string nameLink = handler->playerLink(targetName); handler->PSendSysMessage(LANG_YOU_CHANGE_LVL, nameLink.c_str(), newlevel); } @@ -438,7 +432,7 @@ public: FactionStateList const& targetFSL = target->GetReputationMgr().GetStateList(); for (FactionStateList::const_iterator itr = targetFSL.begin(); itr != targetFSL.end(); ++itr) { - const FactionState& faction = itr->second; + FactionState const& faction = itr->second; FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID); char const* factionName = factionEntry ? factionEntry->name[loc] : "#Not found#"; ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry); @@ -463,9 +457,10 @@ public: ss << handler->GetTrinityString(LANG_FACTION_INVISIBLE_FORCED); if (faction.Flags & FACTION_FLAG_INACTIVE) ss << handler->GetTrinityString(LANG_FACTION_INACTIVE); - + handler->SendSysMessage(ss.str().c_str()); } + return true; } @@ -493,6 +488,7 @@ public: } HandleCharacterDeletedListHelper(foundList, handler); + return true; } @@ -593,7 +589,7 @@ public: // Call the appropriate function to delete them (current account for deleted characters is 0) for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr) - Player::DeleteFromDB(itr->lowguid, 0, false, true); + Player::DeleteFromDB(itr->lowGuid, 0, false, true); return true; } @@ -609,17 +605,17 @@ public: * * @param args the search string which either contains a player GUID or a part fo the character-name */ - static bool HandleCharacterDeletedOldCommand(ChatHandler* handler, char const* args) + static bool HandleCharacterDeletedOldCommand(ChatHandler* /*handler*/, char const* args) { int32 keepDays = sWorld->getIntConfig(CONFIG_CHARDELETE_KEEP_DAYS); - char* px = strtok((char*)args, " "); - if (px) + char* daysStr = strtok((char*)args, " "); + if (daysStr) { - if (!isNumeric(px)) + if (!isNumeric(daysStr)) return false; - keepDays = atoi(px); + keepDays = atoi(daysStr); if (keepDays < 0) return false; } @@ -627,7 +623,8 @@ public: else if (keepDays <= 0) return false; - Player::DeleteOldCharacters((uint32)keepDays); + Player::DeleteOldCharacters(uint32(keepDays)); + return true; } @@ -636,41 +633,42 @@ public: if (!*args) return false; - char *character_name_str = strtok((char*)args, " "); - if (!character_name_str) + char* characterName_str = strtok((char*)args, " "); + if (!characterName_str) return false; - std::string character_name = character_name_str; - if (!normalizePlayerName(character_name)) + std::string characterName = characterName_str; + if (!normalizePlayerName(characterName)) return false; - uint64 character_guid; - uint32 account_id; + uint64 characterGuid; + uint32 accountId; - Player* player = sObjectAccessor->FindPlayerByName(character_name.c_str()); + Player* player = sObjectAccessor->FindPlayerByName(characterName.c_str()); if (player) { - character_guid = player->GetGUID(); - account_id = player->GetSession()->GetAccountId(); + characterGuid = player->GetGUID(); + accountId = player->GetSession()->GetAccountId(); player->GetSession()->KickPlayer(); } else { - character_guid = sObjectMgr->GetPlayerGUIDByName(character_name); - if (!character_guid) + characterGuid = sObjectMgr->GetPlayerGUIDByName(characterName); + if (!characterGuid) { - handler->PSendSysMessage(LANG_NO_PLAYER, character_name.c_str()); + handler->PSendSysMessage(LANG_NO_PLAYER, characterName.c_str()); handler->SetSentErrorMessage(true); return false; } - account_id = sObjectMgr->GetPlayerAccountIdByGUID(character_guid); + accountId = sObjectMgr->GetPlayerAccountIdByGUID(characterGuid); } - std::string account_name; - AccountMgr::GetName (account_id, account_name); + std::string accountName; + AccountMgr::GetName(accountId, accountName); + + Player::DeleteFromDB(characterGuid, accountId, true, true); + handler->PSendSysMessage(LANG_CHARACTER_DELETED, characterName.c_str(), GUID_LOPART(characterGuid), accountName.c_str(), accountId); - Player::DeleteFromDB(character_guid, account_id, true, true); - handler->PSendSysMessage(LANG_CHARACTER_DELETED, character_name.c_str(), GUID_LOPART(character_guid), account_name.c_str(), account_id); return true; } }; @@ -678,4 +676,4 @@ public: void AddSC_character_commandscript() { new character_commandscript(); -} \ No newline at end of file +} diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index 2e5b929d460..8f10af5fe2a 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -37,83 +37,83 @@ public: { static ChatCommand serverIdleRestartCommandTable[] = { - { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, - { "" , SEC_ADMINISTRATOR, true, &HandleServerIdleRestartCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, + { "" , SEC_ADMINISTRATOR, true, &HandleServerIdleRestartCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand serverIdleShutdownCommandTable[] = { - { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, - { "" , SEC_ADMINISTRATOR, true, &HandleServerIdleShutDownCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, + { "" , SEC_ADMINISTRATOR, true, &HandleServerIdleShutDownCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand serverRestartCommandTable[] = { - { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, - { "" , SEC_ADMINISTRATOR, true, &HandleServerRestartCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, + { "" , SEC_ADMINISTRATOR, true, &HandleServerRestartCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand serverShutdownCommandTable[] = - { - { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, - { "" , SEC_ADMINISTRATOR, true, &HandleServerShutDownCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { + { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, + { "" , SEC_ADMINISTRATOR, true, &HandleServerShutDownCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand serverSetCommandTable[] = { - { "difftime", SEC_CONSOLE, true, &HandleServerSetDiffTimeCommand, "", NULL }, - { "loglevel", SEC_CONSOLE, true, &HandleServerSetLogLevelCommand, "", NULL }, - { "logfilelevel", SEC_CONSOLE, true, &HandleServerSetLogFileLevelCommand, "", NULL }, - { "motd", SEC_ADMINISTRATOR, true, &HandleServerSetMotdCommand, "", NULL }, - { "closed", SEC_ADMINISTRATOR, true, &HandleServerSetClosedCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "difftime", SEC_CONSOLE, true, &HandleServerSetDiffTimeCommand, "", NULL }, + { "loglevel", SEC_CONSOLE, true, &HandleServerSetLogLevelCommand, "", NULL }, + { "logfilelevel", SEC_CONSOLE, true, &HandleServerSetLogFileLevelCommand, "", NULL }, + { "motd", SEC_ADMINISTRATOR, true, &HandleServerSetMotdCommand, "", NULL }, + { "closed", SEC_ADMINISTRATOR, true, &HandleServerSetClosedCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand serverCommandTable[] = { - { "corpses", SEC_GAMEMASTER, true, &HandleServerCorpsesCommand, "", NULL }, - { "exit", SEC_CONSOLE, true, &HandleServerExitCommand, "", NULL }, - { "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable }, - { "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverIdleShutdownCommandTable }, - { "info", SEC_PLAYER, true, &HandleServerInfoCommand, "", NULL }, - { "motd", SEC_PLAYER, true, &HandleServerMotdCommand, "", NULL }, - { "plimit", SEC_ADMINISTRATOR, true, &HandleServerPLimitCommand, "", NULL }, - { "restart", SEC_ADMINISTRATOR, true, NULL, "", serverRestartCommandTable }, - { "shutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable }, - { "set", SEC_ADMINISTRATOR, true, NULL, "", serverSetCommandTable }, - { "togglequerylog", SEC_CONSOLE, true, &HandleServerToggleQueryLogging, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "corpses", SEC_GAMEMASTER, true, &HandleServerCorpsesCommand, "", NULL }, + { "exit", SEC_CONSOLE, true, &HandleServerExitCommand, "", NULL }, + { "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable }, + { "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverIdleShutdownCommandTable }, + { "info", SEC_PLAYER, true, &HandleServerInfoCommand, "", NULL }, + { "motd", SEC_PLAYER, true, &HandleServerMotdCommand, "", NULL }, + { "plimit", SEC_ADMINISTRATOR, true, &HandleServerPLimitCommand, "", NULL }, + { "restart", SEC_ADMINISTRATOR, true, NULL, "", serverRestartCommandTable }, + { "shutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable }, + { "set", SEC_ADMINISTRATOR, true, NULL, "", serverSetCommandTable }, + { "togglequerylog", SEC_CONSOLE, true, &HandleServerToggleQueryLogging, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { - { "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable }, - { NULL, 0, false, NULL, "", NULL } + { "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable }, + { NULL, 0, false, NULL, "", NULL } }; return commandTable; } // Triggering corpses expire check in world - static bool HandleServerCorpsesCommand(ChatHandler* handler, char const* args) + static bool HandleServerCorpsesCommand(ChatHandler* /*handler*/, char const* /*args*/) { sObjectAccessor->RemoveOldCorpses(); return true; } - static bool HandleServerInfoCommand(ChatHandler* handler, char const* args) + static bool HandleServerInfoCommand(ChatHandler* handler, char const* /*args*/) { - uint32 playersNum = sWorld->GetPlayerCount(); - uint32 maxPlayersNum = sWorld->GetMaxPlayerCount(); - uint32 activeClientsNum = sWorld->GetActiveSessionCount(); - uint32 queuedClientsNum = sWorld->GetQueuedSessionCount(); - uint32 maxActiveClientsNum = sWorld->GetMaxActiveSessionCount(); - uint32 maxQueuedClientsNum = sWorld->GetMaxQueuedSessionCount(); - std::string uptime = secsToTimeString(sWorld->GetUptime()); - uint32 updateTime = sWorld->GetUpdateTime(); + uint32 playersNum = sWorld->GetPlayerCount(); + uint32 maxPlayersNum = sWorld->GetMaxPlayerCount(); + uint32 activeClientsNum = sWorld->GetActiveSessionCount(); + uint32 queuedClientsNum = sWorld->GetQueuedSessionCount(); + uint32 maxActiveClientsNum = sWorld->GetMaxActiveSessionCount(); + uint32 maxQueuedClientsNum = sWorld->GetMaxQueuedSessionCount(); + std::string uptime = secsToTimeString(sWorld->GetUptime()); + uint32 updateTime = sWorld->GetUpdateTime(); handler->SendSysMessage(_FULLVERSION); handler->PSendSysMessage(LANG_CONNECTED_PLAYERS, playersNum, maxPlayersNum); @@ -127,7 +127,7 @@ public: return true; } // Display the 'Message of the day' for the realm - static bool HandleServerMotdCommand(ChatHandler* handler, char const* args) + static bool HandleServerMotdCommand(ChatHandler* handler, char const* /*args*/) { handler->PSendSysMessage(LANG_MOTD_CURRENT, sWorld->GetMotd()); return true; @@ -137,199 +137,212 @@ public: { if (*args) { - char* param = strtok((char*)args, " "); - if (!param) + char* paramStr = strtok((char*)args, " "); + if (!paramStr) return false; - int l = strlen(param); + int32 limit = strlen(paramStr); - if (strncmp(param, "player", l) == 0) + if (strncmp(paramStr, "player", limit) == 0) sWorld->SetPlayerSecurityLimit(SEC_PLAYER); - else if (strncmp(param, "moderator", l) == 0) + else if (strncmp(paramStr, "moderator", limit) == 0) sWorld->SetPlayerSecurityLimit(SEC_MODERATOR); - else if (strncmp(param, "gamemaster", l) == 0) + else if (strncmp(paramStr, "gamemaster", limit) == 0) sWorld->SetPlayerSecurityLimit(SEC_GAMEMASTER); - else if (strncmp(param, "administrator", l) == 0) + else if (strncmp(paramStr, "administrator", limit) == 0) sWorld->SetPlayerSecurityLimit(SEC_ADMINISTRATOR); - else if (strncmp(param, "reset", l) == 0) + else if (strncmp(paramStr, "reset", limit) == 0) { sWorld->SetPlayerAmountLimit(ConfigMgr::GetIntDefault("PlayerLimit", 100)); sWorld->LoadDBAllowedSecurityLevel(); } else { - int val = atoi(param); - if (val < 0) - sWorld->SetPlayerSecurityLimit(AccountTypes(uint32(-val))); + int32 value = atoi(paramStr); + if (value < 0) + sWorld->SetPlayerSecurityLimit(AccountTypes(-value)); else - sWorld->SetPlayerAmountLimit(uint32(val)); - } + sWorld->SetPlayerAmountLimit(uint32(value)); + } } - uint32 pLimit = sWorld->GetPlayerAmountLimit(); + uint32 playerAmountLimit = sWorld->GetPlayerAmountLimit(); AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit(); char const* secName = ""; switch (allowedAccountType) { - case SEC_PLAYER: secName = "Player"; break; - case SEC_MODERATOR: secName = "Moderator"; break; - case SEC_GAMEMASTER: secName = "Gamemaster"; break; - case SEC_ADMINISTRATOR: secName = "Administrator"; break; - default: secName = ""; break; + case SEC_PLAYER: + secName = "Player"; + break; + case SEC_MODERATOR: + secName = "Moderator"; + break; + case SEC_GAMEMASTER: + secName = "Gamemaster"; + break; + case SEC_ADMINISTRATOR: + secName = "Administrator"; + break; + default: + secName = ""; + break; } - handler->PSendSysMessage("Player limits: amount %u, min. security level %s.", pLimit, secName); + handler->PSendSysMessage("Player limits: amount %u, min. security level %s.", playerAmountLimit, secName); return true; } - static bool HandleServerShutDownCancelCommand(ChatHandler* handler, char const* args) + static bool HandleServerShutDownCancelCommand(ChatHandler* /*handler*/, char const* /*args*/) { sWorld->ShutdownCancel(); + return true; } - static bool HandleServerShutDownCommand(ChatHandler* handler, char const* args) + static bool HandleServerShutDownCommand(ChatHandler* /*handler*/, char const* args) { if (!*args) - return false; + return false; - char* time_str = strtok ((char*) args, " "); - char* exitcode_str = strtok (NULL, ""); + char* timeStr = strtok((char*) args, " "); + char* exitCodeStr = strtok(NULL, ""); - int32 time = atoi (time_str); + int32 time = atoi(timeStr); // Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) - return false; + if ((time == 0 && (timeStr[0] != '0' || timeStr[1] != '\0')) || time < 0) + return false; - if (exitcode_str) + if (exitCodeStr) { - int32 exitcode = atoi(exitcode_str); + int32 exitCode = atoi(exitCodeStr); - // Handle atoi() errors - if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) - return false; + // Handle atoi() errors + if (exitCode == 0 && (exitCodeStr[0] != '0' || exitCodeStr[1] != '\0')) + return false; - // Exit code should be in range of 0-125, 126-255 is used - // in many shells for their own return codes and code > 255 - // is not supported in many others - if (exitcode < 0 || exitcode > 125) - return false; + // Exit code should be in range of 0-125, 126-255 is used + // in many shells for their own return codes and code > 255 + // is not supported in many others + if (exitCode < 0 || exitCode > 125) + return false; - sWorld->ShutdownServ(time, 0, exitcode); + sWorld->ShutdownServ(time, 0, exitCode); } else - sWorld->ShutdownServ(time, 0, SHUTDOWN_EXIT_CODE); + sWorld->ShutdownServ(time, 0, SHUTDOWN_EXIT_CODE); + return true; } - static bool HandleServerRestartCommand(ChatHandler* handler, char const* args) + static bool HandleServerRestartCommand(ChatHandler* /*handler*/, char const* args) { if (!*args) return false; - char* time_str = strtok ((char*) args, " "); - char* exitcode_str = strtok (NULL, ""); + char* timeStr = strtok((char*) args, " "); + char* exitCodeStr = strtok(NULL, ""); - int32 time = atoi (time_str); + int32 time = atoi(timeStr); // Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) + if ((time == 0 && (timeStr[0] != '0' || timeStr[1] != '\0')) || time < 0) return false; - if (exitcode_str) + if (exitCodeStr) { - int32 exitcode = atoi (exitcode_str); + int32 exitCode = atoi(exitCodeStr); - // Handle atoi() errors - if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) - return false; + // Handle atoi() errors + if (exitCode == 0 && (exitCodeStr[0] != '0' || exitCodeStr[1] != '\0')) + return false; - // Exit code should be in range of 0-125, 126-255 is used - // in many shells for their own return codes and code > 255 - // is not supported in many others - if (exitcode < 0 || exitcode > 125) - return false; + // Exit code should be in range of 0-125, 126-255 is used + // in many shells for their own return codes and code > 255 + // is not supported in many others + if (exitCode < 0 || exitCode > 125) + return false; - sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, exitcode); + sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, exitCode); } else - sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE); + sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE); + return true; } - static bool HandleServerIdleRestartCommand(ChatHandler* handler, char const* args) + static bool HandleServerIdleRestartCommand(ChatHandler* /*handler*/, char const* args) { if (!*args) return false; - char* time_str = strtok ((char*) args, " "); - char* exitcode_str = strtok (NULL, ""); + char* timeStr = strtok((char*) args, " "); + char* exitCodeStr = strtok(NULL, ""); - int32 time = atoi (time_str); + int32 time = atoi(timeStr); // Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) + if ((time == 0 && (timeStr[0] != '0' || timeStr[1] != '\0')) || time < 0) return false; - if (exitcode_str) + if (exitCodeStr) { - int32 exitcode = atoi (exitcode_str); + int32 exitCode = atoi(exitCodeStr); - // Handle atoi() errors - if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) - return false; + // Handle atoi() errors + if (exitCode == 0 && (exitCodeStr[0] != '0' || exitCodeStr[1] != '\0')) + return false; - // Exit code should be in range of 0-125, 126-255 is used - // in many shells for their own return codes and code > 255 - // is not supported in many others - if (exitcode < 0 || exitcode > 125) - return false; + // Exit code should be in range of 0-125, 126-255 is used + // in many shells for their own return codes and code > 255 + // is not supported in many others + if (exitCode < 0 || exitCode > 125) + return false; - sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, exitcode); + sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART | SHUTDOWN_MASK_IDLE, exitCode); } else - sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE); - return true; + sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART | SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE); + return true; } - static bool HandleServerIdleShutDownCommand(ChatHandler* handler, char const* args) + static bool HandleServerIdleShutDownCommand(ChatHandler* /*handler*/, char const* args) { if (!*args) return false; - char* time_str = strtok ((char*) args, " "); - char* exitcode_str = strtok (NULL, ""); + char* timeStr = strtok((char*) args, " "); + char* exitCodeStr = strtok(NULL, ""); - int32 time = atoi (time_str); + int32 time = atoi(timeStr); // Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) + if ((time == 0 && (timeStr[0] != '0' || timeStr[1] != '\0')) || time < 0) return false; - if (exitcode_str) + if (exitCodeStr) { - int32 exitcode = atoi (exitcode_str); + int32 exitCode = atoi(exitCodeStr); - // Handle atoi() errors - if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) - return false; + // Handle atoi() errors + if (exitCode == 0 && (exitCodeStr[0] != '0' || exitCodeStr[1] != '\0')) + return false; - // Exit code should be in range of 0-125, 126-255 is used - // in many shells for their own return codes and code > 255 - // is not supported in many others - if (exitcode < 0 || exitcode > 125) - return false; + // Exit code should be in range of 0-125, 126-255 is used + // in many shells for their own return codes and code > 255 + // is not supported in many others + if (exitCode < 0 || exitCode > 125) + return false; - sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, exitcode); + sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, exitCode); } else - sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE); + sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE); return true; } // Exit the realm - static bool HandleServerExitCommand(ChatHandler* handler, char const* args) + static bool HandleServerExitCommand(ChatHandler* handler, char const* /*args*/) { handler->SendSysMessage(LANG_COMMAND_EXIT); World::StopNow(SHUTDOWN_EXIT_CODE); @@ -349,15 +362,15 @@ public: { if (strncmp(args, "on", 3) == 0) { - handler->SendSysMessage(LANG_WORLD_CLOSED); - sWorld->SetClosed(true); - return true; + handler->SendSysMessage(LANG_WORLD_CLOSED); + sWorld->SetClosed(true); + return true; } else if (strncmp(args, "off", 4) == 0) { - handler->SendSysMessage(LANG_WORLD_OPENED); - sWorld->SetClosed(false); - return true; + handler->SendSysMessage(LANG_WORLD_OPENED); + sWorld->SetClosed(false); + return true; } handler->SendSysMessage(LANG_USE_BOL); @@ -366,61 +379,62 @@ public: } // Set the level of logging - static bool HandleServerSetLogFileLevelCommand(ChatHandler* handler, char const* args) + static bool HandleServerSetLogFileLevelCommand(ChatHandler* /*handler*/, char const* args) { if (!*args) return false; - char *NewLevel = strtok((char*)args, " "); - if (!NewLevel) + char* newLevel = strtok((char*)args, " "); + if (!newLevel) return false; - sLog->SetLogFileLevel(NewLevel); - return true; + sLog->SetLogFileLevel(newLevel); + return true; } // Set the level of logging - static bool HandleServerSetLogLevelCommand(ChatHandler* handler, char const* args) + static bool HandleServerSetLogLevelCommand(ChatHandler* /*handler*/, char const* args) { if (!*args) return false; - char *NewLevel = strtok((char*)args, " "); - if (!NewLevel) + char* newLevel = strtok((char*)args, " "); + if (!newLevel) return false; - sLog->SetLogLevel(NewLevel); - return true; + sLog->SetLogLevel(newLevel); + return true; } // set diff time record interval - static bool HandleServerSetDiffTimeCommand(ChatHandler* handler, char const* args) + static bool HandleServerSetDiffTimeCommand(ChatHandler* /*handler*/, char const* args) { if (!*args) return false; - char *NewTimeStr = strtok((char*)args, " "); - if (!NewTimeStr) + char* newTimeStr = strtok((char*)args, " "); + if (!newTimeStr) return false; - int32 NewTime =atoi(NewTimeStr); - if (NewTime < 0) + int32 newTime = atoi(newTimeStr); + if (newTime < 0) return false; - sWorld->SetRecordDiffInterval(NewTime); - printf( "Record diff every %u ms\n", NewTime); - return true; + sWorld->SetRecordDiffInterval(newTime); + printf("Record diff every %u ms\n", newTime); + + return true; } // toggle sql driver query logging - static bool HandleServerToggleQueryLogging(ChatHandler* handler,const char* args ) + static bool HandleServerToggleQueryLogging(ChatHandler* handler, char const* /*args*/) { sLog->SetSQLDriverQueryLogging(!sLog->GetSQLDriverQueryLogging()); + if (sLog->GetSQLDriverQueryLogging()) handler->PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_ENABLED); else handler->PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_DISABLED); - return true; } }; @@ -428,4 +442,4 @@ public: void AddSC_server_commandscript() { new server_commandscript(); -} \ No newline at end of file +} From 716e2db0e10673401ba7d6579899a8151ae64208 Mon Sep 17 00:00:00 2001 From: Chaplain Date: Thu, 21 Jun 2012 21:05:45 +0300 Subject: [PATCH 1084/1149] Core/Misc: Code-style + some const methods. --- src/server/collision/BoundingIntervalHierarchy.h | 5 +++-- src/server/collision/Maps/TileAssembler.cpp | 2 +- src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp | 1 - src/server/game/DungeonFinding/LFGMgr.cpp | 2 +- src/server/game/Entities/Object/Object.h | 4 ++-- src/server/game/Entities/Player/Player.cpp | 8 ++++---- src/server/game/Entities/Unit/Unit.h | 4 ++-- src/server/game/Globals/ObjectMgr.cpp | 6 +++--- src/server/game/Globals/ObjectMgr.h | 10 +++++----- src/server/game/Maps/Map.cpp | 6 +++--- src/server/game/Maps/Map.h | 8 ++++---- src/server/game/Maps/MapManager.h | 2 +- src/server/game/Server/WorldSession.h | 6 +++--- src/server/game/Server/WorldSocket.cpp | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- src/server/game/Warden/Warden.cpp | 1 - src/server/game/Warden/WardenMac.cpp | 6 +++--- 17 files changed, 37 insertions(+), 38 deletions(-) diff --git a/src/server/collision/BoundingIntervalHierarchy.h b/src/server/collision/BoundingIntervalHierarchy.h index ea70fc3e322..a4bbe21006a 100755 --- a/src/server/collision/BoundingIntervalHierarchy.h +++ b/src/server/collision/BoundingIntervalHierarchy.h @@ -128,7 +128,7 @@ class BIH delete[] dat.primBound; delete[] dat.indices; } - uint32 primCount() { return objects.size(); } + uint32 primCount() const { return objects.size(); } template void intersectRay(const Ray &r, RayCallback& intersectCallback, float &maxDist, bool stopAtFirst=false) const @@ -400,7 +400,8 @@ class BIH void buildHierarchy(std::vector &tempTree, buildData &dat, BuildStats &stats); - void createNode(std::vector &tempTree, int nodeIndex, uint32 left, uint32 right) { + void createNode(std::vector &tempTree, int nodeIndex, uint32 left, uint32 right) const + { // write leaf node tempTree[nodeIndex + 0] = (3 << 30) | left; tempTree[nodeIndex + 1] = right - left + 1; diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp index e7693a70de4..3bfed7d322d 100644 --- a/src/server/collision/Maps/TileAssembler.cpp +++ b/src/server/collision/Maps/TileAssembler.cpp @@ -312,7 +312,7 @@ namespace VMAP // write WorldModel WorldModel model; model.setRootWmoID(raw_model.RootWMOID); - if (raw_model.groupsArray.size()) + if (!raw_model.groupsArray.empty()) { std::vector groupsArray; diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index 13bbbe2c338..987af82e496 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -327,7 +327,6 @@ Player* FollowerAI::GetLeaderForFollower() sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI GetLeader changed and returned new leader."); m_uiLeaderGUID = member->GetGUID(); return member; - break; } } } diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index a5ff89136b8..1b7e5edaa55 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -791,7 +791,7 @@ LfgProposal* LFGMgr::FindNewGroups(LfgGuidList& check, LfgGuidList& all) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::FindNewGroup: (%s) - all(%s)", ConcatenateGuids(check).c_str(), ConcatenateGuids(all).c_str()); LfgProposal* pProposal = NULL; - if (!check.size() || check.size() > MAXGROUPSIZE || !CheckCompatibility(check, pProposal)) + if (check.empty() || check.size() > MAXGROUPSIZE || !CheckCompatibility(check, pProposal)) return NULL; // Try to match with queued groups diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 5a6a5799fee..7a91289a95d 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -500,13 +500,13 @@ struct MovementInfo t_seat = -1; } - uint32 GetMovementFlags() { return flags; } + uint32 GetMovementFlags() const { return flags; } void SetMovementFlags(uint32 flag) { flags = flag; } void AddMovementFlag(uint32 flag) { flags |= flag; } void RemoveMovementFlag(uint32 flag) { flags &= ~flag; } bool HasMovementFlag(uint32 flag) const { return flags & flag; } - uint16 GetExtraMovementFlags() { return flags2; } + uint16 GetExtraMovementFlags() const { return flags2; } void AddExtraMovementFlag(uint16 flag) { flags2 |= flag; } bool HasExtraMovementFlag(uint16 flag) const { return flags2 & flag; } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 42d342cbcf9..6d9e8d6b88c 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -12764,7 +12764,7 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ { ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount); pItem->SetCount(pItem->GetCount() - count + remcount); - if (IsInWorld() & update) + if (IsInWorld() && update) pItem->SendUpdateToPlayer(this); pItem->SetState(ITEM_CHANGED, this); return; @@ -12792,7 +12792,7 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ { ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount); pItem->SetCount(pItem->GetCount() - count + remcount); - if (IsInWorld() & update) + if (IsInWorld() && update) pItem->SendUpdateToPlayer(this); pItem->SetState(ITEM_CHANGED, this); return; @@ -12858,7 +12858,7 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ { ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount); pItem->SetCount(pItem->GetCount() - count + remcount); - if (IsInWorld() & update) + if (IsInWorld() && update) pItem->SendUpdateToPlayer(this); pItem->SetState(ITEM_CHANGED, this); return; @@ -12966,7 +12966,7 @@ void Player::DestroyItemCount(Item* pItem, uint32 &count, bool update) ItemRemovedQuestCheck(pItem->GetEntry(), count); pItem->SetCount(pItem->GetCount() - count); count = 0; - if (IsInWorld() & update) + if (IsInWorld() && update) pItem->SendUpdateToPlayer(this); pItem->SetState(ITEM_CHANGED, this); } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 98088f9ef6a..2855b93b0d7 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -793,8 +793,8 @@ public: m_dispeller(_dispeller), m_dispellerSpellId(_dispellerSpellId), m_chargesRemoved(_chargesRemoved) {} Unit* GetDispeller() { return m_dispeller; } - uint32 GetDispellerSpellId() { return m_dispellerSpellId; } - uint8 GetRemovedCharges() { return m_chargesRemoved; } + uint32 GetDispellerSpellId() const { return m_dispellerSpellId; } + uint8 GetRemovedCharges() const { return m_chargesRemoved; } void SetRemovedCharges(uint8 amount) { m_chargesRemoved = amount; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 65f2ccff476..eedf84ab41c 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4816,11 +4816,11 @@ void ObjectMgr::LoadSpellScriptNames() Field* fields = result->Fetch(); - int32 spellId = fields[0].GetInt32(); + int32 spellId = fields[0].GetInt32(); const char *scriptName = fields[1].GetCString(); bool allRanks = false; - if (spellId <=0) + if (spellId <= 0) { allRanks = true; spellId = -spellId; @@ -6553,7 +6553,7 @@ uint32 ObjectMgr::GetBaseXP(uint8 level) return _baseXPTable[level] ? _baseXPTable[level] : 0; } -uint32 ObjectMgr::GetXPForLevel(uint8 level) +uint32 ObjectMgr::GetXPForLevel(uint8 level) const { if (level < _playerXPperLevel.size()) return _playerXPperLevel[level]; diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 97c2f0234ba..fcc0315055e 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -613,14 +613,14 @@ class ObjectMgr Player* GetPlayerByLowGUID(uint32 lowguid) const; GameObjectTemplate const* GetGameObjectTemplate(uint32 entry); - GameObjectTemplateContainer const* GetGameObjectTemplates() { return &_gameObjectTemplateStore; } + GameObjectTemplateContainer const* GetGameObjectTemplates() const { return &_gameObjectTemplateStore; } int LoadReferenceVendor(int32 vendor, int32 item_id, std::set *skip_vendors); void LoadGameObjectTemplate(); void AddGameobjectInfo(GameObjectTemplate* goinfo); CreatureTemplate const* GetCreatureTemplate(uint32 entry); - CreatureTemplateContainer const* GetCreatureTemplates() { return &_creatureTemplateStore; } + CreatureTemplateContainer const* GetCreatureTemplates() const { return &_creatureTemplateStore; } CreatureModelInfo const* GetCreatureModelInfo(uint32 modelId); CreatureModelInfo const* GetCreatureModelRandomGender(uint32* displayID); static uint32 ChooseDisplayId(uint32 team, const CreatureTemplate* cinfo, const CreatureData* data = NULL); @@ -629,7 +629,7 @@ class ObjectMgr CreatureAddon const* GetCreatureAddon(uint32 lowguid); CreatureAddon const* GetCreatureTemplateAddon(uint32 entry); ItemTemplate const* GetItemTemplate(uint32 entry); - ItemTemplateContainer const* GetItemTemplateStore() { return &_itemTemplateStore; } + ItemTemplateContainer const* GetItemTemplateStore() const { return &_itemTemplateStore; } ItemSetNameEntry const* GetItemSetNameEntry(uint32 itemId) { @@ -912,7 +912,7 @@ class ObjectMgr std::string GeneratePetName(uint32 entry); uint32 GetBaseXP(uint8 level); - uint32 GetXPForLevel(uint8 level); + uint32 GetXPForLevel(uint8 level) const; int32 GetFishingBaseSkillLevel(uint32 entry) const { @@ -1098,7 +1098,7 @@ class ObjectMgr void LoadScriptNames(); ScriptNameContainer &GetScriptNames() { return _scriptNamesStore; } - const char * GetScriptName(uint32 id) { return id < _scriptNamesStore.size() ? _scriptNamesStore[id].c_str() : ""; } + const char * GetScriptName(uint32 id) const { return id < _scriptNamesStore.size() ? _scriptNamesStore[id].c_str() : ""; } uint32 GetScriptId(const char *name); SpellClickInfoMapBounds GetSpellClickInfoMapBounds(uint32 creature_id) const diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 82659e32016..270c4c782b6 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -1230,7 +1230,7 @@ bool GridMap::loadLiquidData(FILE* in, uint32 offset, uint32 /*size*/) return true; } -uint16 GridMap::getArea(float x, float y) +uint16 GridMap::getArea(float x, float y) const { if (!_areaMap) return _gridArea; @@ -1463,7 +1463,7 @@ float GridMap::getHeightFromUint16(float x, float y) const return (float)((a * x) + (b * y) + c)*_gridIntHeightMultiplier + _gridHeight; } -float GridMap::getLiquidLevel(float x, float y) +float GridMap::getLiquidLevel(float x, float y) const { if (!_liquidMap) return _liquidLevel; @@ -1483,7 +1483,7 @@ float GridMap::getLiquidLevel(float x, float y) } // Why does this return LIQUID data? -uint8 GridMap::getTerrainType(float x, float y) +uint8 GridMap::getTerrainType(float x, float y) const { if (!_liquidFlags) return 0; diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 214f50e6d3c..6d526f23a94 100755 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -193,10 +193,10 @@ public: bool loadData(char* filaname); void unloadData(); - uint16 getArea(float x, float y); - inline float getHeight(float x, float y) {return (this->*_gridGetHeight)(x, y);} - float getLiquidLevel(float x, float y); - uint8 getTerrainType(float x, float y); + uint16 getArea(float x, float y) const; + inline float getHeight(float x, float y) const {return (this->*_gridGetHeight)(x, y);} + float getLiquidLevel(float x, float y) const; + uint8 getTerrainType(float x, float y) const; ZLiquidStatus getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData* data = 0); }; diff --git a/src/server/game/Maps/MapManager.h b/src/server/game/Maps/MapManager.h index 106c2189c65..aa07eef2204 100755 --- a/src/server/game/Maps/MapManager.h +++ b/src/server/game/Maps/MapManager.h @@ -143,7 +143,7 @@ class MapManager void RegisterInstanceId(uint32 instanceId); void FreeInstanceId(uint32 instanceId); - uint32 GetNextInstanceId() { return _nextInstanceId; }; + uint32 GetNextInstanceId() const { return _nextInstanceId; }; void SetNextInstanceId(uint32 nextInstanceId) { _nextInstanceId = nextInstanceId; }; MapUpdater * GetMapUpdater() { return &m_updater; } diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 00d5a8b5a86..b8b09531082 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -323,7 +323,7 @@ class WorldSession void LoadTutorialsData(); void SendTutorialsData(); void SaveTutorialsData(SQLTransaction& trans); - uint32 GetTutorialInt(uint8 index) { return m_Tutorials[index]; } + uint32 GetTutorialInt(uint8 index) const { return m_Tutorials[index]; } void SetTutorialInt(uint8 index, uint32 value) { if (m_Tutorials[index] != value) @@ -390,8 +390,8 @@ class WorldSession } // Recruit-A-Friend Handling - uint32 GetRecruiterId() { return recruiterId; } - bool IsARecruiter() { return isRecruiter; } + uint32 GetRecruiterId() const { return recruiterId; } + bool IsARecruiter() const { return isRecruiter; } public: // opcodes handlers diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 74e414a43a9..646e9c13392 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -78,7 +78,7 @@ struct ServerPktHeader return 2+(isLargePacket()?3:2); } - bool isLargePacket() + bool isLargePacket() const { return size > 0x7FFF; } diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index e1285eb2db9..aed415b0a9f 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -3548,7 +3548,7 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8 break; } - if (aura_immunity_list.size() == 0) + if (aura_immunity_list.empty()) { if (miscVal & (1<<10)) aura_immunity_list.push_back(SPELL_AURA_MOD_STUN); diff --git a/src/server/game/Warden/Warden.cpp b/src/server/game/Warden/Warden.cpp index cc1c2ff50c6..8608701e2ee 100644 --- a/src/server/game/Warden/Warden.cpp +++ b/src/server/game/Warden/Warden.cpp @@ -196,7 +196,6 @@ std::string Warden::Penalty(WardenCheck* check /*= NULL*/) sWorld->BanAccount(BAN_ACCOUNT, accountName, duration.str(), banReason.str(),"Server"); return "Ban"; - break; } default: break; diff --git a/src/server/game/Warden/WardenMac.cpp b/src/server/game/Warden/WardenMac.cpp index a60ae765013..319cda304cc 100644 --- a/src/server/game/Warden/WardenMac.cpp +++ b/src/server/game/Warden/WardenMac.cpp @@ -222,7 +222,7 @@ void WardenMac::HandleData(ByteBuffer &buff) // return; //} - bool found = false; + //bool found = false; std::string str = "Test string!"; @@ -238,7 +238,7 @@ void WardenMac::HandleData(ByteBuffer &buff) if (memcmp(sha1Hash, sha1.GetDigest(), 20)) { sLog->outDebug(LOG_FILTER_WARDEN, "Handle data failed: SHA1 hash is wrong!"); - found = true; + //found = true; } MD5_CTX ctx; @@ -253,7 +253,7 @@ void WardenMac::HandleData(ByteBuffer &buff) if (memcmp(ourMD5Hash, theirsMD5Hash, 16)) { sLog->outDebug(LOG_FILTER_WARDEN, "Handle data failed: MD5 hash is wrong!"); - found = true; + //found = true; } _session->KickPlayer(); From 5de44b3632465d563cc5e5cc0cac964f228e4890 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Thu, 21 Jun 2012 19:59:47 +0200 Subject: [PATCH 1085/1149] Core/Commands: Convert reset commands in commandscript --- src/server/game/Chat/Chat.cpp | 13 - src/server/game/Chat/Chat.h | 8 - src/server/game/Chat/Commands/Level3.cpp | 259 ----------------- src/server/game/Scripting/ScriptLoader.cpp | 2 + src/server/scripts/Commands/CMakeLists.txt | 2 +- src/server/scripts/Commands/cs_reset.cpp | 312 +++++++++++++++++++++ 6 files changed, 315 insertions(+), 281 deletions(-) create mode 100644 src/server/scripts/Commands/cs_reset.cpp diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index bbfab474e22..7a146e89505 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -165,18 +165,6 @@ ChatCommand* ChatHandler::getCommandTable() { NULL, 0, false, NULL, "", NULL } }; - static ChatCommand resetCommandTable[] = - { - { "achievements", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetAchievementsCommand>, "", NULL }, - { "honor", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetHonorCommand>, "", NULL }, - { "level", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetLevelCommand>, "", NULL }, - { "spells", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetSpellsCommand>, "", NULL }, - { "stats", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetStatsCommand>, "", NULL }, - { "talents", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetTalentsCommand>, "", NULL }, - { "all", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetAllCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - static ChatCommand sendCommandTable[] = { { "items", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleSendItemsCommand>, "", NULL }, @@ -229,7 +217,6 @@ ChatCommand* ChatHandler::getCommandTable() { "pdump", SEC_ADMINISTRATOR, true, NULL, "", pdumpCommandTable }, { "guild", SEC_ADMINISTRATOR, true, NULL, "", guildCommandTable }, { "group", SEC_ADMINISTRATOR, false, NULL, "", groupCommandTable }, - { "reset", SEC_ADMINISTRATOR, true, NULL, "", resetCommandTable }, { "channel", SEC_ADMINISTRATOR, true, NULL, "", channelCommandTable }, diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index 9fc9b394947..bbe138b923d 100755 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -184,14 +184,6 @@ class ChatHandler bool HandlePDumpLoadCommand(const char *args); bool HandlePDumpWriteCommand(const char *args); - bool HandleResetAchievementsCommand(const char * args); - bool HandleResetAllCommand(const char * args); - bool HandleResetHonorCommand(const char * args); - bool HandleResetLevelCommand(const char * args); - bool HandleResetSpellsCommand(const char* args); - bool HandleResetStatsCommand(const char * args); - bool HandleResetTalentsCommand(const char* args); - bool HandleSendItemsCommand(const char* args); bool HandleSendMailCommand(const char* args); bool HandleSendMessageCommand(const char * args); diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index eed4c11e1a9..e6419bf4e1e 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -1990,265 +1990,6 @@ bool ChatHandler::HandleChangeWeather(const char *args) return true; } -bool ChatHandler::HandleResetAchievementsCommand (const char * args) -{ - Player* target; - uint64 target_guid; - if (!extractPlayerTarget((char*)args, &target, &target_guid)) - return false; - - if (target) - target->GetAchievementMgr().Reset(); - else - AchievementMgr::DeleteFromDB(GUID_LOPART(target_guid)); - - return true; -} - -bool ChatHandler::HandleResetHonorCommand (const char * args) -{ - Player* target; - if (!extractPlayerTarget((char*)args, &target)) - return false; - - target->SetHonorPoints(0); - target->SetUInt32Value(PLAYER_FIELD_KILLS, 0); - target->SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 0); - target->SetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, 0); - target->SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, 0); - target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL); - - return true; -} - -static bool HandleResetStatsOrLevelHelper(Player* player) -{ - ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(player->getClass()); - if (!cEntry) - { - sLog->outError("Class %u not found in DBC (Wrong DBC files?)", player->getClass()); - return false; - } - - uint8 powertype = cEntry->powerType; - - // reset m_form if no aura - if (!player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT)) - player->SetShapeshiftForm(FORM_NONE); - - player->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, DEFAULT_WORLD_OBJECT_SIZE); - player->SetFloatValue(UNIT_FIELD_COMBATREACH, DEFAULT_COMBAT_REACH); - - player->setFactionForRace(player->getRace()); - - player->SetUInt32Value(UNIT_FIELD_BYTES_0, ((player->getRace()) | (player->getClass() << 8) | (player->getGender() << 16) | (powertype << 24))); - - // reset only if player not in some form; - if (player->GetShapeshiftForm() == FORM_NONE) - player->InitDisplayIds(); - - player->SetByteValue(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP); - - player->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); - - //-1 is default value - player->SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, uint32(-1)); - - //player->SetUInt32Value(PLAYER_FIELD_BYTES, 0xEEE00000); - return true; -} - -bool ChatHandler::HandleResetLevelCommand(const char * args) -{ - Player* target; - if (!extractPlayerTarget((char*)args, &target)) - return false; - - if (!HandleResetStatsOrLevelHelper(target)) - return false; - - uint8 oldLevel = target->getLevel(); - - // set starting level - uint32 start_level = target->getClass() != CLASS_DEATH_KNIGHT - ? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL) - : sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL); - - target->_ApplyAllLevelScaleItemMods(false); - target->SetLevel(start_level); - target->InitRunes(); - target->InitStatsForLevel(true); - target->InitTaxiNodesForLevel(); - target->InitGlyphsForLevel(); - target->InitTalentForLevel(); - target->SetUInt32Value(PLAYER_XP, 0); - - target->_ApplyAllLevelScaleItemMods(true); - - // reset level for pet - if (Pet* pet = target->GetPet()) - pet->SynchronizeLevelWithOwner(); - - sScriptMgr->OnPlayerLevelChanged(target, oldLevel); - - return true; -} - -bool ChatHandler::HandleResetStatsCommand(const char * args) -{ - Player* target; - if (!extractPlayerTarget((char*)args, &target)) - return false; - - if (!HandleResetStatsOrLevelHelper(target)) - return false; - - target->InitRunes(); - target->InitStatsForLevel(true); - target->InitTaxiNodesForLevel(); - target->InitGlyphsForLevel(); - target->InitTalentForLevel(); - - return true; -} - -bool ChatHandler::HandleResetSpellsCommand(const char* args) -{ - Player* target; - uint64 targetGuid; - std::string targetName; - if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) - return false; - - if (target) - { - target->resetSpells(/* bool myClassOnly */); - - ChatHandler(target).SendSysMessage(LANG_RESET_SPELLS); - if (!m_session || m_session->GetPlayer() != target) - PSendSysMessage(LANG_RESET_SPELLS_ONLINE, GetNameLink(target).c_str()); - } - else - { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); - - stmt->setUInt16(0, uint16(AT_LOGIN_RESET_SPELLS)); - stmt->setUInt32(1, GUID_LOPART(targetGuid)); - - CharacterDatabase.Execute(stmt); - - PSendSysMessage(LANG_RESET_SPELLS_OFFLINE, targetName.c_str()); - } - - return true; -} - -bool ChatHandler::HandleResetTalentsCommand(const char* args) -{ - Player* target; - uint64 targetGuid; - std::string targetName; - if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) - { - // Try reset talents as Hunter Pet - Creature* creature = getSelectedCreature(); - if (!*args && creature && creature->isPet()) - { - Unit* owner = creature->GetOwner(); - if (owner && owner->GetTypeId() == TYPEID_PLAYER && creature->ToPet()->IsPermanentPetFor(owner->ToPlayer())) - { - creature->ToPet()->resetTalents(); - owner->ToPlayer()->SendTalentsInfoData(true); - - ChatHandler(owner->ToPlayer()).SendSysMessage(LANG_RESET_PET_TALENTS); - if (!m_session || m_session->GetPlayer() != owner->ToPlayer()) - PSendSysMessage(LANG_RESET_PET_TALENTS_ONLINE, GetNameLink(owner->ToPlayer()).c_str()); - } - return true; - } - - SendSysMessage(LANG_NO_CHAR_SELECTED); - SetSentErrorMessage(true); - return false; - } - - if (target) - { - target->resetTalents(true); - target->SendTalentsInfoData(false); - ChatHandler(target).SendSysMessage(LANG_RESET_TALENTS); - if (!m_session || m_session->GetPlayer() != target) - PSendSysMessage(LANG_RESET_TALENTS_ONLINE, GetNameLink(target).c_str()); - - Pet* pet = target->GetPet(); - Pet::resetTalentsForAllPetsOf(target, pet); - if (pet) - target->SendTalentsInfoData(true); - return true; - } - else if (targetGuid) - { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); - - stmt->setUInt16(0, uint16(AT_LOGIN_NONE | AT_LOGIN_RESET_PET_TALENTS)); - stmt->setUInt32(1, GUID_LOPART(targetGuid)); - - CharacterDatabase.Execute(stmt); - - std::string nameLink = playerLink(targetName); - PSendSysMessage(LANG_RESET_TALENTS_OFFLINE, nameLink.c_str()); - return true; - } - - SendSysMessage(LANG_NO_CHAR_SELECTED); - SetSentErrorMessage(true); - return false; -} - -bool ChatHandler::HandleResetAllCommand(const char * args) -{ - if (!*args) - return false; - - std::string casename = args; - - AtLoginFlags atLogin; - - // Command specially created as single command to prevent using short case names - if (casename == "spells") - { - atLogin = AT_LOGIN_RESET_SPELLS; - sWorld->SendWorldText(LANG_RESETALL_SPELLS); - if (!m_session) - SendSysMessage(LANG_RESETALL_SPELLS); - } - else if (casename == "talents") - { - atLogin = AtLoginFlags(AT_LOGIN_RESET_TALENTS | AT_LOGIN_RESET_PET_TALENTS); - sWorld->SendWorldText(LANG_RESETALL_TALENTS); - if (!m_session) - SendSysMessage(LANG_RESETALL_TALENTS); - } - else - { - PSendSysMessage(LANG_RESETALL_UNKNOWN_CASE, args); - SetSentErrorMessage(true); - return false; - } - - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ALL_AT_LOGIN_FLAGS); - - stmt->setUInt16(0, uint16(atLogin)); - - CharacterDatabase.Execute(stmt); - - TRINITY_READ_GUARD(HashMapHolder::LockType, *HashMapHolder::GetLock()); - HashMapHolder::MapType const& plist = sObjectAccessor->GetPlayers(); - for (HashMapHolder::MapType::const_iterator itr = plist.begin(); itr != plist.end(); ++itr) - itr->second->SetAtLoginFlag(atLogin); - - return true; -} bool ChatHandler::HandleBanAccountCommand(const char *args) { diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 94da23110b8..86b990253b0 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -60,6 +60,7 @@ void AddSC_modify_commandscript(); void AddSC_npc_commandscript(); void AddSC_quest_commandscript(); void AddSC_reload_commandscript(); +void AddSC_reset_commandscript(); void AddSC_tele_commandscript(); void AddSC_server_commandscript(); void AddSC_titles_commandscript(); @@ -666,6 +667,7 @@ void AddCommandScripts() AddSC_npc_commandscript(); AddSC_quest_commandscript(); AddSC_reload_commandscript(); + AddSC_reset_commandscript(); AddSC_tele_commandscript(); AddSC_server_commandscript(); AddSC_titles_commandscript(); diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index 962efd1d79c..c27b51a1ca2 100644 --- a/src/server/scripts/Commands/CMakeLists.txt +++ b/src/server/scripts/Commands/CMakeLists.txt @@ -28,6 +28,7 @@ set(scripts_STAT_SRCS Commands/cs_npc.cpp Commands/cs_quest.cpp Commands/cs_reload.cpp + Commands/cs_reset.cpp Commands/cs_tele.cpp Commands/cs_server.cpp Commands/cs_titles.cpp @@ -35,7 +36,6 @@ set(scripts_STAT_SRCS # Commands/cs_lookup.cpp # Commands/cs_pdump.cpp # Commands/cs_guild.cpp -# Commands/cs_reset.cpp # Commands/cs_channel.cpp # Commands/cs_pet.cpp # Commands/cs_ticket.cpp diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp new file mode 100644 index 00000000000..deb8f710b11 --- /dev/null +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -0,0 +1,312 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +Name: reset_commandscript +%Complete: 100 +Comment: All reset related commands +Category: commandscripts +EndScriptData */ + +#include "ScriptMgr.h" +#include "Chat.h" + +class reset_commandscript : public CommandScript +{ +public: + reset_commandscript() : CommandScript("reset_commandscript") { } + + ChatCommand* GetCommands() const + { + static ChatCommand resetCommandTable[] = + { + { "achievements", SEC_ADMINISTRATOR, true, &HandleResetAchievementsCommand, "", NULL }, + { "honor", SEC_ADMINISTRATOR, true, &HandleResetHonorCommand, "", NULL }, + { "level", SEC_ADMINISTRATOR, true, &HandleResetLevelCommand, "", NULL }, + { "spells", SEC_ADMINISTRATOR, true, &HandleResetSpellsCommand, "", NULL }, + { "stats", SEC_ADMINISTRATOR, true, &HandleResetStatsCommand, "", NULL }, + { "talents", SEC_ADMINISTRATOR, true, &HandleResetTalentsCommand, "", NULL }, + { "all", SEC_ADMINISTRATOR, true, &HandleResetAllCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + static ChatCommand commandTable[] = + { + { "reset", SEC_ADMINISTRATOR, true, NULL, "", resetCommandTable }, + { NULL, 0, false, NULL, "", NULL } + }; + return commandTable; + } + + static bool HandleResetAchievementsCommand(ChatHandler* handler, char const* args) + { + Player* target; + uint64 targetGuid; + if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid)) + return false; + + if (target) + target->GetAchievementMgr().Reset(); + else + AchievementMgr::DeleteFromDB(GUID_LOPART(targetGuid)); + + return true; + } + + static bool HandleResetHonorCommand(ChatHandler* handler, char const* args) + { + Player* target; + if (!handler->extractPlayerTarget((char*)args, &target)) + return false; + + target->SetHonorPoints(0); + target->SetUInt32Value(PLAYER_FIELD_KILLS, 0); + target->SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 0); + target->SetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, 0); + target->SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, 0); + target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL); + + return true; + } + + static bool HandleResetStatsOrLevelHelper(Player* player) + { + ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(player->getClass()); + if (!classEntry) + { + sLog->outError("Class %u not found in DBC (Wrong DBC files?)", player->getClass()); + return false; + } + + uint8 powerType = classEntry->powerType; + + // reset m_form if no aura + if (!player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT)) + player->SetShapeshiftForm(FORM_NONE); + + player->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, DEFAULT_WORLD_OBJECT_SIZE); + player->SetFloatValue(UNIT_FIELD_COMBATREACH, DEFAULT_COMBAT_REACH); + + player->setFactionForRace(player->getRace()); + + player->SetUInt32Value(UNIT_FIELD_BYTES_0, ((player->getRace()) | (player->getClass() << 8) | (player->getGender() << 16) | (powerType << 24))); + + // reset only if player not in some form; + if (player->GetShapeshiftForm() == FORM_NONE) + player->InitDisplayIds(); + + player->SetByteValue(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP); + + player->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + + //-1 is default value + player->SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, uint32(-1)); + + //player->SetUInt32Value(PLAYER_FIELD_BYTES, 0xEEE00000); + return true; + } + + static bool HandleResetLevelCommand(ChatHandler* handler, char const* args) + { + Player* target; + if (!handler->extractPlayerTarget((char*)args, &target)) + return false; + + if (!HandleResetStatsOrLevelHelper(target)) + return false; + + uint8 oldLevel = target->getLevel(); + + // set starting level + uint32 startLevel = target->getClass() != CLASS_DEATH_KNIGHT + ? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL) + : sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL); + + target->_ApplyAllLevelScaleItemMods(false); + target->SetLevel(startLevel); + target->InitRunes(); + target->InitStatsForLevel(true); + target->InitTaxiNodesForLevel(); + target->InitGlyphsForLevel(); + target->InitTalentForLevel(); + target->SetUInt32Value(PLAYER_XP, 0); + + target->_ApplyAllLevelScaleItemMods(true); + + // reset level for pet + if (Pet* pet = target->GetPet()) + pet->SynchronizeLevelWithOwner(); + + sScriptMgr->OnPlayerLevelChanged(target, oldLevel); + + return true; + } + + static bool HandleResetSpellsCommand(ChatHandler* handler, char const* args) + { + Player* target; + uint64 targetGuid; + std::string targetName; + if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) + return false; + + if (target) + { + target->resetSpells(/* bool myClassOnly */); + + ChatHandler(target).SendSysMessage(LANG_RESET_SPELLS); + if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target) + handler->PSendSysMessage(LANG_RESET_SPELLS_ONLINE, handler->GetNameLink(target).c_str()); + } + else + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); + stmt->setUInt16(0, uint16(AT_LOGIN_RESET_SPELLS)); + stmt->setUInt32(1, GUID_LOPART(targetGuid)); + CharacterDatabase.Execute(stmt); + + handler->PSendSysMessage(LANG_RESET_SPELLS_OFFLINE, targetName.c_str()); + } + + return true; + } + + static bool HandleResetStatsCommand(ChatHandler* handler, char const* args) + { + Player* target; + if (!handler->extractPlayerTarget((char*)args, &target)) + return false; + + if (!HandleResetStatsOrLevelHelper(target)) + return false; + + target->InitRunes(); + target->InitStatsForLevel(true); + target->InitTaxiNodesForLevel(); + target->InitGlyphsForLevel(); + target->InitTalentForLevel(); + + return true; + } + + static bool HandleResetTalentsCommand(ChatHandler* handler, char const* args) + { + Player* target; + uint64 targetGuid; + std::string targetName; + if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) + { + // Try reset talents as Hunter Pet + Creature* creature = handler->getSelectedCreature(); + if (!*args && creature && creature->isPet()) + { + Unit* owner = creature->GetOwner(); + if (owner && owner->GetTypeId() == TYPEID_PLAYER && creature->ToPet()->IsPermanentPetFor(owner->ToPlayer())) + { + creature->ToPet()->resetTalents(); + owner->ToPlayer()->SendTalentsInfoData(true); + + ChatHandler(owner->ToPlayer()).SendSysMessage(LANG_RESET_PET_TALENTS); + if (!handler->GetSession() || handler->GetSession()->GetPlayer() != owner->ToPlayer()) + handler->PSendSysMessage(LANG_RESET_PET_TALENTS_ONLINE, handler->GetNameLink(owner->ToPlayer()).c_str()); + } + return true; + } + + handler->SendSysMessage(LANG_NO_CHAR_SELECTED); + handler->SetSentErrorMessage(true); + return false; + } + + if (target) + { + target->resetTalents(true); + target->SendTalentsInfoData(false); + ChatHandler(target).SendSysMessage(LANG_RESET_TALENTS); + if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target) + handler->PSendSysMessage(LANG_RESET_TALENTS_ONLINE, handler->GetNameLink(target).c_str()); + + Pet* pet = target->GetPet(); + Pet::resetTalentsForAllPetsOf(target, pet); + if (pet) + target->SendTalentsInfoData(true); + return true; + } + else if (targetGuid) + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); + stmt->setUInt16(0, uint16(AT_LOGIN_NONE | AT_LOGIN_RESET_PET_TALENTS)); + stmt->setUInt32(1, GUID_LOPART(targetGuid)); + CharacterDatabase.Execute(stmt); + + std::string nameLink = handler->playerLink(targetName); + handler->PSendSysMessage(LANG_RESET_TALENTS_OFFLINE, nameLink.c_str()); + return true; + } + + handler->SendSysMessage(LANG_NO_CHAR_SELECTED); + handler->SetSentErrorMessage(true); + return false; + } + + static bool HandleResetAllCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + std::string caseName = args; + + AtLoginFlags atLogin; + + // Command specially created as single command to prevent using short case names + if (caseName == "spells") + { + atLogin = AT_LOGIN_RESET_SPELLS; + sWorld->SendWorldText(LANG_RESETALL_SPELLS); + if (!handler->GetSession()) + handler->SendSysMessage(LANG_RESETALL_SPELLS); + } + else if (caseName == "talents") + { + atLogin = AtLoginFlags(AT_LOGIN_RESET_TALENTS | AT_LOGIN_RESET_PET_TALENTS); + sWorld->SendWorldText(LANG_RESETALL_TALENTS); + if (!handler->GetSession()) + handler->SendSysMessage(LANG_RESETALL_TALENTS); + } + else + { + handler->PSendSysMessage(LANG_RESETALL_UNKNOWN_CASE, args); + handler->SetSentErrorMessage(true); + return false; + } + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ALL_AT_LOGIN_FLAGS); + stmt->setUInt16(0, uint16(atLogin)); + CharacterDatabase.Execute(stmt); + + TRINITY_READ_GUARD(HashMapHolder::LockType, *HashMapHolder::GetLock()); + HashMapHolder::MapType const& plist = sObjectAccessor->GetPlayers(); + for (HashMapHolder::MapType::const_iterator itr = plist.begin(); itr != plist.end(); ++itr) + itr->second->SetAtLoginFlag(atLogin); + + return true; + } +}; + +void AddSC_reset_commandscript() +{ + new reset_commandscript(); +} From df7bbf203429235297b5c683908fc63a06bf7b24 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Thu, 21 Jun 2012 23:44:02 +0200 Subject: [PATCH 1086/1149] Core/Commands: Add missing scriptLoader for d3bf4626d05883ed856785e19f70f29340157ad2 --- src/server/game/Scripting/ScriptLoader.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 94da23110b8..2a625767025 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -55,6 +55,7 @@ void AddSC_gobject_commandscript(); void AddSC_honor_commandscript(); void AddSC_instance_commandscript(); void AddSC_learn_commandscript(); +void AddSC_list_commandscript(); void AddSC_misc_commandscript(); void AddSC_modify_commandscript(); void AddSC_npc_commandscript(); @@ -661,6 +662,7 @@ void AddCommandScripts() AddSC_honor_commandscript(); AddSC_instance_commandscript(); AddSC_learn_commandscript(); + AddSC_list_commandscript(); AddSC_misc_commandscript(); AddSC_modify_commandscript(); AddSC_npc_commandscript(); From 69285b1a4d176fa4d39622212d61c79a33eb2d34 Mon Sep 17 00:00:00 2001 From: Abdollah Hasan Date: Fri, 22 Jun 2012 15:19:47 +0300 Subject: [PATCH 1087/1149] Core/Player: Modify GetItemByEntry to include Currency. --- src/server/game/Entities/Player/Player.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 42d342cbcf9..b1355ad2338 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -12933,6 +12933,11 @@ Item* Player::GetItemByEntry(uint32 entry) const if (pItem->GetEntry() == entry) return pItem; + for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->GetEntry() == entry) + return pItem; + for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); ++j) From b859deed80462f733323e551cabafd53701e6d9c Mon Sep 17 00:00:00 2001 From: Abdollah Hasan Date: Fri, 22 Jun 2012 16:06:02 +0300 Subject: [PATCH 1088/1149] Core/Item: Add IsCurrencyToken to override use of default ugly method. --- src/server/game/Entities/Item/Item.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index 1d5fcae7d28..34754cfe570 100755 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -240,6 +240,7 @@ class Item : public Object bool IsLocked() const { return !HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_UNLOCKED); } bool IsBag() const { return GetTemplate()->InventoryType == INVTYPE_BAG; } + bool IsCurrencyToken() const { return GetTemplate()->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS; } bool IsNotEmptyBag() const; bool IsBroken() const { return GetUInt32Value(ITEM_FIELD_MAXDURABILITY) > 0 && GetUInt32Value(ITEM_FIELD_DURABILITY) == 0; } bool CanBeTraded(bool mail = false, bool trade = false) const; From 24a395c82d038057e5b388ac4bc8209f7cad5134 Mon Sep 17 00:00:00 2001 From: Abdollah Hasan Date: Fri, 22 Jun 2012 16:34:06 +0300 Subject: [PATCH 1089/1149] Core/Item: Modify IsCurrencyToken to use IsCurrencyToken in item template. Changed all BAG_FAMILY_MASK_CURRENCY_TOKENS to IsCurrencyToken. --- src/server/game/Entities/Item/Item.h | 2 +- src/server/game/Entities/Item/ItemPrototype.h | 2 ++ src/server/game/Entities/Player/Player.cpp | 8 ++++---- src/server/game/Loot/LootMgr.cpp | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index 34754cfe570..a5f9ed5c008 100755 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -240,7 +240,7 @@ class Item : public Object bool IsLocked() const { return !HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_UNLOCKED); } bool IsBag() const { return GetTemplate()->InventoryType == INVTYPE_BAG; } - bool IsCurrencyToken() const { return GetTemplate()->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS; } + bool IsCurrencyToken() const { return GetTemplate()->IsCurrencyToken(); } bool IsNotEmptyBag() const; bool IsBroken() const { return GetUInt32Value(ITEM_FIELD_MAXDURABILITY) > 0 && GetUInt32Value(ITEM_FIELD_DURABILITY) == 0; } bool CanBeTraded(bool mail = false, bool trade = false) const; diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index 1b5eec7fbaf..5dbf1cad5bb 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -681,6 +681,8 @@ struct ItemTemplate return false; } + bool IsCurrencyToken() const { return BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS; } + uint32 GetMaxStackSize() const { return (Stackable == 2147483647 || Stackable <= 0) ? uint32(0x7FFFFFFF-1) : uint32(Stackable); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b1355ad2338..7a2c5c3c352 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -10678,7 +10678,7 @@ InventoryResult Player::CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemP return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; // currencytoken case - if (slot >= CURRENCYTOKEN_SLOT_START && slot < CURRENCYTOKEN_SLOT_END && !(pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS)) + if (slot >= CURRENCYTOKEN_SLOT_START && slot < CURRENCYTOKEN_SLOT_END && !(pProto->IsCurrencyToken())) return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; // prevent cheating @@ -11031,7 +11031,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; } } - else if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS) + else if (pProto->IsCurrencyToken()) { res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) @@ -11198,7 +11198,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; } } - else if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS) + else if (pProto->IsCurrencyToken()) { res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) @@ -11447,7 +11447,7 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const if (b_found) continue; - if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS) + if (pProto->IsCurrencyToken()) { for (uint32 t = CURRENCYTOKEN_SLOT_START; t < CURRENCYTOKEN_SLOT_END; ++t) { diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 53b560e0b77..b4433906674 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -479,7 +479,7 @@ void Loot::FillNotNormalLootFor(Player* player, bool presentAtLooting) if (!item->is_looted && item->freeforall && item->AllowedForPlayer(player)) if (ItemTemplate const* proto = sObjectMgr->GetItemTemplate(item->itemid)) - if (proto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS) + if (proto->IsCurrencyToken()) player->StoreLootItem(i, this); } } From f63328dcbe5d3490c8b0235cf0c92bc1628d1aea Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 22 Jun 2012 12:23:53 -0400 Subject: [PATCH 1090/1149] Core/LFG: commented out a previous change that was causing issues with lfg dungeon locks. --- src/server/game/DungeonFinding/LFGMgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 1b7e5edaa55..91f9104b0b1 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -433,8 +433,8 @@ void LFGMgr::InitializeLockedDungeons(Player* player) locktype = LFG_LOCKSTATUS_RAID_LOCKED; else if (dungeon->difficulty > DUNGEON_DIFFICULTY_NORMAL && player->GetBoundInstance(dungeon->map, Difficulty(dungeon->difficulty))) { - if (!player->GetGroup() || !player->GetGroup()->isLFGGroup() || GetDungeon(player->GetGroup()->GetGUID(), true) != dungeon->ID || GetState(player->GetGroup()->GetGUID()) != LFG_STATE_DUNGEON) - locktype = LFG_LOCKSTATUS_RAID_LOCKED; + //if (!player->GetGroup() || !player->GetGroup()->isLFGGroup() || GetDungeon(player->GetGroup()->GetGUID(), true) != dungeon->ID || GetState(player->GetGroup()->GetGUID()) != LFG_STATE_DUNGEON) + locktype = LFG_LOCKSTATUS_RAID_LOCKED; } else if (dungeon->minlevel > level) locktype = LFG_LOCKSTATUS_TOO_LOW_LEVEL; From e50fa50736034404635c5392413770529c5ad570 Mon Sep 17 00:00:00 2001 From: kandera Date: Fri, 22 Jun 2012 15:54:11 -0300 Subject: [PATCH 1091/1149] fix build --- src/server/scripts/Commands/cs_list.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index bec5eacdc21..49af62ac497 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -25,6 +25,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "Chat.h" #include "SpellAuraEffects.h" +#include "ObjectAccessor.h" class list_commandscript : public CommandScript { From 9bf7ee3ee94c7951593ca35f973c74c0af43f517 Mon Sep 17 00:00:00 2001 From: kandera Date: Fri, 22 Jun 2012 16:31:35 -0300 Subject: [PATCH 1092/1149] fix build #2 --- src/server/scripts/Commands/cs_list.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index 49af62ac497..7acbc42e20e 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -26,6 +26,7 @@ EndScriptData */ #include "Chat.h" #include "SpellAuraEffects.h" #include "ObjectAccessor.h" +#include "ObjectMgr.h" class list_commandscript : public CommandScript { From 96286790e7263d4f611c58b2bcf8da67ce18a9c5 Mon Sep 17 00:00:00 2001 From: horn Date: Sat, 23 Jun 2012 01:22:09 +0200 Subject: [PATCH 1093/1149] Core/Mails: Allow GMs to send emails without money --- src/server/game/Handlers/MailHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index c30cbaa622e..4fb0ab2e9c1 100755 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -107,7 +107,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) uint32 reqmoney = cost + money; - if (!player->HasEnoughMoney(reqmoney)) + if (!player->HasEnoughMoney(reqmoney) && !player->isGameMaster()) { player->SendMailResult(0, MAIL_SEND, MAIL_ERR_NOT_ENOUGH_MONEY); return; From ea9339b17183ac92c1164571feb65b3944504e5a Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 23 Jun 2012 12:15:52 +0200 Subject: [PATCH 1094/1149] Core/SmartAI: Fixed SMART_ACTION_SET_RANGED_MOVEMENT parameters --- src/server/game/AI/SmartScripts/SmartScript.cpp | 4 ++-- src/server/game/AI/SmartScripts/SmartScriptMgr.h | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index b6624586551..103cde80f43 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1543,8 +1543,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (!IsSmart()) break; - float attackDistance = (float)e.action.setRangedMovement.distance; - float attackAngle = e.action.setRangedMovement.angle / 180.0f * M_PI; + float attackDistance = float(e.action.setRangedMovement.distance); + float attackAngle = float(e.action.setRangedMovement.angle) / 180.0f * M_PI; ObjectList* targets = GetTargets(e, unit); if (targets) diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index d71d71ce519..55e6a7fc446 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -356,11 +356,11 @@ struct SmartEvent uint32 eventId; } eventInform; - struct + struct { uint32 eventId; } doAction; - + struct { uint32 param1; @@ -857,9 +857,9 @@ struct SmartAction struct { - bool withDelayed; + uint32 withDelayed; uint32 spell_id; - bool withInstant; + uint32 withInstant; } interruptSpellCasting; struct @@ -906,10 +906,13 @@ struct SmartAction struct { - float distance; - float angle; + uint32 distance; + uint32 angle; } setRangedMovement; + //! Note for any new future actions + //! All parameters must have type uint32 + struct { uint32 param1; From d0fa012e1df9941ad1141c861a537b308c0d0012 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 23 Jun 2012 12:16:52 +0200 Subject: [PATCH 1095/1149] Core/Auras: Properly initialize mechanic immunity mask for SPELL_AURA_MECHANIC_IMMUNITY_MASK --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index aed415b0a9f..ac51fff81f6 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -3341,7 +3341,7 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8 Unit* target = aurApp->GetTarget(); std::list aura_immunity_list; - uint32 mechanic_immunity_list; + uint32 mechanic_immunity_list = 0; int32 miscVal = GetMiscValue(); switch (miscVal) From bf5002a4d1d8374279b0325011b7ec6838b3cf09 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 23 Jun 2012 12:31:46 +0200 Subject: [PATCH 1096/1149] Core/Items: Remove item from tradeable list when clearing the flag on enchanting/gemming --- src/server/game/Handlers/ItemHandler.cpp | 1 + src/server/game/Spells/SpellEffects.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index a569c914be0..e0ba190d2fc 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1349,6 +1349,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) _player->ToggleMetaGemsActive(slot, true); //turn on all metagems (except for target item) + _player->RemoveTradeableItem(itemTarget); itemTarget->ClearSoulboundTradeable(_player); // clear tradeable flag } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 84c1401bb5b..dd674672935 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2810,6 +2810,7 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex) // add new enchanting if equipped item_owner->ApplyEnchantment(itemTarget, PERM_ENCHANTMENT_SLOT, true); + item_owner->RemoveTradeableItem(itemTarget); itemTarget->ClearSoulboundTradeable(item_owner); } } @@ -2874,6 +2875,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex) // add new enchanting if equipped item_owner->ApplyEnchantment(itemTarget, PRISMATIC_ENCHANTMENT_SLOT, true); + item_owner->RemoveTradeableItem(itemTarget); itemTarget->ClearSoulboundTradeable(item_owner); } From 830d1cd0bc29acc9e7fd8f0c595697a7bcd0b3f8 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 24 Jun 2012 19:45:58 -0230 Subject: [PATCH 1097/1149] DB/Core/Gossip: Add Gossip for Alliance & Horde bonfires, fix gameobject faction, fix quest racerequirements, fix spell 45437 to be cast upon bonfire. Spawning left to do. --- .../world/2012_06_24_00_world_gossip.sql | 296 ++++++++++++++++++ src/server/scripts/World/go_scripts.cpp | 23 ++ 2 files changed, 319 insertions(+) create mode 100644 sql/updates/world/2012_06_24_00_world_gossip.sql diff --git a/sql/updates/world/2012_06_24_00_world_gossip.sql b/sql/updates/world/2012_06_24_00_world_gossip.sql new file mode 100644 index 00000000000..f8aa5213bf4 --- /dev/null +++ b/sql/updates/world/2012_06_24_00_world_gossip.sql @@ -0,0 +1,296 @@ +-- Conditions for Spell "Stamp Out Bonfire" +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (45437); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +-- Alliance Bonfires +(13,1,45437,0,0,31,0,5,187564,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,1,31,0,5,187914,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,2,31,0,5,187916,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,3,31,0,5,187917,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,4,31,0,5,187919,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,5,31,0,5,187920,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,6,31,0,5,187921,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,7,31,0,5,187922,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,8,31,0,5,187923,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,9,31,0,5,187924,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,10,31,0,5,187925,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,11,31,0,5,187926,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,12,31,0,5,187927,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,13,31,0,5,187928,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,14,31,0,5,187929,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,15,31,0,5,187930,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,16,31,0,5,187931,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,17,31,0,5,187932,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,18,31,0,5,187933,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,19,31,0,5,187934,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,20,31,0,5,187935,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,21,31,0,5,187936,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,22,31,0,5,187937,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,23,31,0,5,187938,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,24,31,0,5,187939,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,25,31,0,5,187940,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,26,31,0,5,187941,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,27,31,0,5,187942,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,28,31,0,5,187943,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,29,31,0,5,187944,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,30,31,0,5,187945,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,31,31,0,5,187946,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,32,31,0,5,194032,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,33,31,0,5,194035,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,34,31,0,5,194036,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,35,31,0,5,194038,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,36,31,0,5,194040,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,37,31,0,5,194044,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,38,31,0,5,194045,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,39,31,0,5,194049,0,0,0,'','Spell can hit go target'), +-- Horde Bonfires +(13,1,45437,0,40,31,0,5,187559,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,41,31,0,5,187947,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,42,31,0,5,187948,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,43,31,0,5,187949,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,44,31,0,5,187950,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,45,31,0,5,187951,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,46,31,0,5,187952,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,47,31,0,5,187953,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,48,31,0,5,187954,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,49,31,0,5,187955,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,50,31,0,5,187956,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,51,31,0,5,187957,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,52,31,0,5,187958,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,53,31,0,5,187959,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,54,31,0,5,187960,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,55,31,0,5,187961,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,56,31,0,5,187962,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,57,31,0,5,187963,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,58,31,0,5,187964,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,59,31,0,5,187965,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,60,31,0,5,187966,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,61,31,0,5,187967,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,62,31,0,5,187968,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,63,31,0,5,187969,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,64,31,0,5,187970,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,65,31,0,5,187971,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,66,31,0,5,187972,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,67,31,0,5,187973,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,68,31,0,5,187974,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,69,31,0,5,187975,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,70,31,0,5,194033,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,71,31,0,5,194034,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,72,31,0,5,194037,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,73,31,0,5,194039,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,74,31,0,5,194042,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,75,31,0,5,194043,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,76,31,0,5,194046,0,0,0,'','Spell can hit go target'), +(13,1,45437,0,77,31,0,5,194048,0,0,0,'','Spell can hit go target'); + +-- Add Triggered spell +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=45458; +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES +(45458,45437,1,'Holiday - Midsummer, Stamp Out Bonfire, Quest Complete triggers Stamp Out Bonfire'); + +-- Add script to bonfires +UPDATE `gameobject_template` SET `ScriptName`= 'go_midsummer_bonfire' WHERE `entry` IN (187559,187564,187914,187916,187917,187919,187920,187921,187922,187923,187924,187925,187926,187927,187928,187929,187930,187931,187932,187933,187934,187935,187936,187937,187938,187939,187940,187941,187942,187943,187944,187945,187946,187947,187948,187949,187950,187951,187952,187953,187954,187955,187956,187957,187958,187959,187960,187961,187962,187963,187964,187965,187966,187967,187968,187969,187970,187971,187972,187973,187974,187975,194032,194033,194034,194035,194036,194037,194038,194039,194040,194042,194043,194044,194045,194046,194048,194049); + +-- Add gossip to Horde Bonfires +DELETE FROM `gossip_menu` WHERE `entry` IN (9370,9353,9355,9379,9380,9381,9382,9383,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9371,9372,9373,9374,9375,9376,9377,9378,10228,10231,10232,10235,10236,10239,10241,10242); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(9370,12374),(9353,12374),(9355,12374),(9379,12374),(9380,12374),(9381,12374),(9382,12374), +(9383,12374),(9356,12374),(9357,12374),(9358,12374),(9359,12374),(9360,12374),(9361,12374), +(9362,12374),(9363,12374),(9364,12374),(9365,12374),(9366,12374),(9367,12374),(9368,12374), +(9369,12374),(9371,12374),(9372,12374),(9373,12374),(9374,12374),(9375,12374),(9376,12374), +(9377,12374),(9378,12374),(10228,12374),(10231,12374),(10232,12374),(10235,12374),(10236,12374), +(10239,12374),(10241,12374),(10242,12374); + +-- Creature Gossip_menu_option inserts for Horde bonfires +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (9370,9353,9355,9379,9380,9381,9382,9383,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9371,9372,9373,9374,9375,9376,9377,9378,10228,10231,10232,10235,10236,10239,10241,10242) AND `id`=0; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES +(9370,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9353,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9355,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9379,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9380,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9381,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9382,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9383,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9356,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9357,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9358,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9359,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9360,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9361,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9362,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9363,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9364,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9365,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9366,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9367,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9368,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9369,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9371,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9372,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9373,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9374,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9375,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9376,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9377,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(9378,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(10228,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(10231,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(10232,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(10235,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(10236,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(10239,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(10241,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''), +(10242,0,0, 'Stamp out the Horde bonfire!',1,1,0,0,0,0, ''); + +-- Add conditons for Horde Bonfires +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceEntry`=0 AND `SourceGroup` IN (9370,9353,9355,9379,9380,9381,9382,9383,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9371,9372,9373,9374,9375,9376,9377,9378,10228,10231,10232,10235,10236,10239,10241,10242); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,9370,0,0,0,8,0,11581,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9353,0,0,0,8,0,11764,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9355,0,0,0,8,0,11765,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9379,0,0,0,8,0,11766,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9380,0,0,0,8,0,11767,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9381,0,0,0,8,0,11768,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9382,0,0,0,8,0,11769,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9383,0,0,0,8,0,11770,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9356,0,0,0,8,0,11771,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9357,0,0,0,8,0,11772,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9358,0,0,0,8,0,11773,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9359,0,0,0,8,0,11774,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9360,0,0,0,8,0,11775,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9361,0,0,0,8,0,11776,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9362,0,0,0,8,0,11777,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9363,0,0,0,8,0,11778,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9364,0,0,0,8,0,11779,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9365,0,0,0,8,0,11780,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9366,0,0,0,8,0,11781,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9367,0,0,0,8,0,11782,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9368,0,0,0,8,0,11783,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9369,0,0,0,8,0,11784,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9371,0,0,0,8,0,11785,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9372,0,0,0,8,0,11786,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9373,0,0,0,8,0,11787,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9374,0,0,0,8,0,11799,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9375,0,0,0,8,0,11800,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9376,0,0,0,8,0,11801,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9377,0,0,0,8,0,11802,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9378,0,0,0,8,0,11803,0,0,0,0,'','Show gossip option only if player has quest'), +(15,10228,0,0,0,8,0,13441,0,0,0,0,'','Show gossip option only if player has quest'), +(15,10231,0,0,0,8,0,13450,0,0,0,0,'','Show gossip option only if player has quest'), +(15,10232,0,0,0,8,0,13451,0,0,0,0,'','Show gossip option only if player has quest'), +(15,10235,0,0,0,8,0,13453,0,0,0,0,'','Show gossip option only if player has quest'), +(15,10236,0,0,0,8,0,13454,0,0,0,0,'','Show gossip option only if player has quest'), +(15,10239,0,0,0,8,0,13455,0,0,0,0,'','Show gossip option only if player has quest'), +(15,10241,0,0,0,8,0,13457,0,0,0,0,'','Show gossip option only if player has quest'), +(15,10242,0,0,0,8,0,13458,0,0,0,0,'','Show gossip option only if player has quest'); + +-- Fix required side for Alliance quest +UPDATE `quest_template` SET `RequiredRaces`=1101 WHERE `Id` IN (11581,11764,11765,11766,11767,11768,11769,11770,11771,11772,11773,11774,11775,11776,11777,11778,11779,11780,11781,11782,11783,11784,11785,11786,11787,11799,11800,11801,11802,11803,13441,13450,13451,13453,13454,13455,13457,13458); + +-- Fix Faction for Horde bonfires +UPDATE `gameobject_template` SET `faction`=1732 WHERE `entry` IN (187949,187955,187958,187960,187962,187965,187967,187974,194037,194039,194042,194043,194046,194048); + +-- Add gossip to Alliance Bonfires +DELETE FROM `gossip_menu` WHERE `entry` IN (9406,9352,9354,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9398,9399,9400,9401,9402,9403,9404,9405,9407,9408,9409,9410,9411,9412,9413,10227,10230,10233,10234,10237,10238,10240,10243); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(9406,12377),(9352,12377),(9354,12377),(9384,12377),(9385,12377),(9386,12377),(9387,12377),(9388,12377), +(9389,12377),(9390,12377),(9391,12377),(9392,12377),(9393,12377),(9394,12377),(9395,12377),(9396,12377), +(9397,12377),(9398,12377),(9399,12377),(9400,12377),(9401,12377),(9402,12377),(9403,12377),(9404,12377), +(9405,12377),(9407,12377),(9408,12377),(9409,12377),(9410,12377),(9411,12377),(9412,12377),(9413,12377), +(10227,12377),(10230,12377),(10233,12377),(10234,12377),(10237,12377),(10238,12377),(10240,12377),(10243,12377); + +-- Creature Gossip_menu_option insert from sniff +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (9406,9352,9354,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9398,9399,9400,9401,9402,9403,9404,9405,9407,9408,9409,9410,9411,9412,9413,10227,10230,10233,10234,10237,10238,10240,10243) AND `id`=0; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES +(9406,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9352,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9354,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9384,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9385,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9386,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9387,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9388,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9389,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9390,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9391,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9392,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9393,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9394,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9395,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9396,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9397,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9398,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9399,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9400,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9401,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9402,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9403,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9404,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9405,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9407,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9408,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9409,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9410,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9411,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9412,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(9413,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(10227,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(10230,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(10233,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(10234,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(10237,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(10238,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(10240,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''), +(10243,0,0, 'Stamp out the Alliance bonfire!',1,1,0,0,0,0, ''); + +-- Add conditons for Alliance Bonfires +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceEntry`=0 AND `SourceGroup` IN (9406,9352,9354,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9398,9399,9400,9401,9402,9403,9404,9405,9407,9408,9409,9410,9411,9412,9413,10227,10230,10233,10234,10237,10238,10240,10243); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,9406,0,0,0,8,0,11580,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9352,0,0,0,8,0,11732,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9354,0,0,0,8,0,11734,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9384,0,0,0,8,0,11735,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9385,0,0,0,8,0,11736,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9386,0,0,0,8,0,11737,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9387,0,0,0,8,0,11738,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9388,0,0,0,8,0,11739,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9389,0,0,0,8,0,11740,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9390,0,0,0,8,0,11741,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9391,0,0,0,8,0,11742,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9392,0,0,0,8,0,11743,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9393,0,0,0,8,0,11744,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9394,0,0,0,8,0,11745,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9395,0,0,0,8,0,11746,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9396,0,0,0,8,0,11747,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9397,0,0,0,8,0,11748,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9398,0,0,0,8,0,11749,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9399,0,0,0,8,0,11750,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9400,0,0,0,8,0,11751,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9401,0,0,0,8,0,11752,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9402,0,0,0,8,0,11753,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9403,0,0,0,8,0,11754,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9404,0,0,0,8,0,11755,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9405,0,0,0,8,0,11756,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9407,0,0,0,8,0,11757,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9408,0,0,0,8,0,11758,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9409,0,0,0,8,0,11759,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9410,0,0,0,8,0,11760,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9411,0,0,0,8,0,11761,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9412,0,0,0,8,0,11762,0,0,0,0,'','Show gossip option only if player has quest'), +(15,9413,0,0,0,8,0,11763,0,0,0,0,'','Show gossip option only if player has quest'), +(15,10227,0,0,0,8,0,13440,0,0,0,0,'','Show gossip option only if player has quest'), +(15,10230,0,0,0,8,0,13442,0,0,0,0,'','Show gossip option only if player has quest'), +(15,10233,0,0,0,8,0,13443,0,0,0,0,'','Show gossip option only if player has quest'), +(15,10234,0,0,0,8,0,13444,0,0,0,0,'','Show gossip option only if player has quest'), +(15,10237,0,0,0,8,0,13445,0,0,0,0,'','Show gossip option only if player has quest'), +(15,10238,0,0,0,8,0,13446,0,0,0,0,'','Show gossip option only if player has quest'), +(15,10240,0,0,0,8,0,13447,0,0,0,0,'','Show gossip option only if player has quest'), +(15,10243,0,0,0,8,0,13449,0,0,0,0,'','Show gossip option only if player has quest'); + +-- Fix required side for Horde quest +UPDATE `quest_template` SET `RequiredRaces`=690 WHERE `Id` IN (11580,11732,11734,11735,11736,11737,11738,11739,11740,11741,11742,11743,11744,11745,11746,11747,11748,11749,11750,11751,11752,11753,11754,11755,11756,11757,11758,11759,11760,11761,11762,11763,13440,13442,13443,13444,13445,13446,13447,13449); + +-- Fix Faction for Alliance bonfires +UPDATE `gameobject_template` SET `faction`=1735 WHERE `entry` IN (187564,187914,187916,187917); +UPDATE `gameobject_template` SET `faction`=1735 WHERE `entry` BETWEEN 187919 AND 187946; +UPDATE `gameobject_template` SET `faction`=1735 WHERE `entry` IN (194032,194035,194036,194038,194040,194044,194045,194049); diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 308c7f9afa3..21a852ae9ed 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -1275,6 +1275,28 @@ public: } }; +/*###### +## go_midsummer_bonfire +######*/ + +enum eMidsummerBonfire +{ + STAMP_OUT_BONFIRE_QUEST_COMPLETE = 45458, +}; + +class go_midsummer_bonfire : public GameObjectScript +{ +public: + go_midsummer_bonfire() : GameObjectScript("go_midsummer_bonfire") { } + + bool OnGossipSelect(Player* player, GameObject* /*go*/, uint32 /*sender*/, uint32 /*action*/) + { + player->CastSpell(player, STAMP_OUT_BONFIRE_QUEST_COMPLETE, true); + player->CLOSE_GOSSIP_MENU(); + return false; + } +}; + void AddSC_go_scripts() { new go_cat_figurine; @@ -1316,4 +1338,5 @@ void AddSC_go_scripts() new go_large_gjalerbron_cage; new go_veil_skith_cage; new go_frostblade_shrine; + new go_midsummer_bonfire; } From 1071384010cf3c19d5ebb83d7dab0180f70dba95 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 24 Jun 2012 20:46:25 -0230 Subject: [PATCH 1098/1149] Db/quest: Add quest relations for Alliance & horde bonfires. --- .../world/2012_06_24_00_world_quest.sql | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 sql/updates/world/2012_06_24_00_world_quest.sql diff --git a/sql/updates/world/2012_06_24_00_world_quest.sql b/sql/updates/world/2012_06_24_00_world_quest.sql new file mode 100644 index 00000000000..ec0d39b0c62 --- /dev/null +++ b/sql/updates/world/2012_06_24_00_world_quest.sql @@ -0,0 +1,167 @@ +DELETE FROM `gameobject_questrelation` WHERE `id` IN (187564,187914,187916,187917,187919,187920,187921,187922,187923,187924,187925,187926,187927,187928,187929,187930,187931,187931,187932,187933,187934,187935,187936,187937,187938,187939,187940,187941,187942,187943,187944,187945,187946,194032,194035,194036,194038,194040,194044,194045,194049); +INSERT INTO `gameobject_questrelation` (`id`,`quest`) VALUES +(187564,11580), +(187914,11732), +(187916,11734), +(187917,11735), +(187919,11736), +(187920,11737), +(187921,11738), +(187922,11739), +(187923,11740), +(187924,11741), +(187925,11742), +(187926,11743), +(187927,11744), +(187928,11745), +(187929,11746), +(187930,11747), +(187931,11748), +(187932,11749), +(187933,11750), +(187934,11751), +(187935,11752), +(187936,11753), +(187937,11754), +(187938,11755), +(187939,11756), +(187940,11757), +(187941,11758), +(187942,11759), +(187943,11760), +(187944,11761), +(187945,11762), +(187946,11763), +(194032,13440), +(194035,13442), +(194036,13443), +(194038,13444), +(194040,13445), +(194044,13446), +(194045,13447), +(194049,13449); + +DELETE FROM `gameobject_involvedrelation` WHERE `id` IN (187564,187914,187916,187917,187919,187920,187921,187922,187923,187924,187925,187926,187927,187928,187929,187930,187931,187931,187932,187933,187934,187935,187936,187937,187938,187939,187940,187941,187942,187943,187944,187945,187946,194032,194035,194036,194038,194040,194044,194045,194049); +INSERT INTO `gameobject_involvedrelation` (`id`,`quest`) VALUES +(187564,11580), +(187914,11732), +(187916,11734), +(187917,11735), +(187919,11736), +(187920,11737), +(187921,11738), +(187922,11739), +(187923,11740), +(187924,11741), +(187925,11742), +(187926,11743), +(187927,11744), +(187928,11745), +(187929,11746), +(187930,11747), +(187931,11748), +(187932,11749), +(187933,11750), +(187934,11751), +(187935,11752), +(187936,11753), +(187937,11754), +(187938,11755), +(187939,11756), +(187940,11757), +(187941,11758), +(187942,11759), +(187943,11760), +(187944,11761), +(187945,11762), +(187946,11763), +(194032,13440), +(194035,13442), +(194036,13443), +(194038,13444), +(194040,13445), +(194044,13446), +(194045,13447), +(194049,13449); + +DELETE FROM `gameobject_questrelation` WHERE `id` IN (187559,187947,187948,187949,187950,187951,187952,187953,187954,187955,187956,187957,187958,187959,187960,187961,187962,187963,187964,187965,187966,187967,187968,187969,187970,187971,187972,187973,187974,187975,194033,194034,194037,194039,194042,194043,194046,194048); +INSERT INTO `gameobject_questrelation` (`id`,`quest`) VALUES +(187559,11581), +(187947,11764), +(187948,11765), +(187949,11766), +(187950,11767), +(187951,11768), +(187952,11769), +(187953,11770), +(187954,11771), +(187955,11772), +(187956,11773), +(187957,11774), +(187958,11775), +(187959,11776), +(187960,11777), +(187961,11778), +(187962,11779), +(187963,11780), +(187964,11781), +(187965,11782), +(187966,11783), +(187967,11784), +(187968,11785), +(187969,11786), +(187970,11787), +(187971,11799), +(187972,11800), +(187973,11801), +(187974,11802), +(187975,11803), +(194033,13441), +(194034,13450), +(194037,13451), +(194039,13453), +(194042,13454), +(194043,13455), +(194046,13457), +(194048,13458); + +DELETE FROM `gameobject_involvedrelation` WHERE `id` IN (187559,187947,187948,187949,187950,187951,187952,187953,187954,187955,187956,187957,187958,187959,187960,187961,187962,187963,187964,187965,187966,187967,187968,187969,187970,187971,187972,187973,187974,187975,194033,194034,194037,194039,194042,194043,194046,194048); +INSERT INTO `gameobject_involvedrelation` (`id`,`quest`) VALUES +(187559,11581), +(187947,11764), +(187948,11765), +(187949,11766), +(187950,11767), +(187951,11768), +(187952,11769), +(187953,11770), +(187954,11771), +(187955,11772), +(187956,11773), +(187957,11774), +(187958,11775), +(187959,11776), +(187960,11777), +(187961,11778), +(187962,11779), +(187963,11780), +(187964,11781), +(187965,11782), +(187966,11783), +(187967,11784), +(187968,11785), +(187969,11786), +(187970,11787), +(187971,11799), +(187972,11800), +(187973,11801), +(187974,11802), +(187975,11803), +(194033,13441), +(194034,13450), +(194037,13451), +(194039,13453), +(194042,13454), +(194043,13455), +(194046,13457), +(194048,13458); From 9da9de733e76a4e2eebf6e8c28a4ccca20bda5f6 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 24 Jun 2012 22:48:33 -0230 Subject: [PATCH 1099/1149] DB/Gameobject: Add Mid Summer Festival Go Spawns to Burning Steppes --- .../world/2012_06_24_02_world_gameobject.sql | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 sql/updates/world/2012_06_24_02_world_gameobject.sql diff --git a/sql/updates/world/2012_06_24_02_world_gameobject.sql b/sql/updates/world/2012_06_24_02_world_gameobject.sql new file mode 100644 index 00000000000..55d2b73444c --- /dev/null +++ b/sql/updates/world/2012_06_24_02_world_gameobject.sql @@ -0,0 +1,30 @@ +-- Burning Steppes Mid Summer Festival Go Spawns +SET @OGUID := 17820; +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+19; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES +(@OGUID+0,181302,0,1,1,-8265.07,-2627.144,135.0536,1.989672,0,0,0,1,120,255,1), +(@OGUID+1,181302,0,1,1,-8263.305,-2627.122,134.5683,2.949595,0,0,0,1,120,255,1), +(@OGUID+2,181305,0,1,1,-8258.544,-2624.803,133.4996,5.98648,0,0,0,1,120,255,1), +(@OGUID+3,181306,0,1,1,-8262.327,-2628.302,134.2665,2.007128,0,0,0,1,120,255,1), +(@OGUID+4,181307,0,1,1,-8257.901,-2625.303,134.469,1.658062,0,0,0,1,120,255,1), +(@OGUID+5,181355,0,1,1,-8260.892,-2601.407,133.1487,0.8552105,0,0,0,1,120,255,1), +(@OGUID+6,181355,0,1,1,-8262.448,-2606.505,133.4136,0.2443456,0,0,0,1,120,255,1), +(@OGUID+7,181355,0,1,1,-8245.146,-2606.867,133.1535,0.8552105,0,0,0,1,120,255,1), +(@OGUID+8,181355,0,1,1,-8264.143,-2611.291,133.4626,5.201083,0,0,0,1,120,255,1), +(@OGUID+9,181355,0,1,1,-8246.274,-2611.94,133.1546,4.66003,0,0,0,1,120,255,1), +(@OGUID+10,181355,0,1,1,-8247.434,-2616.645,133.1546,5.846854,0,0,0,1,120,255,1), +(@OGUID+11,181355,0,1,1,-8267.189,-2635.668,134.4242,0.1745321,0,0,0,1,120,255,1), +(@OGUID+12,181355,0,1,1,-8252.989,-2636.582,133.1547,3.211419,0,0,0,1,120,255,1), +(@OGUID+13,181605,0,1,1,-8261.666,-2638.048,133.3969,5.777041,0,0,0,1,120,255,1), +(@OGUID+14,187922,0,1,1,-8249.528,-2625.985,133.1546,1.727875,0,0,0,1,120,255,1), +(@OGUID+15,188020,0,1,1,-8267.534,-2642.816,133.9444,4.555311,0,0,0,1,120,255,1), +(@OGUID+16,188020,0,1,1,-8256.433,-2643.724,133.1869,4.468043,0,0,0,1,120,255,1), +(@OGUID+17,188020,0,1,1,-8258.073,-2601.522,133.1487,1.274088,0,0,0,1,120,255,1), +(@OGUID+18,188020,0,1,1,-8247.378,-2604.626,133.15,1.326448,0,0,0,1,120,255,1), +(@OGUID+19,188021,0,1,1,-8261.987,-2623.612,133.4952,1.361356,0,0,0,1,120,255,1); +DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+19; +INSERT INTO `game_event_gameobject` (`eventEntry`,`guid`) VALUES +(1,@OGUID+0),(1,@OGUID+1),(1,@OGUID+2),(1,@OGUID+3),(1,@OGUID+4), +(1,@OGUID+5),(1,@OGUID+6),(1,@OGUID+7),(1,@OGUID+8),(1,@OGUID+9), +(1,@OGUID+10),(1,@OGUID+11),(1,@OGUID+12),(1,@OGUID+13),(1,@OGUID+14), +(1,@OGUID+15),(1,@OGUID+16),(1,@OGUID+17),(1,@OGUID+18),(1,@OGUID+19); From e25072567ad07446a0eb13b0691ee0bfc4377d64 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 24 Jun 2012 23:05:49 -0230 Subject: [PATCH 1100/1149] DB/Gameobject: Chillwind Camp Mid Summer Festival Go Spawns --- .../world/2012_06_24_03_world_gameobject.sql | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 sql/updates/world/2012_06_24_03_world_gameobject.sql diff --git a/sql/updates/world/2012_06_24_03_world_gameobject.sql b/sql/updates/world/2012_06_24_03_world_gameobject.sql new file mode 100644 index 00000000000..16d0330d1d0 --- /dev/null +++ b/sql/updates/world/2012_06_24_03_world_gameobject.sql @@ -0,0 +1,28 @@ +-- Chillwind Camp Mid Summer Festival Go Spawns +SET @OGUID := 17845; +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+17; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES +(@OGUID+0,181300,0,1,1,945.1077,-1435.984,62.91423,5.288348,0,0,0,1,120,255,1), +(@OGUID+1,181302,0,1,1,1004.427,-1443.667,62.28303,2.949595,0,0,0,1,120,255,1), +(@OGUID+2,181302,0,1,1,1004.097,-1446.269,61.98349,1.989672,0,0,0,1,120,255,1), +(@OGUID+3,181305,0,1,1,1009.866,-1446.948,62.31522,3.490667,0,0,0,1,120,255,1), +(@OGUID+4,181306,0,1,1,1002.772,-1445.215,62.09951,2.007128,0,0,0,1,120,255,1), +(@OGUID+5,181307,0,1,1,1009.089,-1446.896,63.24824,1.658062,0,0,0,1,120,255,1), +(@OGUID+6,181355,0,1,1,995.8973,-1439.065,63.6682,0.8552105,0,0,0,1,120,255,1), +(@OGUID+7,181355,0,1,1,1010.988,-1450.932,62.06363,4.66003,0,0,0,1,120,255,1), +(@OGUID+8,181355,0,1,1,988.3309,-1455.517,60.69862,5.846854,0,0,0,1,120,255,1), +(@OGUID+9,181355,0,1,1,934.7761,-1439.972,63.46706,2.251473,0,0,0,1,120,255,1), +(@OGUID+10,181605,0,1,1,1002.282,-1432.47,64.05733,5.777041,0,0,0,1,120,255,1), +(@OGUID+11,187576,0,1,1,973.3299,-1430.872,67.15336,3.141593,0,0,0,1,120,255,1), +(@OGUID+12,187939,0,1,1,999.0452,-1453.844,60.73637,3.68265,0,0,0,1,120,255,1), +(@OGUID+13,188020,0,1,1,1011.989,-1434.024,63.98868,6.230826,0,0,0,1,120,255,1), +(@OGUID+14,188020,0,1,1,1017.408,-1450.234,62.41806,5.166176,0,0,0,1,120,255,1), +(@OGUID+15,188020,0,1,1,987.117,-1451.32,61.76295,3.717554,0,0,0,1,120,255,1), +(@OGUID+16,188020,0,1,1,990.5877,-1460.205,60.6304,3.595379,0,0,0,1,120,255,1), +(@OGUID+17,188021,0,1,1,1006.964,-1448.083,62.19069,5.148723,0,0,0,1,120,255,1); +DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+19; +INSERT INTO `game_event_gameobject` (`eventEntry`,`guid`) VALUES +(1,@OGUID+0),(1,@OGUID+1),(1,@OGUID+2),(1,@OGUID+3),(1,@OGUID+4), +(1,@OGUID+5),(1,@OGUID+6),(1,@OGUID+7),(1,@OGUID+8),(1,@OGUID+9), +(1,@OGUID+10),(1,@OGUID+11),(1,@OGUID+12),(1,@OGUID+13),(1,@OGUID+14), +(1,@OGUID+15),(1,@OGUID+16),(1,@OGUID+17); From da6904a324d9c3aba3d4b620052d8fd1ce43bc90 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 25 Jun 2012 00:03:41 -0230 Subject: [PATCH 1101/1149] DB/Gameobject: The Forgotten Coast Alliance Mid Summer Festival Go Spawns --- .../world/2012_06_24_02_world_gameobject.sql | 2 +- .../world/2012_06_24_03_world_gameobject.sql | 2 +- .../world/2012_06_24_04_world_gameobject.sql | 30 +++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 sql/updates/world/2012_06_24_04_world_gameobject.sql diff --git a/sql/updates/world/2012_06_24_02_world_gameobject.sql b/sql/updates/world/2012_06_24_02_world_gameobject.sql index 55d2b73444c..4894365462e 100644 --- a/sql/updates/world/2012_06_24_02_world_gameobject.sql +++ b/sql/updates/world/2012_06_24_02_world_gameobject.sql @@ -1,7 +1,7 @@ -- Burning Steppes Mid Summer Festival Go Spawns SET @OGUID := 17820; DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+19; -INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES (@OGUID+0,181302,0,1,1,-8265.07,-2627.144,135.0536,1.989672,0,0,0,1,120,255,1), (@OGUID+1,181302,0,1,1,-8263.305,-2627.122,134.5683,2.949595,0,0,0,1,120,255,1), (@OGUID+2,181305,0,1,1,-8258.544,-2624.803,133.4996,5.98648,0,0,0,1,120,255,1), diff --git a/sql/updates/world/2012_06_24_03_world_gameobject.sql b/sql/updates/world/2012_06_24_03_world_gameobject.sql index 16d0330d1d0..b98ef4b6dbe 100644 --- a/sql/updates/world/2012_06_24_03_world_gameobject.sql +++ b/sql/updates/world/2012_06_24_03_world_gameobject.sql @@ -1,7 +1,7 @@ -- Chillwind Camp Mid Summer Festival Go Spawns SET @OGUID := 17845; DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+17; -INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES (@OGUID+0,181300,0,1,1,945.1077,-1435.984,62.91423,5.288348,0,0,0,1,120,255,1), (@OGUID+1,181302,0,1,1,1004.427,-1443.667,62.28303,2.949595,0,0,0,1,120,255,1), (@OGUID+2,181302,0,1,1,1004.097,-1446.269,61.98349,1.989672,0,0,0,1,120,255,1), diff --git a/sql/updates/world/2012_06_24_04_world_gameobject.sql b/sql/updates/world/2012_06_24_04_world_gameobject.sql new file mode 100644 index 00000000000..2fa34ee18c3 --- /dev/null +++ b/sql/updates/world/2012_06_24_04_world_gameobject.sql @@ -0,0 +1,30 @@ +-- The Forgotten Coast Alliance Mid Summer Festival Go Spawns +SET @OGUID := 21003; +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+19; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(@OGUID+0,188021,1,1,1,-4398.083,2187.373,12.25118,6.03884,0,0,0,1,120,255,1), +(@OGUID+1,181302,1,1,1,-4396.901,2188.478,12.71206,2.949595,0,0,0,1,120,255,1), +(@OGUID+2,181302,1,1,1,-4392.186,2182.861,12.36883,4.694937,0,0,0,1,120,255,1), +(@OGUID+3,181305,1,1,1,-4396.205,2185.561,12.88021,2.268925,0,0,0,1,120,255,1), +(@OGUID+4,181306,1,1,1,-4396.394,2190.134,12.45671,2.007128,0,0,0,1,120,255,1), +(@OGUID+5,181307,1,1,1,-4397.196,2185.575,13.85373,1.658062,0,0,0,1,120,255,1), +(@OGUID+6,181388,1,1,1,-4273.38,2246.32,10.7598,5.637414,0,0,0,1,120,255,1), +(@OGUID+7,181355,1,1,1,-4399.59,2167.158,11.20139,5.201083,0,0,0,1,120,255,1), +(@OGUID+8,181355,1,1,1,-4405.212,2185.207,12.17883,0.8552105,0,0,0,1,120,255,1), +(@OGUID+9,181355,1,1,1,-4402.662,2193.127,11.89757,5.846854,0,0,0,1,120,255,1), +(@OGUID+10,181355,1,1,1,-4387.453,2180.198,11.91319,4.66003,0,0,0,1,120,255,1), +(@OGUID+11,181355,1,1,1,-4385.776,2188.759,11.18229,0.8552105,0,0,0,1,120,255,1), +(@OGUID+12,181355,1,1,1,-4388.712,2208.042,10.41075,1.186823,0,0,0,1,120,255,1), +(@OGUID+13,181355,1,1,1,-4289.17,2237.73,9.40999,1.675514,0,0,0,1,120,255,1), +(@OGUID+14,181605,1,1,1,-4399.495,2171.792,11.82118,5.777041,0,0,0,1,120,255,1), +(@OGUID+15,187929,1,1,1,-4392.564,2198.469,10.85703,2.460913,0,0,0,1,120,255,1), +(@OGUID+16,188020,1,1,1,-4408.799,2171.87,12.71528,2.82743,0,0,0,1,120,255,1), +(@OGUID+17,188020,1,1,1,-4392.096,2168.01,13.40625,6.0912,0,0,0,1,120,255,1), +(@OGUID+18,188020,1,1,1,-4396.503,2207.885,9.430555,2.775069,0,0,0,1,120,255,1), +(@OGUID+19,188020,1,1,1,-4382.582,2200.814,9.956597,5.829401,0,0,0,1,120,255,1); +DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+19; +INSERT INTO `game_event_gameobject` (`eventEntry`,`guid`) VALUES +(1,@OGUID+0),(1,@OGUID+1),(1,@OGUID+2),(1,@OGUID+3),(1,@OGUID+4), +(1,@OGUID+5),(1,@OGUID+6),(1,@OGUID+7),(1,@OGUID+8),(1,@OGUID+9), +(1,@OGUID+10),(1,@OGUID+11),(1,@OGUID+12),(1,@OGUID+13),(1,@OGUID+14), +(1,@OGUID+15),(1,@OGUID+16),(1,@OGUID+17),(1,@OGUID+18),(1,@OGUID+19); From 1f0ecf2c3e7e153d53c65974327425a7a26eb25f Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 25 Jun 2012 12:15:42 -0400 Subject: [PATCH 1102/1149] DB/Spells: fix death strike double procing the heal effect. according to sniffs this should only be done for the main hand. --- sql/updates/world/2012_06_25_00_world_spell_script_names.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2012_06_25_00_world_spell_script_names.sql diff --git a/sql/updates/world/2012_06_25_00_world_spell_script_names.sql b/sql/updates/world/2012_06_25_00_world_spell_script_names.sql new file mode 100644 index 00000000000..51f3e19f5bc --- /dev/null +++ b/sql/updates/world/2012_06_25_00_world_spell_script_names.sql @@ -0,0 +1 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` = -66188; From 4a85def47ebd938eb5f71680692852af49c72cb5 Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Tue, 26 Jun 2012 00:45:07 +0300 Subject: [PATCH 1103/1149] DB/SAI: Fix Quest 12828 (Ample Inspiration). --- sql/updates/world/2012_06_26_00_world_sai.sql | 50 +++++++++++++++++ src/server/scripts/Spells/spell_item.cpp | 55 ------------------- 2 files changed, 50 insertions(+), 55 deletions(-) create mode 100644 sql/updates/world/2012_06_26_00_world_sai.sql diff --git a/sql/updates/world/2012_06_26_00_world_sai.sql b/sql/updates/world/2012_06_26_00_world_sai.sql new file mode 100644 index 00000000000..c6fe75be1e5 --- /dev/null +++ b/sql/updates/world/2012_06_26_00_world_sai.sql @@ -0,0 +1,50 @@ +-- Ample Inspiration (12828) + +SET @GOB_UDED := 191553; -- U.D.E.D. Dispenser +SET @GOSSIP_MENU := 10211; +SET @NPC_MAMMOTH := 29402; -- Ironwool Mammoth +SET @NPC_MEAT_BUNNY := 29524; -- Mammoth Meat Bunny +SET @SPELL_THROW_UDED := 54577; -- Throw U.D.E.D. +SET @SPELL_GIVE_UDED := 54576; -- Forceitem U.D.E.D. +SET @SPELL_SPAWNER := 54581; -- Mammoth Explosion Spell Spawner +SET @SPELL_MAIN_MEAT := 57444; -- Summon Main Mammoth Meat +SET @SPELL_MEAT := 54625; -- Summon Mammoth Meat +SET @SPELL_MEAT_BUNNY1 := 54627; -- Quest - Mammoth Explosion Summon Object +SET @SPELL_MEAT_BUNNY2 := 54628; -- Quest - Mammoth Explosion Summon Object +SET @SPELL_MEAT_BUNNY3 := 54623; -- Quest - Mammoth Explosion Summon Object + +DELETE FROM `spell_script_names` WHERE `spell_id`=@SPELL_THROW_UDED; + +DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP_MENU; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES +(@GOSSIP_MENU,0,0,'',1,0,0,0,0,0,NULL); + +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=@GOB_UDED; +DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=@GOB_UDED; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(@GOB_UDED,1,0,1,62,0,100,0,@GOSSIP_MENU,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'On gossip - Close gossip'), +(@GOB_UDED,1,1,0,61,0,100,0,0,0,0,0,85,@SPELL_GIVE_UDED,0,0,0,0,0,7,0,0,0,0,0,0,0,'On link - Cast Forceitem U.D.E.D.'); + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@NPC_MAMMOTH; +UPDATE `creature_template` SET `flags_extra`=128,`AIName`='SmartAI' WHERE `entry`=@NPC_MEAT_BUNNY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@NPC_MAMMOTH; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (@NPC_MAMMOTH,@NPC_MEAT_BUNNY); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +-- Ironwool Mammoth +(@NPC_MAMMOTH,0,0,0,0,0,100,0,1000,3000,7000,10000,11,56356,0,0,0,0,0,1,0,0,0,0,0,0,0,'Cast Ironwool Coat'), +(@NPC_MAMMOTH,0,1,2,8,0,100,0,@SPELL_THROW_UDED,0,0,0,11,@SPELL_SPAWNER,0,0,0,0,0,1,0,0,0,0,0,0,0,'On spellhit - Cast Mammoth Explosion Spell Spawner'), +(@NPC_MAMMOTH,0,2,0,61,0,100,0,0,0,0,0,41,500,0,0,0,0,0,1,0,0,0,0,0,0,0,'On link - Despawn'), +-- Mammoth Meat Bunny +(@NPC_MEAT_BUNNY,0,0,0,54,0,100,1,0,0,0,0,11,@SPELL_MEAT,0,0,0,0,0,1,0,0,0,0,0,0,0,'On spawn - Cast'); + +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=@SPELL_SPAWNER; +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES +(@SPELL_SPAWNER,@SPELL_MAIN_MEAT,0,'Mammoth Explosion Spell Spawner link to Summon Main Mammoth Meat'), +(@SPELL_SPAWNER,@SPELL_MEAT_BUNNY1,0,'Mammoth Explosion Spell Spawner link to Quest - Mammoth Explosion Summon Object'), +(@SPELL_SPAWNER,@SPELL_MEAT_BUNNY2,0,'Mammoth Explosion Spell Spawner link to Quest - Mammoth Explosion Summon Object'), +(@SPELL_SPAWNER,@SPELL_MEAT_BUNNY3,0,'Mammoth Explosion Spell Spawner link to Quest - Mammoth Explosion Summon Object'); + +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=17 AND `SourceEntry`=@SPELL_THROW_UDED) OR (`SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP_MENU); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(17,0,@SPELL_THROW_UDED,0,0,31,1,3,@NPC_MAMMOTH,0,0,0,'','Require Ironwool Mammoth as target'), +(15,@GOSSIP_MENU,0,0,0,9,0,12828,0,0,0,0,'','Show gossip if quest taken'); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 4e2eb633662..3c89cb7005a 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1848,60 +1848,6 @@ class spell_item_unusual_compass : public SpellScriptLoader } }; -enum UDED -{ - NPC_IRONWOOL_MAMMOTH = 53806, - SPELL_MAMMOTH_CARCASS = 57444, - SPELL_MAMMOTH_MEAT = 54625, -}; - -class spell_item_uded : public SpellScriptLoader -{ - public: - spell_item_uded() : SpellScriptLoader("spell_item_uded") { } - - class spell_item_uded_SpellScript : public SpellScript - { - PrepareSpellScript(spell_item_uded_SpellScript); - - bool Load() - { - if (GetHitCreature() && GetHitCreature()->GetEntry() == NPC_IRONWOOL_MAMMOTH) - return true; - return false; - } - - bool Validate(SpellInfo const* /*spell*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_MAMMOTH_CARCASS) || !sSpellMgr->GetSpellInfo(SPELL_MAMMOTH_MEAT)) - return false; - return true; - } - - void HandleDummy(SpellEffIndex /* effIndex */) - { - Unit* caster = GetCaster(); - Creature* creature = GetHitCreature(); - caster->CastSpell(caster,SPELL_MAMMOTH_CARCASS,true); - - for (uint8 i = 0; i < 4; ++i) - caster->CastSpell(caster,SPELL_MAMMOTH_MEAT,true); - - creature->Kill(creature); - } - - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_item_uded_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_item_uded_SpellScript(); - } -}; - enum ChickenCover { SPELL_CHICKEN_NET = 51959, @@ -2109,7 +2055,6 @@ void AddSC_item_spell_scripts() new spell_item_rocket_boots(); new spell_item_pygmy_oil(); new spell_item_unusual_compass(); - new spell_item_uded(); new spell_item_chicken_cover(); new spell_item_muisek_vessel(); new spell_item_greatmothers_soulcatcher(); From d6db97f4f1cf2e127fa9994a00b4b05dde339509 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 25 Jun 2012 20:08:07 -0230 Subject: [PATCH 1104/1149] DB/SQL: Filename fix and some comments updated. --- .../world/2012_06_12_00_world_transport.sql | 24 +++++++++---------- ...uest.sql => 2012_06_24_01_world_quest.sql} | 0 2 files changed, 12 insertions(+), 12 deletions(-) rename sql/updates/world/{2012_06_24_00_world_quest.sql => 2012_06_24_01_world_quest.sql} (100%) diff --git a/sql/updates/world/2012_06_12_00_world_transport.sql b/sql/updates/world/2012_06_12_00_world_transport.sql index 3099292f48d..d3a35c254d9 100644 --- a/sql/updates/world/2012_06_12_00_world_transport.sql +++ b/sql/updates/world/2012_06_12_00_world_transport.sql @@ -45,19 +45,19 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type (@ENTRY*100,9,3,0,0,0,100,0,3000,3000,0,0,5,5,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Sky-Captain Blastnut emote'), (@ENTRY*100,9,4,0,0,0,100,0,1000,1000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Chief Officer Ograh emote'), -- Script 1 -(@ENTRY*100+1,9,0,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Sky-Captain Blastnut Say 1'), -(@ENTRY*100+1,9,1,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Chief Officer Ograh Say 0'), -(@ENTRY*100+1,9,2,0,0,0,100,0,4000,4000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Chief Officer Ograh emote'), +(@ENTRY*100+1,9,0,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: - Script Leave Orgrimmar - Sky-Captain Blastnut Say 1'), +(@ENTRY*100+1,9,1,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Leave Orgrimmar - Chief Officer Ograh Say 0'), +(@ENTRY*100+1,9,2,0,0,0,100,0,4000,4000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Leave Orgrimmar - Chief Officer Ograh emote'), -- Script 2 -(@ENTRY*100+2,9,0,0,0,0,100,0,0,0,0,0,1,2,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Sky-Captain Blastnut Say 2'), -(@ENTRY*100+2,9,1,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Chief Officer Ograh Say 1'), -(@ENTRY*100+2,9,2,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,19,34766,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Krendle Bigpockets Say 0'), -(@ENTRY*100+2,9,3,0,0,0,100,0,3000,3000,0,0,5,5,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Sky-Captain Blastnut emote'), -(@ENTRY*100+2,9,4,0,0,0,100,0,1000,1000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Chief Officer Ograh emote'), +(@ENTRY*100+2,9,0,0,0,0,100,0,0,0,0,0,1,2,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: - Script Dock Thunder Bluff - Sky-Captain Blastnut Say 2'), +(@ENTRY*100+2,9,1,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Dock Thunder Bluff - Chief Officer Ograh Say 1'), +(@ENTRY*100+2,9,2,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,19,34766,100,0,0,0,0,0,'Zeppelin: - Script Dock Thunder Bluff - Krendle Bigpockets Say 0'), +(@ENTRY*100+2,9,3,0,0,0,100,0,3000,3000,0,0,5,5,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: - Script Dock Thunder Bluff - Sky-Captain Blastnut emote'), +(@ENTRY*100+2,9,4,0,0,0,100,0,1000,1000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Dock Thunder Bluff - Chief Officer Ograh emote'), -- Script 3 -(@ENTRY*100+3,9,0,0,0,0,100,0,0,0,0,0,1,3,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Sky-Captain Blastnut Say 3'), -(@ENTRY*100+3,9,1,0,0,0,100,0,0,0,0,0,1,2,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Chief Officer Ograh Say 2'), -(@ENTRY*100+3,9,2,0,0,0,100,0,4000,4000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Dock Orgrimmar - Chief Officer Ograh emote'); +(@ENTRY*100+3,9,0,0,0,0,100,0,0,0,0,0,1,3,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: - Script Leave Thunder Bluff - Sky-Captain Blastnut Say 3'), +(@ENTRY*100+3,9,1,0,0,0,100,0,0,0,0,0,1,2,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Leave Thunder Bluff - Chief Officer Ograh Say 2'), +(@ENTRY*100+3,9,2,0,0,0,100,0,4000,4000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: - Script Leave Thunder Bluff - Chief Officer Ograh emote'); -- Watcher Tolwe SAI SET @ENTRY := 34723; UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; @@ -76,7 +76,7 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr (34715,2,0,'Watch your step! Don''t want you becoming a smudge down there. Welcome to Thunder Bluff!',12,1,100,1,0,0,'Sky-Captain Blastnut - Dock at Thunder Bluff'), -- wait 3 sec do emote 5 (34715,3,0,'Okay, boys, let''s get this baby over to Orgrimmar!',12,1,100,25,0,0,'Sky-Captain Blastnut - Leave for Orgrimmar'), (34721,0,0,'Move it, Zippik! We don''t have all day!',12,1,100,5,0,0,'Chief Officer Ograh - Leave for Thunder Bluff'), -(34721,1,0,'Careful. CAREFUL! Did I feel a shudder? You''re going to knock that tower down, oaf!',12,1,100,5,0,0,'Chief Officer Ograh - Dock at Thunder Bluff'), -- wait 4 sec do emote 25 +(34721,1,0,'Careful. CAREFUL! Did I feel a shudder? You''re going to knock that tower down, oaf!',12,1,100,5,0,0,'Chief Officer Ograh - Dock at Orgrimmar & Thunder Bluff'), (34721,2,0,'We''re behind schedule! Turn this tub east! EAST!',12,1,100,5,0,0,'Chief Officer Ograh - Leave for Orgrimmar'), (34766,0,0,'Step right up! The zeppelin to Orgrimmar has arrived! All aboard to Durotar!',14,0,100,22,0,11804,'Krendle Bigpockets - Dock at Thunder Bluff'), (34765,0,0,'The zeppelin to Thunder Bluff has arrived! All aboard for a smooth ride across the Barrens!',14,0,100,22,0,11804,'Zelli Hotnozzle - Dock at Orgrimmar'); diff --git a/sql/updates/world/2012_06_24_00_world_quest.sql b/sql/updates/world/2012_06_24_01_world_quest.sql similarity index 100% rename from sql/updates/world/2012_06_24_00_world_quest.sql rename to sql/updates/world/2012_06_24_01_world_quest.sql From 12b46945dbf2866a9f6df600348ba3247c9bd0d9 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 26 Jun 2012 01:19:23 +0200 Subject: [PATCH 1105/1149] Scripts/Icecrown Citadel: Added floating souls visual in The Spire after teleport to The Lich King becomes available (killing 11/12 bosses) --- .../world/2012_06_26_01_world_creature.sql | 61 +++++++++++++ .../IcecrownCitadel/icecrown_citadel.cpp | 85 +++++++++++++++++++ .../IcecrownCitadel/icecrown_citadel.h | 5 ++ .../instance_icecrown_citadel.cpp | 40 +++++++++ 4 files changed, 191 insertions(+) create mode 100644 sql/updates/world/2012_06_26_01_world_creature.sql diff --git a/sql/updates/world/2012_06_26_01_world_creature.sql b/sql/updates/world/2012_06_26_01_world_creature.sql new file mode 100644 index 00000000000..1f0dfff0b04 --- /dev/null +++ b/sql/updates/world/2012_06_26_01_world_creature.sql @@ -0,0 +1,61 @@ +UPDATE `creature_template` SET `InhabitType`=4,`flags_extra`=128,`unit_flags`=0x2000000,`ScriptName`='npc_arthas_teleport_visual' WHERE `entry`=30298; -- Invisible Stalker (Float, Uninteractible, LargeAOI) + +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_icc_soul_missile'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(72585,'spell_icc_soul_missile'); + +DELETE FROM `creature_template_addon` WHERE `entry`=30298; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`auras`) VALUES +(30298,0,0x0,0x1,''); -- Invisible Stalker (Float, Uninteractible, LargeAOI) + +SET @CGUID:=88653; +DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+47; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`MovementType`) VALUES +(@CGUID+00,30298,631,15,1,4357.052,2769.421,356.1364,3.141593,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+01,30298,631,15,1,4308.511,2788.476,312.6750,3.263766,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+02,30298,631,15,1,4292.898,2793.981,310.8101,1.640610,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+03,30298,631,15,1,4306.854,2752.771,299.1382,0.820304,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+04,30298,631,15,1,4317.904,2743.047,299.1328,0.820304,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+05,30298,631,15,1,4319.273,2799.125,299.1442,5.567600,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+06,30298,631,15,1,4312.229,2735.825,299.1255,0.820304,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+07,30298,631,15,1,4295.093,2743.372,299.1294,0.820304,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+08,30298,631,15,1,4342.194,2719.366,312.6750,4.799655,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+09,30298,631,15,1,4284.044,2753.073,299.1465,0.820304,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+10,30298,631,15,1,4331.980,2730.547,299.1442,0.820304,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+11,30298,631,15,1,4331.183,2813.701,299.1328,5.567600,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+12,30298,631,15,1,4292.952,2807.547,299.1372,5.567600,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+13,30298,631,15,1,4284.188,2735.236,299.1377,0.820304,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+14,30298,631,15,1,4323.733,2819.085,299.1255,5.567600,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+15,30298,631,15,1,4308.430,2717.113,299.1333,0.820304,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+16,30298,631,15,1,4304.886,2822.116,299.1333,5.567600,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+17,30298,631,15,1,4336.049,2703.986,310.8101,3.176499,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+18,30298,631,15,1,4430.367,2800.603,299.1377,3.909538,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+19,30298,631,15,1,4432.948,2749.438,307.1431,4.799655,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+20,30298,631,15,1,4340.452,2825.148,299.1382,5.567600,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+21,30298,631,15,1,4322.498,2704.592,299.1372,0.820304,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+22,30298,631,15,1,4380.124,2816.074,312.6750,6.265732,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+23,30298,631,15,1,4330.582,2836.512,299.1294,5.567600,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+24,30298,631,15,1,4418.384,2734.435,299.1372,2.443461,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+25,30298,631,15,1,4429.439,2782.781,299.1465,3.909538,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+26,30298,631,15,1,4380.205,2727.930,299.1328,2.443461,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+27,30298,631,15,1,4371.056,2716.414,299.1382,2.443461,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+28,30298,631,15,1,4399.571,2746.277,312.6750,4.799655,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+29,30298,631,15,1,4382.944,2808.139,299.1442,3.909538,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+30,30298,631,15,1,4389.698,2694.647,299.1377,2.443461,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+31,30298,631,15,1,4336.760,2689.307,307.1431,3.176499,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+32,30298,631,15,1,4391.995,2742.610,299.1442,2.443461,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+33,30298,631,15,1,4322.008,2847.075,299.1377,5.567600,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+34,30298,631,15,1,4396.241,2794.807,299.1328,3.909538,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+35,30298,631,15,1,4380.467,2834.892,310.8101,6.265732,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+36,30298,631,15,1,4337.707,2850.425,299.1465,5.567600,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+37,30298,631,15,1,4392.823,2719.806,299.1255,2.443461,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+38,30298,631,15,1,4406.686,2784.457,299.1382,3.909538,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+39,30298,631,15,1,4381.028,2705.133,299.1294,2.443461,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+40,30298,631,15,1,4371.884,2693.614,299.1465,2.443461,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+41,30298,631,15,1,4405.702,2806.464,299.1255,3.909538,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+42,30298,631,15,1,4418.314,2747.997,310.8101,4.799655,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+43,30298,631,15,1,4380.639,2849.595,307.1431,6.265732,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+44,30298,631,15,1,4393.958,2833.470,299.1372,3.909538,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+45,30298,631,15,1,4406.588,2719.758,299.1333,2.443461,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+46,30298,631,15,1,4407.252,2820.139,299.1333,3.909538,7200,0,0), -- Invisible Stalker (Float, Uninteractible, LargeAOI) +(@CGUID+47,30298,631,15,1,4418.995,2793.132,299.1294,3.909538,7200,0,0); -- Invisible Stalker (Float, Uninteractible, LargeAOI) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 6fd3cd2a294..9cfacebf224 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -158,6 +158,9 @@ enum Spells SPELL_FEL_IRON_BOMB_UNDEAD = 71787, SPELL_MACHINE_GUN_UNDEAD = 71788, SPELL_ROCKET_LAUNCH_UNDEAD = 71786, + + // Invisible Stalker (Float, Uninteractible, LargeAOI) + SPELL_SOUL_MISSILE = 72585, }; // Helper defines @@ -248,6 +251,9 @@ enum EventTypes EVENT_RUPERT_FEL_IRON_BOMB = 52, EVENT_RUPERT_MACHINE_GUN = 53, EVENT_RUPERT_ROCKET_LAUNCH = 54, + + // Invisible Stalker (Float, Uninteractible, LargeAOI) + EVENT_SOUL_MISSILE = 55, }; enum DataTypesICC @@ -1668,6 +1674,56 @@ class npc_impaling_spear : public CreatureScript } }; +class npc_arthas_teleport_visual : public CreatureScript +{ + public: + npc_arthas_teleport_visual() : CreatureScript("npc_arthas_teleport_visual") { } + + struct npc_arthas_teleport_visualAI : public NullCreatureAI + { + npc_arthas_teleport_visualAI(Creature* creature) : NullCreatureAI(creature), _instance(creature->GetInstanceScript()) + { + } + + void Reset() + { + _events.Reset(); + if (_instance->GetBossState(DATA_PROFESSOR_PUTRICIDE) == DONE && + _instance->GetBossState(DATA_BLOOD_QUEEN_LANA_THEL) == DONE && + _instance->GetBossState(DATA_SINDRAGOSA) == DONE) + _events.ScheduleEvent(EVENT_SOUL_MISSILE, urand(1000, 6000)); + } + + void UpdateAI(uint32 const diff) + { + if (_events.Empty()) + return; + + _events.Update(diff); + + if (_events.ExecuteEvent() == EVENT_SOUL_MISSILE) + { + DoCastAOE(SPELL_SOUL_MISSILE); + _events.ScheduleEvent(EVENT_SOUL_MISSILE, urand(5000, 7000)); + } + } + + private: + InstanceScript* _instance; + EventMap _events; + }; + + CreatureAI* GetAI(Creature* creature) const + { + // Distance from the center of the spire + if (creature->GetExactDist2d(4357.052f, 2769.421f) < 100.0f && creature->GetHomePosition().GetPositionZ() < 315.0f) + return GetIcecrownCitadelAI(creature); + + // Default to no script + return NULL; + } +}; + class spell_icc_stoneform : public SpellScriptLoader { public: @@ -1974,6 +2030,33 @@ class spell_svalna_remove_spear : public SpellScriptLoader } }; +class spell_icc_soul_missile : public SpellScriptLoader +{ + public: + spell_icc_soul_missile() : SpellScriptLoader("spell_icc_soul_missile") { } + + class spell_icc_soul_missile_SpellScript : public SpellScript + { + PrepareSpellScript(spell_icc_soul_missile_SpellScript); + + void RelocateDest() + { + static Position const offset = {0.0f, 0.0f, 200.0f, 0.0f}; + const_cast(GetExplTargetDest())->RelocateOffset(offset); + } + + void Register() + { + OnCast += SpellCastFn(spell_icc_soul_missile_SpellScript::RelocateDest); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_icc_soul_missile_SpellScript(); + } +}; + class at_icc_saurfang_portal : public AreaTriggerScript { public: @@ -2063,6 +2146,7 @@ void AddSC_icecrown_citadel() new npc_captain_rupert(); new npc_frostwing_vrykul(); new npc_impaling_spear(); + new npc_arthas_teleport_visual(); new spell_icc_stoneform(); new spell_icc_sprit_alarm(); new spell_frost_giant_death_plague(); @@ -2070,6 +2154,7 @@ void AddSC_icecrown_citadel() new spell_trigger_spell_from_caster("spell_svalna_caress_of_death", SPELL_IMPALING_SPEAR_KILL); new spell_svalna_revive_champion(); new spell_svalna_remove_spear(); + new spell_icc_soul_missile(); new at_icc_saurfang_portal(); new at_icc_shutdown_traps(); new at_icc_start_blood_quickening(); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h index 224777c3db7..31639a698ef 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h @@ -51,6 +51,7 @@ enum SharedSpells SPELL_GREEN_BLIGHT_RESIDUE = 72145, // The Lich King + SPELL_ARTHAS_TELEPORTER_CEREMONY = 72915, SPELL_FROSTMOURNE_TELEPORT_VISUAL = 73078, }; @@ -275,6 +276,9 @@ enum CreaturesIds NPC_WORLD_TRIGGER_INFINITE_AOI = 36171, NPC_SPIRIT_BOMB = 39189, NPC_FROSTMOURNE_TRIGGER = 38584, + + // Generic + NPC_INVISIBLE_STALKER = 30298, }; enum GameObjectsIds @@ -345,6 +349,7 @@ enum GameObjectsIds GO_SIGIL_OF_THE_FROSTWING = 202181, // The Lich King + GO_SCOURGE_TRANSPORTER_LK = 202223, GO_ARTHAS_PLATFORM = 202161, GO_ARTHAS_PRECIPICE = 202078, GO_DOODAD_ICECROWN_THRONEFROSTYWIND01 = 202188, diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index 270f56674eb..650f426d29c 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -130,6 +130,7 @@ class instance_icecrown_citadel : public InstanceMapScript SindragosaGUID = 0; SpinestalkerGUID = 0; RimefangGUID = 0; + TheLichKingTeleportGUID = 0; TheLichKingGUID = 0; HighlordTirionFordringGUID = 0; TerenasMenethilGUID = 0; @@ -280,6 +281,11 @@ class instance_icecrown_citadel : public InstanceMapScript case NPC_RIMEFANG: RimefangGUID = creature->GetGUID(); break; + case NPC_INVISIBLE_STALKER: + // Teleporter visual at center + if (creature->GetExactDist2d(4357.052f, 2769.421f) < 10.0f) + creature->CastSpell(creature, SPELL_ARTHAS_TELEPORTER_CEREMONY, false); + break; case NPC_THE_LICH_KING: TheLichKingGUID = creature->GetGUID(); break; @@ -505,6 +511,11 @@ class instance_icecrown_citadel : public InstanceMapScript go->SetLootRecipient(valithria->GetLootRecipient()); go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED | GO_FLAG_NOT_SELECTABLE | GO_FLAG_NODESPAWN); break; + case GO_SCOURGE_TRANSPORTER_LK: + TheLichKingTeleportGUID = go->GetGUID(); + if (GetBossState(DATA_PROFESSOR_PUTRICIDE) == DONE && GetBossState(DATA_BLOOD_QUEEN_LANA_THEL) == DONE && GetBossState(DATA_SINDRAGOSA) == DONE) + go->SetGoState(GO_STATE_ACTIVE); + break; case GO_ARTHAS_PLATFORM: // this enables movement at The Frozen Throne, when printed this value is 0.000000f // however, when represented as integer client will accept only this value @@ -743,6 +754,8 @@ class instance_icecrown_citadel : public InstanceMapScript break; case DATA_PROFESSOR_PUTRICIDE: HandleGameObject(PlagueSigilGUID, state != DONE); + if (state == DONE) + CheckLichKingAvailability(); if (instance->IsHeroic()) { if (state == FAIL && HeroicAttempts) @@ -757,6 +770,8 @@ class instance_icecrown_citadel : public InstanceMapScript break; case DATA_BLOOD_QUEEN_LANA_THEL: HandleGameObject(BloodwingSigilGUID, state != DONE); + if (state == DONE) + CheckLichKingAvailability(); if (instance->IsHeroic()) { if (state == FAIL && HeroicAttempts) @@ -775,6 +790,8 @@ class instance_icecrown_citadel : public InstanceMapScript break; case DATA_SINDRAGOSA: HandleGameObject(FrostwingSigilGUID, state != DONE); + if (state == DONE) + CheckLichKingAvailability(); if (instance->IsHeroic()) { if (state == FAIL && HeroicAttempts) @@ -1065,6 +1082,28 @@ class instance_icecrown_citadel : public InstanceMapScript return true; } + void CheckLichKingAvailability() + { + if (GetBossState(DATA_PROFESSOR_PUTRICIDE) == DONE && GetBossState(DATA_BLOOD_QUEEN_LANA_THEL) == DONE && GetBossState(DATA_SINDRAGOSA) == DONE) + { + if (GameObject* teleporter = instance->GetGameObject(TheLichKingTeleportGUID)) + { + teleporter->SetGoState(GO_STATE_ACTIVE); + + std::list stalkers; + GetCreatureListWithEntryInGrid(stalkers, teleporter, NPC_INVISIBLE_STALKER, 100.0f); + if (stalkers.empty()) + return; + + stalkers.sort(Trinity::ObjectDistanceOrderPred(teleporter)); + stalkers.front()->CastSpell((Unit*)NULL, SPELL_ARTHAS_TELEPORTER_CEREMONY, false); + stalkers.pop_front(); + for (std::list::iterator itr = stalkers.begin(); itr != stalkers.end(); ++itr) + (*itr)->AI()->Reset(); + } + } + } + std::string GetSaveData() { OUT_SAVE_INST_DATA; @@ -1246,6 +1285,7 @@ class instance_icecrown_citadel : public InstanceMapScript uint64 SindragosaGUID; uint64 SpinestalkerGUID; uint64 RimefangGUID; + uint64 TheLichKingTeleportGUID; uint64 TheLichKingGUID; uint64 HighlordTirionFordringGUID; uint64 TerenasMenethilGUID; From 1bddb4eaf448b00a14b16dd67cc4c2f2adf5135b Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 26 Jun 2012 01:31:55 +0200 Subject: [PATCH 1106/1149] Fixed compile without PCH --- .../scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 9cfacebf224..46e8c1428e4 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -19,6 +19,7 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedEscortAI.h" +#include "PassiveAI.h" #include "Cell.h" #include "CellImpl.h" #include "GridNotifiers.h" From 76df7f8281b199f87c181e0d6b0db58cfe58de54 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 25 Jun 2012 21:35:31 -0230 Subject: [PATCH 1107/1149] DB/Gameobject: Add Azuremyst Isle Alliance Mid Summer Festival Go Spawns --- .../world/2012_06_25_01_world_gameobject.sql | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sql/updates/world/2012_06_25_01_world_gameobject.sql diff --git a/sql/updates/world/2012_06_25_01_world_gameobject.sql b/sql/updates/world/2012_06_25_01_world_gameobject.sql new file mode 100644 index 00000000000..5cadd915990 --- /dev/null +++ b/sql/updates/world/2012_06_25_01_world_gameobject.sql @@ -0,0 +1,64 @@ +-- Azuremyst Isle Alliance Mid Summer Festival Go Spawns +SET @OGUID := 70509; +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+47; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(@OGUID+0,181355,530,1,1,-4196.215,-11595.27,-125.4084,1.239183,0,0,0,1,120,255,1), +(@OGUID+1,181355,530,1,1,-4155.241,-11635.47,-98.17558,5.375615,0,0,0,1,120,255,1), +(@OGUID+2,181355,530,1,1,-4200.809,-11604.3,-125.62,0.4712385,0,0,0,1,120,255,1), +(@OGUID+3,181355,530,1,1,-4167.556,-11641.12,-98.394,1.134463,0,0,0,1,120,255,1), +(@OGUID+4,181355,530,1,1,-4229.965,-11608.42,-126.2826,0.8377575,0,0,0,1,120,255,1), +(@OGUID+5,181355,530,1,1,-4207.486,-11645.04,-143.677,0.1047193,0,0,0,1,120,255,1), +(@OGUID+6,181355,530,1,1,-4185.567,-11653.06,-143.4488,5.044002,0,0,0,1,120,255,1), +(@OGUID+7,181355,530,1,1,-4225.973,-11648.08,-143.8641,5.881761,0,0,0,1,120,255,1), +(@OGUID+8,181355,530,1,1,-4244.824,-11657.96,-143.6249,1.727875,0,0,0,1,120,255,1), +(@OGUID+9,181355,530,1,1,-4209.638,-11675.42,-143.2441,5.899214,0,0,0,1,120,255,1), +(@OGUID+10,181355,530,1,1,-4204.821,-11678.49,-143.1916,0.4014249,0,0,0,1,120,255,1), +(@OGUID+11,181355,530,1,1,-4163.965,-11666.74,-143.2581,4.677484,0,0,0,1,120,255,1), +(@OGUID+12,181355,530,1,1,-4253.186,-11675.28,-143.7647,4.677484,0,0,0,1,120,255,1), +(@OGUID+13,181355,530,1,1,-4178.041,-11713.54,-143.6017,0.7853968,0,0,0,1,120,255,1), +(@OGUID+14,181355,530,1,1,-4154.533,-11704.79,-143.3194,5.98648,0,0,0,1,120,255,1), +(@OGUID+15,181355,530,1,1,-4194.735,-11728.54,-143.4515,3.246347,0,0,0,1,120,255,1), +(@OGUID+16,181355,530,1,1,-4186.29,-11803.01,-133.1742,0.6108634,0,0,0,1,120,255,1), +(@OGUID+17,181355,530,1,1,-4228.949,-11818.94,-115.9345,0.802851,0,0,0,1,120,255,1), +(@OGUID+18,181355,530,1,1,-4210.176,-11796.16,-133.2452,1.570796,0,0,0,1,120,255,1), +(@OGUID+19,181355,530,1,1,-4185.515,-11746.04,-132.2725,3.036838,0,0,0,1,120,255,1), +(@OGUID+20,181355,530,1,1,-4221.807,-11830.92,-115.8959,5.305802,0,0,0,1,120,255,1), +(@OGUID+21,181355,530,1,1,-4161.4,-11800.58,-132.1952,4.555311,0,0,0,1,120,255,1), +(@OGUID+22,181355,530,1,1,-4217.298,-12296.37,2.797,4.66003,0,0,0,1,120,255,1), +(@OGUID+23,181355,530,1,1,-4208.977,-12291.46,1.564008,0.8552105,0,0,0,1,120,255,1), +(@OGUID+24,181355,530,1,1,-4231.342,-12311.88,4.430907,4.694937,0,0,0,1,120,255,1), +(@OGUID+25,181355,530,1,1,-4236.268,-12321.97,3.524465,0.5410506,0,0,0,1,120,255,1), +(@OGUID+26,181355,530,1,1,-4191.353,-12302.24,0.068963,3.211419,0,0,0,1,120,255,1), +(@OGUID+27,181355,530,1,1,-4196.024,-12313.57,0.370297,0.1745321,0,0,0,1,120,255,1), +(@OGUID+28,181355,530,1,1,-4215.688,-12343.17,5.164443,1.186823,0,0,0,1,120,255,1), +(@OGUID+29,181355,530,1,1,-4234.849,-12332.25,4.627616,5.846854,0,0,0,1,120,255,1), +(@OGUID+30,181355,530,1,1,-4207.028,-12336.08,2.900289,5.201083,0,0,0,1,120,255,1), +(@OGUID+31,181355,530,1,1,-4214.633,-12476,45.07409,5.497789,0,0,0,1,120,255,1), +(@OGUID+32,181302,530,1,1,-4224.03,-12301.6,4.06688,6.248279,0,0,0,1,120,255,1), +(@OGUID+33,181302,530,1,1,-4225.604,-12301.49,4.273456,1.937312,0,0,0,1,120,255,1), +(@OGUID+34,181305,530,1,1,-4219.088,-12304.94,2.68953,0.1396245,0,0,0,1,120,255,1), +(@OGUID+35,181306,530,1,1,-4224.28,-12299.62,4.223075,2.478367,0,0,0,1,120,255,1), +(@OGUID+36,181307,530,1,1,-4219.073,-12304.1,3.637502,0.01745246,0,0,0,1,120,255,1), +(@OGUID+37,181605,530,1,1,-4204.668,-12321.07,2.198824,5.777041,0,0,0,1,120,255,1), +(@OGUID+38,187917,530,1,1,-4223.843,-12318.37,2.47695,2.932139,0,0,0,1,120,255,1), +(@OGUID+39,188020,530,1,1,-4205.284,-12290.93,1.317262,0.7330382,0,0,0,1,120,255,1), +(@OGUID+40,188020,530,1,1,-4193.06,-12298.27,0.561426,0.9075702,0,0,0,1,120,255,1), +(@OGUID+41,188020,530,1,1,-4218.465,-12342.38,5.182833,1.361356,0,0,0,1,120,255,1), +(@OGUID+42,188020,530,1,1,-4231.875,-12334.86,4.329966,1.378809,0,0,0,1,120,255,1), +(@OGUID+43,188021,530,1,1,-4221.665,-12306.13,2.295757,5.654869,0,0,0,1,120,255,1), +(@OGUID+44,187667,530,1,1,-4216.924,-12483.89,48.3932,6.230826,0,0,0,1,120,255,1), +(@OGUID+45,187667,530,1,1,-4216.502,-12480.64,48.98628,6.213374,0,0,0,1,120,255,1), +(@OGUID+46,181392,530,1,1,-4213.729,-11685.4,-130.8234,0.9424766,0,0,0,1,120,255,1), +(@OGUID+47,181392,530,1,1,-4145.799,-11745.62,-124.1529,2.024579,0,0,0,1,120,255,1); +DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+47; +INSERT INTO `game_event_gameobject` (`eventEntry`,`guid`) VALUES +(1,@OGUID+0),(1,@OGUID+1),(1,@OGUID+2),(1,@OGUID+3),(1,@OGUID+4), +(1,@OGUID+5),(1,@OGUID+6),(1,@OGUID+7),(1,@OGUID+8),(1,@OGUID+9), +(1,@OGUID+10),(1,@OGUID+11),(1,@OGUID+12),(1,@OGUID+13),(1,@OGUID+14), +(1,@OGUID+15),(1,@OGUID+16),(1,@OGUID+17),(1,@OGUID+18),(1,@OGUID+19), +(1,@OGUID+20),(1,@OGUID+21),(1,@OGUID+22),(1,@OGUID+23),(1,@OGUID+24), +(1,@OGUID+25),(1,@OGUID+26),(1,@OGUID+27),(1,@OGUID+28),(1,@OGUID+29), +(1,@OGUID+30),(1,@OGUID+31),(1,@OGUID+32),(1,@OGUID+33),(1,@OGUID+34), +(1,@OGUID+35),(1,@OGUID+36),(1,@OGUID+37),(1,@OGUID+38),(1,@OGUID+39), +(1,@OGUID+40),(1,@OGUID+41),(1,@OGUID+42),(1,@OGUID+43),(1,@OGUID+44), +(1,@OGUID+45),(1,@OGUID+46),(1,@OGUID+47); From da8c039f0a4be24079367343fbc116cfd3ac4432 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 25 Jun 2012 22:38:28 -0230 Subject: [PATCH 1108/1149] DB/Gameobject: Blades Edge Alliance & Horde Mid Summer Festival Go Spawns --- .../world/2012_06_25_02_world_gameobject.sql | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sql/updates/world/2012_06_25_02_world_gameobject.sql diff --git a/sql/updates/world/2012_06_25_02_world_gameobject.sql b/sql/updates/world/2012_06_25_02_world_gameobject.sql new file mode 100644 index 00000000000..f526f071bac --- /dev/null +++ b/sql/updates/world/2012_06_25_02_world_gameobject.sql @@ -0,0 +1,85 @@ +-- Blades Edge Alliance Mid Summer Festival Go Spawns +SET @OGUID := 70557; +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+37; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(@OGUID+0,187576,530,1,1,1989.314,6784.465,167.9164,4.537859,0,0,0,1,120,255,1), +(@OGUID+1,181391,530,1,1,1989.554,6785.711,165.7517,4.607672,0,0,0,1,120,255,1), +(@OGUID+2,181392,530,1,1,1955.625,6885.821,167.1296,4.468043,0,0,0,1,120,255,1), +(@OGUID+3,181392,530,1,1,2032.214,6819.37,181.5125,3.874631,0,0,0,1,120,255,1), +(@OGUID+4,181392,530,1,1,2031.963,6825.553,181.5333,2.426008,0,0,0,1,120,255,1), +(@OGUID+5,181392,530,1,1,2038.565,6819.838,181.4885,5.550147,0,0,0,1,120,255,1), +(@OGUID+6,181392,530,1,1,2038.027,6826.094,181.4816,0.8377575,0,0,0,1,120,255,1), +(@OGUID+7,181392,530,1,1,2063.305,6759.898,173.2681,4.694937,0,0,0,1,120,255,1), +(@OGUID+8,181392,530,1,1,2062.016,6825.854,184.7832,4.729844,0,0,0,1,120,255,1), +(@OGUID+9,181393,530,1,1,2051.89,6831.638,177.0355,1.588249,0,0,0,1,120,255,1), +(@OGUID+10,181393,530,1,1,2072.185,6832.028,176.9799,1.588249,0,0,0,1,120,255,1), +(@OGUID+11,181401,530,1,1,2055.827,6759.792,173.2742,4.729844,0,0,0,1,120,255,1), +(@OGUID+12,181401,530,1,1,2066.258,6730.639,181.5167,1.518436,0,0,0,1,120,255,1), +(@OGUID+13,181401,530,1,1,2070.803,6759.671,173.2742,4.694937,0,0,0,1,120,255,1), +(@OGUID+14,181401,530,1,1,2066.148,6726.275,181.5531,4.747296,0,0,0,1,120,255,1), +(@OGUID+15,181401,530,1,1,1937.434,6838.64,177.4422,3.194002,0,0,0,1,120,255,1), +(@OGUID+16,181401,530,1,1,1941.395,6838.657,177.4772,0.01745246,0,0,0,1,120,255,1), +(@OGUID+17,181302,530,1,1,2023.801,6594.566,135.5013,2.949595,0,0,0,1,120,255,1), +(@OGUID+18,181302,530,1,1,2021.781,6590.525,135.2787,1.989672,0,0,0,1,120,255,1), +(@OGUID+19,181305,530,1,1,2018.895,6592.329,135.5139,6.126106,0,0,0,1,120,255,1), +(@OGUID+20,181306,530,1,1,2022.451,6595.768,135.6441,2.007128,0,0,0,1,120,255,1), +(@OGUID+21,181307,530,1,1,2018.828,6591.42,136.4855,1.658062,0,0,0,1,120,255,1), +(@OGUID+22,181355,530,1,1,2021.774,6603.31,136.6191,0.1745321,0,0,0,1,120,255,1), +(@OGUID+23,181355,530,1,1,2030.021,6607.951,137.7898,3.211419,0,0,0,1,120,255,1), +(@OGUID+24,181355,530,1,1,2049.479,6600.245,137.5444,1.186823,0,0,0,1,120,255,1), +(@OGUID+25,181355,530,1,1,2017.946,6573.733,135.3068,4.66003,0,0,0,1,120,255,1), +(@OGUID+26,181355,530,1,1,2051.807,6590.619,136.7025,5.201083,0,0,0,1,120,255,1), +(@OGUID+27,181355,530,1,1,2022.703,6566.989,133.5423,0.8552105,0,0,0,1,120,255,1), +(@OGUID+28,181355,530,1,1,2049.964,6570.623,135.499,0.5410506,0,0,0,1,120,255,1), +(@OGUID+29,181355,530,1,1,2046.616,6564.632,134.1706,5.846854,0,0,0,1,120,255,1), +(@OGUID+30,181355,530,1,1,2046.616,6564.632,134.1706,5.846854,0,0,0,1,120,255,1), +(@OGUID+31,188020,530,1,1,2035.179,6608.052,137.9502,0.7330382,0,0,0,1,120,255,1), +(@OGUID+32,188020,530,1,1,2045.668,6604.812,137.8742,1.518436,0,0,0,1,120,255,1), +(@OGUID+33,188020,530,1,1,2024.833,6565.631,133.425,1.378809,0,0,0,1,120,255,1), +(@OGUID+34,188020,530,1,1,2042.706,6563.491,133.4392,1.361356,0,0,0,1,120,255,1), +(@OGUID+35,188021,530,1,1,2021.064,6593.522,135.1495,6.03884,0,0,0,1,120,255,1), +(@OGUID+36,181605,530,1,1,2046.226,6579.709,135.2484,5.777041,0,0,0,1,120,255,1), +(@OGUID+37,187919,530,1,1,2019.803,6580.186,134.3619,1.937312,0,0,0,1,120,255,1); +DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+37; +INSERT INTO `game_event_gameobject` (`eventEntry`,`guid`) VALUES +(1,@OGUID+0),(1,@OGUID+1),(1,@OGUID+2),(1,@OGUID+3),(1,@OGUID+4), +(1,@OGUID+5),(1,@OGUID+6),(1,@OGUID+7),(1,@OGUID+8),(1,@OGUID+9), +(1,@OGUID+10),(1,@OGUID+11),(1,@OGUID+12),(1,@OGUID+13),(1,@OGUID+14), +(1,@OGUID+15),(1,@OGUID+16),(1,@OGUID+17),(1,@OGUID+18),(1,@OGUID+19), +(1,@OGUID+20),(1,@OGUID+21),(1,@OGUID+22),(1,@OGUID+23),(1,@OGUID+24), +(1,@OGUID+25),(1,@OGUID+26),(1,@OGUID+27),(1,@OGUID+28),(1,@OGUID+29), +(1,@OGUID+30),(1,@OGUID+31),(1,@OGUID+32),(1,@OGUID+33),(1,@OGUID+34), +(1,@OGUID+35),(1,@OGUID+36),(1,@OGUID+37); + +-- Blades Edge Horde Mid Summer Festival Go Spawns +SET @OGUID := 21478; +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+20; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(@OGUID+0,181302,530,1,1,2286.953,6131.723,135.8838,0.1047193,0,0,0,1,120,255,1), +(@OGUID+1,181302,530,1,1,2286.061,6134.23,136.0696,4.782203,0,0,0,1,120,255,1), +(@OGUID+2,181305,530,1,1,2290.526,6135.19,135.9771,4.590216,0,0,0,1,120,255,1), +(@OGUID+3,181306,530,1,1,2289.731,6131.177,135.6796,4.956738,0,0,0,1,120,255,1), +(@OGUID+4,181307,530,1,1,2286.542,6131.368,135.8867,0.5934101,0,0,0,1,120,255,1), +(@OGUID+5,181355,530,1,1,2258.801,6129.346,137.7461,0.8552105,0,0,0,1,120,255,1), +(@OGUID+6,181355,530,1,1,2268.304,6125.965,137.2221,4.66003,0,0,0,1,120,255,1), +(@OGUID+7,181355,530,1,1,2255.936,6152.005,139.28,5.846854,0,0,0,1,120,255,1), +(@OGUID+8,181355,530,1,1,2266.464,6158.563,138.4691,0.5410506,0,0,0,1,120,255,1), +(@OGUID+9,181355,530,1,1,2277.704,6161.832,137.9124,0.5934101,0,0,0,1,120,255,1), +(@OGUID+10,181355,530,1,1,2298.375,6131.026,135.5555,5.201083,0,0,0,1,120,255,1), +(@OGUID+11,181355,530,1,1,2303.753,6135.784,135.0607,1.186823,0,0,0,1,120,255,1), +(@OGUID+12,181355,530,1,1,2293.306,6163.847,136.1624,0.1745321,0,0,0,1,120,255,1), +(@OGUID+13,181355,530,1,1,2302.233,6162.095,135.2117,3.211419,0,0,0,1,120,255,1), +(@OGUID+14,188020,530,1,1,2258.107,6132.874,137.3437,3.298687,0,0,0,1,120,255,1), +(@OGUID+15,188020,530,1,1,2255.474,6148.87,138.3934,3.717554,0,0,0,1,120,255,1), +(@OGUID+16,188020,530,1,1,2304.146,6139.788,134.4674,0.05235888,0,0,0,1,120,255,1), +(@OGUID+17,188020,530,1,1,2303.354,6158.675,134.4655,6.126106,0,0,0,1,120,255,1), +(@OGUID+18,188021,530,1,1,2289.121,6132.534,135.8388,1.640607,0,0,0,1,120,255,1), +(@OGUID+19,181605,530,1,1,2285.147,6157.909,136.2808,5.777041,0,0,0,1,120,255,1), +(@OGUID+20,187955,530,1,1,2274.421,6133.031,136.9586,3.036838,0,0,0,1,120,255,1); +DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+20; +INSERT INTO `game_event_gameobject` (`eventEntry`,`guid`) VALUES +(1,@OGUID+0),(1,@OGUID+1),(1,@OGUID+2),(1,@OGUID+3),(1,@OGUID+4), +(1,@OGUID+5),(1,@OGUID+6),(1,@OGUID+7),(1,@OGUID+8),(1,@OGUID+9), +(1,@OGUID+10),(1,@OGUID+11),(1,@OGUID+12),(1,@OGUID+13),(1,@OGUID+14), +(1,@OGUID+15),(1,@OGUID+16),(1,@OGUID+17),(1,@OGUID+18),(1,@OGUID+19), +(1,@OGUID+20); From d014f7fcedce79165d63f2796c6ea64285d74ac6 Mon Sep 17 00:00:00 2001 From: Exodius Date: Tue, 26 Jun 2012 21:07:07 +0200 Subject: [PATCH 1109/1149] DB/Loot: Add missing recipe and replace a furious weapon with the correct item Closes #6925,#6924 --- .../world/2012_06_26_02_world_creature_loot_template.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sql/updates/world/2012_06_26_02_world_creature_loot_template.sql diff --git a/sql/updates/world/2012_06_26_02_world_creature_loot_template.sql b/sql/updates/world/2012_06_26_02_world_creature_loot_template.sql new file mode 100644 index 00000000000..3a704e61bcf --- /dev/null +++ b/sql/updates/world/2012_06_26_02_world_creature_loot_template.sql @@ -0,0 +1,6 @@ +-- Replace Furious Weapon drop with drop that should be in the Cache of Living Stone +UPDATE `reference_loot_template` SET `item` =45695 WHERE (`entry` =34361 AND `item` =45965); +-- add missing Recipe: Mighty Shadow Protection Potion on Cultist Shard Watcher +DELETE FROM `creature_loot_template` WHERE `entry`=32349 AND `item`=44568; +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(32349,44568,0.5,1,0,1,1); From e43b50b415cc562df3b453bee8291dedfcfd09d0 Mon Sep 17 00:00:00 2001 From: Faq Date: Wed, 27 Jun 2012 00:12:07 +0300 Subject: [PATCH 1110/1149] Death Knight T10 Tank 2P Bonus. Thnx Shauren --- src/server/game/Spells/SpellMgr.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 834da088c56..235c3ccb718 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3268,6 +3268,8 @@ void SpellMgr::LoadDbcDataCorrections() break; case 61719: // Easter Lay Noblegarden Egg Aura - Interrupt flags copied from aura which this aura is linked with spellInfo->AuraInterruptFlags = AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE; + case 70650: // Death Knight T10 Tank 2P Bonus + spellInfo->EffectApplyAuraName[0] = SPELL_AURA_ADD_PCT_MODIFIER; break; // ULDUAR SPELLS // From e5adb05844fe735ae66a99c3d5eb67fc9800c47a Mon Sep 17 00:00:00 2001 From: Faq Date: Wed, 27 Jun 2012 00:28:59 +0300 Subject: [PATCH 1111/1149] missed break :/ --- src/server/game/Spells/SpellMgr.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 235c3ccb718..0b1955a02ec 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3268,6 +3268,7 @@ void SpellMgr::LoadDbcDataCorrections() break; case 61719: // Easter Lay Noblegarden Egg Aura - Interrupt flags copied from aura which this aura is linked with spellInfo->AuraInterruptFlags = AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE; + break; case 70650: // Death Knight T10 Tank 2P Bonus spellInfo->EffectApplyAuraName[0] = SPELL_AURA_ADD_PCT_MODIFIER; break; From 551878ad96c1f4b2882f8e94c248f79576927173 Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 27 Jun 2012 15:04:07 -0400 Subject: [PATCH 1112/1149] Core/Spells: correctly award kill credit for quest the focus on the beach. --- ...2012_06_27_00_world_spell_script_names.sql | 3 ++ src/server/scripts/Spells/spell_quest.cpp | 34 ++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_06_27_00_world_spell_script_names.sql diff --git a/sql/updates/world/2012_06_27_00_world_spell_script_names.sql b/sql/updates/world/2012_06_27_00_world_spell_script_names.sql new file mode 100644 index 00000000000..8210225de6e --- /dev/null +++ b/sql/updates/world/2012_06_27_00_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (50546); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(50546,'spell_q12066_bunny_kill_credit'); diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 810cc20e04b..2f6989b57c9 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -639,7 +639,7 @@ class spell_q12851_going_bearback : public SpellScriptLoader // Already in fire if (target->HasAura(SPELL_ABLAZE)) return; - + if (Player* player = caster->GetCharmerOrOwnerPlayerOrPlayerItself()) { switch (target->GetEntry()) @@ -1162,6 +1162,38 @@ class spell_q12277_wintergarde_mine_explosion : public SpellScriptLoader } }; +enum FocusOnTheBeach +{ + SPELL_BUNNY_CREDIT_BEAM = 47390, +}; + +class spell_q12066_bunny_kill_credit : public SpellScriptLoader +{ +public: + spell_q12066_bunny_kill_credit() : SpellScriptLoader("spell_q12066_bunny_kill_credit") { } + + class spell_q12066_bunny_kill_credit_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q12066_bunny_kill_credit_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Creature* target = GetHitCreature()) + target()->CastSpell(GetCaster(), SPELL_BUNNY_CREDIT_BEAM, false); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_q12066_bunny_kill_credit_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_q12066_bunny_kill_credit_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); From 87db7b246fe1f8cdbd99f37798ff42ef022a70e3 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 27 Jun 2012 23:17:40 +0200 Subject: [PATCH 1113/1149] Fix build --- src/server/scripts/Spells/spell_quest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 2f6989b57c9..66ff06decc3 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1179,7 +1179,7 @@ public: void HandleDummy(SpellEffIndex /*effIndex*/) { if (Creature* target = GetHitCreature()) - target()->CastSpell(GetCaster(), SPELL_BUNNY_CREDIT_BEAM, false); + target->CastSpell(GetCaster(), SPELL_BUNNY_CREDIT_BEAM, false); } void Register() @@ -1221,4 +1221,5 @@ void AddSC_quest_spell_scripts() new spell_q9452_cast_net(); new spell_q12987_read_pronouncement(); new spell_q12277_wintergarde_mine_explosion(); + new spell_q12066_bunny_kill_credit(); } From 5b24fbf2f4b72ecbaf5a8f0b4049d06581f9513b Mon Sep 17 00:00:00 2001 From: mweinelt Date: Wed, 27 Jun 2012 23:32:03 +0100 Subject: [PATCH 1114/1149] DB/Graveyards: Fix Graveyard Link for Shattered Halls Closes #6947 Signed-off-by: Nay --- sql/updates/world/2012_06_27_01_world_game_graveyard_zone.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2012_06_27_01_world_game_graveyard_zone.sql diff --git a/sql/updates/world/2012_06_27_01_world_game_graveyard_zone.sql b/sql/updates/world/2012_06_27_01_world_game_graveyard_zone.sql new file mode 100644 index 00000000000..973a1dc5296 --- /dev/null +++ b/sql/updates/world/2012_06_27_01_world_game_graveyard_zone.sql @@ -0,0 +1,3 @@ +-- fix graveyard for shattered halls, alliance to honor hold, horde to thrallmar, not the other way around +UPDATE `game_graveyard_zone` SET `faction`=67 WHERE `id`=919 AND `ghost_zone`=3714; +UPDATE `game_graveyard_zone` SET `faction`=469 WHERE `id`=920 AND `ghost_zone`=3714; From dfdbc91e908e5bbf780c7db5417b0dc170b8085d Mon Sep 17 00:00:00 2001 From: Elron103 Date: Fri, 29 Jun 2012 00:11:05 +0200 Subject: [PATCH 1115/1149] Core/Spells: Fix spell casting time reduce / increase effects for players and creatures --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index d8e7e1c9717..07b2b9d2260 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13162,7 +13162,7 @@ void Unit::ModSpellCastTime(SpellInfo const* spellProto, int32 & castTime, Spell if (Player* modOwner = GetSpellModOwner()) modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_CASTING_TIME, castTime, spell); - if (!(spellProto->Attributes & (SPELL_ATTR0_ABILITY|SPELL_ATTR0_TRADESPELL)) && spellProto->SpellFamilyName) + if (!(spellProto->Attributes & (SPELL_ATTR0_ABILITY|SPELL_ATTR0_TRADESPELL)) && ((GetTypeId() == TYPEID_PLAYER && spellProto->SpellFamilyName) || GetTypeId() == TYPEID_UNIT)) castTime = int32(float(castTime) * GetFloatValue(UNIT_MOD_CAST_SPEED)); else if (spellProto->Attributes & SPELL_ATTR0_REQ_AMMO && !(spellProto->AttributesEx2 & SPELL_ATTR2_AUTOREPEAT_FLAG)) castTime = int32(float(castTime) * m_modAttackSpeedPct[RANGED_ATTACK]); From 8ba234e2455e0d1fe1c624e297e5f3149e8af986 Mon Sep 17 00:00:00 2001 From: Elron103 Date: Fri, 29 Jun 2012 18:45:18 +0200 Subject: [PATCH 1116/1149] Scripts/Spells: Fix Deathknight ability Death Pact 48743 --- src/server/scripts/Spells/spell_dk.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 38901287e0d..1fbd6bd9145 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -334,6 +334,21 @@ class spell_dk_death_pact : public SpellScriptLoader { PrepareSpellScript(spell_dk_death_pact_SpellScript); + SpellCastResult CheckCast() + { + // Check if we have valid targets, otherwise skip spell casting here + if (Player* player = GetCaster()->ToPlayer()) + for (Unit::ControlList::const_iterator itr = player->m_Controlled.begin(); itr != player->m_Controlled.end(); ++itr) + if (Creature* undeadPet = (*itr)->ToCreature()) + if (undeadPet->isAlive() && + undeadPet->GetOwnerGUID() == player->GetGUID() && + undeadPet->GetCreatureInfo()->type == CREATURE_TYPE_UNDEAD && + undeadPet->IsWithinDist(player, 100.0f, false)) + return SPELL_CAST_OK; + + return SPELL_FAILED_NO_PET; + } + void FilterTargets(std::list& unitList) { Unit* unit_to_add = NULL; @@ -351,17 +366,11 @@ class spell_dk_death_pact : public SpellScriptLoader unitList.clear(); if (unit_to_add) unitList.push_back(unit_to_add); - else - { - // Pet not found - remove cooldown - if (Player* modOwner = GetCaster()->GetSpellModOwner()) - modOwner->RemoveSpellCooldown(GetSpellInfo()->Id, true); - FinishCast(SPELL_FAILED_NO_PET); - } } void Register() { + OnCheckCast += SpellCheckCastFn(spell_dk_death_pact_SpellScript::CheckCast); OnUnitTargetSelect += SpellUnitTargetFn(spell_dk_death_pact_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ALLY); } }; From 6e4da3367aaea8494a903da63e5c009f752e5650 Mon Sep 17 00:00:00 2001 From: Kandera Date: Fri, 29 Jun 2012 13:44:30 -0400 Subject: [PATCH 1117/1149] Core/Spells: fix build and typo from previous commit --- src/server/scripts/Spells/spell_dk.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 1fbd6bd9145..ae887baa413 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -342,7 +342,7 @@ class spell_dk_death_pact : public SpellScriptLoader if (Creature* undeadPet = (*itr)->ToCreature()) if (undeadPet->isAlive() && undeadPet->GetOwnerGUID() == player->GetGUID() && - undeadPet->GetCreatureInfo()->type == CREATURE_TYPE_UNDEAD && + undeadPet->GetCreatureType() == CREATURE_TYPE_UNDEAD && undeadPet->IsWithinDist(player, 100.0f, false)) return SPELL_CAST_OK; From e0997874f5bf8d38b67ad3dee66e3d808dd1a059 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 29 Jun 2012 21:53:35 +0200 Subject: [PATCH 1118/1149] Core/SpellScripts: Changed OnUnitTargetSelect hook to OnObjectAreaTargetSelect, it will now work with WorldObject instead of only Units and call it even for empty target lists --- .../game/Grids/Notifiers/GridNotifiers.h | 7 +- src/server/game/Spells/Spell.cpp | 20 +++--- src/server/game/Spells/Spell.h | 2 +- src/server/game/Spells/SpellScript.cpp | 30 +++++---- src/server/game/Spells/SpellScript.h | 18 +++--- src/server/scripts/Commands/cs_instance.cpp | 2 +- src/server/scripts/Commands/cs_list.cpp | 2 +- .../BattleForMountHyjal/boss_kazrogal.cpp | 13 ++-- .../scripts/Kalimdor/dustwallow_marsh.cpp | 12 ++-- .../RubySanctum/boss_saviana_ragefire.cpp | 12 ++-- .../boss_argent_challenge.cpp | 13 ++-- .../ForgeOfSouls/boss_bronjahm.cpp | 18 +++--- .../boss_blood_queen_lana_thel.cpp | 32 +++++----- .../boss_deathbringer_saurfang.cpp | 38 +++++------ .../IcecrownCitadel/boss_lord_marrowgar.cpp | 4 +- .../boss_professor_putricide.cpp | 44 ++++++------- .../IcecrownCitadel/boss_rotface.cpp | 28 ++++---- .../IcecrownCitadel/boss_sindragosa.cpp | 45 ++++++------- .../IcecrownCitadel/boss_the_lich_king.cpp | 64 ++++++++++--------- .../boss_valithria_dreamwalker.cpp | 6 +- .../IcecrownCitadel/icecrown_citadel.cpp | 46 ++++++------- .../Northrend/Naxxramas/boss_gothik.cpp | 6 +- .../Northrend/Naxxramas/boss_thaddius.cpp | 6 +- .../Northrend/Nexus/Oculus/boss_varos.cpp | 16 ++--- .../Ulduar/HallsOfStone/boss_krystallus.cpp | 2 +- .../Ulduar/boss_algalon_the_observer.cpp | 18 +++--- .../Northrend/Ulduar/Ulduar/boss_auriaya.cpp | 18 +++--- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 12 ++-- .../Northrend/Ulduar/Ulduar/boss_kologarn.cpp | 24 +++---- .../Northrend/Ulduar/Ulduar/boss_xt002.cpp | 8 +-- .../scripts/Northrend/Ulduar/Ulduar/ulduar.h | 6 +- .../UtgardePinnacle/boss_svala.cpp | 12 ++-- .../TempestKeep/Eye/boss_astromancer.cpp | 4 +- .../Mechanar/boss_mechano_lord_capacitus.cpp | 6 +- .../scripts/Outland/boss_doomlord_kazzak.cpp | 2 +- src/server/scripts/Spells/spell_dk.cpp | 13 ++-- src/server/scripts/Spells/spell_druid.cpp | 34 +++++----- src/server/scripts/Spells/spell_paladin.cpp | 4 +- src/server/scripts/Spells/spell_priest.cpp | 6 +- src/server/scripts/Spells/spell_shaman.cpp | 29 +++++---- src/server/scripts/Spells/spell_warlock.cpp | 6 +- src/server/scripts/Spells/spell_warrior.cpp | 4 +- .../scripts/World/boss_emerald_dragons.cpp | 24 +++---- src/server/shared/Packets/ByteBuffer.h | 3 +- 44 files changed, 368 insertions(+), 351 deletions(-) diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 7bb4492f99c..072db578220 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -1325,11 +1325,16 @@ namespace Trinity { public: UnitAuraCheck(bool present, uint32 spellId, uint64 casterGUID = 0) : _present(present), _spellId(spellId), _casterGUID(casterGUID) {} - bool operator()(Unit* unit) + bool operator()(Unit* unit) const { return unit->HasAura(_spellId, _casterGUID) == _present; } + bool operator()(WorldObject* object) const + { + return object->ToUnit() && object->ToUnit()->HasAura(_spellId, _casterGUID) == _present; + } + private: bool _present; uint32 _spellId; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index f823e45525d..6b102c25882 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1041,7 +1041,9 @@ void Spell::SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTarge { Trinity::WorldObjectSpellConeTargetCheck check(coneAngle, radius, m_caster, m_spellInfo, selectionType, condList); Trinity::WorldObjectListSearcher searcher(m_caster, targets, check, containerTypeMask); - SearchTargets > (searcher, containerTypeMask, m_caster, m_caster, radius); + SearchTargets >(searcher, containerTypeMask, m_caster, m_caster, radius); + + CallScriptObjectAreaTargetSelectHandlers(targets, effIndex); if (!targets.empty()) { @@ -1069,8 +1071,6 @@ void Spell::SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTarge gObjTargets.push_back(gObjTarget); } - CallScriptAfterUnitTargetSelectHandlers(unitTargets, effIndex); - for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end(); ++itr) AddUnitTarget(*itr, effMask, false); @@ -1217,6 +1217,8 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge gObjTargets.push_back(gObjTarget); } + CallScriptObjectAreaTargetSelectHandlers(targets, effIndex); + if (!unitTargets.empty()) { // Special target selection for smart heals and energizes @@ -1342,8 +1344,6 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge Trinity::Containers::RandomResizeList(unitTargets, maxTargets); } - CallScriptAfterUnitTargetSelectHandlers(unitTargets, effIndex); - for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end(); ++itr) AddUnitTarget(*itr, effMask, false); } @@ -1359,6 +1359,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge Trinity::Containers::RandomResizeList(gObjTargets, maxTargets); } + for (std::list::iterator itr = gObjTargets.begin(); itr != gObjTargets.end(); ++itr) AddGOTarget(*itr, effMask); } @@ -1567,7 +1568,8 @@ void Spell::SelectImplicitChainTargets(SpellEffIndex effIndex, SpellImplicitTarg if (Unit* unitTarget = (*itr)->ToUnit()) unitTargets.push_back(unitTarget); - CallScriptAfterUnitTargetSelectHandlers(unitTargets, effIndex); + // Chain primary target is added earlier + CallScriptObjectAreaTargetSelectHandlers(targets, effIndex); for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end(); ++itr) AddUnitTarget(*itr, effMask, false); @@ -7036,15 +7038,15 @@ void Spell::CallScriptAfterHitHandlers() } } -void Spell::CallScriptAfterUnitTargetSelectHandlers(std::list& unitTargets, SpellEffIndex effIndex) +void Spell::CallScriptObjectAreaTargetSelectHandlers(std::list& targets, SpellEffIndex effIndex) { for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_UNIT_TARGET_SELECT); - std::list::iterator hookItrEnd = (*scritr)->OnUnitTargetSelect.end(), hookItr = (*scritr)->OnUnitTargetSelect.begin(); + std::list::iterator hookItrEnd = (*scritr)->OnObjectAreaTargetSelect.end(), hookItr = (*scritr)->OnObjectAreaTargetSelect.begin(); for (; hookItr != hookItrEnd; ++hookItr) if ((*hookItr).IsEffectAffected(m_spellInfo, effIndex)) - (*hookItr).Call(*scritr, unitTargets); + (*hookItr).Call(*scritr, targets); (*scritr)->_FinishScriptCall(); } diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 8f43b9b2290..98455904cf5 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -630,7 +630,7 @@ class Spell void CallScriptBeforeHitHandlers(); void CallScriptOnHitHandlers(); void CallScriptAfterHitHandlers(); - void CallScriptAfterUnitTargetSelectHandlers(std::list& unitTargets, SpellEffIndex effIndex); + void CallScriptObjectAreaTargetSelectHandlers(std::list& targets, SpellEffIndex effIndex); std::list m_loadedScripts; struct HitTriggerSpell diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index e6ce80c20f0..eaccb8fc005 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -203,50 +203,56 @@ void SpellScript::HitHandler::Call(SpellScript* spellScript) (spellScript->*pHitHandlerScript)(); } -SpellScript::UnitTargetHandler::UnitTargetHandler(SpellUnitTargetFnType _pUnitTargetHandlerScript, uint8 _effIndex, uint16 _targetType) +SpellScript::ObjectAreaTargetSelectHandler::ObjectAreaTargetSelectHandler(SpellObjectAreaTargetSelectFnType _pObjectAreaTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType) : _SpellScript::EffectHook(_effIndex), targetType(_targetType) { - pUnitTargetHandlerScript = _pUnitTargetHandlerScript; + pObjectAreaTargetSelectHandlerScript = _pObjectAreaTargetSelectHandlerScript; } -std::string SpellScript::UnitTargetHandler::ToString() +std::string SpellScript::ObjectAreaTargetSelectHandler::ToString() { std::ostringstream oss; oss << "Index: " << EffIndexToString() << " Target: " << targetType; return oss.str(); } -bool SpellScript::UnitTargetHandler::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex) +bool SpellScript::ObjectAreaTargetSelectHandler::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex) { if (!targetType) return false; - return (effIndex == EFFECT_ALL) || (spellEntry->Effects[effIndex].TargetA.GetTarget() == targetType || spellEntry->Effects[effIndex].TargetB.GetTarget() == targetType); + + if (spellEntry->Effects[effIndex].TargetA.GetTarget() != targetType && + spellEntry->Effects[effIndex].TargetB.GetTarget() != targetType) + return false; + + // TODO: Smart check if this hook will run for this targetType + return true; } -void SpellScript::UnitTargetHandler::Call(SpellScript* spellScript, std::list& unitTargets) +void SpellScript::ObjectAreaTargetSelectHandler::Call(SpellScript* spellScript, std::list& targets) { - (spellScript->*pUnitTargetHandlerScript)(unitTargets); + (spellScript->*pObjectAreaTargetSelectHandlerScript)(targets); } bool SpellScript::_Validate(SpellInfo const* entry) { - for (std::list::iterator itr = OnEffectLaunch.begin(); itr != OnEffectLaunch.end(); ++itr) + for (std::list::iterator itr = OnEffectLaunch.begin(); itr != OnEffectLaunch.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectLaunch` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnEffectLaunchTarget.begin(); itr != OnEffectLaunchTarget.end(); ++itr) + for (std::list::iterator itr = OnEffectLaunchTarget.begin(); itr != OnEffectLaunchTarget.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectLaunchTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnEffectHit.begin(); itr != OnEffectHit.end(); ++itr) + for (std::list::iterator itr = OnEffectHit.begin(); itr != OnEffectHit.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectHit` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnEffectHitTarget.begin(); itr != OnEffectHitTarget.end(); ++itr) + for (std::list::iterator itr = OnEffectHitTarget.begin(); itr != OnEffectHitTarget.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectHitTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnUnitTargetSelect.begin(); itr != OnUnitTargetSelect.end(); ++itr) + for (std::list::iterator itr = OnObjectAreaTargetSelect.begin(); itr != OnObjectAreaTargetSelect.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnUnitTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index 7b194b7827f..a145a0b7377 100755 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -154,7 +154,7 @@ class SpellScript : public _SpellScript typedef void(CLASSNAME::*SpellEffectFnType)(SpellEffIndex); \ typedef void(CLASSNAME::*SpellHitFnType)(); \ typedef void(CLASSNAME::*SpellCastFnType)(); \ - typedef void(CLASSNAME::*SpellUnitTargetFnType)(std::list&); \ + typedef void(CLASSNAME::*SpellObjectAreaTargetSelectFnType)(std::list&); \ SPELLSCRIPT_FUNCTION_TYPE_DEFINES(SpellScript) @@ -196,15 +196,15 @@ class SpellScript : public _SpellScript SpellHitFnType pHitHandlerScript; }; - class UnitTargetHandler : public _SpellScript::EffectHook + class ObjectAreaTargetSelectHandler : public _SpellScript::EffectHook { public: - UnitTargetHandler(SpellUnitTargetFnType _pUnitTargetHandlerScript, uint8 _effIndex, uint16 _targetType); + ObjectAreaTargetSelectHandler(SpellObjectAreaTargetSelectFnType _pObjectAreaTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType); std::string ToString(); bool CheckEffect(SpellInfo const* spellEntry, uint8 targetType); - void Call(SpellScript* spellScript, std::list& unitTargets); + void Call(SpellScript* spellScript, std::list& targets); private: - SpellUnitTargetFnType pUnitTargetHandlerScript; + SpellObjectAreaTargetSelectFnType pObjectAreaTargetSelectHandlerScript; uint16 targetType; }; @@ -213,7 +213,7 @@ class SpellScript : public _SpellScript class CheckCastHandlerFunction : public SpellScript::CheckCastHandler { public: CheckCastHandlerFunction(SpellCheckCastFnType _checkCastHandlerScript) : SpellScript::CheckCastHandler((SpellScript::SpellCheckCastFnType)_checkCastHandlerScript) {} }; \ class EffectHandlerFunction : public SpellScript::EffectHandler { public: EffectHandlerFunction(SpellEffectFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : SpellScript::EffectHandler((SpellScript::SpellEffectFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \ class HitHandlerFunction : public SpellScript::HitHandler { public: HitHandlerFunction(SpellHitFnType _pHitHandlerScript) : SpellScript::HitHandler((SpellScript::SpellHitFnType)_pHitHandlerScript) {} }; \ - class UnitTargetHandlerFunction : public SpellScript::UnitTargetHandler { public: UnitTargetHandlerFunction(SpellUnitTargetFnType _pUnitTargetHandlerScript, uint8 _effIndex, uint16 _targetType) : SpellScript::UnitTargetHandler((SpellScript::SpellUnitTargetFnType)_pUnitTargetHandlerScript, _effIndex, _targetType) {} }; \ + class ObjectAreaTargetSelectHandlerFunction : public SpellScript::ObjectAreaTargetSelectHandler { public: ObjectAreaTargetSelectHandlerFunction(SpellObjectAreaTargetSelectFnType _pObjectAreaTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType) : SpellScript::ObjectAreaTargetSelectHandler((SpellScript::SpellObjectAreaTargetSelectFnType)_pObjectAreaTargetSelectHandlerScript, _effIndex, _targetType) {} }; \ #define PrepareSpellScript(CLASSNAME) SPELLSCRIPT_FUNCTION_TYPE_DEFINES(CLASSNAME) SPELLSCRIPT_FUNCTION_CAST_DEFINES(CLASSNAME) public: @@ -269,8 +269,8 @@ class SpellScript : public _SpellScript // example: OnUnitTargetSelect += SpellUnitTargetFn(class::function, EffectIndexSpecifier, TargetsNameSpecifier); // where function is void function(std::list& targetList) - HookList OnUnitTargetSelect; - #define SpellUnitTargetFn(F, I, N) UnitTargetHandlerFunction(&F, I, N) + HookList OnObjectAreaTargetSelect; + #define SpellObjectAreaTargetSelectFn(F, I, N) ObjectAreaTargetSelectHandlerFunction(&F, I, N) // hooks are executed in following order, at specified event of spell: // 1. BeforeCast - executed when spell preparation is finished (when cast bar becomes full) before cast is handled @@ -302,7 +302,7 @@ class SpellScript : public _SpellScript // -shadowstep - explicit target is the unit you want to go behind of // -chain heal - explicit target is the unit to be healed first // -holy nova/arcane explosion - explicit target = NULL because target you are selecting doesn't affect how spell targets are selected - // you can determine if spell requires explicit targets by dbc columns: + // you can determine if spell requires explicit targets by dbc columns: // - Targets - mask of explicit target types // - ImplicitTargetXX set to TARGET_XXX_TARGET_YYY, _TARGET_ here means that explicit target is used by the effect, so spell needs one too diff --git a/src/server/scripts/Commands/cs_instance.cpp b/src/server/scripts/Commands/cs_instance.cpp index 127a3848ebc..f51727af2ef 100644 --- a/src/server/scripts/Commands/cs_instance.cpp +++ b/src/server/scripts/Commands/cs_instance.cpp @@ -66,7 +66,7 @@ public: return ss.str(); } - static bool HandleInstanceListBindsCommand(ChatHandler* handler, char const* args) + static bool HandleInstanceListBindsCommand(ChatHandler* handler, char const* /*args*/) { Player* player = handler->getSelectedPlayer(); if (!player) diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index 7acbc42e20e..746956581a6 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -207,7 +207,7 @@ public: } // mail case - uint32 mailCount; + uint32 mailCount = 0; stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_COUNT_ITEM); stmt->setUInt32(0, itemId); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index c1ae04cf4c0..9160983b0df 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -199,11 +199,10 @@ public: class MarkTargetFilter { public: - bool operator()(Unit* target) const + bool operator()(WorldObject* target) const { - if (target->getPowerType() != POWER_MANA) - return true; - + if (Unit* unit = target->ToUnit()) + return unit->getPowerType() != POWER_MANA; return false; } }; @@ -217,14 +216,14 @@ class spell_mark_of_kazrogal : public SpellScriptLoader { PrepareSpellScript(spell_mark_of_kazrogal_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - unitList.remove_if(MarkTargetFilter()); + targets.remove_if(MarkTargetFilter()); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_mark_of_kazrogal_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mark_of_kazrogal_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp index 397b0849d5e..5800a6a58a0 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp @@ -707,16 +707,16 @@ class spell_energize_aoe : public SpellScriptLoader return true; } - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - for (std::list::iterator itr = unitList.begin(); itr != unitList.end();) + for (std::list::iterator itr = targets.begin(); itr != targets.end();) { if ((*itr)->GetTypeId() == TYPEID_PLAYER && (*itr)->ToPlayer()->GetQuestStatus(GetSpellInfo()->Effects[EFFECT_1].CalcValue()) == QUEST_STATUS_INCOMPLETE) ++itr; else - unitList.erase(itr++); + targets.erase(itr++); } - unitList.push_back(GetCaster()); + targets.push_back(GetCaster()); } void HandleScript(SpellEffIndex effIndex) @@ -728,8 +728,8 @@ class spell_energize_aoe : public SpellScriptLoader void Register() { OnEffectHitTarget += SpellEffectFn(spell_energize_aoe_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - OnUnitTargetSelect += SpellUnitTargetFn(spell_energize_aoe_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_energize_aoe_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_energize_aoe_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_energize_aoe_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENTRY); } }; diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp index 4e5e01cc745..5a7809dbe70 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp @@ -186,7 +186,7 @@ class ConflagrationTargetSelector public: ConflagrationTargetSelector() { } - bool operator()(Unit* unit) + bool operator()(WorldObject* unit) const { return unit->GetTypeId() != TYPEID_PLAYER; } @@ -201,12 +201,12 @@ class spell_saviana_conflagration_init : public SpellScriptLoader { PrepareSpellScript(spell_saviana_conflagration_init_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - unitList.remove_if (ConflagrationTargetSelector()); + targets.remove_if(ConflagrationTargetSelector()); uint8 maxSize = uint8(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 6 : 3); - if (unitList.size() > maxSize) - Trinity::Containers::RandomResizeList(unitList, maxSize); + if (targets.size() > maxSize) + Trinity::Containers::RandomResizeList(targets, maxSize); } void HandleDummy(SpellEffIndex effIndex) @@ -218,7 +218,7 @@ class spell_saviana_conflagration_init : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_saviana_conflagration_init_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_saviana_conflagration_init_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_saviana_conflagration_init_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp index 305266ee628..e96408acc09 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp @@ -60,9 +60,9 @@ class OrientationCheck : public std::unary_function { public: explicit OrientationCheck(Unit* _caster) : caster(_caster) { } - bool operator() (Unit* unit) + bool operator()(WorldObject* object) { - return !unit->isInFront(caster, 2.5f) || !unit->IsWithinDist(caster, 40.0f); + return !object->isInFront(caster, 2.5f) || !object->IsWithinDist(caster, 40.0f); } private: @@ -76,15 +76,16 @@ class spell_eadric_radiance : public SpellScriptLoader class spell_eadric_radiance_SpellScript : public SpellScript { PrepareSpellScript(spell_eadric_radiance_SpellScript); - void FilterTargets(std::list& unitList) + + void FilterTargets(std::list& unitList) { - unitList.remove_if (OrientationCheck(GetCaster())); + unitList.remove_if(OrientationCheck(GetCaster())); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_eadric_radiance_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_eadric_radiance_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_eadric_radiance_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_eadric_radiance_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); } }; diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp index 4a28ebe6495..5b6bf14c29e 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp @@ -359,7 +359,7 @@ class DistanceCheck public: explicit DistanceCheck(Unit* _caster) : caster(_caster) { } - bool operator() (Unit* unit) + bool operator() (WorldObject* unit) const { if (caster->GetExactDist2d(unit) <= 10.0f) return true; @@ -378,25 +378,25 @@ class spell_bronjahm_soulstorm_targeting : public SpellScriptLoader { PrepareSpellScript(spell_bronjahm_soulstorm_targeting_SpellScript); - void FilterTargetsInitial(std::list& unitList) + void FilterTargetsInitial(std::list& targets) { - unitList.remove_if (DistanceCheck(GetCaster())); - sharedUnitList = unitList; + targets.remove_if(DistanceCheck(GetCaster())); + sharedTargets = targets; } // use the same target for first and second effect - void FilterTargetsSubsequent(std::list& unitList) + void FilterTargetsSubsequent(std::list& targets) { - unitList = sharedUnitList; + targets = sharedTargets; } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_bronjahm_soulstorm_targeting_SpellScript::FilterTargetsInitial, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_bronjahm_soulstorm_targeting_SpellScript::FilterTargetsSubsequent, EFFECT_2, TARGET_UNIT_DEST_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_bronjahm_soulstorm_targeting_SpellScript::FilterTargetsInitial, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_bronjahm_soulstorm_targeting_SpellScript::FilterTargetsSubsequent, EFFECT_2, TARGET_UNIT_DEST_AREA_ENEMY); } - std::list sharedUnitList; + std::list sharedTargets; }; SpellScript* GetSpellScript() const diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index ee966256e2b..0d092ec86b2 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -631,9 +631,9 @@ class BloodboltHitCheck public: explicit BloodboltHitCheck(LanaThelAI* ai) : _ai(ai) {} - bool operator()(Unit* unit) + bool operator()(WorldObject* object) const { - return _ai->WasBloodbolted(unit->GetGUID()); + return _ai->WasBloodbolted(object->GetGUID()); } private: @@ -661,13 +661,13 @@ class spell_blood_queen_bloodbolt : public SpellScriptLoader return GetCaster()->GetEntry() == NPC_BLOOD_QUEEN_LANA_THEL; } - void FilterTargets(std::list& targets) + void FilterTargets(std::list& targets) { uint32 targetCount = (targets.size() + 2) / 3; - targets.remove_if (BloodboltHitCheck(static_cast(GetCaster()->GetAI()))); + targets.remove_if(BloodboltHitCheck(static_cast(GetCaster()->GetAI()))); Trinity::Containers::RandomResizeList(targets, targetCount); // mark targets now, effect hook has missile travel time delay (might cast next in that time) - for (std::list::const_iterator itr = targets.begin(); itr != targets.end(); ++itr) + for (std::list::const_iterator itr = targets.begin(); itr != targets.end(); ++itr) GetCaster()->GetAI()->SetGUID((*itr)->GetGUID(), GUID_BLOODBOLT); } @@ -679,7 +679,7 @@ class spell_blood_queen_bloodbolt : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_blood_queen_bloodbolt_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_blood_queen_bloodbolt_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_blood_queen_bloodbolt_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); } }; @@ -699,19 +699,19 @@ class spell_blood_queen_pact_of_the_darkfallen : public SpellScriptLoader { PrepareSpellScript(spell_blood_queen_pact_of_the_darkfallen_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - unitList.remove_if (Trinity::UnitAuraCheck(false, SPELL_PACT_OF_THE_DARKFALLEN)); + targets.remove_if(Trinity::UnitAuraCheck(false, SPELL_PACT_OF_THE_DARKFALLEN)); bool remove = true; - std::list::const_iterator itrEnd = unitList.end(), itr, itr2; + std::list::const_iterator itrEnd = targets.end(), itr, itr2; // we can do this, unitList is MAX 4 in size - for (itr = unitList.begin(); itr != itrEnd && remove; ++itr) + for (itr = targets.begin(); itr != itrEnd && remove; ++itr) { if (!GetCaster()->IsWithinDist(*itr, 5.0f, false)) remove = false; - for (itr2 = unitList.begin(); itr2 != itrEnd && remove; ++itr2) + for (itr2 = targets.begin(); itr2 != itrEnd && remove; ++itr2) if (itr != itr2 && !(*itr2)->IsWithinDist(*itr, 5.0f, false)) remove = false; } @@ -721,14 +721,14 @@ class spell_blood_queen_pact_of_the_darkfallen : public SpellScriptLoader if (InstanceScript* instance = GetCaster()->GetInstanceScript()) { instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_PACT_OF_THE_DARKFALLEN); - unitList.clear(); + targets.clear(); } } } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_blood_queen_pact_of_the_darkfallen_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_blood_queen_pact_of_the_darkfallen_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); } }; @@ -785,15 +785,15 @@ class spell_blood_queen_pact_of_the_darkfallen_dmg_target : public SpellScriptLo { PrepareSpellScript(spell_blood_queen_pact_of_the_darkfallen_dmg_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& unitList) { - unitList.remove_if (Trinity::UnitAuraCheck(true, SPELL_PACT_OF_THE_DARKFALLEN)); + unitList.remove_if(Trinity::UnitAuraCheck(true, SPELL_PACT_OF_THE_DARKFALLEN)); unitList.push_back(GetCaster()); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_blood_queen_pact_of_the_darkfallen_dmg_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_blood_queen_pact_of_the_darkfallen_dmg_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); } }; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 494be259baa..5d3a6814eb2 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -1198,34 +1198,34 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader return true; } - void FilterTargetsInitial(std::list& unitList) + void FilterTargetsInitial(std::list& targets) { - if (unitList.empty()) + if (targets.empty()) return; // select one random target, with preference of ranged targets uint32 targetsAtRange = 0; uint32 const minTargets = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 10 : 4); - unitList.sort(Trinity::ObjectDistanceOrderPred(GetCaster(), false)); + targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster(), false)); // get target count at range - for (std::list::iterator itr = unitList.begin(); itr != unitList.end(); ++itr, ++targetsAtRange) + for (std::list::iterator itr = targets.begin(); itr != targets.end(); ++itr, ++targetsAtRange) if ((*itr)->GetDistance(GetCaster()) < 12.0f) break; // set the upper cap if (targetsAtRange < minTargets) - targetsAtRange = std::min(unitList.size() - 1, minTargets); + targetsAtRange = std::min(targets.size() - 1, minTargets); - std::list::const_iterator itr = unitList.begin(); + std::list::const_iterator itr = targets.begin(); std::advance(itr, urand(0, targetsAtRange)); target = *itr; - unitList.clear(); - unitList.push_back(target); + targets.clear(); + targets.push_back(target); } // use the same target for first and second effect - void FilterTargetsSubsequent(std::list& unitList) + void FilterTargetsSubsequent(std::list& unitList) { if (!target) return; @@ -1241,12 +1241,12 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsSubsequent, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsSubsequent, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_deathbringer_blood_nova_targeting_SpellScript::HandleForceCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST); } - Unit* target; + WorldObject* target; }; SpellScript* GetSpellScript() const @@ -1269,20 +1269,20 @@ class spell_deathbringer_boiling_blood : public SpellScriptLoader return GetCaster()->GetTypeId() == TYPEID_UNIT; } - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - unitList.remove(GetCaster()->getVictim()); - if (unitList.empty()) + targets.remove(GetCaster()->getVictim()); + if (targets.empty()) return; - Unit* target = Trinity::Containers::SelectRandomContainerElement(unitList); - unitList.clear(); - unitList.push_back(target); + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); + targets.clear(); + targets.push_back(target); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_deathbringer_boiling_blood_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_deathbringer_boiling_blood_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index 1672d8b2d87..0c5cb0aba52 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -416,7 +416,7 @@ class spell_marrowgar_coldflame : public SpellScriptLoader { PrepareSpellScript(spell_marrowgar_coldflame_SpellScript); - void SelectTarget(std::list& targets) + void SelectTarget(std::list& targets) { targets.clear(); // select any unit but not the tank (by owners threatlist) @@ -438,7 +438,7 @@ class spell_marrowgar_coldflame : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_marrowgar_coldflame_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_marrowgar_coldflame_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_marrowgar_coldflame_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index b2662b644a7..a9ba0baa86f 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -870,26 +870,26 @@ class spell_putricide_ooze_channel : public SpellScriptLoader return GetCaster()->GetTypeId() == TYPEID_UNIT; } - void SelectTarget(std::list& targetList) + void SelectTarget(std::list& targets) { - if (targetList.empty()) + if (targets.empty()) { FinishCast(SPELL_FAILED_NO_VALID_TARGETS); GetCaster()->ToCreature()->DespawnOrUnsummon(1); // despawn next update return; } - Unit* target = Trinity::Containers::SelectRandomContainerElement(targetList); - targetList.clear(); - targetList.push_back(target); + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); + targets.clear(); + targets.push_back(target); _target = target; } - void SetTarget(std::list& targetList) + void SetTarget(std::list& targets) { - targetList.clear(); + targets.clear(); if (_target) - targetList.push_back(_target); + targets.push_back(_target); } void StartAttack() @@ -912,14 +912,14 @@ class spell_putricide_ooze_channel : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_ooze_channel_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_ooze_channel_SpellScript::SetTarget, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_ooze_channel_SpellScript::SetTarget, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_ooze_channel_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_ooze_channel_SpellScript::SetTarget, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_ooze_channel_SpellScript::SetTarget, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY); AfterHit += SpellHitFn(spell_putricide_ooze_channel_SpellScript::StartAttack); OnCast += SpellCastFn(spell_putricide_ooze_channel_SpellScript::CheckTarget); } - Unit* _target; + WorldObject* _target; }; SpellScript* GetSpellScript() const @@ -933,7 +933,7 @@ class ExactDistanceCheck public: ExactDistanceCheck(Unit* source, float dist) : _source(source), _dist(dist) {} - bool operator()(Unit* unit) + bool operator()(WorldObject* unit) const { return _source->GetExactDist2d(unit) > _dist; } @@ -952,15 +952,15 @@ class spell_putricide_slime_puddle : public SpellScriptLoader { PrepareSpellScript(spell_putricide_slime_puddle_SpellScript); - void ScaleRange(std::list& targets) + void ScaleRange(std::list& targets) { targets.remove_if(ExactDistanceCheck(GetCaster(), 2.5f * GetCaster()->GetFloatValue(OBJECT_FIELD_SCALE_X))); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_slime_puddle_SpellScript::ScaleRange, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_slime_puddle_SpellScript::ScaleRange, EFFECT_1, TARGET_UNIT_DEST_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_slime_puddle_SpellScript::ScaleRange, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_slime_puddle_SpellScript::ScaleRange, EFFECT_1, TARGET_UNIT_DEST_AREA_ENTRY); } }; @@ -1178,13 +1178,13 @@ class spell_putricide_eat_ooze : public SpellScriptLoader { PrepareSpellScript(spell_putricide_eat_ooze_SpellScript); - void SelectTarget(std::list& targets) + void SelectTarget(std::list& targets) { if (targets.empty()) return; targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster())); - Unit* target = targets.front(); + WorldObject* target = targets.front(); targets.clear(); targets.push_back(target); } @@ -1211,7 +1211,7 @@ class spell_putricide_eat_ooze : public SpellScriptLoader void Register() { OnEffectHitTarget += SpellEffectFn(spell_putricide_eat_ooze_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_eat_ooze_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_DEST_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_eat_ooze_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_DEST_AREA_ENTRY); } }; @@ -1458,15 +1458,15 @@ class spell_putricide_mutated_transformation_dmg : public SpellScriptLoader { PrepareSpellScript(spell_putricide_mutated_transformation_dmg_SpellScript); - void FilterTargetsInitial(std::list& unitList) + void FilterTargetsInitial(std::list& targets) { if (Unit* owner = ObjectAccessor::GetUnit(*GetCaster(), GetCaster()->GetCreatorGUID())) - unitList.remove(owner); + targets.remove(owner); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_mutated_transformation_dmg_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_mutated_transformation_dmg_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); } }; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index a4ab13f6ada..079a2ef48e1 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -449,23 +449,23 @@ class spell_rotface_ooze_flood : public SpellScriptLoader GetHitUnit()->CastSpell(triggers.back(), uint32(GetEffectValue()), false, NULL, NULL, GetOriginalCaster() ? GetOriginalCaster()->GetGUID() : 0); } - void FilterTargets(std::list& targetList) + void FilterTargets(std::list& targets) { // get 2 targets except 2 nearest - targetList.sort(Trinity::ObjectDistanceOrderPred(GetCaster())); + targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster())); // .resize() runs pop_back(); - if (targetList.size() > 4) - targetList.resize(4); + if (targets.size() > 4) + targets.resize(4); - while (targetList.size() > 2) - targetList.pop_front(); + while (targets.size() > 2) + targets.pop_front(); } void Register() { OnEffectHitTarget += SpellEffectFn(spell_rotface_ooze_flood_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - OnUnitTargetSelect += SpellUnitTargetFn(spell_rotface_ooze_flood_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rotface_ooze_flood_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); } }; @@ -490,7 +490,7 @@ class spell_rotface_mutated_infection : public SpellScriptLoader return true; } - void FilterTargets(std::list& targets) + void FilterTargets(std::list& targets) { // remove targets with this aura already // tank is not on this list @@ -498,13 +498,13 @@ class spell_rotface_mutated_infection : public SpellScriptLoader if (targets.empty()) return; - Unit* target = Trinity::Containers::SelectRandomContainerElement(targets); + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); targets.clear(); targets.push_back(target); _target = target; } - void ReplaceTargets(std::list& targets) + void ReplaceTargets(std::list& targets) { targets.clear(); if (_target) @@ -520,13 +520,13 @@ class spell_rotface_mutated_infection : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_rotface_mutated_infection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_rotface_mutated_infection_SpellScript::ReplaceTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_rotface_mutated_infection_SpellScript::ReplaceTargets, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rotface_mutated_infection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rotface_mutated_infection_SpellScript::ReplaceTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rotface_mutated_infection_SpellScript::ReplaceTargets, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY); AfterHit += SpellHitFn(spell_rotface_mutated_infection_SpellScript::NotifyTargets); } - Unit* _target; + WorldObject* _target; }; SpellScript* GetSpellScript() const diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index fdc9a6a21d6..f6d9de9e967 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -1044,9 +1044,9 @@ class spell_sindragosa_s_fury : public SpellScriptLoader return true; } - void CountTargets(std::list& unitList) + void CountTargets(std::list& targets) { - _targetCount = unitList.size(); + _targetCount = targets.size(); } void HandleDummy(SpellEffIndex effIndex) @@ -1071,7 +1071,7 @@ class spell_sindragosa_s_fury : public SpellScriptLoader void Register() { OnEffectHitTarget += SpellEffectFn(spell_sindragosa_s_fury_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_sindragosa_s_fury_SpellScript::CountTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sindragosa_s_fury_SpellScript::CountTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ENTRY); } uint32 _targetCount; @@ -1088,9 +1088,11 @@ class UnchainedMagicTargetSelector public: UnchainedMagicTargetSelector() { } - bool operator()(Unit* unit) + bool operator()(WorldObject* object) const { - return unit->getPowerType() != POWER_MANA; + if (Unit* unit = object->ToUnit()) + return unit->getPowerType() != POWER_MANA; + return true; } }; @@ -1103,7 +1105,7 @@ class spell_sindragosa_unchained_magic : public SpellScriptLoader { PrepareSpellScript(spell_sindragosa_unchained_magic_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& unitList) { unitList.remove_if(UnchainedMagicTargetSelector()); uint32 maxSize = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 6 : 2); @@ -1113,7 +1115,7 @@ class spell_sindragosa_unchained_magic : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_sindragosa_unchained_magic_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sindragosa_unchained_magic_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; @@ -1296,7 +1298,7 @@ class MysticBuffetTargetFilter public: explicit MysticBuffetTargetFilter(Unit* caster) : _caster(caster) { } - bool operator()(Unit* unit) + bool operator()(WorldObject* unit) const { return !unit->IsWithinLOSInMap(_caster); } @@ -1314,14 +1316,14 @@ class spell_sindragosa_mystic_buffet : public SpellScriptLoader { PrepareSpellScript(spell_sindragosa_mystic_buffet_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - unitList.remove_if(MysticBuffetTargetFilter(GetCaster())); + targets.remove_if(MysticBuffetTargetFilter(GetCaster())); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_sindragosa_mystic_buffet_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sindragosa_mystic_buffet_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; @@ -1399,22 +1401,15 @@ class spell_frostwarden_handler_order_whelp : public SpellScriptLoader return true; } - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - for (std::list::iterator itr = unitList.begin(); itr != unitList.end();) - { - if ((*itr)->GetTypeId() != TYPEID_PLAYER) - unitList.erase(itr++); - else - ++itr; - } - - if (unitList.empty()) + targets.remove_if(Trinity::ObjectTypeIdCheck(TYPEID_PLAYER, false)); + if (targets.empty()) return; - Unit* target = Trinity::Containers::SelectRandomContainerElement(unitList); - unitList.clear(); - unitList.push_back(target); + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); + targets.clear(); + targets.push_back(target); } void HandleForcedCast(SpellEffIndex effIndex) @@ -1435,7 +1430,7 @@ class spell_frostwarden_handler_order_whelp : public SpellScriptLoader void Register() { OnEffectHitTarget += SpellEffectFn(spell_frostwarden_handler_order_whelp_SpellScript::HandleForcedCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST); - OnUnitTargetSelect += SpellUnitTargetFn(spell_frostwarden_handler_order_whelp_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_frostwarden_handler_order_whelp_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); } }; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index d2eaab361a1..a8657925131 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -391,7 +391,7 @@ class HeightDifferenceCheck { } - bool operator()(Unit* unit) const + bool operator()(WorldObject* unit) const { return (unit->GetPositionZ() - _baseObject->GetPositionZ() > _difference) != _reverse; } @@ -2288,7 +2288,7 @@ class spell_the_lich_king_shadow_trap_periodic : public SpellScriptLoader { PrepareSpellScript(spell_the_lich_king_shadow_trap_periodic_SpellScript); - void CheckTargetCount(std::list& targets) + void CheckTargetCount(std::list& targets) { if (targets.empty()) return; @@ -2298,7 +2298,7 @@ class spell_the_lich_king_shadow_trap_periodic : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_shadow_trap_periodic_SpellScript::CheckTargetCount, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_shadow_trap_periodic_SpellScript::CheckTargetCount, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; @@ -2322,10 +2322,10 @@ class spell_the_lich_king_quake : public SpellScriptLoader return GetCaster()->GetInstanceScript() != NULL; } - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { if (GameObject* platform = ObjectAccessor::GetGameObject(*GetCaster(), GetCaster()->GetInstanceScript()->GetData64(DATA_ARTHAS_PLATFORM))) - unitList.remove_if(HeightDifferenceCheck(platform, 5.0f, false)); + targets.remove_if(HeightDifferenceCheck(platform, 5.0f, false)); } void HandleSendEvent(SpellEffIndex /*effIndex*/) @@ -2336,7 +2336,7 @@ class spell_the_lich_king_quake : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_quake_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_quake_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); OnEffectHit += SpellEffectFn(spell_the_lich_king_quake_SpellScript::HandleSendEvent, EFFECT_1, SPELL_EFFECT_SEND_EVENT); } }; @@ -2363,7 +2363,7 @@ class spell_the_lich_king_ice_burst_target_search : public SpellScriptLoader return true; } - void CheckTargetCount(std::list& unitList) + void CheckTargetCount(std::list& unitList) { if (unitList.empty()) return; @@ -2371,12 +2371,16 @@ class spell_the_lich_king_ice_burst_target_search : public SpellScriptLoader // if there is at least one affected target cast the explosion GetCaster()->CastSpell(GetCaster(), SPELL_ICE_BURST, true); if (GetCaster()->GetTypeId() == TYPEID_UNIT) + { + GetCaster()->ToCreature()->SetReactState(REACT_PASSIVE); + GetCaster()->AttackStop(); GetCaster()->ToCreature()->DespawnOrUnsummon(500); + } } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_ice_burst_target_search_SpellScript::CheckTargetCount, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_ice_burst_target_search_SpellScript::CheckTargetCount, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; @@ -2425,7 +2429,7 @@ class ExactDistanceCheck public: ExactDistanceCheck(Unit* source, float dist) : _source(source), _dist(dist) {} - bool operator()(Unit* unit) + bool operator()(WorldObject* unit) { return _source->GetExactDist2d(unit) > _dist; } @@ -2444,7 +2448,7 @@ class spell_the_lich_king_defile : public SpellScriptLoader { PrepareSpellScript(spell_the_lich_king_defile_SpellScript); - void CorrectRange(std::list& targets) + void CorrectRange(std::list& targets) { targets.remove_if(ExactDistanceCheck(GetCaster(), 10.0f * GetCaster()->GetFloatValue(OBJECT_FIELD_SCALE_X))); } @@ -2460,8 +2464,8 @@ class spell_the_lich_king_defile : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_defile_SpellScript::CorrectRange, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_defile_SpellScript::CorrectRange, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_defile_SpellScript::CorrectRange, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_defile_SpellScript::CorrectRange, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); OnHit += SpellHitFn(spell_the_lich_king_defile_SpellScript::ChangeDamageAndGrow); } }; @@ -2563,26 +2567,26 @@ class spell_the_lich_king_valkyr_target_search : public SpellScriptLoader return true; } - void SelectTarget(std::list& unitList) + void SelectTarget(std::list& targets) { - if (unitList.empty()) + if (targets.empty()) return; - unitList.remove_if(Trinity::UnitAuraCheck(true, GetSpellInfo()->Id)); - if (unitList.empty()) + targets.remove_if(Trinity::UnitAuraCheck(true, GetSpellInfo()->Id)); + if (targets.empty()) return; - _target = Trinity::Containers::SelectRandomContainerElement(unitList); - unitList.clear(); - unitList.push_back(_target); + _target = Trinity::Containers::SelectRandomContainerElement(targets); + targets.clear(); + targets.push_back(_target); GetCaster()->GetAI()->SetGUID(_target->GetGUID()); } - void ReplaceTarget(std::list& unitList) + void ReplaceTarget(std::list& targets) { - unitList.clear(); + targets.clear(); if (_target) - unitList.push_back(_target); + targets.push_back(_target); } void HandleScript(SpellEffIndex effIndex) @@ -2593,12 +2597,12 @@ class spell_the_lich_king_valkyr_target_search : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_valkyr_target_search_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_valkyr_target_search_SpellScript::ReplaceTarget, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_valkyr_target_search_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_valkyr_target_search_SpellScript::ReplaceTarget, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_the_lich_king_valkyr_target_search_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } - Unit* _target; + WorldObject* _target; }; SpellScript* GetSpellScript() const @@ -2775,7 +2779,7 @@ class spell_the_lich_king_vile_spirit_move_target_search : public SpellScriptLoa return GetCaster()->GetTypeId() == TYPEID_UNIT; } - void SelectTarget(std::list& targets) + void SelectTarget(std::list& targets) { if (targets.empty()) return; @@ -2796,11 +2800,11 @@ class spell_the_lich_king_vile_spirit_move_target_search : public SpellScriptLoa void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_vile_spirit_move_target_search_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_vile_spirit_move_target_search_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_the_lich_king_vile_spirit_move_target_search_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } - Unit* _target; + WorldObject* _target; }; SpellScript* GetSpellScript() const @@ -2823,7 +2827,7 @@ class spell_the_lich_king_vile_spirit_damage_target_search : public SpellScriptL return GetCaster()->GetTypeId() == TYPEID_UNIT; } - void CheckTargetCount(std::list& targets) + void CheckTargetCount(std::list& targets) { if (targets.empty()) return; @@ -2840,7 +2844,7 @@ class spell_the_lich_king_vile_spirit_damage_target_search : public SpellScriptL void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_vile_spirit_damage_target_search_SpellScript::CheckTargetCount, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_vile_spirit_damage_target_search_SpellScript::CheckTargetCount, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } Unit* _target; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index 31ed1eedf10..82946ad1f13 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -1187,13 +1187,13 @@ class spell_dreamwalker_summoner : public SpellScriptLoader return true; } - void FilterTargets(std::list& targets) + void FilterTargets(std::list& targets) { targets.remove_if (Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED)); if (targets.empty()) return; - Unit* target = Trinity::Containers::SelectRandomContainerElement(targets); + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); targets.clear(); targets.push_back(target); } @@ -1209,7 +1209,7 @@ class spell_dreamwalker_summoner : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_dreamwalker_summoner_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dreamwalker_summoner_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); OnEffectHitTarget += SpellEffectFn(spell_dreamwalker_summoner_SpellScript::HandleForceCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST); } }; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 46e8c1428e4..17e33912a86 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -1834,15 +1834,15 @@ class DeathPlagueTargetSelector public: explicit DeathPlagueTargetSelector(Unit* caster) : _caster(caster) {} - bool operator()(Unit* unit) + bool operator()(WorldObject* object) const { - if (unit == _caster) + if (object == _caster) return true; - if (unit->GetTypeId() != TYPEID_PLAYER) + if (object->GetTypeId() != TYPEID_PLAYER) return true; - if (unit->HasAura(SPELL_RECENTLY_INFECTED) || unit->HasAura(SPELL_DEATH_PLAGUE_AURA)) + if (object->ToUnit()->HasAura(SPELL_RECENTLY_INFECTED) || object->ToUnit()->HasAura(SPELL_DEATH_PLAGUE_AURA)) return true; return false; @@ -1868,25 +1868,25 @@ class spell_frost_giant_death_plague : public SpellScriptLoader } // First effect - void CountTargets(std::list& unitList) + void CountTargets(std::list& targets) { - unitList.remove(GetCaster()); - _failed = unitList.empty(); + targets.remove(GetCaster()); + _failed = targets.empty(); } // Second effect - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { // Select valid targets for jump - unitList.remove_if (DeathPlagueTargetSelector(GetCaster())); - if (!unitList.empty()) + targets.remove_if(DeathPlagueTargetSelector(GetCaster())); + if (!targets.empty()) { - Unit* target = Trinity::Containers::SelectRandomContainerElement(unitList); - unitList.clear(); - unitList.push_back(target); + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); + targets.clear(); + targets.push_back(target); } - unitList.push_back(GetCaster()); + targets.push_back(GetCaster()); } void HandleScript(SpellEffIndex effIndex) @@ -1900,8 +1900,8 @@ class spell_frost_giant_death_plague : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_frost_giant_death_plague_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_frost_giant_death_plague_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_frost_giant_death_plague_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_frost_giant_death_plague_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ALLY); OnEffectHitTarget += SpellEffectFn(spell_frost_giant_death_plague_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); } @@ -1950,9 +1950,11 @@ class spell_icc_harvest_blight_specimen : public SpellScriptLoader class AliveCheck { public: - bool operator()(Unit* unit) + bool operator()(WorldObject* object) const { - return unit->isAlive(); + if (Unit* unit = object->ToUnit()) + return unit->isAlive(); + return true; } }; @@ -1965,10 +1967,10 @@ class spell_svalna_revive_champion : public SpellScriptLoader { PrepareSpellScript(spell_svalna_revive_champion_SpellScript); - void RemoveAliveTarget(std::list& unitList) + void RemoveAliveTarget(std::list& targets) { - unitList.remove_if(AliveCheck()); - Trinity::Containers::RandomResizeList(unitList, 2); + targets.remove_if(AliveCheck()); + Trinity::Containers::RandomResizeList(targets, 2); } void Land(SpellEffIndex /*effIndex*/) @@ -1988,7 +1990,7 @@ class spell_svalna_revive_champion : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_svalna_revive_champion_SpellScript::RemoveAliveTarget, EFFECT_0, TARGET_UNIT_DEST_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_svalna_revive_champion_SpellScript::RemoveAliveTarget, EFFECT_0, TARGET_UNIT_DEST_AREA_ENTRY); OnEffectHit += SpellEffectFn(spell_svalna_revive_champion_SpellScript::Land, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index 7f4915cb3f1..faaea9c4cae 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -602,14 +602,14 @@ class spell_gothik_shadow_bolt_volley : public SpellScriptLoader { PrepareSpellScript(spell_gothik_shadow_bolt_volley_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - unitList.remove_if(Trinity::UnitAuraCheck(false, SPELL_SHADOW_MARK)); + targets.remove_if(Trinity::UnitAuraCheck(false, SPELL_SHADOW_MARK)); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_gothik_shadow_bolt_volley_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_gothik_shadow_bolt_volley_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp index ccc8e9a5663..e45700ebd72 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp @@ -456,10 +456,10 @@ class spell_thaddius_pos_neg_charge : public SpellScriptLoader return GetCaster()->GetTypeId() == TYPEID_UNIT; } - void HandleTargets(std::list& targetList) + void HandleTargets(std::list& targets) { uint8 count = 0; - for (std::list::iterator ihit = targetList.begin(); ihit != targetList.end(); ++ihit) + for (std::list::iterator ihit = targets.begin(); ihit != targets.end(); ++ihit) if ((*ihit)->GetGUID() != GetCaster()->GetGUID()) if (Player* target = (*ihit)->ToPlayer()) if (target->HasAura(GetTriggeringSpell()->Id)) @@ -498,7 +498,7 @@ class spell_thaddius_pos_neg_charge : public SpellScriptLoader void Register() { OnEffectHitTarget += SpellEffectFn(spell_thaddius_pos_neg_charge_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); - OnUnitTargetSelect += SpellUnitTargetFn(spell_thaddius_pos_neg_charge_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_thaddius_pos_neg_charge_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); } }; diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp index 19a84fdae84..d200e8bf4bf 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp @@ -297,7 +297,7 @@ class spell_varos_energize_core_area_enemy : public SpellScriptLoader { PrepareSpellScript(spell_varos_energize_core_area_enemySpellScript) - void FilterTargets(std::list& targetList) + void FilterTargets(std::list& targets) { Creature* varos = GetCaster()->ToCreature(); if (!varos) @@ -308,7 +308,7 @@ class spell_varos_energize_core_area_enemy : public SpellScriptLoader float orientation = CAST_AI(boss_varos::boss_varosAI, varos->AI())->GetCoreEnergizeOrientation(); - for (std::list::iterator itr = targetList.begin(); itr != targetList.end();) + for (std::list::iterator itr = targets.begin(); itr != targets.end();) { Position pos; (*itr)->GetPosition(&pos); @@ -317,7 +317,7 @@ class spell_varos_energize_core_area_enemy : public SpellScriptLoader float diff = fabs(orientation - angle); if (diff > 1.0f) - itr = targetList.erase(itr); + itr = targets.erase(itr); else ++itr; } @@ -325,7 +325,7 @@ class spell_varos_energize_core_area_enemy : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_varos_energize_core_area_enemySpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_varos_energize_core_area_enemySpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; @@ -344,7 +344,7 @@ class spell_varos_energize_core_area_entry : public SpellScriptLoader { PrepareSpellScript(spell_varos_energize_core_area_entrySpellScript) - void FilterTargets(std::list& targetList) + void FilterTargets(std::list& targets) { Creature* varos = GetCaster()->ToCreature(); if (!varos) @@ -355,7 +355,7 @@ class spell_varos_energize_core_area_entry : public SpellScriptLoader float orientation = CAST_AI(boss_varos::boss_varosAI, varos->AI())->GetCoreEnergizeOrientation(); - for (std::list::iterator itr = targetList.begin(); itr != targetList.end();) + for (std::list::iterator itr = targets.begin(); itr != targets.end();) { Position pos; (*itr)->GetPosition(&pos); @@ -364,7 +364,7 @@ class spell_varos_energize_core_area_entry : public SpellScriptLoader float diff = fabs(orientation - angle); if (diff > 1.0f) - itr = targetList.erase(itr); + itr = targets.erase(itr); else ++itr; } @@ -372,7 +372,7 @@ class spell_varos_energize_core_area_entry : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_varos_energize_core_area_entrySpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_varos_energize_core_area_entrySpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); } }; diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp index e5e3daede91..93bea92503c 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp @@ -159,7 +159,7 @@ public: DoScriptText(SAY_KILL, me); } - void SpellHitTarget(Unit* target, const SpellInfo* pSpell) + void SpellHitTarget(Unit* /*target*/, const SpellInfo* pSpell) { //this part should be in the core if (pSpell->Id == SPELL_SHATTER || pSpell->Id == H_SPELL_SHATTER) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index 2af73389ecb..7ee67060f97 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -1080,7 +1080,7 @@ class NotVictimFilter { } - bool operator()(Unit* target) + bool operator()(WorldObject* target) { return target != _victim; } @@ -1098,14 +1098,14 @@ class spell_algalon_arcane_barrage : public SpellScriptLoader { PrepareSpellScript(spell_algalon_arcane_barrage_SpellScript); - void SelectTarget(std::list& targets) + void SelectTarget(std::list& targets) { targets.remove_if(NotVictimFilter(GetCaster())); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_algalon_arcane_barrage_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_algalon_arcane_barrage_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; @@ -1118,9 +1118,9 @@ class spell_algalon_arcane_barrage : public SpellScriptLoader class ActiveConstellationFilter { public: - bool operator()(Unit* target) const + bool operator()(WorldObject* target) const { - return target->GetAI()->GetData(0); + return target->ToUnit() && target->ToUnit()->GetAI() && target->ToUnit()->GetAI()->GetData(0); } }; @@ -1133,7 +1133,7 @@ class spell_algalon_trigger_3_adds : public SpellScriptLoader { PrepareSpellScript(spell_algalon_trigger_3_adds_SpellScript); - void SelectTarget(std::list& targets) + void SelectTarget(std::list& targets) { targets.remove_if(ActiveConstellationFilter()); } @@ -1150,7 +1150,7 @@ class spell_algalon_trigger_3_adds : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_algalon_trigger_3_adds_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_algalon_trigger_3_adds_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); } }; @@ -1202,7 +1202,7 @@ class spell_algalon_big_bang : public SpellScriptLoader return true; } - void CountTargets(std::list& targets) + void CountTargets(std::list& targets) { _targetCount = targets.size(); } @@ -1215,7 +1215,7 @@ class spell_algalon_big_bang : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_algalon_big_bang_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_algalon_big_bang_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); AfterCast += SpellCastFn(spell_algalon_big_bang_SpellScript::CheckTargets); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp index 472ff153d73..ec3125f7c0a 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp @@ -472,9 +472,9 @@ class npc_feral_defender : public CreatureScript class SanctumSentryCheck { public: - bool operator() (Unit* unit) + bool operator()(WorldObject* object) const { - if (unit->GetEntry() == NPC_SANCTUM_SENTRY) + if (object->GetEntry() == NPC_SANCTUM_SENTRY) return false; return true; @@ -490,14 +490,14 @@ class spell_auriaya_strenght_of_the_pack : public SpellScriptLoader { PrepareSpellScript(spell_auriaya_strenght_of_the_pack_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& unitList) { - unitList.remove_if (SanctumSentryCheck()); + unitList.remove_if(SanctumSentryCheck()); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_auriaya_strenght_of_the_pack_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_auriaya_strenght_of_the_pack_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); } }; @@ -516,15 +516,15 @@ class spell_auriaya_sentinel_blast : public SpellScriptLoader { PrepareSpellScript(spell_auriaya_sentinel_blast_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& unitList) { - unitList.remove_if (PlayerOrPetCheck()); + unitList.remove_if(PlayerOrPetCheck()); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_auriaya_sentinel_blast_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_auriaya_sentinel_blast_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_auriaya_sentinel_blast_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_auriaya_sentinel_blast_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); } }; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 8ff6c2e1a3a..ce0a61d1099 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -1617,7 +1617,7 @@ class FlameLeviathanPursuedTargetSelector public: explicit FlameLeviathanPursuedTargetSelector(Unit* unit) : _me(unit) {}; - bool operator()(Unit* target) const + bool operator()(WorldObject* target) const { //! No players, only vehicles (todo: check if blizzlike) Creature* creatureTarget = target->ToCreature(); @@ -1665,7 +1665,7 @@ class spell_pursue : public SpellScriptLoader return true; } - void FilterTargets(std::list& targets) + void FilterTargets(std::list& targets) { targets.remove_if(FlameLeviathanPursuedTargetSelector(GetCaster())); if (targets.empty()) @@ -1681,7 +1681,7 @@ class spell_pursue : public SpellScriptLoader } } - void FilterTargetsSubsequently(std::list& targets) + void FilterTargetsSubsequently(std::list& targets) { targets.clear(); if (_target) @@ -1708,12 +1708,12 @@ class spell_pursue : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_pursue_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_pursue_SpellScript::FilterTargetsSubsequently, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pursue_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pursue_SpellScript::FilterTargetsSubsequently, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_pursue_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_APPLY_AURA); } - Unit* _target; + WorldObject* _target; }; SpellScript* GetSpellScript() const diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp index d89d640b083..24a9171e29f 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp @@ -354,7 +354,7 @@ class StoneGripTargetSelector : public std::unary_function public: StoneGripTargetSelector(Creature* me, Unit const* victim) : _me(me), _victim(victim) {} - bool operator() (Unit* target) + bool operator()(WorldObject* target) { if (target == _victim && _me->getThreatManager().getThreatList().size() > 1) return true; @@ -385,10 +385,10 @@ class spell_ulduar_stone_grip_cast_target : public SpellScriptLoader return true; } - void FilterTargetsInitial(std::list& unitList) + void FilterTargetsInitial(std::list& unitList) { // Remove "main tank" and non-player targets - unitList.remove_if (StoneGripTargetSelector(GetCaster()->ToCreature(), GetCaster()->getVictim())); + unitList.remove_if(StoneGripTargetSelector(GetCaster()->ToCreature(), GetCaster()->getVictim())); // Maximum affected targets per difficulty mode uint32 maxTargets = 1; if (GetSpellInfo()->Id == 63981) @@ -397,7 +397,7 @@ class spell_ulduar_stone_grip_cast_target : public SpellScriptLoader // Return a random amount of targets based on maxTargets while (maxTargets < unitList.size()) { - std::list::iterator itr = unitList.begin(); + std::list::iterator itr = unitList.begin(); advance(itr, urand(0, unitList.size()-1)); unitList.erase(itr); } @@ -406,20 +406,20 @@ class spell_ulduar_stone_grip_cast_target : public SpellScriptLoader m_unitList = unitList; } - void FillTargetsSubsequential(std::list& unitList) + void FillTargetsSubsequential(std::list& unitList) { unitList = m_unitList; } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_ulduar_stone_grip_cast_target_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_ulduar_stone_grip_cast_target_SpellScript::FillTargetsSubsequential, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_ulduar_stone_grip_cast_target_SpellScript::FillTargetsSubsequential, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ulduar_stone_grip_cast_target_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ulduar_stone_grip_cast_target_SpellScript::FillTargetsSubsequential, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ulduar_stone_grip_cast_target_SpellScript::FillTargetsSubsequential, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY); } // Shared between effects - std::list m_unitList; + std::list m_unitList; }; SpellScript* GetSpellScript() const @@ -598,14 +598,14 @@ class spell_kologarn_stone_shout : public SpellScriptLoader { PrepareSpellScript(spell_kologarn_stone_shout_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& unitList) { - unitList.remove_if (PlayerOrPetCheck()); + unitList.remove_if(PlayerOrPetCheck()); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_kologarn_stone_shout_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kologarn_stone_shout_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index a2044854672..7ada42144a8 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -950,9 +950,9 @@ class spell_xt002_tympanic_tantrum : public SpellScriptLoader { PrepareSpellScript(spell_xt002_tympanic_tantrum_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - unitList.remove_if(PlayerOrPetCheck()); + targets.remove_if(PlayerOrPetCheck()); } void RecalculateDamage() @@ -962,8 +962,8 @@ class spell_xt002_tympanic_tantrum : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); OnHit += SpellHitFn(spell_xt002_tympanic_tantrum_SpellScript::RecalculateDamage); } }; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h index d35f0559080..858a82bbe57 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h @@ -268,10 +268,10 @@ GameObjectAI* GetUlduarAI(GameObject* go) class PlayerOrPetCheck { public: - bool operator() (Unit* unit) + bool operator()(WorldObject* object) const { - if (unit->GetTypeId() != TYPEID_PLAYER) - if (!unit->ToCreature()->isPet()) + if (object->GetTypeId() != TYPEID_PLAYER) + if (!object->ToCreature()->isPet()) return true; return false; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index 44cd1184098..7969accc28c 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -522,12 +522,12 @@ public: }; }; -class checkRitualTarget +class RitualTargetCheck { public: - explicit checkRitualTarget(Unit* _caster) : caster(_caster) { } + explicit RitualTargetCheck(Unit* _caster) : caster(_caster) { } - bool operator() (Unit* unit) + bool operator() (WorldObject* unit) const { if (InstanceScript* instance = caster->GetInstanceScript()) if (instance->GetData64(DATA_SACRIFICED_PLAYER) == unit->GetGUID()) @@ -549,14 +549,14 @@ class spell_paralyze_pinnacle : public SpellScriptLoader { PrepareSpellScript(spell_paralyze_pinnacle_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& unitList) { - unitList.remove_if(checkRitualTarget(GetCaster())); + unitList.remove_if(RitualTargetCheck(GetCaster())); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_paralyze_pinnacle_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_paralyze_pinnacle_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp index d202fdd2f44..0454274401c 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp @@ -518,7 +518,7 @@ class spell_astromancer_wrath_of_the_astromancer : public SpellScriptLoader return true; } - void CountTargets(std::list& targetList) + void CountTargets(std::list& targetList) { _targetCount = targetList.size(); } @@ -549,7 +549,7 @@ class spell_astromancer_wrath_of_the_astromancer : public SpellScriptLoader void Register() { OnEffectHitTarget += SpellEffectFn(spell_astromancer_wrath_of_the_astromancer_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_astromancer_wrath_of_the_astromancer_SpellScript::CountTargets, EFFECT_0, TARGET_DEST_CASTER_RADIUS); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_astromancer_wrath_of_the_astromancer_SpellScript::CountTargets, EFFECT_0, TARGET_DEST_CASTER_RADIUS); } }; diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp index 3579a7d697b..1cd67065af1 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp @@ -52,10 +52,10 @@ class spell_capacitus_polarity_charge : public SpellScriptLoader return true; } - void HandleTargets(std::list& targetList) + void HandleTargets(std::list& targetList) { uint8 count = 0; - for (std::list::iterator ihit = targetList.begin(); ihit != targetList.end(); ++ihit) + for (std::list::iterator ihit = targetList.begin(); ihit != targetList.end(); ++ihit) if ((*ihit)->GetGUID() != GetCaster()->GetGUID()) if (Player* target = (*ihit)->ToPlayer()) if (target->HasAura(GetTriggeringSpell()->Id)) @@ -88,7 +88,7 @@ class spell_capacitus_polarity_charge : public SpellScriptLoader void Register() { OnEffectHitTarget += SpellEffectFn(spell_capacitus_polarity_charge_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); - OnUnitTargetSelect += SpellUnitTargetFn(spell_capacitus_polarity_charge_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_capacitus_polarity_charge_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); } }; diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp index ab568249027..96897ae3033 100644 --- a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp +++ b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp @@ -191,7 +191,7 @@ class spell_mark_of_kazzak : public SpellScriptLoader return true; } - void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* owner = GetUnitOwner()) amount = CalculatePctU(owner->GetPower(POWER_MANA), 5); diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index ae887baa413..6a58f3d03c5 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -349,16 +349,15 @@ class spell_dk_death_pact : public SpellScriptLoader return SPELL_FAILED_NO_PET; } - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& unitList) { Unit* unit_to_add = NULL; - for (std::list::iterator itr = unitList.begin(); itr != unitList.end(); ++itr) + for (std::list::iterator itr = unitList.begin(); itr != unitList.end(); ++itr) { - if ((*itr)->GetTypeId() == TYPEID_UNIT - && (*itr)->GetOwnerGUID() == GetCaster()->GetGUID() - && (*itr)->ToCreature()->GetCreatureTemplate()->type == CREATURE_TYPE_UNDEAD) + if (Unit* unit = (*itr)->ToUnit()) + if (unit->GetOwnerGUID() == GetCaster()->GetGUID() && unit->GetCreatureType() == CREATURE_TYPE_UNDEAD) { - unit_to_add = (*itr); + unit_to_add = unit; break; } } @@ -371,7 +370,7 @@ class spell_dk_death_pact : public SpellScriptLoader void Register() { OnCheckCast += SpellCheckCastFn(spell_dk_death_pact_SpellScript::CheckCast); - OnUnitTargetSelect += SpellUnitTargetFn(spell_dk_death_pact_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dk_death_pact_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ALLY); } }; diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 4c8a9db1571..f1f624fa8e9 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -232,37 +232,37 @@ class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader return GetCaster()->GetTypeId() == TYPEID_PLAYER; } - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { if (!GetCaster()->ToPlayer()->GetGroup()) { - unitList.clear(); - unitList.push_back(GetCaster()); + targets.clear(); + targets.push_back(GetCaster()); } else { - unitList.remove(GetExplTargetUnit()); + targets.remove(GetExplTargetUnit()); std::list tempTargets; - for (std::list::const_iterator itr = unitList.begin(); itr != unitList.end(); ++itr) - if ((*itr)->GetTypeId() == TYPEID_PLAYER && GetCaster()->IsInRaidWith(*itr)) - tempTargets.push_back(*itr); + for (std::list::const_iterator itr = targets.begin(); itr != targets.end(); ++itr) + if ((*itr)->GetTypeId() == TYPEID_PLAYER && GetCaster()->IsInRaidWith((*itr)->ToUnit())) + tempTargets.push_back((*itr)->ToUnit()); if (tempTargets.empty()) { - unitList.clear(); + targets.clear(); FinishCast(SPELL_FAILED_DONT_REPORT); return; } Unit* target = Trinity::Containers::SelectRandomContainerElement(tempTargets); - unitList.clear(); - unitList.push_back(target); + targets.clear(); + targets.push_back(target); } } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_dru_t10_restoration_4p_bonus_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dru_t10_restoration_4p_bonus_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY); } }; @@ -281,14 +281,14 @@ class spell_dru_starfall_aoe : public SpellScriptLoader { PrepareSpellScript(spell_dru_starfall_aoe_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - unitList.remove(GetExplTargetUnit()); + targets.remove(GetExplTargetUnit()); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_dru_starfall_aoe_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dru_starfall_aoe_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); } }; @@ -341,9 +341,9 @@ class spell_dru_starfall_dummy : public SpellScriptLoader { PrepareSpellScript(spell_dru_starfall_dummy_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - Trinity::Containers::RandomResizeList(unitList, 2); + Trinity::Containers::RandomResizeList(targets, 2); } void HandleDummy(SpellEffIndex /*effIndex*/) @@ -366,7 +366,7 @@ class spell_dru_starfall_dummy : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_dru_starfall_dummy_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dru_starfall_dummy_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_dru_starfall_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 329e0d2e170..7d248b35853 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -409,7 +409,7 @@ class spell_pal_divine_storm_dummy : public SpellScriptLoader return true; } - void CountTargets(std::list& targetList) + void CountTargets(std::list& targetList) { _targetCount = targetList.size(); } @@ -428,7 +428,7 @@ class spell_pal_divine_storm_dummy : public SpellScriptLoader void Register() { OnEffectHitTarget += SpellEffectFn(spell_pal_divine_storm_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_pal_divine_storm_dummy_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pal_divine_storm_dummy_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID); } }; diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 6910bf47805..aab1e974e53 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -132,14 +132,14 @@ class spell_pri_mind_sear : public SpellScriptLoader { PrepareSpellScript(spell_pri_mind_sear_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& unitList) { - unitList.remove_if (Trinity::ObjectGUIDCheck(GetCaster()->GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT))); + unitList.remove_if(Trinity::ObjectGUIDCheck(GetCaster()->GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT))); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_pri_mind_sear_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pri_mind_sear_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); } }; diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index fce3d0415a6..c863c2363af 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -262,9 +262,12 @@ class EarthenPowerTargetSelector public: EarthenPowerTargetSelector() { } - bool operator() (Unit* target) + bool operator() (WorldObject* target) { - if (!target->HasAuraWithMechanic(1 << MECHANIC_SNARE)) + if (!target->ToUnit()) + return true; + + if (!target->ToUnit()->HasAuraWithMechanic(1 << MECHANIC_SNARE)) return true; return false; @@ -280,14 +283,14 @@ class spell_sha_earthen_power : public SpellScriptLoader { PrepareSpellScript(spell_sha_earthen_power_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& unitList) { unitList.remove_if(EarthenPowerTargetSelector()); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_earthen_power_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_earthen_power_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); } }; @@ -313,7 +316,7 @@ class spell_sha_bloodlust : public SpellScriptLoader return true; } - void RemoveInvalidTargets(std::list& targets) + void RemoveInvalidTargets(std::list& targets) { targets.remove_if(Trinity::UnitAuraCheck(true, SHAMAN_SPELL_SATED)); } @@ -326,9 +329,9 @@ class spell_sha_bloodlust : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID); - OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID); - OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID); AfterHit += SpellHitFn(spell_sha_bloodlust_SpellScript::ApplyDebuff); } }; @@ -355,9 +358,9 @@ class spell_sha_heroism : public SpellScriptLoader return true; } - void RemoveInvalidTargets(std::list& targets) + void RemoveInvalidTargets(std::list& targets) { - targets.remove_if (Trinity::UnitAuraCheck(true, SHAMAN_SPELL_EXHAUSTION)); + targets.remove_if(Trinity::UnitAuraCheck(true, SHAMAN_SPELL_EXHAUSTION)); } void ApplyDebuff() @@ -368,9 +371,9 @@ class spell_sha_heroism : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID); - OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID); - OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID); AfterHit += SpellHitFn(spell_sha_heroism_SpellScript::ApplyDebuff); } }; diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index e20eb07d45a..74118599b9f 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -302,15 +302,15 @@ class spell_warl_seed_of_corruption : public SpellScriptLoader { PrepareSpellScript(spell_warl_seed_of_corruption_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { if (GetExplTargetUnit()) - unitList.remove(GetExplTargetUnit()); + targets.remove(GetExplTargetUnit()); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_warl_seed_of_corruption_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warl_seed_of_corruption_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); } }; diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 463b9b2fb97..c64101e11ea 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -77,7 +77,7 @@ class spell_warr_improved_spell_reflection : public SpellScriptLoader { PrepareSpellScript(spell_warr_improved_spell_reflection_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& unitList) { if (GetCaster()) unitList.remove(GetCaster()); @@ -85,7 +85,7 @@ class spell_warr_improved_spell_reflection : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_warr_improved_spell_reflection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_PARTY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warr_improved_spell_reflection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_PARTY); } }; diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp index 045dea9c9a9..abb20130ef8 100644 --- a/src/server/scripts/World/boss_emerald_dragons.cpp +++ b/src/server/scripts/World/boss_emerald_dragons.cpp @@ -224,9 +224,9 @@ class DreamFogTargetSelector public: DreamFogTargetSelector() { } - bool operator()(Unit* unit) + bool operator()(WorldObject* object) const { - return unit->HasAura(SPELL_SLEEP); + return object->ToUnit() && object->ToUnit()->HasAura(SPELL_SLEEP); } }; @@ -239,14 +239,14 @@ class spell_dream_fog_sleep : public SpellScriptLoader { PrepareSpellScript(spell_dream_fog_sleep_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& unitList) { - unitList.remove_if (DreamFogTargetSelector()); + unitList.remove_if(DreamFogTargetSelector()); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_dream_fog_sleep_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dream_fog_sleep_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); } }; @@ -265,10 +265,12 @@ class MarkOfNatureTargetSelector public: MarkOfNatureTargetSelector() { } - bool operator()(Unit* unit) + bool operator()(WorldObject* object) const { - // return anyone that isn't tagged or already under the influence of Aura of Nature - return !(unit->HasAura(SPELL_MARK_OF_NATURE) && !unit->HasAura(SPELL_AURA_OF_NATURE)); + if (Unit* unit = object->ToUnit()) + // return anyone that isn't tagged or already under the influence of Aura of Nature + return !(unit->HasAura(SPELL_MARK_OF_NATURE) && !unit->HasAura(SPELL_AURA_OF_NATURE)); + return true; } }; @@ -290,9 +292,9 @@ class spell_mark_of_nature : public SpellScriptLoader return true; } - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - unitList.remove_if (MarkOfNatureTargetSelector()); + targets.remove_if(MarkOfNatureTargetSelector()); } void HandleEffect(SpellEffIndex effIndex) @@ -305,7 +307,7 @@ class spell_mark_of_nature : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_mark_of_nature_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mark_of_nature_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_mark_of_nature_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_APPLY_AURA); } }; diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index fb2fdf09583..4fac31a9ac6 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -185,8 +185,7 @@ class ByteBuffer ByteBuffer &operator<<(const char *str) { - size_t len = 0; - if (str && (len = strlen(str))) + if (size_t len = (str ? strlen(str) : 0)) append((uint8 const*)str, len); append((uint8)0); return *this; From 067c27d29920baaa97a242dea8d192dc848fdbd8 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 30 Jun 2012 00:06:17 +0200 Subject: [PATCH 1119/1149] Core/SpellScript: Corrected error messages and in-source documentation for OnObjectAreaTargetSelect hook and allow using that hook only for area spell targets --- src/server/game/Spells/Spell.cpp | 2 +- src/server/game/Spells/SpellScript.cpp | 49 +++++++++++++++++++++----- src/server/game/Spells/SpellScript.h | 24 ++++++++----- 3 files changed, 58 insertions(+), 17 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 6b102c25882..e9ae93751b8 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -7042,7 +7042,7 @@ void Spell::CallScriptObjectAreaTargetSelectHandlers(std::list& ta { for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { - (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_UNIT_TARGET_SELECT); + (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_OBJECT_AREA_TARGET_SELECT); std::list::iterator hookItrEnd = (*scritr)->OnObjectAreaTargetSelect.end(), hookItr = (*scritr)->OnObjectAreaTargetSelect.begin(); for (; hookItr != hookItrEnd; ++hookItr) if ((*hookItr).IsEffectAffected(m_spellInfo, effIndex)) diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index eaccb8fc005..f033a4c043e 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -203,20 +203,19 @@ void SpellScript::HitHandler::Call(SpellScript* spellScript) (spellScript->*pHitHandlerScript)(); } -SpellScript::ObjectAreaTargetSelectHandler::ObjectAreaTargetSelectHandler(SpellObjectAreaTargetSelectFnType _pObjectAreaTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType) - : _SpellScript::EffectHook(_effIndex), targetType(_targetType) +SpellScript::TargetHook::TargetHook(uint8 _effectIndex, uint16 _targetType, bool _area) + : _SpellScript::EffectHook(_effectIndex), targetType(_targetType), area(_area) { - pObjectAreaTargetSelectHandlerScript = _pObjectAreaTargetSelectHandlerScript; } -std::string SpellScript::ObjectAreaTargetSelectHandler::ToString() +std::string SpellScript::TargetHook::ToString() { std::ostringstream oss; oss << "Index: " << EffIndexToString() << " Target: " << targetType; return oss.str(); } -bool SpellScript::ObjectAreaTargetSelectHandler::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex) +bool SpellScript::TargetHook::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex) { if (!targetType) return false; @@ -225,8 +224,42 @@ bool SpellScript::ObjectAreaTargetSelectHandler::CheckEffect(SpellInfo const* sp spellEntry->Effects[effIndex].TargetB.GetTarget() != targetType) return false; - // TODO: Smart check if this hook will run for this targetType - return true; + SpellImplicitTargetInfo targetType(targetType); + switch (targetType.GetSelectionCategory()) + { + case TARGET_SELECT_CATEGORY_CHANNEL: // SINGLE + return !area; + case TARGET_SELECT_CATEGORY_NEARBY: // BOTH + return true; + case TARGET_SELECT_CATEGORY_CONE: // AREA + case TARGET_SELECT_CATEGORY_AREA: // AREA + return area; + case TARGET_SELECT_CATEGORY_DEFAULT: + switch (targetType.GetObjectType()) + { + case TARGET_OBJECT_TYPE_SRC: // EMPTY + case TARGET_OBJECT_TYPE_DEST: // EMPTY + return false; + default: + switch(targetType.GetReferenceType()) + { + case TARGET_REFERENCE_TYPE_CASTER: // SINGLE + return !area; + case TARGET_REFERENCE_TYPE_TARGET: // BOTH + return true; + } + break; + } + break; + } + + return false; +} + +SpellScript::ObjectAreaTargetSelectHandler::ObjectAreaTargetSelectHandler(SpellObjectAreaTargetSelectFnType _pObjectAreaTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType) + : TargetHook(_effIndex, _targetType, true) +{ + pObjectAreaTargetSelectHandlerScript = _pObjectAreaTargetSelectHandlerScript; } void SpellScript::ObjectAreaTargetSelectHandler::Call(SpellScript* spellScript, std::list& targets) @@ -254,7 +287,7 @@ bool SpellScript::_Validate(SpellInfo const* entry) for (std::list::iterator itr = OnObjectAreaTargetSelect.begin(); itr != OnObjectAreaTargetSelect.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnUnitTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); + sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnObjectAreaTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); return _SpellScript::_Validate(entry); } diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index a145a0b7377..9b1afd75405 100755 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -131,7 +131,7 @@ enum SpellScriptHookType SPELL_SCRIPT_HOOK_BEFORE_HIT, SPELL_SCRIPT_HOOK_HIT, SPELL_SCRIPT_HOOK_AFTER_HIT, - SPELL_SCRIPT_HOOK_UNIT_TARGET_SELECT, + SPELL_SCRIPT_HOOK_OBJECT_AREA_TARGET_SELECT, SPELL_SCRIPT_HOOK_CHECK_CAST, SPELL_SCRIPT_HOOK_BEFORE_CAST, SPELL_SCRIPT_HOOK_ON_CAST, @@ -196,16 +196,24 @@ class SpellScript : public _SpellScript SpellHitFnType pHitHandlerScript; }; - class ObjectAreaTargetSelectHandler : public _SpellScript::EffectHook + class TargetHook : public _SpellScript::EffectHook + { + public: + TargetHook(uint8 _effectIndex, uint16 _targetType, bool _area); + bool CheckEffect(SpellInfo const* spellEntry, uint8 targetType); + std::string ToString(); + protected: + uint16 targetType; + bool area; + }; + + class ObjectAreaTargetSelectHandler : public TargetHook { public: ObjectAreaTargetSelectHandler(SpellObjectAreaTargetSelectFnType _pObjectAreaTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType); - std::string ToString(); - bool CheckEffect(SpellInfo const* spellEntry, uint8 targetType); void Call(SpellScript* spellScript, std::list& targets); private: SpellObjectAreaTargetSelectFnType pObjectAreaTargetSelectHandlerScript; - uint16 targetType; }; #define SPELLSCRIPT_FUNCTION_CAST_DEFINES(CLASSNAME) \ @@ -267,15 +275,15 @@ class SpellScript : public _SpellScript // where function is: void function() #define SpellHitFn(F) HitHandlerFunction(&F) - // example: OnUnitTargetSelect += SpellUnitTargetFn(class::function, EffectIndexSpecifier, TargetsNameSpecifier); - // where function is void function(std::list& targetList) + // example: OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(class::function, EffectIndexSpecifier, TargetsNameSpecifier); + // where function is void function(std::list& targets) HookList OnObjectAreaTargetSelect; #define SpellObjectAreaTargetSelectFn(F, I, N) ObjectAreaTargetSelectHandlerFunction(&F, I, N) // hooks are executed in following order, at specified event of spell: // 1. BeforeCast - executed when spell preparation is finished (when cast bar becomes full) before cast is handled // 2. OnCheckCast - allows to override result of CheckCast function - // 3. OnUnitTargetSelect - executed just before adding selected targets to final target list + // 3a. OnObjectAreaTargetSelect - executed just before adding selected targets to final target list (for area targets) // 4. OnCast - executed just before spell is launched (creates missile) or executed // 5. AfterCast - executed after spell missile is launched and immediate spell actions are done // 6. OnEffectLaunch - executed just before specified effect handler call - when spell missile is launched From 469c7a0955b819655dbf9ed0ab4c14fcb5a4cc09 Mon Sep 17 00:00:00 2001 From: QAston Date: Sat, 30 Jun 2012 10:43:34 +0200 Subject: [PATCH 1120/1149] Core/Scripts: fix a crash from e0997874f5bf8d38b67ad3dee66e3d808dd1a059 --- src/server/game/Spells/SpellScript.cpp | 2 +- src/server/game/Spells/SpellScript.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index f033a4c043e..633e08e6fb1 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -224,7 +224,7 @@ bool SpellScript::TargetHook::CheckEffect(SpellInfo const* spellEntry, uint8 eff spellEntry->Effects[effIndex].TargetB.GetTarget() != targetType) return false; - SpellImplicitTargetInfo targetType(targetType); + SpellImplicitTargetInfo targetType(this->targetType); switch (targetType.GetSelectionCategory()) { case TARGET_SELECT_CATEGORY_CHANNEL: // SINGLE diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index 9b1afd75405..51631bb8ffe 100755 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -200,7 +200,7 @@ class SpellScript : public _SpellScript { public: TargetHook(uint8 _effectIndex, uint16 _targetType, bool _area); - bool CheckEffect(SpellInfo const* spellEntry, uint8 targetType); + bool CheckEffect(SpellInfo const* spellEntry, uint8 effIndex); std::string ToString(); protected: uint16 targetType; From c8d20004a50d823c7acc4de97266615827af29f7 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 30 Jun 2012 16:07:09 +0200 Subject: [PATCH 1121/1149] Core: Minor code style corrections --- .../collision/Models/GameObjectModel.cpp | 2 +- src/server/collision/RegularGrid.h | 2 +- src/server/game/Conditions/ConditionMgr.cpp | 2 +- .../game/Handlers/AuctionHouseHandler.cpp | 2 +- .../Movement/Spline/MovementPacketBuilder.cpp | 2 +- .../game/Spells/Auras/SpellAuraEffects.cpp | 2 +- src/server/game/Spells/Spell.cpp | 16 +++---- src/server/game/Spells/SpellScript.cpp | 8 ++-- src/server/game/Warden/Warden.cpp | 2 +- src/server/game/Warden/WardenCheckMgr.cpp | 2 +- src/server/game/Warden/WardenMac.cpp | 4 +- src/server/game/Warden/WardenWin.cpp | 4 +- .../boss_pyroguard_emberseer.cpp | 2 +- .../IcecrownCitadel/boss_rotface.cpp | 2 +- .../boss_valithria_dreamwalker.cpp | 4 +- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 2 +- .../scripts/Outland/blades_edge_mountains.cpp | 2 +- .../shared/Cryptography/WardenKeyGeneration.h | 42 +++++++++++-------- .../shared/Database/PreparedStatement.cpp | 2 +- 19 files changed, 55 insertions(+), 49 deletions(-) diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp index 84c736c22e8..8b63620e783 100644 --- a/src/server/collision/Models/GameObjectModel.cpp +++ b/src/server/collision/Models/GameObjectModel.cpp @@ -176,7 +176,7 @@ bool GameObjectModel::intersectRay(const G3D::Ray& ray, float& MaxDist, bool Sto Ray modRay(p, iInvRot * ray.direction()); float distance = MaxDist * iInvScale; bool hit = iModel->IntersectRay(modRay, distance, StopAtFirstHit); - if(hit) + if (hit) { distance *= iScale; MaxDist = distance; diff --git a/src/server/collision/RegularGrid.h b/src/server/collision/RegularGrid.h index 2867b29cfc1..00d7b0cd209 100644 --- a/src/server/collision/RegularGrid.h +++ b/src/server/collision/RegularGrid.h @@ -176,7 +176,7 @@ public: } if (cell == last_cell) break; - if(tMaxX < tMaxY) + if (tMaxX < tMaxY) { tMaxX += tDeltaX; cell.x += stepX; diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 4176d9f605b..9f534ab697d 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -441,7 +441,7 @@ uint32 Condition::GetSearcherTypeMaskForCondition() uint32 Condition::GetMaxAvailableConditionTargets() { // returns number of targets which are available for given source type - switch(SourceType) + switch (SourceType) { case CONDITION_SOURCE_TYPE_SPELL: case CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET: diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index d26f275b864..3aee9ff0b00 100755 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -161,7 +161,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) etime *= MINUTE; - switch(etime) + switch (etime) { case 1*MIN_AUCTION_TIME: case 2*MIN_AUCTION_TIME: diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp index 16f06a25058..8aef671d2d1 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp @@ -49,7 +49,7 @@ namespace Movement data << move_spline.spline.getPoint(move_spline.spline.first()); data << move_spline.GetId(); - switch(splineflags & MoveSplineFlag::Mask_Final_Facing) + switch (splineflags & MoveSplineFlag::Mask_Final_Facing) { case MoveSplineFlag::Final_Target: data << uint8(MonsterMoveFacingTarget); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index ac51fff81f6..a4acff2a47c 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5083,7 +5083,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool break; case SPELLFAMILY_ROGUE: // Tricks of the trade - switch(GetId()) + switch (GetId()) { case 59628: //Tricks of the trade buff on rogue (6sec duration) target->SetReducedThreatPercent(0,0); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index e9ae93751b8..33ecd66e8f6 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -827,7 +827,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar break; } - switch(targetType.GetSelectionCategory()) + switch (targetType.GetSelectionCategory()) { case TARGET_SELECT_CATEGORY_CHANNEL: SelectImplicitChannelTargets(effIndex, targetType); @@ -845,7 +845,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar switch (targetType.GetObjectType()) { case TARGET_OBJECT_TYPE_SRC: - switch(targetType.GetReferenceType()) + switch (targetType.GetReferenceType()) { case TARGET_REFERENCE_TYPE_CASTER: m_targets.SetSrc(*m_caster); @@ -856,7 +856,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar } break; case TARGET_OBJECT_TYPE_DEST: - switch(targetType.GetReferenceType()) + switch (targetType.GetReferenceType()) { case TARGET_REFERENCE_TYPE_CASTER: SelectImplicitCasterDestTargets(effIndex, targetType); @@ -873,7 +873,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar } break; default: - switch(targetType.GetReferenceType()) + switch (targetType.GetReferenceType()) { case TARGET_REFERENCE_TYPE_CASTER: SelectImplicitCasterObjectTargets(effIndex, targetType); @@ -1367,7 +1367,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType) { - switch(targetType.GetTarget()) + switch (targetType.GetTarget()) { case TARGET_DEST_CASTER: m_targets.SetDst(*m_caster); @@ -1432,7 +1432,7 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici void Spell::SelectImplicitTargetDestTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType) { WorldObject* target = m_targets.GetObjectTarget(); - switch(targetType.GetTarget()) + switch (targetType.GetTarget()) { case TARGET_DEST_TARGET_ENEMY: case TARGET_DEST_TARGET_ANY: @@ -1465,7 +1465,7 @@ void Spell::SelectImplicitDestDestTargets(SpellEffIndex effIndex, SpellImplicitT if (!m_targets.HasDst()) m_targets.SetDst(*m_caster); - switch(targetType.GetTarget()) + switch (targetType.GetTarget()) { case TARGET_DEST_DYNOBJ_ENEMY: case TARGET_DEST_DYNOBJ_ALLY: @@ -1491,7 +1491,7 @@ void Spell::SelectImplicitDestDestTargets(SpellEffIndex effIndex, SpellImplicitT void Spell::SelectImplicitCasterObjectTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType) { - switch(targetType.GetTarget()) + switch (targetType.GetTarget()) { case TARGET_UNIT_CASTER: AddUnitTarget(m_caster, 1 << effIndex, false); diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 633e08e6fb1..a19c356b9ed 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -224,8 +224,8 @@ bool SpellScript::TargetHook::CheckEffect(SpellInfo const* spellEntry, uint8 eff spellEntry->Effects[effIndex].TargetB.GetTarget() != targetType) return false; - SpellImplicitTargetInfo targetType(this->targetType); - switch (targetType.GetSelectionCategory()) + SpellImplicitTargetInfo targetInfo(targetType); + switch (targetInfo.GetSelectionCategory()) { case TARGET_SELECT_CATEGORY_CHANNEL: // SINGLE return !area; @@ -235,13 +235,13 @@ bool SpellScript::TargetHook::CheckEffect(SpellInfo const* spellEntry, uint8 eff case TARGET_SELECT_CATEGORY_AREA: // AREA return area; case TARGET_SELECT_CATEGORY_DEFAULT: - switch (targetType.GetObjectType()) + switch (targetInfo.GetObjectType()) { case TARGET_OBJECT_TYPE_SRC: // EMPTY case TARGET_OBJECT_TYPE_DEST: // EMPTY return false; default: - switch(targetType.GetReferenceType()) + switch (targetInfo.GetReferenceType()) { case TARGET_REFERENCE_TYPE_CASTER: // SINGLE return !area; diff --git a/src/server/game/Warden/Warden.cpp b/src/server/game/Warden/Warden.cpp index 8608701e2ee..54e56174b1a 100644 --- a/src/server/game/Warden/Warden.cpp +++ b/src/server/game/Warden/Warden.cpp @@ -211,7 +211,7 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& recvData) sLog->outDebug(LOG_FILTER_WARDEN, "Got packet, opcode %02X, size %u", opcode, uint32(recvData.size())); recvData.hexlike(); - switch(opcode) + switch (opcode) { case WARDEN_CMSG_MODULE_MISSING: _warden->SendModuleToClient(); diff --git a/src/server/game/Warden/WardenCheckMgr.cpp b/src/server/game/Warden/WardenCheckMgr.cpp index f4c7a5069cf..abd7ff8f87d 100644 --- a/src/server/game/Warden/WardenCheckMgr.cpp +++ b/src/server/game/Warden/WardenCheckMgr.cpp @@ -121,7 +121,7 @@ void WardenCheckMgr::LoadWardenChecks() if (checkType == MPQ_CHECK || checkType == MEM_CHECK) { - WardenCheckResult *wr = new WardenCheckResult(); + WardenCheckResult* wr = new WardenCheckResult(); wr->Result.SetHexStr(checkResult.c_str()); int len = checkResult.size() / 2; if (wr->Result.GetNumBytes() < len) diff --git a/src/server/game/Warden/WardenMac.cpp b/src/server/game/Warden/WardenMac.cpp index 319cda304cc..3cc95b9f3f7 100644 --- a/src/server/game/Warden/WardenMac.cpp +++ b/src/server/game/Warden/WardenMac.cpp @@ -43,8 +43,8 @@ void WardenMac::Init(WorldSession *pClient, BigNumber *K) _session = pClient; // Generate Warden Key SHA1Randx WK(K->AsByteArray(), K->GetNumBytes()); - WK.generate(_inputKey, 16); - WK.generate(_outputKey, 16); + WK.Generate(_inputKey, 16); + WK.Generate(_outputKey, 16); /* Seed: 4D808D2C77D905C41A6380EC08586AFE (0x05 packet) Hash: (0x04 packet) diff --git a/src/server/game/Warden/WardenWin.cpp b/src/server/game/Warden/WardenWin.cpp index a7485d7da51..9aa439ec8c0 100644 --- a/src/server/game/Warden/WardenWin.cpp +++ b/src/server/game/Warden/WardenWin.cpp @@ -47,8 +47,8 @@ void WardenWin::Init(WorldSession* session, BigNumber *k) _session = session; // Generate Warden Key SHA1Randx WK(k->AsByteArray(), k->GetNumBytes()); - WK.generate(_inputKey, 16); - WK.generate(_outputKey, 16); + WK.Generate(_inputKey, 16); + WK.Generate(_outputKey, 16); memcpy(_seed, Module.Seed, 16); diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp index 0279f3e2834..015c13d1098 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp @@ -64,7 +64,7 @@ public: void Reset() { - if(instance->GetBossState(DATA_PYROGAURD_EMBERSEER) == IN_PROGRESS) + if (instance->GetBossState(DATA_PYROGAURD_EMBERSEER) == IN_PROGRESS) OpenDoors(false); instance->SetBossState(DATA_PYROGAURD_EMBERSEER,NOT_STARTED); // respawn any dead Blackhand Incarcerators diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index 079a2ef48e1..5a0560293da 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -494,7 +494,7 @@ class spell_rotface_mutated_infection : public SpellScriptLoader { // remove targets with this aura already // tank is not on this list - targets.remove_if (Trinity::UnitAuraCheck(true, GetSpellInfo()->Id)); + targets.remove_if(Trinity::UnitAuraCheck(true, GetSpellInfo()->Id)); if (targets.empty()) return; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index 82946ad1f13..826c62a4390 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -1189,7 +1189,7 @@ class spell_dreamwalker_summoner : public SpellScriptLoader void FilterTargets(std::list& targets) { - targets.remove_if (Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED)); + targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED)); if (targets.empty()) return; @@ -1238,7 +1238,7 @@ class spell_dreamwalker_summon_suppresser : public SpellScriptLoader std::list summoners; GetCreatureListWithEntryInGrid(summoners, caster, NPC_WORLD_TRIGGER, 100.0f); - summoners.remove_if (Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED)); + summoners.remove_if(Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED)); Trinity::Containers::RandomResizeList(summoners, 2); if (summoners.empty()) return; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index ce0a61d1099..9d5adf39817 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -1230,7 +1230,7 @@ public: //bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) //{ // player->PlayerTalkClass->ClearMenus(); - // switch(action) + // switch (action) // { // case GOSSIP_ACTION_INFO_DEF+1: // if (player) diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index 4ec1d04b6ad..c46757a3956 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -651,7 +651,7 @@ class npc_simon_bunny : public CreatureScript { _events.Update(diff); - switch(_events.ExecuteEvent()) + switch (_events.ExecuteEvent()) { case EVENT_SIMON_PERIODIC_PLAYER_CHECK: if (!CheckPlayer()) diff --git a/src/server/shared/Cryptography/WardenKeyGeneration.h b/src/server/shared/Cryptography/WardenKeyGeneration.h index 9b44ab1832e..f0a9905b6fe 100644 --- a/src/server/shared/Cryptography/WardenKeyGeneration.h +++ b/src/server/shared/Cryptography/WardenKeyGeneration.h @@ -21,50 +21,56 @@ #ifndef _WARDEN_KEY_GENERATION_H #define _WARDEN_KEY_GENERATION_H -class SHA1Randx { +class SHA1Randx +{ public: - SHA1Randx(uint8 *buff, uint32 size) { + SHA1Randx(uint8* buff, uint32 size) + { uint32 taken = size/2; sh.Initialize(); - sh.UpdateData(buff,taken); + sh.UpdateData(buff, taken); sh.Finalize(); - memcpy(o1,sh.GetDigest(),20); + memcpy(o1, sh.GetDigest(), 20); sh.Initialize(); - sh.UpdateData(buff+taken,size-taken); + sh.UpdateData(buff + taken, size - taken); sh.Finalize(); - memcpy(o2,sh.GetDigest(),20); + memcpy(o2, sh.GetDigest(), 20); - memset(o0,0x00,20); + memset(o0, 0x00, 20); - fillUp(); + FillUp(); } - void generate(uint8 *buf, uint32 sz) { - for(uint32 i=0;ibind_result_done) + if (m_Mstmt->bind_result_done) { delete[] m_Mstmt->bind->length; delete[] m_Mstmt->bind->is_null; From 330880906612458a5edd1f4248c8001575197dc7 Mon Sep 17 00:00:00 2001 From: Faq Date: Sat, 30 Jun 2012 21:27:09 +0300 Subject: [PATCH 1122/1149] Correcting Black Ice bonus dmg for Scourge strike shadow part. Thnx Tibbi & Shauren --- src/server/scripts/Spells/spell_dk.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 6a58f3d03c5..5095092927e 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -41,6 +41,7 @@ enum DeathKnightSpells DK_SPELL_UNHOLY_PRESENCE = 48265, DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED = 63622, SPELL_DK_ITEM_T8_MALEE_4P_BONUS = 64736, + DK_SPELL_BLACK_ICE_R1 = 49140, }; // 50462 - Anti-Magic Shell (on raid member) @@ -422,6 +423,10 @@ class spell_dk_scourge_strike : public SpellScriptLoader if (Unit* unitTarget = GetHitUnit()) { int32 bp = GetHitDamage() * multiplier; + + if (AuraEffect* aurEff = caster->GetAuraEffectOfRankedSpell(DK_SPELL_BLACK_ICE_R1, EFFECT_0)) + AddPctN(bp, aurEff->GetAmount()); + caster->CastCustomSpell(unitTarget, DK_SPELL_SCOURGE_STRIKE_TRIGGERED, &bp, NULL, NULL, true); } } From ee2252163fc1dd95991a57d3714ace1f7442be28 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 30 Jun 2012 23:14:34 +0200 Subject: [PATCH 1123/1149] Scripts/Icecrown Citadel: Fixed visual and target selection of Sindragosa's Fury --- .../IcecrownCitadel/boss_sindragosa.cpp | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index f6d9de9e967..bcf3229b7d2 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -1041,7 +1041,26 @@ class spell_sindragosa_s_fury : public SpellScriptLoader bool Load() { _targetCount = 0; - return true; + + // This script should execute only in Icecrown Citadel + if (InstanceMap* instance = GetCaster()->GetMap()->ToInstanceMap()) + if (instance->GetInstanceScript()) + if (instance->GetScriptId() == sObjectMgr->GetScriptId(ICCScriptName)) + return true; + + return false; + } + + void SelectDest() + { + if (Position* dest = const_cast(GetExplTargetDest())) + { + float destX = float(rand_norm()) * 75.0f + 4350.0f; + float destY = float(rand_norm()) * 75.0f + 2450.0f; + float destZ = 205.0f; // random number close to ground, get exact in next call + GetCaster()->UpdateGroundPositionZ(destX, destY, destZ); + dest->Relocate(destX, destY, destZ); + } } void CountTargets(std::list& targets) @@ -1057,10 +1076,10 @@ class spell_sindragosa_s_fury : public SpellScriptLoader return; float resistance = float(GetHitUnit()->GetResistance(SpellSchoolMask(GetSpellInfo()->SchoolMask))); - uint32 minResistFactor = uint32((resistance / (resistance + 510.0f))* 10.0f) * 2; - uint32 randomResist = urand(0, (9 - minResistFactor) * 100)/100 + minResistFactor; + uint32 minResistFactor = uint32((resistance / (resistance + 510.0f)) * 10.0f) * 2; + uint32 randomResist = urand(0, (9 - minResistFactor) * 100) / 100 + minResistFactor; - uint32 damage = (uint32(GetEffectValue()/_targetCount) * randomResist) / 10; + uint32 damage = (uint32(GetEffectValue() / _targetCount) * randomResist) / 10; SpellNonMeleeDamage damageInfo(GetCaster(), GetHitUnit(), GetSpellInfo()->Id, GetSpellInfo()->SchoolMask); damageInfo.damage = damage; @@ -1070,8 +1089,9 @@ class spell_sindragosa_s_fury : public SpellScriptLoader void Register() { - OnEffectHitTarget += SpellEffectFn(spell_sindragosa_s_fury_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); + BeforeCast += SpellCastFn(spell_sindragosa_s_fury_SpellScript::SelectDest); OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sindragosa_s_fury_SpellScript::CountTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ENTRY); + OnEffectHitTarget += SpellEffectFn(spell_sindragosa_s_fury_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); } uint32 _targetCount; From bd8226414d288cedf5a8ae00f0d88dcf694e384d Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 30 Jun 2012 23:22:51 +0200 Subject: [PATCH 1124/1149] Missed change for previous commit --- src/server/game/Spells/SpellMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 0b1955a02ec..d40c08f1c4c 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3441,7 +3441,7 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd break; case 70598: // Sindragosa's Fury - spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_CASTER; + spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_DEST; break; case 69846: // Frost Bomb spellInfo->speed = 0.0f; // This spell's summon happens instantly From f4ec8b033dd62a2a3b8e665f00ad0283a6894856 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 1 Jul 2012 01:15:13 +0200 Subject: [PATCH 1125/1149] Scripts/Icecrown Citadel: Fixed Frost Bomb ignoring line of sight checks --- .../scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index bcf3229b7d2..e3c0f2260df 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -19,6 +19,7 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "SpellAuraEffects.h" +#include "GridNotifiers.h" #include "icecrown_citadel.h" enum Texts @@ -183,7 +184,7 @@ class FrostBombExplosion : public BasicEvent bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) { - _owner->CastSpell((Unit*)NULL, SPELL_FROST_BOMB, true, NULL, NULL, _sindragosaGUID); + _owner->CastSpell((Unit*)NULL, SPELL_FROST_BOMB, false, NULL, NULL, _sindragosaGUID); _owner->RemoveAurasDueToSpell(SPELL_FROST_BOMB_VISUAL); return true; } From 6eadc63ade75b0ad6e3b22d2a21d22e94938d1b1 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 1 Jul 2012 01:42:58 +0200 Subject: [PATCH 1126/1149] Core/VMaps: Use fabs instead of abs for float type. On some platforms abs has only int overload exists. --- src/server/collision/Models/WorldModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/collision/Models/WorldModel.cpp b/src/server/collision/Models/WorldModel.cpp index b818232fb32..b4f3f73fc98 100644 --- a/src/server/collision/Models/WorldModel.cpp +++ b/src/server/collision/Models/WorldModel.cpp @@ -42,7 +42,7 @@ namespace VMAP const Vector3 p(ray.direction().cross(e2)); const float a = e1.dot(p); - if (abs(a) < EPS) { + if (fabs(a) < EPS) { // Determinant is ill-conditioned; abort early return false; } From 86353cdde14237a2e9908b49c5785530f91dbd3a Mon Sep 17 00:00:00 2001 From: 4m1g0 Date: Sun, 1 Jul 2012 15:25:33 +0200 Subject: [PATCH 1127/1149] Core/Scripts: Use proper headers, code style, creature_texts and cleanup (Battle for Mount Hyjal) --- .../2012_07_01_00_world_creature_text.sql | 64 ++++++++++ .../BattleForMountHyjal/boss_anetheron.cpp | 113 ++++-------------- .../BattleForMountHyjal/boss_archimonde.cpp | 113 ++++++++---------- .../BattleForMountHyjal/boss_azgalor.cpp | 67 ++++------- .../BattleForMountHyjal/boss_kazrogal.cpp | 56 ++------- .../boss_rage_winterchill.cpp | 85 ++++--------- .../BattleForMountHyjal/hyjal.cpp | 4 +- .../CavernsOfTime/BattleForMountHyjal/hyjal.h | 2 +- .../BattleForMountHyjal/hyjalAI.cpp | 20 ++-- .../BattleForMountHyjal/hyjalAI.h | 68 ++++++----- .../BattleForMountHyjal/hyjal_trash.cpp | 55 ++++----- .../BattleForMountHyjal/instance_hyjal.cpp | 9 +- 12 files changed, 284 insertions(+), 372 deletions(-) create mode 100644 sql/updates/world/2012_07_01_00_world_creature_text.sql diff --git a/sql/updates/world/2012_07_01_00_world_creature_text.sql b/sql/updates/world/2012_07_01_00_world_creature_text.sql new file mode 100644 index 00000000000..6f2bed8e7d6 --- /dev/null +++ b/sql/updates/world/2012_07_01_00_world_creature_text.sql @@ -0,0 +1,64 @@ +-- Anetheron +DELETE FROM `creature_text` WHERE `entry`=17808; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(17808,0,0, 'The clock... is still... ticking.',14,0,100,0,0,10982, 'Anetheron - SAY_ONDEATH'), +(17808,1,0, 'Your hopes are lost!',14,0,100,0,0,10981, 'Anetheron - SAY_ONSLAY1'), +(17808,1,1, 'Scream for me!',14,0,100,0,0,11038, 'Anetheron - SAY_ONSLAY2'), +(17808,1,2, 'Pity, no time for a slow death!',14,0,100,0,0,11039, 'Anetheron - SAY_ONSLAY3'), +(17808,2,0, 'The swarm is eager to feed!',14,0,100,0,0,10979, 'Anetheron - SAY_SWARM1'), +(17808,2,1, 'Pestilence upon you!',14,0,100,0,0,11037, 'Anetheron - SAY_SWARM2'), +(17808,3,0, 'You look tired...',14,0,100,0,0,10978, 'Anetheron - SAY_SLEEP1'), +(17808,3,1, 'Sweet dreams...',14,0,100,0,0,11545, 'Anetheron - SAY_SLEEP2'), +(17808,4,0, 'Let fire rain from above!',14,0,100,0,0,10980, 'Anetheron - SAY_INFERNO1'), +(17808,4,1, 'Earth and sky shall burn!',14,0,100,0,0,11036, 'Anetheron - SAY_INFERNO2'), +(17808,5,0, 'You are defenders of a doomed world! Flee here, and perhaps you will prolong your pathetic lives!',14,0,100,0,0,10977, 'Anetheron - SAY_ONAGGRO'); + +-- Azgalor +DELETE FROM `creature_text` WHERE `entry`=17842; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(17842,0,0, 'Your time is almost... up',14,0,100,0,0,11002, 'Azgalor - SAY_ONDEATH'), +(17842,1,0, 'Reesh, hokta!',14,0,100,0,0,11001, 'Azgalor - SAY_ONSLAY1'), +(17842,1,1, 'Don''t fight it',14,0,100,0,0,11048, 'Azgalor - SAY_ONSLAY2'), +(17842,1,2, 'No one is going to save you',14,0,100,0,0,11047, 'Azgalor - SAY_ONSLAY3'), +(17842,2,0, 'Just a taste... of what awaits you',14,0,100,0,0,11046, 'Azgalor - SAY_DOOM1'), +(17842,2,1, 'Suffer you despicable insect!',14,0,100,0,0,11000, 'Azgalor - SAY_DOOM2'), +(17842,3,0, 'Abandon all hope! The legion has returned to finish what was begun so many years ago. This time there will be no escape!',14,0,100,0,0,10999, 'Azgalor - SAY_ONAGGRO'); + +-- Kazrogal +DELETE FROM `creature_text` WHERE `entry`=17888; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(17888,0,0, 'Shaza-Kiel!',14,0,100,0,0,11017, 'Kazrogal - SAY_ONSLAY1'), +(17888,0,1, 'You... are nothing!',14,0,100,0,0,11053, 'Kazrogal - SAY_ONSLAY2'), +(17888,0,2, 'Miserable nuisance!',14,0,100,0,0,11054, 'Kazrogal - SAY_ONSLAY3'), +(17888,1,0, 'Your death will be a painful one.',14,0,100,0,0,11016, 'Kazrogal - SAY_MARK1'), +(17888,1,1, 'You... are marked.',14,0,100,0,0,11052, 'Kazrogal - SAY_MARK2'), +(17888,2,0, 'Cry for mercy! Your meaningless lives will soon be forfeit.',14,0,100,0,0,11015, 'Kazrogal - SAY_ONAGGRO'); + +-- Rage Winterchill +DELETE FROM `creature_text` WHERE `entry`=17767; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(17767,0,0, 'You have won this battle, but not... the... war',14,0,100,0,0,11026, 'Rage Winterchill - SAY_ONDEATH'), +(17767,1,0, 'All life must perish!',14,0,100,0,0,11025, 'Rage Winterchill - SAY_ONSLAY1'), +(17767,1,1, 'Victory to the Legion!',14,0,100,0,0,11057, 'Rage Winterchill - SAY_ONSLAY2'), +(17767,2,0, 'Crumble and rot!',14,0,100,0,0,11023, 'Rage Winterchill - SAY_DECAY1'), +(17767,2,1, 'Ashes to ashes, dust to dust',14,0,100,0,0,11055, 'Rage Winterchill - SAY_DECAY2'), +(17767,3,0, 'Succumb to the icy chill... of death!',14,0,100,0,0,11024, 'Rage Winterchill - SAY_NOVA1'), +(17767,3,1, 'It will be much colder in your grave',14,0,100,0,0,11058, 'Rage Winterchill - SAY_NOVA2'), +(17767,4,0, 'The Legion''s final conquest has begun! Once again the subjugation of this world is within our grasp. Let none survive!',14,0,100,0,0,11022, 'Rage Winterchill - SAY_ONAGGRO'); + +-- Archimonde +DELETE FROM `creature_text` WHERE `entry`=17968; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(17968,1,0, 'Your resistance is insignificant.',14,0,100,0,0,10987, 'Archimonde - SAY_AGGRO'), +(17968,2,0, 'This world will burn!',14,0,100,0,0,10990, 'Archimonde - SAY_DOOMFIRE1'), +(17968,2,1, 'Manach sheek-thrish!',14,0,100,0,0,11041, 'Archimonde - SAY_DOOMFIRE2'), +(17968,3,0, 'A-kreesh!',14,0,100,0,0,11041, 'Archimonde - SAY_AIR_BURST1'), +(17968,3,1, 'Away vermin!',14,0,100,0,0,10989, 'Archimonde - SAY_AIR_BURST2'), +(17968,4,0, 'All creation will be devoured!',14,0,100,0,0,11044, 'Archimonde - SAY_SLAY1'), +(17968,4,1, 'Your soul will languish for eternity.',14,0,100,0,0,10991, 'Archimonde - SAY_SLAY12'), +(17968,4,2, 'I am the coming of the end!',14,0,100,0,0,11045, 'Archimonde - SAY_SLAY3'), +(17968,5,0, 'At last it is here. Mourn and lament the passing of all you have ever known and all that would have been! Akmin-kurai!',14,0,100,0,0,10993, 'Archimonde - SAY_ENRAGE'), +(17968,6,0, 'No, it cannot be! Nooo!',14,0,100,0,0,10992, 'Archimonde - SAY_DEATH'), +(17968,7,0, 'You are mine now.',14,0,100,0,0,10988, 'Archimonde - SAY_SOUL_CHARGE1'), +(17968,7,1, 'Bow to my will.',14,0,100,0,0,11042, 'Archimonde - SAY_SOUL_CHARGE2'); + diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index 85f82c62079..222626240ea 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -15,42 +15,30 @@ * with this program. If not, see . */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "hyjal.h" #include "hyjal_trash.h" -#define SPELL_CARRION_SWARM 31306 -#define SPELL_SLEEP 31298 -#define SPELL_VAMPIRIC_AURA 38196 -#define SPELL_INFERNO 31299 +enum Spells +{ + SPELL_CARRION_SWARM = 31306, + SPELL_SLEEP = 31298, + SPELL_VAMPIRIC_AURA = 38196, + SPELL_INFERNO = 31299, + SPELL_IMMOLATION = 31303, + SPELL_INFERNO_EFFECT = 31302, +}; -#define SAY_ONDEATH "The clock... is still... ticking." -#define SOUND_ONDEATH 10982 - -#define SAY_ONSLAY1 "Your hopes are lost!" -#define SAY_ONSLAY2 "Scream for me!" -#define SAY_ONSLAY3 "Pity, no time for a slow death!" -#define SOUND_ONSLAY1 10981 -#define SOUND_ONSLAY2 11038 -#define SOUND_ONSLAY3 11039 - -#define SAY_SWARM1 "The swarm is eager to feed!" -#define SAY_SWARM2 "Pestilence upon you!" -#define SOUND_SWARM1 10979 -#define SOUND_SWARM2 11037 - -#define SAY_SLEEP1 "You look tired..." -#define SAY_SLEEP2 "Sweet dreams..." -#define SOUND_SLEEP1 10978 -#define SOUND_SLEEP2 11545 - -#define SAY_INFERNO1 "Let fire rain from above!" -#define SAY_INFERNO2 "Earth and sky shall burn!" -#define SOUND_INFERNO1 10980 -#define SOUND_INFERNO2 11036 - -#define SAY_ONAGGRO "You are defenders of a doomed world! Flee here, and perhaps you will prolong your pathetic lives!" -#define SOUND_ONAGGRO 10977 +enum Texts +{ + SAY_ONDEATH = 0, + SAY_ONSLAY = 1, + SAY_SWARM = 2, + SAY_SLEEP = 3, + SAY_INFERNO = 4, + SAY_ONAGGRO = 5, +}; class boss_anetheron : public CreatureScript { @@ -92,27 +80,12 @@ public: { if (instance && IsEvent) instance->SetData(DATA_ANETHERONEVENT, IN_PROGRESS); - DoPlaySoundToSet(me, SOUND_ONAGGRO); - me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0); + Talk(SAY_ONAGGRO); } void KilledUnit(Unit* /*victim*/) { - switch (urand(0, 2)) - { - case 0: - DoPlaySoundToSet(me, SOUND_ONSLAY1); - me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0); - break; - case 1: - DoPlaySoundToSet(me, SOUND_ONSLAY2); - me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0); - break; - case 2: - DoPlaySoundToSet(me, SOUND_ONSLAY3); - me->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, 0); - break; - } + Talk(SAY_ONSLAY); } void WaypointReached(uint32 waypointId) @@ -130,8 +103,7 @@ public: hyjal_trashAI::JustDied(killer); if (instance && IsEvent) instance->SetData(DATA_ANETHERONEVENT, DONE); - DoPlaySoundToSet(me, SOUND_ONDEATH); - me->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0); + Talk(SAY_ONDEATH); } void UpdateAI(const uint32 diff) @@ -169,17 +141,7 @@ public: DoCast(target, SPELL_CARRION_SWARM); SwarmTimer = urand(45000, 60000); - switch (urand(0, 1)) - { - case 0: - DoPlaySoundToSet(me, SOUND_SWARM1); - me->MonsterYell(SAY_SWARM1, LANG_UNIVERSAL, 0); - break; - case 1: - DoPlaySoundToSet(me, SOUND_SWARM2); - me->MonsterYell(SAY_SWARM2, LANG_UNIVERSAL, 0); - break; - } + Talk(SAY_SWARM); } else SwarmTimer -= diff; if (SleepTimer <= diff) @@ -190,17 +152,7 @@ public: target->CastSpell(target, SPELL_SLEEP, true); } SleepTimer = 60000; - switch (urand(0, 1)) - { - case 0: - DoPlaySoundToSet(me, SOUND_SLEEP1); - me->MonsterYell(SAY_SLEEP1, LANG_UNIVERSAL, 0); - break; - case 1: - DoPlaySoundToSet(me, SOUND_SLEEP2); - me->MonsterYell(SAY_SLEEP2, LANG_UNIVERSAL, 0); - break; - } + Talk(SAY_SLEEP); } else SleepTimer -= diff; if (AuraTimer <= diff) { @@ -211,17 +163,7 @@ public: { DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_INFERNO); InfernoTimer = 45000; - switch (urand(0, 1)) - { - case 0: - DoPlaySoundToSet(me, SOUND_INFERNO1); - me->MonsterYell(SAY_INFERNO1, LANG_UNIVERSAL, 0); - break; - case 1: - DoPlaySoundToSet(me, SOUND_INFERNO2); - me->MonsterYell(SAY_INFERNO2, LANG_UNIVERSAL, 0); - break; - } + Talk(SAY_INFERNO); } else InfernoTimer -= diff; DoMeleeAttackIfReady(); @@ -230,9 +172,6 @@ public: }; -#define SPELL_IMMOLATION 31303 -#define SPELL_INFERNO_EFFECT 31302 - class mob_towering_infernal : public CreatureScript { public: diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index f07aaaa1f2a..ee988accbac 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -23,56 +23,57 @@ SDComment: Doomfires not completely offlike due to core limitations for random m SDCategory: Caverns of Time, Mount Hyjal EndScriptData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "hyjal.h" #include "SpellAuras.h" #include "hyjal_trash.h" -//text id -1534018 are the text used when previous events complete. Not part of this script. -#define SAY_AGGRO -1534019 -#define SAY_DOOMFIRE1 -1534020 -#define SAY_DOOMFIRE2 -1534021 -#define SAY_AIR_BURST1 -1534022 -#define SAY_AIR_BURST2 -1534023 -#define SAY_SLAY1 -1534024 -#define SAY_SLAY2 -1534025 -#define SAY_SLAY3 -1534026 -#define SAY_ENRAGE -1534027 -#define SAY_DEATH -1534028 -#define SAY_SOUL_CHARGE1 -1534029 -#define SAY_SOUL_CHARGE2 -1534030 +enum Texts +{ + SAY_AGGRO = 1, + SAY_DOOMFIRE = 2, + SAY_AIR_BURST = 3, + SAY_SLAY = 4, + SAY_ENRAGE = 5, + SAY_DEATH = 6, + SAY_SOUL_CHARGE = 7, +}; -#define SPELL_DENOUEMENT_WISP 32124 -#define SPELL_ANCIENT_SPARK 39349 -#define SPELL_PROTECTION_OF_ELUNE 38528 +enum Spells +{ + SPELL_DENOUEMENT_WISP = 32124, + SPELL_ANCIENT_SPARK = 39349, + SPELL_PROTECTION_OF_ELUNE = 38528, -#define SPELL_DRAIN_WORLD_TREE 39140 -#define SPELL_DRAIN_WORLD_TREE_2 39141 + SPELL_DRAIN_WORLD_TREE = 39140, + SPELL_DRAIN_WORLD_TREE_2 = 39141, -#define SPELL_FINGER_OF_DEATH 31984 -#define SPELL_HAND_OF_DEATH 35354 -#define SPELL_AIR_BURST 32014 -#define SPELL_GRIP_OF_THE_LEGION 31972 -#define SPELL_DOOMFIRE_STRIKE 31903 //summons two creatures -#define SPELL_DOOMFIRE_SPAWN 32074 -#define SPELL_DOOMFIRE 31945 -#define SPELL_SOUL_CHARGE_YELLOW 32045 -#define SPELL_SOUL_CHARGE_GREEN 32051 -#define SPELL_SOUL_CHARGE_RED 32052 -#define SPELL_UNLEASH_SOUL_YELLOW 32054 -#define SPELL_UNLEASH_SOUL_GREEN 32057 -#define SPELL_UNLEASH_SOUL_RED 32053 -#define SPELL_FEAR 31970 + SPELL_FINGER_OF_DEATH = 31984, + SPELL_HAND_OF_DEATH = 35354, + SPELL_AIR_BURST = 32014, + SPELL_GRIP_OF_THE_LEGION = 31972, + SPELL_DOOMFIRE_STRIKE = 31903, //summons two creatures + SPELL_DOOMFIRE_SPAWN = 32074, + SPELL_DOOMFIRE = 31945, + SPELL_SOUL_CHARGE_YELLOW = 32045, + SPELL_SOUL_CHARGE_GREEN = 32051, + SPELL_SOUL_CHARGE_RED = 32052, + SPELL_UNLEASH_SOUL_YELLOW = 32054, + SPELL_UNLEASH_SOUL_GREEN = 32057, + SPELL_UNLEASH_SOUL_RED = 32053, + SPELL_FEAR = 31970, +}; -#define CREATURE_ARCHIMONDE 17968 -#define CREATURE_DOOMFIRE 18095 -#define CREATURE_DOOMFIRE_SPIRIT 18104 -#define CREATURE_ANCIENT_WISP 17946 -#define CREATURE_CHANNEL_TARGET 22418 +enum Summons +{ + CREATURE_DOOMFIRE = 18095, + CREATURE_DOOMFIRE_SPIRIT = 18104, + CREATURE_ANCIENT_WISP = 17946, + CREATURE_CHANNEL_TARGET = 22418, +}; -#define NORDRASSIL_X 5503.713f -#define NORDRASSIL_Y -3523.436f -#define NORDRASSIL_Z 1608.781f +Position const NordrassilLoc = {5503.713f, -3523.436f, 1608.781f, 0.0f}; class mob_ancient_wisp : public CreatureScript { @@ -258,11 +259,11 @@ public: uint32 GripOfTheLegionTimer; uint32 DoomfireTimer; uint32 SoulChargeTimer; - uint32 SoulChargeCount; + uint8 SoulChargeCount; uint32 MeleeRangeCheckTimer; uint32 HandOfDeathTimer; uint32 SummonWispTimer; - uint32 WispCount; + uint8 WispCount; uint32 EnrageTimer; uint32 CheckDistanceTimer; @@ -303,7 +304,7 @@ public: void EnterCombat(Unit* /*who*/) { me->InterruptSpell(CURRENT_CHANNELED_SPELL); - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); DoZoneInCombat(); if (instance) @@ -312,7 +313,7 @@ public: void KilledUnit(Unit* victim) { - DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); + Talk(SAY_SLAY); if (victim && (victim->GetTypeId() == TYPEID_PLAYER)) GainSoulCharge(CAST_PLR(victim)); @@ -346,7 +347,7 @@ public: void JustDied(Unit* killer) { hyjal_trashAI::JustDied(killer); - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); if (instance) instance->SetData(DATA_ARCHIMONDEEVENT, DONE); @@ -488,7 +489,7 @@ public: { if (!IsChanneling) { - Creature* temp = me->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 1200000); + Creature* temp = me->SummonCreature(CREATURE_CHANNEL_TARGET, NordrassilLoc, TEMPSUMMON_TIMED_DESPAWN, 1200000); if (temp) WorldTreeGUID = temp->GetGUID(); @@ -525,14 +526,14 @@ public: me->GetMotionMaster()->Clear(false); me->GetMotionMaster()->MoveIdle(); Enraged = true; - DoScriptText(SAY_ENRAGE, me); + Talk(SAY_ENRAGE); } } else EnrageTimer -= diff; if (CheckDistanceTimer <= diff) { // To simplify the check, we simply summon a Creature in the location and then check how far we are from the creature - Creature* Check = me->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000); + Creature* Check = me->SummonCreature(CREATURE_CHANNEL_TARGET, NordrassilLoc, TEMPSUMMON_TIMED_DESPAWN, 2000); if (Check) { Check->SetVisible(false); @@ -542,7 +543,7 @@ public: me->GetMotionMaster()->Clear(false); me->GetMotionMaster()->MoveIdle(); Enraged = true; - DoScriptText(SAY_ENRAGE, me); + Talk(SAY_ENRAGE); } } CheckDistanceTimer = 5000; @@ -598,11 +599,7 @@ public: if (AirBurstTimer <= diff) { - if (urand(0, 1)) - DoScriptText(SAY_AIR_BURST1, me); - else - DoScriptText(SAY_AIR_BURST2, me); - + Talk(SAY_AIR_BURST); DoCast(SelectTarget(SELECT_TARGET_RANDOM, 1), SPELL_AIR_BURST);//not on tank AirBurstTimer = urand(25000, 40000); } else AirBurstTimer -= diff; @@ -615,11 +612,7 @@ public: if (DoomfireTimer <= diff) { - if (urand(0, 1)) - DoScriptText(SAY_DOOMFIRE1, me); - else - DoScriptText(SAY_DOOMFIRE2, me); - + Talk(SAY_DOOMFIRE); Unit* temp = SelectTarget(SELECT_TARGET_RANDOM, 1); if (!temp) temp = me->getVictim(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index a9e0c866ab9..bfdaed35dd4 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -15,33 +15,31 @@ * with this program. If not, see . */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "hyjal.h" #include "hyjal_trash.h" -#define SPELL_RAIN_OF_FIRE 31340 -#define SPELL_DOOM 31347 -#define SPELL_HOWL_OF_AZGALOR 31344 -#define SPELL_CLEAVE 31345 -#define SPELL_BERSERK 26662 +enum Spells +{ + SPELL_RAIN_OF_FIRE = 31340, + SPELL_DOOM = 31347, + SPELL_HOWL_OF_AZGALOR = 31344, + SPELL_CLEAVE = 31345, + SPELL_BERSERK = 26662, -#define SAY_ONDEATH "Your time is almost... up" -#define SOUND_ONDEATH 11002 + SPELL_THRASH = 12787, + SPELL_CRIPPLE = 31406, + SPELL_WARSTOMP = 31408, +}; -#define SAY_ONSLAY1 "Reesh, hokta!" -#define SAY_ONSLAY2 "Don't fight it" -#define SAY_ONSLAY3 "No one is going to save you" -#define SOUND_ONSLAY1 11001 -#define SOUND_ONSLAY2 11048 -#define SOUND_ONSLAY3 11047 - -#define SAY_DOOM1 "Just a taste... of what awaits you" -#define SAY_DOOM2 "Suffer you despicable insect!" -#define SOUND_DOOM1 11046 -#define SOUND_DOOM2 11000 - -#define SAY_ONAGGRO "Abandon all hope! The legion has returned to finish what was begun so many years ago. This time there will be no escape!" -#define SOUND_ONAGGRO 10999 +enum Texts +{ + SAY_ONDEATH = 0, + SAY_ONSLAY = 1, + SAY_DOOM = 2, // Not used? + SAY_ONAGGRO = 3, +}; class boss_azgalor : public CreatureScript { @@ -88,27 +86,12 @@ public: { if (instance && IsEvent) instance->SetData(DATA_AZGALOREVENT, IN_PROGRESS); - DoPlaySoundToSet(me, SOUND_ONAGGRO); - me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0); + Talk(SAY_ONAGGRO); } void KilledUnit(Unit* /*victim*/) { - switch (urand(0, 2)) - { - case 0: - DoPlaySoundToSet(me, SOUND_ONSLAY1); - me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0); - break; - case 1: - DoPlaySoundToSet(me, SOUND_ONSLAY2); - me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0); - break; - case 2: - DoPlaySoundToSet(me, SOUND_ONSLAY3); - me->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, 0); - break; - } + Talk(SAY_ONSLAY); } void WaypointReached(uint32 waypointId) @@ -126,7 +109,7 @@ public: hyjal_trashAI::JustDied(killer); if (instance && IsEvent) instance->SetData(DATA_AZGALOREVENT, DONE); - DoPlaySoundToSet(me, SOUND_ONDEATH); + Talk(SAY_ONDEATH); } void UpdateAI(const uint32 diff) @@ -196,10 +179,6 @@ public: }; -#define SPELL_THRASH 12787 -#define SPELL_CRIPPLE 31406 -#define SPELL_WARSTOMP 31408 - class mob_lesser_doomguard : public CreatureScript { public: diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index 9160983b0df..29eff68dfbd 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -30,22 +30,17 @@ enum Spells SPELL_MARK_DAMAGE = 31463 }; -#define SOUND_ONDEATH 11018 +enum Texts +{ + SAY_ONSLAY = 0, + SAY_MARK = 1, + SAY_ONAGGRO = 2, +}; -#define SAY_ONSLAY1 "Shaza-Kiel!" -#define SAY_ONSLAY2 "You... are nothing!" -#define SAY_ONSLAY3 "Miserable nuisance!" -#define SOUND_ONSLAY1 11017 -#define SOUND_ONSLAY2 11053 -#define SOUND_ONSLAY3 11054 - -#define SAY_MARK1 "Your death will be a painful one." -#define SAY_MARK2 "You... are marked." -#define SOUND_MARK1 11016 -#define SOUND_MARK2 11052 - -#define SAY_ONAGGRO "Cry for mercy! Your meaningless lives will soon be forfeit." -#define SOUND_ONAGGRO 11015 +enum Sounds +{ + SOUND_ONDEATH = 11018, +}; class boss_kazrogal : public CreatureScript { @@ -87,27 +82,12 @@ public: { if (instance && IsEvent) instance->SetData(DATA_KAZROGALEVENT, IN_PROGRESS); - DoPlaySoundToSet(me, SOUND_ONAGGRO); - me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0); + Talk(SAY_ONAGGRO); } void KilledUnit(Unit* /*victim*/) { - switch (urand(0, 2)) - { - case 0: - DoPlaySoundToSet(me, SOUND_ONSLAY1); - me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0); - break; - case 1: - DoPlaySoundToSet(me, SOUND_ONSLAY2); - me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0); - break; - case 2: - DoPlaySoundToSet(me, SOUND_ONSLAY3); - me->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, 0); - break; - } + Talk(SAY_ONSLAY); } void WaypointReached(uint32 waypointId) @@ -177,17 +157,7 @@ public: if (MarkTimerBase < 5500) MarkTimerBase = 5500; MarkTimer = MarkTimerBase; - switch (urand(0, 2)) - { - case 0: - DoPlaySoundToSet(me, SOUND_MARK1); - me->MonsterYell(SAY_MARK1, LANG_UNIVERSAL, 0); - break; - case 1: - DoPlaySoundToSet(me, SOUND_MARK2); - me->MonsterYell(SAY_MARK2, LANG_UNIVERSAL, 0); - break; - } + Talk(SAY_MARK); } else MarkTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp index 5d7ee1fe194..09c8c1605b3 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp @@ -15,36 +15,27 @@ * with this program. If not, see . */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "hyjal.h" #include "hyjal_trash.h" -#define SPELL_FROST_ARMOR 31256 -#define SPELL_DEATH_AND_DECAY 31258 +enum Spells +{ + SPELL_FROST_ARMOR = 31256, + SPELL_DEATH_AND_DECAY = 31258, + SPELL_FROST_NOVA = 31250, + SPELL_ICEBOLT = 31249, +}; -#define SPELL_FROST_NOVA 31250 -#define SPELL_ICEBOLT 31249 - -#define SAY_ONDEATH "You have won this battle, but not... the... war" -#define SOUND_ONDEATH 11026 - -#define SAY_ONSLAY1 "All life must perish!" -#define SAY_ONSLAY2 "Victory to the Legion!" -#define SOUND_ONSLAY1 11025 -#define SOUND_ONSLAY2 11057 - -#define SAY_DECAY1 "Crumble and rot!" -#define SAY_DECAY2 "Ashes to ashes, dust to dust" -#define SOUND_DECAY1 11023 -#define SOUND_DECAY2 11055 - -#define SAY_NOVA1 "Succumb to the icy chill... of death!" -#define SAY_NOVA2 "It will be much colder in your grave" -#define SOUND_NOVA1 11024 -#define SOUND_NOVA2 11058 - -#define SAY_ONAGGRO "The Legion's final conquest has begun! Once again the subjugation of this world is within our grasp. Let none survive!" -#define SOUND_ONAGGRO 11022 +enum Texts +{ + SAY_ONDEATH = 0, + SAY_ONSLAY = 1, + SAY_DECAY = 2, + SAY_NOVA = 3, + SAY_ONAGGRO = 4, +}; class boss_rage_winterchill : public CreatureScript { @@ -86,23 +77,12 @@ public: { if (instance && IsEvent) instance->SetData(DATA_RAGEWINTERCHILLEVENT, IN_PROGRESS); - DoPlaySoundToSet(me, SOUND_ONAGGRO); - me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0); + Talk(SAY_ONAGGRO); } void KilledUnit(Unit* /*victim*/) { - switch (urand(0, 1)) - { - case 0: - DoPlaySoundToSet(me, SOUND_ONSLAY1); - me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0); - break; - case 1: - DoPlaySoundToSet(me, SOUND_ONSLAY2); - me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0); - break; - } + Talk(SAY_ONSLAY); } void WaypointReached(uint32 waypointId) @@ -120,8 +100,7 @@ public: hyjal_trashAI::JustDied(killer); if (instance && IsEvent) instance->SetData(DATA_RAGEWINTERCHILLEVENT, DONE); - DoPlaySoundToSet(me, SOUND_ONDEATH); - me->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0); + Talk(SAY_ONDEATH); } void UpdateAI(const uint32 diff) @@ -162,33 +141,13 @@ public: { DoCast(me->getVictim(), SPELL_DEATH_AND_DECAY); DecayTimer = 60000+rand()%20000; - switch (urand(0, 1)) - { - case 0: - DoPlaySoundToSet(me, SOUND_DECAY1); - me->MonsterYell(SAY_DECAY1, LANG_UNIVERSAL, 0); - break; - case 1: - DoPlaySoundToSet(me, SOUND_DECAY2); - me->MonsterYell(SAY_DECAY2, LANG_UNIVERSAL, 0); - break; - } + Talk(SAY_DECAY); } else DecayTimer -= diff; if (NovaTimer <= diff) { DoCast(me->getVictim(), SPELL_FROST_NOVA); NovaTimer = 30000+rand()%15000; - switch (urand(0, 1)) - { - case 0: - DoPlaySoundToSet(me, SOUND_NOVA1); - me->MonsterYell(SAY_NOVA1, LANG_UNIVERSAL, 0); - break; - case 1: - DoPlaySoundToSet(me, SOUND_NOVA2); - me->MonsterYell(SAY_NOVA2, LANG_UNIVERSAL, 0); - break; - } + Talk(SAY_NOVA); } else NovaTimer -= diff; if (IceboltTimer <= diff) { diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp index 22307468f14..1be8f8e058f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp @@ -29,7 +29,9 @@ npc_thrall npc_tyrande_whisperwind EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" #include "hyjalAI.h" #define GOSSIP_ITEM_BEGIN_ALLY "My companions and I are with you, Lady Proudmoore." diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h index e045d3cbf05..6d62072608d 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h @@ -21,7 +21,7 @@ #define ERROR_INST_DATA "TSCR: Instance data not set properly for Mount Hyjal. Encounters will be buggy." -enum eTypes +enum Types { WORLD_STATE_WAVES = 2842, WORLD_STATE_ENEMY = 2453, diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index 2f6bbb7edb5..cdac1b18649 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -23,17 +23,21 @@ SDComment: SDCategory: Caverns of Time, Mount Hyjal EndScriptData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedEscortAI.h" +#include "GridNotifiers.h" +#include "Cell.h" +#include "CellImpl.h" #include "hyjalAI.h" #include "hyjal_trash.h" -#include "MapManager.h" -#include "Language.h" -#include "Chat.h" -#include "Object.h" -#define SPAWN_GARG_GATE 0 -#define SPAWN_WYRM_GATE 1 -#define SPAWN_NEAR_TOWER 2 +enum Spawns +{ + SPAWN_GARG_GATE = 0, + SPAWN_WYRM_GATE = 1, + SPAWN_NEAR_TOWER = 2, +}; #define YELL_HURRY "Hurry, we don't have much time" diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h index b32288ca43a..68efa94d98b 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h @@ -24,43 +24,49 @@ #define HYJAL_AI_MAX_SPELLS 3 -// Trash Mobs summoned in waves -#define NECROMANCER 17899//done -#define ABOMINATION 17898//done -#define GHOUL 17895//done -#define BANSHEE 17905//done -#define CRYPT_FIEND 17897//done -#define GARGOYLE 17906//done -#define FROST_WYRM 17907//done -#define GIANT_INFERNAL 17908//done -#define FEL_STALKER 17916//done +enum CreaturesIds +{ + // Trash Mobs summoned in waves + NECROMANCER = 17899, + ABOMINATION = 17898, + GHOUL = 17895, + BANSHEE = 17905, + CRYPT_FIEND = 17897, + GARGOYLE = 17906, + FROST_WYRM = 17907, + GIANT_INFERNAL = 17908, + FEL_STALKER = 17916, -#define JAINA 17772 -#define THRALL 17852 -#define TYRANDE 17948 + JAINA = 17772, + THRALL = 17852, + TYRANDE = 17948, -#define ANCIENT_VEIN 185557 -#define FLAMEOBJECT 182592 + ANCIENT_VEIN = 185557, + FLAMEOBJECT = 182592, -// Bosses summoned after every 8 waves -#define RAGE_WINTERCHILL 17767 -#define ANETHERON 17808 -#define KAZROGAL 17888 -#define AZGALOR 17842 -#define ARCHIMONDE 17968 + // Bosses summoned after every 8 waves + RAGE_WINTERCHILL = 17767, + ANETHERON = 17808, + KAZROGAL = 17888, + AZGALOR = 17842, + ARCHIMONDE = 17968, +}; -#define SPELL_TELEPORT_VISUAL 41232 -#define SPELL_MASS_TELEPORT 16807 +enum SpellIds +{ + SPELL_TELEPORT_VISUAL = 41232, + SPELL_MASS_TELEPORT = 16807, -//Spells for Jaina -#define SPELL_BRILLIANCE_AURA 31260 // The database must handle this spell via creature_addon(it should, but is removed in evade..) -#define SPELL_BLIZZARD 31266 -#define SPELL_PYROBLAST 31263 -#define SPELL_SUMMON_ELEMENTALS 31264 + //Spells for Jaina + SPELL_BRILLIANCE_AURA = 31260, // The database must handle this spell via creature_addon(it should, but is removed in evade..) + SPELL_BLIZZARD = 31266, + SPELL_PYROBLAST = 31263, + SPELL_SUMMON_ELEMENTALS = 31264, -//Thrall spells -#define SPELL_CHAIN_LIGHTNING 31330 -#define SPELL_SUMMON_DIRE_WOLF 31331 + //Thrall spells + SPELL_CHAIN_LIGHTNING = 31330, + SPELL_SUMMON_DIRE_WOLF = 31331, +}; struct Wave { diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index 840aa5de081..d3218e1729e 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -15,16 +15,35 @@ * with this program. If not, see . */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "hyjal.h" #include "hyjal_trash.h" #include "hyjalAI.h" -#define SPELL_METEOR 33814 //infernal visual -#define SPELL_IMMOLATION 37059 -#define SPELL_FLAME_BUFFET 31724 -#define NPC_TRIGGER 21987 //World Trigger (Tiny) -#define MODEL_INVIS 11686 //invisible model +enum Spells +{ + SPELL_METEOR = 33814, //infernal visual + SPELL_IMMOLATION = 37059, + SPELL_FLAME_BUFFET = 31724, + NPC_TRIGGER = 21987, //World Trigger (Tiny) + MODEL_INVIS = 11686, //invisible model + SPELL_DISEASE_CLOUD = 31607, + SPELL_KNOCKDOWN = 31610, + SPELL_FRENZY = 31540, + SPELL_RAISE_DEAD_1 = 31617, + SPELL_RAISE_DEAD_2 = 31624, + SPELL_RAISE_DEAD_3 = 31625, + SPELL_SHADOW_BOLT = 31627, + SPELL_BANSHEE_CURSE = 31651, + SPELL_BANSHEE_WAIL = 38183, + SPELL_ANTI_MAGIC_SHELL = 31662, + SPELL_WEB = 28991, + SPELL_MANA_BURN = 31729, + SPELL_FROST_BREATH = 31688, + SPELL_GARGOYLE_STRIKE = 31664, + SPELL_EXPLODING_SHOT = 7896, +}; float HordeWPs[8][3]=//basic waypoints from spawn to leader { @@ -522,9 +541,6 @@ public: } }; -#define SPELL_DISEASE_CLOUD 31607 -#define SPELL_KNOCKDOWN 31610 - class mob_abomination : public CreatureScript { public: @@ -623,8 +639,6 @@ public: }; -#define SPELL_FRENZY 31540 - class mob_ghoul : public CreatureScript { public: @@ -727,11 +741,6 @@ public: }; -#define SPELL_RAISE_DEAD_1 31617 -#define SPELL_RAISE_DEAD_2 31624 -#define SPELL_RAISE_DEAD_3 31625 -#define SPELL_SHADOW_BOLT 31627 - class mob_necromancer : public CreatureScript { public: @@ -859,10 +868,6 @@ public: }; -#define SPELL_BANSHEE_CURSE 31651 -#define SPELL_BANSHEE_WAIL 38183 -#define SPELL_ANTI_MAGIC_SHELL 31662 - class mob_banshee : public CreatureScript { public: @@ -966,8 +971,6 @@ public: }; -#define SPELL_WEB 28991 - class mob_crypt_fiend : public CreatureScript { public: @@ -1058,8 +1061,6 @@ public: }; -#define SPELL_MANA_BURN 31729 - class mob_fel_stalker : public CreatureScript { public: @@ -1150,8 +1151,6 @@ public: }; -#define SPELL_FROST_BREATH 31688 - class mob_frost_wyrm : public CreatureScript { public: @@ -1264,8 +1263,6 @@ public: }; -#define SPELL_GARGOYLE_STRIKE 31664 - class mob_gargoyle : public CreatureScript { public: @@ -1402,8 +1399,6 @@ public: }; -#define SPELL_EXPLODING_SHOT 7896 - class alliance_rifleman : public CreatureScript { public: diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp index ad8ebdb370a..69bb8285404 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp @@ -23,15 +23,16 @@ SDComment: Instance Data Scripts and functions to acquire mobs and set encounter SDCategory: Caverns of Time, Mount Hyjal EndScriptData */ -#include "ScriptPCH.h" -#include "hyjal.h" +#include "ScriptMgr.h" +#include "InstanceScript.h" +#include "ScriptedCreature.h" #include "hyjal_trash.h" -enum eEnums +enum Misc { MAX_ENCOUNTER = 5, - GO_ANCIENT_GEM = 185557 + GO_ANCIENT_GEM = 185557, }; /* Battle of Mount Hyjal encounters: 0 - Rage Winterchill event From a986a621324d7157b5804865d460a1ff7e44a93f Mon Sep 17 00:00:00 2001 From: 4m1g0 Date: Sun, 1 Jul 2012 19:45:26 +0200 Subject: [PATCH 1128/1149] DB: Removed old script_texts no longer used --- sql/updates/world/2012_07_01_00_world_creature_text.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/updates/world/2012_07_01_00_world_creature_text.sql b/sql/updates/world/2012_07_01_00_world_creature_text.sql index 6f2bed8e7d6..f59663ceab5 100644 --- a/sql/updates/world/2012_07_01_00_world_creature_text.sql +++ b/sql/updates/world/2012_07_01_00_world_creature_text.sql @@ -1,3 +1,5 @@ +DELETE FROM `script_texts` WHERE entry IN (-1534019, -1534020, -1534021, -1534022, -1534023, -1534024, -1534025, -1534026, -1534027, -1534028, -1534029 , -1534030); + -- Anetheron DELETE FROM `creature_text` WHERE `entry`=17808; INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES From 2bee0e6e37e94faea1dba5ba0ec7348ce32842cb Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 1 Jul 2012 21:05:53 +0200 Subject: [PATCH 1129/1149] Core/SpellScript: Corrected when OnObjectAreaTargetSelect hooks are called (must be before splitting unit/go targets) --- src/server/game/Spells/Spell.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 33ecd66e8f6..2c1cff0c74a 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1205,6 +1205,9 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge default: break; } + + CallScriptObjectAreaTargetSelectHandlers(targets, effIndex); + std::list unitTargets; std::list gObjTargets; // for compability with older code - add only unit and go targets @@ -1217,8 +1220,6 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge gObjTargets.push_back(gObjTarget); } - CallScriptObjectAreaTargetSelectHandlers(targets, effIndex); - if (!unitTargets.empty()) { // Special target selection for smart heals and energizes @@ -1562,15 +1563,15 @@ void Spell::SelectImplicitChainTargets(SpellEffIndex effIndex, SpellImplicitTarg SearchChainTargets(targets, maxTargets - 1, target, targetType.GetObjectType(), targetType.GetCheckType() , m_spellInfo->Effects[effIndex].ImplicitTargetConditions, targetType.GetTarget() == TARGET_UNIT_TARGET_CHAINHEAL_ALLY); + // Chain primary target is added earlier + CallScriptObjectAreaTargetSelectHandlers(targets, effIndex); + // for backward compability std::list unitTargets; for (std::list::iterator itr = targets.begin(); itr != targets.end(); ++itr) if (Unit* unitTarget = (*itr)->ToUnit()) unitTargets.push_back(unitTarget); - // Chain primary target is added earlier - CallScriptObjectAreaTargetSelectHandlers(targets, effIndex); - for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end(); ++itr) AddUnitTarget(*itr, effMask, false); } From 16d4cc7e0b6431efccf0bdc7973e7d3e3c8e705f Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 1 Jul 2012 16:18:11 -0500 Subject: [PATCH 1130/1149] Fixed build --- src/server/scripts/Commands/cs_reset.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp index deb8f710b11..88d648773eb 100644 --- a/src/server/scripts/Commands/cs_reset.cpp +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -24,6 +24,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "Chat.h" +#include "ObjectAccessor.h" class reset_commandscript : public CommandScript { From f34bbf520ee70497af754e50330fe5057a1e0360 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 1 Jul 2012 16:36:12 -0500 Subject: [PATCH 1131/1149] Core/Scripts: More missing includes --- .../Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index cdac1b18649..a407f86ba70 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -27,6 +27,7 @@ EndScriptData */ #include "ScriptedCreature.h" #include "ScriptedEscortAI.h" #include "GridNotifiers.h" +#include "GridNotifiersImpl.h" #include "Cell.h" #include "CellImpl.h" #include "hyjalAI.h" From 8eba4aebfb56bf86a74fc9841af75359b9cf2346 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 1 Jul 2012 18:29:59 -0500 Subject: [PATCH 1132/1149] Core/Units: Removed deprecated code --- src/server/game/Entities/Unit/Unit.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 07b2b9d2260..73d28fe2fa9 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -527,13 +527,7 @@ void Unit::DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb) if (absorb) *absorb += damage; damage = 0; - return; } - - uint32 originalDamage = damage; - - if (absorb && originalDamage > damage) - *absorb += (originalDamage - damage); } uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDamage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask, SpellInfo const* spellProto, bool durabilityLoss) From 7f960fed732f119b6776bc51a4465e8e7a1a10dd Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 2 Jul 2012 10:09:41 -0400 Subject: [PATCH 1133/1149] Core/Spells: fix damage bonus calculations for sanctified wrath talent. --- src/server/game/Entities/Unit/Unit.cpp | 50 ++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 73d28fe2fa9..157b60e2d99 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10676,6 +10676,15 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui int32 TakenTotal = 0; float TakenTotalMod = 1.0f; + float TakenTotalCasterMod = 0.0f; + + // get all auras from caster that allow the spell to ignore resistance (sanctified wrath) + AuraEffectList const& IgnoreResistAuras = caster->GetAuraEffectsByType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST); + for (AuraEffectList::const_iterator i = IgnoreResistAuras.begin(); i != IgnoreResistAuras.end(); ++i) + { + if ((*i)->GetMiscValue() & spellProto->GetSchoolMask()) + TakenTotalCasterMod += ((*i)->GetBaseAmount()/100); + } // from positive and negative SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN // multiplicative bonus, for example Dispersion + Shadowform (0.10*0.85=0.085) @@ -10740,7 +10749,21 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui TakenTotal+= int32(TakenAdvertisedBenefit * coeff * factorMod); } - float tmpDamage = (float(pdamage) + TakenTotal) * TakenTotalMod; + float tmpDamage = 0.0f; + + if (TakenTotalCasterMod) + { + if (TakenTotal < 0) + if (TakenTotalMod < 1) + tmpDamage = ((float(CalculatePctF(pdamage, TakenTotalCasterMod) + TakenTotal) * TakenTotalMod) + CalculatePctF(pdamage, TakenTotalCasterMod)); + else + tmpDamage = ((float(CalculatePctF(pdamage, TakenTotalCasterMod) + TakenTotal) + CalculatePctF(pdamage, TakenTotalCasterMod)) * TakenTotalMod); + else + if (TakenTotalMod < 1) + tmpDamage = ((CalculatePctF(float(pdamage) + TakenTotal, TakenTotalCasterMod) * TakenTotalMod) + CalculatePctF(float(pdamage) + TakenTotal, TakenTotalCasterMod)); + } + if (!tmpDamage) + tmpDamage = (float(pdamage) + TakenTotal) * TakenTotalMod; return uint32(std::max(tmpDamage, 0.0f)); } @@ -11692,6 +11715,15 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackT return 0; int32 TakenFlatBenefit = 0; + float TakenTotalCasterMod = 0.0f; + + // get all auras from caster that allow the spell to ignore resistance (sanctified wrath) + AuraEffectList const& IgnoreResistAuras = attacker->GetAuraEffectsByType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST); + for (AuraEffectList::const_iterator i = IgnoreResistAuras.begin(); i != IgnoreResistAuras.end(); ++i) + { + if ((*i)->GetMiscValue() & spellProto->GetSchoolMask()) + TakenTotalCasterMod += ((*i)->GetBaseAmount()/100); + } // ..taken AuraEffectList const& mDamageTaken = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_TAKEN); @@ -11776,7 +11808,21 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackT AddPctN(TakenTotalMod, (*i)->GetAmount()); } - float tmpDamage = (float(pdamage) + TakenFlatBenefit) * TakenTotalMod; + float tmpDamage = 0.0f; + + if (TakenTotalCasterMod) + { + if (TakenFlatBenefit < 0) + if (TakenTotalMod < 1) + tmpDamage = ((float(CalculatePctF(pdamage, TakenTotalCasterMod) + TakenFlatBenefit) * TakenTotalMod) + CalculatePctF(pdamage, TakenTotalCasterMod)); + else + tmpDamage = ((float(CalculatePctF(pdamage, TakenTotalCasterMod) + TakenFlatBenefit) + CalculatePctF(pdamage, TakenTotalCasterMod)) * TakenTotalMod); + else + if (TakenTotalMod < 1) + tmpDamage = ((CalculatePctF(float(pdamage) + TakenFlatBenefit, TakenTotalCasterMod) * TakenTotalMod) + CalculatePctF(float(pdamage) + TakenFlatBenefit, TakenTotalCasterMod)); + } + if (!tmpDamage) + tmpDamage = (float(pdamage) + TakenFlatBenefit) * TakenTotalMod; // bonus result can be negative return uint32(std::max(tmpDamage, 0.0f)); From 69f1cf37afc0480e61f3dfdeb321cff650793d91 Mon Sep 17 00:00:00 2001 From: trista Date: Mon, 2 Jul 2012 15:02:04 +0100 Subject: [PATCH 1134/1149] DB/Rep: Add onkill reputation for Monstrous Kaliri Closes #6961 Signed-off-by: Nay --- .../world/2012_07_02_00_world_creature_onkill_reputation.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2012_07_02_00_world_creature_onkill_reputation.sql diff --git a/sql/updates/world/2012_07_02_00_world_creature_onkill_reputation.sql b/sql/updates/world/2012_07_02_00_world_creature_onkill_reputation.sql new file mode 100644 index 00000000000..a9565d36934 --- /dev/null +++ b/sql/updates/world/2012_07_02_00_world_creature_onkill_reputation.sql @@ -0,0 +1,4 @@ +-- Add 10 reputation gaining from killing NPC Monstrous Kaliri towards Sha'tari Skyguard +DELETE FROM `creature_onkill_reputation` WHERE `creature_id`=23051; +INSERT INTO `creature_onkill_reputation` (`creature_id`,`RewOnKillRepFaction1`,`MaxStanding1`,`RewOnKillRepValue1`) VALUES +(23051,1031,7,10); From cf65c38dd5f8e006765d1f239fa33732f3abc8b2 Mon Sep 17 00:00:00 2001 From: trista Date: Mon, 2 Jul 2012 15:06:38 +0100 Subject: [PATCH 1135/1149] DB/SAI: Add combat AI for Dark Ritualist Closes #6992 --- sql/updates/world/2012_07_02_01_world_sai.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sql/updates/world/2012_07_02_01_world_sai.sql diff --git a/sql/updates/world/2012_07_02_01_world_sai.sql b/sql/updates/world/2012_07_02_01_world_sai.sql new file mode 100644 index 00000000000..78557f675b6 --- /dev/null +++ b/sql/updates/world/2012_07_02_01_world_sai.sql @@ -0,0 +1,6 @@ +SET @Ritualist := 34734; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@Ritualist; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@Ritualist; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@Ritualist,0,0,0,0,0,100,0,3000,3000,8000,14000,11,32000,0,0,0,0,0,2,0,0,0,0,0,0,0,'Dark Ritualist - IC - Cast Mind Seer'), +(@Ritualist,0,1,0,0,0,100,0,8000,17300,17300,17300,11,32026,0,0,0,0,0,2,0,0,0,0,0,0,0,'Dark Ritualist - IC - Cast Pain Strike'); From 81514542fa442ff40a86cf6a812db7782ba40786 Mon Sep 17 00:00:00 2001 From: trista Date: Mon, 2 Jul 2012 15:24:49 +0100 Subject: [PATCH 1136/1149] DB/SAI: Fix quest The Air Stands Still Add SAI scripts for related npcs Closes #4880 Signed-off-by: Nay --- sql/updates/world/2012_07_02_01_world_sai.sql | 1 + sql/updates/world/2012_07_02_02_world_sai.sql | 189 ++++++++++++++++++ 2 files changed, 190 insertions(+) create mode 100644 sql/updates/world/2012_07_02_02_world_sai.sql diff --git a/sql/updates/world/2012_07_02_01_world_sai.sql b/sql/updates/world/2012_07_02_01_world_sai.sql index 78557f675b6..323d9bddcb2 100644 --- a/sql/updates/world/2012_07_02_01_world_sai.sql +++ b/sql/updates/world/2012_07_02_01_world_sai.sql @@ -1,3 +1,4 @@ +-- Add SAI for Dark Ritualist ID: 34734 // timings are taken from other script finds SET @Ritualist := 34734; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@Ritualist; DELETE FROM `smart_scripts` WHERE `entryorguid`=@Ritualist; diff --git a/sql/updates/world/2012_07_02_02_world_sai.sql b/sql/updates/world/2012_07_02_02_world_sai.sql new file mode 100644 index 00000000000..6b6b0eb587c --- /dev/null +++ b/sql/updates/world/2012_07_02_02_world_sai.sql @@ -0,0 +1,189 @@ +-- Fix quest the Air Stands Still ID: 13125 + some lurking around mobs SAIs +-- Set guids: +SET @NPC := 43480; -- Underking Talonox in phase 2, in phase 128->@NPC+1 +SET @PATH := @NPC * 10; +-- @NPC+2 Salranax phase 2, +3 in phase 128 +-- @NPC+4 High Priest in phase 2 and +5 in 128 +-- Add (Salranax the Flesh Render, High Priest Yath'amon and Underking Talonox -- One for each phase they are in /used @qaywsx phase data/ ) +DELETE FROM `creature` WHERE `id` IN (30829, 30830, 30831); +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `MovementType`) VALUES +(@NPC+2,30829,571,1,2,6839.024902,594.444946,427.229523,4.5,300,0,0,0), +(@NPC+4,30831,571,1,2,6869.477539,423.287720,471.783722,1.066242,300,0,0,0), +(@NPC,30830,571,1,2,7169.797363,664.115479,492.375793,1.129528,300,0,0,0), +(@NPC+3,30829,571,1,128,6839.024902,594.444946,427.229523,4.5,300,0,0,0), +(@NPC+5,30831,571,1,128,6869.477539,423.287720,471.783722,1.066242,300,0,0,0), +(@NPC+1,30830,571,1,128,7169.797363,664.115479,492.375793,1.129528,300,0,0,0); +-- Salranax the Flesh Render SAI +UPDATE `creature_template` SET `faction_A`=2068, `faction_H`=2068, `mindmg`=240, `maxdmg`=270, `mechanic_immune_mask`=10685, `scale`=1.2 WHERE `entry`=30829; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=30829; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=30829; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(30829,0,1,0,8,0,100,1,57906,0,0,0,12,30840,4,5000,0,0,0,1,0,0,0,0,0,0,0,'Salranax the Flesh Render - Summons Munch on hit by horn'), +(30829,0,2,0,8,0,100,1,57906,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'On spellhit set aggro'), +(30829,0,3,0,4,0,100,1,0,0,0,0,11,18100,1,0,0,0,0,1,0,0,0,0,0,0,0,'On aggro - Frost Armor'), +(30829,0,4,0,0,0,100,0,2000,6000,4000,8000,11,15242,1,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Cast Fireball'), +(30829,0,5,0,0,0,100,0,15000,20000,15000,20000,11,15244,0,0,0,0,0,0,0,0,0,0,0,0,0,'Combat - Cast Cone of Cold'), +(30829,0,6,0,0,0,100,0,25000,26000,25000,26000,11,15122,1,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Cast Counterspell'), +(30829,0,7,0,6,0,100,0,0,0,0,0,78,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Reset script on death'), +(30829,0,8,0,25,0,100,0,0,0,0,0,28,18100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Remove buff on respawn'); +-- Add SAI for Munch + weapon +UPDATE `creature_template` SET `faction_A`=290,`faction_H`=290, `equipment_id`=30840 WHERE`entry`=30840; +DELETE FROM `creature_equip_template` WHERE `entry`=30840; +INSERT INTO `creature_equip_template` VALUES +(30840,44948,0,0); +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=30840; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=30840; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(30840,0,1,0,4,0,100,1,0,0,0,0,12,30850,3,2000,0,0,0,1,0,0,0,0,0,0,0,'Summons portal'), +(30840,0,2,0,4,0,100,1,0,0,0,0,1,1,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Welcome text'), +(30840,0,3,0,4,0,100,1,0,0,0,0,1,2,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Welcome text 2'), +(30840,0,4,0,4,0,100,1,0,0,0,0,12,30851,4,1000,0,0,0,1,0,0,0,0,0,0,0,'Summons Melt'), +(30840,0,5,0,0,0,100,0,4000,6000,19000,20000,11,52372,2,0,0,0,0,0,0,0,0,0,0,0,0,'Combat Use - Icy Touch'), +(30840,0,6,0,0,0,100,0,4000,8000,10000,11000,11,52373,2,0,0,0,0,0,0,0,0,0,0,0,0,'Combat Use - Plague Strike'), +(30840,0,7,0,0,0,100,0,4000,7000,2000,3000,11,52374,0,0,0,0,0,0,0,0,0,0,0,0,0,'Combat Use - Blood Strike'), +(30840,0,8,0,5,0,100,1,0,0,0,0,1,3,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Text 3'), +(30840,0,9,0,5,0,100,1,0,0,0,0,12,30850,2,40000,0,0,0,8,0,0,0,6831.7270020,585.404990,427.168011,0.8,'On out of combat opens portal'); +-- Munch's Texts +DELETE FROM `creature_text` WHERE `entry`=30840; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(30840,1,1,'Say hello to my little friend!',12,0,100,0,0,0,'Munch arrival'), +(30840,2,2,'Arise Melt!',12,0,100,0,0,0,'Summon Melts'), +(30840,3,3,'We are done here. I am out.',12,0,100,0,0,0,'Munch oppening portal'); +-- Switch Melts into helping faction +UPDATE `creature_template` SET `faction_A`=290, `faction_H`=290 WHERE `entry`=30851; +-- 2/3 +-- High Priest Yath'amon SAI +UPDATE `creature_template` SET `faction_A`=2068, `faction_H`=2068, `mindmg`=240, `maxdmg`=300,`mechanic_immune_mask`=10685, `scale`=1.2 WHERE `entry`=30831; -- Mana_mod /WDB/ should be exactly 40, if want insert it +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=30831; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=30831; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(30831,0,1,0,8,0,100,1,57906,0,0,0,12,30839,4,5000,0,0,0,1,0,0,0,0,0,0,0,'Summons Jayde on hit by horn'), +(30831,0,2,0,8,0,100,1,57906,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'On spellhit set aggro'), +(30831,0,3,0,0,0,100,0,2000,3000,6000,8000,11,61705,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Venomous Bite'), -- the spell only targets players as it should +(30831,0,4,0,0,0,100,0,2000,7000,10000,20000,11,4962,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Encasing Webs'), +(30831,0,5,0,0,0,100,0,2000,7000,8000,20000,11,38243,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Mind flay Webs'), +(30831,0,6,0,0,0,100,0,10000,15000,30000,35000,11,34322,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Psychic Scream'), +(30831,0,7,0,6,0,100,0,0,0,0,0,78,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Reset script on death'); +-- Add SAI for Jayde + weapon +UPDATE `creature_template` SET `faction_A`=290,`faction_H`=290, `mechanic_immune_mask`=20, `equipment_id`=30839,`scale`=1 WHERE `entry`=30839; +DELETE FROM `creature_equip_template` WHERE `entry`=30839; +INSERT INTO `creature_equip_template` VALUES +(30839,44926,0,0); +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=30839; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=30839; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(30839,0,1,0,4,0,100,1,0,0,0,0,12,30852,3,2000,0,0,0,1,0,0,0,0,0,0,0,'Summons portal'), +(30839,0,2,0,4,0,100,1,0,0,0,0,1,1,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Welcome text'), +(30839,0,3,0,0,0,100,0,4000,6000,19000,20000,11,52372,2,0,0,0,0,0,0,0,0,0,0,0,0,'Combat Use - Icy Touch'), +(30839,0,4,0,0,0,100,0,4000,8000,10500,11000,11,52373,2,0,0,0,0,0,0,0,0,0,0,0,0,'Combat Use - Plague Strike'), +(30839,0,5,0,0,0,100,0,4000,7000,2000,2500,11,52374,0,0,0,0,0,0,0,0,0,0,0,0,0,'Combat Use - Blood Strike'), +(30839,0,6,0,5,0,100,1,0,0,0,0,1,2,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Text 2'), +(30839,0,7,0,5,0,100,1,0,0,0,0,12,30852,2,40000,0,0,0,8,0,0,0,6865.674316,414.657349,472.700226,1.185621,'On out of combat opens portal'); +-- Jayde Texts +DELETE FROM `creature_text` WHERE `entry`=30839; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(30839,1,1,'Too weak to finish your own battles? Very well then...',12,0,100,0,0,0,'Jayde arrival'), +(30839,2,2,'Anything else you need help with before I go? Right, I thought not...',12,0,100,0,0,0,'Oppens portal and dissapears'); +-- 3/3 +-- Underking Talonox SAI +UPDATE `creature_template` SET `exp`=2,`faction_A`=2068,`faction_H`=2068,`InhabitType`=1,`mindmg`=320, `maxdmg`=330, `minlevel`=79, `maxlevel`=79, `mechanic_immune_mask`=10685 WHERE `entry`=30830; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=30830; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=30830; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(30830,0,1,0,8,0,100,1,57906,0,0,0,12,30838,4,5000,0,0,0,1,0,0,0,0,0,0,0,'Summons Mograine on hit by horn'), +(30830,0,2,0,8,0,100,1,57906,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'On spellhit set aggro'), +(30830,0,3,0,0,0,100,0,1000,2000,2000,7000,11,60802,1,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Mandible Crush'), +(30830,0,4,0,0,0,100,0,1500,2000,10000,15000,11,50283,0,0,0,0,0,0,0,2,0,0,0,0,0,'Combat - Blinding Swarm'), +(30830,0,5,0,6,0,100,0,0,0,0,0,78,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Reset script on death'); +-- Add SAI for Mograine + weapon +UPDATE `creature_template` SET `health_mod`=2401.3,`mana_mod`=1599.9,`unit_class`=2,`flags_extra`=131072, `faction_A`=290,`faction_H`=290, `minlevel`=83, `maxlevel`=83, `mindmg`=340, `maxdmg`=420, `equipment_id`=30838 WHERE`entry`=30838; +DELETE FROM `creature_equip_template` WHERE `entry`=30838; +INSERT INTO `creature_equip_template` VALUES +(30838,39344,39344,0); +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=30838; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=30838; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(30838,0,1,0,4,0,100,1,0,0,0,0,12,30850,3,2000,0,0,0,1,0,0,0,0,0,0,0,'Summons portal'), +(30838,0,2,0,4,0,100,1,0,0,0,0,1,1,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Welcome text'), +(30838,0,3,0,0,0,100,0,4000,6000,19000,20000,11,52372,2,0,0,0,0,0,0,0,0,0,0,0,0,'Combat Use - Icy Touch'), +(30838,0,4,0,0,0,100,0,4000,8000,10000,11000,11,52373,2,0,0,0,0,0,0,0,0,0,0,0,0,'Combat Use - Plague Strike'), +(30838,0,5,0,0,0,100,0,4000,7000,5000,5000,11,49020,0,0,0,0,0,0,0,0,0,0,0,0,0,'Combat Use - Obliterete'), +(30838,0,6,0,5,0,100,1,0,0,0,0,1,2,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Text 2'), +(30838,0,7,0,5,0,100,1,0,0,0,0,12,30841,2,40000,0,0,0,8,0,0,0,7190.895508,633.476440,488.506317,1.014229,'On out of combat opens portal'); +-- Mograine Texts +DELETE FROM `creature_text` WHERE `entry`=30838; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(30838,1,1,'You challenge death itself! Come then, "King." Face the might of Mograine!',12,0,100,0,0,0,'Mograine"s arrival'), +(30838,2,1,'I will see you back at the Valley of Echoes. Suffer well, ally.',12,0,100,0,0,0,'Opens portal'); +-- Underking pathing for phase 2 +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7169.797363,`position_y`=664.115479,`position_z`=492.375793, `orientation`=1.129528 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7169.797363,664.115479,490.875793,0,0,0,100,0), +(@PATH,2,7196.977051,627.252869,488.591461,0,0,0,100,0), +(@PATH,3,7231.509277,640.110535,484.103490,0,0,0,100,0), +(@PATH,4,7207.646484,677.654114,491.592255,0,0,0,100,0); +-- Underking pathing for phase 128 +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7169.797363,`position_y`=664.115479,`position_z`=492.375793, `orientation`=1.129528 WHERE `guid`=@NPC+1; +DELETE FROM `creature_addon` WHERE `guid`=@NPC+1; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC+1,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7169.797363,664.115479,490.875793,0,0,0,100,0), +(@PATH,2,7196.977051,627.252869,488.591461,0,0,0,100,0), +(@PATH,3,7231.509277,640.110535,484.103490,0,0,0,100,0), +(@PATH,4,7207.646484,677.654114,491.592255,0,0,0,100,0); +-- 0/0 Thanks to Nay for helping with Gate's data. +-- Add missing data for the teleport spell +DELETE FROM `spell_target_position` WHERE `id`=57897; -- there was none, but just in case +INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES +(57897,571,6383.445801,229.091522,397.031127,1.660376); +-- Add info for Munch's Death Gate spell click +UPDATE `creature_template` SET `unit_flags`=567296,`exp`=2,`speed_run`=1,`minlevel`=80, `maxlevel`=80,`AIName`="SmartAI",`npcflag`=16777216 WHERE `entry`=30850; +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=30850; +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`,`user_type`) VALUES +(30850,57897,2,1); +-- Addon data for creature 30850 (Death Gate (Munch)) +DELETE FROM `creature_template_addon` WHERE `entry`=30850; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(30850,0,0,1,0, NULL); -- Death Gate (Munch) +-- Add info for Jayde's Death Gate spell click +UPDATE `creature_template` SET `exp`=2,`speed_run`=1,`unit_flags`=567296,`minlevel`=80, `maxlevel`=80,`unit_flags`=567296, `speed_run`=1,`AIName`="SmartAI",`npcflag`=16777216 WHERE `entry`=30852; +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=30852; +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`,`user_type`) VALUES +(30852,57897,2,1); +-- Model data 27346 (creature 30852 (Death Gate (Jayde))) +UPDATE `creature_model_info` SET `bounding_radius`=1.35,`combat_reach`=1.35,`gender`=2 WHERE `modelid`=27346; -- Death Gate (Jayde) +-- Addon data for creature 30852 (Death Gate (Jayde)) +DELETE FROM `creature_template_addon` WHERE `entry`=30852; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(30852,0,0,1,0, NULL); -- Death Gate (Jayde) +-- Add info for Mograine's Death Gate spell click +UPDATE `creature_template` SET `unit_flags`=567296,`exp`=2,`speed_run`=1,`minlevel`=80, `maxlevel`=80,`AIName`="SmartAI",`npcflag`=16777216 WHERE `entry`=30841; +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=30841; +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`,`user_type`) VALUES +(30841,57897,2,1); +-- Addon data for creature 30841 (Death Gate (Mograine)) +DELETE FROM `creature_template_addon` WHERE `entry`=30841; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(30841,0,0,1,0, NULL); -- Death Gate (Mograine) +-- Set SAI for Forgotten Depths Priest - ID: 30203 +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 30203; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=30203; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(30203,0,1,0,0,0,100,0,2000,7000,10000,15000,11,4962,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Encasing Webs'), +(30203,0,2,0,0,0,100,0,2000,7000,6000,12000,11,32000,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Mind flay Webs'); +-- Set SAI for Forgotten Depths Priest - ID: 30543 +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 30543; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=30543; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(30543,0,1,0,0,0,100,0,2000,7000,10000,15000,11,4962,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Encasing Webs'), +(30543,0,2,0,0,0,100,0,2000,7000,6000,12000,11,32000,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Mind flay Webs'); +-- Set SAI for Forgotten Depths Priest - ID: 31037 +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 31037; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=31037; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(31037,0,1,0,0,0,100,0,2000,7000,10000,15000,11,4962,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Encasing Webs'), +(31037,0,2,0,0,0,100,0,2000,7000,6000,12000,11,32000,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Mind flay Webs'); From 798fc2df4016c29441af6666a1b446c57cf81a68 Mon Sep 17 00:00:00 2001 From: Kinzcool Date: Mon, 2 Jul 2012 15:38:02 +0100 Subject: [PATCH 1137/1149] DB/NPC: Add various missing gossips Closes #7001 Signed-off-by: Nay --- .../world/2012_07_02_03_world_gossip.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 sql/updates/world/2012_07_02_03_world_gossip.sql diff --git a/sql/updates/world/2012_07_02_03_world_gossip.sql b/sql/updates/world/2012_07_02_03_world_gossip.sql new file mode 100644 index 00000000000..0c158aa7511 --- /dev/null +++ b/sql/updates/world/2012_07_02_03_world_gossip.sql @@ -0,0 +1,17 @@ +UPDATE `creature_template` SET `gossip_menu_id`=8074 WHERE `entry`=19466; -- Exarch Orelis +UPDATE `creature_template` SET `gossip_menu_id`=8216 WHERE `entry`=20920; -- Magister Theledorn +UPDATE `creature_template` SET `gossip_menu_id`=8661 WHERE `entry`=21112; -- Bossi Pentapiston + +DELETE FROM `gossip_menu` WHERE (`entry`=8074 AND `text_id`=9980) OR +(`entry`=8216 AND `text_id`=10211) OR +(`entry`=8304 AND `text_id`=10360) OR +(`entry`=8370 AND `text_id`=10444) OR +(`entry`=8385 AND `text_id`=10466) OR +(`entry`=8661 AND `text_id`=10889); +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES +(8074, 9980), -- 19466 +(8216, 10211), -- 20920 +(8304, 10360), -- 21461 +(8370, 10444), -- 21755 +(8385, 10466), -- 21824 +(8661, 10889); -- 21112 From 93cec76cdbeac769dfd51026a3e6bfc9640303c8 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 2 Jul 2012 11:33:12 -0400 Subject: [PATCH 1138/1149] Core/Spells: small change for previous commit. fixes typos --- src/server/game/Entities/Unit/Unit.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 157b60e2d99..83d7865f34b 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10683,7 +10683,7 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui for (AuraEffectList::const_iterator i = IgnoreResistAuras.begin(); i != IgnoreResistAuras.end(); ++i) { if ((*i)->GetMiscValue() & spellProto->GetSchoolMask()) - TakenTotalCasterMod += ((*i)->GetBaseAmount()/100); + TakenTotalCasterMod += (float((*i)->GetAmount())/100); } // from positive and negative SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN @@ -10754,13 +10754,14 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui if (TakenTotalCasterMod) { if (TakenTotal < 0) + { if (TakenTotalMod < 1) tmpDamage = ((float(CalculatePctF(pdamage, TakenTotalCasterMod) + TakenTotal) * TakenTotalMod) + CalculatePctF(pdamage, TakenTotalCasterMod)); else tmpDamage = ((float(CalculatePctF(pdamage, TakenTotalCasterMod) + TakenTotal) + CalculatePctF(pdamage, TakenTotalCasterMod)) * TakenTotalMod); - else - if (TakenTotalMod < 1) - tmpDamage = ((CalculatePctF(float(pdamage) + TakenTotal, TakenTotalCasterMod) * TakenTotalMod) + CalculatePctF(float(pdamage) + TakenTotal, TakenTotalCasterMod)); + } + else if (TakenTotalMod < 1) + tmpDamage = ((CalculatePctF(float(pdamage) + TakenTotal, TakenTotalCasterMod) * TakenTotalMod) + CalculatePctF(float(pdamage) + TakenTotal, TakenTotalCasterMod)); } if (!tmpDamage) tmpDamage = (float(pdamage) + TakenTotal) * TakenTotalMod; @@ -11722,7 +11723,7 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackT for (AuraEffectList::const_iterator i = IgnoreResistAuras.begin(); i != IgnoreResistAuras.end(); ++i) { if ((*i)->GetMiscValue() & spellProto->GetSchoolMask()) - TakenTotalCasterMod += ((*i)->GetBaseAmount()/100); + TakenTotalCasterMod += (float((*i)->GetAmount())/100); } // ..taken @@ -11813,13 +11814,14 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackT if (TakenTotalCasterMod) { if (TakenFlatBenefit < 0) + { if (TakenTotalMod < 1) tmpDamage = ((float(CalculatePctF(pdamage, TakenTotalCasterMod) + TakenFlatBenefit) * TakenTotalMod) + CalculatePctF(pdamage, TakenTotalCasterMod)); else tmpDamage = ((float(CalculatePctF(pdamage, TakenTotalCasterMod) + TakenFlatBenefit) + CalculatePctF(pdamage, TakenTotalCasterMod)) * TakenTotalMod); - else - if (TakenTotalMod < 1) - tmpDamage = ((CalculatePctF(float(pdamage) + TakenFlatBenefit, TakenTotalCasterMod) * TakenTotalMod) + CalculatePctF(float(pdamage) + TakenFlatBenefit, TakenTotalCasterMod)); + } + else if (TakenTotalMod < 1) + tmpDamage = ((CalculatePctF(float(pdamage) + TakenFlatBenefit, TakenTotalCasterMod) * TakenTotalMod) + CalculatePctF(float(pdamage) + TakenFlatBenefit, TakenTotalCasterMod)); } if (!tmpDamage) tmpDamage = (float(pdamage) + TakenFlatBenefit) * TakenTotalMod; From f454b6722ca0d4be7c8a35730aa325d9404f0b72 Mon Sep 17 00:00:00 2001 From: Discover- Date: Mon, 2 Jul 2012 17:33:17 +0200 Subject: [PATCH 1139/1149] Core/Battlegrounds: Don't reward killing blows if the killer is also the victim. Reason could be stuff like warlock's Hellfire spell or fall damage. --- src/server/game/Battlegrounds/Battleground.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 85bbd2f3b89..8b072bb32e4 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1769,12 +1769,16 @@ void Battleground::HandleTriggerBuff(uint64 go_guid) SpawnBGObject(index, BUFF_RESPAWN_TIME); } -void Battleground::HandleKillPlayer(Player* player, Player* killer) +void Battleground::HandleKillPlayer(Player* victim, Player* killer) { // Keep in mind that for arena this will have to be changed a bit + // Don't reward credit for killing ourselves, like fall damage of hellfire (warlock) + if (victim && killer && killer == victim) + return; + // Add +1 deaths - UpdatePlayerScore(player, SCORE_DEATHS, 1); + UpdatePlayerScore(victim, SCORE_DEATHS, 1); // Add +1 kills to group and +1 killing_blows to killer if (killer) { @@ -1787,7 +1791,7 @@ void Battleground::HandleKillPlayer(Player* player, Player* killer) if (!creditedPlayer || creditedPlayer == killer) continue; - if (creditedPlayer->GetTeam() == killer->GetTeam() && creditedPlayer->IsAtGroupRewardDistance(player)) + if (creditedPlayer->GetTeam() == killer->GetTeam() && creditedPlayer->IsAtGroupRewardDistance(victim)) UpdatePlayerScore(creditedPlayer, SCORE_HONORABLE_KILLS, 1); } } @@ -1795,8 +1799,8 @@ void Battleground::HandleKillPlayer(Player* player, Player* killer) if (!isArena()) { // To be able to remove insignia -- ONLY IN Battlegrounds - player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); - RewardXPAtKill(killer, player); + victim->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); + RewardXPAtKill(killer, victim); } } From a73ad7170ea573bdc8b0cb29d33a4a0f2323dfdc Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 2 Jul 2012 11:42:11 -0400 Subject: [PATCH 1140/1149] Core/Battleground: move check from f454b6722ca0d4be7c8a35730aa325d9404f0b72 to correct location. --- src/server/game/Battlegrounds/Battleground.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 8b072bb32e4..456915d1ca4 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1773,15 +1773,15 @@ void Battleground::HandleKillPlayer(Player* victim, Player* killer) { // Keep in mind that for arena this will have to be changed a bit - // Don't reward credit for killing ourselves, like fall damage of hellfire (warlock) - if (victim && killer && killer == victim) - return; - // Add +1 deaths UpdatePlayerScore(victim, SCORE_DEATHS, 1); // Add +1 kills to group and +1 killing_blows to killer if (killer) { + // Don't reward credit for killing ourselves, like fall damage of hellfire (warlock) + if (killer == victim) + return; + UpdatePlayerScore(killer, SCORE_HONORABLE_KILLS, 1); UpdatePlayerScore(killer, SCORE_KILLING_BLOWS, 1); From 72fd2036881db11e47f1a4ce6d071dc7f2bb9971 Mon Sep 17 00:00:00 2001 From: LordJZ Date: Mon, 2 Jul 2012 20:35:28 +0400 Subject: [PATCH 1141/1149] Fixed CHAR_SEL_PETITION_SIG_BY_GUID_TYPE. --- src/server/game/Entities/Player/Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 33a138a5fbd..c38ceb6f57a 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -20560,7 +20560,7 @@ void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type) else { stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIG_BY_GUID_TYPE); - stmt->setUInt8(0, uint8(type)); + stmt->setUInt8(1, uint8(type)); } stmt->setUInt32(0, GUID_LOPART(guid)); From c49bc934b820c0e634f0231158ec444275f6fa3e Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 2 Jul 2012 15:00:16 -0400 Subject: [PATCH 1142/1149] Core/Spells: correctly get magnet target. (subv fixed it) Closes #6674 --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 83d7865f34b..fc1e4398e17 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10034,7 +10034,7 @@ Unit* Unit::GetMagicHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo) Unit::AuraEffectList const& magnetAuras = victim->GetAuraEffectsByType(SPELL_AURA_SPELL_MAGNET); for (Unit::AuraEffectList::const_iterator itr = magnetAuras.begin(); itr != magnetAuras.end(); ++itr) { - if (Unit* magnet = (*itr)->GetBase()->GetUnitOwner()) + if (Unit* magnet = (*itr)->GetBase()->GetCaster()) if (spellInfo->CheckExplicitTarget(this, magnet) == SPELL_CAST_OK && spellInfo->CheckTarget(this, magnet, false) == SPELL_CAST_OK && _IsValidAttackTarget(magnet, spellInfo) From 1292b732f7dba2d189cf4b447d219c9bedf9448c Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 2 Jul 2012 16:41:25 -0500 Subject: [PATCH 1143/1149] Core/Spells: Fixed Evasive Maneuvers and Stop Time, spells from the Oculus drakes. Closes #6670 Closes #6675 --- ...2012_07_02_04_world_spell_script_names.sql | 3 ++ src/server/game/Entities/Unit/Unit.cpp | 8 +++++ src/server/game/Spells/SpellInfo.cpp | 1 + .../scripts/Northrend/Nexus/Oculus/oculus.cpp | 36 ++++++++++++++++++- 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_07_02_04_world_spell_script_names.sql diff --git a/sql/updates/world/2012_07_02_04_world_spell_script_names.sql b/sql/updates/world/2012_07_02_04_world_spell_script_names.sql new file mode 100644 index 00000000000..9054ea7ba82 --- /dev/null +++ b/sql/updates/world/2012_07_02_04_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=49838; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(49838, "spell_gen_stop_time"); \ No newline at end of file diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index fc1e4398e17..2ab730d7f66 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -8205,6 +8205,14 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg CastSpell(victim, 27526, true, castItem, triggeredByAura); return true; } + // Evasive Maneuvers + case 50240: + { + // Remove a Evasive Charge + Aura* charge = GetAura(50241); + if (charge->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL)) + RemoveAurasDueToSpell(50240); + } } break; case SPELLFAMILY_MAGE: diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 7995087f2c1..16584086245 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1736,6 +1736,7 @@ AuraStateType SpellInfo::GetAuraState() const switch (Id) { case 71465: // Divine Surge + case 50241: // Evasive Charges return AURA_STATE_UNKNOWN22; default: break; diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index 23f55a3033b..d15b3b566bc 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -47,7 +47,9 @@ enum Drakes NPC_VERDISA = 27657, NPC_BELGARISTRASZ = 27658, - NPC_ETERNOS = 27659 + NPC_ETERNOS = 27659, + + SPELL_SHOCK_CHARGE = 49836, }; enum Says @@ -210,8 +212,40 @@ public: } }; +class spell_gen_stop_time : public SpellScriptLoader +{ +public: + spell_gen_stop_time() : SpellScriptLoader("spell_gen_stop_time") { } + + class spell_gen_stop_time_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_stop_time_AuraScript); + + void Apply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* caster = GetCaster(); + if (!caster) + return; + Unit* target = GetTarget(); + for (uint32 i = 0; i < 5; ++i) + caster->CastSpell(target, SPELL_SHOCK_CHARGE, false); + } + + void Register() + { + AfterEffectApply += AuraEffectApplyFn(spell_gen_stop_time_AuraScript::Apply, EFFECT_0); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_gen_stop_time_AuraScript(); + } +}; + void AddSC_oculus() { new npc_oculus_drake(); new npc_image_belgaristrasz(); + new spell_gen_stop_time(); } From 94d935ea8f56102ff74aa7cfc3d5da37e83efa15 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 2 Jul 2012 16:58:02 -0500 Subject: [PATCH 1144/1149] Fixed build --- src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index d15b3b566bc..0eafd7a7fea 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -233,7 +233,7 @@ public: void Register() { - AfterEffectApply += AuraEffectApplyFn(spell_gen_stop_time_AuraScript::Apply, EFFECT_0); + AfterEffectApply += AuraEffectApplyFn(spell_gen_stop_time_AuraScript::Apply, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL); } }; From d28f348caf3b879d8f8dcc7d7ea01e5e893ffada Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 2 Jul 2012 18:53:14 -0500 Subject: [PATCH 1145/1149] Core/Spells: Removed some old code that was breaking Grounding Totem. Please report feedback --- src/server/game/Entities/Unit/Unit.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 2ab730d7f66..e17de57f797 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -804,11 +804,6 @@ void Unit::CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo return; } - // TODO: this is a workaround and needs removal - if (!originalCaster && GetTypeId() == TYPEID_UNIT && ToCreature()->isTotem() && IsControlledByPlayer()) - if (Unit* owner = GetOwner()) - originalCaster=owner->GetGUID(); - // TODO: this is a workaround - not needed anymore, but required for some scripts :( if (!originalCaster && triggeredByAura) originalCaster = triggeredByAura->GetCasterGUID(); From 96014a70cba0d333d7e76cc90cf36468a8b3b247 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 3 Jul 2012 11:45:19 +0200 Subject: [PATCH 1146/1149] Core/Units: Fixed crash added in 7f960fed732f119b6776bc51a4465e8e7a1a10dd --- src/server/game/Entities/Unit/Unit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index e17de57f797..92f2f30b0ff 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11722,10 +11722,11 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackT float TakenTotalCasterMod = 0.0f; // get all auras from caster that allow the spell to ignore resistance (sanctified wrath) + SpellSchoolMask attackSchoolMask = spellProto ? spellProto->GetSchoolMask() : SPELL_SCHOOL_MASK_NORMAL; AuraEffectList const& IgnoreResistAuras = attacker->GetAuraEffectsByType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST); for (AuraEffectList::const_iterator i = IgnoreResistAuras.begin(); i != IgnoreResistAuras.end(); ++i) { - if ((*i)->GetMiscValue() & spellProto->GetSchoolMask()) + if ((*i)->GetMiscValue() & attackSchoolMask) TakenTotalCasterMod += (float((*i)->GetAmount())/100); } From 537caf33e9ee8d88b1c4f4835ee93ee0dd557d2a Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 3 Jul 2012 12:35:06 +0200 Subject: [PATCH 1147/1149] Core/SpellScript: Implemented OnObjectTargetSelect hook for use with spell target that selects a single object --- src/server/game/Spells/Spell.cpp | 115 +++++++++++++++++-------- src/server/game/Spells/Spell.h | 1 + src/server/game/Spells/SpellScript.cpp | 15 ++++ src/server/game/Spells/SpellScript.h | 18 ++++ 4 files changed, 115 insertions(+), 34 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 2c1cff0c74a..590f880a931 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -914,17 +914,25 @@ void Spell::SelectImplicitChannelTargets(SpellEffIndex effIndex, SpellImplicitTa switch (targetType.GetTarget()) { case TARGET_UNIT_CHANNEL_TARGET: + { + WorldObject* target = ObjectAccessor::GetUnit(*m_caster, channeledSpell->m_targets.GetUnitTargetGUID()); + CallScriptObjectTargetSelectHandlers(target, effIndex); // unit target may be no longer avalible - teleported out of map for example - if (Unit* target = Unit::GetUnit(*m_caster, channeledSpell->m_targets.GetUnitTargetGUID())) - AddUnitTarget(target, 1 << effIndex); + if (target && target->ToUnit()) + AddUnitTarget(target->ToUnit(), 1 << effIndex); else sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: cannot find channel spell target for spell ID %u, effect %u", m_spellInfo->Id, effIndex); break; + } case TARGET_DEST_CHANNEL_TARGET: if (channeledSpell->m_targets.HasDst()) m_targets.SetDst(channeledSpell->m_targets); else if (WorldObject* target = ObjectAccessor::GetWorldObject(*m_caster, channeledSpell->m_targets.GetObjectTargetGUID())) - m_targets.SetDst(*target); + { + CallScriptObjectTargetSelectHandlers(target, effIndex); + if (target) + m_targets.SetDst(*target); + } else sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: cannot find channel spell destination for spell ID %u, effect %u", m_spellInfo->Id, effIndex); break; @@ -1002,6 +1010,8 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar return; } + CallScriptObjectTargetSelectHandlers(target, effIndex); + switch (targetType.GetObjectType()) { case TARGET_OBJECT_TYPE_UNIT: @@ -1492,27 +1502,27 @@ void Spell::SelectImplicitDestDestTargets(SpellEffIndex effIndex, SpellImplicitT void Spell::SelectImplicitCasterObjectTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType) { + WorldObject* target = NULL; + bool checkIfValid = true; + switch (targetType.GetTarget()) { case TARGET_UNIT_CASTER: - AddUnitTarget(m_caster, 1 << effIndex, false); + target = m_caster; + checkIfValid = false; break; case TARGET_UNIT_MASTER: - if (Unit* owner = m_caster->GetCharmerOrOwner()) - AddUnitTarget(owner, 1 << effIndex); + target = m_caster->GetCharmerOrOwner(); break; case TARGET_UNIT_PET: - if (Guardian* pet = m_caster->GetGuardianPet()) - AddUnitTarget(pet, 1 << effIndex); + target = m_caster->GetGuardianPet(); break; case TARGET_UNIT_SUMMONER: if (m_caster->isSummon()) - if (Unit* unit = m_caster->ToTempSummon()->GetSummoner()) - AddUnitTarget(unit, 1 << effIndex); + target = m_caster->ToTempSummon()->GetSummoner(); break; case TARGET_UNIT_VEHICLE: - if (Unit *vehicle = m_caster->GetVehicleBase()) - AddUnitTarget(vehicle, 1 << effIndex); + target = m_caster->GetVehicleBase(); break; case TARGET_UNIT_PASSENGER_0: case TARGET_UNIT_PASSENGER_1: @@ -1523,26 +1533,38 @@ void Spell::SelectImplicitCasterObjectTargets(SpellEffIndex effIndex, SpellImpli case TARGET_UNIT_PASSENGER_6: case TARGET_UNIT_PASSENGER_7: if (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->IsVehicle()) - if (Unit *unit = m_caster->GetVehicleKit()->GetPassenger(targetType.GetTarget() - TARGET_UNIT_PASSENGER_0)) - AddUnitTarget(unit, 1 << effIndex); + target = m_caster->GetVehicleKit()->GetPassenger(targetType.GetTarget() - TARGET_UNIT_PASSENGER_0); break; default: break; } + + CallScriptObjectTargetSelectHandlers(target, effIndex); + + if (target && target->ToUnit()) + AddUnitTarget(target->ToUnit(), 1 << effIndex, checkIfValid); } void Spell::SelectImplicitTargetObjectTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType) { ASSERT((m_targets.GetObjectTarget() || m_targets.GetItemTarget()) && "Spell::SelectImplicitTargetObjectTargets - no explicit object or item target available!"); - if (Unit* unit = m_targets.GetUnitTarget()) - AddUnitTarget(unit, 1 << effIndex, true, false); - else if (GameObject* gobj = m_targets.GetGOTarget()) - AddGOTarget(gobj, 1 << effIndex); - else - AddItemTarget(m_targets.GetItemTarget(), 1 << effIndex); - if (WorldObject* target = m_targets.GetObjectTarget()) + WorldObject* target = m_targets.GetObjectTarget(); + + CallScriptObjectTargetSelectHandlers(target, effIndex); + + if (target) + { + if (Unit* unit = target->ToUnit()) + AddUnitTarget(unit, 1 << effIndex, true, false); + else if (GameObject* gobj = target->ToGameObject()) + AddGOTarget(gobj, 1 << effIndex); + SelectImplicitChainTargets(effIndex, targetType, target, 1 << effIndex); + } + // Script hook can remove object target and we would wrongly land here + else if (Item* item = m_targets.GetItemTarget()) + AddItemTarget(item, 1 << effIndex); } void Spell::SelectImplicitChainTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, WorldObject* target, uint32 effMask) @@ -1734,9 +1756,12 @@ void Spell::SelectEffectTypeImplicitTargets(uint8 effIndex) case SPELL_EFFECT_SUMMON_PLAYER: if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->GetSelection()) { - Player* target = ObjectAccessor::FindPlayer(m_caster->ToPlayer()->GetSelection()); - if (target) - AddUnitTarget(target, 1 << effIndex, false); + WorldObject* target = ObjectAccessor::FindPlayer(m_caster->ToPlayer()->GetSelection()); + + CallScriptObjectTargetSelectHandlers(target, SpellEffIndex(effIndex)); + + if (target && target->ToPlayer()) + AddUnitTarget(target->ToUnit(), 1 << effIndex, false); } return; default: @@ -1752,6 +1777,8 @@ void Spell::SelectEffectTypeImplicitTargets(uint8 effIndex) if (!targetMask) return; + WorldObject* target = NULL; + switch (m_spellInfo->Effects[effIndex].GetImplicitTargetType()) { // add explicit object target or self to the target map @@ -1760,40 +1787,46 @@ void Spell::SelectEffectTypeImplicitTargets(uint8 effIndex) if (targetMask & (TARGET_FLAG_UNIT_MASK | TARGET_FLAG_CORPSE_MASK)) { if (Unit* unitTarget = m_targets.GetUnitTarget()) - AddUnitTarget(unitTarget, 1 << effIndex, false); + target = unitTarget; else if (targetMask & TARGET_FLAG_CORPSE_MASK) { if (Corpse* corpseTarget = m_targets.GetCorpseTarget()) { // TODO: this is a workaround - corpses should be added to spell target map too, but we can't do that so we add owner instead if (Player* owner = ObjectAccessor::FindPlayer(corpseTarget->GetOwnerGUID())) - AddUnitTarget(owner, 1 << effIndex, false); + target = owner; } } else //if (targetMask & TARGET_FLAG_UNIT_MASK) - { - AddUnitTarget(m_caster, 1 << effIndex, false); - } + target = m_caster; } if (targetMask & TARGET_FLAG_ITEM_MASK) { if (Item* itemTarget = m_targets.GetItemTarget()) AddItemTarget(itemTarget, 1 << effIndex); + return; } if (targetMask & TARGET_FLAG_GAMEOBJECT_MASK) - { - if (GameObject* gObjTarget = m_targets.GetGOTarget()) - AddGOTarget(gObjTarget, 1 << effIndex); - } + target = m_targets.GetGOTarget(); break; // add self to the target map case EFFECT_IMPLICIT_TARGET_CASTER: if (targetMask & TARGET_FLAG_UNIT_MASK) - AddUnitTarget(m_caster, 1 << effIndex, false); + target = m_caster; break; default: break; } + + CallScriptObjectTargetSelectHandlers(target, SpellEffIndex(effIndex)); + + if (target) + { + if (target->ToUnit()) + AddUnitTarget(target->ToUnit(), 1 << effIndex, false); + else if (target->ToGameObject()) + AddGOTarget(target->ToGameObject(), 1 << effIndex); + } } uint32 Spell::GetSearcherTypeMask(SpellTargetObjectTypes objType, ConditionList* condList) @@ -7053,6 +7086,20 @@ void Spell::CallScriptObjectAreaTargetSelectHandlers(std::list& ta } } +void Spell::CallScriptObjectTargetSelectHandlers(WorldObject*& target, SpellEffIndex effIndex) +{ + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) + { + (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_OBJECT_TARGET_SELECT); + std::list::iterator hookItrEnd = (*scritr)->OnObjectTargetSelect.end(), hookItr = (*scritr)->OnObjectTargetSelect.begin(); + for (; hookItr != hookItrEnd; ++hookItr) + if ((*hookItr).IsEffectAffected(m_spellInfo, effIndex)) + (*hookItr).Call(*scritr, target); + + (*scritr)->_FinishScriptCall(); + } +} + bool Spell::CanExecuteTriggersOnHit(uint8 effMask, SpellInfo const* triggeredByAura) const { bool only_on_caster = (triggeredByAura && (triggeredByAura->AttributesEx4 & SPELL_ATTR4_PROC_ONLY_ON_CASTER)); diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 98455904cf5..1376b0fbd40 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -631,6 +631,7 @@ class Spell void CallScriptOnHitHandlers(); void CallScriptAfterHitHandlers(); void CallScriptObjectAreaTargetSelectHandlers(std::list& targets, SpellEffIndex effIndex); + void CallScriptObjectTargetSelectHandlers(WorldObject*& target, SpellEffIndex effIndex); std::list m_loadedScripts; struct HitTriggerSpell diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index a19c356b9ed..d0ae6fe3098 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -267,6 +267,17 @@ void SpellScript::ObjectAreaTargetSelectHandler::Call(SpellScript* spellScript, (spellScript->*pObjectAreaTargetSelectHandlerScript)(targets); } +SpellScript::ObjectTargetSelectHandler::ObjectTargetSelectHandler(SpellObjectTargetSelectFnType _pObjectTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType) + : TargetHook(_effIndex, _targetType, false) +{ + pObjectTargetSelectHandlerScript = _pObjectTargetSelectHandlerScript; +} + +void SpellScript::ObjectTargetSelectHandler::Call(SpellScript* spellScript, WorldObject*& target) +{ + (spellScript->*pObjectTargetSelectHandlerScript)(target); +} + bool SpellScript::_Validate(SpellInfo const* entry) { for (std::list::iterator itr = OnEffectLaunch.begin(); itr != OnEffectLaunch.end(); ++itr) @@ -289,6 +300,10 @@ bool SpellScript::_Validate(SpellInfo const* entry) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnObjectAreaTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); + for (std::list::iterator itr = OnObjectTargetSelect.begin(); itr != OnObjectTargetSelect.end(); ++itr) + if (!(*itr).GetAffectedEffectsMask(entry)) + sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnObjectTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); + return _SpellScript::_Validate(entry); } diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index 51631bb8ffe..376e7f18edc 100755 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -132,6 +132,7 @@ enum SpellScriptHookType SPELL_SCRIPT_HOOK_HIT, SPELL_SCRIPT_HOOK_AFTER_HIT, SPELL_SCRIPT_HOOK_OBJECT_AREA_TARGET_SELECT, + SPELL_SCRIPT_HOOK_OBJECT_TARGET_SELECT, SPELL_SCRIPT_HOOK_CHECK_CAST, SPELL_SCRIPT_HOOK_BEFORE_CAST, SPELL_SCRIPT_HOOK_ON_CAST, @@ -155,6 +156,7 @@ class SpellScript : public _SpellScript typedef void(CLASSNAME::*SpellHitFnType)(); \ typedef void(CLASSNAME::*SpellCastFnType)(); \ typedef void(CLASSNAME::*SpellObjectAreaTargetSelectFnType)(std::list&); \ + typedef void(CLASSNAME::*SpellObjectTargetSelectFnType)(WorldObject*&); SPELLSCRIPT_FUNCTION_TYPE_DEFINES(SpellScript) @@ -216,12 +218,22 @@ class SpellScript : public _SpellScript SpellObjectAreaTargetSelectFnType pObjectAreaTargetSelectHandlerScript; }; + class ObjectTargetSelectHandler : public TargetHook + { + public: + ObjectTargetSelectHandler(SpellObjectTargetSelectFnType _pObjectTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType); + void Call(SpellScript* spellScript, WorldObject*& targets); + private: + SpellObjectTargetSelectFnType pObjectTargetSelectHandlerScript; + }; + #define SPELLSCRIPT_FUNCTION_CAST_DEFINES(CLASSNAME) \ class CastHandlerFunction : public SpellScript::CastHandler { public: CastHandlerFunction(SpellCastFnType _pCastHandlerScript) : SpellScript::CastHandler((SpellScript::SpellCastFnType)_pCastHandlerScript) {} }; \ class CheckCastHandlerFunction : public SpellScript::CheckCastHandler { public: CheckCastHandlerFunction(SpellCheckCastFnType _checkCastHandlerScript) : SpellScript::CheckCastHandler((SpellScript::SpellCheckCastFnType)_checkCastHandlerScript) {} }; \ class EffectHandlerFunction : public SpellScript::EffectHandler { public: EffectHandlerFunction(SpellEffectFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : SpellScript::EffectHandler((SpellScript::SpellEffectFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \ class HitHandlerFunction : public SpellScript::HitHandler { public: HitHandlerFunction(SpellHitFnType _pHitHandlerScript) : SpellScript::HitHandler((SpellScript::SpellHitFnType)_pHitHandlerScript) {} }; \ class ObjectAreaTargetSelectHandlerFunction : public SpellScript::ObjectAreaTargetSelectHandler { public: ObjectAreaTargetSelectHandlerFunction(SpellObjectAreaTargetSelectFnType _pObjectAreaTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType) : SpellScript::ObjectAreaTargetSelectHandler((SpellScript::SpellObjectAreaTargetSelectFnType)_pObjectAreaTargetSelectHandlerScript, _effIndex, _targetType) {} }; \ + class ObjectTargetSelectHandlerFunction : public SpellScript::ObjectTargetSelectHandler { public: ObjectTargetSelectHandlerFunction(SpellObjectTargetSelectFnType _pObjectTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType) : SpellScript::ObjectTargetSelectHandler((SpellScript::SpellObjectTargetSelectFnType)_pObjectTargetSelectHandlerScript, _effIndex, _targetType) {} }; #define PrepareSpellScript(CLASSNAME) SPELLSCRIPT_FUNCTION_TYPE_DEFINES(CLASSNAME) SPELLSCRIPT_FUNCTION_CAST_DEFINES(CLASSNAME) public: @@ -280,10 +292,16 @@ class SpellScript : public _SpellScript HookList OnObjectAreaTargetSelect; #define SpellObjectAreaTargetSelectFn(F, I, N) ObjectAreaTargetSelectHandlerFunction(&F, I, N) + // example: OnObjectTargetSelect += SpellObjectTargetSelectFn(class::function, EffectIndexSpecifier, TargetsNameSpecifier); + // where function is void function(WorldObject*& target) + HookList OnObjectTargetSelect; + #define SpellObjectTargetSelectFn(F, I, N) ObjectTargetSelectHandlerFunction(&F, I, N) + // hooks are executed in following order, at specified event of spell: // 1. BeforeCast - executed when spell preparation is finished (when cast bar becomes full) before cast is handled // 2. OnCheckCast - allows to override result of CheckCast function // 3a. OnObjectAreaTargetSelect - executed just before adding selected targets to final target list (for area targets) + // 3b. OnObjectTargetSelect - executed just before adding selected target to final target list (for single unit targets) // 4. OnCast - executed just before spell is launched (creates missile) or executed // 5. AfterCast - executed after spell missile is launched and immediate spell actions are done // 6. OnEffectLaunch - executed just before specified effect handler call - when spell missile is launched From 577d5b4fd1c74dd8619ccc0183579d43969a0f92 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 3 Jul 2012 16:22:14 +0200 Subject: [PATCH 1148/1149] Core/SmartScript: Corrected size of pointId parameter for MOVE_TO_POS SAI action --- src/server/game/AI/SmartScripts/SmartScriptMgr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 55e6a7fc446..cdb662edbaf 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -885,7 +885,7 @@ struct SmartAction struct { - uint8 pointId; + uint32 pointId; } MoveToPos; struct From 07e47b89eea849d0d583097c97c88c25e668a0cd Mon Sep 17 00:00:00 2001 From: AliveShiro Date: Wed, 4 Jul 2012 01:48:14 +0200 Subject: [PATCH 1149/1149] Fix Quest A Cleansing Song --- .../2012_07_04_world_spell_script_names.sql | 2 + src/server/scripts/Spells/spell_quest.cpp | 47 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 sql/updates/world/2012_07_04_world_spell_script_names.sql diff --git a/sql/updates/world/2012_07_04_world_spell_script_names.sql b/sql/updates/world/2012_07_04_world_spell_script_names.sql new file mode 100644 index 00000000000..9e157261409 --- /dev/null +++ b/sql/updates/world/2012_07_04_world_spell_script_names.sql @@ -0,0 +1,2 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (52941, -52941); +INSERT INTO `spell_script_names` VALUES (52941, 'spell_q12735_song_of_cleansing'); \ No newline at end of file diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 66ff06decc3..e3714a22304 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1194,6 +1194,52 @@ public: } }; +enum ACleansingSong +{ + SPELL_SUMMON_SPIRIT_ATAH = 52954, + SPELL_SUMMON_SPIRIT_HAKHALAN = 52958, + SPELL_SUMMON_SPIRIT_KOOSU = 52959, + + AREA_BITTERTIDELAKE = 4385, + AREA_RIVERSHEART = 4290, + AREA_WINTERGRASPRIVER = 4388, +}; + +class spell_q12735_song_of_cleansing : public SpellScriptLoader +{ + public: + spell_q12735_song_of_cleansing() : SpellScriptLoader("spell_q12735_song_of_cleansing") { } + + class spell_q12735_song_of_cleansing_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q12735_song_of_cleansing_SpellScript); + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + + if (caster && caster->GetAreaId() == AREA_BITTERTIDELAKE) + caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_ATAH); + + else if (caster && caster->GetAreaId() == AREA_RIVERSHEART) + caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_HAKHALAN); + + else if (caster && caster->GetAreaId() == AREA_WINTERGRASPRIVER) + caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_KOOSU); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_q12735_song_of_cleansing_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_q12735_song_of_cleansing_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -1222,4 +1268,5 @@ void AddSC_quest_spell_scripts() new spell_q12987_read_pronouncement(); new spell_q12277_wintergarde_mine_explosion(); new spell_q12066_bunny_kill_credit(); + new spell_q12735_song_of_cleansing(); }